framer-motion 7.6.1 → 7.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +7 -4
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/value/index.mjs +1 -1
- package/dist/es/value/use-scroll.mjs +6 -2
- package/dist/framer-motion.dev.js +7 -4
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/projection.dev.js +2 -2
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{useEffect as e,useRef as n,useContext as i,useId as o,createElement as s}from"react";import{q as r,t as a,v as l,w as u,x as c,y as h,z as d,A as p,B as m,i as f,C as v,D as g,E as y,a as x,u as b,M as P,P as A,F as S,G as T,g as w,L as E,S as V,d as M,r as C,H as R,I as L,J as D,K as k,n as j,N as O,m as F,c as U,f as I,b as B,l as N,O as z,Q as $,p as G,h as H,R as W,T as Y,U as X,s as q,j as K,o as Z,k as _}from"./size-rollup-dom-max-assets.js";const J=(t,e)=>n=>Boolean(r(n)&&a.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Q=(t,e,n)=>i=>{if(!r(i))return i;const[o,s,a,u]=i.match(l);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(a),alpha:void 0!==u?parseFloat(u):1}},tt={test:J("hsl","hue"),parse:Q("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+u.transform(c(e))+", "+u.transform(c(n))+", "+c(h.transform(i))+")"},et=p(0,255),nt=Object.assign(Object.assign({},d),{transform:t=>Math.round(et(t))}),it={test:J("rgb","red"),parse:Q("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+nt.transform(t)+", "+nt.transform(e)+", "+nt.transform(n)+", "+c(h.transform(i))+")"};const ot={test:J("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),i=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),i=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:it.transform},st={test:t=>it.test(t)||ot.test(t)||tt.test(t),parse:t=>it.test(t)?it.parse(t):tt.test(t)?tt.parse(t):ot.parse(t),transform:t=>r(t)?t:t.hasOwnProperty("red")?it.transform(t):tt.transform(t)};function rt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const i=t.match(m);i&&(n=i.length,t=t.replace(m,"${c}"),e.push(...i.map(st.parse)));const o=t.match(l);return o&&(t=t.replace(l,"${n}"),e.push(...o.map(d.parse))),{values:e,numColors:n,tokenised:t}}function at(t){return rt(t).values}function lt(t){const{values:e,numColors:n,tokenised:i}=rt(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=e.replace(i<n?"${c}":"${n}",i<n?st.transform(t[i]):c(t[i]));return e}}const ut=t=>"number"==typeof t?0:t;const ct={test:function(t){var e,n,i,o;return isNaN(t)&&r(t)&&(null!==(n=null===(e=t.match(l))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(i=t.match(m))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:at,createTransformer:lt,getAnimatableNone:function(t){const e=at(t);return lt(t)(e.map(ut))}},ht=new Set(["brightness","contrast","saturate","opacity"]);function dt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(l)||[];if(!i)return t;const o=n.replace(i,"");let s=ht.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const pt=/([a-z-]*)\(.*?\)/g,mt=Object.assign(Object.assign({},ct),{getAnimatableNone:t=>{const e=t.match(pt);return e?e.map(dt).join(" "):t}});function ft(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function vt(t){return!!t.touches}const gt={pageX:0,pageY:0};function yt(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||gt;return{x:n[e+"X"],y:n[e+"Y"]}}function xt(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function bt(t,e="page"){return{point:vt(t)?yt(t,e):xt(t,e)}}const Pt=(t,e=!1)=>{const n=e=>t(e,bt(e));return e?(i=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&i(t)}):n;var i},At="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),St="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(At()),1/60*1e3);let Tt=!0,wt=!1,Et=!1;const Vt={delta:0,timestamp:0},Mt=["read","update","preRender","render","postRender"],Ct=Mt.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,o=!1,s=!1;const r=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const l=a&&o,u=l?e:n;return s&&r.add(t),-1===u.indexOf(t)&&(u.push(t),l&&o&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,i=e.length,i)for(let n=0;n<i;n++){const i=e[n];i(l),r.has(i)&&(a.schedule(i),t())}o=!1,s&&(s=!1,a.process(l))}}};return a}(()=>wt=!0),t),{}),Rt=Mt.reduce((t,e)=>{const n=Ct[e];return t[e]=(t,e=!1,i=!1)=>(wt||Ot(),n.schedule(t,e,i)),t},{}),Lt=Mt.reduce((t,e)=>(t[e]=Ct[e].cancel,t),{}),Dt=Mt.reduce((t,e)=>(t[e]=()=>Ct[e].process(Vt),t),{}),kt=t=>Ct[t].process(Vt),jt=t=>{wt=!1,Vt.delta=Tt?1/60*1e3:Math.max(Math.min(t-Vt.timestamp,40),1),Vt.timestamp=t,Et=!0,Mt.forEach(kt),Et=!1,wt&&(Tt=!1,St(jt))},Ot=()=>{wt=!0,Tt=!0,Et||St(jt)},Ft=()=>Vt,Ut=t=>1e3*t;function It(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Bt(t,n,i,o){e(()=>{const e=t.current;if(i&&e)return It(e,n,i,o)},[t,n,i,o])}const Nt={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},zt={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function $t(t){return f&&null===window.onpointerdown?t:f&&null===window.ontouchstart?zt[t]:f&&null===window.onmousedown?Nt[t]:t}function Gt(t,e,n,i){return It(t,$t(e),Pt(n,"pointerdown"===e),i)}function Ht(t,e,n,i){return Bt(t,$t(e),n&&Pt(n,"pointerdown"===e),i)}function Wt(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n}const Yt=(t,e,n)=>Math.min(Math.max(n,t),e);function Xt({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let o,s,r=1-e;r=Yt(.05,1,r),t=Yt(.01,10,t/1e3),r<1?(o=e=>{const i=e*r,o=i*t;return.001-(i-n)/qt(e,r)*Math.exp(-o)},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=qt(Math.pow(e,2),r);return(.001-o(e)>0?-1:1)*((s-a)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function qt(t,e){return t*Math.sqrt(1-e*e)}const Kt=["duration","bounce"],Zt=["stiffness","damping","mass"];function _t(t,e){return e.some(e=>void 0!==t[e])}function Jt(t){var{from:e=0,to:n=1,restSpeed:i=2,restDelta:o}=t,s=Wt(t,["from","to","restSpeed","restDelta"]);const r={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!_t(t,Zt)&&_t(t,Kt)){const n=Xt(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(s),p=Qt,m=Qt;function f(){const t=c?-c/1e3:0,i=n-e,s=l/(2*Math.sqrt(a*u)),r=Math.sqrt(a/u)/1e3;if(void 0===o&&(o=Math.min(Math.abs(n-e)/100,.4)),s<1){const e=qt(r,s);p=o=>{const a=Math.exp(-s*r*o);return n-a*((t+s*r*i)/e*Math.sin(e*o)+i*Math.cos(e*o))},m=n=>{const o=Math.exp(-s*r*n);return s*r*o*(Math.sin(e*n)*(t+s*r*i)/e+i*Math.cos(e*n))-o*(Math.cos(e*n)*(t+s*r*i)-e*i*Math.sin(e*n))}}else if(1===s)p=e=>n-Math.exp(-r*e)*(i+(t+r*i)*e);else{const e=r*Math.sqrt(s*s-1);p=o=>{const a=Math.exp(-s*r*o),l=Math.min(e*o,300);return n-a*((t+s*r*i)*Math.sinh(l)+e*i*Math.cosh(l))/e}}}return f(),{next:t=>{const e=p(t);if(d)r.done=t>=h;else{const s=1e3*m(t),a=Math.abs(s)<=i,l=Math.abs(n-e)<=o;r.done=a&&l}return r.value=r.done?n:e,r},flipTarget:()=>{c=-c,[e,n]=[n,e],f()}}}Jt.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Qt=t=>0,te=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},ee=(t,e,n)=>-n*t+n*e+t;function ne(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 ie({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=ne(a,i,t+1/3),s=ne(a,i,t),r=ne(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}const oe=(t,e,n)=>{const i=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-i)+i))},se=[ot,it,tt],re=t=>se.find(e=>e.test(t)),ae=(t,e)=>{let n=re(t),i=re(e),o=n.parse(t),s=i.parse(e);n===tt&&(o=ie(o),n=it),i===tt&&(s=ie(s),i=it);const r=Object.assign({},o);return t=>{for(const e in r)"alpha"!==e&&(r[e]=oe(o[e],s[e],t));return r.alpha=ee(o.alpha,s.alpha,t),n.transform(r)}},le=t=>"number"==typeof t,ue=(t,e)=>n=>e(t(n)),ce=(...t)=>t.reduce(ue);function he(t,e){return le(t)?n=>ee(t,e,n):st.test(t)?ae(t,e):fe(t,e)}const de=(t,e)=>{const n=[...t],i=n.length,o=t.map((t,n)=>he(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}},pe=(t,e)=>{const n=Object.assign(Object.assign({},t),e),i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=he(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}};function me(t){const e=ct.parse(t),n=e.length;let i=0,o=0,s=0;for(let t=0;t<n;t++)i||"number"==typeof e[t]?i++:void 0!==e[t].hue?s++:o++;return{parsed:e,numNumbers:i,numRGB:o,numHSL:s}}const fe=(t,e)=>{const n=ct.createTransformer(e),i=me(t),o=me(e);return i.numHSL===o.numHSL&&i.numRGB===o.numRGB&&i.numNumbers>=o.numNumbers?ce(de(i.parsed,o.parsed),n):n=>""+(n>0?e:t)},ve=(t,e)=>n=>ee(t,e,n);function ge(t,e,n){const i=[],o=n||("number"==typeof(s=t[0])?ve:"string"==typeof s?st.test(s)?ae:fe:Array.isArray(s)?de:"object"==typeof s?pe:void 0);var s;const r=t.length-1;for(let n=0;n<r;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=ce(t,s)}i.push(s)}return i}function ye(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const r=ge(e,i,o),a=2===s?function([t,e],[n]){return i=>n(te(t,e,i))}(t,r):function(t,e){const n=t.length,i=n-1;return o=>{let s=0,r=!1;if(o<=t[0]?r=!0:o>=t[i]&&(s=i-1,r=!0),!r){let e=1;for(;e<n&&!(t[e]>o||e===i);e++);s=e-1}const a=te(t[s],t[s+1],o);return e[s](a)}}(t,r);return n?e=>a(Yt(t[0],t[s-1],e)):a}const xe=t=>e=>1-t(1-e),be=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pe=t=>e=>e*e*((t+1)*e-t),Ae=t=>t,Se=(Te=2,t=>Math.pow(t,Te));var Te;const we=xe(Se),Ee=be(Se),Ve=t=>1-Math.sin(Math.acos(t)),Me=xe(Ve),Ce=be(Me),Re=Pe(1.525),Le=xe(Re),De=be(Re),ke=(t=>{const e=Pe(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),je=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},Oe=xe(je);function Fe(t,e){return t.map(()=>e||Ee).splice(0,t.length-1)}function Ue({from:t=0,to:e=1,ease:n,offset:i,duration:o=300}){const s={done:!1,value:t},r=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(i&&i.length===r.length?i:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(r),o);function l(){return ye(a,r,{ease:Array.isArray(n)?n:Fe(r,n)})}let u=l();return{next:t=>(s.value=u(t),s.done=t>=o,s),flipTarget:()=>{r.reverse(),u=l()}}}const Ie={keyframes:Ue,spring:Jt,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:i=350,restDelta:o=.5,modifyTarget:s}){const r={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===s?l:s(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/i);return r.done=!(e>o||e<-o),r.value=r.done?u:u+e,r},flipTarget:()=>{}}}};function Be(t,e,n=0){return t-e-n}const Ne=t=>{const e=({delta:e})=>t(e);return{start:()=>Rt.update(e,!0),stop:()=>Lt.update(e)}};function ze(t){var e,n,{from:i,autoplay:o=!0,driver:s=Ne,elapsed:r=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:h,onComplete:d,onRepeat:p,onUpdate:m}=t,f=Wt(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let v,g,y,{to:x}=f,b=0,P=f.duration,A=!1,S=!0;const T=function(t){if(Array.isArray(t.to))return Ue;if(Ie[t.type])return Ie[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Ue:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Jt:Ue}(f);(null===(n=(e=T).needsInterpolation)||void 0===n?void 0:n.call(e,i,x))&&(y=ye([0,100],[i,x],{clamp:!1}),i=0,x=100);const w=T(Object.assign(Object.assign({},f),{from:i,to:x}));function E(){b++,"reverse"===l?(S=b%2==0,r=function(t,e,n=0,i=!0){return i?Be(e+-t,e,n):e-(t-e)+n}(r,P,u,S)):(r=Be(r,P,u),"mirror"===l&&w.flipTarget()),A=!1,p&&p()}function V(t){if(S||(t=-t),r+=t,!A){const t=w.next(Math.max(0,r));g=t.value,y&&(g=y(g)),A=S?t.done:r<=0}null==m||m(g),A&&(0===b&&(null!=P||(P=r)),b<a?function(t,e,n,i){return i?t>=e+n:t<=-n}(r,P,u,S)&&E():(v.stop(),d&&d()))}return o&&(null==c||c(),v=s(V),v.start()),{stop:()=>{null==h||h(),v.stop()}}}function $e(t,e){return e?t*(1e3/e):0}const Ge=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),He=t=>Ge(t)&&t.hasOwnProperty("z"),We=(t,e)=>Math.abs(t-e);function Ye(t,e){if(le(t)&&le(e))return We(t,e);if(Ge(t)&&Ge(e)){const n=We(t.x,e.x),i=We(t.y,e.y),o=He(t)&&He(e)?We(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(o,2))}}const Xe=(t,e)=>1-3*e+3*t,qe=(t,e)=>3*e-6*t,Ke=t=>3*t,Ze=(t,e,n)=>((Xe(e,n)*t+qe(e,n))*t+Ke(e))*t,_e=(t,e,n)=>3*Xe(e,n)*t*t+2*qe(e,n)*t+Ke(e);function Je(t,e,n,i){if(t===e&&n===i)return Ae;const o=new Float32Array(11);for(let e=0;e<11;++e)o[e]=Ze(.1*e,t,n);function s(e){let i=0,s=1;for(;10!==s&&o[s]<=e;++s)i+=.1;--s;const r=i+.1*((e-o[s])/(o[s+1]-o[s])),a=_e(r,t,n);return a>=.001?function(t,e,n,i){for(let o=0;o<8;++o){const o=_e(e,n,i);if(0===o)return e;e-=(Ze(e,n,i)-t)/o}return e}(e,r,t,n):0===a?r:function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=Ze(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<10);return r}(e,i,i+.1,t,n)}return t=>0===t||1===t?t:Ze(s(t),e,i)}class Qe{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=nn(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Ye(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=Ft();this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=tn(e,this.transformPagePoint),ft(t)&&0===t.buttons?this.handlePointerUp(t,e):Rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i}=this.handlers,o=nn(tn(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},vt(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const i=tn(bt(t),this.transformPagePoint),{point:o}=i,{timestamp:s}=Ft();this.history=[{...o,timestamp:s}];const{onSessionStart:r}=e;r&&r(t,nn(i,this.history)),this.removeListeners=ce(Gt(window,"pointermove",this.handlePointerMove),Gt(window,"pointerup",this.handlePointerUp),Gt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Lt.update(this.updatePoint)}}function tn(t,e){return e?{point:e(t.point)}:t}function en(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nn({point:t},e){return{point:t,delta:en(t,sn(e)),offset:en(t,on(e)),velocity:rn(e,.1)}}function on(t){return t[0]}function sn(t){return t[t.length-1]}function rn(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=sn(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>Ut(e)));)n--;if(!i)return{x:0,y:0};const s=(o.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function an(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const ln=an("dragHorizontal"),un=an("dragVertical");function cn(t){let e=!1;if("y"===t)e=un();else if("x"===t)e=ln();else{const t=ln(),n=un();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function hn(){const t=cn(!0);return!t||(t(),!1)}function dn(t){return t.max-t.min}function pn(t,e=0,n=.01){return Ye(t,e)<n}function mn(t,e,n,i=.5){t.origin=i,t.originPoint=ee(e.min,e.max,t.origin),t.scale=dn(n)/dn(e),(pn(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=ee(n.min,n.max,t.origin)-t.originPoint,(pn(t.translate)||isNaN(t.translate))&&(t.translate=0)}function fn(t,e,n,i){mn(t.x,e.x,n.x,null==i?void 0:i.originX),mn(t.y,e.y,n.y,null==i?void 0:i.originY)}function vn(t,e,n){t.min=n.min+e.min,t.max=t.min+dn(e)}function gn(t,e,n){t.min=e.min-n.min,t.max=t.min+dn(e)}function yn(t,e,n){gn(t.x,e.x,n.x),gn(t.y,e.y,n.y)}function xn(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 bn(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 Pn=.35;function An(t,e,n){return{min:Sn(t,e),max:Sn(t,n)}}function Sn(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}var Tn;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(Tn||(Tn={}));function wn(t){return[t("x"),t("y")]}function En({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Vn(t){return void 0===t||1===t}function Mn({scale:t,scaleX:e,scaleY:n}){return!Vn(t)||!Vn(e)||!Vn(n)}function Cn(t){return Mn(t)||Rn(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Rn(t){return Ln(t.x)||Ln(t.y)}function Ln(t){return t&&"0%"!==t}function Dn(t,e,n){return n+e*(t-n)}function kn(t,e,n,i,o){return void 0!==o&&(t=Dn(t,o,i)),Dn(t,n,i)+e}function jn(t,e=0,n=1,i,o){t.min=kn(t.min,e,n,i,o),t.max=kn(t.max,e,n,i,o)}function On(t,{x:e,y:n}){jn(t.x,e.translate,e.scale,e.originPoint),jn(t.y,n.translate,n.scale,n.originPoint)}function Fn(t,e){t.min=t.min+e,t.max=t.max+e}function Un(t,e,[n,i,o]){const s=void 0!==e[o]?e[o]:.5,r=ee(t.min,t.max,s);jn(t,e[n],e[i],r,e.scale)}const In=["x","scaleX","originX"],Bn=["y","scaleY","originY"];function Nn(t,e){Un(t.x,e,In),Un(t.y,e,Bn)}function zn(t,e){return En(function(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}}(t.getBoundingClientRect(),e))}const $n={linear:Ae,easeIn:Se,easeInOut:Ee,easeOut:we,circIn:Ve,circInOut:Ce,circOut:Me,backIn:Re,backInOut:De,backOut:Le,anticipate:ke,bounceIn:Oe,bounceInOut:t=>t<.5?.5*(1-je(1-2*t)):.5*je(2*t-1)+.5,bounceOut:je},Gn=t=>{if(Array.isArray(t)){t.length;const[e,n,i,o]=t;return Je(e,n,i,o)}return"string"==typeof t?$n[t]:t},Hn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!ct.test(e)||e.startsWith("url("))),Wn=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Yn=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Xn=()=>({type:"keyframes",ease:"linear",duration:.3}),qn=t=>({type:"keyframes",duration:.8,values:t}),Kn={x:Wn,y:Wn,z:Wn,rotate:Wn,rotateX:Wn,rotateY:Wn,rotateZ:Wn,scaleX:Yn,scaleY:Yn,scale:Yn,opacity:Xn,backgroundColor:Xn,color:Xn,default:Yn},Zn=(t,e)=>{let n;return n=v(e)?qn:Kn[t]||Kn.default,{to:e,...n(e)}},_n={...g,color:st,backgroundColor:st,outlineColor:st,fill:st,stroke:st,borderColor:st,borderTopColor:st,borderRightColor:st,borderBottomColor:st,borderLeftColor:st,filter:mt,WebkitFilter:mt},Jn=t=>_n[t];function Qn(t,e){var n;let i=Jn(t);return i!==mt&&(i=ct),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}const ti=!1;function ei(t,e){const n=performance.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(Lt.read(i),t(s-e))};return Rt.read(i,!0),()=>Lt.read(i)}function ni({ease:t,times:e,yoyo:n,flip:i,loop:o,...s}){const r={...s};return e&&(r.offset=e),s.duration&&(r.duration=Ut(s.duration)),s.repeatDelay&&(r.repeatDelay=Ut(s.repeatDelay)),t&&(r.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(Gn):Gn(t)),"tween"===s.type&&(r.type="keyframes"),(n||o||i)&&(n?r.repeatType="reverse":o?r.repeatType="loop":i&&(r.repeatType="mirror"),r.repeat=o||n||i||s.repeat),"spring"!==s.type&&(r.type="keyframes"),r}function ii(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:o,repeat:s,repeatType:r,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...Zn(n,e.to)}),{...e,...ni(t)}}function oi(t,e,n,i,o){const s=ai(i,t)||{};let r=void 0!==s.from?s.from:e.get();const a=Hn(t,n);"none"===r&&a&&"string"==typeof n?r=Qn(t,n):si(r)&&"string"==typeof n?r=ri(n):!Array.isArray(n)&&si(n)&&"string"==typeof r&&(n=ri(r));return Hn(t,r)&&a&&!1!==s.type?function(){const i={from:r,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:i,power:o=.8,timeConstant:s=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==i&&t>i}function v(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function g(t){null==m||m.stop(),m=ze(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p}))}function y(t){g(Object.assign({type:"spring",stiffness:r,damping:a,restDelta:l},t))}if(f(t))y({from:t,velocity:e,to:v(t)});else{let i=o*e+t;void 0!==u&&(i=u(i));const r=v(i),a=r===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=$e(t-c,Ft().delta),(1===a&&t>r||-1===a&&t<r)&&y({from:t,to:r,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:l,modifyTarget:u,onUpdate:f(i)?d:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...i,...s}):ze({...ii(s,i,t),onUpdate:t=>{i.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{i.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=y(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function si(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function ri(t){return"number"==typeof t?0:Qn("",t)}function ai(t,e){return t[e]||t.default||t}function li(t,e,n,i={}){return ti&&(i={type:!1}),e.start(o=>{let s;const r=oi(t,e,n,i,o),a=function(t,e){var n,i;return null!==(i=null!==(n=(ai(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==i?i:0}(i,t),l=()=>s=r();let u;return a?u=ei(l,Ut(a)):l(),()=>{u&&u(),s&&s.stop()}})}const ui=new WeakMap;class ci{constructor(t){this.openGlobalLock=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.visualElement=t}start(t,{snapToCursor:e=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new Qe(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(bt(t,"page").point)},onStart:(t,e)=>{var n;const{drag:i,dragPropagation:o,onDragStart:s}=this.getProps();(!i||o||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cn(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),wn(t=>{var e,n;let i=this.getAxisMotionValue(t).get()||0;if(u.test(i)){const o=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(o){i=dn(o)*(parseFloat(i)/100)}}this.originPoint[t]=i}),null==s||s(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(Tn.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&(null==o||o(this.currentDirection)));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.syncRender(),null==s||s(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:o}=this.getProps();null==o||o(t,e)}cancel(){var t,e;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(t=this.panSession)||void 0===t||t.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(Tn.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!hi(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?ee(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?ee(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&x(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:xn(t.x,n,o),y:xn(t.y,e,i)}}(n.actual,t),this.elastic=function(t=Pn){return!1===t?t=0:!0===t&&(t=Pn),{x:An(t,"left","right"),y:An(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&wn(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.actual[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!x(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=zn(t,n),{scroll:o}=e;return o&&(Fn(i.x,o.x),Fn(i.y,o.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:bn(t.x,e.x),y:bn(t.y,e.y)}}(i.layout.actual,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=En(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=wn(r=>{var l;if(!hi(r,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[r])&&void 0!==l?l:{};s&&(u={min:0,max:0});const c=i?200:1e6,h=i?40:1e7,d={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...u};return this.startAxisValueAnimation(r,d)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){return li(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){wn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){wn(e=>{const{drag:n}=this.getProps();if(!hi(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.actual[e];o.set(t[e]-ee(n,s,.5))}})}scalePositionWithinConstraints(){var t;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!x(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};wn(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();o[t]=function(t,e){let n=.5;const i=dn(t),o=dn(e);return o>i?n=te(e.min,e.max-i,t.min):i>o&&(n=te(t.min,t.max-o,e.min)),Yt(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=s?s({},""):"none",null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),wn(t=>{if(!hi(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];n.set(ee(i,s,o[t]))})}addListeners(){var t;ui.set(this.visualElement,this);const e=Gt(this.visualElement.getInstance(),"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();x(t)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout()),n();const s=It(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(wn(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.syncRender())});return()=>{s(),e(),o(),null==r||r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Pn,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function hi(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function di(t){return e(()=>()=>t(),[])}const pi=t=>e=>(t(e),null),mi={pan:pi((function({onPan:t,onPanStart:o,onPanEnd:s,onPanSessionStart:r,visualElement:a}){const l=t||o||s||r,u=n(null),{transformPagePoint:c}=i(P),h={onSessionStart:r,onStart:o,onMove:t,onEnd:(t,e)=>{u.current=null,s&&s(t,e)}};e(()=>{null!==u.current&&u.current.updateHandlers(h)}),Ht(a,"pointerdown",l&&function(t){u.current=new Qe(t,h,{transformPagePoint:c})}),di(()=>u.current&&u.current.end())})),drag:pi((function(t){const{dragControls:n,visualElement:i}=t,o=b(()=>new ci(i));e(()=>n&&n.subscribe(o),[o,n]),e(()=>o.addListeners(),[o])}))};function fi(){const t=i(A);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,a=o();e(()=>r(a),[]);return!n&&s?[!1,()=>s&&s(a)]:[!0]}function vi(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const gi={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!S.test(t))return t;t=parseFloat(t)}return`${vi(t,e.target.x)}% ${vi(t,e.target.y)}%`}};function yi(t){return"string"==typeof t&&t.startsWith("var(--")}const xi=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function bi(t,e,n=1){const[i,o]=function(t){const e=xi.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():yi(o)?bi(o,e,n+1):o}const Pi={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=t.includes("var("),s=[];o&&(t=t.replace(xi,t=>(s.push(t),"_$css")));const r=ct.parse(t);if(r.length>5)return i;const a=ct.createTransformer(t),l="number"!=typeof r[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;r[0+l]/=u,r[1+l]/=c;const h=ee(u,c,.5);"number"==typeof r[2+l]&&(r[2+l]/=h),"number"==typeof r[3+l]&&(r[3+l]/=h);let d=a(r);if(o){let t=0;d=d.replace("_$css",()=>{const e=s[t];return t++,e})}return d}};class Ai extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;T(Si),o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),w.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,i||t.layoutDependency!==e||void 0===e?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Rt.postRender(()=>{var t;(null===(t=s.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(i),(null==n?void 0:n.deregister)&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const Si={borderRadius:{...gi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gi,borderTopRightRadius:gi,borderBottomLeftRadius:gi,borderBottomRightRadius:gi,boxShadow:Pi},Ti={measureLayout:function(e){const[n,o]=fi(),s=i(E);return t.createElement(Ai,{...e,layoutGroup:s,switchLayoutGroup:i(V),isPresent:n,safeToRemove:o})}};function wi(t,e){-1===t.indexOf(e)&&t.push(e)}function Ei(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Vi{constructor(){this.subscriptions=[]}add(t){return wi(this.subscriptions,t),()=>Ei(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 o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Mi{constructor(t){var e;this.version="7.6.1",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Vi,this.velocityUpdateSubscribers=new Vi,this.renderSubscribers=new Vi,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=Ft();this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,Rt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Rt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?$e(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Ci(t){return new Mi(t)}const Ri=["TopLeft","TopRight","BottomLeft","BottomRight"],Li=Ri.length,Di=t=>"string"==typeof t?parseFloat(t):t,ki=t=>"number"==typeof t||S.test(t);function ji(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Oi=Ui(0,.5,Me),Fi=Ui(.5,.95,Ae);function Ui(t,e,n){return i=>i<t?0:i>e?1:n(te(t,e,i))}function Ii(t,e){t.min=e.min,t.max=e.max}function Bi(t,e){Ii(t.x,e.x),Ii(t.y,e.y)}function Ni(t,e,n,i,o){return t=Dn(t-=e,1/n,i),void 0!==o&&(t=Dn(t,1/o,i)),t}function zi(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){if(u.test(e)){e=parseFloat(e);e=ee(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=ee(s.min,s.max,i);t===s&&(a-=e),t.min=Ni(t.min,e,n,a,o),t.max=Ni(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const $i=["x","scaleX","originX"],Gi=["y","scaleY","originY"];function Hi(t,e,n,i){zi(t.x,e,$i,null==n?void 0:n.x,null==i?void 0:i.x),zi(t.y,e,Gi,null==n?void 0:n.y,null==i?void 0:i.y)}function Wi(t){return 0===t.translate&&1===t.scale}function Yi(t){return Wi(t.x)&&Wi(t.y)}function Xi(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function qi(t){return dn(t.x)/dn(t.y)}class Ki{constructor(){this.members=[]}add(t){wi(this.members,t),t.scheduleRender()}remove(t){if(Ei(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){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){var n;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues,t.snapshot.isShared=!0),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;!1===o&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,i,o,s;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(s=null===(i=t.resumingFrom)||void 0===i?void 0:(o=i.options).onExitComplete)||void 0===s||s.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Zi(t,e,n){let i=`translate3d(${t.x.translate/e.x}px, ${t.y.translate/e.y}px, 0) `;if(i+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),o&&(i+=`rotateY(${o}deg) `)}return i+=`scale(${t.x.scale*e.x}, ${t.y.scale*e.y})`,"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"===i?"none":i}const _i=(t,e)=>t.depth-e.depth;class Ji{constructor(){this.children=[],this.isDirty=!1}add(t){wi(this.children,t),this.isDirty=!0}remove(t){Ei(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(_i),this.isDirty=!1,this.children.forEach(t)}}const Qi=["","X","Y","Z"];function to({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(ao),this.nodes.forEach(lo)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=t,this.latestValues=n,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ji)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Vi),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var i;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:o,layout:s,visualElement:r}=this.options;if(r&&!r.getInstance()&&r.mount(e),this.root.nodes.add(this),null===(i=this.parent)||void 0===i||i.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),n&&(s||o)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=ei(i,250),w.hasAnimatedSinceResize&&(w.hasAnimatedSinceResize=!1,this.nodes.forEach(ro))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&r&&(o||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{var o,s,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(s=null!==(o=this.options.transition)&&void 0!==o?o:r.getDefaultTransition())&&void 0!==s?s:fo,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=r.getProps(),p=!this.targetLayout||!Xi(this.targetLayout,i)||n,m=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||m||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,m);const e={...ai(c,"layout"),onPlay:h,onComplete:d};r.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||ro(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=i})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,Lt.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(uo))}willUpdate(t=!0){var e,n,i;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll()}const{layoutId:o,layout:s}=this.options;if(void 0===o&&!s)return;const r=null===(i=this.options.visualElement)||void 0===i?void 0:i.getProps().transformTemplate;this.prevTransformTemplateValue=null==r?void 0:r(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(oo);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(vo),this.potentialNodes.clear()),this.nodes.forEach(so),this.nodes.forEach(eo),this.nodes.forEach(no),this.clearAllSnapshots(),Dt.update(),Dt.preRender(),Dt.render())}clearAllSnapshots(){this.nodes.forEach(io),this.sharedNodes.forEach(co)}scheduleUpdateProjection(){Rt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const t=this.measure(),e=this.removeTransform(this.removeElementScroll(t));yo(e),this.snapshot={measured:t,layout:e,latestValues:{}}}updateLayout(){var t;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 e=this.measure();yo(e);const n=this.layout;this.layout={measured:e,actual:this.removeElementScroll(e)},this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),null===(t=this.options.visualElement)||void 0===t||t.notifyLayoutMeasure(this.layout.actual,null==n?void 0:n.actual)}updateScroll(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=i(this.instance),this.scroll=n(this.instance))}resetTransform(){var t;if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Yi(this.projectionDelta),i=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,s=null==i?void 0:i(this.latestValues,""),r=s!==this.prevTransformTemplateValue;e&&(n||Cn(this.latestValues)||r)&&(o(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Fn(e.x,n.x),Fn(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Bi(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s,isScrollRoot:r}=i;if(i!==this.root&&o&&s.layoutScroll){if(r){Bi(e,t);const{scroll:n}=this.root;n&&(Fn(e.x,-n.x),Fn(e.y,-n.y))}Fn(e.x,o.x),Fn(e.y,o.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Bi(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Nn(n,{x:-i.scroll.x,y:-i.scroll.y}),Cn(i.latestValues)&&Nn(n,i.latestValues)}return Cn(this.latestValues)&&Nn(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Bi(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!Cn(i.latestValues))continue;Mn(i.latestValues)&&i.updateSnapshot();const o={x:{min:0,max:0},y:{min:0,max:0}};Bi(o,i.measure()),Hi(n,i.latestValues,null===(e=i.snapshot)||void 0===e?void 0:e.layout,o)}return Cn(this.latestValues)&&Hi(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var t;const{layout:e,layoutId:n}=this.options;var i,o,s;this.layout&&(e||n)&&(this.targetDelta||this.relativeTarget||(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yn(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),Bi(this.relativeTarget,this.relativeTargetOrigin))),(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&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(i=this.target,o=this.relativeTarget,s=this.relativeParent.target,vn(i.x,o.x,s.x),vn(i.y,o.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):Bi(this.target,this.layout.actual),On(this.target,this.targetDelta)):Bi(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&Boolean(this.relativeParent.resumingFrom)===Boolean(this.resumingFrom)&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yn(this.relativeTargetOrigin,this.target,this.relativeParent.target),Bi(this.relativeTarget,this.relativeTargetOrigin)))))}getClosestProjectingParent(){if(this.parent&&!Mn(this.parent.latestValues)&&!Rn(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{layout:e,layoutId:n}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!e&&!n)return;const i=this.getLead();Bi(this.layoutCorrected,this.layout.actual),function(t,e,n,i=!1){var o,s;const r=n.length;if(!r)return;let a,l;e.x=e.y=1;for(let u=0;u<r;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(s=null===(o=a.instance)||void 0===o?void 0:o.style)||void 0===s?void 0:s.display)&&(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Nn(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,On(t,l)),i&&Cn(a.latestValues)&&Nn(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==i);const{target:o}=i;if(!o)return;this.projectionDelta||(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}});const s=this.treeScale.x,r=this.treeScale.y,a=this.projectionTransform;fn(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.projectionTransform=Zi(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===s&&this.treeScale.y===r||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,i;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(i=this.getStack())||void 0===i||i.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n;const i=this.snapshot,o=(null==i?void 0:i.latestValues)||{},s={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=null==i?void 0:i.isShared,c=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,h=Boolean(l&&!c&&!0===this.options.crossfade&&!this.path.some(mo));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const i=e/1e3;var d,p,m,f;ho(r.x,t.x,i),ho(r.y,t.y,i),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(yn(a,this.layout.actual,this.relativeParent.layout.actual),d=this.relativeTarget,p=this.relativeTargetOrigin,m=a,f=i,po(d.x,p.x,m.x,f),po(d.y,p.y,m.y,f)),l&&(this.animationValues=s,function(t,e,n,i,o,s){var r,a,l,c;o?(t.opacity=ee(0,null!==(r=n.opacity)&&void 0!==r?r:1,Oi(i)),t.opacityExit=ee(null!==(a=e.opacity)&&void 0!==a?a:1,0,Fi(i))):s&&(t.opacity=ee(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(c=n.opacity)&&void 0!==c?c:1,i));for(let o=0;o<Li;o++){const s=`border${Ri[o]}Radius`;let r=ji(e,s),a=ji(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||ki(r)===ki(a)?(t[s]=Math.max(ee(Di(r),Di(a),i),0),(u.test(a)||u.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=ee(e.rotate||0,n.rotate||0,i))}(s,o,this.latestValues,i,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(Lt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Rt.update(()=>{w.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=M(t)?t:Ci(t);return li("",i,e,n),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&xo(this.options.animationType,this.layout.actual,i.actual)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=dn(this.layout.actual.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=dn(this.layout.actual.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Bi(e,n),Nn(e,o),fn(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){var n,i,o;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ki);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(i=e.options.initialPromotionConfig)||void 0===i?void 0:i.shouldPreserveFollowOpacity)||void 0===o?void 0:o.call(i,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const n={};for(let i=0;i<Qi.length;i++){const o="rotate"+Qi[i];t.getStaticValue(o)&&(e=!0,n[o]=t.getStaticValue(o),t.setStaticValue(o,0))}if(e){null==t||t.syncRender();for(const e in n)t.setStaticValue(e,n[e]);t.scheduleRender()}}getProjectionStyles(t={}){var e,n,i;const o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";const s=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=C(t.pointerEvents)||"",o.transform=s?s(this.latestValues,""):"none",o;const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=C(t.pointerEvents)||""),this.hasProjected&&!Cn(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const a=r.animationValues||r.latestValues;this.applyTransformsToTarget(),o.transform=Zi(this.projectionDeltaWithTransform,this.treeScale,a),s&&(o.transform=s(a,o.transform));const{x:l,y:u}=this.projectionDelta;o.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,r.animationValues?o.opacity=r===this?null!==(i=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:o.opacity=r===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in R){if(void 0===a[t])continue;const{correct:e,applyTo:n}=R[t],i=e(a[t],r);if(n){const t=n.length;for(let e=0;e<t;e++)o[n[e]]=i}else o[t]=i}return this.options.layoutId&&(o.pointerEvents=r===this?C(t.pointerEvents)||"":"none"),o}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(oo),this.root.sharedNodes.clear()}}}function eo(t){t.updateLayout()}function no(t){var e,n,i;const o=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout,{animationType:i}=t.options;"size"===i?wn(t=>{const n=o.isShared?o.measured[t]:o.layout[t],i=dn(n);n.min=e[t].min,n.max=n.min+i}):xo(i,o.layout,e)&&wn(t=>{const n=o.isShared?o.measured[t]:o.layout[t],i=dn(e[t]);n.max=n.min+i});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};fn(s,e,o.layout);const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o.isShared?fn(r,t.applyTransform(n,!0),o.measured):fn(r,e,o.layout);const a=!Yi(s);let l=!1;if(!t.resumeFrom&&(t.relativeParent=t.getClosestProjectingParent(),t.relativeParent&&!t.relativeParent.resumeFrom)){const{snapshot:n,layout:i}=t.relativeParent;if(n&&i){const t={x:{min:0,max:0},y:{min:0,max:0}};yn(t,o.layout,n.layout);const s={x:{min:0,max:0},y:{min:0,max:0}};yn(s,e,i.actual),Xi(t,s)||(l=!0)}}t.notifyListeners("didUpdate",{layout:e,snapshot:o,delta:r,layoutDelta:s,hasLayoutChanged:a,hasRelativeTargetChanged:l})}else t.isLead()&&(null===(i=(n=t.options).onExitComplete)||void 0===i||i.call(n));t.options.transition=void 0}function io(t){t.clearSnapshot()}function oo(t){t.clearMeasurements()}function so(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notifyBeforeLayoutMeasure(),t.resetTransform()}function ro(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function ao(t){t.resolveTargetDelta()}function lo(t){t.calcProjection()}function uo(t){t.resetRotation()}function co(t){t.removeLeadSnapshot()}function ho(t,e,n){t.translate=ee(e.translate,0,n),t.scale=ee(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function po(t,e,n,i){t.min=ee(e.min,n.min,i),t.max=ee(e.max,n.max,i)}function mo(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const fo={duration:.45,ease:[.4,0,.1,1]};function vo(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function go(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function yo(t){go(t.x),go(t.y)}function xo(t,e,n){return"position"===t||"preserve-aspect"===t&&!function(t,e,n=.1){return Ye(t,e)<=n}(qi(e),qi(n),.2)}const bo=to({attachResizeListener:(t,e)=>It(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Po={current:void 0},Ao=to({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Po.current){const t=new bo(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Po.current=t}return Po.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),So={current:null},To={current:!1};function wo(t){return Boolean(M(t)&&t.add)}function Eo(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 Vo=t=>/^0[^.\s]+$/.test(t),Mo=t=>e=>e.test(t),Co=[d,S,u,L,D,k,{test:t=>"auto"===t,parse:t=>t}],Ro=t=>Co.find(Mo(t)),Lo=[...Co,st,ct],Do=t=>Lo.find(Mo(t));function ko(t,e,n){const i=t.getProps();return j(i,e,void 0!==n?n:i.custom,function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.getVelocity()),e}(t))}function jo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ci(n))}function Oo(t,e){if(!e)return;return(e[t]||e.default||e).from}function Fo(t,e,n={}){var i;const o=ko(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const r=o?()=>Uo(t,o,n):()=>Promise.resolve(),a=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,o=1,s){const r=[],a=(t.variantChildren.size-1)*i,l=1===o?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(Io).forEach((t,i)=>{r.push(Fo(t,e,{...s,delay:n+l(i)}).then(()=>t.notifyAnimationComplete(e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(e)}return Promise.all([r(),a(n.delay)])}function Uo(t,e,{delay:n=0,transitionOverride:i,type:o}={}){var s;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");i&&(r=i);const c=[],h=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in l){const i=t.getValue(e),o=l[e];if(!i||void 0===o||h&&Bo(h,e))continue;let s={delay:n,...r};t.shouldReduceMotion&&O.has(e)&&(s={...s,type:!1,delay:0});let a=li(e,i,o,s);wo(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=ko(t,e);let{transitionEnd:i={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...i};for(const e in s){jo(t,e,y(s[e]))}}(t,a)})}function Io(t,e){return t.sortNodePosition(e)}function Bo({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const No=[Tn.Animate,Tn.InView,Tn.Focus,Tn.Hover,Tn.Tap,Tn.Drag,Tn.Exit],zo=[...No].reverse(),$o=No.length;function Go(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notifyAnimationStart(e),Array.isArray(e)){const o=e.map(e=>Fo(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=Fo(t,e,n);else{const o="function"==typeof e?ko(t,e,n.custom):e;i=Uo(t,o,n)}return i.then(()=>t.notifyAnimationComplete(e))}(t,e,n)))}function Ho(t){let e=Go(t);const n={[Tn.Animate]:Yo(!0),[Tn.InView]:Yo(),[Tn.Hover]:Yo(),[Tn.Tap]:Yo(),[Tn.Drag]:Yo(),[Tn.Focus]:Yo(),[Tn.Exit]:Yo()};let i=!0;const o=(e,n)=>{const i=ko(t,n);if(i){const{transition:t,transitionEnd:n,...o}=i;e={...e,...o,...n}}return e};function s(s,r){var a;const l=t.getProps(),u=t.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let e=0;e<$o;e++){const m=zo[e],f=n[m],g=null!==(a=l[m])&&void 0!==a?a:u[m],y=U(g),x=m===r?f.isActive:null;!1===x&&(p=e);let b=g===u[m]&&g!==l[m]&&y;if(b&&i&&t.manuallyAnimateOnMount&&(b=!1),f.protectedKeys={...d},!f.isActive&&null===x||!g&&!f.prevProp||F(g)||"boolean"==typeof g)continue;const P=Wo(f.prevProp,g);let A=P||m===r&&f.isActive&&!b&&y||e>p&&y;const S=Array.isArray(g)?g:[g];let T=S.reduce(o,{});!1===x&&(T={});const{prevResolvedValues:w={}}=f,E={...w,...T},V=t=>{A=!0,h.delete(t),f.needsAnimating[t]=!0};for(const t in E){const e=T[t],n=w[t];d.hasOwnProperty(t)||(e!==n?v(e)&&v(n)?!Eo(e,n)||P?V(t):f.protectedKeys[t]=!0:void 0!==e?V(t):h.add(t):void 0!==e&&h.has(t)?V(t):f.protectedKeys[t]=!0)}f.prevProp=g,f.prevResolvedValues=T,f.isActive&&(d={...d,...T}),i&&t.blockInitialAnimation&&(A=!1),A&&!b&&c.push(...S.map(t=>({animation:t,options:{type:m,...s}})))}if(h.size){const e={};h.forEach(n=>{const i=t.getBaseTarget(n);void 0!==i&&(e[n]=i)}),c.push({animation:e})}let m=Boolean(c.length);return i&&!1===l.initial&&!t.manuallyAnimateOnMount&&(m=!1),i=!1,m?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,i,o){var r;if(n[e].isActive===i)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Wo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Eo(e,t)}function Yo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Xo=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];const qo=new Set;const Ko=("undefined"==typeof process||process.env,"production"),Zo=Object.keys(I),_o=Zo.length,Jo=({treeType:t="",build:e,getBaseTarget:n,makeTargetAnimatable:i,measureViewportBox:o,render:r,readValueFromInstance:a,removeValueFromRenderState:l,sortNodePosition:u,scrapeMotionValuesFromProps:c})=>({parent:h,props:d,presenceId:p,blockInitialAnimation:m,visualState:v,reducedMotionConfig:g},y={})=>{let b=!1;const{latestValues:P,renderState:A}=v;let S;const T=function(){const t=Xo.map(()=>new Vi),e={},n={clearAllListeners:()=>t.forEach(t=>t.clear()),updatePropListeners:t=>{Xo.forEach(i=>{var o;const s="on"+i,r=t[s];null===(o=e[i])||void 0===o||o.call(e),r&&(e[i]=n[s](r))})}};return t.forEach((t,e)=>{n["on"+Xo[e]]=e=>t.add(e),n["notify"+Xo[e]]=(...e)=>t.notify(...e)}),n}(),w=new Map,E=new Map;let V={};const C={...P},R=d.initial?{...P}:{};let L;function D(){S&&b&&(k(),r(S,A,d.style,W.projection))}function k(){e(W,A,P,y,d)}function O(){T.notifyUpdate(P)}function F(t,e){const n=e.onChange(e=>{P[t]=e,d.onUpdate&&Rt.update(O,!1,!0)}),i=e.onRenderRequest(W.scheduleRender);E.set(t,()=>{n(),i()})}const{willChange:z,...$}=c(d);for(const t in $){const e=$[t];void 0!==P[t]&&M(e)&&(e.set(P[t],!1),wo(z)&&z.add(t))}if(d.values)for(const t in d.values){const e=d.values[t];void 0!==P[t]&&M(e)&&e.set(P[t])}const G=B(d),H=N(d),W={treeType:t,current:null,depth:h?h.depth+1:0,parent:h,children:new Set,presenceId:p,shouldReduceMotion:null,variantChildren:H?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==h?void 0:h.isMounted()),blockInitialAnimation:m,isMounted:()=>Boolean(S),mount(t){b=!0,S=W.current=t,W.projection&&W.projection.mount(t),H&&h&&!G&&(L=null==h?void 0:h.addVariantChild(W)),w.forEach((t,e)=>F(e,t)),To.current||function(){if(To.current=!0,f)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>So.current=t.matches;t.addListener(e),e()}else So.current=!1}(),W.shouldReduceMotion="never"!==g&&("always"===g||So.current),null==h||h.children.add(W),W.setProps(d)},unmount(){var t;null===(t=W.projection)||void 0===t||t.unmount(),Lt.update(O),Lt.render(D),E.forEach(t=>t()),null==L||L(),null==h||h.children.delete(W),T.clearAllListeners(),S=void 0,b=!1},loadFeatures(t,e,n,i,o,r){const a=[];for(let e=0;e<_o;e++){const n=Zo[e],{isEnabled:i,Component:o}=I[n];i(t)&&o&&a.push(s(o,{key:n,...t,visualElement:W}))}if(!W.projection&&o){W.projection=new o(i,W.getLatestValues(),h&&h.projection);const{layoutId:e,layout:n,drag:s,dragConstraints:a,layoutScroll:l}=t;W.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(s)||a&&x(a),visualElement:W,scheduleRender:()=>W.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l})}return a},addVariantChild(t){var e;const n=W.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)},sortNodePosition:e=>u&&t===e.treeType?u(W.getInstance(),e.getInstance()):0,getClosestVariantNode:()=>H?W:null==h?void 0:h.getClosestVariantNode(),getLayoutId:()=>d.layoutId,getInstance:()=>S,getStaticValue:t=>P[t],setStaticValue:(t,e)=>P[t]=e,getLatestValues:()=>P,setVisibility(t){W.isVisible!==t&&(W.isVisible=t,W.scheduleRender())},makeTargetAnimatable:(t,e=!0)=>i(W,t,d,e),measureViewportBox:()=>o(S,d),addValue(t,e){W.hasValue(t)&&W.removeValue(t),w.set(t,e),P[t]=e.get(),F(t,e)},removeValue(t){var e;w.delete(t),null===(e=E.get(t))||void 0===e||e(),E.delete(t),delete P[t],l(t,A)},hasValue:t=>w.has(t),getValue(t,e){if(d.values&&d.values[t])return d.values[t];let n=w.get(t);return void 0===n&&void 0!==e&&(n=Ci(e),W.addValue(t,n)),n},forEachValue:t=>w.forEach(t),readValue:t=>void 0!==P[t]?P[t]:a(S,t,y),setBaseTarget(t,e){C[t]=e},getBaseTarget(t){var e;const{initial:i}=d,o="string"==typeof i||"object"==typeof i?null===(e=j(d,i))||void 0===e?void 0:e[t]:void 0;if(i&&void 0!==o)return o;if(n){const e=n(d,t);if(void 0!==e&&!M(e))return e}return void 0!==R[t]&&void 0===o?void 0:C[t]},...T,build:()=>(k(),A),scheduleRender(){Rt.render(D,!1,!0)},syncRender:D,setProps(t){(t.transformTemplate||d.transformTemplate)&&W.scheduleRender(),d=t,T.updatePropListeners(t),V=function(t,e,n){const{willChange:i}=e;for(const o in e){const s=e[o],r=n[o];if(M(s))t.addValue(o,s),wo(i)&&i.add(o);else if(M(r))t.addValue(o,Ci(s)),wo(i)&&i.remove(o);else if(r!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,Ci(void 0!==e?e:s))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(W,c(d),V)},getProps:()=>d,getVariant:t=>{var e;return null===(e=d.variants)||void 0===e?void 0:e[t]},getDefaultTransition:()=>d.transition,getTransformPagePoint:()=>d.transformPagePoint,getVariantContext(t=!1){if(t)return null==h?void 0:h.getVariantContext();if(!G){const t=(null==h?void 0:h.getVariantContext())||{};return void 0!==d.initial&&(t.initial=d.initial),t}const e={};for(let t=0;t<ts;t++){const n=Qo[t],i=d[n];(U(i)||!1===i)&&(e[n]=i)}return e}};return W},Qo=["initial",...No],ts=Qo.length,es=new Set(["width","height","top","left","right","bottom","x","y"]),ns=t=>es.has(t),is=(t,e)=>{t.set(e,!1),t.set(e)},os=t=>t===d||t===S;var ss;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(ss||(ss={}));const rs=(t,e)=>parseFloat(t.split(", ")[e]),as=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const o=i.match(/^matrix3d\((.+)\)$/);if(o)return rs(o[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?rs(e[1],t):0}},ls=new Set(["x","y","z"]),us=z.filter(t=>!ls.has(t));const cs={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:as(4,13),y:as(5,14)},hs=(t,e,n={},i={})=>{e={...e},i={...i};const o=Object.keys(e).filter(ns);let s=[],r=!1;const a=[];if(o.forEach(o=>{const l=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],c=Ro(u);const h=e[o];let d;if(v(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=Ro(u);for(let n=e;n<t;n++)d?Ro(h[n]):d=Ro(h[n])}else d=Ro(h);if(c!==d)if(os(c)&&os(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[o]=parseFloat(h):Array.isArray(h)&&d===S&&(e[o]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[o]=c.transform(h):(r||(s=function(t){const e=[];return us.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e.length&&t.syncRender(),e}(t),r=!0),a.push(o),i[o]=void 0!==i[o]?i[o]:e[o],is(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const i=e.measureViewportBox(),o=e.getInstance(),s=getComputedStyle(o),{display:r}=s,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=cs[t](i,s)}),e.syncRender();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);is(i,a[n]),t[n]=cs[n](l,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.syncRender(),f&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:i}}return{target:e,transitionEnd:i}};function ds(t,e,n,i){return(t=>Object.keys(t).some(ns))(e)?hs(t,e,n,i):{target:e,transitionEnd:i}}const ps=(t,e,n,i)=>{const o=function(t,{...e},n){const i=t.getInstance();if(!(i instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.forEachValue(t=>{const e=t.get();if(!yi(e))return;const n=bi(e,i);n&&t.set(n)});for(const t in e){const o=e[t];if(!yi(o))continue;const s=bi(o,i);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,i);return ds(t,e=o.target,n,i=o.transitionEnd)};const ms={treeType:"dom",readValueFromInstance(t,e){if(O.has(e)){const t=Jn(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),o=($(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n},sortNodePosition:(t,e)=>2&t.compareDocumentPosition(e)?1:-1,getBaseTarget(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:(t,{transformPagePoint:e})=>zn(t,e),resetTransform(t,e,n){const{transformTemplate:i}=n;e.style.transform=i?i({},""):"none",t.scheduleRender()},restoreTransform(t,e){t.style.transform=e.style.transform},removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...i},{transformValues:o},s=!0){let r=function(t,e,n){var i;const o={};for(const s in t){const t=Oo(s,e);o[s]=void 0!==t?t:null===(i=n.getValue(s))||void 0===i?void 0:i.get()}return o}(i,e||{},t);if(o&&(n&&(n=o(n)),i&&(i=o(i)),r&&(r=o(r))),s){!function(t,e,n){var i,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),r=s.length;if(r)for(let a=0;a<r;a++){const r=s[a],l=e[r];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(o=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==o?o:e[r]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||Vo(u))?u=parseFloat(u):!Do(u)&&ct.test(l)&&(u=Qn(r,l)),t.addValue(r,Ci(u)),void 0===n[r]&&(n[r]=u),t.setBaseTarget(r,u))}}(t,i,r);const e=ps(t,i,r,n);n=e.transitionEnd,i=e.target}return{transition:e,transitionEnd:n,...i}},scrapeMotionValuesFromProps:G,build(t,e,n,i,o){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),H(e,n,i,o.transformTemplate)},render:W},fs=Jo(ms),vs={animation:pi(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=Ho(t)),F(n)&&e(()=>n.subscribe(t),[n])}),exit:pi(t=>{const{custom:n,visualElement:o}=t,[s,r]=fi(),a=i(A);e(()=>{o.isPresent=s;const t=o.animationState&&o.animationState.setActive(Tn.Exit,!s,{custom:a&&a.custom||n});t&&!s&&t.then(r)},[s])})};function gs(t,e,n){return(i,o)=>{ft(i)&&!hn()&&(t.animationState&&t.animationState.setActive(Tn.Hover,e),n&&n(i,o))}}const ys=(t,e)=>!!e&&(t===e||ys(t,e.parentElement));const xs=new WeakMap,bs=new WeakMap,Ps=t=>{const e=xs.get(t.target);e&&e(t)},As=t=>{t.forEach(Ps)};function Ss(t,e,n){const i=function({root:t,...e}){const n=t||document;bs.has(n)||bs.set(n,{});const i=bs.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(As,{root:t,...e})),i[o]}(e);return xs.set(t,n),i.observe(t),()=>{xs.delete(t),i.unobserve(t)}}const Ts={some:0,all:1};function ws(t,n,i,{root:o,margin:s,amount:r="some",once:a}){e(()=>{if(!t)return;const e={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof r?r:Ts[r]};return Ss(i.getInstance(),e,t=>{const{isIntersecting:e}=t;if(n.isInView===e)return;if(n.isInView=e,a&&!e&&n.hasEnteredView)return;e&&(n.hasEnteredView=!0),i.animationState&&i.animationState.setActive(Tn.InView,e);const o=i.getProps(),s=e?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,r])}function Es(t,n,i,{fallback:o=!0}){e(()=>{var e,s;t&&o&&("production"!==Ko&&(e="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||qo.has(e)||(console.warn(e),s&&console.warn(s),qo.add(e))),requestAnimationFrame(()=>{n.hasEnteredView=!0;const{onViewportEnter:t}=i.getProps();t&&t(null),i.animationState&&i.animationState.setActive(Tn.InView,!0)}))},[t])}const Vs={inView:pi((function({visualElement:t,whileInView:e,onViewportEnter:i,onViewportLeave:o,viewport:s={}}){const r=n({hasEnteredView:!1,isInView:!1});let a=Boolean(e||i||o);s.once&&r.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?Es:ws)(a,r.current,t,s)})),tap:pi((function({onTap:t,onTapStart:e,onTapCancel:i,whileTap:o,visualElement:s}){const r=t||e||i||o,a=n(!1),l=n(null),u={passive:!(e||t||i||m)};function c(){l.current&&l.current(),l.current=null}function h(){return c(),a.current=!1,s.animationState&&s.animationState.setActive(Tn.Tap,!1),!hn()}function d(e,n){h()&&(ys(s.getInstance(),e.target)?t&&t(e,n):i&&i(e,n))}function p(t,e){h()&&i&&i(t,e)}function m(t,n){c(),a.current||(a.current=!0,l.current=ce(Gt(window,"pointerup",d,u),Gt(window,"pointercancel",p,u)),s.animationState&&s.animationState.setActive(Tn.Tap,!0),e&&e(t,n))}Ht(s,"pointerdown",r?m:void 0,u),di(c)})),focus:pi((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;Bt(e,"focus",t?()=>{n&&n.setActive(Tn.Focus,!0)}:void 0),Bt(e,"blur",t?()=>{n&&n.setActive(Tn.Focus,!1)}:void 0)})),hover:pi((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:i}){Ht(i,"pointerenter",t||n?gs(i,!0,t):void 0,{passive:!t}),Ht(i,"pointerleave",e||n?gs(i,!1,e):void 0,{passive:!e})}))},Ms=Jo({...ms,getBaseTarget:(t,e)=>t[e],readValueFromInstance(t,e){var n;return O.has(e)?(null===(n=Jn(e))||void 0===n?void 0:n.default)||0:(e=Y.has(e)?e:X(e),t.getAttribute(e))},scrapeMotionValuesFromProps:q,build(t,e,n,i,o){K(e,n,i,o.transformTemplate)},render:Z}),Cs={...{renderer:(t,e)=>_(t)?Ms(e,{enableHardwareAcceleration:!1}):fs(e,{enableHardwareAcceleration:!0}),...vs,...Vs},...mi,...Ti,projectionNodeConstructor:Ao};export{Cs as domMax};
|
|
1
|
+
import t,{useEffect as e,useRef as n,useContext as i,useId as o,createElement as s}from"react";import{q as r,t as a,v as l,w as u,x as c,y as h,z as d,A as p,B as m,i as f,C as v,D as g,E as y,a as x,u as b,M as P,P as A,F as S,G as T,g as w,L as E,S as V,d as M,r as C,H as R,I as L,J as D,K as k,n as j,N as O,m as F,c as U,f as I,b as B,l as N,O as z,Q as $,p as G,h as H,R as W,T as Y,U as X,s as q,j as K,o as Z,k as _}from"./size-rollup-dom-max-assets.js";const J=(t,e)=>n=>Boolean(r(n)&&a.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Q=(t,e,n)=>i=>{if(!r(i))return i;const[o,s,a,u]=i.match(l);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(a),alpha:void 0!==u?parseFloat(u):1}},tt={test:J("hsl","hue"),parse:Q("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+u.transform(c(e))+", "+u.transform(c(n))+", "+c(h.transform(i))+")"},et=p(0,255),nt=Object.assign(Object.assign({},d),{transform:t=>Math.round(et(t))}),it={test:J("rgb","red"),parse:Q("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+nt.transform(t)+", "+nt.transform(e)+", "+nt.transform(n)+", "+c(h.transform(i))+")"};const ot={test:J("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),i=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),i=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:it.transform},st={test:t=>it.test(t)||ot.test(t)||tt.test(t),parse:t=>it.test(t)?it.parse(t):tt.test(t)?tt.parse(t):ot.parse(t),transform:t=>r(t)?t:t.hasOwnProperty("red")?it.transform(t):tt.transform(t)};function rt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const i=t.match(m);i&&(n=i.length,t=t.replace(m,"${c}"),e.push(...i.map(st.parse)));const o=t.match(l);return o&&(t=t.replace(l,"${n}"),e.push(...o.map(d.parse))),{values:e,numColors:n,tokenised:t}}function at(t){return rt(t).values}function lt(t){const{values:e,numColors:n,tokenised:i}=rt(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=e.replace(i<n?"${c}":"${n}",i<n?st.transform(t[i]):c(t[i]));return e}}const ut=t=>"number"==typeof t?0:t;const ct={test:function(t){var e,n,i,o;return isNaN(t)&&r(t)&&(null!==(n=null===(e=t.match(l))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(i=t.match(m))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:at,createTransformer:lt,getAnimatableNone:function(t){const e=at(t);return lt(t)(e.map(ut))}},ht=new Set(["brightness","contrast","saturate","opacity"]);function dt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(l)||[];if(!i)return t;const o=n.replace(i,"");let s=ht.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const pt=/([a-z-]*)\(.*?\)/g,mt=Object.assign(Object.assign({},ct),{getAnimatableNone:t=>{const e=t.match(pt);return e?e.map(dt).join(" "):t}});function ft(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function vt(t){return!!t.touches}const gt={pageX:0,pageY:0};function yt(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||gt;return{x:n[e+"X"],y:n[e+"Y"]}}function xt(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function bt(t,e="page"){return{point:vt(t)?yt(t,e):xt(t,e)}}const Pt=(t,e=!1)=>{const n=e=>t(e,bt(e));return e?(i=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&i(t)}):n;var i},At="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),St="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(At()),1/60*1e3);let Tt=!0,wt=!1,Et=!1;const Vt={delta:0,timestamp:0},Mt=["read","update","preRender","render","postRender"],Ct=Mt.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,o=!1,s=!1;const r=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const l=a&&o,u=l?e:n;return s&&r.add(t),-1===u.indexOf(t)&&(u.push(t),l&&o&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,i=e.length,i)for(let n=0;n<i;n++){const i=e[n];i(l),r.has(i)&&(a.schedule(i),t())}o=!1,s&&(s=!1,a.process(l))}}};return a}(()=>wt=!0),t),{}),Rt=Mt.reduce((t,e)=>{const n=Ct[e];return t[e]=(t,e=!1,i=!1)=>(wt||Ot(),n.schedule(t,e,i)),t},{}),Lt=Mt.reduce((t,e)=>(t[e]=Ct[e].cancel,t),{}),Dt=Mt.reduce((t,e)=>(t[e]=()=>Ct[e].process(Vt),t),{}),kt=t=>Ct[t].process(Vt),jt=t=>{wt=!1,Vt.delta=Tt?1/60*1e3:Math.max(Math.min(t-Vt.timestamp,40),1),Vt.timestamp=t,Et=!0,Mt.forEach(kt),Et=!1,wt&&(Tt=!1,St(jt))},Ot=()=>{wt=!0,Tt=!0,Et||St(jt)},Ft=()=>Vt,Ut=t=>1e3*t;function It(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Bt(t,n,i,o){e(()=>{const e=t.current;if(i&&e)return It(e,n,i,o)},[t,n,i,o])}const Nt={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},zt={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function $t(t){return f&&null===window.onpointerdown?t:f&&null===window.ontouchstart?zt[t]:f&&null===window.onmousedown?Nt[t]:t}function Gt(t,e,n,i){return It(t,$t(e),Pt(n,"pointerdown"===e),i)}function Ht(t,e,n,i){return Bt(t,$t(e),n&&Pt(n,"pointerdown"===e),i)}function Wt(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n}const Yt=(t,e,n)=>Math.min(Math.max(n,t),e);function Xt({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let o,s,r=1-e;r=Yt(.05,1,r),t=Yt(.01,10,t/1e3),r<1?(o=e=>{const i=e*r,o=i*t;return.001-(i-n)/qt(e,r)*Math.exp(-o)},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=qt(Math.pow(e,2),r);return(.001-o(e)>0?-1:1)*((s-a)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function qt(t,e){return t*Math.sqrt(1-e*e)}const Kt=["duration","bounce"],Zt=["stiffness","damping","mass"];function _t(t,e){return e.some(e=>void 0!==t[e])}function Jt(t){var{from:e=0,to:n=1,restSpeed:i=2,restDelta:o}=t,s=Wt(t,["from","to","restSpeed","restDelta"]);const r={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!_t(t,Zt)&&_t(t,Kt)){const n=Xt(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(s),p=Qt,m=Qt;function f(){const t=c?-c/1e3:0,i=n-e,s=l/(2*Math.sqrt(a*u)),r=Math.sqrt(a/u)/1e3;if(void 0===o&&(o=Math.min(Math.abs(n-e)/100,.4)),s<1){const e=qt(r,s);p=o=>{const a=Math.exp(-s*r*o);return n-a*((t+s*r*i)/e*Math.sin(e*o)+i*Math.cos(e*o))},m=n=>{const o=Math.exp(-s*r*n);return s*r*o*(Math.sin(e*n)*(t+s*r*i)/e+i*Math.cos(e*n))-o*(Math.cos(e*n)*(t+s*r*i)-e*i*Math.sin(e*n))}}else if(1===s)p=e=>n-Math.exp(-r*e)*(i+(t+r*i)*e);else{const e=r*Math.sqrt(s*s-1);p=o=>{const a=Math.exp(-s*r*o),l=Math.min(e*o,300);return n-a*((t+s*r*i)*Math.sinh(l)+e*i*Math.cosh(l))/e}}}return f(),{next:t=>{const e=p(t);if(d)r.done=t>=h;else{const s=1e3*m(t),a=Math.abs(s)<=i,l=Math.abs(n-e)<=o;r.done=a&&l}return r.value=r.done?n:e,r},flipTarget:()=>{c=-c,[e,n]=[n,e],f()}}}Jt.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Qt=t=>0,te=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},ee=(t,e,n)=>-n*t+n*e+t;function ne(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 ie({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=ne(a,i,t+1/3),s=ne(a,i,t),r=ne(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}const oe=(t,e,n)=>{const i=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-i)+i))},se=[ot,it,tt],re=t=>se.find(e=>e.test(t)),ae=(t,e)=>{let n=re(t),i=re(e),o=n.parse(t),s=i.parse(e);n===tt&&(o=ie(o),n=it),i===tt&&(s=ie(s),i=it);const r=Object.assign({},o);return t=>{for(const e in r)"alpha"!==e&&(r[e]=oe(o[e],s[e],t));return r.alpha=ee(o.alpha,s.alpha,t),n.transform(r)}},le=t=>"number"==typeof t,ue=(t,e)=>n=>e(t(n)),ce=(...t)=>t.reduce(ue);function he(t,e){return le(t)?n=>ee(t,e,n):st.test(t)?ae(t,e):fe(t,e)}const de=(t,e)=>{const n=[...t],i=n.length,o=t.map((t,n)=>he(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}},pe=(t,e)=>{const n=Object.assign(Object.assign({},t),e),i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=he(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}};function me(t){const e=ct.parse(t),n=e.length;let i=0,o=0,s=0;for(let t=0;t<n;t++)i||"number"==typeof e[t]?i++:void 0!==e[t].hue?s++:o++;return{parsed:e,numNumbers:i,numRGB:o,numHSL:s}}const fe=(t,e)=>{const n=ct.createTransformer(e),i=me(t),o=me(e);return i.numHSL===o.numHSL&&i.numRGB===o.numRGB&&i.numNumbers>=o.numNumbers?ce(de(i.parsed,o.parsed),n):n=>""+(n>0?e:t)},ve=(t,e)=>n=>ee(t,e,n);function ge(t,e,n){const i=[],o=n||("number"==typeof(s=t[0])?ve:"string"==typeof s?st.test(s)?ae:fe:Array.isArray(s)?de:"object"==typeof s?pe:void 0);var s;const r=t.length-1;for(let n=0;n<r;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=ce(t,s)}i.push(s)}return i}function ye(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const r=ge(e,i,o),a=2===s?function([t,e],[n]){return i=>n(te(t,e,i))}(t,r):function(t,e){const n=t.length,i=n-1;return o=>{let s=0,r=!1;if(o<=t[0]?r=!0:o>=t[i]&&(s=i-1,r=!0),!r){let e=1;for(;e<n&&!(t[e]>o||e===i);e++);s=e-1}const a=te(t[s],t[s+1],o);return e[s](a)}}(t,r);return n?e=>a(Yt(t[0],t[s-1],e)):a}const xe=t=>e=>1-t(1-e),be=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pe=t=>e=>e*e*((t+1)*e-t),Ae=t=>t,Se=(Te=2,t=>Math.pow(t,Te));var Te;const we=xe(Se),Ee=be(Se),Ve=t=>1-Math.sin(Math.acos(t)),Me=xe(Ve),Ce=be(Me),Re=Pe(1.525),Le=xe(Re),De=be(Re),ke=(t=>{const e=Pe(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),je=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},Oe=xe(je);function Fe(t,e){return t.map(()=>e||Ee).splice(0,t.length-1)}function Ue({from:t=0,to:e=1,ease:n,offset:i,duration:o=300}){const s={done:!1,value:t},r=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(i&&i.length===r.length?i:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(r),o);function l(){return ye(a,r,{ease:Array.isArray(n)?n:Fe(r,n)})}let u=l();return{next:t=>(s.value=u(t),s.done=t>=o,s),flipTarget:()=>{r.reverse(),u=l()}}}const Ie={keyframes:Ue,spring:Jt,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:i=350,restDelta:o=.5,modifyTarget:s}){const r={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===s?l:s(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/i);return r.done=!(e>o||e<-o),r.value=r.done?u:u+e,r},flipTarget:()=>{}}}};function Be(t,e,n=0){return t-e-n}const Ne=t=>{const e=({delta:e})=>t(e);return{start:()=>Rt.update(e,!0),stop:()=>Lt.update(e)}};function ze(t){var e,n,{from:i,autoplay:o=!0,driver:s=Ne,elapsed:r=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:h,onComplete:d,onRepeat:p,onUpdate:m}=t,f=Wt(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let v,g,y,{to:x}=f,b=0,P=f.duration,A=!1,S=!0;const T=function(t){if(Array.isArray(t.to))return Ue;if(Ie[t.type])return Ie[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Ue:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Jt:Ue}(f);(null===(n=(e=T).needsInterpolation)||void 0===n?void 0:n.call(e,i,x))&&(y=ye([0,100],[i,x],{clamp:!1}),i=0,x=100);const w=T(Object.assign(Object.assign({},f),{from:i,to:x}));function E(){b++,"reverse"===l?(S=b%2==0,r=function(t,e,n=0,i=!0){return i?Be(e+-t,e,n):e-(t-e)+n}(r,P,u,S)):(r=Be(r,P,u),"mirror"===l&&w.flipTarget()),A=!1,p&&p()}function V(t){if(S||(t=-t),r+=t,!A){const t=w.next(Math.max(0,r));g=t.value,y&&(g=y(g)),A=S?t.done:r<=0}null==m||m(g),A&&(0===b&&(null!=P||(P=r)),b<a?function(t,e,n,i){return i?t>=e+n:t<=-n}(r,P,u,S)&&E():(v.stop(),d&&d()))}return o&&(null==c||c(),v=s(V),v.start()),{stop:()=>{null==h||h(),v.stop()}}}function $e(t,e){return e?t*(1e3/e):0}const Ge=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),He=t=>Ge(t)&&t.hasOwnProperty("z"),We=(t,e)=>Math.abs(t-e);function Ye(t,e){if(le(t)&&le(e))return We(t,e);if(Ge(t)&&Ge(e)){const n=We(t.x,e.x),i=We(t.y,e.y),o=He(t)&&He(e)?We(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(o,2))}}const Xe=(t,e)=>1-3*e+3*t,qe=(t,e)=>3*e-6*t,Ke=t=>3*t,Ze=(t,e,n)=>((Xe(e,n)*t+qe(e,n))*t+Ke(e))*t,_e=(t,e,n)=>3*Xe(e,n)*t*t+2*qe(e,n)*t+Ke(e);function Je(t,e,n,i){if(t===e&&n===i)return Ae;const o=new Float32Array(11);for(let e=0;e<11;++e)o[e]=Ze(.1*e,t,n);function s(e){let i=0,s=1;for(;10!==s&&o[s]<=e;++s)i+=.1;--s;const r=i+.1*((e-o[s])/(o[s+1]-o[s])),a=_e(r,t,n);return a>=.001?function(t,e,n,i){for(let o=0;o<8;++o){const o=_e(e,n,i);if(0===o)return e;e-=(Ze(e,n,i)-t)/o}return e}(e,r,t,n):0===a?r:function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=Ze(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<10);return r}(e,i,i+.1,t,n)}return t=>0===t||1===t?t:Ze(s(t),e,i)}class Qe{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=nn(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Ye(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=Ft();this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=tn(e,this.transformPagePoint),ft(t)&&0===t.buttons?this.handlePointerUp(t,e):Rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i}=this.handlers,o=nn(tn(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},vt(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const i=tn(bt(t),this.transformPagePoint),{point:o}=i,{timestamp:s}=Ft();this.history=[{...o,timestamp:s}];const{onSessionStart:r}=e;r&&r(t,nn(i,this.history)),this.removeListeners=ce(Gt(window,"pointermove",this.handlePointerMove),Gt(window,"pointerup",this.handlePointerUp),Gt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Lt.update(this.updatePoint)}}function tn(t,e){return e?{point:e(t.point)}:t}function en(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nn({point:t},e){return{point:t,delta:en(t,sn(e)),offset:en(t,on(e)),velocity:rn(e,.1)}}function on(t){return t[0]}function sn(t){return t[t.length-1]}function rn(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=sn(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>Ut(e)));)n--;if(!i)return{x:0,y:0};const s=(o.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function an(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const ln=an("dragHorizontal"),un=an("dragVertical");function cn(t){let e=!1;if("y"===t)e=un();else if("x"===t)e=ln();else{const t=ln(),n=un();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function hn(){const t=cn(!0);return!t||(t(),!1)}function dn(t){return t.max-t.min}function pn(t,e=0,n=.01){return Ye(t,e)<n}function mn(t,e,n,i=.5){t.origin=i,t.originPoint=ee(e.min,e.max,t.origin),t.scale=dn(n)/dn(e),(pn(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=ee(n.min,n.max,t.origin)-t.originPoint,(pn(t.translate)||isNaN(t.translate))&&(t.translate=0)}function fn(t,e,n,i){mn(t.x,e.x,n.x,null==i?void 0:i.originX),mn(t.y,e.y,n.y,null==i?void 0:i.originY)}function vn(t,e,n){t.min=n.min+e.min,t.max=t.min+dn(e)}function gn(t,e,n){t.min=e.min-n.min,t.max=t.min+dn(e)}function yn(t,e,n){gn(t.x,e.x,n.x),gn(t.y,e.y,n.y)}function xn(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 bn(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 Pn=.35;function An(t,e,n){return{min:Sn(t,e),max:Sn(t,n)}}function Sn(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}var Tn;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(Tn||(Tn={}));function wn(t){return[t("x"),t("y")]}function En({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Vn(t){return void 0===t||1===t}function Mn({scale:t,scaleX:e,scaleY:n}){return!Vn(t)||!Vn(e)||!Vn(n)}function Cn(t){return Mn(t)||Rn(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Rn(t){return Ln(t.x)||Ln(t.y)}function Ln(t){return t&&"0%"!==t}function Dn(t,e,n){return n+e*(t-n)}function kn(t,e,n,i,o){return void 0!==o&&(t=Dn(t,o,i)),Dn(t,n,i)+e}function jn(t,e=0,n=1,i,o){t.min=kn(t.min,e,n,i,o),t.max=kn(t.max,e,n,i,o)}function On(t,{x:e,y:n}){jn(t.x,e.translate,e.scale,e.originPoint),jn(t.y,n.translate,n.scale,n.originPoint)}function Fn(t,e){t.min=t.min+e,t.max=t.max+e}function Un(t,e,[n,i,o]){const s=void 0!==e[o]?e[o]:.5,r=ee(t.min,t.max,s);jn(t,e[n],e[i],r,e.scale)}const In=["x","scaleX","originX"],Bn=["y","scaleY","originY"];function Nn(t,e){Un(t.x,e,In),Un(t.y,e,Bn)}function zn(t,e){return En(function(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}}(t.getBoundingClientRect(),e))}const $n={linear:Ae,easeIn:Se,easeInOut:Ee,easeOut:we,circIn:Ve,circInOut:Ce,circOut:Me,backIn:Re,backInOut:De,backOut:Le,anticipate:ke,bounceIn:Oe,bounceInOut:t=>t<.5?.5*(1-je(1-2*t)):.5*je(2*t-1)+.5,bounceOut:je},Gn=t=>{if(Array.isArray(t)){t.length;const[e,n,i,o]=t;return Je(e,n,i,o)}return"string"==typeof t?$n[t]:t},Hn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!ct.test(e)||e.startsWith("url("))),Wn=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Yn=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Xn=()=>({type:"keyframes",ease:"linear",duration:.3}),qn=t=>({type:"keyframes",duration:.8,values:t}),Kn={x:Wn,y:Wn,z:Wn,rotate:Wn,rotateX:Wn,rotateY:Wn,rotateZ:Wn,scaleX:Yn,scaleY:Yn,scale:Yn,opacity:Xn,backgroundColor:Xn,color:Xn,default:Yn},Zn=(t,e)=>{let n;return n=v(e)?qn:Kn[t]||Kn.default,{to:e,...n(e)}},_n={...g,color:st,backgroundColor:st,outlineColor:st,fill:st,stroke:st,borderColor:st,borderTopColor:st,borderRightColor:st,borderBottomColor:st,borderLeftColor:st,filter:mt,WebkitFilter:mt},Jn=t=>_n[t];function Qn(t,e){var n;let i=Jn(t);return i!==mt&&(i=ct),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}const ti=!1;function ei(t,e){const n=performance.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(Lt.read(i),t(s-e))};return Rt.read(i,!0),()=>Lt.read(i)}function ni({ease:t,times:e,yoyo:n,flip:i,loop:o,...s}){const r={...s};return e&&(r.offset=e),s.duration&&(r.duration=Ut(s.duration)),s.repeatDelay&&(r.repeatDelay=Ut(s.repeatDelay)),t&&(r.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(Gn):Gn(t)),"tween"===s.type&&(r.type="keyframes"),(n||o||i)&&(n?r.repeatType="reverse":o?r.repeatType="loop":i&&(r.repeatType="mirror"),r.repeat=o||n||i||s.repeat),"spring"!==s.type&&(r.type="keyframes"),r}function ii(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:o,repeat:s,repeatType:r,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...Zn(n,e.to)}),{...e,...ni(t)}}function oi(t,e,n,i,o){const s=ai(i,t)||{};let r=void 0!==s.from?s.from:e.get();const a=Hn(t,n);"none"===r&&a&&"string"==typeof n?r=Qn(t,n):si(r)&&"string"==typeof n?r=ri(n):!Array.isArray(n)&&si(n)&&"string"==typeof r&&(n=ri(r));return Hn(t,r)&&a&&!1!==s.type?function(){const i={from:r,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:i,power:o=.8,timeConstant:s=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==i&&t>i}function v(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function g(t){null==m||m.stop(),m=ze(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p}))}function y(t){g(Object.assign({type:"spring",stiffness:r,damping:a,restDelta:l},t))}if(f(t))y({from:t,velocity:e,to:v(t)});else{let i=o*e+t;void 0!==u&&(i=u(i));const r=v(i),a=r===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=$e(t-c,Ft().delta),(1===a&&t>r||-1===a&&t<r)&&y({from:t,to:r,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:l,modifyTarget:u,onUpdate:f(i)?d:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...i,...s}):ze({...ii(s,i,t),onUpdate:t=>{i.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{i.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=y(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function si(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function ri(t){return"number"==typeof t?0:Qn("",t)}function ai(t,e){return t[e]||t.default||t}function li(t,e,n,i={}){return ti&&(i={type:!1}),e.start(o=>{let s;const r=oi(t,e,n,i,o),a=function(t,e){var n,i;return null!==(i=null!==(n=(ai(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==i?i:0}(i,t),l=()=>s=r();let u;return a?u=ei(l,Ut(a)):l(),()=>{u&&u(),s&&s.stop()}})}const ui=new WeakMap;class ci{constructor(t){this.openGlobalLock=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.visualElement=t}start(t,{snapToCursor:e=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new Qe(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(bt(t,"page").point)},onStart:(t,e)=>{var n;const{drag:i,dragPropagation:o,onDragStart:s}=this.getProps();(!i||o||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cn(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),wn(t=>{var e,n;let i=this.getAxisMotionValue(t).get()||0;if(u.test(i)){const o=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(o){i=dn(o)*(parseFloat(i)/100)}}this.originPoint[t]=i}),null==s||s(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(Tn.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&(null==o||o(this.currentDirection)));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.syncRender(),null==s||s(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:o}=this.getProps();null==o||o(t,e)}cancel(){var t,e;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(t=this.panSession)||void 0===t||t.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(Tn.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!hi(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?ee(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?ee(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&x(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:xn(t.x,n,o),y:xn(t.y,e,i)}}(n.actual,t),this.elastic=function(t=Pn){return!1===t?t=0:!0===t&&(t=Pn),{x:An(t,"left","right"),y:An(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&wn(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.actual[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!x(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=zn(t,n),{scroll:o}=e;return o&&(Fn(i.x,o.x),Fn(i.y,o.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:bn(t.x,e.x),y:bn(t.y,e.y)}}(i.layout.actual,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=En(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=wn(r=>{var l;if(!hi(r,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[r])&&void 0!==l?l:{};s&&(u={min:0,max:0});const c=i?200:1e6,h=i?40:1e7,d={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...u};return this.startAxisValueAnimation(r,d)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){return li(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){wn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){wn(e=>{const{drag:n}=this.getProps();if(!hi(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.actual[e];o.set(t[e]-ee(n,s,.5))}})}scalePositionWithinConstraints(){var t;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!x(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};wn(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();o[t]=function(t,e){let n=.5;const i=dn(t),o=dn(e);return o>i?n=te(e.min,e.max-i,t.min):i>o&&(n=te(t.min,t.max-o,e.min)),Yt(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=s?s({},""):"none",null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),wn(t=>{if(!hi(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];n.set(ee(i,s,o[t]))})}addListeners(){var t;ui.set(this.visualElement,this);const e=Gt(this.visualElement.getInstance(),"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();x(t)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout()),n();const s=It(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(wn(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.syncRender())});return()=>{s(),e(),o(),null==r||r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Pn,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function hi(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function di(t){return e(()=>()=>t(),[])}const pi=t=>e=>(t(e),null),mi={pan:pi((function({onPan:t,onPanStart:o,onPanEnd:s,onPanSessionStart:r,visualElement:a}){const l=t||o||s||r,u=n(null),{transformPagePoint:c}=i(P),h={onSessionStart:r,onStart:o,onMove:t,onEnd:(t,e)=>{u.current=null,s&&s(t,e)}};e(()=>{null!==u.current&&u.current.updateHandlers(h)}),Ht(a,"pointerdown",l&&function(t){u.current=new Qe(t,h,{transformPagePoint:c})}),di(()=>u.current&&u.current.end())})),drag:pi((function(t){const{dragControls:n,visualElement:i}=t,o=b(()=>new ci(i));e(()=>n&&n.subscribe(o),[o,n]),e(()=>o.addListeners(),[o])}))};function fi(){const t=i(A);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,a=o();e(()=>r(a),[]);return!n&&s?[!1,()=>s&&s(a)]:[!0]}function vi(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const gi={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!S.test(t))return t;t=parseFloat(t)}return`${vi(t,e.target.x)}% ${vi(t,e.target.y)}%`}};function yi(t){return"string"==typeof t&&t.startsWith("var(--")}const xi=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function bi(t,e,n=1){const[i,o]=function(t){const e=xi.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():yi(o)?bi(o,e,n+1):o}const Pi={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=t.includes("var("),s=[];o&&(t=t.replace(xi,t=>(s.push(t),"_$css")));const r=ct.parse(t);if(r.length>5)return i;const a=ct.createTransformer(t),l="number"!=typeof r[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;r[0+l]/=u,r[1+l]/=c;const h=ee(u,c,.5);"number"==typeof r[2+l]&&(r[2+l]/=h),"number"==typeof r[3+l]&&(r[3+l]/=h);let d=a(r);if(o){let t=0;d=d.replace("_$css",()=>{const e=s[t];return t++,e})}return d}};class Ai extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;T(Si),o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),w.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,i||t.layoutDependency!==e||void 0===e?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Rt.postRender(()=>{var t;(null===(t=s.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(i),(null==n?void 0:n.deregister)&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const Si={borderRadius:{...gi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gi,borderTopRightRadius:gi,borderBottomLeftRadius:gi,borderBottomRightRadius:gi,boxShadow:Pi},Ti={measureLayout:function(e){const[n,o]=fi(),s=i(E);return t.createElement(Ai,{...e,layoutGroup:s,switchLayoutGroup:i(V),isPresent:n,safeToRemove:o})}};function wi(t,e){-1===t.indexOf(e)&&t.push(e)}function Ei(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Vi{constructor(){this.subscriptions=[]}add(t){return wi(this.subscriptions,t),()=>Ei(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 o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Mi{constructor(t){var e;this.version="7.6.2",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Vi,this.velocityUpdateSubscribers=new Vi,this.renderSubscribers=new Vi,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=Ft();this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,Rt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Rt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?$e(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Ci(t){return new Mi(t)}const Ri=["TopLeft","TopRight","BottomLeft","BottomRight"],Li=Ri.length,Di=t=>"string"==typeof t?parseFloat(t):t,ki=t=>"number"==typeof t||S.test(t);function ji(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Oi=Ui(0,.5,Me),Fi=Ui(.5,.95,Ae);function Ui(t,e,n){return i=>i<t?0:i>e?1:n(te(t,e,i))}function Ii(t,e){t.min=e.min,t.max=e.max}function Bi(t,e){Ii(t.x,e.x),Ii(t.y,e.y)}function Ni(t,e,n,i,o){return t=Dn(t-=e,1/n,i),void 0!==o&&(t=Dn(t,1/o,i)),t}function zi(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){if(u.test(e)){e=parseFloat(e);e=ee(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=ee(s.min,s.max,i);t===s&&(a-=e),t.min=Ni(t.min,e,n,a,o),t.max=Ni(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const $i=["x","scaleX","originX"],Gi=["y","scaleY","originY"];function Hi(t,e,n,i){zi(t.x,e,$i,null==n?void 0:n.x,null==i?void 0:i.x),zi(t.y,e,Gi,null==n?void 0:n.y,null==i?void 0:i.y)}function Wi(t){return 0===t.translate&&1===t.scale}function Yi(t){return Wi(t.x)&&Wi(t.y)}function Xi(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function qi(t){return dn(t.x)/dn(t.y)}class Ki{constructor(){this.members=[]}add(t){wi(this.members,t),t.scheduleRender()}remove(t){if(Ei(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){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){var n;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues,t.snapshot.isShared=!0),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;!1===o&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,i,o,s;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(s=null===(i=t.resumingFrom)||void 0===i?void 0:(o=i.options).onExitComplete)||void 0===s||s.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Zi(t,e,n){let i=`translate3d(${t.x.translate/e.x}px, ${t.y.translate/e.y}px, 0) `;if(i+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),o&&(i+=`rotateY(${o}deg) `)}return i+=`scale(${t.x.scale*e.x}, ${t.y.scale*e.y})`,"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"===i?"none":i}const _i=(t,e)=>t.depth-e.depth;class Ji{constructor(){this.children=[],this.isDirty=!1}add(t){wi(this.children,t),this.isDirty=!0}remove(t){Ei(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(_i),this.isDirty=!1,this.children.forEach(t)}}const Qi=["","X","Y","Z"];function to({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(ao),this.nodes.forEach(lo)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=t,this.latestValues=n,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ji)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Vi),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var i;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:o,layout:s,visualElement:r}=this.options;if(r&&!r.getInstance()&&r.mount(e),this.root.nodes.add(this),null===(i=this.parent)||void 0===i||i.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),n&&(s||o)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=ei(i,250),w.hasAnimatedSinceResize&&(w.hasAnimatedSinceResize=!1,this.nodes.forEach(ro))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&r&&(o||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{var o,s,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(s=null!==(o=this.options.transition)&&void 0!==o?o:r.getDefaultTransition())&&void 0!==s?s:fo,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=r.getProps(),p=!this.targetLayout||!Xi(this.targetLayout,i)||n,m=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||m||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,m);const e={...ai(c,"layout"),onPlay:h,onComplete:d};r.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||ro(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=i})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,Lt.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(uo))}willUpdate(t=!0){var e,n,i;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll()}const{layoutId:o,layout:s}=this.options;if(void 0===o&&!s)return;const r=null===(i=this.options.visualElement)||void 0===i?void 0:i.getProps().transformTemplate;this.prevTransformTemplateValue=null==r?void 0:r(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(oo);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(vo),this.potentialNodes.clear()),this.nodes.forEach(so),this.nodes.forEach(eo),this.nodes.forEach(no),this.clearAllSnapshots(),Dt.update(),Dt.preRender(),Dt.render())}clearAllSnapshots(){this.nodes.forEach(io),this.sharedNodes.forEach(co)}scheduleUpdateProjection(){Rt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const t=this.measure(),e=this.removeTransform(this.removeElementScroll(t));yo(e),this.snapshot={measured:t,layout:e,latestValues:{}}}updateLayout(){var t;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 e=this.measure();yo(e);const n=this.layout;this.layout={measured:e,actual:this.removeElementScroll(e)},this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),null===(t=this.options.visualElement)||void 0===t||t.notifyLayoutMeasure(this.layout.actual,null==n?void 0:n.actual)}updateScroll(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=i(this.instance),this.scroll=n(this.instance))}resetTransform(){var t;if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Yi(this.projectionDelta),i=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,s=null==i?void 0:i(this.latestValues,""),r=s!==this.prevTransformTemplateValue;e&&(n||Cn(this.latestValues)||r)&&(o(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Fn(e.x,n.x),Fn(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Bi(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s,isScrollRoot:r}=i;if(i!==this.root&&o&&s.layoutScroll){if(r){Bi(e,t);const{scroll:n}=this.root;n&&(Fn(e.x,-n.x),Fn(e.y,-n.y))}Fn(e.x,o.x),Fn(e.y,o.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Bi(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Nn(n,{x:-i.scroll.x,y:-i.scroll.y}),Cn(i.latestValues)&&Nn(n,i.latestValues)}return Cn(this.latestValues)&&Nn(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Bi(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!Cn(i.latestValues))continue;Mn(i.latestValues)&&i.updateSnapshot();const o={x:{min:0,max:0},y:{min:0,max:0}};Bi(o,i.measure()),Hi(n,i.latestValues,null===(e=i.snapshot)||void 0===e?void 0:e.layout,o)}return Cn(this.latestValues)&&Hi(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var t;const{layout:e,layoutId:n}=this.options;var i,o,s;this.layout&&(e||n)&&(this.targetDelta||this.relativeTarget||(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yn(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),Bi(this.relativeTarget,this.relativeTargetOrigin))),(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&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(i=this.target,o=this.relativeTarget,s=this.relativeParent.target,vn(i.x,o.x,s.x),vn(i.y,o.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):Bi(this.target,this.layout.actual),On(this.target,this.targetDelta)):Bi(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&Boolean(this.relativeParent.resumingFrom)===Boolean(this.resumingFrom)&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yn(this.relativeTargetOrigin,this.target,this.relativeParent.target),Bi(this.relativeTarget,this.relativeTargetOrigin)))))}getClosestProjectingParent(){if(this.parent&&!Mn(this.parent.latestValues)&&!Rn(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{layout:e,layoutId:n}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!e&&!n)return;const i=this.getLead();Bi(this.layoutCorrected,this.layout.actual),function(t,e,n,i=!1){var o,s;const r=n.length;if(!r)return;let a,l;e.x=e.y=1;for(let u=0;u<r;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(s=null===(o=a.instance)||void 0===o?void 0:o.style)||void 0===s?void 0:s.display)&&(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Nn(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,On(t,l)),i&&Cn(a.latestValues)&&Nn(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==i);const{target:o}=i;if(!o)return;this.projectionDelta||(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}});const s=this.treeScale.x,r=this.treeScale.y,a=this.projectionTransform;fn(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.projectionTransform=Zi(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===s&&this.treeScale.y===r||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,i;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(i=this.getStack())||void 0===i||i.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n;const i=this.snapshot,o=(null==i?void 0:i.latestValues)||{},s={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=null==i?void 0:i.isShared,c=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,h=Boolean(l&&!c&&!0===this.options.crossfade&&!this.path.some(mo));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const i=e/1e3;var d,p,m,f;ho(r.x,t.x,i),ho(r.y,t.y,i),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(yn(a,this.layout.actual,this.relativeParent.layout.actual),d=this.relativeTarget,p=this.relativeTargetOrigin,m=a,f=i,po(d.x,p.x,m.x,f),po(d.y,p.y,m.y,f)),l&&(this.animationValues=s,function(t,e,n,i,o,s){var r,a,l,c;o?(t.opacity=ee(0,null!==(r=n.opacity)&&void 0!==r?r:1,Oi(i)),t.opacityExit=ee(null!==(a=e.opacity)&&void 0!==a?a:1,0,Fi(i))):s&&(t.opacity=ee(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(c=n.opacity)&&void 0!==c?c:1,i));for(let o=0;o<Li;o++){const s=`border${Ri[o]}Radius`;let r=ji(e,s),a=ji(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||ki(r)===ki(a)?(t[s]=Math.max(ee(Di(r),Di(a),i),0),(u.test(a)||u.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=ee(e.rotate||0,n.rotate||0,i))}(s,o,this.latestValues,i,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(Lt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Rt.update(()=>{w.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=M(t)?t:Ci(t);return li("",i,e,n),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&xo(this.options.animationType,this.layout.actual,i.actual)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=dn(this.layout.actual.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=dn(this.layout.actual.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Bi(e,n),Nn(e,o),fn(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){var n,i,o;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ki);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(i=e.options.initialPromotionConfig)||void 0===i?void 0:i.shouldPreserveFollowOpacity)||void 0===o?void 0:o.call(i,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const n={};for(let i=0;i<Qi.length;i++){const o="rotate"+Qi[i];t.getStaticValue(o)&&(e=!0,n[o]=t.getStaticValue(o),t.setStaticValue(o,0))}if(e){null==t||t.syncRender();for(const e in n)t.setStaticValue(e,n[e]);t.scheduleRender()}}getProjectionStyles(t={}){var e,n,i;const o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";const s=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=C(t.pointerEvents)||"",o.transform=s?s(this.latestValues,""):"none",o;const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=C(t.pointerEvents)||""),this.hasProjected&&!Cn(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const a=r.animationValues||r.latestValues;this.applyTransformsToTarget(),o.transform=Zi(this.projectionDeltaWithTransform,this.treeScale,a),s&&(o.transform=s(a,o.transform));const{x:l,y:u}=this.projectionDelta;o.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,r.animationValues?o.opacity=r===this?null!==(i=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:o.opacity=r===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in R){if(void 0===a[t])continue;const{correct:e,applyTo:n}=R[t],i=e(a[t],r);if(n){const t=n.length;for(let e=0;e<t;e++)o[n[e]]=i}else o[t]=i}return this.options.layoutId&&(o.pointerEvents=r===this?C(t.pointerEvents)||"":"none"),o}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(oo),this.root.sharedNodes.clear()}}}function eo(t){t.updateLayout()}function no(t){var e,n,i;const o=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout,{animationType:i}=t.options;"size"===i?wn(t=>{const n=o.isShared?o.measured[t]:o.layout[t],i=dn(n);n.min=e[t].min,n.max=n.min+i}):xo(i,o.layout,e)&&wn(t=>{const n=o.isShared?o.measured[t]:o.layout[t],i=dn(e[t]);n.max=n.min+i});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};fn(s,e,o.layout);const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o.isShared?fn(r,t.applyTransform(n,!0),o.measured):fn(r,e,o.layout);const a=!Yi(s);let l=!1;if(!t.resumeFrom&&(t.relativeParent=t.getClosestProjectingParent(),t.relativeParent&&!t.relativeParent.resumeFrom)){const{snapshot:n,layout:i}=t.relativeParent;if(n&&i){const t={x:{min:0,max:0},y:{min:0,max:0}};yn(t,o.layout,n.layout);const s={x:{min:0,max:0},y:{min:0,max:0}};yn(s,e,i.actual),Xi(t,s)||(l=!0)}}t.notifyListeners("didUpdate",{layout:e,snapshot:o,delta:r,layoutDelta:s,hasLayoutChanged:a,hasRelativeTargetChanged:l})}else t.isLead()&&(null===(i=(n=t.options).onExitComplete)||void 0===i||i.call(n));t.options.transition=void 0}function io(t){t.clearSnapshot()}function oo(t){t.clearMeasurements()}function so(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notifyBeforeLayoutMeasure(),t.resetTransform()}function ro(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function ao(t){t.resolveTargetDelta()}function lo(t){t.calcProjection()}function uo(t){t.resetRotation()}function co(t){t.removeLeadSnapshot()}function ho(t,e,n){t.translate=ee(e.translate,0,n),t.scale=ee(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function po(t,e,n,i){t.min=ee(e.min,n.min,i),t.max=ee(e.max,n.max,i)}function mo(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const fo={duration:.45,ease:[.4,0,.1,1]};function vo(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function go(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function yo(t){go(t.x),go(t.y)}function xo(t,e,n){return"position"===t||"preserve-aspect"===t&&!function(t,e,n=.1){return Ye(t,e)<=n}(qi(e),qi(n),.2)}const bo=to({attachResizeListener:(t,e)=>It(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Po={current:void 0},Ao=to({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Po.current){const t=new bo(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Po.current=t}return Po.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),So={current:null},To={current:!1};function wo(t){return Boolean(M(t)&&t.add)}function Eo(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 Vo=t=>/^0[^.\s]+$/.test(t),Mo=t=>e=>e.test(t),Co=[d,S,u,L,D,k,{test:t=>"auto"===t,parse:t=>t}],Ro=t=>Co.find(Mo(t)),Lo=[...Co,st,ct],Do=t=>Lo.find(Mo(t));function ko(t,e,n){const i=t.getProps();return j(i,e,void 0!==n?n:i.custom,function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.getVelocity()),e}(t))}function jo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ci(n))}function Oo(t,e){if(!e)return;return(e[t]||e.default||e).from}function Fo(t,e,n={}){var i;const o=ko(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const r=o?()=>Uo(t,o,n):()=>Promise.resolve(),a=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,o=1,s){const r=[],a=(t.variantChildren.size-1)*i,l=1===o?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(Io).forEach((t,i)=>{r.push(Fo(t,e,{...s,delay:n+l(i)}).then(()=>t.notifyAnimationComplete(e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(e)}return Promise.all([r(),a(n.delay)])}function Uo(t,e,{delay:n=0,transitionOverride:i,type:o}={}){var s;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");i&&(r=i);const c=[],h=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in l){const i=t.getValue(e),o=l[e];if(!i||void 0===o||h&&Bo(h,e))continue;let s={delay:n,...r};t.shouldReduceMotion&&O.has(e)&&(s={...s,type:!1,delay:0});let a=li(e,i,o,s);wo(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=ko(t,e);let{transitionEnd:i={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...i};for(const e in s){jo(t,e,y(s[e]))}}(t,a)})}function Io(t,e){return t.sortNodePosition(e)}function Bo({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const No=[Tn.Animate,Tn.InView,Tn.Focus,Tn.Hover,Tn.Tap,Tn.Drag,Tn.Exit],zo=[...No].reverse(),$o=No.length;function Go(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notifyAnimationStart(e),Array.isArray(e)){const o=e.map(e=>Fo(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=Fo(t,e,n);else{const o="function"==typeof e?ko(t,e,n.custom):e;i=Uo(t,o,n)}return i.then(()=>t.notifyAnimationComplete(e))}(t,e,n)))}function Ho(t){let e=Go(t);const n={[Tn.Animate]:Yo(!0),[Tn.InView]:Yo(),[Tn.Hover]:Yo(),[Tn.Tap]:Yo(),[Tn.Drag]:Yo(),[Tn.Focus]:Yo(),[Tn.Exit]:Yo()};let i=!0;const o=(e,n)=>{const i=ko(t,n);if(i){const{transition:t,transitionEnd:n,...o}=i;e={...e,...o,...n}}return e};function s(s,r){var a;const l=t.getProps(),u=t.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let e=0;e<$o;e++){const m=zo[e],f=n[m],g=null!==(a=l[m])&&void 0!==a?a:u[m],y=U(g),x=m===r?f.isActive:null;!1===x&&(p=e);let b=g===u[m]&&g!==l[m]&&y;if(b&&i&&t.manuallyAnimateOnMount&&(b=!1),f.protectedKeys={...d},!f.isActive&&null===x||!g&&!f.prevProp||F(g)||"boolean"==typeof g)continue;const P=Wo(f.prevProp,g);let A=P||m===r&&f.isActive&&!b&&y||e>p&&y;const S=Array.isArray(g)?g:[g];let T=S.reduce(o,{});!1===x&&(T={});const{prevResolvedValues:w={}}=f,E={...w,...T},V=t=>{A=!0,h.delete(t),f.needsAnimating[t]=!0};for(const t in E){const e=T[t],n=w[t];d.hasOwnProperty(t)||(e!==n?v(e)&&v(n)?!Eo(e,n)||P?V(t):f.protectedKeys[t]=!0:void 0!==e?V(t):h.add(t):void 0!==e&&h.has(t)?V(t):f.protectedKeys[t]=!0)}f.prevProp=g,f.prevResolvedValues=T,f.isActive&&(d={...d,...T}),i&&t.blockInitialAnimation&&(A=!1),A&&!b&&c.push(...S.map(t=>({animation:t,options:{type:m,...s}})))}if(h.size){const e={};h.forEach(n=>{const i=t.getBaseTarget(n);void 0!==i&&(e[n]=i)}),c.push({animation:e})}let m=Boolean(c.length);return i&&!1===l.initial&&!t.manuallyAnimateOnMount&&(m=!1),i=!1,m?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,i,o){var r;if(n[e].isActive===i)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Wo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Eo(e,t)}function Yo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Xo=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];const qo=new Set;const Ko=("undefined"==typeof process||process.env,"production"),Zo=Object.keys(I),_o=Zo.length,Jo=({treeType:t="",build:e,getBaseTarget:n,makeTargetAnimatable:i,measureViewportBox:o,render:r,readValueFromInstance:a,removeValueFromRenderState:l,sortNodePosition:u,scrapeMotionValuesFromProps:c})=>({parent:h,props:d,presenceId:p,blockInitialAnimation:m,visualState:v,reducedMotionConfig:g},y={})=>{let b=!1;const{latestValues:P,renderState:A}=v;let S;const T=function(){const t=Xo.map(()=>new Vi),e={},n={clearAllListeners:()=>t.forEach(t=>t.clear()),updatePropListeners:t=>{Xo.forEach(i=>{var o;const s="on"+i,r=t[s];null===(o=e[i])||void 0===o||o.call(e),r&&(e[i]=n[s](r))})}};return t.forEach((t,e)=>{n["on"+Xo[e]]=e=>t.add(e),n["notify"+Xo[e]]=(...e)=>t.notify(...e)}),n}(),w=new Map,E=new Map;let V={};const C={...P},R=d.initial?{...P}:{};let L;function D(){S&&b&&(k(),r(S,A,d.style,W.projection))}function k(){e(W,A,P,y,d)}function O(){T.notifyUpdate(P)}function F(t,e){const n=e.onChange(e=>{P[t]=e,d.onUpdate&&Rt.update(O,!1,!0)}),i=e.onRenderRequest(W.scheduleRender);E.set(t,()=>{n(),i()})}const{willChange:z,...$}=c(d);for(const t in $){const e=$[t];void 0!==P[t]&&M(e)&&(e.set(P[t],!1),wo(z)&&z.add(t))}if(d.values)for(const t in d.values){const e=d.values[t];void 0!==P[t]&&M(e)&&e.set(P[t])}const G=B(d),H=N(d),W={treeType:t,current:null,depth:h?h.depth+1:0,parent:h,children:new Set,presenceId:p,shouldReduceMotion:null,variantChildren:H?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==h?void 0:h.isMounted()),blockInitialAnimation:m,isMounted:()=>Boolean(S),mount(t){b=!0,S=W.current=t,W.projection&&W.projection.mount(t),H&&h&&!G&&(L=null==h?void 0:h.addVariantChild(W)),w.forEach((t,e)=>F(e,t)),To.current||function(){if(To.current=!0,f)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>So.current=t.matches;t.addListener(e),e()}else So.current=!1}(),W.shouldReduceMotion="never"!==g&&("always"===g||So.current),null==h||h.children.add(W),W.setProps(d)},unmount(){var t;null===(t=W.projection)||void 0===t||t.unmount(),Lt.update(O),Lt.render(D),E.forEach(t=>t()),null==L||L(),null==h||h.children.delete(W),T.clearAllListeners(),S=void 0,b=!1},loadFeatures(t,e,n,i,o,r){const a=[];for(let e=0;e<_o;e++){const n=Zo[e],{isEnabled:i,Component:o}=I[n];i(t)&&o&&a.push(s(o,{key:n,...t,visualElement:W}))}if(!W.projection&&o){W.projection=new o(i,W.getLatestValues(),h&&h.projection);const{layoutId:e,layout:n,drag:s,dragConstraints:a,layoutScroll:l}=t;W.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(s)||a&&x(a),visualElement:W,scheduleRender:()=>W.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l})}return a},addVariantChild(t){var e;const n=W.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)},sortNodePosition:e=>u&&t===e.treeType?u(W.getInstance(),e.getInstance()):0,getClosestVariantNode:()=>H?W:null==h?void 0:h.getClosestVariantNode(),getLayoutId:()=>d.layoutId,getInstance:()=>S,getStaticValue:t=>P[t],setStaticValue:(t,e)=>P[t]=e,getLatestValues:()=>P,setVisibility(t){W.isVisible!==t&&(W.isVisible=t,W.scheduleRender())},makeTargetAnimatable:(t,e=!0)=>i(W,t,d,e),measureViewportBox:()=>o(S,d),addValue(t,e){W.hasValue(t)&&W.removeValue(t),w.set(t,e),P[t]=e.get(),F(t,e)},removeValue(t){var e;w.delete(t),null===(e=E.get(t))||void 0===e||e(),E.delete(t),delete P[t],l(t,A)},hasValue:t=>w.has(t),getValue(t,e){if(d.values&&d.values[t])return d.values[t];let n=w.get(t);return void 0===n&&void 0!==e&&(n=Ci(e),W.addValue(t,n)),n},forEachValue:t=>w.forEach(t),readValue:t=>void 0!==P[t]?P[t]:a(S,t,y),setBaseTarget(t,e){C[t]=e},getBaseTarget(t){var e;const{initial:i}=d,o="string"==typeof i||"object"==typeof i?null===(e=j(d,i))||void 0===e?void 0:e[t]:void 0;if(i&&void 0!==o)return o;if(n){const e=n(d,t);if(void 0!==e&&!M(e))return e}return void 0!==R[t]&&void 0===o?void 0:C[t]},...T,build:()=>(k(),A),scheduleRender(){Rt.render(D,!1,!0)},syncRender:D,setProps(t){(t.transformTemplate||d.transformTemplate)&&W.scheduleRender(),d=t,T.updatePropListeners(t),V=function(t,e,n){const{willChange:i}=e;for(const o in e){const s=e[o],r=n[o];if(M(s))t.addValue(o,s),wo(i)&&i.add(o);else if(M(r))t.addValue(o,Ci(s)),wo(i)&&i.remove(o);else if(r!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,Ci(void 0!==e?e:s))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(W,c(d),V)},getProps:()=>d,getVariant:t=>{var e;return null===(e=d.variants)||void 0===e?void 0:e[t]},getDefaultTransition:()=>d.transition,getTransformPagePoint:()=>d.transformPagePoint,getVariantContext(t=!1){if(t)return null==h?void 0:h.getVariantContext();if(!G){const t=(null==h?void 0:h.getVariantContext())||{};return void 0!==d.initial&&(t.initial=d.initial),t}const e={};for(let t=0;t<ts;t++){const n=Qo[t],i=d[n];(U(i)||!1===i)&&(e[n]=i)}return e}};return W},Qo=["initial",...No],ts=Qo.length,es=new Set(["width","height","top","left","right","bottom","x","y"]),ns=t=>es.has(t),is=(t,e)=>{t.set(e,!1),t.set(e)},os=t=>t===d||t===S;var ss;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(ss||(ss={}));const rs=(t,e)=>parseFloat(t.split(", ")[e]),as=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const o=i.match(/^matrix3d\((.+)\)$/);if(o)return rs(o[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?rs(e[1],t):0}},ls=new Set(["x","y","z"]),us=z.filter(t=>!ls.has(t));const cs={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:as(4,13),y:as(5,14)},hs=(t,e,n={},i={})=>{e={...e},i={...i};const o=Object.keys(e).filter(ns);let s=[],r=!1;const a=[];if(o.forEach(o=>{const l=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],c=Ro(u);const h=e[o];let d;if(v(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=Ro(u);for(let n=e;n<t;n++)d?Ro(h[n]):d=Ro(h[n])}else d=Ro(h);if(c!==d)if(os(c)&&os(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[o]=parseFloat(h):Array.isArray(h)&&d===S&&(e[o]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[o]=c.transform(h):(r||(s=function(t){const e=[];return us.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e.length&&t.syncRender(),e}(t),r=!0),a.push(o),i[o]=void 0!==i[o]?i[o]:e[o],is(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const i=e.measureViewportBox(),o=e.getInstance(),s=getComputedStyle(o),{display:r}=s,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=cs[t](i,s)}),e.syncRender();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);is(i,a[n]),t[n]=cs[n](l,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.syncRender(),f&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:i}}return{target:e,transitionEnd:i}};function ds(t,e,n,i){return(t=>Object.keys(t).some(ns))(e)?hs(t,e,n,i):{target:e,transitionEnd:i}}const ps=(t,e,n,i)=>{const o=function(t,{...e},n){const i=t.getInstance();if(!(i instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.forEachValue(t=>{const e=t.get();if(!yi(e))return;const n=bi(e,i);n&&t.set(n)});for(const t in e){const o=e[t];if(!yi(o))continue;const s=bi(o,i);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,i);return ds(t,e=o.target,n,i=o.transitionEnd)};const ms={treeType:"dom",readValueFromInstance(t,e){if(O.has(e)){const t=Jn(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),o=($(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n},sortNodePosition:(t,e)=>2&t.compareDocumentPosition(e)?1:-1,getBaseTarget(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:(t,{transformPagePoint:e})=>zn(t,e),resetTransform(t,e,n){const{transformTemplate:i}=n;e.style.transform=i?i({},""):"none",t.scheduleRender()},restoreTransform(t,e){t.style.transform=e.style.transform},removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...i},{transformValues:o},s=!0){let r=function(t,e,n){var i;const o={};for(const s in t){const t=Oo(s,e);o[s]=void 0!==t?t:null===(i=n.getValue(s))||void 0===i?void 0:i.get()}return o}(i,e||{},t);if(o&&(n&&(n=o(n)),i&&(i=o(i)),r&&(r=o(r))),s){!function(t,e,n){var i,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),r=s.length;if(r)for(let a=0;a<r;a++){const r=s[a],l=e[r];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(o=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==o?o:e[r]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||Vo(u))?u=parseFloat(u):!Do(u)&&ct.test(l)&&(u=Qn(r,l)),t.addValue(r,Ci(u)),void 0===n[r]&&(n[r]=u),t.setBaseTarget(r,u))}}(t,i,r);const e=ps(t,i,r,n);n=e.transitionEnd,i=e.target}return{transition:e,transitionEnd:n,...i}},scrapeMotionValuesFromProps:G,build(t,e,n,i,o){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),H(e,n,i,o.transformTemplate)},render:W},fs=Jo(ms),vs={animation:pi(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=Ho(t)),F(n)&&e(()=>n.subscribe(t),[n])}),exit:pi(t=>{const{custom:n,visualElement:o}=t,[s,r]=fi(),a=i(A);e(()=>{o.isPresent=s;const t=o.animationState&&o.animationState.setActive(Tn.Exit,!s,{custom:a&&a.custom||n});t&&!s&&t.then(r)},[s])})};function gs(t,e,n){return(i,o)=>{ft(i)&&!hn()&&(t.animationState&&t.animationState.setActive(Tn.Hover,e),n&&n(i,o))}}const ys=(t,e)=>!!e&&(t===e||ys(t,e.parentElement));const xs=new WeakMap,bs=new WeakMap,Ps=t=>{const e=xs.get(t.target);e&&e(t)},As=t=>{t.forEach(Ps)};function Ss(t,e,n){const i=function({root:t,...e}){const n=t||document;bs.has(n)||bs.set(n,{});const i=bs.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(As,{root:t,...e})),i[o]}(e);return xs.set(t,n),i.observe(t),()=>{xs.delete(t),i.unobserve(t)}}const Ts={some:0,all:1};function ws(t,n,i,{root:o,margin:s,amount:r="some",once:a}){e(()=>{if(!t)return;const e={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof r?r:Ts[r]};return Ss(i.getInstance(),e,t=>{const{isIntersecting:e}=t;if(n.isInView===e)return;if(n.isInView=e,a&&!e&&n.hasEnteredView)return;e&&(n.hasEnteredView=!0),i.animationState&&i.animationState.setActive(Tn.InView,e);const o=i.getProps(),s=e?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,r])}function Es(t,n,i,{fallback:o=!0}){e(()=>{var e,s;t&&o&&("production"!==Ko&&(e="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||qo.has(e)||(console.warn(e),s&&console.warn(s),qo.add(e))),requestAnimationFrame(()=>{n.hasEnteredView=!0;const{onViewportEnter:t}=i.getProps();t&&t(null),i.animationState&&i.animationState.setActive(Tn.InView,!0)}))},[t])}const Vs={inView:pi((function({visualElement:t,whileInView:e,onViewportEnter:i,onViewportLeave:o,viewport:s={}}){const r=n({hasEnteredView:!1,isInView:!1});let a=Boolean(e||i||o);s.once&&r.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?Es:ws)(a,r.current,t,s)})),tap:pi((function({onTap:t,onTapStart:e,onTapCancel:i,whileTap:o,visualElement:s}){const r=t||e||i||o,a=n(!1),l=n(null),u={passive:!(e||t||i||m)};function c(){l.current&&l.current(),l.current=null}function h(){return c(),a.current=!1,s.animationState&&s.animationState.setActive(Tn.Tap,!1),!hn()}function d(e,n){h()&&(ys(s.getInstance(),e.target)?t&&t(e,n):i&&i(e,n))}function p(t,e){h()&&i&&i(t,e)}function m(t,n){c(),a.current||(a.current=!0,l.current=ce(Gt(window,"pointerup",d,u),Gt(window,"pointercancel",p,u)),s.animationState&&s.animationState.setActive(Tn.Tap,!0),e&&e(t,n))}Ht(s,"pointerdown",r?m:void 0,u),di(c)})),focus:pi((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;Bt(e,"focus",t?()=>{n&&n.setActive(Tn.Focus,!0)}:void 0),Bt(e,"blur",t?()=>{n&&n.setActive(Tn.Focus,!1)}:void 0)})),hover:pi((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:i}){Ht(i,"pointerenter",t||n?gs(i,!0,t):void 0,{passive:!t}),Ht(i,"pointerleave",e||n?gs(i,!1,e):void 0,{passive:!e})}))},Ms=Jo({...ms,getBaseTarget:(t,e)=>t[e],readValueFromInstance(t,e){var n;return O.has(e)?(null===(n=Jn(e))||void 0===n?void 0:n.default)||0:(e=Y.has(e)?e:X(e),t.getAttribute(e))},scrapeMotionValuesFromProps:q,build(t,e,n,i,o){K(e,n,i,o.transformTemplate)},render:Z}),Cs={...{renderer:(t,e)=>_(t)?Ms(e,{enableHardwareAcceleration:!1}):fs(e,{enableHardwareAcceleration:!0}),...vs,...Vs},...mi,...Ti,projectionNodeConstructor:Ao};export{Cs as domMax};
|