framer-motion
Version:
A simple and powerful JavaScript animation library
1 lines • 123 kB
JavaScript
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{createContext as n,useContext as i,useMemo as s,Fragment as o,createElement as r,useRef as a,useInsertionEffect as l,useCallback as h,useLayoutEffect as u,useEffect as c,forwardRef as d,useId as p,Component as m}from"react";function f(t,e){-1===t.indexOf(e)&&t.push(e)}function y(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const g=(t,e,n)=>n>e?e:n<t?t:n;function v(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let x=()=>{},w=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(x=(t,e,n)=>{t||"undefined"==typeof console||console.warn(v(e,n))},w=(t,e,n)=>{if(!t)throw new Error(v(e,n))});const T={},S=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function P(t){return"object"==typeof t&&null!==t}const b=t=>/^0[^.\s]+$/u.test(t);function E(t){let e;return()=>(void 0===e&&(e=t()),e)}const A=t=>t,M=(t,e)=>n=>e(t(n)),V=(...t)=>t.reduce(M),C=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class k{constructor(){this.subscriptions=[]}add(t){return f(this.subscriptions,t),()=>y(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const D=t=>1e3*t,R=t=>t/1e3;function L(t,e){return e?t*(1e3/e):0}const B=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function j(t,e,n,i){if(t===e&&n===i)return A;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=B(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:B(s(t),e,i)}const F=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,I=t=>e=>1-t(1-e),O=j(.33,1.53,.69,.99),U=I(O),W=F(U),N=t=>t>=1?1:(t*=2)<1?.5*U(t):.5*(2-Math.pow(2,-10*(t-1))),$=t=>1-Math.sin(Math.acos(t)),z=I($),Y=F($),X=j(.42,0,1,1),H=j(0,0,.58,1),K=j(.42,0,.58,1),G=t=>Array.isArray(t)&&"number"==typeof t[0],q={linear:A,easeIn:X,easeInOut:K,easeOut:H,circIn:$,circInOut:Y,circOut:z,backIn:U,backInOut:W,backOut:O,anticipate:N},Z=t=>{if(G(t)){w(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,s]=t;return j(e,n,i,s)}return"string"==typeof t?(w(void 0!==q[t],`Invalid easing type '${t}'`,"invalid-easing-type"),q[t]):t},_=n({}),J=n({strict:!1}),Q=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),tt=n({}),et=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function nt(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=et.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(o),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:u,update:c,preRender:d,render:p,postRender:m}=r,f=()=>{const o=T.useManualTiming,r=o?s.timestamp:performance.now();n=!1,o||(s.delta=i?1e3/60:Math.max(Math.min(r-s.timestamp,40),1)),s.timestamp=r,s.isProcessing=!0,a.process(s),l.process(s),h.process(s),u.process(s),c.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:et.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<et.length;e++)r[et[e]].cancel(t)},state:s,steps:r}}const{schedule:it,cancel:st,state:ot,steps:rt}=nt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:A,!0);let at;function lt(){at=void 0}const ht={now:()=>(void 0===at&&ht.set(ot.isProcessing||T.useManualTiming?ot.timestamp:performance.now()),at),set:t=>{at=t,queueMicrotask(lt)}},ut=t=>e=>"string"==typeof e&&e.startsWith(t),ct=ut("--"),dt=ut("var(--"),pt=t=>!!dt(t)&&mt.test(t.split("/*")[0].trim()),mt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ft(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const yt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},gt={...yt,transform:t=>g(0,1,t)},vt={...yt,default:1},xt=t=>Math.round(1e5*t)/1e5,wt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Tt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,St=(t,e)=>n=>Boolean("string"==typeof n&&Tt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Pt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(wt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},bt={...yt,transform:t=>Math.round((t=>g(0,255,t))(t))},Et={test:St("rgb","red"),parse:Pt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+bt.transform(t)+", "+bt.transform(e)+", "+bt.transform(n)+", "+xt(gt.transform(i))+")"};const At={test:St("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:Et.transform},Mt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Vt=Mt("deg"),Ct=Mt("%"),kt=Mt("px"),Dt=Mt("vh"),Rt=Mt("vw"),Lt=(()=>({...Ct,parse:t=>Ct.parse(t)/100,transform:t=>Ct.transform(100*t)}))(),Bt={test:St("hsl","hue"),parse:Pt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Ct.transform(xt(e))+", "+Ct.transform(xt(n))+", "+xt(gt.transform(i))+")"},jt={test:t=>Et.test(t)||At.test(t)||Bt.test(t),parse:t=>Et.test(t)?Et.parse(t):Bt.test(t)?Bt.parse(t):At.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Et.transform(t):Bt.transform(t),getAnimatableNone:t=>{const e=jt.parse(t);return e.alpha=0,jt.transform(e)}},Ft=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const It="number",Ot="color",Ut=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Wt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Ut,t=>(jt.test(t)?(i.color.push(o),s.push(Ot),n.push(jt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(It),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Nt({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o<n;o++)if(s+=t[o],void 0!==i[o]){const t=e[o];s+=t===It?xt(i[o]):t===Ot?jt.transform(i[o]):i[o]}return s}}const $t=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:jt.test(n)?jt.getAnimatableNone(n):n;var n};const zt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(wt)?.length||0)+(t.match(Ft)?.length||0)>0},parse:function(t){return Wt(t).values},createTransformer:function(t){return Nt(Wt(t))},getAnimatableNone:function(t){const e=Wt(t);return Nt(e)(e.values.map((t,n)=>$t(t,e.split[n])))}};function Yt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Xt(t,e){return n=>n>0?e:t}const Ht=(t,e,n)=>t+(e-t)*n,Kt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Gt=[At,Et,Bt];function qt(t){const e=(n=t,Gt.find(t=>t.test(n)));var n;if(x(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===Bt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Yt(a,i,t+1/3),o=Yt(a,i,t),r=Yt(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const Zt=(t,e)=>{const n=qt(t),i=qt(e);if(!n||!i)return Xt(t,e);const s={...n};return t=>(s.red=Kt(n.red,i.red,t),s.green=Kt(n.green,i.green,t),s.blue=Kt(n.blue,i.blue,t),s.alpha=Ht(n.alpha,i.alpha,t),Et.transform(s))},_t=new Set(["none","hidden"]);function Jt(t,e){return n=>Ht(t,e,n)}function Qt(t){return"number"==typeof t?Jt:"string"==typeof t?pt(t)?Xt:jt.test(t)?Zt:ne:Array.isArray(t)?te:"object"==typeof t?jt.test(t)?Zt:ee:Xt}function te(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Qt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function ee(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Qt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const ne=(t,e)=>{const n=zt.createTransformer(e),i=Wt(t),s=Wt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?_t.has(t)&&!s.values.length||_t.has(e)&&!i.values.length?function(t,e){return _t.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):V(te(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][i[o]],a=t.values[r]??0;n[s]=a,i[o]++}return n}(i,s),s.values),n):(x(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Xt(t,e))};function ie(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ht(t,e,n);return Qt(t)(t,e)}const se=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>it.update(e,t),stop:()=>st(e),now:()=>ot.isProcessing?ot.timestamp:ht.now()}},oe=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},re=2e4;function ae(t){let e=0;let n=t.next(e);for(;!n.done&&e<re;)e+=50,n=t.next(e);return e>=re?1/0:e}const le=100,he=10,ue=1,ce=0,de=800,pe=.3,me=.3,fe={granular:.01,default:2},ye={granular:.005,default:.5},ge=.01,ve=10,xe=.05,we=1;function Te(t,e){return t*Math.sqrt(1-e*e)}const Se=.001;const Pe=["duration","bounce"],be=["stiffness","damping","mass"];function Ee(t,e){return e.some(e=>void 0!==t[e])}function Ae(t){let e={velocity:ce,stiffness:le,damping:he,mass:ue,isResolvedFromDuration:!1,...t};if(!Ee(t,be)&&Ee(t,Pe))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*g(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:ue,stiffness:s,damping:o}}else{const n=function({duration:t=de,bounce:e=pe,velocity:n=ce,mass:i=ue}){let s,o;x(t<=D(ve),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=g(xe,we,r),t=g(ge,ve,R(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=Te(e,r),l=Math.exp(-s);return Se-o/a*l},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),h=Te(Math.pow(e,2),r);return(-s(e)+Se>0?-1:1)*((o-a)*l)/h}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=D(t),isNaN(a))return{stiffness:le,damping:he,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:ue},e.isResolvedFromDuration=!0}return e}function Me(t=me,e=pe){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:h,mass:u,duration:c,velocity:d,isResolvedFromDuration:p}=Ae({...n,velocity:-R(n.velocity||0)}),m=d||0,f=h/(2*Math.sqrt(l*u)),y=r-o,g=R(Math.sqrt(l/u)),v=Math.abs(y)<5;let x,w,T,S,P,b;if(i||(i=v?fe.granular:fe.default),s||(s=v?ye.granular:ye.default),f<1)T=Te(g,f),S=(m+f*g*y)/T,x=t=>{const e=Math.exp(-f*g*t);return r-e*(S*Math.sin(T*t)+y*Math.cos(T*t))},P=f*g*S+y*T,b=f*g*y-S*T,w=t=>Math.exp(-f*g*t)*(P*Math.sin(T*t)+b*Math.cos(T*t));else if(1===f){x=t=>r-Math.exp(-g*t)*(y+(m+g*y)*t);const t=m+g*y;w=e=>Math.exp(-g*e)*(g*t*e-m)}else{const t=g*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*g*e),i=Math.min(t*e,300);return r-n*((m+f*g*y)*Math.sinh(i)+t*y*Math.cosh(i))/t};const e=(m+f*g*y)/t,n=f*g*e-y*t,i=f*g*y-e*t;w=e=>{const s=Math.exp(-f*g*e),o=Math.min(t*e,300);return s*(n*Math.sinh(o)+i*Math.cosh(o))}}const E={calculatedDuration:p&&c||null,velocity:t=>D(w(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*g*t),n=Math.sin(T*t),o=Math.cos(T*t),l=r-e*(S*n+y*o),h=D(e*(P*n+b*o));return a.done=Math.abs(h)<=i&&Math.abs(r-l)<=s,a.value=a.done?r:l,a}const e=x(t);if(p)a.done=t>=c;else{const n=D(w(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=s}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(ae(E),re),e=oe(e=>E.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return E}Me.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(ae(i),re);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:R(s)}}(t,100,Me);return t.ease=e.ease,t.duration=D(e.duration),t.type="keyframes",t};function Ve(t,e,n){const i=Math.max(e-5,0);return L(n-t(i),e-i)}function Ce({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:u}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=c+m,y=void 0===r?f:r(f);y!==f&&(m=y-c);const g=t=>-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=h,d.value=d.done?y:n};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,T=Me({keyframes:[d.value,p(d.value)],velocity:Ve(v,t,d.value),damping:s,stiffness:o,restDelta:h,restSpeed:u}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),S(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function ke(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(w(o===e.length,"Both input and output ranges must be the same length","range-length"),1===o)return()=>e[0];if(2===o&&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=function(t,e,n){const i=[],s=n||T.mix||ie,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||A:e;o=V(t,o)}i.push(o)}return i}(e,i,s),l=a.length,h=n=>{if(r&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=C(t[i],t[i+1],n);return a[i](s)};return n?e=>h(g(t[0],t[o-1],e)):h}function De(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=C(0,e,i);t.push(Ht(n,1,s))}}(e,t.length-1),e}function Re({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Z):Z(i),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:De(e),t),a=ke(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||K).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const Le=t=>null!==t;function Be(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Le),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const je={decay:Ce,inertia:Ce,tween:Re,keyframes:Re,spring:Me};function Fe(t){"string"==typeof t.type&&(t.type=je[t.type])}class Ie{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Oe=t=>t/100;class Ue extends Ie{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==ht.now()&&this.tick(ht.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Fe(t);const{type:e=Re,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Re;a!==Re&&"number"!=typeof r[0]&&(this.mixKeyframes=V(Oe,ie(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=ae(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:h,repeat:u,repeatType:c,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let x,w=this.currentTime,T=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===c?(n=1-n,d&&(n-=d/r)):"mirror"===c&&(T=o)),w=g(0,1,n)*r}v?(this.delayState.value=h[0],x=this.delayState):x=T.next(w),s&&!v&&(x.value=s(x.value));let{done:S}=x;v||null===a||(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const P=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return P&&p!==Ce&&(x.value=Be(h,this.options,f,this.speed)),m&&m(x.value),P&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return R(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+R(t)}get time(){return R(this.currentTime)}set time(t){t=D(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return Ve(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(ht.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=R(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=se,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ht.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&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(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const We=t=>180*t/Math.PI,Ne=t=>{const e=We(Math.atan2(t[1],t[0]));return ze(e)},$e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ne,rotateZ:Ne,skewX:t=>We(Math.atan(t[1])),skewY:t=>We(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ze=t=>((t%=360)<0&&(t+=360),t),Ye=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Xe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),He={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ye,scaleY:Xe,scale:t=>(Ye(t)+Xe(t))/2,rotateX:t=>ze(We(Math.atan2(t[6],t[5]))),rotateY:t=>ze(We(Math.atan2(-t[2],t[0]))),rotateZ:Ne,rotate:Ne,skewX:t=>We(Math.atan(t[4])),skewY:t=>We(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ke(t){return t.includes("scale")?1:0}function Ge(t,e){if(!t||"none"===t)return Ke(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=He,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=$e,s=e}if(!s)return Ke(e);const o=i[e],r=s[1].split(",").map(qe);return"function"==typeof o?o(r):r[o]}function qe(t){return parseFloat(t.trim())}const Ze=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],_e=(()=>new Set(Ze))(),Je=t=>t===yt||t===kt,Qe=new Set(["x","y","z"]),tn=Ze.filter(t=>!Qe.has(t));const en={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ge(e,"x"),y:(t,{transform:e})=>Ge(e,"y")};en.translateX=en.x,en.translateY=en.y;const nn=new Set;let sn=!1,on=!1,rn=!1;function an(){if(on){const t=Array.from(nn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return tn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}on=!1,sn=!1,nn.forEach(t=>t.complete(rn)),nn.clear()}function ln(){nn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(on=!0)})}class hn{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(nn.add(this),sn||(sn=!0,it.read(ln),it.resolveKeyframes(an))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),nn.delete(this)}cancel(){"scheduled"===this.state&&(nn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function un(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const cn={};function dn(t,e){const n=E(t);return()=>cn[e]??n()}const pn=dn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),mn=dn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),fn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,yn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fn([0,.65,.55,1]),circOut:fn([.55,0,1,.45]),backIn:fn([.31,.01,.66,-.59]),backOut:fn([.33,1.53,.69,.99])};function gn(t,e){return t?"function"==typeof t?mn()?oe(t,e):"ease-out":G(t)?fn(t):Array.isArray(t)?t.map(t=>gn(t,e)||yn.easeOut):yn[t]:void 0}function vn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},h=void 0){const u={[e]:n};l&&(u.offset=l);const c=gn(a,s);Array.isArray(c)&&(u.easing=c);const d={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};h&&(d.pseudoElement=h);return t.animate(u,d)}function xn(t){return"function"==typeof t&&"applyToOptions"in t}class wn extends Ie{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,w("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return xn(t)&&mn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=vn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Be(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(t),un(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return R(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+R(t)}get time(){return R(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=D(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&pn()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),A):i(this)}}const Tn={anticipate:N,backInOut:W,circInOut:Y};function Sn(t){"string"==typeof t.ease&&t.ease in Tn&&(t.ease=Tn[t.ease])}class Pn extends wn{constructor(t){Sn(t),Fe(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Ue({...o,autoplay:!1}),a=Math.max(10,ht.now()-this.startTime),l=g(0,10,a-10),h=r.sample(a).value,{name:u}=this.options;s&&u&&un(s,u,h),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,h,l),r.stop()}}const bn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!zt.test(t)&&"0"!==t||t.startsWith("url(")));function En(t){t.duration=0,t.type="keyframes"}const An=new Set(["opacity","clipPath","filter","transform"]),Mn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Vn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Cn=E(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function kn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:u}=e.owner.getProps();return Cn()&&n&&(An.has(n)||Vn.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&Mn.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!u)&&!h&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}class Dn extends Ie{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:h,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ht.now();const c={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:h,...u},d=h?.KeyframeResolver||hn;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:h}=n;this.resolvedAt=ht.now();let u=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=bn(s,e),a=bn(o,e);return x(r===a,`You are trying to animate ${e} from "${s}" to "${o}". "${r?o:s}" is not an animatable value.`,"value-not-animatable"),!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||xn(n))&&i)})(t,s,o,r)||(u=!1,!T.instantAnimations&&a||h?.(Be(t,n,e)),t[0]=t[t.length-1],En(n),n.repeat=0);const c={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},d=u&&!l&&kn(c),p=c.motionValue?.owner?.current;let m;if(d)try{m=new Pn({...c,element:p})}catch{m=new Ue(c)}else m=new Ue(c);m.finished.then(()=>{this.notifyFinished()}).catch(A),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),rn=!0,ln(),an(),rn=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Rn(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const Ln=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Bn(t,e,n=1){w(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,s]=function(t){const e=Ln.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return S(t)?parseFloat(t):t}return pt(s)?Bn(s,e,n+1):s}const jn={type:"spring",stiffness:500,damping:25,restSpeed:10},Fn={type:"keyframes",duration:.8},In={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},On=(t,{keyframes:e})=>e.length>2?Fn:_e.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:jn:In;function Un(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Wn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Un(n,t):n}const Nn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const $n=(t,e,n,i={},s,o)=>r=>{const a=Wn(i,t)||{},l=a.delay||i.delay||0;let{elapsed:h=0}=i;h-=D(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-h,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function(t){for(const e in t)if(!Nn.has(e))return!0;return!1})(a)||Object.assign(u,On(t,u)),u.duration&&(u.duration=D(u.duration)),u.repeatDelay&&(u.repeatDelay=D(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(En(u),0===u.delay&&(c=!0)),(T.instantAnimations||T.skipAnimations||s?.shouldSkipAnimations)&&(c=!0,En(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=Be(u.keyframes,a);if(void 0!==t)return void it.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Ue(u):new Dn(u)};function zn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Yn(t,e,n,i){if("function"==typeof e){const[s,o]=zn(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=zn(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function Xn(t,e,n){const i=t.getProps();return Yn(i,e,void 0!==n?n:i.custom,t)}const Hn=new Set(["width","height","top","left","right","bottom",...Ze]);class Kn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=ht.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=ht.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new k);const n=this.events[t].add(e);return"change"===t?()=>{n(),it.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ht.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return L(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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 Gn(t,e){return new Kn(t,e)}const qn=t=>Array.isArray(t);function Zn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Gn(n))}function _n(t){return qn(t)?t[t.length-1]||0:t}const Jn=t=>Boolean(t&&t.getVelocity);function Qn(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Jn(i)&&i.add))return n.add(e);if(!n&&T.WillChange){const n=new T.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function ti(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ei="data-"+ti("framerAppearId");function ni(t){return t.props[ei]}function ii({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function si(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Un(o,l):l;const h=o?.reduceMotion;i&&(o=i);const u=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||c&&ii(c,e))continue;const r={delay:n,...Wn(o||{},e)},l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){it.update(()=>i.set(s));continue}let d=!1;if(window.MotionHandoffAnimation){const n=ni(t);if(n){const t=window.MotionHandoffAnimation(n,e,it);null!==t&&(r.startTime=t,d=!0)}}Qn(t,e);const p=h??t.shouldReduceMotion;i.start($n(e,i,s,p&&Hn.has(e)?{type:!1}:r,t,d));const m=i.animation;m&&u.push(m)}if(r){const e=()=>it.update(()=>{r&&function(t,e){const n=Xn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)Zn(t,e,_n(o[e]))}(t,r)});u.length?Promise.all(u).then(e):e()}return u}function oi(t,e,n={}){const i=Xn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(si(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(oi(l,e,{...r,delay:n+("function"==typeof i?0:i)+Rn(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}const ri=t=>e=>e.test(t),ai=[yt,kt,Ct,Vt,Rt,Dt,{test:t=>"auto"===t,parse:t=>t}],li=t=>ai.find(ri(t));function hi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||b(t))}const ui=new Set(["brightness","contrast","saturate","opacity"]);function ci(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(wt)||[];if(!i)return t;const s=n.replace(i,"");let o=ui.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const di=/\b([a-z-]*)\(.*?\)/gu,pi={...zt,getAnimatableNone:t=>{const e=t.match(di);return e?e.map(ci).join(" "):t}},mi={...zt,getAnimatableNone:t=>{const e=zt.parse(t);return zt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},fi={...yt,transform:Math.round},yi={borderWidth:kt,borderTopWidth:kt,borderRightWidth:kt,borderBottomWidth:kt,borderLeftWidth:kt,borderRadius:kt,borderTopLeftRadius:kt,borderTopRightRadius:kt,borderBottomRightRadius:kt,borderBottomLeftRadius:kt,width:kt,maxWidth:kt,height:kt,maxHeight:kt,top:kt,right:kt,bottom:kt,left:kt,inset:kt,insetBlock:kt,insetBlockStart:kt,insetBlockEnd:kt,insetInline:kt,insetInlineStart:kt,insetInlineEnd:kt,padding:kt,paddingTop:kt,paddingRight:kt,paddingBottom:kt,paddingLeft:kt,paddingBlock:kt,paddingBlockStart:kt,paddingBlockEnd:kt,paddingInline:kt,paddingInlineStart:kt,paddingInlineEnd:kt,margin:kt,marginTop:kt,marginRight:kt,marginBottom:kt,marginLeft:kt,marginBlock:kt,marginBlockStart:kt,marginBlockEnd:kt,marginInline:kt,marginInlineStart:kt,marginInlineEnd:kt,fontSize:kt,backgroundPositionX:kt,backgroundPositionY:kt,...{rotate:Vt,rotateX:Vt,rotateY:Vt,rotateZ:Vt,scale:vt,scaleX:vt,scaleY:vt,scaleZ:vt,skew:Vt,skewX:Vt,skewY:Vt,distance:kt,translateX:kt,translateY:kt,translateZ:kt,x:kt,y:kt,z:kt,perspective:kt,transformPerspective:kt,opacity:gt,originX:Lt,originY:Lt,originZ:kt},zIndex:fi,fillOpacity:gt,strokeOpacity:gt,numOctaves:fi},gi={...yi,color:jt,backgroundColor:jt,outlineColor:jt,fill:jt,stroke:jt,borderColor:jt,borderTopColor:jt,borderRightColor:jt,borderBottomColor:jt,borderLeftColor:jt,filter:pi,WebkitFilter:pi,mask:mi,WebkitMask:mi},vi=t=>gi[t],xi=new Set([pi,mi]);function wi(t,e){let n=vi(t);return xi.has(n)||(n=zt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ti=new Set(["auto","none","0"]);class Si extends hn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),pt(i))){const s=Bn(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Hn.has(n)||2!==t.length)return;const[i,s]=t,o=li(i),r=li(s);if(ft(i)!==ft(s)&&en[n])this.needsMeasurement=!0;else if(o!==r)if(Je(o)&&Je(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else en[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||hi(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!Ti.has(e)&&Wt(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=wi(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=en[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,o=n[s];n[s]=en[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}function Pi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=n?.[t]??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}const bi=(t,e)=>e&&"number"==typeof t?e.transform(t):t;const{schedule:Ei}=nt(queueMicrotask,!1),Ai={x:!1,y:!1};function Mi(){return Ai.x||Ai.y}function Vi(t,e){const n=Pi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Ci(t,e,n={}){const[i,s,o]=Vi(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Mi())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const ki=(t,e)=>!!e&&(t===e||ki(t,e.parentElement)),Di=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Ri=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Li=new Set(["INPUT","SELECT","TEXTAREA"]);const Bi=new WeakSet;function ji(t){return e=>{"Enter"===e.key&&t(e)}}function Fi(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Ii(t){return Di(t)&&!Mi()}const Oi=new WeakSet;function Ui(t,e,n={}){const[i,s,o]=Vi(t,n),r=t=>{const i=t.currentTarget;if(!Ii(t))return;if(Oi.has(t))return;Bi.add(i),n.stopPropagation&&Oi.add(t);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Bi.has(i)&&Bi.delete(i),Ii(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||ki(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),P(e=t)&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=ji(()=>{if(Bi.has(n))return;Fi(n,"down");const t=ji(()=>{Fi(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Fi(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return Ri.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Wi(t){return P(t)&&"ownerSVGElement"in t}const Ni=new WeakMap;let $i;const zi=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Wi(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Yi=zi("inline","width","offsetWidth"),Xi=zi("block","height","offsetHeight");function Hi({target:t,borderBoxSize:e}){Ni.get(t)?.forEach(n=>{n(t,{get width(){return Yi(t,e)},get height(){return Xi(t,e)}})})}function Ki(t){t.forEach(Hi)}function Gi(t,e){$i||"undefined"!=typeof ResizeObserver&&($i=new ResizeObserver(Ki));const n=Pi(t);return n.forEach(t=>{let n=Ni.get(t);n||(n=new Set,Ni.set(t,n)),n.add(e),$i?.observe(t)}),()=>{n.forEach(t=>{const n=Ni.get(t);n?.delete(e),n?.size||$i?.unobserve(t)})}}const qi=new Set;let Zi;function _i(t){return qi.add(t),Zi||(Zi=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};qi.forEach(e=>e(t))},window.addEventListener("resize",Zi)),()=>{qi.delete(t),qi.size||"function"!=typeof Zi||(window.removeEventListener("resize",Zi),Zi=void 0)}}function Ji(t,e){return"function"==typeof t?_i(t):Gi(t,e)}const Qi=[...ai,jt,zt],ts=()=>({x:{min:0,max:0},y:{min:0,max:0}}),es=new WeakMap;function ns(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function is(t){return"string"==typeof t||Array.isArray(t)}const ss=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],os=["initial",...ss];function rs(t){return ns(t.animate)||os.some(e=>is(t[e]))}function as(t){return Boolean(rs(t)||t.variants)}const ls={current:null},hs={current:!1},us="undefined"!=typeof window;const cs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ds={};function ps(t){ds=t}class ms{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=hn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=ht.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,it.render(this.render,!1,!0))};const{latestValues:l,renderState:h}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=a,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=rs(e),this.isVariantNode=as(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==l[t]&&Jn(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,es.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(hs.current||function(){if(h