!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var i=n(e),s=React,o=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(t,e,n){var i,s={},r=null,u=null;for(i in void 0!==n&&(r=""+n),void 0!==e.key&&(r=""+e.key),void 0!==e.ref&&(u=e.ref),e)a.call(e,i)&&!c.hasOwnProperty(i)&&(s[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===s[i]&&(s[i]=e[i]);return{$$typeof:o,type:t,key:r,ref:u,props:s,_owner:l.current}}const h=r,d=u,p=u,f=e.createContext({});function m(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const g="undefined"!=typeof window,y=g?e.useLayoutEffect:e.useEffect,v=e.createContext(null);function x(t,e){-1===t.indexOf(e)&&t.push(e)}function w(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function S([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&in>e?e:n{};const P={},E=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),A=t=>"object"==typeof t&&null!==t,M=t=>/^0[^.\s]+$/u.test(t);function V(t){let e;return()=>(void 0===e&&(e=t()),e)}const C=t=>t,k=(...t)=>t.reduce((t,e)=>n=>e(t(n))),D=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class R{constructor(){this.subscriptions=[]}add(t){return x(this.subscriptions,t),()=>this.remove(t)}remove(t){w(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s1e3*t,B=t=>t/1e3,O=(t,e)=>e?t*(1e3/e):0,j=new Set;function I(t,e,n){t||j.has(e)||(console.warn(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n)),j.add(e))}const F=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},W=(t,e,n)=>t*(3*(1-t)*((1-t)*e+t*n)+t*t);function N(t,e,n,i){return t===e&&n===i?C:s=>{let o=0,r=1,a=s;for(let e=0;;e++){a>=o&&a<=r||(a=(o+r)/2);const i=W(a,t,n)-s;if(i*i<1e-28||40===e)break;i>0?r=a:o=a,a-=1e-7*i/(W(a+1e-7,t,n)-s-i)}return W(a,e,i)}}const U=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,$=t=>e=>1-t(1-e),z=N(.33,1.53,.69,.99),Y=$(z),X=U(Y),H=t=>t>=1?1:(t*=2)<1?.5*Y(t):.5*(2-Math.pow(2,-10*(t-1))),G=t=>1-Math.sin(Math.acos(t)),K=$(G),_=U(G),q=N(.42,0,1,1),Z=N(0,0,.58,1),J=N(.42,0,.58,1);const Q=t=>Array.isArray(t)&&"number"!=typeof t[0];function tt(t,e){return Q(t)?t[F(0,t.length,e)]:t}const et=t=>Array.isArray(t)&&"number"==typeof t[0],nt={linear:C,easeIn:q,easeInOut:J,easeOut:Z,circIn:G,circInOut:_,circOut:K,backIn:Y,backInOut:X,backOut:z,anticipate:H},it=t=>{if(et(t)){t.length;const[e,n,i,s]=t;return N(e,n,i,s)}return"string"==typeof t?nt[t]:t},st={delta:0,timestamp:0,isProcessing:!1};let ot;function rt(){ot=void 0}const at={now:()=>(void 0===ot&&at.set(st.isProcessing||P.useManualTiming?st.timestamp:performance.now()),ot),set:t=>{ot=t,queueMicrotask(rt)}},lt=t=>Math.round(1e5*t)/1e5,ct=t=>e=>"string"==typeof e&&e.startsWith(t),ut=ct("--"),ht=ct("var(--"),dt=t=>!!ht(t)&&pt.test(t.split("/*")[0].trim()),pt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ft(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const mt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},gt={...mt,transform:t=>b(0,1,t)},yt={...mt,default:1},vt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const xt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,wt=(t,e)=>n=>Boolean("string"==typeof n&&xt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),St=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(vt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},bt={...mt,transform:t=>Math.round((t=>b(0,255,t))(t))},Tt={test:wt("rgb","red"),parse:St("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+bt.transform(t)+", "+bt.transform(e)+", "+bt.transform(n)+", "+lt(gt.transform(i))+")"};const Pt={test:wt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:Tt.transform},Et=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),At=Et("deg"),Mt=Et("%"),Vt=Et("px"),Ct=Et("vh"),kt=Et("vw"),Dt=(()=>({...Mt,parse:t=>Mt.parse(t)/100,transform:t=>Mt.transform(100*t)}))(),Rt={test:wt("hsl","hue"),parse:St("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Mt.transform(lt(e))+", "+Mt.transform(lt(n))+", "+lt(gt.transform(i))+")"},Lt={test:t=>Tt.test(t)||Pt.test(t)||Rt.test(t),parse:t=>Tt.test(t)?Tt.parse(t):Rt.test(t)?Rt.parse(t):Pt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Tt.transform(t):Rt.transform(t),getAnimatableNone:t=>{const e=Lt.parse(t);return e.alpha=0,Lt.transform(e)}},Bt=new RegExp(vt.source),Ot=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const jt="number",It="color",Ft=/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 Wt(t){const e=t.toString();return Bt.test(e)||Ot.test(e)}function Nt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Ft,t=>(Lt.test(t)?(i.color.push(o),s.push(It),n.push(Lt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(jt),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Ut({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:Lt.test(n)?Lt.getAnimatableNone(n):n;var n};const zt={test:function(t){return isNaN(t)&&"string"==typeof t&&(Bt.test(t)||Ot.test(t))},parse:function(t){return Nt(t).values},createTransformer:function(t){return Ut(Nt(t))},getAnimatableNone:function(t){const e=Nt(t);return Ut(e)(e.values.map((t,n)=>$t(t,e.split[n])))}};function Yt(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 Xt({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Yt(a,i,t+1/3),o=Yt(a,i,t),r=Yt(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}function Ht(t,e){return n=>n>0?e:t}const Gt=(t,e,n)=>t+(e-t)*n,Kt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},_t=[Pt,Tt,Rt];function qt(t){const e=(n=t,_t.find(t=>t.test(n)));var n;if(!e)return!1;let i=e.parse(t);return e===Rt&&(i=Xt(i)),i}const Zt=(t,e)=>{const n=qt(t),i=qt(e);if(!n||!i)return Ht(t,e);const s={...n};return t=>(s.red=Kt(n.red,i.red,t),s.green=Kt(n.green,i.green,t),s.blue=Kt(n.blue,i.blue,t),s.alpha=Gt(n.alpha,i.alpha,t),Tt.transform(s))},Jt=new Set(["none","hidden"]);function Qt(t,e){return Jt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function te(t,e){return n=>Gt(t,e,n)}function ee(t){return"number"==typeof t?te:"string"==typeof t?dt(t)?Ht:Lt.test(t)?Zt:se:Array.isArray(t)?ne:"object"==typeof t?Lt.test(t)?Zt:ie:Ht}function ne(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>ee(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const se=(t,e)=>{const n=zt.createTransformer(e),i=Nt(t),s=Nt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Jt.has(t)&&!s.values.length||Jt.has(e)&&!i.values.length?Qt(t,e):k(ne(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;slt(Gt(o,r,t))+s}(t,e);if(n)return n}return ee(t)(t,e)}const ae=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function le(t,e,n={delta:0,timestamp:0,isProcessing:!1}){let i=!1,s=!0;const o=()=>i=!0,r=ae.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new Set;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(n.add(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(o),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:p,postRender:f}=r,m=()=>{const o=P.useManualTiming,r=o?n.timestamp:performance.now();i=!1,o||(n.delta=s?1e3/60:Math.max(Math.min(r-n.timestamp,40),1)),n.timestamp=r,n.isProcessing=!0,a.process(n),l.process(n),c.process(n),u.process(n),h.process(n),d.process(n),p.process(n),f.process(n),n.isProcessing=!1,i&&e&&(s=!1,t(m))};return{schedule:ae.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(i||(i=!0,s=!0,n.isProcessing||t(m)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>ce.update(e,t),stop:()=>ue(e),now:()=>st.isProcessing?st.timestamp:at.now()}},pe=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=n?1/0:s}function ge(t,e=100,n){const{keyframes:i,velocity:s}=t,o=i&&i[i.length-1]-i[0],r=n({...t,velocity:s&&o?s*e/o:s,keyframes:[0,e]}),a=Math.min(me(r),fe);return{type:"keyframes",ease:t=>r.next(a*t).value/e,duration:B(a)}}const ye=100,ve=10,xe=1,we=800,Se=.3,be=.3,Te={granular:.01,default:2},Pe={granular:.005,default:.5},Ee=.01,Ae=10,Me=.05,Ve=t=>t<0?1/Math.max(1+t,Me):Math.max(1-t,Me);function Ce(t,e){if(!(t>1))return 1;const n=Math.sqrt(t*t-1),i=t-n,s=t+n,o=2*n*Math.exp(-e)*(1+e);return Re(t=>s*Math.exp(-i*t)-i*Math.exp(-s*t)-o,t=>Math.exp(-s*t)-Math.exp(-i*t),e)/e}function ke(t,e){return t*Math.sqrt(1-e*e)}const De=12;function Re(t,e,n){let i=n;for(let n=1;n(e?t>=0:t>0)&&t<1/0;function Oe(t,e){if(Be(t,e))return t}function je(t){const e=Oe(t.stiffness),n=Oe(t.damping,!0),i=Oe(t.mass),s={...t,stiffness:e??ye,damping:n??ve,mass:i??xe,isResolvedFromDuration:!1,isTimeDefined:void 0===(e??n??i)&&(void 0!==t.duration||void 0!==t.bounce)};if(s.isTimeDefined){if(t.visualDuration){const e=Ve(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*Ce(e,2*Math.PI/1.2);s.stiffness=n*n,s.damping=2*e*Math.sqrt(s.stiffness)}else Object.assign(s,function({duration:t=we,bounce:e=Se}){let n,i;const s=Ve(e);t=b(Ee,Ae,B(t)),s<1?(n=e=>{const n=e*s,i=n*t,o=ke(e,s),r=Math.exp(-i);return Le-n/o*r},i=e=>{const i=e*s*t,o=s*s*e*e*t,r=Math.exp(-i),a=ke(e*e,s);return(-n(e)+Le>0?-1:1)*-o*r/a}):(n=e=>Math.exp(-e*t)*(e*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*-e));const o=Re(n,i,5/t),r=o*Ce(s,o*t),a=r*r;return{stiffness:a,damping:2*s*Math.sqrt(a),duration:L(t)}}(s)),s.isResolvedFromDuration=!0;Be(s.stiffness)&&Be(s.damping,!0)||(s.stiffness=ye,s.damping=ve)}return s}function Ie(t=be,e=Se){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],o={done:!1,value:i},{stiffness:r,damping:a,mass:l,duration:c,isResolvedFromDuration:u,isTimeDefined:h}=je({...n}),d=t=>h?0:-B(t),p=a/(2*Math.sqrt(r*l)),f=B(Math.sqrt(r/l)),m=p*f,g={target:s,delta:s-i,velocity:d(n.velocity||0)||0,restSpeed:0,restDelta:0},y=()=>{const t=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(t?Te.granular:Te.default),g.restDelta=n.restDelta||(t?Pe.granular:Pe.default)};let v,x,w;if(y(),p<1){const t=ke(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)),x=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},x=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,i=h?1/0:300/t,s=(t,e)=>Math.exp(e>i?-t*i-m*(e-i):-t*e),o={S:0,F:0};w=()=>{const e=(g.velocity+m*g.delta)/t;o.S=(g.delta+e)/2,o.F=(g.delta-e)/2},v=t=>g.target-o.S*s(e,t)-o.F*s(n,t),x=t=>e*o.S*s(e,t)+n*o.F*s(n,t)}w();const S=u&&c||null,b={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(),b.calculatedDuration=S,o.done=!1,w()},velocity:t=>L(x(t)),next:t=>{const e=v(t);if(u)o.done=t>=c;else{const n=L(x(t));o.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-e)<=g.restDelta}return o.value=o.done?g.target:e,o},toString:()=>{const t=Math.min(me(b),fe),e=pe(e=>b.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return b}function Fe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-f*Math.exp(-t/i),v=t=>{const e=y(t);d.done=Math.abs(e)<=c,d.value=d.done?g:g+e};let x,w;const S=t=>{var e;((e=d.value)l)&&(x=t,w=Ie({keyframes:[d.value,p(d.value)],velocity:-y(t)/i*1e3,damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==x||(e=!0,v(t),S(t)),void 0!==x&&t>=x?w.next(t-x):(!e&&v(t),d)}}}function We(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(e.length,1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||P.mix||re,o=t.length-1;for(let n=0;n{if(r&&n1)for(;ic(b(t[0],t[o-1],e)):c}function Ne(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=D(0,e,i);t.push(Gt(n,1,s))}}function Ue(t){const e=[0];return Ne(e,t.length-1),e}function $e(t,e){return t.map(t=>t*e)}function ze(t,e){return t.map(()=>e||J).splice(0,t.length-1)}function Ye({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=Q(i)?i.map(it):it(i)||J,o={done:!1,value:e[0]};if(2===e.length&&!Array.isArray(s)&&(!n||2!==n.length||0===n[0]&&1===n[1])){const[n,i]=e,r=n===i?void 0:(P.mix||re)(n,i);return{calculatedDuration:t,next:e=>(o.value=r?r(s(t>0?b(0,1,e/t):1)):i,o.done=e>=t,o)}}const r=We($e(n&&n.length===e.length?n:Ue(e),t),e,{ease:Array.isArray(s)?s:ze(e,s)});return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}Ie.applyToOptions=t=>{const e=ge(t,100,Ie);return t.ease=e.ease,t.duration=L(e.duration),t.type="keyframes",t};function Xe(t,e,n=0){return e<=0?n:t.velocity?t.velocity(e):function(t,e,n){const i=Math.max(e-5,0);return O(n-t(i),e-i)}(e=>t.next(e).value,e,t.next(e).value)}const He=t=>null!==t;function Ge(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(He),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Ke={decay:Fe,inertia:Fe,tween:Ye,keyframes:Ye,spring:Ie};function _e(t){"string"==typeof t.type&&(t.type=Ke[t.type])}const qe=(t,e)=>e-t>40&&!P.useManualTiming?e:t;function Ze(t,e){return{kind:t,animation:e,timestamp:at.now(),frameTimestamp:st.timestamp,frameIsProcessing:st.isProcessing}}function Je(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...Ze("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Qe{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 tn=t=>t/100,en=t=>Math.round(1e4*t)/1e4;class nn extends Qe{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!==at.now()&&this.tick(at.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),Je(this,this.options)}initAnimation(){const{options:t}=this;_e(t);const{type:e=Ye,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Ye;a!==Ye&&"number"!=typeof r[0]&&(this.mixKeyframes=k(tn,re(r[0],r[1])),r=[0,100]);const l=a(r===t.keyframes?t:{...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=me(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:o=0,keyframes:r,type:a,onUpdate:l,finalKeyframe:c}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=qe(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-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const u=this.currentTime-o*(this.playbackSpeed>=0?1:-1),h=this.playbackSpeed>=0?u<0:u>i;this.currentTime=Math.max(u,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);const d=this.generate(this.currentTime,h);let{done:p}=d;h||null===s||(p=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const f=null===this.holdTime&&("finished"===this.state||"running"===this.state&&p);return f&&a!==Fe&&(d.value=Ge(r,this.options,c,this.speed)),l&&l(d.value),f&&this.finish(),d}at(t){return this.holdTime??en((t-this.startTime)*this.playbackSpeed)}sampleAt(t,e){const{options:n,totalDuration:i}=this,s=this.at(t)-(n.delay||0);return s>=i&&n.type!==Fe?Ge(n.keyframes,n,e?void 0:n.finalKeyframe):this.generate(Math.max(s,0),s<0).value}generate(t,e){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r}=this,{keyframes:a,repeat:l,repeatType:c,repeatDelay:u}=this.options;let h,d=t,p=n;if(l){const e=Math.min(t,i)/r;let n=Math.floor(e),s=e%1;!s&&e>=1&&(s=1),1===s&&n--,n=Math.min(n,l+1);Boolean(n%2)&&("reverse"===c?(s=1-s,u&&(s-=u/r)):"mirror"===c&&(p=o)),d=b(0,1,s)*r}return e?(this.delayState.value=a[0],h=this.delayState):h=p.next(d),s&&!e&&(h.value=s(h.value)),h}then(t,e){return this.finished.then(t,e)}get duration(){return B(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(this.currentTime)}set time(t){t=L(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 Xe(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(at.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=B(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=de,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(at.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 sn=new Set(["brightness","contrast","saturate","opacity"]);function on(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(vt)||[];if(!i)return t;const s=n.replace(i,"");let o=sn.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const rn=/\b([a-z-]*)\(.*?\)/gu,an={...zt,getAnimatableNone:t=>{const e=t.match(rn);return e?e.map(on).join(" "):t}},ln={...zt,getAnimatableNone:t=>{const e=zt.parse(t);return zt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},cn={...mt,transform:Math.round},un={rotate:At,pathRotation:At,rotateX:At,rotateY:At,rotateZ:At,scale:yt,scaleX:yt,scaleY:yt,scaleZ:yt,skew:At,skewX:At,skewY:At,distance:Vt,translateX:Vt,translateY:Vt,translateZ:Vt,x:Vt,y:Vt,z:Vt,perspective:Vt,transformPerspective:Vt,opacity:gt,originX:Dt,originY:Dt,originZ:Vt},hn={borderWidth:Vt,borderTopWidth:Vt,borderRightWidth:Vt,borderBottomWidth:Vt,borderLeftWidth:Vt,borderRadius:Vt,borderTopLeftRadius:Vt,borderTopRightRadius:Vt,borderBottomRightRadius:Vt,borderBottomLeftRadius:Vt,width:Vt,maxWidth:Vt,height:Vt,maxHeight:Vt,top:Vt,right:Vt,bottom:Vt,left:Vt,inset:Vt,insetBlock:Vt,insetBlockStart:Vt,insetBlockEnd:Vt,insetInline:Vt,insetInlineStart:Vt,insetInlineEnd:Vt,padding:Vt,paddingTop:Vt,paddingRight:Vt,paddingBottom:Vt,paddingLeft:Vt,paddingBlock:Vt,paddingBlockStart:Vt,paddingBlockEnd:Vt,paddingInline:Vt,paddingInlineStart:Vt,paddingInlineEnd:Vt,margin:Vt,marginTop:Vt,marginRight:Vt,marginBottom:Vt,marginLeft:Vt,marginBlock:Vt,marginBlockStart:Vt,marginBlockEnd:Vt,marginInline:Vt,marginInlineStart:Vt,marginInlineEnd:Vt,fontSize:Vt,backgroundPositionX:Vt,backgroundPositionY:Vt,...un,zIndex:cn,fillOpacity:gt,strokeOpacity:gt,numOctaves:cn},dn={...hn,color:Lt,backgroundColor:Lt,outlineColor:Lt,fill:Lt,stroke:Lt,borderColor:Lt,borderTopColor:Lt,borderRightColor:Lt,borderBottomColor:Lt,borderLeftColor:Lt,filter:an,WebkitFilter:an,mask:ln,WebkitMask:ln},pn=t=>dn[t],fn=new Set([an,ln]);function mn(t,e){let n=pn(t);return fn.has(n)||(n=zt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function gn(t){for(let e=1;e180*t/Math.PI,vn=t=>{const e=yn(Math.atan2(t[1],t[0]));return wn(e)},xn={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:vn,rotateZ:vn,skewX:t=>yn(Math.atan(t[1])),skewY:t=>yn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},wn=t=>((t%=360)<0&&(t+=360),t),Sn=t=>Math.hypot(t[0],t[1]),bn=t=>Math.hypot(t[4],t[5]),Tn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Sn,scaleY:bn,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>(Sn(t)+bn(t))/2,rotateX:t=>wn(yn(Math.atan2(t[6],t[5]))),rotateY:t=>wn(yn(Math.atan2(-t[2],t[0]))),rotateZ:vn,rotate:vn,skewX:t=>yn(Math.atan(t[4])),skewY:t=>yn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Pn(t){return t.includes("scale")?1:0}function En(t,e){if(!t||"none"===t)return Pn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Tn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=xn,s=e}if(!s)return Pn(e);const o=i[e],r=s[1].split(",").map(Mn);return"function"==typeof o?o(r):r[o]}const An=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return En(n,e)};function Mn(t){return parseFloat(t.trim())}const Vn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Cn=(()=>new Set([...Vn,"pathRotation"]))(),kn=t=>t===mt||t===Vt,Dn=new Set(["x","y","z"]),Rn=Vn.filter(t=>!Dn.has(t));const Ln=new Set(["bottom","right"]);function Bn(t,e,n,i,s,o){const r=parseFloat(t);if(!isNaN(r))return r;const{min:a,max:l}=e()[n],c=l-a;return"border-box"===o?c:c-parseFloat(i)-parseFloat(s)}const On={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>Bn(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>Bn(t,s,"y",e,n,i),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})=>En(t,"x"),y:({transform:t})=>En(t,"y")};On.translateX=On.x,On.translateY=On.y;const jn=new Set;let In=!1,Fn=!1,Wn=!1;function Nn(){if(Fn){const t=[],e=new Set,n=new Set;jn.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),Ln.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return Rn.forEach(n=>{const i=t.getValue(n);if(void 0!==i){const t=i.get(),s=n.startsWith("scale")?1:0;if(t===s)return;e.push([n,t]),i.set(s)}}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=i.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Fn=!1,In=!1,jn.forEach(t=>t.complete(Wn)),jn.clear()}function Un(){jn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Fn=!0)})}function $n(){Wn=!0,Un(),Nn(),Wn=!1}class zn{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(jn.add(this),In||(In=!0,ce.read(Un),ce.resolveKeyframes(Nn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=function(t,e,n){if("string"==typeof t){if(E(t)||M(t))return parseFloat(t);if(!zt.test(t)&&zt.test(n))return mn(e,n)}return t??void 0}(n.readValue(e,o),e,o);void 0!==i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}gn(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),jn.delete(this)}cancel(){"scheduled"===this.state&&(jn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Yn=t=>t.startsWith("--");function Xn(t,e,n){Yn(e)?t.style.setProperty(e,n):t.style[e]=n}const Hn={};function Gn(t,e){const n=V(t);return()=>Hn[e]??n()}const Kn=Gn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),_n=Gn(()=>void 0!==window.ViewTimeline,"viewTimeline"),qn=Gn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Zn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Jn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zn([0,.65,.55,1]),circOut:Zn([.55,0,1,.45]),backIn:Zn([.31,.01,.66,-.59]),backOut:Zn([.33,1.53,.69,.99])};function Qn(t,e){return t?"function"==typeof t?qn()?pe(t,e):"ease-out":et(t)?Zn(t):Array.isArray(t)?t.map(t=>Qn(t,e)||Jn.easeOut):Jn[t]:void 0}function ti(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Qn(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function ei(t){return"function"==typeof t&&"applyToOptions"in t}function ni({type:t,...e}){return ei(t)&&qn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class ii extends Qe{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,t.type;const l=ni(t);this.animation=ti(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Ge(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Xn(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},Je(this,t,l)}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 B(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=L(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&&Kn()?(this.animation.timeline=t,e?.(this.animation),C):n(this)}}const si={anticipate:H,backInOut:X,circInOut:_};function oi(t){"string"==typeof t.ease&&t.ease in si&&(t.ease=si[t.ease])}const ri=10;class ai extends ii{constructor(t){oi(t),_e(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?(at.now()-this.startTime)*this.speed:1e3*this.time}sample(t){if(!this.sampler){const{motionValue:t,onUpdate:e,onComplete:n,onPlay:i,onStop:s,element:o,...r}=this.options;this.sampler=new nn({...r,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:i}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const{speed:s}=this,o=this.elapsed(),r="running"===this.state&&s?b(0,10,o):0,a=this.sample(o);n&&i&&Xn(n,i,a),e.setWithVelocity(this.sample(o-r*Math.sign(s)),a,r/Math.abs(s||1))}}const li=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!zt.test(t)&&"0"!==t||t.startsWith("url(")));function ci(t){t.duration=0,t.type="keyframes"}const ui=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),hi=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const di=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),pi=V(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function fi(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!ui.has(n)&&!di.has(n))return!1;const l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return pi()&&(ui.has(n)||di.has(n)&&function(t){for(let e=0;ee&&"number"==typeof t?e.transform(t):t,gi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yi=Vn.length;function vi(t,e,n){let i="",s=!0;for(let o=0;ot-e,bi=(t,e,n)=>{const i=[];for(let s=0;s<=n;s++)i.push(Gt(t,e,s/n));return i},Ti=t=>t.motionValue.owner,Pi=t=>xi.get(t),Ei=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class Ai extends nn{constructor(t){const e=Ti(t).current,{driver:n=de}=t;let i;const s=function(t){const e=Ti(t),{onUpdate:n,transformTemplate:i}=e.getProps();return!(t.isHandoff||n||t.hasOnUpdate||i||"inertia"===t.type||"none"!==(Ei(e,"transform")||"none")||Ei(e,"pathRotation")||e.projection?.isProjecting())}(t);t.driver=t=>{const s=n(t);return{js:s,now:s.now,start:(t=!0)=>{const n=Pi(e);!n||n.isJS?s.start(t):n.schedule(!1,!t)},stop:()=>{s.stop();const t=Pi(e);t&&!t.isFinishing&&t.release(i)}}},super(t),i=this,this.canAccelerate=s;const{stop:o}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),o()}}get group(){return Pi(Ti(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:i=0,repeatType:s}=this.options;return null!==this.holdTime?[1/0,0]:n===1/0?[t+i/e,this.resolvedDuration*("loop"===s?1:2)/e||1]:[t+(i+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(at.now()):void 0}tween(){const{keyframes:t,type:e,ease:n,times:i,repeat:s,delay:o=0}=this.options,r=et(n)?Zn(n):(t=>/^(linear|ease(In|Out|InOut))$/.test(t))(n)&&Jn[n];if(r&&!s&&!i&&2===t.length&&e===Ye&&null===this.holdTime){const t=this.startTime+o/this.speed;return[t,t+this.resolvedDuration/this.speed,r]}}boundaries(t,e){const{startTime:n,speed:i,resolvedDuration:s,options:o}=this,{delay:r=0,repeat:a=0,repeatDelay:l=0,repeatType:c,times:u,keyframes:h,type:d}=o,p=(d||Ye)===Ye?u||Ue(h):[0,1],f=n+r/i,m=[];if(null!==this.holdTime||!(s>0))return m;for(let n=Math.max(0,Math.floor((t-f)*i/s));n<=a;n++){const o=f+n*s/i;if(o>e)break;for(const r of p){const a=o+(n%2&&c&&"loop"!==c?1-r:r)*(s-l)/i;a>t&&a{for(const e of n)if(e.name===t)return!0},f=(e,n)=>{const r={};for(const a of void 0===e?Vn:o){const o=i.get(a),l=void 0===e?Ei(t,a):o?o.sampleAt(n>e&&!o.timing()[1]?n:e):s[a];void 0!==l&&(r[a]=l)}return r},m=(t,e)=>{let n="";const i=f(t,e);for(const t in i)n+=(gi[t]||t)+"("+mi(i[t],hn[t])+") ";return n||"none"},g=(t=f())=>{e.style.transform=vi(t,{})},y=(t=!0)=>{t&&g(),a.forEach(({animation:t})=>t.cancel()),a=[]},v=(t,e,n=1/0)=>{const i={animation:t,offset:e,end:n};t.startTime=at.now()+e,n<1/0&&(t.onfinish=()=>{i.isDone=!0,a.some(t=>t.end===1/0)&&(t.cancel(),a=a.filter(t=>t!==i)),V.schedule(!1)}),t.oncancel=()=>a.includes(i)&&V.demote(),a.push(i)},x=(t,e,n)=>{const i=(e,n)=>Math.abs(t(n)-t(e)),s=i(e,n);for(;n-e>.01;){const t=(e+n)/2;i(e,t)>i(t,n)?n=t:e=t}return i(e,n)>s/2?[e,n]:[]},w=(t,e,n,i)=>{const s=Math.min(200,Math.max(2,Math.ceil((n-e)/ri)));if(4*i.length>s)return;const o=bi(e,n,s).concat(i).sort(Si),r=t=>D(e,n,t);let a,l;for(const e of t){const t=o.map(t=>e.numberAt(t)),[n]=t,i=t.map(t=>t-n),s=i[i.length-1],r=i.some(t=>Math.abs(t)*wi>Math.abs(s))?0:s,c=i.map(t=>r?t/r:t);if(r)if(a){if(c.some((t,e)=>!(Math.abs(t-a[e])<=wi)))return}else a=c,l=t=>(e.numberAt(t)-n)/r;else if(c.some(t=>!(Math.abs(t)<=wi)))return}if(!a||a.every((t,e)=>Math.abs(t-r(o[e]))<=wi))return"linear";const c=[],u=(t,e=l(t))=>c.push(en(e)+" "+en(100*r(t))+"%");return a.forEach((t,e)=>{e&&Math.abs(t-a[e-1])>.2&&x(l,o[e-1],o[e]).forEach(t=>u(t)),u(o[e],t)}),"linear("+c+")"},S=(t,e,n,i)=>{const s=[e],o=(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))),r=(e,n,i)=>{if(n-e<1||o(e,n))s.push(n);else if(i<4)r(e,(e+n)/2,i+1),r((e+n)/2,n,i+1);else{for(const i of t)s.push(...x(t=>i.numberAt(t),e,n));s.push(n)}},a=bi(e,n,Math.ceil((n-e)/100));for(const t of i)a.push(t,Math.min(t+.01,n));let l=e;for(const t of a.sort(Si))t>l&&r(l,t,0),l=t;return s.sort(Si)},b=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},T=(t,n,i,s={fill:"both"},o,r)=>{const a=t.flatMap(t=>t.boundaries(n,i)),l=r||w(t,n,i,a),c=l?[n,i]:S(t,n,i,a),u=c.map(t=>m(t,o));let h={transform:u};return l||(h.offset=c.map(t=>D(n,i,t))),u.every(t=>t===u[0])&&(g(f(n,o)),h=null),e.animate(h,{...s,duration:i-n,easing:l||"linear"})},P=l=>{let c=l,u=0,h=0;const d=[],p=[],f=new Set;i.clear(),r=new Map;for(const t of n){i.set(t.name,t);const[e,n]=t.timing(),s=e===1/0;if(r.set(t,[t.at(l),t.speed,s]),s)t.sync();else{if(t.speed<0)return;if(n){if(u){const t=(e-h)/n;if(Math.abs(n-u)>1||Math.abs(t-Math.round(t))*u>1)return}else u=n,h=e;p.push(t)}else f.add(e);d.push(t),c=Math.max(c,e)}}s={},o=Vn.filter(e=>{if(i.has(e))return!0;const n=s[e]=Ei(t,e);return void 0!==n&&parseFloat(n)!==(e.startsWith("scale")?1:0)}),y(!1);const m=!u&&b(d);try{if(m&&m[1]>l){const[t,e,n]=m;v(T(d,t,e,void 0,void 0,n),t-l,e-t)}else c>l&&(v(T(d,l,c),0,c-l),f.forEach(t=>t{let e,i=0;for(const s of n){const n=r.get(s);if(!n)return!1;const[o,a,l]=n,c=s.at(t),u=s.timing()[0]===1/0;if(l){if(u&&c===o)continue;return!1}const h=(c-o)/a,d=u?0:s.speed/a;if(void 0===e)e=h,i=d;else if(Math.abs(h-e)>1||d!==i)return!1}if(void 0===e)return!0;if(!a.length)return!1;for(const{offset:t,end:n,isDone:i}of a){const s=e-t;if(n<1/0&&(i?s=n))return!1}for(const{animation:n,offset:s,isDone:o}of a){if(o)continue;const r=e-s;i?(n.playbackRate=i,n.startTime=t-r/i):(n.pause(),n.currentTime=r)}return!0},A=()=>!n.size&&(u=!0,xi.delete(e),V.isJS||y(),!0),M=()=>{const e=at.now();if(V.isJS||(V.isFinishing=!0,n.forEach(n=>{const[i,o]=n.timing();"running"===n.state&&n.speed>0&&!o&&i<=e+1&&(n.complete(),s[n.name]=Ei(t,n.name),r.has(n)||(l=!0))}),V.isFinishing=!1),c=!1,u)return;if(n.forEach(({state:t},e)=>{"idle"!==t&&"finished"!==t||n.delete(e)}),A())return;for(const t of n)if(!t.canAccelerate)return V.demote(!0);V.isJS&&(V.isJS=!1,l=!0,n.forEach(t=>t.js?.stop()));const i=l,o=h;if(l=h=!1,i||!E(e)){if(o){if(e-d<100)return V.demote();d=e}if(!P(e))return V.demote()}},V={tracks:n,isJS:!1,isFinishing:!1,schedule(t,e){u||(l||(l=t),h||(h=!!e),c||(c=!0,st.isProcessing?ce.render(M,!1,!0):queueMicrotask(M)))},release(t){const{state:e}=t;"idle"!==e&&"finished"!==e||n.delete(t),A()||V.schedule(!0)},check(){if(!V.isJS)for(const e in s)if(Ei(t,e)!==s[e]&&!p(e))return V.schedule(!0,!0)},demote(t){V.isJS||u||(n.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),V.isJS=!0,r=new Map,y(),n.forEach(t=>"running"===t.state&&t.js?.start()))}};return xi.set(e,V),V}(Ti(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(at.now())}get time(){return this.isAccelerated()?B(b(0,this.totalDuration,this.at(at.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 Mi extends Qe{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=at.now();const{keyframes:e,name:n,motionValue:i,element:s}=t,o=t;o.autoplay??(o.autoplay=!0),o.delay??(o.delay=0),o.type??(o.type="keyframes"),o.repeat??(o.repeat=0),o.repeatDelay??(o.repeatDelay=0),o.repeatType??(o.repeatType="loop");const r=s?.KeyframeResolver||zn;this.keyframeResolver=new r(e,(t,e,n)=>this.onKeyframesResolved(t,e,o,!n),n,i,s),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:c}=n;this.resolvedAt=at.now();let u=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=li(s,e),a=li(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n{h?.(),this.notifyFinished()};const d=u&&!l&&fi(n),p=!d&&(({name:t,motionValue:e})=>t&&Vn.includes(t)&&e?.owner?.current instanceof HTMLElement&&pi()&&qn())(n);let f;if(i&&(d||p||this.resolvedAt!==this.createdAt)&&(n.startTime??(n.startTime=qe(this.createdAt,this.resolvedAt))),d){n.element=n.motionValue?.owner?.current;try{f=new ai(n)}catch{f=new nn(n)}}else f=p?new Ai(n):new nn(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(),$n()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Vi{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Ci(this.animations,"duration")}get iterationDuration(){return Ci(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Ci(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class ki extends Vi{then(t,e){return this.finished.finally(t).then(()=>{})}}class Di extends ii{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()},Je(this,{})}}const Ri=new WeakMap,Li=(t,e="")=>`${t}:${e}`;function Bi(t){let e=Ri.get(t);return e||(e=new Map,Ri.set(t,e)),e}function Oi(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const ji={current:void 0};class Ii{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=at.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=at.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 R)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new R,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(){ce.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(){ji.current&&ji.current.push(this);const t=this.animation?.liveValue?.();return void 0===t?this.current:t}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=at.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return O(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0;let n,i=!1;n=t(()=>{i=!0,this.events.animationComplete?.notify(),this.animation===n&&this.clearAnimation(),e()}),i||(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 Fi(t,e){return new Ii(t,e)}function Wi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Ni(t,e){const n=t?.[e]??t?.default??t;return n!==t?Wi(n,t):n}const Ui={type:"spring",stiffness:500,damping:25,restSpeed:10},$i={type:"keyframes",duration:.8},zi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Yi=(t,{keyframes:e})=>e.length>2?$i:Cn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ui:zi,Xi=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Hi(t){for(const e in t)if(!Xi.has(e))return!0;return!1}const Gi=(t,e,n,i={},s,o)=>r=>{const a=Ni(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=L(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s,hasOnUpdate:!!a.onUpdate};Hi(a)||Object.assign(u,Yi(t,u)),u.duration&&(u.duration=L(u.duration)),u.repeatDelay&&(u.repeatDelay=L(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(ci(u),0===u.delay&&(h=!0)),(P.instantAnimations||P.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,ci(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&void 0!==e.get()){const t=Ge(u.keyframes,a);if(void 0!==t)return void ce.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new nn(u):new Mi(u)};function Ki(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function _i(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function qi(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const Zi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ji(t){const e=Zi.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Qi(t,e,n=1){const[i,s]=Ji(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return E(t)?parseFloat(t):t}return dt(s)?Qi(s,e,n+1):s}function ts(t,e,n,i){const s=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}(i)):e;return"string"==typeof(e=s(e))&&(e=t.variants&&t.variants[e]),s(e)}function es(t,e,n){return ts(t.getProps(),e,n,t)}const ns=(t,e)=>"exit"===e?t.presenceContext?.custom:void 0,is=new Set(["width","height","top","left","right","bottom",...Vn]),ss=t=>Array.isArray(t);function os(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Fi(n))}function rs(t){return ss(t)?t[t.length-1]||0:t}function as(t,e){const n=es(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){os(t,e,rs(o[e]))}}const ls=t=>Boolean(t&&t.getVelocity);function cs(t){return Boolean(ls(t)&&t.add)}function us(t,e){const n=t.getValue("willChange");if(cs(n))return n.add(e);if(!n&&P.WillChange){const n=new P.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function hs(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ds="framerAppearId",ps="data-"+hs(ds);function fs(t){return t.props[ps]}const ms="undefined"!=typeof window;function gs({protectedKeys:t,needsAnimating:e},n){const i=n in t&&!e[n];return e[n]=!1,i}function ys(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Wi(o,l):l;const c=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const h=[],d=s&&t.animationState?.getState()[s],p=o?.path;p&&(p.animateValues?p.animateValues(e=>t.getValue(e,t.latestValues[e]??0),a,o,n,h):p.animateVisualElement?.(t,a,o,n,h));for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&gs(d,e))continue;const r={delay:n,...Ni(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){ce.update(()=>i.set(s));continue}let p=!1;if(ms&&window.MotionHandoffAnimation){const n=fs(t);if(n){const t=window.MotionHandoffAnimation(n,e,ce);null!==t&&(r.startTime=t,p=!0)}}us(t,e);const f=c??t.shouldReduceMotion;i.start(Gi(e,i,s,f&&is.has(e)?{type:!1}:r,t,p));const m=i.animation;m&&h.push(m)}if(r){const e=()=>ce.update(()=>{r&&as(t,r)});h.length?Promise.all(h).then(e):e()}return h}function vs(t,e,n={}){const i=es(t,e,ns(t,n.type)),s=n.transitionOverride||(i?.transition??(t.getDefaultTransition()||{})),o=()=>Promise.all(i?ys(t,i,n):[]),r=(i=0)=>{const{variantChildren:o}=t,{delayChildren:r=0,staggerChildren:a,staggerDirection:l}=s,c=[];return o?.forEach(t=>{t.notify("AnimationStart",e),c.push(vs(t,e,{...n,delay:i+("function"==typeof r?0:r)+Oi(o,t,r,a,l)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(c)},{when:a}=s;return a?"beforeChildren"===a?o().then(()=>r()):r().then(o):Promise.all([o(),r(n.delay)])}function xs(t,e,n={}){t.notify("AnimationStart",e);return(Array.isArray(e)?Promise.all(e.map(e=>vs(t,e,n))):"string"==typeof e?vs(t,e,n):Promise.all(ys(t,es(t,e,n.custom),n))).then(()=>{t.notify("AnimationComplete",e)})}const ws=t=>e=>e.test(t),Ss=[mt,Vt,Mt,At,kt,Ct,{test:t=>"auto"===t,parse:t=>t}],bs=t=>Ss.find(ws(t));function Ts(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||M(t))}const Ps=new Set(["auto","none","0"]);class Es extends zn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:t,element:e,motionValue:n}=this,i=t[0]??n?.get();if(!e?.current||void 0===i)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 i=e[e.length-1];void 0!==i&&this.motionValue?.jump(i,!1)}measureEndState(){const{element:t,unresolvedKeyframes:e}=this;if(!t||!t.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const n=e.length-1,i=e[n];e[n]=this.measure(),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const As=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],Ms=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...As,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function Vs(t,e){for(let n=0;n{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),ks=[];function Ds(t){"function"==typeof t.test&&t.read,Rs(t),ks.unshift(t)}function Rs(t){w(ks,t)}function Ls(t){return ks.find(e=>e.test(t))}function Bs(t,e,n={},i){const s=[],{velocity:o,path:r}=n,a=n.reduceMotion??i?.shouldReduceMotion;r?.animateValues&&i&&(e={...e},r.animateValues(t,e,n,0,s));for(const r in e){if("transition"===r||"transitionEnd"===r)continue;const l=e[r];if(void 0===l)continue;const c=t(r),u=c.get();void 0===u||c.isAnimating()||Array.isArray(l)||l!==u||o?(c.start(Gi(r,c,l,a&&is.has(r)?{type:!1}:n,i)),c.animation&&s.push(c.animation)):ce.update(()=>c.set(l))}const{transitionEnd:l}=e;if(l){const e=()=>ce.update(()=>{for(const e in l)t(e).set(l[e])});s.length?Promise.all(s).then(e):e()}return s}function Os(t,e,n,i,s){return Bs(i=>{let o=t.get(e,i);if(!o){let r;if(!s){const s=n[i];r=function(t){const e=Array.isArray(t)?t[0]:void 0;return null===e?void 0:e}(s)??t.read(e,i,s)}o=Fi(r,{owner:s}),t(e,{[i]:o})}return o},n,i,s)}function js(t){return A(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function Is(t){return A(t)&&"ownerSVGElement"in t}function Fs(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Ws(t){const{test:e,read:n,get:i,flush:s,state:o}=t;return Object.assign((e,n)=>{const i=Fs(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}},{test:e,read:n,get:i,flush:s,state:o})}class Ns{constructor(t=ce.render){this.step=t,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{const{pending:t,numPending:e}=this;this.numPending=0;for(let n=0;nn&&this.schedule(n);void 0!==e.get()&&s();const o=e.on("change",s),r=()=>{o(),n&&!i&&this.cancel(n),this.values.get(t)?.onRemove===r&&this.values.delete(t)};return this.values.set(t,{value:e,render:i?void 0:n,onRemove:r}),r}get(t){return this.values.get(t)?.value}release(){const t=new Map;return this.values.forEach((e,n)=>{t.set(n,e.value),e.onRemove()}),this.transformKeys=this.transformValues=void 0,t}schedule(t){const{pending:e,numPending:n}=this;for(let i=0;i{const o=i.get(n)??new Ns(e);i.set(n,o);const r=[];for(const e in s){const i=s[e],a=t(n,o,e,i);r.push(a)}return()=>{for(const t of r)t()}},n,{get:(t,e)=>i.get(t)?.get(e),flush:t=>i.get(t)?.flush(),state:t=>i.get(t)})}const $s={};const zs=new Set(["originX","originY","originZ"]),Ys=(t,e)=>mi(t.get(e)?.get(),hn[e]),Xs=(t,e,n,i)=>{let s,o;if(Cn.has(n)){if("pathRotation"!==n){const t=e.transformKeys??(e.transformKeys=[]);(e.transformValues??(e.transformValues={}))[n]=i,t.includes(n)||(t.push(n),t.sort((t,e)=>Vn.indexOf(t)-Vn.indexOf(e)))}e.get("transform")||(js(t)||e.get("transformBox")||Xs(t,e,"transformBox",new Ii("fill-box")),e.set("transform",new Ii("none"),()=>{xi.get(t)?.check(),t.style.transform=function(t){let e="";const{transformKeys:n=[],transformValues:i={}}=t;for(let t=0;t{const n=Ys(e,"originX")??"50%",i=Ys(e,"originY")??"50%",s=Ys(e,"originZ")??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=Yn(n)?()=>{t.style.setProperty(n,i.getCurrent())}:()=>{t.style[n]=mi(i.getCurrent(),hn[n])};return e.set(n,i,s,o)},Hs=(t,e)=>{if(Cn.has(e))return An(t,e);const n=getComputedStyle(t),i=Yn(e)?n.getPropertyValue(e):n[e];return"string"==typeof i&&i.trim()||0},Gs=Us(Xs,{test:t=>js(t)||Is(t),read:Hs}),Ks=Ws(Gs);function _s(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(Cn.has(t))r=!0;else if(ut(t))s[t]=n;else{const e=mi(n,hn[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=vi(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}const qs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Zs={offset:"strokeDashoffset",array:"strokeDasharray"};function Js(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?qs:Zs;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const Qs=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function to(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(_s(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of Qs)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=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&Js(h,s,o,r,!1)}const eo=(t,e,n,i,s=n)=>{const o=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,s);o||!s.startsWith("data")&&!s.startsWith("aria")||(s=hs(s));const r=hn[n]||hn[s],a=o?()=>{t[s]=mi(i.get(),hn[n])}:()=>{const e=mi(i.get(),r);null==e?t.removeAttribute(s):t.setAttribute(s,String(e))};return e.set(n,i,a)},no=Ws(Us(eo));const io=(t,e,n,i)=>{if(n.startsWith("path")&&!Cn.has(n))return function(t,e,n,i){return ce.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const e=i.get();t.setAttribute("stroke-dashoffset",""+-e)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new Ii("1 1"),()=>{const n=e.get("pathLength")?.get()??1,i=e.get("pathSpacing")?.get();t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return eo(t,e,n,i,ao(n));return(Cn.has(n)||zs.has(n)||Yn(n)||n in t.style?Xs:eo)(t,e,n,i)},so=(t,e)=>Cn.has(e)?hn[e]?.default||0:Yn(e)||Qs.includes(e)?Hs(t,e)||t.getAttribute(hs(e))||0:(e=ao(e),t.getAttribute(hs(e))??t.getAttribute(e)??void 0),oo=Us(io,{test:Is,read:so}),ro=Ws(oo);function ao(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}function lo({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function co({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function uo(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ho(t){return void 0===t||1===t}function po({scale:t,scaleX:e,scaleY:n}){return!ho(t)||!ho(e)||!ho(n)}function fo(t){return po(t)||mo(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.rotateZ||t.skewX||t.skewY}function mo(t){return go(t.x)||go(t.y)}function go(t){return t&&"0%"!==t}function yo(t,e,n){return n+e*(t-n)}function vo(t,e,n,i,s){return void 0!==s&&(t=yo(t,s,i)),yo(t,n,i)+e}function xo(t,e=0,n=1,i,s){t.min=vo(t.min,e,n,i,s),t.max=vo(t.max,e,n,i,s)}function wo(t,{x:e,y:n}){xo(t.x,e.translate,e.scale,e.originPoint),xo(t.y,n.translate,n.scale,n.originPoint)}const So=.999999999999,bo=1.0000000000001;function To(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;aSo&&(e.x=1),e.ySo&&(e.y=1)}function Po(t,e){t.min+=e,t.max+=e}function Eo(t,e,n,i,s=.5){xo(t,e,n,Gt(t.min,t.max,s),i)}function Ao(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Mo(t,e,n){const i=n??t;Eo(t.x,Ao(e.x,i.x),e.scaleX,e.scale,e.originX),Eo(t.y,Ao(e.y,i.y),e.scaleY,e.scale,e.originY)}function Vo(t,e){return lo(uo(t.getBoundingClientRect(),e))}function Co(t,e,n){const i=Vo(t,n),{scroll:s}=e;return s&&(Po(i.x,s.offset.x),Po(i.y,s.offset.y)),i}const ko={},Do=t=>Is(t)?oo:Gs;class Ro{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=Es}getValue(t){return this.effect.get(this.current,t)}readValue(t,e){return this.effect.read(this.current,t,e)}render(){this.effect.flush(this.current)}measureViewportBox(){return Vo(this.current)}getProps(){return ko}}function Lo(t,e,n,i){if(i)return Bs(t=>i.getValue(t,null),e,n,i);const s=Do(t);return Os(s,t,e,n,new Ro(s,t))}function Bo(t,e){const n=Do(t).state(t);if(!n)return;const{transformKeys:i}=n;n.release().forEach((t,n)=>{"transformBox"===n||"transform"===n&&i?.length||e.addValue(n,t)})}const Oo=Us((t,e,n,i)=>e.set(n,i,()=>{t[n]=i.get()}),{test:t=>A(t),read:(t,e)=>{const n=t[e];return"string"==typeof n||"number"==typeof n?n:void 0}}),{schedule:jo,cancel:Io}=le(queueMicrotask,!1),Fo={x:!1,y:!1};function Wo(){return Fo.x||Fo.y}function No(t){return"x"===t||"y"===t?Fo[t]?null:(Fo[t]=!0,()=>{Fo[t]=!1}):Fo.x||Fo.y?null:(Fo.x=Fo.y=!0,()=>{Fo.x=Fo.y=!1})}function Uo(t,e){const n=Fs(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function $o(t,e,n={}){const[i,s,o]=Uo(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Wo())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const zo=(t,e)=>!!e&&(t===e||zo(t,e.parentElement)),Yo=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Xo=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ho(t){return Xo.has(t.tagName)||!0===t.isContentEditable}const Go=new Set(["INPUT","SELECT","TEXTAREA"]);function Ko(t){return Go.has(t.tagName)||!0===t.isContentEditable}const _o=new WeakSet;function qo(t){return e=>{"Enter"===e.key&&t(e)}}function Zo(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Jo(t){return Yo(t)&&!Wo()}const Qo=new WeakSet;function tr(t,e,n={}){const[i,s,o]=Uo(t,n),r=t=>{const i=t.currentTarget;if(!Jo(t))return;if(Qo.has(t))return;_o.add(i),n.stopPropagation&&Qo.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),_o.has(i)&&_o.delete(i),Jo(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||zo(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),js(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=qo(()=>{if(_o.has(n))return;Zo(n,"down");const t=qo(()=>{Zo(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Zo(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),Ho(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function er(t,e){const n=window.getComputedStyle(t);return Yn(e)?n.getPropertyValue(e):n[e]}const nr=new WeakMap;let ir;const sr=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Is(i)&&"getBBox"in i?i.getBBox()[e]:i[n],or=sr("inline","width","offsetWidth"),rr=sr("block","height","offsetHeight");function ar({target:t,borderBoxSize:e}){nr.get(t)?.forEach(n=>{n(t,{get width(){return or(t,e)},get height(){return rr(t,e)}})})}function lr(t){t.forEach(ar)}function cr(t,e){ir||"undefined"!=typeof ResizeObserver&&(ir=new ResizeObserver(lr));const n=Fs(t);return n.forEach(t=>{let n=nr.get(t);n||(n=new Set,nr.set(t,n)),n.add(e),ir?.observe(t)}),()=>{n.forEach(t=>{const n=nr.get(t);n?.delete(e),n?.size||ir?.unobserve(t)})}}const ur=new Set;let hr;function dr(t){return ur.add(t),hr||(hr=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};ur.forEach(e=>e(t))},window.addEventListener("resize",hr)),()=>{ur.delete(t),ur.size||"function"!=typeof hr||(window.removeEventListener("resize",hr),hr=void 0)}}function pr(t,e){return"function"==typeof t?dr(t):cr(t,e)}const fr={value:null,addProjectionMetrics:null};function mr(t){return Is(t)&&"svg"===t.tagName}function gr(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=We(t[1+n],t[2+n],t[3+n]);return e?s(i):s}const yr=new Set,vr=({timestamp:t})=>{yr.forEach(e=>e.tick(t))};class xr extends Qe{constructor(t){super(),this.state="idle",this.startTime=0,this.currentTime=0,this.started=!1,this.hasNextTarget=!1,this.nextTarget=0,this.stop=()=>{"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.factory=t.type,this.generator=this.factory(t);const{driver:e}=t;e&&(this.driver=e(t=>this.tick(t))),this.startTime=this.now(),this.state="running",this.driver?this.driver.start():(yr.size||ce.update(vr,!0),yr.add(this))}setTarget(t,e){this.nextTarget=t,this.nextVelocity=e,this.hasNextTarget=!0}retarget(t,e){const{options:n,generator:i}=this;n.keyframes=t,n.velocity=e,this.startTime=this.now(),this.currentTime=0,i.retarget?i.retarget(t,e):this.generator=this.factory(n)}tick(t){const{options:e,hasNextTarget:n}=this,{delay:i=0,onUpdate:s,onPlay:o}=e;this.started||(this.startTime=qe(this.startTime,t));const r=Math.round(t-this.startTime)-i,a=this.currentTime=Math.max(0,r),l=this.generator.next(a),c=r<0?e.keyframes[0]:l.value;if(n){this.hasNextTarget=!1;const{keyframes:t}=e;t[0]=c,t[1]=this.nextTarget,this.retarget(t,this.nextVelocity??this.getGeneratorVelocity())}!n&&this.started||(this.started=!0,o?.()),"running"===this.state&&(s?.(c),l.done&&r>=0&&!n&&!this.hasNextTarget&&"running"===this.state&&(this.notifyFinished(),this.teardown(),this.state="finished",e.onComplete?.()))}getGeneratorVelocity(){return Xe(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():at.now()}teardown(){this.state="idle",this.driver?this.driver.stop():(yr.delete(this),yr.size||ue(vr))}}const wr=t=>"number"==typeof t?t:parseFloat(t);function Sr(t,e,n){const i=t.get();let s,o=null;const r="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,a=t=>s(r?t+r:t),l=()=>t.events.animationStart?.notify(),c=()=>{o&&(o.stop(),o=null),t.animation=void 0};if(t.attach((e,i)=>{s=i;const r=wr(e);if("running"===o?.state)return void o.setTarget(r,n.velocity);const u=wr(t.get()),h=o?o.getGeneratorVelocity():t.getVelocity();if(c(),u===r)return;const d={keyframes:[u,r],velocity:h,restDelta:.001,restSpeed:.01,...n,onUpdate:a},p=o=new xr({...d,onPlay:l});t.animation=p,p.then(()=>{o===p&&(o=null,t.animation=void 0,t.events.animationComplete?.notify())})},c),ls(e)){let i=!0===n.skipInitialAnimation;const s=e=>{i?(i=!1,t.jump(br(e,r),!1)):t.set(br(e,r))},o=e.on("change",s),a=e.get();wr(a)-wr(t.get())&&s(a);const l=t.on("destroy",o);return()=>{o(),l(),c()}}return c}function br(t,e){return e?t+e:t}function Tr(t,e,n={}){const i={type:"spring",...n};return _e(i),i.type=i.type||Ye,Sr(t,e,i)}function Pr(t){const e=[];ji.current=e;const n=t();ji.current=void 0;const i=Fi(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>ce.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),ue(i)})}(e,i,t),i}function Er(t,e,n){return Sr(t,e,{...n,type:Ie})}const Ar=[...Ss,Lt,zt];let Mr=0;const Vr=()=>"motion-view-"+Mr++;function Cr(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function kr(t,e,n,i,s){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&s)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||s.add(e)}}function Dr(t,e,n,i,s,o=[],r,a=[],l){const c=Fs(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??Vr();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),Cr(t,s,o),kr(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=Vr(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),Cr(t,s,o),kr(t,d,r,a,l),d})}function Rr(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let Lr={},Br=null;const Or=(t,e)=>{Lr[t]=e},jr=()=>{Br||(Br=document.createElement("style"),Br.id="motion-view");let t="";for(const e in Lr){const n=Lr[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}Br.textContent=t,document.head.appendChild(Br),Lr={}},Ir=()=>{Br&&Br.parentElement&&Br.parentElement.removeChild(Br)};function Fr(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Wr(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const Nr=["layout","enter","exit","new","old"],Ur=t=>t.split(" ").every(t=>0===parseFloat(t)),$r={group:["layout"],new:["new","enter"],old:["old","exit"]},zr={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function Yr(t){const{update:e,targets:n,resolveDefs:i,cropOverride:s,pairs:o,classNames:r,flatGroups:a,options:l}=t;if(!document.startViewTransition)return(async()=>(await e(),new Vi([])))();const c=new Map,u=[],h=[],d=[],p=new Set,f=new Map,m=new Set,g=new Map,y=new Map,v=new Map,x=new Map,w=t=>{n.forEach((e,n)=>{const l=r.get(n),m="root"!==n&&i.has(n)?a.has(n)?"none":"contain":void 0;let w;if("root"!==n&&i.has(n))if(o.has(n))if("old"===t)x.set(n,Fs(n)),w=Dr(n,c,u,void 0,l,h,m,d,p),v.set(n,w);else{for(const t of x.get(n)??[])t.style?.removeProperty("view-transition-name"),c.delete(t);w=Dr(o.get(n),c,u,v.get(n),l,h,m,d,p)}else w=Dr(n,c,u,void 0,l,h,m,d,p);else w=[n];const S=s.get(n);w.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==S&&g.set(n,S);const o=y.get(n)??{};o[t]=[i,w.length],y.set(n,o)})})},S=(t,e)=>{const n=y.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},b=(t,e,n,i,s)=>{const o=Xr(Ni(l,n),Ni(function(t,e){for(const n of $r[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof o.delay&&(o.delay=o.delay(i,s)),o},T=t=>{const[e,n]=S(t,"group"),i=b(f.get(t),"group","layout",-1===e?0:e,n);i.duration&&(i.duration=L(i.duration));const{delay:s=0,duration:o,ease:r}=ni(i);return{delay:L(s),duration:o,ease:r}},P=new Map,E=t=>c.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of As)o[t]=n[t];const r=P.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},P.set(e,r)}}),A=t=>{const e=P.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},M=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||Or(":root",{"view-transition-name":"none"}),Or("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),m.forEach(t=>{Or(`::view-transition-group(${t})`,{overflow:"clip"}),Or(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),p.forEach(t=>{Or(`::view-transition-group-children(${t})`,{overflow:"clip"})}),jr()},V=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(u,h,d),Ir()},C=async()=>{await e(),w("new"),E("new"),(()=>{m.clear();for(const t of y.keys())"root"!==t&&(g.get(t)??A(t))&&m.add(t)})(),M()};let k;try{w("old"),E("old"),M(),k=document.startViewTransition(C)}catch(t){return V(),Promise.reject(t)}return k.finished.finally(V),new Promise((t,e)=>{k.ready.then(()=>{const e=Wr(),n=[],i=new Set,s=new Set;f.forEach((t,e)=>{const o=y.get(e),r=!!o?.new&&!o?.old,a=!!o?.old&&!o?.new;for(const o of Nr){if(!t[o])continue;if("enter"===o&&!r)continue;if("exit"===o&&!a)continue;const c=Rr(o),[u,h]=S(e,c);if(-1===u)continue;const{keyframes:d,options:p}=t[o];for(let[f,m]of Object.entries(d)){if(null==m)continue;if("x"===f||"y"===f){I(!1,`animateView() animates view-transition layers with CSS properties; the "${f}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===o&&r&&null!=t.enter?.keyframes[f])continue;if("old"===o&&a&&null!=t.exit?.keyframes[f])continue;const d=Xr(Ni(l,f),Ni(p,f));if(!Array.isArray(m)){const e="enter"===o?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===c?r:a),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?zr[c]?.[f]:void 0;void 0!==i&&(m=[i,m])}"function"==typeof d.delay&&(d.delay=d.delay(u,h)),d.duration&&(d.duration=L(d.duration)),d.delay&&(d.delay=L(d.delay)),n.push(new ii({...d,element:document.documentElement,name:f,pseudoElement:`::view-transition-${c}(${e})`,keyframes:m})),i.add(`${e}:${c}`),"opacity"===f&&s.add(`${e}:${c}`)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:o}=e;if(!o)continue;const r=Fr(o);if(!r)continue;const a=f.get(r.layer);if(i.has(`${r.layer}:${r.type}`)){s.has(`${r.layer}:new`)&&s.has(`${r.layer}:old`)&&e.getKeyframes().some(t=>t.mixBlendMode)?n.push(new Di(t)):t.cancel();continue}const l="old"===r.type?"new":"new"===r.type?"old":void 0;if(l&&i.has(`${r.layer}:${l}`)&&!s.has(`${r.layer}:${l}`)){t.cancel();continue}const c=y.get(r.layer),u=!("old"!==r.type&&"new"!==r.type||!c?.old||!c?.new);let h;if(r.type.startsWith("group")){const{delay:t,duration:e,ease:n}=T(r.layer);h={delay:t,duration:e,easing:Qn(n,e)}}else{const t=u?"group":r.type,[e,n]=S(r.layer,t);let i=b(a,t,"group"===t?"layout":"",-1===e?0:e,n);const s=i.visualDuration;i.duration&&(i.duration=L(i.duration)),i=ni(i),h={delay:L(i.delay??0),duration:u&&void 0!==s?L(s):i.duration,easing:u?"linear":Qn(i.ease,i.duration)}}e.updateTiming(h),n.push(new Di(t))}P.forEach((t,e)=>{if(!m.has(e))return;const{delay:i,duration:s,ease:o}=T(e);for(const r of As){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";Ur(a)&&Ur(l)||n.push(new ii({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:i,duration:s,ease:o}))}}),t(new Vi(n))}).catch(()=>k.updateCallbackDone.then(()=>t(new Vi([])),e))})}function Xr(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let Hr=[],Gr=null;function Kr(){Gr=null;const[t]=Hr;var e;t&&(w(Hr,e=t),Gr=e,Yr(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(Kr))}function _r(){for(let t=Hr.length-1;t>=0;t--){const e=Hr[t],{interrupt:n}=e.options;if("immediate"===n){const n=Hr.slice(0,t+1).map(t=>t.update),i=Hr.slice(t+1);e.update=()=>{n.forEach(t=>t())},Hr=[e,...i];break}}Gr&&"immediate"!==Hr[0]?.options.interrupt||Kr()}class qr{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=C,this.notifyReject=C,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...e},this.readyPromise.catch(C),n=this,Hr.push(n),jo.render(_r)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const Zr=()=>({translate:0,scale:1,origin:0,originPoint:0}),Jr=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Qr=()=>({min:0,max:0}),ta=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ea=new WeakMap;function na(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ia(t){return"string"==typeof t||Array.isArray(t)}const sa=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],oa=["initial",...sa];function ra(t){if(na(t.animate))return!0;for(let e=0;eca.current=t.matches;t.addEventListener("change",e),e()}else ca.current=!1}const pa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let fa={};function ma(t){fa=t}function ga(){return fa}class ya{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=zn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=at.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:(ua.current||da(),this.shouldReduceMotion=ca.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(),ue(this.notifyUpdate),ue(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&&ui.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new ii({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:L(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=Cn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&ce.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),xi.get(this.current)?.check()),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}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 fa){const e=fa[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(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:i}=this.props;(t.transformTemplate||n)&&this.scheduleRender(),(t.transformTemplate&&!n||t.onUpdate&&!i)&&xi.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 xa{constructor(t){this.isMounted=!1,this.node=t}update(){}}function wa(t,{style:e,vars:n},i,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,i),n)o.setProperty(r,n[r])}const Sa={};function ba(t,{layout:e,layoutId:n}){return Cn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Sa[t]||"opacity"===t)}function Ta(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(ls(i[e])||s&&ls(s[e])||ba(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class Pa extends va{constructor(){super(...arguments),this.type="html",this.renderInstance=wa}mount(t){Boolean(t.style),super.mount(t)}readValueFromInstance(t,e){if(Cn.has(e))return this.projection?.isProjecting?Pn(e):An(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(ut(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Vo(t,e)}build(t,e,n){_s(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Ta(t,e,n)}}const Ea=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"]),Aa=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ma(t,e,n,i){wa(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ea.has(n)?n:hs(n),e.attrs[n])}function Va(t,e,n){const i=Ta(t,e,n);for(const n in t)if("children"!==n&&(ls(t[n])||ls(e[n]))){i[-1!==Vn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Ca extends va{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ta}getBaseTargetFromProps(t,e){return Cn.has(e)?super.getBaseTargetFromProps(t,e)??Pn(e):t[e]}getDefaultValue(t){return Cn.has(t)?this.latestValues[t]??Pn(t):void 0}readValueFromInstance(t,e){if(Cn.has(e)){const t=pn(e);return t&&t.default||0}if(Qs.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Ea.has(e)?e:hs(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Va(t,e,n)}build(t,e,n){to(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){Ma(t,e,0,i)}mount(t){this.isSVGTag=Aa(t.tagName),super.mount(t)}}function ka(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;iPromise.all(e.map(({animation:e,options:n})=>xs(t,e,n))),n=Ba(),i=!0,s=!1;function o(o){const{props:r,parent:a,manuallyAnimateOnMount:l}=t,c=i||s,u=[],h=new Set;let d={},p=1/0,f=t;do{f=!1!==f.props.inherit&&f.parent}while(f&&!f.isControllingVariants);if(Da.forEach((e,i)=>{const s=n[e],m=r[e],g=f&&f.props[e],y=void 0!==m?m:ia(g)||!1===g?g:void 0,v=ia(y),x=e===o?s.isActive:null;!1===x&&(p=i);const w=v&&void 0===m&&!(c&&l);if(s.protectedKeys={...d},!s.isActive&&null===x||!y&&!s.prevProp||na(y)||"boolean"==typeof y)return;if("exit"===e&&s.isActive&&!0!==x)return void(d={...d,...s.prevResolvedValues});const S=La(s.prevProp,y);let b=S||v&&(x&&!w||i>p),T=!1;const P=Array.isArray(y)?y:[y];let E={};if(!1!==x)for(const n of P){const{transition:i,transitionEnd:s,...o}=es(t,n,ns(t,e))||{};E={...E,...o,...s}}const{prevResolvedValues:A}=s;for(const e in{...A,...E}){if(e in d)continue;const n=E[e],i=A[e],o=Array.isArray(n)&&Array.isArray(i)?!ka(n,i)||S:n!==i;if(o&&null==n)h.add(e);else if(o||void 0!==n&&h.has(e)){b=!0,h.delete(e)&&(T=!0),s.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)}else s.protectedKeys[e]=!0}if(s.prevProp=y,s.prevResolvedValues=E,s.isActive&&(d={...d,...E}),b&&(!w||!S||T))for(const n of P){const i={type:e};if("string"==typeof n&&c&&l&&a?.enteringChildren){const e=es(a,n)?.transition?.delayChildren;i.delay=Oi(a.enteringChildren,t,e)}u.push({animation:n,options:i})}}),h.size){const{initial:e}=r,n={},i="boolean"!=typeof e&&es(t,Array.isArray(e)?e[0]:e,t.presenceContext?.custom);i&&i.transition&&(n.transition=i.transition),h.forEach(s=>{const o=t.getValue(s);o&&(o.liveStyle=!0);const a=i&&!Array.isArray(e)?i[s]:void 0,l=t.getBaseTargetFromProps(r,s);n[s]=(void 0!==a?a:void 0===l||ls(l)?void 0===t.initialValues[s]?t.baseTarget[s]:void 0:l)??null}),u.push({animation:n})}const m=c&&t.blockInitialAnimation||i&&!l&&(!1===r.initial||r.initial===r.animate);return i=s=!1,!m&&u.length?e(u):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:n=>{e=n(t)},getState:()=>n,reset:()=>{n=Ba(),s=!0}}}function La(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!ka(e,t)}function Ba(){const t={};for(const e of sa)t[e]={isActive:"animate"===e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return t}const Oa=oa.length;function ja(t,e){t.min=e.min,t.max=e.max}function Ia(t,e){ja(t.x,e.x),ja(t.y,e.y)}function Fa(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Wa(t){return t.max-t.min}function Na(t,e,n){return Math.abs(t-e)<=n}function Ua(t,e,n,i=.5){t.origin=i,t.originPoint=Gt(e.min,e.max,t.origin),t.scale=Wa(n)/Wa(e),t.translate=Gt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function $a(t,e,n,i){Ua(t.x,e.x,n.x,i?i.originX:void 0),Ua(t.y,e.y,n.y,i?i.originY:void 0)}function za(t,e,n,i=0){const s=i?Gt(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+Wa(e)}function Ya(t,e,n,i){za(t.x,e.x,n.x,i?.x),za(t.y,e.y,n.y,i?.y)}function Xa(t,e,n,i=0){const s=i?Gt(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+Wa(e)}function Ha(t,e,n,i){Xa(t.x,e.x,n.x,i?.x),Xa(t.y,e.y,n.y,i?.y)}function Ga(t,e,n,i,s){return t=yo(t-=e,1/n,i),void 0!==s&&(t=yo(t,1/s,i)),t}function Ka(t,e=0,n=1,i=.5,s,o=t,r=t){if(Mt.test(e)){e=parseFloat(e);e=Gt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Gt(o.min,o.max,i);t===o&&(a-=e),t.min=Ga(t.min,e,n,a,s),t.max=Ga(t.max,e,n,a,s)}function _a(t,e,[n,i,s],o,r){Ka(t,e[n],e[i],e[s],e.scale,o,r)}const qa=["x","scaleX","originX"],Za=["y","scaleY","originY"];function Ja(t,e,n,i){_a(t.x,e,qa,n?n.x:void 0,i?i.x:void 0),_a(t.y,e,Za,n?n.y:void 0,i?i.y:void 0)}function Qa(t){return 0===t.translate&&1===t.scale}function tl(t){return Qa(t.x)&&Qa(t.y)}function el(t,e){return t.min===e.min&&t.max===e.max}function nl(t,e){return el(t.x,e.x)&&el(t.y,e.y)}function il(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function sl(t,e){return il(t.x,e.x)&&il(t.y,e.y)}function ol(t){return Wa(t.x)/Wa(t.y)}function rl(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function al(t){return[t("x"),t("y")]}function ll(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const cl={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Vt.test(t))return t;t=parseFloat(t)}return`${ll(t,e.target.x)}% ${ll(t,e.target.y)}%`}},ul={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=zt.parse(t);if(s.length>5)return i;const o=zt.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=Gt(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}};function hl(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:s,rotateX:o,rotateY:r,rotateZ:a,skewX:l,skewY:c}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`rotateZ(${a}deg) `),l&&(i+=`skewX(${l}deg) `),c&&(i+=`skewY(${c}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const dl=As.length,pl=["rotate","rotateX","rotateY","rotateZ","skewX","skewY"],fl=pl.length,ml=t=>"number"==typeof t||Vt.test(t);function gl(t,e,n,i,s,o){s?(t.opacity=Gt(0,n.opacity??1,vl(i)),t.opacityExit=Gt(e.opacity??1,0,xl(i))):o&&(t.opacity=Gt(e.opacity??1,n.opacity??1,i));for(let s=0;sie?1:n(D(t,e,i))}function Sl(t,e,n){const i=ls(t)?t:Fi(t);return i.start(Gi("",i,e,n)),i.animation}function bl(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Tl=(t,e)=>t.depth-e.depth;class Pl{constructor(){this.children=[],this.isDirty=!1}add(t){x(this.children,t),this.isDirty=!0}remove(t){w(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Tl),this.isDirty=!1,this.children.forEach(t)}}function El(t,e){const n=at.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(ue(i),t(o-e))};return ce.setup(i,!0),()=>ue(i)}function Al(t){return ls(t)?t.get():t}class Ml{constructor(){this.members=[]}add(t){x(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(w(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(w(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Vl={borderRadius:{...cl,applyTo:[...As]},borderTopLeftRadius:cl,borderTopRightRadius:cl,borderBottomLeftRadius:cl,borderBottomRightRadius:cl,boxShadow:ul},Cl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(Sa,{...Vl,...Sa});const kl={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Dl=["","X","Y","Z"];let Rl=0;function Ll(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}const Bl=({instance:t})=>t&&xi.get(t)?.demote();function Ol(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=fs(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ce,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Ol(i)}function jl({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=Rl++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,fr.value&&(kl.nodes=kl.calculatedTargetDeltas=kl.calculatedProjections=0),this.nodes.forEach(Wl),this.nodes.forEach(_l),this.nodes.forEach(ql),this.nodes.forEach(Nl),fr.addProjectionMetrics&&fr.addProjectionMetrics(kl)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;ce.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=El(s,250),Cl.hasAnimatedSinceResize&&(Cl.hasAnimatedSinceResize=!1,this.nodes.forEach(Kl)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){const{layoutId:t,layout:e,visualElement:n,animate:i}=this.options;this.instance&&!this.hasLayoutListener&&!1!==i&&n&&(t||e)&&(this.hasLayoutListener=!0,this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:s})=>{if(this.isAnimationBlocked)return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||n.getDefaultTransition()||ec,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=n.getProps(),l=!this.targetLayout||!sl(this.targetLayout,s),c=!e&&i;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Ni(o,"layout"),onPlay:r,onComplete:a};(n.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||Kl(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,ue(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Zl),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ol(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Bl(this),this.isLayoutDirty=!0;for(let t=0;tt.members.length?t.removeLeadSnapshot():this.sharedNodes.delete(e))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ce.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ce.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Wa(this.snapshot.measuredBox.x)||Wa(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t{const n=e/1e3,i=p?.(n);i?(r.x.translate=i.x,r.x.scale=Gt(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=Gt(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(Jl(r.x,t.x,n),Jl(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ha(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),function(t,e,n,i){Ql(t.x,e.x,n.x,i),Ql(t.y,e.y,n.y,i)}(this.relativeTarget,this.relativeTargetOrigin,a,n),d&&nl(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Ia(d,this.relativeTarget)),l&&(this.animationValues=o,gl(o,s,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ue(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ce.update(()=>{Cl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Fi(0)),this.motionValue.jump(0,!1),this.currentAnimation=Sl(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),function(t,e){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Ze("layout-animation-start",t),node:e})}catch{}}(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead(),{targetWithTransforms:e,layout:n,latestValues:i}=t;let{target:s}=t;if(e&&s&&n){if(this!==t&&this.layout&&n&&oc(this.options.animationType,this.layout.layoutBox,n.layoutBox)){s=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Wa(this.layout.layoutBox.x);s.x.min=t.target.x.min,s.x.max=s.x.min+e;const n=Wa(this.layout.layoutBox.y);s.y.min=t.target.y.min,s.y.max=s.y.min+n}Ia(e,s),Mo(e,i),$a(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ml);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Ll("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach($l),this.root.sharedNodes.clear()}}}function Il(t){t.updateLayout(),function(t){const{snapshot:e,dragAncestor:n}=t,i=n?.layout;if(!e||!i||t.resumeFrom||t.isAnimationBlocked)return;const s=n.dragSnapshot;al(t=>Po(e.layoutBox[t],i.layoutBox[t].min-s.layoutBox[t].min))}(t)}function Fl(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)al(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Wa(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";ja(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else oc(s,e.layoutBox,n)&&al(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Wa(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};$a(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?$a(a,t.applyTransform(i,!0),e.measuredBox):$a(a,n,e.layoutBox);const l=!tl(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};Ha(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};Ha(l,n,o.layoutBox,r),sl(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Wl(t){fr.value&&kl.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Nl(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ul(t){t.clearSnapshot()}function $l(t){t.clearMeasurements()}function zl(t){t.isLayoutDirty=!0,t.updateLayout()}function Yl(t){t.isLayoutDirty=!1}function Xl(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.dragSnapshot||t.layout,t.isLayoutDirty=!0)}function Hl(t){t.relativeTarget&&t.relativeParent?.isLayoutDirty&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function Gl(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Kl(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function _l(t){t.resolveTargetDelta()}function ql(t){t.calcProjection()}function Zl(t){t.resetSkewAndRotation()}function Jl(t,e,n){t.translate=Gt(e.translate,0,n),t.scale=Gt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ql(t,e,n,i){t.min=Gt(e.min,n.min,i),t.max=Gt(e.max,n.max,i)}function tc(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const ec={duration:.45,ease:[.4,0,.1,1]},nc=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ic=nc("applewebkit/")&&!nc("chrome/")?Math.round:C;function sc(t){t.min=ic(t.min),t.max=ic(t.max)}function oc(t,e,n){return"position"===t||"preserve-aspect"===t&&!Na(ol(e),ol(n),.2)}function rc(t){return t!==t.root&&t.scroll?.wasRoot}const ac=jl({attachResizeListener:(t,e)=>bl(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),lc=t=>!t.isLayoutDirty&&t.willUpdate(!1);function cc(){const t=new Set,e=new WeakMap,n=()=>t.forEach(lc);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}}const uc={current:void 0},hc=jl({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!uc.current){const t=new ac({});t.mount(window),t.setOptions({layoutScroll:!0}),uc.current=t}return uc.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),dc="[data-layout],[data-layout-id]",pc=new WeakMap;let fc;function mc(t){const e=[];return t instanceof HTMLElement&&t.matches(dc)&&e.push(t),t.querySelectorAll(dc).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function gc(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function yc(t,e){let n=pc.get(t);if(n)n.setOptions(gc(t,e));else{let i=ea.get(t);i||(i=new Pa({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0}),Bo(t,i)),t.style.transform&&!fo(i.latestValues)&&(t.style.transform=""),n=new hc(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=pc.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...gc(t,e),visualElement:i}),n.mount(t),pc.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function vc(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),pc.delete(t)}function xc(){const t=fc;fc=void 0,function(){if(st.isProcessing)return;const t=at.now();st.delta=b(0,1e3/60,t-st.timestamp),st.timestamp=t,st.isProcessing=!0,he.update.process(st),he.preRender.process(st),he.render.process(st),st.isProcessing=!1}();const e=new Map;for(const n of t)for(const t of n.collectTargets()){const i=e.get(t);i?i.push(n):e.set(t,[n])}const n=new Map;for(const t of(i=e.keys(),[...i].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const i=e.get(t),s=yc(t,i[i.length-1].transitionFor(t));for(const e of i)e.adopt(t,s);n.set(t,s)}var i;n.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const s=[];for(const e of t){const t=e.runUpdate();t&&s.push(t)}const o=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let i;n.forEach(t=>i||(i=t.root));for(const e of t)i||(i=e.getRoot());i?.didUpdate(),jo.render(()=>{for(const e of t)e.finalize()})};s.length?Promise.all(s).then(o):o()}class wc{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),fc||(fc=[],queueMicrotask(xc)),fc.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return mc(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of mc(this.scope)){if(this.tracked.has(e))continue;const n=yc(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),vc(n,e)}}),e.relegate())return;n.remove()}vc(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new Vi([...t]))}}function Sc(t,e,n){if("function"==typeof t)return{scope:document,updateDom:t,defaultOptions:e};return{scope:t instanceof Document?t:Fs(t)[0]??document,updateDom:e,defaultOptions:n}}const bc=ce,Tc=ae.reduce((t,e)=>(t[e]=t=>ue(t),t),{}),Pc=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ec(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}function Ac(...t){return i.useCallback(function(...t){return e=>{let n=!1;const i=t.map(t=>{const i=Ec(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;eu.current||l?.current?.current;return e.useInsertionEffect(()=>{const{width:t,height:e,top:i,left:l,right:u,bottom:d,direction:f}=h.current,m=g();if(n||!1===a||!m||!t||!e)return;const y="rtl"===f,v="left"===s?y?`right: ${u}`:`left: ${l}`:y?`left: ${l}`:`right: ${u}`,x="bottom"===o?`bottom: ${d}`:`top: ${i}`;m.dataset.motionPopId=c;const w=m.ownerDocument,S=w.createElement("style");p&&(S.nonce=p);const b=r??w.head;return b.appendChild(S),S.sheet&&S.sheet.insertRule(`\n [data-motion-pop-id="${c}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${v}px !important;\n ${x}px !important;\n }\n `),()=>{m.removeAttribute("data-motion-pop-id"),b.contains(S)&&b.removeChild(S)}},[n]),d(Mc,{isPresent:n,getElement:g,sizeRef:h,pop:a,children:!1===a?t:i.cloneElement(t,{ref:m})})}const Cc=({children:t,initial:n,isPresent:s,onExitComplete:o,custom:r,presenceAffectsLayout:a,mode:l,anchorX:c,anchorY:u,root:h})=>{const p=m(kc),f=e.useId(),g=e.useRef(),x=e.useRef(s),w=e.useRef(o);y(()=>{x.current=s,w.current=o});let S=!0,b=e.useMemo(()=>(S=!1,{id:f,initial:n,isPresent:s,custom:r,onExitComplete:t=>{p.set(t,!0);for(const t of p.values())if(!t)return;o&&o()},register:(t,e)=>(p.set(t,!1),e&&e.parent?.presenceContext?.id!==f&&(g.current=e),()=>{p.delete(t),!x.current&&!p.size&&w.current?.()})}),[s,p,o]);return a&&S&&(b={...b}),e.useMemo(()=>{p.forEach((t,e)=>p.set(e,!1))},[s]),i.useEffect(()=>{!s&&!p.size&&o&&o()},[s]),t=d(Vc,{pop:"popLayout"===l,isPresent:s,anchorX:c,anchorY:u,root:h,popNode:g,children:t}),d(v.Provider,{value:b,children:t})};function kc(){return new Map}function Dc(t=!0){const n=e.useContext(v);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:s,register:o}=n,r=e.useId();e.useEffect(()=>{if(t)return o(r)},[t]);const a=e.useCallback(()=>t&&s&&s(r),[r,s,t]);return!i&&s?[!1,a]:[!0]}const Rc=t=>t.key||"";function Lc(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}const Bc=e.createContext(null);function Oc(){const t=function(){const t=e.useRef(!1);return y(()=>(t.current=!0,()=>{t.current=!1}),[]),t}(),[n,i]=e.useState(0),s=e.useCallback(()=>{t.current&&i(n+1)},[n]);return[e.useCallback(()=>ce.postRender(s),[s]),n]}const jc=t=>!0===t,Ic=({children:t,id:n,inherit:i=!0})=>{const s=e.useContext(f),o=e.useContext(Bc),[r,a]=Oc(),l=e.useRef(null),c=s.id||o;null===l.current&&((t=>jc(!0===t)||"id"===t)(i)&&c&&(n=n?c+"-"+n:c),l.current={id:n,group:jc(i)&&s.group||cc()});const u=e.useMemo(()=>({...l.current,forceRender:r}),[a]);return d(f.Provider,{value:u,children:t})},Fc=e.createContext({strict:!1}),Wc={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 Nc=!1;function Uc(){return function(){if(Nc)return;const t={};for(const e in Wc)t[e]={isEnabled:t=>Wc[e].some(e=>!!t[e])};ma(t),Nc=!0}(),ga()}function $c(t){const e=Uc();for(const n in t)e[n]={...e[n],...t[n]};ma(e)}function zc(t){return"function"==typeof t}const Yc=e.createContext(null),Xc=["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 Hc(t){return"string"==typeof t&&!t.includes("-")&&!!(Xc.indexOf(t)>-1||/[A-Z]/u.test(t))}const Gc=(t,n)=>n.isSVG??Hc(t)?new Ca(n):new Pa(n,{allowProjection:t!==e.Fragment}),Kc=e.createContext({});function _c(t){const{initial:n,animate:i}=function(t,e){if(ra(t)){const{initial:e,animate:n}=t;return{initial:!1===e||ia(e)?e:void 0,animate:ia(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(Kc));return e.useMemo(()=>({initial:n,animate:i}),[qc(n),qc(i)])}function qc(t){return Array.isArray(t)?t.join(" "):t}const Zc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Jc(t,e,n){for(const i in e)ls(e[i])||ba(i,n)||(t[i]=e[i])}function Qc(t,n){const i={};return Jc(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return _s(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function tu(t,e){const n={},i=Qc(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.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=i,n}const eu=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function nu(t,n,i,s){const o=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return to(e,n,Aa(s),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Jc(e,t.style,t),o.style={...e,...o.style}}return o}const iu=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 su(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||iu.has(t)}function ou(t,e){return t.startsWith("on")?!su(t):e?.(t)??!su(t)}function ru(t,e,n,i){const s={};for(const o in t)"values"===o&&"object"==typeof t.values||ls(t[o])||(ou(o,i)||!0===n&&su(o)||!e&&!su(o)||t.draggable&&o.startsWith("onDrag"))&&(s[o]=t[o]);return s}function au(t,n,i,{latestValues:s},o,r=!1,a,l){const c=(a??Hc(t)?nu:tu)(n,s,o,t),u=ru(n,"string"==typeof t,r,l),h=t!==e.Fragment?{...u,...c,ref:i}:{},{children:d}=n,p=e.useMemo(()=>ls(d)?d.get():d,[d]);return e.createElement(t,{...h,children:p})}function lu(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=Al(o[t]);let{initial:r,animate:a}=t;const l=ra(t),c=aa(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!na(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n(n,i)=>{const s=e.useContext(Kc),o=e.useContext(v),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:lu(n,i,s,t),renderState:e()}}(t,n,s,o);return i?r():m(r)},uu=cu({scrapeMotionValuesFromProps:Ta,createRenderState:Zc}),hu=cu({scrapeMotionValuesFromProps:Va,createRenderState:eu}),du=Symbol.for("motionComponentSymbol");function pu(t,n,i){const s=e.useRef(i);e.useInsertionEffect(()=>{s.current=i});const o=e.useRef(null);return e.useCallback(e=>{e&&t.onMount?.(e),n&&(e?n.mount(e):n.unmount());const i=s.current;if("function"==typeof i)if(e){const t=i(e);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):i(e);else i&&(i.current=e)},[n])}const fu=e.createContext({});function mu(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function gu(t,n,i,s,o,r){const{visualElement:a}=e.useContext(Kc),l=e.useContext(Fc),c=e.useContext(v),u=e.useContext(Pc),h=u.reducedMotion,d=u.skipAnimations,p=e.useRef(null),f=e.useRef(!1);s=s||l.renderer,!p.current&&s&&(p.current=s(t,{visualState:n,parent:a,props:i,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:h,skipAnimations:d,isSVG:r}),f.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const m=p.current,g=e.useContext(fu);!m||m.projection||!o||"html"!==m.type&&"svg"!==m.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:yu(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&mu(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}(p.current,i,o,g);const x=e.useRef(!1);e.useInsertionEffect(()=>{m&&x.current&&m.update(i,c)});const w=i[ps],S=e.useRef(Boolean(w)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return y(()=>{f.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),y(()=>{f.current=!0,m&&(x.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),S.current&&m.animationState&&m.animationState.animateChanges())}),e.useEffect(()=>{m&&(!S.current&&m.animationState&&m.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),S.current=!1),m.enteringChildren=void 0)}),m}function yu(t){if(t)return!1!==t.options.allowProjection?t.projection:yu(t.parent)}function vu(t,{forwardMotionProps:n=!1,type:i}={},s,o){s&&$c(s);const r=i?"svg"===i:Hc(t),a=r?hu:uu;function l(i,s){let l;const c={...e.useContext(Pc),...i,layoutId:xu(i)},{isStatic:u,isValidProp:h}=c,f=_c(i),m=a(i,u);if(!u&&"undefined"!=typeof window){e.useContext(Fc).strict;const n=function(t){const e=Uc(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(c);l=n.MeasureLayout,f.visualElement=gu(t,m,c,o,n.ProjectionNode,r)}return p(Kc.Provider,{value:f,children:[l&&f.visualElement?d(l,{visualElement:f.visualElement,...c}):null,au(t,i,pu(m,f.visualElement,s),m,u,n,r,h)]})}l.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;const c=e.forwardRef(l);return c[du]=t,c}function xu({layoutId:t}){const n=e.useContext(f).id;return n&&void 0!==t?n+"-"+t:t}function wu(t,e){if("undefined"==typeof Proxy)return vu;const n=new Map,i=(n,i)=>vu(n,i,t,e);return new Proxy((t,e)=>i(t,e),{get:(s,o)=>"create"===o?i:(n.has(o)||n.set(o,vu(o,void 0,t,e)),n.get(o))})}let Su=0;const bu={animation:{Feature:class extends xa{constructor(t){super(t),t.animationState||(t.animationState=Ra(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();na(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 xa{constructor(){super(...arguments),this.id=Su++}update(){const{presenceContext:t,prevPresenceContext:e,animationState:n}=this.node;if(!t||!n)return;const{isPresent:i,onExitComplete:s}=t,o=e?.isPresent;if(i===o)return;if(i&&!1===o){if(!0===this.exit){const{initial:t}=this.node.getProps();if(t&&!Array.isArray(t)){const{transition:e,transitionEnd:n,...i}=es(this.node,t)||{};for(const t in i)this.node.getValue(t)?.jump(i[t])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive("exit",!1);return void(this.exit=void 0)}const r=this.exit=n.setActive("exit",!i);s&&!i&&r.then(()=>{this.exit===r&&(this.exit=!0,s(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 Tu(t){return{point:{x:t.pageX,y:t.pageY}}}const Pu=t=>e=>Yo(e)&&t(e,Tu(e));function Eu(t,e,n,i){return bl(t,e,Pu(n),i)}const Au=({current:t})=>t?t.ownerDocument.defaultView:null,Mu=(t,e)=>Math.abs(t-e);function Vu(t,e){const n=Mu(t.x,e.x),i=Mu(t.y,e.y);return Math.sqrt(n**2+i**2)}const Cu=new Set(["auto","scroll"]);class ku{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Du(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Lu(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Vu(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t;this.history.push({...i,timestamp:at.now()});const{onStart:s,onMove:o}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=Du(e,this.transformPagePoint),this.hasPendingMove=!0,ce.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Lu("pointercancel"===t.type?this.lastMoveEventInfo:Du(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!Yo(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const a=Du(Tu(t),this.transformPagePoint),{point:l}=a,{timestamp:c}=st;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=e;u&&u(t,Lu(a,this.history));const h={passive:!0,capture:!0};this.removeListeners=k(Eu(this.contextWindow,"pointermove",this.handlePointerMove,h),Eu(this.contextWindow,"pointerup",this.handlePointerUp,h),Eu(this.contextWindow,"pointercancel",this.handlePointerUp,h)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(Cu.has(t.overflowX)||Cu.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s=i.x-e.x,o=i.y-e.y;0===s&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,i),ce.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ue(this.updatePoint)}}function Du(t,e){return e?{point:e(t.point)}:t}function Ru(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Lu({point:t},e){return{point:t,delta:Ru(t,Ou(e)),offset:Ru(t,Bu(e)),velocity:ju(e,.1)}}function Bu(t){return t[0]}function Ou(t){return t[t.length-1]}function ju(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Ou(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>L(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*L(e)&&(i=t[1]);const o=B(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Iu(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Fu(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min{e&&this.snapToCursor(t),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=No(n),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),al(t=>{let e=this.getAxisMotionValue(t).get()||0;if(dt(e)&&(e=Qi(e,this.visualElement.current)||0),Vt.test(e))e=parseFloat(e);else if(Mt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Wa(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&ce.update(()=>s(t,e),!1,!0),us(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&ce.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:n,contextWindow:Au(this.visualElement),element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&ce.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Xu(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&tn&&(t=i?Gt(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&mu(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Iu(t.x,n,s),y:Iu(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=Wu){return!1===t?t=0:!0===t&&(t=Wu),{x:Nu(t,"left","right"),y:Nu(t,"top","bottom")}}(e),i!==this.constraints&&!mu(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&al(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!mu(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const s=Co(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Fu(t.x,e.x),y:Fu(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(co(o));this.hasMutatedConstraints=!!t,t&&(o=lo(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=al(r=>{if(!Xu(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return us(this.visualElement,t),n.start(Gi(t,n,0,e,this.visualElement,!1))}stopAnimation(){al(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps()[e];return n||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor({clientX:t,clientY:e}){const{drag:n}=this.getProps(),i={x:t,y:e},s=this.visualElement.getTransformPagePoint()?.(i)||i,o=this.visualElement.measureViewportBox();al(t=>{if(!Xu(t,n,this.currentDirection))return;const e=this.getAxisMotionValue(t),{min:i,max:r}=o[t];e.set((e.get()||0)+s[t]-Gt(i,r,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!mu(e)||!n||!this.constraints)return;this.stopAnimation();const i=this.constraints,s={x:0,y:0};al(t=>{const e=this.getAxisMotionValue(t).get();s[t]=function(t,e){let n=.5;const i=Wa(t),s=Wa(e);return s>i?n=D(e.min,e.max-i,t.min):i>s&&(n=D(t.min,t.max-s,e.min)),b(0,1,n)}({min:e,max:e},i[t])});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),al(e=>{const n=this.getAxisMotionValue(e);if(!Xu(e,t,null)||!n.get())return;const{min:i,max:o}=this.constraints[e];n.set(Gt(i,o,s[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;$u.set(this.visualElement,this);const t=this.visualElement.current,e=Eu(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&Ko(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps();mu(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=pr(t,Yu(n)),s=pr(e,Yu(n));return()=>{i(),s()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ce.read(i);const r=bl(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(al(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Wu,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Yu(t){let e=!0;return()=>{e?e=!1:t()}}function Xu(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Hu=t=>(e,n)=>{t&&ce.update(()=>t(e,n),!1,!0)};let Gu=!1;const Ku=({layout:t,layoutDependency:e})=>({layout:t,layoutDependency:e,animationType:"string"==typeof t?t:"both"});class _u extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),Gu&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,...Ku(this.props),onExitComplete:()=>this.safeToRemove()})),Cl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layout:e,layoutDependency:n,visualElement:i,drag:s,isPresent:o}=this.props,{projection:r}=i;return r?(r.isPresent=o,t.layoutDependency===n&&t.layout===e||r.setOptions({...r.options,...Ku(this.props)}),Gu=!0,s||t.layoutDependency!==n||void 0===n||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||ce.postRender(()=>{const t=r.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=e,n.root.didUpdate(),jo.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;Gu=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function qu(t){const[n,i]=Dc(),s=e.useContext(f);return d(_u,{...t,layoutGroup:s,switchLayoutGroup:e.useContext(fu),isPresent:n,safeToRemove:i})}const Zu={pan:{Feature:class extends xa{constructor(){super(...arguments),this.removePointerDownListener=C}onPointerDown(t){this.session=new ku(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Au(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Hu(t),onStart:Hu(e),onMove:Hu(n),onEnd:(t,e)=>{delete this.session,i&&ce.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Eu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends xa{constructor(t){super(t),this.removeGroupControls=C,this.removeListeners=C,this.controls=new zu(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||C}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:hc,MeasureLayout:qu}};function Ju(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&ce.postRender(()=>s(e,Tu(e)))}function Qu(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&ce.postRender(()=>s(e,Tu(e)))}const th=new WeakMap,eh=new WeakMap,nh=t=>{const e=th.get(t.target);e&&e(t)},ih=t=>{t.forEach(nh)};function sh(t,e,n){const i=function({root:t,...e}){const n=t||document;eh.has(n)||eh.set(n,{});const i=eh.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(ih,{root:t,...e})),i[s]}(e);return th.set(t,n),i.observe(t),()=>{th.delete(t),i.unobserve(t)}}const oh={some:0,all:1};const rh={inView:{Feature:class extends xa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:oh[i]};this.stopObserver=sh(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends xa{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=tr(t,(t,e)=>(Qu(this.node,e,"Start"),(t,{success:e})=>Qu(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends xa{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=k(bl(this.node.current,"focus",()=>this.onFocus()),bl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends xa{mount(){const{current:t}=this.node;t&&(this.unmount=$o(t,(t,e)=>(Ju(this.node,e,"Start"),t=>Ju(this.node,t,"End"))))}unmount(){}}}},ah={layout:{ProjectionNode:hc,MeasureLayout:qu}},lh=wu({...bu,...rh,...Zu,...ah},Gc);function ch(t,e,n,i,s,o="ltr"){const r=t.findIndex(t=>t.value===e);if(-1===r)return t;if("xy"===s){const{layout:e}=t[r],i={x:Gt(e.x.min,e.x.max,.5)+n.x,y:Gt(e.y.min,e.y.max,.5)+n.y},s=function(t){const e=[];return t.forEach(t=>{const{min:n,max:i}=t.layout.y,s=e[e.length-1];!s||n>=s.max||i<=s.min?e.push({items:[t],min:n,max:i}):(s.items.push(t),s.min=Math.min(s.min,n),s.max=Math.max(s.max,i))}),e}(t),a=s.find(e=>e.items.includes(t[r])),l=s.reduce((t,e)=>uh(i.y,e)n!==e),r=i.items.find(t=>{const e=Gt(t.layout.x.min,t.layout.x.max,.5);return"ltr"===s?ne}),a=r?o.indexOf(r):o.indexOf(i.items[i.items.length-1])+1,l=[...o];return l.splice(a,0,t[e]),l.every((e,n)=>e===t[n])?t:l}(t,r,i.x,l,o);const c=hh(i,e);let u=-1,h=c;return t.forEach((t,e)=>{if(e===r)return;const n=hh(i,t.layout);n0?1:-1,l=t[r+a];if(!l)return t;const c=t[r].layout[s],u=l.layout[s],h=Gt(u.min,u.max,.5);return 1===a&&c.max+n[s]>h||-1===a&&c.min+n[s]e.max?t-e.max:0}function hh(t,e){const n=Math.max(e.x.min-t.x,0,t.x-e.x.max),i=Math.max(e.y.min-t.y,0,t.y-e.y.max);return n*n+i*i}const dh=(t,e)=>t.max<=e.min||e.max<=t.min;function ph({children:t,as:n="ul",axis:i,onReorder:s,values:o,onPointerDownCapture:r,onClickCapture:a,...l},c){const u=m(()=>lh[n]),h=e.useRef(new Map),[p,f]=e.useState("y"),g=e.useRef(!1),y=e.useRef(!1),v=e.useRef(null),x=i||p,w=new Set(o);h.current.forEach((t,e)=>{w.has(e)||h.current.delete(e)});const S={axis:x,groupRef:v,hasReordered:y,registerItem:(t,e)=>{if(h.current.set(t,e),!i){const t=function(t){let e=!1,n=!1;for(let i=0;i{const e=h.current.get(t);return e?[e]:[]}));t!==p&&f(t)}},updateOrder:(t,e,n)=>{if(g.current)return;const i=o.flatMap(t=>{const e=h.current.get(t);return e?[{value:t,layout:e}]:[]}),r="rtl"===v.current?.ownerDocument.defaultView?.getComputedStyle(v.current).direction?"rtl":"ltr",a=ch(i,t,e,n,x,r);if(i!==a){g.current=!0,y.current=!0;const t=[...o],e=i.map(({value:t})=>o.indexOf(t));a.forEach(({value:n},i)=>{t[e[i]]=n}),s(t)}}};e.useEffect(()=>{g.current=!1},[o]);const b={overflowAnchor:"none",...l.style};return d(u,{...l,style:b,ref:t=>{v.current=t,"function"==typeof c?c(t):c&&(c.current=t)},onPointerDownCapture:t=>{y.current=!1,r?.(t)},onClickCapture:t=>{y.current&&t.detail&&(y.current=!1,t.stopPropagation(),t.preventDefault()),a?.(t)},ignoreStrict:!0,children:d(Yc.Provider,{value:S,children:t})})}const fh=e.forwardRef(ph);function mh(t){const n=m(()=>Fi(t)),{isStatic:i}=e.useContext(Pc);if(i){const[,i]=e.useState(t);e.useEffect(()=>n.on("change",i),[])}return n}function gh(t,e){const n=mh(e()),i=()=>n.set(e());return i(),y(()=>{const e=()=>ce.preRender(i,!1,!0),n=t.map(t=>t.on("change",e));return i(),()=>{n.forEach(t=>t()),ue(i)}}),n}function yh(t,e,n,i){if("function"==typeof t)return function(t){ji.current=[],t();const e=gh(ji.current,t);return ji.current=void 0,e}(t);if(void 0!==n&&!Array.isArray(n)&&"function"!=typeof e)return function(t,e,n,i){const s=m(()=>Object.keys(n)),o=m(()=>({}));for(const r of s)o[r]=yh(t,e,n[r],i);return o}(t,e,n,i);const s="function"==typeof e?e:gr(e,n,i),o=Array.isArray(t)?vh(t,s):vh([t],([t])=>s(t)),r=Array.isArray(t)?void 0:t.accelerate;if(r&&!r.isTransformed&&"function"!=typeof e&&Array.isArray(n)&&!1!==i?.clamp){const t=i?.ease;o.accelerate={...r,times:[0,...e,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...t?{ease:Array.isArray(t)?[t[0],...t]:t}:{}}}return o}function vh(t,e){const n=m(()=>[]);return gh(t,()=>{n.length=0;const i=t.length;for(let e=0;e0))return;Sh.set(s,a);const t="x"===n?s.scrollWidth-(c?window.innerWidth:s.clientWidth):s.scrollHeight-(c?window.innerHeight:s.clientHeight);wh.set(s,t)}if(r>0){const t=wh.get(s);if(("x"===n?c?window.scrollX:s.scrollLeft:c?window.scrollY:s.scrollTop)>=t)return}"x"===n?c?window.scrollBy({left:r}):s.scrollLeft+=r:c?window.scrollBy({top:r}):s.scrollTop+=r}function Ah(t,e=0){return ls(t)?t:mh(e)}function Mh({children:t,style:n={},value:i,as:s="li",onDrag:o,onDragEnd:r,layout:a=!0,...l},c){const u=m(()=>lh[s]),h=e.useContext(Yc),p={x:Ah(n.x),y:Ah(n.y)},f=yh([p.x,p.y],([t,e])=>t||e?1:"unset"),{axis:g,registerItem:y,updateOrder:v,groupRef:x,hasReordered:w}=h;return d(u,{drag:"xy"===g||g,...l,dragSnapToOrigin:!0,style:{...n,x:p.x,y:p.y,zIndex:f},layout:a,onDrag:(t,e)=>{const{velocity:n,point:s}=e,r={x:p.x.get(),y:p.y.get()};v(i,r,n);const a="xy"===g?Math.abs(n.x)>Math.abs(n.y)?"x":"y":g;Eh(x.current,s[a],a,n[a]),o&&o(t,e)},onDragEnd:(t,e)=>{w.current=!1,function(){if(bh){const t=Ph(bh,"y");t&&(Sh.delete(t),wh.delete(t));const e=Ph(bh,"x");e&&e!==t&&(Sh.delete(e),wh.delete(e)),bh=null}}(),r&&r(t,e)},onLayoutMeasure:t=>{y(i,t)},ref:c,ignoreStrict:!0,children:t})}const Vh=e.forwardRef(Mh);var Ch=Object.freeze({__proto__:null,Group:fh,Item:Vh});function kh(t){return"object"==typeof t&&!Array.isArray(t)}function Dh(t,e,n,i){return null==t?[]:"string"==typeof t&&kh(e)?Fs(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Rh(t,e,n){return t*(e+1)+n*e}function Lh(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Bh(t,e,n,i,s,o){!function(t,e,n){for(let i=0;ie&&s.at"number"==typeof t,$h=t=>t.every(Uh);function zh(t,e,n,i){const s=[];if(function(t,e){return ls(t)||"number"==typeof t||"string"==typeof t&&!kh(e)}(t,e))s.push(Sl(t,kh(e)&&e.default||e,n&&n.default||n));else{if(null==t)return s;const o=Dh(t,e,i),r=o.length;for(let t=0;t{const l=Wh(t),{delay:c=0,times:u=Ue(l),type:p=e.type||"keyframes",repeat:f,repeatType:m,repeatDelay:y=0,...v}=n;let{ease:x=e.ease||"easeOut",duration:w}=n;const S="function"==typeof c?c(r,a):c,b=l.length,T=ei(p)?p:s?.[p||"keyframes"];if(b<=2&&T){let t=100;if(2===b&&$h(l)){const e=l[1]-l[0];t=Math.abs(e)}const n={...e,...v};void 0!==w&&(n.duration=L(w));const i=ge(n,t,T);x=i.ease,w=i.duration}w??(w=o);const P=h+S;1===u.length&&0===u[0]&&(u[1]=1);const E=u.length-l.length;if(E>0&&Ne(u,E),1===l.length&&l.unshift(null),f&&f<20){const t=w>0?y/w:0;w=Rh(w,f,y);const e=[...l],n=[...u];x=Array.isArray(x)?[...x]:[x];const i=[...x],s="reverse"===m||"mirror"===m;let o=e,r=i;s&&(o=[...e].reverse(),"reverse"===m&&(r=[...i].reverse().map(t=>"function"==typeof t?$(t):t)));for(let a=0;a0&&(l.push(l[l.length-1]),u.push(p),x.push("linear")),l.push(...h);for(let t=0;t{for(const s in t){const o=t[s];o.sort(jh);const a=[],l=[],c=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=Fi(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:Ie});return s.forEach(({keyframes:t,transition:e},n)=>{i.push(...zh(n,t,e))}),i}function Xh(t={}){const{scope:e,reduceMotion:n,skipAnimations:i}=t;return function(t,s,o){let r,a=[];const l={};if(void 0!==n&&(l.reduceMotion=n),void 0!==i&&(l.skipAnimations=i),c=t,Array.isArray(c)&&c.some(Array.isArray)){const{onComplete:n,...i}=s||{};"function"==typeof n&&(r=n),a=Yh(t,{...l,...i},e)}else{const{onComplete:n,...i}=o||{};"function"==typeof n&&(r=n),a=zh(t,s,{...l,...i},e)}var c;const u=new ki(a);return r&&u.finished.then(r),e&&(e.animations.push(u),u.finished.then(()=>{w(e.animations,u)})),u}}const Hh=Object.assign(Xh(),{addEffect:Ds,removeEffect:Rs});const Gh=t=>function(e,n,i){return new ki(function(t,e,n,i){if(null==t)return[];const s=Fs(t,i),o=s.length,r=[];for(let t=0;te.delete(n)),a.push(s)}return a}(e,n,i,t))},Kh=Gh(),_h={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}},qh=new WeakMap;function Zh(t,e,n,i){const s=n[e],{length:o,position:r}=_h[e],a=s.current,l=n.time,c=t[`scroll${r}`];s.current=function(t,e){const n=t===document.scrollingElement,i=n&&document.body||t;let s=qh.get(i);s||qh.set(i,s=getComputedStyle(i));const{writingMode:o,flexDirection:r}=s,a="x"===e!==/^[vs]/.test(o);return(a?"rtl"===s.direction!=("sideways-lr"===o):o.endsWith("rl"))!==(!n&&s.display.includes("flex")&&(a!==("c"===r[0])?r:s.flexWrap).endsWith("reverse"))}(t,e)?-c||0:c,s.containerLength=t[`client${o}`],s.targetLength=t[`scroll${o}`],s.scrollLength=s.targetLength-s.containerLength,s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=b(0,1,D(0,s.scrollLength,s.current));const u=i-l;s.velocity=u>50?0:O(s.current-a,u)}const Jh={start:0,center:.5,end:1};function Qh(t,e,n=0){let i=0;if(t in Jh&&(t=Jh[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const td=[0,0];function ed(t,e,n,i){let s=Array.isArray(t)?t:td,o=0,r=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,Jh[t]?t:"0"]),o=Qh(s[0],n,i),r=Qh(s[1],e),o-r}const nd={All:[[0,0],[1,1]]};function id(t,e){const{offset:n=nd.All,axis:i="y"}=e,s=t[i];s.offset.length=0;const o=n.length;for(let t=0;tt[n],s=e=>t[i?n-e:e];if(t[0]===t[1]&&e=s(o+1);)o++;const r=(o+D(s(o),s(o+1),e))/n;return i?1-r:r}(s.offset,s.current))}function sd(t,e,n,i={}){const{target:s}=i,o=s||i.offset;return{measure:e=>{if(o){n.time=e.time;for(const t in _h){const i=t,{offset:s}=n[i];Object.assign(n[i],e[i]),n[i].offset=s}if(s&&s!==t){const e=function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(js(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,o=i.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=i.parentNode;i=s}}return n}(s,t),i=function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(s);n.x.targetOffset=e.x,n.y.targetOffset=e.y,n.x.targetLength=i.width,n.y.targetLength=i.height}id(n,i)}},notify:t=>e(o?n:t)}}const od=new WeakMap,rd=new WeakMap,ad=new WeakMap,ld=new WeakMap,cd=t=>t===document.scrollingElement?window:t;function ud(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return C;let s=ad.get(e);s||(s=new Set,ad.set(e,s));const o=sd(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(o),!od.has(e)){const t={time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n=()=>{!function(t,e,n){for(const i in _h)Zh(t,i,e,n);e.time=n}(e,t,st.timestamp);for(const e of s)e.measure(t);ce.preUpdate(i)},i=()=>{for(const e of s)e.notify(t)},o=()=>ce.read(n);od.set(e,o);const r=cd(e);window.addEventListener("resize",o),e!==document.documentElement&&rd.set(e,pr(e,o)),r.addEventListener("scroll",o),o()}if(n&&!ld.has(e)){const t=od.get(e),n={width:e.scrollWidth,height:e.scrollHeight},i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=ce.read(i,!0);ld.set(e,s)}const r=od.get(e);return ce.read(r,!1,!0),()=>{ue(r);const t=ad.get(e);if(!t)return;if(t.delete(o),t.size)return;ad.delete(e);const n=od.get(e);od.delete(e),n&&(cd(e).removeEventListener("scroll",n),rd.get(e)?.(),window.removeEventListener("resize",n));const i=ld.get(e);i&&(ue(i),ld.delete(e))}}const hd=new Map;const dd=t=>{if(/v/u.test(t))return[];const e=ed(t,0,0,0);return[ed(t,0,1,0)-e,e-ed(t,1,0,0),e]},pd=([t,e,n])=>!n&&(0===e||1===e)&&`${e?"entry":"exit"}-crossing ${100*t}%`;function fd(t=nd.All){if(2!==t.length)return;const[e,n]=t.map(dd),i=[pd(e),pd(n)],s=n[0]-e[0],o=e[1]-n[1];return i[0]&&i[1]&&(s||o)?{points:i,a:s,b:o,cover:!e[0]&&1===s&&1===o}:void 0}function md(t,e){const{target:n,container:i,axis:s}=e,o=n&&fd(e.offset),r=function(t){return"undefined"!=typeof window&&(t?_n():Kn())}(n)&&(n?!!o:!e.offset),a=new Map,l=new Set;let c,u=!1;const h=(t,e)=>{const[n,i]=o.points;e.effect.updateTiming({direction:u?"normal"===t?"reverse":"alternate-reverse":t}),Object.assign(e,{rangeStart:u?i:n,rangeEnd:u?n:i}),e.play()},d=[t.attachTimeline({get timeline(){return r?function({container:t,target:e,axis:n}){let i=hd.get(t);i||(i=new Map,hd.set(t,i));const s=e??"self";let o=i.get(s);return o||(o={},i.set(s,o)),o[n]||(o[n]=e?new ViewTimeline({subject:e,axis:n}):new ScrollTimeline({source:t,axis:n}))}(e):void 0},onAttach:o&&(t=>{const e=t.effect.getTiming().direction;a.set(t,e),h(e,t)}),observe:t=>(t.pause(),l.add(t),c||(c=ud(t=>{l.forEach(e=>{e.time=e.iterationDuration*t[s].progress})},e)),()=>l.delete(t))})];if(r&&o){const{a:t,b:e}=o,r="y"===s?"clientHeight":"clientWidth",l=()=>{u!==(u=t*n[r]+e*i[r]<0)&&a.forEach(h)};l(),t*e<0&&d.push(pr(l),pr([n,i],l))}return()=>{d.forEach(t=>t()),c?.()}}function gd(t,{axis:e="y",source:n,container:i=document.scrollingElement,...s}={}){if(!i)return C;const o={axis:e,container:n||i,...s};return"function"==typeof t?ud(n=>t(n[e].progress,n),o):md(t,o)}const yd={some:0,all:1};function vd(t,e,{root:n,margin:i,amount:s="some"}={}){const o=Fs(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof s?s:yd[s]});return o.forEach(t=>a.observe(t)),()=>a.disconnect()}const xd=wu();function wd(t){return e.useEffect(()=>()=>t(),[])}const Sd={renderer:Gc,...bu,...rh},bd={...Sd,...Zu,...ah},Td={renderer:Gc,...bu};function Pd(t,n,i){e.useInsertionEffect(()=>t.on(n,i),[t,n,i])}const Ed=()=>({scrollX:Fi(0),scrollY:Fi(0),scrollXProgress:Fi(0),scrollYProgress:Fi(0)}),Ad=t=>!!t&&!t.current;function Md(t,e,n,i){return{factory:s=>{let o;const r=()=>{Ad(n)||Ad(i)?jo.read(r):o=gd(s,{...e,axis:t,container:n?.current||void 0,target:i?.current||void 0})};return jo.read(r),()=>{Io(r),o?.()}},times:[0,1],keyframes:[0,1],ease:t=>t,duration:1}}function Vd({container:t,target:n,...i}={}){const s=m(Ed);(function(t,e){return"undefined"!=typeof window&&(t?_n()&&!!fd(e):Kn()&&!e)})(n,i.offset)&&(s.scrollXProgress.accelerate=Md("x",i,t,n),s.scrollYProgress.accelerate=Md("y",i,t,n));const o=e.useRef(null),r=e.useRef(!1),a=e.useCallback(()=>(o.current=gd((t,{x:e,y:n})=>{s.scrollX.set(e.current),s.scrollXProgress.set(e.progress),s.scrollY.set(n.current),s.scrollYProgress.set(n.progress)},{...i,container:t?.current||void 0,target:n?.current||void 0}),()=>{o.current?.()}),[t,n,JSON.stringify(i.offset)]);return y(()=>(r.current=!1,Ad(t)||Ad(n)?void(r.current=!0):a()),[a]),e.useEffect(()=>{if(!r.current)return;let e;const i=()=>{const i=Ad(t),s=Ad(n);i||s||(e=a())};return jo.read(i),()=>{Io(i),e?.()}},[a]),s}function Cd(t,n,i){const{isStatic:s}=e.useContext(Pc),o=()=>ls(t)?t.get():t;if(s)return yh(o);const r=mh(o());return e.useInsertionEffect(()=>i(r,t,n),[r,JSON.stringify(n)]),r}function kd(t){const n=e.useRef(0),{isStatic:i}=e.useContext(Pc);e.useEffect(()=>{if(i)return;const e=({timestamp:e,delta:i})=>{n.current||(n.current=e),t(e-n.current,i)};return ce.update(e,!0),()=>ue(e)},[t])}class Dd extends Ii{constructor(){super(...arguments),this.isEnabled=!1}add(t){(Cn.has(t)||ui.has(t))&&(this.isEnabled=!0,this.update())}update(){this.set(this.isEnabled?"transform":"auto")}}function Rd(){!ua.current&&da();const[t]=e.useState(ca.current);return t}function Ld(){const t=Rd(),{reducedMotion:n}=e.useContext(Pc);return"never"!==n&&("always"===n||t)}function Bd(t,e){[...e].reverse().forEach(n=>{const i=t.getVariant(n);i&&as(t,i),t.variantChildren&&t.variantChildren.forEach(t=>{Bd(t,e)})})}function Od(){const t=new Set,e={subscribe:e=>(t.add(e),()=>{t.delete(e)}),start(e,n){const i=[];return t.forEach(t=>{i.push(xs(t,e,{transitionOverride:n}))}),Promise.all(i)},set:e=>t.forEach(t=>{!function(t,e){Array.isArray(e)?Bd(t,e):"string"==typeof e?Bd(t,[e]):as(t,e)}(t,e)}),stop(){t.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>()=>{e.stop()}};return e}function jd(){const t=m(Od);return y(t.mount,[]),t}const Id=jd;class Fd{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const Wd=()=>new Fd;function Nd(t){return null!==t&&"object"==typeof t&&du in t}function Ud(){return $d}function $d(t){uc.current&&(uc.current.isUpdating=!1,uc.current.blockUpdate(),t&&t())}const zd=new Map,Yd=new Map,Xd=(t,e)=>`${t}: ${Cn.has(e)?"transform":e}`;function Hd(t,e,n){const i=Xd(t,e),s=zd.get(i);if(!s)return null;const{animation:o,startTime:r}=s;function a(){window.MotionCancelOptimisedAnimation?.(t,e,n)}return o.onfinish=a,null===r||window.MotionHandoffIsComplete?.(t)?(a(),null):r}let Gd,Kd;const _d=new Set;function qd(){_d.forEach(t=>{t.animation.play(),t.animation.startTime=t.startTime}),_d.clear()}const Zd=()=>({});class Jd extends ya{constructor(){super(...arguments),this.measureInstanceViewportBox=ta}build(){}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}}const Qd=cu({scrapeMotionValuesFromProps:Zd,createRenderState:Zd});let tp=0;const ep=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:i=!0,onExitComplete:s,presenceAffectsLayout:o=!0,mode:r="sync",propagate:a=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[p,g]=Dc(a),v=e.useMemo(()=>Lc(t),[t]),x=a&&!p?[]:v.map(Rc),w=e.useRef(!0),S=m(()=>new Map),b=e.useRef(new Set),[T,P]=e.useState(v),[E,A]=e.useState(v);y(()=>{!a||p||E.length||g?.()},[p,a,E.length,g]);const M=e.useRef();e.useEffect(()=>()=>{const t=M.current;M.current=void 0,t?.()},[E]),y(()=>{w.current=!1;for(let t=0;tS.get(Rc(t)))?t=v:"wait"===r&&(t=V),A(Lc(t)),P(v),null}const{forceRender:C}=e.useContext(f);return d(h,{children:E.map(t=>{const e=Rc(t),h=!(a&&!p)&&(v===E||x.includes(e));return d(Cc,{isPresent:h,initial:!(w.current&&!i)&&void 0,custom:n,presenceAffectsLayout:o,mode:r,root:u,onExitComplete:h?void 0:()=>{if(b.current.has(e))return;if(!S.has(e))return;b.current.add(e),S.set(e,!0);let t=!0;S.forEach(e=>{e||(t=!1)}),t&&(C?.(),P([]),a&&g?.(),M.current=s)},anchorX:l,anchorY:c,children:t},e)})})},t.AnimateSharedLayout=({children:t})=>(i.useEffect(()=>{},[]),d(Ic,{id:m(()=>"asl-"+tp++),children:t})),t.AsyncMotionValueAnimation=Mi,t.DOMKeyframesResolver=Es,t.DOMVisualElement=va,t.DeprecatedLayoutGroupContext=Bc,t.DocumentProjectionNode=ac,t.DragControls=Fd,t.Feature=xa,t.FlatTree=Pl,t.GroupAnimation=Vi,t.GroupAnimationWithThen=ki,t.HTMLProjectionNode=hc,t.HTMLVisualElement=Pa,t.JSAnimation=nn,t.KeyframeResolver=zn,t.LayoutAnimationBuilder=wc,t.LayoutGroup=Ic,t.LayoutGroupContext=f,t.LazyMotion=function({children:t,features:n,strict:i=!1}){const[,s]=e.useState(!zc(n)),o=e.useRef(void 0);if(!zc(n)){const{renderer:t,...e}=n;o.current=t,$c(e)}return e.useEffect(()=>{zc(n)&&n().then(({renderer:t,...e})=>{$c(e),o.current=t,s(!0)})},[]),d(Fc.Provider,{value:{renderer:o.current,strict:i},children:t})},t.MotionConfig=function({children:t,...n}){const i=e.useContext(Pc);(n={...i,...n}).transition=Wi(n.transition,i.transition),n.isStatic=m(()=>n.isStatic);const s=e.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations,n.isValidProp]);return d(Pc.Provider,{value:s,children:t})},t.MotionConfigContext=Pc,t.MotionContext=Kc,t.MotionGlobalConfig=P,t.MotionValue=Ii,t.MotionValueState=Ns,t.NativeAnimation=ii,t.NativeAnimationExtended=ai,t.NativeAnimationWrapper=Di,t.NodeStack=Ml,t.ObjectVisualElement=class extends ya{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}},t.PopChild=Vc,t.PresenceChild=Cc,t.PresenceContext=v,t.Reorder=Ch,t.SVGVisualElement=Ca,t.SubscriptionManager=R,t.SwitchLayoutGroupContext=fu,t.ViewTransitionBuilder=qr,t.VisualElement=ya,t.WillChangeMotionValue=Dd,t.acceleratedValues=ui,t.addAttrValue=eo,t.addDomEvent=bl,t.addEffect=Ds,t.addPointerEvent=Eu,t.addPointerInfo=Pu,t.addSVGValue=io,t.addScaleCorrector=function(t){for(const e in t)Sa[e]=t[e],ut(e)&&(Sa[e].isCSSVariable=!0)},t.addStyleValue=Xs,t.addUniqueItem=x,t.addValueToWillChange=us,t.alpha=gt,t.analyseComplexValue=Nt,t.animate=Hh,t.animateEffectSubject=Os,t.animateElement=Lo,t.animateLayout=function(t,e,n){const{scope:i,updateDom:s,defaultOptions:o}=Sc(t,e,n);return new wc(i,s,o)},t.animateMini=Kh,t.animateMotionValue=Gi,t.animateSingleValue=Sl,t.animateTarget=ys,t.animateValue=function(t){return new nn(t)},t.animateValues=Bs,t.animateVariant=vs,t.animateView=function(t,e={}){return new qr(t,e)},t.animateVisualElement=xs,t.animationControls=Od,t.animationMapKey=Li,t.animations=bu,t.anticipate=H,t.applyAxisDelta=xo,t.applyBoxDelta=wo,t.applyGeneratorOptions=ni,t.applyPointDelta=vo,t.applyPxDefaults=Vs,t.applyTreeDeltas=To,t.arc=function(t={}){const e=function({strength:t=.5,peak:e=.5,direction:n,rotate:i=!1}={}){const s=!0===i?1:"number"==typeof i?i:0;let o;return(i,r)=>{const a=r.x-i.x,l=r.y-i.y;let c;c="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(l)?a:l)<0?-t:t;let u=qi(i.x,i.y,r.x,r.y,c,e);if(void 0===n){const t=Math.abs(a){const e={x:Ki(t,i.x,u.x,r.x),y:Ki(t,i.y,u.y,r.y)};if(s){const n=_i(t,i.x,u.x,r.x,i.y,u.y,r.y),o=h+p*t;e.rotate=F(-180,180,n-o)*s}return e}}}(t),n={interpolateProjection(t){const n=t.x.translate,i=t.y.translate;if(!(Math.sqrt(n*n+i*i)<20))return e({x:n,y:i},{x:0,y:0})},animateValues(t,n,i,s,o){if(!("x"in n)&&!("y"in n))return;const r=t("x"),a=t("y"),l=n.x,c=n.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,f=e({x:u,y:h},{x:d,y:p}),m=void 0!==f(0).rotate?t("pathRotation"):void 0,g={delay:s,...Ni(i||{},"x")};delete g.path;const y=Fi(0);y.start(Gi("",y,[0,1e3],{...g,isSync:!0,velocity:0,onUpdate:t=>{const e=f(t/1e3);r?.set(e.x),a?.set(e.y),m&&void 0!==e.rotate&&m.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),m?.set(0)},onStop:()=>m?.set(0),onCancel:()=>m?.set(0)})),y.animation&&o.push(y.animation),delete n.x,delete n.y}};return n},t.aspectRatio=ol,t.attachFollow=Tr,t.attachSpring=Er,t.attrEffect=no,t.axisDeltaEquals=rl,t.axisEquals=el,t.axisEqualsRounded=il,t.backIn=Y,t.backInOut=X,t.backOut=z,t.boxEquals=nl,t.boxEqualsRounded=sl,t.buildHTMLStyles=_s,t.buildProjectionTransform=hl,t.buildSVGAttrs=to,t.buildSVGPath=Js,t.buildTransform=vi,t.calcAxisDelta=Ua,t.calcBoxDelta=$a,t.calcChildStagger=Oi,t.calcGeneratorDuration=me,t.calcLength=Wa,t.calcRelativeAxis=za,t.calcRelativeAxisPosition=Xa,t.calcRelativeBox=Ya,t.calcRelativePosition=Ha,t.camelCaseAttributes=Ea,t.camelToDash=hs,t.cancelFrame=ue,t.cancelMicrotask=Io,t.cancelSync=Tc,t.checkVariantsDidChange=La,t.circIn=G,t.circInOut=_,t.circOut=K,t.clamp=b,t.cleanDirtyNodes=Nl,t.collectMotionValues=ji,t.color=Lt,t.compareByDepth=Tl,t.complex=zt,t.containsCSSVariable=ft,t.convertBoundingBoxToBox=lo,t.convertBoxToBoundingBox=co,t.convertOffsetToTimes=$e,t.copyAxisDeltaInto=Fa,t.copyAxisInto=ja,t.copyBoxInto=Ia,t.correctBorderRadius=cl,t.correctBoxShadow=ul,t.correctParentTransform=function(t){return e=>{const n=t.current;if(!n)return e;const i=function(t){const{transform:e}=getComputedStyle(t);if(!e||"none"===e)return null;const n=e.match(/^matrix3d\((.*)\)$/u)||e.match(/^matrix\((.*)\)$/u);if(!n)return null;const i=n[1].split(",").map(Number),s=e.startsWith("matrix3d"),o=i[0],r=i[1],a=s?i[4]:i[2],l=s?i[5]:i[3],c=o*l-r*a;return Math.abs(c)<1e-10?null:{a:l/c,b:-r/c,c:-a/c,d:o/c}}(n);if(!i)return e;const s=n.getBoundingClientRect(),o=s.left+window.scrollX+s.width/2,r=s.top+window.scrollY+s.height/2,a=e.x-o,l=e.y-r;return{x:o+i.a*a+i.c*l,y:r+i.b*a+i.d*l}}},t.createAnimationState=Ra,t.createAxis=Qr,t.createAxisDelta=Zr,t.createBox=ta,t.createDelta=Jr,t.createEffect=Us,t.createGeneratorEasing=ge,t.createProjectionNode=jl,t.createRenderBatcher=le,t.createScopedAnimate=Xh,t.cubicBezier=N,t.cubicBezierAsString=Zn,t.defaultEasing=ze,t.defaultOffset=Ue,t.defaultTransformValue=Pn,t.defaultValueTypes=dn,t.degrees=At,t.delay=El,t.delayInSeconds=function(t,e){return El(t,L(e))},t.dimensionValueTypes=Ss,t.disableInstantTransitions=function(){P.instantAnimations=!1},t.distance=Mu,t.distance2D=Vu,t.domAnimation=Sd,t.domMax=bd,t.domMin=Td,t.eachAxis=al,t.easeIn=q,t.easeInOut=J,t.easeOut=Z,t.easingDefinitionToFunction=it,t.fillOffset=Ne,t.fillWildcards=gn,t.filterProps=ru,t.findDimensionValueType=bs,t.findEffect=Ls,t.findValueType=t=>Ar.find(ws(t)),t.flushKeyframeResolvers=$n,t.followValue=function(t,e){const n=Fi(ls(t)?t.get():t);return Tr(n,t,e),n},t.frame=ce,t.frameData=st,t.frameSteps=he,t.generateLinearEasing=pe,t.getAnimatableNone=mn,t.getAnimationMap=Bi,t.getComputedStyle=er,t.getDefaultTransition=Yi,t.getDefaultValueType=pn,t.getEasingForSegment=tt,t.getFeatureDefinitions=ga,t.getFinalKeyframe=Ge,t.getMixer=ee,t.getOptimisedAppearId=fs,t.getOriginIndex=function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}},t.getValueAsType=mi,t.getValueTransition=Ni,t.getVariableValue=Qi,t.getVariantContext=function t(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(n.initial=e.props.initial),n}const n={};for(let t=0;ts(t.get()))},t.maxGeneratorDuration=fe,t.measurePageBox=Co,t.measureViewportBox=Vo,t.memo=V,t.microtask=jo,t.millisecondsToSeconds=B,t.mirrorEasing=U,t.mix=re,t.mixArray=ne,t.mixColor=Zt,t.mixComplex=se,t.mixImmediate=Ht,t.mixLinearColor=Kt,t.mixNumber=Gt,t.mixObject=ie,t.mixValues=gl,t.mixVisibility=Qt,t.motion=lh,t.motionValue=Fi,t.moveItem=S,t.nodeGroup=cc,t.noop=C,t.number=mt,t.numberValueTypes=hn,t.optimizedAppearDataAttribute=ps,t.optimizedAppearDataId=ds,t.originProps=zs,t.parseAnimateLayoutArgs=Sc,t.parseCSSVariable=Ji,t.parseValueFromTransform=En,t.percent=Mt,t.pipe=k,t.pixelsToPercent=ll,t.positionalKeys=is,t.prefersReducedMotion=ca,t.press=tr,t.progress=D,t.progressPercentage=Dt,t.propEffect=Oo,t.propagateDirtyNodes=Wl,t.px=Vt,t.readSVGValue=so,t.readStyleValue=Hs,t.readTransformValue=An,t.recordStats=function(){if(fr.value)throw fr.value=null,fr.addProjectionMetrics=null,new Error("Stats are already being measured");const t=fr;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=Ka,t.removeAxisTransforms=_a,t.removeBoxTransforms=Ja,t.removeEffect=Rs,t.removeItem=w,t.removePointDelta=Ga,t.renderHTML=wa,t.renderSVG=Ma,t.resize=pr,t.resolveElements=Fs,t.resolveMotionValue=Al,t.resolveTransition=Wi,t.resolveVariant=es,t.resolveVariantFromProps=ts,t.reverseEasing=$,t.rgbUnit=bt,t.rgba=Tt,t.rootProjectionNode=uc,t.round=en,t.sampleDelta=ri,t.scale=yt,t.scaleCorrectors=Sa,t.scalePoint=yo,t.scrapeHTMLMotionValuesFromProps=Ta,t.scrapeSVGMotionValuesFromProps=Va,t.scroll=gd,t.scrollInfo=ud,t.secondsToMilliseconds=L,t.setDragLock=No,t.setFeatureDefinitions=ma,t.setStyle=Xn,t.setTarget=as,t.spring=Ie,t.springValue=function(t,e){const n=Fi(ls(t)?t.get():t);return Er(n,t,e),n},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i,grid:s}={}){const o={};return(r,a)=>{let l=o[a];if(!l){const[t,e]=s||[1/0,1],i=Math.min(t,a)-1,r=Math.max(e,Math.ceil(a/t))-1,c="number"==typeof n,u="first"===n?0:"last"===n?1:.5,h=c?n%t:i*u,d=c?Math.floor(n/t):r*u;l=o[a]=[];for(let e=0;e{if(!t)return!1;if(!e)return Yd.has(t);const n=Xd(t,e);return Boolean(zd.get(n))},window.MotionHandoffMarkAsComplete=t=>{Yd.has(t)&&Yd.set(t,!0)},window.MotionHandoffIsComplete=t=>!0===Yd.get(t),window.MotionCancelOptimisedAnimation=(t,e,n,i)=>{const s=Xd(t,e),o=zd.get(s);o&&(n&&void 0===i?n.postRender(()=>{n.postRender(()=>{o.animation.cancel()})}):o.animation.cancel(),n&&i?(_d.add(o),n.render(qd)):(zd.delete(s),zd.size||(window.MotionCancelOptimisedAnimation=void 0)))},window.MotionCheckAppearSync=(t,e,n)=>{const i=fs(t);if(!i)return;const s=window.MotionHasOptimisedAnimation?.(i,e),o=t.props.values?.[e];if(!s||!o)return;const r=n.on("change",t=>{o.get()!==t&&(window.MotionCancelOptimisedAnimation?.(i,e),r())});return r});const a=()=>{Kd.cancel();const o=ti(t,e,n,i);void 0===Gd&&(Gd=performance.now()),o.startTime=Gd,zd.set(r,{animation:o,startTime:Gd}),s&&s(o)};Yd.set(o,!1),Kd.ready?Kd.ready.then(a).catch(C):a()},t.startWaapiAnimation=ti,t.statsBuffer=fr,t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,s="end"===e?Math.floor(i):Math.ceil(i);return b(0,1,s/t)}},t.styleEffect=Ks,t.styleSubjectEffect=Gs,t.supportedWaapiEasing=Jn,t.supportsBrowserAnimation=fi,t.supportsFlags=Hn,t.supportsLinearEasing=qn,t.supportsPartialKeyframes=Cs,t.supportsScrollTimeline=Kn,t.supportsViewTimeline=_n,t.supportsWaapi=pi,t.svgEffect=ro,t.svgSubjectEffect=oo,t.sync=bc,t.testValueType=ws,t.time=at,t.transform=gr,t.transformAxis=Eo,t.transformBox=Mo,t.transformBoxPoints=uo,t.transformPropOrder=Vn,t.transformProps=Cn,t.transformValue=Pr,t.transformValueTypes=un,t.transformViewBoxPoint=function(t){return e=>{const n=t.current;if(!n)return e;const i=n.viewBox?.baseVal;if(!i||0===i.width&&0===i.height)return e;const s=n.getBoundingClientRect();if(0===s.width||0===s.height)return e;const o=i.width/s.width,r=i.height/s.height,a=s.left+window.scrollX,l=s.top+window.scrollY;return{x:(e.x-a)*o+a,y:(e.y-l)*r+l}}},t.translateAxis=Po,t.unwrapMotionComponent=function(t){if(Nd(t))return t[du]},t.updateMotionValuesFromProps=la,t.useAnimate=function(){const t=m(()=>({current:null,animations:[]})),n=Ld()??void 0,{skipAnimations:i}=e.useContext(Pc),s=e.useMemo(()=>Xh({scope:t,reduceMotion:n,skipAnimations:i}),[t,n,i]);return wd(()=>{t.animations.forEach(t=>t.stop()),t.animations.length=0}),[t,s]},t.useAnimateMini=function(){const t=m(()=>({current:null,animations:[]})),e=m(()=>Gh(t));return wd(()=>{t.animations.forEach(t=>t.stop())}),[t,e]},t.useAnimation=Id,t.useAnimationControls=jd,t.useAnimationFrame=kd,t.useComposedRefs=Ac,t.useCycle=function(...t){const n=e.useRef(0),[i,s]=e.useState(t[n.current]),o=e.useCallback(e=>{n.current="number"!=typeof e?F(0,t.length,n.current+1):e,s(t[n.current])},[t.length,...t]);return[i,o]},t.useDeprecatedAnimatedState=function(t){const[n,i]=e.useState(t),s=Qd({},!1),o=m(()=>new Jd({props:{onUpdate:t=>{i({...t})}},visualState:s,presenceContext:null},{initialState:t}));return e.useLayoutEffect(()=>(o.mount({}),()=>o.unmount()),[o]),[n,m(()=>t=>xs(o,t))]},t.useDeprecatedInvertedScale=function(t){let n=mh(1),i=mh(1);const{visualElement:s}=e.useContext(Kc);return t?(n=t.scaleX||n,i=t.scaleY||i):s&&(n=s.getValue("scaleX",1),i=s.getValue("scaleY",1)),{scaleX:yh(n,ep),scaleY:yh(i,ep)}},t.useDomEvent=function(t,n,i,s){e.useEffect(()=>{const e=t.current;if(i&&e)return bl(e,n,i,s)},[t,n,i,s])},t.useDragControls=function(){return m(Wd)},t.useElementScroll=function(t){return Vd({container:t})},t.useFollowValue=function(t,e={}){return Cd(t,e,Tr)},t.useForceUpdate=Oc,t.useInView=function(t,{root:n,margin:i,amount:s,once:o=!1,initial:r=!1}={}){const[a,l]=e.useState(r);return e.useEffect(()=>{if(!t.current||o&&a)return;const e={root:n&&n.current||void 0,margin:i,amount:s};return vd(t.current,()=>(l(!0),o?void 0:()=>l(!1)),e)},[n,t,i,o,s]),a},t.useInstantLayoutTransition=Ud,t.useInstantTransition=function(){const[t,n]=Oc(),i=Ud(),s=e.useRef(-1);return e.useEffect(()=>{ce.postRender(()=>ce.postRender(()=>{n===s.current&&(P.instantAnimations=!1)}))},[n]),e=>{i(()=>{P.instantAnimations=!0,t(),e(),s.current=n+1})}},t.useIsPresent=function(){return null===(t=e.useContext(v))||t.isPresent;var t},t.useIsomorphicLayoutEffect=y,t.useMotionTemplate=function(t,...e){const n=t.length;return gh(e.filter(ls),function(){let i="";for(let s=0;s{const t=()=>n(!document.hidden);return document.hidden&&t(),document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),t},t.usePresence=Dc,t.usePresenceData=function(){const t=e.useContext(v);return t?t.custom:void 0},t.useReducedMotion=Rd,t.useReducedMotionConfig=Ld,t.useResetProjection=function(){return e.useCallback(()=>{const t=uc.current;t&&t.resetTree()},[])},t.useScroll=Vd,t.useSpring=function(t,e={}){return Cd(t,e,Er)},t.useTime=function(){const t=mh(0);return kd(e=>t.set(e)),t},t.useTransform=yh,t.useUnmountEffect=wd,t.useVelocity=function(t){const e=mh(t.getVelocity()),n=()=>{const i=t.getVelocity();e.set(i),i&&ce.update(n)};return Pd(t,"change",()=>{ce.update(n,!1,!0)}),e},t.useViewportScroll=function(){return Vd()},t.useWillChange=function(){return m(()=>new Dd("auto"))},t.variantPriorityOrder=sa,t.variantProps=oa,t.velocityPerSecond=O,t.vh=Ct,t.visualElementStore=ea,t.vw=kt,t.warnOnce=I,t.warning=()=>{},t.wrap=F});