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