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