import{jsxs as t,jsx as e}from"react/jsx-runtime";import{createContext as n,useContext as s,useMemo as i,Fragment as r,createElement as o,useRef as a,useInsertionEffect as u,useCallback as l,useLayoutEffect as c,useEffect as h,forwardRef as d,useState as p}from"react";const f=(t,e,n)=>n>e?e:n/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),y=t=>/^0[^.\s]+$/u.test(t);function v(t){let e;return()=>(void 0===e&&(e=t()),e)}const b=t=>t,w=(...t)=>t.reduce((t,e)=>n=>e(t(n))),S=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class T{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>this.remove(t)}remove(t){!function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i1e3*t,M=t=>t/1e3,V=(t,e)=>e?t*(1e3/e):0,x=(t,e,n)=>t*(3*(1-t)*((1-t)*e+t*n)+t*t);function k(t,e,n,s){return t===e&&n===s?b:i=>{let r=0,o=1,a=i;for(let e=0;;e++){a>=r&&a<=o||(a=(r+o)/2);const s=x(a,t,n)-i;if(s*s<1e-28||40===e)break;s>0?o=a:r=a,a-=1e-7*s/(x(a+1e-7,t,n)-i-s)}return x(a,e,s)}}const C=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,E=t=>e=>1-t(1-e),P=k(.33,1.53,.69,.99),F=E(P),D=C(F),I=t=>t>=1?1:(t*=2)<1?.5*F(t):.5*(2-Math.pow(2,-10*(t-1))),O=t=>1-Math.sin(Math.acos(t)),R=E(O),B=C(O),L=k(.42,0,1,1),j=k(0,0,.58,1),N=k(.42,0,.58,1),W=t=>Array.isArray(t)&&"number"==typeof t[0],K={linear:b,easeIn:L,easeInOut:N,easeOut:j,circIn:O,circInOut:B,circOut:R,backIn:F,backInOut:D,backOut:P,anticipate:I},U=t=>{if(W(t)){t.length;const[e,n,s,i]=t;return k(e,n,s,i)}return"string"==typeof t?K[t]:t},$=n({}),Y=n({strict:!1}),X=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),H=n({}),_={delta:0,timestamp:0,isProcessing:!1};let z;function q(){z=void 0}const Z={now:()=>(void 0===z&&Z.set(_.isProcessing||m.useManualTiming?_.timestamp:performance.now()),z),set:t=>{z=t,queueMicrotask(q)}},G=t=>Math.round(1e5*t)/1e5,J=t=>e=>"string"==typeof e&&e.startsWith(t),Q=J("--"),tt=J("var(--"),et=t=>!!tt(t)&&nt.test(t.split("/*")[0].trim()),nt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function st(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const it={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},rt={...it,transform:t=>f(0,1,t)},ot={...it,default:1},at=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ut=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,lt=(t,e)=>n=>Boolean("string"==typeof n&&ut.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),ct=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(at);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ht={...it,transform:t=>Math.round((t=>f(0,255,t))(t))},dt={test:lt("rgb","red"),parse:ct("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ht.transform(t)+", "+ht.transform(e)+", "+ht.transform(n)+", "+G(rt.transform(s))+")"};const pt={test:lt("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:dt.transform},ft=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),mt=ft("deg"),gt=ft("%"),yt=ft("px"),vt=ft("vh"),bt=ft("vw"),wt=(()=>({...gt,parse:t=>gt.parse(t)/100,transform:t=>gt.transform(100*t)}))(),St={test:lt("hsl","hue"),parse:ct("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+gt.transform(G(e))+", "+gt.transform(G(n))+", "+G(rt.transform(s))+")"},Tt={test:t=>dt.test(t)||pt.test(t)||St.test(t),parse:t=>dt.test(t)?dt.parse(t):St.test(t)?St.parse(t):pt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?dt.transform(t):St.transform(t),getAnimatableNone:t=>{const e=Tt.parse(t);return e.alpha=0,Tt.transform(e)}},At=new RegExp(at.source),Mt=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const Vt="number",xt="color",kt=/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+)(?![a-z]*\()/giu;function Ct(t){const e=t.toString();return At.test(e)||Mt.test(e)}function Et(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(kt,t=>(Tt.test(t)?(s.color.push(r),i.push(xt),n.push(Tt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(Vt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:s,types:i}}function Pt({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:Tt.test(n)?Tt.getAnimatableNone(n):n;var n};const Dt={test:function(t){return isNaN(t)&&"string"==typeof t&&(At.test(t)||Mt.test(t))},parse:function(t){return Et(t).values},createTransformer:function(t){return Pt(Et(t))},getAnimatableNone:function(t){const e=Et(t);return Pt(e)(e.values.map((t,n)=>Ft(t,e.split[n])))}};function It(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ot(t,e){return n=>n>0?e:t}const Rt=(t,e,n)=>t+(e-t)*n,Bt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Lt=[pt,dt,St];function jt(t){const e=(n=t,Lt.find(t=>t.test(n)));var n;if(!e)return!1;let s=e.parse(t);return e===St&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=It(a,s,t+1/3),r=It(a,s,t),o=It(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const Nt=(t,e)=>{const n=jt(t),s=jt(e);if(!n||!s)return Ot(t,e);const i={...n};return t=>(i.red=Bt(n.red,s.red,t),i.green=Bt(n.green,s.green,t),i.blue=Bt(n.blue,s.blue,t),i.alpha=Rt(n.alpha,s.alpha,t),dt.transform(i))},Wt=new Set(["none","hidden"]);function Kt(t,e){return n=>Rt(t,e,n)}function Ut(t){return"number"==typeof t?Kt:"string"==typeof t?et(t)?Ot:Tt.test(t)?Nt:Xt:Array.isArray(t)?$t:"object"==typeof t?Tt.test(t)?Nt:Yt:Ot}function $t(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Ut(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in s)n[e]=s[e](t);return n}}const Xt=(t,e)=>{const n=Dt.createTransformer(e),s=Et(t),i=Et(e);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?Wt.has(t)&&!i.values.length||Wt.has(e)&&!s.values.length?function(t,e){return Wt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):w($t(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;iG(Rt(r,o,t))+i}(t,e);if(n)return n}return Ut(t)(t,e)}const zt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function qt(t,e,n={delta:0,timestamp:0,isProcessing:!1}){let s=!1,i=!0;const r=()=>s=!0,o=zt.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new Set;let o={delta:0,timestamp:0,isProcessing:!1};function a(e){r.has(e)&&(n.add(e),t()),e(o)}const u={schedule:(t,i=!1,o=!1)=>{const a=o&&s?e:n;return i&&r.add(t),a.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{if(o=t,s)return void(i=!0);s=!0;const r=e;e=n,n=r,e.forEach(a),e.clear(),s=!1,i&&(i=!1,u.process(t))}};return u}(r),t),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:d,render:p,postRender:f}=o,g=()=>{const r=m.useManualTiming,o=r?n.timestamp:performance.now();s=!1,r||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,40),1)),n.timestamp=o,n.isProcessing=!0,a.process(n),u.process(n),l.process(n),c.process(n),h.process(n),d.process(n),p.process(n),f.process(n),n.isProcessing=!1,s&&e&&(i=!1,t(g))};return{schedule:zt.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(s||(s=!0,i=!0,n.isProcessing||t(g)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Zt.update(e,t),stop:()=>Gt(e),now:()=>_.isProcessing?_.timestamp:Z.now()}},Qt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e=n?1/0:i}const ne=100,se=10,ie=1,re=800,oe=.3,ae=.3,ue={granular:.01,default:2},le={granular:.005,default:.5},ce=.01,he=10,de=.05,pe=t=>t<0?1/Math.max(1+t,de):Math.max(1-t,de);function fe(t,e){if(!(t>1))return 1;const n=Math.sqrt(t*t-1),s=t-n,i=t+n,r=2*n*Math.exp(-e)*(1+e);return ye(t=>i*Math.exp(-s*t)-s*Math.exp(-i*t)-r,t=>Math.exp(-i*t)-Math.exp(-s*t),e)/e}function me(t,e){return t*Math.sqrt(1-e*e)}const ge=12;function ye(t,e,n){let s=n;for(let n=1;n(e?t>=0:t>0)&&t<1/0;function we(t,e){if(be(t,e))return t}function Se(t){const e=we(t.stiffness),n=we(t.damping,!0),s=we(t.mass),i={...t,stiffness:e??ne,damping:n??se,mass:s??ie,isResolvedFromDuration:!1,isTimeDefined:void 0===(e??n??s)&&(void 0!==t.duration||void 0!==t.bounce)};if(i.isTimeDefined){if(t.visualDuration){const e=pe(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*fe(e,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*e*Math.sqrt(i.stiffness)}else Object.assign(i,function({duration:t=re,bounce:e=oe}){let n,s;const i=pe(e);t=f(ce,he,M(t)),i<1?(n=e=>{const n=e*i,s=n*t,r=me(e,i),o=Math.exp(-s);return ve-n/r*o},s=e=>{const s=e*i*t,r=i*i*e*e*t,o=Math.exp(-s),a=me(e*e,i);return(-n(e)+ve>0?-1:1)*-r*o/a}):(n=e=>Math.exp(-e*t)*(e*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*-e));const r=ye(n,s,5/t),o=r*fe(i,r*t),a=o*o;return{stiffness:a,damping:2*i*Math.sqrt(a),duration:A(t)}}(i)),i.isResolvedFromDuration=!0;be(i.stiffness)&&be(i.damping,!0)||(i.stiffness=ne,i.damping=se)}return i}function Te(t=ae,e=oe){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],r={done:!1,value:s},{stiffness:o,damping:a,mass:u,duration:l,isResolvedFromDuration:c,isTimeDefined:h}=Se({...n}),d=t=>h?0:-M(t),p=a/(2*Math.sqrt(o*u)),f=M(Math.sqrt(o/u)),m=p*f,g={target:i,delta:i-s,velocity:d(n.velocity||0)||0,restSpeed:0,restDelta:0},y=()=>{const t=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(t?ue.granular:ue.default),g.restDelta=n.restDelta||(t?le.granular:le.default)};let v,b,w;if(y(),p<1){const t=me(f,p),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{e.A=(g.velocity+m*g.delta)/t,e.sinC=m*e.A+g.delta*t,e.cosC=m*g.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-m*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};v=t=>(n(t),g.target-e.env*(e.A*e.sin+g.delta*e.cos)),b=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===p){v=t=>g.target-Math.exp(-f*t)*(g.delta+(g.velocity+f*g.delta)*t);const t={C:0};w=()=>{t.C=g.velocity+f*g.delta},b=e=>Math.exp(-f*e)*(f*t.C*e-g.velocity)}else{const t=f*Math.sqrt(p*p-1),e=m-t,n=m+t,s=h?1/0:300/t,i=(t,e)=>Math.exp(e>s?-t*s-m*(e-s):-t*e),r={S:0,F:0};w=()=>{const e=(g.velocity+m*g.delta)/t;r.S=(g.delta+e)/2,r.F=(g.delta-e)/2},v=t=>g.target-r.S*i(e,t)-r.F*i(n,t),b=t=>e*r.S*i(e,t)+n*r.F*i(n,t)}w();const S=c&&l||null,T={calculatedDuration:S,retarget:(t,e)=>{g.target=t[t.length-1],g.delta=g.target-t[0],g.velocity=d(e),n.restSpeed&&n.restDelta||y(),T.calculatedDuration=S,r.done=!1,w()},velocity:t=>A(b(t)),next:t=>{const e=v(t);if(c)r.done=t>=l;else{const n=A(b(t));r.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-e)<=g.restDelta}return r.value=r.done?g.target:e,r},toString:()=>{const t=Math.min(ee(T),te),e=Qt(e=>T.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return T}function Ae({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)-f*Math.exp(-t/s),v=t=>{const e=y(t);d.done=Math.abs(e)<=l,d.value=d.done?g:g+e};let b,w;const S=t=>{var e;((e=d.value)u)&&(b=t,w=Te({keyframes:[d.value,p(d.value)],velocity:-y(t)/s*1e3,damping:i,stiffness:r,restDelta:l,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==b||(e=!0,v(t),S(t)),void 0!==b&&t>=b?w.next(t-b):(!e&&v(t),d)}}}function Me(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(e.length,1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const s=[],i=n||m.mix||_t,r=t.length-1;for(let n=0;n{if(o&&n1)for(;sl(f(t[0],t[r-1],e)):l}function Ve(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=S(0,e,s);t.push(Rt(n,1,i))}}(e,t.length-1),e}function xe({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(s)?s.map(U):U(s)||N,r={done:!1,value:e[0]};if(2===e.length&&!Array.isArray(i)&&(!n||2!==n.length||0===n[0]&&1===n[1])){const[n,s]=e,o=n===s?void 0:(m.mix||_t)(n,s);return{calculatedDuration:t,next:e=>(r.value=o?o(i(t>0?f(0,1,e/t):1)):s,r.done=e>=t,r)}}const o=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Ve(e),t),a=Me(o,e,{ease:Array.isArray(i)?i:(u=e,l=i,u.map(()=>l||N).splice(0,u.length-1))});var u,l;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}Te.applyToOptions=t=>{const e=function(t,e=100,n){const{keyframes:s,velocity:i}=t,r=s&&s[s.length-1]-s[0],o=n({...t,velocity:i&&r?i*e/r:i,keyframes:[0,e]}),a=Math.min(ee(o),te);return{type:"keyframes",ease:t=>o.next(a*t).value/e,duration:M(a)}}(t,100,Te);return t.ease=e.ease,t.duration=A(e.duration),t.type="keyframes",t};function ke(t,e,n=0){return e<=0?n:t.velocity?t.velocity(e):function(t,e,n){const s=Math.max(e-5,0);return V(n-t(s),e-s)}(e=>t.next(e).value,e,t.next(e).value)}const Ce=t=>null!==t;function Ee(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ce),o=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==s?s:r[o]}const Pe={decay:Ae,inertia:Ae,tween:xe,keyframes:xe,spring:Te};function Fe(t){"string"==typeof t.type&&(t.type=Pe[t.type])}const De=(t,e)=>e-t>40&&!m.useManualTiming?e:t;function Ie(t,e){return{kind:t,animation:e,timestamp:Z.now(),frameTimestamp:_.timestamp,frameIsProcessing:_.isProcessing}}function Oe(t,e,n){const s=globalThis.__MOTION_INSPECT__;if(s)try{s({...Ie("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Re{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(t,e){return this.finished.then(t,e)}}const Be=t=>t/100,Le=t=>Math.round(1e4*t)/1e4;class je extends Re{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!==Z.now()&&this.tick(Z.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),Oe(this,this.options)}initAnimation(){const{options:t}=this;Fe(t);const{type:e=xe,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:o}=t;const a=e||xe;a!==xe&&"number"!=typeof o[0]&&(this.mixKeyframes=w(Be,_t(o[0],o[1])),o=[0,100]);const u=a(o===t.keyframes?t:{...t,keyframes:o});"mirror"===i&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=ee(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:s,calculatedDuration:i}=this;if(null===this.startTime)return n.next(0);const{delay:r=0,keyframes:o,type:a,onUpdate:u,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=De(this.startTime,t)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const c=this.currentTime-r*(this.playbackSpeed>=0?1:-1),h=this.playbackSpeed>=0?c<0:c>s;this.currentTime=Math.max(c,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);const d=this.generate(this.currentTime,h);let{done:p}=d;h||null===i||(p=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const f=null===this.holdTime&&("finished"===this.state||"running"===this.state&&p);return f&&a!==Ae&&(d.value=Ee(o,this.options,l,this.speed)),u&&u(d.value),f&&this.finish(),d}at(t){return this.holdTime??Le((t-this.startTime)*this.playbackSpeed)}sampleAt(t,e){const{options:n,totalDuration:s}=this,i=this.at(t)-(n.delay||0);return i>=s&&n.type!==Ae?Ee(n.keyframes,n,e?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(t,e){const{generator:n,totalDuration:s,mixKeyframes:i,mirroredGenerator:r,resolvedDuration:o}=this,{keyframes:a,repeat:u,repeatType:l,repeatDelay:c}=this.options;let h,d=t,p=n;if(u){const e=Math.min(t,s)/o;let n=Math.floor(e),i=e%1;!i&&e>=1&&(i=1),1===i&&n--,n=Math.min(n,u+1);Boolean(n%2)&&("reverse"===l?(i=1-i,c&&(i-=c/o)):"mirror"===l&&(p=r)),d=f(0,1,i)*o}return e?(this.delayState.value=a[0],h=this.delayState):h=p.next(d),i&&!e&&(h.value=i(h.value)),h}then(t,e){return this.finished.then(t,e)}get duration(){return M(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+M(t)}get time(){return M(this.currentTime)}set time(t){t=A(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(){return ke(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(Z.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=M(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Jt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime/(this.playbackSpeed||1):this.startTime||(this.startTime=e??(this.pendingStartTime=n)),"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(Z.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 Ne=new Set(["brightness","contrast","saturate","opacity"]);function We(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(at)||[];if(!s)return t;const i=n.replace(s,"");let r=Ne.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Ke=/\b([a-z-]*)\(.*?\)/gu,Ue={...Dt,getAnimatableNone:t=>{const e=t.match(Ke);return e?e.map(We).join(" "):t}},$e={...Dt,getAnimatableNone:t=>{const e=Dt.parse(t);return Dt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Ye={...it,transform:Math.round},Xe={borderWidth:yt,borderTopWidth:yt,borderRightWidth:yt,borderBottomWidth:yt,borderLeftWidth:yt,borderRadius:yt,borderTopLeftRadius:yt,borderTopRightRadius:yt,borderBottomRightRadius:yt,borderBottomLeftRadius:yt,width:yt,maxWidth:yt,height:yt,maxHeight:yt,top:yt,right:yt,bottom:yt,left:yt,inset:yt,insetBlock:yt,insetBlockStart:yt,insetBlockEnd:yt,insetInline:yt,insetInlineStart:yt,insetInlineEnd:yt,padding:yt,paddingTop:yt,paddingRight:yt,paddingBottom:yt,paddingLeft:yt,paddingBlock:yt,paddingBlockStart:yt,paddingBlockEnd:yt,paddingInline:yt,paddingInlineStart:yt,paddingInlineEnd:yt,margin:yt,marginTop:yt,marginRight:yt,marginBottom:yt,marginLeft:yt,marginBlock:yt,marginBlockStart:yt,marginBlockEnd:yt,marginInline:yt,marginInlineStart:yt,marginInlineEnd:yt,fontSize:yt,backgroundPositionX:yt,backgroundPositionY:yt,...{rotate:mt,pathRotation:mt,rotateX:mt,rotateY:mt,rotateZ:mt,scale:ot,scaleX:ot,scaleY:ot,scaleZ:ot,skew:mt,skewX:mt,skewY:mt,distance:yt,translateX:yt,translateY:yt,translateZ:yt,x:yt,y:yt,z:yt,perspective:yt,transformPerspective:yt,opacity:rt,originX:wt,originY:wt,originZ:yt},zIndex:Ye,fillOpacity:rt,strokeOpacity:rt,numOctaves:Ye},He={...Xe,color:Tt,backgroundColor:Tt,outlineColor:Tt,fill:Tt,stroke:Tt,borderColor:Tt,borderTopColor:Tt,borderRightColor:Tt,borderBottomColor:Tt,borderLeftColor:Tt,filter:Ue,WebkitFilter:Ue,mask:$e,WebkitMask:$e},_e=t=>He[t],ze=new Set([Ue,$e]);function qe(t,e){let n=_e(t);return ze.has(n)||(n=Dt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ze=t=>180*t/Math.PI,Ge=t=>{const e=Ze(Math.atan2(t[1],t[0]));return Qe(e)},Je={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ge,rotateZ:Ge,skewX:t=>Ze(Math.atan(t[1])),skewY:t=>Ze(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Qe=t=>((t%=360)<0&&(t+=360),t),tn=t=>Math.hypot(t[0],t[1]),en=t=>Math.hypot(t[4],t[5]),nn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:tn,scaleY:en,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>(tn(t)+en(t))/2,rotateX:t=>Qe(Ze(Math.atan2(t[6],t[5]))),rotateY:t=>Qe(Ze(Math.atan2(-t[2],t[0]))),rotateZ:Ge,rotate:Ge,skewX:t=>Ze(Math.atan(t[4])),skewY:t=>Ze(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function sn(t){return t.includes("scale")?1:0}function rn(t,e){if(!t||"none"===t)return sn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=nn,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Je,i=e}if(!i)return sn(e);const r=s[e],o=i[1].split(",").map(on);return"function"==typeof r?r(o):o[r]}function on(t){return parseFloat(t.trim())}const an=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],un=(()=>new Set([...an,"pathRotation"]))(),ln=t=>t===it||t===yt,cn=new Set(["x","y","z"]),hn=an.filter(t=>!cn.has(t));const dn=new Set(["bottom","right"]);function pn(t,e,n,s,i,r){const o=parseFloat(t);if(!isNaN(o))return o;const{min:a,max:u}=e()[n],l=u-a;return"border-box"===r?l:l-parseFloat(s)-parseFloat(i)}const fn={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:s},i)=>pn(t,i,"x",e,n,s),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:s},i)=>pn(t,i,"y",e,n,s),top:({top:t})=>parseFloat(t),left:({left:t})=>parseFloat(t),bottom:({top:t},e)=>{const{y:n}=e();return parseFloat(t)+(n.max-n.min)},right:({left:t},e)=>{const{x:n}=e();return parseFloat(t)+(n.max-n.min)},x:({transform:t})=>rn(t,"x"),y:({transform:t})=>rn(t,"y")};fn.translateX=fn.x,fn.translateY=fn.y;const mn=new Set;let gn=!1,yn=!1,vn=!1;function bn(){if(yn){const t=[],e=new Set,n=new Set;mn.forEach(s=>{s.needsMeasurement&&(t.push(s),e.add(s.element),dn.has(s.name)&&n.add(s.element))});const s=new Map;n.forEach(t=>{const e=function(t){const e=[];return hn.forEach(n=>{const s=t.getValue(n);if(void 0!==s){const t=s.get(),i=n.startsWith("scale")?1:0;if(t===i)return;e.push([n,t]),s.set(i)}}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}yn=!1,gn=!1,mn.forEach(t=>t.complete(vn)),mn.clear()}function wn(){mn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(yn=!0)})}class Sn{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(mn.add(this),gn||(gn=!0,Zt.read(wn),Zt.resolveKeyframes(bn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=function(t,e,n){if("string"==typeof t){if(g(t)||y(t))return parseFloat(t);if(!Dt.test(t)&&Dt.test(n))return qe(e,n)}return t??void 0}(n.readValue(e,r),e,r);void 0!==s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}!function(t){for(let e=1;et.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const An={};function Mn(t,e){const n=v(t);return()=>An[e]??n()}const Vn=Mn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),xn=Mn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),kn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Cn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:kn([0,.65,.55,1]),circOut:kn([.55,0,1,.45]),backIn:kn([.31,.01,.66,-.59]),backOut:kn([.33,1.53,.69,.99])};function En(t,e){return t?"function"==typeof t?xn()?Qt(t,e):"ease-out":W(t)?kn(t):Array.isArray(t)?t.map(t=>En(t,e)||Cn.easeOut):Cn[t]:void 0}function Pn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){const c={[e]:n};u&&(c.offset=u);const h=En(a,i);Array.isArray(h)&&(c.easing=h);const d={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};return l&&(d.pseudoElement=l),t.animate(c,d)}function Fn(t){return"function"==typeof t&&"applyToOptions"in t}class Dn extends Re{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,t.type;const u=function({type:t,...e}){return Fn(t)&&xn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Pn(e,n,s,u,i),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=Ee(s,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Tn(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},Oe(this,t,u)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return M(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+M(t)}get time(){return M(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=A(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,onAttach:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Vn()?(this.animation.timeline=t,e?.(this.animation),b):n(this)}}const In={anticipate:I,backInOut:D,circInOut:B};function On(t){"string"==typeof t.ease&&t.ease in In&&(t.ease=In[t.ease])}class Rn extends Dn{constructor(t){On(t),Fe(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?(Z.now()-this.startTime)*this.speed:1e3*this.time}sample(t){if(!this.sampler){const{motionValue:t,onUpdate:e,onComplete:n,onPlay:s,onStop:i,element:r,...o}=this.options;this.sampler=new je({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,t)).value}liveValue(){const{state:t}=this;if("running"===t||"paused"===t)return this.sample(this.elapsed())}updateMotionValue(t){const{motionValue:e,element:n,name:s}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const{speed:i}=this,r=this.elapsed(),o="running"===this.state&&i?f(0,10,r):0,a=this.sample(r);n&&s&&Tn(n,s,a),e.setWithVelocity(this.sample(r-o*Math.sign(i)),a,o/Math.abs(i||1))}}const Bn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Dt.test(t)&&"0"!==t||t.startsWith("url(")));function Ln(t){t.duration=0,t.type="keyframes"}const jn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Nn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Wn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Kn=v(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Un(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o,keyframes:a}=t;if(!n||!jn.has(n)&&!Wn.has(n))return!1;const u=e?.owner?.current;if(!(u instanceof HTMLElement||u instanceof SVGElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Kn()&&(jn.has(n)||Wn.has(n)&&function(t){for(let e=0;ee&&"number"==typeof t?e.transform(t):t,Yn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Xn=an.length;function Hn(t,e,n){let s="",i=!0;for(let r=0;rt-e,Zn=(t,e,n)=>{const s=[];for(let i=0;i<=n;i++)s.push(Rt(t,e,i/n));return s},Gn=t=>t.motionValue.owner,Jn=t=>_n.get(t),Qn=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class ts extends je{constructor(t){const e=Gn(t).current,{driver:n=Jt}=t;let s;const i=function(t){const e=Gn(t),{onUpdate:n,transformTemplate:s}=e.getProps();return!(t.isHandoff||n||t.hasOnUpdate||s||"inertia"===t.type||"none"!==(Qn(e,"transform")||"none")||Qn(e,"pathRotation")||e.projection?.isProjecting())}(t);t.driver=t=>{const i=n(t);return{js:i,now:i.now,start:(t=!0)=>{const n=Jn(e);!n||n.isJS?i.start(t):n.schedule(!1,!t)},stop:()=>{i.stop();const t=Jn(e);t&&!t.isFinishing&&t.release(s)}}},super(t),s=this,this.canAccelerate=i;const{stop:r}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),r()}}get group(){return Jn(Gn(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){const{startTime:t,speed:e,totalDuration:n}=this,{delay:s=0,repeatType:i}=this.options;return null!==this.holdTime?[1/0,0]:n===1/0?[t+s/e,this.resolvedDuration*("loop"===i?1:2)/e||1]:[t+(s+n)/e,0]}isAccelerated(){const{group:t,state:e}=this;return t?.tracks.has(this)&&!t.isJS&&this.canAccelerate&&("running"===e||"paused"===e)}liveValue(){return this.isAccelerated()?this.sampleAt(Z.now()):void 0}tween(){const{keyframes:t,type:e,ease:n,times:s,repeat:i,delay:r=0}=this.options,o=W(n)?kn(n):(t=>/^(linear|ease(In|Out|InOut))$/.test(t))(n)&&Cn[n];if(o&&!i&&!s&&2===t.length&&e===xe&&null===this.holdTime){const t=this.startTime+r/this.speed;return[t,t+this.resolvedDuration/this.speed,o]}}boundaries(t,e){const{startTime:n,speed:s,resolvedDuration:i,options:r}=this,{delay:o=0,repeat:a=0,repeatDelay:u=0,repeatType:l,times:c,keyframes:h,type:d}=r,p=(d||xe)===xe?c||Ve(h):[0,1],f=n+o/s,m=[];if(null!==this.holdTime||!(i>0))return m;for(let n=Math.max(0,Math.floor((t-f)*s/i));n<=a;n++){const r=f+n*i/s;if(r>e)break;for(const o of p){const a=r+(n%2&&l&&"loop"!==l?1-o:o)*(i-u)/s;a>t&&a{for(const e of n)if(e.name===t)return!0},f=(e,n)=>{const o={};for(const a of void 0===e?an:r){const r=s.get(a),u=void 0===e?Qn(t,a):r?r.sampleAt(n>e&&!r.timing()[1]?n:e):i[a];void 0!==u&&(o[a]=u)}return o},m=(t,e)=>{let n="";const s=f(t,e);for(const t in s)n+=(Yn[t]||t)+"("+$n(s[t],Xe[t])+") ";return n||"none"},g=(t=f())=>{e.style.transform=Hn(t,{})},y=(t=!0)=>{t&&g(),a.forEach(({animation:t})=>t.cancel()),a=[]},v=(t,e,n=1/0)=>{const s={animation:t,offset:e,end:n};t.startTime=Z.now()+e,n<1/0&&(t.onfinish=()=>{s.isDone=!0,a.some(t=>t.end===1/0)&&(t.cancel(),a=a.filter(t=>t!==s)),E.schedule(!1)}),t.oncancel=()=>a.includes(s)&&E.demote(),a.push(s)},b=(t,e,n)=>{const s=(e,n)=>Math.abs(t(n)-t(e)),i=s(e,n);for(;n-e>.01;){const t=(e+n)/2;s(e,t)>s(t,n)?n=t:e=t}return s(e,n)>i/2?[e,n]:[]},w=(t,e,n,s)=>{const i=Math.min(200,Math.max(2,Math.ceil((n-e)/10)));if(4*s.length>i)return;const r=Zn(e,n,i).concat(s).sort(qn),o=t=>S(e,n,t);let a,u;for(const e of t){const t=r.map(t=>e.numberAt(t)),[n]=t,s=t.map(t=>t-n),i=s[s.length-1],o=s.some(t=>Math.abs(t)*zn>Math.abs(i))?0:i,l=s.map(t=>o?t/o:t);if(o)if(a){if(l.some((t,e)=>!(Math.abs(t-a[e])<=zn)))return}else a=l,u=t=>(e.numberAt(t)-n)/o;else if(l.some(t=>!(Math.abs(t)<=zn)))return}if(!a||a.every((t,e)=>Math.abs(t-o(r[e]))<=zn))return"linear";const l=[],c=(t,e=u(t))=>l.push(Le(e)+" "+Le(100*o(t))+"%");return a.forEach((t,e)=>{e&&Math.abs(t-a[e-1])>.2&&b(u,r[e-1],r[e]).forEach(t=>c(t)),c(r[e],t)}),"linear("+l+")"},T=(t,e,n,s)=>{const i=[e],r=(e,n)=>t.every(t=>!(Math.abs(t.numberAt((e+n)/2)-(t.numberAt(e)+t.numberAt(n))/2)>(t.name.startsWith("scale")?.001:.1))),o=(e,n,s)=>{if(n-e<1||r(e,n))i.push(n);else if(s<4)o(e,(e+n)/2,s+1),o((e+n)/2,n,s+1);else{for(const s of t)i.push(...b(t=>s.numberAt(t),e,n));i.push(n)}},a=Zn(e,n,Math.ceil((n-e)/100));for(const t of s)a.push(t,Math.min(t+.01,n));let u=e;for(const t of a.sort(qn))t>u&&o(u,t,0),u=t;return i.sort(qn)},A=t=>{let e;for(const n of t){const t=n.tween();if(!t||e?.some((e,n)=>n<2?Math.abs(t[n]-e)>1:t[n]!==e))return;e=t}return e},M=(t,n,s,i={fill:"both"},r,o)=>{const a=t.flatMap(t=>t.boundaries(n,s)),u=o||w(t,n,s,a),l=u?[n,s]:T(t,n,s,a),c=l.map(t=>m(t,r));let h={transform:c};return u||(h.offset=l.map(t=>S(n,s,t))),c.every(t=>t===c[0])&&(g(f(n,r)),h=null),e.animate(h,{...i,duration:s-n,easing:u||"linear"})},V=u=>{let l=u,c=0,h=0;const d=[],p=[],f=new Set;s.clear(),o=new Map;for(const t of n){s.set(t.name,t);const[e,n]=t.timing(),i=e===1/0;if(o.set(t,[t.at(u),t.speed,i]),i)t.sync();else{if(t.speed<0)return;if(n){if(c){const t=(e-h)/n;if(Math.abs(n-c)>1||Math.abs(t-Math.round(t))*c>1)return}else c=n,h=e;p.push(t)}else f.add(e);d.push(t),l=Math.max(l,e)}}i={},r=an.filter(e=>{if(s.has(e))return!0;const n=i[e]=Qn(t,e);return void 0!==n&&parseFloat(n)!==(e.startsWith("scale")?1:0)}),y(!1);const m=!c&&A(d);try{if(m&&m[1]>u){const[t,e,n]=m;v(M(d,t,e,void 0,void 0,n),t-u,e-t)}else l>u&&(v(M(d,u,l),0,l-u),f.forEach(t=>t{let e,s=0;for(const i of n){const n=o.get(i);if(!n)return!1;const[r,a,u]=n,l=i.at(t),c=i.timing()[0]===1/0;if(u){if(c&&l===r)continue;return!1}const h=(l-r)/a,d=c?0:i.speed/a;if(void 0===e)e=h,s=d;else if(Math.abs(h-e)>1||d!==s)return!1}if(void 0===e)return!0;if(!a.length)return!1;for(const{offset:t,end:n,isDone:s}of a){const i=e-t;if(n<1/0&&(s?i=n))return!1}for(const{animation:n,offset:i,isDone:r}of a){if(r)continue;const o=e-i;s?(n.playbackRate=s,n.startTime=t-o/s):(n.pause(),n.currentTime=o)}return!0},k=()=>!n.size&&(c=!0,_n.delete(e),E.isJS||y(),!0),C=()=>{const e=Z.now();if(E.isJS||(E.isFinishing=!0,n.forEach(n=>{const[s,r]=n.timing();"running"===n.state&&n.speed>0&&!r&&s<=e+1&&(n.complete(),i[n.name]=Qn(t,n.name),o.has(n)||(u=!0))}),E.isFinishing=!1),l=!1,c)return;if(n.forEach(({state:t},e)=>{"idle"!==t&&"finished"!==t||n.delete(e)}),k())return;for(const t of n)if(!t.canAccelerate)return E.demote(!0);E.isJS&&(E.isJS=!1,u=!0,n.forEach(t=>t.js?.stop()));const s=u,r=h;if(u=h=!1,s||!x(e)){if(r){if(e-d<100)return E.demote();d=e}if(!V(e))return E.demote()}},E={tracks:n,isJS:!1,isFinishing:!1,schedule(t,e){c||(u||(u=t),h||(h=!!e),l||(l=!0,_.isProcessing?Zt.render(C,!1,!0):queueMicrotask(C)))},release(t){const{state:e}=t;"idle"!==e&&"finished"!==e||n.delete(t),k()||E.schedule(!0)},check(){if(!E.isJS)for(const e in i)if(Qn(t,e)!==i[e]&&!p(e))return E.schedule(!0,!0)},demote(t){E.isJS||c||(n.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),E.isJS=!0,o=new Map,y(),n.forEach(t=>"running"===t.state&&t.js?.start()))}};return _n.set(e,E),E}(Gn(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();const{group:t}=this;t&&!t.isJS&&this.canAccelerate&&this.tick(Z.now())}get time(){return this.isAccelerated()?M(f(0,this.totalDuration,this.at(Z.now())-(this.options.delay||0))):super.time}set time(t){super.time=t,this.isAccelerated()&&this.sync()}attachTimeline(t){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(t)}}class es extends Re{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Z.now();const{keyframes:e,name:n,motionValue:s,element:i}=t,r=t;r.autoplay??(r.autoplay=!0),r.delay??(r.delay=0),r.type??(r.type="keyframes"),r.repeat??(r.repeat=0),r.repeatDelay??(r.repeatDelay=0),r.repeatType??(r.repeatType="loop");const o=i?.KeyframeResolver||Sn;this.keyframeResolver=new o(e,(t,e,n)=>this.onKeyframesResolved(t,e,r,!n),n,s,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,s){this.keyframeResolver=void 0;const{name:i,type:r,velocity:o,delay:a,isHandoff:u,onUpdate:l}=n;this.resolvedAt=Z.now();let c=!0;(function(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Bn(i,e),a=Bn(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n{h?.(),this.notifyFinished()};const d=c&&!u&&Un(n),p=!d&&(({name:t,motionValue:e})=>t&&an.includes(t)&&e?.owner?.current instanceof HTMLElement&&Kn()&&xn())(n);let f;if(s&&(d||p||this.resolvedAt!==this.createdAt)&&(n.startTime??(n.startTime=De(this.createdAt,this.resolvedAt))),d){n.element=n.motionValue?.owner?.current;try{f=new Rn(n)}catch{f=new je(n)}}else f=p?new ts(n):new je(n);this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this._animation.finished:super.finished}then(t,e){return this.finished.finally(t).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),vn=!0,wn(),bn(),vn=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function ns(t,e,n,s=0,i=1){const r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,a=(o-1)*s;return"function"==typeof n?n(r,o):1===i?r*s:a-r*s}class ss{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=Z.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Z.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){var n;return"change"===t?this.onChangeSubscribe(e):((n=this.events)[t]||(n[t]=new T)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new T,e.change.add(this.changeSubscriber),this.changeSubscriber=void 0),e.change.add(t)):this.changeSubscriber=t,()=>{this.changeSubscriber===t?this.changeSubscriber=void 0:e.change?.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){Zt.read(()=>{this.changeSubscriber||this.events.change?.getSize()||this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){const t=this.animation?.liveValue?.();return void 0===t?this.current:t}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Z.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return V(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0;let n,s=!1;n=t(()=>{s=!0,this.events.animationComplete?.notify(),this.animation===n&&this.clearAnimation(),e()}),s||(this.animation=n),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function is(t,e){return new ss(t,e)}function rs(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function os(t,e){const n=t?.[e]??t?.default??t;return n!==t?rs(n,t):n}const as={type:"spring",stiffness:500,damping:25,restSpeed:10},us={type:"keyframes",duration:.8},ls={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},cs=(t,{keyframes:e})=>e.length>2?us:un.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:as:ls,hs=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const ds=(t,e,n,s={},i,r)=>o=>{const a=os(s,t)||{},u=a.delay||s.delay||0;let{elapsed:l=0}=s;l-=A(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i,hasOnUpdate:!!a.onUpdate};(function(t){for(const e in t)if(!hs.has(e))return!0;return!1})(a)||Object.assign(c,cs(t,c)),c.duration&&(c.duration=A(c.duration)),c.repeatDelay&&(c.repeatDelay=A(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(Ln(c),0===c.delay&&(h=!0)),(m.instantAnimations||m.skipAnimations||i?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,Ln(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=Ee(c.keyframes,a);if(void 0!==t)return void Zt.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new je(c):new es(c)},ps=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fs(t,e,n=1){const[s,i]=function(t){const e=ps.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return g(t)?parseFloat(t):t}return et(i)?fs(i,e,n+1):i}function ms(t,e,n,s){const i=e=>"function"==typeof e?e(void 0!==n?n:t.custom,...function(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}(s)):e;return"string"==typeof(e=i(e))&&(e=t.variants&&t.variants[e]),i(e)}function gs(t,e,n){return ms(t.getProps(),e,n,t)}const ys=(t,e)=>"exit"===e?t.presenceContext?.custom:void 0,vs=new Set(["width","height","top","left","right","bottom",...an]);function bs(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,is(n))}function ws(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}const Ss=t=>Boolean(t&&t.getVelocity);function Ts(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Ss(s)&&s.add))return n.add(e);if(!n&&m.WillChange){const n=new m.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}function As(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Ms="data-"+As("framerAppearId");function Vs(t){return t.props[Ms]}const xs="undefined"!=typeof window;function ks({protectedKeys:t,needsAnimating:e},n){const s=n in t&&!e[n];return e[n]=!1,s}function Cs(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?rs(r,u):u;const l=r?.reduceMotion,c=r?.skipAnimations;s&&(r=s);const h=[],d=i&&t.animationState?.getState()[i],p=r?.path;p&&(p.animateValues?p.animateValues(e=>t.getValue(e,t.latestValues[e]??0),a,r,n,h):p.animateVisualElement?.(t,a,r,n,h));for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),i=a[e];if(void 0===i||d&&ks(d,e))continue;const o={delay:n,...os(r||{},e)};c&&(o.skipAnimations=!0);const u=s.get();if(void 0!==u&&!s.isAnimating()&&!Array.isArray(i)&&i===u&&!o.velocity){Zt.update(()=>s.set(i));continue}let p=!1;if(xs&&window.MotionHandoffAnimation){const n=Vs(t);if(n){const t=window.MotionHandoffAnimation(n,e,Zt);null!==t&&(o.startTime=t,p=!0)}}Ts(t,e);const f=l??t.shouldReduceMotion;s.start(ds(e,s,i,f&&vs.has(e)?{type:!1}:o,t,p));const m=s.animation;m&&h.push(m)}if(o){const e=()=>Zt.update(()=>{o&&function(t,e){const n=gs(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r)bs(t,e,ws(r[e]))}(t,o)});h.length?Promise.all(h).then(e):e()}return h}function Es(t,e,n={}){const s=gs(t,e,ys(t,n.type)),i=n.transitionOverride||(s?.transition??(t.getDefaultTransition()||{})),r=()=>Promise.all(s?Cs(t,s,n):[]),o=(s=0)=>{const{variantChildren:r}=t,{delayChildren:o=0,staggerChildren:a,staggerDirection:u}=i,l=[];return r?.forEach(t=>{t.notify("AnimationStart",e),l.push(Es(t,e,{...n,delay:s+("function"==typeof o?0:o)+ns(r,t,o,a,u)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(l)},{when:a}=i;return a?"beforeChildren"===a?r().then(()=>o()):o().then(r):Promise.all([r(),o(n.delay)])}const Ps=[it,yt,gt,mt,bt,vt,{test:t=>"auto"===t,parse:t=>t}],Fs=t=>Ps.find((t=>e=>e.test(t))(t));function Ds(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||y(t))}const Is=new Set(["auto","none","0"]);class Os extends Sn{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:t,element:e,motionValue:n}=this,s=t[0]??n?.get();if(!e?.current||void 0===s)return!1;for(let e=0;et.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&this.motionValue?.jump(s,!1)}measureEndState(){const{element:t,unresolvedKeyframes:e}=this;if(!t||!t.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const n=e.length-1,s=e[n];e[n]=this.measure(),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}function Rs(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(un.has(t))o=!0;else if(Q(t))i[t]=n;else{const e=$n(n,Xe[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=Hn(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}const Bs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ls={offset:"strokeDashoffset",array:"strokeDasharray"};const js=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ns(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},u,l,c){if(Rs(t,a,l),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of js)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==s&&(h.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Bs:Ls;t[r.offset]=""+-s,t[r.array]=`${e} ${n}`}(h,i,r,o,!1)}const{schedule:Ws}=qt(queueMicrotask,!1),Ks=!1;function Us(t,e){const n=function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const s=n?.[t]??e.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function $s(t){return!("touch"===t.pointerType||Ks)}function Ys(t,e,n={}){const[s,i,r]=Us(t,n);return s.forEach(t=>{let n,s=!1,r=!1;const o=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",u)},a=t=>{s=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),r&&(r=!1,o(t))},u=t=>{"touch"!==t.pointerType&&(s?r=!0:o(t))};t.addEventListener("pointerenter",s=>{if(!$s(s))return;r=!1;const o=e(t,s);"function"==typeof o&&(n=o,t.addEventListener("pointerleave",u,i))},i),t.addEventListener("pointerdown",()=>{s=!0,window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",a,i)},i)}),r}const Xs=(t,e)=>!!e&&(t===e||Xs(t,e.parentElement)),Hs=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const _s=new WeakSet;function zs(t){return e=>{"Enter"===e.key&&t(e)}}function qs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Zs(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!0}const Gs=new WeakSet;function Js(t,e,n={}){const[s,i,r]=Us(t,n),o=t=>{const s=t.currentTarget;if(!Zs(t))return;if(Gs.has(t))return;_s.add(s),n.stopPropagation&&Gs.add(t);const r=e(s,t),o={...i,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",u,o),window.removeEventListener("pointercancel",l,o),_s.has(s)&&_s.delete(s),Zs(t)&&"function"==typeof r&&r(t,{success:e})},u=t=>{a(t,s===window||s===document||n.useGlobalTarget||Xs(s,t.target))},l=t=>{a(t,!1)};window.addEventListener("pointerup",u,o),window.addEventListener("pointercancel",l,o)};return s.forEach(t=>{var e,s;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,i),"object"==typeof(s=e=t)&&null!==s&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=zs(()=>{if(_s.has(n))return;qs(n,"down");const t=zs(()=>{qs(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>qs(n,"cancel"),e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)})(t,i)),function(t){return Hs.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}const Qs=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ti=new WeakMap;function ei(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ni(t){return"string"==typeof t||Array.isArray(t)}const si=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ii=["initial",...si];function ri(t){if(ei(t.animate))return!0;for(let e=0;ethis.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=Z.now();this.renderScheduledAte.delete(this)}}this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(ui.current||function(){if(ui.current=!0,li)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ai.current=t.matches;t.addEventListener("change",e),e()}else ai.current=!1}(),this.shouldReduceMotion=ai.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Gt(this.notifyUpdate),Gt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&jn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:s,times:i,ease:r,duration:o}=e.accelerate,a=new Dn({element:this.current,name:t,keyframes:s,times:i,ease:r,duration:A(o)}),u=n(a);return void this.valueSubscriptions.set(t,()=>{u(),a.cancel()})}const n=un.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Zt.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),_n.get(this.current)?.check()),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return this.current&&t.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in hi){const e=hi[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){const{transformTemplate:n,onUpdate:s}=this.props;(t.transformTemplate||n)&&this.scheduleRender(),(t.transformTemplate&&!n||t.onUpdate&&!s)&&_n.get(this.current)?.demote(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e{this.current&&(this.current.textContent=`${t}`)}))}}class mi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function gi(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];for(o in i?.applyProjectionStyles(r,s),n)r.setProperty(o,n[o])}const yi={};function vi(t,{layout:e,layoutId:n}){return un.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!yi[t]||"opacity"===t)}function bi(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const e in s)(Ss(s[e])||i&&Ss(i[e])||vi(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=s[e]);return r}class wi extends fi{constructor(){super(...arguments),this.type="html",this.renderInstance=gi}mount(t){Boolean(t.style),super.mount(t)}readValueFromInstance(t,e){if(un.has(e))return this.projection?.isProjecting?sn(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return rn(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(Q(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){Rs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return bi(t,e,n)}}const Si=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"]),Ti=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ai(t,e,n){const s=bi(t,e,n);for(const n in t)if("children"!==n&&(Ss(t[n])||Ss(e[n]))){s[-1!==an.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return s}class Mi extends fi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Qs}getBaseTargetFromProps(t,e){return un.has(e)?super.getBaseTargetFromProps(t,e)??sn(e):t[e]}getDefaultValue(t){return un.has(t)?this.latestValues[t]??sn(t):void 0}readValueFromInstance(t,e){if(un.has(e)){const t=_e(e);return t&&t.default||0}if(js.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Si.has(e)?e:As(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Ai(t,e,n)}build(t,e,n){Ns(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,s){!function(t,e,n,s){gi(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Si.has(n)?n:As(n),e.attrs[n])}(t,e,0,s)}mount(t){this.isSVGTag=Ti(t.tagName),super.mount(t)}}function Vi(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;sPromise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){return t.notify("AnimationStart",e),(Array.isArray(e)?Promise.all(e.map(e=>Es(t,e,n))):"string"==typeof e?Es(t,e,n):Promise.all(Cs(t,gs(t,e,n.custom),n))).then(()=>{t.notify("AnimationComplete",e)})}(t,e,n))),n=Ci(),s=!0,i=!1;function r(r){const{props:o,parent:a,manuallyAnimateOnMount:u}=t,l=s||i,c=[],h=new Set;let d={},p=1/0,f=t;do{f=!1!==f.props.inherit&&f.parent}while(f&&!f.isControllingVariants);if(xi.forEach((e,s)=>{const i=n[e],m=o[e],g=f&&f.props[e],y=void 0!==m?m:ni(g)||!1===g?g:void 0,v=ni(y),b=e===r?i.isActive:null;!1===b&&(p=s);const w=v&&void 0===m&&!(l&&u);if(i.protectedKeys={...d},!i.isActive&&null===b||!y&&!i.prevProp||ei(y)||"boolean"==typeof y)return;if("exit"===e&&i.isActive&&!0!==b)return void(d={...d,...i.prevResolvedValues});const S=function(t,e){if("string"==typeof e)return e!==t;if(Array.isArray(e))return!Vi(e,t);return!1}(i.prevProp,y);let T=S||v&&(b&&!w||s>p),A=!1;const M=Array.isArray(y)?y:[y];let V={};if(!1!==b)for(const n of M){const{transition:s,transitionEnd:i,...r}=gs(t,n,ys(t,e))||{};V={...V,...r,...i}}const{prevResolvedValues:x}=i;for(const e in{...x,...V}){if(e in d)continue;const n=V[e],s=x[e],r=Array.isArray(n)&&Array.isArray(s)?!Vi(n,s)||S:n!==s;if(r&&null==n)h.add(e);else if(r||void 0!==n&&h.has(e)){T=!0,h.delete(e)&&(A=!0),i.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)}else i.protectedKeys[e]=!0}if(i.prevProp=y,i.prevResolvedValues=V,i.isActive&&(d={...d,...V}),T&&(!w||!S||A))for(const n of M){const s={type:e};if("string"==typeof n&&l&&u&&a?.enteringChildren){const e=gs(a,n)?.transition?.delayChildren;s.delay=ns(a.enteringChildren,t,e)}c.push({animation:n,options:s})}}),h.size){const{initial:e}=o,n={},s="boolean"!=typeof e&&gs(t,Array.isArray(e)?e[0]:e,t.presenceContext?.custom);s&&s.transition&&(n.transition=s.transition),h.forEach(i=>{const r=t.getValue(i);r&&(r.liveStyle=!0);const a=s&&!Array.isArray(e)?s[i]:void 0,u=t.getBaseTargetFromProps(o,i);n[i]=(void 0!==a?a:void 0===u||Ss(u)?void 0===t.initialValues[i]?t.baseTarget[i]:void 0:u)??null}),c.push({animation:n})}const m=l&&t.blockInitialAnimation||s&&!u&&(!1===o.initial||o.initial===o.animate);return s=i=!1,!m&&c.length?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,s){if(n[e].isActive===s)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,s)),n[e].isActive=s;const i=r(e);for(const t in n)n[t].protectedKeys={};return i},setAnimateFunction:n=>{e=n(t)},getState:()=>n,reset:()=>{n=Ci(),i=!0}}}function Ci(){const t={};for(const e of si)t[e]={isActive:"animate"===e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return t}function Ei(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n,s)}function Pi(t){return Ss(t)?t.get():t}function Fi(t){const{initial:e,animate:n}=function(t,e){if(ri(t)){const{initial:e,animate:n}=t;return{initial:!1===e||ni(e)?e:void 0,animate:ni(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,s(H));return i(()=>({initial:e,animate:n}),[Di(e),Di(n)])}function Di(t){return Array.isArray(t)?t.join(" "):t}const Ii=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Oi(t,e,n){for(const s in e)Ss(e[s])||vi(s,n)||(t[s]=e[s])}function Ri(t,e){const n={};return Oi(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return i(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Rs(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Bi(t,e){const n={},s=Ri(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const Li=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function ji(t,e,n,s){const r=i(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Ns(n,e,Ti(s),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Oi(e,t.style,t),r.style={...e,...r.style}}return r}const Ni=new Set(["animate","exit","variants","initial","style","values","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 Wi(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ni.has(t)}function Ki(t,e){return t.startsWith("on")?!Wi(t):e?.(t)??!Wi(t)}const Ui=["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 $i(t){return"string"==typeof t&&!t.includes("-")&&!!(Ui.indexOf(t)>-1||/[A-Z]/u.test(t))}function Yi(t,e,n,{latestValues:s},a,u=!1,l,c){const h=(l??$i(t)?ji:Bi)(e,s,a,t),d=function(t,e,n,s){const i={};for(const r in t)"values"===r&&"object"==typeof t.values||Ss(t[r])||(Ki(r,s)||!0===n&&Wi(r)||!e&&!Wi(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}(e,"string"==typeof t,u,c),p=t!==r?{...d,...h,ref:n}:{},{children:f}=e,m=i(()=>Ss(f)?f.get():f,[f]);return o(t,{...p,children:m})}const Xi=n(null);function Hi(t,e,n,s){const i={},r=s(t,{});for(const t in r)i[t]=Pi(r[t]);let{initial:o,animate:a}=t;const u=ri(t),l=oi(t);e&&l&&!u&&!1!==t.inherit&&(void 0===o&&(o=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===o;const h=c?a:o;if(h&&"boolean"!=typeof h&&!ei(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n(e,n)=>{const i=s(H),r=s(Xi),o=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Hi(n,s,i,t),renderState:e()}}(t,e,i,r);return n?o():function(t){const e=a(null);return null===e.current&&(e.current=t()),e.current}(o)},zi=_i({scrapeMotionValuesFromProps:bi,createRenderState:Ii}),qi=_i({scrapeMotionValuesFromProps:Ai,createRenderState:Li}),Zi={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 Gi=!1;function Ji(){return function(){if(Gi)return;const t={};for(const e in Zi)t[e]={isEnabled:t=>Zi[e].some(e=>!!t[e])};di(t),Gi=!0}(),hi}function Qi(t){const e=Ji();for(const n in t)e[n]={...e[n],...t[n]};di(e)}const tr=Symbol.for("motionComponentSymbol");function er(t,e,n){const s=a(n);u(()=>{s.current=n});const i=a(null);return l(n=>{n&&t.onMount?.(n),e&&(n?e.mount(n):e.unmount());const r=s.current;if("function"==typeof r)if(n){const t=r(n);"function"==typeof t&&(i.current=t)}else i.current?(i.current(),i.current=null):r(n);else r&&(r.current=n)},[e])}const nr=n({});function sr(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const ir="undefined"!=typeof window?c:h;function rr(t,e,n,i,r,o){const{visualElement:l}=s(H),c=s(Y),d=s(Xi),p=s(X),f=p.reducedMotion,m=p.skipAnimations,g=a(null),y=a(!1);i=i||c.renderer,!g.current&&i&&(g.current=i(t,{visualState:e,parent:l,props:n,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:f,skipAnimations:m,isSVG:o}),y.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const v=g.current,b=s(nr);!v||v.projection||!r||"html"!==v.type&&"svg"!==v.type||function(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:u,layoutRoot:l,layoutAnchor:c,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:or(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:Boolean(o)||a&&sr(a),visualElement:t,animationType:"string"==typeof r?r:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:u,layoutRoot:l,layoutAnchor:c})}(g.current,n,r,b);const w=a(!1);u(()=>{v&&w.current&&v.update(n,d)});const S=n[Ms],T=a(Boolean(S)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(S)&&window.MotionHasOptimisedAnimation?.(S));return ir(()=>{y.current&&v&&(v.animationState?.animateChanges(),v.enteringChildren=void 0)},[]),ir(()=>{y.current=!0,v&&(w.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),T.current&&v.animationState&&v.animationState.animateChanges())}),h(()=>{v&&(!T.current&&v.animationState&&v.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(S)}),T.current=!1),v.enteringChildren=void 0)}),v}function or(t){if(t)return!1!==t.options.allowProjection?t.projection:or(t.parent)}function ar(n,{forwardMotionProps:i=!1,type:r}={},o,a){const u=r?"svg"===r:$i(n),l=u?qi:zi;function c(r,o){let c;const h={...s(X),...r,layoutId:ur(r)},{isStatic:d,isValidProp:p}=h,f=Fi(r),m=l(r,d);if(!d&&"undefined"!=typeof window){s(Y).strict;const t=function(t){const e=Ji(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(h);c=t.MeasureLayout,f.visualElement=rr(n,m,h,a,t.ProjectionNode,u)}return t(H.Provider,{value:f,children:[c&&f.visualElement?e(c,{visualElement:f.visualElement,...h}):null,Yi(n,r,er(m,f.visualElement,o),m,d,i,u,p)]})}c.displayName=`motion.${"string"==typeof n?n:`create(${n.displayName??n.name??""})`}`;const h=d(c);return h[tr]=n,h}function ur({layoutId:t}){const e=s($).id;return e&&void 0!==t?e+"-"+t:t}function lr(t,e){return ar(t,e)}const cr=lr("div");function hr({children:t,features:n,strict:s=!1}){const[,i]=p(!dr(n)),r=a(void 0);if(!dr(n)){const{renderer:t,...e}=n;r.current=t,Qi(e)}return h(()=>{dr(n)&&n().then(({renderer:t,...e})=>{Qi(e),r.current=t,i(!0)})},[]),e(Y.Provider,{value:{renderer:r.current,strict:s},children:t})}function dr(t){return"function"==typeof t}let pr=0;const fr={animation:{Feature:class extends mi{constructor(t){super(t),t.animationState||(t.animationState=ki(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ei(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 mi{constructor(){super(...arguments),this.id=pr++}update(){const{presenceContext:t,prevPresenceContext:e,animationState:n}=this.node;if(!t||!n)return;const{isPresent:s,onExitComplete:i}=t,r=e?.isPresent;if(s===r)return;if(s&&!1===r){if(!0===this.exit){const{initial:t}=this.node.getProps();if(t&&!Array.isArray(t)){const{transition:e,transitionEnd:n,...s}=gs(this.node,t)||{};for(const t in s)this.node.getValue(t)?.jump(s[t])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive("exit",!1);return void(this.exit=void 0)}const o=this.exit=n.setActive("exit",!s);i&&!s&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id,this.node))}unmount(){}}}};function mr(t){return{point:{x:t.pageX,y:t.pageY}}}function gr(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover","Start"===n);const i=s["onHover"+n];i&&Zt.postRender(()=>i(e,mr(e)))}function yr(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap","Start"===n);const i=s["onTap"+("End"===n?"":n)];i&&Zt.postRender(()=>i(e,mr(e)))}const vr=new WeakMap,br=new WeakMap,wr=t=>{const e=vr.get(t.target);e&&e(t)},Sr=t=>{t.forEach(wr)};function Tr(t,e,n){const s=function({root:t,...e}){const n=t||document;br.has(n)||br.set(n,{});const s=br.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Sr,{root:t,...e})),s[i]}(e);return vr.set(t,n),s.observe(t),()=>{vr.delete(t),s.unobserve(t)}}const Ar={some:0,all:1};const Mr={renderer:(t,e)=>e.isSVG??$i(t)?new Mi(e):new wi(e,{allowProjection:t!==r}),...fr,...{inView:{Feature:class extends mi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Ar[s]};this.stopObserver=Tr(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),r=e?n:s;r&&r(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 n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends mi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=Js(t,(t,e)=>(yr(this.node,e,"Start"),(t,{success:e})=>yr(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends mi{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=w(Ei(this.node.current,"focus",()=>this.onFocus()),Ei(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends mi{mount(){const{current:t}=this.node;t&&(this.unmount=Ys(t,(t,e)=>(gr(this.node,e,"Start"),t=>gr(this.node,t,"End"))))}unmount(){}}}}};export{hr as LazyMotion,cr as MotionDiv,Mr as domAnimation}; //# sourceMappingURL=size-rollup-m-dom-animation.js.map