UNPKG

framer-motion

Version:

A simple and powerful JavaScript animation library

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