motion-dom 12.28.1 → 12.28.2

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.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const i=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],n={value:null,addProjectionMetrics:null};function s(t,s){let o=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>o=!0,u=i.reduce((t,e)=>(t[e]=function(t,e){let i=new Set,s=new Set,o=!1,r=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},u=0;function c(e){a.has(e)&&(h.schedule(e),t()),u++,e(l)}const h={schedule:(t,e=!1,n=!1)=>{const r=n&&o?i:s;return e&&a.add(t),r.has(t)||r.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{l=t,o?r=!0:(o=!0,[i,s]=[s,i],i.forEach(c),e&&n.value&&n.value.frameloop[e].push(u),u=0,i.clear(),o=!1,r&&(r=!1,h.process(t)))}};return h}(l,s?e:void 0),t),{}),{setup:c,read:h,resolveKeyframes:d,preUpdate:p,update:m,preRender:f,render:y,postRender:g}=u,v=()=>{const i=e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now();o=!1,e.MotionGlobalConfig.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(i-a.timestamp,40),1)),a.timestamp=i,a.isProcessing=!0,c.process(a),h.process(a),d.process(a),p.process(a),m.process(a),f.process(a),y.process(a),g.process(a),a.isProcessing=!1,o&&s&&(r=!1,t(v))};return{schedule:i.reduce((e,i)=>{const n=u[i];return e[i]=(e,i=!1,s=!1)=>(o||(o=!0,r=!0,a.isProcessing||t(v)),n.schedule(e,i,s)),e},{}),cancel:t=>{for(let e=0;e<i.length;e++)u[i[e]].cancel(t)},state:a,steps:u}}const{schedule:o,cancel:r,state:a,steps:l}=s("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e.noop,!0);let u;function c(){u=void 0}const h={now:()=>(void 0===u&&h.set(a.isProcessing||e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now()),u),set:t=>{u=t,queueMicrotask(c)}},d={layout:0,mainThread:0,waapi:0},p=t=>e=>"string"==typeof e&&e.startsWith(t),m=p("--"),f=p("var(--"),y=t=>!!f(t)&&g.test(t.split("/*")[0].trim()),g=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function v(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const x={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},T={...x,transform:t=>e.clamp(0,1,t)},w={...x,default:1},b=t=>Math.round(1e5*t)/1e5,S=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const P=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,V=(t,e)=>i=>Boolean("string"==typeof i&&P.test(i)&&i.startsWith(t)||e&&!function(t){return null==t}(i)&&Object.prototype.hasOwnProperty.call(i,e)),A=(t,e,i)=>n=>{if("string"!=typeof n)return n;const[s,o,r,a]=n.match(S);return{[t]:parseFloat(s),[e]:parseFloat(o),[i]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},M={...x,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},D={test:V("rgb","red"),parse:A("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:n=1})=>"rgba("+M.transform(t)+", "+M.transform(e)+", "+M.transform(i)+", "+b(T.transform(n))+")"};const E={test:V("#"),parse:function(t){let e="",i="",n="",s="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),n=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),n=t.substring(3,4),s=t.substring(4,5),e+=e,i+=i,n+=n,s+=s),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}},transform:D.transform},R=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),k=R("deg"),B=R("%"),C=R("px"),j=R("vh"),L=R("vw"),F=(()=>({...B,parse:t=>B.parse(t)/100,transform:t=>B.transform(100*t)}))(),O={test:V("hsl","hue"),parse:A("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:n=1})=>"hsla("+Math.round(t)+", "+B.transform(b(e))+", "+B.transform(b(i))+", "+b(T.transform(n))+")"},I={test:t=>D.test(t)||E.test(t)||O.test(t),parse:t=>D.test(t)?D.parse(t):O.test(t)?O.parse(t):E.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?D.transform(t):O.transform(t),getAnimatableNone:t=>{const e=I.parse(t);return e.alpha=0,I.transform(e)}},U=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const N="number",$="color",W=/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 K(t){const e=t.toString(),i=[],n={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(W,t=>(I.test(t)?(n.color.push(o),s.push($),i.push(I.parse(t))):t.startsWith("var(")?(n.var.push(o),s.push("var"),i.push(t)):(n.number.push(o),s.push(N),i.push(parseFloat(t))),++o,"${}")).split("${}");return{values:i,split:r,indexes:n,types:s}}function z(t){return K(t).values}function Y(t){const{split:e,types:i}=K(t),n=e.length;return t=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],void 0!==t[o]){const e=i[o];s+=e===N?b(t[o]):e===$?I.transform(t[o]):t[o]}return s}}const X=t=>"number"==typeof t?0:I.test(t)?I.getAnimatableNone(t):t;const G={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(S)?.length||0)+(t.match(U)?.length||0)>0},parse:z,createTransformer:Y,getAnimatableNone:function(t){const e=z(t);return Y(t)(e.map(X))}};function q(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function H({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,i/=100;let s=0,o=0,r=0;if(e/=100){const n=i<.5?i*(1+e):i+e-i*e,a=2*i-n;s=q(a,n,t+1/3),o=q(a,n,t),r=q(a,n,t-1/3)}else s=o=r=i;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:n}}function Z(t,e){return i=>i>0?e:t}const _=(t,e,i)=>t+(e-t)*i,J=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},Q=[E,D,O];function tt(t){const i=(n=t,Q.find(t=>t.test(n)));var n;if(e.warning(Boolean(i),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(i))return!1;let s=i.parse(t);return i===O&&(s=H(s)),s}const et=(t,e)=>{const i=tt(t),n=tt(e);if(!i||!n)return Z(t,e);const s={...i};return t=>(s.red=J(i.red,n.red,t),s.green=J(i.green,n.green,t),s.blue=J(i.blue,n.blue,t),s.alpha=_(i.alpha,n.alpha,t),D.transform(s))},it=new Set(["none","hidden"]);function nt(t,e){return it.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}function st(t,e){return i=>_(t,e,i)}function ot(t){return"number"==typeof t?st:"string"==typeof t?y(t)?Z:I.test(t)?et:lt:Array.isArray(t)?rt:"object"==typeof t?I.test(t)?et:at:Z}function rt(t,e){const i=[...t],n=i.length,s=t.map((t,i)=>ot(t)(t,e[i]));return t=>{for(let e=0;e<n;e++)i[e]=s[e](t);return i}}function at(t,e){const i={...t,...e},n={};for(const s in i)void 0!==t[s]&&void 0!==e[s]&&(n[s]=ot(t[s])(t[s],e[s]));return t=>{for(const e in n)i[e]=n[e](t);return i}}const lt=(t,i)=>{const n=G.createTransformer(i),s=K(t),o=K(i);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?it.has(t)&&!o.values.length||it.has(i)&&!s.values.length?nt(t,i):e.pipe(rt(function(t,e){const i=[],n={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][n[o]],a=t.values[r]??0;i[s]=a,n[o]++}return i}(s,o),o.values),n):(e.warning(!0,`Complex values '${t}' and '${i}' 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"),Z(t,i))};function ut(t,e,i){if("number"==typeof t&&"number"==typeof e&&"number"==typeof i)return _(t,e,i);return ot(t)(t,e)}const ct=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>o.update(e,t),stop:()=>r(e),now:()=>a.isProcessing?a.timestamp:h.now()}},ht=(t,e,i=10)=>{let n="";const s=Math.max(Math.round(e/i),2);for(let e=0;e<s;e++)n+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},dt=2e4;function pt(t){let e=0;let i=t.next(e);for(;!i.done&&e<dt;)e+=50,i=t.next(e);return e>=dt?1/0:e}function mt(t,i=100,n){const s=n({...t,keyframes:[0,i]}),o=Math.min(pt(s),dt);return{type:"keyframes",ease:t=>s.next(o*t).value/i,duration:e.millisecondsToSeconds(o)}}function ft(t,i,n){const s=Math.max(i-5,0);return e.velocityPerSecond(n-t(s),i-s)}const yt=100,gt=10,vt=1,xt=0,Tt=800,wt=.3,bt=.3,St={granular:.01,default:2},Pt={granular:.005,default:.5},Vt=.01,At=10,Mt=.05,Dt=1,Et=.001;function Rt({duration:t=Tt,bounce:i=wt,velocity:n=xt,mass:s=vt}){let o,r;e.warning(t<=e.secondsToMilliseconds(At),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-i;a=e.clamp(Mt,Dt,a),t=e.clamp(Vt,At,e.millisecondsToSeconds(t)),a<1?(o=e=>{const i=e*a,s=i*t,o=i-n,r=Bt(e,a),l=Math.exp(-s);return Et-o/r*l},r=e=>{const i=e*a*t,s=i*n+n,r=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=Bt(Math.pow(e,2),a);return(-o(e)+Et>0?-1:1)*((s-r)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const l=function(t,e,i){let n=i;for(let i=1;i<kt;i++)n-=t(n)/e(n);return n}(o,r,5/t);if(t=e.secondsToMilliseconds(t),isNaN(l))return{stiffness:yt,damping:gt,duration:t};{const e=Math.pow(l,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}const kt=12;function Bt(t,e){return t*Math.sqrt(1-e*e)}const Ct=["duration","bounce"],jt=["stiffness","damping","mass"];function Lt(t,e){return e.some(e=>void 0!==t[e])}function Ft(t=bt,i=wt){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:i}:t;let{restSpeed:s,restDelta:o}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:r},{stiffness:u,damping:c,mass:h,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let i={velocity:xt,stiffness:yt,damping:gt,mass:vt,isResolvedFromDuration:!1,...t};if(!Lt(t,jt)&&Lt(t,Ct))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),o=s*s,r=2*e.clamp(.05,1,1-(t.bounce||0))*Math.sqrt(o);i={...i,mass:vt,stiffness:o,damping:r}}else{const e=Rt(t);i={...i,...e,mass:vt},i.isResolvedFromDuration=!0}return i}({...n,velocity:-e.millisecondsToSeconds(n.velocity||0)}),f=p||0,y=c/(2*Math.sqrt(u*h)),g=a-r,v=e.millisecondsToSeconds(Math.sqrt(u/h)),x=Math.abs(g)<5;let T;if(s||(s=x?St.granular:St.default),o||(o=x?Pt.granular:Pt.default),y<1){const t=Bt(v,y);T=e=>{const i=Math.exp(-y*v*e);return a-i*((f+y*v*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===y)T=t=>a-Math.exp(-v*t)*(g+(f+v*g)*t);else{const t=v*Math.sqrt(y*y-1);T=e=>{const i=Math.exp(-y*v*e),n=Math.min(t*e,300);return a-i*((f+y*v*g)*Math.sinh(n)+t*g*Math.cosh(n))/t}}const w={calculatedDuration:m&&d||null,next:t=>{const i=T(t);if(m)l.done=t>=d;else{let n=0===t?f:0;y<1&&(n=0===t?e.secondsToMilliseconds(f):ft(T,t,i));const r=Math.abs(n)<=s,u=Math.abs(a-i)<=o;l.done=r&&u}return l.value=l.done?a:i,l},toString:()=>{const t=Math.min(pt(w),dt),e=ht(e=>w.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return w}function Ot({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=i*e;const f=h+m,y=void 0===r?f:r(f);y!==f&&(m=y-h);const g=t=>-m*Math.exp(-t/n),v=t=>y+g(t),x=t=>{const e=g(t),i=v(t);d.done=Math.abs(e)<=u,d.value=d.done?y:i};let T,w;const b=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(T=t,w=Ft({keyframes:[d.value,p(d.value)],velocity:ft(v,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:c}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,x(t),b(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&x(t),d)}}}function It(t,i,{clamp:n=!0,ease:s,mixer:o}={}){const r=t.length;if(e.invariant(r===i.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>i[0];if(2===r&&i[0]===i[1])return()=>i[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),i=[...i].reverse());const l=function(t,i,n){const s=[],o=n||e.MotionGlobalConfig.mix||ut,r=t.length-1;for(let n=0;n<r;n++){let r=o(t[n],t[n+1]);if(i){const t=Array.isArray(i)?i[n]||e.noop:i;r=e.pipe(t,r)}s.push(r)}return s}(i,s,o),u=l.length,c=n=>{if(a&&n<t[0])return i[0];let s=0;if(u>1)for(;s<t.length-2&&!(n<t[s+1]);s++);const o=e.progress(t[s],t[s+1],n);return l[s](o)};return n?i=>c(e.clamp(t[0],t[r-1],i)):c}function Ut(t,i){const n=t[t.length-1];for(let s=1;s<=i;s++){const o=e.progress(0,i,s);t.push(_(n,1,o))}}function Nt(t){const e=[0];return Ut(e,t.length-1),e}function $t(t,e){return t.map(t=>t*e)}function Wt(t,i){return t.map(()=>i||e.easeInOut).splice(0,t.length-1)}function Kt({duration:t=300,keyframes:i,times:n,ease:s="easeInOut"}){const o=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s),r={done:!1,value:i[0]},a=It($t(n&&n.length===i.length?n:Nt(i),t),i,{ease:Array.isArray(o)?o:Wt(i,o)});return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}Ft.applyToOptions=t=>{const i=mt(t,100,Ft);return t.ease=i.ease,t.duration=e.secondsToMilliseconds(i.duration),t.type="keyframes",t};const zt=t=>null!==t;function Yt(t,{repeat:e,repeatType:i="loop"},n,s=1){const o=t.filter(zt),r=s<0||e&&"loop"!==i&&e%2==1?0:o.length-1;return r&&void 0!==n?n:o[r]}const Xt={decay:Ot,inertia:Ot,tween:Kt,keyframes:Kt,spring:Ft};function Gt(t){"string"==typeof t.type&&(t.type=Xt[t.type])}class qt{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 Ht=t=>t/100;class Zt extends qt{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!==h.now()&&this.tick(h.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},d.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Gt(t);const{type:i=Kt,repeat:n=0,repeatDelay:s=0,repeatType:o,velocity:r=0}=t;let{keyframes:a}=t;const l=i||Kt;l!==Kt&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe(Ht,ut(a[0],a[1])),a=[0,100]);const u=l({...t,keyframes:a});"mirror"===o&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=pt(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,i=!1){const{generator:n,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),i?this.currentTime=t:this.updateTime(t);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x=this.currentTime,T=n;if(h){const t=Math.min(this.currentTime,s)/a;let i=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&i--,i=Math.min(i,h+1);Boolean(i%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(T=r)),x=e.clamp(0,1,n)*a}const w=v?{done:!1,value:c[0]}:T.next(x);o&&(w.value=o(w.value));let{done:b}=w;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==Ot&&(w.value=Yt(c,this.options,y,this.speed)),f&&f(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){t=e.secondsToMilliseconds(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(h.now());const i=this.playbackSpeed!==t;this.playbackSpeed=t,i&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ct,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=e??i),"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(h.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,d.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function _t(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Jt=t=>180*t/Math.PI,Qt=t=>{const e=Jt(Math.atan2(t[1],t[0]));return ee(e)},te={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Qt,rotateZ:Qt,skewX:t=>Jt(Math.atan(t[1])),skewY:t=>Jt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ee=t=>((t%=360)<0&&(t+=360),t),ie=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ne=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),se={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ie,scaleY:ne,scale:t=>(ie(t)+ne(t))/2,rotateX:t=>ee(Jt(Math.atan2(t[6],t[5]))),rotateY:t=>ee(Jt(Math.atan2(-t[2],t[0]))),rotateZ:Qt,rotate:Qt,skewX:t=>Jt(Math.atan(t[4])),skewY:t=>Jt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function oe(t){return t.includes("scale")?1:0}function re(t,e){if(!t||"none"===t)return oe(e);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,s;if(i)n=se,s=i;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=te,s=e}if(!s)return oe(e);const o=n[e],r=s[1].split(",").map(le);return"function"==typeof o?o(r):r[o]}const ae=(t,e)=>{const{transform:i="none"}=getComputedStyle(t);return re(i,e)};function le(t){return parseFloat(t.trim())}const ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ce=(()=>new Set(ue))(),he=t=>t===x||t===C,de=new Set(["x","y","z"]),pe=ue.filter(t=>!de.has(t));const me={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),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")};me.translateX=me.x,me.translateY=me.y;const fe=new Set;let ye=!1,ge=!1,ve=!1;function xe(){if(ge){const t=Array.from(fe).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{const e=function(t){const e=[];return pe.forEach(i=>{const n=t.getValue(i);void 0!==n&&(e.push([i,n.get()]),n.set(i.startsWith("scale")?1:0))}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=i.get(t);e&&e.forEach(([e,i])=>{t.getValue(e)?.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}ge=!1,ye=!1,fe.forEach(t=>t.complete(ve)),fe.clear()}function Te(){fe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ge=!0)})}function we(){ve=!0,Te(),xe(),ve=!1}class be{constructor(t,e,i,n,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=n,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(fe.add(this),ye||(ye=!0,o.read(Te),o.resolveKeyframes(xe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:i,motionValue:n}=this;if(null===t[0]){const s=n?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(i&&e){const n=i.readValue(e,o);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=o),n&&void 0===s&&n.set(t[0])}_t(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),fe.delete(this)}cancel(){"scheduled"===this.state&&(fe.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Se=t=>t.startsWith("--");function Pe(t,e,i){Se(e)?t.style.setProperty(e,i):t.style[e]=i}const Ve=e.memo(()=>void 0!==window.ScrollTimeline),Ae={};function Me(t,i){const n=e.memo(t);return()=>Ae[i]??n()}const De=Me(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Ee=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,Re={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ee([0,.65,.55,1]),circOut:Ee([.55,0,1,.45]),backIn:Ee([.31,.01,.66,-.59]),backOut:Ee([.33,1.53,.69,.99])};function ke(t,i){return t?"function"==typeof t?De()?ht(t,i):"ease-out":e.isBezierDefinition(t)?Ee(t):Array.isArray(t)?t.map(t=>ke(t,i)||Re.easeOut):Re[t]:void 0}function Be(t,e,i,{delay:s=0,duration:o=300,repeat:r=0,repeatType:a="loop",ease:l="easeOut",times:u}={},c=void 0){const h={[e]:i};u&&(h.offset=u);const p=ke(l,o);Array.isArray(p)&&(h.easing=p),n.value&&d.waapi++;const m={delay:s,duration:o,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};c&&(m.pseudoElement=c);const f=t.animate(h,m);return n.value&&f.finished.finally(()=>{d.waapi--}),f}function Ce(t){return"function"==typeof t&&"applyToOptions"in t}function je({type:t,...e}){return Ce(t)&&De()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Le extends qt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:i,name:n,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=t,e.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=je(t);this.animation=Be(i,n,s,u,o),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Yt(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(t):Pe(i,n,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ve()?(this.animation.timeline=t,e.noop):i(this)}}const Fe={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function Oe(t){"string"==typeof t.ease&&t.ease in Fe&&(t.ease=Fe[t.ease])}class Ie extends Le{constructor(t){Oe(t),Gt(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:i,onUpdate:n,onComplete:s,element:o,...r}=this.options;if(!i)return;if(void 0!==t)return void i.set(t);const a=new Zt({...r,autoplay:!1}),l=Math.max(10,h.now()-this.startTime),u=e.clamp(0,10,l-10);i.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const Ue=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!G.test(t)&&"0"!==t||t.startsWith("url(")));function Ne(t){t.duration=0,t.type="keyframes"}const $e=new Set(["opacity","clipPath","filter","transform"]),We=e.memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ke(t){const{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:o,type:r}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return We()&&i&&$e.has(i)&&("transform"!==i||!u)&&!l&&!n&&"mirror"!==s&&0!==o&&"inertia"!==r}class ze extends qt{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=h.now();const d={autoplay:t,delay:e,type:i,repeat:n,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:u,...c},p=u?.KeyframeResolver||be;this.keyframeResolver=new p(r,(t,e,i)=>this.onKeyframesResolved(t,e,d,!i),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,i,n,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:u,onUpdate:c}=n;this.resolvedAt=h.now(),function(t,i,n,s){const o=t[0];if(null===o)return!1;if("display"===i||"visibility"===i)return!0;const r=t[t.length-1],a=Ue(o,i),l=Ue(r,i);return e.warning(a===l,`You are trying to animate ${i} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===n||Ce(n))&&s)}(t,o,r,a)||(!e.MotionGlobalConfig.instantAnimations&&l||c?.(Yt(t,n,i)),t[0]=t[t.length-1],Ne(n),n.repeat=0);const d={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:i,...n,keyframes:t},p=!u&&Ke(d),m=d.motionValue?.owner?.current,f=p?new Ie({...d,element:m}):new Zt(d);f.finished.then(()=>{this.notifyFinished()}).catch(e.noop),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),we()),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 Ye{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 i=0;i<this.animations.length;i++)this.animations[i][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 Xe(this.animations,"duration")}get iterationDuration(){return Xe(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 Xe(t,e){let i=0;for(let n=0;n<t.length;n++){const s=t[n][e];null!==s&&s>i&&(i=s)}return i}class Ge extends Le{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const qe=new WeakMap;function He(t,e,i,n=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*n;return"function"==typeof i?i(o,r):1===s?o*n:a-o*n}const Ze=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _e(t){const e=Ze.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}function Je(t,i,n=1){e.invariant(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=_e(t);if(!s)return;const r=window.getComputedStyle(i).getPropertyValue(s);if(r){const t=r.trim();return e.isNumericalString(t)?parseFloat(t):t}return y(o)?Je(o,i,n+1):o}const Qe={type:"spring",stiffness:500,damping:25,restSpeed:10},ti={type:"keyframes",duration:.8},ei={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ii=(t,{keyframes:e})=>e.length>2?ti:ce.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Qe:ei,ni=t=>null!==t;function si(t,{repeat:e,repeatType:i="loop"},n){const s=t.filter(ni),o=e&&"loop"!==i&&e%2==1?0:s.length-1;return o&&void 0!==n?n:s[o]}function oi(t,e){return t?.[e]??t?.default??t}function ri({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const ai=(t,i,n,s={},r,a)=>l=>{const u=oi(s,t)||{},c=u.delay||s.delay||0;let{elapsed:h=0}=s;h-=e.secondsToMilliseconds(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:i.getVelocity(),...u,delay:-h,onUpdate:t=>{i.set(t),u.onUpdate&&u.onUpdate(t)},onComplete:()=>{l(),u.onComplete&&u.onComplete()},name:t,motionValue:i,element:a?void 0:r};ri(u)||Object.assign(d,ii(t,d)),d.duration&&(d.duration=e.secondsToMilliseconds(d.duration)),d.repeatDelay&&(d.repeatDelay=e.secondsToMilliseconds(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(Ne(d),0===d.delay&&(p=!0)),(e.MotionGlobalConfig.instantAnimations||e.MotionGlobalConfig.skipAnimations)&&(p=!0,Ne(d),d.delay=0),d.allowFlatten=!u.type&&!u.ease,p&&!a&&void 0!==i.get()){const t=si(d.keyframes,u);if(void 0!==t)return void o.update(()=>{d.onUpdate(t),d.onComplete()})}return u.isSync?new Zt(d):new ze(d)};function li(t){const e=[{},{}];return t?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function ui(t,e,i,n){if("function"==typeof e){const[s,o]=li(n);e=e(void 0!==i?i:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=li(n);e=e(void 0!==i?i:t.custom,s,o)}return e}function ci(t,e,i){const n=t.getProps();return ui(n,e,void 0!==i?i:n.custom,t)}const hi=new Set(["width","height","top","left","right","bottom",...ue]),di={current:void 0};class pi{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=h.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=h.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,i){this.events[t]||(this.events[t]=new e.SubscriptionManager);const n=this.events[t].add(i);return"change"===t?()=>{n(),o.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,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}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 di.current&&di.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=h.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}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 mi(t,e){return new pi(t,e)}const fi=t=>Array.isArray(t);function yi(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,mi(i))}function gi(t){return fi(t)?t[t.length-1]||0:t}function vi(t,e){const i=ci(t,e);let{transitionEnd:n={},transition:s={},...o}=i||{};o={...o,...n};for(const e in o){yi(t,e,gi(o[e]))}}const xi=t=>Boolean(t&&t.getVelocity);function Ti(t){return Boolean(xi(t)&&t.add)}function wi(t,i){const n=t.getValue("willChange");if(Ti(n))return n.add(i);if(!n&&e.MotionGlobalConfig.WillChange){const n=new e.MotionGlobalConfig.WillChange("auto");t.addValue("willChange",n),n.add(i)}}function bi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Si="framerAppearId",Pi="data-"+bi(Si);function Vi(t){return t.props[Pi]}function Ai({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}function Mi(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;n&&(r=n);const u=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in l){const n=t.getValue(e,t.latestValues[e]??null),s=l[e];if(void 0===s||c&&Ai(c,e))continue;const a={delay:i,...oi(r||{},e)},h=n.get();if(void 0!==h&&!n.isAnimating&&!Array.isArray(s)&&s===h&&!a.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const i=Vi(t);if(i){const t=window.MotionHandoffAnimation(i,e,o);null!==t&&(a.startTime=t,d=!0)}}wi(t,e),n.start(ai(e,n,s,t.shouldReduceMotion&&hi.has(e)?{type:!1}:a,t,d));const p=n.animation;p&&u.push(p)}return a&&Promise.all(u).then(()=>{o.update(()=>{a&&vi(t,a)})}),u}function Di(t,e,i={}){const n=ci(t,e,"exit"===i.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(s=i.transitionOverride);const o=n?()=>Promise.all(Mi(t,n,i)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,i=0,n=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Di(l,e,{...r,delay:i+("function"==typeof n?0:n)+He(t.variantChildren,l,n,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,n,o,r,a,i)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(i.delay)])}function Ei(t,e,i={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Di(t,e,i));n=Promise.all(s)}else if("string"==typeof e)n=Di(t,e,i);else{const s="function"==typeof e?ci(t,e,i.custom):e;n=Promise.all(Mi(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}const Ri=t=>e=>e.test(t),ki=[x,C,B,k,L,j,{test:t=>"auto"===t,parse:t=>t}],Bi=t=>ki.find(Ri(t));function Ci(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const ji=new Set(["brightness","contrast","saturate","opacity"]);function Li(t){const[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=i.match(S)||[];if(!n)return t;const s=i.replace(n,"");let o=ji.has(e)?1:0;return n!==i&&(o*=100),e+"("+o+s+")"}const Fi=/\b([a-z-]*)\(.*?\)/gu,Oi={...G,getAnimatableNone:t=>{const e=t.match(Fi);return e?e.map(Li).join(" "):t}},Ii={...x,transform:Math.round},Ui={rotate:k,rotateX:k,rotateY:k,rotateZ:k,scale:w,scaleX:w,scaleY:w,scaleZ:w,skew:k,skewX:k,skewY:k,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:T,originX:F,originY:F,originZ:C},Ni={borderWidth:C,borderTopWidth:C,borderRightWidth:C,borderBottomWidth:C,borderLeftWidth:C,borderRadius:C,radius:C,borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomRightRadius:C,borderBottomLeftRadius:C,width:C,maxWidth:C,height:C,maxHeight:C,top:C,right:C,bottom:C,left:C,inset:C,insetBlock:C,insetBlockStart:C,insetBlockEnd:C,insetInline:C,insetInlineStart:C,insetInlineEnd:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,paddingBlock:C,paddingBlockStart:C,paddingBlockEnd:C,paddingInline:C,paddingInlineStart:C,paddingInlineEnd:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,marginBlock:C,marginBlockStart:C,marginBlockEnd:C,marginInline:C,marginInlineStart:C,marginInlineEnd:C,backgroundPositionX:C,backgroundPositionY:C,...Ui,zIndex:Ii,fillOpacity:T,strokeOpacity:T,numOctaves:Ii},$i={...Ni,color:I,backgroundColor:I,outlineColor:I,fill:I,stroke:I,borderColor:I,borderTopColor:I,borderRightColor:I,borderBottomColor:I,borderLeftColor:I,filter:Oi,WebkitFilter:Oi},Wi=t=>$i[t];function Ki(t,e){let i=Wi(t);return i!==Oi&&(i=G),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const zi=new Set(["auto","none","0"]);class Yi extends be{constructor(t,e,i,n,s){super(t,e,i,n,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i<t.length;i++){let n=t[i];if("string"==typeof n&&(n=n.trim(),y(n))){const s=Je(n,e.current);void 0!==s&&(t[i]=s),i===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!hi.has(i)||2!==t.length)return;const[n,s]=t,o=Bi(n),r=Bi(s);if(v(n)!==v(s)&&me[i])this.needsMeasurement=!0;else if(o!==r)if(he(o)&&he(r))for(let e=0;e<t.length;e++){const i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else me[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++)(null===t[e]||Ci(t[e]))&&i.push(e);i.length&&function(t,e,i){let n,s=0;for(;s<t.length&&!n;){const e=t[s];"string"==typeof e&&!zi.has(e)&&K(e).values.length&&(n=t[s]),s++}if(n&&i)for(const s of e)t[s]=Ki(i,n)}(t,i,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:i}=this;if(!t||!t.current)return;"height"===i&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=me[i](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const n=e[e.length-1];void 0!==n&&t.getValue(i,n).jump(n,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:i}=this;if(!t||!t.current)return;const n=t.getValue(e);n&&n.jump(this.measuredOrigin,!1);const s=i.length-1,o=i[s];i[s]=me[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,i])=>{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}const Xi=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","backgroundPositionX","backgroundPositionY"]);const Gi=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),qi=new Set(["opacity","clipPath","filter","transform"]);function Hi(t,e,i){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let n=document;e&&(n=e.current);const s=i?.[t]??n.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Zi(t){return(e,i)=>{const n=Hi(e),s=[];for(const e of n){const n=t(e,i);s.push(n)}return()=>{for(const t of s)t()}}}const _i=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class Ji{constructor(){this.latest={},this.values=new Map}set(t,e,i,n,s=!0){const a=this.values.get(t);a&&a.onRemove();const l=()=>{const n=e.get();this.latest[t]=s?_i(n,Ni[t]):n,i&&o.render(i)};l();const u=e.on("change",l);n&&e.addDependent(n);const c=()=>{u(),i&&r(i),this.values.delete(t),n&&e.removeDependent(n)};return this.values.set(t,{value:e,onRemove:c}),c}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function Qi(t){const e=new WeakMap,i=[];return(n,s)=>{const o=e.get(n)??new Ji;e.set(n,o);for(const e in s){const r=s[e],a=t(n,o,e,r);i.push(a)}return()=>{for(const t of i)t()}}}const tn=(t,e,i,n)=>{const s=function(t,e){if(!(e in t))return!1;const i=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return i&&"function"==typeof i.set}(t,i),o=s?i:i.startsWith("data")||i.startsWith("aria")?bi(i):i,r=s?()=>{t[o]=e.latest[i]}:()=>{const n=e.latest[i];null==n?t.removeAttribute(o):t.setAttribute(o,String(n))};return e.set(i,n,r)},en=Zi(Qi(tn)),nn=Qi((t,e,i,n)=>e.set(i,n,()=>{t[i]=e.latest[i]},void 0,!1));function sn(t){return e.isObject(t)&&"offsetHeight"in t}const on={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const rn=new Set(["originX","originY","originZ"]),an=(t,e,i,n)=>{let s,o;return ce.has(i)?(e.get("transform")||(sn(t)||e.get("transformBox")||an(t,e,"transformBox",new pi("fill-box")),e.set("transform",new pi("none"),()=>{t.style.transform=function(t){let e="",i=!0;for(let n=0;n<ue.length;n++){const s=ue[n],o=t.latest[s];if(void 0===o)continue;let r=!0;if("number"==typeof o)r=o===(s.startsWith("scale")?1:0);else{const t=parseFloat(o);r=s.startsWith("scale")?1===t:0===t}r||(i=!1,e+=`${on[s]||s}(${t.latest[s]}) `)}return i?"none":e.trim()}(e)})),o=e.get("transform")):rn.has(i)?(e.get("transformOrigin")||e.set("transformOrigin",new pi(""),()=>{const i=e.latest.originX??"50%",n=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${i} ${n} ${s}`}),o=e.get("transformOrigin")):s=Se(i)?()=>{t.style.setProperty(i,e.latest[i])}:()=>{t.style[i]=e.latest[i]},e.set(i,n,s,o)},ln=Zi(Qi(an));const un=Zi(Qi((t,e,i,n)=>{if(i.startsWith("path"))return function(t,e,i,n){return o.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===i?e.set(i,n,()=>{const n=e.latest[i];t.setAttribute("stroke-dashoffset",""+-n)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new pi("1 1"),()=>{const{pathLength:i=1,pathSpacing:n}=e.latest;t.setAttribute("stroke-dasharray",`${i} ${n??1-Number(i)}`)}),e.set(i,n,void 0,e.get("stroke-dasharray")))}(t,e,i,n);if(i.startsWith("attr"))return tn(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(i),n);return(i in t.style?an:tn)(t,e,i,n)}));const{schedule:cn,cancel:hn}=s(queueMicrotask,!1),dn={x:!1,y:!1};function pn(){return dn.x||dn.y}function mn(t,e){const i=Hi(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function fn(t){return!("touch"===t.pointerType||pn())}const yn=(t,e)=>!!e&&(t===e||yn(t,e.parentElement)),gn=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,vn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function xn(t){return vn.has(t.tagName)||!0===t.isContentEditable}const Tn=new WeakSet;function wn(t){return e=>{"Enter"===e.key&&t(e)}}function bn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Sn(t){return gn(t)&&!pn()}function Pn(t){return e.isObject(t)&&"ownerSVGElement"in t}const Vn=new WeakMap;let An;const Mn=(t,e,i)=>(n,s)=>s&&s[0]?s[0][t+"Size"]:Pn(n)&&"getBBox"in n?n.getBBox()[e]:n[i],Dn=Mn("inline","width","offsetWidth"),En=Mn("block","height","offsetHeight");function Rn({target:t,borderBoxSize:e}){Vn.get(t)?.forEach(i=>{i(t,{get width(){return Dn(t,e)},get height(){return En(t,e)}})})}function kn(t){t.forEach(Rn)}function Bn(t,e){An||"undefined"!=typeof ResizeObserver&&(An=new ResizeObserver(kn));const i=Hi(t);return i.forEach(t=>{let i=Vn.get(t);i||(i=new Set,Vn.set(t,i)),i.add(e),An?.observe(t)}),()=>{i.forEach(t=>{const i=Vn.get(t);i?.delete(e),i?.size||An?.unobserve(t)})}}const Cn=new Set;let jn;function Ln(t){return Cn.add(t),jn||(jn=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Cn.forEach(e=>e(t))},window.addEventListener("resize",jn)),()=>{Cn.delete(t),Cn.size||"function"!=typeof jn||(window.removeEventListener("resize",jn),jn=void 0)}}function Fn(){const{value:t}=n;null!==t?(t.frameloop.rate.push(a.delta),t.animations.mainThread.push(d.mainThread),t.animations.waapi.push(d.waapi),t.animations.layout.push(d.layout)):r(Fn)}function On(t){return t.reduce((t,e)=>t+e,0)/t.length}function In(t,e=On){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const Un=t=>Math.round(1e3/t);function Nn(){n.value=null,n.addProjectionMetrics=null}function $n(){const{value:t}=n;if(!t)throw new Error("Stats are not being measured");Nn(),r(Fn);const e={frameloop:{setup:In(t.frameloop.setup),rate:In(t.frameloop.rate),read:In(t.frameloop.read),resolveKeyframes:In(t.frameloop.resolveKeyframes),preUpdate:In(t.frameloop.preUpdate),update:In(t.frameloop.update),preRender:In(t.frameloop.preRender),render:In(t.frameloop.render),postRender:In(t.frameloop.postRender)},animations:{mainThread:In(t.animations.mainThread),waapi:In(t.animations.waapi),layout:In(t.animations.layout)},layoutProjection:{nodes:In(t.layoutProjection.nodes),calculatedTargetDeltas:In(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:In(t.layoutProjection.calculatedProjections)}},{rate:i}=e.frameloop;return i.min=Un(i.min),i.max=Un(i.max),i.avg=Un(i.avg),[i.min,i.max]=[i.max,i.min],e}function Wn(t){return Pn(t)&&"svg"===t.tagName}function Kn(t,e){if("first"===t)return 0;{const i=e-1;return"last"===t?i:i/2}}function zn(...t){const e=!Array.isArray(t[0]),i=e?0:-1,n=t[0+i],s=It(t[1+i],t[2+i],t[3+i]);return e?s(n):s}function Yn(t,e){const i=mi(xi(t)?t.get():t);return Xn(i,t,e),i}function Xn(t,e,i={}){const n=t.get();let s,r=null,a=n;const l="string"==typeof n?n.replace(/[\d.-]/g,""):void 0,u=()=>{r&&(r.stop(),r=null)};if(t.attach((e,n)=>{a=e,s=t=>n(Gn(t,l)),o.postRender(()=>{(()=>{u();const e=qn(t.get()),n=qn(a);e!==n&&(r=new Zt({keyframes:[e,n],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...i,onUpdate:s}))})(),t.events.animationStart?.notify(),r?.then(()=>{t.events.animationComplete?.notify()})})},u),xi(e)){const i=e.on("change",e=>t.set(Gn(e,l))),n=t.on("destroy",i);return()=>{i(),n()}}return u}function Gn(t,e){return e?t+e:t}function qn(t){return"number"==typeof t?t:parseFloat(t)}function Hn(t){const e=[];di.current=e;const i=t();di.current=void 0;const n=mi(i);return function(t,e,i){const n=()=>e.set(i()),s=()=>o.preRender(n,!1,!0),a=t.map(t=>t.on("change",s));e.on("destroy",()=>{a.forEach(t=>t()),r(n)})}(e,n,t),n}const Zn=[...ki,I,G],_n=t=>Zn.find(Ri(t));function Jn(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let Qn={},ts=null;const es=(t,e)=>{Qn[t]=e},is=()=>{ts||(ts=document.createElement("style"),ts.id="motion-view");let t="";for(const e in Qn){const i=Qn[e];t+=`${e} {\n`;for(const[e,n]of Object.entries(i))t+=` ${e}: ${n};\n`;t+="}\n"}ts.textContent=t,document.head.appendChild(ts),Qn={}},ns=()=>{ts&&ts.parentElement&&ts.parentElement.removeChild(ts)};function ss(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function os(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}function rs(){return document.getAnimations().filter(os)}const as=["layout","enter","exit","new","old"];function ls(t){const{update:i,targets:n,options:s}=t;if(!document.startViewTransition)return new Promise(async t=>{await i(),t(new Ye([]))});(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||es(":root",{"view-transition-name":"none"}),es("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),is();const o=document.startViewTransition(async()=>{await i()});return o.finished.finally(()=>{ns()}),new Promise(t=>{o.ready.then(()=>{const i=rs(),o=[];n.forEach((t,i)=>{for(const n of as){if(!t[n])continue;const{keyframes:r,options:a}=t[n];for(let[t,l]of Object.entries(r)){if(!l)continue;const r={...oi(s,t),...oi(a,t)},u=Jn(n);if("opacity"===t&&!Array.isArray(l)){l=["new"===u?0:1,l]}"function"==typeof r.delay&&(r.delay=r.delay(0,1)),r.duration&&(r.duration=e.secondsToMilliseconds(r.duration)),r.delay&&(r.delay=e.secondsToMilliseconds(r.delay));const c=new Le({...r,element:document.documentElement,name:t,pseudoElement:`::view-transition-${u}(${i})`,keyframes:l});o.push(c)}}});for(const t of i){if("finished"===t.playState)continue;const{effect:i}=t;if(!(i&&i instanceof KeyframeEffect))continue;const{pseudoElement:r}=i;if(!r)continue;const a=ss(r);if(!a)continue;const l=n.get(a.layer);if(l)us(l,"enter")&&us(l,"exit")&&i.getKeyframes().some(t=>t.mixBlendMode)?o.push(new Ge(t)):t.cancel();else{const n="group"===a.type?"layout":"";let r={...oi(s,n)};r.duration&&(r.duration=e.secondsToMilliseconds(r.duration)),r=je(r);const l=ke(r.ease,r.duration);i.updateTiming({delay:e.secondsToMilliseconds(r.delay??0),duration:r.duration,easing:l}),o.push(new Ge(t))}}t(new Ye(o))})})}function us(t,e){return t?.[e]?.keyframes.opacity}let cs=[],hs=null;function ds(){hs=null;const[t]=cs;var i;t&&(i=t,e.removeItem(cs,i),hs=i,ls(i).then(t=>{i.notifyReady(t),t.finished.finally(ds)}))}function ps(){for(let t=cs.length-1;t>=0;t--){const e=cs[t],{interrupt:i}=e.options;if("immediate"===i){const i=cs.slice(0,t+1).map(t=>t.update),n=cs.slice(t+1);e.update=()=>{i.forEach(t=>t())},cs=[e,...n];break}}hs&&"immediate"!==cs[0]?.options.interrupt||ds()}class ms{constructor(t,i={}){var n;this.currentSubject="root",this.targets=new Map,this.notifyReady=e.noop,this.readyPromise=new Promise(t=>{this.notifyReady=t}),this.update=t,this.options={interrupt:"wait",...i},n=this,cs.push(n),cn.render(ps)}get(t){return this.currentSubject=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,i={}){const{currentSubject:n,targets:s}=this;s.has(n)||s.set(n,{});s.get(n)[t]={keyframes:e,options:i}}then(t,e){return this.readyPromise.then(t,e)}}const fs=()=>({translate:0,scale:1,origin:0,originPoint:0}),ys=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),gs=()=>({min:0,max:0}),vs=()=>({x:{min:0,max:0},y:{min:0,max:0}}),xs={current:null},Ts={current:!1},ws="undefined"!=typeof window;function bs(){if(Ts.current=!0,ws)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>xs.current=t.matches;t.addEventListener("change",e),e()}else xs.current=!1}const Ss=new WeakMap;function Ps(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Vs(t){return"string"==typeof t||Array.isArray(t)}const As=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ms=["initial",...As];function Ds(t){return Ps(t.animate)||Ms.some(e=>Vs(t[e]))}function Es(t){return Boolean(Ds(t)||t.variants)}function Rs(t,e,i){for(const n in e){const s=e[n],o=i[n];if(xi(s))t.addValue(n,s);else if(xi(o))t.addValue(n,mi(s,{owner:t}));else if(o!==s)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(n);t.addValue(n,mi(void 0!==e?e:s,{owner:t}))}}for(const n in i)void 0===e[n]&&t.removeValue(n);return e}const ks=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Bs={};class Cs{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:n,blockInitialAnimation:s,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=be,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=h.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,o.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=a,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=Ds(e),this.isVariantNode=Es(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==l[t]&&xi(e)&&e.set(l[t])}}mount(t){this.current=t,Ss.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Ts.current||bs(),this.shouldReduceMotion=xs.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),r(this.notifyUpdate),r(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 i=ce.has(t);i&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&o.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),s&&s(),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 Bs){const e=Bs[t];if(!e)continue;const{isEnabled:i,Feature:n}=e;if(!this.features[t]&&n&&i(this.props)&&(this.features[t]=new n(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<ks.length;e++){const i=ks[e];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const n=t["on"+i];n&&(this.propEventSubscriptions[i]=this.on(i,n))}this.prevMotionValues=Rs(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 i=this.values.get(t);e!==i&&(i&&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 i=this.values.get(t);return void 0===i&&void 0!==e&&(i=mi(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,i){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(e.isNumericalString(n)||e.isZeroValueString(n))?n=parseFloat(n):!_n(n)&&G.test(i)&&(n=Ki(t,i)),this.setBaseTarget(t,xi(n)?n.get():n)),xi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let i;if("string"==typeof e||"object"==typeof e){const n=ui(this.props,e,this.presenceContext?.custom);n&&(i=n[t])}if(e&&void 0!==i)return i;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||xi(n)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:n}on(t,i){return this.events[t]||(this.events[t]=new e.SubscriptionManager),this.events[t].add(i)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){cn.render(this.render)}}class js extends Cs{constructor(){super(...arguments),this.KeyframeResolver=Yi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const i=t.style;return i?i[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;xi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Ls({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function Fs(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}function Os(t){return void 0===t||1===t}function Is({scale:t,scaleX:e,scaleY:i}){return!Os(t)||!Os(e)||!Os(i)}function Us(t){return Is(t)||Ns(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ns(t){return $s(t.x)||$s(t.y)}function $s(t){return t&&"0%"!==t}function Ws(t,e,i){return i+e*(t-i)}function Ks(t,e,i,n,s){return void 0!==s&&(t=Ws(t,s,n)),Ws(t,i,n)+e}function zs(t,e=0,i=1,n,s){t.min=Ks(t.min,e,i,n,s),t.max=Ks(t.max,e,i,n,s)}function Ys(t,{x:e,y:i}){zs(t.x,e.translate,e.scale,e.originPoint),zs(t.y,i.translate,i.scale,i.originPoint)}const Xs=.999999999999,Gs=1.0000000000001;function qs(t,e,i,n=!1){const s=i.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=i[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(n&&o.options.layoutScroll&&o.scroll&&o!==o.root&&_s(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Ys(t,r)),n&&Us(o.latestValues)&&_s(t,o.latestValues))}e.x<Gs&&e.x>Xs&&(e.x=1),e.y<Gs&&e.y>Xs&&(e.y=1)}function Hs(t,e){t.min=t.min+e,t.max=t.max+e}function Zs(t,e,i,n,s=.5){zs(t,e,i,_(t.min,t.max,s),n)}function _s(t,e){Zs(t.x,e.x,e.scaleX,e.scale,e.originX),Zs(t.y,e.y,e.scaleY,e.scale,e.originY)}function Js(t,e){return Ls(Fs(t.getBoundingClientRect(),e))}const Qs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},to=ue.length;function eo(t,e,i){let n="",s=!0;for(let o=0;o<to;o++){const r=ue[o],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||i){const t=_i(a,Ni[r]);if(!l){s=!1;n+=`${Qs[r]||r}(${t}) `}i&&(e[r]=t)}}return n=n.trim(),i?n=i(e,s?"":n):s&&(n="none"),n}function io(t,e,i){const{style:n,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const i=e[t];if(ce.has(t))r=!0;else if(m(t))s[t]=i;else{const e=_i(i,Ni[t]);t.startsWith("origin")?(a=!0,o[t]=e):n[t]=e}}if(e.transform||(r||i?n.transform=eo(e,t.transform,i):n.transform&&(n.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:i=0}=o;n.transformOrigin=`${t} ${e} ${i}`}}function no(t,{style:e,vars:i},n,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,n),i)o.setProperty(r,i[r])}function so(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const oo={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!C.test(t))return t;t=parseFloat(t)}return`${so(t,e.target.x)}% ${so(t,e.target.y)}%`}},ro={correct:(t,{treeScale:e,projectionDelta:i})=>{const n=t,s=G.parse(t);if(s.length>5)return n;const o=G.createTransformer(t),r="number"!=typeof s[0]?1:0,a=i.x.scale*e.x,l=i.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const u=_(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=u),"number"==typeof s[3+r]&&(s[3+r]/=u),o(s)}},ao={borderRadius:{...oo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:oo,borderTopRightRadius:oo,borderBottomLeftRadius:oo,borderBottomRightRadius:oo,boxShadow:ro};function lo(t){for(const e in t)ao[e]=t[e],m(e)&&(ao[e].isCSSVariable=!0)}function uo(t,{layout:e,layoutId:i}){return ce.has(t)||t.startsWith("origin")||(e||void 0!==i)&&(!!ao[t]||"opacity"===t)}function co(t,e,i){const n=t.style,s=e?.style,o={};if(!n)return o;for(const e in n)(xi(n[e])||s&&xi(s[e])||uo(e,t)||void 0!==i?.getValue(e)?.liveStyle)&&(o[e]=n[e]);return o}class ho extends js{constructor(){super(...arguments),this.type="html",this.renderInstance=no}readValueFromInstance(t,e){if(ce.has(e))return this.projection?.isProjecting?oe(e):ae(t,e);{const n=(i=t,window.getComputedStyle(i)),s=(m(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof s?s.trim():s}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return Js(t,e)}build(t,e,i){io(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return co(t,e,i)}}const po={offset:"stroke-dashoffset",array:"stroke-dasharray"},mo={offset:"strokeDashoffset",array:"strokeDasharray"};function fo(t,e,i=1,n=0,s=!0){t.pathLength=1;const o=s?po:mo;t[o.offset]=""+-n,t[o.array]=`${e} ${i}`}const yo=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function go(t,{attrX:e,attrY:i,attrScale:n,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,u,c){if(io(t,a,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox);for(const t of yo)void 0!==h[t]&&(d[t]=h[t],delete h[t]);void 0!==e&&(h.x=e),void 0!==i&&(h.y=i),void 0!==n&&(h.scale=n),void 0!==s&&fo(h,s,o,r,!1)}const vo=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"]),xo=t=>"string"==typeof t&&"svg"===t.toLowerCase();function To(t,e,i,n){no(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(vo.has(i)?i:bi(i),e.attrs[i])}function wo(t,e,i){const n=co(t,e,i);for(const i in t)if(xi(t[i])||xi(e[i])){n[-1!==ue.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=t[i]}return n}const bo=Ms.length;function So(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&So(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let i=0;i<bo;i++){const n=Ms[i],s=t.props[n];(Vs(s)||!1===s)&&(e[n]=s)}return e}function Po(t,e){if(!Array.isArray(e))return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}const Vo=[...As].reverse(),Ao=As.length;function Mo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Po(e,t)}function Do(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Eo(){return{animate:Do(!0),whileInView:Do(),whileHover:Do(),whileTap:Do(),whileDrag:Do(),whileFocus:Do(),exit:Do()}}function Ro(t,e){t.min=e.min,t.max=e.max}function ko(t,e){Ro(t.x,e.x),Ro(t.y,e.y)}function Bo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Co(t){return t.max-t.min}function jo(t,e,i){return Math.abs(t-e)<=i}function Lo(t,e,i,n=.5){t.origin=n,t.originPoint=_(e.min,e.max,t.origin),t.scale=Co(i)/Co(e),t.translate=_(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Fo(t,e,i,n){Lo(t.x,e.x,i.x,n?n.originX:void 0),Lo(t.y,e.y,i.y,n?n.originY:void 0)}function Oo(t,e,i){t.min=i.min+e.min,t.max=t.min+Co(e)}function Io(t,e,i){Oo(t.x,e.x,i.x),Oo(t.y,e.y,i.y)}function Uo(t,e,i){t.min=e.min-i.min,t.max=t.min+Co(e)}function No(t,e,i){Uo(t.x,e.x,i.x),Uo(t.y,e.y,i.y)}function $o(t,e,i,n,s){return t=Ws(t-=e,1/i,n),void 0!==s&&(t=Ws(t,1/s,n)),t}function Wo(t,e=0,i=1,n=.5,s,o=t,r=t){if(B.test(e)){e=parseFloat(e);e=_(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=_(o.min,o.max,n);t===o&&(a-=e),t.min=$o(t.min,e,i,a,s),t.max=$o(t.max,e,i,a,s)}function Ko(t,e,[i,n,s],o,r){Wo(t,e[i],e[n],e[s],e.scale,o,r)}const zo=["x","scaleX","originX"],Yo=["y","scaleY","originY"];function Xo(t,e,i,n){Ko(t.x,e,zo,i?i.x:void 0,n?n.x:void 0),Ko(t.y,e,Yo,i?i.y:void 0,n?n.y:void 0)}function Go(t){return 0===t.translate&&1===t.scale}function qo(t){return Go(t.x)&&Go(t.y)}function Ho(t,e){return t.min===e.min&&t.max===e.max}function Zo(t,e){return Ho(t.x,e.x)&&Ho(t.y,e.y)}function _o(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Jo(t,e){return _o(t.x,e.x)&&_o(t.y,e.y)}function Qo(t){return Co(t.x)/Co(t.y)}function tr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function er(t){return[t("x"),t("y")]}function ir(t,e,i){let n="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=i?.z||0;if((s||o||r)&&(n=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(n+=`scale(${1/e.x}, ${1/e.y}) `),i){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=i;t&&(n=`perspective(${t}px) ${n}`),e&&(n+=`rotate(${e}deg) `),s&&(n+=`rotateX(${s}deg) `),o&&(n+=`rotateY(${o}deg) `),r&&(n+=`skewX(${r}deg) `),a&&(n+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(n+=`scale(${a}, ${l})`),n||"none"}const nr=["TopLeft","TopRight","BottomLeft","BottomRight"],sr=nr.length,or=t=>"string"==typeof t?parseFloat(t):t,rr=t=>"number"==typeof t||C.test(t);function ar(t,e,i,n,s,o){s?(t.opacity=_(0,i.opacity??1,ur(n)),t.opacityExit=_(e.opacity??1,0,cr(n))):o&&(t.opacity=_(e.opacity??1,i.opacity??1,n));for(let s=0;s<sr;s++){const o=`border${nr[s]}Radius`;let r=lr(e,o),a=lr(i,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||rr(r)===rr(a)?(t[o]=Math.max(_(or(r),or(a),n),0),(B.test(a)||B.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||i.rotate)&&(t.rotate=_(e.rotate||0,i.rotate||0,n))}function lr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ur=hr(0,.5,e.circOut),cr=hr(.5,.95,e.noop);function hr(t,i,n){return s=>s<t?0:s>i?1:n(e.progress(t,i,s))}function dr(t,e,i){const n=xi(t)?t:mi(t);return n.start(ai("",n,e,i)),n.animation}function pr(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}const mr=(t,e)=>t.depth-e.depth;class fr{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(mr),this.isDirty=!1,this.children.forEach(t)}}function yr(t,e){const i=h.now(),n=({timestamp:s})=>{const o=s-i;o>=e&&(r(n),t(o-e))};return o.setup(n,!0),()=>r(n)}function gr(t){return xi(t)?t.get():t}class vr{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t),t.scheduleRender()}remove(t){if(e.removeItem(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let i;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){i=e;break}}return!!i&&(this.promote(i),!0)}promote(t,e){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:n}=t.options;!1===n&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:i}=t;e.onExitComplete&&e.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const xr={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Tr={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},wr=["","X","Y","Z"];let br=0;function Sr(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function Pr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=Vi(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",o,!(e||n))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&Pr(n)}function Vr({attachResizeListener:t,defaultParent:i,measureScroll:s,checkIsScrollRoot:u,resetTransform:c}){return class{constructor(t={},e=i?.()){this.id=br++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,n.value&&(Tr.nodes=Tr.calculatedTargetDeltas=Tr.calculatedProjections=0),this.nodes.forEach(Dr),this.nodes.forEach(Lr),this.nodes.forEach(Fr),this.nodes.forEach(Er),n.addProjectionMetrics&&n.addProjectionMetrics(Tr)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new fr)}addEventListener(t,i){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new e.SubscriptionManager),this.eventHandlers.get(t).add(i)}notifyListeners(t,...e){const i=this.eventHandlers.get(t);i&&i.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=Pn(e)&&!Wn(e),this.instance=e;const{layoutId:i,layout:n,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(n||i)&&(this.isLayoutDirty=!0),t){let i,n=0;const s=()=>this.root.updateBlockedByResize=!1;o.read(()=>{n=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==n&&(n=t,this.root.updateBlockedByResize=!0,i&&i(),i=yr(s,250),xr.hasAnimatedSinceResize&&(xr.hasAnimatedSinceResize=!1,this.nodes.forEach(jr)))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||n)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Wr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Jo(this.targetLayout,n),u=!e&&i;if(this.options.layoutRoot||this.resumeFrom||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...oi(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,u)}else e||jr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),r(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Or),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Pr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:i}=this.options;if(void 0===e&&!i)return;const n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(kr);if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Br);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Cr),this.nodes.forEach(Ar),this.nodes.forEach(Mr)):this.nodes.forEach(Br),this.clearAllSnapshots();const t=h.now();a.delta=e.clamp(0,1e3/60,t-a.timestamp),a.timestamp=t,a.isProcessing=!0,l.update.process(a),l.preRender.process(a),l.render.process(a),a.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,cn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Rr),this.sharedNodes.forEach(Ir)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,o.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){o.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Co(this.snapshot.measuredBox.x)||Co(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=u(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!c)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!qo(this.projectionDelta),i=this.getTransformTemplate(),n=i?i(this.latestValues,""):void 0,s=n!==this.prevTransformTemplateValue;t&&this.instance&&(e||Us(this.latestValues)||s)&&(c(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let i=this.removeElementScroll(e);var n;return t&&(i=this.removeTransform(i)),Yr((n=i).x),Yr(n.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Gr))){const{scroll:t}=this.root;t&&(Hs(e.x,t.offset.x),Hs(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(ko(e,t),this.scroll?.wasRoot)return e;for(let i=0;i<this.path.length;i++){const n=this.path[i],{scroll:s,options:o}=n;n!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&ko(e,t),Hs(e.x,s.offset.x),Hs(e.y,s.offset.y))}return e}applyTransform(t,e=!1){const i={x:{min:0,max:0},y:{min:0,max:0}};ko(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&_s(i,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),Us(n.latestValues)&&_s(i,n.latestValues)}return Us(this.latestValues)&&_s(i,this.latestValues),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};ko(e,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!Us(i.latestValues))continue;Is(i.latestValues)&&i.updateSnapshot();const n=vs();ko(n,i.measurePageBox()),Xo(e,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,n)}return Us(this.latestValues)&&Xo(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==a.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const i=Boolean(this.resumingFrom)||this!==e;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(!this.layout||!s&&!o)return;this.resolvedRelativeTargetAt=a.timestamp;const r=this.getClosestProjectingParent();r&&this.linkedParentVersion!==r.layoutVersion&&!r.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Io(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):ko(this.target,this.layout.layoutBox),Ys(this.target,this.targetDelta)):ko(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,r&&Boolean(r.resumingFrom)===Boolean(this.resumingFrom)&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0),n.value&&Tr.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!Is(this.parent.latestValues)&&!Ns(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,i){this.relativeParent=t,this.linkedParentVersion=t.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},No(this.relativeTargetOrigin,e,i),ko(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let i=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(i=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===a.timestamp&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;ko(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,l=this.treeScale.y;qs(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:u}=t;u?(this.projectionDelta&&this.prevProjectionDelta?(Bo(this.prevProjectionDelta.x,this.projectionDelta.x),Bo(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Fo(this.projectionDelta,this.layoutCorrected,u,this.latestValues),this.treeScale.x===r&&this.treeScale.y===l&&tr(this.projectionDelta.x,this.prevProjectionDelta.x)&&tr(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",u)),n.value&&Tr.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const i=this.snapshot,n=i?i.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some($r));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const i=e/1e3;var l,d,p,m;Ur(o.x,t.x,i),Ur(o.y,t.y,i),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(No(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,d=this.relativeTargetOrigin,p=r,m=i,Nr(l.x,d.x,p.x,m),Nr(l.y,d.y,p.y,m),h&&Zo(this.relativeTarget,h)&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),ko(h,this.relativeTarget)),a&&(this.animationValues=s,ar(s,n,this.latestValues,i,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(r(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=o.update(()=>{xr.hasAnimatedSinceResize=!0,d.layout++,this.motionValue||(this.motionValue=mi(0)),this.currentAnimation=dr(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{d.layout--},onComplete:()=>{d.layout--,t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:i,layout:n,latestValues:s}=t;if(e&&i&&n){if(this!==t&&this.layout&&n&&Xr(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Co(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const n=Co(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}ko(e,i),_s(e,s),Fo(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new vr);this.sharedNodes.get(t).add(e);const i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){const n=this.getStack();n&&n.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;const n={};i.z&&Sr("z",t,n,this.animationValues);for(let e=0;e<wr.length;e++)Sr(`rotate${wr[e]}`,t,n,this.animationValues),Sr(`skew${wr[e]}`,t,n,this.animationValues);t.render();for(const e in n)t.setStaticValue(e,n[e]),this.animationValues&&(this.animationValues[e]=n[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=gr(e?.pointerEvents)||"",void(t.transform=i?i(this.latestValues,""):"none");const n=this.getLead();if(!this.projectionDelta||!this.layout||!n.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=gr(e?.pointerEvents)||""),void(this.hasProjected&&!Us(this.latestValues)&&(t.transform=i?i({},""):"none",this.hasProjected=!1));t.visibility="";const s=n.animationValues||n.latestValues;this.applyTransformsToTarget();let o=ir(this.projectionDeltaWithTransform,this.treeScale,s);i&&(o=i(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,n.animationValues?t.opacity=n===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=n===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in ao){if(void 0===s[e])continue;const{correct:i,applyTo:r,isCSSVariable:a}=ao[e],l="none"===o?s[e]:i(s[e],n);if(r){const e=r.length;for(let i=0;i<e;i++)t[r[i]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=n===this?gr(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(kr),this.root.sharedNodes.clear()}}}function Ar(t){t.updateLayout()}function Mr(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:n}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;"size"===s?er(t=>{const n=o?e.measuredBox[t]:e.layoutBox[t],s=Co(n);n.min=i[t].min,n.max=n.min+s}):Xr(s,e.layoutBox,i)&&er(n=>{const s=o?e.measuredBox[n]:e.layoutBox[n],r=Co(i[n]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[n].max=t.relativeTarget[n].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Fo(r,i,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Fo(a,t.applyTransform(n,!0),e.measuredBox):Fo(a,i,e.layoutBox);const l=!qo(r);let u=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:s,layout:o}=n;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};No(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};No(a,i,o.layoutBox),Jo(r,a)||(u=!0),n.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Dr(t){n.value&&Tr.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Er(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Rr(t){t.clearSnapshot()}function kr(t){t.clearMeasurements()}function Br(t){t.isLayoutDirty=!1}function Cr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function jr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Lr(t){t.resolveTargetDelta()}function Fr(t){t.calcProjection()}function Or(t){t.resetSkewAndRotation()}function Ir(t){t.removeLeadSnapshot()}function Ur(t,e,i){t.translate=_(e.translate,0,i),t.scale=_(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function Nr(t,e,i,n){t.min=_(e.min,i.min,n),t.max=_(e.max,i.max,n)}function $r(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Wr={duration:.45,ease:[.4,0,.1,1]},Kr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),zr=Kr("applewebkit/")&&!Kr("chrome/")?Math.round:e.noop;function Yr(t){t.min=zr(t.min),t.max=zr(t.max)}function Xr(t,e,i){return"position"===t||"preserve-aspect"===t&&!jo(Qo(e),Qo(i),.2)}function Gr(t){return t!==t.root&&t.scroll?.wasRoot}const qr=Vr({attachResizeListener:(t,e)=>pr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Hr=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Zr(){const t=new Set,e=new WeakMap,i=()=>t.forEach(Hr);return{add:n=>{t.add(n),e.set(n,n.addEventListener("willUpdate",i))},remove:n=>{t.delete(n);const s=e.get(n);s&&(s(),e.delete(n)),i()},dirty:i}}const _r={current:void 0},Jr=Vr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!_r.current){const t=new qr({});t.mount(window),t.setOptions({layoutScroll:!0}),_r.current=t}return _r.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Qr(t){const e=Array.from(t.querySelectorAll("[data-layout], [data-layout-id]"));var i;return t instanceof Element&&((i=t).hasAttribute("data-layout")||i.hasAttribute("data-layout-id"))&&e.unshift(t),e}function ta(t){return t.getAttribute("data-layout-id")}let ea=!1;const ia=new WeakMap;function na(t){let e=0,i=t.parentElement;for(;i;)e++,i=i.parentElement;return e}function sa(t,e){let i=t.parentElement;for(;i;){const t=e.get(i);if(t)return t;i=i.parentElement}}function oa(t,e,i,n){const s=ia.get(t);if(s){const e=s.options.visualElement,o=n?{duration:n.duration,ease:n.ease}:{duration:.3,ease:"easeOut"};return s.setOptions({...s.options,animate:!0,transition:o,...i}),s.instance||s.mount(t),{node:s,visualElement:e}}const o={},r=new ho({visualState:{latestValues:o,renderState:{transformOrigin:{},transform:{},style:{},vars:{}}},presenceContext:null,props:{}}),a=new Jr(o,e),l=n?{duration:n.duration,ease:n.ease}:{duration:.3,ease:"easeOut"};return a.setOptions({visualElement:r,layout:!0,animate:!0,transition:l,...i}),a.mount(t),r.projection=a,ia.set(t,a),{node:a,visualElement:r}}function ra(t,e,i){ea||(ea=!0,lo({borderRadius:{...oo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:oo,borderTopRightRadius:oo,borderBottomLeftRadius:oo,borderBottomRightRadius:oo,boxShadow:ro}));const n=e?.nodes??new Map,s=e?.visualElements??new Map,o=e?.group??Zr(),r=i?.defaultTransition,a=i?.sharedTransitions,l=[...t].sort((t,e)=>na(t)-na(e));let u=e?.root;for(const t of l){if(n.has(t))continue;const e=sa(t,n),i=ta(t),l={layoutId:i??void 0,animationType:aa(t.getAttribute("data-layout"))},c=i&&a?.get(i)?a.get(i):r,{node:h,visualElement:d}=oa(t,e,l,c);n.set(t,h),s.set(t,d),o.add(h),u||(u=h.root)}return{nodes:n,visualElements:s,group:o,root:u}}function aa(t){return"position"===t?"position":"size"===t?"size":"preserve-aspect"===t?"preserve-aspect":"both"}const la=o,ua=i.reduce((t,e)=>(t[e]=t=>r(t),t),{});t.AsyncMotionValueAnimation=ze,t.DOMKeyframesResolver=Yi,t.DOMVisualElement=js,t.DocumentProjectionNode=qr,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=fr,t.GroupAnimation=Ye,t.GroupAnimationWithThen=class extends Ye{then(t,e){return this.finished.finally(t).then(()=>{})}},t.HTMLProjectionNode=Jr,t.HTMLVisualElement=ho,t.JSAnimation=Zt,t.KeyframeResolver=be,t.LayoutAnimationBuilder=class{constructor(t,i,n){this.sharedTransitions=new Map,this.notifyReady=e.noop,this.executed=!1,this.scope=t,this.updateDom=i,this.defaultOptions=n,this.readyPromise=new Promise(t=>{this.notifyReady=t}),queueMicrotask(()=>this.execute())}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}async execute(){if(this.executed)return;let t;this.executed=!0;const e=Qr(this.scope);if(e.length>0){t=ra(e,void 0,this.getBuildOptions()),t.root.startUpdate();for(const e of t.nodes.values())e.isLayoutDirty=!1,e.willUpdate()}this.updateDom();const i=Qr(this.scope),n=new Set(e),s=new Set(i),r=i.filter(t=>!n.has(t)),a=e.filter(t=>!s.has(t));if(r.length>0&&(t=ra(r,t,this.getBuildOptions())),!t)return void this.notifyReady(new Ye([]));for(const e of a){const i=t.nodes.get(e);i?.getStack()?.remove(i)}for(const e of r)t.nodes.get(e)?.promote();t.root.didUpdate(),await new Promise(t=>o.postRender(()=>t()));const l=[];for(const e of t.nodes.values())e.currentAnimation&&l.push(e.currentAnimation);const u=new Ye(l);u.finished.then(()=>{const e=new Set;for(const i of t.nodes.keys())document.contains(i)||e.add(i);!function(t,e){const i=e?[...t.nodes.entries()].filter(([t])=>e.has(t)):[...t.nodes.entries()];for(const[e,n]of i)t.group.remove(n),n.unmount(),ia.get(e)===n&&ia.delete(e),t.nodes.delete(e),t.visualElements.delete(e)}(t,e)}),this.notifyReady(u)}getBuildOptions(){return{defaultTransition:this.defaultOptions||{duration:.3,ease:"easeOut"},sharedTransitions:this.sharedTransitions.size>0?this.sharedTransitions:void 0}}},t.MotionValue=pi,t.NativeAnimation=Le,t.NativeAnimationExtended=Ie,t.NativeAnimationWrapper=Ge,t.NodeStack=vr,t.ObjectVisualElement=class extends Cs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const i=t[e];if("string"==typeof i||"number"==typeof i)return i}}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}},t.SVGVisualElement=class extends js{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=vs}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(ce.has(e)){const t=Wi(e);return t&&t.default||0}return e=vo.has(e)?e:bi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return wo(t,e,i)}build(t,e,i){go(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){To(t,e,0,n)}mount(t){this.isSVGTag=xo(t.tagName),super.mount(t)}},t.ViewTransitionBuilder=ms,t.VisualElement=Cs,t.acceleratedValues=qi,t.activeAnimations=d,t.addAttrValue=tn,t.addDomEvent=pr,t.addScaleCorrector=lo,t.addStyleValue=an,t.addValueToWillChange=wi,t.alpha=T,t.analyseComplexValue=K,t.animateMotionValue=ai,t.animateSingleValue=dr,t.animateTarget=Mi,t.animateValue=function(t){return new Zt(t)},t.animateVariant=Di,t.animateView=function(t,e={}){return new ms(t,e)},t.animateVisualElement=Ei,t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=zs,t.applyBoxDelta=Ys,t.applyGeneratorOptions=je,t.applyPointDelta=Ks,t.applyPxDefaults=function(t,e){for(let i=0;i<t.length;i++)"number"==typeof t[i]&&Xi.has(e)&&(t[i]=t[i]+"px")},t.applyTreeDeltas=qs,t.aspectRatio=Qo,t.attachFollow=Xn,t.attachSpring=function(t,e,i){return Xn(t,e,{type:"spring",...i})},t.attrEffect=en,t.axisDeltaEquals=tr,t.axisEquals=Ho,t.axisEqualsRounded=_o,t.boxEquals=Zo,t.boxEqualsRounded=Jo,t.buildHTMLStyles=io,t.buildProjectionTransform=ir,t.buildSVGAttrs=go,t.buildSVGPath=fo,t.buildTransform=eo,t.calcAxisDelta=Lo,t.calcBoxDelta=Fo,t.calcChildStagger=He,t.calcGeneratorDuration=pt,t.calcLength=Co,t.calcRelativeAxis=Oo,t.calcRelativeAxisPosition=Uo,t.calcRelativeBox=Io,t.calcRelativePosition=No,t.camelCaseAttributes=vo,t.camelToDash=bi,t.cancelFrame=r,t.cancelMicrotask=hn,t.cancelSync=ua,t.checkVariantsDidChange=Mo,t.cleanDirtyNodes=Er,t.collectMotionValues=di,t.color=I,t.compareByDepth=mr,t.complex=G,t.containsCSSVariable=v,t.convertBoundingBoxToBox=Ls,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=$t,t.copyAxisDeltaInto=Bo,t.copyAxisInto=Ro,t.copyBoxInto=ko,t.correctBorderRadius=oo,t.correctBoxShadow=ro,t.createAnimationState=function(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:i})=>Ei(t,e,i)))}(t),i=Eo(),n=!0;const s=e=>(i,n)=>{const s=ci(t,n,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...n}=s;i={...i,...n,...e}}return i};function o(o){const{props:r}=t,a=So(t.parent)||{},l=[],u=new Set;let c={},h=1/0;for(let e=0;e<Ao;e++){const d=Vo[e],p=i[d],m=void 0!==r[d]?r[d]:a[d],f=Vs(m),y=d===o?p.isActive:null;!1===y&&(h=e);let g=m===a[d]&&m!==r[d]&&f;if(g&&n&&t.manuallyAnimateOnMount&&(g=!1),p.protectedKeys={...c},!p.isActive&&null===y||!m&&!p.prevProp||Ps(m)||"boolean"==typeof m)continue;const v=Mo(p.prevProp,m);let x=v||d===o&&p.isActive&&!g&&f||e>h&&f,T=!1;const w=Array.isArray(m)?m:[m];let b=w.reduce(s(d),{});!1===y&&(b={});const{prevResolvedValues:S={}}=p,P={...S,...b},V=e=>{x=!0,u.has(e)&&(T=!0,u.delete(e)),p.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in P){const e=b[t],i=S[t];if(c.hasOwnProperty(t))continue;let n=!1;n=fi(e)&&fi(i)?!Po(e,i):e!==i,n?null!=e?V(t):u.add(t):void 0!==e&&u.has(t)?V(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=b,p.isActive&&(c={...c,...b}),n&&t.blockInitialAnimation&&(x=!1);const A=g&&v;x&&(!A||T)&&l.push(...w.map(e=>{const i={type:d};if("string"==typeof e&&n&&!A&&t.manuallyAnimateOnMount&&t.parent){const{parent:n}=t,s=ci(n,e);if(n.enteringChildren&&s){const{delayChildren:e}=s.transition||{};i.delay=He(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(u.size){const e={};if("boolean"!=typeof r.initial){const i=ci(t,Array.isArray(r.initial)?r.initial[0]:r.initial);i&&i.transition&&(e.transition=i.transition)}u.forEach(i=>{const n=t.getBaseTarget(i),s=t.getValue(i);s&&(s.liveStyle=!0),e[i]=n??null}),l.push({animation:e})}let d=Boolean(l.length);return!n||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),n=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,n){if(i[e].isActive===n)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,n)),i[e].isActive=n;const s=o(e);for(const t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=Eo()}}},t.createAxis=gs,t.createAxisDelta=fs,t.createBox=vs,t.createDelta=ys,t.createGeneratorEasing=mt,t.createProjectionNode=Vr,t.createRenderBatcher=s,t.cubicBezierAsString=Ee,t.defaultEasing=Wt,t.defaultOffset=Nt,t.defaultTransformValue=oe,t.defaultValueTypes=$i,t.degrees=k,t.delay=yr,t.delayInSeconds=function(t,i){return yr(t,e.secondsToMilliseconds(i))},t.dimensionValueTypes=ki,t.eachAxis=er,t.fillOffset=Ut,t.fillWildcards=_t,t.findDimensionValueType=Bi,t.findValueType=_n,t.flushKeyframeResolvers=we,t.followValue=Yn,t.frame=o,t.frameData=a,t.frameSteps=l,t.generateLinearEasing=ht,t.getAnimatableNone=Ki,t.getAnimationMap=function(t){const e=qe.get(t)||new Map;return qe.set(t,e),e},t.getComputedStyle=function(t,e){const i=window.getComputedStyle(t);return Se(e)?i.getPropertyValue(e):i[e]},t.getDefaultTransition=ii,t.getDefaultValueType=Wi,t.getFeatureDefinitions=function(){return Bs},t.getFinalKeyframe=si,t.getMixer=ot,t.getOptimisedAppearId=Vi,t.getOriginIndex=Kn,t.getValueAsType=_i,t.getValueTransition=oi,t.getVariableValue=Je,t.getVariantContext=So,t.getViewAnimationLayerInfo=ss,t.getViewAnimations=rs,t.globalProjectionState=xr,t.has2DTranslate=Ns,t.hasReducedMotionListener=Ts,t.hasScale=Is,t.hasTransform=Us,t.hex=E,t.hover=function(t,e,i={}){const[n,s,o]=mn(t,i),r=t=>{if(!fn(t))return;const{target:i}=t,n=e(i,t);if("function"!=typeof n||!i)return;const o=t=>{fn(t)&&(n(t),i.removeEventListener("pointerleave",o))};i.addEventListener("pointerleave",o,s)};return n.forEach(t=>{t.addEventListener("pointerenter",r,s)}),o},t.hsla=O,t.hslaToRgba=H,t.inertia=Ot,t.initPrefersReducedMotion=bs,t.interpolate=It,t.invisibleValues=it,t.isAnimationControls=Ps,t.isCSSVariableName=m,t.isCSSVariableToken=y,t.isControllingVariants=Ds,t.isDeltaZero=qo,t.isDragActive=pn,t.isDragging=dn,t.isElementKeyboardAccessible=xn,t.isForcedMotionValue=uo,t.isGenerator=Ce,t.isHTMLElement=sn,t.isKeyframesTarget=fi,t.isMotionValue=xi,t.isNear=jo,t.isNodeOrChild=yn,t.isPrimaryPointer=gn,t.isSVGElement=Pn,t.isSVGSVGElement=Wn,t.isSVGTag=xo,t.isTransitionDefined=ri,t.isVariantLabel=Vs,t.isVariantNode=Es,t.isWaapiSupportedEasing=function t(i){return Boolean("function"==typeof i&&De()||!i||"string"==typeof i&&(i in Re||De())||e.isBezierDefinition(i)||Array.isArray(i)&&i.every(t))},t.isWillChangeMotionValue=Ti,t.keyframes=Kt,t.makeAnimationInstant=Ne,t.mapEasingToNativeEasing=ke,t.mapValue=function(t,e,i,n){const s=zn(e,i,n);return Hn(()=>s(t.get()))},t.maxGeneratorDuration=dt,t.measurePageBox=function(t,e,i){const n=Js(t,i),{scroll:s}=e;return s&&(Hs(n.x,s.offset.x),Hs(n.y,s.offset.y)),n},t.measureViewportBox=Js,t.microtask=cn,t.mix=ut,t.mixArray=rt,t.mixColor=et,t.mixComplex=lt,t.mixImmediate=Z,t.mixLinearColor=J,t.mixNumber=_,t.mixObject=at,t.mixValues=ar,t.mixVisibility=nt,t.motionValue=mi,t.nodeGroup=Zr,t.number=x,t.numberValueTypes=Ni,t.observeTimeline=function(t,e){let i;const n=()=>{const{currentTime:n}=e,s=(null===n?0:n.value)/100;i!==s&&t(s),i=s};return o.preUpdate(n,!0),()=>r(n)},t.optimizedAppearDataAttribute=Pi,t.optimizedAppearDataId=Si,t.parseAnimateLayoutArgs=function(t,e,i){if("function"==typeof t)return{scope:document,updateDom:t,defaultOptions:e};const n=Hi(t)[0]||document;return{scope:(Document,n),updateDom:e,defaultOptions:i}},t.parseCSSVariable=_e,t.parseValueFromTransform=re,t.percent=B,t.pixelsToPercent=so,t.positionalKeys=hi,t.prefersReducedMotion=xs,t.press=function(t,e,i={}){const[n,s,o]=mn(t,i),r=t=>{const n=t.currentTarget;if(!Sn(t))return;Tn.add(n);const o=e(n,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Tn.has(n)&&Tn.delete(n),Sn(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,n===window||n===document||i.useGlobalTarget||yn(n,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return n.forEach(t=>{(i.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),sn(t)&&(t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const n=wn(()=>{if(Tn.has(i))return;bn(i,"down");const t=wn(()=>{bn(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>bn(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),xn(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progressPercentage=F,t.propEffect=nn,t.propagateDirtyNodes=Dr,t.px=C,t.readTransformValue=ae,t.recordStats=function(){if(n.value)throw Nn(),new Error("Stats are already being measured");const t=n;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:i}=t.value;i.nodes.push(e.nodes),i.calculatedTargetDeltas.push(e.calculatedTargetDeltas),i.calculatedProjections.push(e.calculatedProjections)},o.postRender(Fn,!0),$n},t.removeAxisDelta=Wo,t.removeAxisTransforms=Ko,t.removeBoxTransforms=Xo,t.removePointDelta=$o,t.renderHTML=no,t.renderSVG=To,t.resize=function(t,e){return"function"==typeof t?Ln(t):Bn(t,e)},t.resolveElements=Hi,t.resolveMotionValue=gr,t.resolveVariant=ci,t.resolveVariantFromProps=ui,t.rgbUnit=M,t.rgba=D,t.rootProjectionNode=_r,t.scale=w,t.scaleCorrectors=ao,t.scalePoint=Ws,t.scrapeHTMLMotionValuesFromProps=co,t.scrapeSVGMotionValuesFromProps=wo,t.setDragLock=function(t){return"x"===t||"y"===t?dn[t]?null:(dn[t]=!0,()=>{dn[t]=!1}):dn.x||dn.y?null:(dn.x=dn.y=!0,()=>{dn.x=dn.y=!1})},t.setFeatureDefinitions=function(t){Bs=t},t.setStyle=Pe,t.setTarget=vi,t.spring=Ft,t.springValue=function(t,e){return Yn(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:i=0,from:n=0,ease:s}={}){return(o,r)=>{const a="number"==typeof n?n:Kn(n,r),l=Math.abs(a-o);let u=t*l;if(s){const i=r*t;u=e.easingDefinitionToFunction(s)(u/i)*i}return i+u}},t.startWaapiAnimation=Be,t.statsBuffer=n,t.styleEffect=ln,t.supportedWaapiEasing=Re,t.supportsBrowserAnimation=Ke,t.supportsFlags=Ae,t.supportsLinearEasing=De,t.supportsPartialKeyframes=Gi,t.supportsScrollTimeline=Ve,t.svgEffect=un,t.sync=la,t.testValueType=Ri,t.time=h,t.transform=zn,t.transformAxis=Zs,t.transformBox=_s,t.transformBoxPoints=Fs,t.transformPropOrder=ue,t.transformProps=ce,t.transformValue=Hn,t.transformValueTypes=Ui,t.translateAxis=Hs,t.updateMotionValuesFromProps=Rs,t.variantPriorityOrder=As,t.variantProps=Ms,t.vh=j,t.visualElementStore=Ss,t.vw=L});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const i=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],n={value:null,addProjectionMetrics:null};function s(t,s){let o=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>o=!0,u=i.reduce((t,e)=>(t[e]=function(t,e){let i=new Set,s=new Set,o=!1,r=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},u=0;function c(e){a.has(e)&&(h.schedule(e),t()),u++,e(l)}const h={schedule:(t,e=!1,n=!1)=>{const r=n&&o?i:s;return e&&a.add(t),r.has(t)||r.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{l=t,o?r=!0:(o=!0,[i,s]=[s,i],i.forEach(c),e&&n.value&&n.value.frameloop[e].push(u),u=0,i.clear(),o=!1,r&&(r=!1,h.process(t)))}};return h}(l,s?e:void 0),t),{}),{setup:c,read:h,resolveKeyframes:d,preUpdate:p,update:m,preRender:f,render:y,postRender:g}=u,v=()=>{const i=e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now();o=!1,e.MotionGlobalConfig.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(i-a.timestamp,40),1)),a.timestamp=i,a.isProcessing=!0,c.process(a),h.process(a),d.process(a),p.process(a),m.process(a),f.process(a),y.process(a),g.process(a),a.isProcessing=!1,o&&s&&(r=!1,t(v))};return{schedule:i.reduce((e,i)=>{const n=u[i];return e[i]=(e,i=!1,s=!1)=>(o||(o=!0,r=!0,a.isProcessing||t(v)),n.schedule(e,i,s)),e},{}),cancel:t=>{for(let e=0;e<i.length;e++)u[i[e]].cancel(t)},state:a,steps:u}}const{schedule:o,cancel:r,state:a,steps:l}=s("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e.noop,!0);let u;function c(){u=void 0}const h={now:()=>(void 0===u&&h.set(a.isProcessing||e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now()),u),set:t=>{u=t,queueMicrotask(c)}},d={layout:0,mainThread:0,waapi:0},p=t=>e=>"string"==typeof e&&e.startsWith(t),m=p("--"),f=p("var(--"),y=t=>!!f(t)&&g.test(t.split("/*")[0].trim()),g=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function v(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const x={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},T={...x,transform:t=>e.clamp(0,1,t)},w={...x,default:1},b=t=>Math.round(1e5*t)/1e5,S=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const P=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,V=(t,e)=>i=>Boolean("string"==typeof i&&P.test(i)&&i.startsWith(t)||e&&!function(t){return null==t}(i)&&Object.prototype.hasOwnProperty.call(i,e)),A=(t,e,i)=>n=>{if("string"!=typeof n)return n;const[s,o,r,a]=n.match(S);return{[t]:parseFloat(s),[e]:parseFloat(o),[i]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},M={...x,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},D={test:V("rgb","red"),parse:A("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:n=1})=>"rgba("+M.transform(t)+", "+M.transform(e)+", "+M.transform(i)+", "+b(T.transform(n))+")"};const E={test:V("#"),parse:function(t){let e="",i="",n="",s="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),n=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),n=t.substring(3,4),s=t.substring(4,5),e+=e,i+=i,n+=n,s+=s),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}},transform:D.transform},R=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),k=R("deg"),B=R("%"),C=R("px"),j=R("vh"),L=R("vw"),F=(()=>({...B,parse:t=>B.parse(t)/100,transform:t=>B.transform(100*t)}))(),O={test:V("hsl","hue"),parse:A("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:n=1})=>"hsla("+Math.round(t)+", "+B.transform(b(e))+", "+B.transform(b(i))+", "+b(T.transform(n))+")"},I={test:t=>D.test(t)||E.test(t)||O.test(t),parse:t=>D.test(t)?D.parse(t):O.test(t)?O.parse(t):E.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?D.transform(t):O.transform(t),getAnimatableNone:t=>{const e=I.parse(t);return e.alpha=0,I.transform(e)}},U=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const N="number",$="color",W=/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 z(t){const e=t.toString(),i=[],n={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(W,t=>(I.test(t)?(n.color.push(o),s.push($),i.push(I.parse(t))):t.startsWith("var(")?(n.var.push(o),s.push("var"),i.push(t)):(n.number.push(o),s.push(N),i.push(parseFloat(t))),++o,"${}")).split("${}");return{values:i,split:r,indexes:n,types:s}}function K(t){return z(t).values}function Y(t){const{split:e,types:i}=z(t),n=e.length;return t=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],void 0!==t[o]){const e=i[o];s+=e===N?b(t[o]):e===$?I.transform(t[o]):t[o]}return s}}const X=t=>"number"==typeof t?0:I.test(t)?I.getAnimatableNone(t):t;const G={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(S)?.length||0)+(t.match(U)?.length||0)>0},parse:K,createTransformer:Y,getAnimatableNone:function(t){const e=K(t);return Y(t)(e.map(X))}};function q(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function H({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,i/=100;let s=0,o=0,r=0;if(e/=100){const n=i<.5?i*(1+e):i+e-i*e,a=2*i-n;s=q(a,n,t+1/3),o=q(a,n,t),r=q(a,n,t-1/3)}else s=o=r=i;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:n}}function Z(t,e){return i=>i>0?e:t}const _=(t,e,i)=>t+(e-t)*i,J=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},Q=[E,D,O];function tt(t){const i=(n=t,Q.find(t=>t.test(n)));var n;if(e.warning(Boolean(i),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(i))return!1;let s=i.parse(t);return i===O&&(s=H(s)),s}const et=(t,e)=>{const i=tt(t),n=tt(e);if(!i||!n)return Z(t,e);const s={...i};return t=>(s.red=J(i.red,n.red,t),s.green=J(i.green,n.green,t),s.blue=J(i.blue,n.blue,t),s.alpha=_(i.alpha,n.alpha,t),D.transform(s))},it=new Set(["none","hidden"]);function nt(t,e){return it.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}function st(t,e){return i=>_(t,e,i)}function ot(t){return"number"==typeof t?st:"string"==typeof t?y(t)?Z:I.test(t)?et:lt:Array.isArray(t)?rt:"object"==typeof t?I.test(t)?et:at:Z}function rt(t,e){const i=[...t],n=i.length,s=t.map((t,i)=>ot(t)(t,e[i]));return t=>{for(let e=0;e<n;e++)i[e]=s[e](t);return i}}function at(t,e){const i={...t,...e},n={};for(const s in i)void 0!==t[s]&&void 0!==e[s]&&(n[s]=ot(t[s])(t[s],e[s]));return t=>{for(const e in n)i[e]=n[e](t);return i}}const lt=(t,i)=>{const n=G.createTransformer(i),s=z(t),o=z(i);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?it.has(t)&&!o.values.length||it.has(i)&&!s.values.length?nt(t,i):e.pipe(rt(function(t,e){const i=[],n={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][n[o]],a=t.values[r]??0;i[s]=a,n[o]++}return i}(s,o),o.values),n):(e.warning(!0,`Complex values '${t}' and '${i}' 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"),Z(t,i))};function ut(t,e,i){if("number"==typeof t&&"number"==typeof e&&"number"==typeof i)return _(t,e,i);return ot(t)(t,e)}const ct=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>o.update(e,t),stop:()=>r(e),now:()=>a.isProcessing?a.timestamp:h.now()}},ht=(t,e,i=10)=>{let n="";const s=Math.max(Math.round(e/i),2);for(let e=0;e<s;e++)n+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},dt=2e4;function pt(t){let e=0;let i=t.next(e);for(;!i.done&&e<dt;)e+=50,i=t.next(e);return e>=dt?1/0:e}function mt(t,i=100,n){const s=n({...t,keyframes:[0,i]}),o=Math.min(pt(s),dt);return{type:"keyframes",ease:t=>s.next(o*t).value/i,duration:e.millisecondsToSeconds(o)}}function ft(t,i,n){const s=Math.max(i-5,0);return e.velocityPerSecond(n-t(s),i-s)}const yt=100,gt=10,vt=1,xt=0,Tt=800,wt=.3,bt=.3,St={granular:.01,default:2},Pt={granular:.005,default:.5},Vt=.01,At=10,Mt=.05,Dt=1,Et=.001;function Rt({duration:t=Tt,bounce:i=wt,velocity:n=xt,mass:s=vt}){let o,r;e.warning(t<=e.secondsToMilliseconds(At),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-i;a=e.clamp(Mt,Dt,a),t=e.clamp(Vt,At,e.millisecondsToSeconds(t)),a<1?(o=e=>{const i=e*a,s=i*t,o=i-n,r=Bt(e,a),l=Math.exp(-s);return Et-o/r*l},r=e=>{const i=e*a*t,s=i*n+n,r=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=Bt(Math.pow(e,2),a);return(-o(e)+Et>0?-1:1)*((s-r)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const l=function(t,e,i){let n=i;for(let i=1;i<kt;i++)n-=t(n)/e(n);return n}(o,r,5/t);if(t=e.secondsToMilliseconds(t),isNaN(l))return{stiffness:yt,damping:gt,duration:t};{const e=Math.pow(l,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}const kt=12;function Bt(t,e){return t*Math.sqrt(1-e*e)}const Ct=["duration","bounce"],jt=["stiffness","damping","mass"];function Lt(t,e){return e.some(e=>void 0!==t[e])}function Ft(t=bt,i=wt){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:i}:t;let{restSpeed:s,restDelta:o}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:r},{stiffness:u,damping:c,mass:h,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let i={velocity:xt,stiffness:yt,damping:gt,mass:vt,isResolvedFromDuration:!1,...t};if(!Lt(t,jt)&&Lt(t,Ct))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),o=s*s,r=2*e.clamp(.05,1,1-(t.bounce||0))*Math.sqrt(o);i={...i,mass:vt,stiffness:o,damping:r}}else{const e=Rt(t);i={...i,...e,mass:vt},i.isResolvedFromDuration=!0}return i}({...n,velocity:-e.millisecondsToSeconds(n.velocity||0)}),f=p||0,y=c/(2*Math.sqrt(u*h)),g=a-r,v=e.millisecondsToSeconds(Math.sqrt(u/h)),x=Math.abs(g)<5;let T;if(s||(s=x?St.granular:St.default),o||(o=x?Pt.granular:Pt.default),y<1){const t=Bt(v,y);T=e=>{const i=Math.exp(-y*v*e);return a-i*((f+y*v*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===y)T=t=>a-Math.exp(-v*t)*(g+(f+v*g)*t);else{const t=v*Math.sqrt(y*y-1);T=e=>{const i=Math.exp(-y*v*e),n=Math.min(t*e,300);return a-i*((f+y*v*g)*Math.sinh(n)+t*g*Math.cosh(n))/t}}const w={calculatedDuration:m&&d||null,next:t=>{const i=T(t);if(m)l.done=t>=d;else{let n=0===t?f:0;y<1&&(n=0===t?e.secondsToMilliseconds(f):ft(T,t,i));const r=Math.abs(n)<=s,u=Math.abs(a-i)<=o;l.done=r&&u}return l.value=l.done?a:i,l},toString:()=>{const t=Math.min(pt(w),dt),e=ht(e=>w.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return w}function Ot({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=i*e;const f=h+m,y=void 0===r?f:r(f);y!==f&&(m=y-h);const g=t=>-m*Math.exp(-t/n),v=t=>y+g(t),x=t=>{const e=g(t),i=v(t);d.done=Math.abs(e)<=u,d.value=d.done?y:i};let T,w;const b=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(T=t,w=Ft({keyframes:[d.value,p(d.value)],velocity:ft(v,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:c}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,x(t),b(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&x(t),d)}}}function It(t,i,{clamp:n=!0,ease:s,mixer:o}={}){const r=t.length;if(e.invariant(r===i.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>i[0];if(2===r&&i[0]===i[1])return()=>i[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),i=[...i].reverse());const l=function(t,i,n){const s=[],o=n||e.MotionGlobalConfig.mix||ut,r=t.length-1;for(let n=0;n<r;n++){let r=o(t[n],t[n+1]);if(i){const t=Array.isArray(i)?i[n]||e.noop:i;r=e.pipe(t,r)}s.push(r)}return s}(i,s,o),u=l.length,c=n=>{if(a&&n<t[0])return i[0];let s=0;if(u>1)for(;s<t.length-2&&!(n<t[s+1]);s++);const o=e.progress(t[s],t[s+1],n);return l[s](o)};return n?i=>c(e.clamp(t[0],t[r-1],i)):c}function Ut(t,i){const n=t[t.length-1];for(let s=1;s<=i;s++){const o=e.progress(0,i,s);t.push(_(n,1,o))}}function Nt(t){const e=[0];return Ut(e,t.length-1),e}function $t(t,e){return t.map(t=>t*e)}function Wt(t,i){return t.map(()=>i||e.easeInOut).splice(0,t.length-1)}function zt({duration:t=300,keyframes:i,times:n,ease:s="easeInOut"}){const o=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s),r={done:!1,value:i[0]},a=It($t(n&&n.length===i.length?n:Nt(i),t),i,{ease:Array.isArray(o)?o:Wt(i,o)});return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}Ft.applyToOptions=t=>{const i=mt(t,100,Ft);return t.ease=i.ease,t.duration=e.secondsToMilliseconds(i.duration),t.type="keyframes",t};const Kt=t=>null!==t;function Yt(t,{repeat:e,repeatType:i="loop"},n,s=1){const o=t.filter(Kt),r=s<0||e&&"loop"!==i&&e%2==1?0:o.length-1;return r&&void 0!==n?n:o[r]}const Xt={decay:Ot,inertia:Ot,tween:zt,keyframes:zt,spring:Ft};function Gt(t){"string"==typeof t.type&&(t.type=Xt[t.type])}class qt{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 Ht=t=>t/100;class Zt extends qt{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!==h.now()&&this.tick(h.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},d.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Gt(t);const{type:i=zt,repeat:n=0,repeatDelay:s=0,repeatType:o,velocity:r=0}=t;let{keyframes:a}=t;const l=i||zt;l!==zt&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe(Ht,ut(a[0],a[1])),a=[0,100]);const u=l({...t,keyframes:a});"mirror"===o&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=pt(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,i=!1){const{generator:n,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),i?this.currentTime=t:this.updateTime(t);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x=this.currentTime,T=n;if(h){const t=Math.min(this.currentTime,s)/a;let i=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&i--,i=Math.min(i,h+1);Boolean(i%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(T=r)),x=e.clamp(0,1,n)*a}const w=v?{done:!1,value:c[0]}:T.next(x);o&&(w.value=o(w.value));let{done:b}=w;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==Ot&&(w.value=Yt(c,this.options,y,this.speed)),f&&f(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){t=e.secondsToMilliseconds(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(h.now());const i=this.playbackSpeed!==t;this.playbackSpeed=t,i&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ct,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=e??i),"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(h.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,d.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function _t(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Jt=t=>180*t/Math.PI,Qt=t=>{const e=Jt(Math.atan2(t[1],t[0]));return ee(e)},te={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Qt,rotateZ:Qt,skewX:t=>Jt(Math.atan(t[1])),skewY:t=>Jt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ee=t=>((t%=360)<0&&(t+=360),t),ie=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ne=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),se={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ie,scaleY:ne,scale:t=>(ie(t)+ne(t))/2,rotateX:t=>ee(Jt(Math.atan2(t[6],t[5]))),rotateY:t=>ee(Jt(Math.atan2(-t[2],t[0]))),rotateZ:Qt,rotate:Qt,skewX:t=>Jt(Math.atan(t[4])),skewY:t=>Jt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function oe(t){return t.includes("scale")?1:0}function re(t,e){if(!t||"none"===t)return oe(e);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,s;if(i)n=se,s=i;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=te,s=e}if(!s)return oe(e);const o=n[e],r=s[1].split(",").map(le);return"function"==typeof o?o(r):r[o]}const ae=(t,e)=>{const{transform:i="none"}=getComputedStyle(t);return re(i,e)};function le(t){return parseFloat(t.trim())}const ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ce=(()=>new Set(ue))(),he=t=>t===x||t===C,de=new Set(["x","y","z"]),pe=ue.filter(t=>!de.has(t));const me={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),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")};me.translateX=me.x,me.translateY=me.y;const fe=new Set;let ye=!1,ge=!1,ve=!1;function xe(){if(ge){const t=Array.from(fe).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{const e=function(t){const e=[];return pe.forEach(i=>{const n=t.getValue(i);void 0!==n&&(e.push([i,n.get()]),n.set(i.startsWith("scale")?1:0))}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=i.get(t);e&&e.forEach(([e,i])=>{t.getValue(e)?.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}ge=!1,ye=!1,fe.forEach(t=>t.complete(ve)),fe.clear()}function Te(){fe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ge=!0)})}function we(){ve=!0,Te(),xe(),ve=!1}class be{constructor(t,e,i,n,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=n,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(fe.add(this),ye||(ye=!0,o.read(Te),o.resolveKeyframes(xe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:i,motionValue:n}=this;if(null===t[0]){const s=n?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(i&&e){const n=i.readValue(e,o);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=o),n&&void 0===s&&n.set(t[0])}_t(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),fe.delete(this)}cancel(){"scheduled"===this.state&&(fe.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Se=t=>t.startsWith("--");function Pe(t,e,i){Se(e)?t.style.setProperty(e,i):t.style[e]=i}const Ve=e.memo(()=>void 0!==window.ScrollTimeline),Ae={};function Me(t,i){const n=e.memo(t);return()=>Ae[i]??n()}const De=Me(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Ee=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,Re={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ee([0,.65,.55,1]),circOut:Ee([.55,0,1,.45]),backIn:Ee([.31,.01,.66,-.59]),backOut:Ee([.33,1.53,.69,.99])};function ke(t,i){return t?"function"==typeof t?De()?ht(t,i):"ease-out":e.isBezierDefinition(t)?Ee(t):Array.isArray(t)?t.map(t=>ke(t,i)||Re.easeOut):Re[t]:void 0}function Be(t,e,i,{delay:s=0,duration:o=300,repeat:r=0,repeatType:a="loop",ease:l="easeOut",times:u}={},c=void 0){const h={[e]:i};u&&(h.offset=u);const p=ke(l,o);Array.isArray(p)&&(h.easing=p),n.value&&d.waapi++;const m={delay:s,duration:o,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};c&&(m.pseudoElement=c);const f=t.animate(h,m);return n.value&&f.finished.finally(()=>{d.waapi--}),f}function Ce(t){return"function"==typeof t&&"applyToOptions"in t}function je({type:t,...e}){return Ce(t)&&De()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Le extends qt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:i,name:n,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=t,e.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=je(t);this.animation=Be(i,n,s,u,o),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Yt(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(t):Pe(i,n,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ve()?(this.animation.timeline=t,e.noop):i(this)}}const Fe={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function Oe(t){"string"==typeof t.ease&&t.ease in Fe&&(t.ease=Fe[t.ease])}class Ie extends Le{constructor(t){Oe(t),Gt(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:i,onUpdate:n,onComplete:s,element:o,...r}=this.options;if(!i)return;if(void 0!==t)return void i.set(t);const a=new Zt({...r,autoplay:!1}),l=Math.max(10,h.now()-this.startTime),u=e.clamp(0,10,l-10);i.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const Ue=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!G.test(t)&&"0"!==t||t.startsWith("url(")));function Ne(t){t.duration=0,t.type="keyframes"}const $e=new Set(["opacity","clipPath","filter","transform"]),We=e.memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ze(t){const{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:o,type:r}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return We()&&i&&$e.has(i)&&("transform"!==i||!u)&&!l&&!n&&"mirror"!==s&&0!==o&&"inertia"!==r}class Ke extends qt{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=h.now();const d={autoplay:t,delay:e,type:i,repeat:n,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:u,...c},p=u?.KeyframeResolver||be;this.keyframeResolver=new p(r,(t,e,i)=>this.onKeyframesResolved(t,e,d,!i),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,i,n,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:u,onUpdate:c}=n;this.resolvedAt=h.now(),function(t,i,n,s){const o=t[0];if(null===o)return!1;if("display"===i||"visibility"===i)return!0;const r=t[t.length-1],a=Ue(o,i),l=Ue(r,i);return e.warning(a===l,`You are trying to animate ${i} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===n||Ce(n))&&s)}(t,o,r,a)||(!e.MotionGlobalConfig.instantAnimations&&l||c?.(Yt(t,n,i)),t[0]=t[t.length-1],Ne(n),n.repeat=0);const d={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:i,...n,keyframes:t},p=!u&&ze(d),m=d.motionValue?.owner?.current,f=p?new Ie({...d,element:m}):new Zt(d);f.finished.then(()=>{this.notifyFinished()}).catch(e.noop),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),we()),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 Ye{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 i=0;i<this.animations.length;i++)this.animations[i][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 Xe(this.animations,"duration")}get iterationDuration(){return Xe(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 Xe(t,e){let i=0;for(let n=0;n<t.length;n++){const s=t[n][e];null!==s&&s>i&&(i=s)}return i}class Ge extends Le{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const qe=new WeakMap;function He(t,e,i,n=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*n;return"function"==typeof i?i(o,r):1===s?o*n:a-o*n}const Ze=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _e(t){const e=Ze.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}function Je(t,i,n=1){e.invariant(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=_e(t);if(!s)return;const r=window.getComputedStyle(i).getPropertyValue(s);if(r){const t=r.trim();return e.isNumericalString(t)?parseFloat(t):t}return y(o)?Je(o,i,n+1):o}const Qe={type:"spring",stiffness:500,damping:25,restSpeed:10},ti={type:"keyframes",duration:.8},ei={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ii=(t,{keyframes:e})=>e.length>2?ti:ce.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Qe:ei,ni=t=>null!==t;function si(t,{repeat:e,repeatType:i="loop"},n){const s=t.filter(ni),o=e&&"loop"!==i&&e%2==1?0:s.length-1;return o&&void 0!==n?n:s[o]}function oi(t,e){return t?.[e]??t?.default??t}function ri({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const ai=(t,i,n,s={},r,a)=>l=>{const u=oi(s,t)||{},c=u.delay||s.delay||0;let{elapsed:h=0}=s;h-=e.secondsToMilliseconds(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:i.getVelocity(),...u,delay:-h,onUpdate:t=>{i.set(t),u.onUpdate&&u.onUpdate(t)},onComplete:()=>{l(),u.onComplete&&u.onComplete()},name:t,motionValue:i,element:a?void 0:r};ri(u)||Object.assign(d,ii(t,d)),d.duration&&(d.duration=e.secondsToMilliseconds(d.duration)),d.repeatDelay&&(d.repeatDelay=e.secondsToMilliseconds(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(Ne(d),0===d.delay&&(p=!0)),(e.MotionGlobalConfig.instantAnimations||e.MotionGlobalConfig.skipAnimations)&&(p=!0,Ne(d),d.delay=0),d.allowFlatten=!u.type&&!u.ease,p&&!a&&void 0!==i.get()){const t=si(d.keyframes,u);if(void 0!==t)return void o.update(()=>{d.onUpdate(t),d.onComplete()})}return u.isSync?new Zt(d):new Ke(d)};function li(t){const e=[{},{}];return t?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function ui(t,e,i,n){if("function"==typeof e){const[s,o]=li(n);e=e(void 0!==i?i:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=li(n);e=e(void 0!==i?i:t.custom,s,o)}return e}function ci(t,e,i){const n=t.getProps();return ui(n,e,void 0!==i?i:n.custom,t)}const hi=new Set(["width","height","top","left","right","bottom",...ue]),di={current:void 0};class pi{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=h.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=h.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,i){this.events[t]||(this.events[t]=new e.SubscriptionManager);const n=this.events[t].add(i);return"change"===t?()=>{n(),o.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,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}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 di.current&&di.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=h.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}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 mi(t,e){return new pi(t,e)}const fi=t=>Array.isArray(t);function yi(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,mi(i))}function gi(t){return fi(t)?t[t.length-1]||0:t}function vi(t,e){const i=ci(t,e);let{transitionEnd:n={},transition:s={},...o}=i||{};o={...o,...n};for(const e in o){yi(t,e,gi(o[e]))}}const xi=t=>Boolean(t&&t.getVelocity);function Ti(t){return Boolean(xi(t)&&t.add)}function wi(t,i){const n=t.getValue("willChange");if(Ti(n))return n.add(i);if(!n&&e.MotionGlobalConfig.WillChange){const n=new e.MotionGlobalConfig.WillChange("auto");t.addValue("willChange",n),n.add(i)}}function bi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Si="framerAppearId",Pi="data-"+bi(Si);function Vi(t){return t.props[Pi]}function Ai({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}function Mi(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;n&&(r=n);const u=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in l){const n=t.getValue(e,t.latestValues[e]??null),s=l[e];if(void 0===s||c&&Ai(c,e))continue;const a={delay:i,...oi(r||{},e)},h=n.get();if(void 0!==h&&!n.isAnimating&&!Array.isArray(s)&&s===h&&!a.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const i=Vi(t);if(i){const t=window.MotionHandoffAnimation(i,e,o);null!==t&&(a.startTime=t,d=!0)}}wi(t,e),n.start(ai(e,n,s,t.shouldReduceMotion&&hi.has(e)?{type:!1}:a,t,d));const p=n.animation;p&&u.push(p)}return a&&Promise.all(u).then(()=>{o.update(()=>{a&&vi(t,a)})}),u}function Di(t,e,i={}){const n=ci(t,e,"exit"===i.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(s=i.transitionOverride);const o=n?()=>Promise.all(Mi(t,n,i)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,i=0,n=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Di(l,e,{...r,delay:i+("function"==typeof n?0:n)+He(t.variantChildren,l,n,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,n,o,r,a,i)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(i.delay)])}function Ei(t,e,i={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Di(t,e,i));n=Promise.all(s)}else if("string"==typeof e)n=Di(t,e,i);else{const s="function"==typeof e?ci(t,e,i.custom):e;n=Promise.all(Mi(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}const Ri=t=>e=>e.test(t),ki=[x,C,B,k,L,j,{test:t=>"auto"===t,parse:t=>t}],Bi=t=>ki.find(Ri(t));function Ci(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const ji=new Set(["brightness","contrast","saturate","opacity"]);function Li(t){const[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=i.match(S)||[];if(!n)return t;const s=i.replace(n,"");let o=ji.has(e)?1:0;return n!==i&&(o*=100),e+"("+o+s+")"}const Fi=/\b([a-z-]*)\(.*?\)/gu,Oi={...G,getAnimatableNone:t=>{const e=t.match(Fi);return e?e.map(Li).join(" "):t}},Ii={...x,transform:Math.round},Ui={rotate:k,rotateX:k,rotateY:k,rotateZ:k,scale:w,scaleX:w,scaleY:w,scaleZ:w,skew:k,skewX:k,skewY:k,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:T,originX:F,originY:F,originZ:C},Ni={borderWidth:C,borderTopWidth:C,borderRightWidth:C,borderBottomWidth:C,borderLeftWidth:C,borderRadius:C,borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomRightRadius:C,borderBottomLeftRadius:C,width:C,maxWidth:C,height:C,maxHeight:C,top:C,right:C,bottom:C,left:C,inset:C,insetBlock:C,insetBlockStart:C,insetBlockEnd:C,insetInline:C,insetInlineStart:C,insetInlineEnd:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,paddingBlock:C,paddingBlockStart:C,paddingBlockEnd:C,paddingInline:C,paddingInlineStart:C,paddingInlineEnd:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,marginBlock:C,marginBlockStart:C,marginBlockEnd:C,marginInline:C,marginInlineStart:C,marginInlineEnd:C,fontSize:C,backgroundPositionX:C,backgroundPositionY:C,...Ui,zIndex:Ii,fillOpacity:T,strokeOpacity:T,numOctaves:Ii},$i={...Ni,color:I,backgroundColor:I,outlineColor:I,fill:I,stroke:I,borderColor:I,borderTopColor:I,borderRightColor:I,borderBottomColor:I,borderLeftColor:I,filter:Oi,WebkitFilter:Oi},Wi=t=>$i[t];function zi(t,e){let i=Wi(t);return i!==Oi&&(i=G),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const Ki=new Set(["auto","none","0"]);class Yi extends be{constructor(t,e,i,n,s){super(t,e,i,n,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i<t.length;i++){let n=t[i];if("string"==typeof n&&(n=n.trim(),y(n))){const s=Je(n,e.current);void 0!==s&&(t[i]=s),i===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!hi.has(i)||2!==t.length)return;const[n,s]=t,o=Bi(n),r=Bi(s);if(v(n)!==v(s)&&me[i])this.needsMeasurement=!0;else if(o!==r)if(he(o)&&he(r))for(let e=0;e<t.length;e++){const i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else me[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++)(null===t[e]||Ci(t[e]))&&i.push(e);i.length&&function(t,e,i){let n,s=0;for(;s<t.length&&!n;){const e=t[s];"string"==typeof e&&!Ki.has(e)&&z(e).values.length&&(n=t[s]),s++}if(n&&i)for(const s of e)t[s]=zi(i,n)}(t,i,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:i}=this;if(!t||!t.current)return;"height"===i&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=me[i](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const n=e[e.length-1];void 0!==n&&t.getValue(i,n).jump(n,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:i}=this;if(!t||!t.current)return;const n=t.getValue(e);n&&n.jump(this.measuredOrigin,!1);const s=i.length-1,o=i[s];i[s]=me[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,i])=>{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}const Xi=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);const Gi=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),qi=new Set(["opacity","clipPath","filter","transform"]);function Hi(t,e,i){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let n=document;e&&(n=e.current);const s=i?.[t]??n.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Zi(t){return(e,i)=>{const n=Hi(e),s=[];for(const e of n){const n=t(e,i);s.push(n)}return()=>{for(const t of s)t()}}}const _i=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class Ji{constructor(){this.latest={},this.values=new Map}set(t,e,i,n,s=!0){const a=this.values.get(t);a&&a.onRemove();const l=()=>{const n=e.get();this.latest[t]=s?_i(n,Ni[t]):n,i&&o.render(i)};l();const u=e.on("change",l);n&&e.addDependent(n);const c=()=>{u(),i&&r(i),this.values.delete(t),n&&e.removeDependent(n)};return this.values.set(t,{value:e,onRemove:c}),c}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function Qi(t){const e=new WeakMap,i=[];return(n,s)=>{const o=e.get(n)??new Ji;e.set(n,o);for(const e in s){const r=s[e],a=t(n,o,e,r);i.push(a)}return()=>{for(const t of i)t()}}}const tn=(t,e,i,n)=>{const s=function(t,e){if(!(e in t))return!1;const i=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return i&&"function"==typeof i.set}(t,i),o=s?i:i.startsWith("data")||i.startsWith("aria")?bi(i):i,r=s?()=>{t[o]=e.latest[i]}:()=>{const n=e.latest[i];null==n?t.removeAttribute(o):t.setAttribute(o,String(n))};return e.set(i,n,r)},en=Zi(Qi(tn)),nn=Qi((t,e,i,n)=>e.set(i,n,()=>{t[i]=e.latest[i]},void 0,!1));function sn(t){return e.isObject(t)&&"offsetHeight"in t}const on={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const rn=new Set(["originX","originY","originZ"]),an=(t,e,i,n)=>{let s,o;return ce.has(i)?(e.get("transform")||(sn(t)||e.get("transformBox")||an(t,e,"transformBox",new pi("fill-box")),e.set("transform",new pi("none"),()=>{t.style.transform=function(t){let e="",i=!0;for(let n=0;n<ue.length;n++){const s=ue[n],o=t.latest[s];if(void 0===o)continue;let r=!0;if("number"==typeof o)r=o===(s.startsWith("scale")?1:0);else{const t=parseFloat(o);r=s.startsWith("scale")?1===t:0===t}r||(i=!1,e+=`${on[s]||s}(${t.latest[s]}) `)}return i?"none":e.trim()}(e)})),o=e.get("transform")):rn.has(i)?(e.get("transformOrigin")||e.set("transformOrigin",new pi(""),()=>{const i=e.latest.originX??"50%",n=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${i} ${n} ${s}`}),o=e.get("transformOrigin")):s=Se(i)?()=>{t.style.setProperty(i,e.latest[i])}:()=>{t.style[i]=e.latest[i]},e.set(i,n,s,o)},ln=Zi(Qi(an));const un=Zi(Qi((t,e,i,n)=>{if(i.startsWith("path"))return function(t,e,i,n){return o.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===i?e.set(i,n,()=>{const n=e.latest[i];t.setAttribute("stroke-dashoffset",""+-n)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new pi("1 1"),()=>{const{pathLength:i=1,pathSpacing:n}=e.latest;t.setAttribute("stroke-dasharray",`${i} ${n??1-Number(i)}`)}),e.set(i,n,void 0,e.get("stroke-dasharray")))}(t,e,i,n);if(i.startsWith("attr"))return tn(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(i),n);return(i in t.style?an:tn)(t,e,i,n)}));const{schedule:cn,cancel:hn}=s(queueMicrotask,!1),dn={x:!1,y:!1};function pn(){return dn.x||dn.y}function mn(t,e){const i=Hi(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function fn(t){return!("touch"===t.pointerType||pn())}const yn=(t,e)=>!!e&&(t===e||yn(t,e.parentElement)),gn=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,vn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function xn(t){return vn.has(t.tagName)||!0===t.isContentEditable}const Tn=new WeakSet;function wn(t){return e=>{"Enter"===e.key&&t(e)}}function bn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Sn(t){return gn(t)&&!pn()}function Pn(t){return e.isObject(t)&&"ownerSVGElement"in t}const Vn=new WeakMap;let An;const Mn=(t,e,i)=>(n,s)=>s&&s[0]?s[0][t+"Size"]:Pn(n)&&"getBBox"in n?n.getBBox()[e]:n[i],Dn=Mn("inline","width","offsetWidth"),En=Mn("block","height","offsetHeight");function Rn({target:t,borderBoxSize:e}){Vn.get(t)?.forEach(i=>{i(t,{get width(){return Dn(t,e)},get height(){return En(t,e)}})})}function kn(t){t.forEach(Rn)}function Bn(t,e){An||"undefined"!=typeof ResizeObserver&&(An=new ResizeObserver(kn));const i=Hi(t);return i.forEach(t=>{let i=Vn.get(t);i||(i=new Set,Vn.set(t,i)),i.add(e),An?.observe(t)}),()=>{i.forEach(t=>{const i=Vn.get(t);i?.delete(e),i?.size||An?.unobserve(t)})}}const Cn=new Set;let jn;function Ln(t){return Cn.add(t),jn||(jn=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Cn.forEach(e=>e(t))},window.addEventListener("resize",jn)),()=>{Cn.delete(t),Cn.size||"function"!=typeof jn||(window.removeEventListener("resize",jn),jn=void 0)}}function Fn(){const{value:t}=n;null!==t?(t.frameloop.rate.push(a.delta),t.animations.mainThread.push(d.mainThread),t.animations.waapi.push(d.waapi),t.animations.layout.push(d.layout)):r(Fn)}function On(t){return t.reduce((t,e)=>t+e,0)/t.length}function In(t,e=On){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const Un=t=>Math.round(1e3/t);function Nn(){n.value=null,n.addProjectionMetrics=null}function $n(){const{value:t}=n;if(!t)throw new Error("Stats are not being measured");Nn(),r(Fn);const e={frameloop:{setup:In(t.frameloop.setup),rate:In(t.frameloop.rate),read:In(t.frameloop.read),resolveKeyframes:In(t.frameloop.resolveKeyframes),preUpdate:In(t.frameloop.preUpdate),update:In(t.frameloop.update),preRender:In(t.frameloop.preRender),render:In(t.frameloop.render),postRender:In(t.frameloop.postRender)},animations:{mainThread:In(t.animations.mainThread),waapi:In(t.animations.waapi),layout:In(t.animations.layout)},layoutProjection:{nodes:In(t.layoutProjection.nodes),calculatedTargetDeltas:In(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:In(t.layoutProjection.calculatedProjections)}},{rate:i}=e.frameloop;return i.min=Un(i.min),i.max=Un(i.max),i.avg=Un(i.avg),[i.min,i.max]=[i.max,i.min],e}function Wn(t){return Pn(t)&&"svg"===t.tagName}function zn(t,e){if("first"===t)return 0;{const i=e-1;return"last"===t?i:i/2}}function Kn(...t){const e=!Array.isArray(t[0]),i=e?0:-1,n=t[0+i],s=It(t[1+i],t[2+i],t[3+i]);return e?s(n):s}function Yn(t,e){const i=mi(xi(t)?t.get():t);return Xn(i,t,e),i}function Xn(t,e,i={}){const n=t.get();let s,r=null,a=n;const l="string"==typeof n?n.replace(/[\d.-]/g,""):void 0,u=()=>{r&&(r.stop(),r=null)};if(t.attach((e,n)=>{a=e,s=t=>n(Gn(t,l)),o.postRender(()=>{(()=>{u();const e=qn(t.get()),n=qn(a);e!==n&&(r=new Zt({keyframes:[e,n],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...i,onUpdate:s}))})(),t.events.animationStart?.notify(),r?.then(()=>{t.events.animationComplete?.notify()})})},u),xi(e)){const i=e.on("change",e=>t.set(Gn(e,l))),n=t.on("destroy",i);return()=>{i(),n()}}return u}function Gn(t,e){return e?t+e:t}function qn(t){return"number"==typeof t?t:parseFloat(t)}function Hn(t){const e=[];di.current=e;const i=t();di.current=void 0;const n=mi(i);return function(t,e,i){const n=()=>e.set(i()),s=()=>o.preRender(n,!1,!0),a=t.map(t=>t.on("change",s));e.on("destroy",()=>{a.forEach(t=>t()),r(n)})}(e,n,t),n}const Zn=[...ki,I,G],_n=t=>Zn.find(Ri(t));function Jn(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let Qn={},ts=null;const es=(t,e)=>{Qn[t]=e},is=()=>{ts||(ts=document.createElement("style"),ts.id="motion-view");let t="";for(const e in Qn){const i=Qn[e];t+=`${e} {\n`;for(const[e,n]of Object.entries(i))t+=` ${e}: ${n};\n`;t+="}\n"}ts.textContent=t,document.head.appendChild(ts),Qn={}},ns=()=>{ts&&ts.parentElement&&ts.parentElement.removeChild(ts)};function ss(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function os(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}function rs(){return document.getAnimations().filter(os)}const as=["layout","enter","exit","new","old"];function ls(t){const{update:i,targets:n,options:s}=t;if(!document.startViewTransition)return new Promise(async t=>{await i(),t(new Ye([]))});(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||es(":root",{"view-transition-name":"none"}),es("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),is();const o=document.startViewTransition(async()=>{await i()});return o.finished.finally(()=>{ns()}),new Promise(t=>{o.ready.then(()=>{const i=rs(),o=[];n.forEach((t,i)=>{for(const n of as){if(!t[n])continue;const{keyframes:r,options:a}=t[n];for(let[t,l]of Object.entries(r)){if(!l)continue;const r={...oi(s,t),...oi(a,t)},u=Jn(n);if("opacity"===t&&!Array.isArray(l)){l=["new"===u?0:1,l]}"function"==typeof r.delay&&(r.delay=r.delay(0,1)),r.duration&&(r.duration=e.secondsToMilliseconds(r.duration)),r.delay&&(r.delay=e.secondsToMilliseconds(r.delay));const c=new Le({...r,element:document.documentElement,name:t,pseudoElement:`::view-transition-${u}(${i})`,keyframes:l});o.push(c)}}});for(const t of i){if("finished"===t.playState)continue;const{effect:i}=t;if(!(i&&i instanceof KeyframeEffect))continue;const{pseudoElement:r}=i;if(!r)continue;const a=ss(r);if(!a)continue;const l=n.get(a.layer);if(l)us(l,"enter")&&us(l,"exit")&&i.getKeyframes().some(t=>t.mixBlendMode)?o.push(new Ge(t)):t.cancel();else{const n="group"===a.type?"layout":"";let r={...oi(s,n)};r.duration&&(r.duration=e.secondsToMilliseconds(r.duration)),r=je(r);const l=ke(r.ease,r.duration);i.updateTiming({delay:e.secondsToMilliseconds(r.delay??0),duration:r.duration,easing:l}),o.push(new Ge(t))}}t(new Ye(o))})})}function us(t,e){return t?.[e]?.keyframes.opacity}let cs=[],hs=null;function ds(){hs=null;const[t]=cs;var i;t&&(i=t,e.removeItem(cs,i),hs=i,ls(i).then(t=>{i.notifyReady(t),t.finished.finally(ds)}))}function ps(){for(let t=cs.length-1;t>=0;t--){const e=cs[t],{interrupt:i}=e.options;if("immediate"===i){const i=cs.slice(0,t+1).map(t=>t.update),n=cs.slice(t+1);e.update=()=>{i.forEach(t=>t())},cs=[e,...n];break}}hs&&"immediate"!==cs[0]?.options.interrupt||ds()}class ms{constructor(t,i={}){var n;this.currentSubject="root",this.targets=new Map,this.notifyReady=e.noop,this.readyPromise=new Promise(t=>{this.notifyReady=t}),this.update=t,this.options={interrupt:"wait",...i},n=this,cs.push(n),cn.render(ps)}get(t){return this.currentSubject=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,i={}){const{currentSubject:n,targets:s}=this;s.has(n)||s.set(n,{});s.get(n)[t]={keyframes:e,options:i}}then(t,e){return this.readyPromise.then(t,e)}}const fs=()=>({translate:0,scale:1,origin:0,originPoint:0}),ys=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),gs=()=>({min:0,max:0}),vs=()=>({x:{min:0,max:0},y:{min:0,max:0}}),xs={current:null},Ts={current:!1},ws="undefined"!=typeof window;function bs(){if(Ts.current=!0,ws)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>xs.current=t.matches;t.addEventListener("change",e),e()}else xs.current=!1}const Ss=new WeakMap;function Ps(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Vs(t){return"string"==typeof t||Array.isArray(t)}const As=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ms=["initial",...As];function Ds(t){return Ps(t.animate)||Ms.some(e=>Vs(t[e]))}function Es(t){return Boolean(Ds(t)||t.variants)}function Rs(t,e,i){for(const n in e){const s=e[n],o=i[n];if(xi(s))t.addValue(n,s);else if(xi(o))t.addValue(n,mi(s,{owner:t}));else if(o!==s)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(n);t.addValue(n,mi(void 0!==e?e:s,{owner:t}))}}for(const n in i)void 0===e[n]&&t.removeValue(n);return e}const ks=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Bs={};class Cs{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:n,blockInitialAnimation:s,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=be,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=h.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,o.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=a,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=Ds(e),this.isVariantNode=Es(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==l[t]&&xi(e)&&e.set(l[t])}}mount(t){this.current=t,Ss.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Ts.current||bs(),this.shouldReduceMotion=xs.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),r(this.notifyUpdate),r(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 i=ce.has(t);i&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&o.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),s&&s(),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 Bs){const e=Bs[t];if(!e)continue;const{isEnabled:i,Feature:n}=e;if(!this.features[t]&&n&&i(this.props)&&(this.features[t]=new n(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<ks.length;e++){const i=ks[e];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const n=t["on"+i];n&&(this.propEventSubscriptions[i]=this.on(i,n))}this.prevMotionValues=Rs(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 i=this.values.get(t);e!==i&&(i&&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 i=this.values.get(t);return void 0===i&&void 0!==e&&(i=mi(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,i){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(e.isNumericalString(n)||e.isZeroValueString(n))?n=parseFloat(n):!_n(n)&&G.test(i)&&(n=zi(t,i)),this.setBaseTarget(t,xi(n)?n.get():n)),xi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let i;if("string"==typeof e||"object"==typeof e){const n=ui(this.props,e,this.presenceContext?.custom);n&&(i=n[t])}if(e&&void 0!==i)return i;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||xi(n)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:n}on(t,i){return this.events[t]||(this.events[t]=new e.SubscriptionManager),this.events[t].add(i)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){cn.render(this.render)}}class js extends Cs{constructor(){super(...arguments),this.KeyframeResolver=Yi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const i=t.style;return i?i[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;xi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Ls({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function Fs(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}function Os(t){return void 0===t||1===t}function Is({scale:t,scaleX:e,scaleY:i}){return!Os(t)||!Os(e)||!Os(i)}function Us(t){return Is(t)||Ns(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ns(t){return $s(t.x)||$s(t.y)}function $s(t){return t&&"0%"!==t}function Ws(t,e,i){return i+e*(t-i)}function zs(t,e,i,n,s){return void 0!==s&&(t=Ws(t,s,n)),Ws(t,i,n)+e}function Ks(t,e=0,i=1,n,s){t.min=zs(t.min,e,i,n,s),t.max=zs(t.max,e,i,n,s)}function Ys(t,{x:e,y:i}){Ks(t.x,e.translate,e.scale,e.originPoint),Ks(t.y,i.translate,i.scale,i.originPoint)}const Xs=.999999999999,Gs=1.0000000000001;function qs(t,e,i,n=!1){const s=i.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=i[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(n&&o.options.layoutScroll&&o.scroll&&o!==o.root&&_s(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Ys(t,r)),n&&Us(o.latestValues)&&_s(t,o.latestValues))}e.x<Gs&&e.x>Xs&&(e.x=1),e.y<Gs&&e.y>Xs&&(e.y=1)}function Hs(t,e){t.min=t.min+e,t.max=t.max+e}function Zs(t,e,i,n,s=.5){Ks(t,e,i,_(t.min,t.max,s),n)}function _s(t,e){Zs(t.x,e.x,e.scaleX,e.scale,e.originX),Zs(t.y,e.y,e.scaleY,e.scale,e.originY)}function Js(t,e){return Ls(Fs(t.getBoundingClientRect(),e))}const Qs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},to=ue.length;function eo(t,e,i){let n="",s=!0;for(let o=0;o<to;o++){const r=ue[o],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||i){const t=_i(a,Ni[r]);if(!l){s=!1;n+=`${Qs[r]||r}(${t}) `}i&&(e[r]=t)}}return n=n.trim(),i?n=i(e,s?"":n):s&&(n="none"),n}function io(t,e,i){const{style:n,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const i=e[t];if(ce.has(t))r=!0;else if(m(t))s[t]=i;else{const e=_i(i,Ni[t]);t.startsWith("origin")?(a=!0,o[t]=e):n[t]=e}}if(e.transform||(r||i?n.transform=eo(e,t.transform,i):n.transform&&(n.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:i=0}=o;n.transformOrigin=`${t} ${e} ${i}`}}function no(t,{style:e,vars:i},n,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,n),i)o.setProperty(r,i[r])}function so(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const oo={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!C.test(t))return t;t=parseFloat(t)}return`${so(t,e.target.x)}% ${so(t,e.target.y)}%`}},ro={correct:(t,{treeScale:e,projectionDelta:i})=>{const n=t,s=G.parse(t);if(s.length>5)return n;const o=G.createTransformer(t),r="number"!=typeof s[0]?1:0,a=i.x.scale*e.x,l=i.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const u=_(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=u),"number"==typeof s[3+r]&&(s[3+r]/=u),o(s)}},ao={borderRadius:{...oo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:oo,borderTopRightRadius:oo,borderBottomLeftRadius:oo,borderBottomRightRadius:oo,boxShadow:ro};function lo(t){for(const e in t)ao[e]=t[e],m(e)&&(ao[e].isCSSVariable=!0)}function uo(t,{layout:e,layoutId:i}){return ce.has(t)||t.startsWith("origin")||(e||void 0!==i)&&(!!ao[t]||"opacity"===t)}function co(t,e,i){const n=t.style,s=e?.style,o={};if(!n)return o;for(const e in n)(xi(n[e])||s&&xi(s[e])||uo(e,t)||void 0!==i?.getValue(e)?.liveStyle)&&(o[e]=n[e]);return o}class ho extends js{constructor(){super(...arguments),this.type="html",this.renderInstance=no}readValueFromInstance(t,e){if(ce.has(e))return this.projection?.isProjecting?oe(e):ae(t,e);{const n=(i=t,window.getComputedStyle(i)),s=(m(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof s?s.trim():s}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return Js(t,e)}build(t,e,i){io(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return co(t,e,i)}}const po={offset:"stroke-dashoffset",array:"stroke-dasharray"},mo={offset:"strokeDashoffset",array:"strokeDasharray"};function fo(t,e,i=1,n=0,s=!0){t.pathLength=1;const o=s?po:mo;t[o.offset]=""+-n,t[o.array]=`${e} ${i}`}const yo=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function go(t,{attrX:e,attrY:i,attrScale:n,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,u,c){if(io(t,a,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox);for(const t of yo)void 0!==h[t]&&(d[t]=h[t],delete h[t]);void 0!==e&&(h.x=e),void 0!==i&&(h.y=i),void 0!==n&&(h.scale=n),void 0!==s&&fo(h,s,o,r,!1)}const vo=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"]),xo=t=>"string"==typeof t&&"svg"===t.toLowerCase();function To(t,e,i,n){no(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(vo.has(i)?i:bi(i),e.attrs[i])}function wo(t,e,i){const n=co(t,e,i);for(const i in t)if(xi(t[i])||xi(e[i])){n[-1!==ue.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=t[i]}return n}const bo=Ms.length;function So(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&So(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let i=0;i<bo;i++){const n=Ms[i],s=t.props[n];(Vs(s)||!1===s)&&(e[n]=s)}return e}function Po(t,e){if(!Array.isArray(e))return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}const Vo=[...As].reverse(),Ao=As.length;function Mo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Po(e,t)}function Do(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Eo(){return{animate:Do(!0),whileInView:Do(),whileHover:Do(),whileTap:Do(),whileDrag:Do(),whileFocus:Do(),exit:Do()}}function Ro(t,e){t.min=e.min,t.max=e.max}function ko(t,e){Ro(t.x,e.x),Ro(t.y,e.y)}function Bo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Co(t){return t.max-t.min}function jo(t,e,i){return Math.abs(t-e)<=i}function Lo(t,e,i,n=.5){t.origin=n,t.originPoint=_(e.min,e.max,t.origin),t.scale=Co(i)/Co(e),t.translate=_(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Fo(t,e,i,n){Lo(t.x,e.x,i.x,n?n.originX:void 0),Lo(t.y,e.y,i.y,n?n.originY:void 0)}function Oo(t,e,i){t.min=i.min+e.min,t.max=t.min+Co(e)}function Io(t,e,i){Oo(t.x,e.x,i.x),Oo(t.y,e.y,i.y)}function Uo(t,e,i){t.min=e.min-i.min,t.max=t.min+Co(e)}function No(t,e,i){Uo(t.x,e.x,i.x),Uo(t.y,e.y,i.y)}function $o(t,e,i,n,s){return t=Ws(t-=e,1/i,n),void 0!==s&&(t=Ws(t,1/s,n)),t}function Wo(t,e=0,i=1,n=.5,s,o=t,r=t){if(B.test(e)){e=parseFloat(e);e=_(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=_(o.min,o.max,n);t===o&&(a-=e),t.min=$o(t.min,e,i,a,s),t.max=$o(t.max,e,i,a,s)}function zo(t,e,[i,n,s],o,r){Wo(t,e[i],e[n],e[s],e.scale,o,r)}const Ko=["x","scaleX","originX"],Yo=["y","scaleY","originY"];function Xo(t,e,i,n){zo(t.x,e,Ko,i?i.x:void 0,n?n.x:void 0),zo(t.y,e,Yo,i?i.y:void 0,n?n.y:void 0)}function Go(t){return 0===t.translate&&1===t.scale}function qo(t){return Go(t.x)&&Go(t.y)}function Ho(t,e){return t.min===e.min&&t.max===e.max}function Zo(t,e){return Ho(t.x,e.x)&&Ho(t.y,e.y)}function _o(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Jo(t,e){return _o(t.x,e.x)&&_o(t.y,e.y)}function Qo(t){return Co(t.x)/Co(t.y)}function tr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function er(t){return[t("x"),t("y")]}function ir(t,e,i){let n="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=i?.z||0;if((s||o||r)&&(n=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(n+=`scale(${1/e.x}, ${1/e.y}) `),i){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=i;t&&(n=`perspective(${t}px) ${n}`),e&&(n+=`rotate(${e}deg) `),s&&(n+=`rotateX(${s}deg) `),o&&(n+=`rotateY(${o}deg) `),r&&(n+=`skewX(${r}deg) `),a&&(n+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(n+=`scale(${a}, ${l})`),n||"none"}const nr=["TopLeft","TopRight","BottomLeft","BottomRight"],sr=nr.length,or=t=>"string"==typeof t?parseFloat(t):t,rr=t=>"number"==typeof t||C.test(t);function ar(t,e,i,n,s,o){s?(t.opacity=_(0,i.opacity??1,ur(n)),t.opacityExit=_(e.opacity??1,0,cr(n))):o&&(t.opacity=_(e.opacity??1,i.opacity??1,n));for(let s=0;s<sr;s++){const o=`border${nr[s]}Radius`;let r=lr(e,o),a=lr(i,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||rr(r)===rr(a)?(t[o]=Math.max(_(or(r),or(a),n),0),(B.test(a)||B.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||i.rotate)&&(t.rotate=_(e.rotate||0,i.rotate||0,n))}function lr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ur=hr(0,.5,e.circOut),cr=hr(.5,.95,e.noop);function hr(t,i,n){return s=>s<t?0:s>i?1:n(e.progress(t,i,s))}function dr(t,e,i){const n=xi(t)?t:mi(t);return n.start(ai("",n,e,i)),n.animation}function pr(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}const mr=(t,e)=>t.depth-e.depth;class fr{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(mr),this.isDirty=!1,this.children.forEach(t)}}function yr(t,e){const i=h.now(),n=({timestamp:s})=>{const o=s-i;o>=e&&(r(n),t(o-e))};return o.setup(n,!0),()=>r(n)}function gr(t){return xi(t)?t.get():t}class vr{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t),t.scheduleRender()}remove(t){if(e.removeItem(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let i;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){i=e;break}}return!!i&&(this.promote(i),!0)}promote(t,e){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:n}=t.options;!1===n&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:i}=t;e.onExitComplete&&e.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const xr={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Tr={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},wr=["","X","Y","Z"];let br=0;function Sr(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function Pr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=Vi(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",o,!(e||n))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&Pr(n)}function Vr({attachResizeListener:t,defaultParent:i,measureScroll:s,checkIsScrollRoot:u,resetTransform:c}){return class{constructor(t={},e=i?.()){this.id=br++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,n.value&&(Tr.nodes=Tr.calculatedTargetDeltas=Tr.calculatedProjections=0),this.nodes.forEach(Dr),this.nodes.forEach(Lr),this.nodes.forEach(Fr),this.nodes.forEach(Er),n.addProjectionMetrics&&n.addProjectionMetrics(Tr)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new fr)}addEventListener(t,i){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new e.SubscriptionManager),this.eventHandlers.get(t).add(i)}notifyListeners(t,...e){const i=this.eventHandlers.get(t);i&&i.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=Pn(e)&&!Wn(e),this.instance=e;const{layoutId:i,layout:n,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(n||i)&&(this.isLayoutDirty=!0),t){let i,n=0;const s=()=>this.root.updateBlockedByResize=!1;o.read(()=>{n=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==n&&(n=t,this.root.updateBlockedByResize=!0,i&&i(),i=yr(s,250),xr.hasAnimatedSinceResize&&(xr.hasAnimatedSinceResize=!1,this.nodes.forEach(jr)))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||n)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Wr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Jo(this.targetLayout,n),u=!e&&i;if(this.options.layoutRoot||this.resumeFrom||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...oi(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,u)}else e||jr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),r(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Or),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Pr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:i}=this.options;if(void 0===e&&!i)return;const n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(kr);if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Br);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Cr),this.nodes.forEach(Ar),this.nodes.forEach(Mr)):this.nodes.forEach(Br),this.clearAllSnapshots();const t=h.now();a.delta=e.clamp(0,1e3/60,t-a.timestamp),a.timestamp=t,a.isProcessing=!0,l.update.process(a),l.preRender.process(a),l.render.process(a),a.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,cn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Rr),this.sharedNodes.forEach(Ir)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,o.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){o.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Co(this.snapshot.measuredBox.x)||Co(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=u(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!c)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!qo(this.projectionDelta),i=this.getTransformTemplate(),n=i?i(this.latestValues,""):void 0,s=n!==this.prevTransformTemplateValue;t&&this.instance&&(e||Us(this.latestValues)||s)&&(c(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let i=this.removeElementScroll(e);var n;return t&&(i=this.removeTransform(i)),Yr((n=i).x),Yr(n.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Gr))){const{scroll:t}=this.root;t&&(Hs(e.x,t.offset.x),Hs(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(ko(e,t),this.scroll?.wasRoot)return e;for(let i=0;i<this.path.length;i++){const n=this.path[i],{scroll:s,options:o}=n;n!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&ko(e,t),Hs(e.x,s.offset.x),Hs(e.y,s.offset.y))}return e}applyTransform(t,e=!1){const i={x:{min:0,max:0},y:{min:0,max:0}};ko(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&_s(i,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),Us(n.latestValues)&&_s(i,n.latestValues)}return Us(this.latestValues)&&_s(i,this.latestValues),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};ko(e,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!Us(i.latestValues))continue;Is(i.latestValues)&&i.updateSnapshot();const n=vs();ko(n,i.measurePageBox()),Xo(e,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,n)}return Us(this.latestValues)&&Xo(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==a.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const i=Boolean(this.resumingFrom)||this!==e;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(!this.layout||!s&&!o)return;this.resolvedRelativeTargetAt=a.timestamp;const r=this.getClosestProjectingParent();r&&this.linkedParentVersion!==r.layoutVersion&&!r.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Io(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):ko(this.target,this.layout.layoutBox),Ys(this.target,this.targetDelta)):ko(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,r&&Boolean(r.resumingFrom)===Boolean(this.resumingFrom)&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0),n.value&&Tr.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!Is(this.parent.latestValues)&&!Ns(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,i){this.relativeParent=t,this.linkedParentVersion=t.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},No(this.relativeTargetOrigin,e,i),ko(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let i=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(i=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===a.timestamp&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;ko(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,l=this.treeScale.y;qs(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:u}=t;u?(this.projectionDelta&&this.prevProjectionDelta?(Bo(this.prevProjectionDelta.x,this.projectionDelta.x),Bo(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Fo(this.projectionDelta,this.layoutCorrected,u,this.latestValues),this.treeScale.x===r&&this.treeScale.y===l&&tr(this.projectionDelta.x,this.prevProjectionDelta.x)&&tr(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",u)),n.value&&Tr.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const i=this.snapshot,n=i?i.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some($r));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const i=e/1e3;var l,d,p,m;Ur(o.x,t.x,i),Ur(o.y,t.y,i),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(No(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,d=this.relativeTargetOrigin,p=r,m=i,Nr(l.x,d.x,p.x,m),Nr(l.y,d.y,p.y,m),h&&Zo(this.relativeTarget,h)&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),ko(h,this.relativeTarget)),a&&(this.animationValues=s,ar(s,n,this.latestValues,i,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(r(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=o.update(()=>{xr.hasAnimatedSinceResize=!0,d.layout++,this.motionValue||(this.motionValue=mi(0)),this.currentAnimation=dr(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{d.layout--},onComplete:()=>{d.layout--,t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:i,layout:n,latestValues:s}=t;if(e&&i&&n){if(this!==t&&this.layout&&n&&Xr(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Co(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const n=Co(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}ko(e,i),_s(e,s),Fo(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new vr);this.sharedNodes.get(t).add(e);const i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){const n=this.getStack();n&&n.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;const n={};i.z&&Sr("z",t,n,this.animationValues);for(let e=0;e<wr.length;e++)Sr(`rotate${wr[e]}`,t,n,this.animationValues),Sr(`skew${wr[e]}`,t,n,this.animationValues);t.render();for(const e in n)t.setStaticValue(e,n[e]),this.animationValues&&(this.animationValues[e]=n[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=gr(e?.pointerEvents)||"",void(t.transform=i?i(this.latestValues,""):"none");const n=this.getLead();if(!this.projectionDelta||!this.layout||!n.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=gr(e?.pointerEvents)||""),void(this.hasProjected&&!Us(this.latestValues)&&(t.transform=i?i({},""):"none",this.hasProjected=!1));t.visibility="";const s=n.animationValues||n.latestValues;this.applyTransformsToTarget();let o=ir(this.projectionDeltaWithTransform,this.treeScale,s);i&&(o=i(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,n.animationValues?t.opacity=n===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=n===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in ao){if(void 0===s[e])continue;const{correct:i,applyTo:r,isCSSVariable:a}=ao[e],l="none"===o?s[e]:i(s[e],n);if(r){const e=r.length;for(let i=0;i<e;i++)t[r[i]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=n===this?gr(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(kr),this.root.sharedNodes.clear()}}}function Ar(t){t.updateLayout()}function Mr(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:n}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;"size"===s?er(t=>{const n=o?e.measuredBox[t]:e.layoutBox[t],s=Co(n);n.min=i[t].min,n.max=n.min+s}):Xr(s,e.layoutBox,i)&&er(n=>{const s=o?e.measuredBox[n]:e.layoutBox[n],r=Co(i[n]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[n].max=t.relativeTarget[n].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Fo(r,i,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Fo(a,t.applyTransform(n,!0),e.measuredBox):Fo(a,i,e.layoutBox);const l=!qo(r);let u=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:s,layout:o}=n;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};No(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};No(a,i,o.layoutBox),Jo(r,a)||(u=!0),n.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Dr(t){n.value&&Tr.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Er(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Rr(t){t.clearSnapshot()}function kr(t){t.clearMeasurements()}function Br(t){t.isLayoutDirty=!1}function Cr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function jr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Lr(t){t.resolveTargetDelta()}function Fr(t){t.calcProjection()}function Or(t){t.resetSkewAndRotation()}function Ir(t){t.removeLeadSnapshot()}function Ur(t,e,i){t.translate=_(e.translate,0,i),t.scale=_(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function Nr(t,e,i,n){t.min=_(e.min,i.min,n),t.max=_(e.max,i.max,n)}function $r(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Wr={duration:.45,ease:[.4,0,.1,1]},zr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Kr=zr("applewebkit/")&&!zr("chrome/")?Math.round:e.noop;function Yr(t){t.min=Kr(t.min),t.max=Kr(t.max)}function Xr(t,e,i){return"position"===t||"preserve-aspect"===t&&!jo(Qo(e),Qo(i),.2)}function Gr(t){return t!==t.root&&t.scroll?.wasRoot}const qr=Vr({attachResizeListener:(t,e)=>pr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Hr=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Zr(){const t=new Set,e=new WeakMap,i=()=>t.forEach(Hr);return{add:n=>{t.add(n),e.set(n,n.addEventListener("willUpdate",i))},remove:n=>{t.delete(n);const s=e.get(n);s&&(s(),e.delete(n)),i()},dirty:i}}const _r={current:void 0},Jr=Vr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!_r.current){const t=new qr({});t.mount(window),t.setOptions({layoutScroll:!0}),_r.current=t}return _r.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Qr(t){const e=Array.from(t.querySelectorAll("[data-layout], [data-layout-id]"));var i;return t instanceof Element&&((i=t).hasAttribute("data-layout")||i.hasAttribute("data-layout-id"))&&e.unshift(t),e}function ta(t){return t.getAttribute("data-layout-id")}let ea=!1;const ia=new WeakMap;function na(t){let e=0,i=t.parentElement;for(;i;)e++,i=i.parentElement;return e}function sa(t,e){let i=t.parentElement;for(;i;){const t=e.get(i);if(t)return t;i=i.parentElement}}function oa(t,e,i,n){const s=ia.get(t);if(s){const e=s.options.visualElement,o=n?{duration:n.duration,ease:n.ease}:{duration:.3,ease:"easeOut"};return s.setOptions({...s.options,animate:!0,transition:o,...i}),s.instance||s.mount(t),{node:s,visualElement:e}}const o={},r=new ho({visualState:{latestValues:o,renderState:{transformOrigin:{},transform:{},style:{},vars:{}}},presenceContext:null,props:{}}),a=new Jr(o,e),l=n?{duration:n.duration,ease:n.ease}:{duration:.3,ease:"easeOut"};return a.setOptions({visualElement:r,layout:!0,animate:!0,transition:l,...i}),a.mount(t),r.projection=a,ia.set(t,a),{node:a,visualElement:r}}function ra(t,e,i){ea||(ea=!0,lo({borderRadius:{...oo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:oo,borderTopRightRadius:oo,borderBottomLeftRadius:oo,borderBottomRightRadius:oo,boxShadow:ro}));const n=e?.nodes??new Map,s=e?.visualElements??new Map,o=e?.group??Zr(),r=i?.defaultTransition,a=i?.sharedTransitions,l=[...t].sort((t,e)=>na(t)-na(e));let u=e?.root;for(const t of l){if(n.has(t))continue;const e=sa(t,n),i=ta(t),l={layoutId:i??void 0,animationType:aa(t.getAttribute("data-layout"))},c=i&&a?.get(i)?a.get(i):r,{node:h,visualElement:d}=oa(t,e,l,c);n.set(t,h),s.set(t,d),o.add(h),u||(u=h.root)}return{nodes:n,visualElements:s,group:o,root:u}}function aa(t){return"position"===t?"position":"size"===t?"size":"preserve-aspect"===t?"preserve-aspect":"both"}const la=o,ua=i.reduce((t,e)=>(t[e]=t=>r(t),t),{});t.AsyncMotionValueAnimation=Ke,t.DOMKeyframesResolver=Yi,t.DOMVisualElement=js,t.DocumentProjectionNode=qr,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=fr,t.GroupAnimation=Ye,t.GroupAnimationWithThen=class extends Ye{then(t,e){return this.finished.finally(t).then(()=>{})}},t.HTMLProjectionNode=Jr,t.HTMLVisualElement=ho,t.JSAnimation=Zt,t.KeyframeResolver=be,t.LayoutAnimationBuilder=class{constructor(t,i,n){this.sharedTransitions=new Map,this.notifyReady=e.noop,this.executed=!1,this.scope=t,this.updateDom=i,this.defaultOptions=n,this.readyPromise=new Promise(t=>{this.notifyReady=t}),queueMicrotask(()=>this.execute())}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}async execute(){if(this.executed)return;let t;this.executed=!0;const e=Qr(this.scope);if(e.length>0){t=ra(e,void 0,this.getBuildOptions()),t.root.startUpdate();for(const e of t.nodes.values())e.isLayoutDirty=!1,e.willUpdate()}this.updateDom();const i=Qr(this.scope),n=new Set(e),s=new Set(i),r=i.filter(t=>!n.has(t)),a=e.filter(t=>!s.has(t));if(r.length>0&&(t=ra(r,t,this.getBuildOptions())),!t)return void this.notifyReady(new Ye([]));for(const e of a){const i=t.nodes.get(e);i?.getStack()?.remove(i)}for(const e of r)t.nodes.get(e)?.promote();t.root.didUpdate(),await new Promise(t=>o.postRender(()=>t()));const l=[];for(const e of t.nodes.values())e.currentAnimation&&l.push(e.currentAnimation);const u=new Ye(l);u.finished.then(()=>{const e=new Set;for(const i of t.nodes.keys())document.contains(i)||e.add(i);!function(t,e){const i=e?[...t.nodes.entries()].filter(([t])=>e.has(t)):[...t.nodes.entries()];for(const[e,n]of i)t.group.remove(n),n.unmount(),ia.get(e)===n&&ia.delete(e),t.nodes.delete(e),t.visualElements.delete(e)}(t,e)}),this.notifyReady(u)}getBuildOptions(){return{defaultTransition:this.defaultOptions||{duration:.3,ease:"easeOut"},sharedTransitions:this.sharedTransitions.size>0?this.sharedTransitions:void 0}}},t.MotionValue=pi,t.NativeAnimation=Le,t.NativeAnimationExtended=Ie,t.NativeAnimationWrapper=Ge,t.NodeStack=vr,t.ObjectVisualElement=class extends Cs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const i=t[e];if("string"==typeof i||"number"==typeof i)return i}}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}},t.SVGVisualElement=class extends js{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=vs}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(ce.has(e)){const t=Wi(e);return t&&t.default||0}return e=vo.has(e)?e:bi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return wo(t,e,i)}build(t,e,i){go(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){To(t,e,0,n)}mount(t){this.isSVGTag=xo(t.tagName),super.mount(t)}},t.ViewTransitionBuilder=ms,t.VisualElement=Cs,t.acceleratedValues=qi,t.activeAnimations=d,t.addAttrValue=tn,t.addDomEvent=pr,t.addScaleCorrector=lo,t.addStyleValue=an,t.addValueToWillChange=wi,t.alpha=T,t.analyseComplexValue=z,t.animateMotionValue=ai,t.animateSingleValue=dr,t.animateTarget=Mi,t.animateValue=function(t){return new Zt(t)},t.animateVariant=Di,t.animateView=function(t,e={}){return new ms(t,e)},t.animateVisualElement=Ei,t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=Ks,t.applyBoxDelta=Ys,t.applyGeneratorOptions=je,t.applyPointDelta=zs,t.applyPxDefaults=function(t,e){for(let i=0;i<t.length;i++)"number"==typeof t[i]&&Xi.has(e)&&(t[i]=t[i]+"px")},t.applyTreeDeltas=qs,t.aspectRatio=Qo,t.attachFollow=Xn,t.attachSpring=function(t,e,i){return Xn(t,e,{type:"spring",...i})},t.attrEffect=en,t.axisDeltaEquals=tr,t.axisEquals=Ho,t.axisEqualsRounded=_o,t.boxEquals=Zo,t.boxEqualsRounded=Jo,t.buildHTMLStyles=io,t.buildProjectionTransform=ir,t.buildSVGAttrs=go,t.buildSVGPath=fo,t.buildTransform=eo,t.calcAxisDelta=Lo,t.calcBoxDelta=Fo,t.calcChildStagger=He,t.calcGeneratorDuration=pt,t.calcLength=Co,t.calcRelativeAxis=Oo,t.calcRelativeAxisPosition=Uo,t.calcRelativeBox=Io,t.calcRelativePosition=No,t.camelCaseAttributes=vo,t.camelToDash=bi,t.cancelFrame=r,t.cancelMicrotask=hn,t.cancelSync=ua,t.checkVariantsDidChange=Mo,t.cleanDirtyNodes=Er,t.collectMotionValues=di,t.color=I,t.compareByDepth=mr,t.complex=G,t.containsCSSVariable=v,t.convertBoundingBoxToBox=Ls,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=$t,t.copyAxisDeltaInto=Bo,t.copyAxisInto=Ro,t.copyBoxInto=ko,t.correctBorderRadius=oo,t.correctBoxShadow=ro,t.createAnimationState=function(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:i})=>Ei(t,e,i)))}(t),i=Eo(),n=!0;const s=e=>(i,n)=>{const s=ci(t,n,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...n}=s;i={...i,...n,...e}}return i};function o(o){const{props:r}=t,a=So(t.parent)||{},l=[],u=new Set;let c={},h=1/0;for(let e=0;e<Ao;e++){const d=Vo[e],p=i[d],m=void 0!==r[d]?r[d]:a[d],f=Vs(m),y=d===o?p.isActive:null;!1===y&&(h=e);let g=m===a[d]&&m!==r[d]&&f;if(g&&n&&t.manuallyAnimateOnMount&&(g=!1),p.protectedKeys={...c},!p.isActive&&null===y||!m&&!p.prevProp||Ps(m)||"boolean"==typeof m)continue;const v=Mo(p.prevProp,m);let x=v||d===o&&p.isActive&&!g&&f||e>h&&f,T=!1;const w=Array.isArray(m)?m:[m];let b=w.reduce(s(d),{});!1===y&&(b={});const{prevResolvedValues:S={}}=p,P={...S,...b},V=e=>{x=!0,u.has(e)&&(T=!0,u.delete(e)),p.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in P){const e=b[t],i=S[t];if(c.hasOwnProperty(t))continue;let n=!1;n=fi(e)&&fi(i)?!Po(e,i):e!==i,n?null!=e?V(t):u.add(t):void 0!==e&&u.has(t)?V(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=b,p.isActive&&(c={...c,...b}),n&&t.blockInitialAnimation&&(x=!1);const A=g&&v;x&&(!A||T)&&l.push(...w.map(e=>{const i={type:d};if("string"==typeof e&&n&&!A&&t.manuallyAnimateOnMount&&t.parent){const{parent:n}=t,s=ci(n,e);if(n.enteringChildren&&s){const{delayChildren:e}=s.transition||{};i.delay=He(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(u.size){const e={};if("boolean"!=typeof r.initial){const i=ci(t,Array.isArray(r.initial)?r.initial[0]:r.initial);i&&i.transition&&(e.transition=i.transition)}u.forEach(i=>{const n=t.getBaseTarget(i),s=t.getValue(i);s&&(s.liveStyle=!0),e[i]=n??null}),l.push({animation:e})}let d=Boolean(l.length);return!n||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),n=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,n){if(i[e].isActive===n)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,n)),i[e].isActive=n;const s=o(e);for(const t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=Eo()}}},t.createAxis=gs,t.createAxisDelta=fs,t.createBox=vs,t.createDelta=ys,t.createGeneratorEasing=mt,t.createProjectionNode=Vr,t.createRenderBatcher=s,t.cubicBezierAsString=Ee,t.defaultEasing=Wt,t.defaultOffset=Nt,t.defaultTransformValue=oe,t.defaultValueTypes=$i,t.degrees=k,t.delay=yr,t.delayInSeconds=function(t,i){return yr(t,e.secondsToMilliseconds(i))},t.dimensionValueTypes=ki,t.eachAxis=er,t.fillOffset=Ut,t.fillWildcards=_t,t.findDimensionValueType=Bi,t.findValueType=_n,t.flushKeyframeResolvers=we,t.followValue=Yn,t.frame=o,t.frameData=a,t.frameSteps=l,t.generateLinearEasing=ht,t.getAnimatableNone=zi,t.getAnimationMap=function(t){const e=qe.get(t)||new Map;return qe.set(t,e),e},t.getComputedStyle=function(t,e){const i=window.getComputedStyle(t);return Se(e)?i.getPropertyValue(e):i[e]},t.getDefaultTransition=ii,t.getDefaultValueType=Wi,t.getFeatureDefinitions=function(){return Bs},t.getFinalKeyframe=si,t.getMixer=ot,t.getOptimisedAppearId=Vi,t.getOriginIndex=zn,t.getValueAsType=_i,t.getValueTransition=oi,t.getVariableValue=Je,t.getVariantContext=So,t.getViewAnimationLayerInfo=ss,t.getViewAnimations=rs,t.globalProjectionState=xr,t.has2DTranslate=Ns,t.hasReducedMotionListener=Ts,t.hasScale=Is,t.hasTransform=Us,t.hex=E,t.hover=function(t,e,i={}){const[n,s,o]=mn(t,i),r=t=>{if(!fn(t))return;const{target:i}=t,n=e(i,t);if("function"!=typeof n||!i)return;const o=t=>{fn(t)&&(n(t),i.removeEventListener("pointerleave",o))};i.addEventListener("pointerleave",o,s)};return n.forEach(t=>{t.addEventListener("pointerenter",r,s)}),o},t.hsla=O,t.hslaToRgba=H,t.inertia=Ot,t.initPrefersReducedMotion=bs,t.interpolate=It,t.invisibleValues=it,t.isAnimationControls=Ps,t.isCSSVariableName=m,t.isCSSVariableToken=y,t.isControllingVariants=Ds,t.isDeltaZero=qo,t.isDragActive=pn,t.isDragging=dn,t.isElementKeyboardAccessible=xn,t.isForcedMotionValue=uo,t.isGenerator=Ce,t.isHTMLElement=sn,t.isKeyframesTarget=fi,t.isMotionValue=xi,t.isNear=jo,t.isNodeOrChild=yn,t.isPrimaryPointer=gn,t.isSVGElement=Pn,t.isSVGSVGElement=Wn,t.isSVGTag=xo,t.isTransitionDefined=ri,t.isVariantLabel=Vs,t.isVariantNode=Es,t.isWaapiSupportedEasing=function t(i){return Boolean("function"==typeof i&&De()||!i||"string"==typeof i&&(i in Re||De())||e.isBezierDefinition(i)||Array.isArray(i)&&i.every(t))},t.isWillChangeMotionValue=Ti,t.keyframes=zt,t.makeAnimationInstant=Ne,t.mapEasingToNativeEasing=ke,t.mapValue=function(t,e,i,n){const s=Kn(e,i,n);return Hn(()=>s(t.get()))},t.maxGeneratorDuration=dt,t.measurePageBox=function(t,e,i){const n=Js(t,i),{scroll:s}=e;return s&&(Hs(n.x,s.offset.x),Hs(n.y,s.offset.y)),n},t.measureViewportBox=Js,t.microtask=cn,t.mix=ut,t.mixArray=rt,t.mixColor=et,t.mixComplex=lt,t.mixImmediate=Z,t.mixLinearColor=J,t.mixNumber=_,t.mixObject=at,t.mixValues=ar,t.mixVisibility=nt,t.motionValue=mi,t.nodeGroup=Zr,t.number=x,t.numberValueTypes=Ni,t.observeTimeline=function(t,e){let i;const n=()=>{const{currentTime:n}=e,s=(null===n?0:n.value)/100;i!==s&&t(s),i=s};return o.preUpdate(n,!0),()=>r(n)},t.optimizedAppearDataAttribute=Pi,t.optimizedAppearDataId=Si,t.parseAnimateLayoutArgs=function(t,e,i){if("function"==typeof t)return{scope:document,updateDom:t,defaultOptions:e};const n=Hi(t)[0]||document;return{scope:(Document,n),updateDom:e,defaultOptions:i}},t.parseCSSVariable=_e,t.parseValueFromTransform=re,t.percent=B,t.pixelsToPercent=so,t.positionalKeys=hi,t.prefersReducedMotion=xs,t.press=function(t,e,i={}){const[n,s,o]=mn(t,i),r=t=>{const n=t.currentTarget;if(!Sn(t))return;Tn.add(n);const o=e(n,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Tn.has(n)&&Tn.delete(n),Sn(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,n===window||n===document||i.useGlobalTarget||yn(n,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return n.forEach(t=>{(i.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),sn(t)&&(t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const n=wn(()=>{if(Tn.has(i))return;bn(i,"down");const t=wn(()=>{bn(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>bn(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),xn(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progressPercentage=F,t.propEffect=nn,t.propagateDirtyNodes=Dr,t.px=C,t.readTransformValue=ae,t.recordStats=function(){if(n.value)throw Nn(),new Error("Stats are already being measured");const t=n;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:i}=t.value;i.nodes.push(e.nodes),i.calculatedTargetDeltas.push(e.calculatedTargetDeltas),i.calculatedProjections.push(e.calculatedProjections)},o.postRender(Fn,!0),$n},t.removeAxisDelta=Wo,t.removeAxisTransforms=zo,t.removeBoxTransforms=Xo,t.removePointDelta=$o,t.renderHTML=no,t.renderSVG=To,t.resize=function(t,e){return"function"==typeof t?Ln(t):Bn(t,e)},t.resolveElements=Hi,t.resolveMotionValue=gr,t.resolveVariant=ci,t.resolveVariantFromProps=ui,t.rgbUnit=M,t.rgba=D,t.rootProjectionNode=_r,t.scale=w,t.scaleCorrectors=ao,t.scalePoint=Ws,t.scrapeHTMLMotionValuesFromProps=co,t.scrapeSVGMotionValuesFromProps=wo,t.setDragLock=function(t){return"x"===t||"y"===t?dn[t]?null:(dn[t]=!0,()=>{dn[t]=!1}):dn.x||dn.y?null:(dn.x=dn.y=!0,()=>{dn.x=dn.y=!1})},t.setFeatureDefinitions=function(t){Bs=t},t.setStyle=Pe,t.setTarget=vi,t.spring=Ft,t.springValue=function(t,e){return Yn(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:i=0,from:n=0,ease:s}={}){return(o,r)=>{const a="number"==typeof n?n:zn(n,r),l=Math.abs(a-o);let u=t*l;if(s){const i=r*t;u=e.easingDefinitionToFunction(s)(u/i)*i}return i+u}},t.startWaapiAnimation=Be,t.statsBuffer=n,t.styleEffect=ln,t.supportedWaapiEasing=Re,t.supportsBrowserAnimation=ze,t.supportsFlags=Ae,t.supportsLinearEasing=De,t.supportsPartialKeyframes=Gi,t.supportsScrollTimeline=Ve,t.svgEffect=un,t.sync=la,t.testValueType=Ri,t.time=h,t.transform=Kn,t.transformAxis=Zs,t.transformBox=_s,t.transformBoxPoints=Fs,t.transformPropOrder=ue,t.transformProps=ce,t.transformValue=Hn,t.transformValueTypes=Ui,t.translateAxis=Hs,t.updateMotionValuesFromProps=Rs,t.variantPriorityOrder=As,t.variantProps=Ms,t.vh=j,t.visualElementStore=Ss,t.vw=L});