react-markdown-typewriter 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.mts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interfaces/index.d.mts +1 -1
- package/dist/interfaces/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {createContext,useMemo,useContext,forwardRef,createElement,useRef,useInsertionEffect,useLayoutEffect,useEffect,useCallback,Fragment,useId,Component}from'react';import {jsx,jsxs}from'react/jsx-runtime';import Oc,{MarkdownAsync}from'react-markdown';var Ga=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var je=createContext({});function ui(t){let e=useRef(null);return e.current===null&&(e.current=t()),e.current}var Gt=typeof window<"u";var fi=Gt?useLayoutEffect:useEffect;var Wt=createContext(null);var Ne=createContext({transformPagePoint:t=>t,isStatic:false,reducedMotion:"never"});function pi(t=true){let e=useContext(Wt);if(e===null)return [true,null];let{isPresent:r,onExitComplete:o,register:i}=e,s=useId();useEffect(()=>{if(t)return i(s)},[t]);let n=useCallback(()=>t&&o&&o(s),[s,o,t]);return !r&&o?[false,n]:[true]}var be=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hi(t,e){let r=new Set,o=new Set,i=false,s=false,n=new WeakSet,a={delta:0,timestamp:0,isProcessing:false};function c(u){n.has(u)&&(m.schedule(u),t()),u(a);}let m={schedule:(u,f=false,p=false)=>{let y=p&&i?r:o;return f&&n.add(u),y.has(u)||y.add(u),u},cancel:u=>{o.delete(u),n.delete(u);},process:u=>{if(a=u,i){s=true;return}i=true,[r,o]=[o,r],r.forEach(c),r.clear(),i=false,s&&(s=false,m.process(u));}};return m}var G={};var Qa=40;function Ue(t,e){let r=false,o=true,i={delta:0,timestamp:0,isProcessing:false},s=()=>r=true,n=be.reduce((d,A)=>(d[A]=hi(s),d),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:m,update:u,preRender:f,render:p,postRender:h}=n,y=()=>{let d=G.useManualTiming?i.timestamp:performance.now();r=false,G.useManualTiming||(i.delta=o?1e3/60:Math.max(Math.min(d-i.timestamp,Qa),1)),i.timestamp=d,i.isProcessing=true,a.process(i),l.process(i),c.process(i),m.process(i),u.process(i),f.process(i),p.process(i),h.process(i),i.isProcessing=false,r&&e&&(o=false,t(y));},v=()=>{r=true,o=true,i.isProcessing||t(y);};return {schedule:be.reduce((d,A)=>{let T=n[A];return d[A]=(w,B=false,S=false)=>(r||v(),T.schedule(w,B,S)),d},{}),cancel:d=>{for(let A=0;A<be.length;A++)n[be[A]].cancel(d);},state:i,steps:n}}var E=t=>t;var{schedule:V,cancel:Y,state:R,steps:Ke}=Ue(typeof requestAnimationFrame<"u"?requestAnimationFrame:E,true);var Ge=createContext({strict:false});var di={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},lt={};for(let t in di)lt[t]={isEnabled:e=>di[t].some(r=>!!e[r])};function gi(t){for(let e in t)lt[e]={...lt[e],...t[e]};}var el=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Ve(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||el.has(t)}var yi=t=>!Ve(t);function rl(t){t&&(yi=e=>e.startsWith("on")?!Ve(e):t(e));}try{rl(Ga("@emotion/is-prop-valid").default);}catch{}function xi(t,e,r){let o={};for(let i in t)i==="values"&&typeof t.values=="object"||(yi(i)||r===true&&Ve(i)||!e&&!Ve(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}var vi=new Set;function $t(t,e,r){t||vi.has(e)||(console.warn(e),vi.add(e));}function Ti(t){if(typeof Proxy>"u")return t;let e=new Map,r=(...o)=>(process.env.NODE_ENV!=="production"&&$t(false,"motion() is deprecated. Use motion.create() instead."),t(...o));return new Proxy(r,{get:(o,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}var xt=createContext({});function vt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function mt(t){return typeof t=="string"||Array.isArray(t)}var We=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Se=["initial",...We];function Et(t){return vt(t.animate)||Se.some(e=>mt(t[e]))}function $e(t){return !!(Et(t)||t.variants)}function bi(t,e){if(Et(t)){let{initial:r,animate:o}=t;return {initial:r===false||mt(r)?r:void 0,animate:mt(o)?o:void 0}}return t.inherit!==false?e:{}}function Si(t){let{initial:e,animate:r}=bi(t,useContext(xt));return useMemo(()=>({initial:e,animate:r}),[Vi(e),Vi(r)])}function Vi(t){return Array.isArray(t)?t.join(" "):t}var Pi=Symbol.for("motionComponentSymbol");function ct(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ai(t,e,r){return useCallback(o=>{o&&t.onMount&&t.onMount(o),e&&(o?e.mount(o):e.unmount()),r&&(typeof r=="function"?r(o):ct(r)&&(r.current=o));},[e])}var Ht=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var al="framerAppearId",He="data-"+Ht(al);var ze=createContext({});var{schedule:zt}=Ue(queueMicrotask,false);function wi(t,e,r,o,i){let{visualElement:s}=useContext(xt),n=useContext(Ge),a=useContext(Wt),l=useContext(Ne).reducedMotion,c=useRef(null);o=o||n.renderer,!c.current&&o&&(c.current=o(t,{visualState:e,parent:s,props:r,presenceContext:a,blockInitialAnimation:a?a.initial===false:false,reducedMotionConfig:l}));let m=c.current,u=useContext(ze);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&ul(c.current,r,i,u);let f=useRef(false);useInsertionEffect(()=>{m&&f.current&&m.update(r,a);});let p=r[He],h=useRef(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return fi(()=>{m&&(f.current=true,window.MotionIsMounted=true,m.updateFeatures(),zt.render(m.render),h.current&&m.animationState&&m.animationState.animateChanges());}),useEffect(()=>{m&&(!h.current&&m.animationState&&m.animationState.animateChanges(),h.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p);}),h.current=false));}),m}function ul(t,e,r,o){let{layoutId:i,layout:s,drag:n,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:m}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:Mi(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!n||a&&ct(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:o,crossfade:m,layoutScroll:l,layoutRoot:c});}function Mi(t){if(t)return t.options.allowProjection!==false?t.projection:Mi(t.parent)}var Q=()=>{},N=()=>{};process.env.NODE_ENV!=="production"&&(Q=(t,e)=>{!t&&typeof console<"u"&&console.warn(e);},N=(t,e)=>{if(!t)throw new Error(e)});function Ci({preloadedFeatures:t,createVisualElement:e,useRender:r,useVisualState:o,Component:i}){t&&gi(t);function s(a,l){let c,m={...useContext(Ne),...a,layoutId:dl(a)},{isStatic:u}=m,f=Si(a),p=o(a,u);if(!u&&Gt){gl(m,t);let h=yl(m);c=h.MeasureLayout,f.visualElement=wi(i,p,m,e,h.ProjectionNode);}return jsxs(xt.Provider,{value:f,children:[c&&f.visualElement?jsx(c,{visualElement:f.visualElement,...m}):null,r(i,a,Ai(p,f.visualElement,l),p,u,f.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;let n=forwardRef(s);return n[Pi]=i,n}function dl({layoutId:t}){let e=useContext(je).id;return e&&t!==void 0?e+"-"+t:t}function gl(t,e){let r=useContext(Ge).strict;if(process.env.NODE_ENV!=="production"&&e&&r){let o="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Q(false,o):N(false,o);}}function yl(t){let{drag:e,layout:r}=lt;if(!e&&!r)return {};let o={...e,...r};return {MeasureLayout:e?.isEnabled(t)||r?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}var Di=t=>e=>typeof e=="string"&&e.startsWith(t),_t=Di("--"),xl=Di("var(--"),Yt=t=>xl(t)?vl.test(t.split("/*")[0].trim()):false,vl=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var Rt={};function Ei(t){for(let e in t)Rt[e]=t[e],_t(e)&&(Rt[e].isCSSVariable=true);}var et=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Z=new Set(et);function _e(t,{layout:e,layoutId:r}){return Z.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!Rt[t]||t==="opacity")}var M=t=>!!(t&&t.getVelocity);var Ye=(t,e)=>e&&typeof t=="number"?e.transform(t):t;var j=(t,e,r)=>r>e?e:r<t?t:r;var rt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ut={...rt,transform:t=>j(0,1,t)},Ae={...rt,default:1};var fo={...rt,transform:Math.round};var we=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ot=we("deg"),W=we("%"),x=we("px"),Ri=we("vh"),Li=we("vw"),po={...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(t*100)};var ki={rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:Ae,scaleX:Ae,scaleY:Ae,scaleZ:Ae,skew:ot,skewX:ot,skewY:ot,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:ut,originX:po,originY:po,originZ:x};var Xt={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,radius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,backgroundPositionX:x,backgroundPositionY:x,...ki,zIndex:fo,fillOpacity:ut,strokeOpacity:ut,numOctaves:fo};var Tl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bl=et.length;function Bi(t,e,r){let o="",i=true;for(let s=0;s<bl;s++){let n=et[s],a=t[n];if(a===void 0)continue;let l=true;if(typeof a=="number"?l=a===(n.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||r){let c=Ye(a,Xt[n]);if(!l){i=false;let m=Tl[n]||n;o+=`${m}(${c}) `;}r&&(e[n]=c);}}return o=o.trim(),r?o=r(e,i?"":o):i&&(o="none"),o}function qt(t,e,r){let{style:o,vars:i,transformOrigin:s}=t,n=false,a=false;for(let l in e){let c=e[l];if(Z.has(l)){n=true;continue}else if(_t(l)){i[l]=c;continue}else {let m=Ye(c,Xt[l]);l.startsWith("origin")?(a=true,s[l]=m):o[l]=m;}}if(e.transform||(n||r?o.transform=Bi(e,t.transform,r):o.transform&&(o.transform="none")),a){let{originX:l="50%",originY:c="50%",originZ:m=0}=s;o.transformOrigin=`${l} ${c} ${m}`;}}var Zt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ho(t,e,r){for(let o in e)!M(e[o])&&!_e(o,r)&&(t[o]=e[o]);}function Sl({transformTemplate:t},e){return useMemo(()=>{let r=Zt();return qt(r,e,t),Object.assign({},r.vars,r.style)},[e])}function Pl(t,e){let r=t.style||{},o={};return ho(o,r,t),Object.assign(o,Sl(t,e)),o}function Fi(t,e){let r={},o=Pl(t,e);return t.drag&&t.dragListener!==false&&(r.draggable=false,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===true?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=o,r}var Oi=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Jt(t){return typeof t!="string"||t.includes("-")?false:!!(Oi.indexOf(t)>-1||/[A-Z]/u.test(t))}var Al={offset:"stroke-dashoffset",array:"stroke-dasharray"},wl={offset:"strokeDashoffset",array:"strokeDasharray"};function Ii(t,e,r=1,o=0,i=true){t.pathLength=1;let s=i?Al:wl;t[s.offset]=x.transform(-o);let n=x.transform(e),a=x.transform(r);t[s.array]=`${n} ${a}`;}function Xe(t,{attrX:e,attrY:r,attrScale:o,pathLength:i,pathSpacing:s=1,pathOffset:n=0,...a},l,c,m){if(qt(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:u,style:f}=t;u.transform&&(f.transform=u.transform,delete u.transform),(f.transform||u.transformOrigin)&&(f.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),f.transform&&(f.transformBox=m?.transformBox??"fill-box",delete u.transformBox),e!==void 0&&(u.x=e),r!==void 0&&(u.y=r),o!==void 0&&(u.scale=o),i!==void 0&&Ii(u,i,s,n,false);}var qe=()=>({...Zt(),attrs:{}});var Ze=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ji(t,e,r,o){let i=useMemo(()=>{let s=qe();return Xe(s,e,Ze(o),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){let s={};ho(s,t.style,t),i.style={...s,...i.style};}return i}function Ni(t=false){return (r,o,i,{latestValues:s},n)=>{let l=(Jt(r)?ji:Fi)(o,s,n,r),c=xi(o,typeof r=="string",t),m=r!==Fragment?{...c,...l,ref:i}:{},{children:u}=o,f=useMemo(()=>M(u)?u.get():u,[u]);return createElement(r,{...m,children:f})}}function Ui(t){let e=[{},{}];return t?.values.forEach((r,o)=>{e[0][o]=r.get(),e[1][o]=r.getVelocity();}),e}function Qt(t,e,r,o){if(typeof e=="function"){let[i,s]=Ui(o);e=e(r!==void 0?r:t.custom,i,s);}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){let[i,s]=Ui(o);e=e(r!==void 0?r:t.custom,i,s);}return e}function te(t){return M(t)?t.get():t}function Rl({scrapeMotionValuesFromProps:t,createRenderState:e},r,o,i){return {latestValues:Ll(r,o,i,t),renderState:e()}}var Je=t=>(e,r)=>{let o=useContext(xt),i=useContext(Wt),s=()=>Rl(t,e,o,i);return r?s():ui(s)};function Ll(t,e,r,o){let i={},s=o(t,{});for(let f in s)i[f]=te(s[f]);let{initial:n,animate:a}=t,l=Et(t),c=$e(t);e&&c&&!l&&t.inherit!==false&&(n===void 0&&(n=e.initial),a===void 0&&(a=e.animate));let m=r?r.initial===false:false;m=m||n===false;let u=m?a:n;if(u&&typeof u!="boolean"&&!vt(u)){let f=Array.isArray(u)?u:[u];for(let p=0;p<f.length;p++){let h=Qt(t,f[p]);if(h){let{transitionEnd:y,transition:v,...g}=h;for(let b in g){let d=g[b];if(Array.isArray(d)){let A=m?d.length-1:0;d=d[A];}d!==null&&(i[b]=d);}for(let b in y)i[b]=y[b];}}}return i}function ee(t,e,r){let{style:o}=t,i={};for(let s in o)(M(o[s])||e.style&&M(e.style[s])||_e(s,t)||r?.getValue(s)?.liveStyle!==void 0)&&(i[s]=o[s]);return i}var Gi={useVisualState:Je({scrapeMotionValuesFromProps:ee,createRenderState:Zt})};function Qe(t,e,r){let o=ee(t,e,r);for(let i in t)if(M(t[i])||M(e[i])){let s=et.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;o[s]=t[i];}return o}var Wi={useVisualState:Je({scrapeMotionValuesFromProps:Qe,createRenderState:qe})};function $i(t,e){return function(o,{forwardMotionProps:i}={forwardMotionProps:false}){let n={...Jt(o)?Wi:Gi,preloadedFeatures:t,useRender:Ni(i),createVisualElement:e,Component:o};return Ci(n)}}function ft(t,e,r){let o=t.getProps();return Qt(o,e,r!==void 0?r:o.custom,t)}var Me=t=>Array.isArray(t);var tr;function kl(){tr=void 0;}var L={now:()=>(tr===void 0&&L.set(R.isProcessing||G.useManualTiming?R.timestamp:performance.now()),tr),set:t=>{tr=t,queueMicrotask(kl);}};function re(t,e){t.indexOf(e)===-1&&t.push(e);}function oe(t,e){let r=t.indexOf(e);r>-1&&t.splice(r,1);}var Tt=class{constructor(){this.subscriptions=[];}add(e){return re(this.subscriptions,e),()=>oe(this.subscriptions,e)}notify(e,r,o){let i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,o);else for(let s=0;s<i;s++){let n=this.subscriptions[s];n&&n(e,r,o);}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0;}};function er(t,e){return e?t*(1e3/e):0}var Hi=30,Bl=t=>!isNaN(parseFloat(t)),go=class{constructor(e,r={}){this.version="__VERSION__",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,i=true)=>{let s=L.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change?.notify(this.current),i&&this.events.renderRequest?.notify(this.current);},this.hasAnimated=false,this.setCurrent(e),this.owner=r.owner;}setCurrent(e){this.current=e,this.updatedAt=L.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Bl(this.current));}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt;}onChange(e){return process.env.NODE_ENV!=="production"&&$t(false,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new Tt);let o=this.events[e].add(r);return e==="change"?()=>{o(),V.read(()=>{this.events.change.getSize()||this.stop();});}:o}clearListeners(){for(let e in this.events)this.events[e].clear();}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r;}set(e,r=true){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify);}setWithVelocity(e,r,o){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-o;}jump(e,r=true){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}get(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=L.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Hi)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,Hi);return er(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=true,this.animation=e(r),this.events.animationStart&&this.events.animationStart.notify();}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation();})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation();}isAnimating(){return !!this.animation}clearAnimation(){delete this.animation;}destroy(){this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}};function pt(t,e){return new go(t,e)}function Fl(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,pt(r));}function Ol(t){return Me(t)?t[t.length-1]||0:t}function _i(t,e){let r=ft(t,e),{transitionEnd:o={},transition:i={},...s}=r||{};s={...s,...o};for(let n in s){let a=Ol(s[n]);Fl(t,n,a);}}function Yi(t){return !!(M(t)&&t.add)}function Ce(t,e){let r=t.getValue("willChange");if(Yi(r))return r.add(e);if(!r&&G.WillChange){let o=new G.WillChange("auto");t.addValue("willChange",o),o.add(e);}}function rr(t){return t.props[He]}var Il=t=>t!==null;function Xi(t,{repeat:e,repeatType:r="loop"},o){let i=t.filter(Il),s=e&&r!=="loop"&&e%2===1?0:i.length-1;return !s||o===void 0?i[s]:o}var jl={type:"spring",stiffness:500,damping:25,restSpeed:10},Nl=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Ul={type:"keyframes",duration:.8},Kl={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},qi=(t,{keyframes:e})=>e.length>2?Ul:Z.has(t)?t.startsWith("scale")?Nl(e[1]):jl:Kl;function Zi({when:t,delay:e,delayChildren:r,staggerChildren:o,staggerDirection:i,repeat:s,repeatType:n,repeatDelay:a,from:l,elapsed:c,...m}){return !!Object.keys(m).length}function ie(t,e){return t?.[e]??t?.default??t}var O=t=>t*1e3,U=t=>t/1e3;var bt=t=>Math.round(t*1e5)/1e5;var ne=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ji(t){return t==null}var Qi=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var se=(t,e)=>r=>!!(typeof r=="string"&&Qi.test(r)&&r.startsWith(t)||e&&!Ji(r)&&Object.prototype.hasOwnProperty.call(r,e)),or=(t,e,r)=>o=>{if(typeof o!="string")return o;let[i,s,n,a]=o.match(ne);return {[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(n),alpha:a!==void 0?parseFloat(a):1}};var Gl=t=>j(0,255,t),yo={...rt,transform:t=>Math.round(Gl(t))},nt={test:se("rgb","red"),parse:or("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:o=1})=>"rgba("+yo.transform(t)+", "+yo.transform(e)+", "+yo.transform(r)+", "+bt(ut.transform(o))+")"};function Wl(t){let e="",r="",o="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),o=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),o=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}}var De={test:se("#"),parse:Wl,transform:nt.transform};var Vt={test:se("hsl","hue"),parse:or("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:o=1})=>"hsla("+Math.round(t)+", "+W.transform(bt(e))+", "+W.transform(bt(r))+", "+bt(ut.transform(o))+")"};var k={test:t=>nt.test(t)||De.test(t)||Vt.test(t),parse:t=>nt.test(t)?nt.parse(t):Vt.test(t)?Vt.parse(t):De.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?nt.transform(t):Vt.transform(t)};var tn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function $l(t){return isNaN(t)&&typeof t=="string"&&(t.match(ne)?.length||0)+(t.match(tn)?.length||0)>0}var rn="number",on="color",Hl="var",zl="var(",en="${}",_l=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Lt(t){let e=t.toString(),r=[],o={color:[],number:[],var:[]},i=[],s=0,a=e.replace(_l,l=>(k.test(l)?(o.color.push(s),i.push(on),r.push(k.parse(l))):l.startsWith(zl)?(o.var.push(s),i.push(Hl),r.push(l)):(o.number.push(s),i.push(rn),r.push(parseFloat(l))),++s,en)).split(en);return {values:r,split:a,indexes:o,types:i}}function nn(t){return Lt(t).values}function sn(t){let{split:e,types:r}=Lt(t),o=e.length;return i=>{let s="";for(let n=0;n<o;n++)if(s+=e[n],i[n]!==void 0){let a=r[n];a===rn?s+=bt(i[n]):a===on?s+=k.transform(i[n]):s+=i[n];}return s}}var Yl=t=>typeof t=="number"?0:t;function Xl(t){let e=nn(t);return sn(t)(e.map(Yl))}var $={test:$l,parse:nn,createTransformer:sn,getAnimatableNone:Xl};function xo(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function an({hue:t,saturation:e,lightness:r,alpha:o}){t/=360,e/=100,r/=100;let i=0,s=0,n=0;if(!e)i=s=n=r;else {let a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;i=xo(l,a,t+1/3),s=xo(l,a,t),n=xo(l,a,t-1/3);}return {red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(n*255),alpha:o}}function ae(t,e){return r=>r>0?e:t}var P=(t,e,r)=>t+(e-t)*r;var vo=(t,e,r)=>{let o=t*t,i=r*(e*e-o)+o;return i<0?0:Math.sqrt(i)},ql=[De,nt,Vt],Zl=t=>ql.find(e=>e.test(t));function ln(t){let e=Zl(t);if(Q(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return false;let r=e.parse(t);return e===Vt&&(r=an(r)),r}var To=(t,e)=>{let r=ln(t),o=ln(e);if(!r||!o)return ae(t,e);let i={...r};return s=>(i.red=vo(r.red,o.red,s),i.green=vo(r.green,o.green,s),i.blue=vo(r.blue,o.blue,s),i.alpha=P(r.alpha,o.alpha,s),nt.transform(i))};var ir=new Set(["none","hidden"]);function mn(t,e){return ir.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}var Jl=(t,e)=>r=>e(t(r)),st=(...t)=>t.reduce(Jl);function Ql(t,e){return r=>P(t,e,r)}function nr(t){return typeof t=="number"?Ql:typeof t=="string"?Yt(t)?ae:k.test(t)?To:rm:Array.isArray(t)?cn:typeof t=="object"?k.test(t)?To:tm:ae}function cn(t,e){let r=[...t],o=r.length,i=t.map((s,n)=>nr(s)(s,e[n]));return s=>{for(let n=0;n<o;n++)r[n]=i[n](s);return r}}function tm(t,e){let r={...t,...e},o={};for(let i in r)t[i]!==void 0&&e[i]!==void 0&&(o[i]=nr(t[i])(t[i],e[i]));return i=>{for(let s in o)r[s]=o[s](i);return r}}function em(t,e){let r=[],o={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){let s=e.types[i],n=t.indexes[s][o[s]],a=t.values[n]??0;r[i]=a,o[s]++;}return r}var rm=(t,e)=>{let r=$.createTransformer(e),o=Lt(t),i=Lt(e);return o.indexes.var.length===i.indexes.var.length&&o.indexes.color.length===i.indexes.color.length&&o.indexes.number.length>=i.indexes.number.length?ir.has(t)&&!i.values.length||ir.has(e)&&!o.values.length?mn(t,e):st(cn(em(o,i),i.values),r):(Q(true,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),ae(t,e))};function sr(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?P(t,e,r):nr(t)(t,e)}var un=t=>{let e=({timestamp:r})=>t(r);return {start:()=>V.update(e,true),stop:()=>Y(e),now:()=>R.isProcessing?R.timestamp:L.now()}};var ar=(t,e,r=10)=>{let o="",i=Math.max(Math.round(e/r),2);for(let s=0;s<i;s++)o+=t(s/(i-1))+", ";return `linear(${o.substring(0,o.length-2)})`};function le(t){let e=0,r=50,o=t.next(e);for(;!o.done&&e<2e4;)e+=r,o=t.next(e);return e>=2e4?1/0:e}function fn(t,e=100,r){let o=r({...t,keyframes:[0,e]}),i=Math.min(le(o),2e4);return {type:"keyframes",ease:s=>o.next(i*s).value/e,duration:U(i)}}var om=5;function lr(t,e,r){let o=Math.max(e-om,0);return er(r-t(o),e-o)}var C={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var Vo=.001;function pn({duration:t=C.duration,bounce:e=C.bounce,velocity:r=C.velocity,mass:o=C.mass}){let i,s;Q(t<=O(C.maxDuration),"Spring duration must be 10 seconds or less");let n=1-e;n=j(C.minDamping,C.maxDamping,n),t=j(C.minDuration,C.maxDuration,U(t)),n<1?(i=c=>{let m=c*n,u=m*t,f=m-r,p=mr(c,n),h=Math.exp(-u);return Vo-f/p*h},s=c=>{let u=c*n*t,f=u*r+r,p=Math.pow(n,2)*Math.pow(c,2)*t,h=Math.exp(-u),y=mr(Math.pow(c,2),n);return (-i(c)+Vo>0?-1:1)*((f-p)*h)/y}):(i=c=>{let m=Math.exp(-c*t),u=(c-r)*t+1;return -1e-3+m*u},s=c=>{let m=Math.exp(-c*t),u=(r-c)*(t*t);return m*u});let a=5/t,l=nm(i,s,a);if(t=O(t),isNaN(l))return {stiffness:C.stiffness,damping:C.damping,duration:t};{let c=Math.pow(l,2)*o;return {stiffness:c,damping:n*2*Math.sqrt(o*c),duration:t}}}var im=12;function nm(t,e,r){let o=r;for(let i=1;i<im;i++)o=o-t(o)/e(o);return o}function mr(t,e){return t*Math.sqrt(1-e*e)}var sm=["duration","bounce"],am=["stiffness","damping","mass"];function hn(t,e){return e.some(r=>t[r]!==void 0)}function lm(t){let e={velocity:C.velocity,stiffness:C.stiffness,damping:C.damping,mass:C.mass,isResolvedFromDuration:false,...t};if(!hn(t,am)&&hn(t,sm))if(t.visualDuration){let r=t.visualDuration,o=2*Math.PI/(r*1.2),i=o*o,s=2*j(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:C.mass,stiffness:i,damping:s};}else {let r=pn(t);e={...e,...r,mass:C.mass},e.isResolvedFromDuration=true;}return e}function me(t=C.visualDuration,e=C.bounce){let r=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:o,restDelta:i}=r,s=r.keyframes[0],n=r.keyframes[r.keyframes.length-1],a={done:false,value:s},{stiffness:l,damping:c,mass:m,duration:u,velocity:f,isResolvedFromDuration:p}=lm({...r,velocity:-U(r.velocity||0)}),h=f||0,y=c/(2*Math.sqrt(l*m)),v=n-s,g=U(Math.sqrt(l/m)),b=Math.abs(v)<5;o||(o=b?C.restSpeed.granular:C.restSpeed.default),i||(i=b?C.restDelta.granular:C.restDelta.default);let d;if(y<1){let T=mr(g,y);d=w=>{let B=Math.exp(-y*g*w);return n-B*((h+y*g*v)/T*Math.sin(T*w)+v*Math.cos(T*w))};}else if(y===1)d=T=>n-Math.exp(-g*T)*(v+(h+g*v)*T);else {let T=g*Math.sqrt(y*y-1);d=w=>{let B=Math.exp(-y*g*w),S=Math.min(T*w,300);return n-B*((h+y*g*v)*Math.sinh(S)+T*v*Math.cosh(S))/T};}let A={calculatedDuration:p&&u||null,next:T=>{let w=d(T);if(p)a.done=T>=u;else {let B=T===0?h:0;y<1&&(B=T===0?O(h):lr(d,T,w));let S=Math.abs(B)<=o,H=Math.abs(n-w)<=i;a.done=S&&H;}return a.value=a.done?n:w,a},toString:()=>{let T=Math.min(le(A),2e4),w=ar(B=>A.next(T*B).value,T,30);return T+"ms "+w},toTransition:()=>{}};return A}me.applyToOptions=t=>{let e=fn(t,100,me);return t.ease=e.ease,t.duration=O(e.duration),t.type="keyframes",t};function Ee({keyframes:t,velocity:e=0,power:r=.8,timeConstant:o=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:n,min:a,max:l,restDelta:c=.5,restSpeed:m}){let u=t[0],f={done:false,value:u},p=S=>a!==void 0&&S<a||l!==void 0&&S>l,h=S=>a===void 0?l:l===void 0||Math.abs(a-S)<Math.abs(l-S)?a:l,y=r*e,v=u+y,g=n===void 0?v:n(v);g!==v&&(y=g-u);let b=S=>-y*Math.exp(-S/o),d=S=>g+b(S),A=S=>{let H=b(S),q=d(S);f.done=Math.abs(H)<=c,f.value=f.done?g:q;},T,w,B=S=>{p(f.value)&&(T=S,w=me({keyframes:[f.value,h(f.value)],velocity:lr(d,S,f.value),damping:i,stiffness:s,restDelta:c,restSpeed:m}));};return B(0),{calculatedDuration:null,next:S=>{let H=false;return !w&&T===void 0&&(H=true,A(S),B(S)),T!==void 0&&S>=T?w.next(S-T):(!H&&A(S),f)}}}var ht=(t,e,r)=>{let o=e-t;return o===0?1:(r-t)/o};function mm(t,e,r){let o=[],i=r||G.mix||sr,s=t.length-1;for(let n=0;n<s;n++){let a=i(t[n],t[n+1]);if(e){let l=Array.isArray(e)?e[n]||E:e;a=st(l,a);}o.push(a);}return o}function dn(t,e,{clamp:r=true,ease:o,mixer:i}={}){let s=t.length;if(N(s===e.length,"Both input and output ranges must be the same length"),s===1)return ()=>e[0];if(s===2&&e[0]===e[1])return ()=>e[1];let n=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());let a=mm(e,o,i),l=a.length,c=m=>{if(n&&m<t[0])return e[0];let u=0;if(l>1)for(;u<t.length-2&&!(m<t[u+1]);u++);let f=ht(t[u],t[u+1],m);return a[u](f)};return r?m=>c(j(t[0],t[s-1],m)):c}function gn(t,e){let r=t[t.length-1];for(let o=1;o<=e;o++){let i=ht(0,e,o);t.push(P(r,1,i));}}function yn(t){let e=[0];return gn(e,t.length-1),e}function xn(t,e){return t.map(r=>r*e)}var vn=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,cm=1e-7,um=12;function fm(t,e,r,o,i){let s,n,a=0;do n=e+(r-e)/2,s=vn(n,o,i)-t,s>0?r=n:e=n;while(Math.abs(s)>cm&&++a<um);return n}function St(t,e,r,o){if(t===e&&r===o)return E;let i=s=>fm(s,0,1,t,r);return s=>s===0||s===1?s:vn(i(s),e,o)}var Tn=St(.42,0,1,1),bn=St(0,0,.58,1),cr=St(.42,0,.58,1);var Vn=t=>Array.isArray(t)&&typeof t[0]!="number";var ur=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2;var fr=t=>e=>1-t(1-e);var So=St(.33,1.53,.69,.99),Re=fr(So),pr=ur(Re);var hr=t=>(t*=2)<1?.5*Re(t):.5*(2-Math.pow(2,-10*(t-1)));var dr=t=>1-Math.sin(Math.acos(t)),gr=fr(dr),yr=ur(dr);var xr=t=>Array.isArray(t)&&typeof t[0]=="number";var Sn={linear:E,easeIn:Tn,easeInOut:cr,easeOut:bn,circIn:dr,circInOut:yr,circOut:gr,backIn:Re,backInOut:pr,backOut:So,anticipate:hr},pm=t=>typeof t=="string",Po=t=>{if(xr(t)){N(t.length===4,"Cubic bezier arrays must contain four numerical values.");let[e,r,o,i]=t;return St(e,r,o,i)}else if(pm(t))return N(Sn[t]!==void 0,`Invalid easing type '${t}'`),Sn[t];return t};function hm(t,e){return t.map(()=>e||cr).splice(0,t.length-1)}function Pt({duration:t=300,keyframes:e,times:r,ease:o="easeInOut"}){let i=Vn(o)?o.map(Po):Po(o),s={done:false,value:e[0]},n=xn(r&&r.length===e.length?r:yn(e),t),a=dn(n,e,{ease:Array.isArray(i)?i:hm(e,i)});return {calculatedDuration:t,next:l=>(s.value=a(l),s.done=l>=t,s)}}var dm=t=>t!==null;function ce(t,{repeat:e,repeatType:r="loop"},o,i=1){let s=t.filter(dm),a=i<0||e&&r!=="loop"&&e%2===1?0:s.length-1;return !a||o===void 0?s[a]:o}var gm={decay:Ee,inertia:Ee,tween:Pt,keyframes:Pt,spring:me};function vr(t){typeof t.type=="string"&&(t.type=gm[t.type]);}var At=class{constructor(){this.count=0,this.updateFinished();}get finished(){return this._finished}updateFinished(){this.count++,this._finished=new Promise(e=>{this.resolve=e;});}notifyFinished(){this.resolve();}then(e,r){return this.finished.then(e,r)}};var ym=t=>t/100,ue=class extends At{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=false,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:r}=this.options;if(r&&r.updatedAt!==L.now()&&this.tick(L.now()),this.isStopped=true,this.state==="idle")return;this.teardown();let{onStop:o}=this.options;o&&o();},this.options=e,this.initAnimation(),this.play(),e.autoplay===false&&this.pause();}initAnimation(){let{options:e}=this;vr(e);let{type:r=Pt,repeat:o=0,repeatDelay:i=0,repeatType:s,velocity:n=0}=e,{keyframes:a}=e,l=r||Pt;process.env.NODE_ENV!=="production"&&l!==Pt&&N(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),l!==Pt&&typeof a[0]!="number"&&(this.mixKeyframes=st(ym,sr(a[0],a[1])),a=[0,100]);let c=l({...e,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-n})),c.calculatedDuration===null&&(c.calculatedDuration=le(c));let{calculatedDuration:m}=c;this.calculatedDuration=m,this.resolvedDuration=m+i,this.totalDuration=this.resolvedDuration*(o+1)-i,this.generator=c;}updateTime(e){let r=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r;}tick(e,r=false){let{generator:o,totalDuration:i,mixKeyframes:s,mirroredGenerator:n,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return o.next(0);let{delay:c=0,keyframes:m,repeat:u,repeatType:f,repeatDelay:p,type:h,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),r?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let d=this.currentTime,A=o;if(u){let S=Math.min(this.currentTime,i)/a,H=Math.floor(S),q=S%1;!q&&S>=1&&(q=1),q===1&&H--,H=Math.min(H,u+1),!!(H%2)&&(f==="reverse"?(q=1-q,p&&(q-=p/a)):f==="mirror"&&(A=n)),d=j(0,1,q)*a;}let T=b?{done:false,value:m[0]}:A.next(d);s&&(T.value=s(T.value));let{done:w}=T;!b&&l!==null&&(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);let B=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&w);return B&&h!==Ee&&(T.value=ce(m,this.options,v,this.speed)),y&&y(T.value),B&&this.finish(),T}then(e,r){return this.finished.then(e,r)}get duration(){return U(this.calculatedDuration)}get time(){return U(this.currentTime)}set time(e){e=O(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed);}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(L.now());let r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=U(this.currentTime));}play(){if(this.isStopped)return;let{driver:e=un,onPlay:r,startTime:o}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),r&&r();let i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=o??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start();}pause(){this.state="paused",this.updateTime(L.now()),this.holdTime=this.currentTime;}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null;}finish(){this.teardown(),this.state="finished";let{onComplete:e}=this.options;e&&e();}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown();}teardown(){this.notifyFinished(),this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null;}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0);}sample(e){return this.startTime=0,this.tick(e,true)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),e.observe(this)}};function Pn(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1]);}var kt=t=>t*180/Math.PI,Ao=t=>{let e=kt(Math.atan2(t[1],t[0]));return wo(e)},xm={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ao,rotateZ:Ao,skewX:t=>kt(Math.atan(t[1])),skewY:t=>kt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},wo=t=>(t=t%360,t<0&&(t+=360),t),An=Ao,wn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Mn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),vm={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:wn,scaleY:Mn,scale:t=>(wn(t)+Mn(t))/2,rotateX:t=>wo(kt(Math.atan2(t[6],t[5]))),rotateY:t=>wo(kt(Math.atan2(-t[2],t[0]))),rotateZ:An,rotate:An,skewX:t=>kt(Math.atan(t[4])),skewY:t=>kt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Cn(t){return t.includes("scale")?1:0}function Tr(t,e){if(!t||t==="none")return Cn(e);let r=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),o,i;if(r)o=vm,i=r;else {let a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=xm,i=a;}if(!i)return Cn(e);let s=o[e],n=i[1].split(",").map(Tm);return typeof s=="function"?s(n):n[s]}var Dn=(t,e)=>{let{transform:r="none"}=getComputedStyle(t);return Tr(r,e)};function Tm(t){return parseFloat(t.trim())}var Mo=t=>t===rt||t===x,bm=new Set(["x","y","z"]),Vm=et.filter(t=>!bm.has(t));function En(t){let e=[];return Vm.forEach(r=>{let o=t.getValue(r);o!==void 0&&(e.push([r,o.get()]),o.set(r.startsWith("scale")?1:0));}),e}var wt={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),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:(t,{transform:e})=>Tr(e,"x"),y:(t,{transform:e})=>Tr(e,"y")};wt.translateX=wt.x;wt.translateY=wt.y;var Bt=new Set,Co=false,Do=false,Eo=false;function Rn(){if(Do){let t=Array.from(Bt).filter(o=>o.needsMeasurement),e=new Set(t.map(o=>o.element)),r=new Map;e.forEach(o=>{let i=En(o);i.length&&(r.set(o,i),o.render());}),t.forEach(o=>o.measureInitialState()),e.forEach(o=>{o.render();let i=r.get(o);i&&i.forEach(([s,n])=>{o.getValue(s)?.set(n);});}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY);});}Do=false,Co=false,Bt.forEach(t=>t.complete(Eo)),Bt.clear();}function Ln(){Bt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Do=true);});}function kn(){Eo=true,Ln(),Rn(),Eo=false;}var Mt=class{constructor(e,r,o,i,s,n=false){this.isComplete=false,this.isAsync=false,this.needsMeasurement=false,this.isScheduled=false,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=o,this.motionValue=i,this.element=s,this.isAsync=n;}scheduleResolve(){this.isScheduled=true,this.isAsync?(Bt.add(this),Co||(Co=true,V.read(Ln),V.resolveKeyframes(Rn))):(this.readKeyframes(),this.complete());}readKeyframes(){let{unresolvedKeyframes:e,name:r,element:o,motionValue:i}=this;if(e[0]===null){let s=i?.get(),n=e[e.length-1];if(s!==void 0)e[0]=s;else if(o&&r){let a=o.readValue(r,n);a!=null&&(e[0]=a);}e[0]===void 0&&(e[0]=n),i&&s===void 0&&i.set(e[0]);}Pn(e);}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=false){this.isComplete=true,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Bt.delete(this);}cancel(){this.isComplete||(this.isScheduled=false,Bt.delete(this));}resume(){this.isComplete||this.scheduleResolve();}};var Bn=t=>t.startsWith("--");function Fn(t,e,r){Bn(e)?t.style.setProperty(e,r):t.style[e]=r;}function fe(t){let e;return ()=>(e===void 0&&(e=t()),e)}var On=fe(()=>window.ScrollTimeline!==void 0);var In={};function jn(t,e){let r=fe(t);return ()=>In[e]??r()}var br=jn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"});}catch{return false}return true},"linearEasing");var Ft=([t,e,r,o])=>`cubic-bezier(${t}, ${e}, ${r}, ${o})`;var Ro={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ft([0,.65,.55,1]),circOut:Ft([.55,0,1,.45]),backIn:Ft([.31,.01,.66,-0.59]),backOut:Ft([.33,1.53,.69,.99])};function Lo(t,e){if(t)return typeof t=="function"?br()?ar(t,e):"ease-out":xr(t)?Ft(t):Array.isArray(t)?t.map(r=>Lo(r,e)||Ro.easeOut):Ro[t]}function Nn(t,e,r,{delay:o=0,duration:i=300,repeat:s=0,repeatType:n="loop",ease:a="easeOut",times:l}={},c=void 0){let m={[e]:r};l&&(m.offset=l);let u=Lo(a,i);Array.isArray(u)&&(m.easing=u);let f={delay:o,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:n==="reverse"?"alternate":"normal"};c&&(f.pseudoElement=c);let p=t.animate(m,f);return p}function Vr(t){return typeof t=="function"&&"applyToOptions"in t}function Un({type:t,...e}){return Vr(t)&&br()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}var Sr=class extends At{constructor(e){if(super(),this.finishedTime=null,this.isStopped=false,!e)return;let{element:r,name:o,keyframes:i,pseudoElement:s,allowFlatten:n=false,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!s,this.allowFlatten=n,this.options=e,N(typeof e.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);let c=Un(e);this.animation=Nn(r,o,i,c,s),c.autoplay===false&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let m=ce(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(m):Fn(r,o,m),this.animation.cancel();}l?.(),this.notifyFinished();},this.animation.oncancel=()=>this.notifyFinished();}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished());}pause(){this.animation.pause();}complete(){this.animation.finish?.();}cancel(){try{this.animation.cancel();}catch{}}stop(){if(this.isStopped)return;this.isStopped=true;let{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel());}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.();}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return U(Number(e))}get time(){return U(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=O(e);}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e;}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e;}attachTimeline({timeline:e,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&On()?(this.animation.timeline=e,E):r(this)}};var Kn={anticipate:hr,backInOut:pr,circInOut:yr};function Sm(t){return t in Kn}function Gn(t){typeof t.ease=="string"&&Sm(t.ease)&&(t.ease=Kn[t.ease]);}var Wn=10,Pr=class extends Sr{constructor(e){Gn(e),vr(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e;}updateMotionValue(e){let{motionValue:r,onUpdate:o,onComplete:i,element:s,...n}=this.options;if(!r)return;if(e!==void 0){r.set(e);return}let a=new ue({...n,autoplay:false}),l=O(this.finishedTime??this.time);r.setWithVelocity(a.sample(l-Wn).value,a.sample(l).value,Wn),a.stop();}};var ko=(t,e)=>e==="zIndex"?false:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&($.test(t)||t==="0")&&!t.startsWith("url("));function Pm(t){let e=t[0];if(t.length===1)return true;for(let r=0;r<t.length;r++)if(t[r]!==e)return true}function $n(t,e,r,o){let i=t[0];if(i===null)return false;if(e==="display"||e==="visibility")return true;let s=t[t.length-1],n=ko(i,e),a=ko(s,e);return Q(n===a,`You are trying to animate ${e} from "${i}" to "${s}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${s} via the \`style\` property.`),!n||!a?false:Pm(t)||(r==="spring"||Vr(r))&&o}var Am=new Set(["opacity","clipPath","filter","transform"]),wm=fe(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Hn(t){let{motionValue:e,name:r,repeatDelay:o,repeatType:i,damping:s,type:n}=t;if(!e||!e.owner||!(e.owner.current instanceof HTMLElement))return false;let{onUpdate:a,transformTemplate:l}=e.owner.getProps();return wm()&&r&&Am.has(r)&&(r!=="transform"||!l)&&!a&&!o&&i!=="mirror"&&s!==0&&n!=="inertia"}var Mm=40,Ar=class extends At{constructor({autoplay:e=true,delay:r=0,type:o="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:n="loop",keyframes:a,name:l,motionValue:c,element:m,...u}){super(),this.stop=()=>{this._animation?(this._animation.stop(),this.stopTimeline?.()):this.keyframeResolver?.cancel();},this.createdAt=L.now();let f={autoplay:e,delay:r,type:o,repeat:i,repeatDelay:s,repeatType:n,name:l,motionValue:c,element:m,...u},p=m?.KeyframeResolver||Mt;this.keyframeResolver=new p(a,(h,y,v)=>this.onKeyframesResolved(h,y,f,!v),l,c,m),this.keyframeResolver?.scheduleResolve();}onKeyframesResolved(e,r,o,i){this.keyframeResolver=void 0;let{name:s,type:n,velocity:a,delay:l,isHandoff:c,onUpdate:m}=o;this.resolvedAt=L.now(),$n(e,s,n,a)||((G.instantAnimations||!l)&&m?.(ce(e,o,r)),e[0]=e[e.length-1],o.duration=0,o.repeat=0);let f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Mm?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...o,keyframes:e},p=!c&&Hn(f)?new Pr({...f,element:f.motionValue.owner.current}):new ue(f);p.finished.then(()=>this.notifyFinished()).catch(E),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p;}get finished(){return this._animation?this.animation.finished:this._finished}then(e,r){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||kn(),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e;}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e;}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play();}pause(){this.animation.pause();}complete(){this.animation.complete();}cancel(){this.animation.cancel();}};var pe=(t,e,r,o={},i,s)=>n=>{let a=ie(o,t)||{},l=a.delay||o.delay||0,{elapsed:c=0}=o;c=c-O(l);let m={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f);},onComplete:()=>{n(),a.onComplete&&a.onComplete();},name:t,motionValue:e,element:s?void 0:i};Zi(a)||Object.assign(m,qi(t,m)),m.duration&&(m.duration=O(m.duration)),m.repeatDelay&&(m.repeatDelay=O(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let u=false;if((m.type===false||m.duration===0&&!m.repeatDelay)&&(m.duration=0,m.delay===0&&(u=true)),(G.instantAnimations||G.skipAnimations)&&(u=true,m.duration=0,m.delay=0),m.allowFlatten=!a.type&&!a.ease,u&&!s&&e.get()!==void 0){let f=Xi(m.keyframes,a);if(f!==void 0){V.update(()=>{m.onUpdate(f),m.onComplete();});return}}return new Ar(m)};var wr=new Set(["width","height","top","left","right","bottom",...et]);function Cm({protectedKeys:t,needsAnimating:e},r){let o=t.hasOwnProperty(r)&&e[r]!==true;return e[r]=false,o}function Mr(t,e,{delay:r=0,transitionOverride:o,type:i}={}){let{transition:s=t.getDefaultTransition(),transitionEnd:n,...a}=e;o&&(s=o);let l=[],c=i&&t.animationState&&t.animationState.getState()[i];for(let m in a){let u=t.getValue(m,t.latestValues[m]??null),f=a[m];if(f===void 0||c&&Cm(c,m))continue;let p={delay:r,...ie(s||{},m)},h=u.get();if(h!==void 0&&!u.isAnimating&&!Array.isArray(f)&&f===h&&!p.velocity)continue;let y=false;if(window.MotionHandoffAnimation){let g=rr(t);if(g){let b=window.MotionHandoffAnimation(g,m,V);b!==null&&(p.startTime=b,y=true);}}Ce(t,m),u.start(pe(m,u,f,t.shouldReduceMotion&&wr.has(m)?{type:false}:p,t,y));let v=u.animation;v&&l.push(v);}return n&&Promise.all(l).then(()=>{V.update(()=>{n&&_i(t,n);});}),l}function Cr(t,e,r={}){let o=ft(t,e,r.type==="exit"?t.presenceContext?.custom:void 0),{transition:i=t.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(i=r.transitionOverride);let s=o?()=>Promise.all(Mr(t,o,r)):()=>Promise.resolve(),n=t.variantChildren&&t.variantChildren.size?(l=0)=>{let{delayChildren:c=0,staggerChildren:m,staggerDirection:u}=i;return Dm(t,e,c+l,m,u,r)}:()=>Promise.resolve(),{when:a}=i;if(a){let[l,c]=a==="beforeChildren"?[s,n]:[n,s];return l().then(()=>c())}else return Promise.all([s(),n(r.delay)])}function Dm(t,e,r=0,o=0,i=1,s){let n=[],a=(t.variantChildren.size-1)*o,l=i===1?(c=0)=>c*o:(c=0)=>a-c*o;return Array.from(t.variantChildren).sort(Em).forEach((c,m)=>{c.notify("AnimationStart",e),n.push(Cr(c,e,{...s,delay:r+l(m)}).then(()=>c.notify("AnimationComplete",e)));}),Promise.all(n)}function Em(t,e){return t.sortNodePosition(e)}function zn(t,e,r={}){t.notify("AnimationStart",e);let o;if(Array.isArray(e)){let i=e.map(s=>Cr(t,s,r));o=Promise.all(i);}else if(typeof e=="string")o=Cr(t,e,r);else {let i=typeof e=="function"?ft(t,e,r.custom):e;o=Promise.all(Mr(t,i,r));}return o.then(()=>{t.notify("AnimationComplete",e);})}function Bo(t,e){if(!Array.isArray(e))return false;let r=e.length;if(r!==t.length)return false;for(let o=0;o<r;o++)if(e[o]!==t[o])return false;return true}var Rm=Se.length;function Fo(t){if(!t)return;if(!t.isControllingVariants){let r=t.parent?Fo(t.parent)||{}:{};return t.props.initial!==void 0&&(r.initial=t.props.initial),r}let e={};for(let r=0;r<Rm;r++){let o=Se[r],i=t.props[o];(mt(i)||i===false)&&(e[o]=i);}return e}var Lm=[...We].reverse(),km=We.length;function Bm(t){return e=>Promise.all(e.map(({animation:r,options:o})=>zn(t,r,o)))}function Yn(t){let e=Bm(t),r=_n(),o=true,i=l=>(c,m)=>{let u=ft(t,m,l==="exit"?t.presenceContext?.custom:void 0);if(u){let{transition:f,transitionEnd:p,...h}=u;c={...c,...h,...p};}return c};function s(l){e=l(t);}function n(l){let{props:c}=t,m=Fo(t.parent)||{},u=[],f=new Set,p={},h=1/0;for(let v=0;v<km;v++){let g=Lm[v],b=r[g],d=c[g]!==void 0?c[g]:m[g],A=mt(d),T=g===l?b.isActive:null;T===false&&(h=v);let w=d===m[g]&&d!==c[g]&&A;if(w&&o&&t.manuallyAnimateOnMount&&(w=false),b.protectedKeys={...p},!b.isActive&&T===null||!d&&!b.prevProp||vt(d)||typeof d=="boolean")continue;let B=Fm(b.prevProp,d),S=B||g===l&&b.isActive&&!w&&A||v>h&&A,H=false,q=Array.isArray(d)?d:[d],Kt=q.reduce(i(g),{});T===false&&(Kt={});let{prevResolvedValues:mi={}}=b,Ka={...mi,...Kt},ci=K=>{S=true,f.has(K)&&(H=true,f.delete(K)),b.needsAnimating[K]=true;let at=t.getValue(K);at&&(at.liveStyle=false);};for(let K in Ka){let at=Kt[K],lo=mi[K];if(p.hasOwnProperty(K))continue;let mo=false;Me(at)&&Me(lo)?mo=!Bo(at,lo):mo=at!==lo,mo?at!=null?ci(K):f.add(K):at!==void 0&&f.has(K)?ci(K):b.protectedKeys[K]=true;}b.prevProp=d,b.prevResolvedValues=Kt,b.isActive&&(p={...p,...Kt}),o&&t.blockInitialAnimation&&(S=false),S&&(!(w&&B)||H)&&u.push(...q.map(K=>({animation:K,options:{type:g}})));}if(f.size){let v={};if(typeof c.initial!="boolean"){let g=ft(t,Array.isArray(c.initial)?c.initial[0]:c.initial);g&&g.transition&&(v.transition=g.transition);}f.forEach(g=>{let b=t.getBaseTarget(g),d=t.getValue(g);d&&(d.liveStyle=true),v[g]=b??null;}),u.push({animation:v});}let y=!!u.length;return o&&(c.initial===false||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(y=false),o=false,y?e(u):Promise.resolve()}function a(l,c){if(r[l].isActive===c)return Promise.resolve();t.variantChildren?.forEach(u=>u.animationState?.setActive(l,c)),r[l].isActive=c;let m=n(l);for(let u in r)r[u].protectedKeys={};return m}return {animateChanges:n,setActive:a,setAnimateFunction:s,getState:()=>r,reset:()=>{r=_n(),o=true;}}}function Fm(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Bo(e,t):false}function Ot(t=false){return {isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _n(){return {animate:Ot(true),whileInView:Ot(),whileHover:Ot(),whileTap:Ot(),whileDrag:Ot(),whileFocus:Ot(),exit:Ot()}}var I=class{constructor(e){this.isMounted=false,this.node=e;}update(){}};var Dr=class extends I{constructor(e){super(e),e.animationState||(e.animationState=Yn(e));}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();vt(e)&&(this.unmountControls=e.subscribe(this.node));}mount(){this.updateAnimationControlsSubscription();}update(){let{animate:e}=this.node.getProps(),{animate:r}=this.node.prevProps||{};e!==r&&this.updateAnimationControlsSubscription();}unmount(){this.node.animationState.reset(),this.unmountControls?.();}};var Om=0,Er=class extends I{constructor(){super(...arguments),this.id=Om++;}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===o)return;let i=this.node.animationState.setActive("exit",!e);r&&!e&&i.then(()=>{r(this.id);});}mount(){let{register:e,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),e&&(this.unmount=e(this.id));}unmount(){}};var Xn={animation:{Feature:Dr},exit:{Feature:Er}};function dt(t,e,r,o={passive:true}){return t.addEventListener(e,r,o),()=>t.removeEventListener(e,r)}var he=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==false;function gt(t){return {point:{x:t.pageX,y:t.pageY}}}var qn=t=>e=>he(e)&&t(e,gt(e));function Ct(t,e,r,o){return dt(t,e,qn(r),o)}function Rr({top:t,left:e,right:r,bottom:o}){return {x:{min:e,max:r},y:{min:t,max:o}}}function Zn({x:t,y:e}){return {top:e.min,right:t.max,bottom:e.max,left:t.min}}function Jn(t,e){if(!e)return t;let r=e({x:t.left,y:t.top}),o=e({x:t.right,y:t.bottom});return {top:r.y,left:r.x,bottom:o.y,right:o.x}}var rs=1e-4,Im=1-rs,jm=1+rs,os=.01,Nm=0-os,Um=0+os;function F(t){return t.max-t.min}function is(t,e,r){return Math.abs(t-e)<=r}function Qn(t,e,r,o=.5){t.origin=o,t.originPoint=P(e.min,e.max,t.origin),t.scale=F(r)/F(e),t.translate=P(r.min,r.max,t.origin)-t.originPoint,(t.scale>=Im&&t.scale<=jm||isNaN(t.scale))&&(t.scale=1),(t.translate>=Nm&&t.translate<=Um||isNaN(t.translate))&&(t.translate=0);}function de(t,e,r,o){Qn(t.x,e.x,r.x,o?o.originX:void 0),Qn(t.y,e.y,r.y,o?o.originY:void 0);}function ts(t,e,r){t.min=r.min+e.min,t.max=t.min+F(e);}function ns(t,e,r){ts(t.x,e.x,r.x),ts(t.y,e.y,r.y);}function es(t,e,r){t.min=e.min-r.min,t.max=t.min+F(e);}function ge(t,e,r){es(t.x,e.x,r.x),es(t.y,e.y,r.y);}var ss=()=>({translate:0,scale:1,origin:0,originPoint:0}),It=()=>({x:ss(),y:ss()}),as=()=>({min:0,max:0}),D=()=>({x:as(),y:as()});function z(t){return [t("x"),t("y")]}function Oo(t){return t===void 0||t===1}function Lr({scale:t,scaleX:e,scaleY:r}){return !Oo(t)||!Oo(e)||!Oo(r)}function yt(t){return Lr(t)||Io(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Io(t){return ls(t.x)||ls(t.y)}function ls(t){return t&&t!=="0%"}function Le(t,e,r){let o=t-r,i=e*o;return r+i}function ms(t,e,r,o,i){return i!==void 0&&(t=Le(t,i,o)),Le(t,r,o)+e}function jo(t,e=0,r=1,o,i){t.min=ms(t.min,e,r,o,i),t.max=ms(t.max,e,r,o,i);}function No(t,{x:e,y:r}){jo(t.x,e.translate,e.scale,e.originPoint),jo(t.y,r.translate,r.scale,r.originPoint);}var cs=.999999999999,us=1.0000000000001;function ps(t,e,r,o=false){let i=r.length;if(!i)return;e.x=e.y=1;let s,n;for(let a=0;a<i;a++){s=r[a],n=s.projectionDelta;let{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(o&&s.options.layoutScroll&&s.scroll&&s!==s.root&&jt(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),n&&(e.x*=n.x.scale,e.y*=n.y.scale,No(t,n)),o&&yt(s.latestValues)&&jt(t,s.latestValues));}e.x<us&&e.x>cs&&(e.x=1),e.y<us&&e.y>cs&&(e.y=1);}function Dt(t,e){t.min=t.min+e,t.max=t.max+e;}function fs(t,e,r,o,i=.5){let s=P(t.min,t.max,i);jo(t,e,r,s,o);}function jt(t,e){fs(t.x,e.x,e.scaleX,e.scale,e.originX),fs(t.y,e.y,e.scaleY,e.scale,e.originY);}function Uo(t,e){return Rr(Jn(t.getBoundingClientRect(),e))}function hs(t,e,r){let o=Uo(t,r),{scroll:i}=e;return i&&(Dt(o.x,i.offset.x),Dt(o.y,i.offset.y)),o}var kr=({current:t})=>t?t.ownerDocument.defaultView:null;var ds=(t,e)=>Math.abs(t-e);function gs(t,e){let r=ds(t.x,e.x),o=ds(t.y,e.y);return Math.sqrt(r**2+o**2)}var ye=class{constructor(e,r,{transformPagePoint:o,contextWindow:i,dragSnapToOrigin:s=false}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let u=Go(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=gs(u.offset,{x:0,y:0})>=3;if(!f&&!p)return;let{point:h}=u,{timestamp:y}=R;this.history.push({...h,timestamp:y});let{onStart:v,onMove:g}=this.handlers;f||(v&&v(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,u);},this.handlePointerMove=(u,f)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Ko(f,this.transformPagePoint),V.update(this.updatePoint,true);},this.handlePointerUp=(u,f)=>{this.end();let{onEnd:p,onSessionEnd:h,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let v=Go(u.type==="pointercancel"?this.lastMoveEventInfo:Ko(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(u,v),h&&h(u,v);},!he(e))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=o,this.contextWindow=i||window;let n=gt(e),a=Ko(n,this.transformPagePoint),{point:l}=a,{timestamp:c}=R;this.history=[{...l,timestamp:c}];let{onSessionStart:m}=r;m&&m(e,Go(a,this.history)),this.removeListeners=st(Ct(this.contextWindow,"pointermove",this.handlePointerMove),Ct(this.contextWindow,"pointerup",this.handlePointerUp),Ct(this.contextWindow,"pointercancel",this.handlePointerUp));}updateHandlers(e){this.handlers=e;}end(){this.removeListeners&&this.removeListeners(),Y(this.updatePoint);}};function Ko(t,e){return e?{point:e(t.point)}:t}function ys(t,e){return {x:t.x-e.x,y:t.y-e.y}}function Go({point:t},e){return {point:t,delta:ys(t,xs(e)),offset:ys(t,Km(e)),velocity:Gm(e,.1)}}function Km(t){return t[0]}function xs(t){return t[t.length-1]}function Gm(t,e){if(t.length<2)return {x:0,y:0};let r=t.length-1,o=null,i=xs(t);for(;r>=0&&(o=t[r],!(i.timestamp-o.timestamp>O(e)));)r--;if(!o)return {x:0,y:0};let s=U(i.timestamp-o.timestamp);if(s===0)return {x:0,y:0};let n={x:(i.x-o.x)/s,y:(i.y-o.y)/s};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}function Ss(t,{min:e,max:r},o){return e!==void 0&&t<e?t=o?P(e,t,o.min):Math.max(t,e):r!==void 0&&t>r&&(t=o?P(r,t,o.max):Math.min(t,r)),t}function vs(t,e,r){return {min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function Ps(t,{top:e,left:r,bottom:o,right:i}){return {x:vs(t.x,r,i),y:vs(t.y,e,o)}}function Ts(t,e){let r=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&([r,o]=[o,r]),{min:r,max:o}}function As(t,e){return {x:Ts(t.x,e.x),y:Ts(t.y,e.y)}}function ws(t,e){let r=.5,o=F(t),i=F(e);return i>o?r=ht(e.min,e.max-o,t.min):o>i&&(r=ht(t.min,t.max-i,e.min)),j(0,1,r)}function Ms(t,e){let r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}var Br=.35;function Cs(t=Br){return t===false?t=0:t===true&&(t=Br),{x:bs(t,"left","right"),y:bs(t,"top","bottom")}}function bs(t,e,r){return {min:Vs(t,e),max:Vs(t,r)}}function Vs(t,e){return typeof t=="number"?t:t[e]||0}var J={x:false,y:false};function Fr(){return J.x||J.y}function Ds(t){return t==="x"||t==="y"?J[t]?null:(J[t]=true,()=>{J[t]=false;}):J.x||J.y?null:(J.x=J.y=true,()=>{J.x=J.y=false;})}var Wm=new WeakMap,Ir=class{constructor(e){this.openDragLock=null,this.isDragging=false,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=false,this.hasMutatedConstraints=false,this.elastic=D(),this.visualElement=e;}start(e,{snapToCursor:r=false}={}){let{presenceContext:o}=this.visualElement;if(o&&o.isPresent===false)return;let i=m=>{let{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(gt(m).point);},s=(m,u)=>{let{drag:f,dragPropagation:p,onDragStart:h}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ds(f),!this.openDragLock))return;this.isDragging=true,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=true,this.visualElement.projection.target=void 0),z(v=>{let g=this.getAxisMotionValue(v).get()||0;if(W.test(g)){let{projection:b}=this.visualElement;if(b&&b.layout){let d=b.layout.layoutBox[v];d&&(g=F(d)*(parseFloat(g)/100));}}this.originPoint[v]=g;}),h&&V.postRender(()=>h(m,u)),Ce(this.visualElement,"transform");let{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",true);},n=(m,u)=>{let{dragPropagation:f,dragDirectionLock:p,onDirectionLock:h,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:v}=u;if(p&&this.currentDirection===null){this.currentDirection=$m(v),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",u.point,v),this.updateAxis("y",u.point,v),this.visualElement.render(),y&&y(m,u);},a=(m,u)=>this.stop(m,u),l=()=>z(m=>this.getAnimationState(m)==="paused"&&this.getAxisMotionValue(m).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new ye(e,{onSessionStart:i,onStart:s,onMove:n,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:kr(this.visualElement)});}stop(e,r){let o=this.isDragging;if(this.cancel(),!o)return;let{velocity:i}=r;this.startAnimation(i);let{onDragEnd:s}=this.getProps();s&&V.postRender(()=>s(e,r));}cancel(){this.isDragging=false;let{projection:e,animationState:r}=this.visualElement;e&&(e.isAnimationBlocked=false),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",false);}updateAxis(e,r,o){let{drag:i}=this.getProps();if(!o||!Or(e,i,this.currentDirection))return;let s=this.getAxisMotionValue(e),n=this.originPoint[e]+o[e];this.constraints&&this.constraints[e]&&(n=Ss(n,this.constraints[e],this.elastic[e])),s.set(n);}resolveConstraints(){let{dragConstraints:e,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(false):this.visualElement.projection?.layout,i=this.constraints;e&&ct(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&o?this.constraints=Ps(o.layoutBox,e):this.constraints=false,this.elastic=Cs(r),i!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&z(s=>{this.constraints!==false&&this.getAxisMotionValue(s)&&(this.constraints[s]=Ms(o.layoutBox[s],this.constraints[s]));});}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!ct(e))return false;let o=e.current;N(o!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:i}=this.visualElement;if(!i||!i.layout)return false;let s=hs(o,i.root,this.visualElement.getTransformPagePoint()),n=As(i.layout.layoutBox,s);if(r){let a=r(Zn(n));this.hasMutatedConstraints=!!a,a&&(n=Rr(a));}return n}startAnimation(e){let{drag:r,dragMomentum:o,dragElastic:i,dragTransition:s,dragSnapToOrigin:n,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=z(m=>{if(!Or(m,r,this.currentDirection))return;let u=l&&l[m]||{};n&&(u={min:0,max:0});let f=i?200:1e6,p=i?40:1e7,h={type:"inertia",velocity:o?e[m]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(m,h)});return Promise.all(c).then(a)}startAxisValueAnimation(e,r){let o=this.getAxisMotionValue(e);return Ce(this.visualElement,e),o.start(pe(e,o,0,r,this.visualElement,false))}stopAnimation(){z(e=>this.getAxisMotionValue(e).stop());}pauseAnimation(){z(e=>this.getAxisMotionValue(e).animation?.pause());}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let r=`_drag${e.toUpperCase()}`,o=this.visualElement.getProps(),i=o[r];return i||this.visualElement.getValue(e,(o.initial?o.initial[e]:void 0)||0)}snapToCursor(e){z(r=>{let{drag:o}=this.getProps();if(!Or(r,o,this.currentDirection))return;let{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){let{min:n,max:a}=i.layout.layoutBox[r];s.set(e[r]-P(n,a,.5));}});}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:r}=this.getProps(),{projection:o}=this.visualElement;if(!ct(r)||!o||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};z(n=>{let a=this.getAxisMotionValue(n);if(a&&this.constraints!==false){let l=a.get();i[n]=ws({min:l,max:l},this.constraints[n]);}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),z(n=>{if(!Or(n,e,null))return;let a=this.getAxisMotionValue(n),{min:l,max:c}=this.constraints[n];a.set(P(l,c,i[n]));});}addListeners(){if(!this.visualElement.current)return;Wm.set(this.visualElement,this);let e=this.visualElement.current,r=Ct(e,"pointerdown",l=>{let{drag:c,dragListener:m=true}=this.getProps();c&&m&&this.start(l);}),o=()=>{let{dragConstraints:l}=this.getProps();ct(l)&&l.current&&(this.constraints=this.resolveRefConstraints());},{projection:i}=this.visualElement,s=i.addEventListener("measure",o);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),V.read(o);let n=dt(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(z(m=>{let u=this.getAxisMotionValue(m);u&&(this.originPoint[m]+=l[m].translate,u.set(u.get()+l[m].translate));}),this.visualElement.render());});return ()=>{n(),r(),s(),a&&a();}}getProps(){let e=this.visualElement.getProps(),{drag:r=false,dragDirectionLock:o=false,dragPropagation:i=false,dragConstraints:s=false,dragElastic:n=Br,dragMomentum:a=true}=e;return {...e,drag:r,dragDirectionLock:o,dragPropagation:i,dragConstraints:s,dragElastic:n,dragMomentum:a}}};function Or(t,e,r){return (e===true||e===t)&&(r===null||r===t)}function $m(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}var jr=class extends I{constructor(e){super(e),this.removeGroupControls=E,this.removeListeners=E,this.controls=new Ir(e);}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||E;}unmount(){this.removeGroupControls(),this.removeListeners();}};var Es=t=>(e,r)=>{t&&V.postRender(()=>t(e,r));},Nr=class extends I{constructor(){super(...arguments),this.removePointerDownListener=E;}onPointerDown(e){this.session=new ye(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:kr(this.node)});}createPanHandlers(){let{onPanSessionStart:e,onPanStart:r,onPan:o,onPanEnd:i}=this.node.getProps();return {onSessionStart:Es(e),onStart:Es(r),onMove:o,onEnd:(s,n)=>{delete this.session,i&&V.postRender(()=>i(s,n));}}}mount(){this.removePointerDownListener=Ct(this.node.current,"pointerdown",e=>this.onPointerDown(e));}update(){this.session&&this.session.updateHandlers(this.createPanHandlers());}unmount(){this.removePointerDownListener(),this.session&&this.session.end();}};var xe={hasAnimatedSinceResize:true,hasEverUpdated:false};function Rs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}var ve={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(x.test(t))t=parseFloat(t);else return t;let r=Rs(t,e.target.x),o=Rs(t,e.target.y);return `${r}% ${o}%`}};var Ls={correct:(t,{treeScale:e,projectionDelta:r})=>{let o=t,i=$.parse(t);if(i.length>5)return o;let s=$.createTransformer(t),n=typeof i[0]!="number"?1:0,a=r.x.scale*e.x,l=r.y.scale*e.y;i[0+n]/=a,i[1+n]/=l;let c=P(a,l,.5);return typeof i[2+n]=="number"&&(i[2+n]/=c),typeof i[3+n]=="number"&&(i[3+n]/=c),s(i)}};var Wo=class extends Component{componentDidMount(){let{visualElement:e,layoutGroup:r,switchLayoutGroup:o,layoutId:i}=this.props,{projection:s}=e;Ei(_m),s&&(r.group&&r.group.add(s),o&&o.register&&i&&o.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove();}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),xe.hasEverUpdated=true;}getSnapshotBeforeUpdate(e){let{layoutDependency:r,visualElement:o,drag:i,isPresent:s}=this.props,{projection:n}=o;return n&&(n.isPresent=s,i||e.layoutDependency!==r||r===void 0||e.isPresent!==s?n.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?n.promote():n.relegate()||V.postRender(()=>{let a=n.getStack();(!a||!a.members.length)&&this.safeToRemove();}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),zt.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove();}));}componentWillUnmount(){let{visualElement:e,layoutGroup:r,switchLayoutGroup:o}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),o&&o.deregister&&o.deregister(i));}safeToRemove(){let{safeToRemove:e}=this.props;e&&e();}render(){return null}};function Ur(t){let[e,r]=pi(),o=useContext(je);return jsx(Wo,{...t,layoutGroup:o,switchLayoutGroup:useContext(ze),isPresent:e,safeToRemove:r})}var _m={borderRadius:{...ve,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomLeftRadius:ve,borderBottomRightRadius:ve,boxShadow:Ls};function Bs(t,e,r){let o=M(t)?t:pt(t);return o.start(pe("",o,e,r)),o.animation}function Fs(t){return t instanceof SVGElement&&t.tagName!=="svg"}var Os=(t,e)=>t.depth-e.depth;var Kr=class{constructor(){this.children=[],this.isDirty=false;}add(e){re(this.children,e),this.isDirty=true;}remove(e){oe(this.children,e),this.isDirty=true;}forEach(e){this.isDirty&&this.children.sort(Os),this.isDirty=false,this.children.forEach(e);}};function Is(t,e){let r=L.now(),o=({timestamp:i})=>{let s=i-r;s>=e&&(Y(o),t(s-e));};return V.setup(o,true),()=>Y(o)}var Ks=["TopLeft","TopRight","BottomLeft","BottomRight"],Ym=Ks.length,js=t=>typeof t=="string"?parseFloat(t):t,Ns=t=>typeof t=="number"||x.test(t);function Gs(t,e,r,o,i,s){i?(t.opacity=P(0,r.opacity??1,Xm(o)),t.opacityExit=P(e.opacity??1,0,qm(o))):s&&(t.opacity=P(e.opacity??1,r.opacity??1,o));for(let n=0;n<Ym;n++){let a=`border${Ks[n]}Radius`,l=Us(e,a),c=Us(r,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Ns(l)===Ns(c)?(t[a]=Math.max(P(js(l),js(c),o),0),(W.test(c)||W.test(l))&&(t[a]+="%")):t[a]=c;}(e.rotate||r.rotate)&&(t.rotate=P(e.rotate||0,r.rotate||0,o));}function Us(t,e){return t[e]!==void 0?t[e]:t.borderRadius}var Xm=Ws(0,.5,gr),qm=Ws(.5,.95,E);function Ws(t,e,r){return o=>o<t?0:o>e?1:r(ht(t,e,o))}function $s(t,e){t.min=e.min,t.max=e.max;}function X(t,e){$s(t.x,e.x),$s(t.y,e.y);}function $o(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin;}function Hs(t,e,r,o,i){return t-=e,t=Le(t,1/r,o),i!==void 0&&(t=Le(t,1/i,o)),t}function Zm(t,e=0,r=1,o=.5,i,s=t,n=t){if(W.test(e)&&(e=parseFloat(e),e=P(n.min,n.max,e/100)-n.min),typeof e!="number")return;let a=P(s.min,s.max,o);t===s&&(a-=e),t.min=Hs(t.min,e,r,a,i),t.max=Hs(t.max,e,r,a,i);}function zs(t,e,[r,o,i],s,n){Zm(t,e[r],e[o],e[i],e.scale,s,n);}var Jm=["x","scaleX","originX"],Qm=["y","scaleY","originY"];function Ho(t,e,r,o){zs(t.x,e,Jm,r?r.x:void 0,o?o.x:void 0),zs(t.y,e,Qm,r?r.y:void 0,o?o.y:void 0);}function _s(t){return t.translate===0&&t.scale===1}function zo(t){return _s(t.x)&&_s(t.y)}function Ys(t,e){return t.min===e.min&&t.max===e.max}function qs(t,e){return Ys(t.x,e.x)&&Ys(t.y,e.y)}function Xs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function _o(t,e){return Xs(t.x,e.x)&&Xs(t.y,e.y)}function Yo(t){return F(t.x)/F(t.y)}function Xo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}var Gr=class{constructor(){this.members=[];}add(e){re(this.members,e),e.scheduleRender();}remove(e){if(oe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r);}}relegate(e){let r=this.members.findIndex(i=>e===i);if(r===0)return false;let o;for(let i=r;i>=0;i--){let s=this.members[i];if(s.isPresent!==false){o=s;break}}return o?(this.promote(o),true):false}promote(e,r){let o=this.lead;if(e!==o&&(this.prevLead=o,this.lead=e,e.show(),o)){o.instance&&o.scheduleRender(),e.scheduleRender(),e.resumeFrom=o,r&&(e.resumeFrom.preserveOpacity=true),o.snapshot&&(e.snapshot=o.snapshot,e.snapshot.latestValues=o.animationValues||o.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=true);let{crossfade:i}=e.options;i===false&&o.hide();}}exitAnimationComplete(){this.members.forEach(e=>{let{options:r,resumingFrom:o}=e;r.onExitComplete&&r.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete();});}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(false);});}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0);}};function Zs(t,e,r){let o="",i=t.x.translate/e.x,s=t.y.translate/e.y,n=r?.z||0;if((i||s||n)&&(o=`translate3d(${i}px, ${s}px, ${n}px) `),(e.x!==1||e.y!==1)&&(o+=`scale(${1/e.x}, ${1/e.y}) `),r){let{transformPerspective:c,rotate:m,rotateX:u,rotateY:f,skewX:p,skewY:h}=r;c&&(o=`perspective(${c}px) ${o}`),m&&(o+=`rotate(${m}deg) `),u&&(o+=`rotateX(${u}deg) `),f&&(o+=`rotateY(${f}deg) `),p&&(o+=`skewX(${p}deg) `),h&&(o+=`skewY(${h}deg) `);}let a=t.x.scale*e.x,l=t.y.scale*e.y;return (a!==1||l!==1)&&(o+=`scale(${a}, ${l})`),o||"none"}var qo=["","X","Y","Z"],tc={visibility:"hidden"},Js=1e3,ec=0;function Zo(t,e,r,o){let{latestValues:i}=e;i[t]&&(r[t]=i[t],e.setStaticValue(t,0),o&&(o[t]=0));}function sa(t){if(t.hasCheckedOptimisedAppear=true,t.root===t)return;let{visualElement:e}=t.options;if(!e)return;let r=rr(e);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",V,!(i||s));}let{parent:o}=t;o&&!o.hasCheckedOptimisedAppear&&sa(o);}function Wr({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:o,resetTransform:i}){return class{constructor(n={},a=e?.()){this.id=ec++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=false,this.isAnimationBlocked=false,this.isLayoutDirty=false,this.isProjectionDirty=false,this.isSharedProjectionDirty=false,this.isTransformDirty=false,this.updateManuallyBlocked=false,this.updateBlockedByResize=false,this.isUpdating=false,this.isSVG=false,this.needsReset=false,this.shouldResetTransform=false,this.hasCheckedOptimisedAppear=false,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=false,this.updateScheduled=false,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=false,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=false,this.clearAllSnapshots());},this.updateProjection=()=>{this.projectionUpdateScheduled=false,this.nodes.forEach(ic),this.nodes.forEach(mc),this.nodes.forEach(cc),this.nodes.forEach(nc);},this.resolvedRelativeTargetAt=0,this.hasProjected=false,this.isVisible=true,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=n,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=true;this.root===this&&(this.nodes=new Kr);}addEventListener(n,a){return this.eventHandlers.has(n)||this.eventHandlers.set(n,new Tt),this.eventHandlers.get(n).add(a)}notifyListeners(n,...a){let l=this.eventHandlers.get(n);l&&l.notify(...a);}hasListeners(n){return this.eventHandlers.has(n)}mount(n){if(this.instance)return;this.isSVG=Fs(n),this.instance=n;let{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(n),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=true),t){let m,u=()=>this.root.updateBlockedByResize=false;t(n,()=>{this.root.updateBlockedByResize=true,m&&m(),m=Is(u,250),xe.hasAnimatedSinceResize&&(xe.hasAnimatedSinceResize=false,this.nodes.forEach(ta));});}a&&this.root.registerSharedNode(a,this),this.options.animate!==false&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:u,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let h=this.options.transition||c.getDefaultTransition()||dc,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=c.getProps(),g=!this.targetLayout||!_o(this.targetLayout,p),b=!u&&f;if(this.options.layoutRoot||this.resumeFrom||b||u&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,b);let d={...ie(h,"layout"),onPlay:y,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(d.delay=0,d.type=false),this.startAnimation(d);}else u||ta(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p;});}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let n=this.getStack();n&&n.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Y(this.updateProjection);}blockUpdate(){this.updateManuallyBlocked=true;}unblockUpdate(){this.updateManuallyBlocked=false;}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||false}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=true,this.nodes&&this.nodes.forEach(uc),this.animationId++);}getTransformTemplate(){let{visualElement:n}=this.options;return n&&n.getProps().transformTemplate}willUpdate(n=true){if(this.root.hasTreeAnimated=true,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=true;for(let m=0;m<this.path.length;m++){let u=this.path[m];u.shouldResetTransform=true,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(false);}let{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;let c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),n&&this.notifyListeners("willUpdate");}update(){if(this.updateScheduled=false,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Qs);return}this.isUpdating||this.nodes.forEach(ac),this.isUpdating=false,this.nodes.forEach(lc),this.nodes.forEach(rc),this.nodes.forEach(oc),this.clearAllSnapshots();let a=L.now();R.delta=j(0,1e3/60,a-R.timestamp),R.timestamp=a,R.isProcessing=true,Ke.update.process(R),Ke.preRender.process(R),Ke.render.process(R),R.isProcessing=false;}didUpdate(){this.updateScheduled||(this.updateScheduled=true,zt.read(this.scheduleUpdate));}clearAllSnapshots(){this.nodes.forEach(sc),this.sharedNodes.forEach(fc);}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=true,V.preRender(this.updateProjection,false,true));}scheduleCheckAfterUnmount(){V.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed();});}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!F(this.snapshot.measuredBox.x)&&!F(this.snapshot.measuredBox.y)&&(this.snapshot=void 0));}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();let n=this.layout;this.layout=this.measure(false),this.layoutCorrected=D(),this.isLayoutDirty=false,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,n?n.layoutBox:void 0);}updateScroll(n="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===n&&(a=false),a&&this.instance){let l=o(this.instance);this.scroll={animationId:this.root.animationId,phase:n,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l};}}resetTransform(){if(!i)return;let n=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!zo(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,m=c!==this.prevTransformTemplateValue;n&&this.instance&&(a||yt(this.latestValues)||m)&&(i(this.instance,c),this.shouldResetTransform=false,this.scheduleRender());}measure(n=true){let a=this.measurePageBox(),l=this.removeElementScroll(a);return n&&(l=this.removeTransform(l)),gc(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:n}=this.options;if(!n)return D();let a=n.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(yc))){let{scroll:c}=this.root;c&&(Dt(a.x,c.offset.x),Dt(a.y,c.offset.y));}return a}removeElementScroll(n){let a=D();if(X(a,n),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){let c=this.path[l],{scroll:m,options:u}=c;c!==this.root&&m&&u.layoutScroll&&(m.wasRoot&&X(a,n),Dt(a.x,m.offset.x),Dt(a.y,m.offset.y));}return a}applyTransform(n,a=false){let l=D();X(l,n);for(let c=0;c<this.path.length;c++){let m=this.path[c];!a&&m.options.layoutScroll&&m.scroll&&m!==m.root&&jt(l,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),yt(m.latestValues)&&jt(l,m.latestValues);}return yt(this.latestValues)&&jt(l,this.latestValues),l}removeTransform(n){let a=D();X(a,n);for(let l=0;l<this.path.length;l++){let c=this.path[l];if(!c.instance||!yt(c.latestValues))continue;Lr(c.latestValues)&&c.updateSnapshot();let m=D(),u=c.measurePageBox();X(m,u),Ho(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,m);}return yt(this.latestValues)&&Ho(a,this.latestValues),a}setTargetDelta(n){this.targetDelta=n,this.root.scheduleUpdateProjection(),this.isProjectionDirty=true;}setOptions(n){this.options={...this.options,...n,crossfade:n.crossfade!==void 0?n.crossfade:true};}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=false;}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==R.timestamp&&this.relativeParent.resolveTargetDelta(true);}resolveTargetDelta(n=false){let a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);let l=!!this.resumingFrom||this!==a;if(!(n||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:m,layoutId:u}=this.options;if(!(!this.layout||!(m||u))){if(this.resolvedRelativeTargetAt=R.timestamp,!this.targetDelta&&!this.relativeTarget){let f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=D(),this.relativeTargetOrigin=D(),ge(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),X(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0;}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=D(),this.targetWithTransforms=D()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ns(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):X(this.target,this.layout.layoutBox),No(this.target,this.targetDelta)):X(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=false;let f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=D(),this.relativeTargetOrigin=D(),ge(this.relativeTargetOrigin,this.target,f.target),X(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0;}}}}getClosestProjectingParent(){if(!(!this.parent||Lr(this.parent.latestValues)||Io(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return !!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){let n=this.getLead(),a=!!this.resumingFrom||this!==n,l=true;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=false),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=false),this.resolvedRelativeTargetAt===R.timestamp&&(l=false),l)return;let{layout:c,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||m))return;X(this.layoutCorrected,this.layout.layoutBox);let u=this.treeScale.x,f=this.treeScale.y;ps(this.layoutCorrected,this.treeScale,this.path,a),n.layout&&!n.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(n.target=n.layout.layoutBox,n.targetWithTransforms=D());let{target:p}=n;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():($o(this.prevProjectionDelta.x,this.projectionDelta.x),$o(this.prevProjectionDelta.y,this.projectionDelta.y)),de(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==f||!Xo(this.projectionDelta.x,this.prevProjectionDelta.x)||!Xo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=true,this.scheduleRender(),this.notifyListeners("projectionUpdate",p));}hide(){this.isVisible=false;}show(){this.isVisible=true;}scheduleRender(n=true){if(this.options.visualElement?.scheduleRender(),n){let a=this.getStack();a&&a.scheduleRender();}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0);}createProjectionDeltas(){this.prevProjectionDelta=It(),this.projectionDelta=It(),this.projectionDeltaWithTransform=It();}setAnimationOrigin(n,a=false){let l=this.snapshot,c=l?l.latestValues:{},m={...this.latestValues},u=It();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;let f=D(),p=l?l.source:void 0,h=this.layout?this.layout.source:void 0,y=p!==h,v=this.getStack(),g=!v||v.members.length<=1,b=!!(y&&!g&&this.options.crossfade===true&&!this.path.some(hc));this.animationProgress=0;let d;this.mixTargetDelta=A=>{let T=A/1e3;ea(u.x,n.x,T),ea(u.y,n.y,T),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ge(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),pc(this.relativeTarget,this.relativeTargetOrigin,f,T),d&&qs(this.relativeTarget,d)&&(this.isProjectionDirty=false),d||(d=D()),X(d,this.relativeTarget)),y&&(this.animationValues=m,Gs(m,c,this.latestValues,T,b,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T;},this.mixTargetDelta(this.options.layoutRoot?1e3:0);}startAnimation(n){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Y(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=V.update(()=>{xe.hasAnimatedSinceResize=true,this.currentAnimation=Bs(0,Js,{...n,onUpdate:a=>{this.mixTargetDelta(a),n.onUpdate&&n.onUpdate(a);},onStop:()=>{},onComplete:()=>{n.onComplete&&n.onComplete(),this.completeAnimation();}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0;});}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let n=this.getStack();n&&n.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete");}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Js),this.currentAnimation.stop()),this.completeAnimation();}applyTransformsToTarget(){let n=this.getLead(),{targetWithTransforms:a,target:l,layout:c,latestValues:m}=n;if(!(!a||!l||!c)){if(this!==n&&this.layout&&c&&aa(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||D();let u=F(this.layout.layoutBox.x);l.x.min=n.target.x.min,l.x.max=l.x.min+u;let f=F(this.layout.layoutBox.y);l.y.min=n.target.y.min,l.y.max=l.y.min+f;}X(a,l),jt(a,m),de(this.projectionDeltaWithTransform,this.layoutCorrected,a,m);}}registerSharedNode(n,a){this.sharedNodes.has(n)||this.sharedNodes.set(n,new Gr),this.sharedNodes.get(n).add(a);let c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0});}isLead(){let n=this.getStack();return n?n.lead===this:true}getLead(){let{layoutId:n}=this.options;return n?this.getStack()?.lead||this:this}getPrevLead(){let{layoutId:n}=this.options;return n?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:n}=this.options;if(n)return this.root.sharedNodes.get(n)}promote({needsReset:n,transition:a,preserveFollowOpacity:l}={}){let c=this.getStack();c&&c.promote(this,l),n&&(this.projectionDelta=void 0,this.needsReset=true),a&&this.setOptions({transition:a});}relegate(){let n=this.getStack();return n?n.relegate(this):false}resetSkewAndRotation(){let{visualElement:n}=this.options;if(!n)return;let a=false,{latestValues:l}=n;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=true),!a)return;let c={};l.z&&Zo("z",n,c,this.animationValues);for(let m=0;m<qo.length;m++)Zo(`rotate${qo[m]}`,n,c,this.animationValues),Zo(`skew${qo[m]}`,n,c,this.animationValues);n.render();for(let m in c)n.setStaticValue(m,c[m]),this.animationValues&&(this.animationValues[m]=c[m]);n.scheduleRender();}getProjectionStyles(n){if(!this.instance||this.isSVG)return;if(!this.isVisible)return tc;let a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=false,a.opacity="",a.pointerEvents=te(n?.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){let p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=te(n?.pointerEvents)||""),this.hasProjected&&!yt(this.latestValues)&&(p.transform=l?l({},""):"none",this.hasProjected=false),p}let m=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=Zs(this.projectionDeltaWithTransform,this.treeScale,m),l&&(a.transform=l(m,a.transform));let{x:u,y:f}=this.projectionDelta;a.transformOrigin=`${u.origin*100}% ${f.origin*100}% 0`,c.animationValues?a.opacity=c===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:a.opacity=c===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(let p in Rt){if(m[p]===void 0)continue;let{correct:h,applyTo:y,isCSSVariable:v}=Rt[p],g=a.transform==="none"?m[p]:h(m[p],c);if(y){let b=y.length;for(let d=0;d<b;d++)a[y[d]]=g;}else v?this.options.visualElement.renderState.vars[p]=g:a[p]=g;}return this.options.layoutId&&(a.pointerEvents=c===this?te(n?.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0;}resetTree(){this.root.nodes.forEach(n=>n.currentAnimation?.stop()),this.root.nodes.forEach(Qs),this.root.sharedNodes.clear();}}}function rc(t){t.updateLayout();}function oc(t){let e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:o}=t.layout,{animationType:i}=t.options,s=e.source!==t.layout.source;i==="size"?z(m=>{let u=s?e.measuredBox[m]:e.layoutBox[m],f=F(u);u.min=r[m].min,u.max=u.min+f;}):aa(i,e.layoutBox,r)&&z(m=>{let u=s?e.measuredBox[m]:e.layoutBox[m],f=F(r[m]);u.max=u.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=true,t.relativeTarget[m].max=t.relativeTarget[m].min+f);});let n=It();de(n,r,e.layoutBox);let a=It();s?de(a,t.applyTransform(o,true),e.measuredBox):de(a,r,e.layoutBox);let l=!zo(n),c=false;if(!t.resumeFrom){let m=t.getClosestProjectingParent();if(m&&!m.resumeFrom){let{snapshot:u,layout:f}=m;if(u&&f){let p=D();ge(p,e.layoutBox,u.layoutBox);let h=D();ge(h,r,f.layoutBox),_o(p,h)||(c=true),m.options.layoutRoot&&(t.relativeTarget=h,t.relativeTargetOrigin=p,t.relativeParent=m);}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:a,layoutDelta:n,hasLayoutChanged:l,hasRelativeLayoutChanged:c});}else if(t.isLead()){let{onExitComplete:r}=t.options;r&&r();}t.options.transition=void 0;}function ic(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty));}function nc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=false;}function sc(t){t.clearSnapshot();}function Qs(t){t.clearMeasurements();}function ac(t){t.isLayoutDirty=false;}function lc(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform();}function ta(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=true;}function mc(t){t.resolveTargetDelta();}function cc(t){t.calcProjection();}function uc(t){t.resetSkewAndRotation();}function fc(t){t.removeLeadSnapshot();}function ea(t,e,r){t.translate=P(e.translate,0,r),t.scale=P(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint;}function ra(t,e,r,o){t.min=P(e.min,r.min,o),t.max=P(e.max,r.max,o);}function pc(t,e,r,o){ra(t.x,e.x,r.x,o),ra(t.y,e.y,r.y,o);}function hc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}var dc={duration:.45,ease:[.4,0,.1,1]},oa=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ia=oa("applewebkit/")&&!oa("chrome/")?Math.round:E;function na(t){t.min=ia(t.min),t.max=ia(t.max);}function gc(t){na(t.x),na(t.y);}function aa(t,e,r){return t==="position"||t==="preserve-aspect"&&!is(Yo(e),Yo(r),.2)}function yc(t){return t!==t.root&&t.scroll?.wasRoot}var la=Wr({attachResizeListener:(t,e)=>dt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>true});var Jo={current:void 0},$r=Wr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Jo.current){let t=new la({});t.mount(window),t.setOptions({layoutScroll:true}),Jo.current=t;}return Jo.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none";},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});var ma={pan:{Feature:Nr},drag:{Feature:jr,ProjectionNode:$r,MeasureLayout:Ur}};function ca(t,e,r){if(t instanceof EventTarget)return [t];if(typeof t=="string"){let o=document;let i=o.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}function Hr(t,e){let r=ca(t),o=new AbortController,i={passive:true,...e,signal:o.signal};return [r,i,()=>o.abort()]}function ua(t){return !(t.pointerType==="touch"||Fr())}function fa(t,e,r={}){let[o,i,s]=Hr(t,r),n=a=>{if(!ua(a))return;let{target:l}=a,c=e(l,a);if(typeof c!="function"||!l)return;let m=u=>{ua(u)&&(c(u),l.removeEventListener("pointerleave",m));};l.addEventListener("pointerleave",m,i);};return o.forEach(a=>{a.addEventListener("pointerenter",n,i);}),s}function pa(t,e,r){let{props:o}=t;t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",r==="Start");let i="onHover"+r,s=o[i];s&&V.postRender(()=>s(e,gt(e)));}var zr=class extends I{mount(){let{current:e}=this.node;e&&(this.unmount=fa(e,(r,o)=>(pa(this.node,o,"Start"),i=>pa(this.node,i,"End"))));}unmount(){}};var _r=class extends I{constructor(){super(...arguments),this.isActive=false;}onFocus(){let e=false;try{e=this.node.current.matches(":focus-visible");}catch{e=true;}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",true),this.isActive=true);}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",false),this.isActive=false);}mount(){this.unmount=st(dt(this.node.current,"focus",()=>this.onFocus()),dt(this.node.current,"blur",()=>this.onBlur()));}unmount(){}};var Qo=(t,e)=>e?t===e?true:Qo(t,e.parentElement):false;var xc=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ha(t){return xc.has(t.tagName)||t.tabIndex!==-1}var Ut=new WeakSet;function da(t){return e=>{e.key==="Enter"&&t(e);}}function ti(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:true,bubbles:true}));}var ga=(t,e)=>{let r=t.currentTarget;if(!r)return;let o=da(()=>{if(Ut.has(r))return;ti(r,"down");let i=da(()=>{ti(r,"up");}),s=()=>ti(r,"cancel");r.addEventListener("keyup",i,e),r.addEventListener("blur",s,e);});r.addEventListener("keydown",o,e),r.addEventListener("blur",()=>r.removeEventListener("keydown",o),e);};function ya(t){return he(t)&&!Fr()}function xa(t,e,r={}){let[o,i,s]=Hr(t,r),n=a=>{let l=a.currentTarget;if(!ya(a)||Ut.has(l))return;Ut.add(l);let c=e(l,a),m=(p,h)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",f),!(!ya(p)||!Ut.has(l))&&(Ut.delete(l),typeof c=="function"&&c(p,{success:h}));},u=p=>{m(p,l===window||l===document||r.useGlobalTarget||Qo(l,p.target));},f=p=>{m(p,false);};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",f,i);};return o.forEach(a=>{(r.useGlobalTarget?window:a).addEventListener("pointerdown",n,i),a instanceof HTMLElement&&(a.addEventListener("focus",c=>ga(c,i)),!ha(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0));}),s}function va(t,e,r){let{props:o}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap",r==="Start");let i="onTap"+(r==="End"?"":r),s=o[i];s&&V.postRender(()=>s(e,gt(e)));}var Yr=class extends I{mount(){let{current:e}=this.node;e&&(this.unmount=xa(e,(r,o)=>(va(this.node,o,"Start"),(i,{success:s})=>va(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}));}unmount(){}};var ri=new WeakMap,ei=new WeakMap,vc=t=>{let e=ri.get(t.target);e&&e(t);},Tc=t=>{t.forEach(vc);};function bc({root:t,...e}){let r=t||document;ei.has(r)||ei.set(r,{});let o=ei.get(r),i=JSON.stringify(e);return o[i]||(o[i]=new IntersectionObserver(Tc,{root:t,...e})),o[i]}function Ta(t,e,r){let o=bc(e);return ri.set(t,r),o.observe(t),()=>{ri.delete(t),o.unobserve(t);}}var Vc={some:0,all:1},Xr=class extends I{constructor(){super(...arguments),this.hasEnteredView=false,this.isInView=false;}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:r,margin:o,amount:i="some",once:s}=e,n={root:r?r.current:void 0,rootMargin:o,threshold:typeof i=="number"?i:Vc[i]},a=l=>{let{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=true),this.node.animationState&&this.node.animationState.setActive("whileInView",c);let{onViewportEnter:m,onViewportLeave:u}=this.node.getProps(),f=c?m:u;f&&f(l);};return Ta(this.node.current,n,a)}mount(){this.startObserver();}update(){if(typeof IntersectionObserver>"u")return;let{props:e,prevProps:r}=this.node;["amount","margin","root"].some(Sc(e,r))&&this.startObserver();}unmount(){}};function Sc({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}var ba={inView:{Feature:Xr},tap:{Feature:Yr},focus:{Feature:_r},hover:{Feature:zr}};var Va={layout:{ProjectionNode:$r,MeasureLayout:Ur}};var ke={current:null},qr={current:false};function Sa(){if(qr.current=true,!!Gt)if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ke.current=t.matches;t.addListener(e),e();}else ke.current=false;}var Pa=new WeakMap;function Aa(t,e,r){for(let o in e){let i=e[o],s=r[o];if(M(i))t.addValue(o,i);else if(M(s))t.addValue(o,pt(i,{owner:t}));else if(s!==i)if(t.hasValue(o)){let n=t.getValue(o);n.liveStyle===true?n.jump(i):n.hasAnimated||n.set(i);}else {let n=t.getStaticValue(o);t.addValue(o,pt(n!==void 0?n:i,{owner:t}));}}for(let o in r)e[o]===void 0&&t.removeValue(o);return e}var Zr=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);var Jr=t=>/^0[^.\s]+$/u.test(t);var wa={test:t=>t==="auto",parse:t=>t};var Qr=t=>e=>e.test(t);var oi=[rt,x,W,ot,Li,Ri,wa],ii=t=>oi.find(Qr(t));var Pc=[...oi,k,$],Ma=t=>Pc.find(Qr(t));var Ac=new Set(["brightness","contrast","saturate","opacity"]);function wc(t){let[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;let[o]=r.match(ne)||[];if(!o)return t;let i=r.replace(o,""),s=Ac.has(e)?1:0;return o!==r&&(s*=100),e+"("+s+i+")"}var Mc=/\b([a-z-]*)\(.*?\)/gu,Be={...$,getAnimatableNone:t=>{let e=t.match(Mc);return e?e.map(wc).join(" "):t}};var Cc={...Xt,color:k,backgroundColor:k,outlineColor:k,fill:k,stroke:k,borderColor:k,borderTopColor:k,borderRightColor:k,borderBottomColor:k,borderLeftColor:k,filter:Be,WebkitFilter:Be},to=t=>Cc[t];function eo(t,e){let r=to(t);return r!==Be&&(r=$),r.getAnimatableNone?r.getAnimatableNone(e):void 0}var Ca=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],ro=class{scrapeMotionValuesFromProps(e,r,o){return {}}constructor({parent:e,props:r,presenceContext:o,reducedMotionConfig:i,blockInitialAnimation:s,visualState:n},a={}){this.current=null,this.children=new Set,this.isVariantNode=false,this.isControllingVariants=false,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Mt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection));},this.renderScheduledAt=0,this.scheduleRender=()=>{let f=L.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,V.render(this.render,false,true));};let{latestValues:l,renderState:c}=n;this.latestValues=l,this.baseTarget={...l},this.initialValues=r.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=r,this.presenceContext=o,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Et(r),this.isVariantNode=$e(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:m,...u}=this.scrapeMotionValuesFromProps(r,{},this);for(let f in u){let p=u[f];l[f]!==void 0&&M(p)&&p.set(l[f],false);}}mount(e){this.current=e,Pa.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,o)=>this.bindToMotionValue(o,r)),qr.current||Sa(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?false:this.reducedMotionConfig==="always"?true:ke.current,process.env.NODE_ENV!=="production"&&$t(this.shouldReduceMotion!==true,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext);}unmount(){this.projection&&this.projection.unmount(),Y(this.notifyUpdate),Y(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let r=this.features[e];r&&(r.unmount(),r.isMounted=false);}this.current=null;}bindToMotionValue(e,r){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let o=Z.has(e);o&&this.onBindTransform&&this.onBindTransform();let i=r.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&V.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=true);}),s=r.on("renderRequest",this.scheduleRender),n;window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,r)),this.valueSubscriptions.set(e,()=>{i(),s(),n&&n(),r.owner&&r.stop();});}sortNodePosition(e){return !this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in lt){let r=lt[e];if(!r)continue;let{isEnabled:o,Feature:i}=r;if(!this.features[e]&&i&&o(this.props)&&(this.features[e]=new i(this)),this.features[e]){let s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=true);}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props);}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):D()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r;}update(e,r){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let o=0;o<Ca.length;o++){let i=Ca[o];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let s="on"+i,n=e[s];n&&(this.propEventSubscriptions[i]=this.on(i,n));}this.prevMotionValues=Aa(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue();}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(e),()=>r.variantChildren.delete(e)}addValue(e,r){let o=this.values.get(e);r!==o&&(o&&this.removeValue(e),this.bindToMotionValue(e,r),this.values.set(e,r),this.latestValues[e]=r.get());}removeValue(e){this.values.delete(e);let r=this.valueSubscriptions.get(e);r&&(r(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState);}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let o=this.values.get(e);return o===void 0&&r!==void 0&&(o=pt(r===null?void 0:r,{owner:this}),this.addValue(e,o)),o}readValue(e,r){let o=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return o!=null&&(typeof o=="string"&&(Zr(o)||Jr(o))?o=parseFloat(o):!Ma(o)&&$.test(r)&&(o=eo(e,r)),this.setBaseTarget(e,M(o)?o.get():o)),M(o)?o.get():o}setBaseTarget(e,r){this.baseTarget[e]=r;}getBaseTarget(e){let{initial:r}=this.props,o;if(typeof r=="string"||typeof r=="object"){let s=Qt(this.props,r,this.presenceContext?.custom);s&&(o=s[e]);}if(r&&o!==void 0)return o;let i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!M(i)?i:this.initialValues[e]!==void 0&&o===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new Tt),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r);}};var Dc=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ec(t){let e=Dc.exec(t);if(!e)return [,];let[,r,o,i]=e;return [`--${r??o}`,i]}var Rc=4;function ni(t,e,r=1){N(r<=Rc,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);let[o,i]=Ec(t);if(!o)return;let s=window.getComputedStyle(e).getPropertyValue(o);if(s){let n=s.trim();return Zr(n)?parseFloat(n):n}return Yt(i)?ni(i,e,r+1):i}function Da(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Jr(t):true}var Lc=new Set(["auto","none","0"]);function Ea(t,e,r){let o=0,i;for(;o<t.length&&!i;){let s=t[o];typeof s=="string"&&!Lc.has(s)&&Lt(s).values.length&&(i=t[o]),o++;}if(i&&r)for(let s of e)t[s]=eo(r,i);}var oo=class extends Mt{constructor(e,r,o,i,s){super(e,r,o,i,s,true);}readKeyframes(){let{unresolvedKeyframes:e,element:r,name:o}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"&&(c=c.trim(),Yt(c))){let m=ni(c,r.current);m!==void 0&&(e[l]=m),l===e.length-1&&(this.finalKeyframe=c);}}if(this.resolveNoneKeyframes(),!wr.has(o)||e.length!==2)return;let[i,s]=e,n=ii(i),a=ii(s);if(n!==a)if(Mo(n)&&Mo(a))for(let l=0;l<e.length;l++){let c=e[l];typeof c=="string"&&(e[l]=parseFloat(c));}else wt[o]&&(this.needsMeasurement=true);}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:r}=this,o=[];for(let i=0;i<e.length;i++)(e[i]===null||Da(e[i]))&&o.push(i);o.length&&Ea(e,o,r);}measureInitialState(){let{element:e,unresolvedKeyframes:r,name:o}=this;if(!e||!e.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=wt[o](e.measureViewportBox(),window.getComputedStyle(e.current)),r[0]=this.measuredOrigin;let i=r[r.length-1];i!==void 0&&e.getValue(o,i).jump(i,false);}measureEndState(){let{element:e,name:r,unresolvedKeyframes:o}=this;if(!e||!e.current)return;let i=e.getValue(r);i&&i.jump(this.measuredOrigin,false);let s=o.length-1,n=o[s];o[s]=wt[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=n),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l);}),this.resolveNoneKeyframes();}};var Te=class extends ro{constructor(){super(...arguments),this.KeyframeResolver=oo;}sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){return e.style?e.style[r]:void 0}removeValueFromRenderState(e,{vars:r,style:o}){delete r[e],delete o[e];}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;M(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`);}));}};function io(t,{style:e,vars:r},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(let s in r)t.style.setProperty(s,r[s]);}function kc(t){return window.getComputedStyle(t)}var no=class extends Te{constructor(){super(...arguments),this.type="html",this.renderInstance=io;}readValueFromInstance(e,r){if(Z.has(r))return Dn(e,r);{let o=kc(e),i=(_t(r)?o.getPropertyValue(r):o[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return Uo(e,r)}build(e,r,o){qt(e,r,o.transformTemplate);}scrapeMotionValuesFromProps(e,r,o){return ee(e,r,o)}};var so=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ra(t,e,r,o){io(t,e,void 0,o);for(let i in e.attrs)t.setAttribute(so.has(i)?i:Ht(i),e.attrs[i]);}var ao=class extends Te{constructor(){super(...arguments),this.type="svg",this.isSVGTag=false,this.measureInstanceViewportBox=D;}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(Z.has(r)){let o=to(r);return o&&o.default||0}return r=so.has(r)?r:Ht(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,o){return Qe(e,r,o)}build(e,r,o){Xe(e,r,this.isSVGTag,o.transformTemplate,o.style);}renderInstance(e,r,o,i){Ra(e,r,o,i);}mount(e){this.isSVGTag=Ze(e.tagName),super.mount(e);}};var La=(t,e)=>Jt(t)?new ao(e):new no(e,{allowProjection:t!==Fragment});var ka=$i({...Xn,...ba,...ma,...Va},La);var tt=Ti(ka);var Ba=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];var Fa=Ba;function Fe({children:t,className:e,characterVariants:r,dadElement:o,onCharacterAnimationComplete:i,key:s}){if(typeof t=="string"){let n=t.split("").map((a,l)=>{let c=useRef(null);return jsx(tt.span,{ref:c,className:e,variants:r,onAnimationComplete:i?()=>{i(c);}:void 0,children:a},`span-${s}-${a}-${l}`)});return o(n,true)}else if(Array.isArray(t)){let n=t.map(a=>typeof a=="string"?a.split("").map((c,m)=>{let u=useRef(null);return jsx(tt.span,{ref:u,className:e,variants:r,onAnimationComplete:i?()=>{i(u);}:void 0,children:c},`span-${s}-${c}-${m}`)}):a);return o(n)}return o(t,true)}function ai({characterVariants:t,onCharacterAnimationComplete:e,delay:r}){let o={},i={hidden:t.hidden,visible:{...t,opacity:1,transition:{staggerChildren:r/1e3}}};return Fa.forEach(s=>{try{let n=tt[s];if(n){let a=l=>{let{children:c,id:m,className:u}=l,{node:f,...p}=l;switch(s){case "table":case "input":case "hr":case "img":return createElement(n,{...p,key:`${s}-${m}`,variants:u?void 0:i,onAnimationComplete:e},c);case "tr":case "th":case "td":return jsx(n,{...p,children:c});case "p":return jsx(Fe,{children:c,characterVariants:t,onCharacterAnimationComplete:e,dadElement:h=>(Array.isArray(h)&&h.push(jsx(tt.span,{style:{display:"block",height:0,width:0}},`span-${m}-newline`)),h)},m);case "span":return jsx(Fe,{children:c,characterVariants:t,onCharacterAnimationComplete:e,dadElement:h=>Array.isArray(h)?createElement(n,{...p,key:`${s}-${m}`,children:h}):h},m);default:return jsx(Fe,{children:c,characterVariants:t,onCharacterAnimationComplete:e,dadElement:(h,y)=>createElement(n,{...p,key:`${s}-${m}`,variants:y||u?void 0:i},h)},m)}};o[s]=a;}}catch{}}),o}function Ie(t){let{delay:e=10,characterVariants:r={hidden:{opacity:0},visible:{opacity:1,transition:{opacity:{duration:0}}}},onCharacterAnimationComplete:o}=t,i=useMemo(()=>({hidden:{},visible:{opacity:1,transition:{staggerChildren:e/1e3}}}),[e]),s=useMemo(()=>r,[e]),n=useMemo(()=>ai({characterVariants:s,onCharacterAnimationComplete:o,delay:e}),[e,s,o]);return {sentenceVariants:i,components:n}}function Na(t){let{delay:e=10,children:r,motionProps:o={},components:i,...s}=t,{characterVariants:n,onCharacterAnimationComplete:a,...l}=o,{sentenceVariants:c,components:m}=Ie({delay:e,characterVariants:n,onCharacterAnimationComplete:a});return jsx(tt.span,{variants:c,initial:"hidden",animate:"visible",...l,children:jsx(Oc,{...s,components:{...m,...i},children:r})},`typewriter-internal-${r}`)}async function Ua(t){let{delay:e=10,children:r,motionProps:o={},components:i,...s}=t,{characterVariants:n,onCharacterAnimationComplete:a,...l}=o,{sentenceVariants:c,components:m}=Ie({delay:e,characterVariants:n,onCharacterAnimationComplete:a}),u=await MarkdownAsync({...s,components:{...m,...i},children:r});return jsx(tt.span,{variants:c,initial:"hidden",animate:"visible",...l,children:u},`typewriter-internal-${r}`)}export{Na as MarkdownTypewriter,Ua as MarkdownTypewriterAsync};
|
|
1
|
+
import {createContext,useMemo,useContext,forwardRef,createElement,useRef,useInsertionEffect,useLayoutEffect,useEffect,useCallback,Fragment,useId,Component}from'react';import {jsx,jsxs}from'react/jsx-runtime';import jc,{MarkdownAsync,MarkdownHooks}from'react-markdown';var Ha=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var je=createContext({});function ui(t){let e=useRef(null);return e.current===null&&(e.current=t()),e.current}var Wt=typeof window<"u";var fi=Wt?useLayoutEffect:useEffect;var Ht=createContext(null);var Ne=createContext({transformPagePoint:t=>t,isStatic:false,reducedMotion:"never"});function pi(t=true){let e=useContext(Ht);if(e===null)return [true,null];let{isPresent:r,onExitComplete:o,register:i}=e,s=useId();useEffect(()=>{if(t)return i(s)},[t]);let n=useCallback(()=>t&&o&&o(s),[s,o,t]);return !r&&o?[false,n]:[true]}var Ve=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hi(t,e){let r=new Set,o=new Set,i=false,s=false,n=new WeakSet,a={delta:0,timestamp:0,isProcessing:false};function c(u){n.has(u)&&(m.schedule(u),t()),u(a);}let m={schedule:(u,f=false,p=false)=>{let y=p&&i?r:o;return f&&n.add(u),y.has(u)||y.add(u),u},cancel:u=>{o.delete(u),n.delete(u);},process:u=>{if(a=u,i){s=true;return}i=true,[r,o]=[o,r],r.forEach(c),r.clear(),i=false,s&&(s=false,m.process(u));}};return m}var G={};var el=40;function Ue(t,e){let r=false,o=true,i={delta:0,timestamp:0,isProcessing:false},s=()=>r=true,n=Ve.reduce((d,w)=>(d[w]=hi(s),d),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:m,update:u,preRender:f,render:p,postRender:h}=n,y=()=>{let d=G.useManualTiming?i.timestamp:performance.now();r=false,G.useManualTiming||(i.delta=o?1e3/60:Math.max(Math.min(d-i.timestamp,el),1)),i.timestamp=d,i.isProcessing=true,a.process(i),l.process(i),c.process(i),m.process(i),u.process(i),f.process(i),p.process(i),h.process(i),i.isProcessing=false,r&&e&&(o=false,t(y));},v=()=>{r=true,o=true,i.isProcessing||t(y);};return {schedule:Ve.reduce((d,w)=>{let T=n[w];return d[w]=(A,B=false,S=false)=>(r||v(),T.schedule(A,B,S)),d},{}),cancel:d=>{for(let w=0;w<Ve.length;w++)n[Ve[w]].cancel(d);},state:i,steps:n}}var E=t=>t;var{schedule:V,cancel:Y,state:R,steps:Ke}=Ue(typeof requestAnimationFrame<"u"?requestAnimationFrame:E,true);var Ge=createContext({strict:false});var di={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},lt={};for(let t in di)lt[t]={isEnabled:e=>di[t].some(r=>!!e[r])};function gi(t){for(let e in t)lt[e]={...lt[e],...t[e]};}var ol=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Se(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ol.has(t)}var yi=t=>!Se(t);function il(t){t&&(yi=e=>e.startsWith("on")?!Se(e):t(e));}try{il(Ha("@emotion/is-prop-valid").default);}catch{}function xi(t,e,r){let o={};for(let i in t)i==="values"&&typeof t.values=="object"||(yi(i)||r===true&&Se(i)||!e&&!Se(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}var vi=new Set;function $t(t,e,r){t||vi.has(e)||(console.warn(e),vi.add(e));}function Ti(t){if(typeof Proxy>"u")return t;let e=new Map,r=(...o)=>(process.env.NODE_ENV!=="production"&&$t(false,"motion() is deprecated. Use motion.create() instead."),t(...o));return new Proxy(r,{get:(o,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}var xt=createContext({});function vt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function mt(t){return typeof t=="string"||Array.isArray(t)}var We=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Pe=["initial",...We];function Et(t){return vt(t.animate)||Pe.some(e=>mt(t[e]))}function He(t){return !!(Et(t)||t.variants)}function bi(t,e){if(Et(t)){let{initial:r,animate:o}=t;return {initial:r===false||mt(r)?r:void 0,animate:mt(o)?o:void 0}}return t.inherit!==false?e:{}}function Si(t){let{initial:e,animate:r}=bi(t,useContext(xt));return useMemo(()=>({initial:e,animate:r}),[Vi(e),Vi(r)])}function Vi(t){return Array.isArray(t)?t.join(" "):t}var Pi=Symbol.for("motionComponentSymbol");function ct(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function wi(t,e,r){return useCallback(o=>{o&&t.onMount&&t.onMount(o),e&&(o?e.mount(o):e.unmount()),r&&(typeof r=="function"?r(o):ct(r)&&(r.current=o));},[e])}var zt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var ml="framerAppearId",$e="data-"+zt(ml);var ze=createContext({});var{schedule:_t}=Ue(queueMicrotask,false);function Ai(t,e,r,o,i){let{visualElement:s}=useContext(xt),n=useContext(Ge),a=useContext(Ht),l=useContext(Ne).reducedMotion,c=useRef(null);o=o||n.renderer,!c.current&&o&&(c.current=o(t,{visualState:e,parent:s,props:r,presenceContext:a,blockInitialAnimation:a?a.initial===false:false,reducedMotionConfig:l}));let m=c.current,u=useContext(ze);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&pl(c.current,r,i,u);let f=useRef(false);useInsertionEffect(()=>{m&&f.current&&m.update(r,a);});let p=r[$e],h=useRef(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return fi(()=>{m&&(f.current=true,window.MotionIsMounted=true,m.updateFeatures(),_t.render(m.render),h.current&&m.animationState&&m.animationState.animateChanges());}),useEffect(()=>{m&&(!h.current&&m.animationState&&m.animationState.animateChanges(),h.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p);}),h.current=false));}),m}function pl(t,e,r,o){let{layoutId:i,layout:s,drag:n,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:m}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:Mi(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!n||a&&ct(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:o,crossfade:m,layoutScroll:l,layoutRoot:c});}function Mi(t){if(t)return t.options.allowProjection!==false?t.projection:Mi(t.parent)}var tt=()=>{},N=()=>{};process.env.NODE_ENV!=="production"&&(tt=(t,e)=>{!t&&typeof console<"u"&&console.warn(e);},N=(t,e)=>{if(!t)throw new Error(e)});function Ci({preloadedFeatures:t,createVisualElement:e,useRender:r,useVisualState:o,Component:i}){t&&gi(t);function s(a,l){let c,m={...useContext(Ne),...a,layoutId:yl(a)},{isStatic:u}=m,f=Si(a),p=o(a,u);if(!u&&Wt){xl(m,t);let h=vl(m);c=h.MeasureLayout,f.visualElement=Ai(i,p,m,e,h.ProjectionNode);}return jsxs(xt.Provider,{value:f,children:[c&&f.visualElement?jsx(c,{visualElement:f.visualElement,...m}):null,r(i,a,wi(p,f.visualElement,l),p,u,f.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;let n=forwardRef(s);return n[Pi]=i,n}function yl({layoutId:t}){let e=useContext(je).id;return e&&t!==void 0?e+"-"+t:t}function xl(t,e){let r=useContext(Ge).strict;if(process.env.NODE_ENV!=="production"&&e&&r){let o="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?tt(false,o):N(false,o);}}function vl(t){let{drag:e,layout:r}=lt;if(!e&&!r)return {};let o={...e,...r};return {MeasureLayout:e?.isEnabled(t)||r?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}var Di=t=>e=>typeof e=="string"&&e.startsWith(t),Yt=Di("--"),Tl=Di("var(--"),Xt=t=>Tl(t)?bl.test(t.split("/*")[0].trim()):false,bl=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var Rt={};function Ei(t){for(let e in t)Rt[e]=t[e],Yt(e)&&(Rt[e].isCSSVariable=true);}var et=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],J=new Set(et);function _e(t,{layout:e,layoutId:r}){return J.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!Rt[t]||t==="opacity")}var M=t=>!!(t&&t.getVelocity);var Ye=(t,e)=>e&&typeof t=="number"?e.transform(t):t;var j=(t,e,r)=>r>e?e:r<t?t:r;var rt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ut={...rt,transform:t=>j(0,1,t)},Ae={...rt,default:1};var fo={...rt,transform:Math.round};var Me=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ot=Me("deg"),W=Me("%"),x=Me("px"),Ri=Me("vh"),Li=Me("vw"),po={...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(t*100)};var ki={rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:Ae,scaleX:Ae,scaleY:Ae,scaleZ:Ae,skew:ot,skewX:ot,skewY:ot,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:ut,originX:po,originY:po,originZ:x};var qt={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,radius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,backgroundPositionX:x,backgroundPositionY:x,...ki,zIndex:fo,fillOpacity:ut,strokeOpacity:ut,numOctaves:fo};var Vl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Sl=et.length;function Bi(t,e,r){let o="",i=true;for(let s=0;s<Sl;s++){let n=et[s],a=t[n];if(a===void 0)continue;let l=true;if(typeof a=="number"?l=a===(n.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||r){let c=Ye(a,qt[n]);if(!l){i=false;let m=Vl[n]||n;o+=`${m}(${c}) `;}r&&(e[n]=c);}}return o=o.trim(),r?o=r(e,i?"":o):i&&(o="none"),o}function Zt(t,e,r){let{style:o,vars:i,transformOrigin:s}=t,n=false,a=false;for(let l in e){let c=e[l];if(J.has(l)){n=true;continue}else if(Yt(l)){i[l]=c;continue}else {let m=Ye(c,qt[l]);l.startsWith("origin")?(a=true,s[l]=m):o[l]=m;}}if(e.transform||(n||r?o.transform=Bi(e,t.transform,r):o.transform&&(o.transform="none")),a){let{originX:l="50%",originY:c="50%",originZ:m=0}=s;o.transformOrigin=`${l} ${c} ${m}`;}}var Jt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ho(t,e,r){for(let o in e)!M(e[o])&&!_e(o,r)&&(t[o]=e[o]);}function wl({transformTemplate:t},e){return useMemo(()=>{let r=Jt();return Zt(r,e,t),Object.assign({},r.vars,r.style)},[e])}function Al(t,e){let r=t.style||{},o={};return ho(o,r,t),Object.assign(o,wl(t,e)),o}function Fi(t,e){let r={},o=Al(t,e);return t.drag&&t.dragListener!==false&&(r.draggable=false,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===true?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=o,r}var Oi=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Qt(t){return typeof t!="string"||t.includes("-")?false:!!(Oi.indexOf(t)>-1||/[A-Z]/u.test(t))}var Ml={offset:"stroke-dashoffset",array:"stroke-dasharray"},Cl={offset:"strokeDashoffset",array:"strokeDasharray"};function Ii(t,e,r=1,o=0,i=true){t.pathLength=1;let s=i?Ml:Cl;t[s.offset]=x.transform(-o);let n=x.transform(e),a=x.transform(r);t[s.array]=`${n} ${a}`;}function Xe(t,{attrX:e,attrY:r,attrScale:o,pathLength:i,pathSpacing:s=1,pathOffset:n=0,...a},l,c,m){if(Zt(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:u,style:f}=t;u.transform&&(f.transform=u.transform,delete u.transform),(f.transform||u.transformOrigin)&&(f.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),f.transform&&(f.transformBox=m?.transformBox??"fill-box",delete u.transformBox),e!==void 0&&(u.x=e),r!==void 0&&(u.y=r),o!==void 0&&(u.scale=o),i!==void 0&&Ii(u,i,s,n,false);}var qe=()=>({...Jt(),attrs:{}});var Ze=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ji(t,e,r,o){let i=useMemo(()=>{let s=qe();return Xe(s,e,Ze(o),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){let s={};ho(s,t.style,t),i.style={...s,...i.style};}return i}function Ni(t=false){return (r,o,i,{latestValues:s},n)=>{let l=(Qt(r)?ji:Fi)(o,s,n,r),c=xi(o,typeof r=="string",t),m=r!==Fragment?{...c,...l,ref:i}:{},{children:u}=o,f=useMemo(()=>M(u)?u.get():u,[u]);return createElement(r,{...m,children:f})}}function Ui(t){let e=[{},{}];return t?.values.forEach((r,o)=>{e[0][o]=r.get(),e[1][o]=r.getVelocity();}),e}function te(t,e,r,o){if(typeof e=="function"){let[i,s]=Ui(o);e=e(r!==void 0?r:t.custom,i,s);}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){let[i,s]=Ui(o);e=e(r!==void 0?r:t.custom,i,s);}return e}function ee(t){return M(t)?t.get():t}function kl({scrapeMotionValuesFromProps:t,createRenderState:e},r,o,i){return {latestValues:Bl(r,o,i,t),renderState:e()}}var Je=t=>(e,r)=>{let o=useContext(xt),i=useContext(Ht),s=()=>kl(t,e,o,i);return r?s():ui(s)};function Bl(t,e,r,o){let i={},s=o(t,{});for(let f in s)i[f]=ee(s[f]);let{initial:n,animate:a}=t,l=Et(t),c=He(t);e&&c&&!l&&t.inherit!==false&&(n===void 0&&(n=e.initial),a===void 0&&(a=e.animate));let m=r?r.initial===false:false;m=m||n===false;let u=m?a:n;if(u&&typeof u!="boolean"&&!vt(u)){let f=Array.isArray(u)?u:[u];for(let p=0;p<f.length;p++){let h=te(t,f[p]);if(h){let{transitionEnd:y,transition:v,...g}=h;for(let b in g){let d=g[b];if(Array.isArray(d)){let w=m?d.length-1:0;d=d[w];}d!==null&&(i[b]=d);}for(let b in y)i[b]=y[b];}}}return i}function re(t,e,r){let{style:o}=t,i={};for(let s in o)(M(o[s])||e.style&&M(e.style[s])||_e(s,t)||r?.getValue(s)?.liveStyle!==void 0)&&(i[s]=o[s]);return i}var Gi={useVisualState:Je({scrapeMotionValuesFromProps:re,createRenderState:Jt})};function Qe(t,e,r){let o=re(t,e,r);for(let i in t)if(M(t[i])||M(e[i])){let s=et.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;o[s]=t[i];}return o}var Wi={useVisualState:Je({scrapeMotionValuesFromProps:Qe,createRenderState:qe})};function Hi(t,e){return function(o,{forwardMotionProps:i}={forwardMotionProps:false}){let n={...Qt(o)?Wi:Gi,preloadedFeatures:t,useRender:Ni(i),createVisualElement:e,Component:o};return Ci(n)}}function ft(t,e,r){let o=t.getProps();return te(o,e,r!==void 0?r:o.custom,t)}var Ce=t=>Array.isArray(t);var tr;function Fl(){tr=void 0;}var L={now:()=>(tr===void 0&&L.set(R.isProcessing||G.useManualTiming?R.timestamp:performance.now()),tr),set:t=>{tr=t,queueMicrotask(Fl);}};function oe(t,e){t.indexOf(e)===-1&&t.push(e);}function ie(t,e){let r=t.indexOf(e);r>-1&&t.splice(r,1);}var Tt=class{constructor(){this.subscriptions=[];}add(e){return oe(this.subscriptions,e),()=>ie(this.subscriptions,e)}notify(e,r,o){let i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,o);else for(let s=0;s<i;s++){let n=this.subscriptions[s];n&&n(e,r,o);}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0;}};function er(t,e){return e?t*(1e3/e):0}var $i=30,Ol=t=>!isNaN(parseFloat(t)),go=class{constructor(e,r={}){this.version="__VERSION__",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,i=true)=>{let s=L.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change?.notify(this.current),i&&this.events.renderRequest?.notify(this.current);},this.hasAnimated=false,this.setCurrent(e),this.owner=r.owner;}setCurrent(e){this.current=e,this.updatedAt=L.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ol(this.current));}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt;}onChange(e){return process.env.NODE_ENV!=="production"&&$t(false,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new Tt);let o=this.events[e].add(r);return e==="change"?()=>{o(),V.read(()=>{this.events.change.getSize()||this.stop();});}:o}clearListeners(){for(let e in this.events)this.events[e].clear();}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r;}set(e,r=true){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify);}setWithVelocity(e,r,o){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-o;}jump(e,r=true){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}get(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=L.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>$i)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,$i);return er(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=true,this.animation=e(r),this.events.animationStart&&this.events.animationStart.notify();}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation();})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation();}isAnimating(){return !!this.animation}clearAnimation(){delete this.animation;}destroy(){this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}};function pt(t,e){return new go(t,e)}function Il(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,pt(r));}function jl(t){return Ce(t)?t[t.length-1]||0:t}function _i(t,e){let r=ft(t,e),{transitionEnd:o={},transition:i={},...s}=r||{};s={...s,...o};for(let n in s){let a=jl(s[n]);Il(t,n,a);}}function Yi(t){return !!(M(t)&&t.add)}function De(t,e){let r=t.getValue("willChange");if(Yi(r))return r.add(e);if(!r&&G.WillChange){let o=new G.WillChange("auto");t.addValue("willChange",o),o.add(e);}}function rr(t){return t.props[$e]}var Nl=t=>t!==null;function Xi(t,{repeat:e,repeatType:r="loop"},o){let i=t.filter(Nl),s=e&&r!=="loop"&&e%2===1?0:i.length-1;return !s||o===void 0?i[s]:o}var Ul={type:"spring",stiffness:500,damping:25,restSpeed:10},Kl=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Gl={type:"keyframes",duration:.8},Wl={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},qi=(t,{keyframes:e})=>e.length>2?Gl:J.has(t)?t.startsWith("scale")?Kl(e[1]):Ul:Wl;function Zi({when:t,delay:e,delayChildren:r,staggerChildren:o,staggerDirection:i,repeat:s,repeatType:n,repeatDelay:a,from:l,elapsed:c,...m}){return !!Object.keys(m).length}function ne(t,e){return t?.[e]??t?.default??t}var O=t=>t*1e3,U=t=>t/1e3;var bt=t=>Math.round(t*1e5)/1e5;var se=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ji(t){return t==null}var Qi=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var ae=(t,e)=>r=>!!(typeof r=="string"&&Qi.test(r)&&r.startsWith(t)||e&&!Ji(r)&&Object.prototype.hasOwnProperty.call(r,e)),or=(t,e,r)=>o=>{if(typeof o!="string")return o;let[i,s,n,a]=o.match(se);return {[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(n),alpha:a!==void 0?parseFloat(a):1}};var Hl=t=>j(0,255,t),yo={...rt,transform:t=>Math.round(Hl(t))},nt={test:ae("rgb","red"),parse:or("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:o=1})=>"rgba("+yo.transform(t)+", "+yo.transform(e)+", "+yo.transform(r)+", "+bt(ut.transform(o))+")"};function $l(t){let e="",r="",o="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),o=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),o=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}}var Ee={test:ae("#"),parse:$l,transform:nt.transform};var Vt={test:ae("hsl","hue"),parse:or("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:o=1})=>"hsla("+Math.round(t)+", "+W.transform(bt(e))+", "+W.transform(bt(r))+", "+bt(ut.transform(o))+")"};var k={test:t=>nt.test(t)||Ee.test(t)||Vt.test(t),parse:t=>nt.test(t)?nt.parse(t):Vt.test(t)?Vt.parse(t):Ee.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?nt.transform(t):Vt.transform(t)};var tn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function zl(t){return isNaN(t)&&typeof t=="string"&&(t.match(se)?.length||0)+(t.match(tn)?.length||0)>0}var rn="number",on="color",_l="var",Yl="var(",en="${}",Xl=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Lt(t){let e=t.toString(),r=[],o={color:[],number:[],var:[]},i=[],s=0,a=e.replace(Xl,l=>(k.test(l)?(o.color.push(s),i.push(on),r.push(k.parse(l))):l.startsWith(Yl)?(o.var.push(s),i.push(_l),r.push(l)):(o.number.push(s),i.push(rn),r.push(parseFloat(l))),++s,en)).split(en);return {values:r,split:a,indexes:o,types:i}}function nn(t){return Lt(t).values}function sn(t){let{split:e,types:r}=Lt(t),o=e.length;return i=>{let s="";for(let n=0;n<o;n++)if(s+=e[n],i[n]!==void 0){let a=r[n];a===rn?s+=bt(i[n]):a===on?s+=k.transform(i[n]):s+=i[n];}return s}}var ql=t=>typeof t=="number"?0:t;function Zl(t){let e=nn(t);return sn(t)(e.map(ql))}var H={test:zl,parse:nn,createTransformer:sn,getAnimatableNone:Zl};function xo(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function an({hue:t,saturation:e,lightness:r,alpha:o}){t/=360,e/=100,r/=100;let i=0,s=0,n=0;if(!e)i=s=n=r;else {let a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;i=xo(l,a,t+1/3),s=xo(l,a,t),n=xo(l,a,t-1/3);}return {red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(n*255),alpha:o}}function le(t,e){return r=>r>0?e:t}var P=(t,e,r)=>t+(e-t)*r;var vo=(t,e,r)=>{let o=t*t,i=r*(e*e-o)+o;return i<0?0:Math.sqrt(i)},Jl=[Ee,nt,Vt],Ql=t=>Jl.find(e=>e.test(t));function ln(t){let e=Ql(t);if(tt(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return false;let r=e.parse(t);return e===Vt&&(r=an(r)),r}var To=(t,e)=>{let r=ln(t),o=ln(e);if(!r||!o)return le(t,e);let i={...r};return s=>(i.red=vo(r.red,o.red,s),i.green=vo(r.green,o.green,s),i.blue=vo(r.blue,o.blue,s),i.alpha=P(r.alpha,o.alpha,s),nt.transform(i))};var ir=new Set(["none","hidden"]);function mn(t,e){return ir.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}var tm=(t,e)=>r=>e(t(r)),st=(...t)=>t.reduce(tm);function em(t,e){return r=>P(t,e,r)}function nr(t){return typeof t=="number"?em:typeof t=="string"?Xt(t)?le:k.test(t)?To:im:Array.isArray(t)?cn:typeof t=="object"?k.test(t)?To:rm:le}function cn(t,e){let r=[...t],o=r.length,i=t.map((s,n)=>nr(s)(s,e[n]));return s=>{for(let n=0;n<o;n++)r[n]=i[n](s);return r}}function rm(t,e){let r={...t,...e},o={};for(let i in r)t[i]!==void 0&&e[i]!==void 0&&(o[i]=nr(t[i])(t[i],e[i]));return i=>{for(let s in o)r[s]=o[s](i);return r}}function om(t,e){let r=[],o={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){let s=e.types[i],n=t.indexes[s][o[s]],a=t.values[n]??0;r[i]=a,o[s]++;}return r}var im=(t,e)=>{let r=H.createTransformer(e),o=Lt(t),i=Lt(e);return o.indexes.var.length===i.indexes.var.length&&o.indexes.color.length===i.indexes.color.length&&o.indexes.number.length>=i.indexes.number.length?ir.has(t)&&!i.values.length||ir.has(e)&&!o.values.length?mn(t,e):st(cn(om(o,i),i.values),r):(tt(true,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),le(t,e))};function sr(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?P(t,e,r):nr(t)(t,e)}var un=t=>{let e=({timestamp:r})=>t(r);return {start:()=>V.update(e,true),stop:()=>Y(e),now:()=>R.isProcessing?R.timestamp:L.now()}};var ar=(t,e,r=10)=>{let o="",i=Math.max(Math.round(e/r),2);for(let s=0;s<i;s++)o+=t(s/(i-1))+", ";return `linear(${o.substring(0,o.length-2)})`};function me(t){let e=0,r=50,o=t.next(e);for(;!o.done&&e<2e4;)e+=r,o=t.next(e);return e>=2e4?1/0:e}function fn(t,e=100,r){let o=r({...t,keyframes:[0,e]}),i=Math.min(me(o),2e4);return {type:"keyframes",ease:s=>o.next(i*s).value/e,duration:U(i)}}var nm=5;function lr(t,e,r){let o=Math.max(e-nm,0);return er(r-t(o),e-o)}var C={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var Vo=.001;function pn({duration:t=C.duration,bounce:e=C.bounce,velocity:r=C.velocity,mass:o=C.mass}){let i,s;tt(t<=O(C.maxDuration),"Spring duration must be 10 seconds or less");let n=1-e;n=j(C.minDamping,C.maxDamping,n),t=j(C.minDuration,C.maxDuration,U(t)),n<1?(i=c=>{let m=c*n,u=m*t,f=m-r,p=mr(c,n),h=Math.exp(-u);return Vo-f/p*h},s=c=>{let u=c*n*t,f=u*r+r,p=Math.pow(n,2)*Math.pow(c,2)*t,h=Math.exp(-u),y=mr(Math.pow(c,2),n);return (-i(c)+Vo>0?-1:1)*((f-p)*h)/y}):(i=c=>{let m=Math.exp(-c*t),u=(c-r)*t+1;return -1e-3+m*u},s=c=>{let m=Math.exp(-c*t),u=(r-c)*(t*t);return m*u});let a=5/t,l=am(i,s,a);if(t=O(t),isNaN(l))return {stiffness:C.stiffness,damping:C.damping,duration:t};{let c=Math.pow(l,2)*o;return {stiffness:c,damping:n*2*Math.sqrt(o*c),duration:t}}}var sm=12;function am(t,e,r){let o=r;for(let i=1;i<sm;i++)o=o-t(o)/e(o);return o}function mr(t,e){return t*Math.sqrt(1-e*e)}var lm=["duration","bounce"],mm=["stiffness","damping","mass"];function hn(t,e){return e.some(r=>t[r]!==void 0)}function cm(t){let e={velocity:C.velocity,stiffness:C.stiffness,damping:C.damping,mass:C.mass,isResolvedFromDuration:false,...t};if(!hn(t,mm)&&hn(t,lm))if(t.visualDuration){let r=t.visualDuration,o=2*Math.PI/(r*1.2),i=o*o,s=2*j(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:C.mass,stiffness:i,damping:s};}else {let r=pn(t);e={...e,...r,mass:C.mass},e.isResolvedFromDuration=true;}return e}function ce(t=C.visualDuration,e=C.bounce){let r=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:o,restDelta:i}=r,s=r.keyframes[0],n=r.keyframes[r.keyframes.length-1],a={done:false,value:s},{stiffness:l,damping:c,mass:m,duration:u,velocity:f,isResolvedFromDuration:p}=cm({...r,velocity:-U(r.velocity||0)}),h=f||0,y=c/(2*Math.sqrt(l*m)),v=n-s,g=U(Math.sqrt(l/m)),b=Math.abs(v)<5;o||(o=b?C.restSpeed.granular:C.restSpeed.default),i||(i=b?C.restDelta.granular:C.restDelta.default);let d;if(y<1){let T=mr(g,y);d=A=>{let B=Math.exp(-y*g*A);return n-B*((h+y*g*v)/T*Math.sin(T*A)+v*Math.cos(T*A))};}else if(y===1)d=T=>n-Math.exp(-g*T)*(v+(h+g*v)*T);else {let T=g*Math.sqrt(y*y-1);d=A=>{let B=Math.exp(-y*g*A),S=Math.min(T*A,300);return n-B*((h+y*g*v)*Math.sinh(S)+T*v*Math.cosh(S))/T};}let w={calculatedDuration:p&&u||null,next:T=>{let A=d(T);if(p)a.done=T>=u;else {let B=T===0?h:0;y<1&&(B=T===0?O(h):lr(d,T,A));let S=Math.abs(B)<=o,$=Math.abs(n-A)<=i;a.done=S&&$;}return a.value=a.done?n:A,a},toString:()=>{let T=Math.min(me(w),2e4),A=ar(B=>w.next(T*B).value,T,30);return T+"ms "+A},toTransition:()=>{}};return w}ce.applyToOptions=t=>{let e=fn(t,100,ce);return t.ease=e.ease,t.duration=O(e.duration),t.type="keyframes",t};function Re({keyframes:t,velocity:e=0,power:r=.8,timeConstant:o=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:n,min:a,max:l,restDelta:c=.5,restSpeed:m}){let u=t[0],f={done:false,value:u},p=S=>a!==void 0&&S<a||l!==void 0&&S>l,h=S=>a===void 0?l:l===void 0||Math.abs(a-S)<Math.abs(l-S)?a:l,y=r*e,v=u+y,g=n===void 0?v:n(v);g!==v&&(y=g-u);let b=S=>-y*Math.exp(-S/o),d=S=>g+b(S),w=S=>{let $=b(S),Z=d(S);f.done=Math.abs($)<=c,f.value=f.done?g:Z;},T,A,B=S=>{p(f.value)&&(T=S,A=ce({keyframes:[f.value,h(f.value)],velocity:lr(d,S,f.value),damping:i,stiffness:s,restDelta:c,restSpeed:m}));};return B(0),{calculatedDuration:null,next:S=>{let $=false;return !A&&T===void 0&&($=true,w(S),B(S)),T!==void 0&&S>=T?A.next(S-T):(!$&&w(S),f)}}}var ht=(t,e,r)=>{let o=e-t;return o===0?1:(r-t)/o};function um(t,e,r){let o=[],i=r||G.mix||sr,s=t.length-1;for(let n=0;n<s;n++){let a=i(t[n],t[n+1]);if(e){let l=Array.isArray(e)?e[n]||E:e;a=st(l,a);}o.push(a);}return o}function dn(t,e,{clamp:r=true,ease:o,mixer:i}={}){let s=t.length;if(N(s===e.length,"Both input and output ranges must be the same length"),s===1)return ()=>e[0];if(s===2&&e[0]===e[1])return ()=>e[1];let n=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());let a=um(e,o,i),l=a.length,c=m=>{if(n&&m<t[0])return e[0];let u=0;if(l>1)for(;u<t.length-2&&!(m<t[u+1]);u++);let f=ht(t[u],t[u+1],m);return a[u](f)};return r?m=>c(j(t[0],t[s-1],m)):c}function gn(t,e){let r=t[t.length-1];for(let o=1;o<=e;o++){let i=ht(0,e,o);t.push(P(r,1,i));}}function yn(t){let e=[0];return gn(e,t.length-1),e}function xn(t,e){return t.map(r=>r*e)}var vn=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,fm=1e-7,pm=12;function hm(t,e,r,o,i){let s,n,a=0;do n=e+(r-e)/2,s=vn(n,o,i)-t,s>0?r=n:e=n;while(Math.abs(s)>fm&&++a<pm);return n}function St(t,e,r,o){if(t===e&&r===o)return E;let i=s=>hm(s,0,1,t,r);return s=>s===0||s===1?s:vn(i(s),e,o)}var Tn=St(.42,0,1,1),bn=St(0,0,.58,1),cr=St(.42,0,.58,1);var Vn=t=>Array.isArray(t)&&typeof t[0]!="number";var ur=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2;var fr=t=>e=>1-t(1-e);var So=St(.33,1.53,.69,.99),Le=fr(So),pr=ur(Le);var hr=t=>(t*=2)<1?.5*Le(t):.5*(2-Math.pow(2,-10*(t-1)));var dr=t=>1-Math.sin(Math.acos(t)),gr=fr(dr),yr=ur(dr);var xr=t=>Array.isArray(t)&&typeof t[0]=="number";var Sn={linear:E,easeIn:Tn,easeInOut:cr,easeOut:bn,circIn:dr,circInOut:yr,circOut:gr,backIn:Le,backInOut:pr,backOut:So,anticipate:hr},dm=t=>typeof t=="string",Po=t=>{if(xr(t)){N(t.length===4,"Cubic bezier arrays must contain four numerical values.");let[e,r,o,i]=t;return St(e,r,o,i)}else if(dm(t))return N(Sn[t]!==void 0,`Invalid easing type '${t}'`),Sn[t];return t};function gm(t,e){return t.map(()=>e||cr).splice(0,t.length-1)}function Pt({duration:t=300,keyframes:e,times:r,ease:o="easeInOut"}){let i=Vn(o)?o.map(Po):Po(o),s={done:false,value:e[0]},n=xn(r&&r.length===e.length?r:yn(e),t),a=dn(n,e,{ease:Array.isArray(i)?i:gm(e,i)});return {calculatedDuration:t,next:l=>(s.value=a(l),s.done=l>=t,s)}}var ym=t=>t!==null;function ue(t,{repeat:e,repeatType:r="loop"},o,i=1){let s=t.filter(ym),a=i<0||e&&r!=="loop"&&e%2===1?0:s.length-1;return !a||o===void 0?s[a]:o}var xm={decay:Re,inertia:Re,tween:Pt,keyframes:Pt,spring:ce};function vr(t){typeof t.type=="string"&&(t.type=xm[t.type]);}var wt=class{constructor(){this.count=0,this.updateFinished();}get finished(){return this._finished}updateFinished(){this.count++,this._finished=new Promise(e=>{this.resolve=e;});}notifyFinished(){this.resolve();}then(e,r){return this.finished.then(e,r)}};var vm=t=>t/100,fe=class extends wt{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=false,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:r}=this.options;if(r&&r.updatedAt!==L.now()&&this.tick(L.now()),this.isStopped=true,this.state==="idle")return;this.teardown();let{onStop:o}=this.options;o&&o();},this.options=e,this.initAnimation(),this.play(),e.autoplay===false&&this.pause();}initAnimation(){let{options:e}=this;vr(e);let{type:r=Pt,repeat:o=0,repeatDelay:i=0,repeatType:s,velocity:n=0}=e,{keyframes:a}=e,l=r||Pt;process.env.NODE_ENV!=="production"&&l!==Pt&&N(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),l!==Pt&&typeof a[0]!="number"&&(this.mixKeyframes=st(vm,sr(a[0],a[1])),a=[0,100]);let c=l({...e,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-n})),c.calculatedDuration===null&&(c.calculatedDuration=me(c));let{calculatedDuration:m}=c;this.calculatedDuration=m,this.resolvedDuration=m+i,this.totalDuration=this.resolvedDuration*(o+1)-i,this.generator=c;}updateTime(e){let r=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r;}tick(e,r=false){let{generator:o,totalDuration:i,mixKeyframes:s,mirroredGenerator:n,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return o.next(0);let{delay:c=0,keyframes:m,repeat:u,repeatType:f,repeatDelay:p,type:h,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),r?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let d=this.currentTime,w=o;if(u){let S=Math.min(this.currentTime,i)/a,$=Math.floor(S),Z=S%1;!Z&&S>=1&&(Z=1),Z===1&&$--,$=Math.min($,u+1),!!($%2)&&(f==="reverse"?(Z=1-Z,p&&(Z-=p/a)):f==="mirror"&&(w=n)),d=j(0,1,Z)*a;}let T=b?{done:false,value:m[0]}:w.next(d);s&&(T.value=s(T.value));let{done:A}=T;!b&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);let B=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return B&&h!==Re&&(T.value=ue(m,this.options,v,this.speed)),y&&y(T.value),B&&this.finish(),T}then(e,r){return this.finished.then(e,r)}get duration(){return U(this.calculatedDuration)}get time(){return U(this.currentTime)}set time(e){e=O(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed);}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(L.now());let r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=U(this.currentTime));}play(){if(this.isStopped)return;let{driver:e=un,onPlay:r,startTime:o}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),r&&r();let i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=o??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start();}pause(){this.state="paused",this.updateTime(L.now()),this.holdTime=this.currentTime;}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null;}finish(){this.teardown(),this.state="finished";let{onComplete:e}=this.options;e&&e();}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown();}teardown(){this.notifyFinished(),this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null;}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0);}sample(e){return this.startTime=0,this.tick(e,true)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),e.observe(this)}};function Pn(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1]);}var kt=t=>t*180/Math.PI,wo=t=>{let e=kt(Math.atan2(t[1],t[0]));return Ao(e)},Tm={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:wo,rotateZ:wo,skewX:t=>kt(Math.atan(t[1])),skewY:t=>kt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ao=t=>(t=t%360,t<0&&(t+=360),t),wn=wo,An=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Mn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),bm={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:An,scaleY:Mn,scale:t=>(An(t)+Mn(t))/2,rotateX:t=>Ao(kt(Math.atan2(t[6],t[5]))),rotateY:t=>Ao(kt(Math.atan2(-t[2],t[0]))),rotateZ:wn,rotate:wn,skewX:t=>kt(Math.atan(t[4])),skewY:t=>kt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Cn(t){return t.includes("scale")?1:0}function Tr(t,e){if(!t||t==="none")return Cn(e);let r=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),o,i;if(r)o=bm,i=r;else {let a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=Tm,i=a;}if(!i)return Cn(e);let s=o[e],n=i[1].split(",").map(Vm);return typeof s=="function"?s(n):n[s]}var Dn=(t,e)=>{let{transform:r="none"}=getComputedStyle(t);return Tr(r,e)};function Vm(t){return parseFloat(t.trim())}var Mo=t=>t===rt||t===x,Sm=new Set(["x","y","z"]),Pm=et.filter(t=>!Sm.has(t));function En(t){let e=[];return Pm.forEach(r=>{let o=t.getValue(r);o!==void 0&&(e.push([r,o.get()]),o.set(r.startsWith("scale")?1:0));}),e}var At={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),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:(t,{transform:e})=>Tr(e,"x"),y:(t,{transform:e})=>Tr(e,"y")};At.translateX=At.x;At.translateY=At.y;var Bt=new Set,Co=false,Do=false,Eo=false;function Rn(){if(Do){let t=Array.from(Bt).filter(o=>o.needsMeasurement),e=new Set(t.map(o=>o.element)),r=new Map;e.forEach(o=>{let i=En(o);i.length&&(r.set(o,i),o.render());}),t.forEach(o=>o.measureInitialState()),e.forEach(o=>{o.render();let i=r.get(o);i&&i.forEach(([s,n])=>{o.getValue(s)?.set(n);});}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY);});}Do=false,Co=false,Bt.forEach(t=>t.complete(Eo)),Bt.clear();}function Ln(){Bt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Do=true);});}function kn(){Eo=true,Ln(),Rn(),Eo=false;}var Mt=class{constructor(e,r,o,i,s,n=false){this.isComplete=false,this.isAsync=false,this.needsMeasurement=false,this.isScheduled=false,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=o,this.motionValue=i,this.element=s,this.isAsync=n;}scheduleResolve(){this.isScheduled=true,this.isAsync?(Bt.add(this),Co||(Co=true,V.read(Ln),V.resolveKeyframes(Rn))):(this.readKeyframes(),this.complete());}readKeyframes(){let{unresolvedKeyframes:e,name:r,element:o,motionValue:i}=this;if(e[0]===null){let s=i?.get(),n=e[e.length-1];if(s!==void 0)e[0]=s;else if(o&&r){let a=o.readValue(r,n);a!=null&&(e[0]=a);}e[0]===void 0&&(e[0]=n),i&&s===void 0&&i.set(e[0]);}Pn(e);}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=false){this.isComplete=true,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Bt.delete(this);}cancel(){this.isComplete||(this.isScheduled=false,Bt.delete(this));}resume(){this.isComplete||this.scheduleResolve();}};var Bn=t=>t.startsWith("--");function Fn(t,e,r){Bn(e)?t.style.setProperty(e,r):t.style[e]=r;}function pe(t){let e;return ()=>(e===void 0&&(e=t()),e)}var On=pe(()=>window.ScrollTimeline!==void 0);var In={};function jn(t,e){let r=pe(t);return ()=>In[e]??r()}var br=jn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"});}catch{return false}return true},"linearEasing");var Ft=([t,e,r,o])=>`cubic-bezier(${t}, ${e}, ${r}, ${o})`;var Ro={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ft([0,.65,.55,1]),circOut:Ft([.55,0,1,.45]),backIn:Ft([.31,.01,.66,-0.59]),backOut:Ft([.33,1.53,.69,.99])};function Lo(t,e){if(t)return typeof t=="function"?br()?ar(t,e):"ease-out":xr(t)?Ft(t):Array.isArray(t)?t.map(r=>Lo(r,e)||Ro.easeOut):Ro[t]}function Nn(t,e,r,{delay:o=0,duration:i=300,repeat:s=0,repeatType:n="loop",ease:a="easeOut",times:l}={},c=void 0){let m={[e]:r};l&&(m.offset=l);let u=Lo(a,i);Array.isArray(u)&&(m.easing=u);let f={delay:o,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:n==="reverse"?"alternate":"normal"};c&&(f.pseudoElement=c);let p=t.animate(m,f);return p}function Vr(t){return typeof t=="function"&&"applyToOptions"in t}function Un({type:t,...e}){return Vr(t)&&br()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}var Sr=class extends wt{constructor(e){if(super(),this.finishedTime=null,this.isStopped=false,!e)return;let{element:r,name:o,keyframes:i,pseudoElement:s,allowFlatten:n=false,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!s,this.allowFlatten=n,this.options=e,N(typeof e.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);let c=Un(e);this.animation=Nn(r,o,i,c,s),c.autoplay===false&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let m=ue(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(m):Fn(r,o,m),this.animation.cancel();}l?.(),this.notifyFinished();},this.animation.oncancel=()=>this.notifyFinished();}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished());}pause(){this.animation.pause();}complete(){this.animation.finish?.();}cancel(){try{this.animation.cancel();}catch{}}stop(){if(this.isStopped)return;this.isStopped=true;let{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel());}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.();}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return U(Number(e))}get time(){return U(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=O(e);}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e;}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e;}attachTimeline({timeline:e,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&On()?(this.animation.timeline=e,E):r(this)}};var Kn={anticipate:hr,backInOut:pr,circInOut:yr};function wm(t){return t in Kn}function Gn(t){typeof t.ease=="string"&&wm(t.ease)&&(t.ease=Kn[t.ease]);}var Wn=10,Pr=class extends Sr{constructor(e){Gn(e),vr(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e;}updateMotionValue(e){let{motionValue:r,onUpdate:o,onComplete:i,element:s,...n}=this.options;if(!r)return;if(e!==void 0){r.set(e);return}let a=new fe({...n,autoplay:false}),l=O(this.finishedTime??this.time);r.setWithVelocity(a.sample(l-Wn).value,a.sample(l).value,Wn),a.stop();}};var ko=(t,e)=>e==="zIndex"?false:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(H.test(t)||t==="0")&&!t.startsWith("url("));function Am(t){let e=t[0];if(t.length===1)return true;for(let r=0;r<t.length;r++)if(t[r]!==e)return true}function Hn(t,e,r,o){let i=t[0];if(i===null)return false;if(e==="display"||e==="visibility")return true;let s=t[t.length-1],n=ko(i,e),a=ko(s,e);return tt(n===a,`You are trying to animate ${e} from "${i}" to "${s}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${s} via the \`style\` property.`),!n||!a?false:Am(t)||(r==="spring"||Vr(r))&&o}var Mm=new Set(["opacity","clipPath","filter","transform"]),Cm=pe(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function $n(t){let{motionValue:e,name:r,repeatDelay:o,repeatType:i,damping:s,type:n}=t;if(!e||!e.owner||!(e.owner.current instanceof HTMLElement))return false;let{onUpdate:a,transformTemplate:l}=e.owner.getProps();return Cm()&&r&&Mm.has(r)&&(r!=="transform"||!l)&&!a&&!o&&i!=="mirror"&&s!==0&&n!=="inertia"}var Dm=40,wr=class extends wt{constructor({autoplay:e=true,delay:r=0,type:o="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:n="loop",keyframes:a,name:l,motionValue:c,element:m,...u}){super(),this.stop=()=>{this._animation?(this._animation.stop(),this.stopTimeline?.()):this.keyframeResolver?.cancel();},this.createdAt=L.now();let f={autoplay:e,delay:r,type:o,repeat:i,repeatDelay:s,repeatType:n,name:l,motionValue:c,element:m,...u},p=m?.KeyframeResolver||Mt;this.keyframeResolver=new p(a,(h,y,v)=>this.onKeyframesResolved(h,y,f,!v),l,c,m),this.keyframeResolver?.scheduleResolve();}onKeyframesResolved(e,r,o,i){this.keyframeResolver=void 0;let{name:s,type:n,velocity:a,delay:l,isHandoff:c,onUpdate:m}=o;this.resolvedAt=L.now(),Hn(e,s,n,a)||((G.instantAnimations||!l)&&m?.(ue(e,o,r)),e[0]=e[e.length-1],o.duration=0,o.repeat=0);let f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Dm?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...o,keyframes:e},p=!c&&$n(f)?new Pr({...f,element:f.motionValue.owner.current}):new fe(f);p.finished.then(()=>this.notifyFinished()).catch(E),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p;}get finished(){return this._animation?this.animation.finished:this._finished}then(e,r){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||kn(),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e;}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e;}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play();}pause(){this.animation.pause();}complete(){this.animation.complete();}cancel(){this.animation.cancel();}};var he=(t,e,r,o={},i,s)=>n=>{let a=ne(o,t)||{},l=a.delay||o.delay||0,{elapsed:c=0}=o;c=c-O(l);let m={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f);},onComplete:()=>{n(),a.onComplete&&a.onComplete();},name:t,motionValue:e,element:s?void 0:i};Zi(a)||Object.assign(m,qi(t,m)),m.duration&&(m.duration=O(m.duration)),m.repeatDelay&&(m.repeatDelay=O(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let u=false;if((m.type===false||m.duration===0&&!m.repeatDelay)&&(m.duration=0,m.delay===0&&(u=true)),(G.instantAnimations||G.skipAnimations)&&(u=true,m.duration=0,m.delay=0),m.allowFlatten=!a.type&&!a.ease,u&&!s&&e.get()!==void 0){let f=Xi(m.keyframes,a);if(f!==void 0){V.update(()=>{m.onUpdate(f),m.onComplete();});return}}return new wr(m)};var Ar=new Set(["width","height","top","left","right","bottom",...et]);function Em({protectedKeys:t,needsAnimating:e},r){let o=t.hasOwnProperty(r)&&e[r]!==true;return e[r]=false,o}function Mr(t,e,{delay:r=0,transitionOverride:o,type:i}={}){let{transition:s=t.getDefaultTransition(),transitionEnd:n,...a}=e;o&&(s=o);let l=[],c=i&&t.animationState&&t.animationState.getState()[i];for(let m in a){let u=t.getValue(m,t.latestValues[m]??null),f=a[m];if(f===void 0||c&&Em(c,m))continue;let p={delay:r,...ne(s||{},m)},h=u.get();if(h!==void 0&&!u.isAnimating&&!Array.isArray(f)&&f===h&&!p.velocity)continue;let y=false;if(window.MotionHandoffAnimation){let g=rr(t);if(g){let b=window.MotionHandoffAnimation(g,m,V);b!==null&&(p.startTime=b,y=true);}}De(t,m),u.start(he(m,u,f,t.shouldReduceMotion&&Ar.has(m)?{type:false}:p,t,y));let v=u.animation;v&&l.push(v);}return n&&Promise.all(l).then(()=>{V.update(()=>{n&&_i(t,n);});}),l}function Cr(t,e,r={}){let o=ft(t,e,r.type==="exit"?t.presenceContext?.custom:void 0),{transition:i=t.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(i=r.transitionOverride);let s=o?()=>Promise.all(Mr(t,o,r)):()=>Promise.resolve(),n=t.variantChildren&&t.variantChildren.size?(l=0)=>{let{delayChildren:c=0,staggerChildren:m,staggerDirection:u}=i;return Rm(t,e,c+l,m,u,r)}:()=>Promise.resolve(),{when:a}=i;if(a){let[l,c]=a==="beforeChildren"?[s,n]:[n,s];return l().then(()=>c())}else return Promise.all([s(),n(r.delay)])}function Rm(t,e,r=0,o=0,i=1,s){let n=[],a=(t.variantChildren.size-1)*o,l=i===1?(c=0)=>c*o:(c=0)=>a-c*o;return Array.from(t.variantChildren).sort(Lm).forEach((c,m)=>{c.notify("AnimationStart",e),n.push(Cr(c,e,{...s,delay:r+l(m)}).then(()=>c.notify("AnimationComplete",e)));}),Promise.all(n)}function Lm(t,e){return t.sortNodePosition(e)}function zn(t,e,r={}){t.notify("AnimationStart",e);let o;if(Array.isArray(e)){let i=e.map(s=>Cr(t,s,r));o=Promise.all(i);}else if(typeof e=="string")o=Cr(t,e,r);else {let i=typeof e=="function"?ft(t,e,r.custom):e;o=Promise.all(Mr(t,i,r));}return o.then(()=>{t.notify("AnimationComplete",e);})}function Bo(t,e){if(!Array.isArray(e))return false;let r=e.length;if(r!==t.length)return false;for(let o=0;o<r;o++)if(e[o]!==t[o])return false;return true}var km=Pe.length;function Fo(t){if(!t)return;if(!t.isControllingVariants){let r=t.parent?Fo(t.parent)||{}:{};return t.props.initial!==void 0&&(r.initial=t.props.initial),r}let e={};for(let r=0;r<km;r++){let o=Pe[r],i=t.props[o];(mt(i)||i===false)&&(e[o]=i);}return e}var Bm=[...We].reverse(),Fm=We.length;function Om(t){return e=>Promise.all(e.map(({animation:r,options:o})=>zn(t,r,o)))}function Yn(t){let e=Om(t),r=_n(),o=true,i=l=>(c,m)=>{let u=ft(t,m,l==="exit"?t.presenceContext?.custom:void 0);if(u){let{transition:f,transitionEnd:p,...h}=u;c={...c,...h,...p};}return c};function s(l){e=l(t);}function n(l){let{props:c}=t,m=Fo(t.parent)||{},u=[],f=new Set,p={},h=1/0;for(let v=0;v<Fm;v++){let g=Bm[v],b=r[g],d=c[g]!==void 0?c[g]:m[g],w=mt(d),T=g===l?b.isActive:null;T===false&&(h=v);let A=d===m[g]&&d!==c[g]&&w;if(A&&o&&t.manuallyAnimateOnMount&&(A=false),b.protectedKeys={...p},!b.isActive&&T===null||!d&&!b.prevProp||vt(d)||typeof d=="boolean")continue;let B=Im(b.prevProp,d),S=B||g===l&&b.isActive&&!A&&w||v>h&&w,$=false,Z=Array.isArray(d)?d:[d],Gt=Z.reduce(i(g),{});T===false&&(Gt={});let{prevResolvedValues:mi={}}=b,Wa={...mi,...Gt},ci=K=>{S=true,f.has(K)&&($=true,f.delete(K)),b.needsAnimating[K]=true;let at=t.getValue(K);at&&(at.liveStyle=false);};for(let K in Wa){let at=Gt[K],lo=mi[K];if(p.hasOwnProperty(K))continue;let mo=false;Ce(at)&&Ce(lo)?mo=!Bo(at,lo):mo=at!==lo,mo?at!=null?ci(K):f.add(K):at!==void 0&&f.has(K)?ci(K):b.protectedKeys[K]=true;}b.prevProp=d,b.prevResolvedValues=Gt,b.isActive&&(p={...p,...Gt}),o&&t.blockInitialAnimation&&(S=false),S&&(!(A&&B)||$)&&u.push(...Z.map(K=>({animation:K,options:{type:g}})));}if(f.size){let v={};if(typeof c.initial!="boolean"){let g=ft(t,Array.isArray(c.initial)?c.initial[0]:c.initial);g&&g.transition&&(v.transition=g.transition);}f.forEach(g=>{let b=t.getBaseTarget(g),d=t.getValue(g);d&&(d.liveStyle=true),v[g]=b??null;}),u.push({animation:v});}let y=!!u.length;return o&&(c.initial===false||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(y=false),o=false,y?e(u):Promise.resolve()}function a(l,c){if(r[l].isActive===c)return Promise.resolve();t.variantChildren?.forEach(u=>u.animationState?.setActive(l,c)),r[l].isActive=c;let m=n(l);for(let u in r)r[u].protectedKeys={};return m}return {animateChanges:n,setActive:a,setAnimateFunction:s,getState:()=>r,reset:()=>{r=_n(),o=true;}}}function Im(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Bo(e,t):false}function Ot(t=false){return {isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _n(){return {animate:Ot(true),whileInView:Ot(),whileHover:Ot(),whileTap:Ot(),whileDrag:Ot(),whileFocus:Ot(),exit:Ot()}}var I=class{constructor(e){this.isMounted=false,this.node=e;}update(){}};var Dr=class extends I{constructor(e){super(e),e.animationState||(e.animationState=Yn(e));}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();vt(e)&&(this.unmountControls=e.subscribe(this.node));}mount(){this.updateAnimationControlsSubscription();}update(){let{animate:e}=this.node.getProps(),{animate:r}=this.node.prevProps||{};e!==r&&this.updateAnimationControlsSubscription();}unmount(){this.node.animationState.reset(),this.unmountControls?.();}};var jm=0,Er=class extends I{constructor(){super(...arguments),this.id=jm++;}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===o)return;let i=this.node.animationState.setActive("exit",!e);r&&!e&&i.then(()=>{r(this.id);});}mount(){let{register:e,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),e&&(this.unmount=e(this.id));}unmount(){}};var Xn={animation:{Feature:Dr},exit:{Feature:Er}};function dt(t,e,r,o={passive:true}){return t.addEventListener(e,r,o),()=>t.removeEventListener(e,r)}var de=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==false;function gt(t){return {point:{x:t.pageX,y:t.pageY}}}var qn=t=>e=>de(e)&&t(e,gt(e));function Ct(t,e,r,o){return dt(t,e,qn(r),o)}function Rr({top:t,left:e,right:r,bottom:o}){return {x:{min:e,max:r},y:{min:t,max:o}}}function Zn({x:t,y:e}){return {top:e.min,right:t.max,bottom:e.max,left:t.min}}function Jn(t,e){if(!e)return t;let r=e({x:t.left,y:t.top}),o=e({x:t.right,y:t.bottom});return {top:r.y,left:r.x,bottom:o.y,right:o.x}}var rs=1e-4,Nm=1-rs,Um=1+rs,os=.01,Km=0-os,Gm=0+os;function F(t){return t.max-t.min}function is(t,e,r){return Math.abs(t-e)<=r}function Qn(t,e,r,o=.5){t.origin=o,t.originPoint=P(e.min,e.max,t.origin),t.scale=F(r)/F(e),t.translate=P(r.min,r.max,t.origin)-t.originPoint,(t.scale>=Nm&&t.scale<=Um||isNaN(t.scale))&&(t.scale=1),(t.translate>=Km&&t.translate<=Gm||isNaN(t.translate))&&(t.translate=0);}function ge(t,e,r,o){Qn(t.x,e.x,r.x,o?o.originX:void 0),Qn(t.y,e.y,r.y,o?o.originY:void 0);}function ts(t,e,r){t.min=r.min+e.min,t.max=t.min+F(e);}function ns(t,e,r){ts(t.x,e.x,r.x),ts(t.y,e.y,r.y);}function es(t,e,r){t.min=e.min-r.min,t.max=t.min+F(e);}function ye(t,e,r){es(t.x,e.x,r.x),es(t.y,e.y,r.y);}var ss=()=>({translate:0,scale:1,origin:0,originPoint:0}),It=()=>({x:ss(),y:ss()}),as=()=>({min:0,max:0}),D=()=>({x:as(),y:as()});function z(t){return [t("x"),t("y")]}function Oo(t){return t===void 0||t===1}function Lr({scale:t,scaleX:e,scaleY:r}){return !Oo(t)||!Oo(e)||!Oo(r)}function yt(t){return Lr(t)||Io(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Io(t){return ls(t.x)||ls(t.y)}function ls(t){return t&&t!=="0%"}function ke(t,e,r){let o=t-r,i=e*o;return r+i}function ms(t,e,r,o,i){return i!==void 0&&(t=ke(t,i,o)),ke(t,r,o)+e}function jo(t,e=0,r=1,o,i){t.min=ms(t.min,e,r,o,i),t.max=ms(t.max,e,r,o,i);}function No(t,{x:e,y:r}){jo(t.x,e.translate,e.scale,e.originPoint),jo(t.y,r.translate,r.scale,r.originPoint);}var cs=.999999999999,us=1.0000000000001;function ps(t,e,r,o=false){let i=r.length;if(!i)return;e.x=e.y=1;let s,n;for(let a=0;a<i;a++){s=r[a],n=s.projectionDelta;let{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(o&&s.options.layoutScroll&&s.scroll&&s!==s.root&&jt(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),n&&(e.x*=n.x.scale,e.y*=n.y.scale,No(t,n)),o&&yt(s.latestValues)&&jt(t,s.latestValues));}e.x<us&&e.x>cs&&(e.x=1),e.y<us&&e.y>cs&&(e.y=1);}function Dt(t,e){t.min=t.min+e,t.max=t.max+e;}function fs(t,e,r,o,i=.5){let s=P(t.min,t.max,i);jo(t,e,r,s,o);}function jt(t,e){fs(t.x,e.x,e.scaleX,e.scale,e.originX),fs(t.y,e.y,e.scaleY,e.scale,e.originY);}function Uo(t,e){return Rr(Jn(t.getBoundingClientRect(),e))}function hs(t,e,r){let o=Uo(t,r),{scroll:i}=e;return i&&(Dt(o.x,i.offset.x),Dt(o.y,i.offset.y)),o}var kr=({current:t})=>t?t.ownerDocument.defaultView:null;var ds=(t,e)=>Math.abs(t-e);function gs(t,e){let r=ds(t.x,e.x),o=ds(t.y,e.y);return Math.sqrt(r**2+o**2)}var xe=class{constructor(e,r,{transformPagePoint:o,contextWindow:i,dragSnapToOrigin:s=false}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let u=Go(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=gs(u.offset,{x:0,y:0})>=3;if(!f&&!p)return;let{point:h}=u,{timestamp:y}=R;this.history.push({...h,timestamp:y});let{onStart:v,onMove:g}=this.handlers;f||(v&&v(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,u);},this.handlePointerMove=(u,f)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Ko(f,this.transformPagePoint),V.update(this.updatePoint,true);},this.handlePointerUp=(u,f)=>{this.end();let{onEnd:p,onSessionEnd:h,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let v=Go(u.type==="pointercancel"?this.lastMoveEventInfo:Ko(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(u,v),h&&h(u,v);},!de(e))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=o,this.contextWindow=i||window;let n=gt(e),a=Ko(n,this.transformPagePoint),{point:l}=a,{timestamp:c}=R;this.history=[{...l,timestamp:c}];let{onSessionStart:m}=r;m&&m(e,Go(a,this.history)),this.removeListeners=st(Ct(this.contextWindow,"pointermove",this.handlePointerMove),Ct(this.contextWindow,"pointerup",this.handlePointerUp),Ct(this.contextWindow,"pointercancel",this.handlePointerUp));}updateHandlers(e){this.handlers=e;}end(){this.removeListeners&&this.removeListeners(),Y(this.updatePoint);}};function Ko(t,e){return e?{point:e(t.point)}:t}function ys(t,e){return {x:t.x-e.x,y:t.y-e.y}}function Go({point:t},e){return {point:t,delta:ys(t,xs(e)),offset:ys(t,Wm(e)),velocity:Hm(e,.1)}}function Wm(t){return t[0]}function xs(t){return t[t.length-1]}function Hm(t,e){if(t.length<2)return {x:0,y:0};let r=t.length-1,o=null,i=xs(t);for(;r>=0&&(o=t[r],!(i.timestamp-o.timestamp>O(e)));)r--;if(!o)return {x:0,y:0};let s=U(i.timestamp-o.timestamp);if(s===0)return {x:0,y:0};let n={x:(i.x-o.x)/s,y:(i.y-o.y)/s};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}function Ss(t,{min:e,max:r},o){return e!==void 0&&t<e?t=o?P(e,t,o.min):Math.max(t,e):r!==void 0&&t>r&&(t=o?P(r,t,o.max):Math.min(t,r)),t}function vs(t,e,r){return {min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function Ps(t,{top:e,left:r,bottom:o,right:i}){return {x:vs(t.x,r,i),y:vs(t.y,e,o)}}function Ts(t,e){let r=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&([r,o]=[o,r]),{min:r,max:o}}function ws(t,e){return {x:Ts(t.x,e.x),y:Ts(t.y,e.y)}}function As(t,e){let r=.5,o=F(t),i=F(e);return i>o?r=ht(e.min,e.max-o,t.min):o>i&&(r=ht(t.min,t.max-i,e.min)),j(0,1,r)}function Ms(t,e){let r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}var Br=.35;function Cs(t=Br){return t===false?t=0:t===true&&(t=Br),{x:bs(t,"left","right"),y:bs(t,"top","bottom")}}function bs(t,e,r){return {min:Vs(t,e),max:Vs(t,r)}}function Vs(t,e){return typeof t=="number"?t:t[e]||0}var Q={x:false,y:false};function Fr(){return Q.x||Q.y}function Ds(t){return t==="x"||t==="y"?Q[t]?null:(Q[t]=true,()=>{Q[t]=false;}):Q.x||Q.y?null:(Q.x=Q.y=true,()=>{Q.x=Q.y=false;})}var $m=new WeakMap,Ir=class{constructor(e){this.openDragLock=null,this.isDragging=false,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=false,this.hasMutatedConstraints=false,this.elastic=D(),this.visualElement=e;}start(e,{snapToCursor:r=false}={}){let{presenceContext:o}=this.visualElement;if(o&&o.isPresent===false)return;let i=m=>{let{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(gt(m).point);},s=(m,u)=>{let{drag:f,dragPropagation:p,onDragStart:h}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ds(f),!this.openDragLock))return;this.isDragging=true,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=true,this.visualElement.projection.target=void 0),z(v=>{let g=this.getAxisMotionValue(v).get()||0;if(W.test(g)){let{projection:b}=this.visualElement;if(b&&b.layout){let d=b.layout.layoutBox[v];d&&(g=F(d)*(parseFloat(g)/100));}}this.originPoint[v]=g;}),h&&V.postRender(()=>h(m,u)),De(this.visualElement,"transform");let{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",true);},n=(m,u)=>{let{dragPropagation:f,dragDirectionLock:p,onDirectionLock:h,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:v}=u;if(p&&this.currentDirection===null){this.currentDirection=zm(v),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",u.point,v),this.updateAxis("y",u.point,v),this.visualElement.render(),y&&y(m,u);},a=(m,u)=>this.stop(m,u),l=()=>z(m=>this.getAnimationState(m)==="paused"&&this.getAxisMotionValue(m).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new xe(e,{onSessionStart:i,onStart:s,onMove:n,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:kr(this.visualElement)});}stop(e,r){let o=this.isDragging;if(this.cancel(),!o)return;let{velocity:i}=r;this.startAnimation(i);let{onDragEnd:s}=this.getProps();s&&V.postRender(()=>s(e,r));}cancel(){this.isDragging=false;let{projection:e,animationState:r}=this.visualElement;e&&(e.isAnimationBlocked=false),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",false);}updateAxis(e,r,o){let{drag:i}=this.getProps();if(!o||!Or(e,i,this.currentDirection))return;let s=this.getAxisMotionValue(e),n=this.originPoint[e]+o[e];this.constraints&&this.constraints[e]&&(n=Ss(n,this.constraints[e],this.elastic[e])),s.set(n);}resolveConstraints(){let{dragConstraints:e,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(false):this.visualElement.projection?.layout,i=this.constraints;e&&ct(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&o?this.constraints=Ps(o.layoutBox,e):this.constraints=false,this.elastic=Cs(r),i!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&z(s=>{this.constraints!==false&&this.getAxisMotionValue(s)&&(this.constraints[s]=Ms(o.layoutBox[s],this.constraints[s]));});}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!ct(e))return false;let o=e.current;N(o!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:i}=this.visualElement;if(!i||!i.layout)return false;let s=hs(o,i.root,this.visualElement.getTransformPagePoint()),n=ws(i.layout.layoutBox,s);if(r){let a=r(Zn(n));this.hasMutatedConstraints=!!a,a&&(n=Rr(a));}return n}startAnimation(e){let{drag:r,dragMomentum:o,dragElastic:i,dragTransition:s,dragSnapToOrigin:n,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=z(m=>{if(!Or(m,r,this.currentDirection))return;let u=l&&l[m]||{};n&&(u={min:0,max:0});let f=i?200:1e6,p=i?40:1e7,h={type:"inertia",velocity:o?e[m]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(m,h)});return Promise.all(c).then(a)}startAxisValueAnimation(e,r){let o=this.getAxisMotionValue(e);return De(this.visualElement,e),o.start(he(e,o,0,r,this.visualElement,false))}stopAnimation(){z(e=>this.getAxisMotionValue(e).stop());}pauseAnimation(){z(e=>this.getAxisMotionValue(e).animation?.pause());}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let r=`_drag${e.toUpperCase()}`,o=this.visualElement.getProps(),i=o[r];return i||this.visualElement.getValue(e,(o.initial?o.initial[e]:void 0)||0)}snapToCursor(e){z(r=>{let{drag:o}=this.getProps();if(!Or(r,o,this.currentDirection))return;let{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){let{min:n,max:a}=i.layout.layoutBox[r];s.set(e[r]-P(n,a,.5));}});}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:r}=this.getProps(),{projection:o}=this.visualElement;if(!ct(r)||!o||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};z(n=>{let a=this.getAxisMotionValue(n);if(a&&this.constraints!==false){let l=a.get();i[n]=As({min:l,max:l},this.constraints[n]);}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),z(n=>{if(!Or(n,e,null))return;let a=this.getAxisMotionValue(n),{min:l,max:c}=this.constraints[n];a.set(P(l,c,i[n]));});}addListeners(){if(!this.visualElement.current)return;$m.set(this.visualElement,this);let e=this.visualElement.current,r=Ct(e,"pointerdown",l=>{let{drag:c,dragListener:m=true}=this.getProps();c&&m&&this.start(l);}),o=()=>{let{dragConstraints:l}=this.getProps();ct(l)&&l.current&&(this.constraints=this.resolveRefConstraints());},{projection:i}=this.visualElement,s=i.addEventListener("measure",o);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),V.read(o);let n=dt(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(z(m=>{let u=this.getAxisMotionValue(m);u&&(this.originPoint[m]+=l[m].translate,u.set(u.get()+l[m].translate));}),this.visualElement.render());});return ()=>{n(),r(),s(),a&&a();}}getProps(){let e=this.visualElement.getProps(),{drag:r=false,dragDirectionLock:o=false,dragPropagation:i=false,dragConstraints:s=false,dragElastic:n=Br,dragMomentum:a=true}=e;return {...e,drag:r,dragDirectionLock:o,dragPropagation:i,dragConstraints:s,dragElastic:n,dragMomentum:a}}};function Or(t,e,r){return (e===true||e===t)&&(r===null||r===t)}function zm(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}var jr=class extends I{constructor(e){super(e),this.removeGroupControls=E,this.removeListeners=E,this.controls=new Ir(e);}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||E;}unmount(){this.removeGroupControls(),this.removeListeners();}};var Es=t=>(e,r)=>{t&&V.postRender(()=>t(e,r));},Nr=class extends I{constructor(){super(...arguments),this.removePointerDownListener=E;}onPointerDown(e){this.session=new xe(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:kr(this.node)});}createPanHandlers(){let{onPanSessionStart:e,onPanStart:r,onPan:o,onPanEnd:i}=this.node.getProps();return {onSessionStart:Es(e),onStart:Es(r),onMove:o,onEnd:(s,n)=>{delete this.session,i&&V.postRender(()=>i(s,n));}}}mount(){this.removePointerDownListener=Ct(this.node.current,"pointerdown",e=>this.onPointerDown(e));}update(){this.session&&this.session.updateHandlers(this.createPanHandlers());}unmount(){this.removePointerDownListener(),this.session&&this.session.end();}};var ve={hasAnimatedSinceResize:true,hasEverUpdated:false};function Rs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}var Te={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(x.test(t))t=parseFloat(t);else return t;let r=Rs(t,e.target.x),o=Rs(t,e.target.y);return `${r}% ${o}%`}};var Ls={correct:(t,{treeScale:e,projectionDelta:r})=>{let o=t,i=H.parse(t);if(i.length>5)return o;let s=H.createTransformer(t),n=typeof i[0]!="number"?1:0,a=r.x.scale*e.x,l=r.y.scale*e.y;i[0+n]/=a,i[1+n]/=l;let c=P(a,l,.5);return typeof i[2+n]=="number"&&(i[2+n]/=c),typeof i[3+n]=="number"&&(i[3+n]/=c),s(i)}};var Wo=class extends Component{componentDidMount(){let{visualElement:e,layoutGroup:r,switchLayoutGroup:o,layoutId:i}=this.props,{projection:s}=e;Ei(Xm),s&&(r.group&&r.group.add(s),o&&o.register&&i&&o.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove();}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),ve.hasEverUpdated=true;}getSnapshotBeforeUpdate(e){let{layoutDependency:r,visualElement:o,drag:i,isPresent:s}=this.props,{projection:n}=o;return n&&(n.isPresent=s,i||e.layoutDependency!==r||r===void 0||e.isPresent!==s?n.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?n.promote():n.relegate()||V.postRender(()=>{let a=n.getStack();(!a||!a.members.length)&&this.safeToRemove();}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),_t.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove();}));}componentWillUnmount(){let{visualElement:e,layoutGroup:r,switchLayoutGroup:o}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),o&&o.deregister&&o.deregister(i));}safeToRemove(){let{safeToRemove:e}=this.props;e&&e();}render(){return null}};function Ur(t){let[e,r]=pi(),o=useContext(je);return jsx(Wo,{...t,layoutGroup:o,switchLayoutGroup:useContext(ze),isPresent:e,safeToRemove:r})}var Xm={borderRadius:{...Te,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Te,borderTopRightRadius:Te,borderBottomLeftRadius:Te,borderBottomRightRadius:Te,boxShadow:Ls};function Bs(t,e,r){let o=M(t)?t:pt(t);return o.start(he("",o,e,r)),o.animation}function Fs(t){return t instanceof SVGElement&&t.tagName!=="svg"}var Os=(t,e)=>t.depth-e.depth;var Kr=class{constructor(){this.children=[],this.isDirty=false;}add(e){oe(this.children,e),this.isDirty=true;}remove(e){ie(this.children,e),this.isDirty=true;}forEach(e){this.isDirty&&this.children.sort(Os),this.isDirty=false,this.children.forEach(e);}};function Is(t,e){let r=L.now(),o=({timestamp:i})=>{let s=i-r;s>=e&&(Y(o),t(s-e));};return V.setup(o,true),()=>Y(o)}var Ks=["TopLeft","TopRight","BottomLeft","BottomRight"],qm=Ks.length,js=t=>typeof t=="string"?parseFloat(t):t,Ns=t=>typeof t=="number"||x.test(t);function Gs(t,e,r,o,i,s){i?(t.opacity=P(0,r.opacity??1,Zm(o)),t.opacityExit=P(e.opacity??1,0,Jm(o))):s&&(t.opacity=P(e.opacity??1,r.opacity??1,o));for(let n=0;n<qm;n++){let a=`border${Ks[n]}Radius`,l=Us(e,a),c=Us(r,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Ns(l)===Ns(c)?(t[a]=Math.max(P(js(l),js(c),o),0),(W.test(c)||W.test(l))&&(t[a]+="%")):t[a]=c;}(e.rotate||r.rotate)&&(t.rotate=P(e.rotate||0,r.rotate||0,o));}function Us(t,e){return t[e]!==void 0?t[e]:t.borderRadius}var Zm=Ws(0,.5,gr),Jm=Ws(.5,.95,E);function Ws(t,e,r){return o=>o<t?0:o>e?1:r(ht(t,e,o))}function Hs(t,e){t.min=e.min,t.max=e.max;}function X(t,e){Hs(t.x,e.x),Hs(t.y,e.y);}function Ho(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin;}function $s(t,e,r,o,i){return t-=e,t=ke(t,1/r,o),i!==void 0&&(t=ke(t,1/i,o)),t}function Qm(t,e=0,r=1,o=.5,i,s=t,n=t){if(W.test(e)&&(e=parseFloat(e),e=P(n.min,n.max,e/100)-n.min),typeof e!="number")return;let a=P(s.min,s.max,o);t===s&&(a-=e),t.min=$s(t.min,e,r,a,i),t.max=$s(t.max,e,r,a,i);}function zs(t,e,[r,o,i],s,n){Qm(t,e[r],e[o],e[i],e.scale,s,n);}var tc=["x","scaleX","originX"],ec=["y","scaleY","originY"];function $o(t,e,r,o){zs(t.x,e,tc,r?r.x:void 0,o?o.x:void 0),zs(t.y,e,ec,r?r.y:void 0,o?o.y:void 0);}function _s(t){return t.translate===0&&t.scale===1}function zo(t){return _s(t.x)&&_s(t.y)}function Ys(t,e){return t.min===e.min&&t.max===e.max}function qs(t,e){return Ys(t.x,e.x)&&Ys(t.y,e.y)}function Xs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function _o(t,e){return Xs(t.x,e.x)&&Xs(t.y,e.y)}function Yo(t){return F(t.x)/F(t.y)}function Xo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}var Gr=class{constructor(){this.members=[];}add(e){oe(this.members,e),e.scheduleRender();}remove(e){if(ie(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r);}}relegate(e){let r=this.members.findIndex(i=>e===i);if(r===0)return false;let o;for(let i=r;i>=0;i--){let s=this.members[i];if(s.isPresent!==false){o=s;break}}return o?(this.promote(o),true):false}promote(e,r){let o=this.lead;if(e!==o&&(this.prevLead=o,this.lead=e,e.show(),o)){o.instance&&o.scheduleRender(),e.scheduleRender(),e.resumeFrom=o,r&&(e.resumeFrom.preserveOpacity=true),o.snapshot&&(e.snapshot=o.snapshot,e.snapshot.latestValues=o.animationValues||o.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=true);let{crossfade:i}=e.options;i===false&&o.hide();}}exitAnimationComplete(){this.members.forEach(e=>{let{options:r,resumingFrom:o}=e;r.onExitComplete&&r.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete();});}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(false);});}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0);}};function Zs(t,e,r){let o="",i=t.x.translate/e.x,s=t.y.translate/e.y,n=r?.z||0;if((i||s||n)&&(o=`translate3d(${i}px, ${s}px, ${n}px) `),(e.x!==1||e.y!==1)&&(o+=`scale(${1/e.x}, ${1/e.y}) `),r){let{transformPerspective:c,rotate:m,rotateX:u,rotateY:f,skewX:p,skewY:h}=r;c&&(o=`perspective(${c}px) ${o}`),m&&(o+=`rotate(${m}deg) `),u&&(o+=`rotateX(${u}deg) `),f&&(o+=`rotateY(${f}deg) `),p&&(o+=`skewX(${p}deg) `),h&&(o+=`skewY(${h}deg) `);}let a=t.x.scale*e.x,l=t.y.scale*e.y;return (a!==1||l!==1)&&(o+=`scale(${a}, ${l})`),o||"none"}var qo=["","X","Y","Z"],rc={visibility:"hidden"},Js=1e3,oc=0;function Zo(t,e,r,o){let{latestValues:i}=e;i[t]&&(r[t]=i[t],e.setStaticValue(t,0),o&&(o[t]=0));}function sa(t){if(t.hasCheckedOptimisedAppear=true,t.root===t)return;let{visualElement:e}=t.options;if(!e)return;let r=rr(e);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",V,!(i||s));}let{parent:o}=t;o&&!o.hasCheckedOptimisedAppear&&sa(o);}function Wr({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:o,resetTransform:i}){return class{constructor(n={},a=e?.()){this.id=oc++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=false,this.isAnimationBlocked=false,this.isLayoutDirty=false,this.isProjectionDirty=false,this.isSharedProjectionDirty=false,this.isTransformDirty=false,this.updateManuallyBlocked=false,this.updateBlockedByResize=false,this.isUpdating=false,this.isSVG=false,this.needsReset=false,this.shouldResetTransform=false,this.hasCheckedOptimisedAppear=false,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=false,this.updateScheduled=false,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=false,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=false,this.clearAllSnapshots());},this.updateProjection=()=>{this.projectionUpdateScheduled=false,this.nodes.forEach(sc),this.nodes.forEach(uc),this.nodes.forEach(fc),this.nodes.forEach(ac);},this.resolvedRelativeTargetAt=0,this.hasProjected=false,this.isVisible=true,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=n,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=true;this.root===this&&(this.nodes=new Kr);}addEventListener(n,a){return this.eventHandlers.has(n)||this.eventHandlers.set(n,new Tt),this.eventHandlers.get(n).add(a)}notifyListeners(n,...a){let l=this.eventHandlers.get(n);l&&l.notify(...a);}hasListeners(n){return this.eventHandlers.has(n)}mount(n){if(this.instance)return;this.isSVG=Fs(n),this.instance=n;let{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(n),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=true),t){let m,u=()=>this.root.updateBlockedByResize=false;t(n,()=>{this.root.updateBlockedByResize=true,m&&m(),m=Is(u,250),ve.hasAnimatedSinceResize&&(ve.hasAnimatedSinceResize=false,this.nodes.forEach(ta));});}a&&this.root.registerSharedNode(a,this),this.options.animate!==false&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:u,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let h=this.options.transition||c.getDefaultTransition()||yc,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=c.getProps(),g=!this.targetLayout||!_o(this.targetLayout,p),b=!u&&f;if(this.options.layoutRoot||this.resumeFrom||b||u&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,b);let d={...ne(h,"layout"),onPlay:y,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(d.delay=0,d.type=false),this.startAnimation(d);}else u||ta(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p;});}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let n=this.getStack();n&&n.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Y(this.updateProjection);}blockUpdate(){this.updateManuallyBlocked=true;}unblockUpdate(){this.updateManuallyBlocked=false;}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||false}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=true,this.nodes&&this.nodes.forEach(pc),this.animationId++);}getTransformTemplate(){let{visualElement:n}=this.options;return n&&n.getProps().transformTemplate}willUpdate(n=true){if(this.root.hasTreeAnimated=true,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=true;for(let m=0;m<this.path.length;m++){let u=this.path[m];u.shouldResetTransform=true,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(false);}let{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;let c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),n&&this.notifyListeners("willUpdate");}update(){if(this.updateScheduled=false,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Qs);return}this.isUpdating||this.nodes.forEach(mc),this.isUpdating=false,this.nodes.forEach(cc),this.nodes.forEach(ic),this.nodes.forEach(nc),this.clearAllSnapshots();let a=L.now();R.delta=j(0,1e3/60,a-R.timestamp),R.timestamp=a,R.isProcessing=true,Ke.update.process(R),Ke.preRender.process(R),Ke.render.process(R),R.isProcessing=false;}didUpdate(){this.updateScheduled||(this.updateScheduled=true,_t.read(this.scheduleUpdate));}clearAllSnapshots(){this.nodes.forEach(lc),this.sharedNodes.forEach(hc);}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=true,V.preRender(this.updateProjection,false,true));}scheduleCheckAfterUnmount(){V.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed();});}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!F(this.snapshot.measuredBox.x)&&!F(this.snapshot.measuredBox.y)&&(this.snapshot=void 0));}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();let n=this.layout;this.layout=this.measure(false),this.layoutCorrected=D(),this.isLayoutDirty=false,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,n?n.layoutBox:void 0);}updateScroll(n="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===n&&(a=false),a&&this.instance){let l=o(this.instance);this.scroll={animationId:this.root.animationId,phase:n,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l};}}resetTransform(){if(!i)return;let n=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!zo(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,m=c!==this.prevTransformTemplateValue;n&&this.instance&&(a||yt(this.latestValues)||m)&&(i(this.instance,c),this.shouldResetTransform=false,this.scheduleRender());}measure(n=true){let a=this.measurePageBox(),l=this.removeElementScroll(a);return n&&(l=this.removeTransform(l)),xc(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:n}=this.options;if(!n)return D();let a=n.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(vc))){let{scroll:c}=this.root;c&&(Dt(a.x,c.offset.x),Dt(a.y,c.offset.y));}return a}removeElementScroll(n){let a=D();if(X(a,n),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){let c=this.path[l],{scroll:m,options:u}=c;c!==this.root&&m&&u.layoutScroll&&(m.wasRoot&&X(a,n),Dt(a.x,m.offset.x),Dt(a.y,m.offset.y));}return a}applyTransform(n,a=false){let l=D();X(l,n);for(let c=0;c<this.path.length;c++){let m=this.path[c];!a&&m.options.layoutScroll&&m.scroll&&m!==m.root&&jt(l,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),yt(m.latestValues)&&jt(l,m.latestValues);}return yt(this.latestValues)&&jt(l,this.latestValues),l}removeTransform(n){let a=D();X(a,n);for(let l=0;l<this.path.length;l++){let c=this.path[l];if(!c.instance||!yt(c.latestValues))continue;Lr(c.latestValues)&&c.updateSnapshot();let m=D(),u=c.measurePageBox();X(m,u),$o(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,m);}return yt(this.latestValues)&&$o(a,this.latestValues),a}setTargetDelta(n){this.targetDelta=n,this.root.scheduleUpdateProjection(),this.isProjectionDirty=true;}setOptions(n){this.options={...this.options,...n,crossfade:n.crossfade!==void 0?n.crossfade:true};}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=false;}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==R.timestamp&&this.relativeParent.resolveTargetDelta(true);}resolveTargetDelta(n=false){let a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);let l=!!this.resumingFrom||this!==a;if(!(n||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:m,layoutId:u}=this.options;if(!(!this.layout||!(m||u))){if(this.resolvedRelativeTargetAt=R.timestamp,!this.targetDelta&&!this.relativeTarget){let f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=D(),this.relativeTargetOrigin=D(),ye(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),X(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0;}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=D(),this.targetWithTransforms=D()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ns(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):X(this.target,this.layout.layoutBox),No(this.target,this.targetDelta)):X(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=false;let f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=D(),this.relativeTargetOrigin=D(),ye(this.relativeTargetOrigin,this.target,f.target),X(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0;}}}}getClosestProjectingParent(){if(!(!this.parent||Lr(this.parent.latestValues)||Io(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return !!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){let n=this.getLead(),a=!!this.resumingFrom||this!==n,l=true;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=false),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=false),this.resolvedRelativeTargetAt===R.timestamp&&(l=false),l)return;let{layout:c,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||m))return;X(this.layoutCorrected,this.layout.layoutBox);let u=this.treeScale.x,f=this.treeScale.y;ps(this.layoutCorrected,this.treeScale,this.path,a),n.layout&&!n.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(n.target=n.layout.layoutBox,n.targetWithTransforms=D());let{target:p}=n;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ho(this.prevProjectionDelta.x,this.projectionDelta.x),Ho(this.prevProjectionDelta.y,this.projectionDelta.y)),ge(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==f||!Xo(this.projectionDelta.x,this.prevProjectionDelta.x)||!Xo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=true,this.scheduleRender(),this.notifyListeners("projectionUpdate",p));}hide(){this.isVisible=false;}show(){this.isVisible=true;}scheduleRender(n=true){if(this.options.visualElement?.scheduleRender(),n){let a=this.getStack();a&&a.scheduleRender();}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0);}createProjectionDeltas(){this.prevProjectionDelta=It(),this.projectionDelta=It(),this.projectionDeltaWithTransform=It();}setAnimationOrigin(n,a=false){let l=this.snapshot,c=l?l.latestValues:{},m={...this.latestValues},u=It();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;let f=D(),p=l?l.source:void 0,h=this.layout?this.layout.source:void 0,y=p!==h,v=this.getStack(),g=!v||v.members.length<=1,b=!!(y&&!g&&this.options.crossfade===true&&!this.path.some(gc));this.animationProgress=0;let d;this.mixTargetDelta=w=>{let T=w/1e3;ea(u.x,n.x,T),ea(u.y,n.y,T),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ye(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dc(this.relativeTarget,this.relativeTargetOrigin,f,T),d&&qs(this.relativeTarget,d)&&(this.isProjectionDirty=false),d||(d=D()),X(d,this.relativeTarget)),y&&(this.animationValues=m,Gs(m,c,this.latestValues,T,b,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T;},this.mixTargetDelta(this.options.layoutRoot?1e3:0);}startAnimation(n){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Y(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=V.update(()=>{ve.hasAnimatedSinceResize=true,this.currentAnimation=Bs(0,Js,{...n,onUpdate:a=>{this.mixTargetDelta(a),n.onUpdate&&n.onUpdate(a);},onStop:()=>{},onComplete:()=>{n.onComplete&&n.onComplete(),this.completeAnimation();}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0;});}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let n=this.getStack();n&&n.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete");}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Js),this.currentAnimation.stop()),this.completeAnimation();}applyTransformsToTarget(){let n=this.getLead(),{targetWithTransforms:a,target:l,layout:c,latestValues:m}=n;if(!(!a||!l||!c)){if(this!==n&&this.layout&&c&&aa(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||D();let u=F(this.layout.layoutBox.x);l.x.min=n.target.x.min,l.x.max=l.x.min+u;let f=F(this.layout.layoutBox.y);l.y.min=n.target.y.min,l.y.max=l.y.min+f;}X(a,l),jt(a,m),ge(this.projectionDeltaWithTransform,this.layoutCorrected,a,m);}}registerSharedNode(n,a){this.sharedNodes.has(n)||this.sharedNodes.set(n,new Gr),this.sharedNodes.get(n).add(a);let c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0});}isLead(){let n=this.getStack();return n?n.lead===this:true}getLead(){let{layoutId:n}=this.options;return n?this.getStack()?.lead||this:this}getPrevLead(){let{layoutId:n}=this.options;return n?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:n}=this.options;if(n)return this.root.sharedNodes.get(n)}promote({needsReset:n,transition:a,preserveFollowOpacity:l}={}){let c=this.getStack();c&&c.promote(this,l),n&&(this.projectionDelta=void 0,this.needsReset=true),a&&this.setOptions({transition:a});}relegate(){let n=this.getStack();return n?n.relegate(this):false}resetSkewAndRotation(){let{visualElement:n}=this.options;if(!n)return;let a=false,{latestValues:l}=n;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=true),!a)return;let c={};l.z&&Zo("z",n,c,this.animationValues);for(let m=0;m<qo.length;m++)Zo(`rotate${qo[m]}`,n,c,this.animationValues),Zo(`skew${qo[m]}`,n,c,this.animationValues);n.render();for(let m in c)n.setStaticValue(m,c[m]),this.animationValues&&(this.animationValues[m]=c[m]);n.scheduleRender();}getProjectionStyles(n){if(!this.instance||this.isSVG)return;if(!this.isVisible)return rc;let a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=false,a.opacity="",a.pointerEvents=ee(n?.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){let p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=ee(n?.pointerEvents)||""),this.hasProjected&&!yt(this.latestValues)&&(p.transform=l?l({},""):"none",this.hasProjected=false),p}let m=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=Zs(this.projectionDeltaWithTransform,this.treeScale,m),l&&(a.transform=l(m,a.transform));let{x:u,y:f}=this.projectionDelta;a.transformOrigin=`${u.origin*100}% ${f.origin*100}% 0`,c.animationValues?a.opacity=c===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:a.opacity=c===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(let p in Rt){if(m[p]===void 0)continue;let{correct:h,applyTo:y,isCSSVariable:v}=Rt[p],g=a.transform==="none"?m[p]:h(m[p],c);if(y){let b=y.length;for(let d=0;d<b;d++)a[y[d]]=g;}else v?this.options.visualElement.renderState.vars[p]=g:a[p]=g;}return this.options.layoutId&&(a.pointerEvents=c===this?ee(n?.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0;}resetTree(){this.root.nodes.forEach(n=>n.currentAnimation?.stop()),this.root.nodes.forEach(Qs),this.root.sharedNodes.clear();}}}function ic(t){t.updateLayout();}function nc(t){let e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:o}=t.layout,{animationType:i}=t.options,s=e.source!==t.layout.source;i==="size"?z(m=>{let u=s?e.measuredBox[m]:e.layoutBox[m],f=F(u);u.min=r[m].min,u.max=u.min+f;}):aa(i,e.layoutBox,r)&&z(m=>{let u=s?e.measuredBox[m]:e.layoutBox[m],f=F(r[m]);u.max=u.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=true,t.relativeTarget[m].max=t.relativeTarget[m].min+f);});let n=It();ge(n,r,e.layoutBox);let a=It();s?ge(a,t.applyTransform(o,true),e.measuredBox):ge(a,r,e.layoutBox);let l=!zo(n),c=false;if(!t.resumeFrom){let m=t.getClosestProjectingParent();if(m&&!m.resumeFrom){let{snapshot:u,layout:f}=m;if(u&&f){let p=D();ye(p,e.layoutBox,u.layoutBox);let h=D();ye(h,r,f.layoutBox),_o(p,h)||(c=true),m.options.layoutRoot&&(t.relativeTarget=h,t.relativeTargetOrigin=p,t.relativeParent=m);}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:a,layoutDelta:n,hasLayoutChanged:l,hasRelativeLayoutChanged:c});}else if(t.isLead()){let{onExitComplete:r}=t.options;r&&r();}t.options.transition=void 0;}function sc(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty));}function ac(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=false;}function lc(t){t.clearSnapshot();}function Qs(t){t.clearMeasurements();}function mc(t){t.isLayoutDirty=false;}function cc(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform();}function ta(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=true;}function uc(t){t.resolveTargetDelta();}function fc(t){t.calcProjection();}function pc(t){t.resetSkewAndRotation();}function hc(t){t.removeLeadSnapshot();}function ea(t,e,r){t.translate=P(e.translate,0,r),t.scale=P(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint;}function ra(t,e,r,o){t.min=P(e.min,r.min,o),t.max=P(e.max,r.max,o);}function dc(t,e,r,o){ra(t.x,e.x,r.x,o),ra(t.y,e.y,r.y,o);}function gc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}var yc={duration:.45,ease:[.4,0,.1,1]},oa=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ia=oa("applewebkit/")&&!oa("chrome/")?Math.round:E;function na(t){t.min=ia(t.min),t.max=ia(t.max);}function xc(t){na(t.x),na(t.y);}function aa(t,e,r){return t==="position"||t==="preserve-aspect"&&!is(Yo(e),Yo(r),.2)}function vc(t){return t!==t.root&&t.scroll?.wasRoot}var la=Wr({attachResizeListener:(t,e)=>dt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>true});var Jo={current:void 0},Hr=Wr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Jo.current){let t=new la({});t.mount(window),t.setOptions({layoutScroll:true}),Jo.current=t;}return Jo.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none";},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});var ma={pan:{Feature:Nr},drag:{Feature:jr,ProjectionNode:Hr,MeasureLayout:Ur}};function ca(t,e,r){if(t instanceof EventTarget)return [t];if(typeof t=="string"){let o=document;let i=o.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}function $r(t,e){let r=ca(t),o=new AbortController,i={passive:true,...e,signal:o.signal};return [r,i,()=>o.abort()]}function ua(t){return !(t.pointerType==="touch"||Fr())}function fa(t,e,r={}){let[o,i,s]=$r(t,r),n=a=>{if(!ua(a))return;let{target:l}=a,c=e(l,a);if(typeof c!="function"||!l)return;let m=u=>{ua(u)&&(c(u),l.removeEventListener("pointerleave",m));};l.addEventListener("pointerleave",m,i);};return o.forEach(a=>{a.addEventListener("pointerenter",n,i);}),s}function pa(t,e,r){let{props:o}=t;t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",r==="Start");let i="onHover"+r,s=o[i];s&&V.postRender(()=>s(e,gt(e)));}var zr=class extends I{mount(){let{current:e}=this.node;e&&(this.unmount=fa(e,(r,o)=>(pa(this.node,o,"Start"),i=>pa(this.node,i,"End"))));}unmount(){}};var _r=class extends I{constructor(){super(...arguments),this.isActive=false;}onFocus(){let e=false;try{e=this.node.current.matches(":focus-visible");}catch{e=true;}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",true),this.isActive=true);}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",false),this.isActive=false);}mount(){this.unmount=st(dt(this.node.current,"focus",()=>this.onFocus()),dt(this.node.current,"blur",()=>this.onBlur()));}unmount(){}};var Qo=(t,e)=>e?t===e?true:Qo(t,e.parentElement):false;var Tc=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ha(t){return Tc.has(t.tagName)||t.tabIndex!==-1}var Ut=new WeakSet;function da(t){return e=>{e.key==="Enter"&&t(e);}}function ti(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:true,bubbles:true}));}var ga=(t,e)=>{let r=t.currentTarget;if(!r)return;let o=da(()=>{if(Ut.has(r))return;ti(r,"down");let i=da(()=>{ti(r,"up");}),s=()=>ti(r,"cancel");r.addEventListener("keyup",i,e),r.addEventListener("blur",s,e);});r.addEventListener("keydown",o,e),r.addEventListener("blur",()=>r.removeEventListener("keydown",o),e);};function ya(t){return de(t)&&!Fr()}function xa(t,e,r={}){let[o,i,s]=$r(t,r),n=a=>{let l=a.currentTarget;if(!ya(a)||Ut.has(l))return;Ut.add(l);let c=e(l,a),m=(p,h)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",f),!(!ya(p)||!Ut.has(l))&&(Ut.delete(l),typeof c=="function"&&c(p,{success:h}));},u=p=>{m(p,l===window||l===document||r.useGlobalTarget||Qo(l,p.target));},f=p=>{m(p,false);};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",f,i);};return o.forEach(a=>{(r.useGlobalTarget?window:a).addEventListener("pointerdown",n,i),a instanceof HTMLElement&&(a.addEventListener("focus",c=>ga(c,i)),!ha(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0));}),s}function va(t,e,r){let{props:o}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap",r==="Start");let i="onTap"+(r==="End"?"":r),s=o[i];s&&V.postRender(()=>s(e,gt(e)));}var Yr=class extends I{mount(){let{current:e}=this.node;e&&(this.unmount=xa(e,(r,o)=>(va(this.node,o,"Start"),(i,{success:s})=>va(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}));}unmount(){}};var ri=new WeakMap,ei=new WeakMap,bc=t=>{let e=ri.get(t.target);e&&e(t);},Vc=t=>{t.forEach(bc);};function Sc({root:t,...e}){let r=t||document;ei.has(r)||ei.set(r,{});let o=ei.get(r),i=JSON.stringify(e);return o[i]||(o[i]=new IntersectionObserver(Vc,{root:t,...e})),o[i]}function Ta(t,e,r){let o=Sc(e);return ri.set(t,r),o.observe(t),()=>{ri.delete(t),o.unobserve(t);}}var Pc={some:0,all:1},Xr=class extends I{constructor(){super(...arguments),this.hasEnteredView=false,this.isInView=false;}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:r,margin:o,amount:i="some",once:s}=e,n={root:r?r.current:void 0,rootMargin:o,threshold:typeof i=="number"?i:Pc[i]},a=l=>{let{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=true),this.node.animationState&&this.node.animationState.setActive("whileInView",c);let{onViewportEnter:m,onViewportLeave:u}=this.node.getProps(),f=c?m:u;f&&f(l);};return Ta(this.node.current,n,a)}mount(){this.startObserver();}update(){if(typeof IntersectionObserver>"u")return;let{props:e,prevProps:r}=this.node;["amount","margin","root"].some(wc(e,r))&&this.startObserver();}unmount(){}};function wc({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}var ba={inView:{Feature:Xr},tap:{Feature:Yr},focus:{Feature:_r},hover:{Feature:zr}};var Va={layout:{ProjectionNode:Hr,MeasureLayout:Ur}};var Be={current:null},qr={current:false};function Sa(){if(qr.current=true,!!Wt)if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Be.current=t.matches;t.addListener(e),e();}else Be.current=false;}var Pa=new WeakMap;function wa(t,e,r){for(let o in e){let i=e[o],s=r[o];if(M(i))t.addValue(o,i);else if(M(s))t.addValue(o,pt(i,{owner:t}));else if(s!==i)if(t.hasValue(o)){let n=t.getValue(o);n.liveStyle===true?n.jump(i):n.hasAnimated||n.set(i);}else {let n=t.getStaticValue(o);t.addValue(o,pt(n!==void 0?n:i,{owner:t}));}}for(let o in r)e[o]===void 0&&t.removeValue(o);return e}var Zr=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);var Jr=t=>/^0[^.\s]+$/u.test(t);var Aa={test:t=>t==="auto",parse:t=>t};var Qr=t=>e=>e.test(t);var oi=[rt,x,W,ot,Li,Ri,Aa],ii=t=>oi.find(Qr(t));var Ac=[...oi,k,H],Ma=t=>Ac.find(Qr(t));var Mc=new Set(["brightness","contrast","saturate","opacity"]);function Cc(t){let[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;let[o]=r.match(se)||[];if(!o)return t;let i=r.replace(o,""),s=Mc.has(e)?1:0;return o!==r&&(s*=100),e+"("+s+i+")"}var Dc=/\b([a-z-]*)\(.*?\)/gu,Fe={...H,getAnimatableNone:t=>{let e=t.match(Dc);return e?e.map(Cc).join(" "):t}};var Ec={...qt,color:k,backgroundColor:k,outlineColor:k,fill:k,stroke:k,borderColor:k,borderTopColor:k,borderRightColor:k,borderBottomColor:k,borderLeftColor:k,filter:Fe,WebkitFilter:Fe},to=t=>Ec[t];function eo(t,e){let r=to(t);return r!==Fe&&(r=H),r.getAnimatableNone?r.getAnimatableNone(e):void 0}var Ca=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],ro=class{scrapeMotionValuesFromProps(e,r,o){return {}}constructor({parent:e,props:r,presenceContext:o,reducedMotionConfig:i,blockInitialAnimation:s,visualState:n},a={}){this.current=null,this.children=new Set,this.isVariantNode=false,this.isControllingVariants=false,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Mt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection));},this.renderScheduledAt=0,this.scheduleRender=()=>{let f=L.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,V.render(this.render,false,true));};let{latestValues:l,renderState:c}=n;this.latestValues=l,this.baseTarget={...l},this.initialValues=r.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=r,this.presenceContext=o,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Et(r),this.isVariantNode=He(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:m,...u}=this.scrapeMotionValuesFromProps(r,{},this);for(let f in u){let p=u[f];l[f]!==void 0&&M(p)&&p.set(l[f],false);}}mount(e){this.current=e,Pa.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,o)=>this.bindToMotionValue(o,r)),qr.current||Sa(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?false:this.reducedMotionConfig==="always"?true:Be.current,process.env.NODE_ENV!=="production"&&$t(this.shouldReduceMotion!==true,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext);}unmount(){this.projection&&this.projection.unmount(),Y(this.notifyUpdate),Y(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let r=this.features[e];r&&(r.unmount(),r.isMounted=false);}this.current=null;}bindToMotionValue(e,r){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let o=J.has(e);o&&this.onBindTransform&&this.onBindTransform();let i=r.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&V.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=true);}),s=r.on("renderRequest",this.scheduleRender),n;window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,r)),this.valueSubscriptions.set(e,()=>{i(),s(),n&&n(),r.owner&&r.stop();});}sortNodePosition(e){return !this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in lt){let r=lt[e];if(!r)continue;let{isEnabled:o,Feature:i}=r;if(!this.features[e]&&i&&o(this.props)&&(this.features[e]=new i(this)),this.features[e]){let s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=true);}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props);}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):D()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r;}update(e,r){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let o=0;o<Ca.length;o++){let i=Ca[o];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let s="on"+i,n=e[s];n&&(this.propEventSubscriptions[i]=this.on(i,n));}this.prevMotionValues=wa(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue();}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(e),()=>r.variantChildren.delete(e)}addValue(e,r){let o=this.values.get(e);r!==o&&(o&&this.removeValue(e),this.bindToMotionValue(e,r),this.values.set(e,r),this.latestValues[e]=r.get());}removeValue(e){this.values.delete(e);let r=this.valueSubscriptions.get(e);r&&(r(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState);}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let o=this.values.get(e);return o===void 0&&r!==void 0&&(o=pt(r===null?void 0:r,{owner:this}),this.addValue(e,o)),o}readValue(e,r){let o=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return o!=null&&(typeof o=="string"&&(Zr(o)||Jr(o))?o=parseFloat(o):!Ma(o)&&H.test(r)&&(o=eo(e,r)),this.setBaseTarget(e,M(o)?o.get():o)),M(o)?o.get():o}setBaseTarget(e,r){this.baseTarget[e]=r;}getBaseTarget(e){let{initial:r}=this.props,o;if(typeof r=="string"||typeof r=="object"){let s=te(this.props,r,this.presenceContext?.custom);s&&(o=s[e]);}if(r&&o!==void 0)return o;let i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!M(i)?i:this.initialValues[e]!==void 0&&o===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new Tt),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r);}};var Rc=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Lc(t){let e=Rc.exec(t);if(!e)return [,];let[,r,o,i]=e;return [`--${r??o}`,i]}var kc=4;function ni(t,e,r=1){N(r<=kc,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);let[o,i]=Lc(t);if(!o)return;let s=window.getComputedStyle(e).getPropertyValue(o);if(s){let n=s.trim();return Zr(n)?parseFloat(n):n}return Xt(i)?ni(i,e,r+1):i}function Da(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Jr(t):true}var Bc=new Set(["auto","none","0"]);function Ea(t,e,r){let o=0,i;for(;o<t.length&&!i;){let s=t[o];typeof s=="string"&&!Bc.has(s)&&Lt(s).values.length&&(i=t[o]),o++;}if(i&&r)for(let s of e)t[s]=eo(r,i);}var oo=class extends Mt{constructor(e,r,o,i,s){super(e,r,o,i,s,true);}readKeyframes(){let{unresolvedKeyframes:e,element:r,name:o}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"&&(c=c.trim(),Xt(c))){let m=ni(c,r.current);m!==void 0&&(e[l]=m),l===e.length-1&&(this.finalKeyframe=c);}}if(this.resolveNoneKeyframes(),!Ar.has(o)||e.length!==2)return;let[i,s]=e,n=ii(i),a=ii(s);if(n!==a)if(Mo(n)&&Mo(a))for(let l=0;l<e.length;l++){let c=e[l];typeof c=="string"&&(e[l]=parseFloat(c));}else At[o]&&(this.needsMeasurement=true);}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:r}=this,o=[];for(let i=0;i<e.length;i++)(e[i]===null||Da(e[i]))&&o.push(i);o.length&&Ea(e,o,r);}measureInitialState(){let{element:e,unresolvedKeyframes:r,name:o}=this;if(!e||!e.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=At[o](e.measureViewportBox(),window.getComputedStyle(e.current)),r[0]=this.measuredOrigin;let i=r[r.length-1];i!==void 0&&e.getValue(o,i).jump(i,false);}measureEndState(){let{element:e,name:r,unresolvedKeyframes:o}=this;if(!e||!e.current)return;let i=e.getValue(r);i&&i.jump(this.measuredOrigin,false);let s=o.length-1,n=o[s];o[s]=At[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=n),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l);}),this.resolveNoneKeyframes();}};var be=class extends ro{constructor(){super(...arguments),this.KeyframeResolver=oo;}sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){return e.style?e.style[r]:void 0}removeValueFromRenderState(e,{vars:r,style:o}){delete r[e],delete o[e];}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;M(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`);}));}};function io(t,{style:e,vars:r},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(let s in r)t.style.setProperty(s,r[s]);}function Fc(t){return window.getComputedStyle(t)}var no=class extends be{constructor(){super(...arguments),this.type="html",this.renderInstance=io;}readValueFromInstance(e,r){if(J.has(r))return Dn(e,r);{let o=Fc(e),i=(Yt(r)?o.getPropertyValue(r):o[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return Uo(e,r)}build(e,r,o){Zt(e,r,o.transformTemplate);}scrapeMotionValuesFromProps(e,r,o){return re(e,r,o)}};var so=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ra(t,e,r,o){io(t,e,void 0,o);for(let i in e.attrs)t.setAttribute(so.has(i)?i:zt(i),e.attrs[i]);}var ao=class extends be{constructor(){super(...arguments),this.type="svg",this.isSVGTag=false,this.measureInstanceViewportBox=D;}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(J.has(r)){let o=to(r);return o&&o.default||0}return r=so.has(r)?r:zt(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,o){return Qe(e,r,o)}build(e,r,o){Xe(e,r,this.isSVGTag,o.transformTemplate,o.style);}renderInstance(e,r,o,i){Ra(e,r,o,i);}mount(e){this.isSVGTag=Ze(e.tagName),super.mount(e);}};var La=(t,e)=>Qt(t)?new ao(e):new no(e,{allowProjection:t!==Fragment});var ka=Hi({...Xn,...ba,...ma,...Va},La);var q=Ti(ka);var Ba=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];var Fa=Ba;function Oe({children:t,className:e,characterVariants:r,dadElement:o,onCharacterAnimationComplete:i,key:s}){if(typeof t=="string"){let n=t.split("").map((a,l)=>{let c=useRef(null);return jsx(q.span,{ref:c,className:e,variants:r,onAnimationComplete:i?()=>{i(c);}:void 0,children:a},`span-${s}-${a}-${l}`)});return o(n,true)}else if(Array.isArray(t)){let n=t.map(a=>typeof a=="string"?a.split("").map((c,m)=>{let u=useRef(null);return jsx(q.span,{ref:u,className:e,variants:r,onAnimationComplete:i?()=>{i(u);}:void 0,children:c},`span-${s}-${c}-${m}`)}):a);return o(n)}return o(t,true)}function ai({characterVariants:t,onCharacterAnimationComplete:e,delay:r}){let o={},i={hidden:t.hidden,visible:{...t,opacity:1,transition:{staggerChildren:r/1e3}}};return Fa.forEach(s=>{try{let n=q[s];if(n){let a=l=>{let{children:c,id:m,className:u}=l,{node:f,...p}=l;switch(s){case "table":case "input":case "hr":case "img":return createElement(n,{...p,key:`${s}-${m}`,variants:u?void 0:i,onAnimationComplete:e},c);case "tr":case "th":case "td":return jsx(n,{...p,children:c});case "p":return jsx(Oe,{children:c,characterVariants:t,onCharacterAnimationComplete:e,dadElement:h=>(Array.isArray(h)&&h.push(jsx(q.span,{style:{display:"block",height:0,width:0}},`span-${m}-newline`)),h)},m);case "span":return jsx(Oe,{children:c,characterVariants:t,onCharacterAnimationComplete:e,dadElement:h=>Array.isArray(h)?createElement(n,{...p,key:`${s}-${m}`,children:h}):h},m);default:return jsx(Oe,{children:c,characterVariants:t,onCharacterAnimationComplete:e,dadElement:(h,y)=>createElement(n,{...p,key:`${s}-${m}`,variants:y||u?void 0:i},h)},m)}};o[s]=a;}}catch{}}),o}function Kt(t){let{delay:e=10,characterVariants:r={hidden:{opacity:0},visible:{opacity:1,transition:{opacity:{duration:0}}}},onCharacterAnimationComplete:o}=t,i=useMemo(()=>({hidden:{},visible:{opacity:1,transition:{staggerChildren:e/1e3}}}),[e]),s=useMemo(()=>r,[e]),n=useMemo(()=>ai({characterVariants:s,onCharacterAnimationComplete:o,delay:e}),[e,s,o]);return {sentenceVariants:i,components:n}}function Na(t){let{delay:e=10,children:r,motionProps:o={},components:i,...s}=t,{characterVariants:n,onCharacterAnimationComplete:a,...l}=o,{sentenceVariants:c,components:m}=Kt({delay:e,characterVariants:n,onCharacterAnimationComplete:a});return jsx(q.span,{variants:c,initial:"hidden",animate:"visible",...l,children:jsx(jc,{...s,components:{...m,...i},children:r})},`typewriter-internal-${r}`)}async function Ua(t){let{delay:e=10,children:r,motionProps:o={},components:i,...s}=t,{characterVariants:n,onCharacterAnimationComplete:a,...l}=o,{sentenceVariants:c,components:m}=Kt({delay:e,characterVariants:n,onCharacterAnimationComplete:a}),u=await MarkdownAsync({...s,components:{...m,...i},children:r});return jsx(q.span,{variants:c,initial:"hidden",animate:"visible",...l,children:u},`typewriter-internal-${r}`)}function Ga(t){let{delay:e=10,children:r,motionProps:o={},components:i,...s}=t,{characterVariants:n,onCharacterAnimationComplete:a,...l}=o,{sentenceVariants:c,components:m}=Kt({delay:e,characterVariants:n,onCharacterAnimationComplete:a});return jsx(q.span,{variants:c,initial:"hidden",animate:"visible",...l,children:jsx(MarkdownHooks,{...s,components:{...m,...i},children:r})},`typewriter-internal-${r}`)}export{Na as MarkdownTypewriter,Ua as MarkdownTypewriterAsync,Ga as MarkdownTypewriterHooks};
|