/**
 * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.
 * Original file: /npm/motion-dom@12.23.12/dist/es/index.mjs
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import{MotionGlobalConfig as re,noop as ae,clamp as Y,warning as Te,pipe as _e,millisecondsToSeconds as N,velocityPerSecond as Lt,secondsToMilliseconds as O,invariant as ze,progress as Wt,easeInOut as rs,isEasingArray as as,easingDefinitionToFunction as Ge,memo as be,isBezierDefinition as It,circInOut as os,backInOut as ls,anticipate as cs,isNumericalString as us,isZeroValueString as fs,isObject as Bt,SubscriptionManager as ds,removeItem as hs}from"/npm/motion-utils@12.23.6/+esm";const oe=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],C={value:null,addProjectionMetrics:null};function ms(e,t){let n=new Set,s=new Set,i=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(f){a.has(f)&&(u.schedule(f),e()),l++,f(o)}const u={schedule:(f,d=!1,m=!1)=>{const p=m&&i?n:s;return d&&a.add(f),p.has(f)||p.add(f),f},cancel:f=>{s.delete(f),a.delete(f)},process:f=>{if(o=f,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(c),t&&C.value&&C.value.frameloop[t].push(l),l=0,n.clear(),i=!1,r&&(r=!1,u.process(f))}};return u}const ps=40;function Xe(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=oe.reduce((w,M)=>(w[M]=ms(r,t?M:void 0),w),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:d,render:m,postRender:g}=a,p=()=>{const w=re.useManualTiming?i.timestamp:performance.now();n=!1,re.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(w-i.timestamp,ps),1)),i.timestamp=w,i.isProcessing=!0,o.process(i),l.process(i),c.process(i),u.process(i),f.process(i),d.process(i),m.process(i),g.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(p))},v=()=>{n=!0,s=!0,i.isProcessing||e(p)};return{schedule:oe.reduce((w,M)=>{const y=a[M];return w[M]=(x,E=!1,T=!1)=>(n||v(),y.schedule(x,E,T)),w},{}),cancel:w=>{for(let M=0;M<oe.length;M++)a[oe[M]].cancel(w)},state:i,steps:a}}const{schedule:P,cancel:B,state:H,steps:gs}=Xe(typeof requestAnimationFrame<"u"?requestAnimationFrame:ae,!0);let we;function ys(){we=void 0}const R={now:()=>(we===void 0&&R.set(H.isProcessing||re.useManualTiming?H.timestamp:performance.now()),we),set:e=>{we=e,queueMicrotask(ys)}},$={layout:0,mainThread:0,waapi:0},$t=e=>t=>typeof t=="string"&&t.startsWith(e),Ts=$t("--"),bs=$t("var(--"),ve=e=>bs(e)?ws.test(e.split("/*")[0].trim()):!1,ws=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,U={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},q={...U,transform:e=>Y(0,1,e)},le={...U,default:1},ce=e=>Math.round(e*1e5)/1e5,Ze=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vs(e){return e==null}const xs=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,He=(e,t)=>n=>!!(typeof n=="string"&&xs.test(n)&&n.startsWith(e)||t&&!vs(n)&&Object.prototype.hasOwnProperty.call(n,t)),jt=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,r,a,o]=s.match(Ze);return{[e]:parseFloat(i),[t]:parseFloat(r),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},As=e=>Y(0,255,e),xe={...U,transform:e=>Math.round(As(e))},j={test:He("rgb","red"),parse:jt("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+xe.transform(e)+", "+xe.transform(t)+", "+xe.transform(n)+", "+ce(q.transform(s))+")"};function Ss(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Ae={test:He("#"),parse:Ss,transform:j.transform},ue=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),L=ue("deg"),_=ue("%"),h=ue("px"),Yt=ue("vh"),Ut=ue("vw"),qe={..._,parse:e=>_.parse(e)/100,transform:e=>_.transform(e*100)},z={test:He("hsl","hue"),parse:jt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+_.transform(ce(t))+", "+_.transform(ce(n))+", "+ce(q.transform(s))+")"},A={test:e=>j.test(e)||Ae.test(e)||z.test(e),parse:e=>j.test(e)?j.parse(e):z.test(e)?z.parse(e):Ae.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?j.transform(e):z.transform(e),getAnimatableNone:e=>{const t=A.parse(e);return t.alpha=0,A.transform(t)}},Ms=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Es(e){return isNaN(e)&&typeof e=="string"&&(e.match(Ze)?.length||0)+(e.match(Ms)?.length||0)>0}const _t="number",zt="color",Vs="var",Ps="var(",Gt="${}",Rs=/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 Q(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=t.replace(Rs,l=>(A.test(l)?(s.color.push(r),i.push(zt),n.push(A.parse(l))):l.startsWith(Ps)?(s.var.push(r),i.push(Vs),n.push(l)):(s.number.push(r),i.push(_t),n.push(parseFloat(l))),++r,Gt)).split(Gt);return{values:n,split:o,indexes:s,types:i}}function Xt(e){return Q(e).values}function Zt(e){const{split:t,types:n}=Q(e),s=t.length;return i=>{let r="";for(let a=0;a<s;a++)if(r+=t[a],i[a]!==void 0){const o=n[a];o===_t?r+=ce(i[a]):o===zt?r+=A.transform(i[a]):r+=i[a]}return r}}const Ds=e=>typeof e=="number"?0:A.test(e)?A.getAnimatableNone(e):e;function Fs(e){const t=Xt(e);return Zt(e)(t.map(Ds))}const J={test:Es,parse:Xt,createTransformer:Zt,getAnimatableNone:Fs};function Qe(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ht({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let i=0,r=0,a=0;if(!t)i=r=a=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;i=Qe(l,o,e+1/3),r=Qe(l,o,e),a=Qe(l,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(a*255),alpha:s}}function fe(e,t){return n=>n>0?t:e}const de=(e,t,n)=>e+(t-e)*n,Se=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},Os=[Ae,j,z],Cs=e=>Os.find(t=>t.test(e));function qt(e){const t=Cs(e);if(Te(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===z&&(n=Ht(n)),n}const Je=(e,t)=>{const n=qt(e),s=qt(t);if(!n||!s)return fe(e,t);const i={...n};return r=>(i.red=Se(n.red,s.red,r),i.green=Se(n.green,s.green,r),i.blue=Se(n.blue,s.blue,r),i.alpha=de(n.alpha,s.alpha,r),j.transform(i))},Me=new Set(["none","hidden"]);function Qt(e,t){return Me.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ks(e,t){return n=>de(e,t,n)}function Ee(e){return typeof e=="number"?ks:typeof e=="string"?ve(e)?fe:A.test(e)?Je:en:Array.isArray(e)?et:typeof e=="object"?A.test(e)?Je:Jt:fe}function et(e,t){const n=[...e],s=n.length,i=e.map((r,a)=>Ee(r)(r,t[a]));return r=>{for(let a=0;a<s;a++)n[a]=i[a](r);return n}}function Jt(e,t){const n={...e,...t},s={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(s[i]=Ee(e[i])(e[i],t[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Ks(e,t){const n=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const r=t.types[i],a=e.indexes[r][s[r]],o=e.values[a]??0;n[i]=o,s[r]++}return n}const en=(e,t)=>{const n=J.createTransformer(t),s=Q(e),i=Q(t);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Me.has(e)&&!i.values.length||Me.has(t)&&!s.values.length?Qt(e,t):_e(et(Ks(s,i),i.values),n):(Te(!0,`Complex values '${e}' and '${t}' 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"),fe(e,t))};function tt(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?de(e,t,n):Ee(e)(e,t)}const Ns=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>P.update(t,n),stop:()=>B(t),now:()=>H.isProcessing?H.timestamp:R.now()}},nt=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let r=0;r<i;r++)s+=Math.round(e(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},he=2e4;function Ve(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<he;)t+=n,s=e.next(t);return t>=he?1/0:t}function tn(e,t=100,n){const s=n({...e,keyframes:[0,t]}),i=Math.min(Ve(s),he);return{type:"keyframes",ease:r=>s.next(i*r).value/t,duration:N(i)}}const Ls=5;function nn(e,t,n){const s=Math.max(t-Ls,0);return Lt(n-e(s),t-s)}const b={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},st=.001;function Ws({duration:e=b.duration,bounce:t=b.bounce,velocity:n=b.velocity,mass:s=b.mass}){let i,r;Te(e<=O(b.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=Y(b.minDamping,b.maxDamping,a),e=Y(b.minDuration,b.maxDuration,N(e)),a<1?(i=c=>{const u=c*a,f=u*e,d=u-n,m=it(c,a),g=Math.exp(-f);return st-d/m*g},r=c=>{const f=c*a*e,d=f*n+n,m=Math.pow(a,2)*Math.pow(c,2)*e,g=Math.exp(-f),p=it(Math.pow(c,2),a);return(-i(c)+st>0?-1:1)*((d-m)*g)/p}):(i=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-st+u*f},r=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const o=5/e,l=Bs(i,r,o);if(e=O(e),isNaN(l))return{stiffness:b.stiffness,damping:b.damping,duration:e};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:a*2*Math.sqrt(s*c),duration:e}}}const Is=12;function Bs(e,t,n){let s=n;for(let i=1;i<Is;i++)s=s-e(s)/t(s);return s}function it(e,t){return e*Math.sqrt(1-t*t)}const $s=["duration","bounce"],js=["stiffness","damping","mass"];function sn(e,t){return t.some(n=>e[n]!==void 0)}function Ys(e){let t={velocity:b.velocity,stiffness:b.stiffness,damping:b.damping,mass:b.mass,isResolvedFromDuration:!1,...e};if(!sn(e,js)&&sn(e,$s))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*Y(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:b.mass,stiffness:i,damping:r}}else{const n=Ws(e);t={...t,...n,mass:b.mass},t.isResolvedFromDuration=!0}return t}function me(e=b.visualDuration,t=b.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:f,velocity:d,isResolvedFromDuration:m}=Ys({...n,velocity:-N(n.velocity||0)}),g=d||0,p=c/(2*Math.sqrt(l*u)),v=a-r,S=N(Math.sqrt(l/u)),k=Math.abs(v)<5;s||(s=k?b.restSpeed.granular:b.restSpeed.default),i||(i=k?b.restDelta.granular:b.restDelta.default);let w;if(p<1){const y=it(S,p);w=x=>{const E=Math.exp(-p*S*x);return a-E*((g+p*S*v)/y*Math.sin(y*x)+v*Math.cos(y*x))}}else if(p===1)w=y=>a-Math.exp(-S*y)*(v+(g+S*v)*y);else{const y=S*Math.sqrt(p*p-1);w=x=>{const E=Math.exp(-p*S*x),T=Math.min(y*x,300);return a-E*((g+p*S*v)*Math.sinh(T)+y*v*Math.cosh(T))/y}}const M={calculatedDuration:m&&f||null,next:y=>{const x=w(y);if(m)o.done=y>=f;else{let E=y===0?g:0;p<1&&(E=y===0?O(g):nn(w,y,x));const T=Math.abs(E)<=s,F=Math.abs(a-x)<=i;o.done=T&&F}return o.value=o.done?a:x,o},toString:()=>{const y=Math.min(Ve(M),he),x=nt(E=>M.next(y*E).value,y,30);return y+"ms "+x},toTransition:()=>{}};return M}me.applyToOptions=e=>{const t=tn(e,100,me);return e.ease=t.ease,e.duration=O(t.duration),e.type="keyframes",e};function Pe({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],d={done:!1,value:f},m=T=>o!==void 0&&T<o||l!==void 0&&T>l,g=T=>o===void 0?l:l===void 0||Math.abs(o-T)<Math.abs(l-T)?o:l;let p=n*t;const v=f+p,S=a===void 0?v:a(v);S!==v&&(p=S-f);const k=T=>-p*Math.exp(-T/s),w=T=>S+k(T),M=T=>{const F=k(T),K=w(T);d.done=Math.abs(F)<=c,d.value=d.done?S:K};let y,x;const E=T=>{m(d.value)&&(y=T,x=me({keyframes:[d.value,g(d.value)],velocity:nn(w,T,d.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:T=>{let F=!1;return!x&&y===void 0&&(F=!0,M(T),E(T)),y!==void 0&&T>=y?x.next(T-y):(!F&&M(T),d)}}}function Us(e,t,n){const s=[],i=n||re.mix||tt,r=e.length-1;for(let a=0;a<r;a++){let o=i(e[a],e[a+1]);if(t){const l=Array.isArray(t)?t[a]||ae:t;o=_e(l,o)}s.push(o)}return s}function rt(e,t,{clamp:n=!0,ease:s,mixer:i}={}){const r=e.length;if(ze(r===t.length,"Both input and output ranges must be the same length","range-length"),r===1)return()=>t[0];if(r===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=Us(t,s,i),l=o.length,c=u=>{if(a&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const d=Wt(e[f],e[f+1],u);return o[f](d)};return n?u=>c(Y(e[0],e[r-1],u)):c}function rn(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=Wt(0,t,s);e.push(de(n,1,i))}}function an(e){const t=[0];return rn(t,e.length-1),t}function on(e,t){return e.map(n=>n*t)}function ln(e,t){return e.map(()=>t||rs).splice(0,e.length-1)}function ee({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=as(s)?s.map(Ge):Ge(s),r={done:!1,value:t[0]},a=on(n&&n.length===t.length?n:an(t),e),o=rt(a,t,{ease:Array.isArray(i)?i:ln(t,i)});return{calculatedDuration:e,next:l=>(r.value=o(l),r.done=l>=e,r)}}const _s=e=>e!==null;function at(e,{repeat:t,repeatType:n="loop"},s,i=1){const r=e.filter(_s),o=i<0||t&&n!=="loop"&&t%2===1?0:r.length-1;return!o||s===void 0?r[o]:s}const zs={decay:Pe,inertia:Pe,tween:ee,keyframes:ee,spring:me};function cn(e){typeof e.type=="string"&&(e.type=zs[e.type])}class ot{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Gs=e=>e/100;class pe extends ot{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==R.now()&&this.tick(R.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},$.mainThread++,this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;cn(t);const{type:n=ee,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:a=0}=t;let{keyframes:o}=t;const l=n||ee;l!==ee&&typeof o[0]!="number"&&(this.mixKeyframes=_e(Gs,tt(o[0],o[1])),o=[0,100]);const c=l({...t,keyframes:o});r==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Ve(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:d,repeatDelay:m,type:g,onUpdate:p,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const S=this.currentTime-c*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?S<0:S>i;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,M=s;if(f){const T=Math.min(this.currentTime,i)/o;let F=Math.floor(T),K=T%1;!K&&T>=1&&(K=1),K===1&&F--,F=Math.min(F,f+1),F%2&&(d==="reverse"?(K=1-K,m&&(K-=m/o)):d==="mirror"&&(M=a)),w=Y(0,1,K)*o}const y=k?{done:!1,value:u[0]}:M.next(w);r&&(y.value=r(y.value));let{done:x}=y;!k&&l!==null&&(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&x);return E&&g!==Pe&&(y.value=at(u,this.options,v,this.speed)),p&&p(y.value),E&&this.finish(),y}then(t,n){return this.finished.then(t,n)}get duration(){return N(this.calculatedDuration)}get time(){return N(this.currentTime)}set time(t){t=O(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(R.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=N(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Ns,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(R.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&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,$.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Xs(e){return new pe(e)}function un(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const G=e=>e*180/Math.PI,lt=e=>{const t=G(Math.atan2(e[1],e[0]));return ct(t)},Zs={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:lt,rotateZ:lt,skewX:e=>G(Math.atan(e[1])),skewY:e=>G(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ct=e=>(e=e%360,e<0&&(e+=360),e),fn=lt,dn=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),hn=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Hs={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:dn,scaleY:hn,scale:e=>(dn(e)+hn(e))/2,rotateX:e=>ct(G(Math.atan2(e[6],e[5]))),rotateY:e=>ct(G(Math.atan2(-e[2],e[0]))),rotateZ:fn,rotate:fn,skewX:e=>G(Math.atan(e[4])),skewY:e=>G(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ut(e){return e.includes("scale")?1:0}function Re(e,t){if(!e||e==="none")return ut(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Hs,i=n;else{const o=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Zs,i=o}if(!i)return ut(t);const r=s[t],a=i[1].split(",").map(Qs);return typeof r=="function"?r(a):a[r]}const qs=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Re(n,t)};function Qs(e){return parseFloat(e.trim())}const te=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mn=new Set(te),pn=e=>e===U||e===h,Js=new Set(["x","y","z"]),ei=te.filter(e=>!Js.has(e));function ti(e){const t=[];return ei.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const X={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Re(t,"x"),y:(e,{transform:t})=>Re(t,"y")};X.translateX=X.x,X.translateY=X.y;const Z=new Set;let ft=!1,dt=!1,ht=!1;function gn(){if(dt){const e=Array.from(Z).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=ti(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,a])=>{s.getValue(r)?.set(a)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}dt=!1,ft=!1,Z.forEach(e=>e.complete(ht)),Z.clear()}function yn(){Z.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(dt=!0)})}function Tn(){ht=!0,yn(),gn(),ht=!1}class mt{constructor(t,n,s,i,r,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Z.add(this),ft||(ft=!0,P.read(yn),P.resolveKeyframes(gn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;if(t[0]===null){const r=i?.get(),a=t[t.length-1];if(r!==void 0)t[0]=r;else if(s&&n){const o=s.readValue(n,a);o!=null&&(t[0]=o)}t[0]===void 0&&(t[0]=a),i&&r===void 0&&i.set(t[0])}un(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Z.delete(this)}cancel(){this.state==="scheduled"&&(Z.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const pt=e=>e.startsWith("--");function bn(e,t,n){pt(t)?e.style.setProperty(t,n):e.style[t]=n}const wn=be(()=>window.ScrollTimeline!==void 0),vn={};function ni(e,t){const n=be(e);return()=>vn[t]??n()}const ge=ni(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ne=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,De={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ne([0,.65,.55,1]),circOut:ne([.55,0,1,.45]),backIn:ne([.31,.01,.66,-.59]),backOut:ne([.33,1.53,.69,.99])};function Fe(e,t){if(e)return typeof e=="function"?ge()?nt(e,t):"ease-out":It(e)?ne(e):Array.isArray(e)?e.map(n=>Fe(n,t)||De.easeOut):De[e]}function xn(e,t,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const f=Fe(o,i);Array.isArray(f)&&(u.easing=f),C.value&&$.waapi++;const d={delay:s,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:r+1,direction:a==="reverse"?"alternate":"normal"};c&&(d.pseudoElement=c);const m=e.animate(u,d);return C.value&&m.finished.finally(()=>{$.waapi--}),m}function gt(e){return typeof e=="function"&&"applyToOptions"in e}function yt({type:e,...t}){return gt(e)&&ge()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Oe extends ot{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=!!r,this.allowFlatten=a,this.options=t,ze(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=yt(t);this.animation=xn(n,s,i,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=at(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(u):bn(n,s,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return N(Number(t))}get time(){return N(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=O(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&wn()?(this.animation.timeline=t,ae):n(this)}}const An={anticipate:cs,backInOut:ls,circInOut:os};function si(e){return e in An}function ii(e){typeof e.ease=="string"&&si(e.ease)&&(e.ease=An[e.ease])}const Sn=10;class Mn extends Oe{constructor(t){ii(t),cn(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const o=new pe({...a,autoplay:!1}),l=O(this.finishedTime??this.time);n.setWithVelocity(o.sample(l-Sn).value,o.sample(l).value,Sn),o.stop()}}const En=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(J.test(e)||e==="0")&&!e.startsWith("url("));function ri(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function ai(e,t,n,s){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const r=e[e.length-1],a=En(i,t),o=En(r,t);return Te(a===o,`You are trying to animate ${t} from "${i}" to "${r}". "${a?r:i}" is not an animatable value.`,"value-not-animatable"),!a||!o?!1:ri(e)||(n==="spring"||gt(n))&&s}function Vn(e){e.duration=0,e.type}const oi=new Set(["opacity","clipPath","filter","transform"]),li=be(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Pn(e){const{motionValue:t,name:n,repeatDelay:s,repeatType:i,damping:r,type:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return li()&&n&&oi.has(n)&&(n!=="transform"||!c)&&!l&&!s&&i!=="mirror"&&r!==0&&a!=="inertia"}const ci=40;class ui extends ot{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:a="loop",keyframes:o,name:l,motionValue:c,element:u,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=R.now();const d={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:a,name:l,motionValue:c,element:u,...f},m=u?.KeyframeResolver||mt;this.keyframeResolver=new m(o,(g,p,v)=>this.onKeyframesResolved(g,p,d,!v),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,s,i){this.keyframeResolver=void 0;const{name:r,type:a,velocity:o,delay:l,isHandoff:c,onUpdate:u}=s;this.resolvedAt=R.now(),ai(t,r,a,o)||((re.instantAnimations||!l)&&u?.(at(t,s,n)),t[0]=t[t.length-1],Vn(s),s.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>ci?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},m=!c&&Pn(d)?new Mn({...d,element:d.motionValue.owner.current}):new pe(d);m.finished.then(()=>this.notifyFinished()).catch(ae),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Tn()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Ce{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=n}attachTimeline(t){const n=this.animations.map(s=>s.attachTimeline(t));return()=>{n.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class fi extends Ce{then(t,n){return this.finished.finally(t).then(()=>{})}}class Tt extends Oe{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Rn=new WeakMap,di=(e,t="")=>`${e}:${t}`;function hi(e){const t=Rn.get(e)||new Map;return Rn.set(e,t),t}const mi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Dn(e){const t=mi.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}const pi=4;function bt(e,t,n=1){ze(n<=pi,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,i]=Dn(e);if(!s)return;const r=window.getComputedStyle(t).getPropertyValue(s);if(r){const a=r.trim();return us(a)?parseFloat(a):a}return ve(i)?bt(i,t,n+1):i}function ke(e,t){return e?.[t]??e?.default??e}const Fn=new Set(["width","height","top","left","right","bottom",...te]),gi={test:e=>e==="auto",parse:e=>e},wt=e=>t=>t.test(e),vt=[U,h,_,L,Ut,Yt,gi],xt=e=>vt.find(wt(e));function yi(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||fs(e):!0}const Ti=new Set(["brightness","contrast","saturate","opacity"]);function bi(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Ze)||[];if(!s)return e;const i=n.replace(s,"");let r=Ti.has(t)?1:0;return s!==n&&(r*=100),t+"("+r+i+")"}const wi=/\b([a-z-]*)\(.*?\)/gu,At={...J,getAnimatableNone:e=>{const t=e.match(wi);return t?t.map(bi).join(" "):e}},On={...U,transform:Math.round},Cn={rotate:L,rotateX:L,rotateY:L,rotateZ:L,scale:le,scaleX:le,scaleY:le,scaleZ:le,skew:L,skewX:L,skewY:L,distance:h,translateX:h,translateY:h,translateZ:h,x:h,y:h,z:h,perspective:h,transformPerspective:h,opacity:q,originX:qe,originY:qe,originZ:h},St={borderWidth:h,borderTopWidth:h,borderRightWidth:h,borderBottomWidth:h,borderLeftWidth:h,borderRadius:h,radius:h,borderTopLeftRadius:h,borderTopRightRadius:h,borderBottomRightRadius:h,borderBottomLeftRadius:h,width:h,maxWidth:h,height:h,maxHeight:h,top:h,right:h,bottom:h,left:h,padding:h,paddingTop:h,paddingRight:h,paddingBottom:h,paddingLeft:h,margin:h,marginTop:h,marginRight:h,marginBottom:h,marginLeft:h,backgroundPositionX:h,backgroundPositionY:h,...Cn,zIndex:On,fillOpacity:q,strokeOpacity:q,numOctaves:On},kn={...St,color:A,backgroundColor:A,outlineColor:A,fill:A,stroke:A,borderColor:A,borderTopColor:A,borderRightColor:A,borderBottomColor:A,borderLeftColor:A,filter:At,WebkitFilter:At},Kn=e=>kn[e];function Nn(e,t){let n=Kn(e);return n!==At&&(n=J),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const vi=new Set(["auto","none","0"]);function xi(e,t,n){let s=0,i;for(;s<e.length&&!i;){const r=e[s];typeof r=="string"&&!vi.has(r)&&Q(r).values.length&&(i=e[s]),s++}if(i&&n)for(const r of t)e[r]=Nn(n,i)}class Ai extends mt{constructor(t,n,s,i,r){super(t,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),ve(c))){const u=bt(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Fn.has(s)||t.length!==2)return;const[i,r]=t,a=xt(i),o=xt(r);if(a!==o)if(pn(a)&&pn(o))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else X[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let i=0;i<t.length;i++)(t[i]===null||yi(t[i]))&&s.push(i);s.length&&xi(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=X[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,a=s[r];s[r]=X[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([o,l])=>{t.getValue(o).set(l)}),this.resolveNoneKeyframes()}}const Si=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","backgroundPositionX","backgroundPositionY"]);function Mi(e,t){for(let n=0;n<e.length;n++)typeof e[n]=="number"&&Si.has(t)&&(e[n]=e[n]+"px")}function Ln(e){return!!(typeof e=="function"&&ge()||!e||typeof e=="string"&&(e in De||ge())||It(e)||Array.isArray(e)&&e.every(Ln))}const Ei=be(()=>{try{document.createElement("div").animate({opacity:[1]})}catch{return!1}return!0}),Vi=new Set(["opacity","clipPath","filter","transform"]);function Pi(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}function Ke(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;t&&(s=t.current);const i=n?.[e]??s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Mt(e){return(t,n)=>{const s=Ke(t),i=[];for(const r of s){const a=e(r,n);i.push(a)}return()=>{for(const r of i)r()}}}const Wn=(e,t)=>t&&typeof e=="number"?t.transform(e):e;class Ri{constructor(){this.latest={},this.values=new Map}set(t,n,s,i,r=!0){const a=this.values.get(t);a&&a.onRemove();const o=()=>{const u=n.get();r?this.latest[t]=Wn(u,St[t]):this.latest[t]=u,s&&P.render(s)};o();const l=n.on("change",o);i&&n.addDependent(i);const c=()=>{l(),s&&B(s),this.values.delete(t),i&&n.removeDependent(i)};return this.values.set(t,{value:n,onRemove:c}),c}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function Ne(e){const t=new WeakMap,n=[];return(s,i)=>{const r=t.get(s)??new Ri;t.set(s,r);for(const a in i){const o=i[a],l=e(s,r,a,o);n.push(l)}return()=>{for(const a of n)a()}}}function Di(e,t){if(!(t in e))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set=="function"}const Le=(e,t,n,s)=>{const i=Di(e,n),r=i?n:n.startsWith("data")||n.startsWith("aria")?Pi(n):n,a=i?()=>{e[r]=t.latest[n]}:()=>{const o=t.latest[n];o==null?e.removeAttribute(r):e.setAttribute(r,String(o))};return t.set(n,s,a)},Fi=Mt(Ne(Le)),Oi=Ne((e,t,n,s)=>t.set(n,s,()=>{e[n]=t.latest[n]},void 0,!1));function Et(e){return Bt(e)&&"offsetHeight"in e}const In=30,Ci=e=>!isNaN(parseFloat(e)),ye={current:void 0};class se{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=R.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=R.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Ci(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ds);const s=this.events[t].add(n);return t==="change"?()=>{s(),P.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return ye.current&&ye.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=R.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>In)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,In);return Lt(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Vt(e,t){return new se(e,t)}const ki={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function Ki(e){let t="",n=!0;for(let s=0;s<te.length;s++){const i=te[s],r=e.latest[i];if(r===void 0)continue;let a=!0;if(typeof r=="number"?a=r===(i.startsWith("scale")?1:0):a=parseFloat(r)===0,!a){n=!1;const o=ki[i]||i,l=e.latest[i];t+=`${o}(${l}) `}}return n?"none":t.trim()}const Ni=new Set(["originX","originY","originZ"]),We=(e,t,n,s)=>{let i,r;return mn.has(n)?(t.get("transform")||(!Et(e)&&!t.get("transformBox")&&We(e,t,"transformBox",new se("fill-box")),t.set("transform",new se("none"),()=>{e.style.transform=Ki(t)})),r=t.get("transform")):Ni.has(n)?(t.get("transformOrigin")||t.set("transformOrigin",new se(""),()=>{const a=t.latest.originX??"50%",o=t.latest.originY??"50%",l=t.latest.originZ??0;e.style.transformOrigin=`${a} ${o} ${l}`}),r=t.get("transformOrigin")):pt(n)?i=()=>{e.style.setProperty(n,t.latest[n])}:i=()=>{e.style[n]=t.latest[n]},t.set(n,s,i,r)},Li=Mt(Ne(We)),Pt=h.transform;function Wi(e,t,n,s){return P.render(()=>e.setAttribute("pathLength","1")),n==="pathOffset"?t.set(n,s,()=>e.setAttribute("stroke-dashoffset",Pt(-t.latest[n]))):(t.get("stroke-dasharray")||t.set("stroke-dasharray",new se("1 1"),()=>{const{pathLength:i=1,pathSpacing:r}=t.latest;e.setAttribute("stroke-dasharray",`${Pt(i)} ${Pt(r??1-Number(i))}`)}),t.set(n,s,void 0,t.get("stroke-dasharray")))}const Ii=(e,t,n,s)=>n.startsWith("path")?Wi(e,t,n,s):n.startsWith("attr")?Le(e,t,$i(n),s):(n in e.style?We:Le)(e,t,n,s),Bi=Mt(Ne(Ii));function $i(e){return e.replace(/^attr([A-Z])/,(t,n)=>n.toLowerCase())}const{schedule:Bn,cancel:ji}=Xe(queueMicrotask,!1),D={x:!1,y:!1};function Rt(){return D.x||D.y}function Yi(e){return e==="x"||e==="y"?D[e]?null:(D[e]=!0,()=>{D[e]=!1}):D.x||D.y?null:(D.x=D.y=!0,()=>{D.x=D.y=!1})}function $n(e,t){const n=Ke(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function jn(e){return!(e.pointerType==="touch"||Rt())}function Ui(e,t,n={}){const[s,i,r]=$n(e,n),a=o=>{if(!jn(o))return;const{target:l}=o,c=t(l,o);if(typeof c!="function"||!l)return;const u=f=>{jn(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,i)};return s.forEach(o=>{o.addEventListener("pointerenter",a,i)}),r}const Dt=(e,t)=>t?e===t?!0:Dt(e,t.parentElement):!1,Yn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,_i=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function zi(e){return _i.has(e.tagName)||e.tabIndex!==-1}const Ie=new WeakSet;function Un(e){return t=>{t.key==="Enter"&&e(t)}}function Ft(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Gi=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=Un(()=>{if(Ie.has(n))return;Ft(n,"down");const i=Un(()=>{Ft(n,"up")}),r=()=>Ft(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",r,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function _n(e){return Yn(e)&&!Rt()}function Xi(e,t,n={}){const[s,i,r]=$n(e,n),a=o=>{const l=o.currentTarget;if(!_n(o))return;Ie.add(l);const c=t(l,o),u=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),Ie.has(l)&&Ie.delete(l),_n(m)&&typeof c=="function"&&c(m,{success:g})},f=m=>{u(m,l===window||l===document||n.useGlobalTarget||Dt(l,m.target))},d=m=>{u(m,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",d,i)};return s.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),Et(o)&&(o.addEventListener("focus",c=>Gi(c,i)),!zi(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),r}function Zi(e,t){const n=window.getComputedStyle(e);return pt(t)?n.getPropertyValue(t):n[t]}function Ot(e){return Bt(e)&&"ownerSVGElement"in e}const Be=new WeakMap;let $e;const zn=(e,t,n)=>(s,i)=>i&&i[0]?i[0][e+"Size"]:Ot(s)&&"getBBox"in s?s.getBBox()[t]:s[n],Hi=zn("inline","width","offsetWidth"),qi=zn("block","height","offsetHeight");function Qi({target:e,borderBoxSize:t}){Be.get(e)?.forEach(n=>{n(e,{get width(){return Hi(e,t)},get height(){return qi(e,t)}})})}function Ji(e){e.forEach(Qi)}function er(){typeof ResizeObserver>"u"||($e=new ResizeObserver(Ji))}function tr(e,t){$e||er();const n=Ke(e);return n.forEach(s=>{let i=Be.get(s);i||(i=new Set,Be.set(s,i)),i.add(t),$e?.observe(s)}),()=>{n.forEach(s=>{const i=Be.get(s);i?.delete(t),i?.size||$e?.unobserve(s)})}}const je=new Set;let ie;function nr(){ie=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};je.forEach(t=>t(e))},window.addEventListener("resize",ie)}function sr(e){return je.add(e),ie||nr(),()=>{je.delete(e),!je.size&&typeof ie=="function"&&(window.removeEventListener("resize",ie),ie=void 0)}}function ir(e,t){return typeof e=="function"?sr(e):tr(e,t)}function rr(e,t){let n;const s=()=>{const{currentTime:i}=t,a=(i===null?0:i.value)/100;n!==a&&e(a),n=a};return P.preUpdate(s,!0),()=>B(s)}function Ct(){const{value:e}=C;if(e===null){B(Ct);return}e.frameloop.rate.push(H.delta),e.animations.mainThread.push($.mainThread),e.animations.waapi.push($.waapi),e.animations.layout.push($.layout)}function ar(e){return e.reduce((t,n)=>t+n,0)/e.length}function V(e,t=ar){return e.length===0?{min:0,max:0,avg:0}:{min:Math.min(...e),max:Math.max(...e),avg:t(e)}}const kt=e=>Math.round(1e3/e);function Gn(){C.value=null,C.addProjectionMetrics=null}function or(){const{value:e}=C;if(!e)throw new Error("Stats are not being measured");Gn(),B(Ct);const t={frameloop:{setup:V(e.frameloop.setup),rate:V(e.frameloop.rate),read:V(e.frameloop.read),resolveKeyframes:V(e.frameloop.resolveKeyframes),preUpdate:V(e.frameloop.preUpdate),update:V(e.frameloop.update),preRender:V(e.frameloop.preRender),render:V(e.frameloop.render),postRender:V(e.frameloop.postRender)},animations:{mainThread:V(e.animations.mainThread),waapi:V(e.animations.waapi),layout:V(e.animations.layout)},layoutProjection:{nodes:V(e.layoutProjection.nodes),calculatedTargetDeltas:V(e.layoutProjection.calculatedTargetDeltas),calculatedProjections:V(e.layoutProjection.calculatedProjections)}},{rate:n}=t.frameloop;return n.min=kt(n.min),n.max=kt(n.max),n.avg=kt(n.avg),[n.min,n.max]=[n.max,n.min],t}function lr(){if(C.value)throw Gn(),new Error("Stats are already being measured");const e=C;return e.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},e.addProjectionMetrics=t=>{const{layoutProjection:n}=e.value;n.nodes.push(t.nodes),n.calculatedTargetDeltas.push(t.calculatedTargetDeltas),n.calculatedProjections.push(t.calculatedProjections)},P.postRender(Ct,!0),or}function cr(e){return Ot(e)&&e.tagName==="svg"}function Xn(e,t){if(e==="first")return 0;{const n=t-1;return e==="last"?n:n/2}}function ur(e=.1,{startDelay:t=0,from:n=0,ease:s}={}){return(i,r)=>{const a=typeof n=="number"?n:Xn(n,r),o=Math.abs(a-i);let l=e*o;if(s){const c=r*e;l=Ge(s)(l/c)*c}return t+l}}function Zn(...e){const t=!Array.isArray(e[0]),n=t?0:-1,s=e[0+n],i=e[1+n],r=e[2+n],a=e[3+n],o=rt(i,r,a);return t?o(s):o}function fr(e,t,n){const s=()=>t.set(n()),i=()=>P.preRender(s,!1,!0),r=e.map(a=>a.on("change",i));t.on("destroy",()=>{r.forEach(a=>a()),B(s)})}function Hn(e){const t=[];ye.current=t;const n=e();ye.current=void 0;const s=Vt(n);return fr(t,s,e),s}function dr(e,t,n,s){const i=Zn(t,n,s);return Hn(()=>i(e.get()))}const Kt=e=>!!(e&&e.getVelocity);function hr(e,t){const n=Kt(e)?e.get():e,s=Vt(n);return qn(s,e,t),s}function qn(e,t,n){const s=e.get();let i=null,r=s,a;const o=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,l=()=>{i&&(i.stop(),i=null)},c=()=>{l(),i=new pe({keyframes:[Jn(e.get()),Jn(r)],velocity:e.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:a})};if(e.attach((u,f)=>(r=u,a=d=>f(Qn(d,o)),P.postRender(c),e.get()),l),Kt(t)){const u=t.on("change",d=>e.set(Qn(d,o))),f=e.on("destroy",u);return()=>{u(),f()}}return l}function Qn(e,t){return t?e+t:e}function Jn(e){return typeof e=="number"?e:parseFloat(e)}const mr=[...vt,A,J],pr=e=>mr.find(wt(e));function gr(e){return e==="layout"?"group":e==="enter"||e==="new"?"new":e==="exit"||e==="old"?"old":"group"}let Ye={},W=null;const Ue={set:(e,t)=>{Ye[e]=t},commit:()=>{W||(W=document.createElement("style"),W.id="motion-view");let e="";for(const t in Ye){const n=Ye[t];e+=`${t} {
`;for(const[s,i]of Object.entries(n))e+=`  ${s}: ${i};
`;e+=`}
`}W.textContent=e,document.head.appendChild(W),Ye={}},remove:()=>{W&&W.parentElement&&W.parentElement.removeChild(W)}};function es(e){const t=e.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return t?{layer:t[2],type:t[1]}:null}function yr(e){const{effect:t}=e;return t?t.target===document.documentElement&&t.pseudoElement?.startsWith("::view-transition"):!1}function ts(){return document.getAnimations().filter(yr)}function Tr(e,t){return t.has(e)&&Object.keys(t.get(e)).length>0}const br=["layout","enter","exit","new","old"];function wr(e){const{update:t,targets:n,options:s}=e;if(!document.startViewTransition)return new Promise(async r=>{await t(),r(new Ce([]))});Tr("root",n)||Ue.set(":root",{"view-transition-name":"none"}),Ue.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),Ue.commit();const i=document.startViewTransition(async()=>{await t()});return i.finished.finally(()=>{Ue.remove()}),new Promise(r=>{i.ready.then(()=>{const a=ts(),o=[];n.forEach((l,c)=>{for(const u of br){if(!l[u])continue;const{keyframes:f,options:d}=l[u];for(let[m,g]of Object.entries(f)){if(!g)continue;const p={...ke(s,m),...ke(d,m)},v=gr(u);m==="opacity"&&!Array.isArray(g)&&(g=[v==="new"?0:1,g]),typeof p.delay=="function"&&(p.delay=p.delay(0,1)),p.duration&&(p.duration=O(p.duration)),p.delay&&(p.delay=O(p.delay));const S=new Oe({...p,element:document.documentElement,name:m,pseudoElement:`::view-transition-${v}(${c})`,keyframes:g});o.push(S)}}});for(const l of a){if(l.playState==="finished")continue;const{effect:c}=l;if(!c||!(c instanceof KeyframeEffect))continue;const{pseudoElement:u}=c;if(!u)continue;const f=es(u);if(!f)continue;const d=n.get(f.layer);if(d)ns(d,"enter")&&ns(d,"exit")&&c.getKeyframes().some(m=>m.mixBlendMode)?o.push(new Tt(l)):l.cancel();else{const m=f.type==="group"?"layout":"";let g={...ke(s,m)};g.duration&&(g.duration=O(g.duration)),g=yt(g);const p=Fe(g.ease,g.duration);c.updateTiming({delay:O(g.delay??0),duration:g.duration,easing:p}),o.push(new Tt(l))}}r(new Ce(o))})})}function ns(e,t){return e?.[t]?.keyframes.opacity}let I=[],Nt=null;function ss(){Nt=null;const[e]=I;e&&vr(e)}function vr(e){hs(I,e),Nt=e,wr(e).then(t=>{e.notifyReady(t),t.finished.finally(ss)})}function xr(){for(let e=I.length-1;e>=0;e--){const t=I[e],{interrupt:n}=t.options;if(n==="immediate"){const s=I.slice(0,e+1).map(r=>r.update),i=I.slice(e+1);t.update=()=>{s.forEach(r=>r())},I=[t,...i];break}}(!Nt||I[0]?.options.interrupt==="immediate")&&ss()}function Ar(e){I.push(e),Bn.render(xr)}class is{constructor(t,n={}){this.currentSubject="root",this.targets=new Map,this.notifyReady=ae,this.readyPromise=new Promise(s=>{this.notifyReady=s}),this.update=t,this.options={interrupt:"wait",...n},Ar(this)}get(t){return this.currentSubject=t,this}layout(t,n){return this.updateTarget("layout",t,n),this}new(t,n){return this.updateTarget("new",t,n),this}old(t,n){return this.updateTarget("old",t,n),this}enter(t,n){return this.updateTarget("enter",t,n),this}exit(t,n){return this.updateTarget("exit",t,n),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,n,s={}){const{currentSubject:i,targets:r}=this;r.has(i)||r.set(i,{});const a=r.get(i);a[t]={keyframes:n,options:s}}then(t,n){return this.readyPromise.then(t,n)}}function Sr(e,t={}){return new is(e,t)}const Mr=P,Er=oe.reduce((e,t)=>(e[t]=n=>B(n),e),{});export{ui as AsyncMotionValueAnimation,Ai as DOMKeyframesResolver,Ce as GroupAnimation,fi as GroupAnimationWithThen,pe as JSAnimation,mt as KeyframeResolver,se as MotionValue,Oe as NativeAnimation,Mn as NativeAnimationExtended,Tt as NativeAnimationWrapper,is as ViewTransitionBuilder,Vi as acceleratedValues,$ as activeAnimations,Le as addAttrValue,We as addStyleValue,q as alpha,Q as analyseComplexValue,Xs as animateValue,Sr as animateView,di as animationMapKey,yt as applyGeneratorOptions,Mi as applyPxDefaults,qn as attachSpring,Fi as attrEffect,Ve as calcGeneratorDuration,B as cancelFrame,ji as cancelMicrotask,Er as cancelSync,ye as collectMotionValues,A as color,J as complex,on as convertOffsetToTimes,tn as createGeneratorEasing,Xe as createRenderBatcher,ne as cubicBezierAsString,ln as defaultEasing,an as defaultOffset,ut as defaultTransformValue,kn as defaultValueTypes,L as degrees,vt as dimensionValueTypes,rn as fillOffset,un as fillWildcards,xt as findDimensionValueType,pr as findValueType,Tn as flushKeyframeResolvers,P as frame,H as frameData,gs as frameSteps,nt as generateLinearEasing,Nn as getAnimatableNone,hi as getAnimationMap,Zi as getComputedStyle,Kn as getDefaultValueType,Ee as getMixer,Xn as getOriginIndex,Wn as getValueAsType,ke as getValueTransition,bt as getVariableValue,es as getViewAnimationLayerInfo,ts as getViewAnimations,Ae as hex,Ui as hover,z as hsla,Ht as hslaToRgba,Pe as inertia,rt as interpolate,Me as invisibleValues,Ts as isCSSVariableName,ve as isCSSVariableToken,Rt as isDragActive,D as isDragging,gt as isGenerator,Et as isHTMLElement,Kt as isMotionValue,Dt as isNodeOrChild,Yn as isPrimaryPointer,Ot as isSVGElement,cr as isSVGSVGElement,Ln as isWaapiSupportedEasing,ee as keyframes,Vn as makeAnimationInstant,Fe as mapEasingToNativeEasing,dr as mapValue,he as maxGeneratorDuration,Bn as microtask,tt as mix,et as mixArray,Je as mixColor,en as mixComplex,fe as mixImmediate,Se as mixLinearColor,de as mixNumber,Jt as mixObject,Qt as mixVisibility,Vt as motionValue,U as number,St as numberValueTypes,rr as observeTimeline,Dn as parseCSSVariable,Re as parseValueFromTransform,_ as percent,Fn as positionalKeys,Xi as press,qe as progressPercentage,Oi as propEffect,h as px,qs as readTransformValue,lr as recordStats,ir as resize,Ke as resolveElements,xe as rgbUnit,j as rgba,le as scale,Yi as setDragLock,bn as setStyle,me as spring,hr as springValue,ur as stagger,xn as startWaapiAnimation,C as statsBuffer,Li as styleEffect,De as supportedWaapiEasing,Pn as supportsBrowserAnimation,vn as supportsFlags,ge as supportsLinearEasing,Ei as supportsPartialKeyframes,wn as supportsScrollTimeline,Bi as svgEffect,Mr as sync,wt as testValueType,R as time,Zn as transform,te as transformPropOrder,mn as transformProps,Hn as transformValue,Cn as transformValueTypes,Yt as vh,Ut as vw};
//# sourceMappingURL=/sm/0b72ea27b7b4e29553670c016ceea5c6bca712ab0fe60a18f05d1c8ffa4326ef.map