framer-motion 10.0.0 → 10.0.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.
@@ -1 +1 @@
1
- import*as t from"react";import e,{createContext as n,useContext as i,useLayoutEffect as s,useEffect as o,useRef as r,useInsertionEffect as a,useCallback as l,useMemo as c,forwardRef as u,createElement as h,useId as d}from"react";const p=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),m=n({});const f=n(null),g="undefined"!=typeof document,y=g?s:o,v=n({strict:!1});function x(t,e,n,s){const l=i(m).visualElement,c=i(v),u=i(f),h=i(p).reducedMotion,d=r();s=s||c.renderer,!d.current&&s&&(d.current=s(t,{visualState:e,parent:l,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:h}));const g=d.current;a(()=>{g&&g.update(n,u)}),y(()=>{g&&g.render()}),o(()=>{g&&g.updateFeatures()});return(window.HandoffAppearAnimations?y:o)(()=>{g&&g.animationState&&g.animationState.animateChanges()}),g}function P(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function b(t){return"string"==typeof t||Array.isArray(t)}function T(t){return"object"==typeof t&&"function"==typeof t.start}const w=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],S=["initial",...w];function A(t){return T(t.animate)||S.some(e=>b(t[e]))}function V(t){return Boolean(A(t)||t.variants)}function E(t){const{initial:e,animate:n}=function(t,e){if(A(t)){const{initial:e,animate:n}=t;return{initial:!1===e||b(e)?e:void 0,animate:b(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,i(m));return c(()=>({initial:e,animate:n}),[C(e),C(n)])}function C(t){return Array.isArray(t)?t.join(" "):t}const M={animation:["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},D={};for(const t in M)D[t]={isEnabled:e=>M[t].some(t=>!!e[t])};function L(t){const e=r(null);return null===e.current&&(e.current=t()),e.current}const k={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let R=1;const B=n({}),j=n({}),F=Symbol.for("motionComponentSymbol");function O({preloadedFeatures:e,createVisualElement:n,useRender:s,useVisualState:o,Component:r}){e&&function(t){for(const e in t)D[e]={...D[e],...t[e]}}(e);const a=u((function(a,c){let u;const h={...i(p),...a,layoutId:I(a)},{isStatic:d}=h,f=E(a),y=d?void 0:L(()=>{if(k.hasEverUpdated)return R++}),b=o(a,d);if(!d&&g){f.visualElement=x(r,b,h,n);const t=i(j),s=i(v).strict;f.visualElement&&(u=f.visualElement.loadFeatures(h,s,e,y,t))}return t.createElement(m.Provider,{value:f},u&&f.visualElement?t.createElement(u,{visualElement:f.visualElement,...h}):null,s(r,a,y,function(t,e,n){return l(i=>{i&&t.mount&&t.mount(i),e&&(i?e.mount(i):e.unmount()),n&&("function"==typeof n?n(i):P(n)&&(n.current=i))},[e])}(b,f.visualElement,c),b,d,f.visualElement))}));return a[F]=r,a}function I({layoutId:t}){const e=i(B).id;return e&&void 0!==t?e+"-"+t:t}function U(t){function e(e,n={}){return O(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,i)=>(n.has(i)||n.set(i,e(i)),n.get(i))})}const N=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function $(t){return"string"==typeof t&&!t.includes("-")&&!!(N.indexOf(t)>-1||/[A-Z]/.test(t))}const W={};const H=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],z=new Set(H);function Y(t,{layout:e,layoutId:n}){return z.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!W[t]||"opacity"===t)}const X=t=>Boolean(t&&t.getVelocity),G={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},q=H.length;const Z=t=>e=>"string"==typeof e&&e.startsWith(t),K=Z("--"),_=Z("var(--"),J=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Q=(t,e,n)=>Math.min(Math.max(n,t),e),tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},et={...tt,transform:t=>Q(0,1,t)},nt={...tt,default:1},it=t=>Math.round(1e5*t)/1e5,st=/(-)?([\d]*\.?[\d])+/g,ot=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,rt=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function at(t){return"string"==typeof t}const lt=t=>({test:e=>at(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ct=lt("deg"),ut=lt("%"),ht=lt("px"),dt=lt("vh"),pt=lt("vw"),mt={...ut,parse:t=>ut.parse(t)/100,transform:t=>ut.transform(100*t)},ft={...tt,transform:Math.round},gt={borderWidth:ht,borderTopWidth:ht,borderRightWidth:ht,borderBottomWidth:ht,borderLeftWidth:ht,borderRadius:ht,radius:ht,borderTopLeftRadius:ht,borderTopRightRadius:ht,borderBottomRightRadius:ht,borderBottomLeftRadius:ht,width:ht,maxWidth:ht,height:ht,maxHeight:ht,size:ht,top:ht,right:ht,bottom:ht,left:ht,padding:ht,paddingTop:ht,paddingRight:ht,paddingBottom:ht,paddingLeft:ht,margin:ht,marginTop:ht,marginRight:ht,marginBottom:ht,marginLeft:ht,rotate:ct,rotateX:ct,rotateY:ct,rotateZ:ct,scale:nt,scaleX:nt,scaleY:nt,scaleZ:nt,skew:ct,skewX:ct,skewY:ct,distance:ht,translateX:ht,translateY:ht,translateZ:ht,x:ht,y:ht,z:ht,perspective:ht,transformPerspective:ht,opacity:et,originX:mt,originY:mt,originZ:ht,zIndex:ft,fillOpacity:et,strokeOpacity:et,numOctaves:ft};function yt(t,e,n,i){const{style:s,vars:o,transform:r,transformOrigin:a}=t;let l=!1,c=!1,u=!0;for(const t in e){const n=e[t];if(K(t)){o[t]=n;continue}const i=gt[t],h=J(n,i);if(z.has(t)){if(l=!0,r[t]=h,!u)continue;n!==(i.default||0)&&(u=!1)}else t.startsWith("origin")?(c=!0,a[t]=h):s[t]=h}if(e.transform||(l||i?s.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},i,s){let o="";for(let e=0;e<q;e++){const n=H[e];if(void 0!==t[n]){o+=`${G[n]||n}(${t[n]}) `}}return e&&!t.z&&(o+="translateZ(0)"),o=o.trim(),s?o=s(t,i?"":o):n&&i&&(o="none"),o}(t.transform,n,u,i):s.transform&&(s.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;s.transformOrigin=`${t} ${e} ${n}`}}const vt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function xt(t,e,n){for(const i in e)X(e[i])||Y(i,n)||(t[i]=e[i])}function Pt(t,e,n){const i={};return xt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},e,n){return c(()=>{const i={style:{},transform:{},transformOrigin:{},vars:{}};return yt(i,e,{enableHardwareAcceleration:!n},t),Object.assign({},i.vars,i.style)},[e])}(t,e,n)),t.transformValues?t.transformValues(i):i}function bt(t,e,n){const i={},s=Pt(t,e,n);return t.drag&&!1!==t.dragListener&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=s,i}const Tt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function wt(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||Tt.has(t)}let St=t=>!wt(t);try{(At=require("@emotion/is-prop-valid").default)&&(St=t=>t.startsWith("on")?!wt(t):At(t))}catch(t){}var At;function Vt(t,e,n){return"string"==typeof t?t:ht.transform(e+n*t)}const Et={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ct={offset:"strokeDashoffset",array:"strokeDasharray"};function Mt(t,{attrX:e,attrY:n,originX:i,originY:s,pathLength:o,pathSpacing:r=1,pathOffset:a=0,...l},c,u,h){if(yt(t,l,c,h),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==i||void 0!==s||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Vt(e,t.x,t.width)} ${Vt(n,t.y,t.height)}`}(m,void 0!==i?i:.5,void 0!==s?s:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==o&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Et:Ct;t[o.offset]=ht.transform(-i);const r=ht.transform(e),a=ht.transform(n);t[o.array]=`${r} ${a}`}(d,o,r,a,!1)}const Dt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Lt=t=>"string"==typeof t&&"svg"===t.toLowerCase();function kt(t,e,n,i){const s=c(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Mt(n,e,{enableHardwareAcceleration:!1},Lt(i),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};xt(e,t.style,t),s.style={...e,...s.style}}return s}function Rt(t=!1){return(e,n,i,s,{latestValues:o},r)=>{const a=($(e)?kt:bt)(n,o,r,e),l={...function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(St(s)||!0===n&&wt(s)||!e&&!wt(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(n,"string"==typeof e,t),...a,ref:s},{children:u}=n,d=c(()=>X(u)?u.get():u,[u]);return i&&(l["data-projection-id"]=i),h(e,{...l,children:d})}}const Bt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function jt(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}const Ft=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ot(t,e,n,i){jt(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ft.has(n)?n:Bt(n),e.attrs[n])}function It(t,e){const{style:n}=t,i={};for(const s in n)(X(n[s])||e.style&&X(e.style[s])||Y(s,t))&&(i[s]=n[s]);return i}function Ut(t,e){const n=It(t,e);for(const i in t)if(X(t[i])||X(e[i])){n["x"===i||"y"===i?"attr"+i.toUpperCase():i]=t[i]}return n}function Nt(t,e,n,i={},s={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,i,s)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,i,s)),e}const $t=t=>Array.isArray(t);function Wt(t){const e=X(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const Ht=t=>(e,n)=>{const s=i(m),o=i(f),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},i,s,o){const r={latestValues:zt(i,s,o,t),renderState:e()};return n&&(r.mount=t=>n(i,t,r)),r}(t,e,s,o);return n?r():L(r)};function zt(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=Wt(o[t]);let{initial:r,animate:a}=t;const l=A(t),c=V(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!T(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=Nt(t,e);if(!n)return;const{transitionEnd:i,transition:o,...r}=n;for(const t in r){let e=r[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(s[t]=e)}for(const t in i)s[t]=i[t]})}return s}const Yt={useVisualState:Ht({scrapeMotionValuesFromProps:Ut,createRenderState:Dt,onMount:(t,e,{renderState:n,latestValues:i})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}Mt(n,i,{enableHardwareAcceleration:!1},Lt(e.tagName),t.transformTemplate),Ot(e,n)}})},Xt={useVisualState:Ht({scrapeMotionValuesFromProps:It,createRenderState:vt})};function Gt(t,{forwardMotionProps:e=!1},n,i){return{...$(t)?Yt:Xt,preloadedFeatures:n,useRender:Rt(e),createVisualElement:i,Component:t}}function qt(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const Zt=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function Kt(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}function _t(t,e,n,i){return qt(t,e,(t=>e=>Zt(e)&&t(e,Kt(e)))(n),i)}const Jt=(t,e)=>n=>e(t(n)),Qt=(...t)=>t.reduce(Jt);function te(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const ee=te("dragHorizontal"),ne=te("dragVertical");function ie(t){let e=!1;if("y"===t)e=ne();else if("x"===t)e=ee();else{const t=ee(),n=ne();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function se(){const t=ie(!0);return!t||(t(),!1)}class oe{constructor(t){this.isMounted=!1,this.node=t}update(){}}function re(t,e){const n="pointer"+(e?"enter":"leave"),i="onHover"+(e?"Start":"End");return _t(t.current,n,(n,s)=>{if("touch"===n.type||se())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e),o[i]&&o[i](n,s)},{passive:!t.getProps()[i]})}const ae=(t,e)=>!!e&&(t===e||ae(t,e.parentElement)),le=t=>t;function ce(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,Kt(n))}const ue=new WeakMap,he=new WeakMap,de=t=>{const e=ue.get(t.target);e&&e(t)},pe=t=>{t.forEach(de)};function me(t,e,n){const i=function({root:t,...e}){const n=t||document;he.has(n)||he.set(n,{});const i=he.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(pe,{root:t,...e})),i[s]}(e);return ue.set(t,n),i.observe(t),()=>{ue.delete(t),i.unobserve(t)}}const fe={some:0,all:1};const ge={inView:{Feature:class extends oe{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:fe[i]};return me(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends oe{constructor(){super(...arguments),this.removeStartListeners=le,this.removeEndListeners=le,this.removeAccessibleListeners=le,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),i=_t(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:i}=this.node.getProps();ae(this.node.current,t.target)?n&&n(t,e):i&&i(t,e)},{passive:!(n.onTap||n.onPointerUp)}),s=_t(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Qt(i,s),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=qt(this.node.current,"keydown",t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=qt(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&ce("up",this.node.getProps().onTap)}),ce("down",(t,e)=>{this.startPress(t,e)})}),e=qt(this.node.current,"blur",()=>{this.isPressing&&ce("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=Qt(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&n(t,e)}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!se()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&n(t,e)}mount(){const t=this.node.getProps(),e=_t(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=qt(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Qt(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends oe{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Qt(qt(this.node.current,"focus",()=>this.onFocus()),qt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends oe{mount(){this.unmount=Qt(re(this.node,!0),re(this.node,!1))}unmount(){}}}};function ye(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const ve=t=>/^0[^.\s]+$/.test(t),xe={delta:0,timestamp:0},Pe="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),be="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Pe()),1/60*1e3);let Te=!0,we=!1,Se=!1;const Ae=["read","update","preRender","render","postRender"],Ve=Ae.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,c=l?e:n;return o&&r.add(t),-1===c.indexOf(t)&&(c.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}(()=>we=!0),t),{}),Ee=Ae.reduce((t,e)=>{const n=Ve[e];return t[e]=(t,e=!1,i=!1)=>(we||ke(),n.schedule(t,e,i)),t},{}),Ce=Ae.reduce((t,e)=>(t[e]=Ve[e].cancel,t),{}),Me=Ae.reduce((t,e)=>(t[e]=()=>Ve[e].process(xe),t),{}),De=t=>Ve[t].process(xe),Le=t=>{we=!1,xe.delta=Te?1/60*1e3:Math.max(Math.min(t-xe.timestamp,40),1),xe.timestamp=t,Se=!0,Ae.forEach(De),Se=!1,we&&(Te=!1,be(Le))},ke=()=>{we=!0,Te=!0,Se||be(Le)};function Re(t,e){-1===t.indexOf(e)&&t.push(e)}function Be(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class je{constructor(){this.subscriptions=[]}add(t){return Re(this.subscriptions,t),()=>Be(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}}function Fe(t,e){return e?t*(1e3/e):0}class Oe{constructor(t,e={}){var n;this.version="10.0.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}=xe;this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,Ee.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=()=>Ee.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){this.events[t]||(this.events[t]=new je);const n=this.events[t].add(e);return"change"===t?()=>{n(),Ee.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}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}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Fe(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ie(t,e){return new Oe(t,e)}const Ue=(t,e)=>n=>Boolean(at(n)&&rt.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Ne=(t,e,n)=>i=>{if(!at(i))return i;const[s,o,r,a]=i.match(st);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},$e={...tt,transform:t=>Math.round((t=>Q(0,255,t))(t))},We={test:Ue("rgb","red"),parse:Ne("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+$e.transform(t)+", "+$e.transform(e)+", "+$e.transform(n)+", "+it(et.transform(i))+")"};const He={test:Ue("#"),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:We.transform},ze={test:Ue("hsl","hue"),parse:Ne("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+ut.transform(it(e))+", "+ut.transform(it(n))+", "+it(et.transform(i))+")"},Ye={test:t=>We.test(t)||He.test(t)||ze.test(t),parse:t=>We.test(t)?We.parse(t):ze.test(t)?ze.parse(t):He.parse(t),transform:t=>at(t)?t:t.hasOwnProperty("red")?We.transform(t):ze.transform(t)};function Xe(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,i=0;const s=t.match(ot);s&&(n=s.length,t=t.replace(ot,"${c}"),e.push(...s.map(Ye.parse)));const o=t.match(st);return o&&(i=o.length,t=t.replace(st,"${n}"),e.push(...o.map(tt.parse))),{values:e,numColors:n,numNumbers:i,tokenised:t}}function Ge(t){return Xe(t).values}function qe(t){const{values:e,numColors:n,tokenised:i}=Xe(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?Ye.transform(t[i]):it(t[i]));return e}}const Ze=t=>"number"==typeof t?0:t;const Ke={test:function(t){var e,n;return isNaN(t)&&at(t)&&((null===(e=t.match(st))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(ot))||void 0===n?void 0:n.length)||0)>0},parse:Ge,createTransformer:qe,getAnimatableNone:function(t){const e=Ge(t);return qe(t)(e.map(Ze))}},_e=new Set(["brightness","contrast","saturate","opacity"]);function Je(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(st)||[];if(!i)return t;const s=n.replace(i,"");let o=_e.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Qe=/([a-z-]*)\(.*?\)/g,tn={...Ke,getAnimatableNone:t=>{const e=t.match(Qe);return e?e.map(Je).join(" "):t}},en={...gt,color:Ye,backgroundColor:Ye,outlineColor:Ye,fill:Ye,stroke:Ye,borderColor:Ye,borderTopColor:Ye,borderRightColor:Ye,borderBottomColor:Ye,borderLeftColor:Ye,filter:tn,WebkitFilter:tn},nn=t=>en[t];function sn(t,e){let n=nn(t);return n!==tn&&(n=Ke),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const on=t=>e=>e.test(t),rn=[tt,ht,ut,ct,pt,dt,{test:t=>"auto"===t,parse:t=>t}],an=t=>rn.find(on(t)),ln=[...rn,Ye,Ke],cn=t=>ln.find(on(t));function un(t,e,n){const i=t.getProps();return Nt(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 hn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ie(n))}function dn(t,e){if(!e)return;return(e[t]||e.default||e).from}function pn(t){return Boolean(X(t)&&t.add)}const mn="data-"+Bt("framerAppearId");let fn=le,gn=le;const yn=t=>1e3*t,vn=!1,xn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pn=t=>e=>1-t(1-e),bn=t=>t*t,Tn=Pn(bn),wn=xn(bn),Sn=(t,e,n)=>-n*t+n*e+t;function An(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 Vn=(t,e,n)=>{const i=t*t;return Math.sqrt(Math.max(0,n*(e*e-i)+i))},En=[He,We,ze];function Cn(t){const e=(n=t,En.find(t=>t.test(n)));var n;let i=e.parse(t);return e===ze&&(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=An(a,i,t+1/3),o=An(a,i,t),r=An(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 Mn=(t,e)=>{const n=Cn(t),i=Cn(e),s={...n};return t=>(s.red=Vn(n.red,i.red,t),s.green=Vn(n.green,i.green,t),s.blue=Vn(n.blue,i.blue,t),s.alpha=Sn(n.alpha,i.alpha,t),We.transform(s))};function Dn(t,e){return"number"==typeof t?n=>Sn(t,e,n):Ye.test(t)?Mn(t,e):Rn(t,e)}const Ln=(t,e)=>{const n=[...t],i=n.length,s=t.map((t,n)=>Dn(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}},kn=(t,e)=>{const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Dn(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}},Rn=(t,e)=>{const n=Ke.createTransformer(e),i=Xe(t),s=Xe(e);return i.numColors===s.numColors&&i.numNumbers>=s.numNumbers?Qt(Ln(i.values,s.values),n):n=>""+(n>0?e:t)},Bn=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},jn=(t,e)=>n=>Sn(t,e,n);function Fn(t,e,n){const i=[],s=n||("number"==typeof(o=t[0])?jn:"string"==typeof o?Ye.test(o)?Mn:Rn:Array.isArray(o)?Ln:"object"==typeof o?kn:jn);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=Qt(t,o)}i.push(o)}return i}function On(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;gn(o===e.length),gn(!i||!Array.isArray(i)||i.length===o-1),t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=Fn(e,i,s),a=r.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const i=Bn(t[n],t[n+1],e);return r[n](i)};return n?e=>l(Q(t[0],t[o-1],e)):l}function In(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=Bn(0,e,i);t.push(Sn(n,1,s))}}(e,t.length-1),e}const Un=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Nn(t,e,n,i){if(t===e&&n===i)return le;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=Un(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:Un(s(t),e,i)}const $n=t=>1-Math.sin(Math.acos(t)),Wn=Pn($n),Hn=xn(Wn),zn=Nn(.33,1.53,.69,.99),Yn=Pn(zn),Xn=xn(Yn),Gn={linear:le,easeIn:bn,easeInOut:wn,easeOut:Tn,circIn:$n,circInOut:Hn,circOut:Wn,backIn:Yn,backInOut:Xn,backOut:zn,anticipate:t=>(t*=2)<1?.5*Yn(t):.5*(2-Math.pow(2,-10*(t-1)))},qn=t=>{if(Array.isArray(t)){gn(4===t.length);const[e,n,i,s]=t;return Nn(e,n,i,s)}return"string"==typeof t?Gn[t]:t};function Zn({keyframes:t,ease:e=wn,times:n,duration:i=300}){t=[...t];const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(qn):qn(e),o={done:!1,value:t[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:In(t),i);function a(){return On(r,t,{ease:Array.isArray(s)?s:(e=t,n=s,e.map(()=>n||wn).splice(0,e.length-1))});var e,n}let l=a();return{next:t=>(o.value=l(t),o.done=t>=i,o),flipTarget:()=>{t.reverse(),l=a()}}}function Kn({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let s,o;fn(t<=1e4);let r=1-e;r=Q(.05,1,r),t=Q(.01,10,t/1e3),r<1?(s=e=>{const i=e*r,s=i*t;return.001-(i-n)/_n(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),c=_n(Math.pow(e,2),r);return(.001-s(e)>0?-1:1)*((o-a)*l)/c}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function _n(t,e){return t*Math.sqrt(1-e*e)}const Jn=["duration","bounce"],Qn=["stiffness","damping","mass"];function ti(t,e){return e.some(e=>void 0!==t[e])}function ei({keyframes:t,restDelta:e,restSpeed:n,...i}){let s=t[0],o=t[t.length-1];const r={done:!1,value:s},{stiffness:a,damping:l,mass:c,velocity:u,duration:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!ti(t,Qn)&&ti(t,Jn)){const n=Kn(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(i);let p=ni,m=u?-u/1e3:0;const f=l/(2*Math.sqrt(a*c));function g(){const t=o-s,i=Math.sqrt(a/c)/1e3,r=Math.abs(t)<5;if(n||(n=r?.01:2),e||(e=r?.005:.5),f<1){const e=_n(i,f);p=n=>{const s=Math.exp(-f*i*n);return o-s*((m+f*i*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===f)p=e=>o-Math.exp(-i*e)*(t+(m+i*t)*e);else{const e=i*Math.sqrt(f*f-1);p=n=>{const s=Math.exp(-f*i*n),r=Math.min(e*n,300);return o-s*((m+f*i*t)*Math.sinh(r)+e*t*Math.cosh(r))/e}}}return g(),{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=Fe(i-p(e),t-e)}else s=0;const a=Math.abs(s)<=n,l=Math.abs(o-i)<=e;r.done=a&&l}return r.value=r.done?o:i,r},flipTarget:()=>{m=-m,[s,o]=[o,s],g()}}}ei.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const ni=t=>0;const ii={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 c=r+l,u=void 0===o?c:o(c);return u!==c&&(l=u-r),{next:t=>{const e=-l*Math.exp(-t/i);return a.done=!(e>s||e<-s),a.value=a.done?u:u+e,a},flipTarget:()=>{}}},keyframes:Zn,tween:Zn,spring:ei};function si(t,e,n=0){return t-e-n}const oi=t=>{const e=({delta:e})=>t(e);return{start:()=>Ee.update(e,!0),stop:()=>Ce.update(e)}};function ri({duration:t,driver:e=oi,elapsed:n=0,repeat:i=0,repeatType:s="loop",repeatDelay:o=0,keyframes:r,autoplay:a=!0,onPlay:l,onStop:c,onComplete:u,onRepeat:h,onUpdate:d,type:p="keyframes",...m}){const f=n;let g,y,v=0,x=t,P=!1,b=!0;const T=ii[r.length>2?"keyframes":p]||Zn,w=r[0],S=r[r.length-1];let A={done:!1,value:w};const{needsInterpolation:V}=T;V&&V(w,S)&&(y=On([0,100],[w,S],{clamp:!1}),r=[0,100]);const E=T({...m,duration:t,keyframes:r});function C(){v++,"reverse"===s?(b=v%2==0,n=function(t,e=0,n=0,i=!0){return i?si(e+-t,e,n):e-(t-e)+n}(n,x,o,b)):(n=si(n,x,o),"mirror"===s&&E.flipTarget()),P=!1,h&&h()}function M(t){b||(t=-t),n+=t,P||(A=E.next(Math.max(0,n)),y&&(A.value=y(A.value)),P=b?A.done:n<=0),d&&d(A.value),P&&(0===v&&(x=void 0!==x?x:n),v<i?function(t,e,n,i){return i?t>=e+n:t<=-n}(n,x,o,b)&&C():(g&&g.stop(),u&&u()))}return a&&(l&&l(),g=e(M),g.start()),{stop:()=>{c&&c(),g&&g.stop()},set currentTime(t){n=f,M(t)},sample:e=>{n=f;const i=t&&"number"==typeof t?Math.max(.5*t,50):50;let s=0;for(M(0);s<=e;){const t=e-s;M(Math.min(t,i)),s+=i}return A}}}const ai=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,li={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ai([0,.65,.55,1]),circOut:ai([.55,0,1,.45]),backIn:ai([.31,.01,.66,-.59]),backOut:ai([.33,1.53,.69,.99])};function ci(t){if(t)return Array.isArray(t)?ai(t):li[t]}const ui={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},hi={},di={};for(const t in ui)di[t]=()=>(void 0===hi[t]&&(hi[t]=ui[t]()),hi[t]);const pi=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),mi=(t,e)=>{return"spring"===e.type||"backgroundColor"===t||!(!(n=e.ease)||Array.isArray(n)||"string"==typeof n&&li[n]);var n};function fi(t,e,{onUpdate:n,onComplete:i,...s}){if(!(di.waapi()&&pi.has(e)&&!s.repeatDelay&&"mirror"!==s.repeatType&&0!==s.damping))return!1;let{keyframes:o,duration:r=300,elapsed:a=0,ease:l}=s;if(mi(e,s)){const t=ri({...s,repeat:0,elapsed:0});let e={done:!1,value:o[0]};const n=[];let i=0;for(;!e.done&&i<2e4;)e=t.sample(i),n.push(e.value),i+=10;o=n,r=i-10,l="linear"}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:ci(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(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(o,s)),Ee.update(()=>c.cancel()),i&&i()},{get currentTime(){return c.currentTime||0},set currentTime(t){c.currentTime=t},stop:()=>{const{currentTime:e}=c;if(e){const n=ri({...s,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}Ee.update(()=>c.cancel())}}}function gi(t,e){const n=performance.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(Ce.read(i),t(o-e))};return Ee.read(i,!0),()=>Ce.read(i)}function yi({keyframes:t,elapsed:e,onUpdate:n,onComplete:i}){const s=()=>{n&&n(t[t.length-1]),i&&i()};return e?{stop:gi(s,-e)}:s()}const vi={type:"spring",stiffness:500,damping:25,restSpeed:10},xi={type:"keyframes",duration:.8},Pi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bi=(t,{keyframes:e})=>e.length>2?xi:z.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:vi:Pi,Ti=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Ke.test(e)||e.startsWith("url(")));function wi(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Si(t){return"number"==typeof t?0:sn("",t)}function Ai(t,e){return t[e]||t.default||t}const Vi=(t,e,n,i={})=>s=>{const o=Ai(i,t)||{},r=o.delay||i.delay||0;let{elapsed:a=0}=i;a-=yn(r);const l=function(t,e,n,i){const s=Ti(e,n);let o=void 0!==i.from?i.from:t.get();return"none"===o&&s&&"string"==typeof n?o=sn(e,n):wi(o)&&"string"==typeof n?o=Si(n):!Array.isArray(n)&&wi(n)&&"string"==typeof o&&(n=Si(o)),Array.isArray(n)?(null===n[0]&&(n[0]=o),n):[o,n]}(e,t,n,o),c=l[0],u=l[l.length-1],h=Ti(t,c),d=Ti(t,u);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||vn||!1===o.type)return yi(p);if("inertia"===o.type)return 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:c,driver:u,onUpdate:h,onComplete:d,onStop:p}){const m=t[0];let f;function g(t){return void 0!==n&&t<n||void 0!==i&&t>i}function y(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function v(t){f&&f.stop(),f=ri({keyframes:[0,1],velocity:0,...t,driver:u,onUpdate:e=>{h&&h(e),t.onUpdate&&t.onUpdate(e)},onComplete:d,onStop:p})}function x(t){v({type:"spring",stiffness:r,damping:a,restDelta:l,...t})}if(g(m))x({velocity:e,keyframes:[m,y(m)]});else{let t=s*e+m;void 0!==c&&(t=c(t));const i=y(t),r=i===n?-1:1;let a,u;const h=t=>{a=u,u=t,e=Fe(t-a,xe.delta),(1===r&&t>i||-1===r&&t<i)&&x({keyframes:[t,i],velocity:e})};v({type:"decay",keyframes:[m,0],velocity:e,timeConstant:o,power:s,restDelta:l,modifyTarget:c,onUpdate:g(t)?h:void 0})}return{stop:()=>f&&f.stop()}}(p);if(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}(o)||(p={...p,...bi(t,p)}),p.duration&&(p.duration=yn(p.duration)),p.repeatDelay&&(p.repeatDelay=yn(p.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=fi(e,t,p);if(n)return n}return ri(p)};function Ei(t,e,n={}){const i=un(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Ci(t,i,n):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;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(Mi).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(Ei(t,e,{...o,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(e)}return Promise.all([o(),r(n.delay)])}function Ci(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");i&&(o=i);const c=[],u=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e),s=a[e];if(!i||void 0===s||u&&Di(u,e))continue;const r={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!i.hasAnimated){const n=t.getProps()[mn];n&&(r.elapsed=window.HandoffAppearAnimations(n,e,i,Ee))}let h=i.start(Vi(e,i,s,t.shouldReduceMotion&&z.has(e)?{type:!1}:r));pn(l)&&(l.add(e),h=h.then(()=>l.remove(e))),c.push(h)}return Promise.all(c).then(()=>{r&&function(t,e){const n=un(t,e);let{transitionEnd:i={},transition:s={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...i};for(const e in o){hn(t,e,(r=o[e],$t(r)?r[r.length-1]||0:r))}var r}(t,r)})}function Mi(t,e){return t.sortNodePosition(e)}function Di({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const Li=[...w].reverse(),ki=w.length;function Ri(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=>Ei(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=Ei(t,e,n);else{const s="function"==typeof e?un(t,e,n.custom):e;i=Ci(t,s,n)}return i.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function Bi(t){let e=Ri(t);const n={animate:Fi(!0),whileInView:Fi(),whileHover:Fi(),whileTap:Fi(),whileDrag:Fi(),whileFocus:Fi(),exit:Fi()};let i=!0;const s=(e,n)=>{const i=un(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)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;e<ki;e++){const p=Li[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=b(f),y=p===r?m.isActive:null;!1===y&&(d=e);let v=f===l[p]&&f!==a[p]&&g;if(v&&i&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...h},!m.isActive&&null===y||!f&&!m.prevProp||T(f)||"boolean"==typeof f)continue;const x=ji(m.prevProp,f);let P=x||p===r&&m.isActive&&!v&&g||e>d&&g;const w=Array.isArray(f)?f:[f];let S=w.reduce(s,{});!1===y&&(S={});const{prevResolvedValues:A={}}=m,V={...A,...S},E=t=>{P=!0,u.delete(t),m.needsAnimating[t]=!0};for(const t in V){const e=S[t],n=A[t];h.hasOwnProperty(t)||(e!==n?$t(e)&&$t(n)?!ye(e,n)||x?E(t):m.protectedKeys[t]=!0:void 0!==e?E(t):u.add(t):void 0!==e&&u.has(t)?E(t):m.protectedKeys[t]=!0)}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(h={...h,...S}),i&&t.blockInitialAnimation&&(P=!1),P&&!v&&c.push(...w.map(t=>({animation:t,options:{type:p,...o}})))}if(u.size){const e={};u.forEach(n=>{const i=t.getBaseTarget(n);void 0!==i&&(e[n]=i)}),c.push({animation:e})}let p=Boolean(c.length);return i&&!1===a.initial&&!t.manuallyAnimateOnMount&&(p=!1),i=!1,p?e(c):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 ji(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!ye(e,t)}function Fi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let Oi=0;const Ii={animation:{Feature:class extends oe{constructor(t){super(t),t.animationState||(t.animationState=Bi(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),T(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends oe{constructor(){super(...arguments),this.id=Oi++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const s=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&s.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},Ui=(t,e)=>Math.abs(t-e);class Ni{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=Hi(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Ui(t.x,e.x),i=Ui(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}=xe;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=$i(e,this.transformPagePoint),Ee.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:i}=this.handlers,s=Hi("pointercancel"===t.type?this.lastMoveEventInfo:$i(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,s),i&&i(t,s)},!Zt(t))return;this.handlers=e,this.transformPagePoint=n;const i=$i(Kt(t),this.transformPagePoint),{point:s}=i,{timestamp:o}=xe;this.history=[{...s,timestamp:o}];const{onSessionStart:r}=e;r&&r(t,Hi(i,this.history)),this.removeListeners=Qt(_t(window,"pointermove",this.handlePointerMove),_t(window,"pointerup",this.handlePointerUp),_t(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ce.update(this.updatePoint)}}function $i(t,e){return e?{point:e(t.point)}:t}function Wi(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Hi({point:t},e){return{point:t,delta:Wi(t,Yi(e)),offset:Wi(t,zi(e)),velocity:Xi(e,.1)}}function zi(t){return t[0]}function Yi(t){return t[t.length-1]}function Xi(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Yi(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>yn(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 Gi(t){return t.max-t.min}function qi(t,e=0,n=.01){return Math.abs(t-e)<=n}function Zi(t,e,n,i=.5){t.origin=i,t.originPoint=Sn(e.min,e.max,t.origin),t.scale=Gi(n)/Gi(e),(qi(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Sn(n.min,n.max,t.origin)-t.originPoint,(qi(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Ki(t,e,n,i){Zi(t.x,e.x,n.x,i?i.originX:void 0),Zi(t.y,e.y,n.y,i?i.originY:void 0)}function _i(t,e,n){t.min=n.min+e.min,t.max=t.min+Gi(e)}function Ji(t,e,n){t.min=e.min-n.min,t.max=t.min+Gi(e)}function Qi(t,e,n){Ji(t.x,e.x,n.x),Ji(t.y,e.y,n.y)}function ts(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 es(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 ns=.35;function is(t,e,n){return{min:ss(t,e),max:ss(t,n)}}function ss(t,e){return"number"==typeof t?t:t[e]||0}function os(t){return[t("x"),t("y")]}function rs({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function as(t){return void 0===t||1===t}function ls({scale:t,scaleX:e,scaleY:n}){return!as(t)||!as(e)||!as(n)}function cs(t){return ls(t)||us(t)||t.z||t.rotate||t.rotateX||t.rotateY}function us(t){return hs(t.x)||hs(t.y)}function hs(t){return t&&"0%"!==t}function ds(t,e,n){return n+e*(t-n)}function ps(t,e,n,i,s){return void 0!==s&&(t=ds(t,s,i)),ds(t,n,i)+e}function ms(t,e=0,n=1,i,s){t.min=ps(t.min,e,n,i,s),t.max=ps(t.max,e,n,i,s)}function fs(t,{x:e,y:n}){ms(t.x,e.translate,e.scale,e.originPoint),ms(t.y,n.translate,n.scale,n.originPoint)}function gs(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function ys(t,e){t.min=t.min+e,t.max=t.max+e}function vs(t,e,[n,i,s]){const o=void 0!==e[s]?e[s]:.5,r=Sn(t.min,t.max,o);ms(t,e[n],e[i],r,e.scale)}const xs=["x","scaleX","originX"],Ps=["y","scaleY","originY"];function bs(t,e){vs(t.x,e,xs),vs(t.y,e,Ps)}function Ts(t,e){return rs(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 ws=new WeakMap;class Ss{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}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;this.panSession=new Ni(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(Kt(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=ie(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),os(t=>{let e=this.getAxisMotionValue(t).get()||0;if(ut.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Gi(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&s(t,e);const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!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&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),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();s&&s(t,e)}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!As(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?Sn(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Sn(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&&P(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:ts(t.x,n,s),y:ts(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=ns){return!1===t?t=0:!0===t&&(t=ns),{x:is(t,"left","right"),y:is(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&os(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||!P(t))return!1;const n=t.current;gn(null!==n);const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=Ts(t,n),{scroll:s}=e;return s&&(ys(i.x,s.offset.x),ys(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:es(t.x,e.x),y:es(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=rs(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=os(r=>{if(!As(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(Vi(t,n,0,e))}stopAnimation(){os(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){os(e=>{const{drag:n}=this.getProps();if(!As(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]-Sn(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!P(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};os(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const i=Gi(t),s=Gi(e);return s>i?n=Bn(e.min,e.max-i,t.min):i>s&&(n=Bn(t.min,t.max-s,e.min)),Q(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),os(e=>{if(!As(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(Sn(s,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;ws.set(this.visualElement,this);const t=_t(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();P(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const s=qt(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(os(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=ns,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function As(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Vs=["TopLeft","TopRight","BottomLeft","BottomRight"],Es=Vs.length,Cs=t=>"string"==typeof t?parseFloat(t):t,Ms=t=>"number"==typeof t||ht.test(t);function Ds(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Ls=Rs(0,.5,Wn),ks=Rs(.5,.95,le);function Rs(t,e,n){return i=>i<t?0:i>e?1:n(Bn(t,e,i))}function Bs(t,e){t.min=e.min,t.max=e.max}function js(t,e){Bs(t.x,e.x),Bs(t.y,e.y)}function Fs(t,e,n,i,s){return t=ds(t-=e,1/n,i),void 0!==s&&(t=ds(t,1/s,i)),t}function Os(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){if(ut.test(e)){e=parseFloat(e);e=Sn(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Sn(o.min,o.max,i);t===o&&(a-=e),t.min=Fs(t.min,e,n,a,s),t.max=Fs(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const Is=["x","scaleX","originX"],Us=["y","scaleY","originY"];function Ns(t,e,n,i){Os(t.x,e,Is,n?n.x:void 0,i?i.x:void 0),Os(t.y,e,Us,n?n.y:void 0,i?i.y:void 0)}function $s(t){return 0===t.translate&&1===t.scale}function Ws(t){return $s(t.x)&&$s(t.y)}function Hs(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 zs(t){return Gi(t.x)/Gi(t.y)}class Ys{constructor(){this.members=[]}add(t){Re(this.members,t),t.scheduleRender()}remove(t){if(Be(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){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Xs(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 Gs=(t,e)=>t.depth-e.depth;class qs{constructor(){this.children=[],this.isDirty=!1}add(t){Re(this.children,t),this.isDirty=!0}remove(t){Be(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Gs),this.isDirty=!1,this.children.forEach(t)}}const Zs=["","X","Y","Z"];let Ks=0;const _s={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Js({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.id=Ks++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var t;_s.totalNodes=_s.resolvedTargetDeltas=_s.recalculatedProjection=0,this.nodes.forEach(eo),this.nodes.forEach(ao),this.nodes.forEach(lo),this.nodes.forEach(no),t=_s,window.MotionDebug&&window.MotionDebug.record(t)},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 qs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new je),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:i,layout:s,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(s||i)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=gi(i,250),k.hasAnimatedSinceResize&&(k.hasAnimatedSinceResize=!1,this.nodes.forEach(ro))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||fo,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Hs(this.targetLayout,i)||n,c=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,c);const e={...Ai(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||ro(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ce.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(co),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());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"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(so);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(go),this.potentialNodes.clear()),this.nodes.forEach(oo),this.nodes.forEach(Qs),this.nodes.forEach(to),this.clearAllSnapshots(),Me.update(),Me.preRender(),Me.render())}clearAllSnapshots(){this.nodes.forEach(io),this.sharedNodes.forEach(uo)}scheduleUpdateProjection(){Ee.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Ee.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}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(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!Ws(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&(e||cs(this.latestValues)||o)&&(s(this.instance,i),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)),yo((i=n).x),yo(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&&(ys(e.x,n.offset.x),ys(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};js(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){js(e,t);const{scroll:n}=this.root;n&&(ys(e.x,-n.offset.x),ys(e.y,-n.offset.y))}ys(e.x,s.offset.x),ys(e.y,s.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};js(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&&bs(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),cs(i.latestValues)&&bs(n,i.latestValues)}return cs(this.latestValues)&&bs(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};js(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!cs(n.latestValues))continue;ls(n.latestValues)&&n.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};js(i,n.measurePageBox()),Ns(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return cs(this.latestValues)&&Ns(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}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();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);if(!((Boolean(this.resumingFrom)||this!==e)&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.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}},Qi(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),js(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,o,r;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&&this.relativeParent&&this.relativeParent.target?(s=this.target,o=this.relativeTarget,r=this.relativeParent.target,_i(s.x,o.x,r.x),_i(s.y,o.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):js(this.target,this.layout.layoutBox),fs(this.target,this.targetDelta)):js(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}},Qi(this.relativeTargetOrigin,this.target,t.target),js(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}_s.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!ls(this.parent.latestValues)&&!us(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let i=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(i=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;js(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const s=o.instance;s&&s.style&&"contents"===s.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&bs(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,fs(t,r)),i&&cs(o.latestValues)&&bs(t,o.latestValues))}e.x=gs(e.x),e.y=gs(e.y)}(this.layoutCorrected,this.treeScale,this.path,n);const{target:r}=e;if(!r)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 a=this.treeScale.x,l=this.treeScale.y,c=this.projectionTransform;Ki(this.projectionDelta,this.layoutCorrected,r,this.latestValues),this.projectionTransform=Xs(this.projectionDelta,this.treeScale),this.projectionTransform===c&&this.treeScale.x===a&&this.treeScale.y===l||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",r)),_s.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(mo));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m;ho(o.x,t.x,n),ho(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qi(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,d=this.relativeTargetOrigin,p=r,m=n,po(l.x,d.x,p.x,m),po(l.y,d.y,p.y,m),h&&Hs(this.relativeTarget,h)&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),js(h,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=Sn(0,void 0!==n.opacity?n.opacity:1,Ls(i)),t.opacityExit=Sn(void 0!==e.opacity?e.opacity:1,0,ks(i))):o&&(t.opacity=Sn(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let s=0;s<Es;s++){const o=`border${Vs[s]}Radius`;let r=Ds(e,o),a=Ds(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Ms(r)===Ms(a)?(t[o]=Math.max(Sn(Cs(r),Cs(a),i),0),(ut.test(a)||ut.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=Sn(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ce.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ee.update(()=>{k.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=X(t)?t:Ie(t);return i.start(Vi("",i,e,n)),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&vo(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Gi(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Gi(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}js(e,n),bs(e,s),Ki(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ys);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){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<Zs.length;e++){const s="rotate"+Zs[e];n[s]&&(i[s]=n[s],t.setStaticValue(s,0))}t.render();for(const e in i)t.setStaticValue(e,i[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const i={};if(!this.instance||this.isSVG)return i;if(!this.isVisible)return{visibility:"hidden"};i.visibility="";const s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=Wt(t.pointerEvents)||"",i.transform=s?s(this.latestValues,""):"none",i;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Wt(t.pointerEvents)||""),this.hasProjected&&!cs(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=Xs(this.projectionDeltaWithTransform,this.treeScale,r),s&&(i.transform=s(r,i.transform));const{x:a,y:l}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?i.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:i.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in W){if(void 0===r[t])continue;const{correct:e,applyTo:n}=W[t],s="none"===i.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=s}else i[t]=s}return this.options.layoutId&&(i.pointerEvents=o===this?Wt(t.pointerEvents)||"":"none"),i}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(so),this.root.sharedNodes.clear()}}}function Qs(t){t.updateLayout()}function to(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;"size"===s?os(t=>{const i=o?n.measuredBox[t]:n.layoutBox[t],s=Gi(i);i.min=e[t].min,i.max=i.min+s}):vo(s,n.layoutBox,e)&&os(t=>{const i=o?n.measuredBox[t]:n.layoutBox[t],s=Gi(e[t]);i.max=i.min+s});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Ki(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Ki(a,t.applyTransform(i,!0),n.measuredBox):Ki(a,e,n.layoutBox);const l=!Ws(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Qi(r,n.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Qi(a,e,o.layoutBox),Hs(r,a)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function eo(t){_s.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function no(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function io(t){t.clearSnapshot()}function so(t){t.clearMeasurements()}function oo(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ro(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function ao(t){t.resolveTargetDelta()}function lo(t){t.calcProjection()}function co(t){t.resetRotation()}function uo(t){t.removeLeadSnapshot()}function ho(t,e,n){t.translate=Sn(e.translate,0,n),t.scale=Sn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function po(t,e,n,i){t.min=Sn(e.min,n.min,i),t.max=Sn(e.max,n.max,i)}function mo(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const fo={duration:.45,ease:[.4,0,.1,1]};function go(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 yo(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function vo(t,e,n){return"position"===t||"preserve-aspect"===t&&!qi(zs(e),zs(n),.2)}const xo=Js({attachResizeListener:(t,e)=>qt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Po={current:void 0},bo=Js({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Po.current){const t=new xo(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Po.current=t}return Po.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function To(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const wo={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ht.test(t))return t;t=parseFloat(t)}return`${To(t,e.target.x)}% ${To(t,e.target.y)}%`}},So=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ao(t,e,n=1){const[i,s]=function(t){const e=So.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():_(s)?Ao(s,e,n+1):s}const Vo={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=t.includes("var("),o=[];s&&(t=t.replace(So,t=>(o.push(t),"_$css")));const r=Ke.parse(t);if(r.length>5)return i;const a=Ke.createTransformer(t),l="number"!=typeof r[0]?1:0,c=n.x.scale*e.x,u=n.y.scale*e.y;r[0+l]/=c,r[1+l]/=u;const h=Sn(c,u,.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}},Eo=new Set(["width","height","top","left","right","bottom","x","y"]),Co=t=>Eo.has(t),Mo=t=>t===tt||t===ht,Do=(t,e)=>parseFloat(t.split(", ")[e]),Lo=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/);if(s)return Do(s[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?Do(e[1],t):0}},ko=new Set(["x","y","z"]),Ro=H.filter(t=>!ko.has(t));const Bo={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:Lo(4,13),y:Lo(5,14)},jo=(t,e,n={},i={})=>{e={...e},i={...i};const s=Object.keys(e).filter(Co);let o=[],r=!1;const a=[];if(s.forEach(s=>{const l=t.getValue(s);if(!t.hasValue(s))return;let c=n[s],u=an(c);const h=e[s];let d;if($t(h)){const t=h.length,e=null===h[0]?1:0;c=h[e],u=an(c);for(let n=e;n<t;n++)d?gn(an(h[n])===d):d=an(h[n])}else d=an(h);if(u!==d)if(Mo(u)&&Mo(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[s]=parseFloat(h):Array.isArray(h)&&d===ht&&(e[s]=h.map(parseFloat))}else(null==u?void 0:u.transform)&&(null==d?void 0:d.transform)&&(0===c||0===h)?0===c?l.set(d.transform(c)):e[s]=u.transform(h):(r||(o=function(t){const e=[];return Ro.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),r=!0),a.push(s),i[s]=void 0!==i[s]?i[s]:e[s],l.jump(h))}),a.length){const n=a.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]=Bo[t](i,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);i&&i.jump(a[n]),t[n]=Bo[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),g&&null!==n&&window.scrollTo({top:n}),{target:s,transitionEnd:i}}return{target:e,transitionEnd:i}};function Fo(t,e,n,i){return(t=>Object.keys(t).some(Co))(e)?jo(t,e,n,i):{target:e,transitionEnd:i}}const Oo=(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(!_(e))return;const n=Ao(e,i);n&&t.set(n)});for(const t in e){const s=e[t];if(!_(s))continue;const o=Ao(s,i);o&&(e[t]=o,n&&void 0===n[t]&&(n[t]=s))}return{target:e,transitionEnd:n}}(t,e,i);return Fo(t,e=s.target,n,i=s.transitionEnd)},Io={current:null},Uo={current:!1};const No=Object.keys(D),$o=No.length,Wo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ho=S.length;class zo extends class{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},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=()=>Ee.render(this.render,!1,!0);const{latestValues:r,renderState:a}=s;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.isControllingVariants=A(e),this.isVariantNode=V(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...c}=this.scrapeMotionValuesFromProps(e,{});for(const t in c){const e=c[t];void 0!==r[t]&&X(e)&&(e.set(r[t],!1),pn(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Uo.current||function(){if(Uo.current=!0,g)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Io.current=t.matches;t.addListener(e),e()}else Io.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Io.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ce.update(this.notifyUpdate),Ce.render(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=z.has(t),i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Ee.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({children:t,...e},n,i,s,o){let r,a;for(let t=0;t<$o;t++){const n=No[t],{isEnabled:i,Feature:s,ProjectionNode:o,MeasureLayout:l}=D[n];o&&(r=o),i(e)&&(!this.features[n]&&s&&(this.features[n]=new s(this)),l&&(a=l))}if(!this.projection&&r){this.projection=new r(s,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(i)||a&&P(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:l,layoutRoot:c})}return a}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update(this.props,this.prevProps):(e.mount(),e.isMounted=!0)}}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)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Wo.length;e++){const n=Wo[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(X(o))t.addValue(s,o),pn(i)&&i.add(s);else if(X(r))t.addValue(s,Ie(o,{owner:t})),pn(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,Ie(void 0!==e?e:o,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<Ho;t++){const n=S[t],i=this.props[n];(b(i)||!1===i)&&(e[n]=i)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);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=Ie(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=Nt(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||X(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 je),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}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){const i={};for(const s in t){const t=dn(s,e);if(void 0!==t)i[s]=t;else{const t=n.getValue(s);t&&(i[s]=t.get())}}return i}(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 c=null;Array.isArray(l)&&(c=l[0]),null===c&&(c=null!==(s=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==s?s:e[r]),null!=c&&("string"==typeof c&&(/^\-?\d*\.?\d+$/.test(c)||ve(c))?c=parseFloat(c):!cn(c)&&Ke.test(l)&&(c=sn(r,l)),t.addValue(r,Ie(c,{owner:t})),void 0===n[r]&&(n[r]=c),null!==c&&t.setBaseTarget(r,c))}}(this,n,o);const t=Oo(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Yo extends zo{readValueFromInstance(t,e){if(z.has(e)){const t=nn(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),s=(K(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ts(t,e)}build(t,e,n,i){yt(t,e,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,e){return It(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;X(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,i){jt(t,e,n,i)}}class Xo extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;var o;o=qo,Object.assign(W,o),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()})),k.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()||Ee.postRender(()=>{const t=o.getStack();t&&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(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Go(t){const[n,s]=function(){const t=i(f);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,r=d();return o(()=>s(r),[]),!e&&n?[!1,()=>n&&n(r)]:[!0]}(),r=i(B);return e.createElement(Xo,{...t,layoutGroup:r,switchLayoutGroup:i(j),isPresent:n,safeToRemove:s})}const qo={borderRadius:{...wo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wo,borderTopRightRadius:wo,borderBottomLeftRadius:wo,borderBottomRightRadius:wo,boxShadow:Vo},Zo={pan:{Feature:class extends oe{constructor(){super(...arguments),this.removePointerDownListener=le}onPointerDown(t){this.session=new Ni(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:t,onStart:e,onMove:n,onEnd:(t,e)=>{delete this.session,i&&i(t,e)}}}mount(){this.removePointerDownListener=_t(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends oe{constructor(t){super(t),this.removeGroupControls=le,this.removeListeners=le,this.controls=new Ss(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||le}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:bo,MeasureLayout:Go}};class Ko extends zo{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(z.has(e)){const t=nn(e);return t&&t.default||0}return e=Ft.has(e)?e:Bt(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return Ut(t,e)}build(t,e,n,i){Mt(t,e,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,n,i){Ot(t,e,0,i)}mount(t){this.isSVGTag=Lt(t.tagName),super.mount(t)}}const _o=(t,e)=>$(t)?new Ko(e,{enableHardwareAcceleration:!1}):new Yo(e,{enableHardwareAcceleration:!0}),Jo={...Ii,...ge,...Zo,...{layout:{ProjectionNode:bo,MeasureLayout:Go}}},Qo=U((t,e)=>Gt(t,e,Jo,_o));function tr(t){return O(Gt(t,{forwardMotionProps:!1},Jo,_o))}export{tr as createDomMotionComponent,Qo as motion};
1
+ import*as t from"react";import e,{createContext as n,useLayoutEffect as i,useEffect as s,useContext as o,useRef as r,useInsertionEffect as a,useCallback as l,useMemo as c,forwardRef as u,createElement as h,useId as d}from"react";const p=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),m=n({}),f=n(null),g="undefined"!=typeof document,y=g?i:s,v=n({strict:!1});function x(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function P(t){return"string"==typeof t||Array.isArray(t)}function b(t){return"object"==typeof t&&"function"==typeof t.start}const T=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],w=["initial",...T];function S(t){return b(t.animate)||w.some(e=>P(t[e]))}function A(t){return Boolean(S(t)||t.variants)}function V(t){const{initial:e,animate:n}=function(t,e){if(S(t)){const{initial:e,animate:n}=t;return{initial:!1===e||P(e)?e:void 0,animate:P(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,o(m));return c(()=>({initial:e,animate:n}),[E(e),E(n)])}function E(t){return Array.isArray(t)?t.join(" "):t}const C={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},M={};for(const t in C)M[t]={isEnabled:e=>C[t].some(t=>!!e[t])};function D(t){const e=r(null);return null===e.current&&(e.current=t()),e.current}const L={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let k=1;const R=n({}),B=n({}),j=Symbol.for("motionComponentSymbol");function F({preloadedFeatures:e,createVisualElement:n,useRender:i,useVisualState:c,Component:h}){e&&function(t){for(const e in t)M[e]={...M[e],...t[e]}}(e);const d=u((function(u,d){let P;const b={...o(p),...u,layoutId:O(u)},{isStatic:T}=b,w=V(u),S=T?void 0:D(()=>{if(L.hasEverUpdated)return k++}),A=c(u,T);if(!T&&g){w.visualElement=function(t,e,n,i){const{visualElement:l}=o(m),c=o(v),u=o(f),h=o(p).reducedMotion,d=r();i=i||c.renderer,!d.current&&i&&(d.current=i(t,{visualState:e,parent:l,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:h}));const g=d.current;return a(()=>{g&&g.update(n,u)}),y(()=>{g&&g.render()}),s(()=>{g&&g.updateFeatures()}),(window.HandoffAppearAnimations?y:s)(()=>{g&&g.animationState&&g.animationState.animateChanges()}),g}(h,A,b,n);const t=o(B),i=o(v).strict;w.visualElement&&(P=w.visualElement.loadFeatures(b,i,e,S,t))}return t.createElement(m.Provider,{value:w},P&&w.visualElement?t.createElement(P,{visualElement:w.visualElement,...b}):null,i(h,u,S,function(t,e,n){return l(i=>{i&&t.mount&&t.mount(i),e&&(i?e.mount(i):e.unmount()),n&&("function"==typeof n?n(i):x(n)&&(n.current=i))},[e])}(A,w.visualElement,d),A,T,w.visualElement))}));return d[j]=h,d}function O({layoutId:t}){const e=o(R).id;return e&&void 0!==t?e+"-"+t:t}function I(t){function e(e,n={}){return F(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,i)=>(n.has(i)||n.set(i,e(i)),n.get(i))})}const U=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function N(t){return"string"==typeof t&&!t.includes("-")&&!!(U.indexOf(t)>-1||/[A-Z]/.test(t))}const $={};const W=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],H=new Set(W);function z(t,{layout:e,layoutId:n}){return H.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!$[t]||"opacity"===t)}const Y=t=>Boolean(t&&t.getVelocity),X={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},G=W.length;const q=t=>e=>"string"==typeof e&&e.startsWith(t),Z=q("--"),K=q("var(--"),_=(t,e)=>e&&"number"==typeof t?e.transform(t):t,J=(t,e,n)=>Math.min(Math.max(n,t),e),Q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},tt={...Q,transform:t=>J(0,1,t)},et={...Q,default:1},nt=t=>Math.round(1e5*t)/1e5,it=/(-)?([\d]*\.?[\d])+/g,st=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,ot=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function rt(t){return"string"==typeof t}const at=t=>({test:e=>rt(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),lt=at("deg"),ct=at("%"),ut=at("px"),ht=at("vh"),dt=at("vw"),pt={...ct,parse:t=>ct.parse(t)/100,transform:t=>ct.transform(100*t)},mt={...Q,transform:Math.round},ft={borderWidth:ut,borderTopWidth:ut,borderRightWidth:ut,borderBottomWidth:ut,borderLeftWidth:ut,borderRadius:ut,radius:ut,borderTopLeftRadius:ut,borderTopRightRadius:ut,borderBottomRightRadius:ut,borderBottomLeftRadius:ut,width:ut,maxWidth:ut,height:ut,maxHeight:ut,size:ut,top:ut,right:ut,bottom:ut,left:ut,padding:ut,paddingTop:ut,paddingRight:ut,paddingBottom:ut,paddingLeft:ut,margin:ut,marginTop:ut,marginRight:ut,marginBottom:ut,marginLeft:ut,rotate:lt,rotateX:lt,rotateY:lt,rotateZ:lt,scale:et,scaleX:et,scaleY:et,scaleZ:et,skew:lt,skewX:lt,skewY:lt,distance:ut,translateX:ut,translateY:ut,translateZ:ut,x:ut,y:ut,z:ut,perspective:ut,transformPerspective:ut,opacity:tt,originX:pt,originY:pt,originZ:ut,zIndex:mt,fillOpacity:tt,strokeOpacity:tt,numOctaves:mt};function gt(t,e,n,i){const{style:s,vars:o,transform:r,transformOrigin:a}=t;let l=!1,c=!1,u=!0;for(const t in e){const n=e[t];if(Z(t)){o[t]=n;continue}const i=ft[t],h=_(n,i);if(H.has(t)){if(l=!0,r[t]=h,!u)continue;n!==(i.default||0)&&(u=!1)}else t.startsWith("origin")?(c=!0,a[t]=h):s[t]=h}if(e.transform||(l||i?s.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},i,s){let o="";for(let e=0;e<G;e++){const n=W[e];if(void 0!==t[n]){o+=`${X[n]||n}(${t[n]}) `}}return e&&!t.z&&(o+="translateZ(0)"),o=o.trim(),s?o=s(t,i?"":o):n&&i&&(o="none"),o}(t.transform,n,u,i):s.transform&&(s.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;s.transformOrigin=`${t} ${e} ${n}`}}const yt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function vt(t,e,n){for(const i in e)Y(e[i])||z(i,n)||(t[i]=e[i])}function xt(t,e,n){const i={};return vt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},e,n){return c(()=>{const i={style:{},transform:{},transformOrigin:{},vars:{}};return gt(i,e,{enableHardwareAcceleration:!n},t),Object.assign({},i.vars,i.style)},[e])}(t,e,n)),t.transformValues?t.transformValues(i):i}function Pt(t,e,n){const i={},s=xt(t,e,n);return t.drag&&!1!==t.dragListener&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=s,i}const bt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function Tt(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||bt.has(t)}let wt=t=>!Tt(t);try{(St=require("@emotion/is-prop-valid").default)&&(wt=t=>t.startsWith("on")?!Tt(t):St(t))}catch(t){}var St;function At(t,e,n){return"string"==typeof t?t:ut.transform(e+n*t)}const Vt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Et={offset:"strokeDashoffset",array:"strokeDasharray"};function Ct(t,{attrX:e,attrY:n,originX:i,originY:s,pathLength:o,pathSpacing:r=1,pathOffset:a=0,...l},c,u,h){if(gt(t,l,c,h),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==i||void 0!==s||p.transform)&&(p.transformOrigin=function(t,e,n){return`${At(e,t.x,t.width)} ${At(n,t.y,t.height)}`}(m,void 0!==i?i:.5,void 0!==s?s:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==o&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Vt:Et;t[o.offset]=ut.transform(-i);const r=ut.transform(e),a=ut.transform(n);t[o.array]=`${r} ${a}`}(d,o,r,a,!1)}const Mt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Dt=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Lt(t,e,n,i){const s=c(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Ct(n,e,{enableHardwareAcceleration:!1},Dt(i),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};vt(e,t.style,t),s.style={...e,...s.style}}return s}function kt(t=!1){return(e,n,i,s,{latestValues:o},r)=>{const a=(N(e)?Lt:Pt)(n,o,r,e),l={...function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(wt(s)||!0===n&&Tt(s)||!e&&!Tt(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(n,"string"==typeof e,t),...a,ref:s},{children:u}=n,d=c(()=>Y(u)?u.get():u,[u]);return i&&(l["data-projection-id"]=i),h(e,{...l,children:d})}}const Rt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Bt(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}const jt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ft(t,e,n,i){Bt(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(jt.has(n)?n:Rt(n),e.attrs[n])}function Ot(t,e){const{style:n}=t,i={};for(const s in n)(Y(n[s])||e.style&&Y(e.style[s])||z(s,t))&&(i[s]=n[s]);return i}function It(t,e){const n=Ot(t,e);for(const i in t)if(Y(t[i])||Y(e[i])){n["x"===i||"y"===i?"attr"+i.toUpperCase():i]=t[i]}return n}function Ut(t,e,n,i={},s={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,i,s)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,i,s)),e}const Nt=t=>Array.isArray(t);function $t(t){const e=Y(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const Wt=t=>(e,n)=>{const i=o(m),s=o(f),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},i,s,o){const r={latestValues:Ht(i,s,o,t),renderState:e()};return n&&(r.mount=t=>n(i,t,r)),r}(t,e,i,s);return n?r():D(r)};function Ht(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=$t(o[t]);let{initial:r,animate:a}=t;const l=S(t),c=A(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!b(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=Ut(t,e);if(!n)return;const{transitionEnd:i,transition:o,...r}=n;for(const t in r){let e=r[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(s[t]=e)}for(const t in i)s[t]=i[t]})}return s}const zt={useVisualState:Wt({scrapeMotionValuesFromProps:It,createRenderState:Mt,onMount:(t,e,{renderState:n,latestValues:i})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}Ct(n,i,{enableHardwareAcceleration:!1},Dt(e.tagName),t.transformTemplate),Ft(e,n)}})},Yt={useVisualState:Wt({scrapeMotionValuesFromProps:Ot,createRenderState:yt})};function Xt(t,{forwardMotionProps:e=!1},n,i){return{...N(t)?zt:Yt,preloadedFeatures:n,useRender:kt(e),createVisualElement:i,Component:t}}function Gt(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const qt=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function Zt(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}function Kt(t,e,n,i){return Gt(t,e,(t=>e=>qt(e)&&t(e,Zt(e)))(n),i)}const _t=(t,e)=>n=>e(t(n)),Jt=(...t)=>t.reduce(_t);function Qt(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const te=Qt("dragHorizontal"),ee=Qt("dragVertical");function ne(t){let e=!1;if("y"===t)e=ee();else if("x"===t)e=te();else{const t=te(),n=ee();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function ie(){const t=ne(!0);return!t||(t(),!1)}class se{constructor(t){this.isMounted=!1,this.node=t}update(){}}function oe(t,e){const n="pointer"+(e?"enter":"leave"),i="onHover"+(e?"Start":"End");return Kt(t.current,n,(n,s)=>{if("touch"===n.type||ie())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e),o[i]&&o[i](n,s)},{passive:!t.getProps()[i]})}const re=(t,e)=>!!e&&(t===e||re(t,e.parentElement)),ae=t=>t;function le(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,Zt(n))}const ce=new WeakMap,ue=new WeakMap,he=t=>{const e=ce.get(t.target);e&&e(t)},de=t=>{t.forEach(he)};function pe(t,e,n){const i=function({root:t,...e}){const n=t||document;ue.has(n)||ue.set(n,{});const i=ue.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(de,{root:t,...e})),i[s]}(e);return ce.set(t,n),i.observe(t),()=>{ce.delete(t),i.unobserve(t)}}const me={some:0,all:1};const fe={inView:{Feature:class extends se{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:me[i]};return pe(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends se{constructor(){super(...arguments),this.removeStartListeners=ae,this.removeEndListeners=ae,this.removeAccessibleListeners=ae,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),i=Kt(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:i}=this.node.getProps();re(this.node.current,t.target)?n&&n(t,e):i&&i(t,e)},{passive:!(n.onTap||n.onPointerUp)}),s=Kt(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Jt(i,s),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=Gt(this.node.current,"keydown",t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=Gt(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&le("up",this.node.getProps().onTap)}),le("down",(t,e)=>{this.startPress(t,e)})}),e=Gt(this.node.current,"blur",()=>{this.isPressing&&le("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=Jt(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&n(t,e)}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!ie()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&n(t,e)}mount(){const t=this.node.getProps(),e=Kt(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=Gt(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Jt(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends se{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Jt(Gt(this.node.current,"focus",()=>this.onFocus()),Gt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends se{mount(){this.unmount=Jt(oe(this.node,!0),oe(this.node,!1))}unmount(){}}}};function ge(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const ye=t=>/^0[^.\s]+$/.test(t),ve={delta:0,timestamp:0},xe="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Pe="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(xe()),1/60*1e3);let be=!0,Te=!1,we=!1;const Se=["read","update","preRender","render","postRender"],Ae=Se.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,c=l?e:n;return o&&r.add(t),-1===c.indexOf(t)&&(c.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}(()=>Te=!0),t),{}),Ve=Se.reduce((t,e)=>{const n=Ae[e];return t[e]=(t,e=!1,i=!1)=>(Te||Le(),n.schedule(t,e,i)),t},{}),Ee=Se.reduce((t,e)=>(t[e]=Ae[e].cancel,t),{}),Ce=Se.reduce((t,e)=>(t[e]=()=>Ae[e].process(ve),t),{}),Me=t=>Ae[t].process(ve),De=t=>{Te=!1,ve.delta=be?1/60*1e3:Math.max(Math.min(t-ve.timestamp,40),1),ve.timestamp=t,we=!0,Se.forEach(Me),we=!1,Te&&(be=!1,Pe(De))},Le=()=>{Te=!0,be=!0,we||Pe(De)};function ke(t,e){-1===t.indexOf(e)&&t.push(e)}function Re(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Be{constructor(){this.subscriptions=[]}add(t){return ke(this.subscriptions,t),()=>Re(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}}function je(t,e){return e?t*(1e3/e):0}class Fe{constructor(t,e={}){var n;this.version="10.0.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}=ve;this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,Ve.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=()=>Ve.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){this.events[t]||(this.events[t]=new Be);const n=this.events[t].add(e);return"change"===t?()=>{n(),Ve.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}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}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?je(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Oe(t,e){return new Fe(t,e)}const Ie=(t,e)=>n=>Boolean(rt(n)&&ot.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Ue=(t,e,n)=>i=>{if(!rt(i))return i;const[s,o,r,a]=i.match(it);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Ne={...Q,transform:t=>Math.round((t=>J(0,255,t))(t))},$e={test:Ie("rgb","red"),parse:Ue("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Ne.transform(t)+", "+Ne.transform(e)+", "+Ne.transform(n)+", "+nt(tt.transform(i))+")"};const We={test:Ie("#"),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:$e.transform},He={test:Ie("hsl","hue"),parse:Ue("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+ct.transform(nt(e))+", "+ct.transform(nt(n))+", "+nt(tt.transform(i))+")"},ze={test:t=>$e.test(t)||We.test(t)||He.test(t),parse:t=>$e.test(t)?$e.parse(t):He.test(t)?He.parse(t):We.parse(t),transform:t=>rt(t)?t:t.hasOwnProperty("red")?$e.transform(t):He.transform(t)};function Ye(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,i=0;const s=t.match(st);s&&(n=s.length,t=t.replace(st,"${c}"),e.push(...s.map(ze.parse)));const o=t.match(it);return o&&(i=o.length,t=t.replace(it,"${n}"),e.push(...o.map(Q.parse))),{values:e,numColors:n,numNumbers:i,tokenised:t}}function Xe(t){return Ye(t).values}function Ge(t){const{values:e,numColors:n,tokenised:i}=Ye(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?ze.transform(t[i]):nt(t[i]));return e}}const qe=t=>"number"==typeof t?0:t;const Ze={test:function(t){var e,n;return isNaN(t)&&rt(t)&&((null===(e=t.match(it))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(st))||void 0===n?void 0:n.length)||0)>0},parse:Xe,createTransformer:Ge,getAnimatableNone:function(t){const e=Xe(t);return Ge(t)(e.map(qe))}},Ke=new Set(["brightness","contrast","saturate","opacity"]);function _e(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(it)||[];if(!i)return t;const s=n.replace(i,"");let o=Ke.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Je=/([a-z-]*)\(.*?\)/g,Qe={...Ze,getAnimatableNone:t=>{const e=t.match(Je);return e?e.map(_e).join(" "):t}},tn={...ft,color:ze,backgroundColor:ze,outlineColor:ze,fill:ze,stroke:ze,borderColor:ze,borderTopColor:ze,borderRightColor:ze,borderBottomColor:ze,borderLeftColor:ze,filter:Qe,WebkitFilter:Qe},en=t=>tn[t];function nn(t,e){let n=en(t);return n!==Qe&&(n=Ze),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const sn=t=>e=>e.test(t),on=[Q,ut,ct,lt,dt,ht,{test:t=>"auto"===t,parse:t=>t}],rn=t=>on.find(sn(t)),an=[...on,ze,Ze],ln=t=>an.find(sn(t));function cn(t,e,n){const i=t.getProps();return Ut(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 un(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Oe(n))}function hn(t,e){if(!e)return;return(e[t]||e.default||e).from}function dn(t){return Boolean(Y(t)&&t.add)}const pn="data-"+Rt("framerAppearId");let mn=ae,fn=ae;const gn=t=>1e3*t,yn=!1,vn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,xn=t=>e=>1-t(1-e),Pn=t=>t*t,bn=xn(Pn),Tn=vn(Pn),wn=(t,e,n)=>-n*t+n*e+t;function Sn(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 An=(t,e,n)=>{const i=t*t;return Math.sqrt(Math.max(0,n*(e*e-i)+i))},Vn=[We,$e,He];function En(t){const e=(n=t,Vn.find(t=>t.test(n)));var n;let i=e.parse(t);return e===He&&(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=Sn(a,i,t+1/3),o=Sn(a,i,t),r=Sn(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 Cn=(t,e)=>{const n=En(t),i=En(e),s={...n};return t=>(s.red=An(n.red,i.red,t),s.green=An(n.green,i.green,t),s.blue=An(n.blue,i.blue,t),s.alpha=wn(n.alpha,i.alpha,t),$e.transform(s))};function Mn(t,e){return"number"==typeof t?n=>wn(t,e,n):ze.test(t)?Cn(t,e):kn(t,e)}const Dn=(t,e)=>{const n=[...t],i=n.length,s=t.map((t,n)=>Mn(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}},Ln=(t,e)=>{const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Mn(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}},kn=(t,e)=>{const n=Ze.createTransformer(e),i=Ye(t),s=Ye(e);return i.numColors===s.numColors&&i.numNumbers>=s.numNumbers?Jt(Dn(i.values,s.values),n):n=>""+(n>0?e:t)},Rn=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},Bn=(t,e)=>n=>wn(t,e,n);function jn(t,e,n){const i=[],s=n||("number"==typeof(o=t[0])?Bn:"string"==typeof o?ze.test(o)?Cn:kn:Array.isArray(o)?Dn:"object"==typeof o?Ln:Bn);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=Jt(t,o)}i.push(o)}return i}function Fn(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;fn(o===e.length),fn(!i||!Array.isArray(i)||i.length===o-1),t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=jn(e,i,s),a=r.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const i=Rn(t[n],t[n+1],e);return r[n](i)};return n?e=>l(J(t[0],t[o-1],e)):l}function On(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=Rn(0,e,i);t.push(wn(n,1,s))}}(e,t.length-1),e}const In=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Un(t,e,n,i){if(t===e&&n===i)return ae;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=In(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:In(s(t),e,i)}const Nn=t=>1-Math.sin(Math.acos(t)),$n=xn(Nn),Wn=vn($n),Hn=Un(.33,1.53,.69,.99),zn=xn(Hn),Yn=vn(zn),Xn={linear:ae,easeIn:Pn,easeInOut:Tn,easeOut:bn,circIn:Nn,circInOut:Wn,circOut:$n,backIn:zn,backInOut:Yn,backOut:Hn,anticipate:t=>(t*=2)<1?.5*zn(t):.5*(2-Math.pow(2,-10*(t-1)))},Gn=t=>{if(Array.isArray(t)){fn(4===t.length);const[e,n,i,s]=t;return Un(e,n,i,s)}return"string"==typeof t?Xn[t]:t};function qn({keyframes:t,ease:e=Tn,times:n,duration:i=300}){t=[...t];const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(Gn):Gn(e),o={done:!1,value:t[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:On(t),i);function a(){return Fn(r,t,{ease:Array.isArray(s)?s:(e=t,n=s,e.map(()=>n||Tn).splice(0,e.length-1))});var e,n}let l=a();return{next:t=>(o.value=l(t),o.done=t>=i,o),flipTarget:()=>{t.reverse(),l=a()}}}function Zn({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let s,o;mn(t<=1e4);let r=1-e;r=J(.05,1,r),t=J(.01,10,t/1e3),r<1?(s=e=>{const i=e*r,s=i*t;return.001-(i-n)/Kn(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),c=Kn(Math.pow(e,2),r);return(.001-s(e)>0?-1:1)*((o-a)*l)/c}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function Kn(t,e){return t*Math.sqrt(1-e*e)}const _n=["duration","bounce"],Jn=["stiffness","damping","mass"];function Qn(t,e){return e.some(e=>void 0!==t[e])}function ti({keyframes:t,restDelta:e,restSpeed:n,...i}){let s=t[0],o=t[t.length-1];const r={done:!1,value:s},{stiffness:a,damping:l,mass:c,velocity:u,duration:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Qn(t,Jn)&&Qn(t,_n)){const n=Zn(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(i);let p=ei,m=u?-u/1e3:0;const f=l/(2*Math.sqrt(a*c));function g(){const t=o-s,i=Math.sqrt(a/c)/1e3,r=Math.abs(t)<5;if(n||(n=r?.01:2),e||(e=r?.005:.5),f<1){const e=Kn(i,f);p=n=>{const s=Math.exp(-f*i*n);return o-s*((m+f*i*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===f)p=e=>o-Math.exp(-i*e)*(t+(m+i*t)*e);else{const e=i*Math.sqrt(f*f-1);p=n=>{const s=Math.exp(-f*i*n),r=Math.min(e*n,300);return o-s*((m+f*i*t)*Math.sinh(r)+e*t*Math.cosh(r))/e}}}return g(),{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=je(i-p(e),t-e)}else s=0;const a=Math.abs(s)<=n,l=Math.abs(o-i)<=e;r.done=a&&l}return r.value=r.done?o:i,r},flipTarget:()=>{m=-m,[s,o]=[o,s],g()}}}ti.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const ei=t=>0;const ni={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 c=r+l,u=void 0===o?c:o(c);return u!==c&&(l=u-r),{next:t=>{const e=-l*Math.exp(-t/i);return a.done=!(e>s||e<-s),a.value=a.done?u:u+e,a},flipTarget:()=>{}}},keyframes:qn,tween:qn,spring:ti};function ii(t,e,n=0){return t-e-n}const si=t=>{const e=({delta:e})=>t(e);return{start:()=>Ve.update(e,!0),stop:()=>Ee.update(e)}};function oi({duration:t,driver:e=si,elapsed:n=0,repeat:i=0,repeatType:s="loop",repeatDelay:o=0,keyframes:r,autoplay:a=!0,onPlay:l,onStop:c,onComplete:u,onRepeat:h,onUpdate:d,type:p="keyframes",...m}){const f=n;let g,y,v=0,x=t,P=!1,b=!0;const T=ni[r.length>2?"keyframes":p]||qn,w=r[0],S=r[r.length-1];let A={done:!1,value:w};const{needsInterpolation:V}=T;V&&V(w,S)&&(y=Fn([0,100],[w,S],{clamp:!1}),r=[0,100]);const E=T({...m,duration:t,keyframes:r});function C(){v++,"reverse"===s?(b=v%2==0,n=function(t,e=0,n=0,i=!0){return i?ii(e+-t,e,n):e-(t-e)+n}(n,x,o,b)):(n=ii(n,x,o),"mirror"===s&&E.flipTarget()),P=!1,h&&h()}function M(t){b||(t=-t),n+=t,P||(A=E.next(Math.max(0,n)),y&&(A.value=y(A.value)),P=b?A.done:n<=0),d&&d(A.value),P&&(0===v&&(x=void 0!==x?x:n),v<i?function(t,e,n,i){return i?t>=e+n:t<=-n}(n,x,o,b)&&C():(g&&g.stop(),u&&u()))}return a&&(l&&l(),g=e(M),g.start()),{stop:()=>{c&&c(),g&&g.stop()},set currentTime(t){n=f,M(t)},sample:(e,i=!1)=>{if(n=f,i)return M(e),A;const s=t&&"number"==typeof t?Math.max(.5*t,50):50;let o=0;for(M(0);o<=e;){const t=e-o;M(Math.min(t,s)),o+=s}return A}}}const ri=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,ai={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ri([0,.65,.55,1]),circOut:ri([.55,0,1,.45]),backIn:ri([.31,.01,.66,-.59]),backOut:ri([.33,1.53,.69,.99])};function li(t){if(t)return Array.isArray(t)?ri(t):ai[t]}const ci={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},ui={},hi={};for(const t in ci)hi[t]=()=>(void 0===ui[t]&&(ui[t]=ci[t]()),ui[t]);const di=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),pi=(t,e)=>{return"spring"===e.type||"backgroundColor"===t||!(!(n=e.ease)||Array.isArray(n)||"string"==typeof n&&ai[n]);var n};function mi(t,e,{onUpdate:n,onComplete:i,...s}){if(!(hi.waapi()&&di.has(e)&&!s.repeatDelay&&"mirror"!==s.repeatType&&0!==s.damping))return!1;let{keyframes:o,duration:r=300,elapsed:a=0,ease:l}=s;if(pi(e,s)){const t=oi({...s,repeat:0,elapsed:0});let e={done:!1,value:o[0]};const n=[];let i=0;for(;!e.done&&i<2e4;)e=t.sample(i,!0),n.push(e.value),i+=10;o=n,r=i-10,l="linear"}const c=function(t,e,n,{delay:i=0,duration:s,repeat:o=0,repeatType:r="loop",ease:a,times:l}={}){const c={[e]:n};return l&&(c.offset=l),t.animate(c,{delay:i,duration:s,easing:li(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(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(o,s)),Ve.update(()=>c.cancel()),i&&i()},{get currentTime(){return c.currentTime||0},set currentTime(t){c.currentTime=t},stop:()=>{const{currentTime:e}=c;if(e){const n=oi({...s,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}Ve.update(()=>c.cancel())}}}function fi(t,e){const n=performance.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(Ee.read(i),t(o-e))};return Ve.read(i,!0),()=>Ee.read(i)}function gi({keyframes:t,elapsed:e,onUpdate:n,onComplete:i}){const s=()=>{n&&n(t[t.length-1]),i&&i()};return e?{stop:fi(s,-e)}:s()}const yi={type:"spring",stiffness:500,damping:25,restSpeed:10},vi={type:"keyframes",duration:.8},xi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Pi=(t,{keyframes:e})=>e.length>2?vi:H.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:yi:xi,bi=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Ze.test(e)||e.startsWith("url(")));function Ti(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function wi(t){return"number"==typeof t?0:nn("",t)}function Si(t,e){return t[e]||t.default||t}const Ai=(t,e,n,i={})=>s=>{const o=Si(i,t)||{},r=o.delay||i.delay||0;let{elapsed:a=0}=i;a-=gn(r);const l=function(t,e,n,i){const s=bi(e,n);let o=void 0!==i.from?i.from:t.get();return"none"===o&&s&&"string"==typeof n?o=nn(e,n):Ti(o)&&"string"==typeof n?o=wi(n):!Array.isArray(n)&&Ti(n)&&"string"==typeof o&&(n=wi(o)),Array.isArray(n)?(null===n[0]&&(n[0]=o),n):[o,n]}(e,t,n,o),c=l[0],u=l[l.length-1],h=bi(t,c),d=bi(t,u);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||yn||!1===o.type)return gi(p);if("inertia"===o.type)return 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:c,driver:u,onUpdate:h,onComplete:d,onStop:p}){const m=t[0];let f;function g(t){return void 0!==n&&t<n||void 0!==i&&t>i}function y(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function v(t){f&&f.stop(),f=oi({keyframes:[0,1],velocity:0,...t,driver:u,onUpdate:e=>{h&&h(e),t.onUpdate&&t.onUpdate(e)},onComplete:d,onStop:p})}function x(t){v({type:"spring",stiffness:r,damping:a,restDelta:l,...t})}if(g(m))x({velocity:e,keyframes:[m,y(m)]});else{let t=s*e+m;void 0!==c&&(t=c(t));const i=y(t),r=i===n?-1:1;let a,u;const h=t=>{a=u,u=t,e=je(t-a,ve.delta),(1===r&&t>i||-1===r&&t<i)&&x({keyframes:[t,i],velocity:e})};v({type:"decay",keyframes:[m,0],velocity:e,timeConstant:o,power:s,restDelta:l,modifyTarget:c,onUpdate:g(t)?h:void 0})}return{stop:()=>f&&f.stop()}}(p);if(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}(o)||(p={...p,...Pi(t,p)}),p.duration&&(p.duration=gn(p.duration)),p.repeatDelay&&(p.repeatDelay=gn(p.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=mi(e,t,p);if(n)return n}return oi(p)};function Vi(t,e,n={}){const i=cn(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Ei(t,i,n):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;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(Ci).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(Vi(t,e,{...o,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(e)}return Promise.all([o(),r(n.delay)])}function Ei(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");i&&(o=i);const c=[],u=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e),s=a[e];if(!i||void 0===s||u&&Mi(u,e))continue;const r={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!i.hasAnimated){const n=t.getProps()[pn];n&&(r.elapsed=window.HandoffAppearAnimations(n,e,i,Ve))}let h=i.start(Ai(e,i,s,t.shouldReduceMotion&&H.has(e)?{type:!1}:r));dn(l)&&(l.add(e),h=h.then(()=>l.remove(e))),c.push(h)}return Promise.all(c).then(()=>{r&&function(t,e){const n=cn(t,e);let{transitionEnd:i={},transition:s={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...i};for(const e in o){un(t,e,(r=o[e],Nt(r)?r[r.length-1]||0:r))}var r}(t,r)})}function Ci(t,e){return t.sortNodePosition(e)}function Mi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const Di=[...T].reverse(),Li=T.length;function ki(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=>Vi(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=Vi(t,e,n);else{const s="function"==typeof e?cn(t,e,n.custom):e;i=Ei(t,s,n)}return i.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function Ri(t){let e=ki(t);const n={animate:ji(!0),whileInView:ji(),whileHover:ji(),whileTap:ji(),whileDrag:ji(),whileFocus:ji(),exit:ji()};let i=!0;const s=(e,n)=>{const i=cn(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)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;e<Li;e++){const p=Di[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=P(f),y=p===r?m.isActive:null;!1===y&&(d=e);let v=f===l[p]&&f!==a[p]&&g;if(v&&i&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...h},!m.isActive&&null===y||!f&&!m.prevProp||b(f)||"boolean"==typeof f)continue;const x=Bi(m.prevProp,f);let T=x||p===r&&m.isActive&&!v&&g||e>d&&g;const w=Array.isArray(f)?f:[f];let S=w.reduce(s,{});!1===y&&(S={});const{prevResolvedValues:A={}}=m,V={...A,...S},E=t=>{T=!0,u.delete(t),m.needsAnimating[t]=!0};for(const t in V){const e=S[t],n=A[t];h.hasOwnProperty(t)||(e!==n?Nt(e)&&Nt(n)?!ge(e,n)||x?E(t):m.protectedKeys[t]=!0:void 0!==e?E(t):u.add(t):void 0!==e&&u.has(t)?E(t):m.protectedKeys[t]=!0)}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(h={...h,...S}),i&&t.blockInitialAnimation&&(T=!1),T&&!v&&c.push(...w.map(t=>({animation:t,options:{type:p,...o}})))}if(u.size){const e={};u.forEach(n=>{const i=t.getBaseTarget(n);void 0!==i&&(e[n]=i)}),c.push({animation:e})}let p=Boolean(c.length);return i&&!1===a.initial&&!t.manuallyAnimateOnMount&&(p=!1),i=!1,p?e(c):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 Bi(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!ge(e,t)}function ji(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let Fi=0;const Oi={animation:{Feature:class extends se{constructor(t){super(t),t.animationState||(t.animationState=Ri(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),b(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends se{constructor(){super(...arguments),this.id=Fi++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const s=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&s.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},Ii=(t,e)=>Math.abs(t-e);class Ui{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=Wi(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Ii(t.x,e.x),i=Ii(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}=ve;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=Ni(e,this.transformPagePoint),Ve.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:i}=this.handlers,s=Wi("pointercancel"===t.type?this.lastMoveEventInfo:Ni(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,s),i&&i(t,s)},!qt(t))return;this.handlers=e,this.transformPagePoint=n;const i=Ni(Zt(t),this.transformPagePoint),{point:s}=i,{timestamp:o}=ve;this.history=[{...s,timestamp:o}];const{onSessionStart:r}=e;r&&r(t,Wi(i,this.history)),this.removeListeners=Jt(Kt(window,"pointermove",this.handlePointerMove),Kt(window,"pointerup",this.handlePointerUp),Kt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ee.update(this.updatePoint)}}function Ni(t,e){return e?{point:e(t.point)}:t}function $i(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Wi({point:t},e){return{point:t,delta:$i(t,zi(e)),offset:$i(t,Hi(e)),velocity:Yi(e,.1)}}function Hi(t){return t[0]}function zi(t){return t[t.length-1]}function Yi(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=zi(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>gn(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 Xi(t){return t.max-t.min}function Gi(t,e=0,n=.01){return Math.abs(t-e)<=n}function qi(t,e,n,i=.5){t.origin=i,t.originPoint=wn(e.min,e.max,t.origin),t.scale=Xi(n)/Xi(e),(Gi(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=wn(n.min,n.max,t.origin)-t.originPoint,(Gi(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Zi(t,e,n,i){qi(t.x,e.x,n.x,i?i.originX:void 0),qi(t.y,e.y,n.y,i?i.originY:void 0)}function Ki(t,e,n){t.min=n.min+e.min,t.max=t.min+Xi(e)}function _i(t,e,n){t.min=e.min-n.min,t.max=t.min+Xi(e)}function Ji(t,e,n){_i(t.x,e.x,n.x),_i(t.y,e.y,n.y)}function Qi(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 ts(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 es=.35;function ns(t,e,n){return{min:is(t,e),max:is(t,n)}}function is(t,e){return"number"==typeof t?t:t[e]||0}function ss(t){return[t("x"),t("y")]}function os({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function rs(t){return void 0===t||1===t}function as({scale:t,scaleX:e,scaleY:n}){return!rs(t)||!rs(e)||!rs(n)}function ls(t){return as(t)||cs(t)||t.z||t.rotate||t.rotateX||t.rotateY}function cs(t){return us(t.x)||us(t.y)}function us(t){return t&&"0%"!==t}function hs(t,e,n){return n+e*(t-n)}function ds(t,e,n,i,s){return void 0!==s&&(t=hs(t,s,i)),hs(t,n,i)+e}function ps(t,e=0,n=1,i,s){t.min=ds(t.min,e,n,i,s),t.max=ds(t.max,e,n,i,s)}function ms(t,{x:e,y:n}){ps(t.x,e.translate,e.scale,e.originPoint),ps(t.y,n.translate,n.scale,n.originPoint)}function fs(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function gs(t,e){t.min=t.min+e,t.max=t.max+e}function ys(t,e,[n,i,s]){const o=void 0!==e[s]?e[s]:.5,r=wn(t.min,t.max,o);ps(t,e[n],e[i],r,e.scale)}const vs=["x","scaleX","originX"],xs=["y","scaleY","originY"];function Ps(t,e){ys(t.x,e,vs),ys(t.y,e,xs)}function bs(t,e){return os(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 Ts=new WeakMap;class ws{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}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;this.panSession=new Ui(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(Zt(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=ne(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ss(t=>{let e=this.getAxisMotionValue(t).get()||0;if(ct.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Xi(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&s(t,e);const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!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&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),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();s&&s(t,e)}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Ss(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?wn(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?wn(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&&x(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Qi(t.x,n,s),y:Qi(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=es){return!1===t?t=0:!0===t&&(t=es),{x:ns(t,"left","right"),y:ns(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&ss(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||!x(t))return!1;const n=t.current;fn(null!==n);const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=bs(t,n),{scroll:s}=e;return s&&(gs(i.x,s.offset.x),gs(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ts(t.x,e.x),y:ts(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=os(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=ss(r=>{if(!Ss(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(Ai(t,n,0,e))}stopAnimation(){ss(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){ss(e=>{const{drag:n}=this.getProps();if(!Ss(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]-wn(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!x(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};ss(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const i=Xi(t),s=Xi(e);return s>i?n=Rn(e.min,e.max-i,t.min):i>s&&(n=Rn(t.min,t.max-s,e.min)),J(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),ss(e=>{if(!Ss(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(wn(s,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;Ts.set(this.visualElement,this);const t=Kt(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();x(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const s=Gt(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(ss(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=es,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Ss(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const As=["TopLeft","TopRight","BottomLeft","BottomRight"],Vs=As.length,Es=t=>"string"==typeof t?parseFloat(t):t,Cs=t=>"number"==typeof t||ut.test(t);function Ms(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Ds=ks(0,.5,$n),Ls=ks(.5,.95,ae);function ks(t,e,n){return i=>i<t?0:i>e?1:n(Rn(t,e,i))}function Rs(t,e){t.min=e.min,t.max=e.max}function Bs(t,e){Rs(t.x,e.x),Rs(t.y,e.y)}function js(t,e,n,i,s){return t=hs(t-=e,1/n,i),void 0!==s&&(t=hs(t,1/s,i)),t}function Fs(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){if(ct.test(e)){e=parseFloat(e);e=wn(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=wn(o.min,o.max,i);t===o&&(a-=e),t.min=js(t.min,e,n,a,s),t.max=js(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const Os=["x","scaleX","originX"],Is=["y","scaleY","originY"];function Us(t,e,n,i){Fs(t.x,e,Os,n?n.x:void 0,i?i.x:void 0),Fs(t.y,e,Is,n?n.y:void 0,i?i.y:void 0)}function Ns(t){return 0===t.translate&&1===t.scale}function $s(t){return Ns(t.x)&&Ns(t.y)}function Ws(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 Hs(t){return Xi(t.x)/Xi(t.y)}class zs{constructor(){this.members=[]}add(t){ke(this.members,t),t.scheduleRender()}remove(t){if(Re(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){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ys(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 Xs=(t,e)=>t.depth-e.depth;class Gs{constructor(){this.children=[],this.isDirty=!1}add(t){ke(this.children,t),this.isDirty=!0}remove(t){Re(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Xs),this.isDirty=!1,this.children.forEach(t)}}const qs=["","X","Y","Z"];let Zs=0;const Ks={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function _s({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.id=Zs++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var t;Ks.totalNodes=Ks.resolvedTargetDeltas=Ks.recalculatedProjection=0,this.nodes.forEach(to),this.nodes.forEach(ro),this.nodes.forEach(ao),this.nodes.forEach(eo),t=Ks,window.MotionDebug&&window.MotionDebug.record(t)},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 Gs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Be),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:i,layout:s,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(s||i)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=fi(i,250),L.hasAnimatedSinceResize&&(L.hasAnimatedSinceResize=!1,this.nodes.forEach(oo))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||mo,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Ws(this.targetLayout,i)||n,c=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,c);const e={...Si(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||oo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ee.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(lo),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());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"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(io);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(fo),this.potentialNodes.clear()),this.nodes.forEach(so),this.nodes.forEach(Js),this.nodes.forEach(Qs),this.clearAllSnapshots(),Ce.update(),Ce.preRender(),Ce.render())}clearAllSnapshots(){this.nodes.forEach(no),this.sharedNodes.forEach(co)}scheduleUpdateProjection(){Ve.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Ve.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}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(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!$s(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&(e||ls(this.latestValues)||o)&&(s(this.instance,i),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)),go((i=n).x),go(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&&(gs(e.x,n.offset.x),gs(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Bs(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){Bs(e,t);const{scroll:n}=this.root;n&&(gs(e.x,-n.offset.x),gs(e.y,-n.offset.y))}gs(e.x,s.offset.x),gs(e.y,s.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Bs(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&&Ps(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),ls(i.latestValues)&&Ps(n,i.latestValues)}return ls(this.latestValues)&&Ps(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Bs(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!ls(n.latestValues))continue;as(n.latestValues)&&n.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};Bs(i,n.measurePageBox()),Us(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return ls(this.latestValues)&&Us(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}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();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);if(!((Boolean(this.resumingFrom)||this!==e)&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.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}},Ji(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Bs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,o,r;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&&this.relativeParent&&this.relativeParent.target?(s=this.target,o=this.relativeTarget,r=this.relativeParent.target,Ki(s.x,o.x,r.x),Ki(s.y,o.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Bs(this.target,this.layout.layoutBox),ms(this.target,this.targetDelta)):Bs(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}},Ji(this.relativeTargetOrigin,this.target,t.target),Bs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ks.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!as(this.parent.latestValues)&&!cs(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let i=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(i=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;Bs(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const s=o.instance;s&&s.style&&"contents"===s.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ps(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,ms(t,r)),i&&ls(o.latestValues)&&Ps(t,o.latestValues))}e.x=fs(e.x),e.y=fs(e.y)}(this.layoutCorrected,this.treeScale,this.path,n);const{target:r}=e;if(!r)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 a=this.treeScale.x,l=this.treeScale.y,c=this.projectionTransform;Zi(this.projectionDelta,this.layoutCorrected,r,this.latestValues),this.projectionTransform=Ys(this.projectionDelta,this.treeScale),this.projectionTransform===c&&this.treeScale.x===a&&this.treeScale.y===l||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",r)),Ks.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(po));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m;uo(o.x,t.x,n),uo(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ji(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,d=this.relativeTargetOrigin,p=r,m=n,ho(l.x,d.x,p.x,m),ho(l.y,d.y,p.y,m),h&&Ws(this.relativeTarget,h)&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),Bs(h,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=wn(0,void 0!==n.opacity?n.opacity:1,Ds(i)),t.opacityExit=wn(void 0!==e.opacity?e.opacity:1,0,Ls(i))):o&&(t.opacity=wn(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let s=0;s<Vs;s++){const o=`border${As[s]}Radius`;let r=Ms(e,o),a=Ms(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Cs(r)===Cs(a)?(t[o]=Math.max(wn(Es(r),Es(a),i),0),(ct.test(a)||ct.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=wn(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ee.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ve.update(()=>{L.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=Y(t)?t:Oe(t);return i.start(Ai("",i,e,n)),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&yo(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Xi(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Xi(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Bs(e,n),Ps(e,s),Zi(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new zs);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){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<qs.length;e++){const s="rotate"+qs[e];n[s]&&(i[s]=n[s],t.setStaticValue(s,0))}t.render();for(const e in i)t.setStaticValue(e,i[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const i={};if(!this.instance||this.isSVG)return i;if(!this.isVisible)return{visibility:"hidden"};i.visibility="";const s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=$t(t.pointerEvents)||"",i.transform=s?s(this.latestValues,""):"none",i;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=$t(t.pointerEvents)||""),this.hasProjected&&!ls(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=Ys(this.projectionDeltaWithTransform,this.treeScale,r),s&&(i.transform=s(r,i.transform));const{x:a,y:l}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?i.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:i.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in $){if(void 0===r[t])continue;const{correct:e,applyTo:n}=$[t],s="none"===i.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=s}else i[t]=s}return this.options.layoutId&&(i.pointerEvents=o===this?$t(t.pointerEvents)||"":"none"),i}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(io),this.root.sharedNodes.clear()}}}function Js(t){t.updateLayout()}function Qs(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;"size"===s?ss(t=>{const i=o?n.measuredBox[t]:n.layoutBox[t],s=Xi(i);i.min=e[t].min,i.max=i.min+s}):yo(s,n.layoutBox,e)&&ss(t=>{const i=o?n.measuredBox[t]:n.layoutBox[t],s=Xi(e[t]);i.max=i.min+s});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Zi(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Zi(a,t.applyTransform(i,!0),n.measuredBox):Zi(a,e,n.layoutBox);const l=!$s(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Ji(r,n.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ji(a,e,o.layoutBox),Ws(r,a)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function to(t){Ks.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function eo(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function no(t){t.clearSnapshot()}function io(t){t.clearMeasurements()}function so(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function oo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function ro(t){t.resolveTargetDelta()}function ao(t){t.calcProjection()}function lo(t){t.resetRotation()}function co(t){t.removeLeadSnapshot()}function uo(t,e,n){t.translate=wn(e.translate,0,n),t.scale=wn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ho(t,e,n,i){t.min=wn(e.min,n.min,i),t.max=wn(e.max,n.max,i)}function po(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const mo={duration:.45,ease:[.4,0,.1,1]};function fo(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function go(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function yo(t,e,n){return"position"===t||"preserve-aspect"===t&&!Gi(Hs(e),Hs(n),.2)}const vo=_s({attachResizeListener:(t,e)=>Gt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xo={current:void 0},Po=_s({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!xo.current){const t=new vo(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),xo.current=t}return xo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function bo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const To={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ut.test(t))return t;t=parseFloat(t)}return`${bo(t,e.target.x)}% ${bo(t,e.target.y)}%`}},wo=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function So(t,e,n=1){const[i,s]=function(t){const e=wo.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():K(s)?So(s,e,n+1):s}const Ao={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=t.includes("var("),o=[];s&&(t=t.replace(wo,t=>(o.push(t),"_$css")));const r=Ze.parse(t);if(r.length>5)return i;const a=Ze.createTransformer(t),l="number"!=typeof r[0]?1:0,c=n.x.scale*e.x,u=n.y.scale*e.y;r[0+l]/=c,r[1+l]/=u;const h=wn(c,u,.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}},Vo=new Set(["width","height","top","left","right","bottom","x","y"]),Eo=t=>Vo.has(t),Co=t=>t===Q||t===ut,Mo=(t,e)=>parseFloat(t.split(", ")[e]),Do=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/);if(s)return Mo(s[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?Mo(e[1],t):0}},Lo=new Set(["x","y","z"]),ko=W.filter(t=>!Lo.has(t));const Ro={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:Do(4,13),y:Do(5,14)},Bo=(t,e,n={},i={})=>{e={...e},i={...i};const s=Object.keys(e).filter(Eo);let o=[],r=!1;const a=[];if(s.forEach(s=>{const l=t.getValue(s);if(!t.hasValue(s))return;let c=n[s],u=rn(c);const h=e[s];let d;if(Nt(h)){const t=h.length,e=null===h[0]?1:0;c=h[e],u=rn(c);for(let n=e;n<t;n++)d?fn(rn(h[n])===d):d=rn(h[n])}else d=rn(h);if(u!==d)if(Co(u)&&Co(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[s]=parseFloat(h):Array.isArray(h)&&d===ut&&(e[s]=h.map(parseFloat))}else(null==u?void 0:u.transform)&&(null==d?void 0:d.transform)&&(0===c||0===h)?0===c?l.set(d.transform(c)):e[s]=u.transform(h):(r||(o=function(t){const e=[];return ko.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),r=!0),a.push(s),i[s]=void 0!==i[s]?i[s]:e[s],l.jump(h))}),a.length){const n=a.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]=Ro[t](i,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);i&&i.jump(a[n]),t[n]=Ro[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),g&&null!==n&&window.scrollTo({top:n}),{target:s,transitionEnd:i}}return{target:e,transitionEnd:i}};function jo(t,e,n,i){return(t=>Object.keys(t).some(Eo))(e)?Bo(t,e,n,i):{target:e,transitionEnd:i}}const Fo=(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(!K(e))return;const n=So(e,i);n&&t.set(n)});for(const t in e){const s=e[t];if(!K(s))continue;const o=So(s,i);o&&(e[t]=o,n&&void 0===n[t]&&(n[t]=s))}return{target:e,transitionEnd:n}}(t,e,i);return jo(t,e=s.target,n,i=s.transitionEnd)},Oo={current:null},Io={current:!1};const Uo=Object.keys(M),No=Uo.length,$o=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Wo=w.length;class Ho extends class{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},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=()=>Ve.render(this.render,!1,!0);const{latestValues:r,renderState:a}=s;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.isControllingVariants=S(e),this.isVariantNode=A(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...c}=this.scrapeMotionValuesFromProps(e,{});for(const t in c){const e=c[t];void 0!==r[t]&&Y(e)&&(e.set(r[t],!1),dn(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Io.current||function(){if(Io.current=!0,g)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Oo.current=t.matches;t.addListener(e),e()}else Oo.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Oo.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ee.update(this.notifyUpdate),Ee.render(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=H.has(t),i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Ve.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({children:t,...e},n,i,s,o){let r,a;for(let t=0;t<No;t++){const n=Uo[t],{isEnabled:i,Feature:s,ProjectionNode:o,MeasureLayout:l}=M[n];o&&(r=o),i(e)&&(!this.features[n]&&s&&(this.features[n]=new s(this)),l&&(a=l))}if(!this.projection&&r){this.projection=new r(s,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(i)||a&&x(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:l,layoutRoot:c})}return a}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update(this.props,this.prevProps):(e.mount(),e.isMounted=!0)}}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)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<$o.length;e++){const n=$o[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(Y(o))t.addValue(s,o),dn(i)&&i.add(s);else if(Y(r))t.addValue(s,Oe(o,{owner:t})),dn(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,Oe(void 0!==e?e:o,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<Wo;t++){const n=w[t],i=this.props[n];(P(i)||!1===i)&&(e[n]=i)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);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=Oe(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=Ut(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||Y(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 Be),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}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){const i={};for(const s in t){const t=hn(s,e);if(void 0!==t)i[s]=t;else{const t=n.getValue(s);t&&(i[s]=t.get())}}return i}(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 c=null;Array.isArray(l)&&(c=l[0]),null===c&&(c=null!==(s=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==s?s:e[r]),null!=c&&("string"==typeof c&&(/^\-?\d*\.?\d+$/.test(c)||ye(c))?c=parseFloat(c):!ln(c)&&Ze.test(l)&&(c=nn(r,l)),t.addValue(r,Oe(c,{owner:t})),void 0===n[r]&&(n[r]=c),null!==c&&t.setBaseTarget(r,c))}}(this,n,o);const t=Fo(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class zo extends Ho{readValueFromInstance(t,e){if(H.has(e)){const t=en(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),s=(Z(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return bs(t,e)}build(t,e,n,i){gt(t,e,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,e){return Ot(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Y(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,i){Bt(t,e,n,i)}}class Yo extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;var o;o=Go,Object.assign($,o),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()})),L.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()||Ve.postRender(()=>{const t=o.getStack();t&&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(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Xo(t){const[n,i]=function(){const t=o(f);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:i}=t,r=d();return s(()=>i(r),[]),!e&&n?[!1,()=>n&&n(r)]:[!0]}(),r=o(R);return e.createElement(Yo,{...t,layoutGroup:r,switchLayoutGroup:o(B),isPresent:n,safeToRemove:i})}const Go={borderRadius:{...To,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:To,borderTopRightRadius:To,borderBottomLeftRadius:To,borderBottomRightRadius:To,boxShadow:Ao},qo={pan:{Feature:class extends se{constructor(){super(...arguments),this.removePointerDownListener=ae}onPointerDown(t){this.session=new Ui(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:t,onStart:e,onMove:n,onEnd:(t,e)=>{delete this.session,i&&i(t,e)}}}mount(){this.removePointerDownListener=Kt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends se{constructor(t){super(t),this.removeGroupControls=ae,this.removeListeners=ae,this.controls=new ws(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ae}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Po,MeasureLayout:Xo}};class Zo extends Ho{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(H.has(e)){const t=en(e);return t&&t.default||0}return e=jt.has(e)?e:Rt(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return It(t,e)}build(t,e,n,i){Ct(t,e,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,n,i){Ft(t,e,0,i)}mount(t){this.isSVGTag=Dt(t.tagName),super.mount(t)}}const Ko=(t,e)=>N(t)?new Zo(e,{enableHardwareAcceleration:!1}):new zo(e,{enableHardwareAcceleration:!0}),_o={...Oi,...fe,...qo,...{layout:{ProjectionNode:Po,MeasureLayout:Xo}}},Jo=I((t,e)=>Xt(t,e,_o,Ko));function Qo(t){return F(Xt(t,{forwardMotionProps:!1},_o,Ko))}export{Qo as createDomMotionComponent,Jo as motion};