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