2 lines
107 KiB
JavaScript
2 lines
107 KiB
JavaScript
!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,c=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},c=0;function u(e){a.has(e)&&(h.schedule(e),t()),c++,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(u),e&&n.value&&n.value.frameloop[e].push(c),c=0,i.clear(),o=!1,r&&(r=!1,h.process(t)))}};return h}(l,s?e:void 0),t),{}),{setup:u,read:h,resolveKeyframes:d,preUpdate:p,update:m,preRender:f,render:y,postRender:g}=c,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,u.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=c[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++)c[i[e]].cancel(t)},state:a,steps:c}}const{schedule:o,cancel:r,state:a,steps:l}=s("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e.noop,!0);let c;function u(){c=void 0}const h={now:()=>(void 0===c&&h.set(a.isProcessing||e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now()),c),set:t=>{c=t,queueMicrotask(u)}},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 V=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,P=(t,e)=>i=>Boolean("string"==typeof i&&V.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:P("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 k={test:P("#"),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},E=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),R=E("deg"),B=E("%"),C=E("px"),j=E("vh"),F=E("vw"),L=(()=>({...B,parse:t=>B.parse(t)/100,transform:t=>B.transform(100*t)}))(),O={test:P("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)||k.test(t)||O.test(t),parse:t=>D.test(t)?D.parse(t):O.test(t)?O.parse(t):k.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=[k,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 ct(t,e,i){if("number"==typeof t&&"number"==typeof e&&"number"==typeof i)return _(t,e,i);return ot(t)(t,e)}const ut=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},Vt={granular:.005,default:.5},Pt=.01,At=10,Mt=.05,Dt=1,kt=.001;function Et({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(Pt,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 kt-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),c=Bt(Math.pow(e,2),a);return(-o(e)+kt>0?-1:1)*((s-r)*l)/c}):(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<Rt;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 Rt=12;function Bt(t,e){return t*Math.sqrt(1-e*e)}const Ct=["duration","bounce"],jt=["stiffness","damping","mass"];function Ft(t,e){return e.some(e=>void 0!==t[e])}function Lt(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:c,damping:u,mass:h,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let i={velocity:xt,stiffness:yt,damping:gt,mass:vt,isResolvedFromDuration:!1,...t};if(!Ft(t,jt)&&Ft(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=Et(t);i={...i,...e,mass:vt},i.isResolvedFromDuration=!0}return i}({...n,velocity:-e.millisecondsToSeconds(n.velocity||0)}),f=p||0,y=u/(2*Math.sqrt(c*h)),g=a-r,v=e.millisecondsToSeconds(Math.sqrt(c/h)),x=Math.abs(g)<5;let T;if(s||(s=x?St.granular:St.default),o||(o=x?Vt.granular:Vt.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,c=Math.abs(a-i)<=o;l.done=r&&c}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:c=.5,restSpeed:u}){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)<=c,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=Lt({keyframes:[d.value,p(d.value)],velocity:ft(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};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||ct,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),c=l.length,u=n=>{if(a&&n<t[0])return i[0];let s=0;if(c>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=>u(e.clamp(t[0],t[r-1],i)):u}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)}}Lt.applyToOptions=t=>{const i=mt(t,100,Lt);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:Lt};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,ct(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});"mirror"===o&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-r})),null===c.calculatedDuration&&(c.calculatedDuration=pt(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=c}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:c=0,keyframes:u,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-c*(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:u[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(u,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=ut,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 ce=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ue=(()=>new Set(ce))(),he=t=>t===x||t===C,de=new Set(["x","y","z"]),pe=ce.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 Ve(t,e,i){Se(e)?t.style.setProperty(e,i):t.style[e]=i}const Pe=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"),ke=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,Ee={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ke([0,.65,.55,1]),circOut:ke([.55,0,1,.45]),backIn:ke([.31,.01,.66,-.59]),backOut:ke([.33,1.53,.69,.99])};function Re(t,i){return t?"function"==typeof t?De()?ht(t,i):"ease-out":e.isBezierDefinition(t)?ke(t):Array.isArray(t)?t.map(t=>Re(t,i)||Ee.easeOut):Ee[t]:void 0}function Be(t,e,i,{delay:s=0,duration:o=300,repeat:r=0,repeatType:a="loop",ease:l="easeOut",times:c}={},u=void 0){const h={[e]:i};c&&(h.offset=c);const p=Re(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"};u&&(m.pseudoElement=u);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 Fe 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 c=je(t);this.animation=Be(i,n,s,c,o),!1===c.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):Ve(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&&Pe()?(this.animation.timeline=t,e.noop):i(this)}}const Le={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function Oe(t){"string"==typeof t.ease&&t.ease in Le&&(t.ease=Le[t.ease])}class Ie extends Fe{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),c=e.clamp(0,10,l-10);i.setWithVelocity(a.sample(Math.max(0,l-c)).value,a.sample(l).value,c),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:c}=e.owner.getProps();return We()&&i&&$e.has(i)&&("transform"!==i||!c)&&!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:c,...u}){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:c,...u},p=c?.KeyframeResolver||be;this.keyframeResolver=new p(r,(t,e,i)=>this.onKeyframesResolved(t,e,d,!i),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,i,n,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=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||u?.(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=!c&&Ke(d)?new Ie({...d,element:d.motionValue.owner.current}):new Zt(d);p.finished.then(()=>this.notifyFinished()).catch(e.noop),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}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 Fe{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const qe=new WeakMap;const He=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ze(t){const e=He.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}function _e(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]=Ze(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)?_e(o,i,n+1):o}function Je(t,e){return t?.[e]??t?.default??t}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:ue.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Qe:ei;function ni({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const si=t=>null!==t;function oi(t,{repeat:e,repeatType:i="loop"},n){const s=t.filter(si),o=e&&"loop"!==i&&e%2==1?0:s.length-1;return o&&void 0!==n?n:s[o]}function ri(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 ai=(t,i,n,s={},r,a)=>l=>{const c=Je(s,t)||{},u=c.delay||s.delay||0;let{elapsed:h=0}=s;h-=e.secondsToMilliseconds(u);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:i.getVelocity(),...c,delay:-h,onUpdate:t=>{i.set(t),c.onUpdate&&c.onUpdate(t)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:t,motionValue:i,element:a?void 0:r};ni(c)||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=!c.type&&!c.ease,p&&!a&&void 0!==i.get()){const t=oi(d.keyframes,c);if(void 0!==t)return void o.update(()=>{d.onUpdate(t),d.onComplete()})}return c.isSync?new Zt(d):new ze(d)},li=new Set(["width","height","top","left","right","bottom",...ce]),ci={current:void 0};class ui{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 ci.current&&ci.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 hi(t,e){return new ui(t,e)}function di(t){const e=[{},{}];return t?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function pi(t,e,i,n){if("function"==typeof e){const[s,o]=di(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]=di(n);e=e(void 0!==i?i:t.custom,s,o)}return e}function mi(t,e,i){const n=t.getProps();return pi(n,e,void 0!==i?i:n.custom,t)}const fi=t=>Array.isArray(t);function yi(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,hi(i))}function gi(t){return fi(t)?t[t.length-1]||0:t}function vi(t,e){const i=mi(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",Vi="data-"+bi(Si);function Pi(t){return t.props[Vi]}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 c=[],u=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||u&&Ai(u,e))continue;const a={delay:i,...Je(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=Pi(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&&li.has(e)?{type:!1}:a,t,d));const p=n.animation;p&&c.push(p)}return a&&Promise.all(c).then(()=>{o.update(()=>{a&&vi(t,a)})}),c}function Di(t,e,i={}){const n=mi(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)+ri(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 ki(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?mi(t,e,i.custom):e;n=Promise.all(Mi(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}const Ei=t=>e=>e.test(t),Ri=[x,C,B,R,F,j,{test:t=>"auto"===t,parse:t=>t}],Bi=t=>Ri.find(Ei(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 Fi(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 Li=/\b([a-z-]*)\(.*?\)/gu,Oi={...G,getAnimatableNone:t=>{const e=t.match(Li);return e?e.map(Fi).join(" "):t}},Ii={...x,transform:Math.round},Ui={rotate:R,rotateX:R,rotateY:R,rotateZ:R,scale:w,scaleX:w,scaleY:w,scaleZ:w,skew:R,skewX:R,skewY:R,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:T,originX:L,originY:L,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=_e(n,e.current);void 0!==s&&(t[i]=s),i===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!li.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(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)}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 c=e.on("change",l);n&&e.addDependent(n);const u=()=>{c(),i&&r(i),this.values.delete(t),n&&e.removeDependent(n)};return this.values.set(t,{value:e,onRemove:u}),u}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 ue.has(i)?(e.get("transform")||(sn(t)||e.get("transformBox")||an(t,e,"transformBox",new ui("fill-box")),e.set("transform",new ui("none"),()=>{t.style.transform=function(t){let e="",i=!0;for(let n=0;n<ce.length;n++){const s=ce[n],o=t.latest[s];if(void 0===o)continue;let r=!0;r="number"==typeof o?o===(s.startsWith("scale")?1:0):0===parseFloat(o),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 ui(""),()=>{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)),cn=C.transform;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,()=>t.setAttribute("stroke-dashoffset",cn(-e.latest[i]))):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new ui("1 1"),()=>{const{pathLength:i=1,pathSpacing:n}=e.latest;t.setAttribute("stroke-dasharray",`${cn(i)} ${cn(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:hn,cancel:dn}=s(queueMicrotask,!1),pn={x:!1,y:!1};function mn(){return pn.x||pn.y}function fn(t,e){const i=Hi(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function yn(t){return!("touch"===t.pointerType||mn())}const gn=(t,e)=>!!e&&(t===e||gn(t,e.parentElement)),vn=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,xn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Tn(t){return xn.has(t.tagName)||!0===t.isContentEditable}const wn=new WeakSet;function bn(t){return e=>{"Enter"===e.key&&t(e)}}function Sn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Vn(t){return vn(t)&&!mn()}function Pn(t){return e.isObject(t)&&"ownerSVGElement"in t}const An=new WeakMap;let Mn;const Dn=(t,e,i)=>(n,s)=>s&&s[0]?s[0][t+"Size"]:Pn(n)&&"getBBox"in n?n.getBBox()[e]:n[i],kn=Dn("inline","width","offsetWidth"),En=Dn("block","height","offsetHeight");function Rn({target:t,borderBoxSize:e}){An.get(t)?.forEach(i=>{i(t,{get width(){return kn(t,e)},get height(){return En(t,e)}})})}function Bn(t){t.forEach(Rn)}function Cn(t,e){Mn||"undefined"!=typeof ResizeObserver&&(Mn=new ResizeObserver(Bn));const i=Hi(t);return i.forEach(t=>{let i=An.get(t);i||(i=new Set,An.set(t,i)),i.add(e),Mn?.observe(t)}),()=>{i.forEach(t=>{const i=An.get(t);i?.delete(e),i?.size||Mn?.unobserve(t)})}}const jn=new Set;let Fn;function Ln(t){return jn.add(t),Fn||(Fn=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};jn.forEach(e=>e(t))},window.addEventListener("resize",Fn)),()=>{jn.delete(t),jn.size||"function"!=typeof Fn||(window.removeEventListener("resize",Fn),Fn=void 0)}}function On(){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(On)}function In(t){return t.reduce((t,e)=>t+e,0)/t.length}function Un(t,e=In){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const Nn=t=>Math.round(1e3/t);function $n(){n.value=null,n.addProjectionMetrics=null}function Wn(){const{value:t}=n;if(!t)throw new Error("Stats are not being measured");$n(),r(On);const e={frameloop:{setup:Un(t.frameloop.setup),rate:Un(t.frameloop.rate),read:Un(t.frameloop.read),resolveKeyframes:Un(t.frameloop.resolveKeyframes),preUpdate:Un(t.frameloop.preUpdate),update:Un(t.frameloop.update),preRender:Un(t.frameloop.preRender),render:Un(t.frameloop.render),postRender:Un(t.frameloop.postRender)},animations:{mainThread:Un(t.animations.mainThread),waapi:Un(t.animations.waapi),layout:Un(t.animations.layout)},layoutProjection:{nodes:Un(t.layoutProjection.nodes),calculatedTargetDeltas:Un(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:Un(t.layoutProjection.calculatedProjections)}},{rate:i}=e.frameloop;return i.min=Nn(i.min),i.max=Nn(i.max),i.avg=Nn(i.avg),[i.min,i.max]=[i.max,i.min],e}function Kn(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 Yn(...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 Xn(t){const e=[];ci.current=e;const i=t();ci.current=void 0;const n=hi(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}function Gn(t,e,i){const n=t.get();let s,r=null,a=n;const l="string"==typeof n?n.replace(/[\d.-]/g,""):void 0,c=()=>{r&&(r.stop(),r=null)};if(t.attach((e,n)=>{a=e,s=t=>n(qn(t,l)),o.postRender(()=>{c(),r=new Zt({keyframes:[Hn(t.get()),Hn(a)],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...i,onUpdate:s}),t.events.animationStart?.notify(),r?.then(()=>{t.events.animationComplete?.notify()})})},c),xi(e)){const i=e.on("change",e=>t.set(qn(e,l))),n=t.on("destroy",i);return()=>{i(),n()}}return c}function qn(t,e){return e?t+e:t}function Hn(t){return"number"==typeof t?t:parseFloat(t)}const Zn=[...Ri,I,G],_n=t=>Zn.find(Ei(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={...Je(s,t),...Je(a,t)},c=Jn(n);if("opacity"===t&&!Array.isArray(l)){l=["new"===c?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 u=new Fe({...r,element:document.documentElement,name:t,pseudoElement:`::view-transition-${c}(${i})`,keyframes:l});o.push(u)}}});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)cs(l,"enter")&&cs(l,"exit")&&i.getKeyframes().some(t=>t.mixBlendMode)?o.push(new Ge(t)):t.cancel();else{const n="group"===a.type?"layout":"";let r={...Je(s,n)};r.duration&&(r.duration=e.secondsToMilliseconds(r.duration)),r=je(r);const l=Re(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 cs(t,e){return t?.[e]?.keyframes.opacity}let us=[],hs=null;function ds(){hs=null;const[t]=us;var i;t&&(i=t,e.removeItem(us,i),hs=i,ls(i).then(t=>{i.notifyReady(t),t.finished.finally(ds)}))}function ps(){for(let t=us.length-1;t>=0;t--){const e=us[t],{interrupt:i}=e.options;if("immediate"===i){const i=us.slice(0,t+1).map(t=>t.update),n=us.slice(t+1);e.update=()=>{i.forEach(t=>t())},us=[e,...n];break}}hs&&"immediate"!==us[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,us.push(n),hn.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 Vs(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Ps(t){return"string"==typeof t||Array.isArray(t)}const As=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ms=["initial",...As];function Ds(t){return Vs(t.animate)||Ms.some(e=>Ps(t[e]))}function ks(t){return Boolean(Ds(t)||t.variants)}function Es(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,hi(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,hi(void 0!==e?e:s,{owner:t}))}}for(const n in i)void 0===e[n]&&t.removeValue(n);return e}const Rs=["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:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=c,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=ks(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...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=ue.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<Rs.length;e++){const i=Rs[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=Es(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=hi(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=pi(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(){hn.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 Fs({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function Ls(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 Fs(Ls(t.getBoundingClientRect(),e))}const Qs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},to=ce.length;function eo(t,e,i){let n="",s=!0;for(let o=0;o<to;o++){const r=ce[o],a=t[r];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(r.startsWith("scale")?1:0):0===parseFloat(a),!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(ue.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 c=_(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},ao={borderRadius:{...oo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:oo,borderTopRightRadius:oo,borderBottomLeftRadius:oo,borderBottomRightRadius:oo,boxShadow:ro};function lo(t,{layout:e,layoutId:i}){return ue.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])||lo(e,t)||void 0!==i?.getValue(e)?.liveStyle)&&(o[e]=n[e]);return o}const uo={offset:"stroke-dashoffset",array:"stroke-dasharray"},ho={offset:"strokeDashoffset",array:"strokeDasharray"};function po(t,e,i=1,n=0,s=!0){t.pathLength=1;const o=s?uo:ho;t[o.offset]=C.transform(-n);const r=C.transform(e),a=C.transform(i);t[o.array]=`${r} ${a}`}const mo=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function fo(t,{attrX:e,attrY:i,attrScale:n,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(io(t,a,c),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=u?.transformBox??"fill-box",delete h.transformBox);for(const t of mo)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&&po(h,s,o,r,!1)}const yo=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"]),go=t=>"string"==typeof t&&"svg"===t.toLowerCase();function vo(t,e,i,n){no(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(yo.has(i)?i:bi(i),e.attrs[i])}function xo(t,e,i){const n=co(t,e,i);for(const i in t)if(xi(t[i])||xi(e[i])){n[-1!==ce.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=t[i]}return n}const To=Ms.length;function wo(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&wo(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let i=0;i<To;i++){const n=Ms[i],s=t.props[n];(Ps(s)||!1===s)&&(e[n]=s)}return e}function bo(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 So=[...As].reverse(),Vo=As.length;function Po(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!bo(e,t)}function Ao(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Mo(){return{animate:Ao(!0),whileInView:Ao(),whileHover:Ao(),whileTap:Ao(),whileDrag:Ao(),whileFocus:Ao(),exit:Ao()}}function Do(t){return t.max-t.min}function ko(t,e,i){return Math.abs(t-e)<=i}function Eo(t,e,i,n=.5){t.origin=n,t.originPoint=_(e.min,e.max,t.origin),t.scale=Do(i)/Do(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 Ro(t,e,i,n){Eo(t.x,e.x,i.x,n?n.originX:void 0),Eo(t.y,e.y,i.y,n?n.originY:void 0)}function Bo(t,e,i){t.min=i.min+e.min,t.max=t.min+Do(e)}function Co(t,e,i){Bo(t.x,e.x,i.x),Bo(t.y,e.y,i.y)}function jo(t,e,i){t.min=e.min-i.min,t.max=t.min+Do(e)}function Fo(t,e,i){jo(t.x,e.x,i.x),jo(t.y,e.y,i.y)}function Lo(t,e,i,n,s){return t=Ws(t-=e,1/i,n),void 0!==s&&(t=Ws(t,1/s,n)),t}function Oo(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=Lo(t.min,e,i,a,s),t.max=Lo(t.max,e,i,a,s)}function Io(t,e,[i,n,s],o,r){Oo(t,e[i],e[n],e[s],e.scale,o,r)}const Uo=["x","scaleX","originX"],No=["y","scaleY","originY"];function $o(t,e,i,n){Io(t.x,e,Uo,i?i.x:void 0,n?n.x:void 0),Io(t.y,e,No,i?i.y:void 0,n?n.y:void 0)}function Wo(t,e){t.min=e.min,t.max=e.max}function Ko(t,e){Wo(t.x,e.x),Wo(t.y,e.y)}function zo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Yo(t){return 0===t.translate&&1===t.scale}function Xo(t){return Yo(t.x)&&Yo(t.y)}function Go(t,e){return t.min===e.min&&t.max===e.max}function qo(t,e){return Go(t.x,e.x)&&Go(t.y,e.y)}function Ho(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Zo(t,e){return Ho(t.x,e.x)&&Ho(t.y,e.y)}function _o(t){return Do(t.x)/Do(t.y)}function Jo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Qo(t){return[t("x"),t("y")]}function tr(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 er=["TopLeft","TopRight","BottomLeft","BottomRight"],ir=er.length,nr=t=>"string"==typeof t?parseFloat(t):t,sr=t=>"number"==typeof t||C.test(t);function or(t,e,i,n,s,o){s?(t.opacity=_(0,i.opacity??1,ar(n)),t.opacityExit=_(e.opacity??1,0,lr(n))):o&&(t.opacity=_(e.opacity??1,i.opacity??1,n));for(let s=0;s<ir;s++){const o=`border${er[s]}Radius`;let r=rr(e,o),a=rr(i,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||sr(r)===sr(a)?(t[o]=Math.max(_(nr(r),nr(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 rr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ar=cr(0,.5,e.circOut),lr=cr(.5,.95,e.noop);function cr(t,i,n){return s=>s<t?0:s>i?1:n(e.progress(t,i,s))}function ur(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 hr(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}function dr(t){return xi(t)?t.get():t}function pr(t,e,i){const n=xi(t)?t:hi(t);return n.start(ai("",n,e,i)),n.animation}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)}}class yr{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 gr={hasAnimatedSinceResize:!0,hasEverUpdated:!1},vr={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},xr=["","X","Y","Z"];let Tr=0;function wr(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function br(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=Pi(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&&br(n)}function Sr({attachResizeListener:t,defaultParent:i,measureScroll:s,checkIsScrollRoot:c,resetTransform:u}){return class{constructor(t={},e=i?.()){this.id=Tr++,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&&(vr.nodes=vr.calculatedTargetDeltas=vr.calculatedProjections=0),this.nodes.forEach(Ar),this.nodes.forEach(Cr),this.nodes.forEach(jr),this.nodes.forEach(Mr),n.addProjectionMetrics&&n.addProjectionMetrics(vr)},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)&&!Kn(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=ur(s,250),gr.hasAnimatedSinceResize&&(gr.hasAnimatedSinceResize=!1,this.nodes.forEach(Br)))})}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()||Nr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Zo(this.targetLayout,n),c=!e&&i;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Je(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c)}else e||Br(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(Fr),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&&br(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(Er);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Rr),this.nodes.forEach(Vr),this.nodes.forEach(Pr)):this.nodes.forEach(Er),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,hn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Dr),this.sharedNodes.forEach(Lr)}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||Do(this.snapshot.measuredBox.x)||Do(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=c(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(!u)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!Xo(this.projectionDelta),i=this.getTransformTemplate(),n=i?i(this.latestValues,""):void 0,s=n!==this.prevTransformTemplateValue;t&&this.instance&&(e||Us(this.latestValues)||s)&&(u(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)),Kr((n=i).x),Kr(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(Yr))){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()),$o(e,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,n)}return Us(this.latestValues)&&$o(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(),Co(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&&vr.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}},Fo(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:c}=t;c?(this.projectionDelta&&this.prevProjectionDelta?(zo(this.prevProjectionDelta.x,this.projectionDelta.x),zo(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Ro(this.projectionDelta,this.layoutCorrected,c,this.latestValues),this.treeScale.x===r&&this.treeScale.y===l&&Jo(this.projectionDelta.x,this.prevProjectionDelta.x)&&Jo(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",c)),n.value&&vr.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(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(Ur));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const i=e/1e3;var l,d,p,m;Or(o.x,t.x,i),Or(o.y,t.y,i),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Fo(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,d=this.relativeTargetOrigin,p=r,m=i,Ir(l.x,d.x,p.x,m),Ir(l.y,d.y,p.y,m),h&&qo(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,or(s,n,this.latestValues,i,u,c)),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(()=>{gr.hasAnimatedSinceResize=!0,d.layout++,this.motionValue||(this.motionValue=hi(0)),this.currentAnimation=pr(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&&zr(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Do(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const n=Do(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}Ko(e,i),_s(e,s),Ro(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new yr);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&&wr("z",t,n,this.animationValues);for(let e=0;e<xr.length;e++)wr(`rotate${xr[e]}`,t,n,this.animationValues),wr(`skew${xr[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=dr(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=dr(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=tr(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?dr(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 Vr(t){t.updateLayout()}function Pr(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?Qo(t=>{const n=o?e.measuredBox[t]:e.layoutBox[t],s=Do(n);n.min=i[t].min,n.max=n.min+s}):zr(s,e.layoutBox,i)&&Qo(n=>{const s=o?e.measuredBox[n]:e.layoutBox[n],r=Do(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}};Ro(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?Ro(a,t.applyTransform(n,!0),e.measuredBox):Ro(a,i,e.layoutBox);const l=!Xo(r);let c=!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}};Fo(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Fo(a,i,o.layoutBox),Zo(r,a)||(c=!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:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Ar(t){n.value&&vr.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 Mr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Dr(t){t.clearSnapshot()}function kr(t){t.clearMeasurements()}function Er(t){t.isLayoutDirty=!1}function Rr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Br(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Cr(t){t.resolveTargetDelta()}function jr(t){t.calcProjection()}function Fr(t){t.resetSkewAndRotation()}function Lr(t){t.removeLeadSnapshot()}function Or(t,e,i){t.translate=_(e.translate,0,i),t.scale=_(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function Ir(t,e,i,n){t.min=_(e.min,i.min,n),t.max=_(e.max,i.max,n)}function Ur(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Nr={duration:.45,ease:[.4,0,.1,1]},$r=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Wr=$r("applewebkit/")&&!$r("chrome/")?Math.round:e.noop;function Kr(t){t.min=Wr(t.min),t.max=Wr(t.max)}function zr(t,e,i){return"position"===t||"preserve-aspect"===t&&!ko(_o(e),_o(i),.2)}function Yr(t){return t!==t.root&&t.scroll?.wasRoot}const Xr=Sr({attachResizeListener:(t,e)=>hr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Gr={current:void 0},qr=Sr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Gr.current){const t=new Xr({});t.mount(window),t.setOptions({layoutScroll:!0}),Gr.current=t}return Gr.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Hr=t=>!t.isLayoutDirty&&t.willUpdate(!1);const Zr=o,_r=i.reduce((t,e)=>(t[e]=t=>r(t),t),{});t.AsyncMotionValueAnimation=ze,t.DOMKeyframesResolver=Yi,t.DOMVisualElement=js,t.DocumentProjectionNode=Xr,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=qr,t.HTMLVisualElement=class extends js{constructor(){super(...arguments),this.type="html",this.renderInstance=no}readValueFromInstance(t,e){if(ue.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)}},t.JSAnimation=Zt,t.KeyframeResolver=be,t.MotionValue=ui,t.NativeAnimation=Fe,t.NativeAnimationExtended=Ie,t.NativeAnimationWrapper=Ge,t.NodeStack=yr,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(ue.has(e)){const t=Wi(e);return t&&t.default||0}return e=yo.has(e)?e:bi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return xo(t,e,i)}build(t,e,i){fo(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){vo(t,e,0,n)}mount(t){this.isSVGTag=go(t.tagName),super.mount(t)}},t.ViewTransitionBuilder=ms,t.VisualElement=Cs,t.acceleratedValues=qi,t.activeAnimations=d,t.addAttrValue=tn,t.addDomEvent=hr,t.addScaleCorrector=function(t){for(const e in t)ao[e]=t[e],m(e)&&(ao[e].isCSSVariable=!0)},t.addStyleValue=an,t.addValueToWillChange=wi,t.alpha=T,t.analyseComplexValue=K,t.animateMotionValue=ai,t.animateSingleValue=pr,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=ki,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=_o,t.attachSpring=Gn,t.attrEffect=en,t.axisDeltaEquals=Jo,t.axisEquals=Go,t.axisEqualsRounded=Ho,t.boxEquals=qo,t.boxEqualsRounded=Zo,t.buildHTMLStyles=io,t.buildProjectionTransform=tr,t.buildSVGAttrs=fo,t.buildSVGPath=po,t.buildTransform=eo,t.calcAxisDelta=Eo,t.calcBoxDelta=Ro,t.calcChildStagger=ri,t.calcGeneratorDuration=pt,t.calcLength=Do,t.calcRelativeAxis=Bo,t.calcRelativeAxisPosition=jo,t.calcRelativeBox=Co,t.calcRelativePosition=Fo,t.camelCaseAttributes=yo,t.camelToDash=bi,t.cancelFrame=r,t.cancelMicrotask=dn,t.cancelSync=_r,t.checkVariantsDidChange=Po,t.cleanDirtyNodes=Mr,t.collectMotionValues=ci,t.color=I,t.compareByDepth=mr,t.complex=G,t.containsCSSVariable=v,t.convertBoundingBoxToBox=Fs,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=zo,t.copyAxisInto=Wo,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})=>ki(t,e,i)))}(t),i=Mo(),n=!0;const s=e=>(i,n)=>{const s=mi(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=wo(t.parent)||{},l=[],c=new Set;let u={},h=1/0;for(let e=0;e<Vo;e++){const d=So[e],p=i[d],m=void 0!==r[d]?r[d]:a[d],f=Ps(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={...u},!p.isActive&&null===y||!m&&!p.prevProp||Vs(m)||"boolean"==typeof m)continue;const v=Po(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,V={...S,...b},P=e=>{x=!0,c.has(e)&&(T=!0,c.delete(e)),p.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in V){const e=b[t],i=S[t];if(u.hasOwnProperty(t))continue;let n=!1;n=fi(e)&&fi(i)?!bo(e,i):e!==i,n?null!=e?P(t):c.add(t):void 0!==e&&c.has(t)?P(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=b,p.isActive&&(u={...u,...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=mi(n,e);if(n.enteringChildren&&s){const{delayChildren:e}=s.transition||{};i.delay=ri(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(c.size){const e={};if("boolean"!=typeof r.initial){const i=mi(t,Array.isArray(r.initial)?r.initial[0]:r.initial);i&&i.transition&&(e.transition=i.transition)}c.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=Mo()}}},t.createAxis=gs,t.createAxisDelta=fs,t.createBox=vs,t.createDelta=ys,t.createGeneratorEasing=mt,t.createProjectionNode=Sr,t.createRenderBatcher=s,t.cubicBezierAsString=ke,t.defaultEasing=Wt,t.defaultOffset=Nt,t.defaultTransformValue=oe,t.defaultValueTypes=$i,t.degrees=R,t.delay=ur,t.delayInSeconds=function(t,i){return ur(t,e.secondsToMilliseconds(i))},t.dimensionValueTypes=Ri,t.eachAxis=Qo,t.fillOffset=Ut,t.fillWildcards=_t,t.findDimensionValueType=Bi,t.findValueType=_n,t.flushKeyframeResolvers=we,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=oi,t.getMixer=ot,t.getOptimisedAppearId=Pi,t.getOriginIndex=zn,t.getValueAsType=_i,t.getValueTransition=Je,t.getVariableValue=_e,t.getVariantContext=wo,t.getViewAnimationLayerInfo=ss,t.getViewAnimations=rs,t.globalProjectionState=gr,t.has2DTranslate=Ns,t.hasReducedMotionListener=Ts,t.hasScale=Is,t.hasTransform=Us,t.hex=k,t.hover=function(t,e,i={}){const[n,s,o]=fn(t,i),r=t=>{if(!yn(t))return;const{target:i}=t,n=e(i,t);if("function"!=typeof n||!i)return;const o=t=>{yn(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=Vs,t.isCSSVariableName=m,t.isCSSVariableToken=y,t.isControllingVariants=Ds,t.isDeltaZero=Xo,t.isDragActive=mn,t.isDragging=pn,t.isElementKeyboardAccessible=Tn,t.isForcedMotionValue=lo,t.isGenerator=Ce,t.isHTMLElement=sn,t.isKeyframesTarget=fi,t.isMotionValue=xi,t.isNear=ko,t.isNodeOrChild=gn,t.isPrimaryPointer=vn,t.isSVGElement=Pn,t.isSVGSVGElement=Kn,t.isSVGTag=go,t.isTransitionDefined=ni,t.isVariantLabel=Ps,t.isVariantNode=ks,t.isWaapiSupportedEasing=function t(i){return Boolean("function"==typeof i&&De()||!i||"string"==typeof i&&(i in Ee||De())||e.isBezierDefinition(i)||Array.isArray(i)&&i.every(t))},t.isWillChangeMotionValue=Ti,t.keyframes=Kt,t.makeAnimationInstant=Ne,t.mapEasingToNativeEasing=Re,t.mapValue=function(t,e,i,n){const s=Yn(e,i,n);return Xn(()=>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=hn,t.mix=ct,t.mixArray=rt,t.mixColor=et,t.mixComplex=lt,t.mixImmediate=Z,t.mixLinearColor=J,t.mixNumber=_,t.mixObject=at,t.mixValues=or,t.mixVisibility=nt,t.motionValue=hi,t.nodeGroup=function(){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}},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=Vi,t.optimizedAppearDataId=Si,t.parseCSSVariable=Ze,t.parseValueFromTransform=re,t.percent=B,t.pixelsToPercent=so,t.positionalKeys=li,t.prefersReducedMotion=xs,t.press=function(t,e,i={}){const[n,s,o]=fn(t,i),r=t=>{const n=t.currentTarget;if(!Vn(t))return;wn.add(n);const o=e(n,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),wn.has(n)&&wn.delete(n),Vn(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,n===window||n===document||i.useGlobalTarget||gn(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=bn(()=>{if(wn.has(i))return;Sn(i,"down");const t=bn(()=>{Sn(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>Sn(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),Tn(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progressPercentage=L,t.propEffect=nn,t.propagateDirtyNodes=Ar,t.px=C,t.readTransformValue=ae,t.recordStats=function(){if(n.value)throw $n(),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(On,!0),Wn},t.removeAxisDelta=Oo,t.removeAxisTransforms=Io,t.removeBoxTransforms=$o,t.removePointDelta=Lo,t.renderHTML=no,t.renderSVG=vo,t.resize=function(t,e){return"function"==typeof t?Ln(t):Cn(t,e)},t.resolveElements=Hi,t.resolveMotionValue=dr,t.resolveVariant=mi,t.resolveVariantFromProps=pi,t.rgbUnit=M,t.rgba=D,t.rootProjectionNode=Gr,t.scale=w,t.scaleCorrectors=ao,t.scalePoint=Ws,t.scrapeHTMLMotionValuesFromProps=co,t.scrapeSVGMotionValuesFromProps=xo,t.setDragLock=function(t){return"x"===t||"y"===t?pn[t]?null:(pn[t]=!0,()=>{pn[t]=!1}):pn.x||pn.y?null:(pn.x=pn.y=!0,()=>{pn.x=pn.y=!1})},t.setFeatureDefinitions=function(t){Bs=t},t.setStyle=Ve,t.setTarget=vi,t.spring=Lt,t.springValue=function(t,e){const i=hi(xi(t)?t.get():t);return Gn(i,t,e),i},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 c=t*l;if(s){const i=r*t;c=e.easingDefinitionToFunction(s)(c/i)*i}return i+c}},t.startWaapiAnimation=Be,t.statsBuffer=n,t.styleEffect=ln,t.supportedWaapiEasing=Ee,t.supportsBrowserAnimation=Ke,t.supportsFlags=Ae,t.supportsLinearEasing=De,t.supportsPartialKeyframes=Gi,t.supportsScrollTimeline=Pe,t.svgEffect=un,t.sync=Zr,t.testValueType=Ei,t.time=h,t.transform=Yn,t.transformAxis=Zs,t.transformBox=_s,t.transformBoxPoints=Ls,t.transformPropOrder=ce,t.transformProps=ue,t.transformValue=Xn,t.transformValueTypes=Ui,t.translateAxis=Hs,t.updateMotionValuesFromProps=Es,t.variantPriorityOrder=As,t.variantProps=Ms,t.vh=j,t.visualElementStore=Ss,t.vw=F});
|