@react-spring/core
Advanced tools
Comparing version 0.0.0-fb0ddfbbce1fd1b524534d96188b7bdb923c7bc7-20230227080834 to 0.0.0-nightly-f50b673-20230330070501
@@ -1,1 +0,1 @@ | ||
import{each as ge,useIsomorphicLayoutEffect as an}from"@react-spring/shared";import{is as K,toArray as $t,eachProp as dt,getFluidValue as Zt,isAnimatedString as en,Globals as tn}from"@react-spring/shared";function I(t,...e){return K.fun(t)?t(...e):t}var te=(t,e)=>t===!0||!!(e&&t&&(K.fun(t)?t(e):$t(t).includes(e))),et=(t,e)=>K.obj(t)?e&&t[e]:t;var ke=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,nn=t=>t,ne=(t,e=nn)=>{let n=rn;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));let r={};for(let o of n){let s=e(t[o],o);K.und(s)||(r[o]=s)}return r},rn=["config","onProps","onStart","onChange","onPause","onResume","onRest"],on={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function sn(t){let e={},n=0;if(dt(t,(r,o)=>{on[o]||(e[o]=r,n++)}),n)return e}function de(t){let e=sn(t);if(e){let n={to:e};return dt(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function me(t){return t=Zt(t),K.arr(t)?t.map(me):en(t)?tn.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function Ue(t){for(let e in t)return!0;return!1}function Ee(t){return K.fun(t)||K.arr(t)&&K.obj(t[0])}function xe(t,e){t.ref?.delete(t),e?.delete(t)}function he(t,e){e&&t.ref!==e&&(t.ref?.delete(t),e.add(t),t.ref=e)}function wr(t,e,n=1e3){an(()=>{if(e){let r=0;ge(t,(o,s)=>{let a=o.current;if(a.length){let i=n*e[s];isNaN(i)?i=r:r=i,ge(a,u=>{ge(u.queue,p=>{let f=p.delay;p.delay=d=>i+I(f||0,d)})}),o.start()}})}else{let r=Promise.resolve();ge(t,o=>{let s=o.current;if(s.length){let a=s.map(i=>{let u=i.queue;return i.queue=[],u});r=r.then(()=>(ge(s,(i,u)=>ge(a[u]||[],p=>i.queue.push(p))),Promise.all(o.start())))}})}})}import{is as Qn}from"@react-spring/shared";import{useContext as Mn,useMemo as Xe,useRef as Nt}from"react";import{is as jn,each as Ye,usePrev as Dt,useOnce as Nn,useForceUpdate as Dn,useIsomorphicLayoutEffect as qn}from"@react-spring/shared";import{is as R,raf as ve,each as At,isEqual as Y,toArray as Rt,eachProp as Pn,frameLoop as Tn,flushCalls as Qe,getFluidValue as ie,isAnimatedString as xn,Globals as bn,callFluidObservers as An,hasFluidValue as Se,addFluidObserver as Rn,removeFluidObserver as vn,getFluidObservers as vt}from"@react-spring/shared";import{AnimatedValue as Cn,AnimatedString as Ct,getPayload as In,getAnimated as ae,setAnimated as Vn,getAnimatedType as It}from"@react-spring/animated";import{is as re,easings as un}from"@react-spring/shared";var mt={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};var tt={...mt.default,mass:1,damping:1,easing:un.linear,clamp:!1},we=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,tt)}};function gt(t,e,n){n&&(n={...n},ht(n,e),e={...n,...e}),ht(t,e),Object.assign(t,e);for(let a in tt)t[a]==null&&(t[a]=tt[a]);let{mass:r,frequency:o,damping:s}=t;return re.und(o)||(o<.01&&(o=.01),s<0&&(s=0),t.tension=Math.pow(2*Math.PI/o,2)*r,t.friction=4*Math.PI*s*r/o),t}function ht(t,e){if(!re.und(e.decay))t.duration=void 0;else{let n=!re.und(e.tension)||!re.und(e.friction);(n||!re.und(e.frequency)||!re.und(e.damping)||!re.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var yt=[],Le=class{changed=!1;values=yt;toValues=null;fromValues=yt;to;from;config=new we;immediate=!1};import{is as pn,raf as St,Globals as ln}from"@react-spring/shared";function Me(t,{key:e,props:n,defaultProps:r,state:o,actions:s}){return new Promise((a,i)=>{let u,p,f=te(n.cancel??r?.cancel,e);if(f)b();else{pn.und(n.pause)||(o.paused=te(n.pause,e));let c=r?.pause;c!==!0&&(c=o.paused||te(c,e)),u=I(n.delay||0,e),c?(o.resumeQueue.add(m),s.pause()):(s.resume(),m())}function d(){o.resumeQueue.add(m),o.timeouts.delete(p),p.cancel(),u=p.time-St.now()}function m(){u>0&&!ln.skipAnimation?(o.delayed=!0,p=St.setTimeout(b,u),o.pauseQueue.add(d),o.timeouts.add(p)):b()}function b(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(p),t<=(o.cancelId||0)&&(f=!0);try{s.start({...n,callId:t,cancel:f},a)}catch(c){i(c)}}})}import{is as je,raf as cn,flush as fn,eachProp as dn,Globals as Pt}from"@react-spring/shared";var be=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?q(t.get()):e.every(n=>n.noop)?nt(t.get()):E(t.get(),e.every(n=>n.finished)),nt=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),E=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),q=t=>({value:t,cancelled:!0,finished:!1});function De(t,e,n,r){let{callId:o,parentId:s,onRest:a}=e,{asyncTo:i,promise:u}=n;return!s&&t===i&&!e.reset?u:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;let p=ne(e,(l,h)=>h==="onRest"?void 0:l),f,d,m=new Promise((l,h)=>(f=l,d=h)),b=l=>{let h=o<=(n.cancelId||0)&&q(r)||o!==n.asyncId&&E(r,!1);if(h)throw l.result=h,d(l),l},c=(l,h)=>{let g=new Ae,x=new Ne;return(async()=>{if(Pt.skipAnimation)throw oe(n),x.result=E(r,!1),d(x),x;b(g);let S=je.obj(l)?{...l}:{...h,to:l};S.parentId=o,dn(p,(V,_)=>{je.und(S[_])&&(S[_]=V)});let A=await r.start(S);return b(g),n.paused&&await new Promise(V=>{n.resumeQueue.add(V)}),A})()},P;if(Pt.skipAnimation)return oe(n),E(r,!1);try{let l;je.arr(t)?l=(async h=>{for(let g of h)await c(g)})(t):l=Promise.resolve(t(c,r.stop.bind(r))),await Promise.all([l.then(f),m]),P=E(r.get(),!0,!1)}catch(l){if(l instanceof Ae)P=l.result;else if(l instanceof Ne)P=l.result;else throw l}finally{o==n.asyncId&&(n.asyncId=s,n.asyncTo=s?i:void 0,n.promise=s?u:void 0)}return je.fun(a)&&cn.batchedUpdates(()=>{a(P,r,r.item)}),P})()}function oe(t,e){fn(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var Ae=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Ne=class extends Error{result;constructor(){super("SkipAnimationSignal")}};import{deprecateInterpolate as mn,frameLoop as hn,FluidValue as gn,Globals as Tt,callFluidObservers as xt}from"@react-spring/shared";import{getAnimated as yn}from"@react-spring/animated";var Re=t=>t instanceof X,Sn=1,X=class extends gn{id=Sn++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=yn(this);return e&&e.getValue()}to(...e){return Tt.to(this,e)}interpolate(...e){return mn(),Tt.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,n=!1){xt(this,{type:"change",parent:this,value:e,idle:n})}_onPriorityChange(e){this.idle||hn.sort(this),xt(this,{type:"priority",parent:this,priority:e})}};var se=Symbol.for("SpringPhase"),bt=1,rt=2,ot=4,qe=t=>(t[se]&bt)>0,Q=t=>(t[se]&rt)>0,ye=t=>(t[se]&ot)>0,st=(t,e)=>e?t[se]|=rt|bt:t[se]&=~rt,it=(t,e)=>e?t[se]|=ot:t[se]&=~ot;var ue=class extends X{key;animation=new Le;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,n){if(super(),!R.und(e)||!R.und(n)){let r=R.obj(e)?{...e}:{...n,from:e};R.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(Q(this)||this._state.asyncTo)||ye(this)}get goal(){return ie(this.animation.to)}get velocity(){let e=ae(this);return e instanceof Cn?e.lastVelocity||0:e.getPayload().map(n=>n.lastVelocity||0)}get hasAnimated(){return qe(this)}get isAnimating(){return Q(this)}get isPaused(){return ye(this)}get isDelayed(){return this._state.delayed}advance(e){let n=!0,r=!1,o=this.animation,{config:s,toValues:a}=o,i=In(o.to);!i&&Se(o.to)&&(a=Rt(ie(o.to))),o.values.forEach((f,d)=>{if(f.done)return;let m=f.constructor==Ct?1:i?i[d].lastPosition:a[d],b=o.immediate,c=m;if(!b){if(c=f.lastPosition,s.tension<=0){f.done=!0;return}let P=f.elapsedTime+=e,l=o.fromValues[d],h=f.v0!=null?f.v0:f.v0=R.arr(s.velocity)?s.velocity[d]:s.velocity,g,x=s.precision||(l==m?.005:Math.min(1,Math.abs(m-l)*.001));if(R.und(s.duration))if(s.decay){let S=s.decay===!0?.998:s.decay,A=Math.exp(-(1-S)*P);c=l+h/(1-S)*(1-A),b=Math.abs(f.lastPosition-c)<=x,g=h*A}else{g=f.lastVelocity==null?h:f.lastVelocity;let S=s.restVelocity||x/10,A=s.clamp?0:s.bounce,V=!R.und(A),_=l==m?f.v0>0:l<m,v,w=!1,C=1,$=Math.ceil(e/C);for(let L=0;L<$&&(v=Math.abs(g)>S,!(!v&&(b=Math.abs(m-c)<=x,b)));++L){V&&(w=c==m||c>m==_,w&&(g=-g*A,c=m));let N=-s.tension*1e-6*(c-m),y=-s.friction*.001*g,T=(N+y)/s.mass;g=g+T*C,c=c+g*C}}else{let S=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,f.durationProgress>0&&(f.elapsedTime=s.duration*f.durationProgress,P=f.elapsedTime+=e)),S=(s.progress||0)+P/this._memoizedDuration,S=S>1?1:S<0?0:S,f.durationProgress=S),c=l+s.easing(S)*(m-l),g=(c-f.lastPosition)/e,b=S==1}f.lastVelocity=g,Number.isNaN(c)&&(console.warn("Got NaN while animating:",this),b=!0)}i&&!i[d].done&&(b=!1),b?f.done=!0:n=!1,f.setValue(c,s.round)&&(r=!0)});let u=ae(this),p=u.getValue();if(n){let f=ie(o.to);(p!==f||r)&&!s.decay?(u.setValue(f),this._onChange(f)):r&&s.decay&&this._onChange(p),this._stop()}else r&&this._onChange(p)}set(e){return ve.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Q(this)){let{to:e,config:n}=this.animation;ve.batchedUpdates(()=>{this._onStart(),n.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,n){let r;return R.und(e)?(r=this.queue||[],this.queue=[]):r=[R.obj(e)?e:{...n,to:e}],Promise.all(r.map(o=>this._update(o))).then(o=>be(this,o))}stop(e){let{to:n}=this.animation;return this._focus(this.get()),oe(this._state,e&&this._lastCallId),ve.batchedUpdates(()=>this._stop(n,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){let n=this.key||"",{to:r,from:o}=e;r=R.obj(r)?r[n]:r,(r==null||Ee(r))&&(r=void 0),o=R.obj(o)?o[n]:o,o==null&&(o=void 0);let s={to:r,from:o};return qe(this)||(e.reverse&&([r,o]=[o,r]),o=ie(o),R.und(o)?ae(this)||this._set(r):this._set(o)),s}_update({...e},n){let{key:r,defaultProps:o}=this;e.default&&Object.assign(o,ne(e,(i,u)=>/^on/.test(u)?et(i,r):i)),_t(this,e,"onProps"),Ie(this,"onProps",e,this);let s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return Me(++this._lastCallId,{key:r,props:e,defaultProps:o,state:a,actions:{pause:()=>{ye(this)||(it(this,!0),Qe(a.pauseQueue),Ie(this,"onPause",E(this,Ce(this,this.animation.to)),this))},resume:()=>{ye(this)&&(it(this,!1),Q(this)&&this._resume(),Qe(a.resumeQueue),Ie(this,"onResume",E(this,Ce(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(i=>{if(e.loop&&i.finished&&!(n&&i.noop)){let u=at(e);if(u)return this._update(u,!0)}return i})}_merge(e,n,r){if(n.cancel)return this.stop(!0),r(q(this));let o=!R.und(e.to),s=!R.und(e.from);if(o||s)if(n.callId>this._lastToId)this._lastToId=n.callId;else return r(q(this));let{key:a,defaultProps:i,animation:u}=this,{to:p,from:f}=u,{to:d=p,from:m=f}=e;s&&!o&&(!n.default||R.und(d))&&(d=m),n.reverse&&([d,m]=[m,d]);let b=!Y(m,f);b&&(u.from=m),m=ie(m);let c=!Y(d,p);c&&this._focus(d);let P=Ee(n.to),{config:l}=u,{decay:h,velocity:g}=l;(o||s)&&(l.velocity=0),n.config&&!P&>(l,I(n.config,a),n.config!==i.config?I(i.config,a):void 0);let x=ae(this);if(!x||R.und(d))return r(E(this,!0));let S=R.und(n.reset)?s&&!n.default:!R.und(m)&&te(n.reset,a),A=S?m:this.get(),V=me(d),_=R.num(V)||R.arr(V)||xn(V),v=!P&&(!_||te(i.immediate||n.immediate,a));if(c){let L=It(d);if(L!==x.constructor)if(v)x=this._set(V);else throw Error(`Cannot animate between ${x.constructor.name} and ${L.name}, as the "to" prop suggests`)}let w=x.constructor,C=Se(d),$=!1;if(!C){let L=S||!qe(this)&&b;(c||L)&&($=Y(me(A),V),C=!$),(!Y(u.immediate,v)&&!v||!Y(l.decay,h)||!Y(l.velocity,g))&&(C=!0)}if($&&Q(this)&&(u.changed&&!S?C=!0:C||this._stop(p)),!P&&((C||Se(p))&&(u.values=x.getPayload(),u.toValues=Se(d)?null:w==Ct?[1]:Rt(V)),u.immediate!=v&&(u.immediate=v,!v&&!S&&this._set(p)),C)){let{onRest:L}=u;At(_n,y=>_t(this,n,y));let N=E(this,Ce(this,p));Qe(this._pendingCalls,N),this._pendingCalls.add(r),u.changed&&ve.batchedUpdates(()=>{u.changed=!S,L?.(N,this),S?I(i.onRest,N):u.onStart?.(N,this)})}S&&this._set(A),P?r(De(n.to,n,this._state,this)):C?this._start():Q(this)&&!c?this._pendingCalls.add(r):r(nt(A))}_focus(e){let n=this.animation;e!==n.to&&(vt(this)&&this._detach(),n.to=e,vt(this)&&this._attach())}_attach(){let e=0,{to:n}=this.animation;Se(n)&&(Rn(n,this),Re(n)&&(e=n.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Se(e)&&vn(e,this)}_set(e,n=!0){let r=ie(e);if(!R.und(r)){let o=ae(this);if(!o||!Y(r,o.getValue())){let s=It(r);!o||o.constructor!=s?Vn(this,s.create(r)):o.setValue(r),o&&ve.batchedUpdates(()=>{this._onChange(r,n)})}}return ae(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Ie(this,"onStart",E(this,Ce(this,e.to)),this))}_onChange(e,n){n||(this._onStart(),I(this.animation.onChange,e,this)),I(this.defaultProps.onChange,e,this),super._onChange(e,n)}_start(){let e=this.animation;ae(this).reset(ie(e.to)),e.immediate||(e.fromValues=e.values.map(n=>n.lastPosition)),Q(this)||(st(this,!0),ye(this)||this._resume())}_resume(){bn.skipAnimation?this.finish():Tn.start(this)}_stop(e,n){if(Q(this)){st(this,!1);let r=this.animation;At(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),An(this,{type:"idle",parent:this});let o=n?q(this.get()):E(this.get(),Ce(this,e??r.to));Qe(this._pendingCalls,o),r.changed&&(r.changed=!1,Ie(this,"onRest",o,this))}}};function Ce(t,e){let n=me(e),r=me(t.get());return Y(r,n)}function at(t,e=t.loop,n=t.to){let r=I(e);if(r){let o=r!==!0&&de(r),s=(o||t).reverse,a=!o||o.reset;return Pe({...t,loop:e,default:!1,pause:void 0,to:!s||Ee(n)?n:void 0,from:a?t.from:void 0,reset:a,...o})}}function Pe(t){let{to:e,from:n}=t=de(t),r=new Set;return R.obj(e)&&Vt(e,r),R.obj(n)&&Vt(n,r),t.keys=r.size?Array.from(r):null,t}function Ot(t){let e=Pe(t);return R.und(e.default)&&(e.default=ne(e)),e}function Vt(t,e){Pn(t,(n,r)=>n!=null&&e.add(r))}var _n=["onStart","onRest","onChange","onPause","onResume"];function _t(t,e,n){t.animation[n]=e[n]!==ke(e,n)?et(e[n],t.key):void 0}function Ie(t,e,...n){t.animation[e]?.(...n),t.defaultProps[e]?.(...n)}import{is as z,raf as kt,each as pe,noop as Ft,flush as ut,toArray as Ve,eachProp as Ut,flushCalls as On,addFluidObserver as Et}from"@react-spring/shared";var Fn=["onStart","onChange","onRest"],kn=1,le=class{id=kn++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,n){this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((n,r)=>e[r]=n.get()),e}set(e){for(let n in e){let r=e[n];z.und(r)||this.springs[n].set(r)}}update(e){return e&&this.queue.push(Pe(e)),this}start(e){let{queue:n}=this;return e?n=Ve(e).map(Pe):this.queue=[],this._flush?this._flush(this,n):(jt(this,n),ze(this,n))}stop(e,n){if(e!==!!e&&(n=e),n){let r=this.springs;pe(Ve(n),o=>r[o].stop(!!e))}else oe(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(z.und(e))this.start({pause:!0});else{let n=this.springs;pe(Ve(e),r=>n[r].pause())}return this}resume(e){if(z.und(e))this.start({pause:!1});else{let n=this.springs;pe(Ve(e),r=>n[r].resume())}return this}each(e){Ut(this.springs,e)}_onFrame(){let{onStart:e,onChange:n,onRest:r}=this._events,o=this._active.size>0,s=this._changed.size>0;(o&&!this._started||s&&!this._started)&&(this._started=!0,ut(e,([u,p])=>{p.value=this.get(),u(p,this,this._item)}));let a=!o&&this._started,i=s||a&&r.size?this.get():null;s&&n.size&&ut(n,([u,p])=>{p.value=i,u(p,this,this._item)}),a&&(this._started=!1,ut(r,([u,p])=>{p.value=i,u(p,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;kt.onFrame(this._onFrame)}};function ze(t,e){return Promise.all(e.map(n=>wt(t,n))).then(n=>be(t,n))}async function wt(t,e,n){let{keys:r,to:o,from:s,loop:a,onRest:i,onResolve:u}=e,p=z.obj(e.default)&&e.default;a&&(e.loop=!1),o===!1&&(e.to=null),s===!1&&(e.from=null);let f=z.arr(o)||z.fun(o)?o:void 0;f?(e.to=void 0,e.onRest=void 0,p&&(p.onRest=void 0)):pe(Fn,P=>{let l=e[P];if(z.fun(l)){let h=t._events[P];e[P]=({finished:g,cancelled:x})=>{let S=h.get(l);S?(g||(S.finished=!1),x&&(S.cancelled=!0)):h.set(l,{value:null,finished:g||!1,cancelled:x||!1})},p&&(p[P]=e[P])}});let d=t._state;e.pause===!d.paused?(d.paused=e.pause,On(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);let m=(r||Object.keys(t.springs)).map(P=>t.springs[P].start(e)),b=e.cancel===!0||ke(e,"cancel")===!0;(f||b&&d.asyncId)&&m.push(Me(++t._lastAsyncId,{props:e,state:d,actions:{pause:Ft,resume:Ft,start(P,l){b?(oe(d,t._lastAsyncId),l(q(t))):(P.onRest=i,l(De(f,P,d,t)))}}})),d.paused&&await new Promise(P=>{d.resumeQueue.add(P)});let c=be(t,await Promise.all(m));if(a&&c.finished&&!(n&&c.noop)){let P=at(e,a,o);if(P)return jt(t,[P]),wt(t,P,!0)}return u&&kt.batchedUpdates(()=>u(c,t,t.item)),c}function _e(t,e){let n={...t.springs};return e&&pe(Ve(e),r=>{z.und(r.keys)&&(r=Pe(r)),z.obj(r.to)||(r={...r,to:void 0}),Mt(n,r,o=>Lt(o))}),pt(t,n),n}function pt(t,e){Ut(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Et(n,t))})}function Lt(t,e){let n=new ue;return n.key=t,e&&Et(n,e),n}function Mt(t,e,n){e.keys&&pe(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function jt(t,e){pe(e,n=>{Mt(t.springs,n,r=>Lt(r,t))})}import*as Be from"react";import{useContext as Un}from"react";import{useMemoOne as En}from"@react-spring/shared";var H=({children:t,...e})=>{let n=Un(Ge),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=En(()=>({pause:r,immediate:o}),[r,o]);let{Provider:s}=Ge;return Be.createElement(s,{value:e},t)},Ge=wn(H,{});H.Provider=Ge.Provider;H.Consumer=Ge.Consumer;function wn(t,e){return Object.assign(t,Be.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}import{each as ce,is as Ke,deprecateDirectCall as Ln}from"@react-spring/shared";var fe=()=>{let t=[],e=function(r){Ln();let o=[];return ce(t,(s,a)=>{if(Ke.und(r))o.push(s.start());else{let i=n(r,s,a);i&&o.push(s.start(i))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){let o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return ce(t,r=>r.pause(...arguments)),this},e.resume=function(){return ce(t,r=>r.resume(...arguments)),this},e.set=function(r){ce(t,(o,s)=>{let a=Ke.fun(r)?r(s,o):r;a&&o.set(a)})},e.start=function(r){let o=[];return ce(t,(s,a)=>{if(Ke.und(r))o.push(s.start());else{let i=this._getProps(r,s,a);i&&o.push(s.start(i))}}),o},e.stop=function(){return ce(t,r=>r.stop(...arguments)),this},e.update=function(r){return ce(t,(o,s)=>o.update(this._getProps(r,o,s))),this};let n=function(r,o,s){return Ke.fun(r)?r(s,o):r};return e._getProps=n,e};function He(t,e,n){let r=jn.fun(e)&&e;r&&!n&&(n=[]);let o=Xe(()=>r||arguments.length==3?fe():void 0,[]),s=Nt(0),a=Dn(),i=Xe(()=>({ctrls:[],queue:[],flush(h,g){let x=_e(h,g);return s.current>0&&!i.queue.length&&!Object.keys(x).some(A=>!h.springs[A])?ze(h,g):new Promise(A=>{pt(h,x),i.queue.push(()=>{A(ze(h,g))}),a()})}}),[]),u=Nt([...i.ctrls]),p=[],f=Dt(t)||0;Xe(()=>{Ye(u.current.slice(t,f),h=>{xe(h,o),h.stop(!0)}),u.current.length=t,d(f,t)},[t]),Xe(()=>{d(0,Math.min(f,t))},n);function d(h,g){for(let x=h;x<g;x++){let S=u.current[x]||(u.current[x]=new le(null,i.flush)),A=r?r(x,S):e[x];A&&(p[x]=Ot(A))}}let m=u.current.map((h,g)=>_e(h,p[g])),b=Mn(H),c=Dt(b),P=b!==c&&Ue(b);qn(()=>{s.current++,i.ctrls=u.current;let{queue:h}=i;h.length&&(i.queue=[],Ye(h,g=>g())),Ye(u.current,(g,x)=>{o?.add(g),P&&g.start({default:b});let S=p[x];S&&(he(g,S.ref),g.ref?g.queue.push(S):g.start(S))})}),Nn(()=>()=>{Ye(i.ctrls,h=>h.stop(!0))});let l=m.map(h=>({...h}));return o?[l,o]:l}function J(t,e){let n=Qn.fun(t),[[r],o]=He(1,n?t:[t],n?e||[]:e);return n||arguments.length==2?[r,o]:r}import{useState as zn}from"react";var Gn=()=>fe(),Xo=()=>zn(Gn)[0];import{useConstant as Bn,useOnce as Kn}from"@react-spring/shared";var Wo=(t,e)=>{let n=Bn(()=>new ue(t,e));return Kn(()=>()=>{n.stop()}),n};import{each as Xn,is as qt,useIsomorphicLayoutEffect as Yn}from"@react-spring/shared";function Qt(t,e,n){let r=qt.fun(e)&&e;r&&!n&&(n=[]);let o=!0,s,a=He(t,(i,u)=>{let p=r?r(i,u):e;return s=p.ref,o=o&&p.reverse,p},n||[{}]);if(Yn(()=>{Xn(a[1].current,(i,u)=>{let p=a[1].current[u+(o?1:-1)];if(he(i,s),i.ref){p&&i.update({to:p.springs});return}p?i.start({to:p.springs}):i.start()})},n),r||arguments.length==3){let i=s??a[1];return i._getProps=(u,p,f)=>{let d=qt.fun(u)?u(f,p):u;if(d){let m=i.current[f+(d.reverse?1:-1)];return m&&(d.to=m.springs),d}},a}return a[0]}import*as Oe from"react";import{useContext as Hn,useRef as lt,useMemo as Jn}from"react";import{is as G,toArray as zt,useForceUpdate as Wn,useOnce as $n,usePrev as Zn,each as j,useIsomorphicLayoutEffect as Je}from"@react-spring/shared";function Gt(t,e,n){let r=G.fun(e)&&e,{reset:o,sort:s,trail:a=0,expires:i=!0,exitBeforeEnter:u=!1,onDestroyed:p,ref:f,config:d}=r?r():e,m=Jn(()=>r||arguments.length==3?fe():void 0,[]),b=zt(t),c=[],P=lt(null),l=o?null:P.current;Je(()=>{P.current=c}),$n(()=>(j(c,y=>{m?.add(y.ctrl),y.ctrl.ref=m}),()=>{j(P.current,y=>{y.expired&&clearTimeout(y.expirationId),xe(y.ctrl,m),y.ctrl.stop(!0)})}));let h=tr(b,r?r():e,l),g=o&&P.current||[];Je(()=>j(g,({ctrl:y,item:T,key:F})=>{xe(y,m),I(p,T,F)}));let x=[];if(l&&j(l,(y,T)=>{y.expired?(clearTimeout(y.expirationId),g.push(y)):(T=x[T]=h.indexOf(y.key),~T&&(c[T]=y))}),j(b,(y,T)=>{c[T]||(c[T]={key:h[T],item:y,phase:"mount",ctrl:new le},c[T].ctrl.item=y)}),x.length){let y=-1,{leave:T}=r?r():e;j(x,(F,k)=>{let O=l[k];~F?(y=c.indexOf(O),c[y]={...O,item:b[F]}):T&&c.splice(++y,0,O)})}G.fun(s)&&c.sort((y,T)=>s(y.item,T.item));let S=-a,A=Wn(),V=ne(e),_=new Map,v=lt(new Map),w=lt(!1);j(c,(y,T)=>{let F=y.key,k=y.phase,O=r?r():e,U,D,Jt=I(O.delay||0,F);if(k=="mount")U=O.enter,D="enter";else{let M=h.indexOf(F)<0;if(k!="leave")if(M)U=O.leave,D="leave";else if(U=O.update)D="update";else return;else if(!M)U=O.enter,D="enter";else return}if(U=I(U,y.item,T),U=G.obj(U)?de(U):{to:U},!U.config){let M=d||V.config;U.config=I(M,y.item,T,D)}S+=a;let Z={...V,delay:Jt+S,ref:f,immediate:O.immediate,reset:!1,...U};if(D=="enter"&&G.und(Z.from)){let M=r?r():e,Te=G.und(M.initial)||l?M.from:M.initial;Z.from=I(Te,y.item,T)}let{onResolve:Wt}=Z;Z.onResolve=M=>{I(Wt,M);let Te=P.current,B=Te.find(Fe=>Fe.key===F);if(!!B&&!(M.cancelled&&B.phase!="update")&&B.ctrl.idle){let Fe=Te.every(ee=>ee.ctrl.idle);if(B.phase=="leave"){let ee=I(i,B.item);if(ee!==!1){let Ze=ee===!0?0:ee;if(B.expired=!0,!Fe&&Ze>0){Ze<=2147483647&&(B.expirationId=setTimeout(A,Ze));return}}}Fe&&Te.some(ee=>ee.expired)&&(v.current.delete(B),u&&(w.current=!0),A())}};let ft=_e(y.ctrl,Z);D==="leave"&&u?v.current.set(y,{phase:D,springs:ft,payload:Z}):_.set(y,{phase:D,springs:ft,payload:Z})});let C=Hn(H),$=Zn(C),L=C!==$&&Ue(C);Je(()=>{L&&j(c,y=>{y.ctrl.start({default:C})})},[C]),j(_,(y,T)=>{if(v.current.size){let F=c.findIndex(k=>k.key===T.key);c.splice(F,1)}}),Je(()=>{j(v.current.size?v.current:_,({phase:y,payload:T},F)=>{let{ctrl:k}=F;F.phase=y,m?.add(k),L&&y=="enter"&&k.start({default:C}),T&&(he(k,T.ref),(k.ref||m)&&!w.current?k.update(T):(k.start(T),w.current&&(w.current=!1)))})},o?void 0:n);let N=y=>Oe.createElement(Oe.Fragment,null,c.map((T,F)=>{let{springs:k}=_.get(T)||T.ctrl,O=y({...k},T.item,T,F);return O&&O.type?Oe.createElement(O.type,{...O.props,key:G.str(T.key)||G.num(T.key)?T.key:T.ctrl.id,ref:O.ref}):O}));return m?[N,m]:N}var er=1;function tr(t,{key:e,keys:n=e},r){if(n===null){let o=new Set;return t.map(s=>{let a=r&&r.find(i=>i.item===s&&i.phase!=="leave"&&!o.has(i));return a?(o.add(a),a.key):er++})}return G.und(n)?t:G.fun(n)?t.map(n):zt(n)}import{each as nr,onScroll as rr,useIsomorphicLayoutEffect as or}from"@react-spring/shared";var hs=({container:t,...e}={})=>{let[n,r]=J(()=>({scrollX:0,scrollY:0,scrollXProgress:0,scrollYProgress:0,...e}),[]);return or(()=>{let o=rr(({x:s,y:a})=>{r.start({scrollX:s.current,scrollXProgress:s.progress,scrollY:a.current,scrollYProgress:a.progress})},{container:t?.current||void 0});return()=>{nr(Object.values(n),s=>s.stop()),o()}},[]),n};import{onResize as sr,each as ir,useIsomorphicLayoutEffect as ar}from"@react-spring/shared";var Ps=({container:t,...e})=>{let[n,r]=J(()=>({width:0,height:0,...e}),[]);return ar(()=>{let o=sr(({width:s,height:a})=>{r.start({width:s,height:a,immediate:n.width.get()===0||n.height.get()===0})},{container:t?.current||void 0});return()=>{ir(Object.values(n),s=>s.stop()),o()}},[]),n};import{useRef as ur,useState as pr}from"react";import{is as Bt,useIsomorphicLayoutEffect as lr}from"@react-spring/shared";var cr={any:0,all:1};function Cs(t,e){let[n,r]=pr(!1),o=ur(),s=Bt.fun(t)&&t,a=s?s():{},{to:i={},from:u={},...p}=a,f=s?e:t,[d,m]=J(()=>({from:u,...p}),[]);return lr(()=>{let b=o.current,{root:c,once:P,amount:l="any",...h}=f??{};if(!b||P&&n||typeof IntersectionObserver>"u")return;let g=new WeakMap,x=()=>(i&&m.start(i),r(!0),P?void 0:()=>{u&&m.start(u),r(!1)}),S=V=>{V.forEach(_=>{let v=g.get(_.target);if(_.isIntersecting!==Boolean(v))if(_.isIntersecting){let w=x();Bt.fun(w)?g.set(_.target,w):A.unobserve(_.target)}else v&&(v(),g.delete(_.target))})},A=new IntersectionObserver(S,{root:c&&c.current||void 0,threshold:typeof l=="number"||Array.isArray(l)?l:cr[l],...h});return A.observe(b),()=>A.unobserve(b)},[f]),s?[o,d]:[o,n]}function qs({children:t,...e}){return t(J(e))}import{is as fr}from"@react-spring/shared";function Bs({items:t,children:e,...n}){let r=Qt(t.length,n);return t.map((o,s)=>{let a=e(o,s);return fr.fun(a)?a(r[s]):a})}function Ys({items:t,children:e,...n}){return Gt(t,n)(e)}import{deprecateInterpolate as Cr}from"@react-spring/shared";import{is as dr,raf as mr,each as $e,isEqual as hr,toArray as We,frameLoop as gr,getFluidValue as Kt,createInterpolator as yr,Globals as Sr,callFluidObservers as Pr,addFluidObserver as Tr,removeFluidObserver as xr,hasFluidValue as Xt}from"@react-spring/shared";import{getAnimated as br,setAnimated as Ar,getAnimatedType as Rr,getPayload as Ht}from"@react-spring/animated";var W=class extends X{constructor(n,r){super();this.source=n;this.calc=yr(...r);let o=this._get(),s=Rr(o);Ar(this,s.create(o))}key;idle=!0;calc;_active=new Set;advance(n){let r=this._get(),o=this.get();hr(r,o)||(br(this).setValue(r),this._onChange(r,this.idle)),!this.idle&&Yt(this._active)&&ct(this)}_get(){let n=dr.arr(this.source)?this.source.map(Kt):We(Kt(this.source));return this.calc(...n)}_start(){this.idle&&!Yt(this._active)&&(this.idle=!1,$e(Ht(this),n=>{n.done=!1}),Sr.skipAnimation?(mr.batchedUpdates(()=>this.advance()),ct(this)):gr.start(this))}_attach(){let n=1;$e(We(this.source),r=>{Xt(r)&&Tr(r,this),Re(r)&&(r.idle||this._active.add(r),n=Math.max(n,r.priority+1))}),this.priority=n,this._start()}_detach(){$e(We(this.source),n=>{Xt(n)&&xr(n,this)}),this._active.clear(),ct(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=We(this.source).reduce((r,o)=>Math.max(r,(Re(o)?o.priority:0)+1),0))}};function vr(t){return t.idle!==!1}function Yt(t){return!t.size||Array.from(t).every(vr)}function ct(t){t.idle||(t.idle=!0,$e(Ht(t),e=>{e.done=!0}),Pr(t,{type:"idle",parent:t}))}var ui=(t,...e)=>new W(t,e),pi=(t,...e)=>(Cr(),new W(t,e));import{Globals as Ir,frameLoop as Vr,createStringInterpolator as _r}from"@react-spring/shared";Ir.assign({createStringInterpolator:_r,to:(t,e)=>new W(t,e)});var di=Vr.advance;import{createInterpolator as Ui,useIsomorphicLayoutEffect as Ei,useReducedMotion as wi,easings as Li}from"@react-spring/shared";export*from"@react-spring/types";export{Ae as BailSignal,le as Controller,X as FrameValue,Ir as Globals,W as Interpolation,qs as Spring,H as SpringContext,fe as SpringRef,ue as SpringValue,Bs as Trail,Ys as Transition,mt as config,Ui as createInterpolator,Li as easings,de as inferTo,pi as interpolate,ui as to,di as update,wr as useChain,Cs as useInView,Ei as useIsomorphicLayoutEffect,wi as useReducedMotion,Ps as useResize,hs as useScroll,J as useSpring,Xo as useSpringRef,Wo as useSpringValue,He as useSprings,Qt as useTrail,Gt as useTransition}; | ||
import{each as ge,useIsomorphicLayoutEffect as an}from"@react-spring/shared";import{is as K,toArray as $t,eachProp as dt,getFluidValue as Zt,isAnimatedString as en,Globals as tn}from"@react-spring/shared";function I(t,...e){return K.fun(t)?t(...e):t}var te=(t,e)=>t===!0||!!(e&&t&&(K.fun(t)?t(e):$t(t).includes(e))),et=(t,e)=>K.obj(t)?e&&t[e]:t;var ke=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,nn=t=>t,ne=(t,e=nn)=>{let n=rn;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));let r={};for(let o of n){let s=e(t[o],o);K.und(s)||(r[o]=s)}return r},rn=["config","onProps","onStart","onChange","onPause","onResume","onRest"],on={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function sn(t){let e={},n=0;if(dt(t,(r,o)=>{on[o]||(e[o]=r,n++)}),n)return e}function de(t){let e=sn(t);if(e){let n={to:e};return dt(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function me(t){return t=Zt(t),K.arr(t)?t.map(me):en(t)?tn.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function Ue(t){for(let e in t)return!0;return!1}function Ee(t){return K.fun(t)||K.arr(t)&&K.obj(t[0])}function xe(t,e){t.ref?.delete(t),e?.delete(t)}function he(t,e){e&&t.ref!==e&&(t.ref?.delete(t),e.add(t),t.ref=e)}function wr(t,e,n=1e3){an(()=>{if(e){let r=0;ge(t,(o,s)=>{let i=o.current;if(i.length){let a=n*e[s];isNaN(a)?a=r:r=a,ge(i,u=>{ge(u.queue,p=>{let f=p.delay;p.delay=d=>a+I(f||0,d)})}),o.start()}})}else{let r=Promise.resolve();ge(t,o=>{let s=o.current;if(s.length){let i=s.map(a=>{let u=a.queue;return a.queue=[],u});r=r.then(()=>(ge(s,(a,u)=>ge(i[u]||[],p=>a.queue.push(p))),Promise.all(o.start())))}})}})}import{is as Qn}from"@react-spring/shared";import{useContext as Mn,useMemo as Xe,useRef as Nt}from"react";import{is as jn,each as Ye,usePrev as Dt,useOnce as Nn,useForceUpdate as Dn,useIsomorphicLayoutEffect as qn}from"@react-spring/shared";import{is as R,raf as ve,each as At,isEqual as Y,toArray as Rt,eachProp as Pn,frameLoop as Tn,flushCalls as Qe,getFluidValue as ie,isAnimatedString as xn,Globals as bn,callFluidObservers as An,hasFluidValue as Se,addFluidObserver as Rn,removeFluidObserver as vn,getFluidObservers as vt}from"@react-spring/shared";import{AnimatedValue as Cn,AnimatedString as Ct,getPayload as In,getAnimated as ae,setAnimated as Vn,getAnimatedType as It}from"@react-spring/animated";import{is as re,easings as un}from"@react-spring/shared";var mt={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};var tt={...mt.default,mass:1,damping:1,easing:un.linear,clamp:!1},we=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,tt)}};function gt(t,e,n){n&&(n={...n},ht(n,e),e={...n,...e}),ht(t,e),Object.assign(t,e);for(let i in tt)t[i]==null&&(t[i]=tt[i]);let{frequency:r,damping:o}=t,{mass:s}=t;return re.und(r)||(r<.01&&(r=.01),o<0&&(o=0),t.tension=Math.pow(2*Math.PI/r,2)*s,t.friction=4*Math.PI*o*s/r),t}function ht(t,e){if(!re.und(e.decay))t.duration=void 0;else{let n=!re.und(e.tension)||!re.und(e.friction);(n||!re.und(e.frequency)||!re.und(e.damping)||!re.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var yt=[],Le=class{changed=!1;values=yt;toValues=null;fromValues=yt;to;from;config=new we;immediate=!1};import{is as pn,raf as St,Globals as ln}from"@react-spring/shared";function Me(t,{key:e,props:n,defaultProps:r,state:o,actions:s}){return new Promise((i,a)=>{let u,p,f=te(n.cancel??r?.cancel,e);if(f)b();else{pn.und(n.pause)||(o.paused=te(n.pause,e));let c=r?.pause;c!==!0&&(c=o.paused||te(c,e)),u=I(n.delay||0,e),c?(o.resumeQueue.add(m),s.pause()):(s.resume(),m())}function d(){o.resumeQueue.add(m),o.timeouts.delete(p),p.cancel(),u=p.time-St.now()}function m(){u>0&&!ln.skipAnimation?(o.delayed=!0,p=St.setTimeout(b,u),o.pauseQueue.add(d),o.timeouts.add(p)):b()}function b(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(p),t<=(o.cancelId||0)&&(f=!0);try{s.start({...n,callId:t,cancel:f},i)}catch(c){a(c)}}})}import{is as je,raf as cn,flush as fn,eachProp as dn,Globals as Pt}from"@react-spring/shared";var be=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?q(t.get()):e.every(n=>n.noop)?nt(t.get()):E(t.get(),e.every(n=>n.finished)),nt=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),E=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),q=t=>({value:t,cancelled:!0,finished:!1});function De(t,e,n,r){let{callId:o,parentId:s,onRest:i}=e,{asyncTo:a,promise:u}=n;return!s&&t===a&&!e.reset?u:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;let p=ne(e,(l,h)=>h==="onRest"?void 0:l),f,d,m=new Promise((l,h)=>(f=l,d=h)),b=l=>{let h=o<=(n.cancelId||0)&&q(r)||o!==n.asyncId&&E(r,!1);if(h)throw l.result=h,d(l),l},c=(l,h)=>{let g=new Ae,x=new Ne;return(async()=>{if(Pt.skipAnimation)throw oe(n),x.result=E(r,!1),d(x),x;b(g);let S=je.obj(l)?{...l}:{...h,to:l};S.parentId=o,dn(p,(V,_)=>{je.und(S[_])&&(S[_]=V)});let A=await r.start(S);return b(g),n.paused&&await new Promise(V=>{n.resumeQueue.add(V)}),A})()},P;if(Pt.skipAnimation)return oe(n),E(r,!1);try{let l;je.arr(t)?l=(async h=>{for(let g of h)await c(g)})(t):l=Promise.resolve(t(c,r.stop.bind(r))),await Promise.all([l.then(f),m]),P=E(r.get(),!0,!1)}catch(l){if(l instanceof Ae)P=l.result;else if(l instanceof Ne)P=l.result;else throw l}finally{o==n.asyncId&&(n.asyncId=s,n.asyncTo=s?a:void 0,n.promise=s?u:void 0)}return je.fun(i)&&cn.batchedUpdates(()=>{i(P,r,r.item)}),P})()}function oe(t,e){fn(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var Ae=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Ne=class extends Error{result;constructor(){super("SkipAnimationSignal")}};import{deprecateInterpolate as mn,frameLoop as hn,FluidValue as gn,Globals as Tt,callFluidObservers as xt}from"@react-spring/shared";import{getAnimated as yn}from"@react-spring/animated";var Re=t=>t instanceof X,Sn=1,X=class extends gn{id=Sn++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=yn(this);return e&&e.getValue()}to(...e){return Tt.to(this,e)}interpolate(...e){return mn(),Tt.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,n=!1){xt(this,{type:"change",parent:this,value:e,idle:n})}_onPriorityChange(e){this.idle||hn.sort(this),xt(this,{type:"priority",parent:this,priority:e})}};var se=Symbol.for("SpringPhase"),bt=1,rt=2,ot=4,qe=t=>(t[se]&bt)>0,Q=t=>(t[se]&rt)>0,ye=t=>(t[se]&ot)>0,st=(t,e)=>e?t[se]|=rt|bt:t[se]&=~rt,it=(t,e)=>e?t[se]|=ot:t[se]&=~ot;var ue=class extends X{key;animation=new Le;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,n){if(super(),!R.und(e)||!R.und(n)){let r=R.obj(e)?{...e}:{...n,from:e};R.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(Q(this)||this._state.asyncTo)||ye(this)}get goal(){return ie(this.animation.to)}get velocity(){let e=ae(this);return e instanceof Cn?e.lastVelocity||0:e.getPayload().map(n=>n.lastVelocity||0)}get hasAnimated(){return qe(this)}get isAnimating(){return Q(this)}get isPaused(){return ye(this)}get isDelayed(){return this._state.delayed}advance(e){let n=!0,r=!1,o=this.animation,{toValues:s}=o,{config:i}=o,a=In(o.to);!a&&Se(o.to)&&(s=Rt(ie(o.to))),o.values.forEach((f,d)=>{if(f.done)return;let m=f.constructor==Ct?1:a?a[d].lastPosition:s[d],b=o.immediate,c=m;if(!b){if(c=f.lastPosition,i.tension<=0){f.done=!0;return}let P=f.elapsedTime+=e,l=o.fromValues[d],h=f.v0!=null?f.v0:f.v0=R.arr(i.velocity)?i.velocity[d]:i.velocity,g,x=i.precision||(l==m?.005:Math.min(1,Math.abs(m-l)*.001));if(R.und(i.duration))if(i.decay){let S=i.decay===!0?.998:i.decay,A=Math.exp(-(1-S)*P);c=l+h/(1-S)*(1-A),b=Math.abs(f.lastPosition-c)<=x,g=h*A}else{g=f.lastVelocity==null?h:f.lastVelocity;let S=i.restVelocity||x/10,A=i.clamp?0:i.bounce,V=!R.und(A),_=l==m?f.v0>0:l<m,v,w=!1,C=1,$=Math.ceil(e/C);for(let L=0;L<$&&(v=Math.abs(g)>S,!(!v&&(b=Math.abs(m-c)<=x,b)));++L){V&&(w=c==m||c>m==_,w&&(g=-g*A,c=m));let N=-i.tension*1e-6*(c-m),y=-i.friction*.001*g,T=(N+y)/i.mass;g=g+T*C,c=c+g*C}}else{let S=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,f.durationProgress>0&&(f.elapsedTime=i.duration*f.durationProgress,P=f.elapsedTime+=e)),S=(i.progress||0)+P/this._memoizedDuration,S=S>1?1:S<0?0:S,f.durationProgress=S),c=l+i.easing(S)*(m-l),g=(c-f.lastPosition)/e,b=S==1}f.lastVelocity=g,Number.isNaN(c)&&(console.warn("Got NaN while animating:",this),b=!0)}a&&!a[d].done&&(b=!1),b?f.done=!0:n=!1,f.setValue(c,i.round)&&(r=!0)});let u=ae(this),p=u.getValue();if(n){let f=ie(o.to);(p!==f||r)&&!i.decay?(u.setValue(f),this._onChange(f)):r&&i.decay&&this._onChange(p),this._stop()}else r&&this._onChange(p)}set(e){return ve.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Q(this)){let{to:e,config:n}=this.animation;ve.batchedUpdates(()=>{this._onStart(),n.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,n){let r;return R.und(e)?(r=this.queue||[],this.queue=[]):r=[R.obj(e)?e:{...n,to:e}],Promise.all(r.map(o=>this._update(o))).then(o=>be(this,o))}stop(e){let{to:n}=this.animation;return this._focus(this.get()),oe(this._state,e&&this._lastCallId),ve.batchedUpdates(()=>this._stop(n,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){let n=this.key||"",{to:r,from:o}=e;r=R.obj(r)?r[n]:r,(r==null||Ee(r))&&(r=void 0),o=R.obj(o)?o[n]:o,o==null&&(o=void 0);let s={to:r,from:o};return qe(this)||(e.reverse&&([r,o]=[o,r]),o=ie(o),R.und(o)?ae(this)||this._set(r):this._set(o)),s}_update({...e},n){let{key:r,defaultProps:o}=this;e.default&&Object.assign(o,ne(e,(a,u)=>/^on/.test(u)?et(a,r):a)),_t(this,e,"onProps"),Ie(this,"onProps",e,this);let s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let i=this._state;return Me(++this._lastCallId,{key:r,props:e,defaultProps:o,state:i,actions:{pause:()=>{ye(this)||(it(this,!0),Qe(i.pauseQueue),Ie(this,"onPause",E(this,Ce(this,this.animation.to)),this))},resume:()=>{ye(this)&&(it(this,!1),Q(this)&&this._resume(),Qe(i.resumeQueue),Ie(this,"onResume",E(this,Ce(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(a=>{if(e.loop&&a.finished&&!(n&&a.noop)){let u=at(e);if(u)return this._update(u,!0)}return a})}_merge(e,n,r){if(n.cancel)return this.stop(!0),r(q(this));let o=!R.und(e.to),s=!R.und(e.from);if(o||s)if(n.callId>this._lastToId)this._lastToId=n.callId;else return r(q(this));let{key:i,defaultProps:a,animation:u}=this,{to:p,from:f}=u,{to:d=p,from:m=f}=e;s&&!o&&(!n.default||R.und(d))&&(d=m),n.reverse&&([d,m]=[m,d]);let b=!Y(m,f);b&&(u.from=m),m=ie(m);let c=!Y(d,p);c&&this._focus(d);let P=Ee(n.to),{config:l}=u,{decay:h,velocity:g}=l;(o||s)&&(l.velocity=0),n.config&&!P&>(l,I(n.config,i),n.config!==a.config?I(a.config,i):void 0);let x=ae(this);if(!x||R.und(d))return r(E(this,!0));let S=R.und(n.reset)?s&&!n.default:!R.und(m)&&te(n.reset,i),A=S?m:this.get(),V=me(d),_=R.num(V)||R.arr(V)||xn(V),v=!P&&(!_||te(a.immediate||n.immediate,i));if(c){let L=It(d);if(L!==x.constructor)if(v)x=this._set(V);else throw Error(`Cannot animate between ${x.constructor.name} and ${L.name}, as the "to" prop suggests`)}let w=x.constructor,C=Se(d),$=!1;if(!C){let L=S||!qe(this)&&b;(c||L)&&($=Y(me(A),V),C=!$),(!Y(u.immediate,v)&&!v||!Y(l.decay,h)||!Y(l.velocity,g))&&(C=!0)}if($&&Q(this)&&(u.changed&&!S?C=!0:C||this._stop(p)),!P&&((C||Se(p))&&(u.values=x.getPayload(),u.toValues=Se(d)?null:w==Ct?[1]:Rt(V)),u.immediate!=v&&(u.immediate=v,!v&&!S&&this._set(p)),C)){let{onRest:L}=u;At(_n,y=>_t(this,n,y));let N=E(this,Ce(this,p));Qe(this._pendingCalls,N),this._pendingCalls.add(r),u.changed&&ve.batchedUpdates(()=>{u.changed=!S,L?.(N,this),S?I(a.onRest,N):u.onStart?.(N,this)})}S&&this._set(A),P?r(De(n.to,n,this._state,this)):C?this._start():Q(this)&&!c?this._pendingCalls.add(r):r(nt(A))}_focus(e){let n=this.animation;e!==n.to&&(vt(this)&&this._detach(),n.to=e,vt(this)&&this._attach())}_attach(){let e=0,{to:n}=this.animation;Se(n)&&(Rn(n,this),Re(n)&&(e=n.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Se(e)&&vn(e,this)}_set(e,n=!0){let r=ie(e);if(!R.und(r)){let o=ae(this);if(!o||!Y(r,o.getValue())){let s=It(r);!o||o.constructor!=s?Vn(this,s.create(r)):o.setValue(r),o&&ve.batchedUpdates(()=>{this._onChange(r,n)})}}return ae(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Ie(this,"onStart",E(this,Ce(this,e.to)),this))}_onChange(e,n){n||(this._onStart(),I(this.animation.onChange,e,this)),I(this.defaultProps.onChange,e,this),super._onChange(e,n)}_start(){let e=this.animation;ae(this).reset(ie(e.to)),e.immediate||(e.fromValues=e.values.map(n=>n.lastPosition)),Q(this)||(st(this,!0),ye(this)||this._resume())}_resume(){bn.skipAnimation?this.finish():Tn.start(this)}_stop(e,n){if(Q(this)){st(this,!1);let r=this.animation;At(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),An(this,{type:"idle",parent:this});let o=n?q(this.get()):E(this.get(),Ce(this,e??r.to));Qe(this._pendingCalls,o),r.changed&&(r.changed=!1,Ie(this,"onRest",o,this))}}};function Ce(t,e){let n=me(e),r=me(t.get());return Y(r,n)}function at(t,e=t.loop,n=t.to){let r=I(e);if(r){let o=r!==!0&&de(r),s=(o||t).reverse,i=!o||o.reset;return Pe({...t,loop:e,default:!1,pause:void 0,to:!s||Ee(n)?n:void 0,from:i?t.from:void 0,reset:i,...o})}}function Pe(t){let{to:e,from:n}=t=de(t),r=new Set;return R.obj(e)&&Vt(e,r),R.obj(n)&&Vt(n,r),t.keys=r.size?Array.from(r):null,t}function Ot(t){let e=Pe(t);return R.und(e.default)&&(e.default=ne(e)),e}function Vt(t,e){Pn(t,(n,r)=>n!=null&&e.add(r))}var _n=["onStart","onRest","onChange","onPause","onResume"];function _t(t,e,n){t.animation[n]=e[n]!==ke(e,n)?et(e[n],t.key):void 0}function Ie(t,e,...n){t.animation[e]?.(...n),t.defaultProps[e]?.(...n)}import{is as z,raf as kt,each as pe,noop as Ft,flush as ut,toArray as Ve,eachProp as Ut,flushCalls as On,addFluidObserver as Et}from"@react-spring/shared";var Fn=["onStart","onChange","onRest"],kn=1,le=class{id=kn++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,n){this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((n,r)=>e[r]=n.get()),e}set(e){for(let n in e){let r=e[n];z.und(r)||this.springs[n].set(r)}}update(e){return e&&this.queue.push(Pe(e)),this}start(e){let{queue:n}=this;return e?n=Ve(e).map(Pe):this.queue=[],this._flush?this._flush(this,n):(jt(this,n),ze(this,n))}stop(e,n){if(e!==!!e&&(n=e),n){let r=this.springs;pe(Ve(n),o=>r[o].stop(!!e))}else oe(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(z.und(e))this.start({pause:!0});else{let n=this.springs;pe(Ve(e),r=>n[r].pause())}return this}resume(e){if(z.und(e))this.start({pause:!1});else{let n=this.springs;pe(Ve(e),r=>n[r].resume())}return this}each(e){Ut(this.springs,e)}_onFrame(){let{onStart:e,onChange:n,onRest:r}=this._events,o=this._active.size>0,s=this._changed.size>0;(o&&!this._started||s&&!this._started)&&(this._started=!0,ut(e,([u,p])=>{p.value=this.get(),u(p,this,this._item)}));let i=!o&&this._started,a=s||i&&r.size?this.get():null;s&&n.size&&ut(n,([u,p])=>{p.value=a,u(p,this,this._item)}),i&&(this._started=!1,ut(r,([u,p])=>{p.value=a,u(p,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;kt.onFrame(this._onFrame)}};function ze(t,e){return Promise.all(e.map(n=>wt(t,n))).then(n=>be(t,n))}async function wt(t,e,n){let{keys:r,to:o,from:s,loop:i,onRest:a,onResolve:u}=e,p=z.obj(e.default)&&e.default;i&&(e.loop=!1),o===!1&&(e.to=null),s===!1&&(e.from=null);let f=z.arr(o)||z.fun(o)?o:void 0;f?(e.to=void 0,e.onRest=void 0,p&&(p.onRest=void 0)):pe(Fn,P=>{let l=e[P];if(z.fun(l)){let h=t._events[P];e[P]=({finished:g,cancelled:x})=>{let S=h.get(l);S?(g||(S.finished=!1),x&&(S.cancelled=!0)):h.set(l,{value:null,finished:g||!1,cancelled:x||!1})},p&&(p[P]=e[P])}});let d=t._state;e.pause===!d.paused?(d.paused=e.pause,On(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);let m=(r||Object.keys(t.springs)).map(P=>t.springs[P].start(e)),b=e.cancel===!0||ke(e,"cancel")===!0;(f||b&&d.asyncId)&&m.push(Me(++t._lastAsyncId,{props:e,state:d,actions:{pause:Ft,resume:Ft,start(P,l){b?(oe(d,t._lastAsyncId),l(q(t))):(P.onRest=a,l(De(f,P,d,t)))}}})),d.paused&&await new Promise(P=>{d.resumeQueue.add(P)});let c=be(t,await Promise.all(m));if(i&&c.finished&&!(n&&c.noop)){let P=at(e,i,o);if(P)return jt(t,[P]),wt(t,P,!0)}return u&&kt.batchedUpdates(()=>u(c,t,t.item)),c}function _e(t,e){let n={...t.springs};return e&&pe(Ve(e),r=>{z.und(r.keys)&&(r=Pe(r)),z.obj(r.to)||(r={...r,to:void 0}),Mt(n,r,o=>Lt(o))}),pt(t,n),n}function pt(t,e){Ut(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Et(n,t))})}function Lt(t,e){let n=new ue;return n.key=t,e&&Et(n,e),n}function Mt(t,e,n){e.keys&&pe(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function jt(t,e){pe(e,n=>{Mt(t.springs,n,r=>Lt(r,t))})}import*as Be from"react";import{useContext as Un}from"react";import{useMemoOne as En}from"@react-spring/shared";var H=({children:t,...e})=>{let n=Un(Ge),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=En(()=>({pause:r,immediate:o}),[r,o]);let{Provider:s}=Ge;return Be.createElement(s,{value:e},t)},Ge=wn(H,{});H.Provider=Ge.Provider;H.Consumer=Ge.Consumer;function wn(t,e){return Object.assign(t,Be.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}import{each as ce,is as Ke,deprecateDirectCall as Ln}from"@react-spring/shared";var fe=()=>{let t=[],e=function(r){Ln();let o=[];return ce(t,(s,i)=>{if(Ke.und(r))o.push(s.start());else{let a=n(r,s,i);a&&o.push(s.start(a))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){let o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return ce(t,r=>r.pause(...arguments)),this},e.resume=function(){return ce(t,r=>r.resume(...arguments)),this},e.set=function(r){ce(t,(o,s)=>{let i=Ke.fun(r)?r(s,o):r;i&&o.set(i)})},e.start=function(r){let o=[];return ce(t,(s,i)=>{if(Ke.und(r))o.push(s.start());else{let a=this._getProps(r,s,i);a&&o.push(s.start(a))}}),o},e.stop=function(){return ce(t,r=>r.stop(...arguments)),this},e.update=function(r){return ce(t,(o,s)=>o.update(this._getProps(r,o,s))),this};let n=function(r,o,s){return Ke.fun(r)?r(s,o):r};return e._getProps=n,e};function He(t,e,n){let r=jn.fun(e)&&e;r&&!n&&(n=[]);let o=Xe(()=>r||arguments.length==3?fe():void 0,[]),s=Nt(0),i=Dn(),a=Xe(()=>({ctrls:[],queue:[],flush(h,g){let x=_e(h,g);return s.current>0&&!a.queue.length&&!Object.keys(x).some(A=>!h.springs[A])?ze(h,g):new Promise(A=>{pt(h,x),a.queue.push(()=>{A(ze(h,g))}),i()})}}),[]),u=Nt([...a.ctrls]),p=[],f=Dt(t)||0;Xe(()=>{Ye(u.current.slice(t,f),h=>{xe(h,o),h.stop(!0)}),u.current.length=t,d(f,t)},[t]),Xe(()=>{d(0,Math.min(f,t))},n);function d(h,g){for(let x=h;x<g;x++){let S=u.current[x]||(u.current[x]=new le(null,a.flush)),A=r?r(x,S):e[x];A&&(p[x]=Ot(A))}}let m=u.current.map((h,g)=>_e(h,p[g])),b=Mn(H),c=Dt(b),P=b!==c&&Ue(b);qn(()=>{s.current++,a.ctrls=u.current;let{queue:h}=a;h.length&&(a.queue=[],Ye(h,g=>g())),Ye(u.current,(g,x)=>{o?.add(g),P&&g.start({default:b});let S=p[x];S&&(he(g,S.ref),g.ref?g.queue.push(S):g.start(S))})}),Nn(()=>()=>{Ye(a.ctrls,h=>h.stop(!0))});let l=m.map(h=>({...h}));return o?[l,o]:l}function J(t,e){let n=Qn.fun(t),[[r],o]=He(1,n?t:[t],n?e||[]:e);return n||arguments.length==2?[r,o]:r}import{useState as zn}from"react";var Gn=()=>fe(),Xo=()=>zn(Gn)[0];import{useConstant as Bn,useOnce as Kn}from"@react-spring/shared";var Wo=(t,e)=>{let n=Bn(()=>new ue(t,e));return Kn(()=>()=>{n.stop()}),n};import{each as Xn,is as qt,useIsomorphicLayoutEffect as Yn}from"@react-spring/shared";function Qt(t,e,n){let r=qt.fun(e)&&e;r&&!n&&(n=[]);let o=!0,s,i=He(t,(a,u)=>{let p=r?r(a,u):e;return s=p.ref,o=o&&p.reverse,p},n||[{}]);if(Yn(()=>{Xn(i[1].current,(a,u)=>{let p=i[1].current[u+(o?1:-1)];if(he(a,s),a.ref){p&&a.update({to:p.springs});return}p?a.start({to:p.springs}):a.start()})},n),r||arguments.length==3){let a=s??i[1];return a._getProps=(u,p,f)=>{let d=qt.fun(u)?u(f,p):u;if(d){let m=a.current[f+(d.reverse?1:-1)];return m&&(d.to=m.springs),d}},i}return i[0]}import*as Oe from"react";import{useContext as Hn,useRef as lt,useMemo as Jn}from"react";import{is as G,toArray as zt,useForceUpdate as Wn,useOnce as $n,usePrev as Zn,each as j,useIsomorphicLayoutEffect as Je}from"@react-spring/shared";function Gt(t,e,n){let r=G.fun(e)&&e,{reset:o,sort:s,trail:i=0,expires:a=!0,exitBeforeEnter:u=!1,onDestroyed:p,ref:f,config:d}=r?r():e,m=Jn(()=>r||arguments.length==3?fe():void 0,[]),b=zt(t),c=[],P=lt(null),l=o?null:P.current;Je(()=>{P.current=c}),$n(()=>(j(c,y=>{m?.add(y.ctrl),y.ctrl.ref=m}),()=>{j(P.current,y=>{y.expired&&clearTimeout(y.expirationId),xe(y.ctrl,m),y.ctrl.stop(!0)})}));let h=tr(b,r?r():e,l),g=o&&P.current||[];Je(()=>j(g,({ctrl:y,item:T,key:F})=>{xe(y,m),I(p,T,F)}));let x=[];if(l&&j(l,(y,T)=>{y.expired?(clearTimeout(y.expirationId),g.push(y)):(T=x[T]=h.indexOf(y.key),~T&&(c[T]=y))}),j(b,(y,T)=>{c[T]||(c[T]={key:h[T],item:y,phase:"mount",ctrl:new le},c[T].ctrl.item=y)}),x.length){let y=-1,{leave:T}=r?r():e;j(x,(F,k)=>{let O=l[k];~F?(y=c.indexOf(O),c[y]={...O,item:b[F]}):T&&c.splice(++y,0,O)})}G.fun(s)&&c.sort((y,T)=>s(y.item,T.item));let S=-i,A=Wn(),V=ne(e),_=new Map,v=lt(new Map),w=lt(!1);j(c,(y,T)=>{let F=y.key,k=y.phase,O=r?r():e,U,D,Jt=I(O.delay||0,F);if(k=="mount")U=O.enter,D="enter";else{let M=h.indexOf(F)<0;if(k!="leave")if(M)U=O.leave,D="leave";else if(U=O.update)D="update";else return;else if(!M)U=O.enter,D="enter";else return}if(U=I(U,y.item,T),U=G.obj(U)?de(U):{to:U},!U.config){let M=d||V.config;U.config=I(M,y.item,T,D)}S+=i;let Z={...V,delay:Jt+S,ref:f,immediate:O.immediate,reset:!1,...U};if(D=="enter"&&G.und(Z.from)){let M=r?r():e,Te=G.und(M.initial)||l?M.from:M.initial;Z.from=I(Te,y.item,T)}let{onResolve:Wt}=Z;Z.onResolve=M=>{I(Wt,M);let Te=P.current,B=Te.find(Fe=>Fe.key===F);if(B&&!(M.cancelled&&B.phase!="update")&&B.ctrl.idle){let Fe=Te.every(ee=>ee.ctrl.idle);if(B.phase=="leave"){let ee=I(a,B.item);if(ee!==!1){let Ze=ee===!0?0:ee;if(B.expired=!0,!Fe&&Ze>0){Ze<=2147483647&&(B.expirationId=setTimeout(A,Ze));return}}}Fe&&Te.some(ee=>ee.expired)&&(v.current.delete(B),u&&(w.current=!0),A())}};let ft=_e(y.ctrl,Z);D==="leave"&&u?v.current.set(y,{phase:D,springs:ft,payload:Z}):_.set(y,{phase:D,springs:ft,payload:Z})});let C=Hn(H),$=Zn(C),L=C!==$&&Ue(C);Je(()=>{L&&j(c,y=>{y.ctrl.start({default:C})})},[C]),j(_,(y,T)=>{if(v.current.size){let F=c.findIndex(k=>k.key===T.key);c.splice(F,1)}}),Je(()=>{j(v.current.size?v.current:_,({phase:y,payload:T},F)=>{let{ctrl:k}=F;F.phase=y,m?.add(k),L&&y=="enter"&&k.start({default:C}),T&&(he(k,T.ref),(k.ref||m)&&!w.current?k.update(T):(k.start(T),w.current&&(w.current=!1)))})},o?void 0:n);let N=y=>Oe.createElement(Oe.Fragment,null,c.map((T,F)=>{let{springs:k}=_.get(T)||T.ctrl,O=y({...k},T.item,T,F);return O&&O.type?Oe.createElement(O.type,{...O.props,key:G.str(T.key)||G.num(T.key)?T.key:T.ctrl.id,ref:O.ref}):O}));return m?[N,m]:N}var er=1;function tr(t,{key:e,keys:n=e},r){if(n===null){let o=new Set;return t.map(s=>{let i=r&&r.find(a=>a.item===s&&a.phase!=="leave"&&!o.has(a));return i?(o.add(i),i.key):er++})}return G.und(n)?t:G.fun(n)?t.map(n):zt(n)}import{each as nr,onScroll as rr,useIsomorphicLayoutEffect as or}from"@react-spring/shared";var hs=({container:t,...e}={})=>{let[n,r]=J(()=>({scrollX:0,scrollY:0,scrollXProgress:0,scrollYProgress:0,...e}),[]);return or(()=>{let o=rr(({x:s,y:i})=>{r.start({scrollX:s.current,scrollXProgress:s.progress,scrollY:i.current,scrollYProgress:i.progress})},{container:t?.current||void 0});return()=>{nr(Object.values(n),s=>s.stop()),o()}},[]),n};import{onResize as sr,each as ir,useIsomorphicLayoutEffect as ar}from"@react-spring/shared";var Ps=({container:t,...e})=>{let[n,r]=J(()=>({width:0,height:0,...e}),[]);return ar(()=>{let o=sr(({width:s,height:i})=>{r.start({width:s,height:i,immediate:n.width.get()===0||n.height.get()===0})},{container:t?.current||void 0});return()=>{ir(Object.values(n),s=>s.stop()),o()}},[]),n};import{useRef as ur,useState as pr}from"react";import{is as Bt,useIsomorphicLayoutEffect as lr}from"@react-spring/shared";var cr={any:0,all:1};function Cs(t,e){let[n,r]=pr(!1),o=ur(),s=Bt.fun(t)&&t,i=s?s():{},{to:a={},from:u={},...p}=i,f=s?e:t,[d,m]=J(()=>({from:u,...p}),[]);return lr(()=>{let b=o.current,{root:c,once:P,amount:l="any",...h}=f??{};if(!b||P&&n||typeof IntersectionObserver>"u")return;let g=new WeakMap,x=()=>(a&&m.start(a),r(!0),P?void 0:()=>{u&&m.start(u),r(!1)}),S=V=>{V.forEach(_=>{let v=g.get(_.target);if(_.isIntersecting!==!!v)if(_.isIntersecting){let w=x();Bt.fun(w)?g.set(_.target,w):A.unobserve(_.target)}else v&&(v(),g.delete(_.target))})},A=new IntersectionObserver(S,{root:c&&c.current||void 0,threshold:typeof l=="number"||Array.isArray(l)?l:cr[l],...h});return A.observe(b),()=>A.unobserve(b)},[f]),s?[o,d]:[o,n]}function qs({children:t,...e}){return t(J(e))}import{is as fr}from"@react-spring/shared";function Bs({items:t,children:e,...n}){let r=Qt(t.length,n);return t.map((o,s)=>{let i=e(o,s);return fr.fun(i)?i(r[s]):i})}function Ys({items:t,children:e,...n}){return Gt(t,n)(e)}import{deprecateInterpolate as Cr}from"@react-spring/shared";import{is as dr,raf as mr,each as $e,isEqual as hr,toArray as We,frameLoop as gr,getFluidValue as Kt,createInterpolator as yr,Globals as Sr,callFluidObservers as Pr,addFluidObserver as Tr,removeFluidObserver as xr,hasFluidValue as Xt}from"@react-spring/shared";import{getAnimated as br,setAnimated as Ar,getAnimatedType as Rr,getPayload as Ht}from"@react-spring/animated";var W=class extends X{constructor(n,r){super();this.source=n;this.calc=yr(...r);let o=this._get(),s=Rr(o);Ar(this,s.create(o))}key;idle=!0;calc;_active=new Set;advance(n){let r=this._get(),o=this.get();hr(r,o)||(br(this).setValue(r),this._onChange(r,this.idle)),!this.idle&&Yt(this._active)&&ct(this)}_get(){let n=dr.arr(this.source)?this.source.map(Kt):We(Kt(this.source));return this.calc(...n)}_start(){this.idle&&!Yt(this._active)&&(this.idle=!1,$e(Ht(this),n=>{n.done=!1}),Sr.skipAnimation?(mr.batchedUpdates(()=>this.advance()),ct(this)):gr.start(this))}_attach(){let n=1;$e(We(this.source),r=>{Xt(r)&&Tr(r,this),Re(r)&&(r.idle||this._active.add(r),n=Math.max(n,r.priority+1))}),this.priority=n,this._start()}_detach(){$e(We(this.source),n=>{Xt(n)&&xr(n,this)}),this._active.clear(),ct(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=We(this.source).reduce((r,o)=>Math.max(r,(Re(o)?o.priority:0)+1),0))}};function vr(t){return t.idle!==!1}function Yt(t){return!t.size||Array.from(t).every(vr)}function ct(t){t.idle||(t.idle=!0,$e(Ht(t),e=>{e.done=!0}),Pr(t,{type:"idle",parent:t}))}var ui=(t,...e)=>new W(t,e),pi=(t,...e)=>(Cr(),new W(t,e));import{Globals as Ir,frameLoop as Vr,createStringInterpolator as _r}from"@react-spring/shared";Ir.assign({createStringInterpolator:_r,to:(t,e)=>new W(t,e)});var di=Vr.advance;import{createInterpolator as Ui,useIsomorphicLayoutEffect as Ei,useReducedMotion as wi,easings as Li}from"@react-spring/shared";export*from"@react-spring/types";export{Ae as BailSignal,le as Controller,X as FrameValue,Ir as Globals,W as Interpolation,qs as Spring,H as SpringContext,fe as SpringRef,ue as SpringValue,Bs as Trail,Ys as Transition,mt as config,Ui as createInterpolator,Li as easings,de as inferTo,pi as interpolate,ui as to,di as update,wr as useChain,Cs as useInView,Ei as useIsomorphicLayoutEffect,wi as useReducedMotion,Ps as useResize,hs as useScroll,J as useSpring,Xo as useSpringRef,Wo as useSpringValue,He as useSprings,Qt as useTrail,Gt as useTransition}; |
@@ -1188,3 +1188,3 @@ import { InterpolatorFn, InterpolatorArgs, EasingFunction, Lookup, Any, UnknownProps, Falsy, OneOrMore, Remap, ObjectFromUnion, Constrain, ObjectType, Merge, NoInfer, InterpolatorConfig, Animatable, ExtrapolateType } from '@react-spring/types'; | ||
interface UseResizeOptions extends Omit<SpringProps, 'to' | 'from'> { | ||
container?: MutableRefObject<HTMLElement>; | ||
container?: MutableRefObject<HTMLElement | null | undefined>; | ||
} | ||
@@ -1250,3 +1250,3 @@ /** | ||
declare function Transition<Item extends any, Props extends TransitionComponentProps<Item>>(props: TransitionComponentProps<Item> | (Props & Valid<Props, TransitionComponentProps<Item, Props>>)): JSX.Element; | ||
declare function Transition<Item, Props extends TransitionComponentProps<Item>>(props: TransitionComponentProps<Item> | (Props & Valid<Props, TransitionComponentProps<Item, Props>>)): JSX.Element; | ||
@@ -1324,2 +1324,2 @@ /** Map the value of one or more dependencies */ | ||
export { AnimationProps, AnimationResult, AsyncResult, BailSignal, Change, Controller, ControllerFlushFn, ControllerProps, ControllerUpdate, EventProp, ForwardProps, FrameValue, GoalProp, GoalValue, GoalValues, InferTo, InlineToProps, Interpolated, Interpolation, Interpolator, IntersectionArgs, ItemKeys, LoopProp, MatchProp, OnChange, OnPause, OnProps, OnResolve, OnRest, OnResume, OnStart, PickAnimated, ReservedEventProps, ReservedProps, Spring, SpringChain, SpringComponentProps, SpringConfig, SpringContext, SpringProps, SpringRef, SpringTo, SpringToFn, SpringUpdate, SpringUpdateFn, SpringValue, SpringValues, Springify, SpringsUpdate, ToProps, ToValues, Trail, TrailComponentProps, Transition, TransitionComponentProps, TransitionFn, TransitionFrom, TransitionKey, TransitionRenderFn, TransitionState, TransitionTo, TransitionValues, UseResizeOptions, UseScrollOptions, UseSpringProps, UseSpringsProps, UseTrailProps, UseTransitionProps, VelocityProp, config, inferTo, interpolate, to, update, useChain, useInView, useResize, useScroll, useSpring, useSpringRef, useSpringValue, useSprings, useTrail, useTransition }; | ||
export { AnimationConfig, AnimationProps, AnimationResult, AsyncResult, BailSignal, Change, Controller, ControllerFlushFn, ControllerProps, ControllerUpdate, EventProp, ForwardProps, FrameValue, GoalProp, GoalValue, GoalValues, InferTo, InlineToProps, Interpolated, Interpolation, Interpolator, IntersectionArgs, ItemKeys, LoopProp, MatchProp, OnChange, OnPause, OnProps, OnResolve, OnRest, OnResume, OnStart, PickAnimated, ReservedEventProps, ReservedProps, Spring, SpringChain, SpringComponentProps, SpringConfig, SpringContext, SpringProps, SpringRef, SpringTo, SpringToFn, SpringUpdate, SpringUpdateFn, SpringValue, SpringValues, Springify, SpringsUpdate, ToProps, ToValues, Trail, TrailComponentProps, Transition, TransitionComponentProps, TransitionFn, TransitionFrom, TransitionKey, TransitionRenderFn, TransitionState, TransitionTo, TransitionValues, UseResizeOptions, UseScrollOptions, UseSpringProps, UseSpringsProps, UseTrailProps, UseTransitionProps, VelocityProp, config, inferTo, interpolate, to, update, useChain, useInView, useResize, useScroll, useSpring, useSpringRef, useSpringValue, useSprings, useTrail, useTransition }; |
@@ -1,1 +0,1 @@ | ||
"use strict";var qt=Object.create;var ze=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Gt=Object.getPrototypeOf,Bt=Object.prototype.hasOwnProperty;var Kt=(t,e)=>{for(var n in e)ze(t,n,{get:e[n],enumerable:!0})},Qe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of zt(e))!Bt.call(t,o)&&o!==n&&ze(t,o,{get:()=>e[o],enumerable:!(r=Qt(e,o))||r.enumerable});return t},L=(t,e,n)=>(Qe(t,e,"default"),n&&Qe(n,e,"default")),Pt=(t,e,n)=>(n=t!=null?qt(Gt(t)):{},Qe(e||!t||!t.__esModule?ze(n,"default",{value:t,enumerable:!0}):n,t)),Xt=t=>Qe(ze({},"__esModule",{value:!0}),t);var U={};Kt(U,{BailSignal:()=>Ce,Controller:()=>pe,FrameValue:()=>te,Globals:()=>Ae.Globals,Interpolation:()=>se,Spring:()=>mn,SpringContext:()=>re,SpringRef:()=>le,SpringValue:()=>ue,Trail:()=>hn,Transition:()=>gn,config:()=>it,createInterpolator:()=>fe.createInterpolator,easings:()=>fe.easings,inferTo:()=>Se,interpolate:()=>Pn,to:()=>Sn,update:()=>Tn,useChain:()=>$t,useInView:()=>dn,useIsomorphicLayoutEffect:()=>fe.useIsomorphicLayoutEffect,useReducedMotion:()=>fe.useReducedMotion,useResize:()=>cn,useScroll:()=>ln,useSpring:()=>oe,useSpringRef:()=>sn,useSpringValue:()=>an,useSprings:()=>je,useTrail:()=>ht,useTransition:()=>gt});module.exports=Xt(U);var Z=require("@react-spring/shared");var V=require("@react-spring/shared");function k(t,...e){return V.is.fun(t)?t(...e):t}var ge=(t,e)=>t===!0||!!(e&&t&&(V.is.fun(t)?t(e):(0,V.toArray)(t).includes(e))),st=(t,e)=>V.is.obj(t)?e&&t[e]:t;var Ge=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,Yt=t=>t,ye=(t,e=Yt)=>{let n=Ht;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));let r={};for(let o of n){let s=e(t[o],o);V.is.und(s)||(r[o]=s)}return r},Ht=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Jt={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Wt(t){let e={},n=0;if((0,V.eachProp)(t,(r,o)=>{Jt[o]||(e[o]=r,n++)}),n)return e}function Se(t){let e=Wt(t);if(e){let n={to:e};return(0,V.eachProp)(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function Re(t){return t=(0,V.getFluidValue)(t),V.is.arr(t)?t.map(Re):(0,V.isAnimatedString)(t)?V.Globals.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function Be(t){for(let e in t)return!0;return!1}function Ke(t){return V.is.fun(t)||V.is.arr(t)&&V.is.obj(t[0])}function ke(t,e){t.ref?.delete(t),e?.delete(t)}function ve(t,e){e&&t.ref!==e&&(t.ref?.delete(t),e.add(t),t.ref=e)}function $t(t,e,n=1e3){(0,Z.useIsomorphicLayoutEffect)(()=>{if(e){let r=0;(0,Z.each)(t,(o,s)=>{let u=o.current;if(u.length){let a=n*e[s];isNaN(a)?a=r:r=a,(0,Z.each)(u,p=>{(0,Z.each)(p.queue,l=>{let d=l.delay;l.delay=m=>a+k(d||0,m)})}),o.start()}})}else{let r=Promise.resolve();(0,Z.each)(t,o=>{let s=o.current;if(s.length){let u=s.map(a=>{let p=a.queue;return a.queue=[],p});r=r.then(()=>((0,Z.each)(s,(a,p)=>(0,Z.each)(u[p]||[],l=>a.queue.push(l))),Promise.all(o.start())))}})}})}var Et=require("@react-spring/shared");var J=require("react"),j=require("@react-spring/shared");var i=require("@react-spring/shared"),_=require("@react-spring/animated");var H=require("@react-spring/shared");var it={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};var at={...it.default,mass:1,damping:1,easing:H.easings.linear,clamp:!1},Xe=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,at)}};function xt(t,e,n){n&&(n={...n},Tt(n,e),e={...n,...e}),Tt(t,e),Object.assign(t,e);for(let u in at)t[u]==null&&(t[u]=at[u]);let{mass:r,frequency:o,damping:s}=t;return H.is.und(o)||(o<.01&&(o=.01),s<0&&(s=0),t.tension=Math.pow(2*Math.PI/o,2)*r,t.friction=4*Math.PI*s*r/o),t}function Tt(t,e){if(!H.is.und(e.decay))t.duration=void 0;else{let n=!H.is.und(e.tension)||!H.is.und(e.friction);(n||!H.is.und(e.frequency)||!H.is.und(e.damping)||!H.is.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var bt=[],Ye=class{changed=!1;values=bt;toValues=null;fromValues=bt;to;from;config=new Xe;immediate=!1};var Pe=require("@react-spring/shared");function He(t,{key:e,props:n,defaultProps:r,state:o,actions:s}){return new Promise((u,a)=>{let p,l,d=ge(n.cancel??r?.cancel,e);if(d)v();else{Pe.is.und(n.pause)||(o.paused=ge(n.pause,e));let f=r?.pause;f!==!0&&(f=o.paused||ge(f,e)),p=k(n.delay||0,e),f?(o.resumeQueue.add(h),s.pause()):(s.resume(),h())}function m(){o.resumeQueue.add(h),o.timeouts.delete(l),l.cancel(),p=l.time-Pe.raf.now()}function h(){p>0&&!Pe.Globals.skipAnimation?(o.delayed=!0,l=Pe.raf.setTimeout(v,p),o.pauseQueue.add(m),o.timeouts.add(l)):v()}function v(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(m),o.timeouts.delete(l),t<=(o.cancelId||0)&&(d=!0);try{s.start({...n,callId:t,cancel:d},u)}catch(f){a(f)}}})}var Q=require("@react-spring/shared");var Ue=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?ee(t.get()):e.every(n=>n.noop)?ut(t.get()):G(t.get(),e.every(n=>n.finished)),ut=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),G=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),ee=t=>({value:t,cancelled:!0,finished:!1});function We(t,e,n,r){let{callId:o,parentId:s,onRest:u}=e,{asyncTo:a,promise:p}=n;return!s&&t===a&&!e.reset?p:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;let l=ye(e,(c,g)=>g==="onRest"?void 0:c),d,m,h=new Promise((c,g)=>(d=c,m=g)),v=c=>{let g=o<=(n.cancelId||0)&&ee(r)||o!==n.asyncId&&G(r,!1);if(g)throw c.result=g,m(c),c},f=(c,g)=>{let y=new Ce,A=new Je;return(async()=>{if(Q.Globals.skipAnimation)throw Te(n),A.result=G(r,!1),m(A),A;v(y);let P=Q.is.obj(c)?{...c}:{...g,to:c};P.parentId=o,(0,Q.eachProp)(l,(E,w)=>{Q.is.und(P[w])&&(P[w]=E)});let I=await r.start(P);return v(y),n.paused&&await new Promise(E=>{n.resumeQueue.add(E)}),I})()},T;if(Q.Globals.skipAnimation)return Te(n),G(r,!1);try{let c;Q.is.arr(t)?c=(async g=>{for(let y of g)await f(y)})(t):c=Promise.resolve(t(f,r.stop.bind(r))),await Promise.all([c.then(d),h]),T=G(r.get(),!0,!1)}catch(c){if(c instanceof Ce)T=c.result;else if(c instanceof Je)T=c.result;else throw c}finally{o==n.asyncId&&(n.asyncId=s,n.asyncTo=s?a:void 0,n.promise=s?p:void 0)}return Q.is.fun(u)&&Q.raf.batchedUpdates(()=>{u(T,r,r.item)}),T})()}function Te(t,e){(0,Q.flush)(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var Ce=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Je=class extends Error{result;constructor(){super("SkipAnimationSignal")}};var X=require("@react-spring/shared"),At=require("@react-spring/animated"),Ee=t=>t instanceof te,Zt=1,te=class extends X.FluidValue{id=Zt++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=(0,At.getAnimated)(this);return e&&e.getValue()}to(...e){return X.Globals.to(this,e)}interpolate(...e){return(0,X.deprecateInterpolate)(),X.Globals.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,n=!1){(0,X.callFluidObservers)(this,{type:"change",parent:this,value:e,idle:n})}_onPriorityChange(e){this.idle||X.frameLoop.sort(this),(0,X.callFluidObservers)(this,{type:"priority",parent:this,priority:e})}};var xe=Symbol.for("SpringPhase"),Rt=1,pt=2,lt=4,$e=t=>(t[xe]&Rt)>0,ne=t=>(t[xe]&pt)>0,Ie=t=>(t[xe]<)>0,ct=(t,e)=>e?t[xe]|=pt|Rt:t[xe]&=~pt,ft=(t,e)=>e?t[xe]|=lt:t[xe]&=~lt;var ue=class extends te{key;animation=new Ye;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,n){if(super(),!i.is.und(e)||!i.is.und(n)){let r=i.is.obj(e)?{...e}:{...n,from:e};i.is.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(ne(this)||this._state.asyncTo)||Ie(this)}get goal(){return(0,i.getFluidValue)(this.animation.to)}get velocity(){let e=(0,_.getAnimated)(this);return e instanceof _.AnimatedValue?e.lastVelocity||0:e.getPayload().map(n=>n.lastVelocity||0)}get hasAnimated(){return $e(this)}get isAnimating(){return ne(this)}get isPaused(){return Ie(this)}get isDelayed(){return this._state.delayed}advance(e){let n=!0,r=!1,o=this.animation,{config:s,toValues:u}=o,a=(0,_.getPayload)(o.to);!a&&(0,i.hasFluidValue)(o.to)&&(u=(0,i.toArray)((0,i.getFluidValue)(o.to))),o.values.forEach((d,m)=>{if(d.done)return;let h=d.constructor==_.AnimatedString?1:a?a[m].lastPosition:u[m],v=o.immediate,f=h;if(!v){if(f=d.lastPosition,s.tension<=0){d.done=!0;return}let T=d.elapsedTime+=e,c=o.fromValues[m],g=d.v0!=null?d.v0:d.v0=i.is.arr(s.velocity)?s.velocity[m]:s.velocity,y,A=s.precision||(c==h?.005:Math.min(1,Math.abs(h-c)*.001));if(i.is.und(s.duration))if(s.decay){let P=s.decay===!0?.998:s.decay,I=Math.exp(-(1-P)*T);f=c+g/(1-P)*(1-I),v=Math.abs(d.lastPosition-f)<=A,y=g*I}else{y=d.lastVelocity==null?g:d.lastVelocity;let P=s.restVelocity||A/10,I=s.clamp?0:s.bounce,E=!i.is.und(I),w=c==h?d.v0>0:c<h,O,B=!1,F=1,de=Math.ceil(e/F);for(let K=0;K<de&&(O=Math.abs(y)>P,!(!O&&(v=Math.abs(h-f)<=A,v)));++K){E&&(B=f==h||f>h==w,B&&(y=-y*I,f=h));let W=-s.tension*1e-6*(f-h),S=-s.friction*.001*y,b=(W+S)/s.mass;y=y+b*F,f=f+y*F}}else{let P=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,d.durationProgress>0&&(d.elapsedTime=s.duration*d.durationProgress,T=d.elapsedTime+=e)),P=(s.progress||0)+T/this._memoizedDuration,P=P>1?1:P<0?0:P,d.durationProgress=P),f=c+s.easing(P)*(h-c),y=(f-d.lastPosition)/e,v=P==1}d.lastVelocity=y,Number.isNaN(f)&&(console.warn("Got NaN while animating:",this),v=!0)}a&&!a[m].done&&(v=!1),v?d.done=!0:n=!1,d.setValue(f,s.round)&&(r=!0)});let p=(0,_.getAnimated)(this),l=p.getValue();if(n){let d=(0,i.getFluidValue)(o.to);(l!==d||r)&&!s.decay?(p.setValue(d),this._onChange(d)):r&&s.decay&&this._onChange(l),this._stop()}else r&&this._onChange(l)}set(e){return i.raf.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(ne(this)){let{to:e,config:n}=this.animation;i.raf.batchedUpdates(()=>{this._onStart(),n.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,n){let r;return i.is.und(e)?(r=this.queue||[],this.queue=[]):r=[i.is.obj(e)?e:{...n,to:e}],Promise.all(r.map(o=>this._update(o))).then(o=>Ue(this,o))}stop(e){let{to:n}=this.animation;return this._focus(this.get()),Te(this._state,e&&this._lastCallId),i.raf.batchedUpdates(()=>this._stop(n,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){let n=this.key||"",{to:r,from:o}=e;r=i.is.obj(r)?r[n]:r,(r==null||Ke(r))&&(r=void 0),o=i.is.obj(o)?o[n]:o,o==null&&(o=void 0);let s={to:r,from:o};return $e(this)||(e.reverse&&([r,o]=[o,r]),o=(0,i.getFluidValue)(o),i.is.und(o)?(0,_.getAnimated)(this)||this._set(r):this._set(o)),s}_update({...e},n){let{key:r,defaultProps:o}=this;e.default&&Object.assign(o,ye(e,(a,p)=>/^on/.test(p)?st(a,r):a)),Ct(this,e,"onProps"),Le(this,"onProps",e,this);let s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let u=this._state;return He(++this._lastCallId,{key:r,props:e,defaultProps:o,state:u,actions:{pause:()=>{Ie(this)||(ft(this,!0),(0,i.flushCalls)(u.pauseQueue),Le(this,"onPause",G(this,we(this,this.animation.to)),this))},resume:()=>{Ie(this)&&(ft(this,!1),ne(this)&&this._resume(),(0,i.flushCalls)(u.resumeQueue),Le(this,"onResume",G(this,we(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(a=>{if(e.loop&&a.finished&&!(n&&a.noop)){let p=dt(e);if(p)return this._update(p,!0)}return a})}_merge(e,n,r){if(n.cancel)return this.stop(!0),r(ee(this));let o=!i.is.und(e.to),s=!i.is.und(e.from);if(o||s)if(n.callId>this._lastToId)this._lastToId=n.callId;else return r(ee(this));let{key:u,defaultProps:a,animation:p}=this,{to:l,from:d}=p,{to:m=l,from:h=d}=e;s&&!o&&(!n.default||i.is.und(m))&&(m=h),n.reverse&&([m,h]=[h,m]);let v=!(0,i.isEqual)(h,d);v&&(p.from=h),h=(0,i.getFluidValue)(h);let f=!(0,i.isEqual)(m,l);f&&this._focus(m);let T=Ke(n.to),{config:c}=p,{decay:g,velocity:y}=c;(o||s)&&(c.velocity=0),n.config&&!T&&xt(c,k(n.config,u),n.config!==a.config?k(a.config,u):void 0);let A=(0,_.getAnimated)(this);if(!A||i.is.und(m))return r(G(this,!0));let P=i.is.und(n.reset)?s&&!n.default:!i.is.und(h)&&ge(n.reset,u),I=P?h:this.get(),E=Re(m),w=i.is.num(E)||i.is.arr(E)||(0,i.isAnimatedString)(E),O=!T&&(!w||ge(a.immediate||n.immediate,u));if(f){let K=(0,_.getAnimatedType)(m);if(K!==A.constructor)if(O)A=this._set(E);else throw Error(`Cannot animate between ${A.constructor.name} and ${K.name}, as the "to" prop suggests`)}let B=A.constructor,F=(0,i.hasFluidValue)(m),de=!1;if(!F){let K=P||!$e(this)&&v;(f||K)&&(de=(0,i.isEqual)(Re(I),E),F=!de),(!(0,i.isEqual)(p.immediate,O)&&!O||!(0,i.isEqual)(c.decay,g)||!(0,i.isEqual)(c.velocity,y))&&(F=!0)}if(de&&ne(this)&&(p.changed&&!P?F=!0:F||this._stop(l)),!T&&((F||(0,i.hasFluidValue)(l))&&(p.values=A.getPayload(),p.toValues=(0,i.hasFluidValue)(m)?null:B==_.AnimatedString?[1]:(0,i.toArray)(E)),p.immediate!=O&&(p.immediate=O,!O&&!P&&this._set(l)),F)){let{onRest:K}=p;(0,i.each)(en,S=>Ct(this,n,S));let W=G(this,we(this,l));(0,i.flushCalls)(this._pendingCalls,W),this._pendingCalls.add(r),p.changed&&i.raf.batchedUpdates(()=>{p.changed=!P,K?.(W,this),P?k(a.onRest,W):p.onStart?.(W,this)})}P&&this._set(I),T?r(We(n.to,n,this._state,this)):F?this._start():ne(this)&&!f?this._pendingCalls.add(r):r(ut(I))}_focus(e){let n=this.animation;e!==n.to&&((0,i.getFluidObservers)(this)&&this._detach(),n.to=e,(0,i.getFluidObservers)(this)&&this._attach())}_attach(){let e=0,{to:n}=this.animation;(0,i.hasFluidValue)(n)&&((0,i.addFluidObserver)(n,this),Ee(n)&&(e=n.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;(0,i.hasFluidValue)(e)&&(0,i.removeFluidObserver)(e,this)}_set(e,n=!0){let r=(0,i.getFluidValue)(e);if(!i.is.und(r)){let o=(0,_.getAnimated)(this);if(!o||!(0,i.isEqual)(r,o.getValue())){let s=(0,_.getAnimatedType)(r);!o||o.constructor!=s?(0,_.setAnimated)(this,s.create(r)):o.setValue(r),o&&i.raf.batchedUpdates(()=>{this._onChange(r,n)})}}return(0,_.getAnimated)(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Le(this,"onStart",G(this,we(this,e.to)),this))}_onChange(e,n){n||(this._onStart(),k(this.animation.onChange,e,this)),k(this.defaultProps.onChange,e,this),super._onChange(e,n)}_start(){let e=this.animation;(0,_.getAnimated)(this).reset((0,i.getFluidValue)(e.to)),e.immediate||(e.fromValues=e.values.map(n=>n.lastPosition)),ne(this)||(ct(this,!0),Ie(this)||this._resume())}_resume(){i.Globals.skipAnimation?this.finish():i.frameLoop.start(this)}_stop(e,n){if(ne(this)){ct(this,!1);let r=this.animation;(0,i.each)(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),(0,i.callFluidObservers)(this,{type:"idle",parent:this});let o=n?ee(this.get()):G(this.get(),we(this,e??r.to));(0,i.flushCalls)(this._pendingCalls,o),r.changed&&(r.changed=!1,Le(this,"onRest",o,this))}}};function we(t,e){let n=Re(e),r=Re(t.get());return(0,i.isEqual)(r,n)}function dt(t,e=t.loop,n=t.to){let r=k(e);if(r){let o=r!==!0&&Se(r),s=(o||t).reverse,u=!o||o.reset;return Ve({...t,loop:e,default:!1,pause:void 0,to:!s||Ke(n)?n:void 0,from:u?t.from:void 0,reset:u,...o})}}function Ve(t){let{to:e,from:n}=t=Se(t),r=new Set;return i.is.obj(e)&&vt(e,r),i.is.obj(n)&&vt(n,r),t.keys=r.size?Array.from(r):null,t}function It(t){let e=Ve(t);return i.is.und(e.default)&&(e.default=ye(e)),e}function vt(t,e){(0,i.eachProp)(t,(n,r)=>n!=null&&e.add(r))}var en=["onStart","onRest","onChange","onPause","onResume"];function Ct(t,e,n){t.animation[n]=e[n]!==Ge(e,n)?st(e[n],t.key):void 0}function Le(t,e,...n){t.animation[e]?.(...n),t.defaultProps[e]?.(...n)}var x=require("@react-spring/shared");var tn=["onStart","onChange","onRest"],nn=1,pe=class{id=nn++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,n){this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((n,r)=>e[r]=n.get()),e}set(e){for(let n in e){let r=e[n];x.is.und(r)||this.springs[n].set(r)}}update(e){return e&&this.queue.push(Ve(e)),this}start(e){let{queue:n}=this;return e?n=(0,x.toArray)(e).map(Ve):this.queue=[],this._flush?this._flush(this,n):(Ft(this,n),Ze(this,n))}stop(e,n){if(e!==!!e&&(n=e),n){let r=this.springs;(0,x.each)((0,x.toArray)(n),o=>r[o].stop(!!e))}else Te(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(x.is.und(e))this.start({pause:!0});else{let n=this.springs;(0,x.each)((0,x.toArray)(e),r=>n[r].pause())}return this}resume(e){if(x.is.und(e))this.start({pause:!1});else{let n=this.springs;(0,x.each)((0,x.toArray)(e),r=>n[r].resume())}return this}each(e){(0,x.eachProp)(this.springs,e)}_onFrame(){let{onStart:e,onChange:n,onRest:r}=this._events,o=this._active.size>0,s=this._changed.size>0;(o&&!this._started||s&&!this._started)&&(this._started=!0,(0,x.flush)(e,([p,l])=>{l.value=this.get(),p(l,this,this._item)}));let u=!o&&this._started,a=s||u&&r.size?this.get():null;s&&n.size&&(0,x.flush)(n,([p,l])=>{l.value=a,p(l,this,this._item)}),u&&(this._started=!1,(0,x.flush)(r,([p,l])=>{l.value=a,p(l,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;x.raf.onFrame(this._onFrame)}};function Ze(t,e){return Promise.all(e.map(n=>Vt(t,n))).then(n=>Ue(t,n))}async function Vt(t,e,n){let{keys:r,to:o,from:s,loop:u,onRest:a,onResolve:p}=e,l=x.is.obj(e.default)&&e.default;u&&(e.loop=!1),o===!1&&(e.to=null),s===!1&&(e.from=null);let d=x.is.arr(o)||x.is.fun(o)?o:void 0;d?(e.to=void 0,e.onRest=void 0,l&&(l.onRest=void 0)):(0,x.each)(tn,T=>{let c=e[T];if(x.is.fun(c)){let g=t._events[T];e[T]=({finished:y,cancelled:A})=>{let P=g.get(c);P?(y||(P.finished=!1),A&&(P.cancelled=!0)):g.set(c,{value:null,finished:y||!1,cancelled:A||!1})},l&&(l[T]=e[T])}});let m=t._state;e.pause===!m.paused?(m.paused=e.pause,(0,x.flushCalls)(e.pause?m.pauseQueue:m.resumeQueue)):m.paused&&(e.pause=!0);let h=(r||Object.keys(t.springs)).map(T=>t.springs[T].start(e)),v=e.cancel===!0||Ge(e,"cancel")===!0;(d||v&&m.asyncId)&&h.push(He(++t._lastAsyncId,{props:e,state:m,actions:{pause:x.noop,resume:x.noop,start(T,c){v?(Te(m,t._lastAsyncId),c(ee(t))):(T.onRest=a,c(We(d,T,m,t)))}}})),m.paused&&await new Promise(T=>{m.resumeQueue.add(T)});let f=Ue(t,await Promise.all(h));if(u&&f.finished&&!(n&&f.noop)){let T=dt(e,u,o);if(T)return Ft(t,[T]),Vt(t,T,!0)}return p&&x.raf.batchedUpdates(()=>p(f,t,t.item)),f}function Me(t,e){let n={...t.springs};return e&&(0,x.each)((0,x.toArray)(e),r=>{x.is.und(r.keys)&&(r=Ve(r)),x.is.obj(r.to)||(r={...r,to:void 0}),Ot(n,r,o=>_t(o))}),mt(t,n),n}function mt(t,e){(0,x.eachProp)(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,(0,x.addFluidObserver)(n,t))})}function _t(t,e){let n=new ue;return n.key=t,e&&(0,x.addFluidObserver)(n,e),n}function Ot(t,e,n){e.keys&&(0,x.each)(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function Ft(t,e){(0,x.each)(e,n=>{Ot(t.springs,n,r=>_t(r,t))})}var tt=Pt(require("react")),kt=require("react"),Ut=require("@react-spring/shared"),re=({children:t,...e})=>{let n=(0,kt.useContext)(et),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=(0,Ut.useMemoOne)(()=>({pause:r,immediate:o}),[r,o]);let{Provider:s}=et;return tt.createElement(s,{value:e},t)},et=rn(re,{});re.Provider=et.Provider;re.Consumer=et.Consumer;function rn(t,e){return Object.assign(t,tt.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var q=require("@react-spring/shared"),le=()=>{let t=[],e=function(r){(0,q.deprecateDirectCall)();let o=[];return(0,q.each)(t,(s,u)=>{if(q.is.und(r))o.push(s.start());else{let a=n(r,s,u);a&&o.push(s.start(a))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){let o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return(0,q.each)(t,r=>r.pause(...arguments)),this},e.resume=function(){return(0,q.each)(t,r=>r.resume(...arguments)),this},e.set=function(r){(0,q.each)(t,(o,s)=>{let u=q.is.fun(r)?r(s,o):r;u&&o.set(u)})},e.start=function(r){let o=[];return(0,q.each)(t,(s,u)=>{if(q.is.und(r))o.push(s.start());else{let a=this._getProps(r,s,u);a&&o.push(s.start(a))}}),o},e.stop=function(){return(0,q.each)(t,r=>r.stop(...arguments)),this},e.update=function(r){return(0,q.each)(t,(o,s)=>o.update(this._getProps(r,o,s))),this};let n=function(r,o,s){return q.is.fun(r)?r(s,o):r};return e._getProps=n,e};function je(t,e,n){let r=j.is.fun(e)&&e;r&&!n&&(n=[]);let o=(0,J.useMemo)(()=>r||arguments.length==3?le():void 0,[]),s=(0,J.useRef)(0),u=(0,j.useForceUpdate)(),a=(0,J.useMemo)(()=>({ctrls:[],queue:[],flush(g,y){let A=Me(g,y);return s.current>0&&!a.queue.length&&!Object.keys(A).some(I=>!g.springs[I])?Ze(g,y):new Promise(I=>{mt(g,A),a.queue.push(()=>{I(Ze(g,y))}),u()})}}),[]),p=(0,J.useRef)([...a.ctrls]),l=[],d=(0,j.usePrev)(t)||0;(0,J.useMemo)(()=>{(0,j.each)(p.current.slice(t,d),g=>{ke(g,o),g.stop(!0)}),p.current.length=t,m(d,t)},[t]),(0,J.useMemo)(()=>{m(0,Math.min(d,t))},n);function m(g,y){for(let A=g;A<y;A++){let P=p.current[A]||(p.current[A]=new pe(null,a.flush)),I=r?r(A,P):e[A];I&&(l[A]=It(I))}}let h=p.current.map((g,y)=>Me(g,l[y])),v=(0,J.useContext)(re),f=(0,j.usePrev)(v),T=v!==f&&Be(v);(0,j.useIsomorphicLayoutEffect)(()=>{s.current++,a.ctrls=p.current;let{queue:g}=a;g.length&&(a.queue=[],(0,j.each)(g,y=>y())),(0,j.each)(p.current,(y,A)=>{o?.add(y),T&&y.start({default:v});let P=l[A];P&&(ve(y,P.ref),y.ref?y.queue.push(P):y.start(P))})}),(0,j.useOnce)(()=>()=>{(0,j.each)(a.ctrls,g=>g.stop(!0))});let c=h.map(g=>({...g}));return o?[c,o]:c}function oe(t,e){let n=Et.is.fun(t),[[r],o]=je(1,n?t:[t],n?e||[]:e);return n||arguments.length==2?[r,o]:r}var wt=require("react");var on=()=>le(),sn=()=>(0,wt.useState)(on)[0];var nt=require("@react-spring/shared");var an=(t,e)=>{let n=(0,nt.useConstant)(()=>new ue(t,e));return(0,nt.useOnce)(()=>()=>{n.stop()}),n};var be=require("@react-spring/shared");function ht(t,e,n){let r=be.is.fun(e)&&e;r&&!n&&(n=[]);let o=!0,s,u=je(t,(a,p)=>{let l=r?r(a,p):e;return s=l.ref,o=o&&l.reverse,l},n||[{}]);if((0,be.useIsomorphicLayoutEffect)(()=>{(0,be.each)(u[1].current,(a,p)=>{let l=u[1].current[p+(o?1:-1)];if(ve(a,s),a.ref){l&&a.update({to:l.springs});return}l?a.start({to:l.springs}):a.start()})},n),r||arguments.length==3){let a=s??u[1];return a._getProps=(p,l,d)=>{let m=be.is.fun(p)?p(d,l):p;if(m){let h=a.current[d+(m.reverse?1:-1)];return h&&(m.to=h.springs),m}},u}return u[0]}var Ne=Pt(require("react")),ce=require("react"),R=require("@react-spring/shared");function gt(t,e,n){let r=R.is.fun(e)&&e,{reset:o,sort:s,trail:u=0,expires:a=!0,exitBeforeEnter:p=!1,onDestroyed:l,ref:d,config:m}=r?r():e,h=(0,ce.useMemo)(()=>r||arguments.length==3?le():void 0,[]),v=(0,R.toArray)(t),f=[],T=(0,ce.useRef)(null),c=o?null:T.current;(0,R.useIsomorphicLayoutEffect)(()=>{T.current=f}),(0,R.useOnce)(()=>((0,R.each)(f,S=>{h?.add(S.ctrl),S.ctrl.ref=h}),()=>{(0,R.each)(T.current,S=>{S.expired&&clearTimeout(S.expirationId),ke(S.ctrl,h),S.ctrl.stop(!0)})}));let g=pn(v,r?r():e,c),y=o&&T.current||[];(0,R.useIsomorphicLayoutEffect)(()=>(0,R.each)(y,({ctrl:S,item:b,key:N})=>{ke(S,h),k(l,b,N)}));let A=[];if(c&&(0,R.each)(c,(S,b)=>{S.expired?(clearTimeout(S.expirationId),y.push(S)):(b=A[b]=g.indexOf(S.key),~b&&(f[b]=S))}),(0,R.each)(v,(S,b)=>{f[b]||(f[b]={key:g[b],item:S,phase:"mount",ctrl:new pe},f[b].ctrl.item=S)}),A.length){let S=-1,{leave:b}=r?r():e;(0,R.each)(A,(N,D)=>{let M=c[D];~N?(S=f.indexOf(M),f[S]={...M,item:v[N]}):b&&f.splice(++S,0,M)})}R.is.fun(s)&&f.sort((S,b)=>s(S.item,b.item));let P=-u,I=(0,R.useForceUpdate)(),E=ye(e),w=new Map,O=(0,ce.useRef)(new Map),B=(0,ce.useRef)(!1);(0,R.each)(f,(S,b)=>{let N=S.key,D=S.phase,M=r?r():e,z,$,Nt=k(M.delay||0,N);if(D=="mount")z=M.enter,$="enter";else{let Y=g.indexOf(N)<0;if(D!="leave")if(Y)z=M.leave,$="leave";else if(z=M.update)$="update";else return;else if(!Y)z=M.enter,$="enter";else return}if(z=k(z,S.item,b),z=R.is.obj(z)?Se(z):{to:z},!z.config){let Y=m||E.config;z.config=k(Y,S.item,b,$)}P+=u;let me={...E,delay:Nt+P,ref:d,immediate:M.immediate,reset:!1,...z};if($=="enter"&&R.is.und(me.from)){let Y=r?r():e,Fe=R.is.und(Y.initial)||c?Y.from:Y.initial;me.from=k(Fe,S.item,b)}let{onResolve:Dt}=me;me.onResolve=Y=>{k(Dt,Y);let Fe=T.current,ae=Fe.find(qe=>qe.key===N);if(!!ae&&!(Y.cancelled&&ae.phase!="update")&&ae.ctrl.idle){let qe=Fe.every(he=>he.ctrl.idle);if(ae.phase=="leave"){let he=k(a,ae.item);if(he!==!1){let ot=he===!0?0:he;if(ae.expired=!0,!qe&&ot>0){ot<=2147483647&&(ae.expirationId=setTimeout(I,ot));return}}}qe&&Fe.some(he=>he.expired)&&(O.current.delete(ae),p&&(B.current=!0),I())}};let St=Me(S.ctrl,me);$==="leave"&&p?O.current.set(S,{phase:$,springs:St,payload:me}):w.set(S,{phase:$,springs:St,payload:me})});let F=(0,ce.useContext)(re),de=(0,R.usePrev)(F),K=F!==de&&Be(F);(0,R.useIsomorphicLayoutEffect)(()=>{K&&(0,R.each)(f,S=>{S.ctrl.start({default:F})})},[F]),(0,R.each)(w,(S,b)=>{if(O.current.size){let N=f.findIndex(D=>D.key===b.key);f.splice(N,1)}}),(0,R.useIsomorphicLayoutEffect)(()=>{(0,R.each)(O.current.size?O.current:w,({phase:S,payload:b},N)=>{let{ctrl:D}=N;N.phase=S,h?.add(D),K&&S=="enter"&&D.start({default:F}),b&&(ve(D,b.ref),(D.ref||h)&&!B.current?D.update(b):(D.start(b),B.current&&(B.current=!1)))})},o?void 0:n);let W=S=>Ne.createElement(Ne.Fragment,null,f.map((b,N)=>{let{springs:D}=w.get(b)||b.ctrl,M=S({...D},b.item,b,N);return M&&M.type?Ne.createElement(M.type,{...M.props,key:R.is.str(b.key)||R.is.num(b.key)?b.key:b.ctrl.id,ref:M.ref}):M}));return h?[W,h]:W}var un=1;function pn(t,{key:e,keys:n=e},r){if(n===null){let o=new Set;return t.map(s=>{let u=r&&r.find(a=>a.item===s&&a.phase!=="leave"&&!o.has(a));return u?(o.add(u),u.key):un++})}return R.is.und(n)?t:R.is.fun(n)?t.map(n):(0,R.toArray)(n)}var _e=require("@react-spring/shared");var ln=({container:t,...e}={})=>{let[n,r]=oe(()=>({scrollX:0,scrollY:0,scrollXProgress:0,scrollYProgress:0,...e}),[]);return(0,_e.useIsomorphicLayoutEffect)(()=>{let o=(0,_e.onScroll)(({x:s,y:u})=>{r.start({scrollX:s.current,scrollXProgress:s.progress,scrollY:u.current,scrollYProgress:u.progress})},{container:t?.current||void 0});return()=>{(0,_e.each)(Object.values(n),s=>s.stop()),o()}},[]),n};var Oe=require("@react-spring/shared");var cn=({container:t,...e})=>{let[n,r]=oe(()=>({width:0,height:0,...e}),[]);return(0,Oe.useIsomorphicLayoutEffect)(()=>{let o=(0,Oe.onResize)(({width:s,height:u})=>{r.start({width:s,height:u,immediate:n.width.get()===0||n.height.get()===0})},{container:t?.current||void 0});return()=>{(0,Oe.each)(Object.values(n),s=>s.stop()),o()}},[]),n};var rt=require("react"),De=require("@react-spring/shared");var fn={any:0,all:1};function dn(t,e){let[n,r]=(0,rt.useState)(!1),o=(0,rt.useRef)(),s=De.is.fun(t)&&t,u=s?s():{},{to:a={},from:p={},...l}=u,d=s?e:t,[m,h]=oe(()=>({from:p,...l}),[]);return(0,De.useIsomorphicLayoutEffect)(()=>{let v=o.current,{root:f,once:T,amount:c="any",...g}=d??{};if(!v||T&&n||typeof IntersectionObserver>"u")return;let y=new WeakMap,A=()=>(a&&h.start(a),r(!0),T?void 0:()=>{p&&h.start(p),r(!1)}),P=E=>{E.forEach(w=>{let O=y.get(w.target);if(w.isIntersecting!==Boolean(O))if(w.isIntersecting){let B=A();De.is.fun(B)?y.set(w.target,B):I.unobserve(w.target)}else O&&(O(),y.delete(w.target))})},I=new IntersectionObserver(P,{root:f&&f.current||void 0,threshold:typeof c=="number"||Array.isArray(c)?c:fn[c],...g});return I.observe(v),()=>I.unobserve(v)},[d]),s?[o,m]:[o,n]}function mn({children:t,...e}){return t(oe(e))}var Lt=require("@react-spring/shared");function hn({items:t,children:e,...n}){let r=ht(t.length,n);return t.map((o,s)=>{let u=e(o,s);return Lt.is.fun(u)?u(r[s]):u})}function gn({items:t,children:e,...n}){return gt(t,n)(e)}var jt=require("@react-spring/shared");var C=require("@react-spring/shared");var ie=require("@react-spring/animated"),se=class extends te{constructor(n,r){super();this.source=n;this.calc=(0,C.createInterpolator)(...r);let o=this._get(),s=(0,ie.getAnimatedType)(o);(0,ie.setAnimated)(this,s.create(o))}key;idle=!0;calc;_active=new Set;advance(n){let r=this._get(),o=this.get();(0,C.isEqual)(r,o)||((0,ie.getAnimated)(this).setValue(r),this._onChange(r,this.idle)),!this.idle&&Mt(this._active)&&yt(this)}_get(){let n=C.is.arr(this.source)?this.source.map(C.getFluidValue):(0,C.toArray)((0,C.getFluidValue)(this.source));return this.calc(...n)}_start(){this.idle&&!Mt(this._active)&&(this.idle=!1,(0,C.each)((0,ie.getPayload)(this),n=>{n.done=!1}),C.Globals.skipAnimation?(C.raf.batchedUpdates(()=>this.advance()),yt(this)):C.frameLoop.start(this))}_attach(){let n=1;(0,C.each)((0,C.toArray)(this.source),r=>{(0,C.hasFluidValue)(r)&&(0,C.addFluidObserver)(r,this),Ee(r)&&(r.idle||this._active.add(r),n=Math.max(n,r.priority+1))}),this.priority=n,this._start()}_detach(){(0,C.each)((0,C.toArray)(this.source),n=>{(0,C.hasFluidValue)(n)&&(0,C.removeFluidObserver)(n,this)}),this._active.clear(),yt(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=(0,C.toArray)(this.source).reduce((r,o)=>Math.max(r,(Ee(o)?o.priority:0)+1),0))}};function yn(t){return t.idle!==!1}function Mt(t){return!t.size||Array.from(t).every(yn)}function yt(t){t.idle||(t.idle=!0,(0,C.each)((0,ie.getPayload)(t),e=>{e.done=!0}),(0,C.callFluidObservers)(t,{type:"idle",parent:t}))}var Sn=(t,...e)=>new se(t,e),Pn=(t,...e)=>((0,jt.deprecateInterpolate)(),new se(t,e));var Ae=require("@react-spring/shared");Ae.Globals.assign({createStringInterpolator:Ae.createStringInterpolator,to:(t,e)=>new se(t,e)});var Tn=Ae.frameLoop.advance;var fe=require("@react-spring/shared");L(U,require("@react-spring/types"),module.exports);0&&(module.exports={BailSignal,Controller,FrameValue,Globals,Interpolation,Spring,SpringContext,SpringRef,SpringValue,Trail,Transition,config,createInterpolator,easings,inferTo,interpolate,to,update,useChain,useInView,useIsomorphicLayoutEffect,useReducedMotion,useResize,useScroll,useSpring,useSpringRef,useSpringValue,useSprings,useTrail,useTransition}); | ||
"use strict";var qt=Object.create;var ze=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Gt=Object.getPrototypeOf,Bt=Object.prototype.hasOwnProperty;var Kt=(t,e)=>{for(var n in e)ze(t,n,{get:e[n],enumerable:!0})},Qe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of zt(e))!Bt.call(t,o)&&o!==n&&ze(t,o,{get:()=>e[o],enumerable:!(r=Qt(e,o))||r.enumerable});return t},L=(t,e,n)=>(Qe(t,e,"default"),n&&Qe(n,e,"default")),Pt=(t,e,n)=>(n=t!=null?qt(Gt(t)):{},Qe(e||!t||!t.__esModule?ze(n,"default",{value:t,enumerable:!0}):n,t)),Xt=t=>Qe(ze({},"__esModule",{value:!0}),t);var U={};Kt(U,{BailSignal:()=>Ce,Controller:()=>pe,FrameValue:()=>te,Globals:()=>Ae.Globals,Interpolation:()=>se,Spring:()=>mn,SpringContext:()=>re,SpringRef:()=>le,SpringValue:()=>ue,Trail:()=>hn,Transition:()=>gn,config:()=>it,createInterpolator:()=>fe.createInterpolator,easings:()=>fe.easings,inferTo:()=>Se,interpolate:()=>Pn,to:()=>Sn,update:()=>Tn,useChain:()=>$t,useInView:()=>dn,useIsomorphicLayoutEffect:()=>fe.useIsomorphicLayoutEffect,useReducedMotion:()=>fe.useReducedMotion,useResize:()=>cn,useScroll:()=>ln,useSpring:()=>oe,useSpringRef:()=>sn,useSpringValue:()=>an,useSprings:()=>je,useTrail:()=>ht,useTransition:()=>gt});module.exports=Xt(U);var Z=require("@react-spring/shared");var V=require("@react-spring/shared");function k(t,...e){return V.is.fun(t)?t(...e):t}var ge=(t,e)=>t===!0||!!(e&&t&&(V.is.fun(t)?t(e):(0,V.toArray)(t).includes(e))),st=(t,e)=>V.is.obj(t)?e&&t[e]:t;var Ge=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,Yt=t=>t,ye=(t,e=Yt)=>{let n=Ht;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));let r={};for(let o of n){let s=e(t[o],o);V.is.und(s)||(r[o]=s)}return r},Ht=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Jt={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Wt(t){let e={},n=0;if((0,V.eachProp)(t,(r,o)=>{Jt[o]||(e[o]=r,n++)}),n)return e}function Se(t){let e=Wt(t);if(e){let n={to:e};return(0,V.eachProp)(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function Re(t){return t=(0,V.getFluidValue)(t),V.is.arr(t)?t.map(Re):(0,V.isAnimatedString)(t)?V.Globals.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function Be(t){for(let e in t)return!0;return!1}function Ke(t){return V.is.fun(t)||V.is.arr(t)&&V.is.obj(t[0])}function ke(t,e){t.ref?.delete(t),e?.delete(t)}function ve(t,e){e&&t.ref!==e&&(t.ref?.delete(t),e.add(t),t.ref=e)}function $t(t,e,n=1e3){(0,Z.useIsomorphicLayoutEffect)(()=>{if(e){let r=0;(0,Z.each)(t,(o,s)=>{let i=o.current;if(i.length){let u=n*e[s];isNaN(u)?u=r:r=u,(0,Z.each)(i,p=>{(0,Z.each)(p.queue,l=>{let d=l.delay;l.delay=m=>u+k(d||0,m)})}),o.start()}})}else{let r=Promise.resolve();(0,Z.each)(t,o=>{let s=o.current;if(s.length){let i=s.map(u=>{let p=u.queue;return u.queue=[],p});r=r.then(()=>((0,Z.each)(s,(u,p)=>(0,Z.each)(i[p]||[],l=>u.queue.push(l))),Promise.all(o.start())))}})}})}var Et=require("@react-spring/shared");var J=require("react"),j=require("@react-spring/shared");var a=require("@react-spring/shared"),_=require("@react-spring/animated");var H=require("@react-spring/shared");var it={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};var at={...it.default,mass:1,damping:1,easing:H.easings.linear,clamp:!1},Xe=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,at)}};function xt(t,e,n){n&&(n={...n},Tt(n,e),e={...n,...e}),Tt(t,e),Object.assign(t,e);for(let i in at)t[i]==null&&(t[i]=at[i]);let{frequency:r,damping:o}=t,{mass:s}=t;return H.is.und(r)||(r<.01&&(r=.01),o<0&&(o=0),t.tension=Math.pow(2*Math.PI/r,2)*s,t.friction=4*Math.PI*o*s/r),t}function Tt(t,e){if(!H.is.und(e.decay))t.duration=void 0;else{let n=!H.is.und(e.tension)||!H.is.und(e.friction);(n||!H.is.und(e.frequency)||!H.is.und(e.damping)||!H.is.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var bt=[],Ye=class{changed=!1;values=bt;toValues=null;fromValues=bt;to;from;config=new Xe;immediate=!1};var Pe=require("@react-spring/shared");function He(t,{key:e,props:n,defaultProps:r,state:o,actions:s}){return new Promise((i,u)=>{let p,l,d=ge(n.cancel??r?.cancel,e);if(d)v();else{Pe.is.und(n.pause)||(o.paused=ge(n.pause,e));let f=r?.pause;f!==!0&&(f=o.paused||ge(f,e)),p=k(n.delay||0,e),f?(o.resumeQueue.add(h),s.pause()):(s.resume(),h())}function m(){o.resumeQueue.add(h),o.timeouts.delete(l),l.cancel(),p=l.time-Pe.raf.now()}function h(){p>0&&!Pe.Globals.skipAnimation?(o.delayed=!0,l=Pe.raf.setTimeout(v,p),o.pauseQueue.add(m),o.timeouts.add(l)):v()}function v(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(m),o.timeouts.delete(l),t<=(o.cancelId||0)&&(d=!0);try{s.start({...n,callId:t,cancel:d},i)}catch(f){u(f)}}})}var Q=require("@react-spring/shared");var Ue=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?ee(t.get()):e.every(n=>n.noop)?ut(t.get()):G(t.get(),e.every(n=>n.finished)),ut=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),G=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),ee=t=>({value:t,cancelled:!0,finished:!1});function We(t,e,n,r){let{callId:o,parentId:s,onRest:i}=e,{asyncTo:u,promise:p}=n;return!s&&t===u&&!e.reset?p:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;let l=ye(e,(c,g)=>g==="onRest"?void 0:c),d,m,h=new Promise((c,g)=>(d=c,m=g)),v=c=>{let g=o<=(n.cancelId||0)&&ee(r)||o!==n.asyncId&&G(r,!1);if(g)throw c.result=g,m(c),c},f=(c,g)=>{let y=new Ce,A=new Je;return(async()=>{if(Q.Globals.skipAnimation)throw Te(n),A.result=G(r,!1),m(A),A;v(y);let P=Q.is.obj(c)?{...c}:{...g,to:c};P.parentId=o,(0,Q.eachProp)(l,(E,w)=>{Q.is.und(P[w])&&(P[w]=E)});let I=await r.start(P);return v(y),n.paused&&await new Promise(E=>{n.resumeQueue.add(E)}),I})()},T;if(Q.Globals.skipAnimation)return Te(n),G(r,!1);try{let c;Q.is.arr(t)?c=(async g=>{for(let y of g)await f(y)})(t):c=Promise.resolve(t(f,r.stop.bind(r))),await Promise.all([c.then(d),h]),T=G(r.get(),!0,!1)}catch(c){if(c instanceof Ce)T=c.result;else if(c instanceof Je)T=c.result;else throw c}finally{o==n.asyncId&&(n.asyncId=s,n.asyncTo=s?u:void 0,n.promise=s?p:void 0)}return Q.is.fun(i)&&Q.raf.batchedUpdates(()=>{i(T,r,r.item)}),T})()}function Te(t,e){(0,Q.flush)(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var Ce=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Je=class extends Error{result;constructor(){super("SkipAnimationSignal")}};var X=require("@react-spring/shared"),At=require("@react-spring/animated"),Ee=t=>t instanceof te,Zt=1,te=class extends X.FluidValue{id=Zt++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=(0,At.getAnimated)(this);return e&&e.getValue()}to(...e){return X.Globals.to(this,e)}interpolate(...e){return(0,X.deprecateInterpolate)(),X.Globals.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,n=!1){(0,X.callFluidObservers)(this,{type:"change",parent:this,value:e,idle:n})}_onPriorityChange(e){this.idle||X.frameLoop.sort(this),(0,X.callFluidObservers)(this,{type:"priority",parent:this,priority:e})}};var xe=Symbol.for("SpringPhase"),Rt=1,pt=2,lt=4,$e=t=>(t[xe]&Rt)>0,ne=t=>(t[xe]&pt)>0,Ie=t=>(t[xe]<)>0,ct=(t,e)=>e?t[xe]|=pt|Rt:t[xe]&=~pt,ft=(t,e)=>e?t[xe]|=lt:t[xe]&=~lt;var ue=class extends te{key;animation=new Ye;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,n){if(super(),!a.is.und(e)||!a.is.und(n)){let r=a.is.obj(e)?{...e}:{...n,from:e};a.is.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(ne(this)||this._state.asyncTo)||Ie(this)}get goal(){return(0,a.getFluidValue)(this.animation.to)}get velocity(){let e=(0,_.getAnimated)(this);return e instanceof _.AnimatedValue?e.lastVelocity||0:e.getPayload().map(n=>n.lastVelocity||0)}get hasAnimated(){return $e(this)}get isAnimating(){return ne(this)}get isPaused(){return Ie(this)}get isDelayed(){return this._state.delayed}advance(e){let n=!0,r=!1,o=this.animation,{toValues:s}=o,{config:i}=o,u=(0,_.getPayload)(o.to);!u&&(0,a.hasFluidValue)(o.to)&&(s=(0,a.toArray)((0,a.getFluidValue)(o.to))),o.values.forEach((d,m)=>{if(d.done)return;let h=d.constructor==_.AnimatedString?1:u?u[m].lastPosition:s[m],v=o.immediate,f=h;if(!v){if(f=d.lastPosition,i.tension<=0){d.done=!0;return}let T=d.elapsedTime+=e,c=o.fromValues[m],g=d.v0!=null?d.v0:d.v0=a.is.arr(i.velocity)?i.velocity[m]:i.velocity,y,A=i.precision||(c==h?.005:Math.min(1,Math.abs(h-c)*.001));if(a.is.und(i.duration))if(i.decay){let P=i.decay===!0?.998:i.decay,I=Math.exp(-(1-P)*T);f=c+g/(1-P)*(1-I),v=Math.abs(d.lastPosition-f)<=A,y=g*I}else{y=d.lastVelocity==null?g:d.lastVelocity;let P=i.restVelocity||A/10,I=i.clamp?0:i.bounce,E=!a.is.und(I),w=c==h?d.v0>0:c<h,O,B=!1,F=1,de=Math.ceil(e/F);for(let K=0;K<de&&(O=Math.abs(y)>P,!(!O&&(v=Math.abs(h-f)<=A,v)));++K){E&&(B=f==h||f>h==w,B&&(y=-y*I,f=h));let W=-i.tension*1e-6*(f-h),S=-i.friction*.001*y,b=(W+S)/i.mass;y=y+b*F,f=f+y*F}}else{let P=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,d.durationProgress>0&&(d.elapsedTime=i.duration*d.durationProgress,T=d.elapsedTime+=e)),P=(i.progress||0)+T/this._memoizedDuration,P=P>1?1:P<0?0:P,d.durationProgress=P),f=c+i.easing(P)*(h-c),y=(f-d.lastPosition)/e,v=P==1}d.lastVelocity=y,Number.isNaN(f)&&(console.warn("Got NaN while animating:",this),v=!0)}u&&!u[m].done&&(v=!1),v?d.done=!0:n=!1,d.setValue(f,i.round)&&(r=!0)});let p=(0,_.getAnimated)(this),l=p.getValue();if(n){let d=(0,a.getFluidValue)(o.to);(l!==d||r)&&!i.decay?(p.setValue(d),this._onChange(d)):r&&i.decay&&this._onChange(l),this._stop()}else r&&this._onChange(l)}set(e){return a.raf.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(ne(this)){let{to:e,config:n}=this.animation;a.raf.batchedUpdates(()=>{this._onStart(),n.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,n){let r;return a.is.und(e)?(r=this.queue||[],this.queue=[]):r=[a.is.obj(e)?e:{...n,to:e}],Promise.all(r.map(o=>this._update(o))).then(o=>Ue(this,o))}stop(e){let{to:n}=this.animation;return this._focus(this.get()),Te(this._state,e&&this._lastCallId),a.raf.batchedUpdates(()=>this._stop(n,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){let n=this.key||"",{to:r,from:o}=e;r=a.is.obj(r)?r[n]:r,(r==null||Ke(r))&&(r=void 0),o=a.is.obj(o)?o[n]:o,o==null&&(o=void 0);let s={to:r,from:o};return $e(this)||(e.reverse&&([r,o]=[o,r]),o=(0,a.getFluidValue)(o),a.is.und(o)?(0,_.getAnimated)(this)||this._set(r):this._set(o)),s}_update({...e},n){let{key:r,defaultProps:o}=this;e.default&&Object.assign(o,ye(e,(u,p)=>/^on/.test(p)?st(u,r):u)),Ct(this,e,"onProps"),Le(this,"onProps",e,this);let s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let i=this._state;return He(++this._lastCallId,{key:r,props:e,defaultProps:o,state:i,actions:{pause:()=>{Ie(this)||(ft(this,!0),(0,a.flushCalls)(i.pauseQueue),Le(this,"onPause",G(this,we(this,this.animation.to)),this))},resume:()=>{Ie(this)&&(ft(this,!1),ne(this)&&this._resume(),(0,a.flushCalls)(i.resumeQueue),Le(this,"onResume",G(this,we(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(u=>{if(e.loop&&u.finished&&!(n&&u.noop)){let p=dt(e);if(p)return this._update(p,!0)}return u})}_merge(e,n,r){if(n.cancel)return this.stop(!0),r(ee(this));let o=!a.is.und(e.to),s=!a.is.und(e.from);if(o||s)if(n.callId>this._lastToId)this._lastToId=n.callId;else return r(ee(this));let{key:i,defaultProps:u,animation:p}=this,{to:l,from:d}=p,{to:m=l,from:h=d}=e;s&&!o&&(!n.default||a.is.und(m))&&(m=h),n.reverse&&([m,h]=[h,m]);let v=!(0,a.isEqual)(h,d);v&&(p.from=h),h=(0,a.getFluidValue)(h);let f=!(0,a.isEqual)(m,l);f&&this._focus(m);let T=Ke(n.to),{config:c}=p,{decay:g,velocity:y}=c;(o||s)&&(c.velocity=0),n.config&&!T&&xt(c,k(n.config,i),n.config!==u.config?k(u.config,i):void 0);let A=(0,_.getAnimated)(this);if(!A||a.is.und(m))return r(G(this,!0));let P=a.is.und(n.reset)?s&&!n.default:!a.is.und(h)&&ge(n.reset,i),I=P?h:this.get(),E=Re(m),w=a.is.num(E)||a.is.arr(E)||(0,a.isAnimatedString)(E),O=!T&&(!w||ge(u.immediate||n.immediate,i));if(f){let K=(0,_.getAnimatedType)(m);if(K!==A.constructor)if(O)A=this._set(E);else throw Error(`Cannot animate between ${A.constructor.name} and ${K.name}, as the "to" prop suggests`)}let B=A.constructor,F=(0,a.hasFluidValue)(m),de=!1;if(!F){let K=P||!$e(this)&&v;(f||K)&&(de=(0,a.isEqual)(Re(I),E),F=!de),(!(0,a.isEqual)(p.immediate,O)&&!O||!(0,a.isEqual)(c.decay,g)||!(0,a.isEqual)(c.velocity,y))&&(F=!0)}if(de&&ne(this)&&(p.changed&&!P?F=!0:F||this._stop(l)),!T&&((F||(0,a.hasFluidValue)(l))&&(p.values=A.getPayload(),p.toValues=(0,a.hasFluidValue)(m)?null:B==_.AnimatedString?[1]:(0,a.toArray)(E)),p.immediate!=O&&(p.immediate=O,!O&&!P&&this._set(l)),F)){let{onRest:K}=p;(0,a.each)(en,S=>Ct(this,n,S));let W=G(this,we(this,l));(0,a.flushCalls)(this._pendingCalls,W),this._pendingCalls.add(r),p.changed&&a.raf.batchedUpdates(()=>{p.changed=!P,K?.(W,this),P?k(u.onRest,W):p.onStart?.(W,this)})}P&&this._set(I),T?r(We(n.to,n,this._state,this)):F?this._start():ne(this)&&!f?this._pendingCalls.add(r):r(ut(I))}_focus(e){let n=this.animation;e!==n.to&&((0,a.getFluidObservers)(this)&&this._detach(),n.to=e,(0,a.getFluidObservers)(this)&&this._attach())}_attach(){let e=0,{to:n}=this.animation;(0,a.hasFluidValue)(n)&&((0,a.addFluidObserver)(n,this),Ee(n)&&(e=n.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;(0,a.hasFluidValue)(e)&&(0,a.removeFluidObserver)(e,this)}_set(e,n=!0){let r=(0,a.getFluidValue)(e);if(!a.is.und(r)){let o=(0,_.getAnimated)(this);if(!o||!(0,a.isEqual)(r,o.getValue())){let s=(0,_.getAnimatedType)(r);!o||o.constructor!=s?(0,_.setAnimated)(this,s.create(r)):o.setValue(r),o&&a.raf.batchedUpdates(()=>{this._onChange(r,n)})}}return(0,_.getAnimated)(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Le(this,"onStart",G(this,we(this,e.to)),this))}_onChange(e,n){n||(this._onStart(),k(this.animation.onChange,e,this)),k(this.defaultProps.onChange,e,this),super._onChange(e,n)}_start(){let e=this.animation;(0,_.getAnimated)(this).reset((0,a.getFluidValue)(e.to)),e.immediate||(e.fromValues=e.values.map(n=>n.lastPosition)),ne(this)||(ct(this,!0),Ie(this)||this._resume())}_resume(){a.Globals.skipAnimation?this.finish():a.frameLoop.start(this)}_stop(e,n){if(ne(this)){ct(this,!1);let r=this.animation;(0,a.each)(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),(0,a.callFluidObservers)(this,{type:"idle",parent:this});let o=n?ee(this.get()):G(this.get(),we(this,e??r.to));(0,a.flushCalls)(this._pendingCalls,o),r.changed&&(r.changed=!1,Le(this,"onRest",o,this))}}};function we(t,e){let n=Re(e),r=Re(t.get());return(0,a.isEqual)(r,n)}function dt(t,e=t.loop,n=t.to){let r=k(e);if(r){let o=r!==!0&&Se(r),s=(o||t).reverse,i=!o||o.reset;return Ve({...t,loop:e,default:!1,pause:void 0,to:!s||Ke(n)?n:void 0,from:i?t.from:void 0,reset:i,...o})}}function Ve(t){let{to:e,from:n}=t=Se(t),r=new Set;return a.is.obj(e)&&vt(e,r),a.is.obj(n)&&vt(n,r),t.keys=r.size?Array.from(r):null,t}function It(t){let e=Ve(t);return a.is.und(e.default)&&(e.default=ye(e)),e}function vt(t,e){(0,a.eachProp)(t,(n,r)=>n!=null&&e.add(r))}var en=["onStart","onRest","onChange","onPause","onResume"];function Ct(t,e,n){t.animation[n]=e[n]!==Ge(e,n)?st(e[n],t.key):void 0}function Le(t,e,...n){t.animation[e]?.(...n),t.defaultProps[e]?.(...n)}var x=require("@react-spring/shared");var tn=["onStart","onChange","onRest"],nn=1,pe=class{id=nn++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,n){this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((n,r)=>e[r]=n.get()),e}set(e){for(let n in e){let r=e[n];x.is.und(r)||this.springs[n].set(r)}}update(e){return e&&this.queue.push(Ve(e)),this}start(e){let{queue:n}=this;return e?n=(0,x.toArray)(e).map(Ve):this.queue=[],this._flush?this._flush(this,n):(Ft(this,n),Ze(this,n))}stop(e,n){if(e!==!!e&&(n=e),n){let r=this.springs;(0,x.each)((0,x.toArray)(n),o=>r[o].stop(!!e))}else Te(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(x.is.und(e))this.start({pause:!0});else{let n=this.springs;(0,x.each)((0,x.toArray)(e),r=>n[r].pause())}return this}resume(e){if(x.is.und(e))this.start({pause:!1});else{let n=this.springs;(0,x.each)((0,x.toArray)(e),r=>n[r].resume())}return this}each(e){(0,x.eachProp)(this.springs,e)}_onFrame(){let{onStart:e,onChange:n,onRest:r}=this._events,o=this._active.size>0,s=this._changed.size>0;(o&&!this._started||s&&!this._started)&&(this._started=!0,(0,x.flush)(e,([p,l])=>{l.value=this.get(),p(l,this,this._item)}));let i=!o&&this._started,u=s||i&&r.size?this.get():null;s&&n.size&&(0,x.flush)(n,([p,l])=>{l.value=u,p(l,this,this._item)}),i&&(this._started=!1,(0,x.flush)(r,([p,l])=>{l.value=u,p(l,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;x.raf.onFrame(this._onFrame)}};function Ze(t,e){return Promise.all(e.map(n=>Vt(t,n))).then(n=>Ue(t,n))}async function Vt(t,e,n){let{keys:r,to:o,from:s,loop:i,onRest:u,onResolve:p}=e,l=x.is.obj(e.default)&&e.default;i&&(e.loop=!1),o===!1&&(e.to=null),s===!1&&(e.from=null);let d=x.is.arr(o)||x.is.fun(o)?o:void 0;d?(e.to=void 0,e.onRest=void 0,l&&(l.onRest=void 0)):(0,x.each)(tn,T=>{let c=e[T];if(x.is.fun(c)){let g=t._events[T];e[T]=({finished:y,cancelled:A})=>{let P=g.get(c);P?(y||(P.finished=!1),A&&(P.cancelled=!0)):g.set(c,{value:null,finished:y||!1,cancelled:A||!1})},l&&(l[T]=e[T])}});let m=t._state;e.pause===!m.paused?(m.paused=e.pause,(0,x.flushCalls)(e.pause?m.pauseQueue:m.resumeQueue)):m.paused&&(e.pause=!0);let h=(r||Object.keys(t.springs)).map(T=>t.springs[T].start(e)),v=e.cancel===!0||Ge(e,"cancel")===!0;(d||v&&m.asyncId)&&h.push(He(++t._lastAsyncId,{props:e,state:m,actions:{pause:x.noop,resume:x.noop,start(T,c){v?(Te(m,t._lastAsyncId),c(ee(t))):(T.onRest=u,c(We(d,T,m,t)))}}})),m.paused&&await new Promise(T=>{m.resumeQueue.add(T)});let f=Ue(t,await Promise.all(h));if(i&&f.finished&&!(n&&f.noop)){let T=dt(e,i,o);if(T)return Ft(t,[T]),Vt(t,T,!0)}return p&&x.raf.batchedUpdates(()=>p(f,t,t.item)),f}function Me(t,e){let n={...t.springs};return e&&(0,x.each)((0,x.toArray)(e),r=>{x.is.und(r.keys)&&(r=Ve(r)),x.is.obj(r.to)||(r={...r,to:void 0}),Ot(n,r,o=>_t(o))}),mt(t,n),n}function mt(t,e){(0,x.eachProp)(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,(0,x.addFluidObserver)(n,t))})}function _t(t,e){let n=new ue;return n.key=t,e&&(0,x.addFluidObserver)(n,e),n}function Ot(t,e,n){e.keys&&(0,x.each)(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function Ft(t,e){(0,x.each)(e,n=>{Ot(t.springs,n,r=>_t(r,t))})}var tt=Pt(require("react")),kt=require("react"),Ut=require("@react-spring/shared"),re=({children:t,...e})=>{let n=(0,kt.useContext)(et),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=(0,Ut.useMemoOne)(()=>({pause:r,immediate:o}),[r,o]);let{Provider:s}=et;return tt.createElement(s,{value:e},t)},et=rn(re,{});re.Provider=et.Provider;re.Consumer=et.Consumer;function rn(t,e){return Object.assign(t,tt.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var q=require("@react-spring/shared"),le=()=>{let t=[],e=function(r){(0,q.deprecateDirectCall)();let o=[];return(0,q.each)(t,(s,i)=>{if(q.is.und(r))o.push(s.start());else{let u=n(r,s,i);u&&o.push(s.start(u))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){let o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return(0,q.each)(t,r=>r.pause(...arguments)),this},e.resume=function(){return(0,q.each)(t,r=>r.resume(...arguments)),this},e.set=function(r){(0,q.each)(t,(o,s)=>{let i=q.is.fun(r)?r(s,o):r;i&&o.set(i)})},e.start=function(r){let o=[];return(0,q.each)(t,(s,i)=>{if(q.is.und(r))o.push(s.start());else{let u=this._getProps(r,s,i);u&&o.push(s.start(u))}}),o},e.stop=function(){return(0,q.each)(t,r=>r.stop(...arguments)),this},e.update=function(r){return(0,q.each)(t,(o,s)=>o.update(this._getProps(r,o,s))),this};let n=function(r,o,s){return q.is.fun(r)?r(s,o):r};return e._getProps=n,e};function je(t,e,n){let r=j.is.fun(e)&&e;r&&!n&&(n=[]);let o=(0,J.useMemo)(()=>r||arguments.length==3?le():void 0,[]),s=(0,J.useRef)(0),i=(0,j.useForceUpdate)(),u=(0,J.useMemo)(()=>({ctrls:[],queue:[],flush(g,y){let A=Me(g,y);return s.current>0&&!u.queue.length&&!Object.keys(A).some(I=>!g.springs[I])?Ze(g,y):new Promise(I=>{mt(g,A),u.queue.push(()=>{I(Ze(g,y))}),i()})}}),[]),p=(0,J.useRef)([...u.ctrls]),l=[],d=(0,j.usePrev)(t)||0;(0,J.useMemo)(()=>{(0,j.each)(p.current.slice(t,d),g=>{ke(g,o),g.stop(!0)}),p.current.length=t,m(d,t)},[t]),(0,J.useMemo)(()=>{m(0,Math.min(d,t))},n);function m(g,y){for(let A=g;A<y;A++){let P=p.current[A]||(p.current[A]=new pe(null,u.flush)),I=r?r(A,P):e[A];I&&(l[A]=It(I))}}let h=p.current.map((g,y)=>Me(g,l[y])),v=(0,J.useContext)(re),f=(0,j.usePrev)(v),T=v!==f&&Be(v);(0,j.useIsomorphicLayoutEffect)(()=>{s.current++,u.ctrls=p.current;let{queue:g}=u;g.length&&(u.queue=[],(0,j.each)(g,y=>y())),(0,j.each)(p.current,(y,A)=>{o?.add(y),T&&y.start({default:v});let P=l[A];P&&(ve(y,P.ref),y.ref?y.queue.push(P):y.start(P))})}),(0,j.useOnce)(()=>()=>{(0,j.each)(u.ctrls,g=>g.stop(!0))});let c=h.map(g=>({...g}));return o?[c,o]:c}function oe(t,e){let n=Et.is.fun(t),[[r],o]=je(1,n?t:[t],n?e||[]:e);return n||arguments.length==2?[r,o]:r}var wt=require("react");var on=()=>le(),sn=()=>(0,wt.useState)(on)[0];var nt=require("@react-spring/shared");var an=(t,e)=>{let n=(0,nt.useConstant)(()=>new ue(t,e));return(0,nt.useOnce)(()=>()=>{n.stop()}),n};var be=require("@react-spring/shared");function ht(t,e,n){let r=be.is.fun(e)&&e;r&&!n&&(n=[]);let o=!0,s,i=je(t,(u,p)=>{let l=r?r(u,p):e;return s=l.ref,o=o&&l.reverse,l},n||[{}]);if((0,be.useIsomorphicLayoutEffect)(()=>{(0,be.each)(i[1].current,(u,p)=>{let l=i[1].current[p+(o?1:-1)];if(ve(u,s),u.ref){l&&u.update({to:l.springs});return}l?u.start({to:l.springs}):u.start()})},n),r||arguments.length==3){let u=s??i[1];return u._getProps=(p,l,d)=>{let m=be.is.fun(p)?p(d,l):p;if(m){let h=u.current[d+(m.reverse?1:-1)];return h&&(m.to=h.springs),m}},i}return i[0]}var Ne=Pt(require("react")),ce=require("react"),R=require("@react-spring/shared");function gt(t,e,n){let r=R.is.fun(e)&&e,{reset:o,sort:s,trail:i=0,expires:u=!0,exitBeforeEnter:p=!1,onDestroyed:l,ref:d,config:m}=r?r():e,h=(0,ce.useMemo)(()=>r||arguments.length==3?le():void 0,[]),v=(0,R.toArray)(t),f=[],T=(0,ce.useRef)(null),c=o?null:T.current;(0,R.useIsomorphicLayoutEffect)(()=>{T.current=f}),(0,R.useOnce)(()=>((0,R.each)(f,S=>{h?.add(S.ctrl),S.ctrl.ref=h}),()=>{(0,R.each)(T.current,S=>{S.expired&&clearTimeout(S.expirationId),ke(S.ctrl,h),S.ctrl.stop(!0)})}));let g=pn(v,r?r():e,c),y=o&&T.current||[];(0,R.useIsomorphicLayoutEffect)(()=>(0,R.each)(y,({ctrl:S,item:b,key:N})=>{ke(S,h),k(l,b,N)}));let A=[];if(c&&(0,R.each)(c,(S,b)=>{S.expired?(clearTimeout(S.expirationId),y.push(S)):(b=A[b]=g.indexOf(S.key),~b&&(f[b]=S))}),(0,R.each)(v,(S,b)=>{f[b]||(f[b]={key:g[b],item:S,phase:"mount",ctrl:new pe},f[b].ctrl.item=S)}),A.length){let S=-1,{leave:b}=r?r():e;(0,R.each)(A,(N,D)=>{let M=c[D];~N?(S=f.indexOf(M),f[S]={...M,item:v[N]}):b&&f.splice(++S,0,M)})}R.is.fun(s)&&f.sort((S,b)=>s(S.item,b.item));let P=-i,I=(0,R.useForceUpdate)(),E=ye(e),w=new Map,O=(0,ce.useRef)(new Map),B=(0,ce.useRef)(!1);(0,R.each)(f,(S,b)=>{let N=S.key,D=S.phase,M=r?r():e,z,$,Nt=k(M.delay||0,N);if(D=="mount")z=M.enter,$="enter";else{let Y=g.indexOf(N)<0;if(D!="leave")if(Y)z=M.leave,$="leave";else if(z=M.update)$="update";else return;else if(!Y)z=M.enter,$="enter";else return}if(z=k(z,S.item,b),z=R.is.obj(z)?Se(z):{to:z},!z.config){let Y=m||E.config;z.config=k(Y,S.item,b,$)}P+=i;let me={...E,delay:Nt+P,ref:d,immediate:M.immediate,reset:!1,...z};if($=="enter"&&R.is.und(me.from)){let Y=r?r():e,Fe=R.is.und(Y.initial)||c?Y.from:Y.initial;me.from=k(Fe,S.item,b)}let{onResolve:Dt}=me;me.onResolve=Y=>{k(Dt,Y);let Fe=T.current,ae=Fe.find(qe=>qe.key===N);if(ae&&!(Y.cancelled&&ae.phase!="update")&&ae.ctrl.idle){let qe=Fe.every(he=>he.ctrl.idle);if(ae.phase=="leave"){let he=k(u,ae.item);if(he!==!1){let ot=he===!0?0:he;if(ae.expired=!0,!qe&&ot>0){ot<=2147483647&&(ae.expirationId=setTimeout(I,ot));return}}}qe&&Fe.some(he=>he.expired)&&(O.current.delete(ae),p&&(B.current=!0),I())}};let St=Me(S.ctrl,me);$==="leave"&&p?O.current.set(S,{phase:$,springs:St,payload:me}):w.set(S,{phase:$,springs:St,payload:me})});let F=(0,ce.useContext)(re),de=(0,R.usePrev)(F),K=F!==de&&Be(F);(0,R.useIsomorphicLayoutEffect)(()=>{K&&(0,R.each)(f,S=>{S.ctrl.start({default:F})})},[F]),(0,R.each)(w,(S,b)=>{if(O.current.size){let N=f.findIndex(D=>D.key===b.key);f.splice(N,1)}}),(0,R.useIsomorphicLayoutEffect)(()=>{(0,R.each)(O.current.size?O.current:w,({phase:S,payload:b},N)=>{let{ctrl:D}=N;N.phase=S,h?.add(D),K&&S=="enter"&&D.start({default:F}),b&&(ve(D,b.ref),(D.ref||h)&&!B.current?D.update(b):(D.start(b),B.current&&(B.current=!1)))})},o?void 0:n);let W=S=>Ne.createElement(Ne.Fragment,null,f.map((b,N)=>{let{springs:D}=w.get(b)||b.ctrl,M=S({...D},b.item,b,N);return M&&M.type?Ne.createElement(M.type,{...M.props,key:R.is.str(b.key)||R.is.num(b.key)?b.key:b.ctrl.id,ref:M.ref}):M}));return h?[W,h]:W}var un=1;function pn(t,{key:e,keys:n=e},r){if(n===null){let o=new Set;return t.map(s=>{let i=r&&r.find(u=>u.item===s&&u.phase!=="leave"&&!o.has(u));return i?(o.add(i),i.key):un++})}return R.is.und(n)?t:R.is.fun(n)?t.map(n):(0,R.toArray)(n)}var _e=require("@react-spring/shared");var ln=({container:t,...e}={})=>{let[n,r]=oe(()=>({scrollX:0,scrollY:0,scrollXProgress:0,scrollYProgress:0,...e}),[]);return(0,_e.useIsomorphicLayoutEffect)(()=>{let o=(0,_e.onScroll)(({x:s,y:i})=>{r.start({scrollX:s.current,scrollXProgress:s.progress,scrollY:i.current,scrollYProgress:i.progress})},{container:t?.current||void 0});return()=>{(0,_e.each)(Object.values(n),s=>s.stop()),o()}},[]),n};var Oe=require("@react-spring/shared");var cn=({container:t,...e})=>{let[n,r]=oe(()=>({width:0,height:0,...e}),[]);return(0,Oe.useIsomorphicLayoutEffect)(()=>{let o=(0,Oe.onResize)(({width:s,height:i})=>{r.start({width:s,height:i,immediate:n.width.get()===0||n.height.get()===0})},{container:t?.current||void 0});return()=>{(0,Oe.each)(Object.values(n),s=>s.stop()),o()}},[]),n};var rt=require("react"),De=require("@react-spring/shared");var fn={any:0,all:1};function dn(t,e){let[n,r]=(0,rt.useState)(!1),o=(0,rt.useRef)(),s=De.is.fun(t)&&t,i=s?s():{},{to:u={},from:p={},...l}=i,d=s?e:t,[m,h]=oe(()=>({from:p,...l}),[]);return(0,De.useIsomorphicLayoutEffect)(()=>{let v=o.current,{root:f,once:T,amount:c="any",...g}=d??{};if(!v||T&&n||typeof IntersectionObserver>"u")return;let y=new WeakMap,A=()=>(u&&h.start(u),r(!0),T?void 0:()=>{p&&h.start(p),r(!1)}),P=E=>{E.forEach(w=>{let O=y.get(w.target);if(w.isIntersecting!==!!O)if(w.isIntersecting){let B=A();De.is.fun(B)?y.set(w.target,B):I.unobserve(w.target)}else O&&(O(),y.delete(w.target))})},I=new IntersectionObserver(P,{root:f&&f.current||void 0,threshold:typeof c=="number"||Array.isArray(c)?c:fn[c],...g});return I.observe(v),()=>I.unobserve(v)},[d]),s?[o,m]:[o,n]}function mn({children:t,...e}){return t(oe(e))}var Lt=require("@react-spring/shared");function hn({items:t,children:e,...n}){let r=ht(t.length,n);return t.map((o,s)=>{let i=e(o,s);return Lt.is.fun(i)?i(r[s]):i})}function gn({items:t,children:e,...n}){return gt(t,n)(e)}var jt=require("@react-spring/shared");var C=require("@react-spring/shared");var ie=require("@react-spring/animated"),se=class extends te{constructor(n,r){super();this.source=n;this.calc=(0,C.createInterpolator)(...r);let o=this._get(),s=(0,ie.getAnimatedType)(o);(0,ie.setAnimated)(this,s.create(o))}key;idle=!0;calc;_active=new Set;advance(n){let r=this._get(),o=this.get();(0,C.isEqual)(r,o)||((0,ie.getAnimated)(this).setValue(r),this._onChange(r,this.idle)),!this.idle&&Mt(this._active)&&yt(this)}_get(){let n=C.is.arr(this.source)?this.source.map(C.getFluidValue):(0,C.toArray)((0,C.getFluidValue)(this.source));return this.calc(...n)}_start(){this.idle&&!Mt(this._active)&&(this.idle=!1,(0,C.each)((0,ie.getPayload)(this),n=>{n.done=!1}),C.Globals.skipAnimation?(C.raf.batchedUpdates(()=>this.advance()),yt(this)):C.frameLoop.start(this))}_attach(){let n=1;(0,C.each)((0,C.toArray)(this.source),r=>{(0,C.hasFluidValue)(r)&&(0,C.addFluidObserver)(r,this),Ee(r)&&(r.idle||this._active.add(r),n=Math.max(n,r.priority+1))}),this.priority=n,this._start()}_detach(){(0,C.each)((0,C.toArray)(this.source),n=>{(0,C.hasFluidValue)(n)&&(0,C.removeFluidObserver)(n,this)}),this._active.clear(),yt(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=(0,C.toArray)(this.source).reduce((r,o)=>Math.max(r,(Ee(o)?o.priority:0)+1),0))}};function yn(t){return t.idle!==!1}function Mt(t){return!t.size||Array.from(t).every(yn)}function yt(t){t.idle||(t.idle=!0,(0,C.each)((0,ie.getPayload)(t),e=>{e.done=!0}),(0,C.callFluidObservers)(t,{type:"idle",parent:t}))}var Sn=(t,...e)=>new se(t,e),Pn=(t,...e)=>((0,jt.deprecateInterpolate)(),new se(t,e));var Ae=require("@react-spring/shared");Ae.Globals.assign({createStringInterpolator:Ae.createStringInterpolator,to:(t,e)=>new se(t,e)});var Tn=Ae.frameLoop.advance;var fe=require("@react-spring/shared");L(U,require("@react-spring/types"),module.exports);0&&(module.exports={BailSignal,Controller,FrameValue,Globals,Interpolation,Spring,SpringContext,SpringRef,SpringValue,Trail,Transition,config,createInterpolator,easings,inferTo,interpolate,to,update,useChain,useInView,useIsomorphicLayoutEffect,useReducedMotion,useResize,useScroll,useSpring,useSpringRef,useSpringValue,useSprings,useTrail,useTransition}); |
{ | ||
"name": "@react-spring/core", | ||
"version": "0.0.0-fb0ddfbbce1fd1b524534d96188b7bdb923c7bc7-20230227080834", | ||
"version": "0.0.0-nightly-f50b673-20230330070501", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/index.d.ts", | ||
@@ -11,2 +11,3 @@ "exports": { | ||
"import": "./dist/esm/index.js", | ||
"module": "./dist/esm/index.js", | ||
"require": "./dist/index.js" | ||
@@ -45,9 +46,11 @@ }, | ||
"build": "tsup --legacy-output", | ||
"dev": "tsup" | ||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", | ||
"dev": "tsup", | ||
"lint": "TIMING=1 eslint \"src/**/*.ts*\"" | ||
}, | ||
"dependencies": { | ||
"@react-spring/animated": "0.0.0-fb0ddfbbce1fd1b524534d96188b7bdb923c7bc7-20230227080834", | ||
"@react-spring/rafz": "0.0.0-fb0ddfbbce1fd1b524534d96188b7bdb923c7bc7-20230227080834", | ||
"@react-spring/shared": "0.0.0-fb0ddfbbce1fd1b524534d96188b7bdb923c7bc7-20230227080834", | ||
"@react-spring/types": "0.0.0-fb0ddfbbce1fd1b524534d96188b7bdb923c7bc7-20230227080834" | ||
"@react-spring/animated": "0.0.0-nightly-f50b673-20230330070501", | ||
"@react-spring/rafz": "0.0.0-nightly-f50b673-20230330070501", | ||
"@react-spring/shared": "0.0.0-nightly-f50b673-20230330070501", | ||
"@react-spring/types": "0.0.0-nightly-f50b673-20230330070501" | ||
}, | ||
@@ -54,0 +57,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
117874
0
+ Added@react-spring/animated@0.0.0-nightly-f50b673-20230330070501(transitive)
+ Added@react-spring/rafz@0.0.0-nightly-f50b673-20230330070501(transitive)
+ Added@react-spring/shared@0.0.0-nightly-f50b673-20230330070501(transitive)
+ Added@react-spring/types@0.0.0-nightly-f50b673-20230330070501(transitive)
- Removed@react-spring/animated@0.0.0-fb0ddfbbce1fd1b524534d96188b7bdb923c7bc7-20230227080834(transitive)
- Removed@react-spring/rafz@0.0.0-fb0ddfbbce1fd1b524534d96188b7bdb923c7bc7-20230227080834(transitive)
- Removed@react-spring/shared@0.0.0-fb0ddfbbce1fd1b524534d96188b7bdb923c7bc7-20230227080834(transitive)
- Removed@react-spring/types@0.0.0-fb0ddfbbce1fd1b524534d96188b7bdb923c7bc7-20230227080834(transitive)
Updated@react-spring/animated@0.0.0-nightly-f50b673-20230330070501
Updated@react-spring/rafz@0.0.0-nightly-f50b673-20230330070501
Updated@react-spring/shared@0.0.0-nightly-f50b673-20230330070501
Updated@react-spring/types@0.0.0-nightly-f50b673-20230330070501