framer-motion 12.24.10 → 12.24.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{q as t,t as e,u as i,v as n,w as s,x as o,y as r,z as a,A as l,B as h,C as u,D as c,E as d,F as p,G as m,H as f,I as y,J as g,K as v,M as x,b as T,n as P,o as w,r as S,N as A,m as b,i as E,h as V,p as M,k as C,O as D,d as k,s as R,P as L,L as j,S as B,a as F,Q as I,j as O,R as U,T as N,l as $,e as K,f as W,g as z}from"./size-rollup-dom-max-assets.js";import{jsx as Y}from"react/jsx-runtime";import{useContext as X,useId as G,useEffect as H,useCallback as q,Component as _,Fragment as Z}from"react";function J(t,e){-1===t.indexOf(e)&&t.push(e)}function Q(t,e){const i=t.indexOf(e);i>-1&&t.splice(i,1)}function tt(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let et=()=>{},it=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(et=(t,e,i)=>{t||"undefined"==typeof console||console.warn(tt(e,i))},it=(t,e,i)=>{if(!t)throw new Error(tt(e,i))});const nt={},st=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function ot(t){return"object"==typeof t&&null!==t}const rt=t=>/^0[^.\s]+$/u.test(t);function at(t){let e;return()=>(void 0===e&&(e=t()),e)}const lt=t=>t,ht=(t,e)=>i=>e(t(i)),ut=(...t)=>t.reduce(ht),ct=(t,e,i)=>{const n=e-t;return 0===n?1:(i-t)/n};class dt{constructor(){this.subscriptions=[]}add(t){return J(this.subscriptions,t),()=>Q(this.subscriptions,t)}notify(t,e,i){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,i);else for(let s=0;s<n;s++){const n=this.subscriptions[s];n&&n(t,e,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const pt=t=>1e3*t,mt=t=>t/1e3;function ft(t,e){return e?t*(1e3/e):0}const yt=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function gt(t,e,i,n){if(t===e&&i===n)return lt;const s=e=>function(t,e,i,n,s){let o,r,a=0;do{r=e+(i-e)/2,o=yt(r,n,s)-t,o>0?i=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,i);return t=>0===t||1===t?t:yt(s(t),e,n)}const vt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,xt=t=>e=>1-t(1-e),Tt=gt(.33,1.53,.69,.99),Pt=xt(Tt),wt=vt(Pt),St=t=>(t*=2)<1?.5*Pt(t):.5*(2-Math.pow(2,-10*(t-1))),At=t=>1-Math.sin(Math.acos(t)),bt=xt(At),Et=vt(At),Vt=gt(.42,0,1,1),Mt=gt(0,0,.58,1),Ct=gt(.42,0,.58,1),Dt=t=>Array.isArray(t)&&"number"==typeof t[0],kt={linear:lt,easeIn:Vt,easeInOut:Ct,easeOut:Mt,circIn:At,circInOut:Et,circOut:bt,backIn:Pt,backInOut:wt,backOut:Tt,anticipate:St},Rt=t=>{if(Dt(t)){it(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,n,s]=t;return gt(e,i,n,s)}return"string"==typeof t?(it(void 0!==kt[t],`Invalid easing type '${t}'`,"invalid-easing-type"),kt[t]):t},Lt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],jt={value:null,addProjectionMetrics:null};function Bt(t,e){let i=!1,n=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>i=!0,r=Lt.reduce((t,i)=>(t[i]=function(t,e){let i=new Set,n=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function h(e){r.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,o=!1)=>{const a=o&&s?i:n;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[i,n]=[n,i],i.forEach(h),e&&jt.value&&jt.value.frameloop[e].push(l),l=0,i.clear(),s=!1,o&&(o=!1,u.process(t)))}};return u}(o,e?i:void 0),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:u,update:c,preRender:d,render:p,postRender:m}=r,f=()=>{const o=nt.useManualTiming?s.timestamp:performance.now();i=!1,nt.useManualTiming||(s.delta=n?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),h.process(s),u.process(s),c.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,i&&e&&(n=!1,t(f))};return{schedule:Lt.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(i||(i=!0,n=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<Lt.length;e++)r[Lt[e]].cancel(t)},state:s,steps:r}}const{schedule:Ft,cancel:It,state:Ot,steps:Ut}=Bt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:lt,!0);let Nt;function $t(){Nt=void 0}const Kt={now:()=>(void 0===Nt&&Kt.set(Ot.isProcessing||nt.useManualTiming?Ot.timestamp:performance.now()),Nt),set:t=>{Nt=t,queueMicrotask($t)}};function Wt(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 zt(t,e){return i=>i>0?e:t}const Yt=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},Xt=[n,e,i];function Gt(t){const e=(n=t,Xt.find(t=>t.test(n)));var n;if(et(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let s=e.parse(t);return e===i&&(s=function({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=Wt(a,n,t+1/3),o=Wt(a,n,t),r=Wt(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}}(s)),s}const Ht=(i,n)=>{const s=Gt(i),o=Gt(n);if(!s||!o)return zt(i,n);const r={...s};return i=>(r.red=Yt(s.red,o.red,i),r.green=Yt(s.green,o.green,i),r.blue=Yt(s.blue,o.blue,i),r.alpha=t(s.alpha,o.alpha,i),e.transform(r))},qt=new Set(["none","hidden"]);function _t(e,i){return n=>t(e,i,n)}function Zt(t){return"number"==typeof t?_t:"string"==typeof t?s(t)?zt:o.test(t)?Ht:te:Array.isArray(t)?Jt:"object"==typeof t?o.test(t)?Ht:Qt:zt}function Jt(t,e){const i=[...t],n=i.length,s=t.map((t,i)=>Zt(t)(t,e[i]));return t=>{for(let e=0;e<n;e++)i[e]=s[e](t);return i}}function Qt(t,e){const i={...t,...e},n={};for(const s in i)void 0!==t[s]&&void 0!==e[s]&&(n[s]=Zt(t[s])(t[s],e[s]));return t=>{for(const e in n)i[e]=n[e](t);return i}}const te=(t,e)=>{const i=r.createTransformer(e),n=a(t),s=a(e);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?qt.has(t)&&!s.values.length||qt.has(e)&&!n.values.length?function(t,e){return qt.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}(t,e):ut(Jt(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}(n,s),s.values),i):(et(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),zt(t,e))};function ee(e,i,n){if("number"==typeof e&&"number"==typeof i&&"number"==typeof n)return t(e,i,n);return Zt(e)(e,i)}const ie=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Ft.update(e,t),stop:()=>It(e),now:()=>Ot.isProcessing?Ot.timestamp:Kt.now()}},ne=(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)})`},se=2e4;function oe(t){let e=0;let i=t.next(e);for(;!i.done&&e<se;)e+=50,i=t.next(e);return e>=se?1/0:e}function re(t,e,i){const n=Math.max(e-5,0);return ft(i-t(n),e-n)}const ae=100,le=10,he=1,ue=0,ce=800,de=.3,pe=.3,me={granular:.01,default:2},fe={granular:.005,default:.5},ye=.01,ge=10,ve=.05,xe=1,Te=.001;function Pe({duration:t=ce,bounce:e=de,velocity:i=ue,mass:n=he}){let s,o;et(t<=pt(ge),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=l(ve,xe,r),t=l(ye,ge,mt(t)),r<1?(s=e=>{const n=e*r,s=n*t,o=n-i,a=Se(e,r),l=Math.exp(-s);return Te-o/a*l},o=e=>{const n=e*r*t,o=n*i+i,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-n),h=Se(Math.pow(e,2),r);return(-s(e)+Te>0?-1:1)*((o-a)*l)/h}):(s=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const a=function(t,e,i){let n=i;for(let i=1;i<we;i++)n-=t(n)/e(n);return n}(s,o,5/t);if(t=pt(t),isNaN(a))return{stiffness:ae,damping:le,duration:t};{const e=Math.pow(a,2)*n;return{stiffness:e,damping:2*r*Math.sqrt(n*e),duration:t}}}const we=12;function Se(t,e){return t*Math.sqrt(1-e*e)}const Ae=["duration","bounce"],be=["stiffness","damping","mass"];function Ee(t,e){return e.some(e=>void 0!==t[e])}function Ve(t=pe,e=de){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:s}=i;const o=i.keyframes[0],r=i.keyframes[i.keyframes.length-1],a={done:!1,value:o},{stiffness:h,damping:u,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:ue,stiffness:ae,damping:le,mass:he,isResolvedFromDuration:!1,...t};if(!Ee(t,be)&&Ee(t,Ae))if(t.visualDuration){const i=t.visualDuration,n=2*Math.PI/(1.2*i),s=n*n,o=2*l(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:he,stiffness:s,damping:o}}else{const i=Pe(t);e={...e,...i,mass:he},e.isResolvedFromDuration=!0}return e}({...i,velocity:-mt(i.velocity||0)}),f=p||0,y=u/(2*Math.sqrt(h*c)),g=r-o,v=mt(Math.sqrt(h/c)),x=Math.abs(g)<5;let T;if(n||(n=x?me.granular:me.default),s||(s=x?fe.granular:fe.default),y<1){const t=Se(v,y);T=e=>{const i=Math.exp(-y*v*e);return r-i*((f+y*v*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===y)T=t=>r-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 r-i*((f+y*v*g)*Math.sinh(n)+t*g*Math.cosh(n))/t}}const P={calculatedDuration:m&&d||null,next:t=>{const e=T(t);if(m)a.done=t>=d;else{let i=0===t?f:0;y<1&&(i=0===t?pt(f):re(T,t,e));const o=Math.abs(i)<=n,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(oe(P),se),e=ne(e=>P.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return P}function Me({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:u}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=i*e;const f=c+m,y=void 0===r?f:r(f);y!==f&&(m=y-c);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)<=h,d.value=d.done?y:i};let T,P;const w=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(T=t,P=Ve({keyframes:[d.value,p(d.value)],velocity:re(v,t,d.value),damping:s,stiffness:o,restDelta:h,restSpeed:u}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return P||void 0!==T||(e=!0,x(t),w(t)),void 0!==T&&t>=T?P.next(t-T):(!e&&x(t),d)}}}function Ce(t,e,{clamp:i=!0,ease:n,mixer:s}={}){const o=t.length;if(it(o===e.length,"Both input and output ranges must be the same length","range-length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,i){const n=[],s=i||nt.mix||ee,o=t.length-1;for(let i=0;i<o;i++){let o=s(t[i],t[i+1]);if(e){const t=Array.isArray(e)?e[i]||lt:e;o=ut(t,o)}n.push(o)}return n}(e,n,s),h=a.length,u=i=>{if(r&&i<t[0])return e[0];let n=0;if(h>1)for(;n<t.length-2&&!(i<t[n+1]);n++);const s=ct(t[n],t[n+1],i);return a[n](s)};return i?e=>u(l(t[0],t[o-1],e)):u}function De(e){const i=[0];return function(e,i){const n=e[e.length-1];for(let s=1;s<=i;s++){const o=ct(0,i,s);e.push(t(n,1,o))}}(i,e.length-1),i}function ke({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(n)?n.map(Rt):Rt(n),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(i&&i.length===e.length?i:De(e),t),a=Ce(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||Ct).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}Ve.applyToOptions=t=>{const e=function(t,e=100,i){const n=i({...t,keyframes:[0,e]}),s=Math.min(oe(n),se);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:mt(s)}}(t,100,Ve);return t.ease=e.ease,t.duration=pt(e.duration),t.type="keyframes",t};const Re=t=>null!==t;function Le(t,{repeat:e,repeatType:i="loop"},n,s=1){const o=t.filter(Re),r=s<0||e&&"loop"!==i&&e%2==1?0:o.length-1;return r&&void 0!==n?n:o[r]}const je={decay:Me,inertia:Me,tween:ke,keyframes:ke,spring:Ve};function Be(t){"string"==typeof t.type&&(t.type=je[t.type])}class Fe{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 Ie=t=>t/100;class Oe extends Fe{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!==Kt.now()&&this.tick(Kt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Be(t);const{type:e=ke,repeat:i=0,repeatDelay:n=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||ke;a!==ke&&"number"!=typeof r[0]&&(this.mixKeyframes=ut(Ie,ee(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=oe(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+n,this.totalDuration=this.resolvedDuration*(i+1)-n,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:i,totalDuration:n,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return i.next(0);const{delay:h=0,keyframes:u,repeat:c,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-n/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-h*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>n;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let x=this.currentTime,T=i;if(c){const t=Math.min(this.currentTime,n)/r;let e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===d?(i=1-i,p&&(i-=p/r)):"mirror"===d&&(T=o)),x=l(0,1,i)*r}const P=v?{done:!1,value:u[0]}:T.next(x);s&&(P.value=s(P.value));let{done:w}=P;v||null===a||(w=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return S&&m!==Me&&(P.value=Le(u,this.options,y,this.speed)),f&&f(P.value),S&&this.finish(),P}then(t,e){return this.finished.then(t,e)}get duration(){return mt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+mt(t)}get time(){return mt(this.currentTime)}set time(t){t=pt(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(Kt.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=mt(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ie,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(Kt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Ue=t=>180*t/Math.PI,Ne=t=>{const e=Ue(Math.atan2(t[1],t[0]));return Ke(e)},$e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ne,rotateZ:Ne,skewX:t=>Ue(Math.atan(t[1])),skewY:t=>Ue(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ke=t=>((t%=360)<0&&(t+=360),t),We=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ze=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ye={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:We,scaleY:ze,scale:t=>(We(t)+ze(t))/2,rotateX:t=>Ke(Ue(Math.atan2(t[6],t[5]))),rotateY:t=>Ke(Ue(Math.atan2(-t[2],t[0]))),rotateZ:Ne,rotate:Ne,skewX:t=>Ue(Math.atan(t[4])),skewY:t=>Ue(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Xe(t){return t.includes("scale")?1:0}function Ge(t,e){if(!t||"none"===t)return Xe(e);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,s;if(i)n=Ye,s=i;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=$e,s=e}if(!s)return Xe(e);const o=n[e],r=s[1].split(",").map(He);return"function"==typeof o?o(r):r[o]}function He(t){return parseFloat(t.trim())}const qe=t=>t===h||t===u,_e=new Set(["x","y","z"]),Ze=c.filter(t=>!_e.has(t));const Je={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})=>Ge(e,"x"),y:(t,{transform:e})=>Ge(e,"y")};Je.translateX=Je.x,Je.translateY=Je.y;const Qe=new Set;let ti=!1,ei=!1,ii=!1;function ni(){if(ei){const t=Array.from(Qe).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 Ze.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)})}ei=!1,ti=!1,Qe.forEach(t=>t.complete(ii)),Qe.clear()}function si(){Qe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ei=!0)})}class oi{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?(Qe.add(this),ti||(ti=!0,Ft.read(si),Ft.resolveKeyframes(ni))):(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])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Qe.delete(this)}cancel(){"scheduled"===this.state&&(Qe.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const ri=at(()=>void 0!==window.ScrollTimeline),ai={};function li(t,e){const i=at(t);return()=>ai[e]??i()}const hi=li(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),ui=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,ci={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ui([0,.65,.55,1]),circOut:ui([.55,0,1,.45]),backIn:ui([.31,.01,.66,-.59]),backOut:ui([.33,1.53,.69,.99])};function di(t,e){return t?"function"==typeof t?hi()?ne(t,e):"ease-out":Dt(t)?ui(t):Array.isArray(t)?t.map(t=>di(t,e)||ci.easeOut):ci[t]:void 0}function pi(t,e,i,{delay:n=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},h=void 0){const u={[e]:i};l&&(u.offset=l);const c=di(a,s);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};h&&(d.pseudoElement=h);return t.animate(u,d)}function mi(t){return"function"==typeof t&&"applyToOptions"in t}class fi extends Fe{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:i,keyframes:n,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,it("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return mi(t)&&hi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=pi(e,i,n,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Le(n,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,i){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,i):t.style[e]=i}(e,i,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return mt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+mt(t)}get time(){return mt(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=pt(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&ri()?(this.animation.timeline=t,lt):e(this)}}const yi={anticipate:St,backInOut:wt,circInOut:Et};function gi(t){"string"==typeof t.ease&&t.ease in yi&&(t.ease=yi[t.ease])}class vi extends fi{constructor(t){gi(t),Be(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:i,onComplete:n,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Oe({...o,autoplay:!1}),a=pt(this.finishedTime??this.time);e.setWithVelocity(r.sample(a-10).value,r.sample(a).value,10),r.stop()}}const xi=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!r.test(t)&&"0"!==t||t.startsWith("url(")));function Ti(t){t.duration=0,t.type="keyframes"}const Pi=new Set(["opacity","clipPath","filter","transform"]),wi=at(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Si extends Fe{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:h,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Kt.now();const c={autoplay:t,delay:e,type:i,repeat:n,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:h,...u},d=h?.KeyframeResolver||oi;this.keyframeResolver=new d(r,(t,e,i)=>this.onKeyframesResolved(t,e,c,!i),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,i,n){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:h}=i;this.resolvedAt=Kt.now(),function(t,e,i,n){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=xi(s,e),a=xi(o,e);return et(r===a,`You are trying to animate ${e} from "${s}" to "${o}". "${r?o:s}" is not an animatable value.`,"value-not-animatable"),!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===i||mi(i))&&n)}(t,s,o,r)||(!nt.instantAnimations&&a||h?.(Le(t,i,e)),t[0]=t[t.length-1],Ti(i),i.repeat=0);const u={startTime:n?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...i,keyframes:t},c=!l&&function(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:h}=e.owner.getProps();return wi()&&i&&Pi.has(i)&&("transform"!==i||!h)&&!l&&!n&&"mirror"!==s&&0!==o&&"inertia"!==r}(u)?new vi({...u,element:u.motionValue.owner.current}):new Oe(u);c.finished.then(()=>this.notifyFinished()).catch(lt),this.pendingTimeline&&(this.stopTimeline=c.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=c}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(),ii=!0,si(),ni(),ii=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const Ai=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bi(t,e,i=1){it(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[n,o]=function(t){const e=Ai.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}(t);if(!n)return;const r=window.getComputedStyle(e).getPropertyValue(n);if(r){const t=r.trim();return st(t)?parseFloat(t):t}return s(o)?bi(o,e,i+1):o}function Ei(t,e){return t?.[e]??t?.default??t}const Vi=new Set(["width","height","top","left","right","bottom",...c]),Mi=t=>e=>e.test(t),Ci=[h,u,d,p,m,f,{test:t=>"auto"===t,parse:t=>t}],Di=t=>Ci.find(Mi(t));function ki(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||rt(t))}const Ri=new Set(["brightness","contrast","saturate","opacity"]);function Li(t){const[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=i.match(y)||[];if(!n)return t;const s=i.replace(n,"");let o=Ri.has(e)?1:0;return n!==i&&(o*=100),e+"("+o+s+")"}const ji=/\b([a-z-]*)\(.*?\)/gu,Bi={...r,getAnimatableNone:t=>{const e=t.match(ji);return e?e.map(Li).join(" "):t}},Fi={...g,color:o,backgroundColor:o,outlineColor:o,fill:o,stroke:o,borderColor:o,borderTopColor:o,borderRightColor:o,borderBottomColor:o,borderLeftColor:o,filter:Bi,WebkitFilter:Bi},Ii=t=>Fi[t];function Oi(t,e){let i=Ii(t);return i!==Bi&&(i=r),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const Ui=new Set(["auto","none","0"]);class Ni extends oi{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(),s(n))){const s=bi(n,e.current);void 0!==s&&(t[i]=s),i===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!Vi.has(i)||2!==t.length)return;const[n,o]=t,r=Di(n),a=Di(o);if(v(n)!==v(o)&&Je[i])this.needsMeasurement=!0;else if(r!==a)if(qe(r)&&qe(a))for(let e=0;e<t.length;e++){const i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else Je[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++)(null===t[e]||ki(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&&!Ui.has(e)&&a(e).values.length&&(n=t[s]),s++}if(n&&i)for(const s of e)t[s]=Oi(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=Je[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]=Je[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()}}class $i{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=Kt.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=Kt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new dt);const i=this.events[t].add(e);return"change"===t?()=>{i(),Ft.read(()=>{this.events.change.getSize()||this.stop()})}:i}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 this.current}getPrevious(){return this.prev}getVelocity(){const t=Kt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return ft(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ki(t,e){return new $i(t,e)}const{schedule:Wi,cancel:zi}=Bt(queueMicrotask,!1),Yi={x:!1,y:!1};function Xi(){return Yi.x||Yi.y}function Gi(t,e){const i=function(t){if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t)}(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function Hi(t){return!("touch"===t.pointerType||Xi())}const qi=(t,e)=>!!e&&(t===e||qi(t,e.parentElement)),_i=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Zi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ji(t){return Zi.has(t.tagName)||!0===t.isContentEditable}const Qi=new WeakSet;function tn(t){return e=>{"Enter"===e.key&&t(e)}}function en(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function nn(t){return _i(t)&&!Xi()}function sn(t,e,i={}){const[n,s,o]=Gi(t,i),r=t=>{const n=t.currentTarget;if(!nn(t))return;Qi.add(n);const o=e(n,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Qi.has(n)&&Qi.delete(n),nn(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,n===window||n===document||i.useGlobalTarget||qi(n,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return n.forEach(t=>{var e;(i.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),ot(e=t)&&"offsetHeight"in e&&(t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const n=tn(()=>{if(Qi.has(i))return;en(i,"down");const t=tn(()=>{en(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>en(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),Ji(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function on(t){return ot(t)&&"ownerSVGElement"in t}const rn=[...Ci,o,r];class an{constructor(t){this.isMounted=!1,this.node=t}update(){}}const ln=t=>null!==t;const hn={type:"spring",stiffness:500,damping:25,restSpeed:10},un={type:"keyframes",duration:.8},cn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},dn=(t,{keyframes:e})=>e.length>2?un:x.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:hn:cn;const pn=(t,e,i,n={},s,o)=>r=>{const a=Ei(n,t)||{},l=a.delay||n.delay||0;let{elapsed:h=0}=n;h-=pt(l);const u={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-h,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length})(a)||Object.assign(u,dn(t,u)),u.duration&&(u.duration=pt(u.duration)),u.repeatDelay&&(u.repeatDelay=pt(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(Ti(u),0===u.delay&&(c=!0)),(nt.instantAnimations||nt.skipAnimations)&&(c=!0,Ti(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:i="loop"},n){const s=t.filter(ln),o=e&&"loop"!==i&&e%2==1?0:s.length-1;return o&&void 0!==n?n:s[o]}(u.keyframes,a);if(void 0!==t)return void Ft.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Oe(u):new Si(u)};function mn(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}function fn(t){return{point:{x:t.pageX,y:t.pageY}}}function yn(t,e,i,n){return mn(t,e,(t=>e=>_i(e)&&t(e,fn(e)))(i),n)}function gn({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function vn(t){return t.max-t.min}function xn(e,i,n,s=.5){e.origin=s,e.originPoint=t(i.min,i.max,e.origin),e.scale=vn(n)/vn(i),e.translate=t(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Tn(t,e,i,n){xn(t.x,e.x,i.x,n?n.originX:void 0),xn(t.y,e.y,i.y,n?n.originY:void 0)}function Pn(t,e,i){t.min=i.min+e.min,t.max=t.min+vn(e)}function wn(t,e,i){t.min=e.min-i.min,t.max=t.min+vn(e)}function Sn(t,e,i){wn(t.x,e.x,i.x),wn(t.y,e.y,i.y)}const An=()=>({x:{min:0,max:0},y:{min:0,max:0}});function bn(t){return[t("x"),t("y")]}function En(t){return void 0===t||1===t}function Vn({scale:t,scaleX:e,scaleY:i}){return!En(t)||!En(e)||!En(i)}function Mn(t){return Vn(t)||Cn(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Cn(t){return Dn(t.x)||Dn(t.y)}function Dn(t){return t&&"0%"!==t}function kn(t,e,i){return i+e*(t-i)}function Rn(t,e,i,n,s){return void 0!==s&&(t=kn(t,s,n)),kn(t,i,n)+e}function Ln(t,e=0,i=1,n,s){t.min=Rn(t.min,e,i,n,s),t.max=Rn(t.max,e,i,n,s)}function jn(t,{x:e,y:i}){Ln(t.x,e.translate,e.scale,e.originPoint),Ln(t.y,i.translate,i.scale,i.originPoint)}const Bn=.999999999999,Fn=1.0000000000001;function In(t,e){t.min=t.min+e,t.max=t.max+e}function On(e,i,n,s,o=.5){Ln(e,i,n,t(e.min,e.max,o),s)}function Un(t,e){On(t.x,e.x,e.scaleX,e.scale,e.originX),On(t.y,e.y,e.scaleY,e.scale,e.originY)}function Nn(t,e){return gn(function(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}}(t.getBoundingClientRect(),e))}const $n=({current:t})=>t?t.ownerDocument.defaultView:null;function Kn(t,e){const i=t.getValue("willChange");if(n=i,Boolean(T(n)&&n.add))return i.add(e);if(!i&&nt.WillChange){const i=new nt.WillChange("auto");t.addValue("willChange",i),i.add(e)}var n}const Wn=(t,e)=>Math.abs(t-e);class zn{constructor(t,e,{transformPagePoint:i,contextWindow:n=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Gn(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){const i=Wn(t.x,e.x),n=Wn(t.y,e.y);return Math.sqrt(i**2+n**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!i)return;const{point:n}=t,{timestamp:s}=Ot;this.history.push({...n,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Yn(e,this.transformPagePoint),Ft.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:i,onSessionEnd:n,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Gn("pointercancel"===t.type?this.lastMoveEventInfo:Yn(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,o),n&&n(t,o)},!_i(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=n||window;const r=Yn(fn(t),this.transformPagePoint),{point:a}=r,{timestamp:l}=Ot;this.history=[{...a,timestamp:l}];const{onSessionStart:h}=e;h&&h(t,Gn(r,this.history)),this.removeListeners=ut(yn(this.contextWindow,"pointermove",this.handlePointerMove),yn(this.contextWindow,"pointerup",this.handlePointerUp),yn(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),It(this.updatePoint)}}function Yn(t,e){return e?{point:e(t.point)}:t}function Xn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Gn({point:t},e){return{point:t,delta:Xn(t,qn(e)),offset:Xn(t,Hn(e)),velocity:_n(e,.1)}}function Hn(t){return t[0]}function qn(t){return t[t.length-1]}function _n(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null;const s=qn(t);for(;i>=0&&(n=t[i],!(s.timestamp-n.timestamp>pt(e)));)i--;if(!n)return{x:0,y:0};const o=mt(s.timestamp-n.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-n.x)/o,y:(s.y-n.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Zn(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function Jn(t,e){let i=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,n]=[n,i]),{min:i,max:n}}const Qn=.35;function ts(t,e,i){return{min:es(t,e),max:es(t,i)}}function es(t,e){return"number"==typeof t?t:t[e]||0}const is=new WeakMap;class ns{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:i}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:s}=this.getProps();this.panSession=new zn(t,{onSessionStart:t=>{e?(this.stopAnimation(),this.snapToCursor(fn(t).point)):this.pauseAnimation()},onStart:(t,e)=>{this.stopAnimation();const{drag:i,dragPropagation:n,onDragStart:s}=this.getProps();if(i&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=i)||"y"===o?Yi[o]?null:(Yi[o]=!0,()=>{Yi[o]=!1}):Yi.x||Yi.y?null:(Yi.x=Yi.y=!0,()=>{Yi.x=Yi.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),bn(t=>{let e=this.getAxisMotionValue(t).get()||0;if(d.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const n=i.layout.layoutBox[t];if(n){e=vn(n)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&Ft.postRender(()=>s(t,e)),Kn(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:i,dragDirectionLock:n,onDirectionLock:s,onDrag:o}=this.getProps();if(!i&&!this.openDragLock)return;const{offset:r}=e;if(n&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let i=null;Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x");return i}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>bn(t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play())},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:i,contextWindow:$n(this.visualElement)})}stop(t,e){const i=t||this.latestPointerEvent,n=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!n||!i)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&Ft.postRender(()=>r(i,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(e,i,n){const{drag:s}=this.getProps();if(!n||!ss(e,s,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(r=function(e,{min:i,max:n},s){return void 0!==i&&e<i?e=s?t(i,e,s.min):Math.max(e,i):void 0!==n&&e>n&&(e=s?t(n,e,s.max):Math.min(e,n)),e}(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;t&&P(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(t,{top:e,left:i,bottom:n,right:s}){return{x:Zn(t.x,i,s),y:Zn(t.y,e,n)}}(i.layoutBox,t),this.elastic=function(t=Qn){return!1===t?t=0:!0===t&&(t=Qn),{x:ts(t,"left","right"),y:ts(t,"top","bottom")}}(e),n!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&bn(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!P(t))return!1;const i=t.current;it(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const s=function(t,e,i){const n=Nn(t,i),{scroll:s}=e;return s&&(In(n.x,s.offset.x),In(n.y,s.offset.y)),n}(i,n.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Jn(t.x,e.x),y:Jn(t.y,e.y)}}(n.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=gn(t))}return o}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:n,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=bn(r=>{if(!ss(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const h=n?200:1e6,u=n?40:1e7,c={type:"inertia",velocity:i?t[r]:0,bounceStiffness:h,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const i=this.getAxisMotionValue(t);return Kn(this.visualElement,t),i.start(pn(t,i,0,e,this.visualElement,!1))}stopAnimation(){bn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){bn(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),n=i[e];return n||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(e){bn(i=>{const{drag:n}=this.getProps();if(!ss(i,n,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(i);if(s&&s.layout){const{min:n,max:r}=s.layout.layoutBox[i],a=o.get()||0;o.set(e[i]-t(n,r,.5)+a)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:i}=this.getProps(),{projection:n}=this.visualElement;if(!P(i)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};bn(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const i=e.get();s[t]=function(t,e){let i=.5;const n=vn(t),s=vn(e);return s>n?i=ct(e.min,e.max-n,t.min):n>s&&(i=ct(t.min,t.max-s,e.min)),l(0,1,i)}({min:i,max:i},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),bn(i=>{if(!ss(i,e,null))return;const n=this.getAxisMotionValue(i),{min:o,max:r}=this.constraints[i];n.set(t(o,r,s[i]))})}addListeners(){if(!this.visualElement.current)return;is.set(this.visualElement,this);const t=yn(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:i=!0}=this.getProps();e&&i&&!Ji(t.target)&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();P(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,n=i.addEventListener("measure",e);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ft.read(e);const s=mn(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(bn(e=>{const i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),n(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:s=!1,dragElastic:o=Qn,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:n,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function ss(t,e,i){return!(!0!==e&&e!==t||null!==i&&i!==t)}const os=t=>(e,i)=>{t&&Ft.postRender(()=>t(e,i))};function rs(t){return t.props[w]}const as=(t,e)=>t.depth-e.depth;class ls{constructor(){this.children=[],this.isDirty=!1}add(t){J(this.children,t),this.isDirty=!0}remove(t){Q(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(as),this.isDirty=!1,this.children.forEach(t)}}const hs=["TopLeft","TopRight","BottomLeft","BottomRight"],us=hs.length,cs=t=>"string"==typeof t?parseFloat(t):t,ds=t=>"number"==typeof t||u.test(t);function ps(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ms=ys(0,.5,bt),fs=ys(.5,.95,lt);function ys(t,e,i){return n=>n<t?0:n>e?1:i(ct(t,e,n))}function gs(t,e){t.min=e.min,t.max=e.max}function vs(t,e){gs(t.x,e.x),gs(t.y,e.y)}function xs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Ts(t,e,i,n,s){return t=kn(t-=e,1/i,n),void 0!==s&&(t=kn(t,1/s,n)),t}function Ps(e,i,[n,s,o],r,a){!function(e,i=0,n=1,s=.5,o,r=e,a=e){d.test(i)&&(i=parseFloat(i),i=t(a.min,a.max,i/100)-a.min);if("number"!=typeof i)return;let l=t(r.min,r.max,s);e===r&&(l-=i),e.min=Ts(e.min,i,n,l,o),e.max=Ts(e.max,i,n,l,o)}(e,i[n],i[s],i[o],i.scale,r,a)}const ws=["x","scaleX","originX"],Ss=["y","scaleY","originY"];function As(t,e,i,n){Ps(t.x,e,ws,i?i.x:void 0,n?n.x:void 0),Ps(t.y,e,Ss,i?i.y:void 0,n?n.y:void 0)}function bs(t){return 0===t.translate&&1===t.scale}function Es(t){return bs(t.x)&&bs(t.y)}function Vs(t,e){return t.min===e.min&&t.max===e.max}function Ms(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Cs(t,e){return Ms(t.x,e.x)&&Ms(t.y,e.y)}function Ds(t){return vn(t.x)/vn(t.y)}function ks(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Rs{constructor(){this.members=[]}add(t){J(this.members,t),t.scheduleRender()}remove(t){if(Q(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 Ls={hasAnimatedSinceResize:!0,hasEverUpdated:!1},js=["","X","Y","Z"];let Bs=0;function Fs(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function Is(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=rs(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",Ft,!(e||n))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&Is(n)}function Os({attachResizeListener:e,defaultParent:i,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},e=i?.()){this.id=Bs++,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,this.nodes.forEach($s),this.nodes.forEach(Hs),this.nodes.forEach(qs),this.nodes.forEach(Ks)},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 ls)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new dt),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const i=this.eventHandlers.get(t);i&&i.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(t){if(this.instance)return;var i;this.isSVG=on(t)&&!(on(i=t)&&"svg"===i.tagName),this.instance=t;const{layoutId:n,layout:s,visualElement:o}=this.options;if(o&&!o.current&&o.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(s||n)&&(this.isLayoutDirty=!0),e){let i,n=0;const s=()=>this.root.updateBlockedByResize=!1;Ft.read(()=>{n=window.innerWidth}),e(t,()=>{const t=window.innerWidth;t!==n&&(n=t,this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){const i=Kt.now(),n=({timestamp:s})=>{const o=s-i;o>=e&&(It(n),t(o-e))};return Ft.setup(n,!0),()=>It(n)}(s,250),Ls.hasAnimatedSinceResize&&(Ls.hasAnimatedSinceResize=!1,this.nodes.forEach(Gs)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||s)&&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 s=this.options.transition||o.getDefaultTransition()||eo,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Cs(this.targetLayout,n),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Ei(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h)}else e||Gs(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(),It(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(_s),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&&Is(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(zs);if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Ys);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Xs),this.nodes.forEach(Us),this.nodes.forEach(Ns)):this.nodes.forEach(Ys),this.clearAllSnapshots();const t=Kt.now();Ot.delta=l(0,1e3/60,t-Ot.timestamp),Ot.timestamp=t,Ot.isProcessing=!0,Ut.update.process(Ot),Ut.preRender.process(Ot),Ut.render.process(Ot),Ot.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Wi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ws),this.sharedNodes.forEach(Zs)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ft.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ft.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||vn(this.snapshot.measuredBox.x)||vn(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=s(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!o)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!Es(this.projectionDelta),i=this.getTransformTemplate(),n=i?i(this.latestValues,""):void 0,s=n!==this.prevTransformTemplateValue;t&&this.instance&&(e||Mn(this.latestValues)||s)&&(o(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)),so((n=i).x),so(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(ro))){const{scroll:t}=this.root;t&&(In(e.x,t.offset.x),In(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(vs(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&&vs(e,t),In(e.x,s.offset.x),In(e.y,s.offset.y))}return e}applyTransform(t,e=!1){const i={x:{min:0,max:0},y:{min:0,max:0}};vs(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&&Un(i,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),Mn(n.latestValues)&&Un(i,n.latestValues)}return Mn(this.latestValues)&&Un(i,this.latestValues),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};vs(e,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!Mn(i.latestValues))continue;Vn(i.latestValues)&&i.updateSnapshot();const n=An();vs(n,i.measurePageBox()),As(e,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,n)}return Mn(this.latestValues)&&As(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!==Ot.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:n,layoutId:s}=this.options;if(!this.layout||!n&&!s)return;this.resolvedRelativeTargetAt=Ot.timestamp;const o=this.getClosestProjectingParent();var r,a,l;(o&&this.linkedParentVersion!==o.layoutVersion&&!o.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(o&&o.layout?this.createRelativeTarget(o,this.layout.layoutBox,o.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(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,Pn(r.x,a.x,l.x),Pn(r.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):vs(this.target,this.layout.layoutBox),jn(this.target,this.targetDelta)):vs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,o&&Boolean(o.resumingFrom)===Boolean(this.resumingFrom)&&!o.options.layoutScroll&&o.target&&1!==this.animationProgress?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(this.parent&&!Vn(this.parent.latestValues)&&!Cn(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}},Sn(this.relativeTargetOrigin,e,i),vs(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===Ot.timestamp&&(i=!1),i)return;const{layout:n,layoutId:s}=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||!n&&!s)return;vs(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,r=this.treeScale.y;!function(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&&Un(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,jn(t,r)),n&&Mn(o.latestValues)&&Un(t,o.latestValues))}e.x<Fn&&e.x>Bn&&(e.x=1),e.y<Fn&&e.y>Bn&&(e.y=1)}(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:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(xs(this.prevProjectionDelta.x,this.projectionDelta.x),xs(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Tn(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&ks(this.projectionDelta.x,this.prevProjectionDelta.x)&&ks(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):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(e,i=!1){const n=this.snapshot,s=n?n.latestValues:{},o={...this.latestValues},r={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=!i;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(to));let p;this.animationProgress=0,this.mixTargetDelta=i=>{const n=i/1e3;var h,m,f,y,g,v;Js(r.x,e.x,n),Js(r.y,e.y,n),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Sn(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f=this.relativeTarget,y=this.relativeTargetOrigin,g=a,v=n,Qs(f.x,y.x,g.x,v),Qs(f.y,y.y,g.y,v),p&&(h=this.relativeTarget,m=p,Vs(h.x,m.x)&&Vs(h.y,m.y))&&(this.isProjectionDirty=!1),p||(p={x:{min:0,max:0},y:{min:0,max:0}}),vs(p,this.relativeTarget)),l&&(this.animationValues=o,function(e,i,n,s,o,r){o?(e.opacity=t(0,n.opacity??1,ms(s)),e.opacityExit=t(i.opacity??1,0,fs(s))):r&&(e.opacity=t(i.opacity??1,n.opacity??1,s));for(let o=0;o<us;o++){const r=`border${hs[o]}Radius`;let a=ps(i,r),l=ps(n,r);void 0===a&&void 0===l||(a||(a=0),l||(l=0),0===a||0===l||ds(a)===ds(l)?(e[r]=Math.max(t(cs(a),cs(l),s),0),(d.test(l)||d.test(a))&&(e[r]+="%")):e[r]=l)}(i.rotate||n.rotate)&&(e.rotate=t(i.rotate||0,n.rotate||0,s))}(o,s,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(It(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ft.update(()=>{Ls.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ki(0)),this.currentAnimation=function(t,e,i){const n=T(t)?t:Ki(t);return n.start(pn("",n,e,i)),n.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{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&&oo(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=vn(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const n=vn(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}vs(e,i),Un(e,s),Tn(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Rs);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&&Fs("z",t,n,this.animationValues);for(let e=0;e<js.length;e++)Fs(`rotate${js[e]}`,t,n,this.animationValues),Fs(`skew${js[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=S(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=S(e?.pointerEvents)||""),void(this.hasProjected&&!Mn(this.latestValues)&&(t.transform=i?i({},""):"none",this.hasProjected=!1));t.visibility="";const s=n.animationValues||n.latestValues;this.applyTransformsToTarget();let o=function(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"}(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 A){if(void 0===s[e])continue;const{correct:i,applyTo:r,isCSSVariable:a}=A[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?S(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(zs),this.root.sharedNodes.clear()}}}function Us(t){t.updateLayout()}function Ns(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?bn(t=>{const n=o?e.measuredBox[t]:e.layoutBox[t],s=vn(n);n.min=i[t].min,n.max=n.min+s}):oo(s,e.layoutBox,i)&&bn(n=>{const s=o?e.measuredBox[n]:e.layoutBox[n],r=vn(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}};Tn(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?Tn(a,t.applyTransform(n,!0),e.measuredBox):Tn(a,i,e.layoutBox);const l=!Es(r);let h=!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}};Sn(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Sn(a,i,o.layoutBox),Cs(r,a)||(h=!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:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function $s(t){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 Ks(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ws(t){t.clearSnapshot()}function zs(t){t.clearMeasurements()}function Ys(t){t.isLayoutDirty=!1}function Xs(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Gs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Hs(t){t.resolveTargetDelta()}function qs(t){t.calcProjection()}function _s(t){t.resetSkewAndRotation()}function Zs(t){t.removeLeadSnapshot()}function Js(e,i,n){e.translate=t(i.translate,0,n),e.scale=t(i.scale,1,n),e.origin=i.origin,e.originPoint=i.originPoint}function Qs(e,i,n,s){e.min=t(i.min,n.min,s),e.max=t(i.max,n.max,s)}function to(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const eo={duration:.45,ease:[.4,0,.1,1]},io=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),no=io("applewebkit/")&&!io("chrome/")?Math.round:lt;function so(t){t.min=no(t.min),t.max=no(t.max)}function oo(t,e,i){return"position"===t||"preserve-aspect"===t&&(n=Ds(e),s=Ds(i),o=.2,!(Math.abs(n-s)<=o));var n,s,o}function ro(t){return t!==t.root&&t.scroll?.wasRoot}const ao=Os({attachResizeListener:(t,e)=>mn(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lo={current:void 0},ho=Os({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!lo.current){const t=new ao({});t.mount(window),t.setOptions({layoutScroll:!0}),lo.current=t}return lo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),uo={current:null},co={current:!1};const po=new WeakMap;const mo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class fo{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:n,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=oi,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=Kt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Ft.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=o;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=r,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=E(e),this.isVariantNode=V(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==a[t]&&T(e)&&e.set(a[t])}}mount(t){this.current=t,po.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:(co.current||function(){if(co.current=!0,b)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>uo.current=t.matches;t.addEventListener("change",e),e()}else uo.current=!1}(),this.shouldReduceMotion=uo.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),It(this.notifyUpdate),It(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=x.has(t);i&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Ft.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;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 M){const e=M[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<mo.length;e++){const i=mo[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=function(t,e,i){for(const n in e){const s=e[n],o=i[n];if(T(s))t.addValue(n,s);else if(T(o))t.addValue(n,Ki(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,Ki(void 0!==e?e:s,{owner:t}))}}for(const n in i)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const 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=Ki(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=i&&("string"==typeof i&&(st(i)||rt(i))?i=parseFloat(i):(n=i,!rn.find(Mi(n))&&r.test(e)&&(i=Oi(t,e))),this.setBaseTarget(t,T(i)?i.get():i)),T(i)?i.get():i}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=C(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||T(n)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new dt),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){Wi.render(this.render)}}class yo extends fo{constructor(){super(...arguments),this.KeyframeResolver=Ni}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;T(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function go(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])}class vo extends yo{constructor(){super(...arguments),this.type="html",this.renderInstance=go}readValueFromInstance(t,e){if(x.has(e))return this.projection?.isProjecting?Xe(e):((t,e)=>{const{transform:i="none"}=getComputedStyle(t);return Ge(i,e)})(t,e);{const n=(i=t,window.getComputedStyle(i)),s=(D(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof s?s.trim():s}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return Nn(t,e)}build(t,e,i){k(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return R(t,e,i)}}let xo=!1;class To extends _{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:n}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),i&&i.register&&n&&i.register(s),xo&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Ls.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:n,isPresent:s}=this.props,{projection:o}=i;return o?(o.isPresent=s,xo=!0,n||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Ft.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Wi.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:n}=t;xo=!0,n&&(n.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(n),i&&i.deregister&&i.deregister(n))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Po(t){const[e,i]=function(t=!0){const e=X(L);if(null===e)return[!0,null];const{isPresent:i,onExitComplete:n,register:s}=e,o=G();H(()=>{if(t)return s(o)},[t]);const r=q(()=>t&&n&&n(o),[o,n,t]);return!i&&n?[!1,r]:[!0]}(),n=X(j);return Y(To,{...t,layoutGroup:n,switchLayoutGroup:X(B),isPresent:e,safeToRemove:i})}const wo={pan:{Feature:class extends an{constructor(){super(...arguments),this.removePointerDownListener=lt}onPointerDown(t){this.session=new zn(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$n(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:os(t),onStart:os(e),onMove:i,onEnd:(t,e)=>{delete this.session,n&&Ft.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=yn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends an{constructor(t){super(t),this.removeGroupControls=lt,this.removeListeners=lt,this.controls=new ns(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||lt}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:ho,MeasureLayout:Po}},So={layout:{ProjectionNode:ho,MeasureLayout:Po}};function Ao(t,e,i){const n=t.getProps();return C(n,e,void 0!==i?i:n.custom,t)}const bo=t=>Array.isArray(t);function Eo(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,Ki(i))}function Vo(t){return bo(t)?t[t.length-1]||0:t}function Mo({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}function Co(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;n&&(o=n);const l=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const n=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||h&&Mo(h,e))continue;const r={delay:i,...Ei(o||{},e)},u=n.get();if(void 0!==u&&!n.isAnimating&&!Array.isArray(s)&&s===u&&!r.velocity)continue;let c=!1;if(window.MotionHandoffAnimation){const i=rs(t);if(i){const t=window.MotionHandoffAnimation(i,e,Ft);null!==t&&(r.startTime=t,c=!0)}}Kn(t,e),n.start(pn(e,n,s,t.shouldReduceMotion&&Vi.has(e)?{type:!1}:r,t,c));const d=n.animation;d&&l.push(d)}return r&&Promise.all(l).then(()=>{Ft.update(()=>{r&&function(t,e){const i=Ao(t,e);let{transitionEnd:n={},transition:s={},...o}=i||{};o={...o,...n};for(const e in o)Eo(t,e,Vo(o[e]))}(t,r)})}),l}function Do(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}function ko(t,e,i={}){const n=Ao(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(Co(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(ko(l,e,{...r,delay:i+("function"==typeof n?0:n)+Do(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 Ro(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 Lo=I.length;function jo(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&jo(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let i=0;i<Lo;i++){const n=I[i],s=t.props[n];(F(s)||!1===s)&&(e[n]=s)}return e}const Bo=[...U].reverse(),Fo=U.length;function Io(t){return e=>Promise.all(e.map(({animation:e,options:i})=>function(t,e,i={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>ko(t,e,i));n=Promise.all(s)}else if("string"==typeof e)n=ko(t,e,i);else{const s="function"==typeof e?Ao(t,e,i.custom):e;n=Promise.all(Co(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}(t,e,i)))}function Oo(t){let e=Io(t),i=$o(),n=!0;const s=e=>(i,n)=>{const s=Ao(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=jo(t.parent)||{},l=[],h=new Set;let u={},c=1/0;for(let e=0;e<Fo;e++){const d=Bo[e],p=i[d],m=void 0!==r[d]?r[d]:a[d],f=F(m),y=d===o?p.isActive:null;!1===y&&(c=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||O(m)||"boolean"==typeof m)continue;const v=Uo(p.prevProp,m);let x=v||d===o&&p.isActive&&!g&&f||e>c&&f,T=!1;const P=Array.isArray(m)?m:[m];let w=P.reduce(s(d),{});!1===y&&(w={});const{prevResolvedValues:S={}}=p,A={...S,...w},b=e=>{x=!0,h.has(e)&&(T=!0,h.delete(e)),p.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in A){const e=w[t],i=S[t];if(u.hasOwnProperty(t))continue;let n=!1;n=bo(e)&&bo(i)?!Ro(e,i):e!==i,n?null!=e?b(t):h.add(t):void 0!==e&&h.has(t)?b(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=w,p.isActive&&(u={...u,...w}),n&&t.blockInitialAnimation&&(x=!1);const E=g&&v;x&&(!E||T)&&l.push(...P.map(e=>{const i={type:d};if("string"==typeof e&&n&&!E&&t.manuallyAnimateOnMount&&t.parent){const{parent:n}=t,s=Ao(n,e);if(n.enteringChildren&&s){const{delayChildren:e}=s.transition||{};i.delay=Do(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(h.size){const e={};if("boolean"!=typeof r.initial){const i=Ao(t,Array.isArray(r.initial)?r.initial[0]:r.initial);i&&i.transition&&(e.transition=i.transition)}h.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=$o()}}}function Uo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Ro(e,t)}function No(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function $o(){return{animate:No(!0),whileInView:No(),whileHover:No(),whileTap:No(),whileDrag:No(),whileFocus:No(),exit:No()}}let Ko=0;const Wo={animation:{Feature:class extends an{constructor(t){super(t),t.animationState||(t.animationState=Oo(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();O(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends an{constructor(){super(...arguments),this.id=Ko++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function zo(t,e,i){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===i);const s=n["onHover"+i];s&&Ft.postRender(()=>s(e,fn(e)))}function Yo(t,e,i){const{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap","Start"===i);const s=n["onTap"+("End"===i?"":i)];s&&Ft.postRender(()=>s(e,fn(e)))}const Xo=new WeakMap,Go=new WeakMap,Ho=t=>{const e=Xo.get(t.target);e&&e(t)},qo=t=>{t.forEach(Ho)};function _o(t,e,i){const n=function({root:t,...e}){const i=t||document;Go.has(i)||Go.set(i,{});const n=Go.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(qo,{root:t,...e})),n[s]}(e);return Xo.set(t,i),n.observe(t),()=>{Xo.delete(t),n.unobserve(t)}}const Zo={some:0,all:1};const Jo={inView:{Feature:class extends an{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:n="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof n?n:Zo[n]};return _o(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:i,onViewportLeave:n}=this.node.getProps(),o=e?i:n;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends an{mount(){const{current:t}=this.node;t&&(this.unmount=sn(t,(t,e)=>(Yo(this.node,e,"Start"),(t,{success:e})=>Yo(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends an{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ut(mn(this.node.current,"focus",()=>this.onFocus()),mn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends an{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,i={}){const[n,s,o]=Gi(t,i),r=t=>{if(!Hi(t))return;const{target:i}=t,n=e(i,t);if("function"!=typeof n||!i)return;const o=t=>{Hi(t)&&(n(t),i.removeEventListener("pointerleave",o))};i.addEventListener("pointerleave",o,s)};return n.forEach(t=>{t.addEventListener("pointerenter",r,s)}),o}(t,(t,e)=>(zo(this.node,e,"Start"),t=>zo(this.node,t,"End"))))}unmount(){}}}},Qo=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class tr extends yo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=An}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(x.has(e)){const t=Ii(e);return t&&t.default||0}return e=Qo.has(e)?e:N(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return $(t,e,i)}build(t,e,i){K(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){!function(t,e,i,n){go(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(Qo.has(i)?i:N(i),e.attrs[i])}(t,e,0,n)}mount(t){this.isSVGTag=W(t.tagName),super.mount(t)}}const er={renderer:(t,e)=>e.isSVG??z(t)?new tr(e):new vo(e,{allowProjection:t!==Z}),...Wo,...Jo},ir={...er,...wo,...So};export{ir as domMax};
1
+ import{q as t,t as e,u as i,v as n,w as s,x as o,y as r,z as a,A as l,B as h,C as u,D as c,E as d,F as p,G as m,H as f,I as y,J as g,K as v,M as x,b as T,n as P,o as w,r as S,N as A,m as E,i as b,h as V,p as M,k as C,O as D,d as k,s as R,P as L,L as j,S as B,a as F,Q as I,j as O,R as U,T as N,l as $,e as K,f as W,g as z}from"./size-rollup-dom-max-assets.js";import{jsx as Y}from"react/jsx-runtime";import{useContext as X,useId as G,useEffect as H,useCallback as q,Component as _,Fragment as Z}from"react";function J(t,e){-1===t.indexOf(e)&&t.push(e)}function Q(t,e){const i=t.indexOf(e);i>-1&&t.splice(i,1)}function tt(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let et=()=>{},it=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(et=(t,e,i)=>{t||"undefined"==typeof console||console.warn(tt(e,i))},it=(t,e,i)=>{if(!t)throw new Error(tt(e,i))});const nt={},st=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function ot(t){return"object"==typeof t&&null!==t}const rt=t=>/^0[^.\s]+$/u.test(t);function at(t){let e;return()=>(void 0===e&&(e=t()),e)}const lt=t=>t,ht=(t,e)=>i=>e(t(i)),ut=(...t)=>t.reduce(ht),ct=(t,e,i)=>{const n=e-t;return 0===n?1:(i-t)/n};class dt{constructor(){this.subscriptions=[]}add(t){return J(this.subscriptions,t),()=>Q(this.subscriptions,t)}notify(t,e,i){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,i);else for(let s=0;s<n;s++){const n=this.subscriptions[s];n&&n(t,e,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const pt=t=>1e3*t,mt=t=>t/1e3;function ft(t,e){return e?t*(1e3/e):0}const yt=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function gt(t,e,i,n){if(t===e&&i===n)return lt;const s=e=>function(t,e,i,n,s){let o,r,a=0;do{r=e+(i-e)/2,o=yt(r,n,s)-t,o>0?i=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,i);return t=>0===t||1===t?t:yt(s(t),e,n)}const vt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,xt=t=>e=>1-t(1-e),Tt=gt(.33,1.53,.69,.99),Pt=xt(Tt),wt=vt(Pt),St=t=>(t*=2)<1?.5*Pt(t):.5*(2-Math.pow(2,-10*(t-1))),At=t=>1-Math.sin(Math.acos(t)),Et=xt(At),bt=vt(At),Vt=gt(.42,0,1,1),Mt=gt(0,0,.58,1),Ct=gt(.42,0,.58,1),Dt=t=>Array.isArray(t)&&"number"==typeof t[0],kt={linear:lt,easeIn:Vt,easeInOut:Ct,easeOut:Mt,circIn:At,circInOut:bt,circOut:Et,backIn:Pt,backInOut:wt,backOut:Tt,anticipate:St},Rt=t=>{if(Dt(t)){it(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,n,s]=t;return gt(e,i,n,s)}return"string"==typeof t?(it(void 0!==kt[t],`Invalid easing type '${t}'`,"invalid-easing-type"),kt[t]):t},Lt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],jt={value:null,addProjectionMetrics:null};function Bt(t,e){let i=!1,n=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>i=!0,r=Lt.reduce((t,i)=>(t[i]=function(t,e){let i=new Set,n=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function h(e){r.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,o=!1)=>{const a=o&&s?i:n;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[i,n]=[n,i],i.forEach(h),e&&jt.value&&jt.value.frameloop[e].push(l),l=0,i.clear(),s=!1,o&&(o=!1,u.process(t)))}};return u}(o,e?i:void 0),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:u,update:c,preRender:d,render:p,postRender:m}=r,f=()=>{const o=nt.useManualTiming?s.timestamp:performance.now();i=!1,nt.useManualTiming||(s.delta=n?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),h.process(s),u.process(s),c.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,i&&e&&(n=!1,t(f))};return{schedule:Lt.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(i||(i=!0,n=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<Lt.length;e++)r[Lt[e]].cancel(t)},state:s,steps:r}}const{schedule:Ft,cancel:It,state:Ot,steps:Ut}=Bt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:lt,!0);let Nt;function $t(){Nt=void 0}const Kt={now:()=>(void 0===Nt&&Kt.set(Ot.isProcessing||nt.useManualTiming?Ot.timestamp:performance.now()),Nt),set:t=>{Nt=t,queueMicrotask($t)}};function Wt(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 zt(t,e){return i=>i>0?e:t}const Yt=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},Xt=[n,e,i];function Gt(t){const e=(n=t,Xt.find(t=>t.test(n)));var n;if(et(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let s=e.parse(t);return e===i&&(s=function({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=Wt(a,n,t+1/3),o=Wt(a,n,t),r=Wt(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}}(s)),s}const Ht=(i,n)=>{const s=Gt(i),o=Gt(n);if(!s||!o)return zt(i,n);const r={...s};return i=>(r.red=Yt(s.red,o.red,i),r.green=Yt(s.green,o.green,i),r.blue=Yt(s.blue,o.blue,i),r.alpha=t(s.alpha,o.alpha,i),e.transform(r))},qt=new Set(["none","hidden"]);function _t(e,i){return n=>t(e,i,n)}function Zt(t){return"number"==typeof t?_t:"string"==typeof t?s(t)?zt:o.test(t)?Ht:te:Array.isArray(t)?Jt:"object"==typeof t?o.test(t)?Ht:Qt:zt}function Jt(t,e){const i=[...t],n=i.length,s=t.map((t,i)=>Zt(t)(t,e[i]));return t=>{for(let e=0;e<n;e++)i[e]=s[e](t);return i}}function Qt(t,e){const i={...t,...e},n={};for(const s in i)void 0!==t[s]&&void 0!==e[s]&&(n[s]=Zt(t[s])(t[s],e[s]));return t=>{for(const e in n)i[e]=n[e](t);return i}}const te=(t,e)=>{const i=r.createTransformer(e),n=a(t),s=a(e);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?qt.has(t)&&!s.values.length||qt.has(e)&&!n.values.length?function(t,e){return qt.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}(t,e):ut(Jt(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}(n,s),s.values),i):(et(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),zt(t,e))};function ee(e,i,n){if("number"==typeof e&&"number"==typeof i&&"number"==typeof n)return t(e,i,n);return Zt(e)(e,i)}const ie=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Ft.update(e,t),stop:()=>It(e),now:()=>Ot.isProcessing?Ot.timestamp:Kt.now()}},ne=(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)})`},se=2e4;function oe(t){let e=0;let i=t.next(e);for(;!i.done&&e<se;)e+=50,i=t.next(e);return e>=se?1/0:e}function re(t,e,i){const n=Math.max(e-5,0);return ft(i-t(n),e-n)}const ae=100,le=10,he=1,ue=0,ce=800,de=.3,pe=.3,me={granular:.01,default:2},fe={granular:.005,default:.5},ye=.01,ge=10,ve=.05,xe=1,Te=.001;function Pe({duration:t=ce,bounce:e=de,velocity:i=ue,mass:n=he}){let s,o;et(t<=pt(ge),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=l(ve,xe,r),t=l(ye,ge,mt(t)),r<1?(s=e=>{const n=e*r,s=n*t,o=n-i,a=Se(e,r),l=Math.exp(-s);return Te-o/a*l},o=e=>{const n=e*r*t,o=n*i+i,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-n),h=Se(Math.pow(e,2),r);return(-s(e)+Te>0?-1:1)*((o-a)*l)/h}):(s=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const a=function(t,e,i){let n=i;for(let i=1;i<we;i++)n-=t(n)/e(n);return n}(s,o,5/t);if(t=pt(t),isNaN(a))return{stiffness:ae,damping:le,duration:t};{const e=Math.pow(a,2)*n;return{stiffness:e,damping:2*r*Math.sqrt(n*e),duration:t}}}const we=12;function Se(t,e){return t*Math.sqrt(1-e*e)}const Ae=["duration","bounce"],Ee=["stiffness","damping","mass"];function be(t,e){return e.some(e=>void 0!==t[e])}function Ve(t=pe,e=de){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:s}=i;const o=i.keyframes[0],r=i.keyframes[i.keyframes.length-1],a={done:!1,value:o},{stiffness:h,damping:u,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:ue,stiffness:ae,damping:le,mass:he,isResolvedFromDuration:!1,...t};if(!be(t,Ee)&&be(t,Ae))if(t.visualDuration){const i=t.visualDuration,n=2*Math.PI/(1.2*i),s=n*n,o=2*l(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:he,stiffness:s,damping:o}}else{const i=Pe(t);e={...e,...i,mass:he},e.isResolvedFromDuration=!0}return e}({...i,velocity:-mt(i.velocity||0)}),f=p||0,y=u/(2*Math.sqrt(h*c)),g=r-o,v=mt(Math.sqrt(h/c)),x=Math.abs(g)<5;let T;if(n||(n=x?me.granular:me.default),s||(s=x?fe.granular:fe.default),y<1){const t=Se(v,y);T=e=>{const i=Math.exp(-y*v*e);return r-i*((f+y*v*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===y)T=t=>r-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 r-i*((f+y*v*g)*Math.sinh(n)+t*g*Math.cosh(n))/t}}const P={calculatedDuration:m&&d||null,next:t=>{const e=T(t);if(m)a.done=t>=d;else{let i=0===t?f:0;y<1&&(i=0===t?pt(f):re(T,t,e));const o=Math.abs(i)<=n,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(oe(P),se),e=ne(e=>P.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return P}function Me({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:u}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=i*e;const f=c+m,y=void 0===r?f:r(f);y!==f&&(m=y-c);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)<=h,d.value=d.done?y:i};let T,P;const w=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(T=t,P=Ve({keyframes:[d.value,p(d.value)],velocity:re(v,t,d.value),damping:s,stiffness:o,restDelta:h,restSpeed:u}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return P||void 0!==T||(e=!0,x(t),w(t)),void 0!==T&&t>=T?P.next(t-T):(!e&&x(t),d)}}}function Ce(t,e,{clamp:i=!0,ease:n,mixer:s}={}){const o=t.length;if(it(o===e.length,"Both input and output ranges must be the same length","range-length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,i){const n=[],s=i||nt.mix||ee,o=t.length-1;for(let i=0;i<o;i++){let o=s(t[i],t[i+1]);if(e){const t=Array.isArray(e)?e[i]||lt:e;o=ut(t,o)}n.push(o)}return n}(e,n,s),h=a.length,u=i=>{if(r&&i<t[0])return e[0];let n=0;if(h>1)for(;n<t.length-2&&!(i<t[n+1]);n++);const s=ct(t[n],t[n+1],i);return a[n](s)};return i?e=>u(l(t[0],t[o-1],e)):u}function De(e){const i=[0];return function(e,i){const n=e[e.length-1];for(let s=1;s<=i;s++){const o=ct(0,i,s);e.push(t(n,1,o))}}(i,e.length-1),i}function ke({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(n)?n.map(Rt):Rt(n),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(i&&i.length===e.length?i:De(e),t),a=Ce(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||Ct).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}Ve.applyToOptions=t=>{const e=function(t,e=100,i){const n=i({...t,keyframes:[0,e]}),s=Math.min(oe(n),se);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:mt(s)}}(t,100,Ve);return t.ease=e.ease,t.duration=pt(e.duration),t.type="keyframes",t};const Re=t=>null!==t;function Le(t,{repeat:e,repeatType:i="loop"},n,s=1){const o=t.filter(Re),r=s<0||e&&"loop"!==i&&e%2==1?0:o.length-1;return r&&void 0!==n?n:o[r]}const je={decay:Me,inertia:Me,tween:ke,keyframes:ke,spring:Ve};function Be(t){"string"==typeof t.type&&(t.type=je[t.type])}class Fe{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 Ie=t=>t/100;class Oe extends Fe{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!==Kt.now()&&this.tick(Kt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Be(t);const{type:e=ke,repeat:i=0,repeatDelay:n=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||ke;a!==ke&&"number"!=typeof r[0]&&(this.mixKeyframes=ut(Ie,ee(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=oe(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+n,this.totalDuration=this.resolvedDuration*(i+1)-n,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:i,totalDuration:n,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return i.next(0);const{delay:h=0,keyframes:u,repeat:c,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-n/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-h*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>n;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let x=this.currentTime,T=i;if(c){const t=Math.min(this.currentTime,n)/r;let e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===d?(i=1-i,p&&(i-=p/r)):"mirror"===d&&(T=o)),x=l(0,1,i)*r}const P=v?{done:!1,value:u[0]}:T.next(x);s&&(P.value=s(P.value));let{done:w}=P;v||null===a||(w=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return S&&m!==Me&&(P.value=Le(u,this.options,y,this.speed)),f&&f(P.value),S&&this.finish(),P}then(t,e){return this.finished.then(t,e)}get duration(){return mt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+mt(t)}get time(){return mt(this.currentTime)}set time(t){t=pt(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(Kt.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=mt(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ie,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(Kt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Ue=t=>180*t/Math.PI,Ne=t=>{const e=Ue(Math.atan2(t[1],t[0]));return Ke(e)},$e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ne,rotateZ:Ne,skewX:t=>Ue(Math.atan(t[1])),skewY:t=>Ue(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ke=t=>((t%=360)<0&&(t+=360),t),We=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ze=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ye={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:We,scaleY:ze,scale:t=>(We(t)+ze(t))/2,rotateX:t=>Ke(Ue(Math.atan2(t[6],t[5]))),rotateY:t=>Ke(Ue(Math.atan2(-t[2],t[0]))),rotateZ:Ne,rotate:Ne,skewX:t=>Ue(Math.atan(t[4])),skewY:t=>Ue(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Xe(t){return t.includes("scale")?1:0}function Ge(t,e){if(!t||"none"===t)return Xe(e);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,s;if(i)n=Ye,s=i;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=$e,s=e}if(!s)return Xe(e);const o=n[e],r=s[1].split(",").map(He);return"function"==typeof o?o(r):r[o]}function He(t){return parseFloat(t.trim())}const qe=t=>t===h||t===u,_e=new Set(["x","y","z"]),Ze=c.filter(t=>!_e.has(t));const Je={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})=>Ge(e,"x"),y:(t,{transform:e})=>Ge(e,"y")};Je.translateX=Je.x,Je.translateY=Je.y;const Qe=new Set;let ti=!1,ei=!1,ii=!1;function ni(){if(ei){const t=Array.from(Qe).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 Ze.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)})}ei=!1,ti=!1,Qe.forEach(t=>t.complete(ii)),Qe.clear()}function si(){Qe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ei=!0)})}class oi{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?(Qe.add(this),ti||(ti=!0,Ft.read(si),Ft.resolveKeyframes(ni))):(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])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Qe.delete(this)}cancel(){"scheduled"===this.state&&(Qe.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const ri=at(()=>void 0!==window.ScrollTimeline),ai={};function li(t,e){const i=at(t);return()=>ai[e]??i()}const hi=li(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),ui=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,ci={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ui([0,.65,.55,1]),circOut:ui([.55,0,1,.45]),backIn:ui([.31,.01,.66,-.59]),backOut:ui([.33,1.53,.69,.99])};function di(t,e){return t?"function"==typeof t?hi()?ne(t,e):"ease-out":Dt(t)?ui(t):Array.isArray(t)?t.map(t=>di(t,e)||ci.easeOut):ci[t]:void 0}function pi(t,e,i,{delay:n=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},h=void 0){const u={[e]:i};l&&(u.offset=l);const c=di(a,s);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};h&&(d.pseudoElement=h);return t.animate(u,d)}function mi(t){return"function"==typeof t&&"applyToOptions"in t}class fi extends Fe{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:i,keyframes:n,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,it("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return mi(t)&&hi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=pi(e,i,n,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Le(n,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,i){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,i):t.style[e]=i}(e,i,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return mt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+mt(t)}get time(){return mt(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=pt(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:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&ri()?(this.animation.timeline=t,lt):e(this)}}const yi={anticipate:St,backInOut:wt,circInOut:bt};function gi(t){"string"==typeof t.ease&&t.ease in yi&&(t.ease=yi[t.ease])}class vi extends fi{constructor(t){gi(t),Be(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:i,onComplete:n,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Oe({...o,autoplay:!1}),a=Math.max(10,Kt.now()-this.startTime),h=l(0,10,a-10);e.setWithVelocity(r.sample(Math.max(0,a-h)).value,r.sample(a).value,h),r.stop()}}const xi=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!r.test(t)&&"0"!==t||t.startsWith("url(")));function Ti(t){t.duration=0,t.type="keyframes"}const Pi=new Set(["opacity","clipPath","filter","transform"]),wi=at(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Si extends Fe{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:h,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Kt.now();const c={autoplay:t,delay:e,type:i,repeat:n,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:h,...u},d=h?.KeyframeResolver||oi;this.keyframeResolver=new d(r,(t,e,i)=>this.onKeyframesResolved(t,e,c,!i),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,i,n){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:h}=i;this.resolvedAt=Kt.now(),function(t,e,i,n){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=xi(s,e),a=xi(o,e);return et(r===a,`You are trying to animate ${e} from "${s}" to "${o}". "${r?o:s}" is not an animatable value.`,"value-not-animatable"),!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===i||mi(i))&&n)}(t,s,o,r)||(!nt.instantAnimations&&a||h?.(Le(t,i,e)),t[0]=t[t.length-1],Ti(i),i.repeat=0);const u={startTime:n?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...i,keyframes:t},c=!l&&function(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:h}=e.owner.getProps();return wi()&&i&&Pi.has(i)&&("transform"!==i||!h)&&!l&&!n&&"mirror"!==s&&0!==o&&"inertia"!==r}(u)?new vi({...u,element:u.motionValue.owner.current}):new Oe(u);c.finished.then(()=>this.notifyFinished()).catch(lt),this.pendingTimeline&&(this.stopTimeline=c.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=c}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(),ii=!0,si(),ni(),ii=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const Ai=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ei(t,e,i=1){it(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[n,o]=function(t){const e=Ai.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}(t);if(!n)return;const r=window.getComputedStyle(e).getPropertyValue(n);if(r){const t=r.trim();return st(t)?parseFloat(t):t}return s(o)?Ei(o,e,i+1):o}function bi(t,e){return t?.[e]??t?.default??t}const Vi=new Set(["width","height","top","left","right","bottom",...c]),Mi=t=>e=>e.test(t),Ci=[h,u,d,p,m,f,{test:t=>"auto"===t,parse:t=>t}],Di=t=>Ci.find(Mi(t));function ki(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||rt(t))}const Ri=new Set(["brightness","contrast","saturate","opacity"]);function Li(t){const[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=i.match(y)||[];if(!n)return t;const s=i.replace(n,"");let o=Ri.has(e)?1:0;return n!==i&&(o*=100),e+"("+o+s+")"}const ji=/\b([a-z-]*)\(.*?\)/gu,Bi={...r,getAnimatableNone:t=>{const e=t.match(ji);return e?e.map(Li).join(" "):t}},Fi={...g,color:o,backgroundColor:o,outlineColor:o,fill:o,stroke:o,borderColor:o,borderTopColor:o,borderRightColor:o,borderBottomColor:o,borderLeftColor:o,filter:Bi,WebkitFilter:Bi},Ii=t=>Fi[t];function Oi(t,e){let i=Ii(t);return i!==Bi&&(i=r),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const Ui=new Set(["auto","none","0"]);class Ni extends oi{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(),s(n))){const s=Ei(n,e.current);void 0!==s&&(t[i]=s),i===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!Vi.has(i)||2!==t.length)return;const[n,o]=t,r=Di(n),a=Di(o);if(v(n)!==v(o)&&Je[i])this.needsMeasurement=!0;else if(r!==a)if(qe(r)&&qe(a))for(let e=0;e<t.length;e++){const i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else Je[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++)(null===t[e]||ki(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&&!Ui.has(e)&&a(e).values.length&&(n=t[s]),s++}if(n&&i)for(const s of e)t[s]=Oi(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=Je[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]=Je[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()}}class $i{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=Kt.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=Kt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new dt);const i=this.events[t].add(e);return"change"===t?()=>{i(),Ft.read(()=>{this.events.change.getSize()||this.stop()})}:i}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 this.current}getPrevious(){return this.prev}getVelocity(){const t=Kt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return ft(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ki(t,e){return new $i(t,e)}const{schedule:Wi,cancel:zi}=Bt(queueMicrotask,!1),Yi={x:!1,y:!1};function Xi(){return Yi.x||Yi.y}function Gi(t,e){const i=function(t){if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t)}(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function Hi(t){return!("touch"===t.pointerType||Xi())}const qi=(t,e)=>!!e&&(t===e||qi(t,e.parentElement)),_i=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Zi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ji(t){return Zi.has(t.tagName)||!0===t.isContentEditable}const Qi=new WeakSet;function tn(t){return e=>{"Enter"===e.key&&t(e)}}function en(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function nn(t){return _i(t)&&!Xi()}function sn(t,e,i={}){const[n,s,o]=Gi(t,i),r=t=>{const n=t.currentTarget;if(!nn(t))return;Qi.add(n);const o=e(n,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Qi.has(n)&&Qi.delete(n),nn(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,n===window||n===document||i.useGlobalTarget||qi(n,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return n.forEach(t=>{var e;(i.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),ot(e=t)&&"offsetHeight"in e&&(t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const n=tn(()=>{if(Qi.has(i))return;en(i,"down");const t=tn(()=>{en(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>en(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),Ji(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function on(t){return ot(t)&&"ownerSVGElement"in t}const rn=[...Ci,o,r];class an{constructor(t){this.isMounted=!1,this.node=t}update(){}}const ln=t=>null!==t;const hn={type:"spring",stiffness:500,damping:25,restSpeed:10},un={type:"keyframes",duration:.8},cn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},dn=(t,{keyframes:e})=>e.length>2?un:x.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:hn:cn;const pn=(t,e,i,n={},s,o)=>r=>{const a=bi(n,t)||{},l=a.delay||n.delay||0;let{elapsed:h=0}=n;h-=pt(l);const u={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-h,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length})(a)||Object.assign(u,dn(t,u)),u.duration&&(u.duration=pt(u.duration)),u.repeatDelay&&(u.repeatDelay=pt(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(Ti(u),0===u.delay&&(c=!0)),(nt.instantAnimations||nt.skipAnimations)&&(c=!0,Ti(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:i="loop"},n){const s=t.filter(ln),o=e&&"loop"!==i&&e%2==1?0:s.length-1;return o&&void 0!==n?n:s[o]}(u.keyframes,a);if(void 0!==t)return void Ft.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Oe(u):new Si(u)};function mn(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}function fn(t){return{point:{x:t.pageX,y:t.pageY}}}function yn(t,e,i,n){return mn(t,e,(t=>e=>_i(e)&&t(e,fn(e)))(i),n)}function gn({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function vn(t){return t.max-t.min}function xn(e,i,n,s=.5){e.origin=s,e.originPoint=t(i.min,i.max,e.origin),e.scale=vn(n)/vn(i),e.translate=t(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Tn(t,e,i,n){xn(t.x,e.x,i.x,n?n.originX:void 0),xn(t.y,e.y,i.y,n?n.originY:void 0)}function Pn(t,e,i){t.min=i.min+e.min,t.max=t.min+vn(e)}function wn(t,e,i){t.min=e.min-i.min,t.max=t.min+vn(e)}function Sn(t,e,i){wn(t.x,e.x,i.x),wn(t.y,e.y,i.y)}const An=()=>({x:{min:0,max:0},y:{min:0,max:0}});function En(t){return[t("x"),t("y")]}function bn(t){return void 0===t||1===t}function Vn({scale:t,scaleX:e,scaleY:i}){return!bn(t)||!bn(e)||!bn(i)}function Mn(t){return Vn(t)||Cn(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Cn(t){return Dn(t.x)||Dn(t.y)}function Dn(t){return t&&"0%"!==t}function kn(t,e,i){return i+e*(t-i)}function Rn(t,e,i,n,s){return void 0!==s&&(t=kn(t,s,n)),kn(t,i,n)+e}function Ln(t,e=0,i=1,n,s){t.min=Rn(t.min,e,i,n,s),t.max=Rn(t.max,e,i,n,s)}function jn(t,{x:e,y:i}){Ln(t.x,e.translate,e.scale,e.originPoint),Ln(t.y,i.translate,i.scale,i.originPoint)}const Bn=.999999999999,Fn=1.0000000000001;function In(t,e){t.min=t.min+e,t.max=t.max+e}function On(e,i,n,s,o=.5){Ln(e,i,n,t(e.min,e.max,o),s)}function Un(t,e){On(t.x,e.x,e.scaleX,e.scale,e.originX),On(t.y,e.y,e.scaleY,e.scale,e.originY)}function Nn(t,e){return gn(function(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}}(t.getBoundingClientRect(),e))}const $n=({current:t})=>t?t.ownerDocument.defaultView:null;function Kn(t,e){const i=t.getValue("willChange");if(n=i,Boolean(T(n)&&n.add))return i.add(e);if(!i&&nt.WillChange){const i=new nt.WillChange("auto");t.addValue("willChange",i),i.add(e)}var n}const Wn=(t,e)=>Math.abs(t-e);const zn=new Set(["auto","scroll"]);class Yn{constructor(t,e,{transformPagePoint:i,contextWindow:n=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Hn(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){const i=Wn(t.x,e.x),n=Wn(t.y,e.y);return Math.sqrt(i**2+n**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!i)return;const{point:n}=t,{timestamp:s}=Ot;this.history.push({...n,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Xn(e,this.transformPagePoint),Ft.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:i,onSessionEnd:n,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Hn("pointercancel"===t.type?this.lastMoveEventInfo:Xn(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,o),n&&n(t,o)},!_i(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=n||window;const a=Xn(fn(t),this.transformPagePoint),{point:l}=a,{timestamp:h}=Ot;this.history=[{...l,timestamp:h}];const{onSessionStart:u}=e;u&&u(t,Hn(a,this.history)),this.removeListeners=ut(yn(this.contextWindow,"pointermove",this.handlePointerMove),yn(this.contextWindow,"pointerup",this.handlePointerUp),yn(this.contextWindow,"pointercancel",this.handlePointerUp)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(zn.has(t.overflowX)||zn.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const i=t===window,n=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s=n.x-e.x,o=n.y-e.y;0===s&&0===o||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,n),Ft.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),It(this.updatePoint)}}function Xn(t,e){return e?{point:e(t.point)}:t}function Gn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Hn({point:t},e){return{point:t,delta:Gn(t,_n(e)),offset:Gn(t,qn(e)),velocity:Zn(e,.1)}}function qn(t){return t[0]}function _n(t){return t[t.length-1]}function Zn(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null;const s=_n(t);for(;i>=0&&(n=t[i],!(s.timestamp-n.timestamp>pt(e)));)i--;if(!n)return{x:0,y:0};const o=mt(s.timestamp-n.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-n.x)/o,y:(s.y-n.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Jn(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function Qn(t,e){let i=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,n]=[n,i]),{min:i,max:n}}const ts=.35;function es(t,e,i){return{min:is(t,e),max:is(t,i)}}function is(t,e){return"number"==typeof t?t:t[e]||0}const ns=new WeakMap;class ss{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:i}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:s}=this.getProps();this.panSession=new Yn(t,{onSessionStart:t=>{e?(this.stopAnimation(),this.snapToCursor(fn(t).point)):this.pauseAnimation()},onStart:(t,e)=>{this.stopAnimation();const{drag:i,dragPropagation:n,onDragStart:s}=this.getProps();if(i&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=i)||"y"===o?Yi[o]?null:(Yi[o]=!0,()=>{Yi[o]=!1}):Yi.x||Yi.y?null:(Yi.x=Yi.y=!0,()=>{Yi.x=Yi.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),En(t=>{let e=this.getAxisMotionValue(t).get()||0;if(d.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const n=i.layout.layoutBox[t];if(n){e=vn(n)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&Ft.postRender(()=>s(t,e)),Kn(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:i,dragDirectionLock:n,onDirectionLock:s,onDrag:o}=this.getProps();if(!i&&!this.openDragLock)return;const{offset:r}=e;if(n&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let i=null;Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x");return i}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>En(t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play())},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:i,contextWindow:$n(this.visualElement),element:this.visualElement.current})}stop(t,e){const i=t||this.latestPointerEvent,n=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!n||!i)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&Ft.postRender(()=>r(i,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(e,i,n){const{drag:s}=this.getProps();if(!n||!os(e,s,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(r=function(e,{min:i,max:n},s){return void 0!==i&&e<i?e=s?t(i,e,s.min):Math.max(e,i):void 0!==n&&e>n&&(e=s?t(n,e,s.max):Math.min(e,n)),e}(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;t&&P(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(t,{top:e,left:i,bottom:n,right:s}){return{x:Jn(t.x,i,s),y:Jn(t.y,e,n)}}(i.layoutBox,t),this.elastic=function(t=ts){return!1===t?t=0:!0===t&&(t=ts),{x:es(t,"left","right"),y:es(t,"top","bottom")}}(e),n!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&En(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!P(t))return!1;const i=t.current;it(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const s=function(t,e,i){const n=Nn(t,i),{scroll:s}=e;return s&&(In(n.x,s.offset.x),In(n.y,s.offset.y)),n}(i,n.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Qn(t.x,e.x),y:Qn(t.y,e.y)}}(n.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=gn(t))}return o}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:n,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=En(r=>{if(!os(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const h=n?200:1e6,u=n?40:1e7,c={type:"inertia",velocity:i?t[r]:0,bounceStiffness:h,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const i=this.getAxisMotionValue(t);return Kn(this.visualElement,t),i.start(pn(t,i,0,e,this.visualElement,!1))}stopAnimation(){En(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){En(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),n=i[e];return n||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(e){En(i=>{const{drag:n}=this.getProps();if(!os(i,n,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(i);if(s&&s.layout){const{min:n,max:r}=s.layout.layoutBox[i],a=o.get()||0;o.set(e[i]-t(n,r,.5)+a)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:i}=this.getProps(),{projection:n}=this.visualElement;if(!P(i)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};En(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const i=e.get();s[t]=function(t,e){let i=.5;const n=vn(t),s=vn(e);return s>n?i=ct(e.min,e.max-n,t.min):n>s&&(i=ct(t.min,t.max-s,e.min)),l(0,1,i)}({min:i,max:i},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),En(i=>{if(!os(i,e,null))return;const n=this.getAxisMotionValue(i),{min:o,max:r}=this.constraints[i];n.set(t(o,r,s[i]))})}addListeners(){if(!this.visualElement.current)return;ns.set(this.visualElement,this);const t=yn(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:i=!0}=this.getProps();e&&i&&!Ji(t.target)&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();P(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,n=i.addEventListener("measure",e);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ft.read(e);const s=mn(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(En(e=>{const i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),n(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:s=!1,dragElastic:o=ts,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:n,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function os(t,e,i){return!(!0!==e&&e!==t||null!==i&&i!==t)}const rs=t=>(e,i)=>{t&&Ft.postRender(()=>t(e,i))};function as(t){return t.props[w]}const ls=(t,e)=>t.depth-e.depth;class hs{constructor(){this.children=[],this.isDirty=!1}add(t){J(this.children,t),this.isDirty=!0}remove(t){Q(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ls),this.isDirty=!1,this.children.forEach(t)}}const us=["TopLeft","TopRight","BottomLeft","BottomRight"],cs=us.length,ds=t=>"string"==typeof t?parseFloat(t):t,ps=t=>"number"==typeof t||u.test(t);function ms(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const fs=gs(0,.5,Et),ys=gs(.5,.95,lt);function gs(t,e,i){return n=>n<t?0:n>e?1:i(ct(t,e,n))}function vs(t,e){t.min=e.min,t.max=e.max}function xs(t,e){vs(t.x,e.x),vs(t.y,e.y)}function Ts(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Ps(t,e,i,n,s){return t=kn(t-=e,1/i,n),void 0!==s&&(t=kn(t,1/s,n)),t}function ws(e,i,[n,s,o],r,a){!function(e,i=0,n=1,s=.5,o,r=e,a=e){d.test(i)&&(i=parseFloat(i),i=t(a.min,a.max,i/100)-a.min);if("number"!=typeof i)return;let l=t(r.min,r.max,s);e===r&&(l-=i),e.min=Ps(e.min,i,n,l,o),e.max=Ps(e.max,i,n,l,o)}(e,i[n],i[s],i[o],i.scale,r,a)}const Ss=["x","scaleX","originX"],As=["y","scaleY","originY"];function Es(t,e,i,n){ws(t.x,e,Ss,i?i.x:void 0,n?n.x:void 0),ws(t.y,e,As,i?i.y:void 0,n?n.y:void 0)}function bs(t){return 0===t.translate&&1===t.scale}function Vs(t){return bs(t.x)&&bs(t.y)}function Ms(t,e){return t.min===e.min&&t.max===e.max}function Cs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ds(t,e){return Cs(t.x,e.x)&&Cs(t.y,e.y)}function ks(t){return vn(t.x)/vn(t.y)}function Rs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Ls{constructor(){this.members=[]}add(t){J(this.members,t),t.scheduleRender()}remove(t){if(Q(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 js={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Bs=["","X","Y","Z"];let Fs=0;function Is(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function Os(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=as(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",Ft,!(e||n))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&Os(n)}function Us({attachResizeListener:e,defaultParent:i,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},e=i?.()){this.id=Fs++,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,this.nodes.forEach(Ks),this.nodes.forEach(qs),this.nodes.forEach(_s),this.nodes.forEach(Ws)},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 hs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new dt),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const i=this.eventHandlers.get(t);i&&i.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(t){if(this.instance)return;var i;this.isSVG=on(t)&&!(on(i=t)&&"svg"===i.tagName),this.instance=t;const{layoutId:n,layout:s,visualElement:o}=this.options;if(o&&!o.current&&o.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(s||n)&&(this.isLayoutDirty=!0),e){let i,n=0;const s=()=>this.root.updateBlockedByResize=!1;Ft.read(()=>{n=window.innerWidth}),e(t,()=>{const t=window.innerWidth;t!==n&&(n=t,this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){const i=Kt.now(),n=({timestamp:s})=>{const o=s-i;o>=e&&(It(n),t(o-e))};return Ft.setup(n,!0),()=>It(n)}(s,250),js.hasAnimatedSinceResize&&(js.hasAnimatedSinceResize=!1,this.nodes.forEach(Hs)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||s)&&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 s=this.options.transition||o.getDefaultTransition()||io,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Ds(this.targetLayout,n),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...bi(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h)}else e||Hs(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(),It(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(Zs),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&&Os(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(Ys);if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Xs);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Gs),this.nodes.forEach(Ns),this.nodes.forEach($s)):this.nodes.forEach(Xs),this.clearAllSnapshots();const t=Kt.now();Ot.delta=l(0,1e3/60,t-Ot.timestamp),Ot.timestamp=t,Ot.isProcessing=!0,Ut.update.process(Ot),Ut.preRender.process(Ot),Ut.render.process(Ot),Ot.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Wi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zs),this.sharedNodes.forEach(Js)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ft.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ft.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||vn(this.snapshot.measuredBox.x)||vn(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=s(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!o)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!Vs(this.projectionDelta),i=this.getTransformTemplate(),n=i?i(this.latestValues,""):void 0,s=n!==this.prevTransformTemplateValue;t&&this.instance&&(e||Mn(this.latestValues)||s)&&(o(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)),oo((n=i).x),oo(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(ao))){const{scroll:t}=this.root;t&&(In(e.x,t.offset.x),In(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(xs(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&&xs(e,t),In(e.x,s.offset.x),In(e.y,s.offset.y))}return e}applyTransform(t,e=!1){const i={x:{min:0,max:0},y:{min:0,max:0}};xs(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&&Un(i,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),Mn(n.latestValues)&&Un(i,n.latestValues)}return Mn(this.latestValues)&&Un(i,this.latestValues),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};xs(e,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!Mn(i.latestValues))continue;Vn(i.latestValues)&&i.updateSnapshot();const n=An();xs(n,i.measurePageBox()),Es(e,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,n)}return Mn(this.latestValues)&&Es(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!==Ot.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:n,layoutId:s}=this.options;if(!this.layout||!n&&!s)return;this.resolvedRelativeTargetAt=Ot.timestamp;const o=this.getClosestProjectingParent();var r,a,l;(o&&this.linkedParentVersion!==o.layoutVersion&&!o.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(o&&o.layout?this.createRelativeTarget(o,this.layout.layoutBox,o.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(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,Pn(r.x,a.x,l.x),Pn(r.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):xs(this.target,this.layout.layoutBox),jn(this.target,this.targetDelta)):xs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,o&&Boolean(o.resumingFrom)===Boolean(this.resumingFrom)&&!o.options.layoutScroll&&o.target&&1!==this.animationProgress?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(this.parent&&!Vn(this.parent.latestValues)&&!Cn(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}},Sn(this.relativeTargetOrigin,e,i),xs(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===Ot.timestamp&&(i=!1),i)return;const{layout:n,layoutId:s}=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||!n&&!s)return;xs(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,r=this.treeScale.y;!function(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&&Un(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,jn(t,r)),n&&Mn(o.latestValues)&&Un(t,o.latestValues))}e.x<Fn&&e.x>Bn&&(e.x=1),e.y<Fn&&e.y>Bn&&(e.y=1)}(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:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(Ts(this.prevProjectionDelta.x,this.projectionDelta.x),Ts(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Tn(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Rs(this.projectionDelta.x,this.prevProjectionDelta.x)&&Rs(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):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(e,i=!1){const n=this.snapshot,s=n?n.latestValues:{},o={...this.latestValues},r={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=!i;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(eo));let p;this.animationProgress=0,this.mixTargetDelta=i=>{const n=i/1e3;var h,m,f,y,g,v;Qs(r.x,e.x,n),Qs(r.y,e.y,n),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Sn(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f=this.relativeTarget,y=this.relativeTargetOrigin,g=a,v=n,to(f.x,y.x,g.x,v),to(f.y,y.y,g.y,v),p&&(h=this.relativeTarget,m=p,Ms(h.x,m.x)&&Ms(h.y,m.y))&&(this.isProjectionDirty=!1),p||(p={x:{min:0,max:0},y:{min:0,max:0}}),xs(p,this.relativeTarget)),l&&(this.animationValues=o,function(e,i,n,s,o,r){o?(e.opacity=t(0,n.opacity??1,fs(s)),e.opacityExit=t(i.opacity??1,0,ys(s))):r&&(e.opacity=t(i.opacity??1,n.opacity??1,s));for(let o=0;o<cs;o++){const r=`border${us[o]}Radius`;let a=ms(i,r),l=ms(n,r);void 0===a&&void 0===l||(a||(a=0),l||(l=0),0===a||0===l||ps(a)===ps(l)?(e[r]=Math.max(t(ds(a),ds(l),s),0),(d.test(l)||d.test(a))&&(e[r]+="%")):e[r]=l)}(i.rotate||n.rotate)&&(e.rotate=t(i.rotate||0,n.rotate||0,s))}(o,s,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(It(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ft.update(()=>{js.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ki(0)),this.currentAnimation=function(t,e,i){const n=T(t)?t:Ki(t);return n.start(pn("",n,e,i)),n.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{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&&ro(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=vn(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const n=vn(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}xs(e,i),Un(e,s),Tn(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ls);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&&Is("z",t,n,this.animationValues);for(let e=0;e<Bs.length;e++)Is(`rotate${Bs[e]}`,t,n,this.animationValues),Is(`skew${Bs[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=S(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=S(e?.pointerEvents)||""),void(this.hasProjected&&!Mn(this.latestValues)&&(t.transform=i?i({},""):"none",this.hasProjected=!1));t.visibility="";const s=n.animationValues||n.latestValues;this.applyTransformsToTarget();let o=function(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"}(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 A){if(void 0===s[e])continue;const{correct:i,applyTo:r,isCSSVariable:a}=A[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?S(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(Ys),this.root.sharedNodes.clear()}}}function Ns(t){t.updateLayout()}function $s(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?En(t=>{const n=o?e.measuredBox[t]:e.layoutBox[t],s=vn(n);n.min=i[t].min,n.max=n.min+s}):ro(s,e.layoutBox,i)&&En(n=>{const s=o?e.measuredBox[n]:e.layoutBox[n],r=vn(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}};Tn(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?Tn(a,t.applyTransform(n,!0),e.measuredBox):Tn(a,i,e.layoutBox);const l=!Vs(r);let h=!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}};Sn(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Sn(a,i,o.layoutBox),Ds(r,a)||(h=!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:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Ks(t){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 Ws(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function zs(t){t.clearSnapshot()}function Ys(t){t.clearMeasurements()}function Xs(t){t.isLayoutDirty=!1}function Gs(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Hs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function qs(t){t.resolveTargetDelta()}function _s(t){t.calcProjection()}function Zs(t){t.resetSkewAndRotation()}function Js(t){t.removeLeadSnapshot()}function Qs(e,i,n){e.translate=t(i.translate,0,n),e.scale=t(i.scale,1,n),e.origin=i.origin,e.originPoint=i.originPoint}function to(e,i,n,s){e.min=t(i.min,n.min,s),e.max=t(i.max,n.max,s)}function eo(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const io={duration:.45,ease:[.4,0,.1,1]},no=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),so=no("applewebkit/")&&!no("chrome/")?Math.round:lt;function oo(t){t.min=so(t.min),t.max=so(t.max)}function ro(t,e,i){return"position"===t||"preserve-aspect"===t&&(n=ks(e),s=ks(i),o=.2,!(Math.abs(n-s)<=o));var n,s,o}function ao(t){return t!==t.root&&t.scroll?.wasRoot}const lo=Us({attachResizeListener:(t,e)=>mn(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ho={current:void 0},uo=Us({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ho.current){const t=new lo({});t.mount(window),t.setOptions({layoutScroll:!0}),ho.current=t}return ho.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),co={current:null},po={current:!1};const mo=new WeakMap;const fo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class yo{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:n,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=oi,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=Kt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Ft.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=o;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=r,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=b(e),this.isVariantNode=V(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==a[t]&&T(e)&&e.set(a[t])}}mount(t){this.current=t,mo.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:(po.current||function(){if(po.current=!0,E)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>co.current=t.matches;t.addEventListener("change",e),e()}else co.current=!1}(),this.shouldReduceMotion=co.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),It(this.notifyUpdate),It(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=x.has(t);i&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Ft.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;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 M){const e=M[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<fo.length;e++){const i=fo[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=function(t,e,i){for(const n in e){const s=e[n],o=i[n];if(T(s))t.addValue(n,s);else if(T(o))t.addValue(n,Ki(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,Ki(void 0!==e?e:s,{owner:t}))}}for(const n in i)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const 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=Ki(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=i&&("string"==typeof i&&(st(i)||rt(i))?i=parseFloat(i):(n=i,!rn.find(Mi(n))&&r.test(e)&&(i=Oi(t,e))),this.setBaseTarget(t,T(i)?i.get():i)),T(i)?i.get():i}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=C(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||T(n)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new dt),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){Wi.render(this.render)}}class go extends yo{constructor(){super(...arguments),this.KeyframeResolver=Ni}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;T(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function vo(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])}class xo extends go{constructor(){super(...arguments),this.type="html",this.renderInstance=vo}readValueFromInstance(t,e){if(x.has(e))return this.projection?.isProjecting?Xe(e):((t,e)=>{const{transform:i="none"}=getComputedStyle(t);return Ge(i,e)})(t,e);{const n=(i=t,window.getComputedStyle(i)),s=(D(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof s?s.trim():s}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return Nn(t,e)}build(t,e,i){k(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return R(t,e,i)}}let To=!1;class Po extends _{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:n}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),i&&i.register&&n&&i.register(s),To&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),js.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:n,isPresent:s}=this.props,{projection:o}=i;return o?(o.isPresent=s,To=!0,n||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Ft.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Wi.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:n}=t;To=!0,n&&(n.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(n),i&&i.deregister&&i.deregister(n))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function wo(t){const[e,i]=function(t=!0){const e=X(L);if(null===e)return[!0,null];const{isPresent:i,onExitComplete:n,register:s}=e,o=G();H(()=>{if(t)return s(o)},[t]);const r=q(()=>t&&n&&n(o),[o,n,t]);return!i&&n?[!1,r]:[!0]}(),n=X(j);return Y(Po,{...t,layoutGroup:n,switchLayoutGroup:X(B),isPresent:e,safeToRemove:i})}const So={pan:{Feature:class extends an{constructor(){super(...arguments),this.removePointerDownListener=lt}onPointerDown(t){this.session=new Yn(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$n(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:rs(t),onStart:rs(e),onMove:i,onEnd:(t,e)=>{delete this.session,n&&Ft.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=yn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends an{constructor(t){super(t),this.removeGroupControls=lt,this.removeListeners=lt,this.controls=new ss(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||lt}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:uo,MeasureLayout:wo}},Ao={layout:{ProjectionNode:uo,MeasureLayout:wo}};function Eo(t,e,i){const n=t.getProps();return C(n,e,void 0!==i?i:n.custom,t)}const bo=t=>Array.isArray(t);function Vo(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,Ki(i))}function Mo(t){return bo(t)?t[t.length-1]||0:t}function Co({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}function Do(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;n&&(o=n);const l=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const n=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||h&&Co(h,e))continue;const r={delay:i,...bi(o||{},e)},u=n.get();if(void 0!==u&&!n.isAnimating&&!Array.isArray(s)&&s===u&&!r.velocity)continue;let c=!1;if(window.MotionHandoffAnimation){const i=as(t);if(i){const t=window.MotionHandoffAnimation(i,e,Ft);null!==t&&(r.startTime=t,c=!0)}}Kn(t,e),n.start(pn(e,n,s,t.shouldReduceMotion&&Vi.has(e)?{type:!1}:r,t,c));const d=n.animation;d&&l.push(d)}return r&&Promise.all(l).then(()=>{Ft.update(()=>{r&&function(t,e){const i=Eo(t,e);let{transitionEnd:n={},transition:s={},...o}=i||{};o={...o,...n};for(const e in o)Vo(t,e,Mo(o[e]))}(t,r)})}),l}function ko(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}function Ro(t,e,i={}){const n=Eo(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(Do(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(Ro(l,e,{...r,delay:i+("function"==typeof n?0:n)+ko(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 Lo(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 jo=I.length;function Bo(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Bo(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let i=0;i<jo;i++){const n=I[i],s=t.props[n];(F(s)||!1===s)&&(e[n]=s)}return e}const Fo=[...U].reverse(),Io=U.length;function Oo(t){return e=>Promise.all(e.map(({animation:e,options:i})=>function(t,e,i={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Ro(t,e,i));n=Promise.all(s)}else if("string"==typeof e)n=Ro(t,e,i);else{const s="function"==typeof e?Eo(t,e,i.custom):e;n=Promise.all(Do(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}(t,e,i)))}function Uo(t){let e=Oo(t),i=Ko(),n=!0;const s=e=>(i,n)=>{const s=Eo(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=Bo(t.parent)||{},l=[],h=new Set;let u={},c=1/0;for(let e=0;e<Io;e++){const d=Fo[e],p=i[d],m=void 0!==r[d]?r[d]:a[d],f=F(m),y=d===o?p.isActive:null;!1===y&&(c=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||O(m)||"boolean"==typeof m)continue;const v=No(p.prevProp,m);let x=v||d===o&&p.isActive&&!g&&f||e>c&&f,T=!1;const P=Array.isArray(m)?m:[m];let w=P.reduce(s(d),{});!1===y&&(w={});const{prevResolvedValues:S={}}=p,A={...S,...w},E=e=>{x=!0,h.has(e)&&(T=!0,h.delete(e)),p.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in A){const e=w[t],i=S[t];if(u.hasOwnProperty(t))continue;let n=!1;n=bo(e)&&bo(i)?!Lo(e,i):e!==i,n?null!=e?E(t):h.add(t):void 0!==e&&h.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=w,p.isActive&&(u={...u,...w}),n&&t.blockInitialAnimation&&(x=!1);const b=g&&v;x&&(!b||T)&&l.push(...P.map(e=>{const i={type:d};if("string"==typeof e&&n&&!b&&t.manuallyAnimateOnMount&&t.parent){const{parent:n}=t,s=Eo(n,e);if(n.enteringChildren&&s){const{delayChildren:e}=s.transition||{};i.delay=ko(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(h.size){const e={};if("boolean"!=typeof r.initial){const i=Eo(t,Array.isArray(r.initial)?r.initial[0]:r.initial);i&&i.transition&&(e.transition=i.transition)}h.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=Ko()}}}function No(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Lo(e,t)}function $o(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ko(){return{animate:$o(!0),whileInView:$o(),whileHover:$o(),whileTap:$o(),whileDrag:$o(),whileFocus:$o(),exit:$o()}}let Wo=0;const zo={animation:{Feature:class extends an{constructor(t){super(t),t.animationState||(t.animationState=Uo(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();O(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends an{constructor(){super(...arguments),this.id=Wo++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Yo(t,e,i){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===i);const s=n["onHover"+i];s&&Ft.postRender(()=>s(e,fn(e)))}function Xo(t,e,i){const{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap","Start"===i);const s=n["onTap"+("End"===i?"":i)];s&&Ft.postRender(()=>s(e,fn(e)))}const Go=new WeakMap,Ho=new WeakMap,qo=t=>{const e=Go.get(t.target);e&&e(t)},_o=t=>{t.forEach(qo)};function Zo(t,e,i){const n=function({root:t,...e}){const i=t||document;Ho.has(i)||Ho.set(i,{});const n=Ho.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(_o,{root:t,...e})),n[s]}(e);return Go.set(t,i),n.observe(t),()=>{Go.delete(t),n.unobserve(t)}}const Jo={some:0,all:1};const Qo={inView:{Feature:class extends an{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:n="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof n?n:Jo[n]};return Zo(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:i,onViewportLeave:n}=this.node.getProps(),o=e?i:n;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends an{mount(){const{current:t}=this.node;t&&(this.unmount=sn(t,(t,e)=>(Xo(this.node,e,"Start"),(t,{success:e})=>Xo(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends an{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ut(mn(this.node.current,"focus",()=>this.onFocus()),mn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends an{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,i={}){const[n,s,o]=Gi(t,i),r=t=>{if(!Hi(t))return;const{target:i}=t,n=e(i,t);if("function"!=typeof n||!i)return;const o=t=>{Hi(t)&&(n(t),i.removeEventListener("pointerleave",o))};i.addEventListener("pointerleave",o,s)};return n.forEach(t=>{t.addEventListener("pointerenter",r,s)}),o}(t,(t,e)=>(Yo(this.node,e,"Start"),t=>Yo(this.node,t,"End"))))}unmount(){}}}},tr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class er extends go{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=An}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(x.has(e)){const t=Ii(e);return t&&t.default||0}return e=tr.has(e)?e:N(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return $(t,e,i)}build(t,e,i){K(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){!function(t,e,i,n){vo(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(tr.has(i)?i:N(i),e.attrs[i])}(t,e,0,n)}mount(t){this.isSVGTag=W(t.tagName),super.mount(t)}}const ir={renderer:(t,e)=>e.isSVG??z(t)?new er(e):new xo(e,{allowProjection:t!==Z}),...zo,...Qo},nr={...ir,...So,...Ao};export{nr as domMax};