UNPKG

framer-motion

Version:

A simple and powerful JavaScript animation library

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