framer-motion 12.42.0 → 12.42.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 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,N as T,O as P,W as w,Q as S,R as E,T as A,U as D,V as b,X as M,Y as k,Z as C,_ as V,$ as L,k as R,a0 as B,a1 as j,b as I,o as O,a2 as F,a3 as U,a4 as z,a5 as W,a6 as $,a7 as N,a8 as G,a9 as H,aa as K,ab as Y,d as X,s as q,ac as _,ad as Z,l as J,e as Q,f as tt,ae as et,a as it,af as nt,j as st,ag as ot,ah as rt,ai as at,aj as lt,ak as ht,al as ut,am as ct,an as dt,ao as pt,r as mt,ap as ft,p as yt,P as gt,L as vt,S as xt,g as Tt}from"./size-rollup-dom-max-assets.js";import{jsx as Pt}from"react/jsx-runtime";import{useContext as wt,useId as St,useEffect as Et,useCallback as At,Component as Dt,Fragment as bt}from"react";const Mt=t=>"object"==typeof t&&null!==t,kt=(...t)=>t.reduce((t,e)=>i=>e(t(i))),Ct=(t,e,i)=>{const n=e-t;return n?(i-t)/n:1},Vt=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function Lt(e,i,n,s){if(e===i&&n===s)return t;const o=t=>function(t,e,i,n,s){let o,r,a=0;do{r=e+(i-e)/2,o=Vt(r,n,s)-t,o>0?i=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(t,0,1,e,n);return t=>0===t||1===t?t:Vt(o(t),i,s)}const Rt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Bt=t=>e=>1-t(1-e),jt=Lt(.33,1.53,.69,.99),It=Bt(jt),Ot=Rt(It),Ft=t=>t>=1?1:(t*=2)<1?.5*It(t):.5*(2-Math.pow(2,-10*(t-1))),Ut=t=>1-Math.sin(Math.acos(t)),zt=Bt(Ut),Wt=Rt(Ut),$t=Lt(.42,0,1,1),Nt=Lt(0,0,.58,1),Gt=Lt(.42,0,.58,1),Ht={linear:t,easeIn:$t,easeInOut:Gt,easeOut:Nt,circIn:Ut,circInOut:Wt,circOut:zt,backIn:It,backInOut:Ot,backOut:jt,anticipate:Ft},Kt=t=>{if(e(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,o]=t;return Lt(e,n,s,o)}return"string"==typeof t?(i(void 0!==Ht[t],`Invalid easing type '${t}'`,"invalid-easing-type"),Ht[t]):t};function Yt(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 Xt(t,e){return i=>i>0?e:t}const qt=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},_t=[r,s,o];function Zt(t){const e=(i=t,_t.find(t=>t.test(i)));var i;if(a(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let n=e.parse(t);return e===o&&(n=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=Yt(a,n,t+1/3),o=Yt(a,n,t),r=Yt(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}}(n)),n}const Jt=(t,e)=>{const i=Zt(t),o=Zt(e);if(!i||!o)return Xt(t,e);const r={...i};return t=>(r.red=qt(i.red,o.red,t),r.green=qt(i.green,o.green,t),r.blue=qt(i.blue,o.blue,t),r.alpha=n(i.alpha,o.alpha,t),s.transform(r))},Qt=new Set(["none","hidden"]);function te(t,e){return i=>n(t,e,i)}function ee(t){return"number"==typeof t?te:"string"==typeof t?l(t)?Xt:h.test(t)?Jt:se:Array.isArray(t)?ie:"object"==typeof t?h.test(t)?Jt:ne:Xt}function ie(t,e){const i=[...t],n=i.length,s=t.map((t,i)=>ee(t)(t,e[i]));return t=>{for(let e=0;e<n;e++)i[e]=s[e](t);return i}}function ne(t,e){const i={...t,...e},n={};for(const s in i)void 0!==t[s]&&void 0!==e[s]&&(n[s]=ee(t[s])(t[s],e[s]));return t=>{for(const e in n)i[e]=n[e](t);return i}}const se=(t,e)=>{const i=u.createTransformer(e),n=c(t),s=c(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):kt(ie(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):(a(!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"),Xt(t,e))};function oe(t,e,i){if("number"==typeof t&&"number"==typeof e&&"number"==typeof i)return n(t,e,i);return ee(t)(t,e)}const re=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>f.update(e,t),stop:()=>m(e),now:()=>d.isProcessing?d.timestamp:p.now()}},ae=2e4;function le(t){let e=0;let i=t.next(e);for(;!i.done&&e<ae;)e+=50,i=t.next(e);return e>=ae?1/0:e}const he=100,ue=10,ce=1,de=0,pe=800,me=.3,fe=.3,ye={granular:.01,default:2},ge={granular:.005,default:.5},ve=.01,xe=10,Te=.05,Pe=1;function we(t,e){return t*Math.sqrt(1-e*e)}const Se=.001;const Ee=["duration","bounce"],Ae=["stiffness","damping","mass"];function De(t,e){return e.some(e=>void 0!==t[e])}function be(t){let e={velocity:de,stiffness:he,damping:ue,mass:ce,isResolvedFromDuration:!1,...t};if(!De(t,Ae)&&De(t,Ee))if(e.velocity=0,t.visualDuration){const i=t.visualDuration,n=2*Math.PI/(1.2*i),s=n*n,o=2*g(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:ce,stiffness:s,damping:o}}else{const i=function({duration:t=pe,bounce:e=me,velocity:i=de,mass:n=ce}){let s,o;a(t<=x(xe),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=g(Te,Pe,r),t=g(ve,xe,y(t)),r<1?(s=e=>{const n=e*r,s=n*t,o=n-i,a=we(e,r),l=Math.exp(-s);return Se-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=we(Math.pow(e,2),r);return(-s(e)+Se>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 l=function(t,e,i){let n=i;for(let i=1;i<12;i++)n-=t(n)/e(n);return n}(s,o,5/t);if(t=x(t),isNaN(l))return{stiffness:he,damping:ue,duration:t};{const e=Math.pow(l,2)*n;return{stiffness:e,damping:2*r*Math.sqrt(n*e),duration:t}}}({...t,velocity:0});e={...e,...i,mass:ce},e.isResolvedFromDuration=!0}return e}function Me(t=fe,e=me){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:l,damping:h,mass:u,duration:c,velocity:d,isResolvedFromDuration:p}=be({...i,velocity:-y(i.velocity||0)}),m=d||0,f=h/(2*Math.sqrt(l*u)),g=r-o,T=y(Math.sqrt(l/u)),P=Math.abs(g)<5;let w,S,E,A,D,b;if(n||(n=P?ye.granular:ye.default),s||(s=P?ge.granular:ge.default),f<1)E=we(T,f),A=(m+f*T*g)/E,w=t=>{const e=Math.exp(-f*T*t);return r-e*(A*Math.sin(E*t)+g*Math.cos(E*t))},D=f*T*A+g*E,b=f*T*g-A*E,S=t=>Math.exp(-f*T*t)*(D*Math.sin(E*t)+b*Math.cos(E*t));else if(1===f){w=t=>r-Math.exp(-T*t)*(g+(m+T*g)*t);const t=m+T*g;S=e=>Math.exp(-T*e)*(T*t*e-m)}else{const t=T*Math.sqrt(f*f-1);w=e=>{const i=Math.exp(-f*T*e),n=Math.min(t*e,300);return r-i*((m+f*T*g)*Math.sinh(n)+t*g*Math.cosh(n))/t};const e=(m+f*T*g)/t,i=f*T*e-g*t,n=f*T*g-e*t;S=e=>{const s=Math.exp(-f*T*e),o=Math.min(t*e,300);return s*(i*Math.sinh(o)+n*Math.cosh(o))}}const M={calculatedDuration:p&&c||null,velocity:t=>x(S(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*T*t),i=Math.sin(E*t),o=Math.cos(E*t),l=r-e*(A*i+g*o),h=x(e*(D*i+b*o));return a.done=Math.abs(h)<=n&&Math.abs(r-l)<=s,a.value=a.done?r:l,a}const e=w(t);if(p)a.done=t>=c;else{const i=x(S(t));a.done=Math.abs(i)<=n&&Math.abs(r-e)<=s}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(le(M),ae),e=v(e=>M.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return M}Me.applyToOptions=t=>{const e=function(t,e=100,i){const n=i({...t,keyframes:[0,e]}),s=Math.min(le(n),ae);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:y(s)}}(t,100,Me);return t.ease=e.ease,t.duration=x(e.duration),t.type="keyframes",t};function ke(t,e,i){const n=Math.max(e-5,0);return T(i-t(n),e-n)}function Ce({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=Me({keyframes:[d.value,p(d.value)],velocity:ke(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 Ve(e,n,{clamp:s=!0,ease:o,mixer:r}={}){const a=e.length;if(i(a===n.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>n[0];if(2===a&&n[0]===n[1])return()=>n[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),n=[...n].reverse());const h=function(e,i,n){const s=[],o=n||P.mix||oe,r=e.length-1;for(let n=0;n<r;n++){let r=o(e[n],e[n+1]);if(i){const e=Array.isArray(i)?i[n]||t:i;r=kt(e,r)}s.push(r)}return s}(n,o,r),u=h.length,c=t=>{if(l&&t<e[0])return n[0];let i=0;if(u>1)for(;i<e.length-2&&!(t<e[i+1]);i++);const s=Ct(e[i],e[i+1],t);return h[i](s)};return s?t=>c(g(e[0],e[a-1],t)):c}function Le(t){const e=[0];return function(t,e){const i=t[t.length-1];for(let s=1;s<=e;s++){const o=Ct(0,e,s);t.push(n(i,1,o))}}(e,t.length-1),e}function Re({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(n)?n.map(Kt):Kt(n),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(i&&i.length===e.length?i:Le(e),t),a=Ve(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||Gt).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const Be={decay:Ce,inertia:Ce,tween:Re,keyframes:Re,spring:Me};function je(t){"string"==typeof t.type&&(t.type=Be[t.type])}const Ie=t=>t/100;class Oe extends w{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==p.now()&&this.tick(p.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;je(t);const{type:e=Re,repeat:i=0,repeatDelay:n=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Re;a!==Re&&"number"!=typeof r[0]&&(this.mixKeyframes=kt(Ie,oe(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=le(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:l=0,keyframes:h,repeat:u,repeatType:c,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-n/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>n;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let x,T=this.currentTime,P=i;if(u){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,u+1);Boolean(e%2)&&("reverse"===c?(i=1-i,d&&(i-=d/r)):"mirror"===c&&(P=o)),T=g(0,1,i)*r}v?(this.delayState.value=h[0],x=this.delayState):x=P.next(T),s&&!v&&(x.value=s(x.value));let{done:w}=x;v||null===a||(w=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const E=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return E&&p!==Ce&&(x.value=S(h,this.options,f,this.speed)),m&&m(x.value),E&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=x(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return ke(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(p.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=re,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(p.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 Fe={anticipate:Ft,backInOut:Ot,circInOut:Wt};function Ue(t){"string"==typeof t.ease&&t.ease in Fe&&(t.ease=Fe[t.ease])}class ze extends E{constructor(t){Ue(t),je(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(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,p.now()-this.startTime),l=g(0,10,a-10),h=r.sample(a).value,{name:u}=this.options;s&&u&&A(s,u,h),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,h,l),r.stop()}}const We=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!u.test(t)&&"0"!==t||t.startsWith("url(")));function $e(t){t.duration=0,t.type="keyframes"}const Ne=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Ge=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),He=b(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ke(t){const{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:u}=e.owner.getProps();return He()&&i&&(M.has(i)||Ge.has(i)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&Ne.test(t[e]))return!0;return!1}(a))&&("transform"!==i||!u)&&!h&&!n&&"mirror"!==s&&0!==o&&"inertia"!==r}class Ye extends w{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=p.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||k;this.keyframeResolver=new d(r,(t,e,i)=>this.onKeyframesResolved(t,e,c,!i),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,i,n,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:l,delay:h,isHandoff:u,onUpdate:c}=n;this.resolvedAt=p.now();let d=!0;(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=We(s,e),l=We(o,e);return a(r===l,`You are trying to animate ${e} from "${s}" to "${o}". "${r?o:s}" is not an animatable value.`,"value-not-animatable"),!(!r||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===i||D(i))&&n)})(e,o,r,l)||(d=!1,!P.instantAnimations&&h||c?.(S(e,n,i)),e[0]=e[e.length-1],$e(n),n.repeat=0);const m={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:i,...n,keyframes:e},f=d&&!u&&Ke(m),y=m.motionValue?.owner?.current;let g;if(f)try{g=new ze({...m,element:y})}catch{g=new Oe(m)}else g=new Oe(m);g.finished.then(()=>{this.notifyFinished()}).catch(t),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}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(),C()),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()}}function Xe(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 qe(t,e){if(t?.inherit&&e){const{inherit:i,...n}=t;return{...e,...n}}return t}function _e(t,e){const i=t?.[e]??t?.default??t;return i!==t?qe(i,t):i}const Ze={type:"spring",stiffness:500,damping:25,restSpeed:10},Je={type:"keyframes",duration:.8},Qe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ti=(t,{keyframes:e})=>e.length>2?Je:V.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ze:Qe,ei=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const ii=(t,e,i,n={},s,o)=>r=>{const a=_e(n,t)||{},l=a.delay||n.delay||0;let{elapsed:h=0}=n;h-=x(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(t){for(const e in t)if(!ei.has(e))return!0;return!1})(a)||Object.assign(u,ti(t,u)),u.duration&&(u.duration=x(u.duration)),u.repeatDelay&&(u.repeatDelay=x(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&($e(u),0===u.delay&&(c=!0)),(P.instantAnimations||P.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(c=!0,$e(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=S(u.keyframes,a);if(void 0!==t)return void f.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Oe(u):new Ye(u)},ni=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function si(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=function(t){const e=ni.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return L(t)?parseFloat(t):t}return l(o)?si(o,e,n+1):o}function oi(t,e,i){const n=t.getProps();return R(n,e,void 0!==i?i:n.custom,t)}const ri=new Set(["width","height","top","left","right","bottom",...B]),ai=t=>Array.isArray(t);function li(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,j(i))}function hi(t){return ai(t)?t[t.length-1]||0:t}function ui(t,e){const i=t.getValue("willChange");if(n=i,Boolean(I(n)&&n.add))return i.add(e);if(!i&&P.WillChange){const i=new P.WillChange("auto");t.addValue("willChange",i),i.add(e)}var n}function ci(t){return t.props[O]}function di({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}function pi(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?qe(o,l):l;const h=o?.reduceMotion,u=o?.skipAnimations;n&&(o=n);const c=[],d=s&&t.animationState&&t.animationState.getState()[s],p=o?.path;p&&p.animateVisualElement(t,a,o,i,c);for(const e in a){const n=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&di(d,e))continue;const r={delay:i,..._e(o||{},e)};u&&(r.skipAnimations=!0);const l=n.get();if(void 0!==l&&!n.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){f.update(()=>n.set(s));continue}let p=!1;if(window.MotionHandoffAnimation){const i=ci(t);if(i){const t=window.MotionHandoffAnimation(i,e,f);null!==t&&(r.startTime=t,p=!0)}}ui(t,e);const m=h??t.shouldReduceMotion;n.start(ii(e,n,s,m&&ri.has(e)?{type:!1}:r,t,p));const y=n.animation;y&&c.push(y)}if(r){const e=()=>f.update(()=>{r&&function(t,e){const i=oi(t,e);let{transitionEnd:n={},transition:s={},...o}=i||{};o={...o,...n};for(const e in o)li(t,e,hi(o[e]))}(t,r)});c.length?Promise.all(c).then(e):e()}return c}function mi(t,e,i={}){const n=oi(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(pi(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(mi(l,e,{...r,delay:i+("function"==typeof n?0:n)+Xe(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 fi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||F(t))}const yi=new Set(["auto","none","0"]);class gi extends k{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(),l(n))){const s=si(n,e.current);void 0!==s&&(t[i]=s),i===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!ri.has(i)||2!==t.length)return;const[n,s]=t,o=z(n),r=z(s);if(W(n)!==W(s)&&$[i])this.needsMeasurement=!0;else if(o!==r)if(N(o)&&N(r))for(let e=0;e<t.length;e++){const i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else $[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++)(null===t[e]||fi(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&&!yi.has(e)&&c(e).values.length&&(n=t[s]),s++}if(n&&i)for(const s of e)t[s]=U(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=$[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]=$[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()}}function vi(t,e,i){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const n=i?.[t]??e.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t).filter(t=>null!=t)}const xi={x:!1,y:!1};function Ti(){return xi.x||xi.y}function Pi(t,e){const i=vi(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function wi(t,e,i={}){const[n,s,o]=Pi(t,i);return n.forEach(t=>{let i,n=!1,o=!1;const r=e=>{i&&(i(e),i=void 0),t.removeEventListener("pointerleave",l)},a=t=>{n=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(n?o=!0:r(t))};t.addEventListener("pointerenter",n=>{if("touch"===n.pointerType||Ti())return;o=!1;const r=e(t,n);"function"==typeof r&&(i=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{n=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const Si=(t,e)=>!!e&&(t===e||Si(t,e.parentElement)),Ei=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Ai=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Di=new Set(["INPUT","SELECT","TEXTAREA"]);const bi=new WeakSet;function Mi(t){return e=>{"Enter"===e.key&&t(e)}}function ki(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Ci(t){return Ei(t)&&!Ti()}const Vi=new WeakSet;function Li(t,e,i={}){const[n,s,o]=Pi(t,i),r=t=>{const n=t.currentTarget;if(!Ci(t))return;if(Vi.has(t))return;bi.add(n),i.stopPropagation&&Vi.add(t);const o=e(n,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",h,r),bi.has(n)&&bi.delete(n),Ci(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,n===window||n===document||i.useGlobalTarget||Si(n,t.target))},h=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",h,r)};return n.forEach(t=>{var e;(i.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),Mt(e=t)&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const n=Mi(()=>{if(bi.has(i))return;ki(i,"down");const t=Mi(()=>{ki(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>ki(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),function(t){return Ai.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Ri(t){return Mt(t)&&"ownerSVGElement"in t}const Bi=new WeakMap;let ji;const Ii=(t,e,i)=>(n,s)=>s&&s[0]?s[0][t+"Size"]:Ri(n)&&"getBBox"in n?n.getBBox()[e]:n[i],Oi=Ii("inline","width","offsetWidth"),Fi=Ii("block","height","offsetHeight");function Ui({target:t,borderBoxSize:e}){Bi.get(t)?.forEach(i=>{i(t,{get width(){return Oi(t,e)},get height(){return Fi(t,e)}})})}function zi(t){t.forEach(Ui)}function Wi(t,e){ji||"undefined"!=typeof ResizeObserver&&(ji=new ResizeObserver(zi));const i=vi(t);return i.forEach(t=>{let i=Bi.get(t);i||(i=new Set,Bi.set(t,i)),i.add(e),ji?.observe(t)}),()=>{i.forEach(t=>{const i=Bi.get(t);i?.delete(e),i?.size||ji?.unobserve(t)})}}const $i=new Set;let Ni;function Gi(t){return $i.add(t),Ni||(Ni=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};$i.forEach(e=>e(t))},window.addEventListener("resize",Ni)),()=>{$i.delete(t),$i.size||"function"!=typeof Ni||(window.removeEventListener("resize",Ni),Ni=void 0)}}function Hi(t,e){return"function"==typeof t?Gi(t):Wi(t,e)}class Ki extends G{constructor(){super(...arguments),this.KeyframeResolver=gi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const i=t.style;return i?i[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;I(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class Yi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Xi({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function qi(t){return void 0===t||1===t}function _i({scale:t,scaleX:e,scaleY:i}){return!qi(t)||!qi(e)||!qi(i)}function Zi(t){return _i(t)||Ji(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ji(t){return Qi(t.x)||Qi(t.y)}function Qi(t){return t&&"0%"!==t}function tn(t,e,i){return i+e*(t-i)}function en(t,e,i,n,s){return void 0!==s&&(t=tn(t,s,n)),tn(t,i,n)+e}function nn(t,e=0,i=1,n,s){t.min=en(t.min,e,i,n,s),t.max=en(t.max,e,i,n,s)}function sn(t,{x:e,y:i}){nn(t.x,e.translate,e.scale,e.originPoint),nn(t.y,i.translate,i.scale,i.originPoint)}const on=.999999999999,rn=1.0000000000001;function an(t,e){t.min+=e,t.max+=e}function ln(t,e,i,s,o=.5){nn(t,e,i,n(t.min,t.max,o),s)}function hn(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function un(t,e,i){const n=i??t;ln(t.x,hn(e.x,n.x),e.scaleX,e.scale,e.originX),ln(t.y,hn(e.y,n.y),e.scaleY,e.scale,e.originY)}function cn(t,e){return Xi(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))}function dn(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 pn extends Ki{constructor(){super(...arguments),this.type="html",this.renderInstance=dn}readValueFromInstance(t,e){if(V.has(e))return this.projection?.isProjecting?H(e):K(t,e);{const n=(i=t,window.getComputedStyle(i)),s=(Y(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof s?s.trim():s}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return cn(t,e)}build(t,e,i){X(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return q(t,e,i)}}const mn=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 fn extends Ki{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Z}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(V.has(e)){const t=et(e);return t&&t.default||0}return e=mn.has(e)?e:_(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return J(t,e,i)}build(t,e,i){Q(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){!function(t,e,i,n){dn(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(mn.has(i)?i:_(i),e.attrs[i])}(t,e,0,n)}mount(t){this.isSVGTag=tt(t.tagName),super.mount(t)}}const yn=nt.length;function gn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&gn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let i=0;i<yn;i++){const n=nt[i],s=t.props[n];(it(s)||!1===s)&&(e[n]=s)}return e}function vn(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 xn=[...ot].reverse(),Tn=ot.length;function Pn(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=>mi(t,e,i));n=Promise.all(s)}else if("string"==typeof e)n=mi(t,e,i);else{const s="function"==typeof e?oi(t,e,i.custom):e;n=Promise.all(pi(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}(t,e,i)))}function wn(t){let e=Pn(t),i=An(),n=!0,s=!1;const o=e=>(i,n)=>{const s=oi(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 r(r){const{props:a}=t,l=gn(t.parent)||{},h=[],u=new Set;let c={},d=1/0;for(let e=0;e<Tn;e++){const p=xn[e],m=i[p],f=void 0!==a[p]?a[p]:l[p],y=it(f),g=p===r?m.isActive:null;!1===g&&(d=e);let v=f===l[p]&&f!==a[p]&&y;if(v&&(n||s)&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...c},!m.isActive&&null===g||!f&&!m.prevProp||st(f)||"boolean"==typeof f)continue;if("exit"===p&&m.isActive&&!0!==g){m.prevResolvedValues&&(c={...c,...m.prevResolvedValues});continue}const x=Sn(m.prevProp,f);let T=x||p===r&&m.isActive&&!v&&y||e>d&&y,P=!1;const w=Array.isArray(f)?f:[f];let S=w.reduce(o(p),{});!1===g&&(S={});const{prevResolvedValues:E={}}=m,A={...E,...S},D=e=>{T=!0,u.has(e)&&(P=!0,u.delete(e)),m.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in A){const e=S[t],i=E[t];if(c.hasOwnProperty(t))continue;let n=!1;n=ai(e)&&ai(i)?!vn(e,i)||x:e!==i,n?null!=e?D(t):u.add(t):void 0!==e&&u.has(t)?D(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(c={...c,...S}),(n||s)&&t.blockInitialAnimation&&(T=!1);const b=v&&x;T&&(!b||P)&&h.push(...w.map(e=>{const i={type:p};if("string"==typeof e&&(n||s)&&!b&&t.manuallyAnimateOnMount&&t.parent){const{parent:n}=t,s=oi(n,e);if(n.enteringChildren&&s){const{delayChildren:e}=s.transition||{};i.delay=Xe(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const i=oi(t,Array.isArray(a.initial)?a.initial[0]:a.initial);i&&i.transition&&(e.transition=i.transition)}u.forEach(i=>{const n=t.getBaseTarget(i),s=t.getValue(i);s&&(s.liveStyle=!0),e[i]=n??null}),h.push({animation:e})}let p=Boolean(h.length);return!n||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),n=!1,s=!1,p?e(h):Promise.resolve()}return{animateChanges:r,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=r(e);for(const t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=An(),s=!0}}}function Sn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!vn(e,t)}function En(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function An(){return{animate:En(!0),whileInView:En(),whileHover:En(),whileTap:En(),whileDrag:En(),whileFocus:En(),exit:En()}}function Dn(t,e){t.min=e.min,t.max=e.max}function bn(t,e){Dn(t.x,e.x),Dn(t.y,e.y)}function Mn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function kn(t){return t.max-t.min}function Cn(t,e,i,s=.5){t.origin=s,t.originPoint=n(e.min,e.max,t.origin),t.scale=kn(i)/kn(e),t.translate=n(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Vn(t,e,i,n){Cn(t.x,e.x,i.x,n?n.originX:void 0),Cn(t.y,e.y,i.y,n?n.originY:void 0)}function Ln(t,e,i,s=0){const o=s?n(i.min,i.max,s):i.min;t.min=o+e.min,t.max=t.min+kn(e)}function Rn(t,e,i,s=0){const o=s?n(i.min,i.max,s):i.min;t.min=e.min-o,t.max=t.min+kn(e)}function Bn(t,e,i,n){Rn(t.x,e.x,i.x,n?.x),Rn(t.y,e.y,i.y,n?.y)}function jn(t,e,i,n,s){return t=tn(t-=e,1/i,n),void 0!==s&&(t=tn(t,1/s,n)),t}function In(t,e,[i,s,o],r,a){!function(t,e=0,i=1,s=.5,o,r=t,a=t){rt.test(e)&&(e=parseFloat(e),e=n(a.min,a.max,e/100)-a.min);if("number"!=typeof e)return;let l=n(r.min,r.max,s);t===r&&(l-=e),t.min=jn(t.min,e,i,l,o),t.max=jn(t.max,e,i,l,o)}(t,e[i],e[s],e[o],e.scale,r,a)}const On=["x","scaleX","originX"],Fn=["y","scaleY","originY"];function Un(t,e,i,n){In(t.x,e,On,i?i.x:void 0,n?n.x:void 0),In(t.y,e,Fn,i?i.y:void 0,n?n.y:void 0)}function zn(t){return 0===t.translate&&1===t.scale}function Wn(t){return zn(t.x)&&zn(t.y)}function $n(t,e){return t.min===e.min&&t.max===e.max}function Nn(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Gn(t,e){return Nn(t.x,e.x)&&Nn(t.y,e.y)}function Hn(t){return kn(t.x)/kn(t.y)}function Kn(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Yn(t){return[t("x"),t("y")]}const Xn=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],qn=Xn.length,_n=t=>"string"==typeof t?parseFloat(t):t,Zn=t=>"number"==typeof t||at.test(t);function Jn(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Qn=es(0,.5,zt),ts=es(.5,.95,t);function es(t,e,i){return n=>n<t?0:n>e?1:i(Ct(t,e,n))}function is(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}const ns=(t,e)=>t.depth-e.depth;class ss{constructor(){this.children=[],this.isDirty=!1}add(t){lt(this.children,t),this.isDirty=!0}remove(t){ht(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ns),this.isDirty=!1,this.children.forEach(t)}}class os{constructor(){this.members=[]}add(t){lt(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const n=i.instance;n&&!1!==n.isConnected||i.snapshot||(ht(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(ht(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){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:n}=i.options,{layoutDependency:s}=t.options;void 0!==n&&n===s||(t.resumeFrom=i,e&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const rs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},as=["","X","Y","Z"];let ls=0;function hs(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function us(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=ci(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",f,!(e||n))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&us(n)}function cs({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},i=e?.()){this.id=ls++,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(ms),this.nodes.forEach(Ss),this.nodes.forEach(Es),this.nodes.forEach(fs)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new ss)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new ut),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(e){if(this.instance)return;var i;this.isSVG=Ri(e)&&!(Ri(i=e)&&"svg"===i.tagName),this.instance=e;const{layoutId:n,layout:s,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(s||n)&&(this.isLayoutDirty=!0),t){let i,n=0;const s=()=>this.root.updateBlockedByResize=!1;f.read(()=>{n=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==n&&(n=t,this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){const i=p.now(),n=({timestamp:s})=>{const o=s-i;o>=e&&(m(n),t(o-e))};return f.setup(n,!0),()=>m(n)}(s,250),rs.hasAnimatedSinceResize&&(rs.hasAnimatedSinceResize=!1,this.nodes.forEach(ws)))})}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()||Cs,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Gn(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={..._e(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h,e.path)}else e||ws(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(),m(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(As),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&&us(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,"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!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()){const t=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(vs),void this.nodes.forEach(gs)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(xs);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ts),this.nodes.forEach(Ps),this.nodes.forEach(ds),this.nodes.forEach(ps)):this.nodes.forEach(xs),this.clearAllSnapshots();const t=p.now();d.delta=g(0,1e3/60,t-d.timestamp),d.timestamp=t,d.isProcessing=!0,ct.update.process(d),ct.preRender.process(d),ct.render.process(d),d.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,dt.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ys),this.sharedNodes.forEach(Ds)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,f.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){f.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||kn(this.snapshot.measuredBox.x)||kn(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||(this.layoutCorrected=Z()),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:i(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&&!Wn(this.projectionDelta),i=this.getTransformTemplate(),n=i?i(this.latestValues,""):void 0,s=n!==this.prevTransformTemplateValue;t&&this.instance&&(e||Zi(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)),Rs((n=i).x),Rs(n.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return Z();const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(js))){const{scroll:t}=this.root;t&&(an(e.x,t.offset.x),an(e.y,t.offset.y))}return e}removeElementScroll(t){const e=Z();if(bn(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&&bn(e,t),an(e.x,s.offset.x),an(e.y,s.offset.y))}return e}applyTransform(t,e=!1,i){const n=i||Z();bn(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(an(n.x,-i.scroll.offset.x),an(n.y,-i.scroll.offset.y)),Zi(i.latestValues)&&un(n,i.latestValues,i.layout?.layoutBox)}return Zi(this.latestValues)&&un(n,this.latestValues,this.layout?.layoutBox),n}removeTransform(t){const e=Z();bn(e,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!Zi(i.latestValues))continue;let n;i.instance&&(_i(i.latestValues)&&i.updateSnapshot(),n=Z(),bn(n,i.measurePageBox())),Un(e,i.latestValues,i.snapshot?.layoutBox,n)}return Zi(this.latestValues)&&Un(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!==d.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=d.timestamp;const o=this.getClosestProjectingParent();var r,a,l,h;(o&&this.linkedParentVersion!==o.layoutVersion&&!o.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&o&&o.layout?this.createRelativeTarget(o,this.layout.layoutBox,o.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Z(),this.targetWithTransforms=Z()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,h=this.options.layoutAnchor||void 0,Ln(r.x,a.x,l.x,h?.x),Ln(r.y,a.y,l.y,h?.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):bn(this.target,this.layout.layoutBox),sn(this.target,this.targetDelta)):bn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&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&&!_i(this.parent.latestValues)&&!Ji(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=Z(),this.relativeTargetOrigin=Z(),Bn(this.relativeTargetOrigin,e,i,this.options.layoutAnchor||void 0),bn(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===d.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;bn(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&&(an(t.x,-o.scroll.offset.x),an(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,sn(t,r)),n&&Zi(o.latestValues)&&un(t,o.latestValues,o.layout?.layoutBox))}e.x<rn&&e.x>on&&(e.x=1),e.y<rn&&e.y>on&&(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=Z());const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(Mn(this.prevProjectionDelta.x,this.projectionDelta.x),Mn(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Vn(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Kn(this.projectionDelta.x,this.prevProjectionDelta.x)&&Kn(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=pt(),this.projectionDelta=pt(),this.projectionDeltaWithTransform=pt()}setAnimationOrigin(t,e=!1,i){const s=this.snapshot,o=s?s.latestValues:{},r={...this.latestValues},a=pt();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const l=Z(),h=(s?s.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),c=!u||u.members.length<=1,d=Boolean(h&&!c&&!0===this.options.crossfade&&!this.path.some(ks));let p;this.animationProgress=0;const m=i?.interpolateProjection(t);this.mixTargetDelta=e=>{const i=e/1e3,s=m?.(i);var u,f,y,g,v,x;s?(a.x.translate=s.x,a.x.scale=n(t.x.scale,1,i),a.x.origin=t.x.origin,a.x.originPoint=t.x.originPoint,a.y.translate=s.y,a.y.scale=n(t.y.scale,1,i),a.y.origin=t.y.origin,a.y.originPoint=t.y.originPoint):(bs(a.x,t.x,i),bs(a.y,t.y,i)),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Bn(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),y=this.relativeTarget,g=this.relativeTargetOrigin,v=l,x=i,Ms(y.x,g.x,v.x,x),Ms(y.y,g.y,v.y,x),p&&(u=this.relativeTarget,f=p,$n(u.x,f.x)&&$n(u.y,f.y))&&(this.isProjectionDirty=!1),p||(p=Z()),bn(p,this.relativeTarget)),h&&(this.animationValues=r,function(t,e,i,s,o,r){o?(t.opacity=n(0,i.opacity??1,Qn(s)),t.opacityExit=n(e.opacity??1,0,ts(s))):r&&(t.opacity=n(e.opacity??1,i.opacity??1,s));for(let o=0;o<qn;o++){const r=Xn[o];let a=Jn(e,r),l=Jn(i,r);void 0===a&&void 0===l||(a||(a=0),l||(l=0),0===a||0===l||Zn(a)===Zn(l)?(t[r]=Math.max(n(_n(a),_n(l),s),0),(rt.test(l)||rt.test(a))&&(t[r]+="%")):t[r]=l)}(e.rotate||i.rotate)&&(t.rotate=n(e.rotate||0,i.rotate||0,s))}(r,o,this.latestValues,i,d,c)),s&&void 0!==s.rotate&&(this.animationValues||(this.animationValues=r),this.animationValues.pathRotation=s.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(m(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=f.update(()=>{rs.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=j(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(t,e,i){const n=I(t)?t:j(t);return n.start(ii("",n,e,i)),n.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},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&&Bs(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Z();const e=kn(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const n=kn(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}bn(e,i),un(e,s),Vn(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new os);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&&hs("z",t,n,this.animationValues);for(let e=0;e<as.length;e++)hs(`rotate${as[e]}`,t,n,this.animationValues),hs(`skew${as[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=mt(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=mt(e?.pointerEvents)||""),void(this.hasProjected&&!Zi(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,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=i;t&&(n=`perspective(${t}px) ${n}`),e&&(n+=`rotate(${e}deg) `),s&&(n+=`rotate(${s}deg) `),o&&(n+=`rotateX(${o}deg) `),r&&(n+=`rotateY(${r}deg) `),a&&(n+=`skewX(${a}deg) `),l&&(n+=`skewY(${l}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 ft){if(void 0===s[e])continue;const{correct:i,applyTo:r,isCSSVariable:a}=ft[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?mt(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(gs),this.root.sharedNodes.clear()}}}function ds(t){t.updateLayout()}function ps(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;if("size"===s)Yn(t=>{const n=o?e.measuredBox[t]:e.layoutBox[t],s=kn(n);n.min=i[t].min,n.max=n.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";Dn(o?e.measuredBox[t]:e.layoutBox[t],i[t])}else Bs(s,e.layoutBox,i)&&Yn(n=>{const s=o?e.measuredBox[n]:e.layoutBox[n],r=kn(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=pt();Vn(r,i,e.layoutBox);const a=pt();o?Vn(a,t.applyTransform(n,!0),e.measuredBox):Vn(a,i,e.layoutBox);const l=!Wn(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=t.options.layoutAnchor||void 0,a=Z();Bn(a,e.layoutBox,s.layoutBox,r);const l=Z();Bn(l,i,o.layoutBox,r),Gn(a,l)||(h=!0),n.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,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 ms(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 fs(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ys(t){t.clearSnapshot()}function gs(t){t.clearMeasurements()}function vs(t){t.isLayoutDirty=!0,t.updateLayout()}function xs(t){t.isLayoutDirty=!1}function Ts(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Ps(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ws(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ss(t){t.resolveTargetDelta()}function Es(t){t.calcProjection()}function As(t){t.resetSkewAndRotation()}function Ds(t){t.removeLeadSnapshot()}function bs(t,e,i){t.translate=n(e.translate,0,i),t.scale=n(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function Ms(t,e,i,s){t.min=n(e.min,i.min,s),t.max=n(e.max,i.max,s)}function ks(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Cs={duration:.45,ease:[.4,0,.1,1]},Vs=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ls=Vs("applewebkit/")&&!Vs("chrome/")?Math.round:t;function Rs(t){t.min=Ls(t.min),t.max=Ls(t.max)}function Bs(t,e,i){return"position"===t||"preserve-aspect"===t&&(n=Hn(e),s=Hn(i),o=.2,!(Math.abs(n-s)<=o));var n,s,o}function js(t){return t!==t.root&&t.scroll?.wasRoot}const Is=cs({attachResizeListener:(t,e)=>is(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Os={current:void 0},Fs=cs({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Os.current){const t=new Is({});t.mount(window),t.setOptions({layoutScroll:!0}),Os.current=t}return Os.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Us(t){return{point:{x:t.pageX,y:t.pageY}}}function zs(t,e,i,n){return is(t,e,(t=>e=>Ei(e)&&t(e,Us(e)))(i),n)}const Ws=({current:t})=>t?t.ownerDocument.defaultView:null,$s=(t,e)=>Math.abs(t-e);const Ns=new Set(["auto","scroll"]);class Gs{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.lastRawMoveEventInfo=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;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Hs(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Ys(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){const i=$s(t.x,e.x),n=$s(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}=d;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.lastRawMoveEventInfo=e,this.lastMoveEventInfo=Hs(e,this.transformPagePoint),f.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=Ys("pointercancel"===t.type?this.lastMoveEventInfo:Hs(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,o),n&&n(t,o)},!Ei(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=n||window;const a=Hs(Us(t),this.transformPagePoint),{point:l}=a,{timestamp:h}=d;this.history=[{...l,timestamp:h}];const{onSessionStart:u}=e;u&&u(t,Ys(a,this.history));const c={passive:!0,capture:!0};this.removeListeners=kt(zs(this.contextWindow,"pointermove",this.handlePointerMove,c),zs(this.contextWindow,"pointerup",this.handlePointerUp,c),zs(this.contextWindow,"pointercancel",this.handlePointerUp,c)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(Ns.has(t.overflowX)||Ns.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}),window.addEventListener("scroll",this.onWindowScroll),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),f.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),m(this.updatePoint)}}function Hs(t,e){return e?{point:e(t.point)}:t}function Ks(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ys({point:t},e){return{point:t,delta:Ks(t,qs(e)),offset:Ks(t,Xs(e)),velocity:_s(e,.1)}}function Xs(t){return t[0]}function qs(t){return t[t.length-1]}function _s(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null;const s=qs(t);for(;i>=0&&(n=t[i],!(s.timestamp-n.timestamp>x(e)));)i--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&s.timestamp-n.timestamp>2*x(e)&&(n=t[1]);const o=y(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 Zs(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 Js(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 Qs=.35;function to(t,e,i){return{min:eo(t,e),max:eo(t,i)}}function eo(t,e){return"number"==typeof t?t:t[e]||0}const io=new WeakMap;class no{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=Z(),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 Gs(t,{onSessionStart:t=>{e&&this.snapToCursor(Us(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:i,dragPropagation:n,onDragStart:s}=this.getProps();if(i&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=i)||"y"===o?xi[o]?null:(xi[o]=!0,()=>{xi[o]=!1}):xi.x||xi.y?null:(xi.x=xi.y=!0,()=>{xi.x=xi.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),Yn(t=>{let e=this.getAxisMotionValue(t).get()||0;if(rt.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const n=i.layout.layoutBox[t];if(n){e=kn(n)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&f.update(()=>s(t,e),!1,!0),ui(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&&f.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:i,contextWindow:Ws(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&&f.postRender(()=>r(i,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,i){const{drag:s}=this.getProps();if(!i||!oo(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:i},s){return void 0!==e&&t<e?t=s?n(e,t,s.min):Math.max(t,e):void 0!==i&&t>i&&(t=s?n(i,t,s.max):Math.min(t,i)),t}(r,this.constraints[t],this.elastic[t])),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&&yt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(t,{top:e,left:i,bottom:n,right:s}){return{x:Zs(t.x,i,s),y:Zs(t.y,e,n)}}(i.layoutBox,t),this.elastic=function(t=Qs){return!1===t?t=0:!0===t&&(t=Qs),{x:to(t,"left","right"),y:to(t,"top","bottom")}}(e),n!==this.constraints&&!yt(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Yn(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||!yt(t))return!1;const n=t.current;i(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const o=function(t,e,i){const n=cn(t,i),{scroll:s}=e;return s&&(an(n.x,s.offset.x),an(n.y,s.offset.y)),n}(n,s.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Js(t.x,e.x),y:Js(t.y,e.y)}}(s.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=Xi(t))}return r}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:n,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Yn(r=>{if(!oo(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(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 ui(this.visualElement,t),i.start(ii(t,i,0,e,this.visualElement,!1))}stopAnimation(){Yn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[e];return i||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Yn(e=>{const{drag:i}=this.getProps();if(!oo(e,i,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(e);if(s&&s.layout){const{min:i,max:r}=s.layout.layoutBox[e],a=o.get()||0;o.set(t[e]-n(i,r,.5)+a)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!yt(e)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Yn(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=kn(t),s=kn(e);return s>n?i=Ct(e.min,e.max-n,t.min):n>s&&(i=Ct(t.min,t.max-s,e.min)),g(0,1,i)}({min:i,max:i},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Yn(e=>{if(!oo(e,t,null))return;const i=this.getAxisMotionValue(e),{min:o,max:r}=this.constraints[e];i.set(n(o,r,s[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;io.set(this.visualElement,this);const t=this.visualElement.current,e=zs(t,"pointerdown",e=>{const{drag:i,dragListener:n=!0}=this.getProps(),s=e.target,o=s!==t&&function(t){return Di.has(t.tagName)||!0===t.isContentEditable}(s);i&&n&&!o&&this.start(e)});let i;const n=()=>{const{dragConstraints:e}=this.getProps();yt(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),i||(i=function(t,e,i){const n=Hi(t,so(i)),s=Hi(e,so(i));return()=>{n(),s()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),f.read(n);const r=is(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Yn(e=>{const i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:s=!1,dragElastic:o=Qs,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:n,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function so(t){let e=!0;return()=>{e?e=!1:t()}}function oo(t,e,i){return!(!0!==e&&e!==t||null!==i&&i!==t)}const ro=t=>(e,i)=>{t&&f.update(()=>t(e,i),!1,!0)};let ao=!1;class lo extends Dt{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),ao&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),rs.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:n,isPresent:s}=this.props,{projection:o}=i;return o?(o.isPresent=s,t.layoutDependency!==e&&o.setOptions({...o.options,layoutDependency:e}),ao=!0,n||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||f.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=e,i.root.didUpdate(),dt.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:n}=t;ao=!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 ho(t){const[e,i]=function(t=!0){const e=wt(gt);if(null===e)return[!0,null];const{isPresent:i,onExitComplete:n,register:s}=e,o=St();Et(()=>{if(t)return s(o)},[t]);const r=At(()=>t&&n&&n(o),[o,n,t]);return!i&&n?[!1,r]:[!0]}(),n=wt(vt);return Pt(lo,{...t,layoutGroup:n,switchLayoutGroup:wt(xt),isPresent:e,safeToRemove:i})}const uo={pan:{Feature:class extends Yi{constructor(){super(...arguments),this.removePointerDownListener=t}onPointerDown(t){this.session=new Gs(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ws(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:ro(t),onStart:ro(e),onMove:ro(i),onEnd:(t,e)=>{delete this.session,n&&f.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=zs(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 Yi{constructor(e){super(e),this.removeGroupControls=t,this.removeListeners=t,this.controls=new no(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||t}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(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Fs,MeasureLayout:ho}},co={layout:{ProjectionNode:Fs,MeasureLayout:ho}};let po=0;const mo={animation:{Feature:class extends Yi{constructor(t){super(t),t.animationState||(t.animationState=wn(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();st(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 Yi{constructor(){super(...arguments),this.id=po++,this.isExitComplete=!1}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;if(t&&!1===i){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const i=oi(this.node,t,e);if(i){const{transition:t,transitionEnd:e,...n}=i;for(const t in n)this.node.getValue(t)?.jump(n[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function fo(t,e,i){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===i);const s=n["onHover"+i];s&&f.postRender(()=>s(e,Us(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&&f.postRender(()=>s(e,Us(e)))}const go=new WeakMap,vo=new WeakMap,xo=t=>{const e=go.get(t.target);e&&e(t)},To=t=>{t.forEach(xo)};function Po(t,e,i){const n=function({root:t,...e}){const i=t||document;vo.has(i)||vo.set(i,{});const n=vo.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(To,{root:t,...e})),n[s]}(e);return go.set(t,i),n.observe(t),()=>{go.delete(t),n.unobserve(t)}}const wo={some:0,all:1};const So={renderer:(t,e)=>e.isSVG??Tt(t)?new fn(e):new pn(e,{allowProjection:t!==bt}),...mo,...{inView:{Feature:class extends Yi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();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:wo[n]};this.stopObserver=Po(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(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends Yi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:i}=this.node.props;this.unmount=Li(t,(t,e)=>(yo(this.node,e,"Start"),(t,{success:e})=>yo(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===i?.tap})}unmount(){}}},focus:{Feature:class extends Yi{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=kt(is(this.node.current,"focus",()=>this.onFocus()),is(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Yi{mount(){const{current:t}=this.node;t&&(this.unmount=wi(t,(t,e)=>(fo(this.node,e,"Start"),t=>fo(this.node,t,"End"))))}unmount(){}}}}},Eo={...So,...uo,...co};export{Eo 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,N as T,O as P,W as w,Q as S,R as E,T as A,U as D,V as b,X as M,Y as k,Z as C,_ as V,$ as L,k as R,a0 as j,a1 as B,b as I,o as O,a2 as F,a3 as U,a4 as z,a5 as W,a6 as $,a7 as N,a8 as G,a9 as H,aa as K,ab as Y,d as X,s as q,ac as _,ad as Z,l as J,e as Q,f as tt,ae as et,a as it,af as nt,j as st,ag as ot,ah as rt,ai as at,aj as lt,ak as ht,al as ut,am as ct,an as dt,ao as pt,ap as mt,r as ft,aq as yt,p as gt,P as vt,L as xt,S as Tt,g as Pt}from"./size-rollup-dom-max-assets.js";import{jsx as wt}from"react/jsx-runtime";import{useContext as St,useId as Et,useEffect as At,useCallback as Dt,Component as bt,Fragment as Mt}from"react";const kt=t=>"object"==typeof t&&null!==t,Ct=(...t)=>t.reduce((t,e)=>i=>e(t(i))),Vt=(t,e,i)=>{const n=e-t;return n?(i-t)/n:1},Lt=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function Rt(e,i,n,s){if(e===i&&n===s)return t;const o=t=>function(t,e,i,n,s){let o,r,a=0;do{r=e+(i-e)/2,o=Lt(r,n,s)-t,o>0?i=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(t,0,1,e,n);return t=>0===t||1===t?t:Lt(o(t),i,s)}const jt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Bt=t=>e=>1-t(1-e),It=Rt(.33,1.53,.69,.99),Ot=Bt(It),Ft=jt(Ot),Ut=t=>t>=1?1:(t*=2)<1?.5*Ot(t):.5*(2-Math.pow(2,-10*(t-1))),zt=t=>1-Math.sin(Math.acos(t)),Wt=Bt(zt),$t=jt(zt),Nt=Rt(.42,0,1,1),Gt=Rt(0,0,.58,1),Ht=Rt(.42,0,.58,1),Kt={linear:t,easeIn:Nt,easeInOut:Ht,easeOut:Gt,circIn:zt,circInOut:$t,circOut:Wt,backIn:Ot,backInOut:Ft,backOut:It,anticipate:Ut},Yt=t=>{if(e(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,o]=t;return Rt(e,n,s,o)}return"string"==typeof t?(i(void 0!==Kt[t],`Invalid easing type '${t}'`,"invalid-easing-type"),Kt[t]):t};function Xt(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 qt(t,e){return i=>i>0?e:t}const _t=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},Zt=[r,s,o];function Jt(t){const e=(i=t,Zt.find(t=>t.test(i)));var i;if(a(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let n=e.parse(t);return e===o&&(n=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=Xt(a,n,t+1/3),o=Xt(a,n,t),r=Xt(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}}(n)),n}const Qt=(t,e)=>{const i=Jt(t),o=Jt(e);if(!i||!o)return qt(t,e);const r={...i};return t=>(r.red=_t(i.red,o.red,t),r.green=_t(i.green,o.green,t),r.blue=_t(i.blue,o.blue,t),r.alpha=n(i.alpha,o.alpha,t),s.transform(r))},te=new Set(["none","hidden"]);function ee(t,e){return i=>n(t,e,i)}function ie(t){return"number"==typeof t?ee:"string"==typeof t?l(t)?qt:h.test(t)?Qt:oe:Array.isArray(t)?ne:"object"==typeof t?h.test(t)?Qt:se:qt}function ne(t,e){const i=[...t],n=i.length,s=t.map((t,i)=>ie(t)(t,e[i]));return t=>{for(let e=0;e<n;e++)i[e]=s[e](t);return i}}function se(t,e){const i={...t,...e},n={};for(const s in i)void 0!==t[s]&&void 0!==e[s]&&(n[s]=ie(t[s])(t[s],e[s]));return t=>{for(const e in n)i[e]=n[e](t);return i}}const oe=(t,e)=>{const i=u.createTransformer(e),n=c(t),s=c(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?te.has(t)&&!s.values.length||te.has(e)&&!n.values.length?function(t,e){return te.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}(t,e):Ct(ne(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):(a(!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"),qt(t,e))};function re(t,e,i){if("number"==typeof t&&"number"==typeof e&&"number"==typeof i)return n(t,e,i);return ie(t)(t,e)}const ae=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>f.update(e,t),stop:()=>m(e),now:()=>d.isProcessing?d.timestamp:p.now()}},le=2e4;function he(t){let e=0;let i=t.next(e);for(;!i.done&&e<le;)e+=50,i=t.next(e);return e>=le?1/0:e}const ue=100,ce=10,de=1,pe=0,me=800,fe=.3,ye=.3,ge={granular:.01,default:2},ve={granular:.005,default:.5},xe=.01,Te=10,Pe=.05,we=1;function Se(t,e){return t*Math.sqrt(1-e*e)}const Ee=.001;const Ae=["duration","bounce"],De=["stiffness","damping","mass"];function be(t,e){return e.some(e=>void 0!==t[e])}function Me(t){let e={velocity:pe,stiffness:ue,damping:ce,mass:de,isResolvedFromDuration:!1,...t};if(!be(t,De)&&be(t,Ae))if(e.velocity=0,t.visualDuration){const i=t.visualDuration,n=2*Math.PI/(1.2*i),s=n*n,o=2*g(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:de,stiffness:s,damping:o}}else{const i=function({duration:t=me,bounce:e=fe,velocity:i=pe,mass:n=de}){let s,o;a(t<=x(Te),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=g(Pe,we,r),t=g(xe,Te,y(t)),r<1?(s=e=>{const n=e*r,s=n*t,o=n-i,a=Se(e,r),l=Math.exp(-s);return Ee-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)+Ee>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 l=function(t,e,i){let n=i;for(let i=1;i<12;i++)n-=t(n)/e(n);return n}(s,o,5/t);if(t=x(t),isNaN(l))return{stiffness:ue,damping:ce,duration:t};{const e=Math.pow(l,2)*n;return{stiffness:e,damping:2*r*Math.sqrt(n*e),duration:t}}}({...t,velocity:0});e={...e,...i,mass:de},e.isResolvedFromDuration=!0}return e}function ke(t=ye,e=fe){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:l,damping:h,mass:u,duration:c,velocity:d,isResolvedFromDuration:p}=Me({...i,velocity:-y(i.velocity||0)}),m=d||0,f=h/(2*Math.sqrt(l*u)),g=r-o,T=y(Math.sqrt(l/u)),P=Math.abs(g)<5;let w,S,E,A,D,b;if(n||(n=P?ge.granular:ge.default),s||(s=P?ve.granular:ve.default),f<1)E=Se(T,f),A=(m+f*T*g)/E,w=t=>{const e=Math.exp(-f*T*t);return r-e*(A*Math.sin(E*t)+g*Math.cos(E*t))},D=f*T*A+g*E,b=f*T*g-A*E,S=t=>Math.exp(-f*T*t)*(D*Math.sin(E*t)+b*Math.cos(E*t));else if(1===f){w=t=>r-Math.exp(-T*t)*(g+(m+T*g)*t);const t=m+T*g;S=e=>Math.exp(-T*e)*(T*t*e-m)}else{const t=T*Math.sqrt(f*f-1);w=e=>{const i=Math.exp(-f*T*e),n=Math.min(t*e,300);return r-i*((m+f*T*g)*Math.sinh(n)+t*g*Math.cosh(n))/t};const e=(m+f*T*g)/t,i=f*T*e-g*t,n=f*T*g-e*t;S=e=>{const s=Math.exp(-f*T*e),o=Math.min(t*e,300);return s*(i*Math.sinh(o)+n*Math.cosh(o))}}const M={calculatedDuration:p&&c||null,velocity:t=>x(S(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*T*t),i=Math.sin(E*t),o=Math.cos(E*t),l=r-e*(A*i+g*o),h=x(e*(D*i+b*o));return a.done=Math.abs(h)<=n&&Math.abs(r-l)<=s,a.value=a.done?r:l,a}const e=w(t);if(p)a.done=t>=c;else{const i=x(S(t));a.done=Math.abs(i)<=n&&Math.abs(r-e)<=s}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(he(M),le),e=v(e=>M.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return M}ke.applyToOptions=t=>{const e=function(t,e=100,i){const n=i({...t,keyframes:[0,e]}),s=Math.min(he(n),le);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:y(s)}}(t,100,ke);return t.ease=e.ease,t.duration=x(e.duration),t.type="keyframes",t};function Ce(t,e,i){const n=Math.max(e-5,0);return T(i-t(n),e-n)}function Ve({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=ke({keyframes:[d.value,p(d.value)],velocity:Ce(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 Le(e,n,{clamp:s=!0,ease:o,mixer:r}={}){const a=e.length;if(i(a===n.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>n[0];if(2===a&&n[0]===n[1])return()=>n[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),n=[...n].reverse());const h=function(e,i,n){const s=[],o=n||P.mix||re,r=e.length-1;for(let n=0;n<r;n++){let r=o(e[n],e[n+1]);if(i){const e=Array.isArray(i)?i[n]||t:i;r=Ct(e,r)}s.push(r)}return s}(n,o,r),u=h.length,c=t=>{if(l&&t<e[0])return n[0];let i=0;if(u>1)for(;i<e.length-2&&!(t<e[i+1]);i++);const s=Vt(e[i],e[i+1],t);return h[i](s)};return s?t=>c(g(e[0],e[a-1],t)):c}function Re(t){const e=[0];return function(t,e){const i=t[t.length-1];for(let s=1;s<=e;s++){const o=Vt(0,e,s);t.push(n(i,1,o))}}(e,t.length-1),e}function je({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(n)?n.map(Yt):Yt(n),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(i&&i.length===e.length?i:Re(e),t),a=Le(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||Ht).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const Be={decay:Ve,inertia:Ve,tween:je,keyframes:je,spring:ke};function Ie(t){"string"==typeof t.type&&(t.type=Be[t.type])}const Oe=t=>t/100;class Fe extends w{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==p.now()&&this.tick(p.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;Ie(t);const{type:e=je,repeat:i=0,repeatDelay:n=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||je;a!==je&&"number"!=typeof r[0]&&(this.mixKeyframes=Ct(Oe,re(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=he(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:l=0,keyframes:h,repeat:u,repeatType:c,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-n/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>n;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let x,T=this.currentTime,P=i;if(u){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,u+1);Boolean(e%2)&&("reverse"===c?(i=1-i,d&&(i-=d/r)):"mirror"===c&&(P=o)),T=g(0,1,i)*r}v?(this.delayState.value=h[0],x=this.delayState):x=P.next(T),s&&!v&&(x.value=s(x.value));let{done:w}=x;v||null===a||(w=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const E=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return E&&p!==Ve&&(x.value=S(h,this.options,f,this.speed)),m&&m(x.value),E&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=x(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return Ce(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(p.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ae,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(p.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={anticipate:Ut,backInOut:Ft,circInOut:$t};function ze(t){"string"==typeof t.ease&&t.ease in Ue&&(t.ease=Ue[t.ease])}class We extends E{constructor(t){ze(t),Ie(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(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 Fe({...o,autoplay:!1}),a=Math.max(10,p.now()-this.startTime),l=g(0,10,a-10),h=r.sample(a).value,{name:u}=this.options;s&&u&&A(s,u,h),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,h,l),r.stop()}}const $e=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!u.test(t)&&"0"!==t||t.startsWith("url(")));function Ne(t){t.duration=0,t.type="keyframes"}const Ge=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const He=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Ke=b(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ye(t){const{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:o,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:u}=e.owner.getProps();return Ke()&&i&&(M.has(i)||He.has(i)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&Ge.test(t[e]))return!0;return!1}(a))&&("transform"!==i||!u)&&!h&&!n&&"mirror"!==s&&0!==o&&"inertia"!==r}class Xe extends w{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=p.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||k;this.keyframeResolver=new d(r,(t,e,i)=>this.onKeyframesResolved(t,e,c,!i),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,i,n,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:l,delay:h,isHandoff:u,onUpdate:c}=n;this.resolvedAt=p.now();let d=!0;(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=$e(s,e),l=$e(o,e);return a(r===l,`You are trying to animate ${e} from "${s}" to "${o}". "${r?o:s}" is not an animatable value.`,"value-not-animatable"),!(!r||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===i||D(i))&&n)})(e,o,r,l)||(d=!1,!P.instantAnimations&&h||c?.(S(e,n,i)),e[0]=e[e.length-1],Ne(n),n.repeat=0);const m={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:i,...n,keyframes:e},f=d&&!u&&Ye(m),y=m.motionValue?.owner?.current;let g;if(f)try{g=new We({...m,element:y})}catch{g=new Fe(m)}else g=new Fe(m);g.finished.then(()=>{this.notifyFinished()}).catch(t),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}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(),C()),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()}}function qe(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 _e(t,e){if(t?.inherit&&e){const{inherit:i,...n}=t;return{...e,...n}}return t}function Ze(t,e){const i=t?.[e]??t?.default??t;return i!==t?_e(i,t):i}const Je={type:"spring",stiffness:500,damping:25,restSpeed:10},Qe={type:"keyframes",duration:.8},ti={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ei=(t,{keyframes:e})=>e.length>2?Qe:V.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Je:ti,ii=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const ni=(t,e,i,n={},s,o)=>r=>{const a=Ze(n,t)||{},l=a.delay||n.delay||0;let{elapsed:h=0}=n;h-=x(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(t){for(const e in t)if(!ii.has(e))return!0;return!1})(a)||Object.assign(u,ei(t,u)),u.duration&&(u.duration=x(u.duration)),u.repeatDelay&&(u.repeatDelay=x(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(Ne(u),0===u.delay&&(c=!0)),(P.instantAnimations||P.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(c=!0,Ne(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=S(u.keyframes,a);if(void 0!==t)return void f.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Fe(u):new Xe(u)},si=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function oi(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=function(t){const e=si.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return L(t)?parseFloat(t):t}return l(o)?oi(o,e,n+1):o}function ri(t,e,i){const n=t.getProps();return R(n,e,void 0!==i?i:n.custom,t)}const ai=new Set(["width","height","top","left","right","bottom",...j]),li=t=>Array.isArray(t);function hi(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,B(i))}function ui(t){return li(t)?t[t.length-1]||0:t}function ci(t,e){const i=t.getValue("willChange");if(n=i,Boolean(I(n)&&n.add))return i.add(e);if(!i&&P.WillChange){const i=new P.WillChange("auto");t.addValue("willChange",i),i.add(e)}var n}function di(t){return t.props[O]}function pi({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}function mi(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?_e(o,l):l;const h=o?.reduceMotion,u=o?.skipAnimations;n&&(o=n);const c=[],d=s&&t.animationState&&t.animationState.getState()[s],p=o?.path;p&&p.animateVisualElement(t,a,o,i,c);for(const e in a){const n=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&pi(d,e))continue;const r={delay:i,...Ze(o||{},e)};u&&(r.skipAnimations=!0);const l=n.get();if(void 0!==l&&!n.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){f.update(()=>n.set(s));continue}let p=!1;if(window.MotionHandoffAnimation){const i=di(t);if(i){const t=window.MotionHandoffAnimation(i,e,f);null!==t&&(r.startTime=t,p=!0)}}ci(t,e);const m=h??t.shouldReduceMotion;n.start(ni(e,n,s,m&&ai.has(e)?{type:!1}:r,t,p));const y=n.animation;y&&c.push(y)}if(r){const e=()=>f.update(()=>{r&&function(t,e){const i=ri(t,e);let{transitionEnd:n={},transition:s={},...o}=i||{};o={...o,...n};for(const e in o)hi(t,e,ui(o[e]))}(t,r)});c.length?Promise.all(c).then(e):e()}return c}function fi(t,e,i={}){const n=ri(t,e,"exit"===i.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(s=i.transitionOverride);const o=n?()=>Promise.all(mi(t,n,i)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,i=0,n=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(fi(l,e,{...r,delay:i+("function"==typeof n?0:n)+qe(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 yi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||F(t))}const gi=new Set(["auto","none","0"]);class vi extends k{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(),l(n))){const s=oi(n,e.current);void 0!==s&&(t[i]=s),i===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!ai.has(i)||2!==t.length)return;const[n,s]=t,o=z(n),r=z(s);if(W(n)!==W(s)&&$[i])this.needsMeasurement=!0;else if(o!==r)if(N(o)&&N(r))for(let e=0;e<t.length;e++){const i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else $[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++)(null===t[e]||yi(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&&!gi.has(e)&&c(e).values.length&&(n=t[s]),s++}if(n&&i)for(const s of e)t[s]=U(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=$[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]=$[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()}}function xi(t,e,i){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const n=i?.[t]??e.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t).filter(t=>null!=t)}const Ti={x:!1,y:!1};function Pi(){return Ti.x||Ti.y}function wi(t,e){const i=xi(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function Si(t,e,i={}){const[n,s,o]=wi(t,i);return n.forEach(t=>{let i,n=!1,o=!1;const r=e=>{i&&(i(e),i=void 0),t.removeEventListener("pointerleave",l)},a=t=>{n=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(n?o=!0:r(t))};t.addEventListener("pointerenter",n=>{if("touch"===n.pointerType||Pi())return;o=!1;const r=e(t,n);"function"==typeof r&&(i=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{n=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const Ei=(t,e)=>!!e&&(t===e||Ei(t,e.parentElement)),Ai=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Di=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const bi=new Set(["INPUT","SELECT","TEXTAREA"]);const Mi=new WeakSet;function ki(t){return e=>{"Enter"===e.key&&t(e)}}function Ci(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Vi(t){return Ai(t)&&!Pi()}const Li=new WeakSet;function Ri(t,e,i={}){const[n,s,o]=wi(t,i),r=t=>{const n=t.currentTarget;if(!Vi(t))return;if(Li.has(t))return;Mi.add(n),i.stopPropagation&&Li.add(t);const o=e(n,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",h,r),Mi.has(n)&&Mi.delete(n),Vi(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,n===window||n===document||i.useGlobalTarget||Ei(n,t.target))},h=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",h,r)};return n.forEach(t=>{var e;(i.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),kt(e=t)&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const n=ki(()=>{if(Mi.has(i))return;Ci(i,"down");const t=ki(()=>{Ci(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>Ci(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),function(t){return Di.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function ji(t){return kt(t)&&"ownerSVGElement"in t}const Bi=new WeakMap;let Ii;const Oi=(t,e,i)=>(n,s)=>s&&s[0]?s[0][t+"Size"]:ji(n)&&"getBBox"in n?n.getBBox()[e]:n[i],Fi=Oi("inline","width","offsetWidth"),Ui=Oi("block","height","offsetHeight");function zi({target:t,borderBoxSize:e}){Bi.get(t)?.forEach(i=>{i(t,{get width(){return Fi(t,e)},get height(){return Ui(t,e)}})})}function Wi(t){t.forEach(zi)}function $i(t,e){Ii||"undefined"!=typeof ResizeObserver&&(Ii=new ResizeObserver(Wi));const i=xi(t);return i.forEach(t=>{let i=Bi.get(t);i||(i=new Set,Bi.set(t,i)),i.add(e),Ii?.observe(t)}),()=>{i.forEach(t=>{const i=Bi.get(t);i?.delete(e),i?.size||Ii?.unobserve(t)})}}const Ni=new Set;let Gi;function Hi(t){return Ni.add(t),Gi||(Gi=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ni.forEach(e=>e(t))},window.addEventListener("resize",Gi)),()=>{Ni.delete(t),Ni.size||"function"!=typeof Gi||(window.removeEventListener("resize",Gi),Gi=void 0)}}function Ki(t,e){return"function"==typeof t?Hi(t):$i(t,e)}class Yi extends G{constructor(){super(...arguments),this.KeyframeResolver=vi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const i=t.style;return i?i[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;I(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class Xi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function qi({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function _i(t){return void 0===t||1===t}function Zi({scale:t,scaleX:e,scaleY:i}){return!_i(t)||!_i(e)||!_i(i)}function Ji(t){return Zi(t)||Qi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Qi(t){return tn(t.x)||tn(t.y)}function tn(t){return t&&"0%"!==t}function en(t,e,i){return i+e*(t-i)}function nn(t,e,i,n,s){return void 0!==s&&(t=en(t,s,n)),en(t,i,n)+e}function sn(t,e=0,i=1,n,s){t.min=nn(t.min,e,i,n,s),t.max=nn(t.max,e,i,n,s)}function on(t,{x:e,y:i}){sn(t.x,e.translate,e.scale,e.originPoint),sn(t.y,i.translate,i.scale,i.originPoint)}const rn=.999999999999,an=1.0000000000001;function ln(t,e){t.min+=e,t.max+=e}function hn(t,e,i,s,o=.5){sn(t,e,i,n(t.min,t.max,o),s)}function un(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function cn(t,e,i){const n=i??t;hn(t.x,un(e.x,n.x),e.scaleX,e.scale,e.originX),hn(t.y,un(e.y,n.y),e.scaleY,e.scale,e.originY)}function dn(t,e){return qi(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))}function pn(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 mn extends Yi{constructor(){super(...arguments),this.type="html",this.renderInstance=pn}readValueFromInstance(t,e){if(V.has(e))return this.projection?.isProjecting?H(e):K(t,e);{const n=(i=t,window.getComputedStyle(i)),s=(Y(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof s?s.trim():s}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return dn(t,e)}build(t,e,i){X(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return q(t,e,i)}}const fn=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 yn extends Yi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Z}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(V.has(e)){const t=et(e);return t&&t.default||0}return e=fn.has(e)?e:_(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return J(t,e,i)}build(t,e,i){Q(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){!function(t,e,i,n){pn(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(fn.has(i)?i:_(i),e.attrs[i])}(t,e,0,n)}mount(t){this.isSVGTag=tt(t.tagName),super.mount(t)}}const gn=nt.length;function vn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&vn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let i=0;i<gn;i++){const n=nt[i],s=t.props[n];(it(s)||!1===s)&&(e[n]=s)}return e}function xn(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 Tn=[...ot].reverse(),Pn=ot.length;function wn(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=>fi(t,e,i));n=Promise.all(s)}else if("string"==typeof e)n=fi(t,e,i);else{const s="function"==typeof e?ri(t,e,i.custom):e;n=Promise.all(mi(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}(t,e,i)))}function Sn(t){let e=wn(t),i=Dn(),n=!0,s=!1;const o=e=>(i,n)=>{const s=ri(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 r(r){const{props:a}=t,l=vn(t.parent)||{},h=[],u=new Set;let c={},d=1/0;for(let e=0;e<Pn;e++){const p=Tn[e],m=i[p],f=void 0!==a[p]?a[p]:l[p],y=it(f),g=p===r?m.isActive:null;!1===g&&(d=e);let v=f===l[p]&&f!==a[p]&&y;if(v&&(n||s)&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...c},!m.isActive&&null===g||!f&&!m.prevProp||st(f)||"boolean"==typeof f)continue;if("exit"===p&&m.isActive&&!0!==g){m.prevResolvedValues&&(c={...c,...m.prevResolvedValues});continue}const x=En(m.prevProp,f);let T=x||p===r&&m.isActive&&!v&&y||e>d&&y,P=!1;const w=Array.isArray(f)?f:[f];let S=w.reduce(o(p),{});!1===g&&(S={});const{prevResolvedValues:E={}}=m,A={...E,...S},D=e=>{T=!0,u.has(e)&&(P=!0,u.delete(e)),m.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in A){const e=S[t],i=E[t];if(c.hasOwnProperty(t))continue;let n=!1;n=li(e)&&li(i)?!xn(e,i)||x:e!==i,n?null!=e?D(t):u.add(t):void 0!==e&&u.has(t)?D(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(c={...c,...S}),(n||s)&&t.blockInitialAnimation&&(T=!1);const b=v&&x;T&&(!b||P)&&h.push(...w.map(e=>{const i={type:p};if("string"==typeof e&&(n||s)&&!b&&t.manuallyAnimateOnMount&&t.parent){const{parent:n}=t,s=ri(n,e);if(n.enteringChildren&&s){const{delayChildren:e}=s.transition||{};i.delay=qe(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const i=ri(t,Array.isArray(a.initial)?a.initial[0]:a.initial);i&&i.transition&&(e.transition=i.transition)}u.forEach(i=>{const n=t.getBaseTarget(i),s=t.getValue(i);s&&(s.liveStyle=!0),e[i]=n??null}),h.push({animation:e})}let p=Boolean(h.length);return!n||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),n=!1,s=!1,p?e(h):Promise.resolve()}return{animateChanges:r,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=r(e);for(const t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=Dn(),s=!0}}}function En(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!xn(e,t)}function An(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Dn(){return{animate:An(!0),whileInView:An(),whileHover:An(),whileTap:An(),whileDrag:An(),whileFocus:An(),exit:An()}}function bn(t,e){t.min=e.min,t.max=e.max}function Mn(t,e){bn(t.x,e.x),bn(t.y,e.y)}function kn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Cn(t){return t.max-t.min}function Vn(t,e,i,s=.5){t.origin=s,t.originPoint=n(e.min,e.max,t.origin),t.scale=Cn(i)/Cn(e),t.translate=n(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Ln(t,e,i,n){Vn(t.x,e.x,i.x,n?n.originX:void 0),Vn(t.y,e.y,i.y,n?n.originY:void 0)}function Rn(t,e,i,s=0){const o=s?n(i.min,i.max,s):i.min;t.min=o+e.min,t.max=t.min+Cn(e)}function jn(t,e,i,s=0){const o=s?n(i.min,i.max,s):i.min;t.min=e.min-o,t.max=t.min+Cn(e)}function Bn(t,e,i,n){jn(t.x,e.x,i.x,n?.x),jn(t.y,e.y,i.y,n?.y)}function In(t,e,i,n,s){return t=en(t-=e,1/i,n),void 0!==s&&(t=en(t,1/s,n)),t}function On(t,e,[i,s,o],r,a){!function(t,e=0,i=1,s=.5,o,r=t,a=t){rt.test(e)&&(e=parseFloat(e),e=n(a.min,a.max,e/100)-a.min);if("number"!=typeof e)return;let l=n(r.min,r.max,s);t===r&&(l-=e),t.min=In(t.min,e,i,l,o),t.max=In(t.max,e,i,l,o)}(t,e[i],e[s],e[o],e.scale,r,a)}const Fn=["x","scaleX","originX"],Un=["y","scaleY","originY"];function zn(t,e,i,n){On(t.x,e,Fn,i?i.x:void 0,n?n.x:void 0),On(t.y,e,Un,i?i.y:void 0,n?n.y:void 0)}function Wn(t){return 0===t.translate&&1===t.scale}function $n(t){return Wn(t.x)&&Wn(t.y)}function Nn(t,e){return t.min===e.min&&t.max===e.max}function Gn(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Hn(t,e){return Gn(t.x,e.x)&&Gn(t.y,e.y)}function Kn(t){return Cn(t.x)/Cn(t.y)}function Yn(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Xn(t){return[t("x"),t("y")]}const qn=at.length,_n=t=>"string"==typeof t?parseFloat(t):t,Zn=t=>"number"==typeof t||lt.test(t);function Jn(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Qn=es(0,.5,Wt),ts=es(.5,.95,t);function es(t,e,i){return n=>n<t?0:n>e?1:i(Vt(t,e,n))}function is(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}const ns=(t,e)=>t.depth-e.depth;class ss{constructor(){this.children=[],this.isDirty=!1}add(t){ht(this.children,t),this.isDirty=!0}remove(t){ut(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ns),this.isDirty=!1,this.children.forEach(t)}}class os{constructor(){this.members=[]}add(t){ht(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const n=i.instance;n&&!1!==n.isConnected||i.snapshot||(ut(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(ut(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){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:n}=i.options,{layoutDependency:s}=t.options;void 0!==n&&n===s||(t.resumeFrom=i,e&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const rs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},as=["","X","Y","Z"];let ls=0;function hs(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function us(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=di(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",f,!(e||n))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&us(n)}function cs({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},i=e?.()){this.id=ls++,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(ms),this.nodes.forEach(Ss),this.nodes.forEach(Es),this.nodes.forEach(fs)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new ss)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new ct),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(e){if(this.instance)return;var i;this.isSVG=ji(e)&&!(ji(i=e)&&"svg"===i.tagName),this.instance=e;const{layoutId:n,layout:s,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(s||n)&&(this.isLayoutDirty=!0),t){let i,n=0;const s=()=>this.root.updateBlockedByResize=!1;f.read(()=>{n=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==n&&(n=t,this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){const i=p.now(),n=({timestamp:s})=>{const o=s-i;o>=e&&(m(n),t(o-e))};return f.setup(n,!0),()=>m(n)}(s,250),rs.hasAnimatedSinceResize&&(rs.hasAnimatedSinceResize=!1,this.nodes.forEach(ws)))})}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()||Cs,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Hn(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={...Ze(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h,e.path)}else e||ws(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(),m(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(As),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&&us(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,"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!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()){const t=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(vs),void this.nodes.forEach(gs)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(xs);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ts),this.nodes.forEach(Ps),this.nodes.forEach(ds),this.nodes.forEach(ps)):this.nodes.forEach(xs),this.clearAllSnapshots();const t=p.now();d.delta=g(0,1e3/60,t-d.timestamp),d.timestamp=t,d.isProcessing=!0,dt.update.process(d),dt.preRender.process(d),dt.render.process(d),d.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pt.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ys),this.sharedNodes.forEach(Ds)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,f.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){f.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Cn(this.snapshot.measuredBox.x)||Cn(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||(this.layoutCorrected=Z()),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:i(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&&!$n(this.projectionDelta),i=this.getTransformTemplate(),n=i?i(this.latestValues,""):void 0,s=n!==this.prevTransformTemplateValue;t&&this.instance&&(e||Ji(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)),Rs((n=i).x),Rs(n.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return Z();const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Bs))){const{scroll:t}=this.root;t&&(ln(e.x,t.offset.x),ln(e.y,t.offset.y))}return e}removeElementScroll(t){const e=Z();if(Mn(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&&Mn(e,t),ln(e.x,s.offset.x),ln(e.y,s.offset.y))}return e}applyTransform(t,e=!1,i){const n=i||Z();Mn(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(ln(n.x,-i.scroll.offset.x),ln(n.y,-i.scroll.offset.y)),Ji(i.latestValues)&&cn(n,i.latestValues,i.layout?.layoutBox)}return Ji(this.latestValues)&&cn(n,this.latestValues,this.layout?.layoutBox),n}removeTransform(t){const e=Z();Mn(e,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!Ji(i.latestValues))continue;let n;i.instance&&(Zi(i.latestValues)&&i.updateSnapshot(),n=Z(),Mn(n,i.measurePageBox())),zn(e,i.latestValues,i.snapshot?.layoutBox,n)}return Ji(this.latestValues)&&zn(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!==d.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=d.timestamp;const o=this.getClosestProjectingParent();var r,a,l,h;(o&&this.linkedParentVersion!==o.layoutVersion&&!o.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&o&&o.layout?this.createRelativeTarget(o,this.layout.layoutBox,o.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Z(),this.targetWithTransforms=Z()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,h=this.options.layoutAnchor||void 0,Rn(r.x,a.x,l.x,h?.x),Rn(r.y,a.y,l.y,h?.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):Mn(this.target,this.layout.layoutBox),on(this.target,this.targetDelta)):Mn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&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&&!Zi(this.parent.latestValues)&&!Qi(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=Z(),this.relativeTargetOrigin=Z(),Bn(this.relativeTargetOrigin,e,i,this.options.layoutAnchor||void 0),Mn(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===d.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;Mn(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&&(ln(t.x,-o.scroll.offset.x),ln(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,on(t,r)),n&&Ji(o.latestValues)&&cn(t,o.latestValues,o.layout?.layoutBox))}e.x<an&&e.x>rn&&(e.x=1),e.y<an&&e.y>rn&&(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=Z());const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(kn(this.prevProjectionDelta.x,this.projectionDelta.x),kn(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Ln(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Yn(this.projectionDelta.x,this.prevProjectionDelta.x)&&Yn(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=mt(),this.projectionDelta=mt(),this.projectionDeltaWithTransform=mt()}setAnimationOrigin(t,e=!1,i){const s=this.snapshot,o=s?s.latestValues:{},r={...this.latestValues},a=mt();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const l=Z(),h=(s?s.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),c=!u||u.members.length<=1,d=Boolean(h&&!c&&!0===this.options.crossfade&&!this.path.some(ks));let p;this.animationProgress=0;const m=i?.interpolateProjection(t);this.mixTargetDelta=e=>{const i=e/1e3,s=m?.(i);var u,f,y,g,v,x;s?(a.x.translate=s.x,a.x.scale=n(t.x.scale,1,i),a.x.origin=t.x.origin,a.x.originPoint=t.x.originPoint,a.y.translate=s.y,a.y.scale=n(t.y.scale,1,i),a.y.origin=t.y.origin,a.y.originPoint=t.y.originPoint):(bs(a.x,t.x,i),bs(a.y,t.y,i)),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Bn(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),y=this.relativeTarget,g=this.relativeTargetOrigin,v=l,x=i,Ms(y.x,g.x,v.x,x),Ms(y.y,g.y,v.y,x),p&&(u=this.relativeTarget,f=p,Nn(u.x,f.x)&&Nn(u.y,f.y))&&(this.isProjectionDirty=!1),p||(p=Z()),Mn(p,this.relativeTarget)),h&&(this.animationValues=r,function(t,e,i,s,o,r){o?(t.opacity=n(0,i.opacity??1,Qn(s)),t.opacityExit=n(e.opacity??1,0,ts(s))):r&&(t.opacity=n(e.opacity??1,i.opacity??1,s));for(let o=0;o<qn;o++){const r=at[o];let a=Jn(e,r),l=Jn(i,r);void 0===a&&void 0===l||(a||(a=0),l||(l=0),0===a||0===l||Zn(a)===Zn(l)?(t[r]=Math.max(n(_n(a),_n(l),s),0),(rt.test(l)||rt.test(a))&&(t[r]+="%")):t[r]=l)}(e.rotate||i.rotate)&&(t.rotate=n(e.rotate||0,i.rotate||0,s))}(r,o,this.latestValues,i,d,c)),s&&void 0!==s.rotate&&(this.animationValues||(this.animationValues=r),this.animationValues.pathRotation=s.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(m(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=f.update(()=>{rs.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=B(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(t,e,i){const n=I(t)?t:B(t);return n.start(ni("",n,e,i)),n.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},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&&js(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Z();const e=Cn(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const n=Cn(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}Mn(e,i),cn(e,s),Ln(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new os);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&&hs("z",t,n,this.animationValues);for(let e=0;e<as.length;e++)hs(`rotate${as[e]}`,t,n,this.animationValues),hs(`skew${as[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=ft(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=ft(e?.pointerEvents)||""),void(this.hasProjected&&!Ji(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,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=i;t&&(n=`perspective(${t}px) ${n}`),e&&(n+=`rotate(${e}deg) `),s&&(n+=`rotate(${s}deg) `),o&&(n+=`rotateX(${o}deg) `),r&&(n+=`rotateY(${r}deg) `),a&&(n+=`skewX(${a}deg) `),l&&(n+=`skewY(${l}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 yt){if(void 0===s[e])continue;const{correct:i,applyTo:r,isCSSVariable:a}=yt[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?ft(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(gs),this.root.sharedNodes.clear()}}}function ds(t){t.updateLayout()}function ps(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;if("size"===s)Xn(t=>{const n=o?e.measuredBox[t]:e.layoutBox[t],s=Cn(n);n.min=i[t].min,n.max=n.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";bn(o?e.measuredBox[t]:e.layoutBox[t],i[t])}else js(s,e.layoutBox,i)&&Xn(n=>{const s=o?e.measuredBox[n]:e.layoutBox[n],r=Cn(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=mt();Ln(r,i,e.layoutBox);const a=mt();o?Ln(a,t.applyTransform(n,!0),e.measuredBox):Ln(a,i,e.layoutBox);const l=!$n(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=t.options.layoutAnchor||void 0,a=Z();Bn(a,e.layoutBox,s.layoutBox,r);const l=Z();Bn(l,i,o.layoutBox,r),Hn(a,l)||(h=!0),n.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,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 ms(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 fs(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ys(t){t.clearSnapshot()}function gs(t){t.clearMeasurements()}function vs(t){t.isLayoutDirty=!0,t.updateLayout()}function xs(t){t.isLayoutDirty=!1}function Ts(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Ps(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ws(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ss(t){t.resolveTargetDelta()}function Es(t){t.calcProjection()}function As(t){t.resetSkewAndRotation()}function Ds(t){t.removeLeadSnapshot()}function bs(t,e,i){t.translate=n(e.translate,0,i),t.scale=n(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function Ms(t,e,i,s){t.min=n(e.min,i.min,s),t.max=n(e.max,i.max,s)}function ks(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Cs={duration:.45,ease:[.4,0,.1,1]},Vs=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ls=Vs("applewebkit/")&&!Vs("chrome/")?Math.round:t;function Rs(t){t.min=Ls(t.min),t.max=Ls(t.max)}function js(t,e,i){return"position"===t||"preserve-aspect"===t&&(n=Kn(e),s=Kn(i),o=.2,!(Math.abs(n-s)<=o));var n,s,o}function Bs(t){return t!==t.root&&t.scroll?.wasRoot}const Is=cs({attachResizeListener:(t,e)=>is(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Os={current:void 0},Fs=cs({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Os.current){const t=new Is({});t.mount(window),t.setOptions({layoutScroll:!0}),Os.current=t}return Os.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Us(t){return{point:{x:t.pageX,y:t.pageY}}}function zs(t,e,i,n){return is(t,e,(t=>e=>Ai(e)&&t(e,Us(e)))(i),n)}const Ws=({current:t})=>t?t.ownerDocument.defaultView:null,$s=(t,e)=>Math.abs(t-e);const Ns=new Set(["auto","scroll"]);class Gs{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.lastRawMoveEventInfo=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;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Hs(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Ys(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){const i=$s(t.x,e.x),n=$s(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}=d;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.lastRawMoveEventInfo=e,this.lastMoveEventInfo=Hs(e,this.transformPagePoint),f.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=Ys("pointercancel"===t.type?this.lastMoveEventInfo:Hs(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,o),n&&n(t,o)},!Ai(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=n||window;const a=Hs(Us(t),this.transformPagePoint),{point:l}=a,{timestamp:h}=d;this.history=[{...l,timestamp:h}];const{onSessionStart:u}=e;u&&u(t,Ys(a,this.history));const c={passive:!0,capture:!0};this.removeListeners=Ct(zs(this.contextWindow,"pointermove",this.handlePointerMove,c),zs(this.contextWindow,"pointerup",this.handlePointerUp,c),zs(this.contextWindow,"pointercancel",this.handlePointerUp,c)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(Ns.has(t.overflowX)||Ns.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}),window.addEventListener("scroll",this.onWindowScroll),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),f.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),m(this.updatePoint)}}function Hs(t,e){return e?{point:e(t.point)}:t}function Ks(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ys({point:t},e){return{point:t,delta:Ks(t,qs(e)),offset:Ks(t,Xs(e)),velocity:_s(e,.1)}}function Xs(t){return t[0]}function qs(t){return t[t.length-1]}function _s(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null;const s=qs(t);for(;i>=0&&(n=t[i],!(s.timestamp-n.timestamp>x(e)));)i--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&s.timestamp-n.timestamp>2*x(e)&&(n=t[1]);const o=y(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 Zs(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 Js(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 Qs=.35;function to(t,e,i){return{min:eo(t,e),max:eo(t,i)}}function eo(t,e){return"number"==typeof t?t:t[e]||0}const io=new WeakMap;class no{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=Z(),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 Gs(t,{onSessionStart:t=>{e&&this.snapToCursor(Us(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:i,dragPropagation:n,onDragStart:s}=this.getProps();if(i&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=i)||"y"===o?Ti[o]?null:(Ti[o]=!0,()=>{Ti[o]=!1}):Ti.x||Ti.y?null:(Ti.x=Ti.y=!0,()=>{Ti.x=Ti.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),Xn(t=>{let e=this.getAxisMotionValue(t).get()||0;if(rt.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const n=i.layout.layoutBox[t];if(n){e=Cn(n)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&f.update(()=>s(t,e),!1,!0),ci(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&&f.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:i,contextWindow:Ws(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&&f.postRender(()=>r(i,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,i){const{drag:s}=this.getProps();if(!i||!oo(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:i},s){return void 0!==e&&t<e?t=s?n(e,t,s.min):Math.max(t,e):void 0!==i&&t>i&&(t=s?n(i,t,s.max):Math.min(t,i)),t}(r,this.constraints[t],this.elastic[t])),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&&gt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(t,{top:e,left:i,bottom:n,right:s}){return{x:Zs(t.x,i,s),y:Zs(t.y,e,n)}}(i.layoutBox,t),this.elastic=function(t=Qs){return!1===t?t=0:!0===t&&(t=Qs),{x:to(t,"left","right"),y:to(t,"top","bottom")}}(e),n!==this.constraints&&!gt(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Xn(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||!gt(t))return!1;const n=t.current;i(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const o=function(t,e,i){const n=dn(t,i),{scroll:s}=e;return s&&(ln(n.x,s.offset.x),ln(n.y,s.offset.y)),n}(n,s.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Js(t.x,e.x),y:Js(t.y,e.y)}}(s.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=qi(t))}return r}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:n,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Xn(r=>{if(!oo(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(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 ci(this.visualElement,t),i.start(ni(t,i,0,e,this.visualElement,!1))}stopAnimation(){Xn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[e];return i||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Xn(e=>{const{drag:i}=this.getProps();if(!oo(e,i,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(e);if(s&&s.layout){const{min:i,max:r}=s.layout.layoutBox[e],a=o.get()||0;o.set(t[e]-n(i,r,.5)+a)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!gt(e)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Xn(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=Cn(t),s=Cn(e);return s>n?i=Vt(e.min,e.max-n,t.min):n>s&&(i=Vt(t.min,t.max-s,e.min)),g(0,1,i)}({min:i,max:i},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Xn(e=>{if(!oo(e,t,null))return;const i=this.getAxisMotionValue(e),{min:o,max:r}=this.constraints[e];i.set(n(o,r,s[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;io.set(this.visualElement,this);const t=this.visualElement.current,e=zs(t,"pointerdown",e=>{const{drag:i,dragListener:n=!0}=this.getProps(),s=e.target,o=s!==t&&function(t){return bi.has(t.tagName)||!0===t.isContentEditable}(s);i&&n&&!o&&this.start(e)});let i;const n=()=>{const{dragConstraints:e}=this.getProps();gt(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),i||(i=function(t,e,i){const n=Ki(t,so(i)),s=Ki(e,so(i));return()=>{n(),s()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),f.read(n);const r=is(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Xn(e=>{const i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:s=!1,dragElastic:o=Qs,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:n,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function so(t){let e=!0;return()=>{e?e=!1:t()}}function oo(t,e,i){return!(!0!==e&&e!==t||null!==i&&i!==t)}const ro=t=>(e,i)=>{t&&f.update(()=>t(e,i),!1,!0)};let ao=!1;class lo extends bt{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),ao&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),rs.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:n,isPresent:s}=this.props,{projection:o}=i;return o?(o.isPresent=s,t.layoutDependency!==e&&o.setOptions({...o.options,layoutDependency:e}),ao=!0,n||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||f.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=e,i.root.didUpdate(),pt.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:n}=t;ao=!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 ho(t){const[e,i]=function(t=!0){const e=St(vt);if(null===e)return[!0,null];const{isPresent:i,onExitComplete:n,register:s}=e,o=Et();At(()=>{if(t)return s(o)},[t]);const r=Dt(()=>t&&n&&n(o),[o,n,t]);return!i&&n?[!1,r]:[!0]}(),n=St(xt);return wt(lo,{...t,layoutGroup:n,switchLayoutGroup:St(Tt),isPresent:e,safeToRemove:i})}const uo={pan:{Feature:class extends Xi{constructor(){super(...arguments),this.removePointerDownListener=t}onPointerDown(t){this.session=new Gs(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ws(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:ro(t),onStart:ro(e),onMove:ro(i),onEnd:(t,e)=>{delete this.session,n&&f.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=zs(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 Xi{constructor(e){super(e),this.removeGroupControls=t,this.removeListeners=t,this.controls=new no(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||t}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(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Fs,MeasureLayout:ho}},co={layout:{ProjectionNode:Fs,MeasureLayout:ho}};let po=0;const mo={animation:{Feature:class extends Xi{constructor(t){super(t),t.animationState||(t.animationState=Sn(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();st(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 Xi{constructor(){super(...arguments),this.id=po++,this.isExitComplete=!1}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;if(t&&!1===i){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const i=ri(this.node,t,e);if(i){const{transition:t,transitionEnd:e,...n}=i;for(const t in n)this.node.getValue(t)?.jump(n[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function fo(t,e,i){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===i);const s=n["onHover"+i];s&&f.postRender(()=>s(e,Us(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&&f.postRender(()=>s(e,Us(e)))}const go=new WeakMap,vo=new WeakMap,xo=t=>{const e=go.get(t.target);e&&e(t)},To=t=>{t.forEach(xo)};function Po(t,e,i){const n=function({root:t,...e}){const i=t||document;vo.has(i)||vo.set(i,{});const n=vo.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(To,{root:t,...e})),n[s]}(e);return go.set(t,i),n.observe(t),()=>{go.delete(t),n.unobserve(t)}}const wo={some:0,all:1};const So={renderer:(t,e)=>e.isSVG??Pt(t)?new yn(e):new mn(e,{allowProjection:t!==Mt}),...mo,...{inView:{Feature:class extends Xi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();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:wo[n]};this.stopObserver=Po(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(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends Xi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:i}=this.node.props;this.unmount=Ri(t,(t,e)=>(yo(this.node,e,"Start"),(t,{success:e})=>yo(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===i?.tap})}unmount(){}}},focus:{Feature:class extends Xi{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=Ct(is(this.node.current,"focus",()=>this.onFocus()),is(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Xi{mount(){const{current:t}=this.node;t&&(this.unmount=Si(t,(t,e)=>(fo(this.node,e,"Start"),t=>fo(this.node,t,"End"))))}unmount(){}}}}},Eo={...So,...uo,...co};export{Eo as domMax};
@@ -1,2 +1,2 @@
1
- import{jsxs as t,jsx as n}from"react/jsx-runtime";import{createContext as r,useContext as e,useMemo as o,Fragment as a,createElement as s,useRef as i,useInsertionEffect as l,useCallback as u,useLayoutEffect as c,useEffect as f,forwardRef as d}from"react";const p=(t,n,r)=>r>n?n:r<t?t:r,m=r({}),g=r({strict:!1}),h=r({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),y=r({}),v=(t=>n=>"string"==typeof n&&n.startsWith(t))("--"),b={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},w={...b,transform:t=>p(0,1,t)},S={...b,default:1},x=t=>Math.round(1e5*t)/1e5,R=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const k=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,B=(t,n)=>r=>Boolean("string"==typeof r&&k.test(r)&&r.startsWith(t)||n&&!function(t){return null==t}(r)&&Object.prototype.hasOwnProperty.call(r,n)),T=(t,n,r)=>e=>{if("string"!=typeof e)return e;const[o,a,s,i]=e.match(R);return{[t]:parseFloat(o),[n]:parseFloat(a),[r]:parseFloat(s),alpha:void 0!==i?parseFloat(i):1}},I={...b,transform:t=>Math.round((t=>p(0,255,t))(t))},A={test:B("rgb","red"),parse:T("red","green","blue"),transform:({red:t,green:n,blue:r,alpha:e=1})=>"rgba("+I.transform(t)+", "+I.transform(n)+", "+I.transform(r)+", "+x(w.transform(e))+")"};const M={test:B("#"),parse:function(t){let n="",r="",e="",o="";return t.length>5?(n=t.substring(1,3),r=t.substring(3,5),e=t.substring(5,7),o=t.substring(7,9)):(n=t.substring(1,2),r=t.substring(2,3),e=t.substring(3,4),o=t.substring(4,5),n+=n,r+=r,e+=e,o+=o),{red:parseInt(n,16),green:parseInt(r,16),blue:parseInt(e,16),alpha:o?parseInt(o,16)/255:1}},transform:A.transform},O=t=>({test:n=>"string"==typeof n&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),P=O("deg"),W=O("%"),E=O("px"),L=(()=>({...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(100*t)}))(),C={test:B("hsl","hue"),parse:T("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:r,alpha:e=1})=>"hsla("+Math.round(t)+", "+W.transform(x(n))+", "+W.transform(x(r))+", "+x(w.transform(e))+")"},j={test:t=>A.test(t)||M.test(t)||C.test(t),parse:t=>A.test(t)?A.parse(t):C.test(t)?C.parse(t):M.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?A.transform(t):C.transform(t),getAnimatableNone:t=>{const n=j.parse(t);return n.alpha=0,j.transform(n)}},$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const V="number",F="color",X=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Y(t){const n=t.toString(),r=[],e={color:[],number:[],var:[]},o=[];let a=0;const s=n.replace(X,t=>(j.test(t)?(e.color.push(a),o.push(F),r.push(j.parse(t))):t.startsWith("var(")?(e.var.push(a),o.push("var"),r.push(t)):(e.number.push(a),o.push(V),r.push(parseFloat(t))),++a,"${}")).split("${}");return{values:r,split:s,indexes:e,types:o}}function D({split:t,types:n}){const r=t.length;return e=>{let o="";for(let a=0;a<r;a++)if(o+=t[a],void 0!==e[a]){const t=n[a];o+=t===V?x(e[a]):t===F?j.transform(e[a]):e[a]}return o}}const H=(t,n)=>{return"number"==typeof t?n?.trim().endsWith("/")?t:0:"number"==typeof(r=t)?0:j.test(r)?j.getAnimatableNone(r):r;var r};const N={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(R)?.length||0)+(t.match($)?.length||0)>0},parse:function(t){return Y(t).values},createTransformer:function(t){return D(Y(t))},getAnimatableNone:function(t){const n=Y(t);return D(n)(n.values.map((t,r)=>H(t,n.split[r])))}},Z=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],z=(()=>new Set([...Z,"pathRotation"]))();function U(t,n,r,e){if("function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}if("string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}return n}const q=t=>Boolean(t&&t.getVelocity);const _="data-"+"framerAppearId".replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`);const G={...b,transform:Math.round},J={borderWidth:E,borderTopWidth:E,borderRightWidth:E,borderBottomWidth:E,borderLeftWidth:E,borderRadius:E,borderTopLeftRadius:E,borderTopRightRadius:E,borderBottomRightRadius:E,borderBottomLeftRadius:E,width:E,maxWidth:E,height:E,maxHeight:E,top:E,right:E,bottom:E,left:E,inset:E,insetBlock:E,insetBlockStart:E,insetBlockEnd:E,insetInline:E,insetInlineStart:E,insetInlineEnd:E,padding:E,paddingTop:E,paddingRight:E,paddingBottom:E,paddingLeft:E,paddingBlock:E,paddingBlockStart:E,paddingBlockEnd:E,paddingInline:E,paddingInlineStart:E,paddingInlineEnd:E,margin:E,marginTop:E,marginRight:E,marginBottom:E,marginLeft:E,marginBlock:E,marginBlockStart:E,marginBlockEnd:E,marginInline:E,marginInlineStart:E,marginInlineEnd:E,fontSize:E,backgroundPositionX:E,backgroundPositionY:E,...{rotate:P,pathRotation:P,rotateX:P,rotateY:P,rotateZ:P,scale:S,scaleX:S,scaleY:S,scaleZ:S,skew:P,skewX:P,skewY:P,distance:E,translateX:E,translateY:E,translateZ:E,x:E,y:E,z:E,perspective:E,transformPerspective:E,opacity:w,originX:L,originY:L,originZ:E},zIndex:G,fillOpacity:w,strokeOpacity:w,numOctaves:G},K=(t,n)=>n&&"number"==typeof t?n.transform(t):t;function Q(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function tt(t){return"string"==typeof t||Array.isArray(t)}const nt=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function rt(t){return Q(t.animate)||nt.some(n=>tt(t[n]))}let et={};const ot={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},at=Z.length;function st(t,n,r){const{style:e,vars:o,transformOrigin:a}=t;let s=!1,i=!1;for(const t in n){const r=n[t];if(z.has(t))s=!0;else if(v(t))o[t]=r;else{const n=K(r,J[t]);t.startsWith("origin")?(i=!0,a[t]=n):e[t]=n}}if(n.transform||(s||r?e.transform=function(t,n,r){let e="",o=!0;for(let a=0;a<at;a++){const s=Z[a],i=t[s];if(void 0===i)continue;let l=!0;if("number"==typeof i)l=i===(s.startsWith("scale")?1:0);else{const t=parseFloat(i);l=s.startsWith("scale")?1===t:0===t}if(!l||r){const t=K(i,J[s]);l||(o=!1,e+=`${ot[s]||s}(${t}) `),r&&(n[s]=t)}}const a=t.pathRotation;return a&&(o=!1,e+=`rotate(${K(a,J.pathRotation)}) `),e=e.trim(),r?e=r(n,o?"":e):o&&(e="none"),e}(n,t.transform,r):e.transform&&(e.transform="none")),i){const{originX:t="50%",originY:n="50%",originZ:r=0}=a;e.transformOrigin=`${t} ${n} ${r}`}}function it(t,n){return n.max===n.min?0:t/(n.max-n.min)*100}const lt={correct:(t,n)=>{if(!n.target)return t;if("string"==typeof t){if(!E.test(t))return t;t=parseFloat(t)}return`${it(t,n.target.x)}% ${it(t,n.target.y)}%`}},ut={correct:(t,{treeScale:n,projectionDelta:r})=>{const e=t,o=N.parse(t);if(o.length>5)return e;const a=N.createTransformer(t),s="number"!=typeof o[0]?1:0,i=r.x.scale*n.x,l=r.y.scale*n.y;o[0+s]/=i,o[1+s]/=l;const u=(c=i)+(l-c)*.5;var c;return"number"==typeof o[2+s]&&(o[2+s]/=u),"number"==typeof o[3+s]&&(o[3+s]/=u),a(o)}},ct={borderRadius:{...lt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomLeftRadius:lt,borderBottomRightRadius:lt,boxShadow:ut};function ft(t,{layout:n,layoutId:r}){return z.has(t)||t.startsWith("origin")||(n||void 0!==r)&&(!!ct[t]||"opacity"===t)}function dt(t,n,r){const e=t.style,o=n?.style,a={};if(!e)return a;for(const n in e)(q(e[n])||o&&q(o[n])||ft(n,t)||void 0!==r?.getValue(n)?.liveStyle)&&(a[n]=e[n]);return a}const pt={offset:"stroke-dashoffset",array:"stroke-dasharray"},mt={offset:"strokeDashoffset",array:"strokeDasharray"};const gt=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ht(t,{attrX:n,attrY:r,attrScale:e,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...i},l,u,c){if(st(t,i,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete f.transformBox);for(const t of gt)void 0!==f[t]&&(d[t]=f[t],delete f[t]);void 0!==n&&(f.x=n),void 0!==r&&(f.y=r),void 0!==e&&(f.scale=e),void 0!==o&&function(t,n,r=1,e=0,o=!0){t.pathLength=1;const a=o?pt:mt;t[a.offset]=""+-e,t[a.array]=`${n} ${r}`}(f,o,a,s,!1)}function yt(t){return q(t)?t.get():t}function vt(t){const{initial:n,animate:r}=function(t,n){if(rt(t)){const{initial:n,animate:r}=t;return{initial:!1===n||tt(n)?n:void 0,animate:tt(r)?r:void 0}}return!1!==t.inherit?n:{}}(t,e(y));return o(()=>({initial:n,animate:r}),[bt(n),bt(r)])}function bt(t){return Array.isArray(t)?t.join(" "):t}const wt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function St(t,n,r){for(const e in n)q(n[e])||ft(e,r)||(t[e]=n[e])}function xt(t,n){const r={};return St(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n){return o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return st(r,n,t),Object.assign({},r.vars,r.style)},[n])}(t,n)),r}function Rt(t,n){const r={},e=xt(t,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,e.userSelect=e.WebkitUserSelect=e.WebkitTouchCallout="none",e.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=e,r}const kt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Bt(t,n,r,e){const a=o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};var o;return ht(r,n,"string"==typeof(o=e)&&"svg"===o.toLowerCase(),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[n]);if(t.style){const n={};St(n,t.style,t),a.style={...n,...a.style}}return a}const Tt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function It(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Tt.has(t)}let At=t=>!It(t);try{"function"==typeof(Mt=require("@emotion/is-prop-valid").default)&&(At=t=>t.startsWith("on")?!It(t):Mt(t))}catch{}var Mt;const Ot=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Pt(t){return"string"==typeof t&&!t.includes("-")&&!!(Ot.indexOf(t)>-1||/[A-Z]/u.test(t))}function Wt(t,n,r,{latestValues:e},i,l=!1,u){const c=(u??Pt(t)?Bt:Rt)(n,e,i,t),f=function(t,n,r){const e={};for(const o in t)"values"===o&&"object"==typeof t.values||q(t[o])||(At(o)||!0===r&&It(o)||!n&&!It(o)||t.draggable&&o.startsWith("onDrag"))&&(e[o]=t[o]);return e}(n,"string"==typeof t,l),d=t!==a?{...f,...c,ref:r}:{},{children:p}=n,m=o(()=>q(p)?p.get():p,[p]);return s(t,{...d,children:m})}const Et=r(null);function Lt(t,n,r,e){const o={},a=e(t,{});for(const t in a)o[t]=yt(a[t]);let{initial:s,animate:i}=t;const l=rt(t),u=function(t){return Boolean(rt(t)||t.variants)}(t);n&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=n.initial),void 0===i&&(i=n.animate));let c=!!r&&!1===r.initial;c=c||!1===s;const f=c?i:s;if(f&&"boolean"!=typeof f&&!Q(f)){const n=Array.isArray(f)?f:[f];for(let r=0;r<n.length;r++){const e=U(t,n[r]);if(e){const{transitionEnd:t,transition:n,...r}=e;for(const t in r){let n=r[t];if(Array.isArray(n)){n=n[c?n.length-1:0]}null!==n&&(o[t]=n)}for(const n in t)o[n]=t[n]}}}return o}const Ct=t=>(n,r)=>{const o=e(y),a=e(Et),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n},r,e,o){return{latestValues:Lt(r,e,o,t),renderState:n()}}(t,n,o,a);return r?s():function(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}(s)},jt=Ct({scrapeMotionValuesFromProps:dt,createRenderState:wt}),$t=Ct({scrapeMotionValuesFromProps:function(t,n,r){const e=dt(t,n,r);for(const r in t)if(q(t[r])||q(n[r])){e[-1!==Z.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]}return e},createRenderState:kt}),Vt={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Ft=!1;function Xt(){if(Ft)return;const t={};for(const n in Vt)t[n]={isEnabled:t=>Vt[n].some(n=>!!t[n])};et=t,Ft=!0}function Yt(){return Xt(),et}const Dt=Symbol.for("motionComponentSymbol");function Ht(t,n,r){const e=i(r);l(()=>{e.current=r});const o=i(null);return u(r=>{r&&t.onMount?.(r),n&&(r?n.mount(r):n.unmount());const a=e.current;if("function"==typeof a)if(r){const t=a(r);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):a(r);else a&&(a.current=r)},[n])}const Nt=r({});function Zt(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const zt="undefined"!=typeof window?c:f;function Ut(t,n,r,o,a,s){const{visualElement:u}=e(y),c=e(g),d=e(Et),p=e(h),m=p.reducedMotion,v=p.skipAnimations,b=i(null),w=i(!1);o=o||c.renderer,!b.current&&o&&(b.current=o(t,{visualState:n,parent:u,props:r,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:m,skipAnimations:v,isSVG:s}),w.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const S=b.current,x=e(Nt);!S||S.projection||!a||"html"!==S.type&&"svg"!==S.type||function(t,n,r,e){const{layoutId:o,layout:a,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:f}=n;t.projection=new r(t.latestValues,n["data-framer-portal-id"]?void 0:qt(t.parent)),t.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(s)||i&&Zt(i),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:e,crossfade:f,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}(b.current,r,a,x);const R=i(!1);l(()=>{S&&R.current&&S.update(r,d)});const k=r[_],B=i(Boolean(k)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(k)&&window.MotionHasOptimisedAnimation?.(k));return zt(()=>{w.current=!0,S&&(R.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),B.current&&S.animationState&&S.animationState.animateChanges())}),f(()=>{S&&(!B.current&&S.animationState&&S.animationState.animateChanges(),B.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(k)}),B.current=!1),S.enteringChildren=void 0)}),S}function qt(t){if(t)return!1!==t.options.allowProjection?t.projection:qt(t.parent)}function _t(r,{forwardMotionProps:o=!1,type:a}={},s,i){const l=a?"svg"===a:Pt(r),u=l?$t:jt;function c(a,s){let c;const f={...e(h),...a,layoutId:Gt(a)},{isStatic:d}=f,p=vt(a),m=u(a,d);if(!d&&"undefined"!=typeof window){e(g).strict;const t=function(t){const n=Yt(),{drag:r,layout:e}=n;if(!r&&!e)return{};const o={...r,...e};return{MeasureLayout:r?.isEnabled(t)||e?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(f);c=t.MeasureLayout,p.visualElement=Ut(r,m,f,i,t.ProjectionNode,l)}return t(y.Provider,{value:p,children:[c&&p.visualElement?n(c,{visualElement:p.visualElement,...f}):null,Wt(r,a,Ht(m,p.visualElement,s),m,d,o,l)]})}c.displayName=`motion.${"string"==typeof r?r:`create(${r.displayName??r.name??""})`}`;const f=d(c);return f[Dt]=r,f}function Gt({layoutId:t}){const n=e(m).id;return n&&void 0!==t?n+"-"+t:t}function Jt(t,n){return _t(t,n)}const Kt=Jt("div");export{Kt as MotionDiv};
1
+ import{jsxs as t,jsx as n}from"react/jsx-runtime";import{createContext as r,useContext as e,useMemo as o,Fragment as a,createElement as s,useRef as i,useInsertionEffect as l,useCallback as u,useLayoutEffect as c,useEffect as f,forwardRef as d}from"react";const p=(t,n,r)=>r>n?n:r<t?t:r,m=r({}),g=r({strict:!1}),h=r({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),y=r({}),v=(t=>n=>"string"==typeof n&&n.startsWith(t))("--"),b={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},w={...b,transform:t=>p(0,1,t)},S={...b,default:1},x=t=>Math.round(1e5*t)/1e5,R=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const k=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,B=(t,n)=>r=>Boolean("string"==typeof r&&k.test(r)&&r.startsWith(t)||n&&!function(t){return null==t}(r)&&Object.prototype.hasOwnProperty.call(r,n)),T=(t,n,r)=>e=>{if("string"!=typeof e)return e;const[o,a,s,i]=e.match(R);return{[t]:parseFloat(o),[n]:parseFloat(a),[r]:parseFloat(s),alpha:void 0!==i?parseFloat(i):1}},I={...b,transform:t=>Math.round((t=>p(0,255,t))(t))},A={test:B("rgb","red"),parse:T("red","green","blue"),transform:({red:t,green:n,blue:r,alpha:e=1})=>"rgba("+I.transform(t)+", "+I.transform(n)+", "+I.transform(r)+", "+x(w.transform(e))+")"};const M={test:B("#"),parse:function(t){let n="",r="",e="",o="";return t.length>5?(n=t.substring(1,3),r=t.substring(3,5),e=t.substring(5,7),o=t.substring(7,9)):(n=t.substring(1,2),r=t.substring(2,3),e=t.substring(3,4),o=t.substring(4,5),n+=n,r+=r,e+=e,o+=o),{red:parseInt(n,16),green:parseInt(r,16),blue:parseInt(e,16),alpha:o?parseInt(o,16)/255:1}},transform:A.transform},O=t=>({test:n=>"string"==typeof n&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),P=O("deg"),W=O("%"),E=O("px"),L=(()=>({...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(100*t)}))(),C={test:B("hsl","hue"),parse:T("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:r,alpha:e=1})=>"hsla("+Math.round(t)+", "+W.transform(x(n))+", "+W.transform(x(r))+", "+x(w.transform(e))+")"},j={test:t=>A.test(t)||M.test(t)||C.test(t),parse:t=>A.test(t)?A.parse(t):C.test(t)?C.parse(t):M.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?A.transform(t):C.transform(t),getAnimatableNone:t=>{const n=j.parse(t);return n.alpha=0,j.transform(n)}},$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const V="number",F="color",X=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Y(t){const n=t.toString(),r=[],e={color:[],number:[],var:[]},o=[];let a=0;const s=n.replace(X,t=>(j.test(t)?(e.color.push(a),o.push(F),r.push(j.parse(t))):t.startsWith("var(")?(e.var.push(a),o.push("var"),r.push(t)):(e.number.push(a),o.push(V),r.push(parseFloat(t))),++a,"${}")).split("${}");return{values:r,split:s,indexes:e,types:o}}function D({split:t,types:n}){const r=t.length;return e=>{let o="";for(let a=0;a<r;a++)if(o+=t[a],void 0!==e[a]){const t=n[a];o+=t===V?x(e[a]):t===F?j.transform(e[a]):e[a]}return o}}const H=(t,n)=>{return"number"==typeof t?n?.trim().endsWith("/")?t:0:"number"==typeof(r=t)?0:j.test(r)?j.getAnimatableNone(r):r;var r};const N={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(R)?.length||0)+(t.match($)?.length||0)>0},parse:function(t){return Y(t).values},createTransformer:function(t){return D(Y(t))},getAnimatableNone:function(t){const n=Y(t);return D(n)(n.values.map((t,r)=>H(t,n.split[r])))}},Z=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],z=(()=>new Set([...Z,"pathRotation"]))();function U(t,n,r,e){if("function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}if("string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}return n}const q=t=>Boolean(t&&t.getVelocity);const _="data-"+"framerAppearId".replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`);const G={...b,transform:Math.round},J={borderWidth:E,borderTopWidth:E,borderRightWidth:E,borderBottomWidth:E,borderLeftWidth:E,borderRadius:E,borderTopLeftRadius:E,borderTopRightRadius:E,borderBottomRightRadius:E,borderBottomLeftRadius:E,width:E,maxWidth:E,height:E,maxHeight:E,top:E,right:E,bottom:E,left:E,inset:E,insetBlock:E,insetBlockStart:E,insetBlockEnd:E,insetInline:E,insetInlineStart:E,insetInlineEnd:E,padding:E,paddingTop:E,paddingRight:E,paddingBottom:E,paddingLeft:E,paddingBlock:E,paddingBlockStart:E,paddingBlockEnd:E,paddingInline:E,paddingInlineStart:E,paddingInlineEnd:E,margin:E,marginTop:E,marginRight:E,marginBottom:E,marginLeft:E,marginBlock:E,marginBlockStart:E,marginBlockEnd:E,marginInline:E,marginInlineStart:E,marginInlineEnd:E,fontSize:E,backgroundPositionX:E,backgroundPositionY:E,...{rotate:P,pathRotation:P,rotateX:P,rotateY:P,rotateZ:P,scale:S,scaleX:S,scaleY:S,scaleZ:S,skew:P,skewX:P,skewY:P,distance:E,translateX:E,translateY:E,translateZ:E,x:E,y:E,z:E,perspective:E,transformPerspective:E,opacity:w,originX:L,originY:L,originZ:E},zIndex:G,fillOpacity:w,strokeOpacity:w,numOctaves:G},K=(t,n)=>n&&"number"==typeof t?n.transform(t):t;function Q(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function tt(t){return"string"==typeof t||Array.isArray(t)}const nt=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function rt(t){return Q(t.animate)||nt.some(n=>tt(t[n]))}let et={};const ot={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},at=Z.length;function st(t,n,r){const{style:e,vars:o,transformOrigin:a}=t;let s=!1,i=!1;for(const t in n){const r=n[t];if(z.has(t))s=!0;else if(v(t))o[t]=r;else{const n=K(r,J[t]);t.startsWith("origin")?(i=!0,a[t]=n):e[t]=n}}if(n.transform||(s||r?e.transform=function(t,n,r){let e="",o=!0;for(let a=0;a<at;a++){const s=Z[a],i=t[s];if(void 0===i)continue;let l=!0;if("number"==typeof i)l=i===(s.startsWith("scale")?1:0);else{const t=parseFloat(i);l=s.startsWith("scale")?1===t:0===t}if(!l||r){const t=K(i,J[s]);l||(o=!1,e+=`${ot[s]||s}(${t}) `),r&&(n[s]=t)}}const a=t.pathRotation;return a&&(o=!1,e+=`rotate(${K(a,J.pathRotation)}) `),e=e.trim(),r?e=r(n,o?"":e):o&&(e="none"),e}(n,t.transform,r):e.transform&&(e.transform="none")),i){const{originX:t="50%",originY:n="50%",originZ:r=0}=a;e.transformOrigin=`${t} ${n} ${r}`}}function it(t,n){return n.max===n.min?0:t/(n.max-n.min)*100}const lt={correct:(t,n)=>{if(!n.target)return t;if("string"==typeof t){if(!E.test(t))return t;t=parseFloat(t)}return`${it(t,n.target.x)}% ${it(t,n.target.y)}%`}},ut={correct:(t,{treeScale:n,projectionDelta:r})=>{const e=t,o=N.parse(t);if(o.length>5)return e;const a=N.createTransformer(t),s="number"!=typeof o[0]?1:0,i=r.x.scale*n.x,l=r.y.scale*n.y;o[0+s]/=i,o[1+s]/=l;const u=(c=i)+(l-c)*.5;var c;return"number"==typeof o[2+s]&&(o[2+s]/=u),"number"==typeof o[3+s]&&(o[3+s]/=u),a(o)}},ct={borderRadius:{...lt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]},borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomLeftRadius:lt,borderBottomRightRadius:lt,boxShadow:ut};function ft(t,{layout:n,layoutId:r}){return z.has(t)||t.startsWith("origin")||(n||void 0!==r)&&(!!ct[t]||"opacity"===t)}function dt(t,n,r){const e=t.style,o=n?.style,a={};if(!e)return a;for(const n in e)(q(e[n])||o&&q(o[n])||ft(n,t)||void 0!==r?.getValue(n)?.liveStyle)&&(a[n]=e[n]);return a}const pt={offset:"stroke-dashoffset",array:"stroke-dasharray"},mt={offset:"strokeDashoffset",array:"strokeDasharray"};const gt=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ht(t,{attrX:n,attrY:r,attrScale:e,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...i},l,u,c){if(st(t,i,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete f.transformBox);for(const t of gt)void 0!==f[t]&&(d[t]=f[t],delete f[t]);void 0!==n&&(f.x=n),void 0!==r&&(f.y=r),void 0!==e&&(f.scale=e),void 0!==o&&function(t,n,r=1,e=0,o=!0){t.pathLength=1;const a=o?pt:mt;t[a.offset]=""+-e,t[a.array]=`${n} ${r}`}(f,o,a,s,!1)}function yt(t){return q(t)?t.get():t}function vt(t){const{initial:n,animate:r}=function(t,n){if(rt(t)){const{initial:n,animate:r}=t;return{initial:!1===n||tt(n)?n:void 0,animate:tt(r)?r:void 0}}return!1!==t.inherit?n:{}}(t,e(y));return o(()=>({initial:n,animate:r}),[bt(n),bt(r)])}function bt(t){return Array.isArray(t)?t.join(" "):t}const wt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function St(t,n,r){for(const e in n)q(n[e])||ft(e,r)||(t[e]=n[e])}function xt(t,n){const r={};return St(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n){return o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return st(r,n,t),Object.assign({},r.vars,r.style)},[n])}(t,n)),r}function Rt(t,n){const r={},e=xt(t,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,e.userSelect=e.WebkitUserSelect=e.WebkitTouchCallout="none",e.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=e,r}const kt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Bt(t,n,r,e){const a=o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};var o;return ht(r,n,"string"==typeof(o=e)&&"svg"===o.toLowerCase(),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[n]);if(t.style){const n={};St(n,t.style,t),a.style={...n,...a.style}}return a}const Tt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function It(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Tt.has(t)}let At=t=>!It(t);try{"function"==typeof(Mt=require("@emotion/is-prop-valid").default)&&(At=t=>t.startsWith("on")?!It(t):Mt(t))}catch{}var Mt;const Ot=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Pt(t){return"string"==typeof t&&!t.includes("-")&&!!(Ot.indexOf(t)>-1||/[A-Z]/u.test(t))}function Wt(t,n,r,{latestValues:e},i,l=!1,u){const c=(u??Pt(t)?Bt:Rt)(n,e,i,t),f=function(t,n,r){const e={};for(const o in t)"values"===o&&"object"==typeof t.values||q(t[o])||(At(o)||!0===r&&It(o)||!n&&!It(o)||t.draggable&&o.startsWith("onDrag"))&&(e[o]=t[o]);return e}(n,"string"==typeof t,l),d=t!==a?{...f,...c,ref:r}:{},{children:p}=n,m=o(()=>q(p)?p.get():p,[p]);return s(t,{...d,children:m})}const Et=r(null);function Lt(t,n,r,e){const o={},a=e(t,{});for(const t in a)o[t]=yt(a[t]);let{initial:s,animate:i}=t;const l=rt(t),u=function(t){return Boolean(rt(t)||t.variants)}(t);n&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=n.initial),void 0===i&&(i=n.animate));let c=!!r&&!1===r.initial;c=c||!1===s;const f=c?i:s;if(f&&"boolean"!=typeof f&&!Q(f)){const n=Array.isArray(f)?f:[f];for(let r=0;r<n.length;r++){const e=U(t,n[r]);if(e){const{transitionEnd:t,transition:n,...r}=e;for(const t in r){let n=r[t];if(Array.isArray(n)){n=n[c?n.length-1:0]}null!==n&&(o[t]=n)}for(const n in t)o[n]=t[n]}}}return o}const Ct=t=>(n,r)=>{const o=e(y),a=e(Et),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n},r,e,o){return{latestValues:Lt(r,e,o,t),renderState:n()}}(t,n,o,a);return r?s():function(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}(s)},jt=Ct({scrapeMotionValuesFromProps:dt,createRenderState:wt}),$t=Ct({scrapeMotionValuesFromProps:function(t,n,r){const e=dt(t,n,r);for(const r in t)if(q(t[r])||q(n[r])){e[-1!==Z.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]}return e},createRenderState:kt}),Vt={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Ft=!1;function Xt(){if(Ft)return;const t={};for(const n in Vt)t[n]={isEnabled:t=>Vt[n].some(n=>!!t[n])};et=t,Ft=!0}function Yt(){return Xt(),et}const Dt=Symbol.for("motionComponentSymbol");function Ht(t,n,r){const e=i(r);l(()=>{e.current=r});const o=i(null);return u(r=>{r&&t.onMount?.(r),n&&(r?n.mount(r):n.unmount());const a=e.current;if("function"==typeof a)if(r){const t=a(r);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):a(r);else a&&(a.current=r)},[n])}const Nt=r({});function Zt(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const zt="undefined"!=typeof window?c:f;function Ut(t,n,r,o,a,s){const{visualElement:u}=e(y),c=e(g),d=e(Et),p=e(h),m=p.reducedMotion,v=p.skipAnimations,b=i(null),w=i(!1);o=o||c.renderer,!b.current&&o&&(b.current=o(t,{visualState:n,parent:u,props:r,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:m,skipAnimations:v,isSVG:s}),w.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const S=b.current,x=e(Nt);!S||S.projection||!a||"html"!==S.type&&"svg"!==S.type||function(t,n,r,e){const{layoutId:o,layout:a,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:f}=n;t.projection=new r(t.latestValues,n["data-framer-portal-id"]?void 0:qt(t.parent)),t.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(s)||i&&Zt(i),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:e,crossfade:f,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}(b.current,r,a,x);const R=i(!1);l(()=>{S&&R.current&&S.update(r,d)});const k=r[_],B=i(Boolean(k)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(k)&&window.MotionHasOptimisedAnimation?.(k));return zt(()=>{w.current=!0,S&&(R.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),B.current&&S.animationState&&S.animationState.animateChanges())}),f(()=>{S&&(!B.current&&S.animationState&&S.animationState.animateChanges(),B.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(k)}),B.current=!1),S.enteringChildren=void 0)}),S}function qt(t){if(t)return!1!==t.options.allowProjection?t.projection:qt(t.parent)}function _t(r,{forwardMotionProps:o=!1,type:a}={},s,i){const l=a?"svg"===a:Pt(r),u=l?$t:jt;function c(a,s){let c;const f={...e(h),...a,layoutId:Gt(a)},{isStatic:d}=f,p=vt(a),m=u(a,d);if(!d&&"undefined"!=typeof window){e(g).strict;const t=function(t){const n=Yt(),{drag:r,layout:e}=n;if(!r&&!e)return{};const o={...r,...e};return{MeasureLayout:r?.isEnabled(t)||e?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(f);c=t.MeasureLayout,p.visualElement=Ut(r,m,f,i,t.ProjectionNode,l)}return t(y.Provider,{value:p,children:[c&&p.visualElement?n(c,{visualElement:p.visualElement,...f}):null,Wt(r,a,Ht(m,p.visualElement,s),m,d,o,l)]})}c.displayName=`motion.${"string"==typeof r?r:`create(${r.displayName??r.name??""})`}`;const f=d(c);return f[Dt]=r,f}function Gt({layoutId:t}){const n=e(m).id;return n&&void 0!==t?n+"-"+t:t}function Jt(t,n){return _t(t,n)}const Kt=Jt("div");export{Kt as MotionDiv};
2
2
  //# sourceMappingURL=size-rollup-m.js.map