framer-motion 12.24.0 → 12.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.js +1 -1
- package/dist/cjs/dom.js +15 -0
- package/dist/cjs/dom.js.map +1 -1
- package/dist/cjs/{feature-bundle-DhbxBqkJ.js → feature-bundle-DRMwxyzS.js} +16 -1
- package/dist/cjs/feature-bundle-DRMwxyzS.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/m.js +15 -0
- package/dist/cjs/m.js.map +1 -1
- package/dist/dom.js +1 -1
- package/dist/es/components/Reorder/Item.mjs.map +1 -1
- package/dist/es/render/svg/utils/build-attrs.mjs +15 -0
- package/dist/es/render/svg/utils/build-attrs.mjs.map +1 -1
- package/dist/framer-motion.dev.js +15 -0
- package/dist/framer-motion.js +1 -1
- package/dist/size-rollup-animate.js +1 -1
- package/dist/size-rollup-animate.js.map +1 -1
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-max-assets.js +1 -1
- package/dist/size-rollup-m.js +1 -1
- package/dist/size-rollup-m.js.map +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-rollup-motion.js.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/package.json +2 -2
- package/dist/cjs/feature-bundle-DhbxBqkJ.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function t(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const e=(t,e,n)=>n>e?e:n<t?t:n;function n(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let s=()=>{},i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,e,s)=>{t||"undefined"==typeof console||console.warn(n(e,s))},i=(t,e,s)=>{if(!t)throw new Error(n(e,s))});const r={},a=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);const o=t=>/^0[^.\s]+$/u.test(t);function l(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(t,e)=>n=>e(t(n)),c=(...t)=>t.reduce(h),d=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class p{constructor(){this.subscriptions=[]}add(e){var n,s;return n=this.subscriptions,s=e,-1===n.indexOf(s)&&n.push(s),()=>t(this.subscriptions,e)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const m=t=>1e3*t,f=t=>t/1e3;function g(t,e){return e?t*(1e3/e):0}const y=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function v(t,e,n,s){if(t===e&&n===s)return u;const i=e=>function(t,e,n,s,i){let r,a,o=0;do{a=e+(n-e)/2,r=y(a,s,i)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:y(i(t),e,s)}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,w=t=>e=>1-t(1-e),T=v(.33,1.53,.69,.99),M=w(T),S=b(M),x=t=>(t*=2)<1?.5*M(t):.5*(2-Math.pow(2,-10*(t-1))),V=t=>1-Math.sin(Math.acos(t)),A=w(V),k=b(V),C=v(.42,0,1,1),F=v(0,0,.58,1),P=v(.42,0,.58,1),E=t=>Array.isArray(t)&&"number"!=typeof t[0];function B(t,e){return E(t)?t[((t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t})(0,t.length,e)]:t}const R=t=>Array.isArray(t)&&"number"==typeof t[0],I={linear:u,easeIn:C,easeInOut:P,easeOut:F,circIn:V,circInOut:k,circOut:A,backIn:M,backInOut:S,backOut:T,anticipate:x},D=t=>{if(R(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,r]=t;return v(e,n,s,r)}return"string"==typeof t?(i(void 0!==I[t],`Invalid easing type '${t}'`,"invalid-easing-type"),I[t]):t},O=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],N={value:null,addProjectionMetrics:null};function $(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=O.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,i=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){a.has(e)&&(h.schedule(e),t()),l++,e(o)}const h={schedule:(t,e=!1,r=!1)=>{const o=r&&i?n:s;return e&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{o=t,i?r=!0:(i=!0,[n,s]=[s,n],n.forEach(u),e&&N.value&&N.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,h.process(t)))}};return h}(a,e?n:void 0),t),{}),{setup:l,read:u,resolveKeyframes:h,preUpdate:c,update:d,preRender:p,render:m,postRender:f}=o,g=()=>{const a=r.useManualTiming?i.timestamp:performance.now();n=!1,r.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,l.process(i),u.process(i),h.process(i),c.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:O.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<O.length;e++)o[O[e]].cancel(t)},state:i,steps:o}}const{schedule:K,cancel:j,state:L,steps:W}=$("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0);let Y;function U(){Y=void 0}const X={now:()=>(void 0===Y&&X.set(L.isProcessing||r.useManualTiming?L.timestamp:performance.now()),Y),set:t=>{Y=t,queueMicrotask(U)}},q=t=>e=>"string"==typeof e&&e.startsWith(t),z=q("--"),Z=q("var(--"),_=t=>!!Z(t)&&H.test(t.split("/*")[0].trim()),H=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,G={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},J={...G,transform:t=>e(0,1,t)},Q={...G,default:1},tt=t=>Math.round(1e5*t)/1e5,et=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const nt=/^(?:#[\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&&nt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),it=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,a,o]=s.match(et);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},rt={...G,transform:t=>Math.round((t=>e(0,255,t))(t))},at={test:st("rgb","red"),parse:it("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+rt.transform(t)+", "+rt.transform(e)+", "+rt.transform(n)+", "+tt(J.transform(s))+")"};const ot={test:st("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:at.transform},lt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ut=lt("deg"),ht=lt("%"),ct=lt("px"),dt=lt("vh"),pt=lt("vw"),mt=(()=>({...ht,parse:t=>ht.parse(t)/100,transform:t=>ht.transform(100*t)}))(),ft={test:st("hsl","hue"),parse:it("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ht.transform(tt(e))+", "+ht.transform(tt(n))+", "+tt(J.transform(s))+")"},gt={test:t=>at.test(t)||ot.test(t)||ft.test(t),parse:t=>at.test(t)?at.parse(t):ft.test(t)?ft.parse(t):ot.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?at.transform(t):ft.transform(t),getAnimatableNone:t=>{const e=gt.parse(t);return e.alpha=0,gt.transform(e)}},yt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const vt="number",bt="color",wt=/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 Tt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(wt,t=>(gt.test(t)?(s.color.push(r),i.push(bt),n.push(gt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(vt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:s,types:i}}function Mt(t){return Tt(t).values}function St(t){const{split:e,types:n}=Tt(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+=e===vt?tt(t[r]):e===bt?gt.transform(t[r]):t[r]}return i}}const xt=t=>"number"==typeof t?0:gt.test(t)?gt.getAnimatableNone(t):t;const Vt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(et)?.length||0)+(t.match(yt)?.length||0)>0},parse:Mt,createTransformer:St,getAnimatableNone:function(t){const e=Mt(t);return St(t)(e.map(xt))}};function At(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 kt(t,e){return n=>n>0?e:t}const Ct=(t,e,n)=>t+(e-t)*n,Ft=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Pt=[ot,at,ft];function Et(t){const e=(n=t,Pt.find(t=>t.test(n)));var n;if(s(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===ft&&(i=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,a=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,o=2*n-s;i=At(o,s,t+1/3),r=At(o,s,t),a=At(o,s,t-1/3)}else i=r=a=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*a),alpha:s}}(i)),i}const Bt=(t,e)=>{const n=Et(t),s=Et(e);if(!n||!s)return kt(t,e);const i={...n};return t=>(i.red=Ft(n.red,s.red,t),i.green=Ft(n.green,s.green,t),i.blue=Ft(n.blue,s.blue,t),i.alpha=Ct(n.alpha,s.alpha,t),at.transform(i))},Rt=new Set(["none","hidden"]);function It(t,e){return n=>Ct(t,e,n)}function Dt(t){return"number"==typeof t?It:"string"==typeof t?_(t)?kt:gt.test(t)?Bt:$t:Array.isArray(t)?Ot:"object"==typeof t?gt.test(t)?Bt:Nt:kt}function Ot(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Dt(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function Nt(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Dt(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const $t=(t,e)=>{const n=Vt.createTransformer(e),i=Tt(t),r=Tt(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Rt.has(t)&&!r.values.length||Rt.has(e)&&!i.values.length?function(t,e){return Rt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):c(Ot(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],a=t.indexes[r][s[r]],o=t.values[a]??0;n[i]=o,s[r]++}return n}(i,r),r.values),n):(s(!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"),kt(t,e))};function Kt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ct(t,e,n);return Dt(t)(t,e)}const jt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>K.update(e,t),stop:()=>j(e),now:()=>L.isProcessing?L.timestamp:X.now()}},Lt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Wt=2e4;function Yt(t){let e=0;let n=t.next(e);for(;!n.done&&e<Wt;)e+=50,n=t.next(e);return e>=Wt?1/0:e}function Ut(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Yt(s),Wt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:f(i)}}function Xt(t,e,n){const s=Math.max(e-5,0);return g(n-t(s),e-s)}const qt=100,zt=10,Zt=1,_t=0,Ht=800,Gt=.3,Jt=.3,Qt={granular:.01,default:2},te={granular:.005,default:.5},ee=.01,ne=10,se=.05,ie=1,re=.001;function ae({duration:t=Ht,bounce:n=Gt,velocity:i=_t,mass:r=Zt}){let a,o;s(t<=m(ne),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=e(se,ie,l),t=e(ee,ne,f(t)),l<1?(a=e=>{const n=e*l,s=n*t,r=n-i,a=le(e,l),o=Math.exp(-s);return re-r/a*o},o=e=>{const n=e*l*t,s=n*i+i,r=Math.pow(l,2)*Math.pow(e,2)*t,o=Math.exp(-n),u=le(Math.pow(e,2),l);return(-a(e)+re>0?-1:1)*((s-r)*o)/u}):(a=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const u=function(t,e,n){let s=n;for(let n=1;n<oe;n++)s-=t(s)/e(s);return s}(a,o,5/t);if(t=m(t),isNaN(u))return{stiffness:qt,damping:zt,duration:t};{const e=Math.pow(u,2)*r;return{stiffness:e,damping:2*l*Math.sqrt(r*e),duration:t}}}const oe=12;function le(t,e){return t*Math.sqrt(1-e*e)}const ue=["duration","bounce"],he=["stiffness","damping","mass"];function ce(t,e){return e.some(e=>void 0!==t[e])}function de(t=Jt,n=Gt){const s="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t;let{restSpeed:i,restDelta:r}=s;const a=s.keyframes[0],o=s.keyframes[s.keyframes.length-1],l={done:!1,value:a},{stiffness:u,damping:h,mass:c,duration:d,velocity:p,isResolvedFromDuration:g}=function(t){let n={velocity:_t,stiffness:qt,damping:zt,mass:Zt,isResolvedFromDuration:!1,...t};if(!ce(t,he)&&ce(t,ue))if(t.visualDuration){const s=t.visualDuration,i=2*Math.PI/(1.2*s),r=i*i,a=2*e(.05,1,1-(t.bounce||0))*Math.sqrt(r);n={...n,mass:Zt,stiffness:r,damping:a}}else{const e=ae(t);n={...n,...e,mass:Zt},n.isResolvedFromDuration=!0}return n}({...s,velocity:-f(s.velocity||0)}),y=p||0,v=h/(2*Math.sqrt(u*c)),b=o-a,w=f(Math.sqrt(u/c)),T=Math.abs(b)<5;let M;if(i||(i=T?Qt.granular:Qt.default),r||(r=T?te.granular:te.default),v<1){const t=le(w,v);M=e=>{const n=Math.exp(-v*w*e);return o-n*((y+v*w*b)/t*Math.sin(t*e)+b*Math.cos(t*e))}}else if(1===v)M=t=>o-Math.exp(-w*t)*(b+(y+w*b)*t);else{const t=w*Math.sqrt(v*v-1);M=e=>{const n=Math.exp(-v*w*e),s=Math.min(t*e,300);return o-n*((y+v*w*b)*Math.sinh(s)+t*b*Math.cosh(s))/t}}const S={calculatedDuration:g&&d||null,next:t=>{const e=M(t);if(g)l.done=t>=d;else{let n=0===t?y:0;v<1&&(n=0===t?m(y):Xt(M,t,e));const s=Math.abs(n)<=i,a=Math.abs(o-e)<=r;l.done=s&&a}return l.value=l.done?o:e,l},toString:()=>{const t=Math.min(Yt(S),Wt),e=Lt(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function pe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===o?l:void 0===l||Math.abs(o-t)<Math.abs(l-t)?o:l;let m=n*e;const f=c+m,g=void 0===a?f:a(f);g!==f&&(m=g-c);const y=t=>-m*Math.exp(-t/s),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let w,T;const M=t=>{var e;(e=d.value,void 0!==o&&e<o||void 0!==l&&e>l)&&(w=t,T=de({keyframes:[d.value,p(d.value)],velocity:Xt(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:h}))};return M(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,b(t),M(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&b(t),d)}}}function me(t,n,{clamp:s=!0,ease:a,mixer:o}={}){const l=t.length;if(i(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const h=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),n=[...n].reverse());const p=function(t,e,n){const s=[],i=n||r.mix||Kt,a=t.length-1;for(let n=0;n<a;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||u:e;r=c(t,r)}s.push(r)}return s}(n,a,o),m=p.length,f=e=>{if(h&&e<t[0])return n[0];let s=0;if(m>1)for(;s<t.length-2&&!(e<t[s+1]);s++);const i=d(t[s],t[s+1],e);return p[s](i)};return s?n=>f(e(t[0],t[l-1],n)):f}function fe(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=d(0,e,s);t.push(Ct(n,1,i))}}function ge(t){const e=[0];return fe(e,t.length-1),e}function ye({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=E(s)?s.map(D):D(s),r={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:ge(e),t),o=me(a,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map(()=>u||P).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}de.applyToOptions=t=>{const e=Ut(t,100,de);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};const ve=t=>null!==t;function be(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(ve),a=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==s?s:r[a]}const we={decay:pe,inertia:pe,tween:ye,keyframes:ye,spring:de};function Te(t){"string"==typeof t.type&&(t.type=we[t.type])}class Me{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 Se=t=>t/100;class xe extends Me{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==X.now()&&this.tick(X.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;Te(t);const{type:e=ye,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:a}=t;const o=e||ye;o!==ye&&"number"!=typeof a[0]&&(this.mixKeyframes=c(Se,Kt(a[0],a[1])),a=[0,100]);const l=o({...t,keyframes:a});"mirror"===i&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Yt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,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,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(null===this.startTime)return s.next(0);const{delay:u=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:g}=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)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(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 b=this.currentTime,w=s;if(c){const t=Math.min(this.currentTime,i)/o;let n=Math.floor(t),s=t%1;!s&&t>=1&&(s=1),1===s&&n--,n=Math.min(n,c+1);Boolean(n%2)&&("reverse"===d?(s=1-s,p&&(s-=p/o)):"mirror"===d&&(w=a)),b=e(0,1,s)*o}const T=v?{done:!1,value:h[0]}:w.next(b);r&&(T.value=r(T.value));let{done:M}=T;v||null===l||(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&M);return S&&m!==pe&&(T.value=be(h,this.options,g,this.speed)),f&&f(T.value),S&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return f(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(this.currentTime)}set time(t){t=m(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?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(X.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=f(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=jt,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(X.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 Ve=t=>180*t/Math.PI,Ae=t=>{const e=Ve(Math.atan2(t[1],t[0]));return Ce(e)},ke={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ae,rotateZ:Ae,skewX:t=>Ve(Math.atan(t[1])),skewY:t=>Ve(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ce=t=>((t%=360)<0&&(t+=360),t),Fe=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Pe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ee={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Fe,scaleY:Pe,scale:t=>(Fe(t)+Pe(t))/2,rotateX:t=>Ce(Ve(Math.atan2(t[6],t[5]))),rotateY:t=>Ce(Ve(Math.atan2(-t[2],t[0]))),rotateZ:Ae,rotate:Ae,skewX:t=>Ve(Math.atan(t[4])),skewY:t=>Ve(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Be(t){return t.includes("scale")?1:0}function Re(t,e){if(!t||"none"===t)return Be(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ee,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=ke,i=e}if(!i)return Be(e);const r=s[e],a=i[1].split(",").map(Ie);return"function"==typeof r?r(a):a[r]}function Ie(t){return parseFloat(t.trim())}const De=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Oe=(()=>new Set(De))(),Ne=t=>t===G||t===ct,$e=new Set(["x","y","z"]),Ke=De.filter(t=>!$e.has(t));const je={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Re(e,"x"),y:(t,{transform:e})=>Re(e,"y")};je.translateX=je.x,je.translateY=je.y;const Le=new Set;let We=!1,Ye=!1,Ue=!1;function Xe(){if(Ye){const t=Array.from(Le).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 Ke.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.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)})}Ye=!1,We=!1,Le.forEach(t=>t.complete(Ue)),Le.clear()}function qe(){Le.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ye=!0)})}class ze{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Le.add(this),We||(We=!0,K.read(qe),K.resolveKeyframes(Xe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.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),Le.delete(this)}cancel(){"scheduled"===this.state&&(Le.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Ze=l(()=>void 0!==window.ScrollTimeline),_e={};function He(t,e){const n=l(t);return()=>_e[e]??n()}const Ge=He(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Je=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Qe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Je([0,.65,.55,1]),circOut:Je([.55,0,1,.45]),backIn:Je([.31,.01,.66,-.59]),backOut:Je([.33,1.53,.69,.99])};function tn(t,e){return t?"function"==typeof t?Ge()?Lt(t,e):"ease-out":R(t)?Je(t):Array.isArray(t)?t.map(t=>tn(t,e)||Qe.easeOut):Qe[t]:void 0}function en(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const h={[e]:n};l&&(h.offset=l);const c=tn(o,i);Array.isArray(c)&&(h.easing=c);const d={delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};u&&(d.pseudoElement=u);return t.animate(h,d)}function nn(t){return"function"==typeof t&&"applyToOptions"in t}class sn extends Me{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return nn(t)&&Ge()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=en(e,n,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=be(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(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(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=m(t)}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 Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ze()?(this.animation.timeline=t,u):e(this)}}const rn={anticipate:x,backInOut:S,circInOut:k};function an(t){"string"==typeof t.ease&&t.ease in rn&&(t.ease=rn[t.ease])}class on extends sn{constructor(t){an(t),Te(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:i,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const a=new xe({...r,autoplay:!1}),o=m(this.finishedTime??this.time);e.setWithVelocity(a.sample(o-10).value,a.sample(o).value,10),a.stop()}}const ln=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Vt.test(t)&&"0"!==t||t.startsWith("url(")));function un(t){t.duration=0,t.type="keyframes"}const hn=new Set(["opacity","clipPath","filter","transform"]),cn=l(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class dn extends Me{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:a,name:o,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=X.now();const c={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:o,motionValue:l,element:u,...h},d=u?.KeyframeResolver||ze;this.keyframeResolver=new d(a,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),o,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:h,isHandoff:c,onUpdate:d}=n;this.resolvedAt=X.now(),function(t,e,n,i){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const a=t[t.length-1],o=ln(r,e),l=ln(a,e);return s(o===l,`You are trying to animate ${e} from "${r}" to "${a}". "${o?a:r}" is not an animatable value.`,"value-not-animatable"),!(!o||!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}(t)||("spring"===n||nn(n))&&i)}(t,a,o,l)||(!r.instantAnimations&&h||d?.(be(t,n,e)),t[0]=t[t.length-1],un(n),n.repeat=0);const p={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},m=!c&&function(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a}=t,o=e?.owner?.current;if(!(o instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return cn()&&n&&hn.has(n)&&("transform"!==n||!u)&&!l&&!s&&"mirror"!==i&&0!==r&&"inertia"!==a}(p)?new on({...p,element:p.motionValue.owner.current}):new xe(p);m.finished.then(()=>this.notifyFinished()).catch(u),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ue=!0,qe(),Xe(),Ue=!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()}}class pn{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 mn(this.animations,"duration")}get iterationDuration(){return mn(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 mn(t,e){let n=0;for(let s=0;s<t.length;s++){const i=t[s][e];null!==i&&i>n&&(n=i)}return n}class fn extends pn{then(t,e){return this.finished.finally(t).then(()=>{})}}const gn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yn(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=gn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return a(t)?parseFloat(t):t}return _(r)?yn(r,e,n+1):r}function vn(t,e){return t?.[e]??t?.default??t}const bn=new Set(["width","height","top","left","right","bottom",...De]),wn=t=>e=>e.test(t),Tn=[G,ct,ht,ut,pt,dt,{test:t=>"auto"===t,parse:t=>t}],Mn=t=>Tn.find(wn(t));function Sn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||o(t))}const xn=new Set(["brightness","contrast","saturate","opacity"]);function Vn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(et)||[];if(!s)return t;const i=n.replace(s,"");let r=xn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const An=/\b([a-z-]*)\(.*?\)/gu,kn={...Vt,getAnimatableNone:t=>{const e=t.match(An);return e?e.map(Vn).join(" "):t}},Cn={...G,transform:Math.round},Fn={borderWidth:ct,borderTopWidth:ct,borderRightWidth:ct,borderBottomWidth:ct,borderLeftWidth:ct,borderRadius:ct,radius:ct,borderTopLeftRadius:ct,borderTopRightRadius:ct,borderBottomRightRadius:ct,borderBottomLeftRadius:ct,width:ct,maxWidth:ct,height:ct,maxHeight:ct,top:ct,right:ct,bottom:ct,left:ct,inset:ct,insetBlock:ct,insetBlockStart:ct,insetBlockEnd:ct,insetInline:ct,insetInlineStart:ct,insetInlineEnd:ct,padding:ct,paddingTop:ct,paddingRight:ct,paddingBottom:ct,paddingLeft:ct,paddingBlock:ct,paddingBlockStart:ct,paddingBlockEnd:ct,paddingInline:ct,paddingInlineStart:ct,paddingInlineEnd:ct,margin:ct,marginTop:ct,marginRight:ct,marginBottom:ct,marginLeft:ct,marginBlock:ct,marginBlockStart:ct,marginBlockEnd:ct,marginInline:ct,marginInlineStart:ct,marginInlineEnd:ct,backgroundPositionX:ct,backgroundPositionY:ct,...{rotate:ut,rotateX:ut,rotateY:ut,rotateZ:ut,scale:Q,scaleX:Q,scaleY:Q,scaleZ:Q,skew:ut,skewX:ut,skewY:ut,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:J,originX:mt,originY:mt,originZ:ct},zIndex:Cn,fillOpacity:J,strokeOpacity:J,numOctaves:Cn},Pn={...Fn,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:kn,WebkitFilter:kn},En=t=>Pn[t];function Bn(t,e){let n=En(t);return n!==kn&&(n=Vt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Rn=new Set(["auto","none","0"]);class In extends ze{constructor(t,e,n,s,i){super(t,e,n,s,i,!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 s=t[n];if("string"==typeof s&&(s=s.trim(),_(s))){const i=yn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!bn.has(n)||2!==t.length)return;const[s,i]=t,r=Mn(s),a=Mn(i);if(r!==a)if(Ne(r)&&Ne(a))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else je[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Sn(t[e]))&&n.push(e);n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!Rn.has(e)&&Tt(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Bn(n,s)}(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=je[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=je[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Dn=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class On{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=X.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=X.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 p);const n=this.events[t].add(e);return"change"===t?()=>{n(),K.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=X.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(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 Nn(t,e){return new On(t,e)}const{schedule:$n,cancel:Kn}=$(queueMicrotask,!1);function jn(t){return"object"==typeof(e=t)&&null!==e&&"ownerSVGElement"in t;var e}const Ln=t=>Boolean(t&&t.getVelocity),Wn=[...Tn,gt,Vt];function Yn(t){return"object"==typeof t&&!Array.isArray(t)}function Un(t,e,n,s){return"string"==typeof t&&Yn(e)?function(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Xn(t,e,n){return t*(e+1)}function qn(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):s.get(e)??t}function zn(e,n,s,i,r,a){!function(e,n,s){for(let i=0;i<e.length;i++){const r=e[i];r.at>n&&r.at<s&&(t(e,r),i--)}}(e,r,a);for(let t=0;t<n.length;t++)e.push({value:n[t],at:Ct(r,a,i[t]),easing:B(s,t)})}function Zn(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function _n(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Hn(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Gn(t,e){return e[t]||(e[t]=[]),e[t]}function Jn(t){return Array.isArray(t)?t:[t]}function Qn(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const ts=t=>"number"==typeof t,es=t=>t.every(ts),ns=new WeakMap;function ss(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function is(t,e,n,s){if("function"==typeof e){const[i,r]=ss(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=ss(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function rs(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Nn(n))}function as(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function os(t,e){const n=function(t,e){const n=t.getProps();return is(n,e,n.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){rs(t,e,as(r[e]))}}function ls(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Ln(s)&&s.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}const us=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),hs="data-"+us("framerAppearId");function cs(t){return t.props[hs]}const ds=t=>null!==t;const ps={type:"spring",stiffness:500,damping:25,restSpeed:10},ms={type:"keyframes",duration:.8},fs={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},gs=(t,{keyframes:e})=>e.length>2?ms:Oe.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ps:fs;const ys=(t,e,n,s={},i,a)=>o=>{const l=vn(s,t)||{},u=l.delay||s.delay||0;let{elapsed:h=0}=s;h-=m(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-h,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:a?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:a,repeatDelay:o,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(l)||Object.assign(c,gs(t,c)),c.duration&&(c.duration=m(c.duration)),c.repeatDelay&&(c.repeatDelay=m(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(un(c),0===c.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations)&&(d=!0,un(c),c.delay=0),c.allowFlatten=!l.type&&!l.ease,d&&!a&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ds),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}(c.keyframes,l);if(void 0!==t)return void K.update(()=>{c.onUpdate(t),c.onComplete()})}return l.isSync?new xe(c):new dn(c)};function vs({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function bs(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:a,...o}=e;s&&(r=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const e in o){const s=t.getValue(e,t.latestValues[e]??null),i=o[e];if(void 0===i||u&&vs(u,e))continue;const a={delay:n,...vn(r||{},e)},h=s.get();if(void 0!==h&&!s.isAnimating&&!Array.isArray(i)&&i===h&&!a.velocity)continue;let c=!1;if(window.MotionHandoffAnimation){const n=cs(t);if(n){const t=window.MotionHandoffAnimation(n,e,K);null!==t&&(a.startTime=t,c=!0)}}ls(t,e),s.start(ys(e,s,i,t.shouldReduceMotion&&bn.has(e)?{type:!1}:a,t,c));const d=s.animation;d&&l.push(d)}return a&&Promise.all(l).then(()=>{K.update(()=>{a&&os(t,a)})}),l}const ws={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ts={};for(const t in ws)Ts[t]={isEnabled:e=>ws[t].some(t=>!!e[t])};const Ms=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ss="undefined"!=typeof window,xs={current:null},Vs={current:!1};const As=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function ks(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||As.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const Cs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Fs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ze,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=X.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,K.render(this.render,!1,!0))};const{latestValues:o,renderState:l}=r;this.latestValues=o,this.baseTarget={...o},this.initialValues=e.initial?{...o}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=ks(e),this.isVariantNode=function(t){return Boolean(ks(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==o[t]&&Ln(e)&&e.set(o[t])}}mount(t){this.current=t,ns.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)),Vs.current||function(){if(Vs.current=!0,Ss)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>xs.current=t.matches;t.addEventListener("change",e),e()}else xs.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||xs.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),j(this.notifyUpdate),j(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Oe.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&K.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ts){const e=Ts[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Cs.length;e++){const n=Cs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(Ln(i))t.addValue(s,i);else if(Ln(r))t.addValue(s,Nn(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,Nn(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Nn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(a(n)||o(n))?n=parseFloat(n):(s=n,!Wn.find(wn(s))&&Vt.test(e)&&(n=Bn(t,e))),this.setBaseTarget(t,Ln(n)?n.get():n)),Ln(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=is(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Ln(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){$n.render(this.render)}}class Ps extends Fs{constructor(){super(...arguments),this.KeyframeResolver=In}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ln(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const Es={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bs=De.length;function Rs(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const n=e[t];if(Oe.has(t))a=!0;else if(z(t))i[t]=n;else{const e=Dn(n,Fn[t]);t.startsWith("origin")?(o=!0,r[t]=e):s[t]=e}}if(e.transform||(a||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<Bs;r++){const a=De[r],o=t[a];if(void 0===o)continue;let l=!0;if(l="number"==typeof o?o===(a.startsWith("scale")?1:0):0===parseFloat(o),!l||n){const t=Dn(o,Fn[a]);l||(i=!1,s+=`${Es[a]||a}(${t}) `),n&&(e[a]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}function Is(t,{style:e,vars:n},s,i){const r=t.style;let a;for(a in e)r[a]=e[a];for(a in i?.applyProjectionStyles(r,s),n)r.setProperty(a,n[a])}function Ds(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Os={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ct.test(t))return t;t=parseFloat(t)}return`${Ds(t,e.target.x)}% ${Ds(t,e.target.y)}%`}},Ns={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Vt.parse(t);if(i.length>5)return s;const r=Vt.createTransformer(t),a="number"!=typeof i[0]?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;i[0+a]/=o,i[1+a]/=l;const u=Ct(o,l,.5);return"number"==typeof i[2+a]&&(i[2+a]/=u),"number"==typeof i[3+a]&&(i[3+a]/=u),r(i)}},$s={borderRadius:{...Os,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Os,borderTopRightRadius:Os,borderBottomLeftRadius:Os,borderBottomRightRadius:Os,boxShadow:Ns};function Ks(t,{layout:e,layoutId:n}){return Oe.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!$s[t]||"opacity"===t)}function js(t,e,n){const{style:s}=t,i={};for(const r in s)(Ln(s[r])||e.style&&Ln(e.style[r])||Ks(r,t)||void 0!==n?.getValue(r)?.liveStyle)&&(i[r]=s[r]);return i}class Ls extends Ps{constructor(){super(...arguments),this.type="html",this.renderInstance=Is}readValueFromInstance(t,e){if(Oe.has(e))return this.projection?.isProjecting?Be(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Re(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(z(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){Rs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return js(t,e,n)}}class Ws extends Fs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Ys={offset:"stroke-dashoffset",array:"stroke-dasharray"},Us={offset:"strokeDashoffset",array:"strokeDasharray"};function Xs(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},l,u,h){if(Rs(t,o,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=h?.transformBox??"fill-box",delete c.transformBox),void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==s&&(c.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Ys:Us;t[r.offset]=ct.transform(-s);const a=ct.transform(e),o=ct.transform(n);t[r.array]=`${a} ${o}`}(c,i,r,a,!1)}const qs=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class zs extends Ps{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ms}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Oe.has(e)){const t=En(e);return t&&t.default||0}return e=qs.has(e)?e:us(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=js(t,e,n);for(const n in t)(Ln(t[n])||Ln(e[n]))&&(s[-1!==De.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}build(t,e,n){Xs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,s){!function(t,e,n,s){Is(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(qs.has(n)?n:us(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function Zs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=jn(t)&&!function(t){return jn(t)&&"svg"===t.tagName}(t)?new zs(e):new Ls(e);n.mount(t),ns.set(t,n)}function _s(t){const e=new Ws({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),ns.set(t,e)}function Hs(t,e,n,s){const r=[];if(function(t,e){return Ln(t)||"number"==typeof t||"string"==typeof t&&!Yn(e)}(t,e))r.push(function(t,e,n){const s=Ln(t)?t:Nn(t);return s.start(ys("",s,e,n)),s.animation}(t,Yn(e)&&e.default||e,n&&n.default||n));else{const a=Un(t,e,s),o=a.length;i(Boolean(o),"No valid elements provided.","no-valid-elements");for(let t=0;t<o;t++){const s=a[t];i(null!==s,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");const l=s instanceof Element?Zs:_s;ns.has(s)||l(s);const u=ns.get(s),h={...n};"delay"in h&&"function"==typeof h.delay&&(h.delay=h.delay(t,o)),r.push(...bs(u,{...e,transition:h},{}))}}return r}function Gs(t,e,n){const s=[],r=function(t,{defaultTransition:e={},...n}={},s,r){const a=e.duration||.3,o=new Map,l=new Map,u={},h=new Map;let c=0,p=0,f=0;for(let n=0;n<t.length;n++){const o=t[n];if("string"==typeof o){h.set(o,p);continue}if(!Array.isArray(o)){h.set(o.name,qn(p,o.at,c,h));continue}let[d,g,y={}]=o;void 0!==y.at&&(p=qn(p,y.at,c,h));let v=0;const b=(t,n,s,o=0,l=0)=>{const u=Jn(t),{delay:h=0,times:c=ge(u),type:d="keyframes",repeat:g,repeatType:y,repeatDelay:b=0,...w}=n;let{ease:T=e.ease||"easeOut",duration:M}=n;const S="function"==typeof h?h(o,l):h,x=u.length,V=nn(d)?d:r?.[d||"keyframes"];if(x<=2&&V){let t=100;if(2===x&&es(u)){const e=u[1]-u[0];t=Math.abs(e)}const e={...w};void 0!==M&&(e.duration=m(M));const n=Ut(e,t,V);T=n.ease,M=n.duration}M??(M=a);const A=p+S;1===c.length&&0===c[0]&&(c[1]=1);const k=c.length-u.length;if(k>0&&fe(c,k),1===u.length&&u.unshift(null),g){i(g<20,"Repeat count too high, must be less than 20","repeat-count-high"),M=Xn(M,g);const t=[...u],e=[...c];T=Array.isArray(T)?[...T]:[T];const n=[...T];for(let s=0;s<g;s++){u.push(...t);for(let i=0;i<t.length;i++)c.push(e[i]+(s+1)),T.push(0===i?"linear":B(n,i-1))}Zn(c,g)}const C=A+M;zn(s,u,T,c,A,C),v=Math.max(S+M,v),f=Math.max(C,f)};if(Ln(d))b(g,y,Gn("default",Hn(d,l)));else{const t=Un(d,g,s,u),e=t.length;for(let n=0;n<e;n++){const s=Hn(t[n],l);for(const t in g)b(g[t],Qn(y,t),Gn(t,s),n,e)}}c=p,p+=v}return l.forEach((t,s)=>{for(const i in t){const r=t[i];r.sort(_n);const a=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:s}=r[t];a.push(n),l.push(d(0,f,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),o.has(s)||o.set(s,{keyframes:{},transition:{}});const h=o.get(s);h.keyframes[i]=a,h.transition[i]={...e,duration:f,ease:u,times:l,...n}}}),o}(t,e,n,{spring:de});return r.forEach(({keyframes:t,transition:e},n)=>{s.push(...Hs(n,t,e))}),s}function Js(e){return function(n,s,i){let r,a=[];if(o=n,Array.isArray(o)&&o.some(Array.isArray))a=Gs(n,s,e);else{const{onComplete:t,...o}=i||{};"function"==typeof t&&(r=t),a=Hs(n,s,o,e)}var o;const l=new fn(a);return r&&l.finished.then(r),e&&(e.animations.push(l),l.finished.then(()=>{t(e.animations,l)})),l}}const Qs=Js();export{Qs as animate,Js as createScopedAnimate};
|
|
1
|
+
function t(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const e=(t,e,n)=>n>e?e:n<t?t:n;function n(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let s=()=>{},i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,e,s)=>{t||"undefined"==typeof console||console.warn(n(e,s))},i=(t,e,s)=>{if(!t)throw new Error(n(e,s))});const r={},a=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);const o=t=>/^0[^.\s]+$/u.test(t);function l(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(t,e)=>n=>e(t(n)),c=(...t)=>t.reduce(h),d=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class p{constructor(){this.subscriptions=[]}add(e){var n,s;return n=this.subscriptions,s=e,-1===n.indexOf(s)&&n.push(s),()=>t(this.subscriptions,e)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const m=t=>1e3*t,f=t=>t/1e3;function g(t,e){return e?t*(1e3/e):0}const y=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function v(t,e,n,s){if(t===e&&n===s)return u;const i=e=>function(t,e,n,s,i){let r,a,o=0;do{a=e+(n-e)/2,r=y(a,s,i)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:y(i(t),e,s)}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,w=t=>e=>1-t(1-e),T=v(.33,1.53,.69,.99),M=w(T),S=b(M),x=t=>(t*=2)<1?.5*M(t):.5*(2-Math.pow(2,-10*(t-1))),V=t=>1-Math.sin(Math.acos(t)),A=w(V),k=b(V),C=v(.42,0,1,1),F=v(0,0,.58,1),P=v(.42,0,.58,1),E=t=>Array.isArray(t)&&"number"!=typeof t[0];function R(t,e){return E(t)?t[((t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t})(0,t.length,e)]:t}const B=t=>Array.isArray(t)&&"number"==typeof t[0],D={linear:u,easeIn:C,easeInOut:P,easeOut:F,circIn:V,circInOut:k,circOut:A,backIn:M,backInOut:S,backOut:T,anticipate:x},I=t=>{if(B(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,r]=t;return v(e,n,s,r)}return"string"==typeof t?(i(void 0!==D[t],`Invalid easing type '${t}'`,"invalid-easing-type"),D[t]):t},O=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],N={value:null,addProjectionMetrics:null};function $(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=O.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,i=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){a.has(e)&&(h.schedule(e),t()),l++,e(o)}const h={schedule:(t,e=!1,r=!1)=>{const o=r&&i?n:s;return e&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{o=t,i?r=!0:(i=!0,[n,s]=[s,n],n.forEach(u),e&&N.value&&N.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,h.process(t)))}};return h}(a,e?n:void 0),t),{}),{setup:l,read:u,resolveKeyframes:h,preUpdate:c,update:d,preRender:p,render:m,postRender:f}=o,g=()=>{const a=r.useManualTiming?i.timestamp:performance.now();n=!1,r.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,l.process(i),u.process(i),h.process(i),c.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:O.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<O.length;e++)o[O[e]].cancel(t)},state:i,steps:o}}const{schedule:K,cancel:j,state:L,steps:W}=$("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0);let Y;function U(){Y=void 0}const X={now:()=>(void 0===Y&&X.set(L.isProcessing||r.useManualTiming?L.timestamp:performance.now()),Y),set:t=>{Y=t,queueMicrotask(U)}},q=t=>e=>"string"==typeof e&&e.startsWith(t),z=q("--"),Z=q("var(--"),_=t=>!!Z(t)&&H.test(t.split("/*")[0].trim()),H=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,G={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},J={...G,transform:t=>e(0,1,t)},Q={...G,default:1},tt=t=>Math.round(1e5*t)/1e5,et=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const nt=/^(?:#[\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&&nt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),it=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,a,o]=s.match(et);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},rt={...G,transform:t=>Math.round((t=>e(0,255,t))(t))},at={test:st("rgb","red"),parse:it("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+rt.transform(t)+", "+rt.transform(e)+", "+rt.transform(n)+", "+tt(J.transform(s))+")"};const ot={test:st("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:at.transform},lt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ut=lt("deg"),ht=lt("%"),ct=lt("px"),dt=lt("vh"),pt=lt("vw"),mt=(()=>({...ht,parse:t=>ht.parse(t)/100,transform:t=>ht.transform(100*t)}))(),ft={test:st("hsl","hue"),parse:it("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ht.transform(tt(e))+", "+ht.transform(tt(n))+", "+tt(J.transform(s))+")"},gt={test:t=>at.test(t)||ot.test(t)||ft.test(t),parse:t=>at.test(t)?at.parse(t):ft.test(t)?ft.parse(t):ot.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?at.transform(t):ft.transform(t),getAnimatableNone:t=>{const e=gt.parse(t);return e.alpha=0,gt.transform(e)}},yt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const vt="number",bt="color",wt=/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 Tt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(wt,t=>(gt.test(t)?(s.color.push(r),i.push(bt),n.push(gt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(vt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:s,types:i}}function Mt(t){return Tt(t).values}function St(t){const{split:e,types:n}=Tt(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+=e===vt?tt(t[r]):e===bt?gt.transform(t[r]):t[r]}return i}}const xt=t=>"number"==typeof t?0:gt.test(t)?gt.getAnimatableNone(t):t;const Vt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(et)?.length||0)+(t.match(yt)?.length||0)>0},parse:Mt,createTransformer:St,getAnimatableNone:function(t){const e=Mt(t);return St(t)(e.map(xt))}};function At(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 kt(t,e){return n=>n>0?e:t}const Ct=(t,e,n)=>t+(e-t)*n,Ft=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Pt=[ot,at,ft];function Et(t){const e=(n=t,Pt.find(t=>t.test(n)));var n;if(s(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===ft&&(i=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,a=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,o=2*n-s;i=At(o,s,t+1/3),r=At(o,s,t),a=At(o,s,t-1/3)}else i=r=a=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*a),alpha:s}}(i)),i}const Rt=(t,e)=>{const n=Et(t),s=Et(e);if(!n||!s)return kt(t,e);const i={...n};return t=>(i.red=Ft(n.red,s.red,t),i.green=Ft(n.green,s.green,t),i.blue=Ft(n.blue,s.blue,t),i.alpha=Ct(n.alpha,s.alpha,t),at.transform(i))},Bt=new Set(["none","hidden"]);function Dt(t,e){return n=>Ct(t,e,n)}function It(t){return"number"==typeof t?Dt:"string"==typeof t?_(t)?kt:gt.test(t)?Rt:$t:Array.isArray(t)?Ot:"object"==typeof t?gt.test(t)?Rt:Nt:kt}function Ot(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>It(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function Nt(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=It(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const $t=(t,e)=>{const n=Vt.createTransformer(e),i=Tt(t),r=Tt(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Bt.has(t)&&!r.values.length||Bt.has(e)&&!i.values.length?function(t,e){return Bt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):c(Ot(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],a=t.indexes[r][s[r]],o=t.values[a]??0;n[i]=o,s[r]++}return n}(i,r),r.values),n):(s(!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"),kt(t,e))};function Kt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ct(t,e,n);return It(t)(t,e)}const jt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>K.update(e,t),stop:()=>j(e),now:()=>L.isProcessing?L.timestamp:X.now()}},Lt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Wt=2e4;function Yt(t){let e=0;let n=t.next(e);for(;!n.done&&e<Wt;)e+=50,n=t.next(e);return e>=Wt?1/0:e}function Ut(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Yt(s),Wt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:f(i)}}function Xt(t,e,n){const s=Math.max(e-5,0);return g(n-t(s),e-s)}const qt=100,zt=10,Zt=1,_t=0,Ht=800,Gt=.3,Jt=.3,Qt={granular:.01,default:2},te={granular:.005,default:.5},ee=.01,ne=10,se=.05,ie=1,re=.001;function ae({duration:t=Ht,bounce:n=Gt,velocity:i=_t,mass:r=Zt}){let a,o;s(t<=m(ne),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=e(se,ie,l),t=e(ee,ne,f(t)),l<1?(a=e=>{const n=e*l,s=n*t,r=n-i,a=le(e,l),o=Math.exp(-s);return re-r/a*o},o=e=>{const n=e*l*t,s=n*i+i,r=Math.pow(l,2)*Math.pow(e,2)*t,o=Math.exp(-n),u=le(Math.pow(e,2),l);return(-a(e)+re>0?-1:1)*((s-r)*o)/u}):(a=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const u=function(t,e,n){let s=n;for(let n=1;n<oe;n++)s-=t(s)/e(s);return s}(a,o,5/t);if(t=m(t),isNaN(u))return{stiffness:qt,damping:zt,duration:t};{const e=Math.pow(u,2)*r;return{stiffness:e,damping:2*l*Math.sqrt(r*e),duration:t}}}const oe=12;function le(t,e){return t*Math.sqrt(1-e*e)}const ue=["duration","bounce"],he=["stiffness","damping","mass"];function ce(t,e){return e.some(e=>void 0!==t[e])}function de(t=Jt,n=Gt){const s="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t;let{restSpeed:i,restDelta:r}=s;const a=s.keyframes[0],o=s.keyframes[s.keyframes.length-1],l={done:!1,value:a},{stiffness:u,damping:h,mass:c,duration:d,velocity:p,isResolvedFromDuration:g}=function(t){let n={velocity:_t,stiffness:qt,damping:zt,mass:Zt,isResolvedFromDuration:!1,...t};if(!ce(t,he)&&ce(t,ue))if(t.visualDuration){const s=t.visualDuration,i=2*Math.PI/(1.2*s),r=i*i,a=2*e(.05,1,1-(t.bounce||0))*Math.sqrt(r);n={...n,mass:Zt,stiffness:r,damping:a}}else{const e=ae(t);n={...n,...e,mass:Zt},n.isResolvedFromDuration=!0}return n}({...s,velocity:-f(s.velocity||0)}),y=p||0,v=h/(2*Math.sqrt(u*c)),b=o-a,w=f(Math.sqrt(u/c)),T=Math.abs(b)<5;let M;if(i||(i=T?Qt.granular:Qt.default),r||(r=T?te.granular:te.default),v<1){const t=le(w,v);M=e=>{const n=Math.exp(-v*w*e);return o-n*((y+v*w*b)/t*Math.sin(t*e)+b*Math.cos(t*e))}}else if(1===v)M=t=>o-Math.exp(-w*t)*(b+(y+w*b)*t);else{const t=w*Math.sqrt(v*v-1);M=e=>{const n=Math.exp(-v*w*e),s=Math.min(t*e,300);return o-n*((y+v*w*b)*Math.sinh(s)+t*b*Math.cosh(s))/t}}const S={calculatedDuration:g&&d||null,next:t=>{const e=M(t);if(g)l.done=t>=d;else{let n=0===t?y:0;v<1&&(n=0===t?m(y):Xt(M,t,e));const s=Math.abs(n)<=i,a=Math.abs(o-e)<=r;l.done=s&&a}return l.value=l.done?o:e,l},toString:()=>{const t=Math.min(Yt(S),Wt),e=Lt(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function pe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===o?l:void 0===l||Math.abs(o-t)<Math.abs(l-t)?o:l;let m=n*e;const f=c+m,g=void 0===a?f:a(f);g!==f&&(m=g-c);const y=t=>-m*Math.exp(-t/s),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let w,T;const M=t=>{var e;(e=d.value,void 0!==o&&e<o||void 0!==l&&e>l)&&(w=t,T=de({keyframes:[d.value,p(d.value)],velocity:Xt(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:h}))};return M(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,b(t),M(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&b(t),d)}}}function me(t,n,{clamp:s=!0,ease:a,mixer:o}={}){const l=t.length;if(i(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const h=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),n=[...n].reverse());const p=function(t,e,n){const s=[],i=n||r.mix||Kt,a=t.length-1;for(let n=0;n<a;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||u:e;r=c(t,r)}s.push(r)}return s}(n,a,o),m=p.length,f=e=>{if(h&&e<t[0])return n[0];let s=0;if(m>1)for(;s<t.length-2&&!(e<t[s+1]);s++);const i=d(t[s],t[s+1],e);return p[s](i)};return s?n=>f(e(t[0],t[l-1],n)):f}function fe(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=d(0,e,s);t.push(Ct(n,1,i))}}function ge(t){const e=[0];return fe(e,t.length-1),e}function ye({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=E(s)?s.map(I):I(s),r={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:ge(e),t),o=me(a,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map(()=>u||P).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}de.applyToOptions=t=>{const e=Ut(t,100,de);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};const ve=t=>null!==t;function be(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(ve),a=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==s?s:r[a]}const we={decay:pe,inertia:pe,tween:ye,keyframes:ye,spring:de};function Te(t){"string"==typeof t.type&&(t.type=we[t.type])}class Me{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 Se=t=>t/100;class xe extends Me{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==X.now()&&this.tick(X.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;Te(t);const{type:e=ye,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:a}=t;const o=e||ye;o!==ye&&"number"!=typeof a[0]&&(this.mixKeyframes=c(Se,Kt(a[0],a[1])),a=[0,100]);const l=o({...t,keyframes:a});"mirror"===i&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Yt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,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,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(null===this.startTime)return s.next(0);const{delay:u=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:g}=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)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(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 b=this.currentTime,w=s;if(c){const t=Math.min(this.currentTime,i)/o;let n=Math.floor(t),s=t%1;!s&&t>=1&&(s=1),1===s&&n--,n=Math.min(n,c+1);Boolean(n%2)&&("reverse"===d?(s=1-s,p&&(s-=p/o)):"mirror"===d&&(w=a)),b=e(0,1,s)*o}const T=v?{done:!1,value:h[0]}:w.next(b);r&&(T.value=r(T.value));let{done:M}=T;v||null===l||(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&M);return S&&m!==pe&&(T.value=be(h,this.options,g,this.speed)),f&&f(T.value),S&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return f(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(this.currentTime)}set time(t){t=m(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?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(X.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=f(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=jt,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(X.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 Ve=t=>180*t/Math.PI,Ae=t=>{const e=Ve(Math.atan2(t[1],t[0]));return Ce(e)},ke={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ae,rotateZ:Ae,skewX:t=>Ve(Math.atan(t[1])),skewY:t=>Ve(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ce=t=>((t%=360)<0&&(t+=360),t),Fe=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Pe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ee={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Fe,scaleY:Pe,scale:t=>(Fe(t)+Pe(t))/2,rotateX:t=>Ce(Ve(Math.atan2(t[6],t[5]))),rotateY:t=>Ce(Ve(Math.atan2(-t[2],t[0]))),rotateZ:Ae,rotate:Ae,skewX:t=>Ve(Math.atan(t[4])),skewY:t=>Ve(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Re(t){return t.includes("scale")?1:0}function Be(t,e){if(!t||"none"===t)return Re(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ee,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=ke,i=e}if(!i)return Re(e);const r=s[e],a=i[1].split(",").map(De);return"function"==typeof r?r(a):a[r]}function De(t){return parseFloat(t.trim())}const Ie=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Oe=(()=>new Set(Ie))(),Ne=t=>t===G||t===ct,$e=new Set(["x","y","z"]),Ke=Ie.filter(t=>!$e.has(t));const je={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Be(e,"x"),y:(t,{transform:e})=>Be(e,"y")};je.translateX=je.x,je.translateY=je.y;const Le=new Set;let We=!1,Ye=!1,Ue=!1;function Xe(){if(Ye){const t=Array.from(Le).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 Ke.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.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)})}Ye=!1,We=!1,Le.forEach(t=>t.complete(Ue)),Le.clear()}function qe(){Le.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ye=!0)})}class ze{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Le.add(this),We||(We=!0,K.read(qe),K.resolveKeyframes(Xe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.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),Le.delete(this)}cancel(){"scheduled"===this.state&&(Le.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Ze=l(()=>void 0!==window.ScrollTimeline),_e={};function He(t,e){const n=l(t);return()=>_e[e]??n()}const Ge=He(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Je=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Qe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Je([0,.65,.55,1]),circOut:Je([.55,0,1,.45]),backIn:Je([.31,.01,.66,-.59]),backOut:Je([.33,1.53,.69,.99])};function tn(t,e){return t?"function"==typeof t?Ge()?Lt(t,e):"ease-out":B(t)?Je(t):Array.isArray(t)?t.map(t=>tn(t,e)||Qe.easeOut):Qe[t]:void 0}function en(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const h={[e]:n};l&&(h.offset=l);const c=tn(o,i);Array.isArray(c)&&(h.easing=c);const d={delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};u&&(d.pseudoElement=u);return t.animate(h,d)}function nn(t){return"function"==typeof t&&"applyToOptions"in t}class sn extends Me{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return nn(t)&&Ge()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=en(e,n,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=be(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(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(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=m(t)}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 Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ze()?(this.animation.timeline=t,u):e(this)}}const rn={anticipate:x,backInOut:S,circInOut:k};function an(t){"string"==typeof t.ease&&t.ease in rn&&(t.ease=rn[t.ease])}class on extends sn{constructor(t){an(t),Te(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:i,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const a=new xe({...r,autoplay:!1}),o=m(this.finishedTime??this.time);e.setWithVelocity(a.sample(o-10).value,a.sample(o).value,10),a.stop()}}const ln=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Vt.test(t)&&"0"!==t||t.startsWith("url(")));function un(t){t.duration=0,t.type="keyframes"}const hn=new Set(["opacity","clipPath","filter","transform"]),cn=l(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class dn extends Me{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:a,name:o,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=X.now();const c={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:o,motionValue:l,element:u,...h},d=u?.KeyframeResolver||ze;this.keyframeResolver=new d(a,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),o,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:h,isHandoff:c,onUpdate:d}=n;this.resolvedAt=X.now(),function(t,e,n,i){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const a=t[t.length-1],o=ln(r,e),l=ln(a,e);return s(o===l,`You are trying to animate ${e} from "${r}" to "${a}". "${o?a:r}" is not an animatable value.`,"value-not-animatable"),!(!o||!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}(t)||("spring"===n||nn(n))&&i)}(t,a,o,l)||(!r.instantAnimations&&h||d?.(be(t,n,e)),t[0]=t[t.length-1],un(n),n.repeat=0);const p={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},m=!c&&function(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a}=t,o=e?.owner?.current;if(!(o instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return cn()&&n&&hn.has(n)&&("transform"!==n||!u)&&!l&&!s&&"mirror"!==i&&0!==r&&"inertia"!==a}(p)?new on({...p,element:p.motionValue.owner.current}):new xe(p);m.finished.then(()=>this.notifyFinished()).catch(u),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ue=!0,qe(),Xe(),Ue=!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()}}class pn{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 mn(this.animations,"duration")}get iterationDuration(){return mn(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 mn(t,e){let n=0;for(let s=0;s<t.length;s++){const i=t[s][e];null!==i&&i>n&&(n=i)}return n}class fn extends pn{then(t,e){return this.finished.finally(t).then(()=>{})}}const gn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yn(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=gn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return a(t)?parseFloat(t):t}return _(r)?yn(r,e,n+1):r}function vn(t,e){return t?.[e]??t?.default??t}const bn=new Set(["width","height","top","left","right","bottom",...Ie]),wn=t=>e=>e.test(t),Tn=[G,ct,ht,ut,pt,dt,{test:t=>"auto"===t,parse:t=>t}],Mn=t=>Tn.find(wn(t));function Sn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||o(t))}const xn=new Set(["brightness","contrast","saturate","opacity"]);function Vn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(et)||[];if(!s)return t;const i=n.replace(s,"");let r=xn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const An=/\b([a-z-]*)\(.*?\)/gu,kn={...Vt,getAnimatableNone:t=>{const e=t.match(An);return e?e.map(Vn).join(" "):t}},Cn={...G,transform:Math.round},Fn={borderWidth:ct,borderTopWidth:ct,borderRightWidth:ct,borderBottomWidth:ct,borderLeftWidth:ct,borderRadius:ct,radius:ct,borderTopLeftRadius:ct,borderTopRightRadius:ct,borderBottomRightRadius:ct,borderBottomLeftRadius:ct,width:ct,maxWidth:ct,height:ct,maxHeight:ct,top:ct,right:ct,bottom:ct,left:ct,inset:ct,insetBlock:ct,insetBlockStart:ct,insetBlockEnd:ct,insetInline:ct,insetInlineStart:ct,insetInlineEnd:ct,padding:ct,paddingTop:ct,paddingRight:ct,paddingBottom:ct,paddingLeft:ct,paddingBlock:ct,paddingBlockStart:ct,paddingBlockEnd:ct,paddingInline:ct,paddingInlineStart:ct,paddingInlineEnd:ct,margin:ct,marginTop:ct,marginRight:ct,marginBottom:ct,marginLeft:ct,marginBlock:ct,marginBlockStart:ct,marginBlockEnd:ct,marginInline:ct,marginInlineStart:ct,marginInlineEnd:ct,backgroundPositionX:ct,backgroundPositionY:ct,...{rotate:ut,rotateX:ut,rotateY:ut,rotateZ:ut,scale:Q,scaleX:Q,scaleY:Q,scaleZ:Q,skew:ut,skewX:ut,skewY:ut,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:J,originX:mt,originY:mt,originZ:ct},zIndex:Cn,fillOpacity:J,strokeOpacity:J,numOctaves:Cn},Pn={...Fn,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:kn,WebkitFilter:kn},En=t=>Pn[t];function Rn(t,e){let n=En(t);return n!==kn&&(n=Vt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Bn=new Set(["auto","none","0"]);class Dn extends ze{constructor(t,e,n,s,i){super(t,e,n,s,i,!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 s=t[n];if("string"==typeof s&&(s=s.trim(),_(s))){const i=yn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!bn.has(n)||2!==t.length)return;const[s,i]=t,r=Mn(s),a=Mn(i);if(r!==a)if(Ne(r)&&Ne(a))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else je[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Sn(t[e]))&&n.push(e);n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!Bn.has(e)&&Tt(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Rn(n,s)}(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=je[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=je[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const In=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class On{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=X.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=X.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 p);const n=this.events[t].add(e);return"change"===t?()=>{n(),K.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=X.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(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 Nn(t,e){return new On(t,e)}const{schedule:$n,cancel:Kn}=$(queueMicrotask,!1);function jn(t){return"object"==typeof(e=t)&&null!==e&&"ownerSVGElement"in t;var e}const Ln=t=>Boolean(t&&t.getVelocity),Wn=[...Tn,gt,Vt];function Yn(t){return"object"==typeof t&&!Array.isArray(t)}function Un(t,e,n,s){return"string"==typeof t&&Yn(e)?function(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Xn(t,e,n){return t*(e+1)}function qn(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):s.get(e)??t}function zn(e,n,s,i,r,a){!function(e,n,s){for(let i=0;i<e.length;i++){const r=e[i];r.at>n&&r.at<s&&(t(e,r),i--)}}(e,r,a);for(let t=0;t<n.length;t++)e.push({value:n[t],at:Ct(r,a,i[t]),easing:R(s,t)})}function Zn(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function _n(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Hn(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Gn(t,e){return e[t]||(e[t]=[]),e[t]}function Jn(t){return Array.isArray(t)?t:[t]}function Qn(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const ts=t=>"number"==typeof t,es=t=>t.every(ts),ns=new WeakMap;function ss(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function is(t,e,n,s){if("function"==typeof e){const[i,r]=ss(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=ss(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function rs(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Nn(n))}function as(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function os(t,e){const n=function(t,e){const n=t.getProps();return is(n,e,n.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){rs(t,e,as(r[e]))}}function ls(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Ln(s)&&s.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}const us=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),hs="data-"+us("framerAppearId");function cs(t){return t.props[hs]}const ds=t=>null!==t;const ps={type:"spring",stiffness:500,damping:25,restSpeed:10},ms={type:"keyframes",duration:.8},fs={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},gs=(t,{keyframes:e})=>e.length>2?ms:Oe.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ps:fs;const ys=(t,e,n,s={},i,a)=>o=>{const l=vn(s,t)||{},u=l.delay||s.delay||0;let{elapsed:h=0}=s;h-=m(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-h,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:a?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:a,repeatDelay:o,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(l)||Object.assign(c,gs(t,c)),c.duration&&(c.duration=m(c.duration)),c.repeatDelay&&(c.repeatDelay=m(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(un(c),0===c.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations)&&(d=!0,un(c),c.delay=0),c.allowFlatten=!l.type&&!l.ease,d&&!a&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ds),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}(c.keyframes,l);if(void 0!==t)return void K.update(()=>{c.onUpdate(t),c.onComplete()})}return l.isSync?new xe(c):new dn(c)};function vs({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function bs(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:a,...o}=e;s&&(r=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const e in o){const s=t.getValue(e,t.latestValues[e]??null),i=o[e];if(void 0===i||u&&vs(u,e))continue;const a={delay:n,...vn(r||{},e)},h=s.get();if(void 0!==h&&!s.isAnimating&&!Array.isArray(i)&&i===h&&!a.velocity)continue;let c=!1;if(window.MotionHandoffAnimation){const n=cs(t);if(n){const t=window.MotionHandoffAnimation(n,e,K);null!==t&&(a.startTime=t,c=!0)}}ls(t,e),s.start(ys(e,s,i,t.shouldReduceMotion&&bn.has(e)?{type:!1}:a,t,c));const d=s.animation;d&&l.push(d)}return a&&Promise.all(l).then(()=>{K.update(()=>{a&&os(t,a)})}),l}const ws={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ts={};for(const t in ws)Ts[t]={isEnabled:e=>ws[t].some(t=>!!e[t])};const Ms=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ss="undefined"!=typeof window,xs={current:null},Vs={current:!1};const As=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function ks(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||As.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const Cs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Fs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ze,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=X.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,K.render(this.render,!1,!0))};const{latestValues:o,renderState:l}=r;this.latestValues=o,this.baseTarget={...o},this.initialValues=e.initial?{...o}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=ks(e),this.isVariantNode=function(t){return Boolean(ks(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==o[t]&&Ln(e)&&e.set(o[t])}}mount(t){this.current=t,ns.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)),Vs.current||function(){if(Vs.current=!0,Ss)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>xs.current=t.matches;t.addEventListener("change",e),e()}else xs.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||xs.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),j(this.notifyUpdate),j(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Oe.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&K.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ts){const e=Ts[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Cs.length;e++){const n=Cs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(Ln(i))t.addValue(s,i);else if(Ln(r))t.addValue(s,Nn(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,Nn(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Nn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(a(n)||o(n))?n=parseFloat(n):(s=n,!Wn.find(wn(s))&&Vt.test(e)&&(n=Rn(t,e))),this.setBaseTarget(t,Ln(n)?n.get():n)),Ln(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=is(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Ln(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){$n.render(this.render)}}class Ps extends Fs{constructor(){super(...arguments),this.KeyframeResolver=Dn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ln(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const Es={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Rs=Ie.length;function Bs(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const n=e[t];if(Oe.has(t))a=!0;else if(z(t))i[t]=n;else{const e=In(n,Fn[t]);t.startsWith("origin")?(o=!0,r[t]=e):s[t]=e}}if(e.transform||(a||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<Rs;r++){const a=Ie[r],o=t[a];if(void 0===o)continue;let l=!0;if(l="number"==typeof o?o===(a.startsWith("scale")?1:0):0===parseFloat(o),!l||n){const t=In(o,Fn[a]);l||(i=!1,s+=`${Es[a]||a}(${t}) `),n&&(e[a]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}function Ds(t,{style:e,vars:n},s,i){const r=t.style;let a;for(a in e)r[a]=e[a];for(a in i?.applyProjectionStyles(r,s),n)r.setProperty(a,n[a])}function Is(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Os={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ct.test(t))return t;t=parseFloat(t)}return`${Is(t,e.target.x)}% ${Is(t,e.target.y)}%`}},Ns={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Vt.parse(t);if(i.length>5)return s;const r=Vt.createTransformer(t),a="number"!=typeof i[0]?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;i[0+a]/=o,i[1+a]/=l;const u=Ct(o,l,.5);return"number"==typeof i[2+a]&&(i[2+a]/=u),"number"==typeof i[3+a]&&(i[3+a]/=u),r(i)}},$s={borderRadius:{...Os,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Os,borderTopRightRadius:Os,borderBottomLeftRadius:Os,borderBottomRightRadius:Os,boxShadow:Ns};function Ks(t,{layout:e,layoutId:n}){return Oe.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!$s[t]||"opacity"===t)}function js(t,e,n){const{style:s}=t,i={};for(const r in s)(Ln(s[r])||e.style&&Ln(e.style[r])||Ks(r,t)||void 0!==n?.getValue(r)?.liveStyle)&&(i[r]=s[r]);return i}class Ls extends Ps{constructor(){super(...arguments),this.type="html",this.renderInstance=Ds}readValueFromInstance(t,e){if(Oe.has(e))return this.projection?.isProjecting?Re(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Be(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(z(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){Bs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return js(t,e,n)}}class Ws extends Fs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Ys={offset:"stroke-dashoffset",array:"stroke-dasharray"},Us={offset:"strokeDashoffset",array:"strokeDasharray"};const Xs=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qs(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},l,u,h){if(Bs(t,o,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=h?.transformBox??"fill-box",delete c.transformBox);for(const t of Xs)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==s&&(c.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Ys:Us;t[r.offset]=ct.transform(-s);const a=ct.transform(e),o=ct.transform(n);t[r.array]=`${a} ${o}`}(c,i,r,a,!1)}const zs=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class Zs extends Ps{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ms}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Oe.has(e)){const t=En(e);return t&&t.default||0}return e=zs.has(e)?e:us(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=js(t,e,n);for(const n in t)(Ln(t[n])||Ln(e[n]))&&(s[-1!==Ie.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}build(t,e,n){qs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,s){!function(t,e,n,s){Ds(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(zs.has(n)?n:us(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function _s(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=jn(t)&&!function(t){return jn(t)&&"svg"===t.tagName}(t)?new Zs(e):new Ls(e);n.mount(t),ns.set(t,n)}function Hs(t){const e=new Ws({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),ns.set(t,e)}function Gs(t,e,n,s){const r=[];if(function(t,e){return Ln(t)||"number"==typeof t||"string"==typeof t&&!Yn(e)}(t,e))r.push(function(t,e,n){const s=Ln(t)?t:Nn(t);return s.start(ys("",s,e,n)),s.animation}(t,Yn(e)&&e.default||e,n&&n.default||n));else{const a=Un(t,e,s),o=a.length;i(Boolean(o),"No valid elements provided.","no-valid-elements");for(let t=0;t<o;t++){const s=a[t];i(null!==s,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");const l=s instanceof Element?_s:Hs;ns.has(s)||l(s);const u=ns.get(s),h={...n};"delay"in h&&"function"==typeof h.delay&&(h.delay=h.delay(t,o)),r.push(...bs(u,{...e,transition:h},{}))}}return r}function Js(t,e,n){const s=[],r=function(t,{defaultTransition:e={},...n}={},s,r){const a=e.duration||.3,o=new Map,l=new Map,u={},h=new Map;let c=0,p=0,f=0;for(let n=0;n<t.length;n++){const o=t[n];if("string"==typeof o){h.set(o,p);continue}if(!Array.isArray(o)){h.set(o.name,qn(p,o.at,c,h));continue}let[d,g,y={}]=o;void 0!==y.at&&(p=qn(p,y.at,c,h));let v=0;const b=(t,n,s,o=0,l=0)=>{const u=Jn(t),{delay:h=0,times:c=ge(u),type:d="keyframes",repeat:g,repeatType:y,repeatDelay:b=0,...w}=n;let{ease:T=e.ease||"easeOut",duration:M}=n;const S="function"==typeof h?h(o,l):h,x=u.length,V=nn(d)?d:r?.[d||"keyframes"];if(x<=2&&V){let t=100;if(2===x&&es(u)){const e=u[1]-u[0];t=Math.abs(e)}const e={...w};void 0!==M&&(e.duration=m(M));const n=Ut(e,t,V);T=n.ease,M=n.duration}M??(M=a);const A=p+S;1===c.length&&0===c[0]&&(c[1]=1);const k=c.length-u.length;if(k>0&&fe(c,k),1===u.length&&u.unshift(null),g){i(g<20,"Repeat count too high, must be less than 20","repeat-count-high"),M=Xn(M,g);const t=[...u],e=[...c];T=Array.isArray(T)?[...T]:[T];const n=[...T];for(let s=0;s<g;s++){u.push(...t);for(let i=0;i<t.length;i++)c.push(e[i]+(s+1)),T.push(0===i?"linear":R(n,i-1))}Zn(c,g)}const C=A+M;zn(s,u,T,c,A,C),v=Math.max(S+M,v),f=Math.max(C,f)};if(Ln(d))b(g,y,Gn("default",Hn(d,l)));else{const t=Un(d,g,s,u),e=t.length;for(let n=0;n<e;n++){const s=Hn(t[n],l);for(const t in g)b(g[t],Qn(y,t),Gn(t,s),n,e)}}c=p,p+=v}return l.forEach((t,s)=>{for(const i in t){const r=t[i];r.sort(_n);const a=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:s}=r[t];a.push(n),l.push(d(0,f,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),o.has(s)||o.set(s,{keyframes:{},transition:{}});const h=o.get(s);h.keyframes[i]=a,h.transition[i]={...e,duration:f,ease:u,times:l,...n}}}),o}(t,e,n,{spring:de});return r.forEach(({keyframes:t,transition:e},n)=>{s.push(...Gs(n,t,e))}),s}function Qs(e){return function(n,s,i){let r,a=[];if(o=n,Array.isArray(o)&&o.some(Array.isArray))a=Js(n,s,e);else{const{onComplete:t,...o}=i||{};"function"==typeof t&&(r=t),a=Gs(n,s,o,e)}var o;const l=new fn(a);return r&&l.finished.then(r),e&&(e.animations.push(l),l.finished.then(()=>{t(e.animations,l)})),l}}const ti=Qs();export{ti as animate,Qs as createScopedAnimate};
|
|
2
2
|
//# sourceMappingURL=size-rollup-animate.js.map
|