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