import{c as _s,r as w,m as Uo,a5 as Wo,j as Y,n as Ko,f as $o,l as Go,h as _o,B as zo,P as zs,i as vt}from"./index-7mCYgmGq.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eh=_s("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nh=_s("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var Ho=Wo[" useId ".trim().toString()]||(()=>{}),Yo=0;function Xo(t){const[e,n]=w.useState(Ho());return Uo(()=>{t||n(s=>s??String(Yo++))},[t]),t||(e?`radix-${e}`:"")}const Hs=w.createContext({});function qo(t){const e=w.useRef(null);return e.current===null&&(e.current=t()),e.current}const Zo=typeof window<"u",Jo=Zo?w.useLayoutEffect:w.useEffect,Je=w.createContext(null);function Qe(t,e){t.indexOf(e)===-1&&t.push(e)}function Jt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const q=(t,e,n)=>n>e?e:n<t?t:n;let re=()=>{},xt=()=>{};const Z={},Ys=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Xs(t){return typeof t=="object"&&t!==null}const qs=t=>/^0[^.\s]+$/u.test(t);function Zs(t){let e;return()=>(e===void 0&&(e=t()),e)}const W=t=>t,Qo=(t,e)=>n=>e(t(n)),Bt=(...t)=>t.reduce(Qo),Rt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class tn{constructor(){this.subscriptions=[]}add(e){return Qe(this.subscriptions,e),()=>Jt(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;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const K=t=>t*1e3,U=t=>t/1e3;function Js(t,e){return e?t*(1e3/e):0}const Qs=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,tr=1e-7,er=12;function nr(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)>tr&&++a<er);return o}function Ot(t,e,n,s){if(t===e&&n===s)return W;const i=r=>nr(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=Ot(.33,1.53,.69,.99),en=ei(ni),si=ti(en),ii=t=>(t*=2)<1?.5*en(t):.5*(2-Math.pow(2,-10*(t-1))),nn=t=>1-Math.sin(Math.acos(t)),oi=ei(nn),ri=ti(nn),sr=Ot(.42,0,1,1),ir=Ot(0,0,.58,1),ai=Ot(.42,0,.58,1),or=t=>Array.isArray(t)&&typeof t[0]!="number",li=t=>Array.isArray(t)&&typeof t[0]=="number",Mn={linear:W,easeIn:sr,easeInOut:ai,easeOut:ir,circIn:nn,circInOut:ri,circOut:oi,backIn:en,backInOut:si,backOut:ni,anticipate:ii},rr=t=>typeof t=="string",Dn=t=>{if(li(t)){xt(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,i]=t;return Ot(e,n,s,i)}else if(rr(t))return xt(Mn[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),Mn[t];return t},$t=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],En={value:null,addProjectionMetrics:null};function ar(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(h){o.has(h)&&(c.schedule(h),t()),l++,h(a)}const c={schedule:(h,f=!1,d=!1)=>{const y=d&&i?n:s;return f&&o.add(h),y.has(h)||y.add(h),h},cancel:h=>{s.delete(h),o.delete(h)},process:h=>{if(a=h,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(u),e&&En.value&&En.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,c.process(h))}};return c}const lr=40;function ci(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=$t.reduce((g,S)=>(g[S]=ar(r,e?S:void 0),g),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:f,render:d,postRender:m}=o,y=()=>{const g=Z.useManualTiming?i.timestamp:performance.now();n=!1,Z.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,lr),1)),i.timestamp=g,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),f.process(i),d.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(y))},p=()=>{n=!0,s=!0,i.isProcessing||t(y)};return{schedule:$t.reduce((g,S)=>{const b=o[S];return g[S]=(A,C=!1,P=!1)=>(n||p(),b.schedule(A,C,P)),g},{}),cancel:g=>{for(let S=0;S<$t.length;S++)o[$t[S]].cancel(g)},state:i,steps:o}}const{schedule:V,cancel:et,state:I,steps:ue}=ci(typeof requestAnimationFrame<"u"?requestAnimationFrame:W,!0);let zt;function cr(){zt=void 0}const O={now:()=>(zt===void 0&&O.set(I.isProcessing||Z.useManualTiming?I.timestamp:performance.now()),zt),set:t=>{zt=t,queueMicrotask(cr)}},ui=t=>e=>typeof e=="string"&&e.startsWith(t),hi=ui("--"),ur=ui("var(--"),sn=t=>ur(t)?hr.test(t.split("/*")[0].trim()):!1,hr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Rn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const St={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Lt={...St,transform:t=>q(0,1,t)},Gt={...St,default:1},Ct=t=>Math.round(t*1e5)/1e5,on=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function fr(t){return t==null}const dr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rn=(t,e)=>n=>!!(typeof n=="string"&&dr.test(n)&&n.startsWith(t)||e&&!fr(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(on);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},mr=t=>q(0,255,t),he={...St,transform:t=>Math.round(mr(t))},lt={test:rn("rgb","red"),parse:fi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+he.transform(t)+", "+he.transform(e)+", "+he.transform(n)+", "+Ct(Lt.transform(s))+")"};function pr(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 Me={test:rn("#"),parse:pr,transform:lt.transform},jt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),J=jt("deg"),X=jt("%"),x=jt("px"),gr=jt("vh"),yr=jt("vw"),Ln={...X,parse:t=>X.parse(t)/100,transform:t=>X.transform(t*100)},dt={test:rn("hsl","hue"),parse:fi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+X.transform(Ct(e))+", "+X.transform(Ct(n))+", "+Ct(Lt.transform(s))+")"},E={test:t=>lt.test(t)||Me.test(t)||dt.test(t),parse:t=>lt.test(t)?lt.parse(t):dt.test(t)?dt.parse(t):Me.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?lt.transform(t):dt.transform(t),getAnimatableNone:t=>{const e=E.parse(t);return e.alpha=0,E.transform(e)}},vr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Tr(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(on))==null?void 0:e.length)||0)+(((n=t.match(vr))==null?void 0:n.length)||0)>0}const di="number",mi="color",xr="var",wr="var(",kn="${}",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 kt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Sr,l=>(E.test(l)?(s.color.push(r),i.push(mi),n.push(E.parse(l))):l.startsWith(wr)?(s.var.push(r),i.push(xr),n.push(l)):(s.number.push(r),i.push(di),n.push(parseFloat(l))),++r,kn)).split(kn);return{values:n,split:a,indexes:s,types:i}}function pi(t){return kt(t).values}function gi(t){const{split:e,types:n}=kt(t),s=e.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=e[o],i[o]!==void 0){const a=n[o];a===di?r+=Ct(i[o]):a===mi?r+=E.transform(i[o]):r+=i[o]}return r}}const br=t=>typeof t=="number"?0:E.test(t)?E.getAnimatableNone(t):t;function Pr(t){const e=pi(t);return gi(t)(e.map(br))}const _={test:Tr,parse:pi,createTransformer:gi,getAnimatableNone:Pr};function fe(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 Ar({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,l=2*n-a;i=fe(l,a,t+1/3),r=fe(l,a,t),o=fe(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Qt(t,e){return n=>n>0?e:t}const D=(t,e,n)=>t+(e-t)*n,de=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Vr=[Me,lt,dt],Cr=t=>Vr.find(e=>e.test(t));function In(t){const e=Cr(t);if(re(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===dt&&(n=Ar(n)),n}const Fn=(t,e)=>{const n=In(t),s=In(e);if(!n||!s)return Qt(t,e);const i={...n};return r=>(i.red=de(n.red,s.red,r),i.green=de(n.green,s.green,r),i.blue=de(n.blue,s.blue,r),i.alpha=D(n.alpha,s.alpha,r),lt.transform(i))},De=new Set(["none","hidden"]);function Mr(t,e){return De.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Dr(t,e){return n=>D(t,e,n)}function an(t){return typeof t=="number"?Dr:typeof t=="string"?sn(t)?Qt:E.test(t)?Fn:Lr:Array.isArray(t)?yi:typeof t=="object"?E.test(t)?Fn:Er:Qt}function yi(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>an(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function Er(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=an(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Rr(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const Lr=(t,e)=>{const n=_.createTransformer(e),s=kt(t),i=kt(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?De.has(t)&&!i.values.length||De.has(e)&&!s.values.length?Mr(t,e):Bt(yi(Rr(s,i),i.values),n):(re(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Qt(t,e))};function vi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?D(t,e,n):an(t)(t,e)}const kr=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>V.update(e,n),stop:()=>et(e),now:()=>I.isProcessing?I.timestamp:O.now()}},Ti=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},te=2e4;function ln(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<te;)e+=n,s=t.next(e);return e>=te?1/0:e}function Ir(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(ln(s),te);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:U(i)}}const Fr=5;function xi(t,e,n){const s=Math.max(e-Fr,0);return Js(n-t(s),e-s)}const M={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},me=.001;function Br({duration:t=M.duration,bounce:e=M.bounce,velocity:n=M.velocity,mass:s=M.mass}){let i,r;re(t<=K(M.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=q(M.minDamping,M.maxDamping,o),t=q(M.minDuration,M.maxDuration,U(t)),o<1?(i=u=>{const c=u*o,h=c*t,f=c-n,d=Ee(u,o),m=Math.exp(-h);return me-f/d*m},r=u=>{const h=u*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,m=Math.exp(-h),y=Ee(Math.pow(u,2),o);return(-i(u)+me>0?-1:1)*((f-d)*m)/y}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-me+c*h},r=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=jr(i,r,a);if(t=K(t),isNaN(l))return{stiffness:M.stiffness,damping:M.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const Or=12;function jr(t,e,n){let s=n;for(let i=1;i<Or;i++)s=s-t(s)/e(s);return s}function Ee(t,e){return t*Math.sqrt(1-e*e)}const Nr=["duration","bounce"],Ur=["stiffness","damping","mass"];function Bn(t,e){return e.some(n=>t[n]!==void 0)}function Wr(t){let e={velocity:M.velocity,stiffness:M.stiffness,damping:M.damping,mass:M.mass,isResolvedFromDuration:!1,...t};if(!Bn(t,Ur)&&Bn(t,Nr))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:M.mass,stiffness:i,damping:r}}else{const n=Br({...t,velocity:0});e={...e,...n,mass:M.mass},e.isResolvedFromDuration=!0}return e}function ee(t=M.visualDuration,e=M.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:l,damping:u,mass:c,duration:h,velocity:f,isResolvedFromDuration:d}=Wr({...n,velocity:-U(n.velocity||0)}),m=f||0,y=u/(2*Math.sqrt(l*c)),p=o-r,v=U(Math.sqrt(l/c)),T=Math.abs(p)<5;s||(s=T?M.restSpeed.granular:M.restSpeed.default),i||(i=T?M.restDelta.granular:M.restDelta.default);let g;if(y<1){const b=Ee(v,y);g=A=>{const C=Math.exp(-y*v*A);return o-C*((m+y*v*p)/b*Math.sin(b*A)+p*Math.cos(b*A))}}else if(y===1)g=b=>o-Math.exp(-v*b)*(p+(m+v*p)*b);else{const b=v*Math.sqrt(y*y-1);g=A=>{const C=Math.exp(-y*v*A),P=Math.min(b*A,300);return o-C*((m+y*v*p)*Math.sinh(P)+b*p*Math.cosh(P))/b}}const S={calculatedDuration:d&&h||null,next:b=>{const A=g(b);if(d)a.done=b>=h;else{let C=b===0?m:0;y<1&&(C=b===0?K(m):xi(g,b,A));const P=Math.abs(C)<=s,L=Math.abs(o-A)<=i;a.done=P&&L}return a.value=a.done?o:A,a},toString:()=>{const b=Math.min(ln(S),te),A=Ti(C=>S.next(b*C).value,b,30);return b+"ms "+A},toTransition:()=>{}};return S}ee.applyToOptions=t=>{const e=Ir(t,100,ee);return t.ease=e.ease,t.duration=K(e.duration),t.type="keyframes",t};function Re({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=P=>a!==void 0&&P<a||l!==void 0&&P>l,m=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let y=n*e;const p=h+y,v=o===void 0?p:o(p);v!==p&&(y=v-h);const T=P=>-y*Math.exp(-P/s),g=P=>v+T(P),S=P=>{const L=T(P),B=g(P);f.done=Math.abs(L)<=u,f.value=f.done?v:B};let b,A;const C=P=>{d(f.value)&&(b=P,A=ee({keyframes:[f.value,m(f.value)],velocity:xi(g,P,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:P=>{let L=!1;return!A&&b===void 0&&(L=!0,S(P),C(P)),b!==void 0&&P>=b?A.next(P-b):(!L&&S(P),f)}}}function Kr(t,e,n){const s=[],i=n||Z.mix||vi,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||W:e;a=Bt(l,a)}s.push(a)}return s}function $r(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(xt(r===e.length,"Both input and output ranges must be the same length","range-length"),r===1)return()=>e[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=Kr(e,s,i),l=a.length,u=c=>{if(o&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const f=Rt(t[h],t[h+1],c);return a[h](f)};return n?c=>u(q(t[0],t[r-1],c)):u}function Gr(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 _r(t){const e=[0];return Gr(e,t.length-1),e}function zr(t,e){return t.map(n=>n*e)}function Hr(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=or(s)?s.map(Dn):Dn(s),r={done:!1,value:e[0]},o=zr(n&&n.length===e.length?n:_r(e),t),a=$r(o,e,{ease:Array.isArray(i)?i:Hr(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const Yr=t=>t!==null;function cn(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Yr),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Xr={decay:Re,inertia:Re,tween:Mt,keyframes:Mt,spring:ee};function wi(t){typeof t.type=="string"&&(t.type=Xr[t.type])}class un{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 qr=t=>t/100;class hn extends un{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==O.now()&&this.tick(O.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;wi(e);const{type:n=Mt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const l=n||Mt;l!==Mt&&typeof a[0]!="number"&&(this.mixKeyframes=Bt(qr,vi(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ln(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}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:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:d,type:m,onUpdate:y,finalKeyframe:p}=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 v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,S=s;if(h){const P=Math.min(this.currentTime,i)/a;let L=Math.floor(P),B=P%1;!B&&P>=1&&(B=1),B===1&&L--,L=Math.min(L,h+1),!!(L%2)&&(f==="reverse"?(B=1-B,d&&(B-=d/a)):f==="mirror"&&(S=o)),g=q(0,1,B)*a}const b=T?{done:!1,value:c[0]}:S.next(g);r&&!T&&(b.value=r(b.value));let{done:A}=b;!T&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return C&&m!==Re&&(b.value=cn(c,this.options,p,this.speed)),y&&y(b.value),C&&this.finish(),b}then(e,n){return this.finished.then(e,n)}get duration(){return U(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+U(e)}get time(){return U(this.currentTime)}set time(e){e=K(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))}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(O.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=U(this.currentTime))}play(){var i,r;if(this.isStopped)return;const{driver:e=kr,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(r=(i=this.options).onPlay)==null||r.call(i);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(O.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}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){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Zr(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ct=t=>t*180/Math.PI,Le=t=>{const e=ct(Math.atan2(t[1],t[0]));return ke(e)},Jr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Le,rotateZ:Le,skewX:t=>ct(Math.atan(t[1])),skewY:t=>ct(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ke=t=>(t=t%360,t<0&&(t+=360),t),On=Le,jn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Nn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Qr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:jn,scaleY:Nn,scale:t=>(jn(t)+Nn(t))/2,rotateX:t=>ke(ct(Math.atan2(t[6],t[5]))),rotateY:t=>ke(ct(Math.atan2(-t[2],t[0]))),rotateZ:On,rotate:On,skewX:t=>ct(Math.atan(t[4])),skewY:t=>ct(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ie(t){return t.includes("scale")?1:0}function Fe(t,e){if(!t||t==="none")return Ie(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Qr,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Jr,i=a}if(!i)return Ie(e);const r=s[e],o=i[1].split(",").map(ea);return typeof r=="function"?r(o):o[r]}const ta=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Fe(n,e)};function ea(t){return parseFloat(t.trim())}const bt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pt=new Set(bt),Un=t=>t===St||t===x,na=new Set(["x","y","z"]),sa=bt.filter(t=>!na.has(t));function ia(t){const e=[];return sa.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const tt={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})=>Fe(e,"x"),y:(t,{transform:e})=>Fe(e,"y")};tt.translateX=tt.x;tt.translateY=tt.y;const ut=new Set;let Be=!1,Oe=!1,je=!1;function Si(){if(Oe){const t=Array.from(ut).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=ia(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])=>{var a;(a=s.getValue(r))==null||a.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Oe=!1,Be=!1,ut.forEach(t=>t.complete(je)),ut.clear()}function bi(){ut.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Oe=!0)})}function oa(){je=!0,bi(),Si(),je=!1}class fn{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?(ut.add(this),Be||(Be=!0,V.read(bi),V.resolveKeyframes(Si))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i==null?void 0: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])}Zr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ut.delete(this)}cancel(){this.state==="scheduled"&&(ut.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ra=t=>t.startsWith("--");function Pi(t,e,n){ra(e)?t.style.setProperty(e,n):t.style[e]=n}const aa={};function Ai(t,e){const n=Zs(t);return()=>aa[e]??n()}const la=Ai(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Vi=Ai(()=>{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})`,Wn={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 Ci(t,e){if(t)return typeof t=="function"?Vi()?Ti(t,e):"ease-out":li(t)?Vt(t):Array.isArray(t)?t.map(n=>Ci(n,e)||Wn.easeOut):Wn[t]}function ca(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=Ci(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 u&&(f.pseudoElement=u),t.animate(c,f)}function Mi(t){return typeof t=="function"&&"applyToOptions"in t}function ua({type:t,...e}){return Mi(t)&&Vi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Di extends un{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:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,xt(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=ua(e);this.animation=ca(n,s,i,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const c=cn(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(c),Pi(n,s,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,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 n,s,i;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(s=this.animation).commitStyles)==null||i.call(s))}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 U(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+U(e)}get time(){return U(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=K(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}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&la()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),W):i(this)}}const Ei={anticipate:ii,backInOut:si,circInOut:ri};function ha(t){return t in Ei}function fa(t){typeof t.ease=="string"&&ha(t.ease)&&(t.ease=Ei[t.ease])}const pe=10;class da extends Di{constructor(e){fa(e),wi(e),super(e),e.startTime!==void 0&&(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 hn({...o,autoplay:!1}),l=Math.max(pe,O.now()-this.startTime),u=q(0,pe,l-pe),c=a.sample(l).value,{name:h}=this.options;r&&h&&Pi(r,h,c),n.setWithVelocity(a.sample(Math.max(0,l-u)).value,c,u),a.stop()}}const Kn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(_.test(t)||t==="0")&&!t.startsWith("url("));function ma(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function pa(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=Kn(i,e),a=Kn(r,e);return re(o===a,`You are trying to animate ${e} from "${i}" to "${r}". "${o?r:i}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:ma(t)||(n==="spring"||Mi(n))&&s}function Ne(t){t.duration=0,t.type="keyframes"}const ga=new Set(["opacity","clipPath","filter","transform"]),ya=Zs(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function va(t){var c;const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(((c=e==null?void 0:e.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return ya()&&n&&ga.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const Ta=40;class xa extends un{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:c,...h}){var m;super(),this.stop=()=>{var y,p;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(p=this.keyframeResolver)==null||p.cancel()},this.createdAt=O.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:l,motionValue:u,element:c,...h},d=(c==null?void 0:c.KeyframeResolver)||fn;this.keyframeResolver=new d(a,(y,p,v)=>this.onKeyframesResolved(y,p,f,!v),l,u,c),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,s,i){var p,v;this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=O.now(),pa(e,r,o,a)||((Z.instantAnimations||!l)&&(c==null||c(cn(e,s,n))),e[0]=e[e.length-1],Ne(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Ta?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!u&&va(f),m=(v=(p=f.motionValue)==null?void 0:p.owner)==null?void 0:v.current,y=d?new da({...f,element:m}):new hn(f);y.finished.then(()=>{this.notifyFinished()}).catch(W),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),oa()),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(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function Ri(t,e,n,s=0,i=1){const r=Array.from(t).sort((u,c)=>u.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 wa=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Sa(t){const e=wa.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}const ba=4;function Li(t,e,n=1){xt(n<=ba,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,i]=Sa(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return Ys(o)?parseFloat(o):o}return sn(i)?Li(i,e,n+1):i}const Pa={type:"spring",stiffness:500,damping:25,restSpeed:10},Aa=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Va={type:"keyframes",duration:.8},Ca={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ma=(t,{keyframes:e})=>e.length>2?Va:Pt.has(t)?t.startsWith("scale")?Aa(e[1]):Pa:Ca,Da=t=>t!==null;function Ea(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Da),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}function ki(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function dn(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?ki(n,t):n}function Ra({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const mn=(t,e,n,s={},i,r)=>o=>{const a=dn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-K(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,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};Ra(a)||Object.assign(c,Ma(t,c)),c.duration&&(c.duration=K(c.duration)),c.repeatDelay&&(c.repeatDelay=K(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Ne(c),c.delay===0&&(h=!0)),(Z.instantAnimations||Z.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(h=!0,Ne(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=Ea(c.keyframes,a);if(f!==void 0){V.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new hn(c):new xa(c)};function $n(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function pn(t,e,n,s){if(typeof e=="function"){const[i,r]=$n(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]=$n(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function Tt(t,e,n){const s=t.getProps();return pn(s,e,n!==void 0?n:s.custom,t)}const Ii=new Set(["width","height","top","left","right","bottom",...bt]),Gn=30,La=t=>!isNaN(parseFloat(t));class ka{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var r;const i=O.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((r=this.events.change)==null||r.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=O.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=La(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 tn);const s=this.events[e].add(n);return e==="change"?()=>{s(),V.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(){var e;(e=this.events.change)==null||e.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=O.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Gn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Gn);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(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function wt(t,e){return new ka(t,e)}const Ue=t=>Array.isArray(t);function Ia(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,wt(n))}function Fa(t){return Ue(t)?t[t.length-1]||0:t}function Ba(t,e){const n=Tt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Fa(r[o]);Ia(t,o,a)}}const F=t=>!!(t&&t.getVelocity);function Oa(t){return!!(F(t)&&t.add)}function We(t,e){const n=t.getValue("willChange");if(Oa(n))return n.add(e);if(!n&&Z.WillChange){const s=new Z.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function gn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ja="framerAppearId",Fi="data-"+gn(ja);function Bi(t){return t.props[Fi]}function Na({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 l=t.getDefaultTransition();r=r?ki(r,l):l;const u=r==null?void 0:r.reduceMotion;s&&(r=s);const c=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const d=t.getValue(f,t.latestValues[f]??null),m=a[f];if(m===void 0||h&&Na(h,f))continue;const y={delay:n,...dn(r||{},f)},p=d.get();if(p!==void 0&&!d.isAnimating&&!Array.isArray(m)&&m===p&&!y.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const S=Bi(t);if(S){const b=window.MotionHandoffAnimation(S,f,V);b!==null&&(y.startTime=b,v=!0)}}We(t,f);const T=u??t.shouldReduceMotion;d.start(mn(f,d,m,T&&Ii.has(f)?{type:!1}:y,t,v));const g=d.animation;g&&c.push(g)}if(o){const f=()=>V.update(()=>{o&&Ba(t,o)});c.length?Promise.all(c).then(f):f()}return c}function Ke(t,e,n={}){var l;const s=Tt(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 r=s?()=>Promise.all(Oi(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=i;return Ua(t,e,u,c,h,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[r,o]:[o,r];return u().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function Ua(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Ke(l,e,{...o,delay:n+(typeof s=="function"?0:s)+Ri(t.variantChildren,l,s,i,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function Wa(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Ke(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Ke(t,e,n);else{const i=typeof e=="function"?Tt(t,e,n.custom):e;s=Promise.all(Oi(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Ka={test:t=>t==="auto",parse:t=>t},ji=t=>e=>e.test(t),Ni=[St,x,X,J,yr,gr,Ka],_n=t=>Ni.find(ji(t));function $a(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||qs(t):!0}const Ga=new Set(["brightness","contrast","saturate","opacity"]);function _a(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(on)||[];if(!s)return t;const i=n.replace(s,"");let r=Ga.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const za=/\b([a-z-]*)\(.*?\)/gu,$e={..._,getAnimatableNone:t=>{const e=t.match(za);return e?e.map(_a).join(" "):t}},Ge={..._,getAnimatableNone:t=>{const e=_.parse(t);return _.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},zn={...St,transform:Math.round},Ha={rotate:J,rotateX:J,rotateY:J,rotateZ:J,scale:Gt,scaleX:Gt,scaleY:Gt,scaleZ:Gt,skew:J,skewX:J,skewY:J,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:Lt,originX:Ln,originY:Ln,originZ:x},yn={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,inset:x,insetBlock:x,insetBlockStart:x,insetBlockEnd:x,insetInline:x,insetInlineStart:x,insetInlineEnd:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,paddingBlock:x,paddingBlockStart:x,paddingBlockEnd:x,paddingInline:x,paddingInlineStart:x,paddingInlineEnd:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,marginBlock:x,marginBlockStart:x,marginBlockEnd:x,marginInline:x,marginInlineStart:x,marginInlineEnd:x,fontSize:x,backgroundPositionX:x,backgroundPositionY:x,...Ha,zIndex:zn,fillOpacity:Lt,strokeOpacity:Lt,numOctaves:zn},Ya={...yn,color:E,backgroundColor:E,outlineColor:E,fill:E,stroke:E,borderColor:E,borderTopColor:E,borderRightColor:E,borderBottomColor:E,borderLeftColor:E,filter:$e,WebkitFilter:$e,mask:Ge,WebkitMask:Ge},Ui=t=>Ya[t],Xa=new Set([$e,Ge]);function Wi(t,e){let n=Ui(t);return Xa.has(n)||(n=_),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const qa=new Set(["auto","none","0"]);function Za(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!qa.has(r)&&kt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Wi(n,i)}class Ja extends fn{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let h=e[c];if(typeof h=="string"&&(h=h.trim(),sn(h))){const f=Li(h,n.current);f!==void 0&&(e[c]=f),c===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Ii.has(s)||e.length!==2)return;const[i,r]=e,o=_n(i),a=_n(r),l=Rn(i),u=Rn(r);if(l!==u&&tt[s]){this.needsMeasurement=!0;return}if(o!==a)if(Un(o)&&Un(a))for(let c=0;c<e.length;c++){const h=e[c];typeof h=="string"&&(e[c]=parseFloat(h))}else tt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||$a(e[i]))&&s.push(i);s.length&&Za(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tt[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=tt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Qa=new Set(["opacity","clipPath","filter","transform"]);function Ki(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const i=document.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const $i=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function tl(t){return Xs(t)&&"offsetHeight"in t}const{schedule:vn,cancel:sh}=ci(queueMicrotask,!1),G={x:!1,y:!1};function Gi(){return G.x||G.y}function el(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 _i(t,e){const n=Ki(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function nl(t){return!(t.pointerType==="touch"||Gi())}function sl(t,e,n={}){const[s,i,r]=_i(t,n);return s.forEach(o=>{let a=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",m)},h=p=>{u&&(u(p),u=void 0),c()},f=p=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,h(p))},d=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},m=p=>{if(p.pointerType!=="touch"){if(a){l=!0;return}h(p)}},y=p=>{if(!nl(p))return;l=!1;const v=e(o,p);typeof v=="function"&&(u=v,o.addEventListener("pointerleave",m,i))};o.addEventListener("pointerenter",y,i),o.addEventListener("pointerdown",d,i)}),r}const zi=(t,e)=>e?t===e?!0:zi(t,e.parentElement):!1,Tn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,il=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ol(t){return il.has(t.tagName)||t.isContentEditable===!0}const rl=new Set(["INPUT","SELECT","TEXTAREA"]);function al(t){return rl.has(t.tagName)||t.isContentEditable===!0}const Ht=new WeakSet;function Hn(t){return e=>{e.key==="Enter"&&t(e)}}function ge(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const ll=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Hn(()=>{if(Ht.has(n))return;ge(n,"down");const i=Hn(()=>{ge(n,"up")}),r=()=>ge(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 Yn(t){return Tn(t)&&!Gi()}const Xn=new WeakSet;function cl(t,e,n={}){const[s,i,r]=_i(t,n),o=a=>{const l=a.currentTarget;if(!Yn(a)||Xn.has(a))return;Ht.add(l),n.stopPropagation&&Xn.add(a);const u=e(l,a),c=(d,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),Ht.has(l)&&Ht.delete(l),Yn(d)&&typeof u=="function"&&u(d,{success:m})},h=d=>{c(d,l===window||l===document||n.useGlobalTarget||zi(l,d.target))},f=d=>{c(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),tl(a)&&(a.addEventListener("focus",u=>ll(u,i)),!ol(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function xn(t){return Xs(t)&&"ownerSVGElement"in t}const Yt=new WeakMap;let Q;const Hi=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:xn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],ul=Hi("inline","width","offsetWidth"),hl=Hi("block","height","offsetHeight");function fl({target:t,borderBoxSize:e}){var n;(n=Yt.get(t))==null||n.forEach(s=>{s(t,{get width(){return ul(t,e)},get height(){return hl(t,e)}})})}function dl(t){t.forEach(fl)}function ml(){typeof ResizeObserver>"u"||(Q=new ResizeObserver(dl))}function pl(t,e){Q||ml();const n=Ki(t);return n.forEach(s=>{let i=Yt.get(s);i||(i=new Set,Yt.set(s,i)),i.add(e),Q==null||Q.observe(s)}),()=>{n.forEach(s=>{const i=Yt.get(s);i==null||i.delete(e),i!=null&&i.size||Q==null||Q.unobserve(s)})}}const Xt=new Set;let mt;function gl(){mt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Xt.forEach(e=>e(t))},window.addEventListener("resize",mt)}function yl(t){return Xt.add(t),mt||gl(),()=>{Xt.delete(t),!Xt.size&&typeof mt=="function"&&(window.removeEventListener("resize",mt),mt=void 0)}}function qn(t,e){return typeof t=="function"?yl(t):pl(t,e)}function vl(t){return xn(t)&&t.tagName==="svg"}const Tl=[...Ni,E,_],xl=t=>Tl.find(ji(t)),Zn=()=>({translate:0,scale:1,origin:0,originPoint:0}),pt=()=>({x:Zn(),y:Zn()}),Jn=()=>({min:0,max:0}),R=()=>({x:Jn(),y:Jn()}),wl=new WeakMap;function ae(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function It(t){return typeof t=="string"||Array.isArray(t)}const wn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sn=["initial",...wn];function le(t){return ae(t.animate)||Sn.some(e=>It(t[e]))}function Yi(t){return!!(le(t)||t.variants)}function Sl(t,e,n){for(const s in e){const i=e[s],r=n[s];if(F(i))t.addValue(s,i);else if(F(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 _e={current:null},Xi={current:!1},bl=typeof window<"u";function Pl(){if(Xi.current=!0,!!bl)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>_e.current=t.matches;t.addEventListener("change",e),e()}else _e.current=!1}const Qn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ne={};function qi(t){ne=t}function Al(){return ne}class Vl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},l={}){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=fn,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 d=O.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,V.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=le(n),this.isVariantNode=Yi(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const m=f[d];u[d]!==void 0&&F(m)&&m.set(u[d])}}mount(e){var n,s;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,wl.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,r)=>this.bindToMotionValue(r,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Xi.current||Pl(),this.shouldReduceMotion=_e.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),et(this.notifyUpdate),et(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.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&&Qa.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:u,duration:c}=n.accelerate,h=new Di({element:this.current,name:e,keyframes:a,times:l,ease:u,duration:K(c)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=Pt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&V.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(),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 ne){const n=ne[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):R()}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;s<Qn.length;s++){const i=Qn[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Sl(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.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"&&(Ys(s)||qs(s))?s=parseFloat(s):!xl(s)&&_.test(n)&&(s=Wi(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 r;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=pn(this.props,n,(r=this.presenceContext)==null?void 0:r.custom);o&&(s=o[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 tn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){vn.render(this.render)}}class Zi extends Vl{constructor(){super(...arguments),this.KeyframeResolver=Ja}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;F(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class nt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Ji({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 Ml(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 ye(t){return t===void 0||t===1}function ze({scale:t,scaleX:e,scaleY:n}){return!ye(t)||!ye(e)||!ye(n)}function at(t){return ze(t)||Qi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Qi(t){return ts(t.x)||ts(t.y)}function ts(t){return t&&t!=="0%"}function se(t,e,n){const s=t-n,i=e*s;return n+i}function es(t,e,n,s,i){return i!==void 0&&(t=se(t,i,s)),se(t,n,s)+e}function He(t,e=0,n=1,s,i){t.min=es(t.min,e,n,s,i),t.max=es(t.max,e,n,s,i)}function to(t,{x:e,y:n}){He(t.x,e.translate,e.scale,e.originPoint),He(t.y,n.translate,n.scale,n.originPoint)}const ns=.999999999999,ss=1.0000000000001;function Dl(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&yt(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,to(t,o)),s&&at(r.latestValues)&&yt(t,r.latestValues))}e.x<ss&&e.x>ns&&(e.x=1),e.y<ss&&e.y>ns&&(e.y=1)}function gt(t,e){t.min=t.min+e,t.max=t.max+e}function is(t,e,n,s,i=.5){const r=D(t.min,t.max,i);He(t,e,n,r,s)}function os(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function yt(t,e){is(t.x,os(e.x,t.x),e.scaleX,e.scale,e.originX),is(t.y,os(e.y,t.y),e.scaleY,e.scale,e.originY)}function eo(t,e){return Ji(Ml(t.getBoundingClientRect(),e))}function El(t,e,n){const s=eo(t,n),{scroll:i}=e;return i&&(gt(s.x,i.offset.x),gt(s.y,i.offset.y)),s}const Rl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ll=bt.length;function kl(t,e,n){let s="",i=!0;for(let r=0;r<Ll;r++){const o=bt[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(o.startsWith("scale")?1:0);else{const u=parseFloat(a);l=o.startsWith("scale")?u===1:u===0}if(!l||n){const u=$i(a,yn[o]);if(!l){i=!1;const c=Rl[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function bn(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if(Pt.has(l)){o=!0;continue}else if(hi(l)){i[l]=u;continue}else{const c=$i(u,yn[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=kl(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}function no(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i==null||i.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function rs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const At={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(x.test(t))t=parseFloat(t);else return t;const n=rs(t,e.target.x),s=rs(t,e.target.y);return`${n}% ${s}%`}},Il={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,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=D(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},Ye={borderRadius:{...At,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:At,borderTopRightRadius:At,borderBottomLeftRadius:At,borderBottomRightRadius:At,boxShadow:Il};function so(t,{layout:e,layoutId:n}){return Pt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ye[t]||t==="opacity")}function Pn(t,e,n){var o;const s=t.style,i=e==null?void 0:e.style,r={};if(!s)return r;for(const a in s)(F(s[a])||i&&F(i[a])||so(a,t)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(r[a]=s[a]);return r}function Fl(t){return window.getComputedStyle(t)}class Bl extends Zi{constructor(){super(...arguments),this.type="html",this.renderInstance=no}readValueFromInstance(e,n){var s;if(Pt.has(n))return(s=this.projection)!=null&&s.isProjecting?Ie(n):ta(e,n);{const i=Fl(e),r=(hi(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return eo(e,n)}build(e,n,s){bn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Pn(e,n,s)}}const Ol={offset:"stroke-dashoffset",array:"stroke-dasharray"},jl={offset:"strokeDashoffset",array:"strokeDasharray"};function Nl(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Ol:jl;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const Ul=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function io(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,u,c){if(bn(t,a,u),l){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==null?void 0:c.transformBox)??"fill-box",delete h.transformBox);for(const d of Ul)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Nl(h,i,r,o,!1)}const oo=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"]),ro=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Wl(t,e,n,s){no(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(oo.has(i)?i:gn(i),e.attrs[i])}function ao(t,e,n){const s=Pn(t,e,n);for(const i in t)if(F(t[i])||F(e[i])){const r=bt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class Kl extends Zi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=R}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Pt.has(n)){const s=Ui(n);return s&&s.default||0}return n=oo.has(n)?n:gn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return ao(e,n,s)}build(e,n,s){io(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Wl(e,n,s,i)}mount(e){this.isSVGTag=ro(e.tagName),super.mount(e)}}const $l=Sn.length;function lo(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?lo(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<$l;n++){const s=Sn[n],i=t.props[s];(It(i)||i===!1)&&(e[s]=i)}return e}function co(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Gl=[...wn].reverse(),_l=wn.length;function zl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Wa(t,n,s)))}function Hl(t){let e=zl(t),n=as(),s=!0,i=!1;const r=u=>(c,h)=>{var d;const f=Tt(t,h,u==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(f){const{transition:m,transitionEnd:y,...p}=f;c={...c,...p,...y}}return c};function o(u){e=u(t)}function a(u){const{props:c}=t,h=lo(t.parent)||{},f=[],d=new Set;let m={},y=1/0;for(let v=0;v<_l;v++){const T=Gl[v],g=n[T],S=c[T]!==void 0?c[T]:h[T],b=It(S),A=T===u?g.isActive:null;A===!1&&(y=v);let C=S===h[T]&&S!==c[T]&&b;if(C&&(s||i)&&t.manuallyAnimateOnMount&&(C=!1),g.protectedKeys={...m},!g.isActive&&A===null||!S&&!g.prevProp||ae(S)||typeof S=="boolean")continue;if(T==="exit"&&g.isActive&&A!==!0){g.prevResolvedValues&&(m={...m,...g.prevResolvedValues});continue}const P=Yl(g.prevProp,S);let L=P||T===u&&g.isActive&&!C&&b||v>y&&b,B=!1;const st=Array.isArray(S)?S:[S];let it=st.reduce(r(T),{});A===!1&&(it={});const{prevResolvedValues:Wt={}}=g,Cn={...Wt,...it},Kt=k=>{L=!0,d.has(k)&&(B=!0,d.delete(k)),g.needsAnimating[k]=!0;const N=t.getValue(k);N&&(N.liveStyle=!1)};for(const k in Cn){const N=it[k],ot=Wt[k];if(m.hasOwnProperty(k))continue;let ht=!1;Ue(N)&&Ue(ot)?ht=!co(N,ot):ht=N!==ot,ht?N!=null?Kt(k):d.add(k):N!==void 0&&d.has(k)?Kt(k):g.protectedKeys[k]=!0}g.prevProp=S,g.prevResolvedValues=it,g.isActive&&(m={...m,...it}),(s||i)&&t.blockInitialAnimation&&(L=!1);const z=C&&P;L&&(!z||B)&&f.push(...st.map(k=>{const N={type:T};if(typeof k=="string"&&(s||i)&&!z&&t.manuallyAnimateOnMount&&t.parent){const{parent:ot}=t,ht=Tt(ot,k);if(ot.enteringChildren&&ht){const{delayChildren:No}=ht.transition||{};N.delay=Ri(ot.enteringChildren,t,No)}}return{animation:k,options:N}}))}if(d.size){const v={};if(typeof c.initial!="boolean"){const T=Tt(t,Array.isArray(c.initial)?c.initial[0]:c.initial);T&&T.transition&&(v.transition=T.transition)}d.forEach(T=>{const g=t.getBaseTarget(T),S=t.getValue(T);S&&(S.liveStyle=!0),v[T]=g??null}),f.push({animation:v})}let p=!!f.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(p=!1),s=!1,i=!1,p?e(f):Promise.resolve()}function l(u,c){var f;if(n[u].isActive===c)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(d=>{var m;return(m=d.animationState)==null?void 0:m.setActive(u,c)}),n[u].isActive=c;const h=a(u);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=as(),i=!0}}}function Yl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!co(e,t):!1}function rt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function as(){return{animate:rt(!0),whileInView:rt(),whileHover:rt(),whileTap:rt(),whileDrag:rt(),whileFocus:rt(),exit:rt()}}function ls(t,e){t.min=e.min,t.max=e.max}function $(t,e){ls(t.x,e.x),ls(t.y,e.y)}function cs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const uo=1e-4,Xl=1-uo,ql=1+uo,ho=.01,Zl=0-ho,Jl=0+ho;function j(t){return t.max-t.min}function Ql(t,e,n){return Math.abs(t-e)<=n}function us(t,e,n,s=.5){t.origin=s,t.originPoint=D(e.min,e.max,t.origin),t.scale=j(n)/j(e),t.translate=D(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Xl&&t.scale<=ql||isNaN(t.scale))&&(t.scale=1),(t.translate>=Zl&&t.translate<=Jl||isNaN(t.translate))&&(t.translate=0)}function Dt(t,e,n,s){us(t.x,e.x,n.x,s?s.originX:void 0),us(t.y,e.y,n.y,s?s.originY:void 0)}function hs(t,e,n){t.min=n.min+e.min,t.max=t.min+j(e)}function tc(t,e,n){hs(t.x,e.x,n.x),hs(t.y,e.y,n.y)}function fs(t,e,n){t.min=e.min-n.min,t.max=t.min+j(e)}function ie(t,e,n){fs(t.x,e.x,n.x),fs(t.y,e.y,n.y)}function ds(t,e,n,s,i){return t-=e,t=se(t,1/n,s),i!==void 0&&(t=se(t,1/i,s)),t}function ec(t,e=0,n=1,s=.5,i,r=t,o=t){if(X.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=ds(t.min,e,n,a,i),t.max=ds(t.max,e,n,a,i)}function ms(t,e,[n,s,i],r,o){ec(t,e[n],e[s],e[i],e.scale,r,o)}const nc=["x","scaleX","originX"],sc=["y","scaleY","originY"];function ps(t,e,n,s){ms(t.x,e,nc,n?n.x:void 0,s?s.x:void 0),ms(t.y,e,sc,n?n.y:void 0,s?s.y:void 0)}function gs(t){return t.translate===0&&t.scale===1}function fo(t){return gs(t.x)&&gs(t.y)}function ys(t,e){return t.min===e.min&&t.max===e.max}function ic(t,e){return ys(t.x,e.x)&&ys(t.y,e.y)}function vs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function mo(t,e){return vs(t.x,e.x)&&vs(t.y,e.y)}function Ts(t){return j(t.x)/j(t.y)}function xs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function H(t){return[t("x"),t("y")]}function oc(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0: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:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}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 po=["TopLeft","TopRight","BottomLeft","BottomRight"],rc=po.length,ws=t=>typeof t=="string"?parseFloat(t):t,Ss=t=>typeof t=="number"||x.test(t);function ac(t,e,n,s,i,r){i?(t.opacity=D(0,n.opacity??1,lc(s)),t.opacityExit=D(e.opacity??1,0,cc(s))):r&&(t.opacity=D(e.opacity??1,n.opacity??1,s));for(let o=0;o<rc;o++){const a=`border${po[o]}Radius`;let l=bs(e,a),u=bs(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Ss(l)===Ss(u)?(t[a]=Math.max(D(ws(l),ws(u),s),0),(X.test(u)||X.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=D(e.rotate||0,n.rotate||0,s))}function bs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const lc=go(0,.5,oi),cc=go(.5,.95,W);function go(t,e,n){return s=>s<t?0:s>e?1:n(Rt(t,e,s))}function uc(t,e,n){const s=F(t)?t:wt(t);return s.start(mn("",s,e,n)),s.animation}function Ft(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const hc=(t,e)=>t.depth-e.depth;class fc{constructor(){this.children=[],this.isDirty=!1}add(e){Qe(this.children,e),this.isDirty=!0}remove(e){Jt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(hc),this.isDirty=!1,this.children.forEach(e)}}function dc(t,e){const n=O.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(et(s),t(r-e))};return V.setup(s,!0),()=>et(s)}function qt(t){return F(t)?t.get():t}class mc{constructor(){this.members=[]}add(e){Qe(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&&(Jt(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(Jt(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){var n;for(let s=this.members.indexOf(e)-1;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,n){var i;const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=s.options,{layoutDependency:o}=e.options;(r===void 0||r!==o)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,s,i,r,o;(s=(n=e.options).onExitComplete)==null||s.call(n),(o=(i=e.resumingFrom)==null?void 0:(r=i.options).onExitComplete)==null||o.call(r)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Zt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ve=["","X","Y","Z"],pc=1e3;let gc=0;function Te(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function yo(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Bi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",V,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&yo(s)}function vo({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=gc++,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(Tc),this.nodes.forEach(bc),this.nodes.forEach(Pc),this.nodes.forEach(xc)},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 l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new fc)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new tn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=xn(o)&&!vl(o),this.instance=o;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let c,h=0;const f=()=>this.root.updateBlockedByResize=!1;V.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,c&&c(),c=dc(f,250),Zt.hasAnimatedSinceResize&&(Zt.hasAnimatedSinceResize=!1,this.nodes.forEach(Vs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||Dc,{onLayoutAnimationStart:y,onLayoutAnimationComplete:p}=u.getProps(),v=!this.targetLayout||!mo(this.targetLayout,d),T=!h&&f;if(this.options.layoutRoot||this.resumeFrom||T||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const g={...dn(m,"layout"),onPlay:y,onComplete:p};(u.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g),this.setAnimationOrigin(c,T)}else h||Vs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}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(),et(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(Ac),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&&yo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Ps);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(As);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Sc),this.nodes.forEach(yc),this.nodes.forEach(vc)):this.nodes.forEach(As),this.clearAllSnapshots();const a=O.now();I.delta=q(0,1e3/60,a-I.timestamp),I.timestamp=a,I.isProcessing=!0,ue.update.process(I),ue.preRender.process(I),ue.render.process(I),I.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,vn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(wc),this.sharedNodes.forEach(Vc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,V.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){V.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!j(this.snapshot.measuredBox.x)&&!j(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<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=R(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!fo(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||at(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Ec(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return R();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Rc))){const{scroll:c}=this.root;c&&(gt(a.x,c.offset.x),gt(a.y,c.offset.y))}return a}removeElementScroll(o){var l;const a=R();if($(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:f}=c;c!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&$(a,o),gt(a.x,h.offset.x),gt(a.y,h.offset.y))}return a}applyTransform(o,a=!1){const l=R();$(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&yt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),at(c.latestValues)&&yt(l,c.latestValues)}return at(this.latestValues)&&yt(l,this.latestValues),l}removeTransform(o){const a=R();$(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!at(u.latestValues))continue;ze(u.latestValues)&&u.updateSnapshot();const c=R(),h=u.measurePageBox();$(c,h),ps(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return at(this.latestValues)&&ps(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==I.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var d;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=I.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=R(),this.targetWithTransforms=R()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),tc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$(this.target,this.layout.layoutBox),to(this.target,this.targetDelta)):$(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||ze(this.parent.latestValues)||Qi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=R(),this.relativeTargetOrigin=R(),ie(this.relativeTargetOrigin,a,l),$(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===I.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;$(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Dl(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=R());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(cs(this.prevProjectionDelta.x,this.projectionDelta.x),cs(this.prevProjectionDelta.y,this.projectionDelta.y)),Dt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!xs(this.projectionDelta.x,this.prevProjectionDelta.x)||!xs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=pt(),this.projectionDelta=pt(),this.projectionDeltaWithTransform=pt()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=pt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=R(),d=l?l.source:void 0,m=this.layout?this.layout.source:void 0,y=d!==m,p=this.getStack(),v=!p||p.members.length<=1,T=!!(y&&!v&&this.options.crossfade===!0&&!this.path.some(Mc));this.animationProgress=0;let g;this.mixTargetDelta=S=>{const b=S/1e3;Cs(h.x,o.x,b),Cs(h.y,o.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ie(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Cc(this.relativeTarget,this.relativeTargetOrigin,f,b),g&&ic(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=R()),$(g,this.relativeTarget)),y&&(this.animationValues=c,ac(c,u,this.latestValues,b,T,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(et(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=V.update(()=>{Zt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=wt(0)),this.motionValue.jump(0,!1),this.currentAnimation=uc(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),o.onUpdate&&o.onUpdate(c)},onStop:()=>{},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(pc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&To(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||R();const h=j(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=j(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}$(a,l),yt(a,c),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new mc),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),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:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Te("z",o,u,this.animationValues);for(let c=0;c<ve.length;c++)Te(`rotate${ve[c]}`,o,u,this.animationValues),Te(`skew${ve[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=qt(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=qt(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!at(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=oc(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?o.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in Ye){if(c[m]===void 0)continue;const{correct:y,applyTo:p,isCSSVariable:v}=Ye[m],T=h==="none"?c[m]:y(c[m],u);if(p){const g=p.length;for(let S=0;S<g;S++)o[p[S]]=T}else v?this.options.visualElement.renderState.vars[m]=T:o[m]=T}this.options.layoutId&&(o.pointerEvents=u===this?qt(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Ps),this.root.sharedNodes.clear()}}}function yc(t){t.updateLayout()}function vc(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:r}=t.options,o=e.source!==t.layout.source;r==="size"?H(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=j(f);f.min=s[h].min,f.max=f.min+d}):To(r,e.layoutBox,s)&&H(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=j(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=pt();Dt(a,s,e.layoutBox);const l=pt();o?Dt(l,t.applyTransform(i,!0),e.measuredBox):Dt(l,s,e.layoutBox);const u=!fo(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const m=R();ie(m,e.layoutBox,f.layoutBox);const y=R();ie(y,s,d.layoutBox),mo(m,y)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function Tc(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 xc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function wc(t){t.clearSnapshot()}function Ps(t){t.clearMeasurements()}function As(t){t.isLayoutDirty=!1}function Sc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Vs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function bc(t){t.resolveTargetDelta()}function Pc(t){t.calcProjection()}function Ac(t){t.resetSkewAndRotation()}function Vc(t){t.removeLeadSnapshot()}function Cs(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 Ms(t,e,n,s){t.min=D(e.min,n.min,s),t.max=D(e.max,n.max,s)}function Cc(t,e,n,s){Ms(t.x,e.x,n.x,s),Ms(t.y,e.y,n.y,s)}function Mc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Dc={duration:.45,ease:[.4,0,.1,1]},Ds=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Es=Ds("applewebkit/")&&!Ds("chrome/")?Math.round:W;function Rs(t){t.min=Es(t.min),t.max=Es(t.max)}function Ec(t){Rs(t.x),Rs(t.y)}function To(t,e,n){return t==="position"||t==="preserve-aspect"&&!Ql(Ts(e),Ts(n),.2)}function Rc(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Lc=vo({attachResizeListener:(t,e)=>Ft(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),xe={current:void 0},xo=vo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!xe.current){const t=new Lc({});t.mount(window),t.setOptions({layoutScroll:!0}),xe.current=t}return xe.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),wo=w.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function kc(t=!0){const e=w.useContext(Je);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 So=w.createContext({strict:!1}),Ls={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 ks=!1;function Ic(){if(ks)return;const t={};for(const e in Ls)t[e]={isEnabled:n=>Ls[e].some(s=>!!n[s])};qi(t),ks=!0}function bo(){return Ic(),Al()}function Fc(t){const e=bo();for(const n in t)e[n]={...e[n],...t[n]};qi(e)}const Bc=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 oe(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Bc.has(t)}let Po=t=>!oe(t);function Oc(t){typeof t=="function"&&(Po=e=>e.startsWith("on")?!oe(e):t(e))}try{Oc(require("@emotion/is-prop-valid").default)}catch{}function jc(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Po(i)||n===!0&&oe(i)||!e&&!oe(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const ce=w.createContext({});function Nc(t,e){if(le(t)){const{initial:n,animate:s}=t;return{initial:n===!1||It(n)?n:void 0,animate:It(s)?s:void 0}}return t.inherit!==!1?e:{}}function Uc(t){const{initial:e,animate:n}=Nc(t,w.useContext(ce));return w.useMemo(()=>({initial:e,animate:n}),[Is(e),Is(n)])}function Is(t){return Array.isArray(t)?t.join(" "):t}const An=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ao(t,e,n){for(const s in e)!F(e[s])&&!so(s,n)&&(t[s]=e[s])}function Wc({transformTemplate:t},e){return w.useMemo(()=>{const n=An();return bn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Kc(t,e){const n=t.style||{},s={};return Ao(s,n,t),Object.assign(s,Wc(t,e)),s}function $c(t,e){const n={},s=Kc(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 Vo=()=>({...An(),attrs:{}});function Gc(t,e,n,s){const i=w.useMemo(()=>{const r=Vo();return io(r,e,ro(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Ao(r,t.style,t),i.style={...r,...i.style}}return i}const _c=["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 Vn(t){return typeof t!="string"||t.includes("-")?!1:!!(_c.indexOf(t)>-1||/[A-Z]/u.test(t))}function zc(t,e,n,{latestValues:s},i,r=!1,o){const l=(o??Vn(t)?Gc:$c)(e,s,i,t),u=jc(e,typeof t=="string",r),c=t!==w.Fragment?{...u,...l,ref:n}:{},{children:h}=e,f=w.useMemo(()=>F(h)?h.get():h,[h]);return w.createElement(t,{...c,children:f})}function Hc({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Yc(n,s,i,t),renderState:e()}}function Yc(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=qt(r[f]);let{initial:o,animate:a}=t;const l=le(t),u=Yi(t);e&&u&&!l&&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"&&!ae(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const m=pn(t,f[d]);if(m){const{transitionEnd:y,transition:p,...v}=m;for(const T in v){let g=v[T];if(Array.isArray(g)){const S=c?g.length-1:0;g=g[S]}g!==null&&(i[T]=g)}for(const T in y)i[T]=y[T]}}}return i}const Co=t=>(e,n)=>{const s=w.useContext(ce),i=w.useContext(Je),r=()=>Hc(t,e,s,i);return n?r():qo(r)},Xc=Co({scrapeMotionValuesFromProps:Pn,createRenderState:An}),qc=Co({scrapeMotionValuesFromProps:ao,createRenderState:Vo}),Zc=Symbol.for("motionComponentSymbol");function Jc(t,e,n){const s=w.useRef(n);w.useInsertionEffect(()=>{s.current=n});const i=w.useRef(null);return w.useCallback(r=>{var a;r&&((a=t.onMount)==null||a.call(t,r));const o=s.current;if(typeof o=="function")if(r){const l=o(r);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r);e&&(r?e.mount(r):e.unmount())},[e])}const Mo=w.createContext({});function ft(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Qc(t,e,n,s,i,r){var g,S;const{visualElement:o}=w.useContext(ce),a=w.useContext(So),l=w.useContext(Je),u=w.useContext(wo),c=u.reducedMotion,h=u.skipAnimations,f=w.useRef(null),d=w.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,y=w.useContext(Mo);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&tu(f.current,n,i,y);const p=w.useRef(!1);w.useInsertionEffect(()=>{m&&p.current&&m.update(n,l)});const v=n[Fi],T=w.useRef(!!v&&typeof window<"u"&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,v))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,v)));return Jo(()=>{d.current=!0,m&&(p.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),T.current&&m.animationState&&m.animationState.animateChanges())}),w.useEffect(()=>{m&&(!T.current&&m.animationState&&m.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)==null||b.call(window,v)}),T.current=!1),m.enteringChildren=void 0)}),m}function tu(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Do(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&ft(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function Do(t){if(t)return t.options.allowProjection!==!1?t.projection:Do(t.parent)}function we(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Fc(s);const r=n?n==="svg":Vn(t),o=r?qc:Xc;function a(u,c){let h;const f={...w.useContext(wo),...u,layoutId:eu(u)},{isStatic:d}=f,m=Uc(u),y=o(u,d);if(!d&&typeof window<"u"){nu();const p=su(f);h=p.MeasureLayout,m.visualElement=Qc(t,y,f,i,p.ProjectionNode,r)}return Y.jsxs(ce.Provider,{value:m,children:[h&&m.visualElement?Y.jsx(h,{visualElement:m.visualElement,...f}):null,zc(t,u,Jc(y,m.visualElement,c),y,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=w.forwardRef(a);return l[Zc]=t,l}function eu({layoutId:t}){const e=w.useContext(Hs).id;return e&&t!==void 0?e+"-"+t:t}function nu(t,e){w.useContext(So).strict}function su(t){const e=bo(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(t)||s!=null&&s.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function iu(t,e){if(typeof Proxy>"u")return we;const n=new Map,s=(r,o)=>we(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,we(o,void 0,t,e)),n.get(o))})}const ou=(t,e)=>e.isSVG??Vn(t)?new Kl(e):new Bl(e,{allowProjection:t!==w.Fragment});class ru extends nt{constructor(e){super(e),e.animationState||(e.animationState=Hl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ae(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 au=0;class lu extends nt{constructor(){super(...arguments),this.id=au++}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 cu={animation:{Feature:ru},exit:{Feature:lu}};function Nt(t){return{point:{x:t.pageX,y:t.pageY}}}const uu=t=>e=>Tn(e)&&t(e,Nt(e));function Et(t,e,n,s){return Ft(t,e,uu(n),s)}const Eo=({current:t})=>t?t.ownerDocument.defaultView:null,Fs=(t,e)=>Math.abs(t-e);function hu(t,e){const n=Fs(t.x,e.x),s=Fs(t.y,e.y);return Math.sqrt(n**2+s**2)}const Bs=new Set(["auto","scroll"]);class Ro{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.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;const d=be(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=hu(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!y)return;const{point:p}=d,{timestamp:v}=I;this.history.push({...p,timestamp:v});const{onStart:T,onMove:g}=this.handlers;m||(T&&T(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Se(m,this.transformPagePoint),V.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:y,onSessionEnd:p,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=be(d.type==="pointercancel"?this.lastMoveEventInfo:Se(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(d,T),p&&p(d,T)},!Tn(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const l=Nt(e),u=Se(l,this.transformPagePoint),{point:c}=u,{timestamp:h}=I;this.history=[{...c,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,be(u,this.history)),this.removeListeners=Bt(Et(this.contextWindow,"pointermove",this.handlePointerMove),Et(this.contextWindow,"pointerup",this.handlePointerUp),Et(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Bs.has(s.overflowX)||Bs.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),V.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),et(this.updatePoint)}}function Se(t,e){return e?{point:e(t.point)}:t}function Os(t,e){return{x:t.x-e.x,y:t.y-e.y}}function be({point:t},e){return{point:t,delta:Os(t,Lo(e)),offset:Os(t,fu(e)),velocity:du(e,.1)}}function fu(t){return t[0]}function Lo(t){return t[t.length-1]}function du(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Lo(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>K(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>K(e)*2&&(s=t[1]);const r=U(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 mu(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?D(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?D(n,t,s.max):Math.min(t,n)),t}function js(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 pu(t,{top:e,left:n,bottom:s,right:i}){return{x:js(t.x,n,i),y:js(t.y,e,s)}}function Ns(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function gu(t,e){return{x:Ns(t.x,e.x),y:Ns(t.y,e.y)}}function yu(t,e){let n=.5;const s=j(t),i=j(e);return i>s?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 vu(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 Xe=.35;function Tu(t=Xe){return t===!1?t=0:t===!0&&(t=Xe),{x:Us(t,"left","right"),y:Us(t,"top","bottom")}}function Us(t,e,n){return{min:Ws(t,e),max:Ws(t,n)}}function Ws(t,e){return typeof t=="number"?t:t[e]||0}const xu=new WeakMap;class wu{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=R(),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(Nt(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:m,onDragStart:y}=this.getProps();if(d&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=el(d),!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),H(v=>{let T=this.getAxisMotionValue(v).get()||0;if(X.test(T)){const{projection:g}=this.visualElement;if(g&&g.layout){const S=g.layout.layoutBox[v];S&&(T=j(S)*(parseFloat(T)/100))}}this.originPoint[v]=T}),y&&V.update(()=>y(h,f),!1,!0),We(this.visualElement,"transform");const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:m,onDirectionLock:y,onDrag:p}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=bu(v),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),p&&V.update(()=>p(h,f),!1,!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new Ro(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:Eo(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&&V.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=mu(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var r;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)==null?void 0:r.layout,i=this.constraints;e&&ft(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=pu(s.layoutBox,e):this.constraints=!1,this.elastic=Tu(n),i!==this.constraints&&!ft(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&H(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=vu(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ft(e))return!1;const s=e.current;xt(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=El(s,i.root,this.visualElement.getTransformPagePoint());let o=gu(i.layout.layoutBox,r);if(n){const a=n(Cl(o));this.hasMutatedConstraints=!!a,a&&(o=Ji(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=H(c=>{if(!_t(c,n,this.currentDirection))return;let h=l&&l[c]||{};o&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,m={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return We(this.visualElement,e),s.start(mn(e,s,0,n,this.visualElement,!1))}stopAnimation(){H(e=>this.getAxisMotionValue(e).stop())}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){H(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],l=r.get()||0;r.set(e[n]-D(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!ft(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};H(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=yu({min:l,max:l},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(),H(o=>{if(!_t(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(D(l,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;xu.set(this.visualElement,this);const e=this.visualElement.current,n=Et(e,"pointerdown",u=>{const{drag:c,dragListener:h=!0}=this.getProps(),f=u.target,d=f!==e&&al(f);c&&h&&!d&&this.start(u)});let s;const i=()=>{const{dragConstraints:u}=this.getProps();ft(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=Su(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),V.read(i);const a=Ft(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(H(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Xe,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Ks(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Su(t,e,n){const s=qn(t,Ks(n)),i=qn(e,Ks(n));return()=>{s(),i()}}function _t(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function bu(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Pu extends nt{constructor(e){super(e),this.removeGroupControls=W,this.removeListeners=W,this.controls=new wu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||W}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 Pe=t=>(e,n)=>{t&&V.update(()=>t(e,n),!1,!0)};class Au extends nt{constructor(){super(...arguments),this.removePointerDownListener=W}onPointerDown(e){this.session=new Ro(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Eo(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Pe(e),onStart:Pe(n),onMove:Pe(s),onEnd:(r,o)=>{delete this.session,i&&V.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 Ae=!1;class Vu 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),Ae&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Zt.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}),Ae=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||V.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),vn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;Ae=!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 ko(t){const[e,n]=kc(),s=w.useContext(Hs);return Y.jsx(Vu,{...t,layoutGroup:s,switchLayoutGroup:w.useContext(Mo),isPresent:e,safeToRemove:n})}const Cu={pan:{Feature:Au},drag:{Feature:Pu,ProjectionNode:xo,MeasureLayout:ko}};function $s(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&&V.postRender(()=>r(e,Nt(e)))}class Mu extends nt{mount(){const{current:e}=this.node;e&&(this.unmount=sl(e,(n,s)=>($s(this.node,s,"Start"),i=>$s(this.node,i,"End"))))}unmount(){}}class Du extends nt{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=Bt(Ft(this.node.current,"focus",()=>this.onFocus()),Ft(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Gs(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&&V.postRender(()=>r(e,Nt(e)))}class Eu extends nt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=cl(e,(i,r)=>(Gs(this.node,r,"Start"),(o,{success:a})=>Gs(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const qe=new WeakMap,Ve=new WeakMap,Ru=t=>{const e=qe.get(t.target);e&&e(t)},Lu=t=>{t.forEach(Ru)};function ku({root:t,...e}){const n=t||document;Ve.has(n)||Ve.set(n,{});const s=Ve.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Lu,{root:t,...e})),s[i]}function Iu(t,e,n){const s=ku(e);return qe.set(t,n),s.observe(t),()=>{qe.delete(t),s.unobserve(t)}}const Fu={some:0,all:1};class Bu extends nt{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:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Fu[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return Iu(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(Ou(e,n))&&this.startObserver()}unmount(){}}function Ou({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const ju={inView:{Feature:Bu},tap:{Feature:Eu},focus:{Feature:Du},hover:{Feature:Mu}},Nu={layout:{ProjectionNode:xo,MeasureLayout:ko}},Uu={...cu,...ju,...Cu,...Nu},oh=iu(Uu,ou);var Wu=w.createContext(void 0);function Ku(t){const e=w.useContext(Wu);return t||e||"ltr"}var Ce="rovingFocusGroup.onEntryFocus",$u={bubbles:!1,cancelable:!0},Ut="RovingFocusGroup",[Ze,Io,Gu]=Ko(Ut),[_u,rh]=$o(Ut,[Gu]),[zu,Hu]=_u(Ut),Fo=w.forwardRef((t,e)=>Y.jsx(Ze.Provider,{scope:t.__scopeRovingFocusGroup,children:Y.jsx(Ze.Slot,{scope:t.__scopeRovingFocusGroup,children:Y.jsx(Yu,{...t,ref:e})})}));Fo.displayName=Ut;var Yu=w.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:i=!1,dir:r,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...h}=t,f=w.useRef(null),d=Go(e,f),m=Ku(r),[y,p]=_o({prop:o,defaultProp:a??null,onChange:l,caller:Ut}),[v,T]=w.useState(!1),g=zo(u),S=Io(n),b=w.useRef(!1),[A,C]=w.useState(0);return w.useEffect(()=>{const P=f.current;if(P)return P.addEventListener(Ce,g),()=>P.removeEventListener(Ce,g)},[g]),Y.jsx(zu,{scope:n,orientation:s,dir:m,loop:i,currentTabStopId:y,onItemFocus:w.useCallback(P=>p(P),[p]),onItemShiftTab:w.useCallback(()=>T(!0),[]),onFocusableItemAdd:w.useCallback(()=>C(P=>P+1),[]),onFocusableItemRemove:w.useCallback(()=>C(P=>P-1),[]),children:Y.jsx(zs.div,{tabIndex:v||A===0?-1:0,"data-orientation":s,...h,ref:d,style:{outline:"none",...t.style},onMouseDown:vt(t.onMouseDown,()=>{b.current=!0}),onFocus:vt(t.onFocus,P=>{const L=!b.current;if(P.target===P.currentTarget&&L&&!v){const B=new CustomEvent(Ce,$u);if(P.currentTarget.dispatchEvent(B),!B.defaultPrevented){const st=S().filter(z=>z.focusable),it=st.find(z=>z.active),Wt=st.find(z=>z.id===y),Kt=[it,Wt,...st].filter(Boolean).map(z=>z.ref.current);jo(Kt,c)}}b.current=!1}),onBlur:vt(t.onBlur,()=>T(!1))})})}),Bo="RovingFocusGroupItem",Oo=w.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:r,children:o,...a}=t,l=Xo(),u=r||l,c=Hu(Bo,n),h=c.currentTabStopId===u,f=Io(n),{onFocusableItemAdd:d,onFocusableItemRemove:m,currentTabStopId:y}=c;return w.useEffect(()=>{if(s)return d(),()=>m()},[s,d,m]),Y.jsx(Ze.ItemSlot,{scope:n,id:u,focusable:s,active:i,children:Y.jsx(zs.span,{tabIndex:h?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:vt(t.onMouseDown,p=>{s?c.onItemFocus(u):p.preventDefault()}),onFocus:vt(t.onFocus,()=>c.onItemFocus(u)),onKeyDown:vt(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const v=Zu(p,c.orientation,c.dir);if(v!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let g=f().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")g.reverse();else if(v==="prev"||v==="next"){v==="prev"&&g.reverse();const S=g.indexOf(p.currentTarget);g=c.loop?Ju(g,S+1):g.slice(S+1)}setTimeout(()=>jo(g))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:y!=null}):o})})});Oo.displayName=Bo;var Xu={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qu(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Zu(t,e,n){const s=qu(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return Xu[s]}function jo(t,e=!1){const n=document.activeElement;for(const s of t)if(s===n||(s.focus({preventScroll:e}),document.activeElement!==n))return}function Ju(t,e){return t.map((n,s)=>t[(e+s)%t.length])}var ah=Fo,lh=Oo;export{eh as B,lh as I,Hs as L,wo as M,Je as P,ah as R,nh as U,kc as a,Jo as b,Xo as c,Ku as d,rh as e,tl as i,oh as m,qo as u};
