framer-motion 7.6.5 → 7.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +59 -64
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +5 -5
- package/dist/es/projection/node/create-projection-node.mjs +52 -46
- package/dist/es/render/VisualElement.mjs +0 -11
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/value/index.mjs +1 -1
- package/dist/framer-motion.dev.js +59 -64
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +8 -11
- package/dist/projection.dev.js +54 -59
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-webpack-dom-animation.js +1 -1
- package/dist/size-webpack-dom-max.js +1 -1
- package/dist/three-entry.d.ts +8 -11
- package/package.json +3 -3
package/dist/framer-motion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(e),r=o(e);const s=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),a=e.createContext({});function l(){return e.useContext(a).visualElement}const u=e.createContext(null),c="undefined"!=typeof document,h=c?e.useLayoutEffect:e.useEffect,d=e.createContext({strict:!1});function p(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function m(t){return"string"==typeof t||Array.isArray(t)}function f(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function v(t){return f(t.animate)||g.some(e=>m(t[e]))}function y(t){return Boolean(v(t)||t.variants)}function x(t){const{initial:n,animate:o}=function(t,e){if(v(t)){const{initial:e,animate:n}=t;return{initial:!1===e||m(e)?e:void 0,animate:m(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:o}),[b(n),b(o)])}function b(t){return Array.isArray(t)?t.join(" "):t}const E=t=>({isEnabled:e=>t.some(t=>!!e[t])}),w={measureLayout:E(["layout","layoutId","drag"]),animation:E(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:E(["exit"]),drag:E(["drag","dragControls"]),focus:E(["whileFocus"]),hover:E(["whileHover","onHoverStart","onHoverEnd"]),tap:E(["whileTap","onTap","onTapStart","onTapCancel"]),pan:E(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:E(["whileInView","onViewportEnter","onViewportLeave"])};function S(t){for(const e in t)"projectionNodeConstructor"===e?w.projectionNodeConstructor=t[e]:w[e].Component=t[e]}function A(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const P={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let T=1;const V=e.createContext({});class C extends i.default.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const M=e.createContext({}),R=Symbol.for("motionComponentSymbol");function L({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:i,useVisualState:m,Component:f}){t&&S(t);const g=e.forwardRef((function(g,v){const y={...e.useContext(s),...g,layoutId:O(g)},{isStatic:b}=y;let E=null;const S=x(g),V=b?void 0:A(()=>{if(P.hasEverUpdated)return T++}),R=m(g,b);if(!b&&c){S.visualElement=function(t,n,o,i){const r=l(),a=e.useContext(d),c=e.useContext(u),p=e.useContext(s).reducedMotion,m=e.useRef();i=i||a.renderer,!m.current&&i&&(m.current=i(t,{visualState:n,parent:r,props:o,presenceId:c?c.id:void 0,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:p}));const f=m.current;return h(()=>{f&&f.render()}),e.useEffect(()=>{f&&f.animationState&&f.animationState.animateChanges()}),h(()=>()=>f&&f.notify("Unmount"),[]),f}(f,R,y,n);const i=e.useContext(d).strict,r=e.useContext(M);S.visualElement&&(E=S.visualElement.loadFeatures(y,i,t,V,o||w.projectionNodeConstructor,r))}return r.createElement(C,{visualElement:S.visualElement,props:y},E,r.createElement(a.Provider,{value:S},i(f,g,V,function(t,n,o){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):p(o)&&(o.current=e))},[n])}(R,S.visualElement,v),R,b,S.visualElement)))}));return g[R]=f,g}function O({layoutId:t}){const n=e.useContext(V).id;return n&&void 0!==t?n+"-"+t:t}function k(t){function e(e,n={}){return L(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const D=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function j(t){return"string"==typeof t&&!t.includes("-")&&!!(D.indexOf(t)>-1||/[A-Z]/.test(t))}const F={};function I(t){Object.assign(F,t)}const B=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=new Set(B);function N(t,{layout:e,layoutId:n}){return U.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!F[t]||"opacity"===t)}const z=t=>!!(null==t?void 0:t.getVelocity),W={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H=(t,e)=>B.indexOf(t)-B.indexOf(e);function $({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},i,r){let s="";e.sort(H);for(const n of e)s+=`${W[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(t,i?"":s):o&&i&&(s="none"),s}function Y(t){return t.startsWith("--")}const X=(t,e)=>e&&"number"==typeof t?e.transform(t):t,G=(t,e)=>n=>Math.max(Math.min(n,e),t),q=t=>t%1?Number(t.toFixed(5)):t,Z=/(-)?([\d]*\.?[\d])+/g,K=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,_=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function J(t){return"string"==typeof t}const Q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},tt=Object.assign(Object.assign({},Q),{transform:G(0,1)}),et=Object.assign(Object.assign({},Q),{default:1}),nt=t=>({test:e=>J(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=nt("deg"),it=nt("%"),rt=nt("px"),st=nt("vh"),at=nt("vw"),lt=Object.assign(Object.assign({},it),{parse:t=>it.parse(t)/100,transform:t=>it.transform(100*t)}),ut=(t,e)=>n=>Boolean(J(n)&&_.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ct=(t,e,n)=>o=>{if(!J(o))return o;const[i,r,s,a]=o.match(Z);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ht={test:ut("hsl","hue"),parse:ct("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+it.transform(q(e))+", "+it.transform(q(n))+", "+q(tt.transform(o))+")"},dt=G(0,255),pt=Object.assign(Object.assign({},Q),{transform:t=>Math.round(dt(t))}),mt={test:ut("rgb","red"),parse:ct("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+pt.transform(t)+", "+pt.transform(e)+", "+pt.transform(n)+", "+q(tt.transform(o))+")"};const ft={test:ut("#"),parse:function(t){let e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:mt.transform},gt={test:t=>mt.test(t)||ft.test(t)||ht.test(t),parse:t=>mt.test(t)?mt.parse(t):ht.test(t)?ht.parse(t):ft.parse(t),transform:t=>J(t)?t:t.hasOwnProperty("red")?mt.transform(t):ht.transform(t)};function vt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const o=t.match(K);o&&(n=o.length,t=t.replace(K,"${c}"),e.push(...o.map(gt.parse)));const i=t.match(Z);return i&&(t=t.replace(Z,"${n}"),e.push(...i.map(Q.parse))),{values:e,numColors:n,tokenised:t}}function yt(t){return vt(t).values}function xt(t){const{values:e,numColors:n,tokenised:o}=vt(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=e.replace(o<n?"${c}":"${n}",o<n?gt.transform(t[o]):q(t[o]));return e}}const bt=t=>"number"==typeof t?0:t;const Et={test:function(t){var e,n,o,i;return isNaN(t)&&J(t)&&(null!==(n=null===(e=t.match(Z))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(K))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:yt,createTransformer:xt,getAnimatableNone:function(t){const e=yt(t);return xt(t)(e.map(bt))}},wt=new Set(["brightness","contrast","saturate","opacity"]);function St(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(Z)||[];if(!o)return t;const i=n.replace(o,"");let r=wt.has(e)?1:0;return o!==n&&(r*=100),e+"("+r+i+")"}const At=/([a-z-]*)\(.*?\)/g,Pt=Object.assign(Object.assign({},Et),{getAnimatableNone:t=>{const e=t.match(At);return e?e.map(St).join(" "):t}}),Tt={...Q,transform:Math.round},Vt={borderWidth:rt,borderTopWidth:rt,borderRightWidth:rt,borderBottomWidth:rt,borderLeftWidth:rt,borderRadius:rt,radius:rt,borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomRightRadius:rt,borderBottomLeftRadius:rt,width:rt,maxWidth:rt,height:rt,maxHeight:rt,size:rt,top:rt,right:rt,bottom:rt,left:rt,padding:rt,paddingTop:rt,paddingRight:rt,paddingBottom:rt,paddingLeft:rt,margin:rt,marginTop:rt,marginRight:rt,marginBottom:rt,marginLeft:rt,rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:et,scaleX:et,scaleY:et,scaleZ:et,skew:ot,skewX:ot,skewY:ot,distance:rt,translateX:rt,translateY:rt,translateZ:rt,x:rt,y:rt,z:rt,perspective:rt,transformPerspective:rt,opacity:tt,originX:lt,originY:lt,originZ:rt,zIndex:Tt,fillOpacity:tt,strokeOpacity:tt,numOctaves:Tt};function Ct(t,e,n,o){const{style:i,vars:r,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let u=!1,c=!1,h=!0;for(const t in e){const n=e[t];if(Y(t)){r[t]=n;continue}const o=Vt[t],d=X(n,o);if(U.has(t)){if(u=!0,s[t]=d,a.push(t),!h)continue;n!==(o.default||0)&&(h=!1)}else t.startsWith("origin")?(c=!0,l[t]=d):i[t]=d}if(e.transform||(u||o?i.transform=$(t,n,h,o):i.transform&&(i.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;i.transformOrigin=`${t} ${e} ${n}`}}const Mt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Rt(t,e,n){for(const o in e)z(e[o])||N(o,n)||(t[o]=e[o])}function Lt(t,n,o){const i={};return Rt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return Ct(e,n,{enableHardwareAcceleration:!o},t),Object.assign({},e.vars,e.style)},[n])}(t,n,o)),t.transformValues?t.transformValues(i):i}function Ot(t,e,n){const o={},i=Lt(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}const kt=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function Dt(t){return kt.has(t)}let jt=t=>!Dt(t);function Ft(t){t&&(jt=e=>e.startsWith("on")?!Dt(e):t(e))}try{Ft(require("@emotion/is-prop-valid").default)}catch(t){}function It(t,e,n){const o={};for(const i in t)(jt(i)||!0===n&&Dt(i)||!e&&!Dt(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}function Bt(t,e,n){return"string"==typeof t?t:rt.transform(e+n*t)}const Ut={offset:"stroke-dashoffset",array:"stroke-dasharray"},Nt={offset:"strokeDashoffset",array:"strokeDasharray"};function zt(t,{attrX:e,attrY:n,originX:o,originY:i,pathLength:r,pathSpacing:s=1,pathOffset:a=0,...l},u,c){Ct(t,l,u,c),t.attrs=t.style,t.style={};const{attrs:h,style:d,dimensions:p}=t;h.transform&&(p&&(d.transform=h.transform),delete h.transform),p&&(void 0!==o||void 0!==i||d.transform)&&(d.transformOrigin=function(t,e,n){return`${Bt(e,t.x,t.width)} ${Bt(n,t.y,t.height)}`}(p,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==r&&function(t,e,n=1,o=0,i=!0){t.pathLength=1;const r=i?Ut:Nt;t[r.offset]=rt.transform(-o);const s=rt.transform(e),a=rt.transform(n);t[r.array]=`${s} ${a}`}(h,r,s,a,!1)}const Wt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function Ht(t,n){const o=e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return zt(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Rt(e,t.style,t),o.style={...e,...o.style}}return o}function $t(t=!1){return(n,o,i,r,{latestValues:s},a)=>{const l=(j(n)?Ht:Ot)(o,s,a),u={...It(o,"string"==typeof n,t),...l,ref:r};return i&&(u["data-projection-id"]=i),e.createElement(n,u)}}const Yt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Xt(t,{style:e,vars:n},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Gt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function qt(t,e,n,o){Xt(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Gt.has(n)?n:Yt(n),e.attrs[n])}function Zt(t){const{style:e}=t,n={};for(const o in e)(z(e[o])||N(o,t))&&(n[o]=e[o]);return n}function Kt(t){const e=Zt(t);for(const n in t)if(z(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function _t(t,e,n,o={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),e}const Jt=t=>Array.isArray(t),Qt=t=>Jt(t)?t[t.length-1]||0:t;function te(t){const e=z(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const ee=t=>(n,o)=>{const i=e.useContext(a),r=e.useContext(u),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,i,r){const s={latestValues:ne(o,i,r,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,i,r);return o?s():A(s)};function ne(t,e,n,o){const i={},r=o(t);for(const t in r)i[t]=te(r[t]);let{initial:s,animate:a}=t;const l=v(t),u=y(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const h=c?a:s;if(h&&"boolean"!=typeof h&&!f(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=_t(t,e);if(!n)return;const{transitionEnd:o,transition:r,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(i[t]=e)}for(const t in o)i[t]=o[t]})}return i}const oe={useVisualState:ee({scrapeMotionValuesFromProps:Kt,createRenderState:Wt,onMount:(t,e,{renderState:n,latestValues:o})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}zt(n,o,{enableHardwareAcceleration:!1},t.transformTemplate),qt(e,n)}})},ie={useVisualState:ee({scrapeMotionValuesFromProps:Zt,createRenderState:Mt})};function re(t,{forwardMotionProps:e=!1},n,o,i){return{...j(t)?oe:ie,preloadedFeatures:n,useRender:$t(e),createVisualElement:o,projectionNodeConstructor:i,Component:t}}var se;function ae(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function le(t,n,o,i){e.useEffect(()=>{const e=t.current;if(o&&e)return ae(e,n,o,i)},[t,n,o,i])}function ue(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function ce(t){return!!t.touches}t.AnimationType=void 0,(se=t.AnimationType||(t.AnimationType={})).Animate="animate",se.Hover="whileHover",se.Tap="whileTap",se.Drag="whileDrag",se.Focus="whileFocus",se.InView="whileInView",se.Exit="exit";const he={pageX:0,pageY:0};function de(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||he;return{x:n[e+"X"],y:n[e+"Y"]}}function pe(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function me(t,e="page"){return{point:ce(t)?de(t,e):pe(t,e)}}const fe=(t,e=!1)=>{const n=e=>t(e,me(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},ge={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ve={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function ye(t){return c&&null===window.onpointerdown?t:c&&null===window.ontouchstart?ve[t]:c&&null===window.onmousedown?ge[t]:t}function xe(t,e,n,o){return ae(t,ye(e),fe(n,"pointerdown"===e),o)}function be(t,e,n,o){return le(t,ye(e),n&&fe(n,"pointerdown"===e),o)}function Ee(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const we=Ee("dragHorizontal"),Se=Ee("dragVertical");function Ae(t){let e=!1;if("y"===t)e=Se();else if("x"===t)e=we();else{const t=we(),n=Se();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Pe(){const t=Ae(!0);return!t||(t(),!1)}function Te(e,n,o){return(i,r)=>{ue(i)&&!Pe()&&(e.animationState&&e.animationState.setActive(t.AnimationType.Hover,n),o&&o(i,r))}}const Ve=(t,e)=>!!e&&(t===e||Ve(t,e.parentElement));function Ce(t){return e.useEffect(()=>()=>t(),[])}function Me(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}const Re=(t,e,n)=>Math.min(Math.max(n,t),e);function Le({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let i,r,s=1-e;s=Re(.05,1,s),t=Re(.01,10,t/1e3),s<1?(i=e=>{const o=e*s,i=o*t;return.001-(o-n)/Oe(e,s)*Math.exp(-i)},r=e=>{const o=e*s*t,r=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=Oe(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let o=n;for(let n=1;n<12;n++)o-=t(o)/e(o);return o}(i,r,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*o;return{stiffness:e,damping:2*s*Math.sqrt(o*e),duration:t}}}function Oe(t,e){return t*Math.sqrt(1-e*e)}const ke=["duration","bounce"],De=["stiffness","damping","mass"];function je(t,e){return e.some(e=>void 0!==t[e])}function Fe(t){var{from:e=0,to:n=1,restSpeed:o=2,restDelta:i}=t,r=Me(t,["from","to","restSpeed","restDelta"]);const s={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!je(t,De)&&je(t,ke)){const n=Le(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(r),p=Ie,m=Ie;function f(){const t=c?-c/1e3:0,o=n-e,r=l/(2*Math.sqrt(a*u)),s=Math.sqrt(a/u)/1e3;if(void 0===i&&(i=Math.min(Math.abs(n-e)/100,.4)),r<1){const e=Oe(s,r);p=i=>{const a=Math.exp(-r*s*i);return n-a*((t+r*s*o)/e*Math.sin(e*i)+o*Math.cos(e*i))},m=n=>{const i=Math.exp(-r*s*n);return r*s*i*(Math.sin(e*n)*(t+r*s*o)/e+o*Math.cos(e*n))-i*(Math.cos(e*n)*(t+r*s*o)-e*o*Math.sin(e*n))}}else if(1===r)p=e=>n-Math.exp(-s*e)*(o+(t+s*o)*e);else{const e=s*Math.sqrt(r*r-1);p=i=>{const a=Math.exp(-r*s*i),l=Math.min(e*i,300);return n-a*((t+r*s*o)*Math.sinh(l)+e*o*Math.cosh(l))/e}}}return f(),{next:t=>{const e=p(t);if(d)s.done=t>=h;else{const r=1e3*m(t),a=Math.abs(r)<=o,l=Math.abs(n-e)<=i;s.done=a&&l}return s.value=s.done?n:e,s},flipTarget:()=>{c=-c,[e,n]=[n,e],f()}}}Fe.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Ie=t=>0,Be=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Ue=(t,e,n)=>-n*t+n*e+t;function Ne(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ze({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let i=0,r=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;i=Ne(a,o,t+1/3),r=Ne(a,o,t),s=Ne(a,o,t-1/3)}else i=r=s=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*s),alpha:o}}const We=(t,e,n)=>{const o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},He=[ft,mt,ht],$e=t=>He.find(e=>e.test(t)),Ye=(t,e)=>{let n=$e(t),o=$e(e),i=n.parse(t),r=o.parse(e);n===ht&&(i=ze(i),n=mt),o===ht&&(r=ze(r),o=mt);const s=Object.assign({},i);return t=>{for(const e in s)"alpha"!==e&&(s[e]=We(i[e],r[e],t));return s.alpha=Ue(i.alpha,r.alpha,t),n.transform(s)}},Xe=t=>"number"==typeof t,Ge=(t,e)=>n=>e(t(n)),qe=(...t)=>t.reduce(Ge);function Ze(t,e){return Xe(t)?n=>Ue(t,e,n):gt.test(t)?Ye(t,e):Qe(t,e)}const Ke=(t,e)=>{const n=[...t],o=n.length,i=t.map((t,n)=>Ze(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=i[e](t);return n}},_e=(t,e)=>{const n=Object.assign(Object.assign({},t),e),o={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=Ze(t[i],e[i]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function Je(t){const e=Et.parse(t),n=e.length;let o=0,i=0,r=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:void 0!==e[t].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}const Qe=(t,e)=>{const n=Et.createTransformer(e),o=Je(t),i=Je(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&o.numNumbers>=i.numNumbers?qe(Ke(o.parsed,i.parsed),n):n=>""+(n>0?e:t)},tn=(t,e)=>n=>Ue(t,e,n);function en(t,e,n){const o=[],i=n||("number"==typeof(r=t[0])?tn:"string"==typeof r?gt.test(r)?Ye:Qe:Array.isArray(r)?Ke:"object"==typeof r?_e:void 0);var r;const s=t.length-1;for(let n=0;n<s;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;r=qe(t,r)}o.push(r)}return o}function nn(t,e,{clamp:n=!0,ease:o,mixer:i}={}){const r=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[r-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const s=en(e,o,i),a=2===r?function([t,e],[n]){return o=>n(Be(t,e,o))}(t,s):function(t,e){const n=t.length,o=n-1;return i=>{let r=0,s=!1;if(i<=t[0]?s=!0:i>=t[o]&&(r=o-1,s=!0),!s){let e=1;for(;e<n&&!(t[e]>i||e===o);e++);r=e-1}const a=Be(t[r],t[r+1],i);return e[r](a)}}(t,s);return n?e=>a(Re(t[0],t[r-1],e)):a}const on=t=>e=>1-t(1-e),rn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,sn=t=>e=>e*e*((t+1)*e-t),an=t=>t,ln=(un=2,t=>Math.pow(t,un));var un;const cn=on(ln),hn=rn(ln),dn=t=>1-Math.sin(Math.acos(t)),pn=on(dn),mn=rn(pn),fn=sn(1.525),gn=on(fn),vn=rn(fn),yn=(t=>{const e=sn(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),xn=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},bn=on(xn);function En(t,e){return t.map(()=>e||hn).splice(0,t.length-1)}function wn({from:t=0,to:e=1,ease:n,offset:o,duration:i=300}){const r={done:!1,value:t},s=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(o&&o.length===s.length?o:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(s),i);function l(){return nn(a,s,{ease:Array.isArray(n)?n:En(s,n)})}let u=l();return{next:t=>(r.value=u(t),r.done=t>=i,r),flipTarget:()=>{s.reverse(),u=l()}}}const Sn={keyframes:wn,spring:Fe,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:i=.5,modifyTarget:r}){const s={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===r?l:r(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>i||e<-i),s.value=s.done?u:u+e,s},flipTarget:()=>{}}}};const An="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Pn="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(An()),1/60*1e3);let Tn=!0,Vn=!1,Cn=!1;const Mn={delta:0,timestamp:0},Rn=["read","update","preRender","render","postRender"],Ln=Rn.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,i=!1,r=!1;const s=new WeakSet,a={schedule:(t,r=!1,a=!1)=>{const l=a&&i,u=l?e:n;return r&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&i&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(i)r=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,o=e.length,o)for(let n=0;n<o;n++){const o=e[n];o(l),s.has(o)&&(a.schedule(o),t())}i=!1,r&&(r=!1,a.process(l))}}};return a}(()=>Vn=!0),t),{}),On=Rn.reduce((t,e)=>{const n=Ln[e];return t[e]=(t,e=!1,o=!1)=>(Vn||In(),n.schedule(t,e,o)),t},{}),kn=Rn.reduce((t,e)=>(t[e]=Ln[e].cancel,t),{}),Dn=Rn.reduce((t,e)=>(t[e]=()=>Ln[e].process(Mn),t),{}),jn=t=>Ln[t].process(Mn),Fn=t=>{Vn=!1,Mn.delta=Tn?1/60*1e3:Math.max(Math.min(t-Mn.timestamp,40),1),Mn.timestamp=t,Cn=!0,Rn.forEach(jn),Cn=!1,Vn&&(Tn=!1,Pn(Fn))},In=()=>{Vn=!0,Tn=!0,Cn||Pn(Fn)},Bn=()=>Mn;function Un(t,e,n=0){return t-e-n}const Nn=t=>{const e=({delta:e})=>t(e);return{start:()=>On.update(e,!0),stop:()=>kn.update(e)}};function zn(t){var e,n,{from:o,autoplay:i=!0,driver:r=Nn,elapsed:s=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:h,onComplete:d,onRepeat:p,onUpdate:m}=t,f=Me(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,v,y,{to:x}=f,b=0,E=f.duration,w=!1,S=!0;const A=function(t){if(Array.isArray(t.to))return wn;if(Sn[t.type])return Sn[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?wn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Fe:wn}(f);(null===(n=(e=A).needsInterpolation)||void 0===n?void 0:n.call(e,o,x))&&(y=nn([0,100],[o,x],{clamp:!1}),o=0,x=100);const P=A(Object.assign(Object.assign({},f),{from:o,to:x}));function T(){b++,"reverse"===l?(S=b%2==0,s=function(t,e,n=0,o=!0){return o?Un(e+-t,e,n):e-(t-e)+n}(s,E,u,S)):(s=Un(s,E,u),"mirror"===l&&P.flipTarget()),w=!1,p&&p()}function V(t){if(S||(t=-t),s+=t,!w){const t=P.next(Math.max(0,s));v=t.value,y&&(v=y(v)),w=S?t.done:s<=0}null==m||m(v),w&&(0===b&&(null!=E||(E=s)),b<a?function(t,e,n,o){return o?t>=e+n:t<=-n}(s,E,u,S)&&T():(g.stop(),d&&d()))}return i&&(null==c||c(),g=r(V),g.start()),{stop:()=>{null==h||h(),g.stop()}}}function Wn(t,e){return e?t*(1e3/e):0}const Hn=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),$n=t=>Hn(t)&&t.hasOwnProperty("z"),Yn=(t,e)=>Math.abs(t-e);function Xn(t,e){if(Xe(t)&&Xe(e))return Yn(t,e);if(Hn(t)&&Hn(e)){const n=Yn(t.x,e.x),o=Yn(t.y,e.y),i=$n(t)&&$n(e)?Yn(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}const Gn=(t,e)=>1-3*e+3*t,qn=(t,e)=>3*e-6*t,Zn=t=>3*t,Kn=(t,e,n)=>((Gn(e,n)*t+qn(e,n))*t+Zn(e))*t,_n=(t,e,n)=>3*Gn(e,n)*t*t+2*qn(e,n)*t+Zn(e);function Jn(t,e,n,o){if(t===e&&n===o)return an;const i=new Float32Array(11);for(let e=0;e<11;++e)i[e]=Kn(.1*e,t,n);function r(e){let o=0,r=1;for(;10!==r&&i[r]<=e;++r)o+=.1;--r;const s=o+.1*((e-i[r])/(i[r+1]-i[r])),a=_n(s,t,n);return a>=.001?function(t,e,n,o){for(let i=0;i<8;++i){const i=_n(e,n,o);if(0===i)return e;e-=(Kn(e,n,o)-t)/i}return e}(e,s,t,n):0===a?s:function(t,e,n,o,i){let r,s,a=0;do{s=e+(n-e)/2,r=Kn(s,o,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<10);return s}(e,o,o+.1,t,n)}return t=>0===t||1===t?t:Kn(r(t),e,o)}const Qn=("undefined"==typeof process||process.env,"production"),to=new Set;function eo(t,e,n){t||to.has(e)||(console.warn(e),n&&console.warn(n),to.add(e))}const no=new WeakMap,oo=new WeakMap,io=t=>{const e=no.get(t.target);e&&e(t)},ro=t=>{t.forEach(io)};function so(t,e,n){const o=function({root:t,...e}){const n=t||document;oo.has(n)||oo.set(n,{});const o=oo.get(n),i=JSON.stringify(e);return o[i]||(o[i]=new IntersectionObserver(ro,{root:t,...e})),o[i]}(e);return no.set(t,n),o.observe(t),()=>{no.delete(t),o.unobserve(t)}}const ao={some:0,all:1};function lo(n,o,i,{root:r,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n||!i.current)return;const e={root:null==r?void 0:r.current,rootMargin:s,threshold:"number"==typeof a?a:ao[a]};return so(i.current,e,e=>{const{isIntersecting:n}=e;if(o.isInView===n)return;if(o.isInView=n,l&&!n&&o.hasEnteredView)return;n&&(o.hasEnteredView=!0),i.animationState&&i.animationState.setActive(t.AnimationType.InView,n);const r=i.getProps(),s=n?r.onViewportEnter:r.onViewportLeave;s&&s(e)})},[n,r,s,a])}function uo(n,o,i,{fallback:r=!0}){e.useEffect(()=>{n&&r&&("production"!==Qn&&eo(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{o.hasEnteredView=!0;const{onViewportEnter:e}=i.getProps();e&&e(null),i.animationState&&i.animationState.setActive(t.AnimationType.InView,!0)}))},[n])}const co=t=>e=>(t(e),null),ho={inView:co((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:i,viewport:r={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||i);r.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?uo:lo)(a,s.current,t,r)})),tap:co((function({onTap:n,onTapStart:o,onTapCancel:i,whileTap:r,visualElement:s}){const a=n||o||i||r,l=e.useRef(!1),u=e.useRef(null),c={passive:!(o||n||i||f)};function h(){u.current&&u.current(),u.current=null}function d(){return h(),l.current=!1,s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!1),!Pe()}function p(t,e){d()&&(Ve(s.current,t.target)?n&&n(t,e):i&&i(t,e))}function m(t,e){d()&&i&&i(t,e)}function f(e,n){h(),l.current||(l.current=!0,u.current=qe(xe(window,"pointerup",p,c),xe(window,"pointercancel",m,c)),s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!0),o&&o(e,n))}be(s,"pointerdown",a?f:void 0,c),Ce(h)})),focus:co((function({whileFocus:e,visualElement:n}){const{animationState:o}=n;le(n,"focus",e?()=>{o&&o.setActive(t.AnimationType.Focus,!0)}:void 0),le(n,"blur",e?()=>{o&&o.setActive(t.AnimationType.Focus,!1)}:void 0)})),hover:co((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){be(o,"pointerenter",t||n?Te(o,!0,t):void 0,{passive:!t}),be(o,"pointerleave",e||n?Te(o,!1,e):void 0,{passive:!e})}))};function po(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=e.useId();e.useEffect(()=>i(r),[]);return!n&&o?[!1,()=>o&&o(r)]:[!0]}function mo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}const fo=t=>1e3*t,go={linear:an,easeIn:ln,easeInOut:hn,easeOut:cn,circIn:dn,circInOut:mn,circOut:pn,backIn:fn,backInOut:vn,backOut:gn,anticipate:yn,bounceIn:bn,bounceInOut:t=>t<.5?.5*(1-xn(1-2*t)):.5*xn(2*t-1)+.5,bounceOut:xn},vo=t=>{if(Array.isArray(t)){t.length;const[e,n,o,i]=t;return Jn(e,n,o,i)}return"string"==typeof t?go[t]:t},yo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Et.test(e)||e.startsWith("url("))),xo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),bo=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Eo=()=>({type:"keyframes",ease:"linear",duration:.3}),wo=t=>({type:"keyframes",duration:.8,values:t}),So={x:xo,y:xo,z:xo,rotate:xo,rotateX:xo,rotateY:xo,rotateZ:xo,scaleX:bo,scaleY:bo,scale:bo,opacity:Eo,backgroundColor:Eo,color:Eo,default:bo},Ao=(t,e)=>{let n;return n=Jt(e)?wo:So[t]||So.default,{to:e,...n(e)}},Po={...Vt,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:Pt,WebkitFilter:Pt},To=t=>Po[t];function Vo(t,e){var n;let o=To(t);return o!==Pt&&(o=Et),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const Co={current:!1};function Mo(t,e){const n=performance.now(),o=({timestamp:i})=>{const r=i-n;r>=e&&(kn.read(o),t(r-e))};return On.read(o,!0),()=>kn.read(o)}function Ro({ease:t,times:e,yoyo:n,flip:o,loop:i,...r}){const s={...r};return e&&(s.offset=e),r.duration&&(s.duration=fo(r.duration)),r.repeatDelay&&(s.repeatDelay=fo(r.repeatDelay)),t&&(s.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(vo):vo(t)),"tween"===r.type&&(s.type="keyframes"),(n||i||o)&&(n?s.repeatType="reverse":i?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=i||n||o||r.repeat),"spring"!==r.type&&(s.type="keyframes"),s}function Lo(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...Ao(n,e.to)}),{...e,...Ro(t)}}function Oo(t,e,n,o,i){const r=jo(o,t)||{};let s=void 0!==r.from?r.from:e.get();const a=yo(t,n);"none"===s&&a&&"string"==typeof n?s=Vo(t,n):ko(s)&&"string"==typeof n?s=Do(n):!Array.isArray(n)&&ko(n)&&"string"==typeof s&&(n=Do(s));return yo(t,s)&&a&&!1!==r.type?function(){const o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:t=>e.set(t)};return"inertia"===r.type||"decay"===r.type?function({from:t=0,velocity:e=0,min:n,max:o,power:i=.8,timeConstant:r=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==o&&t>o}function g(t){return void 0===n?o:void 0===o||Math.abs(n-t)<Math.abs(o-t)?n:o}function v(t){null==m||m.stop(),m=zn(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p}))}function y(t){v(Object.assign({type:"spring",stiffness:s,damping:a,restDelta:l},t))}if(f(t))y({from:t,velocity:e,to:g(t)});else{let o=i*e+t;void 0!==u&&(o=u(o));const s=g(o),a=s===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=Wn(t-c,Bn().delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:r,power:i,restDelta:l,modifyTarget:u,onUpdate:f(o)?d:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...o,...r}):zn({...Lo(r,o,t),onUpdate:t=>{o.onUpdate(t),r.onUpdate&&r.onUpdate(t)},onComplete:()=>{o.onComplete(),r.onComplete&&r.onComplete()}})}:function(){const t=Qt(n);return e.set(t),i(),r.onUpdate&&r.onUpdate(t),r.onComplete&&r.onComplete(),{stop:()=>{}}}}function ko(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Do(t){return"number"==typeof t?0:Vo("",t)}function jo(t,e){return t[e]||t.default||t}function Fo(t,e,n,o={}){return Co.current&&(o={type:!1}),e.start(i=>{let r;const s=Oo(t,e,n,o,i),a=function(t,e){var n,o;return null!==(o=null!==(n=(jo(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==o?o:0}(o,t),l=()=>r=s();let u;return a?u=Mo(l,fo(a)):l(),()=>{u&&u(),r&&r.stop()}})}const Io=t=>/^0[^.\s]+$/.test(t);function Bo(t,e){-1===t.indexOf(e)&&t.push(e)}function Uo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class No{constructor(){this.subscriptions=[]}add(t){return Bo(this.subscriptions,t),()=>Uo(this.subscriptions,t)}notify(t,e,n){const o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(let i=0;i<o;i++){const o=this.subscriptions[i];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class zo{constructor(t){var e;this.version="7.6.5",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new No,this.velocityUpdateSubscribers=new No,this.renderSubscribers=new No,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=Bn();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,On.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>On.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Wn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Wo(t){return new zo(t)}const Ho=t=>e=>e.test(t),$o=[Q,rt,it,ot,at,st,{test:t=>"auto"===t,parse:t=>t}],Yo=t=>$o.find(Ho(t)),Xo=[...$o,gt,Et],Go=t=>Xo.find(Ho(t));function qo(t,e,n){const o=t.getProps();return _t(o,e,void 0!==n?n:o.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 Zo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Wo(n))}function Ko(t,e){const n=qo(t,e);let{transitionEnd:o={},transition:i={},...r}=n?t.makeTargetAnimatable(n,!1):{};r={...r,...o};for(const e in r){Zo(t,e,Qt(r[e]))}}function _o(t,e){[...e].reverse().forEach(n=>{var o;const i=t.getVariant(n);i&&Ko(t,i),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{_o(t,e)})})}function Jo(t,e,n){var o,i;const r=Object.keys(e).filter(e=>!t.hasValue(e)),s=r.length;if(s)for(let a=0;a<s;a++){const s=r[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(o=n[s])&&void 0!==o?o:t.readValue(s))&&void 0!==i?i:e[s]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||Io(u))?u=parseFloat(u):!Go(u)&&Et.test(l)&&(u=Vo(s,l)),t.addValue(s,Wo(u)),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}function Qo(t,e){if(!e)return;return(e[t]||e.default||e).from}function ti(t,e,n){var o;const i={};for(const r in t){const t=Qo(r,e);i[r]=void 0!==t?t:null===(o=n.getValue(r))||void 0===o?void 0:o.get()}return i}function ei(t){return Boolean(z(t)&&t.add)}function ni(t,e,n={}){let o;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>oi(t,e,n));o=Promise.all(i)}else if("string"==typeof e)o=oi(t,e,n);else{const i="function"==typeof e?qo(t,e,n.custom):e;o=ii(t,i,n)}return o.then(()=>t.notify("AnimationComplete",e))}function oi(t,e,n={}){var o;const i=qo(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>ii(t,i,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=r;return function(t,e,n=0,o=0,i=1,r){const s=[],a=(t.variantChildren.size-1)*o,l=1===i?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(ri).forEach((t,o)=>{s.push(oi(t,e,{...r,delay:n+l(o)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,i+o,s,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function ii(t,e,{delay:n=0,transitionOverride:o,type:i}={}){var r;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");o&&(s=o);const c=[],h=i&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[i]);for(const e in l){const o=t.getValue(e),i=l[e];if(!o||void 0===i||h&&si(h,e))continue;let r={delay:n,...s};t.shouldReduceMotion&&U.has(e)&&(r={...r,type:!1,delay:0});let a=Fo(e,o,i,r);ei(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&Ko(t,a)})}function ri(t,e){return t.sortNodePosition(e)}function si({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const ai=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],li=[...ai].reverse(),ui=ai.length;function ci(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>ni(t,e,n)))}(e);const o={[t.AnimationType.Animate]:di(!0),[t.AnimationType.InView]:di(),[t.AnimationType.Hover]:di(),[t.AnimationType.Tap]:di(),[t.AnimationType.Drag]:di(),[t.AnimationType.Focus]:di(),[t.AnimationType.Exit]:di()};let i=!0;const r=(t,n)=>{const o=qo(e,n);if(o){const{transition:e,transitionEnd:n,...i}=o;t={...t,...i,...n}}return t};function s(t,s){var a;const l=e.getProps(),u=e.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let n=0;n<ui;n++){const g=li[n],v=o[g],y=null!==(a=l[g])&&void 0!==a?a:u[g],x=m(y),b=g===s?v.isActive:null;!1===b&&(p=n);let E=y===u[g]&&y!==l[g]&&x;if(E&&i&&e.manuallyAnimateOnMount&&(E=!1),v.protectedKeys={...d},!v.isActive&&null===b||!y&&!v.prevProp||f(y)||"boolean"==typeof y)continue;const w=hi(v.prevProp,y);let S=w||g===s&&v.isActive&&!E&&x||n>p&&x;const A=Array.isArray(y)?y:[y];let P=A.reduce(r,{});!1===b&&(P={});const{prevResolvedValues:T={}}=v,V={...T,...P},C=t=>{S=!0,h.delete(t),v.needsAnimating[t]=!0};for(const t in V){const e=P[t],n=T[t];d.hasOwnProperty(t)||(e!==n?Jt(e)&&Jt(n)?!mo(e,n)||w?C(t):v.protectedKeys[t]=!0:void 0!==e?C(t):h.add(t):void 0!==e&&h.has(t)?C(t):v.protectedKeys[t]=!0)}v.prevProp=y,v.prevResolvedValues=P,v.isActive&&(d={...d,...P}),i&&e.blockInitialAnimation&&(S=!1),S&&!E&&c.push(...A.map(e=>({animation:e,options:{type:g,...t}})))}if(h.size){const t={};h.forEach(n=>{const o=e.getBaseTarget(n);void 0!==o&&(t[n]=o)}),c.push({animation:t})}let g=Boolean(c.length);return i&&!1===l.initial&&!e.manuallyAnimateOnMount&&(g=!1),i=!1,g?n(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,i){var r;if(o[t].isActive===n)return Promise.resolve();null===(r=e.variantChildren)||void 0===r||r.forEach(e=>{var o;return null===(o=e.animationState)||void 0===o?void 0:o.setActive(t,n)}),o[t].isActive=n;const a=s(i,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function hi(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!mo(e,t)}function di(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const pi={animation:co(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=ci(t)),f(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:co(n=>{const{custom:o,visualElement:i}=n,[r,s]=po(),a=e.useContext(u);e.useEffect(()=>{i.isPresent=r;const e=i.animationState&&i.animationState.setActive(t.AnimationType.Exit,!r,{custom:a&&a.custom||o});e&&!r&&e.then(s)},[r])})};class mi{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=vi(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Xn(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:i}=Bn();this.history.push({...o,timestamp:i});const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=fi(e,this.transformPagePoint),ue(t)&&0===t.buttons?this.handlePointerUp(t,e):On.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,i=vi(fi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),o&&o(t,i)},ce(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=fi(me(t),this.transformPagePoint),{point:i}=o,{timestamp:r}=Bn();this.history=[{...i,timestamp:r}];const{onSessionStart:s}=e;s&&s(t,vi(o,this.history)),this.removeListeners=qe(xe(window,"pointermove",this.handlePointerMove),xe(window,"pointerup",this.handlePointerUp),xe(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),kn.update(this.updatePoint)}}function fi(t,e){return e?{point:e(t.point)}:t}function gi(t,e){return{x:t.x-e.x,y:t.y-e.y}}function vi({point:t},e){return{point:t,delta:gi(t,xi(e)),offset:gi(t,yi(e)),velocity:bi(e,.1)}}function yi(t){return t[0]}function xi(t){return t[t.length-1]}function bi(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const i=xi(t);for(;n>=0&&(o=t[n],!(i.timestamp-o.timestamp>fo(e)));)n--;if(!o)return{x:0,y:0};const r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Ei(t){return t.max-t.min}function wi(t,e=0,n=.01){return Xn(t,e)<n}function Si(t,e,n,o=.5){t.origin=o,t.originPoint=Ue(e.min,e.max,t.origin),t.scale=Ei(n)/Ei(e),(wi(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Ue(n.min,n.max,t.origin)-t.originPoint,(wi(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Ai(t,e,n,o){Si(t.x,e.x,n.x,null==o?void 0:o.originX),Si(t.y,e.y,n.y,null==o?void 0:o.originY)}function Pi(t,e,n){t.min=n.min+e.min,t.max=t.min+Ei(e)}function Ti(t,e,n){t.min=e.min-n.min,t.max=t.min+Ei(e)}function Vi(t,e,n){Ti(t.x,e.x,n.x),Ti(t.y,e.y,n.y)}function Ci(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 Mi(t,e){let n=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,o]=[o,n]),{min:n,max:o}}const Ri=.35;function Li(t,e,n){return{min:Oi(t,e),max:Oi(t,n)}}function Oi(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}const ki=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Di(t){return[t("x"),t("y")]}function ji({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function Fi(t){return void 0===t||1===t}function Ii({scale:t,scaleX:e,scaleY:n}){return!Fi(t)||!Fi(e)||!Fi(n)}function Bi(t){return Ii(t)||Ui(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Ui(t){return Ni(t.x)||Ni(t.y)}function Ni(t){return t&&"0%"!==t}function zi(t,e,n){return n+e*(t-n)}function Wi(t,e,n,o,i){return void 0!==i&&(t=zi(t,i,o)),zi(t,n,o)+e}function Hi(t,e=0,n=1,o,i){t.min=Wi(t.min,e,n,o,i),t.max=Wi(t.max,e,n,o,i)}function $i(t,{x:e,y:n}){Hi(t.x,e.translate,e.scale,e.originPoint),Hi(t.y,n.translate,n.scale,n.originPoint)}function Yi(t,e){t.min=t.min+e,t.max=t.max+e}function Xi(t,e,[n,o,i]){const r=void 0!==e[i]?e[i]:.5,s=Ue(t.min,t.max,r);Hi(t,e[n],e[o],s,e.scale)}const Gi=["x","scaleX","originX"],qi=["y","scaleY","originY"];function Zi(t,e){Xi(t.x,e,Gi),Xi(t.y,e,qi)}function Ki(t,e){return ji(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),o=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}(t.getBoundingClientRect(),e))}const _i=new WeakMap;class Ji{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(e,{snapToCursor:n=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new mi(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(me(t,"page").point)},onStart:(e,n)=>{var o;const{drag:i,dragPropagation:r,onDragStart:s}=this.getProps();(!i||r||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Ae(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Di(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(it.test(o)){const i=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(i){o=Ei(i)*(parseFloat(o)/100)}}this.originPoint[t]=o}),null==s||s(e,n),null===(o=this.visualElement.animationState)||void 0===o||o.setActive(t.AnimationType.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:o,onDirectionLock:i,onDrag:r}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(o&&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}(s),void(null!==this.currentDirection&&(null==i||i(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),null==r||r(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:o}=e;this.startAnimation(o);const{onDragEnd:i}=this.getProps();null==i||i(t,e)}cancel(){var e,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(t.AnimationType.Drag,!1)}updateAxis(t,e,n){const{drag:o}=this.getProps();if(!n||!Qi(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?Ue(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?Ue(n,t,o.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),i.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&p(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:i}){return{x:Ci(t.x,n,i),y:Ci(t.y,e,o)}}(n.actual,t),this.elastic=function(t=Ri){return!1===t?t=0:!0===t&&(t=Ri),{x:Li(t,"left","right"),y:Li(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Di(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.actual[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!p(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=function(t,e,n){const o=Ki(t,n),{scroll:i}=e;return i&&(Yi(o.x,i.x),Yi(o.y,i.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Mi(t.x,e.x),y:Mi(t.y,e.y)}}(o.layout.actual,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=ji(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Di(s=>{var l;if(!Qi(s,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[s])&&void 0!==l?l:{};r&&(u={min:0,max:0});const c=o?200:1e6,h=o?40:1e7,d={type:"inertia",velocity:n?t[s]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...u};return this.startAxisValueAnimation(s,d)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){return Fo(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Di(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const o="_drag"+t.toUpperCase(),i=this.visualElement.getProps()[o];return i||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){Di(e=>{const{drag:n}=this.getProps();if(!Qi(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:r}=o.layout.actual[e];i.set(t[e]-Ue(n,r,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!p(n)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Di(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const o=Ei(t),i=Ei(e);return i>o?n=Be(e.min,e.max-o,t.min):o>i&&(n=Be(t.min,t.max-i,e.min)),Re(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),Di(t=>{if(!Qi(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:r}=this.constraints[t];n.set(Ue(o,r,i[t]))})}addListeners(){var t;if(!this.visualElement.current)return;_i.set(this.visualElement,this);const e=xe(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();p(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const r=ae(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Di(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),i(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=Ri,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:s}}}function Qi(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const tr={pan:co((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:i,visualElement:r}){const a=t||n||o||i,l=e.useRef(null),{transformPagePoint:u}=e.useContext(s),c={onSessionStart:i,onStart:n,onMove:t,onEnd:(t,e)=>{l.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==l.current&&l.current.updateHandlers(c)}),be(r,"pointerdown",a&&function(t){l.current=new mi(t,c,{transformPagePoint:u})}),Ce(()=>l.current&&l.current.end())})),drag:co((function(t){const{dragControls:n,visualElement:o}=t,i=A(()=>new Ji(o));e.useEffect(()=>n&&n.subscribe(i),[i,n]),e.useEffect(()=>i.addListeners(),[i])}))};function er(t){return"string"==typeof t&&t.startsWith("var(--")}const nr=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function or(t,e,n=1){const[o,i]=function(t){const e=nr.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const r=window.getComputedStyle(e).getPropertyValue(o);return r?r.trim():er(i)?or(i,e,n+1):i}const ir=new Set(["width","height","top","left","right","bottom","x","y"]),rr=t=>ir.has(t),sr=(t,e)=>{t.set(e,!1),t.set(e)},ar=t=>t===Q||t===rt;var lr;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(lr||(lr={}));const ur=(t,e)=>parseFloat(t.split(", ")[e]),cr=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const i=o.match(/^matrix3d\((.+)\)$/);if(i)return ur(i[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?ur(e[1],t):0}},hr=new Set(["x","y","z"]),dr=B.filter(t=>!hr.has(t));const pr={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:cr(4,13),y:cr(5,14)},mr=(t,e,n={},o={})=>{e={...e},o={...o};const i=Object.keys(e).filter(rr);let r=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=Yo(u);const h=e[i];let d;if(Jt(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=Yo(u);for(let n=e;n<t;n++)d?Yo(h[n]):d=Yo(h[n])}else d=Yo(h);if(c!==d)if(ar(c)&&ar(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[i]=parseFloat(h):Array.isArray(h)&&d===rt&&(e[i]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[i]=c.transform(h):(s||(r=function(t){const e=[];return dr.forEach(n=>{const o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),s=!0),a.push(i),o[i]=void 0!==o[i]?o[i]:e[i],sr(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const o=e.measureViewportBox(),i=e.current,r=getComputedStyle(i),{display:s}=r,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=pr[t](o,r)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);sr(o,a[n]),t[n]=pr[n](l,r)}),t})(e,t,a);return r.length&&r.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),c&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:o}}return{target:e,transitionEnd:o}};function fr(t,e,n,o){return(t=>Object.keys(t).some(rr))(e)?mr(t,e,n,o):{target:e,transitionEnd:o}}const gr=(t,e,n,o)=>{const i=function(t,{...e},n){const o=t.current;if(!(o instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!er(e))return;const n=or(e,o);n&&t.set(n)});for(const t in e){const i=e[t];if(!er(i))continue;const r=or(i,o);r&&(e[t]=r,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,o);return fr(t,e=i.target,n,o=i.transitionEnd)},vr={current:null},yr={current:!1};function xr(){if(yr.current=!0,c)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>vr.current=t.matches;t.addListener(e),e()}else vr.current=!1}const br=Object.keys(w),Er=br.length,wr=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Sr{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:o},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>On.render(this.render,!1,!0);const{latestValues:r,renderState:s}=o;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=s,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.isControllingVariants=v(e),this.isVariantNode=y(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e);for(const t in l){const e=l[t];void 0!==r[t]&&z(e)&&(e.set(r[t],!1),ei(a)&&a.add(t))}if(e.values)for(const t in e.values){const n=e.values[t];void 0!==r[t]&&z(n)&&n.set(r[t])}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),yr.current||xr(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||vr.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),kn.update(this.notifyUpdate),kn.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&On.update(this.notifyUpdate,!1,!0)}),o=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{n(),o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,n,o,i,r,s){const a=[];for(let n=0;n<Er;n++){const o=br[n],{isEnabled:i,Component:r}=w[o];i(t)&&r&&a.push(e.createElement(r,{key:o,...t,visualElement:this}))}if(!this.projection&&r){this.projection=new r(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&p(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:l})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<wr.length;e++){const n=wr[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const o=t["on"+n];o&&(this.propEventSubscriptions[n]=this.on(n,o))}this.prevMotionValues=function(t,e,n){const{willChange:o}=e;for(const i in e){const r=e[i],s=n[i];if(z(r))t.addValue(i,r),ei(o)&&o.add(i);else if(z(s))t.addValue(i,Wo(r)),ei(o)&&o.remove(i);else if(s!==r)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(r)}else{const e=t.getStaticValue(i);t.addValue(i,Wo(void 0!==e?e:r))}}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const o={};for(let t=0;t<Pr;t++){const e=Ar[t],n=this.props[e];(m(n)||!1===n)&&(o[e]=n)}return o}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===e||e(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Wo(e),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,o="string"==typeof n||"object"==typeof n?null===(e=_t(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==o)return o;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||z(i)?void 0!==this.initialValues[t]&&void 0===o?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new No),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}const Ar=["initial",...ai],Pr=Ar.length;class Tr extends Sr{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:o},i){let r=ti(n,t||{},this);if(o&&(e&&(e=o(e)),n&&(n=o(n)),r&&(r=o(r))),i){Jo(this,n,r);const t=gr(this,n,r,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Vr extends Tr{readValueFromInstance(t,e){if(U.has(e)){const t=To(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),i=(Y(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ki(t,e)}build(t,e,n,o){Ct(t,e,n,o.transformTemplate)}scrapeMotionValuesFromProps(t){return Zt(t)}renderInstance(t,e,n,o){Xt(t,e,n,o)}}class Cr extends Tr{getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return U.has(e)?(null===(n=To(e))||void 0===n?void 0:n.default)||0:(e=Gt.has(e)?e:Yt(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return Kt(t)}build(t,e,n,o){zt(t,e,n,o.transformTemplate)}renderInstance(t,e,n,o){qt(t,e,0,o)}}const Mr=(t,e)=>j(t)?new Cr(e,{enableHardwareAcceleration:!1}):new Vr(e,{enableHardwareAcceleration:!0});function Rr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Lr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!rt.test(t))return t;t=parseFloat(t)}return`${Rr(t,e.target.x)}% ${Rr(t,e.target.y)}%`}},Or={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,i=t.includes("var("),r=[];i&&(t=t.replace(nr,t=>(r.push(t),"_$css")));const s=Et.parse(t);if(s.length>5)return o;const a=Et.createTransformer(t),l="number"!=typeof s[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+l]/=u,s[1+l]/=c;const h=Ue(u,c,.5);"number"==typeof s[2+l]&&(s[2+l]/=h),"number"==typeof s[3+l]&&(s[3+l]/=h);let d=a(s);if(i){let t=0;d=d.replace("_$css",()=>{const e=r[t];return t++,e})}return d}};class kr extends i.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:i}=t;I(Dr),i&&(e.group&&e.group.add(i),n&&n.register&&o&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),P.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:i}=this.props,r=n.projection;return r?(r.isPresent=i,o||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?r.promote():r.relegate()||On.postRender(()=>{var t;(null===(t=r.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(o),(null==n?void 0:n.deregister)&&n.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const Dr={borderRadius:{...Lr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Lr,borderTopRightRadius:Lr,borderBottomLeftRadius:Lr,borderBottomRightRadius:Lr,boxShadow:Or},jr={measureLayout:function(t){const[n,o]=po(),r=e.useContext(V);return i.default.createElement(kr,{...t,layoutGroup:r,switchLayoutGroup:e.useContext(M),isPresent:n,safeToRemove:o})}};function Fr(t,e,n={}){const o=z(t)?t:Wo(t);return Fo("",o,e,n),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const Ir=["TopLeft","TopRight","BottomLeft","BottomRight"],Br=Ir.length,Ur=t=>"string"==typeof t?parseFloat(t):t,Nr=t=>"number"==typeof t||rt.test(t);function zr(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Wr=$r(0,.5,pn),Hr=$r(.5,.95,an);function $r(t,e,n){return o=>o<t?0:o>e?1:n(Be(t,e,o))}function Yr(t,e){t.min=e.min,t.max=e.max}function Xr(t,e){Yr(t.x,e.x),Yr(t.y,e.y)}function Gr(t,e,n,o,i){return t=zi(t-=e,1/n,o),void 0!==i&&(t=zi(t,1/i,o)),t}function qr(t,e,[n,o,i],r,s){!function(t,e=0,n=1,o=.5,i,r=t,s=t){if(it.test(e)){e=parseFloat(e);e=Ue(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=Ue(r.min,r.max,o);t===r&&(a-=e),t.min=Gr(t.min,e,n,a,i),t.max=Gr(t.max,e,n,a,i)}(t,e[n],e[o],e[i],e.scale,r,s)}const Zr=["x","scaleX","originX"],Kr=["y","scaleY","originY"];function _r(t,e,n,o){qr(t.x,e,Zr,null==n?void 0:n.x,null==o?void 0:o.x),qr(t.y,e,Kr,null==n?void 0:n.y,null==o?void 0:o.y)}function Jr(t){return 0===t.translate&&1===t.scale}function Qr(t){return Jr(t.x)&&Jr(t.y)}function ts(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 es(t){return Ei(t.x)/Ei(t.y)}class ns{constructor(){this.members=[]}add(t){Bo(this.members,t),t.scheduleRender()}remove(t){if(Uo(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){var n;const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,e&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues,t.snapshot.isShared=!0),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,i,r;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(r=null===(o=t.resumingFrom)||void 0===o?void 0:(i=o.options).onExitComplete)||void 0===r||r.call(i)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function os(t,e,n){let o=`translate3d(${t.x.translate/e.x}px, ${t.y.translate/e.y}px, 0) `;if(o+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),i&&(o+=`rotateY(${i}deg) `)}return o+=`scale(${t.x.scale*e.x}, ${t.y.scale*e.y})`,"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"===o?"none":o}const is=(t,e)=>t.depth-e.depth;class rs{constructor(){this.children=[],this.isDirty=!1}add(t){Bo(this.children,t),this.isDirty=!0}remove(t){Uo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(is),this.isDirty=!1,this.children.forEach(t)}}const ss=["","X","Y","Z"];function as({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:i}){return class{constructor(t,n={},o=(null==e?void 0:e())){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(ms),this.nodes.forEach(fs)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=t,this.latestValues=n,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.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 rs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new No),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var o;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:i,layout:r,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),null===(o=this.parent)||void 0===o||o.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),n&&(r||i)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=Mo(o,250),P.hasAnimatedSinceResize&&(P.hasAnimatedSinceResize=!1,this.nodes.forEach(ps))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var i,r,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(r=null!==(i=this.options.transition)&&void 0!==i?i:s.getDefaultTransition())&&void 0!==r?r:Es,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=s.getProps(),p=!this.targetLayout||!ts(this.targetLayout,o)||n,m=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||m||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,m);const e={...jo(c,"layout"),onPlay:h,onComplete:d};s.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||ps(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=o})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,kn.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(gs))}willUpdate(t=!0){var e,n,o;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll()}const{layoutId:i,layout:r}=this.options;if(void 0===i&&!r)return;const s=null===(o=this.options.visualElement)||void 0===o?void 0:o.getProps().transformTemplate;this.prevTransformTemplateValue=null==s?void 0:s(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(hs);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(ws),this.potentialNodes.clear()),this.nodes.forEach(ds),this.nodes.forEach(ls),this.nodes.forEach(us),this.clearAllSnapshots(),Dn.update(),Dn.preRender(),Dn.render())}clearAllSnapshots(){this.nodes.forEach(cs),this.sharedNodes.forEach(vs)}scheduleUpdateProjection(){On.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){On.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const t=this.measure(),e=this.removeTransform(this.removeElementScroll(t));As(e),this.snapshot={measured:t,layout:e,latestValues:{}}}updateLayout(){var t;if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const e=this.measure();As(e);const n=this.layout;this.layout={measured:e,actual:this.removeElementScroll(e)},this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),null===(t=this.options.visualElement)||void 0===t||t.notify("LayoutMeasure",this.layout.actual,null==n?void 0:n.actual)}updateScroll(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=o(this.instance),this.scroll=n(this.instance))}resetTransform(){var t;if(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Qr(this.projectionDelta),o=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,r=null==o?void 0:o(this.latestValues,""),s=r!==this.prevTransformTemplateValue;e&&(n||Bi(this.latestValues)||s)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Yi(e.x,n.x),Yi(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Xr(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:i,options:r,isScrollRoot:s}=o;if(o!==this.root&&i&&r.layoutScroll){if(s){Xr(e,t);const{scroll:n}=this.root;n&&(Yi(e.x,-n.x),Yi(e.y,-n.y))}Yi(e.x,i.x),Yi(e.y,i.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Xr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];!e&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Zi(n,{x:-o.scroll.x,y:-o.scroll.y}),Bi(o.latestValues)&&Zi(n,o.latestValues)}return Bi(this.latestValues)&&Zi(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Xr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!Bi(o.latestValues))continue;Ii(o.latestValues)&&o.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};Xr(i,o.measure()),_r(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layout,i)}return Bi(this.latestValues)&&_r(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var t;const{layout:e,layoutId:n}=this.options;if(this.layout&&(e||n)){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}},Vi(this.relativeTargetOrigin,this.layout.actual,t.layout.actual),Xr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var o,i,r;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(o=this.target,i=this.relativeTarget,r=this.relativeParent.target,Pi(o.x,i.x,r.x),Pi(o.y,i.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):Xr(this.target,this.layout.actual),$i(this.target,this.targetDelta)):Xr(this.target,this.layout.actual),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}},Vi(this.relativeTargetOrigin,this.target,t.target),Xr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Ii(this.parent.latestValues)&&!Ui(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{layout:e,layoutId:n}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!e&&!n)return;const o=this.getLead();Xr(this.layoutCorrected,this.layout.actual),function(t,e,n,o=!1){var i,r;const s=n.length;if(!s)return;let a,l;e.x=e.y=1;for(let u=0;u<s;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(r=null===(i=a.instance)||void 0===i?void 0:i.style)||void 0===r?void 0:r.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Zi(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,$i(t,l)),o&&Bi(a.latestValues)&&Zi(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==o);const{target:i}=o;if(!i)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 r=this.treeScale.x,s=this.treeScale.y,a=this.projectionTransform;Ai(this.projectionDelta,this.layoutCorrected,i,this.latestValues),this.projectionTransform=os(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===r&&this.treeScale.y===s||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",i))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,o;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(o=this.getStack())||void 0===o||o.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n;const o=this.snapshot,i=(null==o?void 0:o.latestValues)||{},r={...this.latestValues},s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=null==o?void 0:o.isShared,u=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(bs));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const o=e/1e3;var h,d,p,m;ys(s.x,t.x,o),ys(s.y,t.y,o),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(Vi(a,this.layout.actual,this.relativeParent.layout.actual),h=this.relativeTarget,d=this.relativeTargetOrigin,p=a,m=o,xs(h.x,d.x,p.x,m),xs(h.y,d.y,p.y,m)),l&&(this.animationValues=r,function(t,e,n,o,i,r){var s,a,l,u;i?(t.opacity=Ue(0,null!==(s=n.opacity)&&void 0!==s?s:1,Wr(o)),t.opacityExit=Ue(null!==(a=e.opacity)&&void 0!==a?a:1,0,Hr(o))):r&&(t.opacity=Ue(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,o));for(let i=0;i<Br;i++){const r=`border${Ir[i]}Radius`;let s=zr(e,r),a=zr(n,r);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Nr(s)===Nr(a)?(t[r]=Math.max(Ue(Ur(s),Ur(a),o),0),(it.test(a)||it.test(s))&&(t[r]+="%")):t[r]=a}(e.rotate||n.rotate)&&(t.rotate=Ue(e.rotate||0,n.rotate||0,o))}(r,i,this.latestValues,o,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=o},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(kn.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=On.update(()=>{P.hasAnimatedSinceResize=!0,this.currentAnimation=Fr(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:o,latestValues:i}=t;if(e&&n&&o){if(this!==t&&this.layout&&o&&Ps(this.options.animationType,this.layout.actual,o.actual)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Ei(this.layout.actual.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const o=Ei(this.layout.actual.y);n.y.min=t.target.y.min,n.y.max=n.y.min+o}Xr(e,n),Zi(e,i),Ai(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){var n,o,i;this.sharedNodes.has(t)||this.sharedNodes.set(t,new ns);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(i=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===i?void 0:i.call(o,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const o=this.getStack();o&&o.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const n={};for(let o=0;o<ss.length;o++){const i="rotate"+ss[o];t.getStaticValue(i)&&(e=!0,n[i]=t.getStaticValue(i),t.setStaticValue(i,0))}if(e){null==t||t.render();for(const e in n)t.setStaticValue(e,n[e]);t.scheduleRender()}}getProjectionStyles(t={}){var e,n,o;const i={};if(!this.instance||this.isSVG)return i;if(!this.isVisible)return{visibility:"hidden"};i.visibility="";const r=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=te(t.pointerEvents)||"",i.transform=r?r(this.latestValues,""):"none",i;const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=te(t.pointerEvents)||""),this.hasProjected&&!Bi(this.latestValues)&&(e.transform=r?r({},""):"none",this.hasProjected=!1),e}const a=s.animationValues||s.latestValues;this.applyTransformsToTarget(),i.transform=os(this.projectionDeltaWithTransform,this.treeScale,a),r&&(i.transform=r(a,i.transform));const{x:l,y:u}=this.projectionDelta;i.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,s.animationValues?i.opacity=s===this?null!==(o=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==o?o:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:i.opacity=s===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in F){if(void 0===a[t])continue;const{correct:e,applyTo:n}=F[t],o=e(a[t],s);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=o}else i[t]=o}return this.options.layoutId&&(i.pointerEvents=s===this?te(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(hs),this.root.sharedNodes.clear()}}}function ls(t){t.updateLayout()}function us(t){var e,n,o;const i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout,{animationType:o}=t.options;"size"===o?Di(t=>{const n=i.isShared?i.measured[t]:i.layout[t],o=Ei(n);n.min=e[t].min,n.max=n.min+o}):Ps(o,i.layout,e)&&Di(t=>{const n=i.isShared?i.measured[t]:i.layout[t],o=Ei(e[t]);n.max=n.min+o});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Ai(r,e,i.layout);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};i.isShared?Ai(s,t.applyTransform(n,!0),i.measured):Ai(s,e,i.layout);const a=!Qr(r);let l=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:t,layout:o}=n;if(t&&o){const n={x:{min:0,max:0},y:{min:0,max:0}};Vi(n,i.layout,t.layout);const r={x:{min:0,max:0},y:{min:0,max:0}};Vi(r,e,o.actual),ts(n,r)||(l=!0)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:s,layoutDelta:r,hasLayoutChanged:a,hasRelativeTargetChanged:l})}else t.isLead()&&(null===(o=(n=t.options).onExitComplete)||void 0===o||o.call(n));t.options.transition=void 0}function cs(t){t.clearSnapshot()}function hs(t){t.clearMeasurements()}function ds(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ps(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function ms(t){t.resolveTargetDelta()}function fs(t){t.calcProjection()}function gs(t){t.resetRotation()}function vs(t){t.removeLeadSnapshot()}function ys(t,e,n){t.translate=Ue(e.translate,0,n),t.scale=Ue(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function xs(t,e,n,o){t.min=Ue(e.min,n.min,o),t.max=Ue(e.max,n.max,o)}function bs(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Es={duration:.45,ease:[.4,0,.1,1]};function ws(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 o=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);o&&t.mount(o,!0)}function Ss(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function As(t){Ss(t.x),Ss(t.y)}function Ps(t,e,n){return"position"===t||"preserve-aspect"===t&&!function(t,e,n=.1){return Xn(t,e)<=n}(es(e),es(n),.2)}const Ts=as({attachResizeListener:(t,e)=>ae(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Vs={current:void 0},Cs=as({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Vs.current){const t=new Ts(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Vs.current=t}return Vs.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ms={...pi,...ho,...tr,...jr},Rs=k((t,e)=>re(t,e,Ms,Mr,Cs));const Ls=k(re);function Os(){const t=e.useRef(!1);return h(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function ks(){const t=Os(),[n,o]=e.useState(0),i=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>On.postRender(i),[i]),n]}class Ds extends r.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function js({children:t,isPresent:n}){const o=e.useId(),i=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:r,left:a}=s.current;if(n||!i.current||!t||!e)return;i.current.dataset.motionPopId=o;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n top: ${r}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[n]),r.createElement(Ds,{isPresent:n,childRef:i,sizeRef:s},r.cloneElement(t,{ref:i}))}const Fs=({children:t,initial:n,isPresent:o,onExitComplete:i,custom:s,presenceAffectsLayout:a,mode:l})=>{const c=A(Is),h=e.useId(),d=e.useMemo(()=>({id:h,initial:n,isPresent:o,custom:s,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;i&&i()},register:t=>(c.set(t,!1),()=>c.delete(t))}),a?void 0:[o]);return e.useMemo(()=>{c.forEach((t,e)=>c.set(e,!1))},[o]),r.useEffect(()=>{!o&&!c.size&&i&&i()},[o]),"popLayout"===l&&(t=r.createElement(js,{isPresent:o},t)),r.createElement(u.Provider,{value:d},t)};function Is(){return new Map}const Bs=t=>t.key||"";const Us=e.createContext(null),Ns=t=>!t.isLayoutDirty&&t.willUpdate(!1);function zs(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Ns);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var i;t.delete(o),null===(i=e.get(o))||void 0===i||i(),e.delete(o),n()},dirty:n}}const Ws=t=>!0===t,Hs=({children:t,id:n,inheritId:o,inherit:i=!0})=>{void 0!==o&&(i=o);const s=e.useContext(V),a=e.useContext(Us),[l,u]=ks(),c=e.useRef(null),h=s.id||a;null===c.current&&((t=>Ws(!0===t)||"id"===t)(i)&&h&&(n=n?h+"-"+n:h),c.current={id:n,group:Ws(i)&&s.group||zs()});const d=e.useMemo(()=>({...c.current,forceRender:l}),[u]);return r.createElement(V.Provider,{value:d},t)};let $s=0;function Ys(t){return"function"==typeof t}const Xs=e.createContext(null);const Gs=e.forwardRef((function({children:t,as:n="ul",axis:o="y",onReorder:i,values:s,...a},l){const u=A(()=>Rs(n)),c=[],h=e.useRef(!1),d={axis:o,registerItem:(t,e)=>{e&&-1===c.findIndex(e=>t===e.value)&&(c.push({value:t,layout:e[o]}),c.sort(Zs))},updateOrder:(t,e,n)=>{if(h.current)return;const o=function(t,e,n,o){if(!o)return t;const i=t.findIndex(t=>t.value===e);if(-1===i)return t;const r=o>0?1:-1,s=t[i+r];if(!s)return t;const a=t[i],l=s.layout,u=Ue(l.min,l.max,.5);return 1===r&&a.layout.max+n>u||-1===r&&a.layout.min+n<u?function([...t],e,n){const o=e<0?t.length+e:e;if(o>=0&&o<t.length){const o=n<0?t.length+n:n,[i]=t.splice(e,1);t.splice(o,0,i)}return t}(t,i,i+r):t}(c,t,e,n);c!==o&&(h.current=!0,i(o.map(qs).filter(t=>-1!==s.indexOf(t))))}};return e.useEffect(()=>{h.current=!1}),r.createElement(u,{...a,ref:l},r.createElement(Xs.Provider,{value:d},t))}));function qs(t){return t.value}function Zs(t,e){return t.layout.min-e.layout.min}function Ks(t){const n=A(()=>Wo(t)),{isStatic:o}=e.useContext(s);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.onChange(o),[])}return n}function _s(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],i=t[1+n],r=t[2+n],s=t[3+n],a=nn(i,r,{mixer:(l=r[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0),...s});var l;return e?a(o):a}function Js(t,e){const n=Ks(e()),o=()=>n.set(e());return o(),function(t,e,n){h(()=>{const o=t.map(t=>t.onChange(e));return()=>{o.forEach(t=>t()),n()}})}(t,()=>On.update(o,!1,!0),()=>kn.update(o)),n}function Qs(t,e,n,o){const i="function"==typeof e?e:_s(e,n,o);return Array.isArray(t)?ta(t,i):ta([t],([t])=>i(t))}function ta(t,e){const n=A(()=>[]);return Js(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function ea(t,e=0){return z(t)?t:Ks(e)}const na={Group:Gs,Item:e.forwardRef((function({children:t,style:n={},value:o,as:i="li",onDrag:s,layout:a=!0,...l},u){const c=A(()=>Rs(i)),h=e.useContext(Xs),d={x:ea(n.x),y:ea(n.y)},p=Qs([d.x,d.y],([t,e])=>t||e?1:"unset"),m=e.useRef(null),{axis:f,registerItem:g,updateOrder:v}=h;return e.useEffect(()=>{g(o,m.current)},[h]),r.createElement(c,{drag:f,...l,dragSnapToOrigin:!0,style:{...n,x:d.x,y:d.y,zIndex:p},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[f]&&v(o,d[f].get(),n[f]),s&&s(t,e)},onLayoutMeasure:t=>{m.current=t},ref:u},t)}))},oa={renderer:Mr,...pi,...ho},ia={...oa,...tr,...jr,projectionNodeConstructor:Cs};const ra=t=>"number"==typeof t;function sa(t,e){return(t=>Array.isArray(t)&&!ra(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const aa=(t,e,n)=>-n*t+n*e+t,la=t=>t,ua=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function ca(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const i=ua(0,e,o);t.push(aa(n,1,i))}}function ha(t){const e=[0];return ca(e,t-1),e}function da(t,e=ha(t.length),n=la){const o=t.length,i=o-e.length;return i>0&&ca(e,i),i=>{let r=0;for(;r<o-2&&!(i<e[r+1]);r++);let s=(a=0,l=1,u=ua(e[r],e[r+1],i),Math.min(Math.max(u,a),l));var a,l,u;return s=sa(n,r)(s),aa(t[r],t[r+1],s)}}const pa=t=>"function"==typeof t,ma=t=>"string"==typeof t;function fa(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const ga={any:0,all:1};const va=new WeakMap;let ya;function xa({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=va.get(t))||void 0===o||o.forEach(o=>{o({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function ba(t){t.forEach(xa)}function Ea(t,e){ya||"undefined"!=typeof ResizeObserver&&(ya=new ResizeObserver(ba));const n=fa(t);return n.forEach(t=>{let n=va.get(t);n||(n=new Set,va.set(t,n)),n.add(e),null==ya||ya.observe(t)}),()=>{n.forEach(t=>{const n=va.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==ya||ya.unobserve(t)})}}const wa=new Set;let Sa;function Aa(t){return wa.add(t),Sa||(Sa=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};wa.forEach(t=>t(e))},window.addEventListener("resize",Sa)),()=>{wa.delete(t),!wa.size&&Sa&&(Sa=void 0)}}const Pa={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Ta(t,e,n,o){const i=n[e],{length:r,position:s}=Pa[e],a=i.current,l=n.time;i.current=t["scroll"+s],i.scrollLength=t["scroll"+r]-t["client"+r],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=ua(0,i.scrollLength,i.current);const u=o-l;var c,h;i.velocity=u>50?0:(c=i.current-a,(h=u)?c*(1e3/h):0)}const Va={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Ca={start:0,center:.5,end:1};function Ma(t,e,n=0){let o=0;if(void 0!==Ca[t]&&(t=Ca[t]),ma(t)){const e=parseFloat(t);t.endsWith("px")?o=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?o=e/100*document.documentElement.clientWidth:t.endsWith("vh")?o=e/100*document.documentElement.clientHeight:t=e}return ra(t)&&(o=e*t),n+o}const Ra=[0,0];function La(t,e,n,o){let i=Array.isArray(t)?t:Ra,r=0,s=0;return ra(t)?i=[t,t]:ma(t)&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,Ca[t]?t:"0"]),r=Ma(i[0],n,o),s=Ma(i[1],e),r-s}const Oa={x:0,y:0};function ka(t,e,n){let{offset:o=Va.All}=n;const{target:i=t,axis:r="y"}=n,s="y"===r?"height":"width",a=i!==t?function(t,e){let n={x:0,y:0},o=t;for(;o&&o!==e;)if(o instanceof HTMLElement)n.x+=o.offsetLeft,n.y+=o.offsetTop,o=o.offsetParent;else if(o instanceof SVGGraphicsElement&&"getBBox"in o){const{top:t,left:e}=o.getBBox();for(n.x+=e,n.y+=t;o&&"svg"!==o.tagName;)o=o.parentNode}return n}(i,t):Oa,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:i.clientWidth,height:i.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=o.length;for(let t=0;t<h;t++){const n=La(o[t],u[s],l[s],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=da(ha(h),e[r].offset),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=e[r].interpolate(e[r].current)}function Da(t,e,n,o={}){const i=o.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let o=e;for(;o&&o!=t;)n.x.targetOffset+=o.offsetLeft,n.y.targetOffset+=o.offsetTop,o=o.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,o.target,n),update:e=>{!function(t,e,n){Ta(t,"x",e,n),Ta(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&ka(t,n,o)},notify:pa(e)?()=>e(n):ja(e,n[i])}}function ja(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=la),t.updateDuration(1);else{const i={duration:1e3};e||(i.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,i)}}),()=>{t.currentTime=e.progress}}const Fa=new WeakMap,Ia=new WeakMap,Ba=new WeakMap,Ua=t=>t===document.documentElement?window:t;function Na(t,e={}){var{container:n=document.documentElement}=e,o=Me(e,["container"]);let i=Ba.get(n);i||(i=new Set,Ba.set(n,i));const r=Da(n,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},o);if(i.add(r),!Fa.has(n)){const t=()=>{const t=performance.now();for(const t of i)t.measure();for(const e of i)e.update(t);for(const t of i)t.notify()};Fa.set(n,t);const e=Ua(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&Ia.set(n,function(t,e){return pa(t)?Aa(t):Ea(t,e)}(n,t)),e.addEventListener("scroll",t,{passive:!0})}const s=Fa.get(n),a=requestAnimationFrame(s);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(a);const o=Ba.get(n);if(!o)return;if(o.delete(r),o.size)return;const i=Fa.get(n);Fa.delete(n),i&&(Ua(n).removeEventListener("scroll",i),null===(e=Ia.get(n))||void 0===e||e(),window.removeEventListener("resize",i))}}const za=()=>({scrollX:Wo(0),scrollY:Wo(0),scrollXProgress:Wo(0),scrollYProgress:Wo(0)});function Wa({container:t,target:n,layoutEffect:o=!0,...i}={}){const r=A(za);return(o?h:e.useEffect)(()=>Na(({x:t,y:e})=>{r.scrollX.set(t.current),r.scrollXProgress.set(t.progress),r.scrollY.set(e.current),r.scrollYProgress.set(e.progress)},{...i,container:(null==t?void 0:t.current)||void 0,target:(null==n?void 0:n.current)||void 0}),[]),r}function Ha(t){const n=e.useRef(0),{isStatic:o}=e.useContext(s);e.useEffect(()=>{if(o)return;const e=({timestamp:e,delta:o})=>{n.current||(n.current=e),t(e-n.current,o)};return On.update(e,!0),()=>kn.update(e)},[t])}class $a extends zo{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;U.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||Y(t)||"willChange"===t||(e=Yt(t)),e&&(Bo(this.members,e),this.update())}remove(t){U.has(t)?(this.transforms.delete(t),this.transforms.size||Uo(this.members,"transform")):Uo(this.members,Yt(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Ya(){!yr.current&&xr();const[t]=e.useState(vr.current);return t}function Xa(){let t=!1;const e=[],n=new Set,o={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(o,i){if(t){const t=[];return n.forEach(e=>{t.push(ni(e,o,{transitionOverride:i}))}),Promise.all(t)}return new Promise(t=>{e.push({animation:[o,i],resolve:t})})},set:t=>n.forEach(e=>{!function(t,e){Array.isArray(e)?_o(t,e):"string"==typeof e?_o(t,[e]):Ko(t,e)}(e,t)}),stop(){n.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(t=!0,e.forEach(({animation:t,resolve:e})=>{o.start(...t).then(e)}),()=>{t=!1,o.stop()})};return o}function Ga(){const t=A(Xa);return e.useEffect(t.mount,[]),t}const qa=Ga;class Za{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}}const Ka=()=>new Za;function _a(t){return null!==t&&"object"==typeof t&&R in t}function Ja(){return Qa}function Qa(t){Vs.current&&(Vs.current.isUpdating=!1,Vs.current.blockUpdate(),t&&t())}const tl=()=>({});class el extends Sr{build(){}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n}){return Jo(this,n,ti(n,t||{},this)),{transition:t,transitionEnd:e,...n}}}const nl=ee({scrapeMotionValuesFromProps:tl,createRenderState:tl});const ol=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:i,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"})=>{s&&(l="wait",eo(!1,"Replace exitBeforeEnter with mode='wait'"));let[u]=ks();const c=e.useContext(V).forceRender;c&&(u=c);const d=Os(),p=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let m=p;const f=new Set,g=e.useRef(m),v=e.useRef(new Map).current,y=e.useRef(!0);if(h(()=>{y.current=!1,function(t,e){t.forEach(t=>{const n=Bs(t);e.set(n,t)})}(p,v),g.current=m}),Ce(()=>{y.current=!0,v.clear(),f.clear()}),y.current)return r.createElement(r.Fragment,null,m.map(t=>r.createElement(Fs,{key:Bs(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:a,mode:l},t)));m=[...m];const x=g.current.map(Bs),b=p.map(Bs),E=x.length;for(let t=0;t<E;t++){const e=x[t];-1===b.indexOf(e)&&f.add(e)}return"wait"===l&&f.size&&(m=[]),f.forEach(t=>{if(-1!==b.indexOf(t))return;const e=v.get(t);if(!e)return;const o=x.indexOf(t);m.splice(o,0,r.createElement(Fs,{key:Bs(e),isPresent:!1,onExitComplete:()=>{v.delete(t),f.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!f.size){if(g.current=p,!1===d.current)return;u(),i&&i()}},custom:n,presenceAffectsLayout:a,mode:l},e))}),m=m.map(t=>{const e=t.key;return f.has(e)?t:r.createElement(Fs,{key:Bs(t),isPresent:!0,presenceAffectsLayout:a,mode:l},t)}),"production"!==Qn&&"wait"===l&&m.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),r.createElement(r.Fragment,null,f.size?m:m.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(r.useEffect(()=>{},[]),r.createElement(Hs,{id:A(()=>"asl-"+$s++)},t)),t.DeprecatedLayoutGroupContext=Us,t.DragControls=Za,t.FlatTree=rs,t.LayoutGroup=Hs,t.LayoutGroupContext=V,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,i]=e.useState(!Ys(n)),s=e.useRef(void 0);if(!Ys(n)){const{renderer:t,...e}=n;s.current=t,S(e)}return e.useEffect(()=>{Ys(n)&&n().then(({renderer:t,...e})=>{S(e),s.current=t,i(!0)})},[]),r.createElement(d.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function({children:t,isValidProp:n,...o}){n&&Ft(n),(o={...e.useContext(s),...o}).isStatic=A(()=>o.isStatic);const i=e.useMemo(()=>o,[JSON.stringify(o.transition),o.transformPagePoint,o.reducedMotion]);return r.createElement(s.Provider,{value:i},t)},t.MotionConfigContext=s,t.MotionContext=a,t.MotionValue=zo,t.PresenceContext=u,t.Reorder=na,t.SwitchLayoutGroupContext=M,t.VisualElement=Sr,t.addPointerEvent=xe,t.addScaleCorrector=I,t.animate=Fr,t.animateVisualElement=ni,t.animationControls=Xa,t.animations=pi,t.buildTransform=$,t.calcLength=Ei,t.checkTargetForNewValues=Jo,t.createBox=ki,t.createDomMotionComponent=function(t){return L(re(t,{forwardMotionProps:!1},Ms,Mr,Cs))},t.createMotionComponent=L,t.delay=Mo,t.domAnimation=oa,t.domMax=ia,t.filterProps=It,t.isBrowser=c,t.isDragActive=Pe,t.isMotionComponent=_a,t.isMotionValue=z,t.isValidMotionProp=Dt,t.m=Ls,t.makeUseVisualState=ee,t.motion=Rs,t.motionValue=Wo,t.resolveMotionValue=te,t.transform=_s,t.unwrapMotionComponent=function(t){if(_a(t))return t[R]},t.useAnimation=qa,t.useAnimationControls=Ga,t.useAnimationFrame=Ha,t.useCycle=function(...t){const n=e.useRef(0),[o,i]=e.useState(t[n.current]);return[o,e.useCallback(e=>{n.current="number"!=typeof e?((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,n.current+1):e,i(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),i=nl({},!1),r=A(()=>new el({props:{},visualState:i},{initialState:t}));return e.useEffect(()=>(r.mount({}),()=>r.unmount()),[r]),e.useEffect(()=>{r.setProps({onUpdate:t=>{o({...t})}})},[o,r]),[n,A(()=>t=>ni(r,t))]},t.useDeprecatedInvertedScale=function(t){let e=Ks(1),n=Ks(1);const o=l();return t?(e=t.scaleX||e,n=t.scaleY||n):o&&(e=o.getValue("scaleX",1),n=o.getValue("scaleY",1)),{scaleX:Qs(e,ol),scaleY:Qs(n,ol)}},t.useDomEvent=le,t.useDragControls=function(){return A(Ka)},t.useElementScroll=function(t){return eo(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),Wa({container:t})},t.useForceUpdate=ks,t.useInView=function(t,{root:n,margin:o,amount:i,once:r=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||r&&s)return;const e={root:n&&n.current||void 0,margin:o,amount:"some"===i?"any":i};return function(t,e,{root:n,margin:o,amount:i="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const r=fa(t),s=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=s.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);pa(n)?s.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),s.delete(t.target))})},{root:n,rootMargin:o,threshold:"number"==typeof i?i:ga[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),r?void 0:()=>a(!1)),e)},[n,t,o,r]),s},t.useInstantLayoutTransition=Ja,t.useInstantTransition=function(){const[t,n]=ks(),o=Ja();return e.useEffect(()=>{On.postRender(()=>On.postRender(()=>Co.current=!1))},[n]),e=>{o(()=>{Co.current=!0,t(),e()})}},t.useIsPresent=function(){return null===(t=e.useContext(u))||t.isPresent;var t},t.useIsomorphicLayoutEffect=h,t.useMotionTemplate=function(t,...e){const n=t.length;return Js(e,(function(){let o="";for(let i=0;i<n;i++){o+=t[i];e[i]&&(o+=e[i].get())}return o}))},t.useMotionValue=Ks,t.usePresence=po,t.useReducedMotion=Ya,t.useReducedMotionConfig=function(){const t=Ya(),{reducedMotion:n}=e.useContext(s);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return r.useCallback(()=>{const t=Vs.current;t&&t.resetTree()},[])},t.useScroll=Wa,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(s),i=e.useRef(null),r=Ks(z(t)?t.get():t);return e.useMemo(()=>r.attach((t,e)=>o?e(t):(i.current&&i.current.stop(),i.current=zn({from:r.get(),to:t,velocity:r.getVelocity(),...n,onUpdate:e}),r.get())),[JSON.stringify(n)]),function(t,e){h(()=>{if(z(t))return t.onChange(e)},[e])}(t,t=>r.set(parseFloat(t))),r},t.useTime=function(){const t=Ks(0);return Ha(e=>t.set(e)),t},t.useTransform=Qs,t.useUnmountEffect=Ce,t.useVelocity=function(t){const n=Ks(t.getVelocity());return e.useEffect(()=>t.velocityUpdateSubscribers.add(t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return eo(!1,"useViewportScroll is deprecated. Convert to useScroll()."),Wa()},t.useVisualElementContext=l,t.useWillChange=function(){return A(()=>new $a("auto"))},t.wrapHandler=fe,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(e),r=o(e);const s=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),a=e.createContext({});function l(){return e.useContext(a).visualElement}const u=e.createContext(null),c="undefined"!=typeof document,h=c?e.useLayoutEffect:e.useEffect,d=e.createContext({strict:!1});function p(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function m(t){return"string"==typeof t||Array.isArray(t)}function f(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function v(t){return f(t.animate)||g.some(e=>m(t[e]))}function y(t){return Boolean(v(t)||t.variants)}function x(t){const{initial:n,animate:o}=function(t,e){if(v(t)){const{initial:e,animate:n}=t;return{initial:!1===e||m(e)?e:void 0,animate:m(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:o}),[b(n),b(o)])}function b(t){return Array.isArray(t)?t.join(" "):t}const E=t=>({isEnabled:e=>t.some(t=>!!e[t])}),w={measureLayout:E(["layout","layoutId","drag"]),animation:E(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:E(["exit"]),drag:E(["drag","dragControls"]),focus:E(["whileFocus"]),hover:E(["whileHover","onHoverStart","onHoverEnd"]),tap:E(["whileTap","onTap","onTapStart","onTapCancel"]),pan:E(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:E(["whileInView","onViewportEnter","onViewportLeave"])};function S(t){for(const e in t)"projectionNodeConstructor"===e?w.projectionNodeConstructor=t[e]:w[e].Component=t[e]}function P(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const A={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let T=1;const V=e.createContext({});class C extends i.default.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const M=e.createContext({}),R=Symbol.for("motionComponentSymbol");function L({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:i,useVisualState:m,Component:f}){t&&S(t);const g=e.forwardRef((function(g,v){const y={...e.useContext(s),...g,layoutId:O(g)},{isStatic:b}=y;let E=null;const S=x(g),V=b?void 0:P(()=>{if(A.hasEverUpdated)return T++}),R=m(g,b);if(!b&&c){S.visualElement=function(t,n,o,i){const r=l(),a=e.useContext(d),c=e.useContext(u),p=e.useContext(s).reducedMotion,m=e.useRef();i=i||a.renderer,!m.current&&i&&(m.current=i(t,{visualState:n,parent:r,props:o,presenceId:c?c.id:void 0,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:p}));const f=m.current;return h(()=>{f&&f.render()}),e.useEffect(()=>{f&&f.animationState&&f.animationState.animateChanges()}),h(()=>()=>f&&f.notify("Unmount"),[]),f}(f,R,y,n);const i=e.useContext(d).strict,r=e.useContext(M);S.visualElement&&(E=S.visualElement.loadFeatures(y,i,t,V,o||w.projectionNodeConstructor,r))}return r.createElement(C,{visualElement:S.visualElement,props:y},E,r.createElement(a.Provider,{value:S},i(f,g,V,function(t,n,o){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):p(o)&&(o.current=e))},[n])}(R,S.visualElement,v),R,b,S.visualElement)))}));return g[R]=f,g}function O({layoutId:t}){const n=e.useContext(V).id;return n&&void 0!==t?n+"-"+t:t}function k(t){function e(e,n={}){return L(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const D=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function B(t){return"string"==typeof t&&!t.includes("-")&&!!(D.indexOf(t)>-1||/[A-Z]/.test(t))}const j={};function F(t){Object.assign(j,t)}const I=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=new Set(I);function N(t,{layout:e,layoutId:n}){return U.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!j[t]||"opacity"===t)}const z=t=>!!(null==t?void 0:t.getVelocity),W={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H=(t,e)=>I.indexOf(t)-I.indexOf(e);function $({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},i,r){let s="";e.sort(H);for(const n of e)s+=`${W[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(t,i?"":s):o&&i&&(s="none"),s}function Y(t){return t.startsWith("--")}const X=(t,e)=>e&&"number"==typeof t?e.transform(t):t,G=(t,e)=>n=>Math.max(Math.min(n,e),t),q=t=>t%1?Number(t.toFixed(5)):t,Z=/(-)?([\d]*\.?[\d])+/g,K=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,_=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function J(t){return"string"==typeof t}const Q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},tt=Object.assign(Object.assign({},Q),{transform:G(0,1)}),et=Object.assign(Object.assign({},Q),{default:1}),nt=t=>({test:e=>J(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=nt("deg"),it=nt("%"),rt=nt("px"),st=nt("vh"),at=nt("vw"),lt=Object.assign(Object.assign({},it),{parse:t=>it.parse(t)/100,transform:t=>it.transform(100*t)}),ut=(t,e)=>n=>Boolean(J(n)&&_.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ct=(t,e,n)=>o=>{if(!J(o))return o;const[i,r,s,a]=o.match(Z);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ht={test:ut("hsl","hue"),parse:ct("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+it.transform(q(e))+", "+it.transform(q(n))+", "+q(tt.transform(o))+")"},dt=G(0,255),pt=Object.assign(Object.assign({},Q),{transform:t=>Math.round(dt(t))}),mt={test:ut("rgb","red"),parse:ct("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+pt.transform(t)+", "+pt.transform(e)+", "+pt.transform(n)+", "+q(tt.transform(o))+")"};const ft={test:ut("#"),parse:function(t){let e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:mt.transform},gt={test:t=>mt.test(t)||ft.test(t)||ht.test(t),parse:t=>mt.test(t)?mt.parse(t):ht.test(t)?ht.parse(t):ft.parse(t),transform:t=>J(t)?t:t.hasOwnProperty("red")?mt.transform(t):ht.transform(t)};function vt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const o=t.match(K);o&&(n=o.length,t=t.replace(K,"${c}"),e.push(...o.map(gt.parse)));const i=t.match(Z);return i&&(t=t.replace(Z,"${n}"),e.push(...i.map(Q.parse))),{values:e,numColors:n,tokenised:t}}function yt(t){return vt(t).values}function xt(t){const{values:e,numColors:n,tokenised:o}=vt(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=e.replace(o<n?"${c}":"${n}",o<n?gt.transform(t[o]):q(t[o]));return e}}const bt=t=>"number"==typeof t?0:t;const Et={test:function(t){var e,n,o,i;return isNaN(t)&&J(t)&&(null!==(n=null===(e=t.match(Z))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(K))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:yt,createTransformer:xt,getAnimatableNone:function(t){const e=yt(t);return xt(t)(e.map(bt))}},wt=new Set(["brightness","contrast","saturate","opacity"]);function St(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(Z)||[];if(!o)return t;const i=n.replace(o,"");let r=wt.has(e)?1:0;return o!==n&&(r*=100),e+"("+r+i+")"}const Pt=/([a-z-]*)\(.*?\)/g,At=Object.assign(Object.assign({},Et),{getAnimatableNone:t=>{const e=t.match(Pt);return e?e.map(St).join(" "):t}}),Tt={...Q,transform:Math.round},Vt={borderWidth:rt,borderTopWidth:rt,borderRightWidth:rt,borderBottomWidth:rt,borderLeftWidth:rt,borderRadius:rt,radius:rt,borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomRightRadius:rt,borderBottomLeftRadius:rt,width:rt,maxWidth:rt,height:rt,maxHeight:rt,size:rt,top:rt,right:rt,bottom:rt,left:rt,padding:rt,paddingTop:rt,paddingRight:rt,paddingBottom:rt,paddingLeft:rt,margin:rt,marginTop:rt,marginRight:rt,marginBottom:rt,marginLeft:rt,rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:et,scaleX:et,scaleY:et,scaleZ:et,skew:ot,skewX:ot,skewY:ot,distance:rt,translateX:rt,translateY:rt,translateZ:rt,x:rt,y:rt,z:rt,perspective:rt,transformPerspective:rt,opacity:tt,originX:lt,originY:lt,originZ:rt,zIndex:Tt,fillOpacity:tt,strokeOpacity:tt,numOctaves:Tt};function Ct(t,e,n,o){const{style:i,vars:r,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let u=!1,c=!1,h=!0;for(const t in e){const n=e[t];if(Y(t)){r[t]=n;continue}const o=Vt[t],d=X(n,o);if(U.has(t)){if(u=!0,s[t]=d,a.push(t),!h)continue;n!==(o.default||0)&&(h=!1)}else t.startsWith("origin")?(c=!0,l[t]=d):i[t]=d}if(e.transform||(u||o?i.transform=$(t,n,h,o):i.transform&&(i.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;i.transformOrigin=`${t} ${e} ${n}`}}const Mt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Rt(t,e,n){for(const o in e)z(e[o])||N(o,n)||(t[o]=e[o])}function Lt(t,n,o){const i={};return Rt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return Ct(e,n,{enableHardwareAcceleration:!o},t),Object.assign({},e.vars,e.style)},[n])}(t,n,o)),t.transformValues?t.transformValues(i):i}function Ot(t,e,n){const o={},i=Lt(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}const kt=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function Dt(t){return kt.has(t)}let Bt=t=>!Dt(t);function jt(t){t&&(Bt=e=>e.startsWith("on")?!Dt(e):t(e))}try{jt(require("@emotion/is-prop-valid").default)}catch(t){}function Ft(t,e,n){const o={};for(const i in t)(Bt(i)||!0===n&&Dt(i)||!e&&!Dt(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}function It(t,e,n){return"string"==typeof t?t:rt.transform(e+n*t)}const Ut={offset:"stroke-dashoffset",array:"stroke-dasharray"},Nt={offset:"strokeDashoffset",array:"strokeDasharray"};function zt(t,{attrX:e,attrY:n,originX:o,originY:i,pathLength:r,pathSpacing:s=1,pathOffset:a=0,...l},u,c){Ct(t,l,u,c),t.attrs=t.style,t.style={};const{attrs:h,style:d,dimensions:p}=t;h.transform&&(p&&(d.transform=h.transform),delete h.transform),p&&(void 0!==o||void 0!==i||d.transform)&&(d.transformOrigin=function(t,e,n){return`${It(e,t.x,t.width)} ${It(n,t.y,t.height)}`}(p,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==r&&function(t,e,n=1,o=0,i=!0){t.pathLength=1;const r=i?Ut:Nt;t[r.offset]=rt.transform(-o);const s=rt.transform(e),a=rt.transform(n);t[r.array]=`${s} ${a}`}(h,r,s,a,!1)}const Wt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function Ht(t,n){const o=e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return zt(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Rt(e,t.style,t),o.style={...e,...o.style}}return o}function $t(t=!1){return(n,o,i,r,{latestValues:s},a)=>{const l=(B(n)?Ht:Ot)(o,s,a),u={...Ft(o,"string"==typeof n,t),...l,ref:r};return i&&(u["data-projection-id"]=i),e.createElement(n,u)}}const Yt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Xt(t,{style:e,vars:n},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Gt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function qt(t,e,n,o){Xt(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Gt.has(n)?n:Yt(n),e.attrs[n])}function Zt(t){const{style:e}=t,n={};for(const o in e)(z(e[o])||N(o,t))&&(n[o]=e[o]);return n}function Kt(t){const e=Zt(t);for(const n in t)if(z(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function _t(t,e,n,o={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),e}const Jt=t=>Array.isArray(t),Qt=t=>Jt(t)?t[t.length-1]||0:t;function te(t){const e=z(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const ee=t=>(n,o)=>{const i=e.useContext(a),r=e.useContext(u),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,i,r){const s={latestValues:ne(o,i,r,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,i,r);return o?s():P(s)};function ne(t,e,n,o){const i={},r=o(t);for(const t in r)i[t]=te(r[t]);let{initial:s,animate:a}=t;const l=v(t),u=y(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const h=c?a:s;if(h&&"boolean"!=typeof h&&!f(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=_t(t,e);if(!n)return;const{transitionEnd:o,transition:r,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(i[t]=e)}for(const t in o)i[t]=o[t]})}return i}const oe={useVisualState:ee({scrapeMotionValuesFromProps:Kt,createRenderState:Wt,onMount:(t,e,{renderState:n,latestValues:o})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}zt(n,o,{enableHardwareAcceleration:!1},t.transformTemplate),qt(e,n)}})},ie={useVisualState:ee({scrapeMotionValuesFromProps:Zt,createRenderState:Mt})};function re(t,{forwardMotionProps:e=!1},n,o,i){return{...B(t)?oe:ie,preloadedFeatures:n,useRender:$t(e),createVisualElement:o,projectionNodeConstructor:i,Component:t}}var se;function ae(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function le(t,n,o,i){e.useEffect(()=>{const e=t.current;if(o&&e)return ae(e,n,o,i)},[t,n,o,i])}function ue(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function ce(t){return!!t.touches}t.AnimationType=void 0,(se=t.AnimationType||(t.AnimationType={})).Animate="animate",se.Hover="whileHover",se.Tap="whileTap",se.Drag="whileDrag",se.Focus="whileFocus",se.InView="whileInView",se.Exit="exit";const he={pageX:0,pageY:0};function de(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||he;return{x:n[e+"X"],y:n[e+"Y"]}}function pe(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function me(t,e="page"){return{point:ce(t)?de(t,e):pe(t,e)}}const fe=(t,e=!1)=>{const n=e=>t(e,me(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},ge={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ve={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function ye(t){return c&&null===window.onpointerdown?t:c&&null===window.ontouchstart?ve[t]:c&&null===window.onmousedown?ge[t]:t}function xe(t,e,n,o){return ae(t,ye(e),fe(n,"pointerdown"===e),o)}function be(t,e,n,o){return le(t,ye(e),n&&fe(n,"pointerdown"===e),o)}function Ee(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const we=Ee("dragHorizontal"),Se=Ee("dragVertical");function Pe(t){let e=!1;if("y"===t)e=Se();else if("x"===t)e=we();else{const t=we(),n=Se();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Ae(){const t=Pe(!0);return!t||(t(),!1)}function Te(e,n,o){return(i,r)=>{ue(i)&&!Ae()&&(e.animationState&&e.animationState.setActive(t.AnimationType.Hover,n),o&&o(i,r))}}const Ve=(t,e)=>!!e&&(t===e||Ve(t,e.parentElement));function Ce(t){return e.useEffect(()=>()=>t(),[])}function Me(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}const Re=(t,e,n)=>Math.min(Math.max(n,t),e);function Le({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let i,r,s=1-e;s=Re(.05,1,s),t=Re(.01,10,t/1e3),s<1?(i=e=>{const o=e*s,i=o*t;return.001-(o-n)/Oe(e,s)*Math.exp(-i)},r=e=>{const o=e*s*t,r=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=Oe(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let o=n;for(let n=1;n<12;n++)o-=t(o)/e(o);return o}(i,r,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*o;return{stiffness:e,damping:2*s*Math.sqrt(o*e),duration:t}}}function Oe(t,e){return t*Math.sqrt(1-e*e)}const ke=["duration","bounce"],De=["stiffness","damping","mass"];function Be(t,e){return e.some(e=>void 0!==t[e])}function je(t){var{from:e=0,to:n=1,restSpeed:o=2,restDelta:i}=t,r=Me(t,["from","to","restSpeed","restDelta"]);const s={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Be(t,De)&&Be(t,ke)){const n=Le(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(r),p=Fe,m=Fe;function f(){const t=c?-c/1e3:0,o=n-e,r=l/(2*Math.sqrt(a*u)),s=Math.sqrt(a/u)/1e3;if(void 0===i&&(i=Math.min(Math.abs(n-e)/100,.4)),r<1){const e=Oe(s,r);p=i=>{const a=Math.exp(-r*s*i);return n-a*((t+r*s*o)/e*Math.sin(e*i)+o*Math.cos(e*i))},m=n=>{const i=Math.exp(-r*s*n);return r*s*i*(Math.sin(e*n)*(t+r*s*o)/e+o*Math.cos(e*n))-i*(Math.cos(e*n)*(t+r*s*o)-e*o*Math.sin(e*n))}}else if(1===r)p=e=>n-Math.exp(-s*e)*(o+(t+s*o)*e);else{const e=s*Math.sqrt(r*r-1);p=i=>{const a=Math.exp(-r*s*i),l=Math.min(e*i,300);return n-a*((t+r*s*o)*Math.sinh(l)+e*o*Math.cosh(l))/e}}}return f(),{next:t=>{const e=p(t);if(d)s.done=t>=h;else{const r=1e3*m(t),a=Math.abs(r)<=o,l=Math.abs(n-e)<=i;s.done=a&&l}return s.value=s.done?n:e,s},flipTarget:()=>{c=-c,[e,n]=[n,e],f()}}}je.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Fe=t=>0,Ie=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Ue=(t,e,n)=>-n*t+n*e+t;function Ne(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ze({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let i=0,r=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;i=Ne(a,o,t+1/3),r=Ne(a,o,t),s=Ne(a,o,t-1/3)}else i=r=s=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*s),alpha:o}}const We=(t,e,n)=>{const o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},He=[ft,mt,ht],$e=t=>He.find(e=>e.test(t)),Ye=(t,e)=>{let n=$e(t),o=$e(e),i=n.parse(t),r=o.parse(e);n===ht&&(i=ze(i),n=mt),o===ht&&(r=ze(r),o=mt);const s=Object.assign({},i);return t=>{for(const e in s)"alpha"!==e&&(s[e]=We(i[e],r[e],t));return s.alpha=Ue(i.alpha,r.alpha,t),n.transform(s)}},Xe=t=>"number"==typeof t,Ge=(t,e)=>n=>e(t(n)),qe=(...t)=>t.reduce(Ge);function Ze(t,e){return Xe(t)?n=>Ue(t,e,n):gt.test(t)?Ye(t,e):Qe(t,e)}const Ke=(t,e)=>{const n=[...t],o=n.length,i=t.map((t,n)=>Ze(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=i[e](t);return n}},_e=(t,e)=>{const n=Object.assign(Object.assign({},t),e),o={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=Ze(t[i],e[i]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function Je(t){const e=Et.parse(t),n=e.length;let o=0,i=0,r=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:void 0!==e[t].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}const Qe=(t,e)=>{const n=Et.createTransformer(e),o=Je(t),i=Je(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&o.numNumbers>=i.numNumbers?qe(Ke(o.parsed,i.parsed),n):n=>""+(n>0?e:t)},tn=(t,e)=>n=>Ue(t,e,n);function en(t,e,n){const o=[],i=n||("number"==typeof(r=t[0])?tn:"string"==typeof r?gt.test(r)?Ye:Qe:Array.isArray(r)?Ke:"object"==typeof r?_e:void 0);var r;const s=t.length-1;for(let n=0;n<s;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;r=qe(t,r)}o.push(r)}return o}function nn(t,e,{clamp:n=!0,ease:o,mixer:i}={}){const r=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[r-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const s=en(e,o,i),a=2===r?function([t,e],[n]){return o=>n(Ie(t,e,o))}(t,s):function(t,e){const n=t.length,o=n-1;return i=>{let r=0,s=!1;if(i<=t[0]?s=!0:i>=t[o]&&(r=o-1,s=!0),!s){let e=1;for(;e<n&&!(t[e]>i||e===o);e++);r=e-1}const a=Ie(t[r],t[r+1],i);return e[r](a)}}(t,s);return n?e=>a(Re(t[0],t[r-1],e)):a}const on=t=>e=>1-t(1-e),rn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,sn=t=>e=>e*e*((t+1)*e-t),an=t=>t,ln=(un=2,t=>Math.pow(t,un));var un;const cn=on(ln),hn=rn(ln),dn=t=>1-Math.sin(Math.acos(t)),pn=on(dn),mn=rn(pn),fn=sn(1.525),gn=on(fn),vn=rn(fn),yn=(t=>{const e=sn(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),xn=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},bn=on(xn);function En(t,e){return t.map(()=>e||hn).splice(0,t.length-1)}function wn({from:t=0,to:e=1,ease:n,offset:o,duration:i=300}){const r={done:!1,value:t},s=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(o&&o.length===s.length?o:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(s),i);function l(){return nn(a,s,{ease:Array.isArray(n)?n:En(s,n)})}let u=l();return{next:t=>(r.value=u(t),r.done=t>=i,r),flipTarget:()=>{s.reverse(),u=l()}}}const Sn={keyframes:wn,spring:je,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:i=.5,modifyTarget:r}){const s={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===r?l:r(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>i||e<-i),s.value=s.done?u:u+e,s},flipTarget:()=>{}}}};const Pn="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),An="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Pn()),1/60*1e3);let Tn=!0,Vn=!1,Cn=!1;const Mn={delta:0,timestamp:0},Rn=["read","update","preRender","render","postRender"],Ln=Rn.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,i=!1,r=!1;const s=new WeakSet,a={schedule:(t,r=!1,a=!1)=>{const l=a&&i,u=l?e:n;return r&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&i&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(i)r=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,o=e.length,o)for(let n=0;n<o;n++){const o=e[n];o(l),s.has(o)&&(a.schedule(o),t())}i=!1,r&&(r=!1,a.process(l))}}};return a}(()=>Vn=!0),t),{}),On=Rn.reduce((t,e)=>{const n=Ln[e];return t[e]=(t,e=!1,o=!1)=>(Vn||Fn(),n.schedule(t,e,o)),t},{}),kn=Rn.reduce((t,e)=>(t[e]=Ln[e].cancel,t),{}),Dn=Rn.reduce((t,e)=>(t[e]=()=>Ln[e].process(Mn),t),{}),Bn=t=>Ln[t].process(Mn),jn=t=>{Vn=!1,Mn.delta=Tn?1/60*1e3:Math.max(Math.min(t-Mn.timestamp,40),1),Mn.timestamp=t,Cn=!0,Rn.forEach(Bn),Cn=!1,Vn&&(Tn=!1,An(jn))},Fn=()=>{Vn=!0,Tn=!0,Cn||An(jn)},In=()=>Mn;function Un(t,e,n=0){return t-e-n}const Nn=t=>{const e=({delta:e})=>t(e);return{start:()=>On.update(e,!0),stop:()=>kn.update(e)}};function zn(t){var e,n,{from:o,autoplay:i=!0,driver:r=Nn,elapsed:s=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:h,onComplete:d,onRepeat:p,onUpdate:m}=t,f=Me(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,v,y,{to:x}=f,b=0,E=f.duration,w=!1,S=!0;const P=function(t){if(Array.isArray(t.to))return wn;if(Sn[t.type])return Sn[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?wn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?je:wn}(f);(null===(n=(e=P).needsInterpolation)||void 0===n?void 0:n.call(e,o,x))&&(y=nn([0,100],[o,x],{clamp:!1}),o=0,x=100);const A=P(Object.assign(Object.assign({},f),{from:o,to:x}));function T(){b++,"reverse"===l?(S=b%2==0,s=function(t,e,n=0,o=!0){return o?Un(e+-t,e,n):e-(t-e)+n}(s,E,u,S)):(s=Un(s,E,u),"mirror"===l&&A.flipTarget()),w=!1,p&&p()}function V(t){if(S||(t=-t),s+=t,!w){const t=A.next(Math.max(0,s));v=t.value,y&&(v=y(v)),w=S?t.done:s<=0}null==m||m(v),w&&(0===b&&(null!=E||(E=s)),b<a?function(t,e,n,o){return o?t>=e+n:t<=-n}(s,E,u,S)&&T():(g.stop(),d&&d()))}return i&&(null==c||c(),g=r(V),g.start()),{stop:()=>{null==h||h(),g.stop()}}}function Wn(t,e){return e?t*(1e3/e):0}const Hn=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),$n=t=>Hn(t)&&t.hasOwnProperty("z"),Yn=(t,e)=>Math.abs(t-e);function Xn(t,e){if(Xe(t)&&Xe(e))return Yn(t,e);if(Hn(t)&&Hn(e)){const n=Yn(t.x,e.x),o=Yn(t.y,e.y),i=$n(t)&&$n(e)?Yn(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}const Gn=(t,e)=>1-3*e+3*t,qn=(t,e)=>3*e-6*t,Zn=t=>3*t,Kn=(t,e,n)=>((Gn(e,n)*t+qn(e,n))*t+Zn(e))*t,_n=(t,e,n)=>3*Gn(e,n)*t*t+2*qn(e,n)*t+Zn(e);function Jn(t,e,n,o){if(t===e&&n===o)return an;const i=new Float32Array(11);for(let e=0;e<11;++e)i[e]=Kn(.1*e,t,n);function r(e){let o=0,r=1;for(;10!==r&&i[r]<=e;++r)o+=.1;--r;const s=o+.1*((e-i[r])/(i[r+1]-i[r])),a=_n(s,t,n);return a>=.001?function(t,e,n,o){for(let i=0;i<8;++i){const i=_n(e,n,o);if(0===i)return e;e-=(Kn(e,n,o)-t)/i}return e}(e,s,t,n):0===a?s:function(t,e,n,o,i){let r,s,a=0;do{s=e+(n-e)/2,r=Kn(s,o,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<10);return s}(e,o,o+.1,t,n)}return t=>0===t||1===t?t:Kn(r(t),e,o)}const Qn=("undefined"==typeof process||process.env,"production"),to=new Set;function eo(t,e,n){t||to.has(e)||(console.warn(e),n&&console.warn(n),to.add(e))}const no=new WeakMap,oo=new WeakMap,io=t=>{const e=no.get(t.target);e&&e(t)},ro=t=>{t.forEach(io)};function so(t,e,n){const o=function({root:t,...e}){const n=t||document;oo.has(n)||oo.set(n,{});const o=oo.get(n),i=JSON.stringify(e);return o[i]||(o[i]=new IntersectionObserver(ro,{root:t,...e})),o[i]}(e);return no.set(t,n),o.observe(t),()=>{no.delete(t),o.unobserve(t)}}const ao={some:0,all:1};function lo(n,o,i,{root:r,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n||!i.current)return;const e={root:null==r?void 0:r.current,rootMargin:s,threshold:"number"==typeof a?a:ao[a]};return so(i.current,e,e=>{const{isIntersecting:n}=e;if(o.isInView===n)return;if(o.isInView=n,l&&!n&&o.hasEnteredView)return;n&&(o.hasEnteredView=!0),i.animationState&&i.animationState.setActive(t.AnimationType.InView,n);const r=i.getProps(),s=n?r.onViewportEnter:r.onViewportLeave;s&&s(e)})},[n,r,s,a])}function uo(n,o,i,{fallback:r=!0}){e.useEffect(()=>{n&&r&&("production"!==Qn&&eo(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{o.hasEnteredView=!0;const{onViewportEnter:e}=i.getProps();e&&e(null),i.animationState&&i.animationState.setActive(t.AnimationType.InView,!0)}))},[n])}const co=t=>e=>(t(e),null),ho={inView:co((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:i,viewport:r={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||i);r.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?uo:lo)(a,s.current,t,r)})),tap:co((function({onTap:n,onTapStart:o,onTapCancel:i,whileTap:r,visualElement:s}){const a=n||o||i||r,l=e.useRef(!1),u=e.useRef(null),c={passive:!(o||n||i||f)};function h(){u.current&&u.current(),u.current=null}function d(){return h(),l.current=!1,s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!1),!Ae()}function p(t,e){d()&&(Ve(s.current,t.target)?n&&n(t,e):i&&i(t,e))}function m(t,e){d()&&i&&i(t,e)}function f(e,n){h(),l.current||(l.current=!0,u.current=qe(xe(window,"pointerup",p,c),xe(window,"pointercancel",m,c)),s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!0),o&&o(e,n))}be(s,"pointerdown",a?f:void 0,c),Ce(h)})),focus:co((function({whileFocus:e,visualElement:n}){const{animationState:o}=n;le(n,"focus",e?()=>{o&&o.setActive(t.AnimationType.Focus,!0)}:void 0),le(n,"blur",e?()=>{o&&o.setActive(t.AnimationType.Focus,!1)}:void 0)})),hover:co((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){be(o,"pointerenter",t||n?Te(o,!0,t):void 0,{passive:!t}),be(o,"pointerleave",e||n?Te(o,!1,e):void 0,{passive:!e})}))};function po(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=e.useId();e.useEffect(()=>i(r),[]);return!n&&o?[!1,()=>o&&o(r)]:[!0]}function mo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}const fo=t=>1e3*t,go={linear:an,easeIn:ln,easeInOut:hn,easeOut:cn,circIn:dn,circInOut:mn,circOut:pn,backIn:fn,backInOut:vn,backOut:gn,anticipate:yn,bounceIn:bn,bounceInOut:t=>t<.5?.5*(1-xn(1-2*t)):.5*xn(2*t-1)+.5,bounceOut:xn},vo=t=>{if(Array.isArray(t)){t.length;const[e,n,o,i]=t;return Jn(e,n,o,i)}return"string"==typeof t?go[t]:t},yo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Et.test(e)||e.startsWith("url("))),xo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),bo=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Eo=()=>({type:"keyframes",ease:"linear",duration:.3}),wo=t=>({type:"keyframes",duration:.8,values:t}),So={x:xo,y:xo,z:xo,rotate:xo,rotateX:xo,rotateY:xo,rotateZ:xo,scaleX:bo,scaleY:bo,scale:bo,opacity:Eo,backgroundColor:Eo,color:Eo,default:bo},Po=(t,e)=>{let n;return n=Jt(e)?wo:So[t]||So.default,{to:e,...n(e)}},Ao={...Vt,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:At,WebkitFilter:At},To=t=>Ao[t];function Vo(t,e){var n;let o=To(t);return o!==At&&(o=Et),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const Co={current:!1};function Mo(t,e){const n=performance.now(),o=({timestamp:i})=>{const r=i-n;r>=e&&(kn.read(o),t(r-e))};return On.read(o,!0),()=>kn.read(o)}function Ro({ease:t,times:e,yoyo:n,flip:o,loop:i,...r}){const s={...r};return e&&(s.offset=e),r.duration&&(s.duration=fo(r.duration)),r.repeatDelay&&(s.repeatDelay=fo(r.repeatDelay)),t&&(s.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(vo):vo(t)),"tween"===r.type&&(s.type="keyframes"),(n||i||o)&&(n?s.repeatType="reverse":i?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=i||n||o||r.repeat),"spring"!==r.type&&(s.type="keyframes"),s}function Lo(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...Po(n,e.to)}),{...e,...Ro(t)}}function Oo(t,e,n,o,i){const r=Bo(o,t)||{};let s=void 0!==r.from?r.from:e.get();const a=yo(t,n);"none"===s&&a&&"string"==typeof n?s=Vo(t,n):ko(s)&&"string"==typeof n?s=Do(n):!Array.isArray(n)&&ko(n)&&"string"==typeof s&&(n=Do(s));return yo(t,s)&&a&&!1!==r.type?function(){const o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:t=>e.set(t)};return"inertia"===r.type||"decay"===r.type?function({from:t=0,velocity:e=0,min:n,max:o,power:i=.8,timeConstant:r=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==o&&t>o}function g(t){return void 0===n?o:void 0===o||Math.abs(n-t)<Math.abs(o-t)?n:o}function v(t){null==m||m.stop(),m=zn(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p}))}function y(t){v(Object.assign({type:"spring",stiffness:s,damping:a,restDelta:l},t))}if(f(t))y({from:t,velocity:e,to:g(t)});else{let o=i*e+t;void 0!==u&&(o=u(o));const s=g(o),a=s===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=Wn(t-c,In().delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:r,power:i,restDelta:l,modifyTarget:u,onUpdate:f(o)?d:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...o,...r}):zn({...Lo(r,o,t),onUpdate:t=>{o.onUpdate(t),r.onUpdate&&r.onUpdate(t)},onComplete:()=>{o.onComplete(),r.onComplete&&r.onComplete()}})}:function(){const t=Qt(n);return e.set(t),i(),r.onUpdate&&r.onUpdate(t),r.onComplete&&r.onComplete(),{stop:()=>{}}}}function ko(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Do(t){return"number"==typeof t?0:Vo("",t)}function Bo(t,e){return t[e]||t.default||t}function jo(t,e,n,o={}){return Co.current&&(o={type:!1}),e.start(i=>{let r;const s=Oo(t,e,n,o,i),a=function(t,e){var n,o;return null!==(o=null!==(n=(Bo(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==o?o:0}(o,t),l=()=>r=s();let u;return a?u=Mo(l,fo(a)):l(),()=>{u&&u(),r&&r.stop()}})}const Fo=t=>/^0[^.\s]+$/.test(t);function Io(t,e){-1===t.indexOf(e)&&t.push(e)}function Uo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class No{constructor(){this.subscriptions=[]}add(t){return Io(this.subscriptions,t),()=>Uo(this.subscriptions,t)}notify(t,e,n){const o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(let i=0;i<o;i++){const o=this.subscriptions[i];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class zo{constructor(t){var e;this.version="7.6.7",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new No,this.velocityUpdateSubscribers=new No,this.renderSubscribers=new No,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=In();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,On.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>On.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Wn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Wo(t){return new zo(t)}const Ho=t=>e=>e.test(t),$o=[Q,rt,it,ot,at,st,{test:t=>"auto"===t,parse:t=>t}],Yo=t=>$o.find(Ho(t)),Xo=[...$o,gt,Et],Go=t=>Xo.find(Ho(t));function qo(t,e,n){const o=t.getProps();return _t(o,e,void 0!==n?n:o.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 Zo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Wo(n))}function Ko(t,e){const n=qo(t,e);let{transitionEnd:o={},transition:i={},...r}=n?t.makeTargetAnimatable(n,!1):{};r={...r,...o};for(const e in r){Zo(t,e,Qt(r[e]))}}function _o(t,e){[...e].reverse().forEach(n=>{var o;const i=t.getVariant(n);i&&Ko(t,i),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{_o(t,e)})})}function Jo(t,e,n){var o,i;const r=Object.keys(e).filter(e=>!t.hasValue(e)),s=r.length;if(s)for(let a=0;a<s;a++){const s=r[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(o=n[s])&&void 0!==o?o:t.readValue(s))&&void 0!==i?i:e[s]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||Fo(u))?u=parseFloat(u):!Go(u)&&Et.test(l)&&(u=Vo(s,l)),t.addValue(s,Wo(u)),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}function Qo(t,e){if(!e)return;return(e[t]||e.default||e).from}function ti(t,e,n){var o;const i={};for(const r in t){const t=Qo(r,e);i[r]=void 0!==t?t:null===(o=n.getValue(r))||void 0===o?void 0:o.get()}return i}function ei(t){return Boolean(z(t)&&t.add)}function ni(t,e,n={}){let o;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>oi(t,e,n));o=Promise.all(i)}else if("string"==typeof e)o=oi(t,e,n);else{const i="function"==typeof e?qo(t,e,n.custom):e;o=ii(t,i,n)}return o.then(()=>t.notify("AnimationComplete",e))}function oi(t,e,n={}){var o;const i=qo(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>ii(t,i,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=r;return function(t,e,n=0,o=0,i=1,r){const s=[],a=(t.variantChildren.size-1)*o,l=1===i?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(ri).forEach((t,o)=>{s.push(oi(t,e,{...r,delay:n+l(o)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,i+o,s,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function ii(t,e,{delay:n=0,transitionOverride:o,type:i}={}){var r;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");o&&(s=o);const c=[],h=i&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[i]);for(const e in l){const o=t.getValue(e),i=l[e];if(!o||void 0===i||h&&si(h,e))continue;let r={delay:n,...s};t.shouldReduceMotion&&U.has(e)&&(r={...r,type:!1,delay:0});let a=jo(e,o,i,r);ei(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&Ko(t,a)})}function ri(t,e){return t.sortNodePosition(e)}function si({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const ai=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],li=[...ai].reverse(),ui=ai.length;function ci(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>ni(t,e,n)))}(e);const o={[t.AnimationType.Animate]:di(!0),[t.AnimationType.InView]:di(),[t.AnimationType.Hover]:di(),[t.AnimationType.Tap]:di(),[t.AnimationType.Drag]:di(),[t.AnimationType.Focus]:di(),[t.AnimationType.Exit]:di()};let i=!0;const r=(t,n)=>{const o=qo(e,n);if(o){const{transition:e,transitionEnd:n,...i}=o;t={...t,...i,...n}}return t};function s(t,s){var a;const l=e.getProps(),u=e.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let n=0;n<ui;n++){const g=li[n],v=o[g],y=null!==(a=l[g])&&void 0!==a?a:u[g],x=m(y),b=g===s?v.isActive:null;!1===b&&(p=n);let E=y===u[g]&&y!==l[g]&&x;if(E&&i&&e.manuallyAnimateOnMount&&(E=!1),v.protectedKeys={...d},!v.isActive&&null===b||!y&&!v.prevProp||f(y)||"boolean"==typeof y)continue;const w=hi(v.prevProp,y);let S=w||g===s&&v.isActive&&!E&&x||n>p&&x;const P=Array.isArray(y)?y:[y];let A=P.reduce(r,{});!1===b&&(A={});const{prevResolvedValues:T={}}=v,V={...T,...A},C=t=>{S=!0,h.delete(t),v.needsAnimating[t]=!0};for(const t in V){const e=A[t],n=T[t];d.hasOwnProperty(t)||(e!==n?Jt(e)&&Jt(n)?!mo(e,n)||w?C(t):v.protectedKeys[t]=!0:void 0!==e?C(t):h.add(t):void 0!==e&&h.has(t)?C(t):v.protectedKeys[t]=!0)}v.prevProp=y,v.prevResolvedValues=A,v.isActive&&(d={...d,...A}),i&&e.blockInitialAnimation&&(S=!1),S&&!E&&c.push(...P.map(e=>({animation:e,options:{type:g,...t}})))}if(h.size){const t={};h.forEach(n=>{const o=e.getBaseTarget(n);void 0!==o&&(t[n]=o)}),c.push({animation:t})}let g=Boolean(c.length);return i&&!1===l.initial&&!e.manuallyAnimateOnMount&&(g=!1),i=!1,g?n(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,i){var r;if(o[t].isActive===n)return Promise.resolve();null===(r=e.variantChildren)||void 0===r||r.forEach(e=>{var o;return null===(o=e.animationState)||void 0===o?void 0:o.setActive(t,n)}),o[t].isActive=n;const a=s(i,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function hi(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!mo(e,t)}function di(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const pi={animation:co(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=ci(t)),f(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:co(n=>{const{custom:o,visualElement:i}=n,[r,s]=po(),a=e.useContext(u);e.useEffect(()=>{i.isPresent=r;const e=i.animationState&&i.animationState.setActive(t.AnimationType.Exit,!r,{custom:a&&a.custom||o});e&&!r&&e.then(s)},[r])})};class mi{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=vi(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Xn(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:i}=In();this.history.push({...o,timestamp:i});const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=fi(e,this.transformPagePoint),ue(t)&&0===t.buttons?this.handlePointerUp(t,e):On.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,i=vi(fi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),o&&o(t,i)},ce(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=fi(me(t),this.transformPagePoint),{point:i}=o,{timestamp:r}=In();this.history=[{...i,timestamp:r}];const{onSessionStart:s}=e;s&&s(t,vi(o,this.history)),this.removeListeners=qe(xe(window,"pointermove",this.handlePointerMove),xe(window,"pointerup",this.handlePointerUp),xe(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),kn.update(this.updatePoint)}}function fi(t,e){return e?{point:e(t.point)}:t}function gi(t,e){return{x:t.x-e.x,y:t.y-e.y}}function vi({point:t},e){return{point:t,delta:gi(t,xi(e)),offset:gi(t,yi(e)),velocity:bi(e,.1)}}function yi(t){return t[0]}function xi(t){return t[t.length-1]}function bi(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const i=xi(t);for(;n>=0&&(o=t[n],!(i.timestamp-o.timestamp>fo(e)));)n--;if(!o)return{x:0,y:0};const r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Ei(t){return t.max-t.min}function wi(t,e=0,n=.01){return Xn(t,e)<n}function Si(t,e,n,o=.5){t.origin=o,t.originPoint=Ue(e.min,e.max,t.origin),t.scale=Ei(n)/Ei(e),(wi(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Ue(n.min,n.max,t.origin)-t.originPoint,(wi(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Pi(t,e,n,o){Si(t.x,e.x,n.x,null==o?void 0:o.originX),Si(t.y,e.y,n.y,null==o?void 0:o.originY)}function Ai(t,e,n){t.min=n.min+e.min,t.max=t.min+Ei(e)}function Ti(t,e,n){t.min=e.min-n.min,t.max=t.min+Ei(e)}function Vi(t,e,n){Ti(t.x,e.x,n.x),Ti(t.y,e.y,n.y)}function Ci(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 Mi(t,e){let n=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,o]=[o,n]),{min:n,max:o}}const Ri=.35;function Li(t,e,n){return{min:Oi(t,e),max:Oi(t,n)}}function Oi(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}const ki=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Di(t){return[t("x"),t("y")]}function Bi({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function ji(t){return void 0===t||1===t}function Fi({scale:t,scaleX:e,scaleY:n}){return!ji(t)||!ji(e)||!ji(n)}function Ii(t){return Fi(t)||Ui(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Ui(t){return Ni(t.x)||Ni(t.y)}function Ni(t){return t&&"0%"!==t}function zi(t,e,n){return n+e*(t-n)}function Wi(t,e,n,o,i){return void 0!==i&&(t=zi(t,i,o)),zi(t,n,o)+e}function Hi(t,e=0,n=1,o,i){t.min=Wi(t.min,e,n,o,i),t.max=Wi(t.max,e,n,o,i)}function $i(t,{x:e,y:n}){Hi(t.x,e.translate,e.scale,e.originPoint),Hi(t.y,n.translate,n.scale,n.originPoint)}function Yi(t,e){t.min=t.min+e,t.max=t.max+e}function Xi(t,e,[n,o,i]){const r=void 0!==e[i]?e[i]:.5,s=Ue(t.min,t.max,r);Hi(t,e[n],e[o],s,e.scale)}const Gi=["x","scaleX","originX"],qi=["y","scaleY","originY"];function Zi(t,e){Xi(t.x,e,Gi),Xi(t.y,e,qi)}function Ki(t,e){return Bi(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),o=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}(t.getBoundingClientRect(),e))}const _i=new WeakMap;class Ji{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(e,{snapToCursor:n=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new mi(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(me(t,"page").point)},onStart:(e,n)=>{var o;const{drag:i,dragPropagation:r,onDragStart:s}=this.getProps();(!i||r||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Pe(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Di(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(it.test(o)){const i=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.layoutBox[t];if(i){o=Ei(i)*(parseFloat(o)/100)}}this.originPoint[t]=o}),null==s||s(e,n),null===(o=this.visualElement.animationState)||void 0===o||o.setActive(t.AnimationType.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:o,onDirectionLock:i,onDrag:r}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(o&&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}(s),void(null!==this.currentDirection&&(null==i||i(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),null==r||r(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:o}=e;this.startAnimation(o);const{onDragEnd:i}=this.getProps();null==i||i(t,e)}cancel(){var e,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(t.AnimationType.Drag,!1)}updateAxis(t,e,n){const{drag:o}=this.getProps();if(!n||!Qi(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?Ue(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?Ue(n,t,o.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),i.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&p(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:i}){return{x:Ci(t.x,n,i),y:Ci(t.y,e,o)}}(n.layoutBox,t),this.elastic=function(t=Ri){return!1===t?t=0:!0===t&&(t=Ri),{x:Li(t,"left","right"),y:Li(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Di(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,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=function(t,e,n){const o=Ki(t,n),{scroll:i}=e;return i&&(Yi(o.x,i.x),Yi(o.y,i.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Mi(t.x,e.x),y:Mi(t.y,e.y)}}(o.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=Bi(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Di(s=>{var l;if(!Qi(s,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[s])&&void 0!==l?l:{};r&&(u={min:0,max:0});const c=o?200:1e6,h=o?40:1e7,d={type:"inertia",velocity:n?t[s]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...u};return this.startAxisValueAnimation(s,d)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){return jo(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Di(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const o="_drag"+t.toUpperCase(),i=this.visualElement.getProps()[o];return i||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){Di(e=>{const{drag:n}=this.getProps();if(!Qi(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:r}=o.layout.layoutBox[e];i.set(t[e]-Ue(n,r,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!p(n)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Di(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const o=Ei(t),i=Ei(e);return i>o?n=Ie(e.min,e.max-o,t.min):o>i&&(n=Ie(t.min,t.max-i,e.min)),Re(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),Di(t=>{if(!Qi(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:r}=this.constraints[t];n.set(Ue(o,r,i[t]))})}addListeners(){var t;if(!this.visualElement.current)return;_i.set(this.visualElement,this);const e=xe(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();p(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const r=ae(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Di(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),i(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=Ri,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:s}}}function Qi(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const tr={pan:co((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:i,visualElement:r}){const a=t||n||o||i,l=e.useRef(null),{transformPagePoint:u}=e.useContext(s),c={onSessionStart:i,onStart:n,onMove:t,onEnd:(t,e)=>{l.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==l.current&&l.current.updateHandlers(c)}),be(r,"pointerdown",a&&function(t){l.current=new mi(t,c,{transformPagePoint:u})}),Ce(()=>l.current&&l.current.end())})),drag:co((function(t){const{dragControls:n,visualElement:o}=t,i=P(()=>new Ji(o));e.useEffect(()=>n&&n.subscribe(i),[i,n]),e.useEffect(()=>i.addListeners(),[i])}))};function er(t){return"string"==typeof t&&t.startsWith("var(--")}const nr=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function or(t,e,n=1){const[o,i]=function(t){const e=nr.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const r=window.getComputedStyle(e).getPropertyValue(o);return r?r.trim():er(i)?or(i,e,n+1):i}const ir=new Set(["width","height","top","left","right","bottom","x","y"]),rr=t=>ir.has(t),sr=(t,e)=>{t.set(e,!1),t.set(e)},ar=t=>t===Q||t===rt;var lr;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(lr||(lr={}));const ur=(t,e)=>parseFloat(t.split(", ")[e]),cr=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const i=o.match(/^matrix3d\((.+)\)$/);if(i)return ur(i[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?ur(e[1],t):0}},hr=new Set(["x","y","z"]),dr=I.filter(t=>!hr.has(t));const pr={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:cr(4,13),y:cr(5,14)},mr=(t,e,n={},o={})=>{e={...e},o={...o};const i=Object.keys(e).filter(rr);let r=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=Yo(u);const h=e[i];let d;if(Jt(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=Yo(u);for(let n=e;n<t;n++)d?Yo(h[n]):d=Yo(h[n])}else d=Yo(h);if(c!==d)if(ar(c)&&ar(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[i]=parseFloat(h):Array.isArray(h)&&d===rt&&(e[i]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[i]=c.transform(h):(s||(r=function(t){const e=[];return dr.forEach(n=>{const o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),s=!0),a.push(i),o[i]=void 0!==o[i]?o[i]:e[i],sr(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const o=e.measureViewportBox(),i=e.current,r=getComputedStyle(i),{display:s}=r,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=pr[t](o,r)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);sr(o,a[n]),t[n]=pr[n](l,r)}),t})(e,t,a);return r.length&&r.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),c&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:o}}return{target:e,transitionEnd:o}};function fr(t,e,n,o){return(t=>Object.keys(t).some(rr))(e)?mr(t,e,n,o):{target:e,transitionEnd:o}}const gr=(t,e,n,o)=>{const i=function(t,{...e},n){const o=t.current;if(!(o instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!er(e))return;const n=or(e,o);n&&t.set(n)});for(const t in e){const i=e[t];if(!er(i))continue;const r=or(i,o);r&&(e[t]=r,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,o);return fr(t,e=i.target,n,o=i.transitionEnd)},vr={current:null},yr={current:!1};function xr(){if(yr.current=!0,c)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>vr.current=t.matches;t.addListener(e),e()}else vr.current=!1}const br=Object.keys(w),Er=br.length,wr=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Sr{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:o},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>On.render(this.render,!1,!0);const{latestValues:r,renderState:s}=o;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=s,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.isControllingVariants=v(e),this.isVariantNode=y(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e);for(const t in l){const e=l[t];void 0!==r[t]&&z(e)&&(e.set(r[t],!1),ei(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),yr.current||xr(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||vr.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),kn.update(this.notifyUpdate),kn.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&On.update(this.notifyUpdate,!1,!0)}),o=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{n(),o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,n,o,i,r,s){const a=[];for(let n=0;n<Er;n++){const o=br[n],{isEnabled:i,Component:r}=w[o];i(t)&&r&&a.push(e.createElement(r,{key:o,...t,visualElement:this}))}if(!this.projection&&r){this.projection=new r(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&p(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:l})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<wr.length;e++){const n=wr[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const o=t["on"+n];o&&(this.propEventSubscriptions[n]=this.on(n,o))}this.prevMotionValues=function(t,e,n){const{willChange:o}=e;for(const i in e){const r=e[i],s=n[i];if(z(r))t.addValue(i,r),ei(o)&&o.add(i);else if(z(s))t.addValue(i,Wo(r)),ei(o)&&o.remove(i);else if(s!==r)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(r)}else{const e=t.getStaticValue(i);t.addValue(i,Wo(void 0!==e?e:r))}}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const o={};for(let t=0;t<Ar;t++){const e=Pr[t],n=this.props[e];(m(n)||!1===n)&&(o[e]=n)}return o}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===e||e(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Wo(e),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,o="string"==typeof n||"object"==typeof n?null===(e=_t(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==o)return o;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||z(i)?void 0!==this.initialValues[t]&&void 0===o?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new No),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}const Pr=["initial",...ai],Ar=Pr.length;class Tr extends Sr{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:o},i){let r=ti(n,t||{},this);if(o&&(e&&(e=o(e)),n&&(n=o(n)),r&&(r=o(r))),i){Jo(this,n,r);const t=gr(this,n,r,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Vr extends Tr{readValueFromInstance(t,e){if(U.has(e)){const t=To(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),i=(Y(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ki(t,e)}build(t,e,n,o){Ct(t,e,n,o.transformTemplate)}scrapeMotionValuesFromProps(t){return Zt(t)}renderInstance(t,e,n,o){Xt(t,e,n,o)}}class Cr extends Tr{getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return U.has(e)?(null===(n=To(e))||void 0===n?void 0:n.default)||0:(e=Gt.has(e)?e:Yt(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return Kt(t)}build(t,e,n,o){zt(t,e,n,o.transformTemplate)}renderInstance(t,e,n,o){qt(t,e,0,o)}}const Mr=(t,e)=>B(t)?new Cr(e,{enableHardwareAcceleration:!1}):new Vr(e,{enableHardwareAcceleration:!0});function Rr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Lr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!rt.test(t))return t;t=parseFloat(t)}return`${Rr(t,e.target.x)}% ${Rr(t,e.target.y)}%`}},Or={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,i=t.includes("var("),r=[];i&&(t=t.replace(nr,t=>(r.push(t),"_$css")));const s=Et.parse(t);if(s.length>5)return o;const a=Et.createTransformer(t),l="number"!=typeof s[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+l]/=u,s[1+l]/=c;const h=Ue(u,c,.5);"number"==typeof s[2+l]&&(s[2+l]/=h),"number"==typeof s[3+l]&&(s[3+l]/=h);let d=a(s);if(i){let t=0;d=d.replace("_$css",()=>{const e=r[t];return t++,e})}return d}};class kr extends i.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:i}=t;F(Dr),i&&(e.group&&e.group.add(i),n&&n.register&&o&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),A.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:i}=this.props,r=n.projection;return r?(r.isPresent=i,o||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?r.promote():r.relegate()||On.postRender(()=>{var t;(null===(t=r.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(o),(null==n?void 0:n.deregister)&&n.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const Dr={borderRadius:{...Lr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Lr,borderTopRightRadius:Lr,borderBottomLeftRadius:Lr,borderBottomRightRadius:Lr,boxShadow:Or},Br={measureLayout:function(t){const[n,o]=po(),r=e.useContext(V);return i.default.createElement(kr,{...t,layoutGroup:r,switchLayoutGroup:e.useContext(M),isPresent:n,safeToRemove:o})}};function jr(t,e,n={}){const o=z(t)?t:Wo(t);return jo("",o,e,n),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const Fr=["TopLeft","TopRight","BottomLeft","BottomRight"],Ir=Fr.length,Ur=t=>"string"==typeof t?parseFloat(t):t,Nr=t=>"number"==typeof t||rt.test(t);function zr(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Wr=$r(0,.5,pn),Hr=$r(.5,.95,an);function $r(t,e,n){return o=>o<t?0:o>e?1:n(Ie(t,e,o))}function Yr(t,e){t.min=e.min,t.max=e.max}function Xr(t,e){Yr(t.x,e.x),Yr(t.y,e.y)}function Gr(t,e,n,o,i){return t=zi(t-=e,1/n,o),void 0!==i&&(t=zi(t,1/i,o)),t}function qr(t,e,[n,o,i],r,s){!function(t,e=0,n=1,o=.5,i,r=t,s=t){if(it.test(e)){e=parseFloat(e);e=Ue(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=Ue(r.min,r.max,o);t===r&&(a-=e),t.min=Gr(t.min,e,n,a,i),t.max=Gr(t.max,e,n,a,i)}(t,e[n],e[o],e[i],e.scale,r,s)}const Zr=["x","scaleX","originX"],Kr=["y","scaleY","originY"];function _r(t,e,n,o){qr(t.x,e,Zr,null==n?void 0:n.x,null==o?void 0:o.x),qr(t.y,e,Kr,null==n?void 0:n.y,null==o?void 0:o.y)}function Jr(t){return 0===t.translate&&1===t.scale}function Qr(t){return Jr(t.x)&&Jr(t.y)}function ts(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 es(t){return Ei(t.x)/Ei(t.y)}class ns{constructor(){this.members=[]}add(t){Io(this.members,t),t.scheduleRender()}remove(t){if(Uo(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){var n;const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,e&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues,t.snapshot.isShared=!0),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,i,r;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(r=null===(o=t.resumingFrom)||void 0===o?void 0:(i=o.options).onExitComplete)||void 0===r||r.call(i)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function os(t,e,n){let o=`translate3d(${t.x.translate/e.x}px, ${t.y.translate/e.y}px, 0) `;if(o+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),i&&(o+=`rotateY(${i}deg) `)}return o+=`scale(${t.x.scale*e.x}, ${t.y.scale*e.y})`,"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"===o?"none":o}const is=(t,e)=>t.depth-e.depth;class rs{constructor(){this.children=[],this.isDirty=!1}add(t){Io(this.children,t),this.isDirty=!0}remove(t){Uo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(is),this.isDirty=!1,this.children.forEach(t)}}const ss=["","X","Y","Z"];function as({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:i}){return class{constructor(t,n={},o=(null==e?void 0:e())){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(ms),this.nodes.forEach(fs)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.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 rs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new No),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var o;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:i,layout:r,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),null===(o=this.parent)||void 0===o||o.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(r||i)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=Mo(o,250),A.hasAnimatedSinceResize&&(A.hasAnimatedSinceResize=!1,this.nodes.forEach(ps))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var i,r,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(r=null!==(i=this.options.transition)&&void 0!==i?i:s.getDefaultTransition())&&void 0!==r?r:Es,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=s.getProps(),p=!this.targetLayout||!ts(this.targetLayout,o)||n,m=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||m||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,m);const e={...Bo(c,"layout"),onPlay:h,onComplete:d};s.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||ps(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=o})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,kn.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(gs))}willUpdate(t=!0){var e,n,o;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll()}const{layoutId:i,layout:r}=this.options;if(void 0===i&&!r)return;const s=null===(o=this.options.visualElement)||void 0===o?void 0:o.getProps().transformTemplate;this.prevTransformTemplateValue=null==s?void 0:s(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(hs);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(ws),this.potentialNodes.clear()),this.nodes.forEach(ds),this.nodes.forEach(ls),this.nodes.forEach(us),this.clearAllSnapshots(),Dn.update(),Dn.preRender(),Dn.render())}clearAllSnapshots(){this.nodes.forEach(cs),this.sharedNodes.forEach(vs)}scheduleUpdateProjection(){On.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){On.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){var t;if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox),null===(t=this.options.visualElement)||void 0===t||t.notify("LayoutMeasure",this.layout.layoutBox,null==e?void 0:e.layoutBox)}updateScroll(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=o(this.instance),this.scroll=n(this.instance))}resetTransform(){var t;if(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Qr(this.projectionDelta),o=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,r=null==o?void 0:o(this.latestValues,""),s=r!==this.prevTransformTemplateValue;e&&(n||Ii(this.latestValues)||s)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var o;return t&&(n=this.removeTransform(n)),Ss((o=n).x),Ss(o.y),{measuredBox:e,layoutBox:n,latestValues:{}}}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&&(Yi(e.x,n.x),Yi(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Xr(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:i,options:r,isScrollRoot:s}=o;if(o!==this.root&&i&&r.layoutScroll){if(s){Xr(e,t);const{scroll:n}=this.root;n&&(Yi(e.x,-n.x),Yi(e.y,-n.y))}Yi(e.x,i.x),Yi(e.y,i.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Xr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];!e&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Zi(n,{x:-o.scroll.x,y:-o.scroll.y}),Ii(o.latestValues)&&Zi(n,o.latestValues)}return Ii(this.latestValues)&&Zi(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Xr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!Ii(o.latestValues))continue;Fi(o.latestValues)&&o.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};Xr(i,o.measurePageBox()),_r(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layoutBox,i)}return Ii(this.latestValues)&&_r(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var t;const{layout:e,layoutId:n}=this.options;if(this.layout&&(e||n)){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}},Vi(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Xr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var o,i,r;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(o=this.target,i=this.relativeTarget,r=this.relativeParent.target,Ai(o.x,i.x,r.x),Ai(o.y,i.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Xr(this.target,this.layout.layoutBox),$i(this.target,this.targetDelta)):Xr(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}},Vi(this.relativeTargetOrigin,this.target,t.target),Xr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Fi(this.parent.latestValues)&&!Ui(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{layout:e,layoutId:n}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!e&&!n)return;const o=this.getLead();Xr(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,o=!1){var i,r;const s=n.length;if(!s)return;let a,l;e.x=e.y=1;for(let u=0;u<s;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(r=null===(i=a.instance)||void 0===i?void 0:i.style)||void 0===r?void 0:r.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Zi(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,$i(t,l)),o&&Ii(a.latestValues)&&Zi(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==o);const{target:i}=o;if(!i)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 r=this.treeScale.x,s=this.treeScale.y,a=this.projectionTransform;Pi(this.projectionDelta,this.layoutCorrected,i,this.latestValues),this.projectionTransform=os(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===r&&this.treeScale.y===s||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",i))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,o;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(o=this.getStack())||void 0===o||o.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n;const o=this.snapshot,i=(null==o?void 0:o.latestValues)||{},r={...this.latestValues},s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=null==o?void 0:o.isShared,u=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(bs));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const o=e/1e3;var h,d,p,m;ys(s.x,t.x,o),ys(s.y,t.y,o),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(Vi(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,d=this.relativeTargetOrigin,p=a,m=o,xs(h.x,d.x,p.x,m),xs(h.y,d.y,p.y,m)),l&&(this.animationValues=r,function(t,e,n,o,i,r){var s,a,l,u;i?(t.opacity=Ue(0,null!==(s=n.opacity)&&void 0!==s?s:1,Wr(o)),t.opacityExit=Ue(null!==(a=e.opacity)&&void 0!==a?a:1,0,Hr(o))):r&&(t.opacity=Ue(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,o));for(let i=0;i<Ir;i++){const r=`border${Fr[i]}Radius`;let s=zr(e,r),a=zr(n,r);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Nr(s)===Nr(a)?(t[r]=Math.max(Ue(Ur(s),Ur(a),o),0),(it.test(a)||it.test(s))&&(t[r]+="%")):t[r]=a}(e.rotate||n.rotate)&&(t.rotate=Ue(e.rotate||0,n.rotate||0,o))}(r,i,this.latestValues,o,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=o},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(kn.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=On.update(()=>{A.hasAnimatedSinceResize=!0,this.currentAnimation=jr(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:o,latestValues:i}=t;if(e&&n&&o){if(this!==t&&this.layout&&o&&Ps(this.options.animationType,this.layout.layoutBox,o.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Ei(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const o=Ei(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+o}Xr(e,n),Zi(e,i),Pi(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){var n,o,i;this.sharedNodes.has(t)||this.sharedNodes.set(t,new ns);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(i=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===i?void 0:i.call(o,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const o=this.getStack();o&&o.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const n={};for(let o=0;o<ss.length;o++){const i="rotate"+ss[o];t.getStaticValue(i)&&(e=!0,n[i]=t.getStaticValue(i),t.setStaticValue(i,0))}if(e){null==t||t.render();for(const e in n)t.setStaticValue(e,n[e]);t.scheduleRender()}}getProjectionStyles(t={}){var e,n,o;const i={};if(!this.instance||this.isSVG)return i;if(!this.isVisible)return{visibility:"hidden"};i.visibility="";const r=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=te(t.pointerEvents)||"",i.transform=r?r(this.latestValues,""):"none",i;const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=te(t.pointerEvents)||""),this.hasProjected&&!Ii(this.latestValues)&&(e.transform=r?r({},""):"none",this.hasProjected=!1),e}const a=s.animationValues||s.latestValues;this.applyTransformsToTarget(),i.transform=os(this.projectionDeltaWithTransform,this.treeScale,a),r&&(i.transform=r(a,i.transform));const{x:l,y:u}=this.projectionDelta;i.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,s.animationValues?i.opacity=s===this?null!==(o=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==o?o:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:i.opacity=s===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in j){if(void 0===a[t])continue;const{correct:e,applyTo:n}=j[t],o=e(a[t],s);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=o}else i[t]=o}return this.options.layoutId&&(i.pointerEvents=s===this?te(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(hs),this.root.sharedNodes.clear()}}}function ls(t){t.updateLayout()}function us(t){var e,n,o;const i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:o}=t.options;"size"===o?Di(t=>{const n=i.isShared?i.measuredBox[t]:i.layoutBox[t],o=Ei(n);n.min=e[t].min,n.max=n.min+o}):Ps(o,i.layoutBox,e)&&Di(t=>{const n=i.isShared?i.measuredBox[t]:i.layoutBox[t],o=Ei(e[t]);n.max=n.min+o});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Pi(r,e,i.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};i.isShared?Pi(s,t.applyTransform(n,!0),i.measuredBox):Pi(s,e,i.layoutBox);const a=!Qr(r);let l=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:t,layout:o}=n;if(t&&o){const n={x:{min:0,max:0},y:{min:0,max:0}};Vi(n,i.layoutBox,t.layoutBox);const r={x:{min:0,max:0},y:{min:0,max:0}};Vi(r,e,o.layoutBox),ts(n,r)||(l=!0)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:s,layoutDelta:r,hasLayoutChanged:a,hasRelativeTargetChanged:l})}else t.isLead()&&(null===(o=(n=t.options).onExitComplete)||void 0===o||o.call(n));t.options.transition=void 0}function cs(t){t.clearSnapshot()}function hs(t){t.clearMeasurements()}function ds(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ps(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function ms(t){t.resolveTargetDelta()}function fs(t){t.calcProjection()}function gs(t){t.resetRotation()}function vs(t){t.removeLeadSnapshot()}function ys(t,e,n){t.translate=Ue(e.translate,0,n),t.scale=Ue(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function xs(t,e,n,o){t.min=Ue(e.min,n.min,o),t.max=Ue(e.max,n.max,o)}function bs(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Es={duration:.45,ease:[.4,0,.1,1]};function ws(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 o=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);o&&t.mount(o,!0)}function Ss(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Ps(t,e,n){return"position"===t||"preserve-aspect"===t&&!function(t,e,n=.1){return Xn(t,e)<=n}(es(e),es(n),.2)}const As=as({attachResizeListener:(t,e)=>ae(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ts={current:void 0},Vs=as({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ts.current){const t=new As(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Ts.current=t}return Ts.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Cs={...pi,...ho,...tr,...Br},Ms=k((t,e)=>re(t,e,Cs,Mr,Vs));const Rs=k(re);function Ls(){const t=e.useRef(!1);return h(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Os(){const t=Ls(),[n,o]=e.useState(0),i=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>On.postRender(i),[i]),n]}class ks extends r.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ds({children:t,isPresent:n}){const o=e.useId(),i=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:r,left:a}=s.current;if(n||!i.current||!t||!e)return;i.current.dataset.motionPopId=o;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n top: ${r}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[n]),r.createElement(ks,{isPresent:n,childRef:i,sizeRef:s},r.cloneElement(t,{ref:i}))}const Bs=({children:t,initial:n,isPresent:o,onExitComplete:i,custom:s,presenceAffectsLayout:a,mode:l})=>{const c=P(js),h=e.useId(),d=e.useMemo(()=>({id:h,initial:n,isPresent:o,custom:s,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;i&&i()},register:t=>(c.set(t,!1),()=>c.delete(t))}),a?void 0:[o]);return e.useMemo(()=>{c.forEach((t,e)=>c.set(e,!1))},[o]),r.useEffect(()=>{!o&&!c.size&&i&&i()},[o]),"popLayout"===l&&(t=r.createElement(Ds,{isPresent:o},t)),r.createElement(u.Provider,{value:d},t)};function js(){return new Map}const Fs=t=>t.key||"";const Is=e.createContext(null),Us=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Ns(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Us);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var i;t.delete(o),null===(i=e.get(o))||void 0===i||i(),e.delete(o),n()},dirty:n}}const zs=t=>!0===t,Ws=({children:t,id:n,inheritId:o,inherit:i=!0})=>{void 0!==o&&(i=o);const s=e.useContext(V),a=e.useContext(Is),[l,u]=Os(),c=e.useRef(null),h=s.id||a;null===c.current&&((t=>zs(!0===t)||"id"===t)(i)&&h&&(n=n?h+"-"+n:h),c.current={id:n,group:zs(i)&&s.group||Ns()});const d=e.useMemo(()=>({...c.current,forceRender:l}),[u]);return r.createElement(V.Provider,{value:d},t)};let Hs=0;function $s(t){return"function"==typeof t}const Ys=e.createContext(null);const Xs=e.forwardRef((function({children:t,as:n="ul",axis:o="y",onReorder:i,values:s,...a},l){const u=P(()=>Ms(n)),c=[],h=e.useRef(!1),d={axis:o,registerItem:(t,e)=>{e&&-1===c.findIndex(e=>t===e.value)&&(c.push({value:t,layout:e[o]}),c.sort(qs))},updateOrder:(t,e,n)=>{if(h.current)return;const o=function(t,e,n,o){if(!o)return t;const i=t.findIndex(t=>t.value===e);if(-1===i)return t;const r=o>0?1:-1,s=t[i+r];if(!s)return t;const a=t[i],l=s.layout,u=Ue(l.min,l.max,.5);return 1===r&&a.layout.max+n>u||-1===r&&a.layout.min+n<u?function([...t],e,n){const o=e<0?t.length+e:e;if(o>=0&&o<t.length){const o=n<0?t.length+n:n,[i]=t.splice(e,1);t.splice(o,0,i)}return t}(t,i,i+r):t}(c,t,e,n);c!==o&&(h.current=!0,i(o.map(Gs).filter(t=>-1!==s.indexOf(t))))}};return e.useEffect(()=>{h.current=!1}),r.createElement(u,{...a,ref:l},r.createElement(Ys.Provider,{value:d},t))}));function Gs(t){return t.value}function qs(t,e){return t.layout.min-e.layout.min}function Zs(t){const n=P(()=>Wo(t)),{isStatic:o}=e.useContext(s);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.onChange(o),[])}return n}function Ks(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],i=t[1+n],r=t[2+n],s=t[3+n],a=nn(i,r,{mixer:(l=r[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0),...s});var l;return e?a(o):a}function _s(t,e){const n=Zs(e()),o=()=>n.set(e());return o(),function(t,e,n){h(()=>{const o=t.map(t=>t.onChange(e));return()=>{o.forEach(t=>t()),n()}})}(t,()=>On.update(o,!1,!0),()=>kn.update(o)),n}function Js(t,e,n,o){const i="function"==typeof e?e:Ks(e,n,o);return Array.isArray(t)?Qs(t,i):Qs([t],([t])=>i(t))}function Qs(t,e){const n=P(()=>[]);return _s(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function ta(t,e=0){return z(t)?t:Zs(e)}const ea={Group:Xs,Item:e.forwardRef((function({children:t,style:n={},value:o,as:i="li",onDrag:s,layout:a=!0,...l},u){const c=P(()=>Ms(i)),h=e.useContext(Ys),d={x:ta(n.x),y:ta(n.y)},p=Js([d.x,d.y],([t,e])=>t||e?1:"unset"),m=e.useRef(null),{axis:f,registerItem:g,updateOrder:v}=h;return e.useEffect(()=>{g(o,m.current)},[h]),r.createElement(c,{drag:f,...l,dragSnapToOrigin:!0,style:{...n,x:d.x,y:d.y,zIndex:p},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[f]&&v(o,d[f].get(),n[f]),s&&s(t,e)},onLayoutMeasure:t=>{m.current=t},ref:u},t)}))},na={renderer:Mr,...pi,...ho},oa={...na,...tr,...Br,projectionNodeConstructor:Vs};const ia=t=>"number"==typeof t;function ra(t,e){return(t=>Array.isArray(t)&&!ia(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const sa=(t,e,n)=>-n*t+n*e+t,aa=t=>t,la=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function ua(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const i=la(0,e,o);t.push(sa(n,1,i))}}function ca(t){const e=[0];return ua(e,t-1),e}function ha(t,e=ca(t.length),n=aa){const o=t.length,i=o-e.length;return i>0&&ua(e,i),i=>{let r=0;for(;r<o-2&&!(i<e[r+1]);r++);let s=(a=0,l=1,u=la(e[r],e[r+1],i),Math.min(Math.max(u,a),l));var a,l,u;return s=ra(n,r)(s),sa(t[r],t[r+1],s)}}const da=t=>"function"==typeof t,pa=t=>"string"==typeof t;function ma(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const fa={any:0,all:1};const ga=new WeakMap;let va;function ya({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=ga.get(t))||void 0===o||o.forEach(o=>{o({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function xa(t){t.forEach(ya)}function ba(t,e){va||"undefined"!=typeof ResizeObserver&&(va=new ResizeObserver(xa));const n=ma(t);return n.forEach(t=>{let n=ga.get(t);n||(n=new Set,ga.set(t,n)),n.add(e),null==va||va.observe(t)}),()=>{n.forEach(t=>{const n=ga.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==va||va.unobserve(t)})}}const Ea=new Set;let wa;function Sa(t){return Ea.add(t),wa||(wa=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};Ea.forEach(t=>t(e))},window.addEventListener("resize",wa)),()=>{Ea.delete(t),!Ea.size&&wa&&(wa=void 0)}}const Pa={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Aa(t,e,n,o){const i=n[e],{length:r,position:s}=Pa[e],a=i.current,l=n.time;i.current=t["scroll"+s],i.scrollLength=t["scroll"+r]-t["client"+r],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=la(0,i.scrollLength,i.current);const u=o-l;var c,h;i.velocity=u>50?0:(c=i.current-a,(h=u)?c*(1e3/h):0)}const Ta={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Va={start:0,center:.5,end:1};function Ca(t,e,n=0){let o=0;if(void 0!==Va[t]&&(t=Va[t]),pa(t)){const e=parseFloat(t);t.endsWith("px")?o=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?o=e/100*document.documentElement.clientWidth:t.endsWith("vh")?o=e/100*document.documentElement.clientHeight:t=e}return ia(t)&&(o=e*t),n+o}const Ma=[0,0];function Ra(t,e,n,o){let i=Array.isArray(t)?t:Ma,r=0,s=0;return ia(t)?i=[t,t]:pa(t)&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,Va[t]?t:"0"]),r=Ca(i[0],n,o),s=Ca(i[1],e),r-s}const La={x:0,y:0};function Oa(t,e,n){let{offset:o=Ta.All}=n;const{target:i=t,axis:r="y"}=n,s="y"===r?"height":"width",a=i!==t?function(t,e){let n={x:0,y:0},o=t;for(;o&&o!==e;)if(o instanceof HTMLElement)n.x+=o.offsetLeft,n.y+=o.offsetTop,o=o.offsetParent;else if(o instanceof SVGGraphicsElement&&"getBBox"in o){const{top:t,left:e}=o.getBBox();for(n.x+=e,n.y+=t;o&&"svg"!==o.tagName;)o=o.parentNode}return n}(i,t):La,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:i.clientWidth,height:i.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=o.length;for(let t=0;t<h;t++){const n=Ra(o[t],u[s],l[s],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=ha(ca(h),e[r].offset),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=e[r].interpolate(e[r].current)}function ka(t,e,n,o={}){const i=o.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let o=e;for(;o&&o!=t;)n.x.targetOffset+=o.offsetLeft,n.y.targetOffset+=o.offsetTop,o=o.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,o.target,n),update:e=>{!function(t,e,n){Aa(t,"x",e,n),Aa(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&Oa(t,n,o)},notify:da(e)?()=>e(n):Da(e,n[i])}}function Da(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=aa),t.updateDuration(1);else{const i={duration:1e3};e||(i.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,i)}}),()=>{t.currentTime=e.progress}}const Ba=new WeakMap,ja=new WeakMap,Fa=new WeakMap,Ia=t=>t===document.documentElement?window:t;function Ua(t,e={}){var{container:n=document.documentElement}=e,o=Me(e,["container"]);let i=Fa.get(n);i||(i=new Set,Fa.set(n,i));const r=ka(n,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},o);if(i.add(r),!Ba.has(n)){const t=()=>{const t=performance.now();for(const t of i)t.measure();for(const e of i)e.update(t);for(const t of i)t.notify()};Ba.set(n,t);const e=Ia(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&ja.set(n,function(t,e){return da(t)?Sa(t):ba(t,e)}(n,t)),e.addEventListener("scroll",t,{passive:!0})}const s=Ba.get(n),a=requestAnimationFrame(s);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(a);const o=Fa.get(n);if(!o)return;if(o.delete(r),o.size)return;const i=Ba.get(n);Ba.delete(n),i&&(Ia(n).removeEventListener("scroll",i),null===(e=ja.get(n))||void 0===e||e(),window.removeEventListener("resize",i))}}const Na=()=>({scrollX:Wo(0),scrollY:Wo(0),scrollXProgress:Wo(0),scrollYProgress:Wo(0)});function za({container:t,target:n,layoutEffect:o=!0,...i}={}){const r=P(Na);return(o?h:e.useEffect)(()=>Ua(({x:t,y:e})=>{r.scrollX.set(t.current),r.scrollXProgress.set(t.progress),r.scrollY.set(e.current),r.scrollYProgress.set(e.progress)},{...i,container:(null==t?void 0:t.current)||void 0,target:(null==n?void 0:n.current)||void 0}),[]),r}function Wa(t){const n=e.useRef(0),{isStatic:o}=e.useContext(s);e.useEffect(()=>{if(o)return;const e=({timestamp:e,delta:o})=>{n.current||(n.current=e),t(e-n.current,o)};return On.update(e,!0),()=>kn.update(e)},[t])}class Ha extends zo{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;U.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||Y(t)||"willChange"===t||(e=Yt(t)),e&&(Io(this.members,e),this.update())}remove(t){U.has(t)?(this.transforms.delete(t),this.transforms.size||Uo(this.members,"transform")):Uo(this.members,Yt(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function $a(){!yr.current&&xr();const[t]=e.useState(vr.current);return t}function Ya(){let t=!1;const e=[],n=new Set,o={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(o,i){if(t){const t=[];return n.forEach(e=>{t.push(ni(e,o,{transitionOverride:i}))}),Promise.all(t)}return new Promise(t=>{e.push({animation:[o,i],resolve:t})})},set:t=>n.forEach(e=>{!function(t,e){Array.isArray(e)?_o(t,e):"string"==typeof e?_o(t,[e]):Ko(t,e)}(e,t)}),stop(){n.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(t=!0,e.forEach(({animation:t,resolve:e})=>{o.start(...t).then(e)}),()=>{t=!1,o.stop()})};return o}function Xa(){const t=P(Ya);return e.useEffect(t.mount,[]),t}const Ga=Xa;class qa{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}}const Za=()=>new qa;function Ka(t){return null!==t&&"object"==typeof t&&R in t}function _a(){return Ja}function Ja(t){Ts.current&&(Ts.current.isUpdating=!1,Ts.current.blockUpdate(),t&&t())}const Qa=()=>({});class tl extends Sr{build(){}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n}){return Jo(this,n,ti(n,t||{},this)),{transition:t,transitionEnd:e,...n}}}const el=ee({scrapeMotionValuesFromProps:Qa,createRenderState:Qa});const nl=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:i,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"})=>{s&&(l="wait",eo(!1,"Replace exitBeforeEnter with mode='wait'"));let[u]=Os();const c=e.useContext(V).forceRender;c&&(u=c);const d=Ls(),p=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let m=p;const f=new Set,g=e.useRef(m),v=e.useRef(new Map).current,y=e.useRef(!0);if(h(()=>{y.current=!1,function(t,e){t.forEach(t=>{const n=Fs(t);e.set(n,t)})}(p,v),g.current=m}),Ce(()=>{y.current=!0,v.clear(),f.clear()}),y.current)return r.createElement(r.Fragment,null,m.map(t=>r.createElement(Bs,{key:Fs(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:a,mode:l},t)));m=[...m];const x=g.current.map(Fs),b=p.map(Fs),E=x.length;for(let t=0;t<E;t++){const e=x[t];-1===b.indexOf(e)&&f.add(e)}return"wait"===l&&f.size&&(m=[]),f.forEach(t=>{if(-1!==b.indexOf(t))return;const e=v.get(t);if(!e)return;const o=x.indexOf(t);m.splice(o,0,r.createElement(Bs,{key:Fs(e),isPresent:!1,onExitComplete:()=>{v.delete(t),f.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!f.size){if(g.current=p,!1===d.current)return;u(),i&&i()}},custom:n,presenceAffectsLayout:a,mode:l},e))}),m=m.map(t=>{const e=t.key;return f.has(e)?t:r.createElement(Bs,{key:Fs(t),isPresent:!0,presenceAffectsLayout:a,mode:l},t)}),"production"!==Qn&&"wait"===l&&m.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),r.createElement(r.Fragment,null,f.size?m:m.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(r.useEffect(()=>{},[]),r.createElement(Ws,{id:P(()=>"asl-"+Hs++)},t)),t.DeprecatedLayoutGroupContext=Is,t.DragControls=qa,t.FlatTree=rs,t.LayoutGroup=Ws,t.LayoutGroupContext=V,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,i]=e.useState(!$s(n)),s=e.useRef(void 0);if(!$s(n)){const{renderer:t,...e}=n;s.current=t,S(e)}return e.useEffect(()=>{$s(n)&&n().then(({renderer:t,...e})=>{S(e),s.current=t,i(!0)})},[]),r.createElement(d.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function({children:t,isValidProp:n,...o}){n&&jt(n),(o={...e.useContext(s),...o}).isStatic=P(()=>o.isStatic);const i=e.useMemo(()=>o,[JSON.stringify(o.transition),o.transformPagePoint,o.reducedMotion]);return r.createElement(s.Provider,{value:i},t)},t.MotionConfigContext=s,t.MotionContext=a,t.MotionValue=zo,t.PresenceContext=u,t.Reorder=ea,t.SwitchLayoutGroupContext=M,t.VisualElement=Sr,t.addPointerEvent=xe,t.addScaleCorrector=F,t.animate=jr,t.animateVisualElement=ni,t.animationControls=Ya,t.animations=pi,t.buildTransform=$,t.calcLength=Ei,t.checkTargetForNewValues=Jo,t.createBox=ki,t.createDomMotionComponent=function(t){return L(re(t,{forwardMotionProps:!1},Cs,Mr,Vs))},t.createMotionComponent=L,t.delay=Mo,t.domAnimation=na,t.domMax=oa,t.filterProps=Ft,t.isBrowser=c,t.isDragActive=Ae,t.isMotionComponent=Ka,t.isMotionValue=z,t.isValidMotionProp=Dt,t.m=Rs,t.makeUseVisualState=ee,t.motion=Ms,t.motionValue=Wo,t.resolveMotionValue=te,t.transform=Ks,t.unwrapMotionComponent=function(t){if(Ka(t))return t[R]},t.useAnimation=Ga,t.useAnimationControls=Xa,t.useAnimationFrame=Wa,t.useCycle=function(...t){const n=e.useRef(0),[o,i]=e.useState(t[n.current]);return[o,e.useCallback(e=>{n.current="number"!=typeof e?((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,n.current+1):e,i(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),i=el({},!1),r=P(()=>new tl({props:{},visualState:i},{initialState:t}));return e.useEffect(()=>(r.mount({}),()=>r.unmount()),[r]),e.useEffect(()=>{r.setProps({onUpdate:t=>{o({...t})}})},[o,r]),[n,P(()=>t=>ni(r,t))]},t.useDeprecatedInvertedScale=function(t){let e=Zs(1),n=Zs(1);const o=l();return t?(e=t.scaleX||e,n=t.scaleY||n):o&&(e=o.getValue("scaleX",1),n=o.getValue("scaleY",1)),{scaleX:Js(e,nl),scaleY:Js(n,nl)}},t.useDomEvent=le,t.useDragControls=function(){return P(Za)},t.useElementScroll=function(t){return eo(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),za({container:t})},t.useForceUpdate=Os,t.useInView=function(t,{root:n,margin:o,amount:i,once:r=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||r&&s)return;const e={root:n&&n.current||void 0,margin:o,amount:"some"===i?"any":i};return function(t,e,{root:n,margin:o,amount:i="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const r=ma(t),s=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=s.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);da(n)?s.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),s.delete(t.target))})},{root:n,rootMargin:o,threshold:"number"==typeof i?i:fa[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),r?void 0:()=>a(!1)),e)},[n,t,o,r]),s},t.useInstantLayoutTransition=_a,t.useInstantTransition=function(){const[t,n]=Os(),o=_a();return e.useEffect(()=>{On.postRender(()=>On.postRender(()=>Co.current=!1))},[n]),e=>{o(()=>{Co.current=!0,t(),e()})}},t.useIsPresent=function(){return null===(t=e.useContext(u))||t.isPresent;var t},t.useIsomorphicLayoutEffect=h,t.useMotionTemplate=function(t,...e){const n=t.length;return _s(e,(function(){let o="";for(let i=0;i<n;i++){o+=t[i];e[i]&&(o+=e[i].get())}return o}))},t.useMotionValue=Zs,t.usePresence=po,t.useReducedMotion=$a,t.useReducedMotionConfig=function(){const t=$a(),{reducedMotion:n}=e.useContext(s);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return r.useCallback(()=>{const t=Ts.current;t&&t.resetTree()},[])},t.useScroll=za,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(s),i=e.useRef(null),r=Zs(z(t)?t.get():t);return e.useMemo(()=>r.attach((t,e)=>o?e(t):(i.current&&i.current.stop(),i.current=zn({from:r.get(),to:t,velocity:r.getVelocity(),...n,onUpdate:e}),r.get())),[JSON.stringify(n)]),function(t,e){h(()=>{if(z(t))return t.onChange(e)},[e])}(t,t=>r.set(parseFloat(t))),r},t.useTime=function(){const t=Zs(0);return Wa(e=>t.set(e)),t},t.useTransform=Js,t.useUnmountEffect=Ce,t.useVelocity=function(t){const n=Zs(t.getVelocity());return e.useEffect(()=>t.velocityUpdateSubscribers.add(t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return eo(!1,"useViewportScroll is deprecated. Convert to useScroll()."),za()},t.useVisualElementContext=l,t.useWillChange=function(){return P(()=>new Ha("auto"))},t.wrapHandler=fe,Object.defineProperty(t,"__esModule",{value:!0})}));
|