import{r as w,j as st}from"./vendor-react-AgJGJ0jt.js";const sn=w.createContext({});function ce(t){const e=w.useRef(null);return e.current===null&&(e.current=t()),e.current}const ko=typeof window<"u",on=ko?w.useLayoutEffect:w.useEffect,ue=w.createContext(null);function rn(t,e){t.indexOf(e)===-1&&t.push(e)}function Qt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Q=(t,e,n)=>n>e?e:n{};const ot={},Xs=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Ys=t=>typeof t=="object"&&t!==null,qs=t=>/^0[^.\s]+$/u.test(t);function Zs(t){let e;return()=>(e===void 0&&(e=t()),e)}const z=t=>t,It=(...t)=>t.reduce((e,n)=>s=>n(e(s))),Rt=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class an{constructor(){this.subscriptions=[]}add(e){return rn(this.subscriptions,e),()=>Qt(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;rt*1e3,$=t=>t/1e3,Js=(t,e)=>e?t*(1e3/e):0,Qs=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Bo=1e-7,Io=12;function Fo(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=Qs(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Bo&&++aFo(r,0,1,t,n);return r=>r===0||r===1?r:Qs(i(r),e,s)}const ti=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ei=t=>e=>1-t(1-e),ni=Ft(.33,1.53,.69,.99),ln=ei(ni),si=ti(ln),ii=t=>t>=1?1:(t*=2)<1?.5*ln(t):.5*(2-Math.pow(2,-10*(t-1))),cn=t=>1-Math.sin(Math.acos(t)),oi=ei(cn),ri=ti(cn),Oo=Ft(.42,0,1,1),jo=Ft(0,0,.58,1),ai=Ft(.42,0,.58,1),No=t=>Array.isArray(t)&&typeof t[0]!="number",li=t=>Array.isArray(t)&&typeof t[0]=="number",Uo={linear:z,easeIn:Oo,easeInOut:ai,easeOut:jo,circIn:cn,circInOut:ri,circOut:oi,backIn:ln,backInOut:si,backOut:ni,anticipate:ii},Wo=t=>typeof t=="string",Ln=t=>{if(li(t)){he(t.length===4);const[e,n,s,i]=t;return Ft(e,n,s,i)}else if(Wo(t))return Uo[t];return t},Nt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ko(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(l){r.has(l)&&(u.schedule(l),t()),l(o)}const u={schedule:(l,c=!1,h=!1)=>{const p=h&&s?e:n;return c&&r.add(l),p.add(l),l},cancel:l=>{n.delete(l),r.delete(l)},process:l=>{if(o=l,s){i=!0;return}s=!0;const c=e;e=n,n=c,e.forEach(a),e.clear(),s=!1,i&&(i=!1,u.process(l))}};return u}const $o=40;function ci(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Nt.reduce((v,T)=>(v[T]=Ko(r),v),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:f,render:p,postRender:d}=o,m=()=>{const v=ot.useManualTiming,T=v?i.timestamp:performance.now();n=!1,v||(i.delta=s?1e3/60:Math.max(Math.min(T-i.timestamp,$o),1)),i.timestamp=T,i.isProcessing=!0,a.process(i),u.process(i),l.process(i),c.process(i),h.process(i),f.process(i),p.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(m))},g=()=>{n=!0,s=!0,i.isProcessing||t(m)};return{schedule:Nt.reduce((v,T)=>{const A=o[T];return v[T]=(V,M=!1,S=!1)=>(n||g(),A.schedule(V,M,S)),v},{}),cancel:v=>{for(let T=0;T(zt===void 0&&N.set(O.isProcessing||ot.useManualTiming?O.timestamp:performance.now()),zt),set:t=>{zt=t,queueMicrotask(zo)}},ui=t=>e=>typeof e=="string"&&e.startsWith(t),hi=ui("--"),Ho=ui("var(--"),un=t=>Ho(t)?Go.test(t.split("/*")[0].trim()):!1,Go=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function kn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Pt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Lt={...Pt,transform:t=>Q(0,1,t)},Ut={...Pt,default:1},Ct=t=>Math.round(t*1e5)/1e5,hn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function _o(t){return t==null}const Xo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,fn=(t,e)=>n=>!!(typeof n=="string"&&Xo.test(n)&&n.startsWith(t)||e&&!_o(n)&&Object.prototype.hasOwnProperty.call(n,e)),fi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(hn);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Yo=t=>Q(0,255,t),ye={...Pt,transform:t=>Math.round(Yo(t))},ht={test:fn("rgb","red"),parse:fi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ye.transform(t)+", "+ye.transform(e)+", "+ye.transform(n)+", "+Ct(Lt.transform(s))+")"};function qo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Le={test:fn("#"),parse:qo,transform:ht.transform},Ot=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),nt=Ot("deg"),J=Ot("%"),P=Ot("px"),Zo=Ot("vh"),Jo=Ot("vw"),Bn={...J,parse:t=>J.parse(t)/100,transform:t=>J.transform(t*100)},yt={test:fn("hsl","hue"),parse:fi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+J.transform(Ct(e))+", "+J.transform(Ct(n))+", "+Ct(Lt.transform(s))+")"},k={test:t=>ht.test(t)||Le.test(t)||yt.test(t),parse:t=>ht.test(t)?ht.parse(t):yt.test(t)?yt.parse(t):Le.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ht.transform(t):yt.transform(t),getAnimatableNone:t=>{const e=k.parse(t);return e.alpha=0,k.transform(e)}},Qo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function tr(t){return isNaN(t)&&typeof t=="string"&&(t.match(hn)?.length||0)+(t.match(Qo)?.length||0)>0}const di="number",pi="color",er="var",nr="var(",In="${}",sr=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Tt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(sr,u=>(k.test(u)?(s.color.push(r),i.push(pi),n.push(k.parse(u))):u.startsWith(nr)?(s.var.push(r),i.push(er),n.push(u)):(s.number.push(r),i.push(di),n.push(parseFloat(u))),++r,In)).split(In);return{values:n,split:a,indexes:s,types:i}}function ir(t){return Tt(t).values}function mi({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;rtypeof t=="number"?0:k.test(t)?k.getAnimatableNone(t):t,ar=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:rr(t);function lr(t){const e=Tt(t);return mi(e)(e.values.map((s,i)=>ar(s,e.split[i])))}const _={test:tr,parse:ir,createTransformer:or,getAnimatableNone:lr};function ve(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function cr({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,u=2*n-a;i=ve(u,a,t+1/3),r=ve(u,a,t),o=ve(u,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function te(t,e){return n=>n>0?e:t}const D=(t,e,n)=>t+(e-t)*n,xe=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},ur=[Le,ht,yt],hr=t=>ur.find(e=>e.test(t));function Fn(t){const e=hr(t);if(!e)return!1;let n=e.parse(t);return e===yt&&(n=cr(n)),n}const On=(t,e)=>{const n=Fn(t),s=Fn(e);if(!n||!s)return te(t,e);const i={...n};return r=>(i.red=xe(n.red,s.red,r),i.green=xe(n.green,s.green,r),i.blue=xe(n.blue,s.blue,r),i.alpha=D(n.alpha,s.alpha,r),ht.transform(i))},ke=new Set(["none","hidden"]);function fr(t,e){return ke.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function dr(t,e){return n=>D(t,e,n)}function dn(t){return typeof t=="number"?dr:typeof t=="string"?un(t)?te:k.test(t)?On:gr:Array.isArray(t)?gi:typeof t=="object"?k.test(t)?On:pr:te}function gi(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>dn(r)(r,e[o]));return r=>{for(let o=0;o{for(const r in s)n[r]=s[r](i);return n}}function mr(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i{const n=_.createTransformer(e),s=Tt(t),i=Tt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ke.has(t)&&!i.values.length||ke.has(e)&&!s.values.length?fr(t,e):It(gi(mr(s,i),i.values),n):te(t,e)};function yi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?D(t,e,n):dn(t)(t,e)}const yr=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>E.update(e,n),stop:()=>rt(e),now:()=>O.isProcessing?O.timestamp:N.now()}},vi=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r=ee?1/0:e}function vr(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(pn(s),ee);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:$(i)}}const L={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Be(t,e){return t*Math.sqrt(1-e*e)}const xr=12;function Tr(t,e,n){let s=n;for(let i=1;i{const c=l*o,h=c*t,f=c-n,p=Be(l,o),d=Math.exp(-h);return Te-f/p*d},r=l=>{const h=l*o*t,f=h*n+n,p=Math.pow(o,2)*Math.pow(l,2)*t,d=Math.exp(-h),m=Be(Math.pow(l,2),o);return(-i(l)+Te>0?-1:1)*((f-p)*d)/m}):(i=l=>{const c=Math.exp(-l*t),h=(l-n)*t+1;return-Te+c*h},r=l=>{const c=Math.exp(-l*t),h=(n-l)*(t*t);return c*h});const a=5/t,u=Tr(i,r,a);if(t=W(t),isNaN(u))return{stiffness:L.stiffness,damping:L.damping,duration:t};{const l=Math.pow(u,2)*s;return{stiffness:l,damping:o*2*Math.sqrt(s*l),duration:t}}}const Pr=["duration","bounce"],Sr=["stiffness","damping","mass"];function jn(t,e){return e.some(n=>t[n]!==void 0)}function br(t){let e={velocity:L.velocity,stiffness:L.stiffness,damping:L.damping,mass:L.mass,isResolvedFromDuration:!1,...t};if(!jn(t,Sr)&&jn(t,Pr))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*Q(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:L.mass,stiffness:i,damping:r}}else{const n=wr({...t,velocity:0});e={...e,...n,mass:L.mass},e.isResolvedFromDuration=!0}return e}function ne(t=L.visualDuration,e=L.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:u,damping:l,mass:c,duration:h,velocity:f,isResolvedFromDuration:p}=br({...n,velocity:-$(n.velocity||0)}),d=f||0,m=l/(2*Math.sqrt(u*c)),g=o-r,y=$(Math.sqrt(u/c)),x=Math.abs(g)<5;s||(s=x?L.restSpeed.granular:L.restSpeed.default),i||(i=x?L.restDelta.granular:L.restDelta.default);let v,T,A,V,M,S;if(m<1)A=Be(y,m),V=(d+m*y*g)/A,v=b=>{const R=Math.exp(-m*y*b);return o-R*(V*Math.sin(A*b)+g*Math.cos(A*b))},M=m*y*V+g*A,S=m*y*g-V*A,T=b=>Math.exp(-m*y*b)*(M*Math.sin(A*b)+S*Math.cos(A*b));else if(m===1){v=R=>o-Math.exp(-y*R)*(g+(d+y*g)*R);const b=d+y*g;T=R=>Math.exp(-y*R)*(y*b*R-d)}else{const b=y*Math.sqrt(m*m-1);v=X=>{const et=Math.exp(-m*y*X),Y=Math.min(b*X,300);return o-et*((d+m*y*g)*Math.sinh(Y)+b*g*Math.cosh(Y))/b};const R=(d+m*y*g)/b,I=m*y*R-g*b,tt=m*y*g-R*b;T=X=>{const et=Math.exp(-m*y*X),Y=Math.min(b*X,300);return et*(I*Math.sinh(Y)+tt*Math.cosh(Y))}}const C={calculatedDuration:p&&h||null,velocity:b=>W(T(b)),next:b=>{if(!p&&m<1){const I=Math.exp(-m*y*b),tt=Math.sin(A*b),X=Math.cos(A*b),et=o-I*(V*tt+g*X),Y=W(I*(M*tt+S*X));return a.done=Math.abs(Y)<=s&&Math.abs(o-et)<=i,a.value=a.done?o:et,a}const R=v(b);if(p)a.done=b>=h;else{const I=W(T(b));a.done=Math.abs(I)<=s&&Math.abs(o-R)<=i}return a.value=a.done?o:R,a},toString:()=>{const b=Math.min(pn(C),ee),R=vi(I=>C.next(b*I).value,b,30);return b+"ms "+R},toTransition:()=>{}};return C}ne.applyToOptions=t=>{const e=vr(t,100,ne);return t.ease=e.ease,t.duration=W(e.duration),t.type="keyframes",t};const Ar=5;function xi(t,e,n){const s=Math.max(e-Ar,0);return Js(n-t(s),e-s)}function Ie({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},p=S=>a!==void 0&&Su,d=S=>a===void 0?u:u===void 0||Math.abs(a-S)-m*Math.exp(-S/s),v=S=>y+x(S),T=S=>{const C=x(S),b=v(S);f.done=Math.abs(C)<=l,f.value=f.done?y:b};let A,V;const M=S=>{p(f.value)&&(A=S,V=ne({keyframes:[f.value,d(f.value)],velocity:xi(v,S,f.value),damping:i,stiffness:r,restDelta:l,restSpeed:c}))};return M(0),{calculatedDuration:null,next:S=>{let C=!1;return!V&&A===void 0&&(C=!0,T(S),M(S)),A!==void 0&&S>=A?V.next(S-A):(!C&&T(S),f)}}}function Vr(t,e,n){const s=[],i=n||ot.mix||yi,r=t.length-1;for(let o=0;oe[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Vr(e,s,i),u=a.length,l=c=>{if(o&&c1)for(;hl(Q(t[0],t[r-1],c)):l}function Mr(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Rt(0,e,s);t.push(D(n,1,i))}}function Dr(t){const e=[0];return Mr(e,t.length-1),e}function Er(t,e){return t.map(n=>n*e)}function Rr(t,e){return t.map(()=>e||ai).splice(0,t.length-1)}function Mt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=No(s)?s.map(Ln):Ln(s),r={done:!1,value:e[0]},o=Er(n&&n.length===e.length?n:Dr(e),t),a=Cr(o,e,{ease:Array.isArray(i)?i:Rr(e,i)});return{calculatedDuration:t,next:u=>(r.value=a(u),r.done=u>=t,r)}}const Lr=t=>t!==null;function fe(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Lr),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const kr={decay:Ie,inertia:Ie,tween:Mt,keyframes:Mt,spring:ne};function Ti(t){typeof t.type=="string"&&(t.type=kr[t.type])}class mn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Br=t=>t/100;class se extends mn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==N.now()&&this.tick(N.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Ti(e);const{type:n=Mt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const u=n||Mt;u!==Mt&&typeof a[0]!="number"&&(this.mixKeyframes=It(Br,yi(a[0],a[1])),a=[0,100]);const l=u({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=pn(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:p,type:d,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,T=s;if(h){const S=Math.min(this.currentTime,i)/a;let C=Math.floor(S),b=S%1;!b&&S>=1&&(b=1),b===1&&C--,C=Math.min(C,h+1),C%2&&(f==="reverse"?(b=1-b,p&&(b-=p/a)):f==="mirror"&&(T=o)),v=Q(0,1,b)*a}let A;x?(this.delayState.value=c[0],A=this.delayState):A=T.next(v),r&&!x&&(A.value=r(A.value));let{done:V}=A;!x&&u!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return M&&d!==Ie&&(A.value=fe(c,this.options,g,this.speed)),m&&m(A.value),M&&this.finish(),A}then(e,n){return this.finished.then(e,n)}get duration(){return $(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+$(e)}get time(){return $(this.currentTime)}set time(e){e=W(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return xi(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(N.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=$(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=yr,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(N.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Ir(t){for(let e=1;et*180/Math.PI,Fe=t=>{const e=ft(Math.atan2(t[1],t[0]));return Oe(e)},Fr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Fe,rotateZ:Fe,skewX:t=>ft(Math.atan(t[1])),skewY:t=>ft(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Oe=t=>(t=t%360,t<0&&(t+=360),t),Nn=Fe,Un=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Wn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Or={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Un,scaleY:Wn,scale:t=>(Un(t)+Wn(t))/2,rotateX:t=>Oe(ft(Math.atan2(t[6],t[5]))),rotateY:t=>Oe(ft(Math.atan2(-t[2],t[0]))),rotateZ:Nn,rotate:Nn,skewX:t=>ft(Math.atan(t[4])),skewY:t=>ft(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function je(t){return t.includes("scale")?1:0}function Ne(t,e){if(!t||t==="none")return je(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Or,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Fr,i=a}if(!i)return je(e);const r=s[e],o=i[1].split(",").map(Nr);return typeof r=="function"?r(o):o[r]}const jr=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ne(n,e)};function Nr(t){return parseFloat(t.trim())}const St=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bt=new Set([...St,"pathRotation"]),Kn=t=>t===Pt||t===P,Ur=new Set(["x","y","z"]),Wr=St.filter(t=>!Ur.has(t));function Kr(t){const e=[];return Wr.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const it={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ne(e,"x"),y:(t,{transform:e})=>Ne(e,"y")};it.translateX=it.x;it.translateY=it.y;const dt=new Set;let Ue=!1,We=!1,Ke=!1;function wi(){if(We){const t=Array.from(dt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Kr(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{s.getValue(r)?.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}We=!1,Ue=!1,dt.forEach(t=>t.complete(Ke)),dt.clear()}function Pi(){dt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(We=!0)})}function $r(){Ke=!0,Pi(),wi(),Ke=!1}class gn{constructor(e,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(dt.add(this),Ue||(Ue=!0,E.read(Pi),E.resolveKeyframes(wi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}Ir(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),dt.delete(this)}cancel(){this.state==="scheduled"&&(dt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const zr=t=>t.startsWith("--");function Si(t,e,n){zr(e)?t.style.setProperty(e,n):t.style[e]=n}const Hr={};function bi(t,e){const n=Zs(t);return()=>Hr[e]??n()}const Gr=bi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Ai=bi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Vt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,$n={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vt([0,.65,.55,1]),circOut:Vt([.55,0,1,.45]),backIn:Vt([.31,.01,.66,-.59]),backOut:Vt([.33,1.53,.69,.99])};function Vi(t,e){if(t)return typeof t=="function"?Ai()?vi(t,e):"ease-out":li(t)?Vt(t):Array.isArray(t)?t.map(n=>Vi(n,e)||$n.easeOut):$n[t]}function _r(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){const c={[e]:n};u&&(c.offset=u);const h=Vi(a,i);Array.isArray(h)&&(c.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),t.animate(c,f)}function Ci(t){return typeof t=="function"&&"applyToOptions"in t}function Xr({type:t,...e}){return Ci(t)&&Ai()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Mi extends mn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,he(typeof e.type!="string");const l=Xr(e);this.animation=_r(n,s,i,l,r),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const c=fe(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(c),Si(n,s,c),this.animation.cancel()}u?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return $(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+$(e)}get time(){return $(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=W(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Gr()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),z):i(this)}}const Di={anticipate:ii,backInOut:si,circInOut:ri};function Yr(t){return t in Di}function qr(t){typeof t.ease=="string"&&Yr(t.ease)&&(t.ease=Di[t.ease])}const we=10;class Zr extends Mi{constructor(e){qr(e),Ti(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new se({...o,autoplay:!1}),u=Math.max(we,N.now()-this.startTime),l=Q(0,we,u-we),c=a.sample(u).value,{name:h}=this.options;r&&h&&Si(r,h,c),n.setWithVelocity(a.sample(Math.max(0,u-l)).value,c,l),a.stop()}}const zn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(_.test(t)||t==="0")&&!t.startsWith("url("));function Jr(t){const e=t[0];if(t.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function ia(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o,keyframes:a}=t,u=e?.owner?.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return sa()&&n&&(Ei.has(n)||na.has(n)&&ea(a))&&(n!=="transform"||!c)&&!l&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const oa=40;class ra extends mn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:u,motionValue:l,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=N.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:u,motionValue:l,element:c,...h},p=c?.KeyframeResolver||gn;this.keyframeResolver=new p(a,(d,m,g)=>this.onKeyframesResolved(d,m,f,!g),u,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:c}=s;this.resolvedAt=N.now();let h=!0;Qr(e,r,o,a)||(h=!1,(ot.instantAnimations||!u)&&c?.(fe(e,s,n)),e[0]=e[e.length-1],$e(s),s.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>oa?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=h&&!l&&ia(p),m=p.motionValue?.owner?.current;let g;if(d)try{g=new Zr({...p,element:m})}catch{g=new se(p)}else g=new se(p);g.finished.then(()=>{this.notifyFinished()}).catch(z),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),$r()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Ri(t,e,n,s=0,i=1){const r=Array.from(t).sort((l,c)=>l.sortNodePosition(c)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const Hn=30,aa=t=>!isNaN(parseFloat(t));class la{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=N.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=N.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=aa(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new an);const s=this.events[e].add(n);return e==="change"?()=>{s(),E.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=N.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Hn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Hn);return Js(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function wt(t,e){return new la(t,e)}function Li(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function yn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Li(n,t):n}const ca={type:"spring",stiffness:500,damping:25,restSpeed:10},ua=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),ha={type:"keyframes",duration:.8},fa={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},da=(t,{keyframes:e})=>e.length>2?ha:bt.has(t)?t.startsWith("scale")?ua(e[1]):ca:fa,pa=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function ma(t){for(const e in t)if(!pa.has(e))return!0;return!1}const vn=(t,e,n,s={},i,r)=>o=>{const a=yn(s,t)||{},u=a.delay||s.delay||0;let{elapsed:l=0}=s;l=l-W(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};ma(a)||Object.assign(c,da(t,c)),c.duration&&(c.duration=W(c.duration)),c.repeatDelay&&(c.repeatDelay=W(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&($e(c),c.delay===0&&(h=!0)),(ot.instantAnimations||ot.skipAnimations||i?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,$e(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=fe(c.keyframes,a);if(f!==void 0){E.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new se(c):new ra(c)},ga=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ya(t){const e=ga.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function ki(t,e,n=1){const[s,i]=ya(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return Xs(o)?parseFloat(o):o}return un(i)?ki(i,e,n+1):i}function Gn(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function xn(t,e,n,s){if(typeof e=="function"){const[i,r]=Gn(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=Gn(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function pt(t,e,n){const s=t.getProps();return xn(s,e,n!==void 0?n:s.custom,t)}const Bi=new Set(["width","height","top","left","right","bottom",...St]),ze=t=>Array.isArray(t);function va(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,wt(n))}function xa(t){return ze(t)?t[t.length-1]||0:t}function Ta(t,e){const n=pt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=xa(r[o]);va(t,o,a)}}const j=t=>!!(t&&t.getVelocity);function wa(t){return!!(j(t)&&t.add)}function He(t,e){const n=t.getValue("willChange");if(wa(n))return n.add(e);if(!n&&ot.WillChange){const s=new ot.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function Tn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Pa="framerAppearId",Ii="data-"+Tn(Pa);function Fi(t){return t.props[Ii]}function Sa({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Oi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?Li(r,u):u;const l=r?.reduceMotion,c=r?.skipAnimations;s&&(r=s);const h=[],f=i&&t.animationState&&t.animationState.getState()[i],p=r?.path;p&&p.animateVisualElement(t,a,r,n,h);for(const d in a){const m=t.getValue(d,t.latestValues[d]??null),g=a[d];if(g===void 0||f&&Sa(f,d))continue;const y={delay:n,...yn(r||{},d)};c&&(y.skipAnimations=!0);const x=m.get();if(x!==void 0&&!m.isAnimating()&&!Array.isArray(g)&&g===x&&!y.velocity){E.update(()=>m.set(g));continue}let v=!1;if(window.MotionHandoffAnimation){const V=Fi(t);if(V){const M=window.MotionHandoffAnimation(V,d,E);M!==null&&(y.startTime=M,v=!0)}}He(t,d);const T=l??t.shouldReduceMotion;m.start(vn(d,m,g,T&&Bi.has(d)?{type:!1}:y,t,v));const A=m.animation;A&&h.push(A)}if(o){const d=()=>E.update(()=>{o&&Ta(t,o)});h.length?Promise.all(h).then(d):d()}return h}function Ge(t,e,n={}){const s=pt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(Oi(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:l=0,staggerChildren:c,staggerDirection:h}=i;return ba(t,e,u,l,c,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,l]=a==="beforeChildren"?[r,o]:[o,r];return u().then(()=>l())}else return Promise.all([r(),o(n.delay)])}function ba(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(Ge(u,e,{...o,delay:n+(typeof s=="function"?0:s)+Ri(t.variantChildren,u,s,i,r)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}function Aa(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Ge(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Ge(t,e,n);else{const i=typeof e=="function"?pt(t,e,n.custom):e;s=Promise.all(Oi(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Va={test:t=>t==="auto",parse:t=>t},ji=t=>e=>e.test(t),Ni=[Pt,P,J,nt,Jo,Zo,Va],_n=t=>Ni.find(ji(t));function Ca(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||qs(t):!0}const Ma=new Set(["brightness","contrast","saturate","opacity"]);function Da(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(hn)||[];if(!s)return t;const i=n.replace(s,"");let r=Ma.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Ea=/\b([a-z-]*)\(.*?\)/gu,_e={..._,getAnimatableNone:t=>{const e=t.match(Ea);return e?e.map(Da).join(" "):t}},Xe={..._,getAnimatableNone:t=>{const e=_.parse(t);return _.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Xn={...Pt,transform:Math.round},Ra={rotate:nt,pathRotation:nt,rotateX:nt,rotateY:nt,rotateZ:nt,scale:Ut,scaleX:Ut,scaleY:Ut,scaleZ:Ut,skew:nt,skewX:nt,skewY:nt,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:Lt,originX:Bn,originY:Bn,originZ:P},ie={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,inset:P,insetBlock:P,insetBlockStart:P,insetBlockEnd:P,insetInline:P,insetInlineStart:P,insetInlineEnd:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,paddingBlock:P,paddingBlockStart:P,paddingBlockEnd:P,paddingInline:P,paddingInlineStart:P,paddingInlineEnd:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,marginBlock:P,marginBlockStart:P,marginBlockEnd:P,marginInline:P,marginInlineStart:P,marginInlineEnd:P,fontSize:P,backgroundPositionX:P,backgroundPositionY:P,...Ra,zIndex:Xn,fillOpacity:Lt,strokeOpacity:Lt,numOctaves:Xn},La={...ie,color:k,backgroundColor:k,outlineColor:k,fill:k,stroke:k,borderColor:k,borderTopColor:k,borderRightColor:k,borderBottomColor:k,borderLeftColor:k,filter:_e,WebkitFilter:_e,mask:Xe,WebkitMask:Xe},Ui=t=>La[t],ka=new Set([_e,Xe]);function Wi(t,e){let n=Ui(t);return ka.has(n)||(n=_),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ba=new Set(["auto","none","0"]);function Ia(t,e,n){let s=0,i;for(;s{e.getValue(a).set(u)}),this.resolveNoneKeyframes()}}const wn=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Ki(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const Ye=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ht(t){return Ys(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Pn}=ci(queueMicrotask,!1),G={x:!1,y:!1};function $i(){return G.x||G.y}function Oa(t){return t==="x"||t==="y"?G[t]?null:(G[t]=!0,()=>{G[t]=!1}):G.x||G.y?null:(G.x=G.y=!0,()=>{G.x=G.y=!1})}function zi(t,e){const n=Ki(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function ja(t){return!(t.pointerType==="touch"||$i())}function Na(t,e,n={}){const[s,i,r]=zi(t,n);return s.forEach(o=>{let a=!1,u=!1,l;const c=()=>{o.removeEventListener("pointerleave",d)},h=g=>{l&&(l(g),l=void 0),c()},f=g=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),u&&(u=!1,h(g))},p=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},d=g=>{if(g.pointerType!=="touch"){if(a){u=!0;return}h(g)}},m=g=>{if(!ja(g))return;u=!1;const y=e(o,g);typeof y=="function"&&(l=y,o.addEventListener("pointerleave",d,i))};o.addEventListener("pointerenter",m,i),o.addEventListener("pointerdown",p,i)}),r}const Hi=(t,e)=>e?t===e?!0:Hi(t,e.parentElement):!1,Sn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ua=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Wa(t){return Ua.has(t.tagName)||t.isContentEditable===!0}const Ka=new Set(["INPUT","SELECT","TEXTAREA"]);function $a(t){return Ka.has(t.tagName)||t.isContentEditable===!0}const Gt=new WeakSet;function Yn(t){return e=>{e.key==="Enter"&&t(e)}}function Pe(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const za=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Yn(()=>{if(Gt.has(n))return;Pe(n,"down");const i=Yn(()=>{Pe(n,"up")}),r=()=>Pe(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function qn(t){return Sn(t)&&!$i()}const Zn=new WeakSet;function Ha(t,e,n={}){const[s,i,r]=zi(t,n),o=a=>{const u=a.currentTarget;if(!qn(a)||Zn.has(a))return;Gt.add(u),n.stopPropagation&&Zn.add(a);const l=e(u,a),c={...i,capture:!0},h=(d,m)=>{window.removeEventListener("pointerup",f,c),window.removeEventListener("pointercancel",p,c),Gt.has(u)&&Gt.delete(u),qn(d)&&typeof l=="function"&&l(d,{success:m})},f=d=>{h(d,u===window||u===document||n.useGlobalTarget||Hi(u,d.target))},p=d=>{h(d,!1)};window.addEventListener("pointerup",f,c),window.addEventListener("pointercancel",p,c)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Ht(a)&&(a.addEventListener("focus",l=>za(l,i)),!Wa(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function bn(t){return Ys(t)&&"ownerSVGElement"in t}const _t=new WeakMap;let Xt;const Gi=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:bn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Ga=Gi("inline","width","offsetWidth"),_a=Gi("block","height","offsetHeight");function Xa({target:t,borderBoxSize:e}){_t.get(t)?.forEach(n=>{n(t,{get width(){return Ga(t,e)},get height(){return _a(t,e)}})})}function Ya(t){t.forEach(Xa)}function qa(){typeof ResizeObserver>"u"||(Xt=new ResizeObserver(Ya))}function Za(t,e){Xt||qa();const n=Ki(t);return n.forEach(s=>{let i=_t.get(s);i||(i=new Set,_t.set(s,i)),i.add(e),Xt?.observe(s)}),()=>{n.forEach(s=>{const i=_t.get(s);i?.delete(e),i?.size||Xt?.unobserve(s)})}}const Yt=new Set;let vt;function Ja(){vt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yt.forEach(e=>e(t))},window.addEventListener("resize",vt)}function Qa(t){return Yt.add(t),vt||Ja(),()=>{Yt.delete(t),!Yt.size&&typeof vt=="function"&&(window.removeEventListener("resize",vt),vt=void 0)}}function Jn(t,e){return typeof t=="function"?Qa(t):Za(t,e)}function tl(t){return bn(t)&&t.tagName==="svg"}const el=[...Ni,k,_],nl=t=>el.find(ji(t)),Qn=()=>({translate:0,scale:1,origin:0,originPoint:0}),xt=()=>({x:Qn(),y:Qn()}),ts=()=>({min:0,max:0}),B=()=>({x:ts(),y:ts()}),sl=new WeakMap;function de(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function kt(t){return typeof t=="string"||Array.isArray(t)}const An=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Vn=["initial",...An];function pe(t){return de(t.animate)||Vn.some(e=>kt(t[e]))}function _i(t){return!!(pe(t)||t.variants)}function il(t,e,n){for(const s in e){const i=e[s],r=n[s];if(j(i))t.addValue(s,i);else if(j(r))t.addValue(s,wt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,wt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const qe={current:null},Xi={current:!1},ol=typeof window<"u";function rl(){if(Xi.current=!0,!!ol)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>qe.current=t.matches;t.addEventListener("change",e),e()}else qe.current=!1}const es=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let oe={};function Yi(t){oe=t}function al(){return oe}class ll{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=gn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=N.now();this.renderScheduledAtthis.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Xi.current||rl(),this.shouldReduceMotion=qe.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),rt(this.notifyUpdate),rt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Ei.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:u,ease:l,duration:c}=n.accelerate,h=new Mi({element:this.current,name:e,keyframes:a,times:u,ease:l,duration:W(c)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=bt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&E.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in oe){const n=oe[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):B()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;sn.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=wt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Xs(s)||qs(s))?s=parseFloat(s):!nl(s)&&_.test(n)&&(s=Wi(e,n)),this.setBaseTarget(e,j(s)?s.get():s)),j(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=xn(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!j(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new an),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Pn.render(this.render)}}class qi extends ll{constructor(){super(...arguments),this.KeyframeResolver=Fa}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;j(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class at{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Zi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function cl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function ul(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Se(t){return t===void 0||t===1}function Ze({scale:t,scaleX:e,scaleY:n}){return!Se(t)||!Se(e)||!Se(n)}function ut(t){return Ze(t)||Ji(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ji(t){return ns(t.x)||ns(t.y)}function ns(t){return t&&t!=="0%"}function re(t,e,n){const s=t-n,i=e*s;return n+i}function ss(t,e,n,s,i){return i!==void 0&&(t=re(t,i,s)),re(t,n,s)+e}function Je(t,e=0,n=1,s,i){t.min=ss(t.min,e,n,s,i),t.max=ss(t.max,e,n,s,i)}function Qi(t,{x:e,y:n}){Je(t.x,e.translate,e.scale,e.originPoint),Je(t.y,n.translate,n.scale,n.originPoint)}const is=.999999999999,os=1.0000000000001;function hl(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;ais&&(e.x=1),e.yis&&(e.y=1)}function Z(t,e){t.min+=e,t.max+=e}function rs(t,e,n,s,i=.5){const r=D(t.min,t.max,i);Je(t,e,n,r,s)}function as(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function qt(t,e,n){const s=n??t;rs(t.x,as(e.x,s.x),e.scaleX,e.scale,e.originX),rs(t.y,as(e.y,s.y),e.scaleY,e.scale,e.originY)}function to(t,e){return Zi(ul(t.getBoundingClientRect(),e))}function fl(t,e,n){const s=to(t,n),{scroll:i}=e;return i&&(Z(s.x,i.offset.x),Z(s.y,i.offset.y)),s}const dl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pl=St.length;function ml(t,e,n){let s="",i=!0;for(let o=0;o{if(!e.target)return t;if(typeof t=="string")if(P.test(t))t=parseFloat(t);else return t;const n=ls(t,e.target.x),s=ls(t,e.target.y);return`${n}% ${s}%`}},gl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=_.parse(t);if(i.length>5)return s;const r=_.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,u=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=u;const l=D(a,u,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),r(i)}},Qe={borderRadius:{...At,applyTo:[...wn]},borderTopLeftRadius:At,borderTopRightRadius:At,borderBottomLeftRadius:At,borderBottomRightRadius:At,boxShadow:gl};function no(t,{layout:e,layoutId:n}){return bt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Qe[t]||t==="opacity")}function Mn(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(j(s[o])||i&&j(i[o])||no(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function yl(t){return window.getComputedStyle(t)}class vl extends qi{constructor(){super(...arguments),this.type="html",this.renderInstance=eo}mount(e){he(!!e.style),super.mount(e)}readValueFromInstance(e,n){if(bt.has(n))return this.projection?.isProjecting?je(n):jr(e,n);{const s=yl(e),i=(hi(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return to(e,n)}build(e,n,s){Cn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Mn(e,n,s)}}const xl={offset:"stroke-dashoffset",array:"stroke-dasharray"},Tl={offset:"strokeDashoffset",array:"strokeDasharray"};function wl(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?xl:Tl;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const Pl=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function so(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},u,l,c){if(Cn(t,a,l),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=c?.transformBox??"fill-box",delete h.transformBox);for(const p of Pl)h[p]!==void 0&&(f[p]=h[p],delete h[p]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&wl(h,i,r,o,!1)}const io=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),oo=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Sl(t,e,n,s){eo(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(io.has(i)?i:Tn(i),e.attrs[i])}function ro(t,e,n){const s=Mn(t,e,n);for(const i in t)if(j(t[i])||j(e[i])){const r=St.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class bl extends qi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=B}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(bt.has(n)){const s=Ui(n);return s&&s.default||0}return n=io.has(n)?n:Tn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return ro(e,n,s)}build(e,n,s){so(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Sl(e,n,s,i)}mount(e){this.isSVGTag=oo(e.tagName),super.mount(e)}}const Al=Vn.length;function ao(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?ao(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;nPromise.all(e.map(({animation:n,options:s})=>Aa(t,n,s)))}function Dl(t){let e=Ml(t),n=cs(),s=!0,i=!1;const r=l=>(c,h)=>{const f=pt(t,h,l==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:p,transitionEnd:d,...m}=f;c={...c,...m,...d}}return c};function o(l){e=l(t)}function a(l){const{props:c}=t,h=ao(t.parent)||{},f=[],p=new Set;let d={},m=1/0;for(let y=0;ym&&A,b=!1;const R=Array.isArray(T)?T:[T];let I=R.reduce(r(x),{});V===!1&&(I={});const{prevResolvedValues:tt={}}=v,X={...tt,...I},et=F=>{C=!0,p.has(F)&&(b=!0,p.delete(F)),v.needsAnimating[F]=!0;const K=t.getValue(F);K&&(K.liveStyle=!1)};for(const F in X){const K=I[F],lt=tt[F];if(d.hasOwnProperty(F))continue;let mt=!1;ze(K)&&ze(lt)?mt=!lo(K,lt)||S:mt=K!==lt,mt?K!=null?et(F):p.add(F):K!==void 0&&p.has(F)?et(F):v.protectedKeys[F]=!0}v.prevProp=T,v.prevResolvedValues=I,v.isActive&&(d={...d,...I}),(s||i)&&t.blockInitialAnimation&&(C=!1);const Y=M&&S;C&&(!Y||b)&&f.push(...R.map(F=>{const K={type:x};if(typeof F=="string"&&(s||i)&&!Y&&t.manuallyAnimateOnMount&&t.parent){const{parent:lt}=t,mt=pt(lt,F);if(lt.enteringChildren&&mt){const{delayChildren:Lo}=mt.transition||{};K.delay=Ri(lt.enteringChildren,t,Lo)}}return{animation:F,options:K}}))}if(p.size){const y={};if(typeof c.initial!="boolean"){const x=pt(t,Array.isArray(c.initial)?c.initial[0]:c.initial);x&&x.transition&&(y.transition=x.transition)}p.forEach(x=>{const v=t.getBaseTarget(x),T=t.getValue(x);T&&(T.liveStyle=!0),y[x]=v??null}),f.push({animation:y})}let g=!!f.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,i=!1,g?e(f):Promise.resolve()}function u(l,c){if(n[l].isActive===c)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const h=a(l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:a,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=cs(),i=!0}}}function El(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!lo(e,t):!1}function ct(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function cs(){return{animate:ct(!0),whileInView:ct(),whileHover:ct(),whileTap:ct(),whileDrag:ct(),whileFocus:ct(),exit:ct()}}function tn(t,e){t.min=e.min,t.max=e.max}function H(t,e){tn(t.x,e.x),tn(t.y,e.y)}function us(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const co=1e-4,Rl=1-co,Ll=1+co,uo=.01,kl=0-uo,Bl=0+uo;function U(t){return t.max-t.min}function Il(t,e,n){return Math.abs(t-e)<=n}function hs(t,e,n,s=.5){t.origin=s,t.originPoint=D(e.min,e.max,t.origin),t.scale=U(n)/U(e),t.translate=D(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Rl&&t.scale<=Ll||isNaN(t.scale))&&(t.scale=1),(t.translate>=kl&&t.translate<=Bl||isNaN(t.translate))&&(t.translate=0)}function Dt(t,e,n,s){hs(t.x,e.x,n.x,s?s.originX:void 0),hs(t.y,e.y,n.y,s?s.originY:void 0)}function fs(t,e,n,s=0){const i=s?D(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+U(e)}function Fl(t,e,n,s){fs(t.x,e.x,n.x,s?.x),fs(t.y,e.y,n.y,s?.y)}function ds(t,e,n,s=0){const i=s?D(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+U(e)}function ae(t,e,n,s){ds(t.x,e.x,n.x,s?.x),ds(t.y,e.y,n.y,s?.y)}function ps(t,e,n,s,i){return t-=e,t=re(t,1/n,s),i!==void 0&&(t=re(t,1/i,s)),t}function Ol(t,e=0,n=1,s=.5,i,r=t,o=t){if(J.test(e)&&(e=parseFloat(e),e=D(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=D(r.min,r.max,s);t===r&&(a-=e),t.min=ps(t.min,e,n,a,i),t.max=ps(t.max,e,n,a,i)}function ms(t,e,[n,s,i],r,o){Ol(t,e[n],e[s],e[i],e.scale,r,o)}const jl=["x","scaleX","originX"],Nl=["y","scaleY","originY"];function gs(t,e,n,s){ms(t.x,e,jl,n?n.x:void 0,s?s.x:void 0),ms(t.y,e,Nl,n?n.y:void 0,s?s.y:void 0)}function ys(t){return t.translate===0&&t.scale===1}function ho(t){return ys(t.x)&&ys(t.y)}function vs(t,e){return t.min===e.min&&t.max===e.max}function Ul(t,e){return vs(t.x,e.x)&&vs(t.y,e.y)}function xs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function fo(t,e){return xs(t.x,e.x)&&xs(t.y,e.y)}function Ts(t){return U(t.x)/U(t.y)}function ws(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function q(t){return[t("x"),t("y")]}function Wl(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:l,rotate:c,pathRotation:h,rotateX:f,rotateY:p,skewX:d,skewY:m}=n;l&&(s=`perspective(${l}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotate(${h}deg) `),f&&(s+=`rotateX(${f}deg) `),p&&(s+=`rotateY(${p}deg) `),d&&(s+=`skewX(${d}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,u=t.y.scale*e.y;return(a!==1||u!==1)&&(s+=`scale(${a}, ${u})`),s||"none"}const Kl=wn.length,Ps=t=>typeof t=="string"?parseFloat(t):t,Ss=t=>typeof t=="number"||P.test(t);function $l(t,e,n,s,i,r){i?(t.opacity=D(0,n.opacity??1,zl(s)),t.opacityExit=D(e.opacity??1,0,Hl(s))):r&&(t.opacity=D(e.opacity??1,n.opacity??1,s));for(let o=0;ose?1:n(Rt(t,e,s))}function Gl(t,e,n){const s=j(t)?t:wt(t);return s.start(vn("",s,e,n)),s.animation}function Bt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n,s)}const _l=(t,e)=>t.depth-e.depth;class Xl{constructor(){this.children=[],this.isDirty=!1}add(e){rn(this.children,e),this.isDirty=!0}remove(e){Qt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(_l),this.isDirty=!1,this.children.forEach(e)}}function Yl(t,e){const n=N.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(rt(s),t(r-e))};return E.setup(s,!0),()=>rt(s)}function Zt(t){return j(t)?t.get():t}class ql{constructor(){this.members=[]}add(e){rn(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(Qt(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(Qt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:r}=e.options;(i===void 0||i!==r)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Jt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},be=["","X","Y","Z"],Zl=1e3;let Jl=0;function Ae(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function mo(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Fi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",E,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&mo(s)}function go({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=Jl++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ec),this.nodes.forEach(ac),this.nodes.forEach(lc),this.nodes.forEach(nc)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let u=0;uthis.root.updateBlockedByResize=!1;E.read(()=>{h=window.innerWidth}),t(o,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,c&&c(),c=Yl(f,250),Jt.hasAnimatedSinceResize&&(Jt.hasAnimatedSinceResize=!1,this.nodes.forEach(Cs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const d=this.options.transition||l.getDefaultTransition()||dc,{onLayoutAnimationStart:m,onLayoutAnimationComplete:g}=l.getProps(),y=!this.targetLayout||!fo(this.targetLayout,p),x=!h&&f;if(this.options.layoutRoot||this.resumeFrom||x||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...yn(d,"layout"),onPlay:m,onComplete:g};(l.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(c,x,v.path)}else h||Cs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),rt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(cc),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&mo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!U(this.snapshot.measuredBox.x)&&!U(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u{const M=V/1e3,S=A?.(M);S?(f.x.translate=S.x,f.x.scale=D(o.x.scale,1,M),f.x.origin=o.x.origin,f.x.originPoint=o.x.originPoint,f.y.translate=S.y,f.y.scale=D(o.y.scale,1,M),f.y.origin=o.y.origin,f.y.originPoint=o.y.originPoint):(Ms(f.x,o.x,M),Ms(f.y,o.y,M)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ae(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),hc(this.relativeTarget,this.relativeTargetOrigin,p,M),T&&Ul(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=B()),H(T,this.relativeTarget)),g&&(this.animationValues=h,$l(h,c,this.latestValues,M,v,x)),S&&S.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=S.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(rt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=E.update(()=>{Jt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=wt(0)),this.motionValue.jump(0,!1),this.currentAnimation=Gl(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Zl),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:u,layout:l,latestValues:c}=o;if(!(!a||!u||!l)){if(this!==o&&this.layout&&l&&yo(this.options.animationType,this.layout.layoutBox,l.layoutBox)){u=this.target||B();const h=U(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+h;const f=U(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+f}H(a,u),qt(a,c),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new ql),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:u}={}){const l=this.getStack();l&&l.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;const l={};u.z&&Ae("z",o,l,this.animationValues);for(let c=0;co.currentAnimation?.stop()),this.root.nodes.forEach(As),this.root.sharedNodes.clear()}}}function Ql(t){t.updateLayout()}function tc(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;if(i==="size")q(c=>{const h=r?e.measuredBox[c]:e.layoutBox[c],f=U(h);h.min=n[c].min,h.max=h.min+f});else if(i==="x"||i==="y"){const c=i==="x"?"y":"x";tn(r?e.measuredBox[c]:e.layoutBox[c],n[c])}else yo(i,e.layoutBox,n)&&q(c=>{const h=r?e.measuredBox[c]:e.layoutBox[c],f=U(n[c]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[c].max=t.relativeTarget[c].min+f)});const o=xt();Dt(o,n,e.layoutBox);const a=xt();r?Dt(a,t.applyTransform(s,!0),e.measuredBox):Dt(a,n,e.layoutBox);const u=!ho(o);let l=!1;if(!t.resumeFrom){const c=t.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:h,layout:f}=c;if(h&&f){const p=t.options.layoutAnchor||void 0,d=B();ae(d,e.layoutBox,h.layoutBox,p);const m=B();ae(m,n,f.layoutBox,p),fo(d,m)||(l=!0),c.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=d,t.relativeParent=c)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:l})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function ec(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function nc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function sc(t){t.clearSnapshot()}function As(t){t.clearMeasurements()}function ic(t){t.isLayoutDirty=!0,t.updateLayout()}function Vs(t){t.isLayoutDirty=!1}function oc(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function rc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Cs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ac(t){t.resolveTargetDelta()}function lc(t){t.calcProjection()}function cc(t){t.resetSkewAndRotation()}function uc(t){t.removeLeadSnapshot()}function Ms(t,e,n){t.translate=D(e.translate,0,n),t.scale=D(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ds(t,e,n,s){t.min=D(e.min,n.min,s),t.max=D(e.max,n.max,s)}function hc(t,e,n,s){Ds(t.x,e.x,n.x,s),Ds(t.y,e.y,n.y,s)}function fc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const dc={duration:.45,ease:[.4,0,.1,1]},Es=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Rs=Es("applewebkit/")&&!Es("chrome/")?Math.round:z;function Ls(t){t.min=Rs(t.min),t.max=Rs(t.max)}function pc(t){Ls(t.x),Ls(t.y)}function yo(t,e,n){return t==="position"||t==="preserve-aspect"&&!Il(Ts(e),Ts(n),.2)}function mc(t){return t!==t.root&&t.scroll?.wasRoot}const gc=go({attachResizeListener:(t,e)=>Bt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Ve={current:void 0},vo=go({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ve.current){const t=new gc({});t.mount(window),t.setOptions({layoutScroll:!0}),Ve.current=t}return Ve.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Dn=w.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function ks(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function yc(...t){return e=>{let n=!1;const s=t.map(i=>{const r=ks(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i{const{width:f,height:p,top:d,left:m,right:g,bottom:y,direction:x}=u.current;if(e||r===!1||!a.current||!f||!p)return;const v=x==="rtl",T=n==="left"?v?`right: ${g}`:`left: ${m}`:v?`left: ${m}`:`right: ${g}`,A=s==="bottom"?`bottom: ${y}`:`top: ${d}`;a.current.dataset.motionPopId=o;const V=document.createElement("style");l&&(V.nonce=l);const M=i??document.head;return M.appendChild(V),V.sheet&&V.sheet.insertRule(` [data-motion-pop-id="${o}"] { position: absolute !important; width: ${f}px !important; height: ${p}px !important; ${T}px !important; ${A}px !important; } `),()=>{a.current?.removeAttribute("data-motion-pop-id"),M.contains(V)&&M.removeChild(V)}},[e]),st.jsx(xc,{isPresent:e,childRef:a,sizeRef:u,pop:r,children:r===!1?t:w.cloneElement(t,{ref:h})})}const wc=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:u,root:l})=>{const c=ce(Pc),h=w.useId(),f=w.useRef(n),p=w.useRef(s);on(()=>{f.current=n,p.current=s});let d=!0,m=w.useMemo(()=>(d=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:g=>{c.set(g,!0);for(const y of c.values())if(!y)return;s&&s()},register:g=>(c.set(g,!1),()=>{c.delete(g),!f.current&&!c.size&&p.current?.()})}),[n,c,s]);return r&&d&&(m={...m}),w.useMemo(()=>{c.forEach((g,y)=>c.set(y,!1))},[n]),w.useEffect(()=>{!n&&!c.size&&s&&s()},[n]),t=st.jsx(Tc,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:u,root:l,children:t}),st.jsx(ue.Provider,{value:m,children:t})};function Pc(){return new Map}function xo(t=!0){const e=w.useContext(ue);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=w.useId();w.useEffect(()=>{if(t)return i(r)},[t]);const o=w.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const Wt=t=>t.key||"";function Bs(t){const e=[];return w.Children.forEach(t,n=>{w.isValidElement(n)&&e.push(n)}),e}const Iu=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:u="top",root:l})=>{const[c,h]=xo(o),f=w.useMemo(()=>Bs(t),[t]),p=o&&!c?[]:f.map(Wt),d=w.useRef(!0),m=w.useRef(f),g=ce(()=>new Map),y=w.useRef(new Set),[x,v]=w.useState(f),[T,A]=w.useState(f);on(()=>{d.current=!1,m.current=f;for(let S=0;S{const C=Wt(S),b=o&&!c?!1:f===T||p.includes(C),R=()=>{if(y.current.has(C))return;if(g.has(C))y.current.add(C),g.set(C,!0);else return;let I=!0;g.forEach(tt=>{tt||(I=!1)}),I&&(M?.(),A(m.current),o&&h?.(),s&&s())};return st.jsx(wc,{isPresent:b,initial:!d.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:l,onExitComplete:b?void 0:R,anchorX:a,anchorY:u,children:S},C)})})},To=w.createContext({strict:!1}),Is={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Fs=!1;function Sc(){if(Fs)return;const t={};for(const e in Is)t[e]={isEnabled:n=>Is[e].some(s=>!!n[s])};Yi(t),Fs=!0}function wo(){return Sc(),al()}function bc(t){const e=wo();for(const n in t)e[n]={...e[n],...t[n]};Yi(e)}const Ac=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function le(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ac.has(t)}let Po=t=>!le(t);function Vc(t){typeof t=="function"&&(Po=e=>e.startsWith("on")?!le(e):t(e))}try{Vc(require("@emotion/is-prop-valid").default)}catch{}function Cc(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||j(t[i])||(Po(i)||n===!0&&le(i)||!e&&!le(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const me=w.createContext({});function Mc(t,e){if(pe(t)){const{initial:n,animate:s}=t;return{initial:n===!1||kt(n)?n:void 0,animate:kt(s)?s:void 0}}return t.inherit!==!1?e:{}}function Dc(t){const{initial:e,animate:n}=Mc(t,w.useContext(me));return w.useMemo(()=>({initial:e,animate:n}),[Os(e),Os(n)])}function Os(t){return Array.isArray(t)?t.join(" "):t}const En=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function So(t,e,n){for(const s in e)!j(e[s])&&!no(s,n)&&(t[s]=e[s])}function Ec({transformTemplate:t},e){return w.useMemo(()=>{const n=En();return Cn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Rc(t,e){const n=t.style||{},s={};return So(s,n,t),Object.assign(s,Ec(t,e)),s}function Lc(t,e){const n={},s=Rc(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const bo=()=>({...En(),attrs:{}});function kc(t,e,n,s){const i=w.useMemo(()=>{const r=bo();return so(r,e,oo(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};So(r,t.style,t),i.style={...r,...i.style}}return i}const Bc=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Rn(t){return typeof t!="string"||t.includes("-")?!1:!!(Bc.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ic(t,e,n,{latestValues:s},i,r=!1,o){const u=(o??Rn(t)?kc:Lc)(e,s,i,t),l=Cc(e,typeof t=="string",r),c=t!==w.Fragment?{...l,...u,ref:n}:{},{children:h}=e,f=w.useMemo(()=>j(h)?h.get():h,[h]);return w.createElement(t,{...c,children:f})}function Fc({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Oc(n,s,i,t),renderState:e()}}function Oc(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=Zt(r[f]);let{initial:o,animate:a}=t;const u=pe(t),l=_i(t);e&&l&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const h=c?a:o;if(h&&typeof h!="boolean"&&!de(h)){const f=Array.isArray(h)?h:[h];for(let p=0;p(e,n)=>{const s=w.useContext(me),i=w.useContext(ue),r=()=>Fc(t,e,s,i);return n?r():ce(r)},jc=Ao({scrapeMotionValuesFromProps:Mn,createRenderState:En}),Nc=Ao({scrapeMotionValuesFromProps:ro,createRenderState:bo}),Uc=Symbol.for("motionComponentSymbol");function Wc(t,e,n){const s=w.useRef(n);w.useInsertionEffect(()=>{s.current=n});const i=w.useRef(null);return w.useCallback(r=>{r&&t.onMount?.(r),e&&(r?e.mount(r):e.unmount());const o=s.current;if(typeof o=="function")if(r){const a=o(r);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r)},[e])}const Vo=w.createContext({});function gt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Kc(t,e,n,s,i,r){const{visualElement:o}=w.useContext(me),a=w.useContext(To),u=w.useContext(ue),l=w.useContext(Dn),c=l.reducedMotion,h=l.skipAnimations,f=w.useRef(null),p=w.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c,skipAnimations:h,isSVG:r}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const d=f.current,m=w.useContext(Vo);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&$c(f.current,n,i,m);const g=w.useRef(!1);w.useInsertionEffect(()=>{d&&g.current&&d.update(n,u)});const y=n[Ii],x=w.useRef(!!y&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return on(()=>{p.current=!0,d&&(g.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),x.current&&d.animationState&&d.animationState.animateChanges())}),w.useEffect(()=>{d&&(!x.current&&d.animationState&&d.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),x.current=!1),d.enteringChildren=void 0)}),d}function $c(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:u,layoutRoot:l,layoutAnchor:c,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Co(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&>(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:u,layoutRoot:l,layoutAnchor:c})}function Co(t){if(t)return t.options.allowProjection!==!1?t.projection:Co(t.parent)}function Ce(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&bc(s);const r=n?n==="svg":Rn(t),o=r?Nc:jc;function a(l,c){let h;const f={...w.useContext(Dn),...l,layoutId:zc(l)},{isStatic:p}=f,d=Dc(l),m=o(l,p);if(!p&&typeof window<"u"){Hc();const g=Gc(f);h=g.MeasureLayout,d.visualElement=Kc(t,m,f,i,g.ProjectionNode,r)}return st.jsxs(me.Provider,{value:d,children:[h&&d.visualElement?st.jsx(h,{visualElement:d.visualElement,...f}):null,Ic(t,l,Wc(m,d.visualElement,c),m,p,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=w.forwardRef(a);return u[Uc]=t,u}function zc({layoutId:t}){const e=w.useContext(sn).id;return e&&t!==void 0?e+"-"+t:t}function Hc(t,e){w.useContext(To).strict}function Gc(t){const e=wo(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function _c(t,e){if(typeof Proxy>"u")return Ce;const n=new Map,s=(r,o)=>Ce(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,Ce(o,void 0,t,e)),n.get(o))})}const Xc=(t,e)=>e.isSVG??Rn(t)?new bl(e):new vl(e,{allowProjection:t!==w.Fragment});class Yc extends at{constructor(e){super(e),e.animationState||(e.animationState=Dl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();de(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let qc=0;class Zc extends at{constructor(){super(...arguments),this.id=qc++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;if(e&&s===!1){if(this.isExitComplete){const{initial:r,custom:o}=this.node.getProps();if(typeof r=="string"||typeof r=="object"&&r!==null&&!Array.isArray(r)){const a=pt(this.node,r,o);if(a){const{transition:u,transitionEnd:l,...c}=a;for(const h in c)this.node.getValue(h)?.jump(c[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Jc={animation:{Feature:Yc},exit:{Feature:Zc}};function jt(t){return{point:{x:t.pageX,y:t.pageY}}}const Qc=t=>e=>Sn(e)&&t(e,jt(e));function Et(t,e,n,s){return Bt(t,e,Qc(n),s)}const Mo=({current:t})=>t?t.ownerDocument.defaultView:null,js=(t,e)=>Math.abs(t-e);function tu(t,e){const n=js(t.x,e.x),s=js(t.y,e.y);return Math.sqrt(n**2+s**2)}const Ns=new Set(["auto","scroll"]);class Do{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Kt(this.lastRawMoveEventInfo,this.transformPagePoint));const d=Me(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=tu(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:y}=d,{timestamp:x}=O;this.history.push({...y,timestamp:x});const{onStart:v,onMove:T}=this.handlers;m||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=Kt(m,this.transformPagePoint),E.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Me(d.type==="pointercancel"?this.lastMoveEventInfo:Kt(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,v),y&&y(d,v)},!Sn(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const u=jt(e),l=Kt(u,this.transformPagePoint),{point:c}=l,{timestamp:h}=O;this.history=[{...c,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,Me(l,this.history));const p={passive:!0,capture:!0};this.removeListeners=It(Et(this.contextWindow,"pointermove",this.handlePointerMove,p),Et(this.contextWindow,"pointerup",this.handlePointerUp,p),Et(this.contextWindow,"pointercancel",this.handlePointerUp,p)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Ns.has(s.overflowX)||Ns.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),E.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),rt(this.updatePoint)}}function Kt(t,e){return e?{point:e(t.point)}:t}function Us(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Me({point:t},e){return{point:t,delta:Us(t,Eo(e)),offset:Us(t,eu(e)),velocity:nu(e,.1)}}function eu(t){return t[0]}function Eo(t){return t[t.length-1]}function nu(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Eo(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>W(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>W(e)*2&&(s=t[1]);const r=$(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function su(t,{min:e,max:n},s){return e!==void 0&&tn&&(t=s?D(n,t,s.max):Math.min(t,n)),t}function Ws(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function iu(t,{top:e,left:n,bottom:s,right:i}){return{x:Ws(t.x,n,i),y:Ws(t.y,e,s)}}function Ks(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.mins?n=Rt(e.min,e.max-s,t.min):s>i&&(n=Rt(t.min,t.max-i,e.min)),Q(0,1,n)}function au(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const en=.35;function lu(t=en){return t===!1?t=0:t===!0&&(t=en),{x:$s(t,"left","right"),y:$s(t,"top","bottom")}}function $s(t,e,n){return{min:zs(t,e),max:zs(t,n)}}function zs(t,e){return typeof t=="number"?t:t[e]||0}const cu=new WeakMap;class uu{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=B(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(jt(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:p,dragPropagation:d,onDragStart:m}=this.getProps();if(p&&!d&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Oa(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),q(y=>{let x=this.getAxisMotionValue(y).get()||0;if(J.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const T=v.layout.layoutBox[y];T&&(x=U(T)*(parseFloat(x)/100))}}this.originPoint[y]=x}),m&&E.update(()=>m(h,f),!1,!0),He(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:d,onDirectionLock:m,onDrag:g}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=f;if(d&&this.currentDirection===null){this.currentDirection=fu(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),g&&E.update(()=>g(h,f),!1,!0)},u=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new Do(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:u,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:Mo(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&E.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!$t(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=su(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&>(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=iu(s.layoutBox,e):this.constraints=!1,this.elastic=lu(n),i!==this.constraints&&!gt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&q(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=au(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!gt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const r=fl(s,i.root,this.visualElement.getTransformPagePoint());let o=ou(i.layout.layoutBox,r);if(n){const a=n(cl(o));this.hasMutatedConstraints=!!a,a&&(o=Zi(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},l=q(c=>{if(!$t(c,n,this.currentDirection))return;let h=u&&u[c]||{};(o===!0||o===c)&&(h={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,d={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(c,d)});return Promise.all(l).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return He(this.visualElement,e),s.start(vn(e,s,0,n,this.visualElement,!1))}stopAnimation(){q(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){q(n=>{const{drag:s}=this.getProps();if(!$t(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],u=r.get()||0;r.set(e[n]-D(o,a,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!gt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};q(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const u=a.get();i[o]=ru({min:u,max:u},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),q(o=>{if(!$t(o,e,null))return;const a=this.getAxisMotionValue(o),{min:u,max:l}=this.constraints[o];a.set(D(u,l,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;cu.set(this.visualElement,this);const e=this.visualElement.current,n=Et(e,"pointerdown",l=>{const{drag:c,dragListener:h=!0}=this.getProps(),f=l.target,p=f!==e&&$a(f);c&&h&&!p&&this.start(l)});let s;const i=()=>{const{dragConstraints:l}=this.getProps();gt(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),s||(s=hu(e,l.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),E.read(i);const a=Bt(window,"resize",()=>this.scalePositionWithinConstraints()),u=r.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(q(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=l[h].translate,f.set(f.get()+l[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),u&&u(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=en,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Hs(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function hu(t,e,n){const s=Jn(t,Hs(n)),i=Jn(e,Hs(n));return()=>{s(),i()}}function $t(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function fu(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class du extends at{constructor(e){super(e),this.removeGroupControls=z,this.removeListeners=z,this.controls=new uu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||z}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const De=t=>(e,n)=>{t&&E.update(()=>t(e,n),!1,!0)};class pu extends at{constructor(){super(...arguments),this.removePointerDownListener=z}onPointerDown(e){this.session=new Do(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Mo(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:De(e),onStart:De(n),onMove:De(s),onEnd:(r,o)=>{delete this.session,i&&E.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Et(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Ee=!1;class mu extends w.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),Ee&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Jt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Ee=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||E.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:s}=e;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),Pn.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;Ee=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ro(t){const[e,n]=xo(),s=w.useContext(sn);return st.jsx(mu,{...t,layoutGroup:s,switchLayoutGroup:w.useContext(Vo),isPresent:e,safeToRemove:n})}const gu={pan:{Feature:pu},drag:{Feature:du,ProjectionNode:vo,MeasureLayout:Ro}};function Gs(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&E.postRender(()=>r(e,jt(e)))}class yu extends at{mount(){const{current:e}=this.node;e&&(this.unmount=Na(e,(n,s)=>(Gs(this.node,s,"Start"),i=>Gs(this.node,i,"End"))))}unmount(){}}class vu extends at{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=It(Bt(this.node.current,"focus",()=>this.onFocus()),Bt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function _s(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&E.postRender(()=>r(e,jt(e)))}class xu extends at{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Ha(e,(i,r)=>(_s(this.node,r,"Start"),(o,{success:a})=>_s(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const nn=new WeakMap,Re=new WeakMap,Tu=t=>{const e=nn.get(t.target);e&&e(t)},wu=t=>{t.forEach(Tu)};function Pu({root:t,...e}){const n=t||document;Re.has(n)||Re.set(n,{});const s=Re.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(wu,{root:t,...e})),s[i]}function Su(t,e,n){const s=Pu(e);return nn.set(t,n),s.observe(t),()=>{nn.delete(t),s.unobserve(t)}}const bu={some:0,all:1};class Au extends at{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:bu[i]},a=u=>{const{isIntersecting:l}=u;if(this.isInView===l||(this.isInView=l,r&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=l?c:h;f&&f(u)};this.stopObserver=Su(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Vu(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Vu({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Cu={inView:{Feature:Au},tap:{Feature:xu},focus:{Feature:vu},hover:{Feature:yu}},Mu={layout:{ProjectionNode:vo,MeasureLayout:Ro}},Du={...Jc,...Cu,...gu,...Mu},Fu=_c(Du,Xc);class Eu{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}start(e,n){this.componentControls.forEach(s=>{s.start(e.nativeEvent||e,n)})}cancel(){this.componentControls.forEach(e=>{e.cancel()})}stop(){this.componentControls.forEach(e=>{e.stop()})}}const Ru=()=>new Eu;function Ou(){return ce(Ru)}export{Iu as A,Fu as m,Ou as u};