react-pro-messenger 1.1.2 → 1.1.3

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/index.umd.js CHANGED
@@ -16,6 +16,6 @@ Check the top-level render call using <`+R+">.")}return C}}function ra(d,C){{if(
16
16
  ${h}px !important;
17
17
  top: ${c}px !important;
18
18
  }
19
- `),()=>{document.head.removeChild(m)}},[t]),p.exports.jsx(da,{isPresent:t,childRef:s,sizeRef:i,children:an.cloneElement(e,{ref:s})})}const pa=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a})=>{const l=cn(ma),c=x.useId(),u=x.useCallback(h=>{l.set(h,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),f=x.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:h=>(l.set(h,!1),()=>l.delete(h))}),i?[Math.random(),u]:[n,u]);return x.useMemo(()=>{l.forEach((h,m)=>l.set(m,!1))},[n]),an.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=p.exports.jsx(ha,{isPresent:n,anchorX:a,children:e})),p.exports.jsx(Ft.Provider,{value:f,children:e})};function ma(){return new Map}function zr(e=!0){const t=x.useContext(Ft);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=x.useId();x.useEffect(()=>{if(e)return s(i)},[e]);const o=x.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const Bt=e=>e.key||"";function Yr(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const fn=typeof window<"u",Kr=fn?x.useLayoutEffect:x.useEffect,Hr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=zr(o),u=x.useMemo(()=>Yr(e),[e]),f=o&&!l?[]:u.map(Bt),h=x.useRef(!0),m=x.useRef(u),y=cn(()=>new Map),[v,S]=x.useState(u),[b,P]=x.useState(u);Kr(()=>{h.current=!1,m.current=u;for(let g=0;g<b.length;g++){const O=Bt(b[g]);f.includes(O)?y.delete(O):y.get(O)!==!0&&y.set(O,!1)}},[b,f.length,f.join("-")]);const j=[];if(u!==v){let g=[...u];for(let O=0;O<b.length;O++){const Y=b[O],k=Bt(Y);f.includes(k)||(g.splice(O,0,Y),j.push(Y))}return i==="wait"&&j.length&&(g=j),P(Yr(g)),S(u),null}process.env.NODE_ENV!=="production"&&i==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:D}=x.useContext(ln);return p.exports.jsx(p.exports.Fragment,{children:b.map(g=>{const O=Bt(g),Y=o&&!l?!1:u===b||f.includes(O),k=()=>{if(y.has(O))y.set(O,!0);else return;let ee=!0;y.forEach(M=>{M||(ee=!1)}),ee&&(D==null||D(),P(m.current),o&&(c==null||c()),r&&r())};return p.exports.jsx(pa,{isPresent:Y,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:Y?void 0:k,anchorX:a,children:g},O)})})},je=e=>e;let et=je,Fe=je;process.env.NODE_ENV!=="production"&&(et=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Fe=(e,t)=>{if(!e)throw new Error(t)});function dn(e){let t;return()=>(t===void 0&&(t=e()),t)}const tt=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},De=e=>e*1e3,_e=e=>e/1e3,qr={skipAnimations:!1,useManualTiming:!1},$t=["read","resolveKeyframes","update","preRender","render","postRender"],Be={value:null,addProjectionMetrics:null};function ga(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(f){o.has(f)&&(u.schedule(f),e()),l++,f(a)}const u={schedule:(f,h=!1,m=!1)=>{const v=m&&s?n:r;return h&&o.add(f),v.has(f)||v.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(a=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),t&&Be.value&&Be.value.frameloop[t].push(l),l=0,n.clear(),s=!1,i&&(i=!1,u.process(f))}};return u}const ya=40;function Gr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=$t.reduce((b,P)=>(b[P]=ga(i,t?P:void 0),b),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:f,postRender:h}=o,m=()=>{const b=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,ya),1),s.timestamp=b,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},y=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:$t.reduce((b,P)=>{const j=o[P];return b[P]=(D,g=!1,O=!1)=>(n||y(),j.schedule(D,g,O)),b},{}),cancel:b=>{for(let P=0;P<$t.length;P++)o[$t[P]].cancel(b)},state:s,steps:o}}const{schedule:se,cancel:$e,state:we,steps:hn}=Gr(typeof requestAnimationFrame<"u"?requestAnimationFrame:je,!0),Xr=x.createContext({strict:!1}),Zr={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"]},nt={};for(const e in Zr)nt[e]={isEnabled:t=>Zr[e].some(n=>!!t[n])};function va(e){for(const t in e)nt[t]={...nt[t],...e[t]}}const xa=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 Ut(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||xa.has(e)}let Jr=e=>!Ut(e);function ba(e){e&&(Jr=t=>t.startsWith("on")?!Ut(t):e(t))}try{ba(require("@emotion/is-prop-valid").default)}catch{}function wa(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Jr(s)||n===!0&&Ut(s)||!t&&!Ut(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Qr=new Set;function Wt(e,t,n){e||Qr.has(t)||(console.warn(t),n&&console.warn(n),Qr.add(t))}function Ta(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Wt(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const zt=x.createContext({});function Yt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function vt(e){return typeof e=="string"||Array.isArray(e)}const pn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mn=["initial",...pn];function Kt(e){return Yt(e.animate)||mn.some(t=>vt(e[t]))}function es(e){return Boolean(Kt(e)||e.variants)}function Sa(e,t){if(Kt(e)){const{initial:n,animate:r}=e;return{initial:n===!1||vt(n)?n:void 0,animate:vt(r)?r:void 0}}return e.inherit!==!1?t:{}}function Ca(e){const{initial:t,animate:n}=Sa(e,x.useContext(zt));return x.useMemo(()=>({initial:t,animate:n}),[ts(t),ts(n)])}function ts(e){return Array.isArray(e)?e.join(" "):e}const Pa=Symbol.for("motionComponentSymbol");function rt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ea(e,t,n){return x.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):rt(n)&&(n.current=r))},[t])}const gn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ns="data-"+gn("framerAppearId"),{schedule:yn,cancel:Ud}=Gr(queueMicrotask,!1),rs=x.createContext({});function ja(e,t,n,r,s){var i,o;const{visualElement:a}=x.useContext(zt),l=x.useContext(Xr),c=x.useContext(Ft),u=x.useContext(un).reducedMotion,f=x.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,m=x.useContext(rs);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Aa(f.current,n,s,m);const y=x.useRef(!1);x.useInsertionEffect(()=>{h&&y.current&&h.update(n,c)});const v=n[ns],S=x.useRef(Boolean(v)&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,v))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,v)));return Kr(()=>{h&&(y.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),yn.render(h.render),S.current&&h.animationState&&h.animationState.animateChanges())}),x.useEffect(()=>{h&&(!S.current&&h.animationState&&h.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,v)}),S.current=!1))}),h}function Aa(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ss(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||a&&rt(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function ss(e){if(e)return e.options.allowProjection!==!1?e.projection:ss(e.parent)}function Ma({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&va(e);function a(c,u){let f;const h={...x.useContext(un),...c,layoutId:Ra(c)},{isStatic:m}=h,y=Ca(c),v=r(c,m);if(!m&&fn){Va(h,e);const S=Da(h);f=S.MeasureLayout,y.visualElement=ja(s,v,h,t,S.ProjectionNode)}return p.exports.jsxs(zt.Provider,{value:y,children:[f&&y.visualElement?p.exports.jsx(f,{visualElement:y.visualElement,...h}):null,n(s,c,Ea(v,y.visualElement,u),v,m,y.visualElement)]})}a.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const l=x.forwardRef(a);return l[Pa]=s,l}function Ra({layoutId:e}){const t=x.useContext(ln).id;return t&&e!==void 0?t+"-"+e:e}function Va(e,t){const n=x.useContext(Xr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?et(!1,r):Fe(!1,r)}}function Da(e){const{drag:t,layout:n}=nt;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const is=e=>t=>typeof t=="string"&&t.startsWith(e),vn=is("--"),Oa=is("var(--"),xn=e=>Oa(e)?La.test(e.split("/*")[0].trim()):!1,La=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,xt={};function ka(e){for(const t in e)xt[t]=e[t],vn(t)&&(xt[t].isCSSVariable=!0)}const st=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],He=new Set(st);function os(e,{layout:t,layoutId:n}){return He.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!xt[e]||e==="opacity")}const Se=e=>Boolean(e&&e.getVelocity),as=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ie=(e,t,n)=>n>t?t:n<e?e:n,it={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},bt={...it,transform:e=>Ie(0,1,e)},Ht={...it,default:1},wt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ue=wt("deg"),Oe=wt("%"),_=wt("px"),_a=wt("vh"),Ia=wt("vw"),ls={...Oe,parse:e=>Oe.parse(e)/100,transform:e=>Oe.transform(e*100)},Na={borderWidth:_,borderTopWidth:_,borderRightWidth:_,borderBottomWidth:_,borderLeftWidth:_,borderRadius:_,radius:_,borderTopLeftRadius:_,borderTopRightRadius:_,borderBottomRightRadius:_,borderBottomLeftRadius:_,width:_,maxWidth:_,height:_,maxHeight:_,top:_,right:_,bottom:_,left:_,padding:_,paddingTop:_,paddingRight:_,paddingBottom:_,paddingLeft:_,margin:_,marginTop:_,marginRight:_,marginBottom:_,marginLeft:_,backgroundPositionX:_,backgroundPositionY:_},Fa={rotate:Ue,rotateX:Ue,rotateY:Ue,rotateZ:Ue,scale:Ht,scaleX:Ht,scaleY:Ht,scaleZ:Ht,skew:Ue,skewX:Ue,skewY:Ue,distance:_,translateX:_,translateY:_,translateZ:_,x:_,y:_,z:_,perspective:_,transformPerspective:_,opacity:bt,originX:ls,originY:ls,originZ:_},cs={...it,transform:Math.round},bn={...Na,...Fa,zIndex:cs,size:_,fillOpacity:bt,strokeOpacity:bt,numOctaves:cs},Ba={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$a=st.length;function Ua(e,t,n){let r="",s=!0;for(let i=0;i<$a;i++){const o=st[i],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=as(a,bn[o]);if(!l){s=!1;const u=Ba[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function wn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(He.has(l)){o=!0;continue}else if(vn(l)){s[l]=c;continue}else{const u=as(c,bn[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=Ua(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const Tn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function us(e,t,n){for(const r in t)!Se(t[r])&&!os(r,n)&&(e[r]=t[r])}function Wa({transformTemplate:e},t){return x.useMemo(()=>{const n=Tn();return wn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function za(e,t){const n=e.style||{},r={};return us(r,n,e),Object.assign(r,Wa(e,t)),r}function Ya(e,t){const n={},r=za(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Ka=["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 Sn(e){return typeof e!="string"||e.includes("-")?!1:!!(Ka.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ha={offset:"stroke-dashoffset",array:"stroke-dasharray"},qa={offset:"strokeDashoffset",array:"strokeDasharray"};function Ga(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Ha:qa;e[i.offset]=_.transform(-r);const o=_.transform(t),a=_.transform(n);e[i.array]=`${o} ${a}`}function fs(e,t,n){return typeof e=="string"?e:_.transform(t+n*e)}function Xa(e,t,n){const r=fs(t,e.x,e.width),s=fs(n,e.y,e.height);return`${r} ${s}`}function Cn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,f){if(wn(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:y}=e;h.transform&&(y&&(m.transform=h.transform),delete h.transform),y&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=Xa(y,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ga(h,o,a,l,!1)}const ds=()=>({...Tn(),attrs:{}}),Pn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Za(e,t,n,r){const s=x.useMemo(()=>{const i=ds();return Cn(i,t,Pn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};us(i,e.style,e),s.style={...i,...s.style}}return s}function Ja(e=!1){return(n,r,s,{latestValues:i},o)=>{const l=(Sn(n)?Za:Ya)(r,i,o,n),c=wa(r,typeof n=="string",e),u=n!==x.Fragment?{...c,...l,ref:s}:{},{children:f}=r,h=x.useMemo(()=>Se(f)?f.get():f,[f]);return x.createElement(n,{...u,children:h})}}function hs(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function En(e,t,n,r){if(typeof t=="function"){const[s,i]=hs(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=hs(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const jn=e=>Array.isArray(e),Qa=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),el=e=>jn(e)?e[e.length-1]||0:e;function qt(e){const t=Se(e)?e.get():e;return Qa(t)?t.toValue():t}function tl({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:nl(r,s,i,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const ps=e=>(t,n)=>{const r=x.useContext(zt),s=x.useContext(Ft),i=()=>tl(e,t,r,s);return n?i():cn(i)};function nl(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=qt(i[h]);let{initial:o,animate:a}=e;const l=Kt(e),c=es(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?a:o;if(f&&typeof f!="boolean"&&!Yt(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const y=En(e,h[m]);if(y){const{transitionEnd:v,transition:S,...b}=y;for(const P in b){let j=b[P];if(Array.isArray(j)){const D=u?j.length-1:0;j=j[D]}j!==null&&(s[P]=j)}for(const P in v)s[P]=v[P]}}}return s}function An(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(Se(s[o])||t.style&&Se(t.style[o])||os(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}const rl={useVisualState:ps({scrapeMotionValuesFromProps:An,createRenderState:Tn})};function ms(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function gs(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const ys=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 vs(e,t,n,r){gs(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(ys.has(s)?s:gn(s),t.attrs[s])}function xs(e,t,n){const r=An(e,t,n);for(const s in e)if(Se(e[s])||Se(t[s])){const i=st.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const bs=["x","y","width","height","cx","cy","r"],sl={useVisualState:ps({scrapeMotionValuesFromProps:xs,createRenderState:ds,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const a in s)if(He.has(a)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let a=0;a<bs.length;a++){const l=bs[a];e[l]!==t[l]&&(o=!0)}o&&se.read(()=>{ms(n,r),se.render(()=>{Cn(r,s,Pn(n.tagName),e.transformTemplate),vs(n,r)})})}})};function il(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...Sn(r)?sl:rl,preloadedFeatures:e,useRender:Ja(s),createVisualElement:t,Component:r};return Ma(o)}}function Tt(e,t,n){const r=e.getProps();return En(r,t,n!==void 0?n:r.custom,e)}const ol=dn(()=>window.ScrollTimeline!==void 0);class al{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>{if(ol()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ll extends al{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Mn(e,t){return e?e[t]||e.default||e:void 0}const Rn=2e4;function ws(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Rn;)t+=n,r=e.next(t);return t>=Rn?1/0:t}function Vn(e){return typeof e=="function"}function Ts(e,t){e.timeline=t,e.onfinish=null}const Dn=e=>Array.isArray(e)&&typeof e[0]=="number",cl={linearEasing:void 0};function ul(e,t){const n=dn(e);return()=>{var r;return(r=cl[t])!==null&&r!==void 0?r:n()}}const Gt=ul(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ss=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(tt(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function Cs(e){return Boolean(typeof e=="function"&&Gt()||!e||typeof e=="string"&&(e in On||Gt())||Dn(e)||Array.isArray(e)&&e.every(Cs))}const St=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,On={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:St([0,.65,.55,1]),circOut:St([.55,0,1,.45]),backIn:St([.31,.01,.66,-.59]),backOut:St([.33,1.53,.69,.99])};function Ps(e,t){if(e)return typeof e=="function"&&Gt()?Ss(e,t):Dn(e)?St(e):Array.isArray(e)?e.map(n=>Ps(n,t)||On.easeOut):On[e]}const Ve={x:!1,y:!1};function Es(){return Ve.x||Ve.y}function fl(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;t&&(s=t.current);const i=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function js(e,t){const n=fl(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function As(e){return!(e.pointerType==="touch"||Es())}function dl(e,t,n={}){const[r,s,i]=js(e,n),o=a=>{if(!As(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=f=>{As(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,s)};return r.forEach(a=>{a.addEventListener("pointerenter",o,s)}),i}function Xt(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const Ms=(e,t)=>t?e===t?!0:Ms(e,t.parentElement):!1,Ln=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,hl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pl(e){return hl.has(e.tagName)||e.tabIndex!==-1}const Ct=new WeakSet;function Rs(e){return t=>{t.key==="Enter"&&e(t)}}function kn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ml=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Rs(()=>{if(Ct.has(n))return;kn(n,"down");const s=Rs(()=>{kn(n,"up")}),i=()=>kn(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Vs(e){return Ln(e)&&!Es()}function gl(e,t,n={}){const[r,s,i]=js(e,n),o=a=>{const l=a.currentTarget;if(!l||!Vs(a)||Ct.has(l))return;Ct.add(l),Xt(a,"set");const c=t(l,a),u=(m,y)=>{l.removeEventListener("pointerup",f),l.removeEventListener("pointercancel",h),Xt(m,"release"),!(!Vs(m)||!Ct.has(l))&&(Ct.delete(l),typeof c=="function"&&c(m,{success:y}))},f=m=>{(m.isTrusted?yl(m,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(m,!1):u(m,!(l instanceof Element)||Ms(l,m.target))},h=m=>{u(m,!1)};l.addEventListener("pointerup",f,s),l.addEventListener("pointercancel",h,s),l.addEventListener("lostpointercapture",h,s)};return r.forEach(a=>{a=n.useGlobalTarget?window:a;let l=!1;a instanceof HTMLElement&&(l=!0,!pl(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",o,s),l&&a.addEventListener("focus",c=>ml(c,s),s)}),i}function yl(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function vl(e){return e==="x"||e==="y"?Ve[e]?null:(Ve[e]=!0,()=>{Ve[e]=!1}):Ve.x||Ve.y?null:(Ve.x=Ve.y=!0,()=>{Ve.x=Ve.y=!1})}const Ds=new Set(["width","height","top","left","right","bottom",...st]);let Zt;function xl(){Zt=void 0}const Le={now:()=>(Zt===void 0&&Le.set(we.isProcessing||qr.useManualTiming?we.timestamp:performance.now()),Zt),set:e=>{Zt=e,queueMicrotask(xl)}};function _n(e,t){e.indexOf(t)===-1&&e.push(t)}function In(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Nn{constructor(){this.subscriptions=[]}add(t){return _n(this.subscriptions,t),()=>In(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Os(e,t){return t?e*(1e3/t):0}const Ls=30,bl=e=>!isNaN(parseFloat(e));class wl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Le.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Le.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=bl(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Wt(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Nn);const r=this.events[t].add(n);return t==="change"?()=>{r(),se.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Le.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Ls)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ls);return Os(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pt(e,t){return new wl(e,t)}function Tl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pt(n))}function Sl(e,t){const n=Tt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=el(i[o]);Tl(e,o,a)}}function Cl(e){return Boolean(Se(e)&&e.add)}function Fn(e,t){const n=e.getValue("willChange");if(Cl(n))return n.add(t)}function ks(e){return e.props[ns]}const Pl={current:!1},_s=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,El=1e-7,jl=12;function Al(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=_s(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>El&&++a<jl);return o}function Et(e,t,n,r){if(e===t&&n===r)return je;const s=i=>Al(i,0,1,e,n);return i=>i===0||i===1?i:_s(s(i),t,r)}const Is=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ns=e=>t=>1-e(1-t),Fs=Et(.33,1.53,.69,.99),Bn=Ns(Fs),Bs=Is(Bn),$s=e=>(e*=2)<1?.5*Bn(e):.5*(2-Math.pow(2,-10*(e-1))),$n=e=>1-Math.sin(Math.acos(e)),Us=Ns($n),Ws=Is($n),zs=e=>/^0[^.\s]+$/u.test(e);function Ml(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||zs(e):!0}const jt=e=>Math.round(e*1e5)/1e5,Un=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Rl(e){return e==null}const Vl=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wn=(e,t)=>n=>Boolean(typeof n=="string"&&Vl.test(n)&&n.startsWith(e)||t&&!Rl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ys=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Un);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Dl=e=>Ie(0,255,e),zn={...it,transform:e=>Math.round(Dl(e))},qe={test:Wn("rgb","red"),parse:Ys("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+zn.transform(e)+", "+zn.transform(t)+", "+zn.transform(n)+", "+jt(bt.transform(r))+")"};function Ol(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Yn={test:Wn("#"),parse:Ol,transform:qe.transform},ot={test:Wn("hsl","hue"),parse:Ys("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Oe.transform(jt(t))+", "+Oe.transform(jt(n))+", "+jt(bt.transform(r))+")"},Ce={test:e=>qe.test(e)||Yn.test(e)||ot.test(e),parse:e=>qe.test(e)?qe.parse(e):ot.test(e)?ot.parse(e):Yn.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?qe.transform(e):ot.transform(e)},Ll=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kl(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Un))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Ll))===null||n===void 0?void 0:n.length)||0)>0}const Ks="number",Hs="color",_l="var",Il="var(",qs="${}",Nl=/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 At(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(Nl,l=>(Ce.test(l)?(r.color.push(i),s.push(Hs),n.push(Ce.parse(l))):l.startsWith(Il)?(r.var.push(i),s.push(_l),n.push(l)):(r.number.push(i),s.push(Ks),n.push(parseFloat(l))),++i,qs)).split(qs);return{values:n,split:a,indexes:r,types:s}}function Gs(e){return At(e).values}function Xs(e){const{split:t,types:n}=At(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const a=n[o];a===Ks?i+=jt(s[o]):a===Hs?i+=Ce.transform(s[o]):i+=s[o]}return i}}const Fl=e=>typeof e=="number"?0:e;function Bl(e){const t=Gs(e);return Xs(e)(t.map(Fl))}const We={test:kl,parse:Gs,createTransformer:Xs,getAnimatableNone:Bl},$l=new Set(["brightness","contrast","saturate","opacity"]);function Ul(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Un)||[];if(!r)return e;const s=n.replace(r,"");let i=$l.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Wl=/\b([a-z-]*)\(.*?\)/gu,Kn={...We,getAnimatableNone:e=>{const t=e.match(Wl);return t?t.map(Ul).join(" "):e}},zl={...bn,color:Ce,backgroundColor:Ce,outlineColor:Ce,fill:Ce,stroke:Ce,borderColor:Ce,borderTopColor:Ce,borderRightColor:Ce,borderBottomColor:Ce,borderLeftColor:Ce,filter:Kn,WebkitFilter:Kn},Hn=e=>zl[e];function Zs(e,t){let n=Hn(e);return n!==Kn&&(n=We),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Yl=new Set(["auto","none","0"]);function Kl(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Yl.has(i)&&At(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=Zs(n,s)}const Js=e=>e===it||e===_,Qs=(e,t)=>parseFloat(e.split(", ")[t]),ei=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Qs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Qs(i[1],e):0}},Hl=new Set(["x","y","z"]),ql=st.filter(e=>!Hl.has(e));function Gl(e){const t=[];return ql.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const at={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:ei(4,13),y:ei(5,14)};at.translateX=at.x,at.translateY=at.y;const Ge=new Set;let qn=!1,Gn=!1;function ti(){if(Gn){const e=Array.from(Ge).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Gl(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Gn=!1,qn=!1,Ge.forEach(e=>e.complete()),Ge.clear()}function ni(){Ge.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Gn=!0)})}function Xl(){ni(),ti()}class Xn{constructor(t,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ge.add(this),qn||(qn=!0,se.read(ni),se.resolveKeyframes(ti))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const o=s==null?void 0:s.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),s&&o===void 0&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ge.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ge.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ri=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Zl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jl(e){const t=Zl.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Ql=4;function si(e,t,n=1){Fe(n<=Ql,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=Jl(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return ri(o)?parseFloat(o):o}return xn(s)?si(s,t,n+1):s}const ii=e=>t=>t.test(e),oi=[it,_,Oe,Ue,Ia,_a,{test:e=>e==="auto",parse:e=>e}],ai=e=>oi.find(ii(e));class li extends Xn{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),xn(c))){const u=si(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Ds.has(r)||t.length!==2)return;const[s,i]=t,o=ai(s),a=ai(i);if(o!==a)if(Js(o)&&Js(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)Ml(t[s])&&r.push(s);r.length&&Kl(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=at[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=at[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const ci=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(We.test(e)||e==="0")&&!e.startsWith("url("));function ec(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function tc(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=ci(s,t),a=ci(i,t);return et(o===a,`You are trying to animate ${t} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:ec(e)||(n==="spring"||Vn(n))&&r}const nc=e=>e!==null;function Jt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(nc),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const rc=40;class ui{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Le.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>rc?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Xl(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Le.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!tc(t,r,s,i))if(o)this.options.duration=0;else{l&&l(Jt(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Mt={layout:0,mainThread:0,waapi:0},oe=(e,t,n)=>e+(t-e)*n;function Zn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function sc({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Zn(l,a,e+1/3),i=Zn(l,a,e),o=Zn(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Qt(e,t){return n=>n>0?t:e}const Jn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},ic=[Yn,qe,ot],oc=e=>ic.find(t=>t.test(e));function fi(e){const t=oc(e);if(et(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===ot&&(n=sc(n)),n}const di=(e,t)=>{const n=fi(e),r=fi(t);if(!n||!r)return Qt(e,t);const s={...n};return i=>(s.red=Jn(n.red,r.red,i),s.green=Jn(n.green,r.green,i),s.blue=Jn(n.blue,r.blue,i),s.alpha=oe(n.alpha,r.alpha,i),qe.transform(s))},ac=(e,t)=>n=>t(e(n)),Rt=(...e)=>e.reduce(ac),Qn=new Set(["none","hidden"]);function lc(e,t){return Qn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function cc(e,t){return n=>oe(e,t,n)}function er(e){return typeof e=="number"?cc:typeof e=="string"?xn(e)?Qt:Ce.test(e)?di:dc:Array.isArray(e)?hi:typeof e=="object"?Ce.test(e)?di:uc:Qt}function hi(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>er(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function uc(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=er(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function fc(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],a=e.indexes[o][s[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[i]=l,s[o]++}return r}const dc=(e,t)=>{const n=We.createTransformer(t),r=At(e),s=At(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Qn.has(e)&&!s.values.length||Qn.has(t)&&!r.values.length?lc(e,t):Rt(hi(fc(r,s),s.values),n):(et(!0,`Complex values '${e}' and '${t}' 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.`),Qt(e,t))};function pi(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?oe(e,t,n):er(e)(e,t)}const hc=5;function mi(e,t,n){const r=Math.max(t-hc,0);return Os(n-e(r),t-r)}const ae={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},tr=.001;function pc({duration:e=ae.duration,bounce:t=ae.bounce,velocity:n=ae.velocity,mass:r=ae.mass}){let s,i;et(e<=De(ae.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Ie(ae.minDamping,ae.maxDamping,o),e=Ie(ae.minDuration,ae.maxDuration,_e(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,m=nr(c,o),y=Math.exp(-f);return tr-h/m*y},i=c=>{const f=c*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-f),v=nr(Math.pow(c,2),o);return(-s(c)+tr>0?-1:1)*((h-m)*y)/v}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-tr+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=gc(s,i,a);if(e=De(e),isNaN(l))return{stiffness:ae.stiffness,damping:ae.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const mc=12;function gc(e,t,n){let r=n;for(let s=1;s<mc;s++)r=r-e(r)/t(r);return r}function nr(e,t){return e*Math.sqrt(1-t*t)}const yc=["duration","bounce"],vc=["stiffness","damping","mass"];function gi(e,t){return t.some(n=>e[n]!==void 0)}function xc(e){let t={velocity:ae.velocity,stiffness:ae.stiffness,damping:ae.damping,mass:ae.mass,isResolvedFromDuration:!1,...e};if(!gi(e,vc)&&gi(e,yc))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ie(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ae.mass,stiffness:s,damping:i}}else{const n=pc(e);t={...t,...n,mass:ae.mass},t.isResolvedFromDuration=!0}return t}function yi(e=ae.visualDuration,t=ae.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:m}=xc({...n,velocity:-_e(n.velocity||0)}),y=h||0,v=c/(2*Math.sqrt(l*u)),S=o-i,b=_e(Math.sqrt(l/u)),P=Math.abs(S)<5;r||(r=P?ae.restSpeed.granular:ae.restSpeed.default),s||(s=P?ae.restDelta.granular:ae.restDelta.default);let j;if(v<1){const g=nr(b,v);j=O=>{const Y=Math.exp(-v*b*O);return o-Y*((y+v*b*S)/g*Math.sin(g*O)+S*Math.cos(g*O))}}else if(v===1)j=g=>o-Math.exp(-b*g)*(S+(y+b*S)*g);else{const g=b*Math.sqrt(v*v-1);j=O=>{const Y=Math.exp(-v*b*O),k=Math.min(g*O,300);return o-Y*((y+v*b*S)*Math.sinh(k)+g*S*Math.cosh(k))/g}}const D={calculatedDuration:m&&f||null,next:g=>{const O=j(g);if(m)a.done=g>=f;else{let Y=0;v<1&&(Y=g===0?De(y):mi(j,g,O));const k=Math.abs(Y)<=r,ee=Math.abs(o-O)<=s;a.done=k&&ee}return a.value=a.done?o:O,a},toString:()=>{const g=Math.min(ws(D),Rn),O=Ss(Y=>D.next(g*Y).value,g,30);return g+"ms "+O}};return D}function vi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},m=k=>a!==void 0&&k<a||l!==void 0&&k>l,y=k=>a===void 0?l:l===void 0||Math.abs(a-k)<Math.abs(l-k)?a:l;let v=n*t;const S=f+v,b=o===void 0?S:o(S);b!==S&&(v=b-f);const P=k=>-v*Math.exp(-k/r),j=k=>b+P(k),D=k=>{const ee=P(k),M=j(k);h.done=Math.abs(ee)<=c,h.value=h.done?b:M};let g,O;const Y=k=>{m(h.value)&&(g=k,O=yi({keyframes:[h.value,y(h.value)],velocity:mi(j,k,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return Y(0),{calculatedDuration:null,next:k=>{let ee=!1;return!O&&g===void 0&&(ee=!0,D(k),Y(k)),g!==void 0&&k>=g?O.next(k-g):(!ee&&D(k),h)}}}const bc=Et(.42,0,1,1),wc=Et(0,0,.58,1),xi=Et(.42,0,.58,1),Tc=e=>Array.isArray(e)&&typeof e[0]!="number",bi={linear:je,easeIn:bc,easeInOut:xi,easeOut:wc,circIn:$n,circInOut:Ws,circOut:Us,backIn:Bn,backInOut:Bs,backOut:Fs,anticipate:$s},wi=e=>{if(Dn(e)){Fe(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return Et(t,n,r,s)}else if(typeof e=="string")return Fe(bi[e]!==void 0,`Invalid easing type '${e}'`),bi[e];return e};function Sc(e,t,n){const r=[],s=n||pi,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||je:t;a=Rt(l,a)}r.push(a)}return r}function Cc(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Fe(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Sc(t,r,s),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=tt(e[f],e[f+1],u);return a[f](h)};return n?u=>c(Ie(e[0],e[i-1],u)):c}function Pc(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=tt(0,t,r);e.push(oe(n,1,s))}}function Ec(e){const t=[0];return Pc(t,e.length-1),t}function jc(e,t){return e.map(n=>n*t)}function Ac(e,t){return e.map(()=>t||xi).splice(0,e.length-1)}function Vt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Tc(r)?r.map(wi):wi(r),i={done:!1,value:t[0]},o=jc(n&&n.length===t.length?n:Ec(t),e),a=Cc(o,t,{ease:Array.isArray(s)?s:Ac(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const Mc=e=>{const t=({timestamp:n})=>e(n);return{start:()=>se.update(t,!0),stop:()=>$e(t),now:()=>we.isProcessing?we.timestamp:Le.now()}},Rc={decay:vi,inertia:vi,tween:Vt,keyframes:Vt,spring:yi},Vc=e=>e/100;class rr extends ui{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||Xn,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(i,a,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,a=Vn(n)?n:Rc[n]||Vt;let l,c;process.env.NODE_ENV!=="production"&&a!==Vt&&Fe(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a!==Vt&&typeof t[0]!="number"&&(l=Rt(Vc,pi(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});i==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ws(u));const{calculatedDuration:f}=u,h=f+s,m=h*(r+1)-s;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;Mt.mainThread++,this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:k}=this.options;return{done:!0,value:k[k.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:m,repeatType:y,repeatDelay:v,onUpdate:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-h*(this.speed>=0?1:-1),P=this.speed>=0?b<0:b>u;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let j=this.currentTime,D=i;if(m){const k=Math.min(this.currentTime,u)/f;let ee=Math.floor(k),M=k%1;!M&&k>=1&&(M=1),M===1&&ee--,ee=Math.min(ee,m+1),Boolean(ee%2)&&(y==="reverse"?(M=1-M,v&&(M-=v/f)):y==="mirror"&&(D=o)),j=Ie(0,1,M)*f}const g=P?{done:!1,value:l[0]}:D.next(j);a&&(g.value=a(g.value));let{done:O}=g;!P&&c!==null&&(O=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const Y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return Y&&s!==void 0&&(g.value=Jt(l,this.options,s)),S&&S(g.value),Y&&this.finish(),g}get duration(){const{resolved:t}=this;return t?_e(t.calculatedDuration):0}get time(){return _e(this.currentTime)}set time(t){t=De(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=_e(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Mc,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel(),Mt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Dc=new Set(["opacity","clipPath","filter","transform"]);function Oc(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Ps(a,s);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Lc=dn(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),en=10,kc=2e4;function _c(e){return Vn(e.type)||e.type==="spring"||!Cs(e.ease)}function Ic(e,t){const n=new rr({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&i<kc;)r=n.sample(i),s.push(r.value),i+=en;return{times:void 0,keyframes:s,duration:i-en,ease:"linear"}}const Ti={anticipate:$s,backInOut:Bs,circInOut:Ws};function Nc(e){return e in Ti}class Si extends ui{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new li(i,(o,a)=>this.onKeyframesResolved(o,a),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof i=="string"&&Gt()&&Nc(i)&&(i=Ti[i]),_c(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:y,...v}=this.options,S=Ic(t,v);t=S.keyframes,t.length===1&&(t[1]=t[0]),r=S.duration,s=S.times,i=S.ease,o="keyframes"}const u=Oc(a.owner.current,l,t,{...this.options,duration:r,times:s,ease:i});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(Ts(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;a.set(Jt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:s,type:o,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return _e(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return _e(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=De(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return je;const{animation:r}=n;Ts(r,t)}return je}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...m}=this.options,y=new rr({...m,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),v=De(this.time);c.setWithVelocity(y.sample(v-en).value,y.sample(v).value,en)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return Lc()&&r&&Dc.has(r)&&!l&&!c&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}const Fc={type:"spring",stiffness:500,damping:25,restSpeed:10},Bc=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),$c={type:"keyframes",duration:.8},Uc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Wc=(e,{keyframes:t})=>t.length>2?$c:He.has(e)?e.startsWith("scale")?Bc(t[1]):Fc:Uc;function zc({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const sr=(e,t,n,r={},s,i)=>o=>{const a=Mn(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-De(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};zc(a)||(u={...u,...Wc(e,u)}),u.duration&&(u.duration=De(u.duration)),u.repeatDelay&&(u.repeatDelay=De(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),(Pl.current||qr.skipAnimations)&&(f=!0,u.duration=0,u.delay=0),f&&!i&&t.get()!==void 0){const h=Jt(u.keyframes,a);if(h!==void 0)return se.update(()=>{u.onUpdate(h),u.onComplete()}),new ll([])}return!i&&Si.supports(u)?new Si(u):new rr(u)};function Yc({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ci(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),m=l[f];if(m===void 0||u&&Yc(u,f))continue;const y={delay:n,...Mn(o||{},f)};let v=!1;if(window.MotionHandoffAnimation){const b=ks(e);if(b){const P=window.MotionHandoffAnimation(b,f,se);P!==null&&(y.startTime=P,v=!0)}}Fn(e,f),h.start(sr(f,h,m,e.shouldReduceMotion&&Ds.has(f)?{type:!1}:y,e,v));const S=h.animation;S&&c.push(S)}return a&&Promise.all(c).then(()=>{se.update(()=>{a&&Sl(e,a)})}),c}function ir(e,t,n={}){var r;const s=Tt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(Ci(e,s,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=i;return Kc(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function Kc(e,t,n=0,r=0,s=1,i){const o=[],a=(e.variantChildren.size-1)*r,l=s===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(Hc).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(ir(c,t,{...i,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function Hc(e,t){return e.sortNodePosition(t)}function qc(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>ir(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=ir(e,t,n);else{const s=typeof t=="function"?Tt(e,t,n.custom):t;r=Promise.all(Ci(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Pi(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Gc=mn.length;function Ei(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ei(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Gc;n++){const r=mn[n],s=e.props[r];(vt(s)||s===!1)&&(t[r]=s)}return t}const Xc=[...pn].reverse(),Zc=pn.length;function Jc(e){return t=>Promise.all(t.map(({animation:n,options:r})=>qc(e,n,r)))}function Qc(e){let t=Jc(e),n=ji(),r=!0;const s=l=>(c,u)=>{var f;const h=Tt(e,u,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:y,...v}=h;c={...c,...v,...y}}return c};function i(l){t=l(e)}function o(l){const{props:c}=e,u=Ei(e.parent)||{},f=[],h=new Set;let m={},y=1/0;for(let S=0;S<Zc;S++){const b=Xc[S],P=n[b],j=c[b]!==void 0?c[b]:u[b],D=vt(j),g=b===l?P.isActive:null;g===!1&&(y=S);let O=j===u[b]&&j!==c[b]&&D;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),P.protectedKeys={...m},!P.isActive&&g===null||!j&&!P.prevProp||Yt(j)||typeof j=="boolean")continue;const Y=eu(P.prevProp,j);let k=Y||b===l&&P.isActive&&!O&&D||S>y&&D,ee=!1;const M=Array.isArray(j)?j:[j];let q=M.reduce(s(b),{});g===!1&&(q={});const{prevResolvedValues:ie={}}=P,W={...ie,...q},ce=X=>{k=!0,h.has(X)&&(ee=!0,h.delete(X)),P.needsAnimating[X]=!0;const ue=e.getValue(X);ue&&(ue.liveStyle=!1)};for(const X in W){const ue=q[X],ve=ie[X];if(m.hasOwnProperty(X))continue;let w=!1;jn(ue)&&jn(ve)?w=!Pi(ue,ve):w=ue!==ve,w?ue!=null?ce(X):h.add(X):ue!==void 0&&h.has(X)?ce(X):P.protectedKeys[X]=!0}P.prevProp=j,P.prevResolvedValues=q,P.isActive&&(m={...m,...q}),r&&e.blockInitialAnimation&&(k=!1),k&&(!(O&&Y)||ee)&&f.push(...M.map(X=>({animation:X,options:{type:b}})))}if(h.size){const S={};if(typeof c.initial!="boolean"){const b=Tt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(S.transition=b.transition)}h.forEach(b=>{const P=e.getBaseTarget(b),j=e.getValue(b);j&&(j.liveStyle=!0),S[b]=P??null}),f.push({animation:S})}let v=Boolean(f.length);return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,v?t(f):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(l,c)}),n[l].isActive=c;const f=o(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=ji(),r=!0}}}function eu(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Pi(t,e):!1}function Xe(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ji(){return{animate:Xe(!0),whileInView:Xe(),whileHover:Xe(),whileTap:Xe(),whileDrag:Xe(),whileFocus:Xe(),exit:Xe()}}class ze{constructor(t){this.isMounted=!1,this.node=t}update(){}}class tu extends ze{constructor(t){super(t),t.animationState||(t.animationState=Qc(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Yt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let nu=0;class ru extends ze{constructor(){super(...arguments),this.id=nu++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const su={animation:{Feature:tu},exit:{Feature:ru}};function Dt(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ot(e){return{point:{x:e.pageX,y:e.pageY}}}const iu=e=>t=>Ln(t)&&e(t,Ot(t));function lt(e,t,n,r){return Dt(e,t,iu(n),r)}function Ai({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ou({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function au(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Mi=1e-4,lu=1-Mi,cu=1+Mi,Ri=.01,uu=0-Ri,fu=0+Ri;function Pe(e){return e.max-e.min}function du(e,t,n){return Math.abs(e-t)<=n}function Vi(e,t,n,r=.5){e.origin=r,e.originPoint=oe(t.min,t.max,e.origin),e.scale=Pe(n)/Pe(t),e.translate=oe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=lu&&e.scale<=cu||isNaN(e.scale))&&(e.scale=1),(e.translate>=uu&&e.translate<=fu||isNaN(e.translate))&&(e.translate=0)}function Lt(e,t,n,r){Vi(e.x,t.x,n.x,r?r.originX:void 0),Vi(e.y,t.y,n.y,r?r.originY:void 0)}function Di(e,t,n){e.min=n.min+t.min,e.max=e.min+Pe(t)}function hu(e,t,n){Di(e.x,t.x,n.x),Di(e.y,t.y,n.y)}function Oi(e,t,n){e.min=t.min-n.min,e.max=e.min+Pe(t)}function kt(e,t,n){Oi(e.x,t.x,n.x),Oi(e.y,t.y,n.y)}const Li=()=>({translate:0,scale:1,origin:0,originPoint:0}),ct=()=>({x:Li(),y:Li()}),ki=()=>({min:0,max:0}),fe=()=>({x:ki(),y:ki()});function Ae(e){return[e("x"),e("y")]}function or(e){return e===void 0||e===1}function ar({scale:e,scaleX:t,scaleY:n}){return!or(e)||!or(t)||!or(n)}function Ze(e){return ar(e)||_i(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function _i(e){return Ii(e.x)||Ii(e.y)}function Ii(e){return e&&e!=="0%"}function tn(e,t,n){const r=e-n,s=t*r;return n+s}function Ni(e,t,n,r,s){return s!==void 0&&(e=tn(e,s,r)),tn(e,n,r)+t}function lr(e,t=0,n=1,r,s){e.min=Ni(e.min,t,n,r,s),e.max=Ni(e.max,t,n,r,s)}function Fi(e,{x:t,y:n}){lr(e.x,t.translate,t.scale,t.originPoint),lr(e.y,n.translate,n.scale,n.originPoint)}const Bi=.999999999999,$i=1.0000000000001;function pu(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&ft(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Fi(e,o)),r&&Ze(i.latestValues)&&ft(e,i.latestValues))}t.x<$i&&t.x>Bi&&(t.x=1),t.y<$i&&t.y>Bi&&(t.y=1)}function ut(e,t){e.min=e.min+t,e.max=e.max+t}function Ui(e,t,n,r,s=.5){const i=oe(e.min,e.max,s);lr(e,t,n,i,r)}function ft(e,t){Ui(e.x,t.x,t.scaleX,t.scale,t.originX),Ui(e.y,t.y,t.scaleY,t.scale,t.originY)}function Wi(e,t){return Ai(au(e.getBoundingClientRect(),t))}function mu(e,t,n){const r=Wi(e,n),{scroll:s}=t;return s&&(ut(r.x,s.offset.x),ut(r.y,s.offset.y)),r}const zi=(e,t)=>Math.abs(e-t);function gu(e,t){const n=zi(e.x,t.x),r=zi(e.y,t.y);return Math.sqrt(n**2+r**2)}class Yi{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=ur(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=gu(u.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=u,{timestamp:y}=we;this.history.push({...m,timestamp:y});const{onStart:v,onMove:S}=this.handlers;f||(v&&v(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,u)},this.handlePointerMove=(u,f)=>{if(u.target instanceof Element&&u.target.hasPointerCapture&&u.pointerId!==void 0)try{if(!u.target.hasPointerCapture(u.pointerId))return}catch{}this.lastMoveEvent=u,this.lastMoveEventInfo=cr(f,this.transformPagePoint),se.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{Xt(u,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=ur(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:cr(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,v),m&&m(u,v)},!Ln(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=Ot(t),o=cr(i,this.transformPagePoint),{point:a}=o,{timestamp:l}=we;this.history=[{...a,timestamp:l}];const{onSessionStart:c}=n;c&&c(t,ur(o,this.history)),Xt(t,"set"),this.removeListeners=Rt(lt(t.currentTarget,"pointermove",this.handlePointerMove),lt(t.currentTarget,"pointerup",this.handlePointerUp),lt(t.currentTarget,"pointercancel",this.handlePointerUp),lt(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),$e(this.updatePoint)}}function cr(e,t){return t?{point:t(e.point)}:e}function Ki(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ur({point:e},t){return{point:e,delta:Ki(e,Hi(t)),offset:Ki(e,yu(t)),velocity:vu(t,.1)}}function yu(e){return e[0]}function Hi(e){return e[e.length-1]}function vu(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=Hi(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>De(t)));)n--;if(!r)return{x:0,y:0};const i=_e(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function xu(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?oe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?oe(n,e,r.max):Math.min(e,n)),e}function qi(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function bu(e,{top:t,left:n,bottom:r,right:s}){return{x:qi(e.x,n,s),y:qi(e.y,t,r)}}function Gi(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function wu(e,t){return{x:Gi(e.x,t.x),y:Gi(e.y,t.y)}}function Tu(e,t){let n=.5;const r=Pe(e),s=Pe(t);return s>r?n=tt(t.min,t.max-r,e.min):r>s&&(n=tt(e.min,e.max-s,t.min)),Ie(0,1,n)}function Su(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fr=.35;function Cu(e=fr){return e===!1?e=0:e===!0&&(e=fr),{x:Xi(e,"left","right"),y:Xi(e,"top","bottom")}}function Xi(e,t,n){return{min:Zi(e,t),max:Zi(e,n)}}function Zi(e,t){return typeof e=="number"?e:e[t]||0}const Pu=new WeakMap;class Eu{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ot(u).point)},i=(u,f)=>{const{drag:h,dragPropagation:m,onDragStart:y}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vl(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ae(S=>{let b=this.getAxisMotionValue(S).get()||0;if(Oe.test(b)){const{projection:P}=this.visualElement;if(P&&P.layout){const j=P.layout.layoutBox[S];j&&(b=Pe(j)*(parseFloat(b)/100))}}this.originPoint[S]=b}),y&&se.postRender(()=>y(u,f)),Fn(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:y,onDrag:v}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:S}=f;if(m&&this.currentDirection===null){this.currentDirection=ju(S),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",f.point,S),this.updateAxis("y",f.point,S),this.visualElement.render(),v&&v(u,f)},a=(u,f)=>this.stop(u,f),l=()=>Ae(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Yi(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&se.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!nn(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=xu(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&rt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=bu(s.layoutBox,n):this.constraints=!1,this.elastic=Cu(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ae(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Su(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!rt(t))return!1;const r=t.current;Fe(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=mu(r,s.root,this.visualElement.getTransformPagePoint());let o=wu(s.layout.layoutBox,i);if(n){const a=n(ou(o));this.hasMutatedConstraints=!!a,a&&(o=Ai(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Ae(u=>{if(!nn(u,n,this.currentDirection))return;let f=l&&l[u]||{};o&&(f={min:0,max:0});const h=s?200:1e6,m=s?40:1e7,y={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,y)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Fn(this.visualElement,t),r.start(sr(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ae(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ae(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ae(n=>{const{drag:r}=this.getProps();if(!nn(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(t[n]-oe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!rt(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ae(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=Tu({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ae(o=>{if(!nn(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(oe(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;Pu.set(this.visualElement,this);const t=this.visualElement.current,n=lt(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();rt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),se.read(r);const o=Dt(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Ae(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=fr,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function nn(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ju(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Au extends ze{constructor(t){super(t),this.removeGroupControls=je,this.removeListeners=je,this.controls=new Eu(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||je}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ji=e=>(t,n)=>{e&&se.postRender(()=>e(t,n))};class Mu extends ze{constructor(){super(...arguments),this.removePointerDownListener=je}onPointerDown(t){this.session=new Yi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Ji(t),onStart:Ji(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&se.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=lt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const rn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Qi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const _t={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_.test(e))e=parseFloat(e);else return e;const n=Qi(e,t.target.x),r=Qi(e,t.target.y);return`${n}% ${r}%`}},Ru={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=We.parse(e);if(s.length>5)return r;const i=We.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=oe(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}};class Vu extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;ka(Du),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),rn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||se.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),yn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function eo(e){const[t,n]=zr(),r=x.useContext(ln);return p.exports.jsx(Vu,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(rs),isPresent:t,safeToRemove:n})}const Du={borderRadius:{..._t,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_t,borderTopRightRadius:_t,borderBottomLeftRadius:_t,borderBottomRightRadius:_t,boxShadow:Ru};function Ou(e,t,n){const r=Se(e)?e:Pt(e);return r.start(sr("",r,t,n)),r.animation}function Lu(e){return e instanceof SVGElement&&e.tagName!=="svg"}const ku=(e,t)=>e.depth-t.depth;class _u{constructor(){this.children=[],this.isDirty=!1}add(t){_n(this.children,t),this.isDirty=!0}remove(t){In(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ku),this.isDirty=!1,this.children.forEach(t)}}function Iu(e,t){const n=Le.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&($e(r),e(i-t))};return se.read(r,!0),()=>$e(r)}const to=["TopLeft","TopRight","BottomLeft","BottomRight"],Nu=to.length,no=e=>typeof e=="string"?parseFloat(e):e,ro=e=>typeof e=="number"||_.test(e);function Fu(e,t,n,r,s,i){s?(e.opacity=oe(0,n.opacity!==void 0?n.opacity:1,Bu(r)),e.opacityExit=oe(t.opacity!==void 0?t.opacity:1,0,$u(r))):i&&(e.opacity=oe(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Nu;o++){const a=`border${to[o]}Radius`;let l=so(t,a),c=so(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||ro(l)===ro(c)?(e[a]=Math.max(oe(no(l),no(c),r),0),(Oe.test(c)||Oe.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=oe(t.rotate||0,n.rotate||0,r))}function so(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Bu=io(0,.5,Us),$u=io(.5,.95,je);function io(e,t,n){return r=>r<e?0:r>t?1:n(tt(e,t,r))}function oo(e,t){e.min=t.min,e.max=t.max}function Me(e,t){oo(e.x,t.x),oo(e.y,t.y)}function ao(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function lo(e,t,n,r,s){return e-=t,e=tn(e,1/n,r),s!==void 0&&(e=tn(e,1/s,r)),e}function Uu(e,t=0,n=1,r=.5,s,i=e,o=e){if(Oe.test(t)&&(t=parseFloat(t),t=oe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=oe(i.min,i.max,r);e===i&&(a-=t),e.min=lo(e.min,t,n,a,s),e.max=lo(e.max,t,n,a,s)}function co(e,t,[n,r,s],i,o){Uu(e,t[n],t[r],t[s],t.scale,i,o)}const Wu=["x","scaleX","originX"],zu=["y","scaleY","originY"];function uo(e,t,n,r){co(e.x,t,Wu,n?n.x:void 0,r?r.x:void 0),co(e.y,t,zu,n?n.y:void 0,r?r.y:void 0)}function fo(e){return e.translate===0&&e.scale===1}function ho(e){return fo(e.x)&&fo(e.y)}function po(e,t){return e.min===t.min&&e.max===t.max}function Yu(e,t){return po(e.x,t.x)&&po(e.y,t.y)}function mo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function go(e,t){return mo(e.x,t.x)&&mo(e.y,t.y)}function yo(e){return Pe(e.x)/Pe(e.y)}function vo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ku{constructor(){this.members=[]}add(t){_n(this.members,t),t.scheduleRender()}remove(t){if(In(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Hu(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:h,skewX:m,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Je={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},dr=["","X","Y","Z"],qu={visibility:"hidden"},xo=1e3;let Gu=0;function hr(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function bo(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ks(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",se,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&bo(r)}function wo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Gu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Be.value&&(Je.nodes=Je.calculatedTargetDeltas=Je.calculatedProjections=0),this.nodes.forEach(Ju),this.nodes.forEach(rf),this.nodes.forEach(sf),this.nodes.forEach(Qu),Be.addProjectionMetrics&&Be.addProjectionMetrics(Je)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,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=!0;this.root===this&&(this.nodes=new _u)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Nn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Lu(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Iu(h,250),rn.hasAnimatedSinceResize&&(rn.hasAnimatedSinceResize=!1,this.nodes.forEach(So))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||uf,{onLayoutAnimationStart:S,onLayoutAnimationComplete:b}=u.getProps(),P=!this.targetLayout||!go(this.targetLayout,y),j=!h&&m;if(this.options.layoutRoot||this.resumeFrom||j||h&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,j);const D={...Mn(v,"layout"),onPlay:S,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else h||So(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,$e(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(of),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&bo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(To);return}this.isUpdating||this.nodes.forEach(tf),this.isUpdating=!1,this.nodes.forEach(nf),this.nodes.forEach(Xu),this.nodes.forEach(Zu),this.clearAllSnapshots();const a=Le.now();we.delta=Ie(0,1e3/60,a-we.timestamp),we.timestamp=a,we.isProcessing=!0,hn.update.process(we),hn.preRender.process(we),hn.render.process(we),we.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,yn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ef),this.sharedNodes.forEach(af)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,se.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){se.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pe(this.snapshot.measuredBox.x)&&!Pe(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();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=fe(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!ho(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(a||Ze(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),ff(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return fe();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(df))){const{scroll:u}=this.root;u&&(ut(l.x,u.offset.x),ut(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=fe();if(Me(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Me(l,o),ut(l.x,f.offset.x),ut(l.y,f.offset.y))}return l}applyTransform(o,a=!1){const l=fe();Me(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ft(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ze(u.latestValues)&&ft(l,u.latestValues)}return Ze(this.latestValues)&&ft(l,this.latestValues),l}removeTransform(o){const a=fe();Me(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Ze(c.latestValues))continue;ar(c.latestValues)&&c.updateSnapshot();const u=fe(),f=c.measurePageBox();Me(u,f),uo(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Ze(this.latestValues)&&uo(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==we.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=Boolean(this.resumingFrom)||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=we.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fe(),this.relativeTargetOrigin=fe(),kt(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Me(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=fe(),this.targetWithTransforms=fe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hu(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Me(this.target,this.layout.layoutBox),Fi(this.target,this.targetDelta)):Me(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&Boolean(m.resumingFrom)===Boolean(this.resumingFrom)&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fe(),this.relativeTargetOrigin=fe(),kt(this.relativeTargetOrigin,this.target,m.target),Me(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Be.value&&Je.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ar(this.parent.latestValues)||_i(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=Boolean(this.resumingFrom)||this!==a;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===we.timestamp&&(c=!1),c)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;Me(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;pu(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=fe());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ao(this.prevProjectionDelta.x,this.projectionDelta.x),ao(this.prevProjectionDelta.y,this.projectionDelta.y)),Lt(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!vo(this.projectionDelta.x,this.prevProjectionDelta.x)||!vo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y)),Be.value&&Je.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ct(),this.projectionDelta=ct(),this.projectionDeltaWithTransform=ct()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=ct();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=fe(),m=l?l.source:void 0,y=this.layout?this.layout.source:void 0,v=m!==y,S=this.getStack(),b=!S||S.members.length<=1,P=Boolean(v&&!b&&this.options.crossfade===!0&&!this.path.some(cf));this.animationProgress=0;let j;this.mixTargetDelta=D=>{const g=D/1e3;Co(f.x,o.x,g),Co(f.y,o.y,g),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(kt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),lf(this.relativeTarget,this.relativeTargetOrigin,h,g),j&&Yu(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=fe()),Me(j,this.relativeTarget)),v&&(this.animationValues=u,Fu(u,c,this.latestValues,g,P,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&($e(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=se.update(()=>{rn.hasAnimatedSinceResize=!0,Mt.layout++,this.currentAnimation=Ou(0,xo,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{Mt.layout--},onComplete:()=>{Mt.layout--,o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(xo),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Mo(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||fe();const f=Pe(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=Pe(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Me(a,l),ft(a,u),Lt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Ku),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&hr("z",o,c,this.animationValues);for(let u=0;u<dr.length;u++)hr(`rotate${dr[u]}`,o,c,this.animationValues),hr(`skew${dr[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return qu;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=qt(o==null?void 0:o.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const v={};return this.options.layoutId&&(v.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,v.pointerEvents=qt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ze(this.latestValues)&&(v.transform=u?u({},""):"none",this.hasProjected=!1),v}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Hu(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:m,y}=this.projectionDelta;c.transformOrigin=`${m.origin*100}% ${y.origin*100}% 0`,f.animationValues?c.opacity=f===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const v in xt){if(h[v]===void 0)continue;const{correct:S,applyTo:b,isCSSVariable:P}=xt[v],j=c.transform==="none"?h[v]:S(h[v],f);if(b){const D=b.length;for(let g=0;g<D;g++)c[b[g]]=j}else P?this.options.visualElement.renderState.vars[v]=j:c[v]=j}return this.options.layoutId&&(c.pointerEvents=f===this?qt(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(To),this.root.sharedNodes.clear()}}}function Xu(e){e.updateLayout()}function Zu(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?Ae(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Pe(h);h.min=r[f].min,h.max=h.min+m}):Mo(i,n.layoutBox,r)&&Ae(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Pe(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const a=ct();Lt(a,r,n.layoutBox);const l=ct();o?Lt(l,e.applyTransform(s,!0),n.measuredBox):Lt(l,r,n.layoutBox);const c=!ho(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const y=fe();kt(y,n.layoutBox,h.layoutBox);const v=fe();kt(v,r,m.layoutBox),go(y,v)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=y,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Ju(e){Be.value&&Je.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Qu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ef(e){e.clearSnapshot()}function To(e){e.clearMeasurements()}function tf(e){e.isLayoutDirty=!1}function nf(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function So(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rf(e){e.resolveTargetDelta()}function sf(e){e.calcProjection()}function of(e){e.resetSkewAndRotation()}function af(e){e.removeLeadSnapshot()}function Co(e,t,n){e.translate=oe(t.translate,0,n),e.scale=oe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Po(e,t,n,r){e.min=oe(t.min,n.min,r),e.max=oe(t.max,n.max,r)}function lf(e,t,n,r){Po(e.x,t.x,n.x,r),Po(e.y,t.y,n.y,r)}function cf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const uf={duration:.45,ease:[.4,0,.1,1]},Eo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),jo=Eo("applewebkit/")&&!Eo("chrome/")?Math.round:je;function Ao(e){e.min=jo(e.min),e.max=jo(e.max)}function ff(e){Ao(e.x),Ao(e.y)}function Mo(e,t,n){return e==="position"||e==="preserve-aspect"&&!du(yo(t),yo(n),.2)}function df(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const hf=wo({attachResizeListener:(e,t)=>Dt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pr={current:void 0},Ro=wo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pr.current){const e=new hf({});e.mount(window),e.setOptions({layoutScroll:!0}),pr.current=e}return pr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),pf={pan:{Feature:Mu},drag:{Feature:Au,ProjectionNode:Ro,MeasureLayout:eo}};function Vo(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&se.postRender(()=>i(t,Ot(t)))}class mf extends ze{mount(){const{current:t}=this.node;t&&(this.unmount=dl(t,(n,r)=>(Vo(this.node,r,"Start"),s=>Vo(this.node,s,"End"))))}unmount(){}}class gf extends ze{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Rt(Dt(this.node.current,"focus",()=>this.onFocus()),Dt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Do(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&se.postRender(()=>i(t,Ot(t)))}class yf extends ze{mount(){const{current:t}=this.node;t&&(this.unmount=gl(t,(n,r)=>(Do(this.node,r,"Start"),(s,{success:i})=>Do(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const mr=new WeakMap,gr=new WeakMap,vf=e=>{const t=mr.get(e.target);t&&t(e)},xf=e=>{e.forEach(vf)};function bf({root:e,...t}){const n=e||document;gr.has(n)||gr.set(n,{});const r=gr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(xf,{root:e,...t})),r[s]}function wf(e,t,n){const r=bf(t);return mr.set(e,n),r.observe(e),()=>{mr.delete(e),r.unobserve(e)}}const Tf={some:0,all:1};class Sf extends ze{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Tf[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=c?u:f;h&&h(l)};return wf(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Cf(t,n))&&this.startObserver()}unmount(){}}function Cf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Pf={inView:{Feature:Sf},tap:{Feature:yf},focus:{Feature:gf},hover:{Feature:mf}},Ef={layout:{ProjectionNode:Ro,MeasureLayout:eo}},yr={current:null},Oo={current:!1};function jf(){if(Oo.current=!0,!!fn)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yr.current=e.matches;e.addListener(t),t()}else yr.current=!1}const Af=[...oi,Ce,We],Mf=e=>Af.find(ii(e)),Rf=new WeakMap;function Vf(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Se(s))e.addValue(r,s),process.env.NODE_ENV==="development"&&Wt(s.version==="12.4.7",`Attempting to mix Motion versions ${s.version} with 12.4.7 may not work as expected.`);else if(Se(i))e.addValue(r,Pt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,Pt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Lo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Df{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Xn,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=()=>{const m=Le.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,se.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=Kt(n),this.isVariantNode=es(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const y=h[m];l[m]!==void 0&&Se(y)&&y.set(l[m],!1)}}mount(t){this.current=t,Rf.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Oo.current||jf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:yr.current,process.env.NODE_ENV!=="production"&&Wt(this.shouldReduceMotion!==!0,"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(),$e(this.notifyUpdate),$e(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=He.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&se.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in nt){const n=nt[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Lo.length;r++){const s=Lo[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Vf(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(ri(s)||zs(s))?s=parseFloat(s):!Mf(s)&&We.test(n)&&(s=Zs(t,n)),this.setBaseTarget(t,Se(s)?s.get():s)),Se(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=En(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Se(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Nn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class ko extends Df{constructor(){super(...arguments),this.KeyframeResolver=li}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Se(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Of(e){return window.getComputedStyle(e)}class Lf extends ko{constructor(){super(...arguments),this.type="html",this.renderInstance=gs}readValueFromInstance(t,n){if(He.has(n)){const r=Hn(n);return r&&r.default||0}else{const r=Of(t),s=(vn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Wi(t,n)}build(t,n,r){wn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return An(t,n,r)}}class kf extends ko{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fe,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&ms(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(He.has(n)){const r=Hn(n);return r&&r.default||0}return n=ys.has(n)?n:gn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return xs(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&se.postRender(this.updateDimensions)}build(t,n,r){Cn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){vs(t,n,r,s)}mount(t){this.isSVGTag=Pn(t.tagName),super.mount(t)}}const _f=(e,t)=>Sn(e)?new kf(t):new Lf(t,{allowProjection:e!==x.Fragment}),If=il({...su,...Pf,...pf,...Ef},_f),vr=Ta(If),Nf=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?p.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"absolute z-10 w-full md:inset-0 h-full max-h-full overflow-y-auto overflow-x-hidden flex justify-center items-center bg-[rgb(0,0,0,0.6)]",children:p.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:p.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[p.exports.jsxs("div",{className:"flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600 border-gray-200",children:[p.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),p.exports.jsxs("button",{type:"button",className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center",onClick:t,children:[p.exports.jsx("svg",{className:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:p.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),p.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),p.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:p.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),p.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[p.exports.jsx("button",{onClick:()=>{n(),t()},type:"button",className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",children:"Yes "}),p.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ml-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",children:"Cancel"})]})]})})}):null,Ff=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=x.useRef(null),[o,a]=x.useState(!1);return x.useEffect(()=>(i.current||(i.current=document.createElement("div"),i.current.style.zIndex="1500",i.current.style.position="fixed",i.current.style.top="0",i.current.style.left="0",i.current.style.width="100%",i.current.style.height="100%",i.current.style.pointerEvents="none",document.body.appendChild(i.current)),a(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:Ke.createPortal(p.exports.jsx(Hr,{children:t&&p.exports.jsx(vr.div,{initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:-10},transition:{duration:.2,ease:"easeOut"},className:"absolute z-50 bg-white shadow-lg rounded-md p-2 px-1 w-42 pointer-events-auto",style:{top:n.y,left:n.x},children:e.map((l,c)=>l!=null&&l.onlyCurrentUserMessage&&!s?null:p.exports.jsxs("button",{disabled:l==null?void 0:l.disabled,className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 disabled:opacity-20 hover:bg-gray-200",onClick:()=>l.onClick(r),children:[x.cloneElement(l.icon,{className:"text-black",size:18}),p.exports.jsx("span",{className:"ml-2 text-black",children:l.name})]},c))})}),i.current)},Bf=e=>{const t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},_o=e=>{const t=document.createElement("div");return t.innerHTML=e,t.querySelectorAll("span").forEach(r=>{var i;const s=((i=r.textContent)==null?void 0:i.replace(/\u00A0/g," ").trim().replace(/\s+/g,"-"))??"";r.replaceWith(s)}),t.innerHTML.replace(/&nbsp;/g," ")},$f=()=>p.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M9.77169 2.74358C12.1132 0.399998 15.9121 0.399998 18.2553 2.74314C20.5384 5.02621 20.5969 8.69142 18.4309 11.0454L18.2428 11.2427L9.44273 20.0409L9.40616 20.0712C7.94492 21.3879 5.69092 21.3432 4.28355 19.9358C2.96453 18.6168 2.84241 16.5541 3.9172 15.0974C3.94054 15.0521 3.96879 15.0083 4.002 14.9672L4.05556 14.9075L4.14247 14.8198L4.28355 14.6719L4.28647 14.6748L11.7222 7.22047C11.9881 6.95385 12.4047 6.92909 12.6986 7.14656L12.7829 7.21906C13.0495 7.48497 13.0742 7.9016 12.8568 8.19551L12.7843 8.27972L5.18966 15.8928C4.47202 16.7684 4.5219 18.0627 5.3393 18.8801C6.16836 19.7091 7.48801 19.7486 8.3638 18.9985L17.1965 10.1681C18.952 8.41041 18.952 5.56116 17.1946 3.8038C15.4922 2.10136 12.765 2.04816 10.9986 3.6442L10.8307 3.8038L10.8181 3.81812L1.28179 13.3544C0.988902 13.6473 0.514028 13.6473 0.221135 13.3544C-0.0451319 13.0882 -0.0693378 12.6715 0.148517 12.3779L0.221135 12.2938L9.77001 2.74314L9.77169 2.74358Z",fill:"#8A8A8A"})}),Uf=()=>p.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M13.25 9C13.6297 9 13.9435 9.28215 13.9932 9.64823L14 9.75V10.25C14 13.8094 11.245 16.7254 7.75098 16.9817L7.75 19.25C7.75 19.6642 7.41421 20 7 20C6.6203 20 6.30651 19.7178 6.25685 19.3518L6.25 19.25L6.25002 16.9818C2.83323 16.7316 0.122835 13.938 0.00406027 10.4863L0 10.25V9.75C0 9.33579 0.335786 9 0.75 9C1.1297 9 1.44349 9.28215 1.49315 9.64823L1.5 9.75V10.25C1.5 13.077 3.73445 15.3821 6.5336 15.4956L6.75 15.5H7.25C10.077 15.5 12.3821 13.2656 12.4956 10.4664L12.5 10.25V9.75C12.5 9.33579 12.8358 9 13.25 9ZM7 0C9.20914 0 11 1.79086 11 4V10C11 12.2091 9.20914 14 7 14C4.79086 14 3 12.2091 3 10V4C3 1.79086 4.79086 0 7 0ZM7 1.5C5.61929 1.5 4.5 2.61929 4.5 4V10C4.5 11.3807 5.61929 12.5 7 12.5C8.38071 12.5 9.5 11.3807 9.5 10V4C9.5 2.61929 8.38071 1.5 7 1.5Z",fill:"#fff"})}),xr=()=>p.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M10.8147 10.1974L3.28344 11.4526C3.10705 11.482 2.95979 11.6034 2.89723 11.7709L0.299335 18.7283C0.0506615 19.3678 0.720085 19.9778 1.33375 19.671L19.3337 10.671C19.8865 10.3946 19.8865 9.60573 19.3337 9.32933L1.33375 0.329334C0.720085 0.0225017 0.0506615 0.632543 0.299335 1.27199L2.89723 8.22938C2.95979 8.39691 3.10705 8.51827 3.28344 8.54767L10.8147 9.80287C10.9236 9.82103 10.9972 9.92408 10.9791 10.033C10.965 10.1173 10.899 10.1834 10.8147 10.1974Z",fill:"#fff"})}),sn=e=>p.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:p.exports.jsxs("g",{fill:"none",children:[p.exports.jsx("path",{className:"background",fill:"#ffffff",d:"M8,1 L9,1 L9,20 L8,20 L8,18 C7.807,15.161 7.124,12.233 5.950,9.218 C5.046,6.893 3.504,4.733 1.325,2.738 L1.325,2.738 C0.917,2.365 0.89,1.732 1.263,1.325 C1.452,1.118 1.72,1 2,1 L8,1 Z"}),p.exports.jsx("path",{className:"fill-gray-200",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0 L9,0 L9,20 L7,20 L7,20 L7.002,18.068 C6.816,15.333 6.156,12.504 5.018,9.58 C4.172,7.406 2.72,5.371 0.649,3.475 C-0.165,2.729 -0.221,1.464 0.525,0.649 C0.904,0.236 1.439,0 2,0 Z"}),p.exports.jsx("path",{className:"border_2x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.5 L9,0.5 L9,20 L7.5,20 L7.5,20 L7.501,18.034 C7.312,15.247 6.64,12.369 5.484,9.399 C4.609,7.15 3.112,5.052 0.987,3.106 C0.376,2.547 0.334,1.598 0.894,0.987 C1.178,0.677 1.579,0.5 2,0.5 Z"}),p.exports.jsx("path",{className:"border_3x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.667 L9,0.667 L9,20 L7.667,20 L7.667,20 L7.668,18.023 C7.477,15.218 6.802,12.324 5.64,9.338 C4.755,7.064 3.243,4.946 1.1,2.983 C0.557,2.486 0.52,1.643 1.017,1.1 C1.269,0.824 1.626,0.667 2,0.667 Z"})]})}),Wf=({onSendMessage:e,onEditMessage:t,onSendVoice:n,onImageSend:r,onVideoSend:s,onFileSend:i,dynamicSymbolAssignments:o,onDynamicSymbolListSet:a,onDynamicSymbolListDelete:l,messageToEdit:c,setMessageToEdit:u})=>{const[f,h]=x.useState(""),[m,y]=x.useState(!1),[v,S]=x.useState(0),[b,P]=x.useState(null),[j,D]=x.useState(null),[g,O]=x.useState(0),Y=x.useRef(null),k=x.useRef([]),ee=x.useRef(null),M=x.useRef(null),q=x.useRef(null),[ie,W]=x.useState(!1),[ce,ye]=x.useState([]),me=150,X=41.6;x.useEffect(()=>{const A=document.getElementById("static-display");A&&!A.textContent&&(c!=null&&c.text)&&(A.textContent=c==null?void 0:c.text)},[c==null?void 0:c.text]);const ue=A=>{c?u(L=>L?new yt({...L,text:A,isEdited:!0}):void 0):h(A);const V=A.match(/(\S+)$/);if(B(V),ce.length>0){const L=Array.from(A.matchAll(/<span[^>]*id=["']([^"']+)["'][^>]*>/g)).map(E=>E[1]);ye(E=>(E.filter(te=>!L.includes(te)).forEach(te=>{const xe=te.charAt(0),Te=te.slice(1);l==null||l(Te,xe)}),L))}if(M.current){const L=M.current.scrollHeight;Math.ceil(M.current.scrollHeight/L)-1,L>X?L>me?(M.current.style.height=`${me}px`,M.current.style.overflowY="auto"):(M.current.style.height=`${L}px`,M.current.style.overflowY="hidden"):(M.current.style.height=`${X}px`,M.current.style.overflowY="hidden")}},ve=()=>{if(c){const A=_o(c.text);if(A.trim()==="")return;t({...c,htmlContent:c.text,text:A}),u(void 0)}else h(A=>{const V=_o(A);return V.trim()===""?A:(console.log("htmlcontnent before",A),e(V,A),"")});P(null),D(null),M.current&&(M.current.style.height=`${X}px`,M.current.innerHTML="")},w=async()=>{y(!0),S(0),k.current=[],ee.current=setInterval(()=>{S(L=>L+1)},1e3);const A=await navigator.mediaDevices.getUserMedia({audio:!0}),V=new MediaRecorder(A);Y.current=V,V.ondataavailable=L=>{L.data.size>0&&k.current.push(L.data)},V.onstop=()=>{clearInterval(ee.current);const L=new Blob(k.current,{type:"audio/mp3"}),E=new File([L],"recording.mp3",{type:"audio/mp3"});n(E),y(!1)},V.start()},T=()=>{var A;(A=Y.current)==null||A.stop()},B=A=>{if(A){const V=A[0];if(b){const L=A[0].split(b)[1];D(L)}o!=null&&o.some(L=>L.symbol===V)&&P(V)}else P(null),D(null)},$=(A,V,L)=>{var Qe;if(!M.current)return;ye(Ye=>[...Ye,`${L+A}`]);let E=((Qe=M.current)==null?void 0:Qe.innerHTML)||"";const ne=E.match(/(\S+)$/);if(ne){const Ye=ne[0];E=E.slice(0,-Ye.length)}const te=`<span id="${L+A}" contentEditable="false" class="inline-flex items-center gap-1 px-2 pb-1 text-sm font-medium text-white bg-blue-500 rounded-full pointer-events-none select-none truncate max-w-[250px]">${L+V}</span>&nbsp;`;M.current.innerHTML=E+te;const xe=document.createTextNode("");M.current.appendChild(xe);const Te=window.getSelection(),dt=document.createRange();dt.setStart(xe,0),dt.collapse(!0),Te==null||Te.removeAllRanges(),Te==null||Te.addRange(dt);const on=M.current.innerHTML;ue(on),a&&a(V,A,L),P(null),D(null),setTimeout(()=>{var Ye;(Ye=M.current)==null||Ye.focus()},0)},I=A=>{const{scrollTop:V,scrollHeight:L,clientHeight:E}=A.currentTarget;if(V>g){if(V+E>=L-1){const te=o==null?void 0:o.find(xe=>xe.symbol===b);te&&(te!=null&&te.updatePageNumber)&&(W(!0),te==null||te.updatePageNumber(te.pagNumber+1),O(V),setTimeout(()=>{W(!1)},500))}}else O(V)},K=new Set(["jpeg","png","gif","webp","bmp","svg+xml","tiff","x-icon"]),N=new Set(["mp4","webm","ogg","mpeg","quicktime","x-msvideo","x-ms-wmv","3gpp","3gpp2"]),U=()=>{var A;(A=q.current)==null||A.click()},z=A=>{var E,ne;const V=(E=A.target.files)==null?void 0:E[0];if(!V)return;let L="";if(V.type){const te=V.type.split("/");te.length===2&&(L=te[1])}L||(L=((ne=V.name.split(".").pop())==null?void 0:ne.toLowerCase())||""),K.has(L)?r(V):N.has(L)?s(V):i(V)};return p.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[m?p.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[p.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:Bf(v)}),p.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:T,children:p.exports.jsx(xr,{})})]}):c?p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] relative h-10",children:[p.exports.jsxs("div",{className:" h-12 absolute bottom-10 w-full flex justify-between items-center px-2 border-t border-x border-gray-300 bg-white rounded-t-lg ",children:[p.exports.jsx("span",{id:"static-display",className:"text-gray-400 whitespace-nowrap truncate"}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700 -mt-4",onClick:()=>u(void 0),children:"✕"})]}),p.exports.jsx("textarea",{className:"w-full resize-none h-[41.6px] absolute bottom-0 bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-bl-3xl ",placeholder:"Type a message...",value:c.text,onChange:A=>ue(A.target.value),onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),ve())}}),p.exports.jsx(sn,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:ve,children:p.exports.jsx(xr,{})})]}):p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] h-10 relative ",children:[p.exports.jsx("div",{onClick:U,className:"cursor-pointer z-10 absolute right-4 top-[11px]",children:p.exports.jsx($f,{})}),p.exports.jsx("input",{type:"file",ref:q,style:{display:"none"},onChange:z}),p.exports.jsx("div",{ref:M,contentEditable:!0,suppressContentEditableWarning:!0,className:"w-full absolute bottom-0 resize-none bg-white flex-1 p-2 pr-10 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl overflow-hidden",style:{height:X},onInput:A=>ue(A.currentTarget.innerHTML),onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),ve())}}),p.exports.jsx(sn,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:f?ve:w,children:f?p.exports.jsx(xr,{}):p.exports.jsx(Uf,{})})]}),b&&p.exports.jsxs("div",{className:"absolute bottom-full left-0 w-full bg-white shadow-xl rounded-lg border border-gray-200 p-4 z-50 max-h-60 overflow-y-auto",onScroll:I,children:[p.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[p.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",p.exports.jsx("span",{className:"text-blue-500",children:b})]}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>P(null),children:"✕"})]}),p.exports.jsxs("div",{className:"space-y-2",children:[o?o.filter(A=>A.symbol===b).map(A=>{var E;const{component:V,lists:L}=A;return V?j?(E=L==null?void 0:L.filter(ne=>ne==null?void 0:ne.name.includes(j)))==null?void 0:E.map((ne,te)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(V,{listsProps:ne,onClick:(xe,Te)=>$(xe,Te,b)})},te)):L==null?void 0:L.map((ne,te)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(V,{listsProps:ne,onClick:(xe,Te)=>$(xe,Te,b)})},te)):null}):null,p.exports.jsx("div",{className:"h-8",children:ie&&"Loading more items..."})]})]})]})};var ke=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(ke||{}),le=(e=>(e[e.Telegram=0]="Telegram",e[e.Simple=1]="Simple",e))(le||{});const br=({progress:e,size:t=100,strokeWidth:n=10,circleColor:r="#e0e0e0",progressColor:s="#3b82f6",animationDuration:i=1e3,showCancel:o=!1,onCancelClick:a,className:l})=>{const[c,u]=x.useState(0),f=(t-n)/2,h=2*Math.PI*f,m=h-c/100*h;return x.useEffect(()=>{const y=Date.now(),v=y+i,S=()=>{const b=Date.now(),j=Math.min(1,(b-y)/i)*e;u(j),b<v?requestAnimationFrame(S):u(e)};requestAnimationFrame(S)},[e,i]),p.exports.jsxs("div",{className:`relative flex items-center justify-center ${l}`,style:{width:t,height:t},children:[p.exports.jsxs("svg",{className:"absolute animate-[spin_2s_ease-in-out_infinite] ",width:t,height:t,children:[p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:r,strokeWidth:n}),p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:s,strokeWidth:n,strokeDasharray:h,strokeDashoffset:m,strokeLinecap:"round",transform:`rotate(-90 ${t/2} ${t/2})`,className:"transition-all ease-linear duration-1000"})]}),o?p.exports.jsx("button",{onClick:a,className:"absolute flex items-center justify-center w-8 h-8 rounded-full hover:bg-gray-200 transition-colors","aria-label":"Cancel",children:p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:s,children:p.exports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}):p.exports.jsxs("span",{className:"absolute text-lg font-bold",style:{color:s},children:[Math.round(c),"%"]})]})},Io=({fileName:e,fileSize:t,format:n,src:r,them:s,uploadProgres:i,onCancelClick:o})=>{const a=()=>{const c={rar:p.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:p.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:p.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:p.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:p.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),txt:p.exports.jsx("p",{className:"p-2 text-purple-500 font-bold",children:n}),xls:p.exports.jsx("p",{className:"p-2 text-green-400 font-bold",children:n}),ppt:p.exports.jsx("p",{className:"p-2 text-yellow-500 font-bold",children:n}),png:p.exports.jsx("p",{className:"p-2 text-pink-500 font-bold",children:n}),jpg:p.exports.jsx("p",{className:"p-2 text-indigo-500 font-bold",children:n}),mp3:p.exports.jsx("p",{className:"p-2 text-teal-500 font-bold",children:n}),mp4:p.exports.jsx("p",{className:"p-2 text-gray-500 font-bold",children:n}),exe:p.exports.jsx("p",{className:"p-2 text-red-400 font-bold",children:n}),html:p.exports.jsx("p",{className:"p-2 text-orange-500 font-bold",children:n}),css:p.exports.jsx("p",{className:"p-2 text-blue-300 font-bold",children:n}),js:p.exports.jsx("p",{className:"p-2 text-yellow-400 font-bold",children:n}),json:p.exports.jsx("p",{className:"p-2 text-purple-400 font-bold",children:n}),xml:p.exports.jsx("p",{className:"p-2 text-green-300 font-bold",children:n}),svg:p.exports.jsx("p",{className:"p-2 text-pink-400 font-bold",children:n}),gif:p.exports.jsx("p",{className:"p-2 text-indigo-400 font-bold",children:n}),csv:p.exports.jsx("p",{className:"p-2 text-teal-400 font-bold",children:n}),sql:p.exports.jsx("p",{className:"p-2 text-gray-400 font-bold",children:n})};return n&&c[n]?c[n]:p.exports.jsx("p",{className:"p-2 text-black ",children:n??"UN"})},l=c=>c>1073741824?(c/1073741824).toFixed(2)+" GB":c>1048576?(c/1048576).toFixed(1)+" MB":(c/1024).toFixed(1)+" KB";return p.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[i?p.exports.jsx("div",{className:" w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(br,{progress:(i==null?void 0:i.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:o,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("div",{className:` border ${s===le.Simple?" border-white ":s===le.Telegram?" border-green-900":""} w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3`,children:a()}),p.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[p.exports.jsx("a",{href:r,download:e,className:`${s===le.Simple?"text-white":s===le.Telegram?"text-gray-900":""} font-medium text-sm hover:underline truncate max-w-[100px]`,title:e,children:e}),p.exports.jsx("span",{className:`${s===le.Simple?"text-gray-800":s===le.Telegram?"text-gray-900":""} text-sm`,children:l(t)})]}),p.exports.jsx("a",{href:r,download:e,className:"ml-2 bg-green-500 text-white px-2 py-1 text-sm rounded hover:bg-green-600",children:"Download"})]})},zf=e=>p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-play",...e,children:p.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),Yf=e=>p.exports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-pause",...e,children:[p.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),p.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let It=null;const Kf=({src:e,className:t,uploadProgres:n,onCancelClick:r})=>{const[s,i]=x.useState(!1),[o,a]=x.useState(0),l=x.useRef(null);x.useEffect(()=>{const u=l.current;if(!u)return;const f=()=>{a(u.currentTime/u.duration*100)},h=()=>i(!0),m=()=>i(!1),y=()=>{i(!1),a(0)};return u.addEventListener("timeupdate",f),u.addEventListener("play",h),u.addEventListener("pause",m),u.addEventListener("ended",y),()=>{u.removeEventListener("timeupdate",f),u.removeEventListener("play",h),u.removeEventListener("pause",m),u.removeEventListener("ended",y)}},[]);const c=()=>{const u=l.current;u&&(s?u.pause():(It&&It!==u&&(It.pause(),It.currentTime=0),u.play(),It=u))};return p.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[n?p.exports.jsx("div",{className:" w-9 h-9 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(br,{progress:(n==null?void 0:n.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:r,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("button",{className:"w-9 h-9 cursor-pointer flex items-center justify-center pl-[1.5px] bg-gray-700 rounded-full hover:bg-gray-600",onClick:c,children:s?p.exports.jsx(Yf,{}):p.exports.jsx(zf,{})}),p.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:p.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${o}%`}})}),p.exports.jsx("audio",{ref:l,src:e})]})},Hf=({attachmentUrl:e,attachmentType:t,attachmentFormat:n,attachmentName:r,attachmentSize:s,them:i,uploadProgres:o,cancellationToken:a})=>{const l=r||"File",c=s||0;return e?t===ke.Voice?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx(Kf,{onCancelClick:a,uploadProgres:o,src:e})}):t===ke.Image?p.exports.jsxs("div",{className:"relative w-full",children:[o?p.exports.jsx(br,{progress:o==null?void 0:o.progres,size:50,strokeWidth:4,showCancel:!0,onCancelClick:a,circleColor:"#ddd",progressColor:"#286b2a",className:"!absolute z-[1] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"}):null,p.exports.jsx("img",{className:`transition-all ${o?"filter blur-lg":" blur-none"}`,src:e})]}):t===ke.File?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Io,{fileName:l,fileSize:c,format:n??"UN",src:e,uploadProgres:o,onCancelClick:a})}):t===ke.Video?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Io,{fileName:l,fileSize:c,format:n??"UN",src:e,uploadProgres:o,onCancelClick:a})}):null:null},qf=({message:e,showUserProfile:t,handleContextMenu:n,media:r,them:s,maxWidth:i})=>{var o,a,l,c,u,f,h,m,y,v;return p.exports.jsxs(p.exports.Fragment,{children:[t?p.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,p.exports.jsxs(vr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:S=>n(S,e),className:`relative ${r?"w-3/4":i?"max-w-[400px] w-fit":"max-w-[75%] w-fit"} flex flex-col gap-1 break-words p-2 pt-5 rounded-lg ${s===le.Simple?"bg-[#f8fbff]":s===le.Telegram?"bg-blue-200 ":""} `,children:[p.exports.jsx("span",{title:(o=e.user)!=null&&o.fullName&&((l=(a=e.user)==null?void 0:a.fullName)==null?void 0:l.length)>16?(c=e.user)==null?void 0:c.firstName:(u=e.user)==null?void 0:u.fullName,className:"relative -top-3 h-4 -mb-3 overflow-y-visible text-xs text-orange-700 whitespace-nowrap truncate max-w-[100px] overflow-visible",children:(f=e.user)!=null&&f.fullName&&((m=(h=e.user)==null?void 0:h.fullName)==null?void 0:m.length)>16?(y=e.user)==null?void 0:y.firstName:(v=e.user)==null?void 0:v.fullName}),r||null,p.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e.text}}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]}),e.isEdited?p.exports.jsx("span",{className:`text-xs italic ${s===le.Simple?"text-gray-700":s===le.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(sn,{className:` ${s===le.Simple?"[&>g>path]:fill-[#f8fbff]":s===le.Telegram?"[&>g>path]:fill-blue-200":""} -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 `})]})]})},Gf=({className:e})=>p.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[p.exports.jsx("path",{d:"M11.6619 4.6478C11.8358 4.83691 11.8272 5.1347 11.6427 5.31294L4.36284 12.3463C4.14493 12.5568 3.80285 12.5503 3.59268 12.3317L1.13205 9.77168C0.954124 9.58658 0.956276 9.28866 1.13686 9.10628C1.31743 8.92389 1.60806 8.9261 1.78598 9.1112L3.99455 11.4089L11.013 4.62812C11.1975 4.44988 11.488 4.4587 11.6619 4.6478Z",fill:"gray"}),p.exports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.8759 4.64963C15.0492 4.83921 15.0399 5.13698 14.8549 5.31471L7.51066 12.3726C7.32572 12.5503 7.03524 12.5407 6.86185 12.3511C6.68847 12.1616 6.69784 11.8638 6.88278 11.6861L14.227 4.62818C14.412 4.45045 14.7025 4.46005 14.8759 4.64963Z",fill:"gray"})]}),No=({size:e=24,color:t="text-current",className:n})=>p.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:p.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[p.exports.jsx("defs",{children:p.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),p.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),p.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[p.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),p.exports.jsx("path",{d:"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",stroke:"url(#linearGradient-1)",strokeWidth:"4",strokeLinecap:"round"})]})]})}),Xf=({handleContextMenu:e,media:t,message:n,them:r,maxWidth:s})=>p.exports.jsxs(vr.div,{style:{background:"red !important"},initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:i=>e(i,n),className:`relative self-end ${t?"w-3/4":s?" max-w-[400px]":"max-w-[75%]"} flex flex-col justify-center break-words p-2 rounded-lg ${r===le.Telegram?" bg-green-200":le.Simple?" bg-[#4F46E5] text-white":""}`,children:[t||null,p.exports.jsx("span",{className:"",children:n.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?p.exports.jsx(No,{size:13,color:"text-black"}):p.exports.jsx(Gf,{className:r===le.Telegram?" ":le.Simple?" [&>path]:fill-white":""}),n.isEdited?p.exports.jsx("span",{className:`text-xs italic ${r===le.Simple?"text-gray-200":r===le.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(sn,{className:`fill-blue-200 rotate-180 absolute -right-2 bottom-0 ${r===le.Telegram?"[&>g>path]:fill-green-200":le.Simple?"[&>g>path]:fill-[#4F46E5]":""} `})]});var ge={exports:{}},wr={exports:{}},J={};var Fo;function Zf(){if(Fo)return J;Fo=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,P=e?Symbol.for("react.scope"):60119;function j(g){if(typeof g=="object"&&g!==null){var O=g.$$typeof;switch(O){case t:switch(g=g.type,g){case l:case c:case r:case i:case s:case f:return g;default:switch(g=g&&g.$$typeof,g){case a:case u:case y:case m:case o:return g;default:return O}}case n:return O}}}function D(g){return j(g)===c}return J.AsyncMode=l,J.ConcurrentMode=c,J.ContextConsumer=a,J.ContextProvider=o,J.Element=t,J.ForwardRef=u,J.Fragment=r,J.Lazy=y,J.Memo=m,J.Portal=n,J.Profiler=i,J.StrictMode=s,J.Suspense=f,J.isAsyncMode=function(g){return D(g)||j(g)===l},J.isConcurrentMode=D,J.isContextConsumer=function(g){return j(g)===a},J.isContextProvider=function(g){return j(g)===o},J.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},J.isForwardRef=function(g){return j(g)===u},J.isFragment=function(g){return j(g)===r},J.isLazy=function(g){return j(g)===y},J.isMemo=function(g){return j(g)===m},J.isPortal=function(g){return j(g)===n},J.isProfiler=function(g){return j(g)===i},J.isStrictMode=function(g){return j(g)===s},J.isSuspense=function(g){return j(g)===f},J.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===c||g===i||g===s||g===f||g===h||typeof g=="object"&&g!==null&&(g.$$typeof===y||g.$$typeof===m||g.$$typeof===o||g.$$typeof===a||g.$$typeof===u||g.$$typeof===S||g.$$typeof===b||g.$$typeof===P||g.$$typeof===v)},J.typeOf=j,J}var Q={};var Bo;function Jf(){return Bo||(Bo=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,P=e?Symbol.for("react.scope"):60119;function j(E){return typeof E=="string"||typeof E=="function"||E===r||E===c||E===i||E===s||E===f||E===h||typeof E=="object"&&E!==null&&(E.$$typeof===y||E.$$typeof===m||E.$$typeof===o||E.$$typeof===a||E.$$typeof===u||E.$$typeof===S||E.$$typeof===b||E.$$typeof===P||E.$$typeof===v)}function D(E){if(typeof E=="object"&&E!==null){var ne=E.$$typeof;switch(ne){case t:var te=E.type;switch(te){case l:case c:case r:case i:case s:case f:return te;default:var xe=te&&te.$$typeof;switch(xe){case a:case u:case y:case m:case o:return xe;default:return ne}}case n:return ne}}}var g=l,O=c,Y=a,k=o,ee=t,M=u,q=r,ie=y,W=m,ce=n,ye=i,me=s,X=f,ue=!1;function ve(E){return ue||(ue=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),w(E)||D(E)===l}function w(E){return D(E)===c}function T(E){return D(E)===a}function B(E){return D(E)===o}function $(E){return typeof E=="object"&&E!==null&&E.$$typeof===t}function I(E){return D(E)===u}function K(E){return D(E)===r}function N(E){return D(E)===y}function U(E){return D(E)===m}function z(E){return D(E)===n}function A(E){return D(E)===i}function V(E){return D(E)===s}function L(E){return D(E)===f}Q.AsyncMode=g,Q.ConcurrentMode=O,Q.ContextConsumer=Y,Q.ContextProvider=k,Q.Element=ee,Q.ForwardRef=M,Q.Fragment=q,Q.Lazy=ie,Q.Memo=W,Q.Portal=ce,Q.Profiler=ye,Q.StrictMode=me,Q.Suspense=X,Q.isAsyncMode=ve,Q.isConcurrentMode=w,Q.isContextConsumer=T,Q.isContextProvider=B,Q.isElement=$,Q.isForwardRef=I,Q.isFragment=K,Q.isLazy=N,Q.isMemo=U,Q.isPortal=z,Q.isProfiler=A,Q.isStrictMode=V,Q.isSuspense=L,Q.isValidElementType=j,Q.typeOf=D}()),Q}var $o;function Uo(){return $o||($o=1,function(e){process.env.NODE_ENV==="production"?e.exports=Zf():e.exports=Jf()}(wr)),wr.exports}var Tr,Wo;function Qf(){if(Wo)return Tr;Wo=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function s(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Tr=s()?Object.assign:function(i,o){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},Tr}var Sr,zo;function Cr(){if(zo)return Sr;zo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Sr=e,Sr}var Pr,Yo;function Ko(){return Yo||(Yo=1,Pr=Function.call.bind(Object.prototype.hasOwnProperty)),Pr}var Er,Ho;function ed(){if(Ho)return Er;Ho=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Cr(),n={},r=Ko();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var f;try{if(typeof i[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[u](o,u,l,a,null,t)}catch(y){f=y}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var m=c?c():"";e("Failed "+a+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Er=s,Er}var jr,qo;function td(){if(qo)return jr;qo=1;var e=Uo(),t=Qf(),n=Cr(),r=Ko(),s=ed(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return jr=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(w){var T=w&&(c&&w[c]||w[u]);if(typeof T=="function")return T}var h="<<anonymous>>",m={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:P(),arrayOf:j,element:D(),elementType:g(),instanceOf:O,node:M(),objectOf:k,oneOf:Y,oneOfType:ee,shape:ie,exact:W};function y(w,T){return w===T?w!==0||1/w===1/T:w!==w&&T!==T}function v(w,T){this.message=w,this.data=T&&typeof T=="object"?T:{},this.stack=""}v.prototype=Error.prototype;function S(w){if(process.env.NODE_ENV!=="production")var T={},B=0;function $(K,N,U,z,A,V,L){if(z=z||h,V=V||U,L!==n){if(l){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=z+":"+U;!T[ne]&&B<3&&(i("You are manually calling a React.PropTypes validation function for the `"+V+"` prop on `"+z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),T[ne]=!0,B++)}}return N[U]==null?K?N[U]===null?new v("The "+A+" `"+V+"` is marked as required "+("in `"+z+"`, but its value is `null`.")):new v("The "+A+" `"+V+"` is marked as required in "+("`"+z+"`, but its value is `undefined`.")):null:w(N,U,z,A,V)}var I=$.bind(null,!1);return I.isRequired=$.bind(null,!0),I}function b(w){function T(B,$,I,K,N,U){var z=B[$],A=me(z);if(A!==w){var V=X(z);return new v("Invalid "+K+" `"+N+"` of type "+("`"+V+"` supplied to `"+I+"`, expected ")+("`"+w+"`."),{expectedType:w})}return null}return S(T)}function P(){return S(o)}function j(w){function T(B,$,I,K,N){if(typeof w!="function")return new v("Property `"+N+"` of component `"+I+"` has invalid PropType notation inside arrayOf.");var U=B[$];if(!Array.isArray(U)){var z=me(U);return new v("Invalid "+K+" `"+N+"` of type "+("`"+z+"` supplied to `"+I+"`, expected an array."))}for(var A=0;A<U.length;A++){var V=w(U,A,I,K,N+"["+A+"]",n);if(V instanceof Error)return V}return null}return S(T)}function D(){function w(T,B,$,I,K){var N=T[B];if(!a(N)){var U=me(N);return new v("Invalid "+I+" `"+K+"` of type "+("`"+U+"` supplied to `"+$+"`, expected a single ReactElement."))}return null}return S(w)}function g(){function w(T,B,$,I,K){var N=T[B];if(!e.isValidElementType(N)){var U=me(N);return new v("Invalid "+I+" `"+K+"` of type "+("`"+U+"` supplied to `"+$+"`, expected a single ReactElement type."))}return null}return S(w)}function O(w){function T(B,$,I,K,N){if(!(B[$]instanceof w)){var U=w.name||h,z=ve(B[$]);return new v("Invalid "+K+" `"+N+"` of type "+("`"+z+"` supplied to `"+I+"`, expected ")+("instance of `"+U+"`."))}return null}return S(T)}function Y(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),o;function T(B,$,I,K,N){for(var U=B[$],z=0;z<w.length;z++)if(y(U,w[z]))return null;var A=JSON.stringify(w,function(L,E){var ne=X(E);return ne==="symbol"?String(E):E});return new v("Invalid "+K+" `"+N+"` of value `"+String(U)+"` "+("supplied to `"+I+"`, expected one of "+A+"."))}return S(T)}function k(w){function T(B,$,I,K,N){if(typeof w!="function")return new v("Property `"+N+"` of component `"+I+"` has invalid PropType notation inside objectOf.");var U=B[$],z=me(U);if(z!=="object")return new v("Invalid "+K+" `"+N+"` of type "+("`"+z+"` supplied to `"+I+"`, expected an object."));for(var A in U)if(r(U,A)){var V=w(U,A,I,K,N+"."+A,n);if(V instanceof Error)return V}return null}return S(T)}function ee(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var T=0;T<w.length;T++){var B=w[T];if(typeof B!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ue(B)+" at index "+T+"."),o}function $(I,K,N,U,z){for(var A=[],V=0;V<w.length;V++){var L=w[V],E=L(I,K,N,U,z,n);if(E==null)return null;E.data&&r(E.data,"expectedType")&&A.push(E.data.expectedType)}var ne=A.length>0?", expected one of type ["+A.join(", ")+"]":"";return new v("Invalid "+U+" `"+z+"` supplied to "+("`"+N+"`"+ne+"."))}return S($)}function M(){function w(T,B,$,I,K){return ce(T[B])?null:new v("Invalid "+I+" `"+K+"` supplied to "+("`"+$+"`, expected a ReactNode."))}return S(w)}function q(w,T,B,$,I){return new v((w||"React class")+": "+T+" type `"+B+"."+$+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+I+"`.")}function ie(w){function T(B,$,I,K,N){var U=B[$],z=me(U);if(z!=="object")return new v("Invalid "+K+" `"+N+"` of type `"+z+"` "+("supplied to `"+I+"`, expected `object`."));for(var A in w){var V=w[A];if(typeof V!="function")return q(I,K,N,A,X(V));var L=V(U,A,I,K,N+"."+A,n);if(L)return L}return null}return S(T)}function W(w){function T(B,$,I,K,N){var U=B[$],z=me(U);if(z!=="object")return new v("Invalid "+K+" `"+N+"` of type `"+z+"` "+("supplied to `"+I+"`, expected `object`."));var A=t({},B[$],w);for(var V in A){var L=w[V];if(r(w,V)&&typeof L!="function")return q(I,K,N,V,X(L));if(!L)return new v("Invalid "+K+" `"+N+"` key `"+V+"` supplied to `"+I+"`.\nBad object: "+JSON.stringify(B[$],null," ")+`
19
+ `),()=>{document.head.removeChild(m)}},[t]),p.exports.jsx(da,{isPresent:t,childRef:s,sizeRef:i,children:an.cloneElement(e,{ref:s})})}const pa=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a})=>{const l=cn(ma),c=x.useId(),u=x.useCallback(h=>{l.set(h,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),f=x.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:h=>(l.set(h,!1),()=>l.delete(h))}),i?[Math.random(),u]:[n,u]);return x.useMemo(()=>{l.forEach((h,m)=>l.set(m,!1))},[n]),an.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=p.exports.jsx(ha,{isPresent:n,anchorX:a,children:e})),p.exports.jsx(Ft.Provider,{value:f,children:e})};function ma(){return new Map}function zr(e=!0){const t=x.useContext(Ft);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=x.useId();x.useEffect(()=>{if(e)return s(i)},[e]);const o=x.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const Bt=e=>e.key||"";function Yr(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const fn=typeof window<"u",Kr=fn?x.useLayoutEffect:x.useEffect,Hr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=zr(o),u=x.useMemo(()=>Yr(e),[e]),f=o&&!l?[]:u.map(Bt),h=x.useRef(!0),m=x.useRef(u),y=cn(()=>new Map),[v,S]=x.useState(u),[b,P]=x.useState(u);Kr(()=>{h.current=!1,m.current=u;for(let g=0;g<b.length;g++){const O=Bt(b[g]);f.includes(O)?y.delete(O):y.get(O)!==!0&&y.set(O,!1)}},[b,f.length,f.join("-")]);const j=[];if(u!==v){let g=[...u];for(let O=0;O<b.length;O++){const Y=b[O],k=Bt(Y);f.includes(k)||(g.splice(O,0,Y),j.push(Y))}return i==="wait"&&j.length&&(g=j),P(Yr(g)),S(u),null}process.env.NODE_ENV!=="production"&&i==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:D}=x.useContext(ln);return p.exports.jsx(p.exports.Fragment,{children:b.map(g=>{const O=Bt(g),Y=o&&!l?!1:u===b||f.includes(O),k=()=>{if(y.has(O))y.set(O,!0);else return;let ee=!0;y.forEach(M=>{M||(ee=!1)}),ee&&(D==null||D(),P(m.current),o&&(c==null||c()),r&&r())};return p.exports.jsx(pa,{isPresent:Y,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:Y?void 0:k,anchorX:a,children:g},O)})})},je=e=>e;let et=je,Fe=je;process.env.NODE_ENV!=="production"&&(et=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Fe=(e,t)=>{if(!e)throw new Error(t)});function dn(e){let t;return()=>(t===void 0&&(t=e()),t)}const tt=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},De=e=>e*1e3,_e=e=>e/1e3,qr={skipAnimations:!1,useManualTiming:!1},$t=["read","resolveKeyframes","update","preRender","render","postRender"],Be={value:null,addProjectionMetrics:null};function ga(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(f){o.has(f)&&(u.schedule(f),e()),l++,f(a)}const u={schedule:(f,h=!1,m=!1)=>{const v=m&&s?n:r;return h&&o.add(f),v.has(f)||v.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(a=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),t&&Be.value&&Be.value.frameloop[t].push(l),l=0,n.clear(),s=!1,i&&(i=!1,u.process(f))}};return u}const ya=40;function Gr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=$t.reduce((b,P)=>(b[P]=ga(i,t?P:void 0),b),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:f,postRender:h}=o,m=()=>{const b=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,ya),1),s.timestamp=b,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},y=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:$t.reduce((b,P)=>{const j=o[P];return b[P]=(D,g=!1,O=!1)=>(n||y(),j.schedule(D,g,O)),b},{}),cancel:b=>{for(let P=0;P<$t.length;P++)o[$t[P]].cancel(b)},state:s,steps:o}}const{schedule:se,cancel:$e,state:we,steps:hn}=Gr(typeof requestAnimationFrame<"u"?requestAnimationFrame:je,!0),Xr=x.createContext({strict:!1}),Zr={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"]},nt={};for(const e in Zr)nt[e]={isEnabled:t=>Zr[e].some(n=>!!t[n])};function va(e){for(const t in e)nt[t]={...nt[t],...e[t]}}const xa=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 Ut(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||xa.has(e)}let Jr=e=>!Ut(e);function ba(e){e&&(Jr=t=>t.startsWith("on")?!Ut(t):e(t))}try{ba(require("@emotion/is-prop-valid").default)}catch{}function wa(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Jr(s)||n===!0&&Ut(s)||!t&&!Ut(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Qr=new Set;function Wt(e,t,n){e||Qr.has(t)||(console.warn(t),n&&console.warn(n),Qr.add(t))}function Ta(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Wt(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const zt=x.createContext({});function Yt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function vt(e){return typeof e=="string"||Array.isArray(e)}const pn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mn=["initial",...pn];function Kt(e){return Yt(e.animate)||mn.some(t=>vt(e[t]))}function es(e){return Boolean(Kt(e)||e.variants)}function Sa(e,t){if(Kt(e)){const{initial:n,animate:r}=e;return{initial:n===!1||vt(n)?n:void 0,animate:vt(r)?r:void 0}}return e.inherit!==!1?t:{}}function Ca(e){const{initial:t,animate:n}=Sa(e,x.useContext(zt));return x.useMemo(()=>({initial:t,animate:n}),[ts(t),ts(n)])}function ts(e){return Array.isArray(e)?e.join(" "):e}const Pa=Symbol.for("motionComponentSymbol");function rt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ea(e,t,n){return x.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):rt(n)&&(n.current=r))},[t])}const gn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ns="data-"+gn("framerAppearId"),{schedule:yn,cancel:Ud}=Gr(queueMicrotask,!1),rs=x.createContext({});function ja(e,t,n,r,s){var i,o;const{visualElement:a}=x.useContext(zt),l=x.useContext(Xr),c=x.useContext(Ft),u=x.useContext(un).reducedMotion,f=x.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,m=x.useContext(rs);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Aa(f.current,n,s,m);const y=x.useRef(!1);x.useInsertionEffect(()=>{h&&y.current&&h.update(n,c)});const v=n[ns],S=x.useRef(Boolean(v)&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,v))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,v)));return Kr(()=>{h&&(y.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),yn.render(h.render),S.current&&h.animationState&&h.animationState.animateChanges())}),x.useEffect(()=>{h&&(!S.current&&h.animationState&&h.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,v)}),S.current=!1))}),h}function Aa(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ss(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||a&&rt(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function ss(e){if(e)return e.options.allowProjection!==!1?e.projection:ss(e.parent)}function Ma({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&va(e);function a(c,u){let f;const h={...x.useContext(un),...c,layoutId:Ra(c)},{isStatic:m}=h,y=Ca(c),v=r(c,m);if(!m&&fn){Va(h,e);const S=Da(h);f=S.MeasureLayout,y.visualElement=ja(s,v,h,t,S.ProjectionNode)}return p.exports.jsxs(zt.Provider,{value:y,children:[f&&y.visualElement?p.exports.jsx(f,{visualElement:y.visualElement,...h}):null,n(s,c,Ea(v,y.visualElement,u),v,m,y.visualElement)]})}a.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const l=x.forwardRef(a);return l[Pa]=s,l}function Ra({layoutId:e}){const t=x.useContext(ln).id;return t&&e!==void 0?t+"-"+e:e}function Va(e,t){const n=x.useContext(Xr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?et(!1,r):Fe(!1,r)}}function Da(e){const{drag:t,layout:n}=nt;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const is=e=>t=>typeof t=="string"&&t.startsWith(e),vn=is("--"),Oa=is("var(--"),xn=e=>Oa(e)?La.test(e.split("/*")[0].trim()):!1,La=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,xt={};function ka(e){for(const t in e)xt[t]=e[t],vn(t)&&(xt[t].isCSSVariable=!0)}const st=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],He=new Set(st);function os(e,{layout:t,layoutId:n}){return He.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!xt[e]||e==="opacity")}const Se=e=>Boolean(e&&e.getVelocity),as=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ie=(e,t,n)=>n>t?t:n<e?e:n,it={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},bt={...it,transform:e=>Ie(0,1,e)},Ht={...it,default:1},wt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ue=wt("deg"),Oe=wt("%"),_=wt("px"),_a=wt("vh"),Ia=wt("vw"),ls={...Oe,parse:e=>Oe.parse(e)/100,transform:e=>Oe.transform(e*100)},Na={borderWidth:_,borderTopWidth:_,borderRightWidth:_,borderBottomWidth:_,borderLeftWidth:_,borderRadius:_,radius:_,borderTopLeftRadius:_,borderTopRightRadius:_,borderBottomRightRadius:_,borderBottomLeftRadius:_,width:_,maxWidth:_,height:_,maxHeight:_,top:_,right:_,bottom:_,left:_,padding:_,paddingTop:_,paddingRight:_,paddingBottom:_,paddingLeft:_,margin:_,marginTop:_,marginRight:_,marginBottom:_,marginLeft:_,backgroundPositionX:_,backgroundPositionY:_},Fa={rotate:Ue,rotateX:Ue,rotateY:Ue,rotateZ:Ue,scale:Ht,scaleX:Ht,scaleY:Ht,scaleZ:Ht,skew:Ue,skewX:Ue,skewY:Ue,distance:_,translateX:_,translateY:_,translateZ:_,x:_,y:_,z:_,perspective:_,transformPerspective:_,opacity:bt,originX:ls,originY:ls,originZ:_},cs={...it,transform:Math.round},bn={...Na,...Fa,zIndex:cs,size:_,fillOpacity:bt,strokeOpacity:bt,numOctaves:cs},Ba={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$a=st.length;function Ua(e,t,n){let r="",s=!0;for(let i=0;i<$a;i++){const o=st[i],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=as(a,bn[o]);if(!l){s=!1;const u=Ba[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function wn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(He.has(l)){o=!0;continue}else if(vn(l)){s[l]=c;continue}else{const u=as(c,bn[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=Ua(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const Tn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function us(e,t,n){for(const r in t)!Se(t[r])&&!os(r,n)&&(e[r]=t[r])}function Wa({transformTemplate:e},t){return x.useMemo(()=>{const n=Tn();return wn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function za(e,t){const n=e.style||{},r={};return us(r,n,e),Object.assign(r,Wa(e,t)),r}function Ya(e,t){const n={},r=za(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Ka=["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 Sn(e){return typeof e!="string"||e.includes("-")?!1:!!(Ka.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ha={offset:"stroke-dashoffset",array:"stroke-dasharray"},qa={offset:"strokeDashoffset",array:"strokeDasharray"};function Ga(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Ha:qa;e[i.offset]=_.transform(-r);const o=_.transform(t),a=_.transform(n);e[i.array]=`${o} ${a}`}function fs(e,t,n){return typeof e=="string"?e:_.transform(t+n*e)}function Xa(e,t,n){const r=fs(t,e.x,e.width),s=fs(n,e.y,e.height);return`${r} ${s}`}function Cn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,f){if(wn(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:y}=e;h.transform&&(y&&(m.transform=h.transform),delete h.transform),y&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=Xa(y,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ga(h,o,a,l,!1)}const ds=()=>({...Tn(),attrs:{}}),Pn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Za(e,t,n,r){const s=x.useMemo(()=>{const i=ds();return Cn(i,t,Pn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};us(i,e.style,e),s.style={...i,...s.style}}return s}function Ja(e=!1){return(n,r,s,{latestValues:i},o)=>{const l=(Sn(n)?Za:Ya)(r,i,o,n),c=wa(r,typeof n=="string",e),u=n!==x.Fragment?{...c,...l,ref:s}:{},{children:f}=r,h=x.useMemo(()=>Se(f)?f.get():f,[f]);return x.createElement(n,{...u,children:h})}}function hs(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function En(e,t,n,r){if(typeof t=="function"){const[s,i]=hs(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=hs(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const jn=e=>Array.isArray(e),Qa=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),el=e=>jn(e)?e[e.length-1]||0:e;function qt(e){const t=Se(e)?e.get():e;return Qa(t)?t.toValue():t}function tl({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:nl(r,s,i,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const ps=e=>(t,n)=>{const r=x.useContext(zt),s=x.useContext(Ft),i=()=>tl(e,t,r,s);return n?i():cn(i)};function nl(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=qt(i[h]);let{initial:o,animate:a}=e;const l=Kt(e),c=es(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?a:o;if(f&&typeof f!="boolean"&&!Yt(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const y=En(e,h[m]);if(y){const{transitionEnd:v,transition:S,...b}=y;for(const P in b){let j=b[P];if(Array.isArray(j)){const D=u?j.length-1:0;j=j[D]}j!==null&&(s[P]=j)}for(const P in v)s[P]=v[P]}}}return s}function An(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(Se(s[o])||t.style&&Se(t.style[o])||os(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}const rl={useVisualState:ps({scrapeMotionValuesFromProps:An,createRenderState:Tn})};function ms(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function gs(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const ys=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 vs(e,t,n,r){gs(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(ys.has(s)?s:gn(s),t.attrs[s])}function xs(e,t,n){const r=An(e,t,n);for(const s in e)if(Se(e[s])||Se(t[s])){const i=st.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const bs=["x","y","width","height","cx","cy","r"],sl={useVisualState:ps({scrapeMotionValuesFromProps:xs,createRenderState:ds,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const a in s)if(He.has(a)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let a=0;a<bs.length;a++){const l=bs[a];e[l]!==t[l]&&(o=!0)}o&&se.read(()=>{ms(n,r),se.render(()=>{Cn(r,s,Pn(n.tagName),e.transformTemplate),vs(n,r)})})}})};function il(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...Sn(r)?sl:rl,preloadedFeatures:e,useRender:Ja(s),createVisualElement:t,Component:r};return Ma(o)}}function Tt(e,t,n){const r=e.getProps();return En(r,t,n!==void 0?n:r.custom,e)}const ol=dn(()=>window.ScrollTimeline!==void 0);class al{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>{if(ol()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ll extends al{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Mn(e,t){return e?e[t]||e.default||e:void 0}const Rn=2e4;function ws(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Rn;)t+=n,r=e.next(t);return t>=Rn?1/0:t}function Vn(e){return typeof e=="function"}function Ts(e,t){e.timeline=t,e.onfinish=null}const Dn=e=>Array.isArray(e)&&typeof e[0]=="number",cl={linearEasing:void 0};function ul(e,t){const n=dn(e);return()=>{var r;return(r=cl[t])!==null&&r!==void 0?r:n()}}const Gt=ul(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ss=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(tt(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function Cs(e){return Boolean(typeof e=="function"&&Gt()||!e||typeof e=="string"&&(e in On||Gt())||Dn(e)||Array.isArray(e)&&e.every(Cs))}const St=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,On={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:St([0,.65,.55,1]),circOut:St([.55,0,1,.45]),backIn:St([.31,.01,.66,-.59]),backOut:St([.33,1.53,.69,.99])};function Ps(e,t){if(e)return typeof e=="function"&&Gt()?Ss(e,t):Dn(e)?St(e):Array.isArray(e)?e.map(n=>Ps(n,t)||On.easeOut):On[e]}const Ve={x:!1,y:!1};function Es(){return Ve.x||Ve.y}function fl(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;t&&(s=t.current);const i=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function js(e,t){const n=fl(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function As(e){return!(e.pointerType==="touch"||Es())}function dl(e,t,n={}){const[r,s,i]=js(e,n),o=a=>{if(!As(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=f=>{As(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,s)};return r.forEach(a=>{a.addEventListener("pointerenter",o,s)}),i}function Xt(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const Ms=(e,t)=>t?e===t?!0:Ms(e,t.parentElement):!1,Ln=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,hl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pl(e){return hl.has(e.tagName)||e.tabIndex!==-1}const Ct=new WeakSet;function Rs(e){return t=>{t.key==="Enter"&&e(t)}}function kn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ml=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Rs(()=>{if(Ct.has(n))return;kn(n,"down");const s=Rs(()=>{kn(n,"up")}),i=()=>kn(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Vs(e){return Ln(e)&&!Es()}function gl(e,t,n={}){const[r,s,i]=js(e,n),o=a=>{const l=a.currentTarget;if(!l||!Vs(a)||Ct.has(l))return;Ct.add(l),Xt(a,"set");const c=t(l,a),u=(m,y)=>{l.removeEventListener("pointerup",f),l.removeEventListener("pointercancel",h),Xt(m,"release"),!(!Vs(m)||!Ct.has(l))&&(Ct.delete(l),typeof c=="function"&&c(m,{success:y}))},f=m=>{(m.isTrusted?yl(m,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(m,!1):u(m,!(l instanceof Element)||Ms(l,m.target))},h=m=>{u(m,!1)};l.addEventListener("pointerup",f,s),l.addEventListener("pointercancel",h,s),l.addEventListener("lostpointercapture",h,s)};return r.forEach(a=>{a=n.useGlobalTarget?window:a;let l=!1;a instanceof HTMLElement&&(l=!0,!pl(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",o,s),l&&a.addEventListener("focus",c=>ml(c,s),s)}),i}function yl(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function vl(e){return e==="x"||e==="y"?Ve[e]?null:(Ve[e]=!0,()=>{Ve[e]=!1}):Ve.x||Ve.y?null:(Ve.x=Ve.y=!0,()=>{Ve.x=Ve.y=!1})}const Ds=new Set(["width","height","top","left","right","bottom",...st]);let Zt;function xl(){Zt=void 0}const Le={now:()=>(Zt===void 0&&Le.set(we.isProcessing||qr.useManualTiming?we.timestamp:performance.now()),Zt),set:e=>{Zt=e,queueMicrotask(xl)}};function _n(e,t){e.indexOf(t)===-1&&e.push(t)}function In(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Nn{constructor(){this.subscriptions=[]}add(t){return _n(this.subscriptions,t),()=>In(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Os(e,t){return t?e*(1e3/t):0}const Ls=30,bl=e=>!isNaN(parseFloat(e));class wl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Le.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Le.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=bl(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Wt(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Nn);const r=this.events[t].add(n);return t==="change"?()=>{r(),se.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Le.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Ls)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ls);return Os(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pt(e,t){return new wl(e,t)}function Tl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pt(n))}function Sl(e,t){const n=Tt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=el(i[o]);Tl(e,o,a)}}function Cl(e){return Boolean(Se(e)&&e.add)}function Fn(e,t){const n=e.getValue("willChange");if(Cl(n))return n.add(t)}function ks(e){return e.props[ns]}const Pl={current:!1},_s=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,El=1e-7,jl=12;function Al(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=_s(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>El&&++a<jl);return o}function Et(e,t,n,r){if(e===t&&n===r)return je;const s=i=>Al(i,0,1,e,n);return i=>i===0||i===1?i:_s(s(i),t,r)}const Is=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ns=e=>t=>1-e(1-t),Fs=Et(.33,1.53,.69,.99),Bn=Ns(Fs),Bs=Is(Bn),$s=e=>(e*=2)<1?.5*Bn(e):.5*(2-Math.pow(2,-10*(e-1))),$n=e=>1-Math.sin(Math.acos(e)),Us=Ns($n),Ws=Is($n),zs=e=>/^0[^.\s]+$/u.test(e);function Ml(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||zs(e):!0}const jt=e=>Math.round(e*1e5)/1e5,Un=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Rl(e){return e==null}const Vl=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wn=(e,t)=>n=>Boolean(typeof n=="string"&&Vl.test(n)&&n.startsWith(e)||t&&!Rl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ys=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Un);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Dl=e=>Ie(0,255,e),zn={...it,transform:e=>Math.round(Dl(e))},qe={test:Wn("rgb","red"),parse:Ys("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+zn.transform(e)+", "+zn.transform(t)+", "+zn.transform(n)+", "+jt(bt.transform(r))+")"};function Ol(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Yn={test:Wn("#"),parse:Ol,transform:qe.transform},ot={test:Wn("hsl","hue"),parse:Ys("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Oe.transform(jt(t))+", "+Oe.transform(jt(n))+", "+jt(bt.transform(r))+")"},Ce={test:e=>qe.test(e)||Yn.test(e)||ot.test(e),parse:e=>qe.test(e)?qe.parse(e):ot.test(e)?ot.parse(e):Yn.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?qe.transform(e):ot.transform(e)},Ll=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kl(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Un))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Ll))===null||n===void 0?void 0:n.length)||0)>0}const Ks="number",Hs="color",_l="var",Il="var(",qs="${}",Nl=/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 At(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(Nl,l=>(Ce.test(l)?(r.color.push(i),s.push(Hs),n.push(Ce.parse(l))):l.startsWith(Il)?(r.var.push(i),s.push(_l),n.push(l)):(r.number.push(i),s.push(Ks),n.push(parseFloat(l))),++i,qs)).split(qs);return{values:n,split:a,indexes:r,types:s}}function Gs(e){return At(e).values}function Xs(e){const{split:t,types:n}=At(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const a=n[o];a===Ks?i+=jt(s[o]):a===Hs?i+=Ce.transform(s[o]):i+=s[o]}return i}}const Fl=e=>typeof e=="number"?0:e;function Bl(e){const t=Gs(e);return Xs(e)(t.map(Fl))}const We={test:kl,parse:Gs,createTransformer:Xs,getAnimatableNone:Bl},$l=new Set(["brightness","contrast","saturate","opacity"]);function Ul(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Un)||[];if(!r)return e;const s=n.replace(r,"");let i=$l.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Wl=/\b([a-z-]*)\(.*?\)/gu,Kn={...We,getAnimatableNone:e=>{const t=e.match(Wl);return t?t.map(Ul).join(" "):e}},zl={...bn,color:Ce,backgroundColor:Ce,outlineColor:Ce,fill:Ce,stroke:Ce,borderColor:Ce,borderTopColor:Ce,borderRightColor:Ce,borderBottomColor:Ce,borderLeftColor:Ce,filter:Kn,WebkitFilter:Kn},Hn=e=>zl[e];function Zs(e,t){let n=Hn(e);return n!==Kn&&(n=We),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Yl=new Set(["auto","none","0"]);function Kl(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Yl.has(i)&&At(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=Zs(n,s)}const Js=e=>e===it||e===_,Qs=(e,t)=>parseFloat(e.split(", ")[t]),ei=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Qs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Qs(i[1],e):0}},Hl=new Set(["x","y","z"]),ql=st.filter(e=>!Hl.has(e));function Gl(e){const t=[];return ql.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const at={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:ei(4,13),y:ei(5,14)};at.translateX=at.x,at.translateY=at.y;const Ge=new Set;let qn=!1,Gn=!1;function ti(){if(Gn){const e=Array.from(Ge).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Gl(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Gn=!1,qn=!1,Ge.forEach(e=>e.complete()),Ge.clear()}function ni(){Ge.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Gn=!0)})}function Xl(){ni(),ti()}class Xn{constructor(t,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ge.add(this),qn||(qn=!0,se.read(ni),se.resolveKeyframes(ti))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const o=s==null?void 0:s.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),s&&o===void 0&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ge.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ge.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ri=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Zl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jl(e){const t=Zl.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Ql=4;function si(e,t,n=1){Fe(n<=Ql,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=Jl(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return ri(o)?parseFloat(o):o}return xn(s)?si(s,t,n+1):s}const ii=e=>t=>t.test(e),oi=[it,_,Oe,Ue,Ia,_a,{test:e=>e==="auto",parse:e=>e}],ai=e=>oi.find(ii(e));class li extends Xn{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),xn(c))){const u=si(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Ds.has(r)||t.length!==2)return;const[s,i]=t,o=ai(s),a=ai(i);if(o!==a)if(Js(o)&&Js(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)Ml(t[s])&&r.push(s);r.length&&Kl(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=at[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=at[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const ci=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(We.test(e)||e==="0")&&!e.startsWith("url("));function ec(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function tc(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=ci(s,t),a=ci(i,t);return et(o===a,`You are trying to animate ${t} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:ec(e)||(n==="spring"||Vn(n))&&r}const nc=e=>e!==null;function Jt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(nc),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const rc=40;class ui{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Le.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>rc?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Xl(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Le.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!tc(t,r,s,i))if(o)this.options.duration=0;else{l&&l(Jt(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Mt={layout:0,mainThread:0,waapi:0},oe=(e,t,n)=>e+(t-e)*n;function Zn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function sc({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Zn(l,a,e+1/3),i=Zn(l,a,e),o=Zn(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Qt(e,t){return n=>n>0?t:e}const Jn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},ic=[Yn,qe,ot],oc=e=>ic.find(t=>t.test(e));function fi(e){const t=oc(e);if(et(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===ot&&(n=sc(n)),n}const di=(e,t)=>{const n=fi(e),r=fi(t);if(!n||!r)return Qt(e,t);const s={...n};return i=>(s.red=Jn(n.red,r.red,i),s.green=Jn(n.green,r.green,i),s.blue=Jn(n.blue,r.blue,i),s.alpha=oe(n.alpha,r.alpha,i),qe.transform(s))},ac=(e,t)=>n=>t(e(n)),Rt=(...e)=>e.reduce(ac),Qn=new Set(["none","hidden"]);function lc(e,t){return Qn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function cc(e,t){return n=>oe(e,t,n)}function er(e){return typeof e=="number"?cc:typeof e=="string"?xn(e)?Qt:Ce.test(e)?di:dc:Array.isArray(e)?hi:typeof e=="object"?Ce.test(e)?di:uc:Qt}function hi(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>er(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function uc(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=er(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function fc(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],a=e.indexes[o][s[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[i]=l,s[o]++}return r}const dc=(e,t)=>{const n=We.createTransformer(t),r=At(e),s=At(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Qn.has(e)&&!s.values.length||Qn.has(t)&&!r.values.length?lc(e,t):Rt(hi(fc(r,s),s.values),n):(et(!0,`Complex values '${e}' and '${t}' 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.`),Qt(e,t))};function pi(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?oe(e,t,n):er(e)(e,t)}const hc=5;function mi(e,t,n){const r=Math.max(t-hc,0);return Os(n-e(r),t-r)}const ae={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},tr=.001;function pc({duration:e=ae.duration,bounce:t=ae.bounce,velocity:n=ae.velocity,mass:r=ae.mass}){let s,i;et(e<=De(ae.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Ie(ae.minDamping,ae.maxDamping,o),e=Ie(ae.minDuration,ae.maxDuration,_e(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,m=nr(c,o),y=Math.exp(-f);return tr-h/m*y},i=c=>{const f=c*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-f),v=nr(Math.pow(c,2),o);return(-s(c)+tr>0?-1:1)*((h-m)*y)/v}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-tr+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=gc(s,i,a);if(e=De(e),isNaN(l))return{stiffness:ae.stiffness,damping:ae.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const mc=12;function gc(e,t,n){let r=n;for(let s=1;s<mc;s++)r=r-e(r)/t(r);return r}function nr(e,t){return e*Math.sqrt(1-t*t)}const yc=["duration","bounce"],vc=["stiffness","damping","mass"];function gi(e,t){return t.some(n=>e[n]!==void 0)}function xc(e){let t={velocity:ae.velocity,stiffness:ae.stiffness,damping:ae.damping,mass:ae.mass,isResolvedFromDuration:!1,...e};if(!gi(e,vc)&&gi(e,yc))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ie(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ae.mass,stiffness:s,damping:i}}else{const n=pc(e);t={...t,...n,mass:ae.mass},t.isResolvedFromDuration=!0}return t}function yi(e=ae.visualDuration,t=ae.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:m}=xc({...n,velocity:-_e(n.velocity||0)}),y=h||0,v=c/(2*Math.sqrt(l*u)),S=o-i,b=_e(Math.sqrt(l/u)),P=Math.abs(S)<5;r||(r=P?ae.restSpeed.granular:ae.restSpeed.default),s||(s=P?ae.restDelta.granular:ae.restDelta.default);let j;if(v<1){const g=nr(b,v);j=O=>{const Y=Math.exp(-v*b*O);return o-Y*((y+v*b*S)/g*Math.sin(g*O)+S*Math.cos(g*O))}}else if(v===1)j=g=>o-Math.exp(-b*g)*(S+(y+b*S)*g);else{const g=b*Math.sqrt(v*v-1);j=O=>{const Y=Math.exp(-v*b*O),k=Math.min(g*O,300);return o-Y*((y+v*b*S)*Math.sinh(k)+g*S*Math.cosh(k))/g}}const D={calculatedDuration:m&&f||null,next:g=>{const O=j(g);if(m)a.done=g>=f;else{let Y=0;v<1&&(Y=g===0?De(y):mi(j,g,O));const k=Math.abs(Y)<=r,ee=Math.abs(o-O)<=s;a.done=k&&ee}return a.value=a.done?o:O,a},toString:()=>{const g=Math.min(ws(D),Rn),O=Ss(Y=>D.next(g*Y).value,g,30);return g+"ms "+O}};return D}function vi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},m=k=>a!==void 0&&k<a||l!==void 0&&k>l,y=k=>a===void 0?l:l===void 0||Math.abs(a-k)<Math.abs(l-k)?a:l;let v=n*t;const S=f+v,b=o===void 0?S:o(S);b!==S&&(v=b-f);const P=k=>-v*Math.exp(-k/r),j=k=>b+P(k),D=k=>{const ee=P(k),M=j(k);h.done=Math.abs(ee)<=c,h.value=h.done?b:M};let g,O;const Y=k=>{m(h.value)&&(g=k,O=yi({keyframes:[h.value,y(h.value)],velocity:mi(j,k,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return Y(0),{calculatedDuration:null,next:k=>{let ee=!1;return!O&&g===void 0&&(ee=!0,D(k),Y(k)),g!==void 0&&k>=g?O.next(k-g):(!ee&&D(k),h)}}}const bc=Et(.42,0,1,1),wc=Et(0,0,.58,1),xi=Et(.42,0,.58,1),Tc=e=>Array.isArray(e)&&typeof e[0]!="number",bi={linear:je,easeIn:bc,easeInOut:xi,easeOut:wc,circIn:$n,circInOut:Ws,circOut:Us,backIn:Bn,backInOut:Bs,backOut:Fs,anticipate:$s},wi=e=>{if(Dn(e)){Fe(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return Et(t,n,r,s)}else if(typeof e=="string")return Fe(bi[e]!==void 0,`Invalid easing type '${e}'`),bi[e];return e};function Sc(e,t,n){const r=[],s=n||pi,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||je:t;a=Rt(l,a)}r.push(a)}return r}function Cc(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Fe(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Sc(t,r,s),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=tt(e[f],e[f+1],u);return a[f](h)};return n?u=>c(Ie(e[0],e[i-1],u)):c}function Pc(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=tt(0,t,r);e.push(oe(n,1,s))}}function Ec(e){const t=[0];return Pc(t,e.length-1),t}function jc(e,t){return e.map(n=>n*t)}function Ac(e,t){return e.map(()=>t||xi).splice(0,e.length-1)}function Vt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Tc(r)?r.map(wi):wi(r),i={done:!1,value:t[0]},o=jc(n&&n.length===t.length?n:Ec(t),e),a=Cc(o,t,{ease:Array.isArray(s)?s:Ac(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const Mc=e=>{const t=({timestamp:n})=>e(n);return{start:()=>se.update(t,!0),stop:()=>$e(t),now:()=>we.isProcessing?we.timestamp:Le.now()}},Rc={decay:vi,inertia:vi,tween:Vt,keyframes:Vt,spring:yi},Vc=e=>e/100;class rr extends ui{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||Xn,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(i,a,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,a=Vn(n)?n:Rc[n]||Vt;let l,c;process.env.NODE_ENV!=="production"&&a!==Vt&&Fe(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a!==Vt&&typeof t[0]!="number"&&(l=Rt(Vc,pi(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});i==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ws(u));const{calculatedDuration:f}=u,h=f+s,m=h*(r+1)-s;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;Mt.mainThread++,this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:k}=this.options;return{done:!0,value:k[k.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:m,repeatType:y,repeatDelay:v,onUpdate:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-h*(this.speed>=0?1:-1),P=this.speed>=0?b<0:b>u;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let j=this.currentTime,D=i;if(m){const k=Math.min(this.currentTime,u)/f;let ee=Math.floor(k),M=k%1;!M&&k>=1&&(M=1),M===1&&ee--,ee=Math.min(ee,m+1),Boolean(ee%2)&&(y==="reverse"?(M=1-M,v&&(M-=v/f)):y==="mirror"&&(D=o)),j=Ie(0,1,M)*f}const g=P?{done:!1,value:l[0]}:D.next(j);a&&(g.value=a(g.value));let{done:O}=g;!P&&c!==null&&(O=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const Y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return Y&&s!==void 0&&(g.value=Jt(l,this.options,s)),S&&S(g.value),Y&&this.finish(),g}get duration(){const{resolved:t}=this;return t?_e(t.calculatedDuration):0}get time(){return _e(this.currentTime)}set time(t){t=De(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=_e(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Mc,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel(),Mt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Dc=new Set(["opacity","clipPath","filter","transform"]);function Oc(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Ps(a,s);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Lc=dn(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),en=10,kc=2e4;function _c(e){return Vn(e.type)||e.type==="spring"||!Cs(e.ease)}function Ic(e,t){const n=new rr({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&i<kc;)r=n.sample(i),s.push(r.value),i+=en;return{times:void 0,keyframes:s,duration:i-en,ease:"linear"}}const Ti={anticipate:$s,backInOut:Bs,circInOut:Ws};function Nc(e){return e in Ti}class Si extends ui{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new li(i,(o,a)=>this.onKeyframesResolved(o,a),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof i=="string"&&Gt()&&Nc(i)&&(i=Ti[i]),_c(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:y,...v}=this.options,S=Ic(t,v);t=S.keyframes,t.length===1&&(t[1]=t[0]),r=S.duration,s=S.times,i=S.ease,o="keyframes"}const u=Oc(a.owner.current,l,t,{...this.options,duration:r,times:s,ease:i});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(Ts(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;a.set(Jt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:s,type:o,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return _e(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return _e(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=De(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return je;const{animation:r}=n;Ts(r,t)}return je}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...m}=this.options,y=new rr({...m,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),v=De(this.time);c.setWithVelocity(y.sample(v-en).value,y.sample(v).value,en)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return Lc()&&r&&Dc.has(r)&&!l&&!c&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}const Fc={type:"spring",stiffness:500,damping:25,restSpeed:10},Bc=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),$c={type:"keyframes",duration:.8},Uc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Wc=(e,{keyframes:t})=>t.length>2?$c:He.has(e)?e.startsWith("scale")?Bc(t[1]):Fc:Uc;function zc({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const sr=(e,t,n,r={},s,i)=>o=>{const a=Mn(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-De(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};zc(a)||(u={...u,...Wc(e,u)}),u.duration&&(u.duration=De(u.duration)),u.repeatDelay&&(u.repeatDelay=De(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),(Pl.current||qr.skipAnimations)&&(f=!0,u.duration=0,u.delay=0),f&&!i&&t.get()!==void 0){const h=Jt(u.keyframes,a);if(h!==void 0)return se.update(()=>{u.onUpdate(h),u.onComplete()}),new ll([])}return!i&&Si.supports(u)?new Si(u):new rr(u)};function Yc({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ci(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),m=l[f];if(m===void 0||u&&Yc(u,f))continue;const y={delay:n,...Mn(o||{},f)};let v=!1;if(window.MotionHandoffAnimation){const b=ks(e);if(b){const P=window.MotionHandoffAnimation(b,f,se);P!==null&&(y.startTime=P,v=!0)}}Fn(e,f),h.start(sr(f,h,m,e.shouldReduceMotion&&Ds.has(f)?{type:!1}:y,e,v));const S=h.animation;S&&c.push(S)}return a&&Promise.all(c).then(()=>{se.update(()=>{a&&Sl(e,a)})}),c}function ir(e,t,n={}){var r;const s=Tt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(Ci(e,s,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=i;return Kc(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function Kc(e,t,n=0,r=0,s=1,i){const o=[],a=(e.variantChildren.size-1)*r,l=s===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(Hc).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(ir(c,t,{...i,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function Hc(e,t){return e.sortNodePosition(t)}function qc(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>ir(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=ir(e,t,n);else{const s=typeof t=="function"?Tt(e,t,n.custom):t;r=Promise.all(Ci(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Pi(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Gc=mn.length;function Ei(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ei(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Gc;n++){const r=mn[n],s=e.props[r];(vt(s)||s===!1)&&(t[r]=s)}return t}const Xc=[...pn].reverse(),Zc=pn.length;function Jc(e){return t=>Promise.all(t.map(({animation:n,options:r})=>qc(e,n,r)))}function Qc(e){let t=Jc(e),n=ji(),r=!0;const s=l=>(c,u)=>{var f;const h=Tt(e,u,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:y,...v}=h;c={...c,...v,...y}}return c};function i(l){t=l(e)}function o(l){const{props:c}=e,u=Ei(e.parent)||{},f=[],h=new Set;let m={},y=1/0;for(let S=0;S<Zc;S++){const b=Xc[S],P=n[b],j=c[b]!==void 0?c[b]:u[b],D=vt(j),g=b===l?P.isActive:null;g===!1&&(y=S);let O=j===u[b]&&j!==c[b]&&D;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),P.protectedKeys={...m},!P.isActive&&g===null||!j&&!P.prevProp||Yt(j)||typeof j=="boolean")continue;const Y=eu(P.prevProp,j);let k=Y||b===l&&P.isActive&&!O&&D||S>y&&D,ee=!1;const M=Array.isArray(j)?j:[j];let q=M.reduce(s(b),{});g===!1&&(q={});const{prevResolvedValues:ie={}}=P,W={...ie,...q},ce=X=>{k=!0,h.has(X)&&(ee=!0,h.delete(X)),P.needsAnimating[X]=!0;const ue=e.getValue(X);ue&&(ue.liveStyle=!1)};for(const X in W){const ue=q[X],ve=ie[X];if(m.hasOwnProperty(X))continue;let w=!1;jn(ue)&&jn(ve)?w=!Pi(ue,ve):w=ue!==ve,w?ue!=null?ce(X):h.add(X):ue!==void 0&&h.has(X)?ce(X):P.protectedKeys[X]=!0}P.prevProp=j,P.prevResolvedValues=q,P.isActive&&(m={...m,...q}),r&&e.blockInitialAnimation&&(k=!1),k&&(!(O&&Y)||ee)&&f.push(...M.map(X=>({animation:X,options:{type:b}})))}if(h.size){const S={};if(typeof c.initial!="boolean"){const b=Tt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(S.transition=b.transition)}h.forEach(b=>{const P=e.getBaseTarget(b),j=e.getValue(b);j&&(j.liveStyle=!0),S[b]=P??null}),f.push({animation:S})}let v=Boolean(f.length);return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,v?t(f):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(l,c)}),n[l].isActive=c;const f=o(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=ji(),r=!0}}}function eu(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Pi(t,e):!1}function Xe(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ji(){return{animate:Xe(!0),whileInView:Xe(),whileHover:Xe(),whileTap:Xe(),whileDrag:Xe(),whileFocus:Xe(),exit:Xe()}}class ze{constructor(t){this.isMounted=!1,this.node=t}update(){}}class tu extends ze{constructor(t){super(t),t.animationState||(t.animationState=Qc(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Yt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let nu=0;class ru extends ze{constructor(){super(...arguments),this.id=nu++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const su={animation:{Feature:tu},exit:{Feature:ru}};function Dt(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ot(e){return{point:{x:e.pageX,y:e.pageY}}}const iu=e=>t=>Ln(t)&&e(t,Ot(t));function lt(e,t,n,r){return Dt(e,t,iu(n),r)}function Ai({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ou({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function au(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Mi=1e-4,lu=1-Mi,cu=1+Mi,Ri=.01,uu=0-Ri,fu=0+Ri;function Pe(e){return e.max-e.min}function du(e,t,n){return Math.abs(e-t)<=n}function Vi(e,t,n,r=.5){e.origin=r,e.originPoint=oe(t.min,t.max,e.origin),e.scale=Pe(n)/Pe(t),e.translate=oe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=lu&&e.scale<=cu||isNaN(e.scale))&&(e.scale=1),(e.translate>=uu&&e.translate<=fu||isNaN(e.translate))&&(e.translate=0)}function Lt(e,t,n,r){Vi(e.x,t.x,n.x,r?r.originX:void 0),Vi(e.y,t.y,n.y,r?r.originY:void 0)}function Di(e,t,n){e.min=n.min+t.min,e.max=e.min+Pe(t)}function hu(e,t,n){Di(e.x,t.x,n.x),Di(e.y,t.y,n.y)}function Oi(e,t,n){e.min=t.min-n.min,e.max=e.min+Pe(t)}function kt(e,t,n){Oi(e.x,t.x,n.x),Oi(e.y,t.y,n.y)}const Li=()=>({translate:0,scale:1,origin:0,originPoint:0}),ct=()=>({x:Li(),y:Li()}),ki=()=>({min:0,max:0}),fe=()=>({x:ki(),y:ki()});function Ae(e){return[e("x"),e("y")]}function or(e){return e===void 0||e===1}function ar({scale:e,scaleX:t,scaleY:n}){return!or(e)||!or(t)||!or(n)}function Ze(e){return ar(e)||_i(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function _i(e){return Ii(e.x)||Ii(e.y)}function Ii(e){return e&&e!=="0%"}function tn(e,t,n){const r=e-n,s=t*r;return n+s}function Ni(e,t,n,r,s){return s!==void 0&&(e=tn(e,s,r)),tn(e,n,r)+t}function lr(e,t=0,n=1,r,s){e.min=Ni(e.min,t,n,r,s),e.max=Ni(e.max,t,n,r,s)}function Fi(e,{x:t,y:n}){lr(e.x,t.translate,t.scale,t.originPoint),lr(e.y,n.translate,n.scale,n.originPoint)}const Bi=.999999999999,$i=1.0000000000001;function pu(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&ft(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Fi(e,o)),r&&Ze(i.latestValues)&&ft(e,i.latestValues))}t.x<$i&&t.x>Bi&&(t.x=1),t.y<$i&&t.y>Bi&&(t.y=1)}function ut(e,t){e.min=e.min+t,e.max=e.max+t}function Ui(e,t,n,r,s=.5){const i=oe(e.min,e.max,s);lr(e,t,n,i,r)}function ft(e,t){Ui(e.x,t.x,t.scaleX,t.scale,t.originX),Ui(e.y,t.y,t.scaleY,t.scale,t.originY)}function Wi(e,t){return Ai(au(e.getBoundingClientRect(),t))}function mu(e,t,n){const r=Wi(e,n),{scroll:s}=t;return s&&(ut(r.x,s.offset.x),ut(r.y,s.offset.y)),r}const zi=(e,t)=>Math.abs(e-t);function gu(e,t){const n=zi(e.x,t.x),r=zi(e.y,t.y);return Math.sqrt(n**2+r**2)}class Yi{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=ur(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=gu(u.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=u,{timestamp:y}=we;this.history.push({...m,timestamp:y});const{onStart:v,onMove:S}=this.handlers;f||(v&&v(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,u)},this.handlePointerMove=(u,f)=>{if(u.target instanceof Element&&u.target.hasPointerCapture&&u.pointerId!==void 0)try{if(!u.target.hasPointerCapture(u.pointerId))return}catch{}this.lastMoveEvent=u,this.lastMoveEventInfo=cr(f,this.transformPagePoint),se.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{Xt(u,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=ur(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:cr(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,v),m&&m(u,v)},!Ln(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=Ot(t),o=cr(i,this.transformPagePoint),{point:a}=o,{timestamp:l}=we;this.history=[{...a,timestamp:l}];const{onSessionStart:c}=n;c&&c(t,ur(o,this.history)),Xt(t,"set"),this.removeListeners=Rt(lt(t.currentTarget,"pointermove",this.handlePointerMove),lt(t.currentTarget,"pointerup",this.handlePointerUp),lt(t.currentTarget,"pointercancel",this.handlePointerUp),lt(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),$e(this.updatePoint)}}function cr(e,t){return t?{point:t(e.point)}:e}function Ki(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ur({point:e},t){return{point:e,delta:Ki(e,Hi(t)),offset:Ki(e,yu(t)),velocity:vu(t,.1)}}function yu(e){return e[0]}function Hi(e){return e[e.length-1]}function vu(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=Hi(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>De(t)));)n--;if(!r)return{x:0,y:0};const i=_e(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function xu(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?oe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?oe(n,e,r.max):Math.min(e,n)),e}function qi(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function bu(e,{top:t,left:n,bottom:r,right:s}){return{x:qi(e.x,n,s),y:qi(e.y,t,r)}}function Gi(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function wu(e,t){return{x:Gi(e.x,t.x),y:Gi(e.y,t.y)}}function Tu(e,t){let n=.5;const r=Pe(e),s=Pe(t);return s>r?n=tt(t.min,t.max-r,e.min):r>s&&(n=tt(e.min,e.max-s,t.min)),Ie(0,1,n)}function Su(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fr=.35;function Cu(e=fr){return e===!1?e=0:e===!0&&(e=fr),{x:Xi(e,"left","right"),y:Xi(e,"top","bottom")}}function Xi(e,t,n){return{min:Zi(e,t),max:Zi(e,n)}}function Zi(e,t){return typeof e=="number"?e:e[t]||0}const Pu=new WeakMap;class Eu{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ot(u).point)},i=(u,f)=>{const{drag:h,dragPropagation:m,onDragStart:y}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vl(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ae(S=>{let b=this.getAxisMotionValue(S).get()||0;if(Oe.test(b)){const{projection:P}=this.visualElement;if(P&&P.layout){const j=P.layout.layoutBox[S];j&&(b=Pe(j)*(parseFloat(b)/100))}}this.originPoint[S]=b}),y&&se.postRender(()=>y(u,f)),Fn(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:y,onDrag:v}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:S}=f;if(m&&this.currentDirection===null){this.currentDirection=ju(S),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",f.point,S),this.updateAxis("y",f.point,S),this.visualElement.render(),v&&v(u,f)},a=(u,f)=>this.stop(u,f),l=()=>Ae(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Yi(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&se.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!nn(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=xu(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&rt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=bu(s.layoutBox,n):this.constraints=!1,this.elastic=Cu(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ae(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Su(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!rt(t))return!1;const r=t.current;Fe(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=mu(r,s.root,this.visualElement.getTransformPagePoint());let o=wu(s.layout.layoutBox,i);if(n){const a=n(ou(o));this.hasMutatedConstraints=!!a,a&&(o=Ai(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Ae(u=>{if(!nn(u,n,this.currentDirection))return;let f=l&&l[u]||{};o&&(f={min:0,max:0});const h=s?200:1e6,m=s?40:1e7,y={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,y)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Fn(this.visualElement,t),r.start(sr(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ae(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ae(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ae(n=>{const{drag:r}=this.getProps();if(!nn(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(t[n]-oe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!rt(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ae(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=Tu({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ae(o=>{if(!nn(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(oe(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;Pu.set(this.visualElement,this);const t=this.visualElement.current,n=lt(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();rt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),se.read(r);const o=Dt(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Ae(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=fr,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function nn(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ju(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Au extends ze{constructor(t){super(t),this.removeGroupControls=je,this.removeListeners=je,this.controls=new Eu(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||je}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ji=e=>(t,n)=>{e&&se.postRender(()=>e(t,n))};class Mu extends ze{constructor(){super(...arguments),this.removePointerDownListener=je}onPointerDown(t){this.session=new Yi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Ji(t),onStart:Ji(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&se.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=lt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const rn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Qi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const _t={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_.test(e))e=parseFloat(e);else return e;const n=Qi(e,t.target.x),r=Qi(e,t.target.y);return`${n}% ${r}%`}},Ru={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=We.parse(e);if(s.length>5)return r;const i=We.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=oe(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}};class Vu extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;ka(Du),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),rn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||se.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),yn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function eo(e){const[t,n]=zr(),r=x.useContext(ln);return p.exports.jsx(Vu,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(rs),isPresent:t,safeToRemove:n})}const Du={borderRadius:{..._t,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_t,borderTopRightRadius:_t,borderBottomLeftRadius:_t,borderBottomRightRadius:_t,boxShadow:Ru};function Ou(e,t,n){const r=Se(e)?e:Pt(e);return r.start(sr("",r,t,n)),r.animation}function Lu(e){return e instanceof SVGElement&&e.tagName!=="svg"}const ku=(e,t)=>e.depth-t.depth;class _u{constructor(){this.children=[],this.isDirty=!1}add(t){_n(this.children,t),this.isDirty=!0}remove(t){In(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ku),this.isDirty=!1,this.children.forEach(t)}}function Iu(e,t){const n=Le.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&($e(r),e(i-t))};return se.read(r,!0),()=>$e(r)}const to=["TopLeft","TopRight","BottomLeft","BottomRight"],Nu=to.length,no=e=>typeof e=="string"?parseFloat(e):e,ro=e=>typeof e=="number"||_.test(e);function Fu(e,t,n,r,s,i){s?(e.opacity=oe(0,n.opacity!==void 0?n.opacity:1,Bu(r)),e.opacityExit=oe(t.opacity!==void 0?t.opacity:1,0,$u(r))):i&&(e.opacity=oe(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Nu;o++){const a=`border${to[o]}Radius`;let l=so(t,a),c=so(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||ro(l)===ro(c)?(e[a]=Math.max(oe(no(l),no(c),r),0),(Oe.test(c)||Oe.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=oe(t.rotate||0,n.rotate||0,r))}function so(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Bu=io(0,.5,Us),$u=io(.5,.95,je);function io(e,t,n){return r=>r<e?0:r>t?1:n(tt(e,t,r))}function oo(e,t){e.min=t.min,e.max=t.max}function Me(e,t){oo(e.x,t.x),oo(e.y,t.y)}function ao(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function lo(e,t,n,r,s){return e-=t,e=tn(e,1/n,r),s!==void 0&&(e=tn(e,1/s,r)),e}function Uu(e,t=0,n=1,r=.5,s,i=e,o=e){if(Oe.test(t)&&(t=parseFloat(t),t=oe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=oe(i.min,i.max,r);e===i&&(a-=t),e.min=lo(e.min,t,n,a,s),e.max=lo(e.max,t,n,a,s)}function co(e,t,[n,r,s],i,o){Uu(e,t[n],t[r],t[s],t.scale,i,o)}const Wu=["x","scaleX","originX"],zu=["y","scaleY","originY"];function uo(e,t,n,r){co(e.x,t,Wu,n?n.x:void 0,r?r.x:void 0),co(e.y,t,zu,n?n.y:void 0,r?r.y:void 0)}function fo(e){return e.translate===0&&e.scale===1}function ho(e){return fo(e.x)&&fo(e.y)}function po(e,t){return e.min===t.min&&e.max===t.max}function Yu(e,t){return po(e.x,t.x)&&po(e.y,t.y)}function mo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function go(e,t){return mo(e.x,t.x)&&mo(e.y,t.y)}function yo(e){return Pe(e.x)/Pe(e.y)}function vo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ku{constructor(){this.members=[]}add(t){_n(this.members,t),t.scheduleRender()}remove(t){if(In(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Hu(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:h,skewX:m,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Je={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},dr=["","X","Y","Z"],qu={visibility:"hidden"},xo=1e3;let Gu=0;function hr(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function bo(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ks(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",se,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&bo(r)}function wo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Gu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Be.value&&(Je.nodes=Je.calculatedTargetDeltas=Je.calculatedProjections=0),this.nodes.forEach(Ju),this.nodes.forEach(rf),this.nodes.forEach(sf),this.nodes.forEach(Qu),Be.addProjectionMetrics&&Be.addProjectionMetrics(Je)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,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=!0;this.root===this&&(this.nodes=new _u)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Nn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Lu(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Iu(h,250),rn.hasAnimatedSinceResize&&(rn.hasAnimatedSinceResize=!1,this.nodes.forEach(So))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||uf,{onLayoutAnimationStart:S,onLayoutAnimationComplete:b}=u.getProps(),P=!this.targetLayout||!go(this.targetLayout,y),j=!h&&m;if(this.options.layoutRoot||this.resumeFrom||j||h&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,j);const D={...Mn(v,"layout"),onPlay:S,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else h||So(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,$e(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(of),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&bo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(To);return}this.isUpdating||this.nodes.forEach(tf),this.isUpdating=!1,this.nodes.forEach(nf),this.nodes.forEach(Xu),this.nodes.forEach(Zu),this.clearAllSnapshots();const a=Le.now();we.delta=Ie(0,1e3/60,a-we.timestamp),we.timestamp=a,we.isProcessing=!0,hn.update.process(we),hn.preRender.process(we),hn.render.process(we),we.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,yn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ef),this.sharedNodes.forEach(af)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,se.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){se.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pe(this.snapshot.measuredBox.x)&&!Pe(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();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=fe(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!ho(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(a||Ze(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),ff(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return fe();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(df))){const{scroll:u}=this.root;u&&(ut(l.x,u.offset.x),ut(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=fe();if(Me(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Me(l,o),ut(l.x,f.offset.x),ut(l.y,f.offset.y))}return l}applyTransform(o,a=!1){const l=fe();Me(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ft(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ze(u.latestValues)&&ft(l,u.latestValues)}return Ze(this.latestValues)&&ft(l,this.latestValues),l}removeTransform(o){const a=fe();Me(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Ze(c.latestValues))continue;ar(c.latestValues)&&c.updateSnapshot();const u=fe(),f=c.measurePageBox();Me(u,f),uo(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Ze(this.latestValues)&&uo(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==we.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=Boolean(this.resumingFrom)||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=we.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fe(),this.relativeTargetOrigin=fe(),kt(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Me(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=fe(),this.targetWithTransforms=fe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hu(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Me(this.target,this.layout.layoutBox),Fi(this.target,this.targetDelta)):Me(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&Boolean(m.resumingFrom)===Boolean(this.resumingFrom)&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fe(),this.relativeTargetOrigin=fe(),kt(this.relativeTargetOrigin,this.target,m.target),Me(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Be.value&&Je.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ar(this.parent.latestValues)||_i(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=Boolean(this.resumingFrom)||this!==a;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===we.timestamp&&(c=!1),c)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;Me(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;pu(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=fe());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ao(this.prevProjectionDelta.x,this.projectionDelta.x),ao(this.prevProjectionDelta.y,this.projectionDelta.y)),Lt(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!vo(this.projectionDelta.x,this.prevProjectionDelta.x)||!vo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y)),Be.value&&Je.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ct(),this.projectionDelta=ct(),this.projectionDeltaWithTransform=ct()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=ct();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=fe(),m=l?l.source:void 0,y=this.layout?this.layout.source:void 0,v=m!==y,S=this.getStack(),b=!S||S.members.length<=1,P=Boolean(v&&!b&&this.options.crossfade===!0&&!this.path.some(cf));this.animationProgress=0;let j;this.mixTargetDelta=D=>{const g=D/1e3;Co(f.x,o.x,g),Co(f.y,o.y,g),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(kt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),lf(this.relativeTarget,this.relativeTargetOrigin,h,g),j&&Yu(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=fe()),Me(j,this.relativeTarget)),v&&(this.animationValues=u,Fu(u,c,this.latestValues,g,P,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&($e(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=se.update(()=>{rn.hasAnimatedSinceResize=!0,Mt.layout++,this.currentAnimation=Ou(0,xo,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{Mt.layout--},onComplete:()=>{Mt.layout--,o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(xo),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Mo(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||fe();const f=Pe(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=Pe(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Me(a,l),ft(a,u),Lt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Ku),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&hr("z",o,c,this.animationValues);for(let u=0;u<dr.length;u++)hr(`rotate${dr[u]}`,o,c,this.animationValues),hr(`skew${dr[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return qu;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=qt(o==null?void 0:o.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const v={};return this.options.layoutId&&(v.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,v.pointerEvents=qt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ze(this.latestValues)&&(v.transform=u?u({},""):"none",this.hasProjected=!1),v}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Hu(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:m,y}=this.projectionDelta;c.transformOrigin=`${m.origin*100}% ${y.origin*100}% 0`,f.animationValues?c.opacity=f===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const v in xt){if(h[v]===void 0)continue;const{correct:S,applyTo:b,isCSSVariable:P}=xt[v],j=c.transform==="none"?h[v]:S(h[v],f);if(b){const D=b.length;for(let g=0;g<D;g++)c[b[g]]=j}else P?this.options.visualElement.renderState.vars[v]=j:c[v]=j}return this.options.layoutId&&(c.pointerEvents=f===this?qt(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(To),this.root.sharedNodes.clear()}}}function Xu(e){e.updateLayout()}function Zu(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?Ae(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Pe(h);h.min=r[f].min,h.max=h.min+m}):Mo(i,n.layoutBox,r)&&Ae(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Pe(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const a=ct();Lt(a,r,n.layoutBox);const l=ct();o?Lt(l,e.applyTransform(s,!0),n.measuredBox):Lt(l,r,n.layoutBox);const c=!ho(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const y=fe();kt(y,n.layoutBox,h.layoutBox);const v=fe();kt(v,r,m.layoutBox),go(y,v)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=y,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Ju(e){Be.value&&Je.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Qu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ef(e){e.clearSnapshot()}function To(e){e.clearMeasurements()}function tf(e){e.isLayoutDirty=!1}function nf(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function So(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rf(e){e.resolveTargetDelta()}function sf(e){e.calcProjection()}function of(e){e.resetSkewAndRotation()}function af(e){e.removeLeadSnapshot()}function Co(e,t,n){e.translate=oe(t.translate,0,n),e.scale=oe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Po(e,t,n,r){e.min=oe(t.min,n.min,r),e.max=oe(t.max,n.max,r)}function lf(e,t,n,r){Po(e.x,t.x,n.x,r),Po(e.y,t.y,n.y,r)}function cf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const uf={duration:.45,ease:[.4,0,.1,1]},Eo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),jo=Eo("applewebkit/")&&!Eo("chrome/")?Math.round:je;function Ao(e){e.min=jo(e.min),e.max=jo(e.max)}function ff(e){Ao(e.x),Ao(e.y)}function Mo(e,t,n){return e==="position"||e==="preserve-aspect"&&!du(yo(t),yo(n),.2)}function df(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const hf=wo({attachResizeListener:(e,t)=>Dt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pr={current:void 0},Ro=wo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pr.current){const e=new hf({});e.mount(window),e.setOptions({layoutScroll:!0}),pr.current=e}return pr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),pf={pan:{Feature:Mu},drag:{Feature:Au,ProjectionNode:Ro,MeasureLayout:eo}};function Vo(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&se.postRender(()=>i(t,Ot(t)))}class mf extends ze{mount(){const{current:t}=this.node;t&&(this.unmount=dl(t,(n,r)=>(Vo(this.node,r,"Start"),s=>Vo(this.node,s,"End"))))}unmount(){}}class gf extends ze{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Rt(Dt(this.node.current,"focus",()=>this.onFocus()),Dt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Do(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&se.postRender(()=>i(t,Ot(t)))}class yf extends ze{mount(){const{current:t}=this.node;t&&(this.unmount=gl(t,(n,r)=>(Do(this.node,r,"Start"),(s,{success:i})=>Do(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const mr=new WeakMap,gr=new WeakMap,vf=e=>{const t=mr.get(e.target);t&&t(e)},xf=e=>{e.forEach(vf)};function bf({root:e,...t}){const n=e||document;gr.has(n)||gr.set(n,{});const r=gr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(xf,{root:e,...t})),r[s]}function wf(e,t,n){const r=bf(t);return mr.set(e,n),r.observe(e),()=>{mr.delete(e),r.unobserve(e)}}const Tf={some:0,all:1};class Sf extends ze{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Tf[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=c?u:f;h&&h(l)};return wf(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Cf(t,n))&&this.startObserver()}unmount(){}}function Cf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Pf={inView:{Feature:Sf},tap:{Feature:yf},focus:{Feature:gf},hover:{Feature:mf}},Ef={layout:{ProjectionNode:Ro,MeasureLayout:eo}},yr={current:null},Oo={current:!1};function jf(){if(Oo.current=!0,!!fn)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yr.current=e.matches;e.addListener(t),t()}else yr.current=!1}const Af=[...oi,Ce,We],Mf=e=>Af.find(ii(e)),Rf=new WeakMap;function Vf(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Se(s))e.addValue(r,s),process.env.NODE_ENV==="development"&&Wt(s.version==="12.4.7",`Attempting to mix Motion versions ${s.version} with 12.4.7 may not work as expected.`);else if(Se(i))e.addValue(r,Pt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,Pt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Lo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Df{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Xn,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=()=>{const m=Le.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,se.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=Kt(n),this.isVariantNode=es(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const y=h[m];l[m]!==void 0&&Se(y)&&y.set(l[m],!1)}}mount(t){this.current=t,Rf.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Oo.current||jf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:yr.current,process.env.NODE_ENV!=="production"&&Wt(this.shouldReduceMotion!==!0,"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(),$e(this.notifyUpdate),$e(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=He.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&se.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in nt){const n=nt[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Lo.length;r++){const s=Lo[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Vf(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(ri(s)||zs(s))?s=parseFloat(s):!Mf(s)&&We.test(n)&&(s=Zs(t,n)),this.setBaseTarget(t,Se(s)?s.get():s)),Se(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=En(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Se(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Nn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class ko extends Df{constructor(){super(...arguments),this.KeyframeResolver=li}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Se(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Of(e){return window.getComputedStyle(e)}class Lf extends ko{constructor(){super(...arguments),this.type="html",this.renderInstance=gs}readValueFromInstance(t,n){if(He.has(n)){const r=Hn(n);return r&&r.default||0}else{const r=Of(t),s=(vn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Wi(t,n)}build(t,n,r){wn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return An(t,n,r)}}class kf extends ko{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fe,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&ms(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(He.has(n)){const r=Hn(n);return r&&r.default||0}return n=ys.has(n)?n:gn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return xs(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&se.postRender(this.updateDimensions)}build(t,n,r){Cn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){vs(t,n,r,s)}mount(t){this.isSVGTag=Pn(t.tagName),super.mount(t)}}const _f=(e,t)=>Sn(e)?new kf(t):new Lf(t,{allowProjection:e!==x.Fragment}),If=il({...su,...Pf,...pf,...Ef},_f),vr=Ta(If),Nf=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?p.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"absolute z-10 w-full md:inset-0 h-full max-h-full overflow-y-auto overflow-x-hidden flex justify-center items-center bg-[rgb(0,0,0,0.6)]",children:p.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:p.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[p.exports.jsxs("div",{className:"flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600 border-gray-200",children:[p.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),p.exports.jsxs("button",{type:"button",className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center",onClick:t,children:[p.exports.jsx("svg",{className:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:p.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),p.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),p.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:p.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),p.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[p.exports.jsx("button",{onClick:()=>{n(),t()},type:"button",className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",children:"Yes "}),p.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ml-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",children:"Cancel"})]})]})})}):null,Ff=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=x.useRef(null),[o,a]=x.useState(!1);return x.useEffect(()=>(i.current||(i.current=document.createElement("div"),i.current.style.zIndex="1500",i.current.style.position="fixed",i.current.style.top="0",i.current.style.left="0",i.current.style.width="100%",i.current.style.height="100%",i.current.style.pointerEvents="none",document.body.appendChild(i.current)),a(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:Ke.createPortal(p.exports.jsx(Hr,{children:t&&p.exports.jsx(vr.div,{initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:-10},transition:{duration:.2,ease:"easeOut"},className:"absolute z-50 bg-white shadow-lg rounded-md p-2 px-1 w-42 pointer-events-auto",style:{top:n.y,left:n.x},children:e.map((l,c)=>l!=null&&l.onlyCurrentUserMessage&&!s?null:p.exports.jsxs("button",{disabled:l==null?void 0:l.disabled,className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 disabled:opacity-20 hover:bg-gray-200",onClick:()=>l.onClick(r),children:[x.cloneElement(l.icon,{className:"text-black",size:18}),p.exports.jsx("span",{className:"ml-2 text-black",children:l.name})]},c))})}),i.current)},Bf=e=>{const t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},_o=e=>{const t=document.createElement("div");return t.innerHTML=e,t.querySelectorAll("span").forEach(r=>{var i;const s=((i=r.textContent)==null?void 0:i.replace(/\u00A0/g," ").trim().replace(/\s+/g,"-"))??"";r.replaceWith(s)}),t.innerHTML.replace(/&nbsp;/g," ")},$f=()=>p.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M9.77169 2.74358C12.1132 0.399998 15.9121 0.399998 18.2553 2.74314C20.5384 5.02621 20.5969 8.69142 18.4309 11.0454L18.2428 11.2427L9.44273 20.0409L9.40616 20.0712C7.94492 21.3879 5.69092 21.3432 4.28355 19.9358C2.96453 18.6168 2.84241 16.5541 3.9172 15.0974C3.94054 15.0521 3.96879 15.0083 4.002 14.9672L4.05556 14.9075L4.14247 14.8198L4.28355 14.6719L4.28647 14.6748L11.7222 7.22047C11.9881 6.95385 12.4047 6.92909 12.6986 7.14656L12.7829 7.21906C13.0495 7.48497 13.0742 7.9016 12.8568 8.19551L12.7843 8.27972L5.18966 15.8928C4.47202 16.7684 4.5219 18.0627 5.3393 18.8801C6.16836 19.7091 7.48801 19.7486 8.3638 18.9985L17.1965 10.1681C18.952 8.41041 18.952 5.56116 17.1946 3.8038C15.4922 2.10136 12.765 2.04816 10.9986 3.6442L10.8307 3.8038L10.8181 3.81812L1.28179 13.3544C0.988902 13.6473 0.514028 13.6473 0.221135 13.3544C-0.0451319 13.0882 -0.0693378 12.6715 0.148517 12.3779L0.221135 12.2938L9.77001 2.74314L9.77169 2.74358Z",fill:"#8A8A8A"})}),Uf=()=>p.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M13.25 9C13.6297 9 13.9435 9.28215 13.9932 9.64823L14 9.75V10.25C14 13.8094 11.245 16.7254 7.75098 16.9817L7.75 19.25C7.75 19.6642 7.41421 20 7 20C6.6203 20 6.30651 19.7178 6.25685 19.3518L6.25 19.25L6.25002 16.9818C2.83323 16.7316 0.122835 13.938 0.00406027 10.4863L0 10.25V9.75C0 9.33579 0.335786 9 0.75 9C1.1297 9 1.44349 9.28215 1.49315 9.64823L1.5 9.75V10.25C1.5 13.077 3.73445 15.3821 6.5336 15.4956L6.75 15.5H7.25C10.077 15.5 12.3821 13.2656 12.4956 10.4664L12.5 10.25V9.75C12.5 9.33579 12.8358 9 13.25 9ZM7 0C9.20914 0 11 1.79086 11 4V10C11 12.2091 9.20914 14 7 14C4.79086 14 3 12.2091 3 10V4C3 1.79086 4.79086 0 7 0ZM7 1.5C5.61929 1.5 4.5 2.61929 4.5 4V10C4.5 11.3807 5.61929 12.5 7 12.5C8.38071 12.5 9.5 11.3807 9.5 10V4C9.5 2.61929 8.38071 1.5 7 1.5Z",fill:"#fff"})}),xr=()=>p.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.exports.jsx("path",{d:"M10.8147 10.1974L3.28344 11.4526C3.10705 11.482 2.95979 11.6034 2.89723 11.7709L0.299335 18.7283C0.0506615 19.3678 0.720085 19.9778 1.33375 19.671L19.3337 10.671C19.8865 10.3946 19.8865 9.60573 19.3337 9.32933L1.33375 0.329334C0.720085 0.0225017 0.0506615 0.632543 0.299335 1.27199L2.89723 8.22938C2.95979 8.39691 3.10705 8.51827 3.28344 8.54767L10.8147 9.80287C10.9236 9.82103 10.9972 9.92408 10.9791 10.033C10.965 10.1173 10.899 10.1834 10.8147 10.1974Z",fill:"#fff"})}),sn=e=>p.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:p.exports.jsxs("g",{fill:"none",children:[p.exports.jsx("path",{className:"background",fill:"#ffffff",d:"M8,1 L9,1 L9,20 L8,20 L8,18 C7.807,15.161 7.124,12.233 5.950,9.218 C5.046,6.893 3.504,4.733 1.325,2.738 L1.325,2.738 C0.917,2.365 0.89,1.732 1.263,1.325 C1.452,1.118 1.72,1 2,1 L8,1 Z"}),p.exports.jsx("path",{className:"fill-gray-200",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0 L9,0 L9,20 L7,20 L7,20 L7.002,18.068 C6.816,15.333 6.156,12.504 5.018,9.58 C4.172,7.406 2.72,5.371 0.649,3.475 C-0.165,2.729 -0.221,1.464 0.525,0.649 C0.904,0.236 1.439,0 2,0 Z"}),p.exports.jsx("path",{className:"border_2x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.5 L9,0.5 L9,20 L7.5,20 L7.5,20 L7.501,18.034 C7.312,15.247 6.64,12.369 5.484,9.399 C4.609,7.15 3.112,5.052 0.987,3.106 C0.376,2.547 0.334,1.598 0.894,0.987 C1.178,0.677 1.579,0.5 2,0.5 Z"}),p.exports.jsx("path",{className:"border_3x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.667 L9,0.667 L9,20 L7.667,20 L7.667,20 L7.668,18.023 C7.477,15.218 6.802,12.324 5.64,9.338 C4.755,7.064 3.243,4.946 1.1,2.983 C0.557,2.486 0.52,1.643 1.017,1.1 C1.269,0.824 1.626,0.667 2,0.667 Z"})]})}),Wf=({onSendMessage:e,onEditMessage:t,onSendVoice:n,onImageSend:r,onVideoSend:s,onFileSend:i,dynamicSymbolAssignments:o,onDynamicSymbolListSet:a,onDynamicSymbolListDelete:l,messageToEdit:c,setMessageToEdit:u})=>{const[f,h]=x.useState(""),[m,y]=x.useState(!1),[v,S]=x.useState(0),[b,P]=x.useState(null),[j,D]=x.useState(null),[g,O]=x.useState(0),Y=x.useRef(null),k=x.useRef([]),ee=x.useRef(null),M=x.useRef(null),q=x.useRef(null),[ie,W]=x.useState(!1),[ce,ye]=x.useState([]),me=150,X=41.6;x.useEffect(()=>{const A=document.getElementById("static-display");A&&!A.textContent&&(c!=null&&c.text)&&(A.textContent=c==null?void 0:c.text)},[c==null?void 0:c.text]);const ue=A=>{c?u(L=>L?new yt({...L,text:A,isEdited:!0}):void 0):h(A);const V=A.match(/(\S+)$/);if(B(V),ce.length>0){const L=Array.from(A.matchAll(/<span[^>]*id=["']([^"']+)["'][^>]*>/g)).map(E=>E[1]);ye(E=>(E.filter(te=>!L.includes(te)).forEach(te=>{const xe=te.charAt(0),Te=te.slice(1);l==null||l(Te,xe)}),L))}if(M.current){const L=M.current.scrollHeight;Math.ceil(M.current.scrollHeight/L)-1,L>X?L>me?(M.current.style.height=`${me}px`,M.current.style.overflowY="auto"):(M.current.style.height=`${L}px`,M.current.style.overflowY="hidden"):(M.current.style.height=`${X}px`,M.current.style.overflowY="hidden")}},ve=()=>{if(c){const A=_o(c.text);if(A.trim()==="")return;t({...c,htmlContent:c.text,text:A}),u(void 0)}else h(A=>{const V=_o(A);return V.trim()===""?A:(console.log("htmlcontnent before",A),e(V,A),"")});P(null),D(null),M.current&&(M.current.style.height=`${X}px`,M.current.innerHTML="")},w=async()=>{y(!0),S(0),k.current=[],ee.current=setInterval(()=>{S(L=>L+1)},1e3);const A=await navigator.mediaDevices.getUserMedia({audio:!0}),V=new MediaRecorder(A);Y.current=V,V.ondataavailable=L=>{L.data.size>0&&k.current.push(L.data)},V.onstop=()=>{clearInterval(ee.current);const L=new Blob(k.current,{type:"audio/mp3"}),E=new File([L],"recording.mp3",{type:"audio/mp3"});n(E),y(!1)},V.start()},T=()=>{var A;(A=Y.current)==null||A.stop()},B=A=>{if(A){const V=A[0];if(b){const L=A[0].split(b)[1];D(L)}o!=null&&o.some(L=>L.symbol===V)&&P(V)}else P(null),D(null)},$=(A,V,L)=>{var Qe;if(!M.current)return;ye(Ye=>[...Ye,`${L+A}`]);let E=((Qe=M.current)==null?void 0:Qe.innerHTML)||"";const ne=E.match(/(\S+)$/);if(ne){const Ye=ne[0];E=E.slice(0,-Ye.length)}const te=`<span id="${L+A}" contentEditable="false" class="inline-flex items-center gap-1 px-2 pb-1 text-sm font-medium text-white bg-blue-500 rounded-full pointer-events-none select-none truncate max-w-[250px]">${L+V}</span>&nbsp;`;M.current.innerHTML=E+te;const xe=document.createTextNode("");M.current.appendChild(xe);const Te=window.getSelection(),dt=document.createRange();dt.setStart(xe,0),dt.collapse(!0),Te==null||Te.removeAllRanges(),Te==null||Te.addRange(dt);const on=M.current.innerHTML;ue(on),a&&a(V,A,L),P(null),D(null),setTimeout(()=>{var Ye;(Ye=M.current)==null||Ye.focus()},0)},I=A=>{const{scrollTop:V,scrollHeight:L,clientHeight:E}=A.currentTarget;if(V>g){if(V+E>=L-1){const te=o==null?void 0:o.find(xe=>xe.symbol===b);te&&(te!=null&&te.updatePageNumber)&&(W(!0),te==null||te.updatePageNumber(te.pagNumber+1),O(V),setTimeout(()=>{W(!1)},500))}}else O(V)},K=new Set(["jpeg","png","gif","webp","bmp","svg+xml","tiff","x-icon"]),N=new Set(["mp4","webm","ogg","mpeg","quicktime","x-msvideo","x-ms-wmv","3gpp","3gpp2"]),U=()=>{var A;(A=q.current)==null||A.click()},z=A=>{var E,ne;const V=(E=A.target.files)==null?void 0:E[0];if(!V)return;let L="";if(V.type){const te=V.type.split("/");te.length===2&&(L=te[1])}L||(L=((ne=V.name.split(".").pop())==null?void 0:ne.toLowerCase())||""),K.has(L)?r(V):N.has(L)?s(V):i(V)};return p.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[m?p.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[p.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:Bf(v)}),p.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:T,children:p.exports.jsx(xr,{})})]}):c?p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] relative h-10",children:[p.exports.jsxs("div",{className:" h-12 absolute bottom-10 w-full flex justify-between items-center px-2 border-t border-x border-gray-300 bg-white rounded-t-lg ",children:[p.exports.jsx("span",{id:"static-display",className:"text-gray-400 whitespace-nowrap truncate"}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700 -mt-4",onClick:()=>u(void 0),children:"✕"})]}),p.exports.jsx("textarea",{className:"w-full resize-none h-[41.6px] absolute bottom-0 bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-bl-3xl ",placeholder:"Type a message...",value:c.text,onChange:A=>ue(A.target.value),onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),ve())}}),p.exports.jsx(sn,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:ve,children:p.exports.jsx(xr,{})})]}):p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] h-10 relative ",children:[p.exports.jsx("div",{onClick:U,className:"cursor-pointer z-10 absolute right-4 top-[11px]",children:p.exports.jsx($f,{})}),p.exports.jsx("input",{type:"file",ref:q,style:{display:"none"},onChange:z}),p.exports.jsx("div",{ref:M,contentEditable:!0,suppressContentEditableWarning:!0,className:"w-full absolute bottom-0 resize-none bg-white flex-1 p-2 pr-10 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl overflow-hidden",style:{height:X},onInput:A=>ue(A.currentTarget.innerHTML),onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),ve())}}),p.exports.jsx(sn,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:f?ve:w,children:f?p.exports.jsx(xr,{}):p.exports.jsx(Uf,{})})]}),b&&p.exports.jsxs("div",{className:"absolute bottom-full left-0 w-full bg-white shadow-xl rounded-lg border border-gray-200 p-4 z-50 max-h-60 overflow-y-auto",onScroll:I,children:[p.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[p.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",p.exports.jsx("span",{className:"text-blue-500",children:b})]}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>P(null),children:"✕"})]}),p.exports.jsxs("div",{className:"space-y-2",children:[o?o.filter(A=>A.symbol===b).map(A=>{var E;const{component:V,lists:L}=A;return V?j?(E=L==null?void 0:L.filter(ne=>ne==null?void 0:ne.name.includes(j)))==null?void 0:E.map((ne,te)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(V,{listsProps:ne,onClick:(xe,Te)=>$(xe,Te,b)})},te)):L==null?void 0:L.map((ne,te)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(V,{listsProps:ne,onClick:(xe,Te)=>$(xe,Te,b)})},te)):null}):null,p.exports.jsx("div",{className:"h-8",children:ie&&"Loading more items..."})]})]})]})};var ke=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(ke||{}),le=(e=>(e[e.Telegram=0]="Telegram",e[e.Simple=1]="Simple",e))(le||{});const br=({progress:e,size:t=100,strokeWidth:n=10,circleColor:r="#e0e0e0",progressColor:s="#3b82f6",animationDuration:i=1e3,showCancel:o=!1,onCancelClick:a,className:l})=>{const[c,u]=x.useState(0),f=(t-n)/2,h=2*Math.PI*f,m=h-c/100*h;return x.useEffect(()=>{const y=Date.now(),v=y+i,S=()=>{const b=Date.now(),j=Math.min(1,(b-y)/i)*e;u(j),b<v?requestAnimationFrame(S):u(e)};requestAnimationFrame(S)},[e,i]),p.exports.jsxs("div",{className:`relative flex items-center justify-center ${l}`,style:{width:t,height:t},children:[p.exports.jsxs("svg",{className:"absolute animate-[spin_2s_ease-in-out_infinite] ",width:t,height:t,children:[p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:r,strokeWidth:n}),p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:s,strokeWidth:n,strokeDasharray:h,strokeDashoffset:m,strokeLinecap:"round",transform:`rotate(-90 ${t/2} ${t/2})`,className:"transition-all ease-linear duration-1000"})]}),o?p.exports.jsx("button",{onClick:a,className:"absolute flex items-center justify-center w-8 h-8 rounded-full hover:bg-gray-200 transition-colors","aria-label":"Cancel",children:p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:s,children:p.exports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}):p.exports.jsxs("span",{className:"absolute text-lg font-bold",style:{color:s},children:[Math.round(c),"%"]})]})},Io=({fileName:e,fileSize:t,format:n,src:r,them:s,uploadProgres:i,onCancelClick:o})=>{const a=()=>{const c={rar:p.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:p.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:p.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:p.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:p.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),txt:p.exports.jsx("p",{className:"p-2 text-purple-500 font-bold",children:n}),xls:p.exports.jsx("p",{className:"p-2 text-green-400 font-bold",children:n}),ppt:p.exports.jsx("p",{className:"p-2 text-yellow-500 font-bold",children:n}),png:p.exports.jsx("p",{className:"p-2 text-pink-500 font-bold",children:n}),jpg:p.exports.jsx("p",{className:"p-2 text-indigo-500 font-bold",children:n}),mp3:p.exports.jsx("p",{className:"p-2 text-teal-500 font-bold",children:n}),mp4:p.exports.jsx("p",{className:"p-2 text-gray-500 font-bold",children:n}),exe:p.exports.jsx("p",{className:"p-2 text-red-400 font-bold",children:n}),html:p.exports.jsx("p",{className:"p-2 text-orange-500 font-bold",children:n}),css:p.exports.jsx("p",{className:"p-2 text-blue-300 font-bold",children:n}),js:p.exports.jsx("p",{className:"p-2 text-yellow-400 font-bold",children:n}),json:p.exports.jsx("p",{className:"p-2 text-purple-400 font-bold",children:n}),xml:p.exports.jsx("p",{className:"p-2 text-green-300 font-bold",children:n}),svg:p.exports.jsx("p",{className:"p-2 text-pink-400 font-bold",children:n}),gif:p.exports.jsx("p",{className:"p-2 text-indigo-400 font-bold",children:n}),csv:p.exports.jsx("p",{className:"p-2 text-teal-400 font-bold",children:n}),sql:p.exports.jsx("p",{className:"p-2 text-gray-400 font-bold",children:n})};return n&&c[n]?c[n]:p.exports.jsx("p",{className:"p-2 text-black ",children:n??"UN"})},l=c=>c>1073741824?(c/1073741824).toFixed(2)+" GB":c>1048576?(c/1048576).toFixed(1)+" MB":(c/1024).toFixed(1)+" KB";return p.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[i?p.exports.jsx("div",{className:" w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(br,{progress:(i==null?void 0:i.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:o,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("div",{className:` border ${s===le.Simple?" border-white ":s===le.Telegram?" border-green-900":""} w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3`,children:a()}),p.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[p.exports.jsx("a",{href:r,download:e,className:`${s===le.Simple?"text-white":s===le.Telegram?"text-gray-900":""} font-medium text-sm hover:underline truncate max-w-[100px]`,title:e,children:e}),p.exports.jsx("span",{className:`${s===le.Simple?"text-gray-800":s===le.Telegram?"text-gray-900":""} text-sm`,children:l(t)})]}),p.exports.jsx("a",{href:r,download:e,className:"ml-2 bg-green-500 text-white px-2 py-1 text-sm rounded hover:bg-green-600",children:"Download"})]})},zf=e=>p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-play",...e,children:p.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),Yf=e=>p.exports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-pause",...e,children:[p.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),p.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let It=null;const Kf=({src:e,className:t,uploadProgres:n,onCancelClick:r})=>{const[s,i]=x.useState(!1),[o,a]=x.useState(0),l=x.useRef(null);x.useEffect(()=>{const u=l.current;if(!u)return;const f=()=>{a(u.currentTime/u.duration*100)},h=()=>i(!0),m=()=>i(!1),y=()=>{i(!1),a(0)};return u.addEventListener("timeupdate",f),u.addEventListener("play",h),u.addEventListener("pause",m),u.addEventListener("ended",y),()=>{u.removeEventListener("timeupdate",f),u.removeEventListener("play",h),u.removeEventListener("pause",m),u.removeEventListener("ended",y)}},[]);const c=()=>{const u=l.current;u&&(s?u.pause():(It&&It!==u&&(It.pause(),It.currentTime=0),u.play(),It=u))};return p.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[n?p.exports.jsx("div",{className:" w-9 h-9 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(br,{progress:(n==null?void 0:n.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:r,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("button",{className:"w-9 h-9 cursor-pointer flex items-center justify-center pl-[1.5px] bg-gray-700 rounded-full hover:bg-gray-600",onClick:c,children:s?p.exports.jsx(Yf,{}):p.exports.jsx(zf,{})}),p.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:p.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${o}%`}})}),p.exports.jsx("audio",{ref:l,src:e})]})},Hf=({attachmentUrl:e,attachmentType:t,attachmentFormat:n,attachmentName:r,attachmentSize:s,them:i,uploadProgres:o,cancellationToken:a})=>{const l=r||"File",c=s||0;return e?t===ke.Voice?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx(Kf,{onCancelClick:a,uploadProgres:o,src:e})}):t===ke.Image?p.exports.jsxs("div",{className:"relative w-full",children:[o?p.exports.jsx(br,{progress:o==null?void 0:o.progres,size:50,strokeWidth:4,showCancel:!0,onCancelClick:a,circleColor:"#ddd",progressColor:"#286b2a",className:"!absolute z-[1] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"}):null,p.exports.jsx("img",{className:`transition-all ${o?"filter blur-lg":" blur-none"}`,src:e})]}):t===ke.File?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Io,{fileName:l,fileSize:c,format:n??"UN",src:e,uploadProgres:o,onCancelClick:a})}):t===ke.Video?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Io,{fileName:l,fileSize:c,format:n??"UN",src:e,uploadProgres:o,onCancelClick:a})}):null:null},qf=({message:e,showUserProfile:t,handleContextMenu:n,media:r,them:s,maxWidth:i})=>{var o,a,l,c,u,f,h,m,y,v;return p.exports.jsxs(p.exports.Fragment,{children:[t?p.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,p.exports.jsxs(vr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:S=>n(S,e),className:`relative ${r?"w-3/4":i?"max-w-[400px] w-fit":"max-w-[75%] w-fit"} flex flex-col gap-1 break-words p-2 pt-5 rounded-lg ${s===le.Simple?"bg-[#f8fbff]":s===le.Telegram?"bg-blue-200 ":""} `,children:[p.exports.jsx("span",{title:(o=e.user)!=null&&o.fullName&&((l=(a=e.user)==null?void 0:a.fullName)==null?void 0:l.length)>16?(c=e.user)==null?void 0:c.firstName:(u=e.user)==null?void 0:u.fullName,className:"relative -top-3 h-4 -mb-3 overflow-y-visible text-xs text-orange-700 whitespace-nowrap truncate max-w-[100px] overflow-visible",children:(f=e.user)!=null&&f.fullName&&((m=(h=e.user)==null?void 0:h.fullName)==null?void 0:m.length)>16?(y=e.user)==null?void 0:y.firstName:(v=e.user)==null?void 0:v.fullName}),r||null,p.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e.text}}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]}),e.isEdited?p.exports.jsx("span",{className:`text-xs italic ${s===le.Simple?"text-gray-700":s===le.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(sn,{className:` ${s===le.Simple?"[&>g>path]:fill-[#f8fbff]":s===le.Telegram?"[&>g>path]:fill-blue-200":""} -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 `})]})]})},Gf=({className:e})=>p.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[p.exports.jsx("path",{d:"M11.6619 4.6478C11.8358 4.83691 11.8272 5.1347 11.6427 5.31294L4.36284 12.3463C4.14493 12.5568 3.80285 12.5503 3.59268 12.3317L1.13205 9.77168C0.954124 9.58658 0.956276 9.28866 1.13686 9.10628C1.31743 8.92389 1.60806 8.9261 1.78598 9.1112L3.99455 11.4089L11.013 4.62812C11.1975 4.44988 11.488 4.4587 11.6619 4.6478Z",fill:"gray"}),p.exports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.8759 4.64963C15.0492 4.83921 15.0399 5.13698 14.8549 5.31471L7.51066 12.3726C7.32572 12.5503 7.03524 12.5407 6.86185 12.3511C6.68847 12.1616 6.69784 11.8638 6.88278 11.6861L14.227 4.62818C14.412 4.45045 14.7025 4.46005 14.8759 4.64963Z",fill:"gray"})]}),No=({size:e=24,color:t="text-current",className:n})=>p.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:p.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[p.exports.jsx("defs",{children:p.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),p.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),p.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[p.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),p.exports.jsx("path",{d:"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",stroke:"url(#linearGradient-1)",strokeWidth:"4",strokeLinecap:"round"})]})]})}),Xf=({handleContextMenu:e,media:t,message:n,them:r,maxWidth:s})=>p.exports.jsxs(vr.div,{style:{background:"red !important"},initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:i=>e(i,n),className:`relative self-end ${t?"w-3/4":s?" max-w-[400px]":"max-w-[75%]"} flex flex-col justify-center break-words p-2 rounded-lg ${r===le.Telegram?" bg-green-200":le.Simple?" bg-[#b3baff] text-black":""}`,children:[t||null,p.exports.jsx("span",{className:"",children:n.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?p.exports.jsx(No,{size:13,color:"text-black"}):p.exports.jsx(Gf,{className:r===le.Telegram?" ":le.Simple?" [&>path]:fill-black":""}),n.isEdited?p.exports.jsx("span",{className:`text-xs italic ${r===le.Simple?"text-gray-200":r===le.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(sn,{className:`fill-blue-200 rotate-180 absolute -right-2 bottom-0 ${r===le.Telegram?"[&>g>path]:fill-green-200":le.Simple?"[&>g>path]:fill-[#b3baff]":""} `})]});var ge={exports:{}},wr={exports:{}},J={};var Fo;function Zf(){if(Fo)return J;Fo=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,P=e?Symbol.for("react.scope"):60119;function j(g){if(typeof g=="object"&&g!==null){var O=g.$$typeof;switch(O){case t:switch(g=g.type,g){case l:case c:case r:case i:case s:case f:return g;default:switch(g=g&&g.$$typeof,g){case a:case u:case y:case m:case o:return g;default:return O}}case n:return O}}}function D(g){return j(g)===c}return J.AsyncMode=l,J.ConcurrentMode=c,J.ContextConsumer=a,J.ContextProvider=o,J.Element=t,J.ForwardRef=u,J.Fragment=r,J.Lazy=y,J.Memo=m,J.Portal=n,J.Profiler=i,J.StrictMode=s,J.Suspense=f,J.isAsyncMode=function(g){return D(g)||j(g)===l},J.isConcurrentMode=D,J.isContextConsumer=function(g){return j(g)===a},J.isContextProvider=function(g){return j(g)===o},J.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},J.isForwardRef=function(g){return j(g)===u},J.isFragment=function(g){return j(g)===r},J.isLazy=function(g){return j(g)===y},J.isMemo=function(g){return j(g)===m},J.isPortal=function(g){return j(g)===n},J.isProfiler=function(g){return j(g)===i},J.isStrictMode=function(g){return j(g)===s},J.isSuspense=function(g){return j(g)===f},J.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===c||g===i||g===s||g===f||g===h||typeof g=="object"&&g!==null&&(g.$$typeof===y||g.$$typeof===m||g.$$typeof===o||g.$$typeof===a||g.$$typeof===u||g.$$typeof===S||g.$$typeof===b||g.$$typeof===P||g.$$typeof===v)},J.typeOf=j,J}var Q={};var Bo;function Jf(){return Bo||(Bo=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,P=e?Symbol.for("react.scope"):60119;function j(E){return typeof E=="string"||typeof E=="function"||E===r||E===c||E===i||E===s||E===f||E===h||typeof E=="object"&&E!==null&&(E.$$typeof===y||E.$$typeof===m||E.$$typeof===o||E.$$typeof===a||E.$$typeof===u||E.$$typeof===S||E.$$typeof===b||E.$$typeof===P||E.$$typeof===v)}function D(E){if(typeof E=="object"&&E!==null){var ne=E.$$typeof;switch(ne){case t:var te=E.type;switch(te){case l:case c:case r:case i:case s:case f:return te;default:var xe=te&&te.$$typeof;switch(xe){case a:case u:case y:case m:case o:return xe;default:return ne}}case n:return ne}}}var g=l,O=c,Y=a,k=o,ee=t,M=u,q=r,ie=y,W=m,ce=n,ye=i,me=s,X=f,ue=!1;function ve(E){return ue||(ue=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),w(E)||D(E)===l}function w(E){return D(E)===c}function T(E){return D(E)===a}function B(E){return D(E)===o}function $(E){return typeof E=="object"&&E!==null&&E.$$typeof===t}function I(E){return D(E)===u}function K(E){return D(E)===r}function N(E){return D(E)===y}function U(E){return D(E)===m}function z(E){return D(E)===n}function A(E){return D(E)===i}function V(E){return D(E)===s}function L(E){return D(E)===f}Q.AsyncMode=g,Q.ConcurrentMode=O,Q.ContextConsumer=Y,Q.ContextProvider=k,Q.Element=ee,Q.ForwardRef=M,Q.Fragment=q,Q.Lazy=ie,Q.Memo=W,Q.Portal=ce,Q.Profiler=ye,Q.StrictMode=me,Q.Suspense=X,Q.isAsyncMode=ve,Q.isConcurrentMode=w,Q.isContextConsumer=T,Q.isContextProvider=B,Q.isElement=$,Q.isForwardRef=I,Q.isFragment=K,Q.isLazy=N,Q.isMemo=U,Q.isPortal=z,Q.isProfiler=A,Q.isStrictMode=V,Q.isSuspense=L,Q.isValidElementType=j,Q.typeOf=D}()),Q}var $o;function Uo(){return $o||($o=1,function(e){process.env.NODE_ENV==="production"?e.exports=Zf():e.exports=Jf()}(wr)),wr.exports}var Tr,Wo;function Qf(){if(Wo)return Tr;Wo=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function s(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Tr=s()?Object.assign:function(i,o){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},Tr}var Sr,zo;function Cr(){if(zo)return Sr;zo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Sr=e,Sr}var Pr,Yo;function Ko(){return Yo||(Yo=1,Pr=Function.call.bind(Object.prototype.hasOwnProperty)),Pr}var Er,Ho;function ed(){if(Ho)return Er;Ho=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Cr(),n={},r=Ko();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var f;try{if(typeof i[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[u](o,u,l,a,null,t)}catch(y){f=y}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var m=c?c():"";e("Failed "+a+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Er=s,Er}var jr,qo;function td(){if(qo)return jr;qo=1;var e=Uo(),t=Qf(),n=Cr(),r=Ko(),s=ed(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return jr=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(w){var T=w&&(c&&w[c]||w[u]);if(typeof T=="function")return T}var h="<<anonymous>>",m={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:P(),arrayOf:j,element:D(),elementType:g(),instanceOf:O,node:M(),objectOf:k,oneOf:Y,oneOfType:ee,shape:ie,exact:W};function y(w,T){return w===T?w!==0||1/w===1/T:w!==w&&T!==T}function v(w,T){this.message=w,this.data=T&&typeof T=="object"?T:{},this.stack=""}v.prototype=Error.prototype;function S(w){if(process.env.NODE_ENV!=="production")var T={},B=0;function $(K,N,U,z,A,V,L){if(z=z||h,V=V||U,L!==n){if(l){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=z+":"+U;!T[ne]&&B<3&&(i("You are manually calling a React.PropTypes validation function for the `"+V+"` prop on `"+z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),T[ne]=!0,B++)}}return N[U]==null?K?N[U]===null?new v("The "+A+" `"+V+"` is marked as required "+("in `"+z+"`, but its value is `null`.")):new v("The "+A+" `"+V+"` is marked as required in "+("`"+z+"`, but its value is `undefined`.")):null:w(N,U,z,A,V)}var I=$.bind(null,!1);return I.isRequired=$.bind(null,!0),I}function b(w){function T(B,$,I,K,N,U){var z=B[$],A=me(z);if(A!==w){var V=X(z);return new v("Invalid "+K+" `"+N+"` of type "+("`"+V+"` supplied to `"+I+"`, expected ")+("`"+w+"`."),{expectedType:w})}return null}return S(T)}function P(){return S(o)}function j(w){function T(B,$,I,K,N){if(typeof w!="function")return new v("Property `"+N+"` of component `"+I+"` has invalid PropType notation inside arrayOf.");var U=B[$];if(!Array.isArray(U)){var z=me(U);return new v("Invalid "+K+" `"+N+"` of type "+("`"+z+"` supplied to `"+I+"`, expected an array."))}for(var A=0;A<U.length;A++){var V=w(U,A,I,K,N+"["+A+"]",n);if(V instanceof Error)return V}return null}return S(T)}function D(){function w(T,B,$,I,K){var N=T[B];if(!a(N)){var U=me(N);return new v("Invalid "+I+" `"+K+"` of type "+("`"+U+"` supplied to `"+$+"`, expected a single ReactElement."))}return null}return S(w)}function g(){function w(T,B,$,I,K){var N=T[B];if(!e.isValidElementType(N)){var U=me(N);return new v("Invalid "+I+" `"+K+"` of type "+("`"+U+"` supplied to `"+$+"`, expected a single ReactElement type."))}return null}return S(w)}function O(w){function T(B,$,I,K,N){if(!(B[$]instanceof w)){var U=w.name||h,z=ve(B[$]);return new v("Invalid "+K+" `"+N+"` of type "+("`"+z+"` supplied to `"+I+"`, expected ")+("instance of `"+U+"`."))}return null}return S(T)}function Y(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),o;function T(B,$,I,K,N){for(var U=B[$],z=0;z<w.length;z++)if(y(U,w[z]))return null;var A=JSON.stringify(w,function(L,E){var ne=X(E);return ne==="symbol"?String(E):E});return new v("Invalid "+K+" `"+N+"` of value `"+String(U)+"` "+("supplied to `"+I+"`, expected one of "+A+"."))}return S(T)}function k(w){function T(B,$,I,K,N){if(typeof w!="function")return new v("Property `"+N+"` of component `"+I+"` has invalid PropType notation inside objectOf.");var U=B[$],z=me(U);if(z!=="object")return new v("Invalid "+K+" `"+N+"` of type "+("`"+z+"` supplied to `"+I+"`, expected an object."));for(var A in U)if(r(U,A)){var V=w(U,A,I,K,N+"."+A,n);if(V instanceof Error)return V}return null}return S(T)}function ee(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var T=0;T<w.length;T++){var B=w[T];if(typeof B!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ue(B)+" at index "+T+"."),o}function $(I,K,N,U,z){for(var A=[],V=0;V<w.length;V++){var L=w[V],E=L(I,K,N,U,z,n);if(E==null)return null;E.data&&r(E.data,"expectedType")&&A.push(E.data.expectedType)}var ne=A.length>0?", expected one of type ["+A.join(", ")+"]":"";return new v("Invalid "+U+" `"+z+"` supplied to "+("`"+N+"`"+ne+"."))}return S($)}function M(){function w(T,B,$,I,K){return ce(T[B])?null:new v("Invalid "+I+" `"+K+"` supplied to "+("`"+$+"`, expected a ReactNode."))}return S(w)}function q(w,T,B,$,I){return new v((w||"React class")+": "+T+" type `"+B+"."+$+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+I+"`.")}function ie(w){function T(B,$,I,K,N){var U=B[$],z=me(U);if(z!=="object")return new v("Invalid "+K+" `"+N+"` of type `"+z+"` "+("supplied to `"+I+"`, expected `object`."));for(var A in w){var V=w[A];if(typeof V!="function")return q(I,K,N,A,X(V));var L=V(U,A,I,K,N+"."+A,n);if(L)return L}return null}return S(T)}function W(w){function T(B,$,I,K,N){var U=B[$],z=me(U);if(z!=="object")return new v("Invalid "+K+" `"+N+"` of type `"+z+"` "+("supplied to `"+I+"`, expected `object`."));var A=t({},B[$],w);for(var V in A){var L=w[V];if(r(w,V)&&typeof L!="function")return q(I,K,N,V,X(L));if(!L)return new v("Invalid "+K+" `"+N+"` key `"+V+"` supplied to `"+I+"`.\nBad object: "+JSON.stringify(B[$],null," ")+`
20
20
  Valid keys: `+JSON.stringify(Object.keys(w),null," "));var E=L(U,V,I,K,N+"."+V,n);if(E)return E}return null}return S(T)}function ce(w){switch(typeof w){case"number":case"string":case"undefined":return!0;case"boolean":return!w;case"object":if(Array.isArray(w))return w.every(ce);if(w===null||a(w))return!0;var T=f(w);if(T){var B=T.call(w),$;if(T!==w.entries){for(;!($=B.next()).done;)if(!ce($.value))return!1}else for(;!($=B.next()).done;){var I=$.value;if(I&&!ce(I[1]))return!1}}else return!1;return!0;default:return!1}}function ye(w,T){return w==="symbol"?!0:T?T["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&T instanceof Symbol:!1}function me(w){var T=typeof w;return Array.isArray(w)?"array":w instanceof RegExp?"object":ye(T,w)?"symbol":T}function X(w){if(typeof w>"u"||w===null)return""+w;var T=me(w);if(T==="object"){if(w instanceof Date)return"date";if(w instanceof RegExp)return"regexp"}return T}function ue(w){var T=X(w);switch(T){case"array":case"object":return"an "+T;case"boolean":case"date":case"regexp":return"a "+T;default:return T}}function ve(w){return!w.constructor||!w.constructor.name?h:w.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},jr}var Ar,Go;function nd(){if(Go)return Ar;Go=1;var e=Cr();function t(){}function n(){}return n.resetWarningCache=t,Ar=function(){function r(o,a,l,c,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function s(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Ar}if(process.env.NODE_ENV!=="production"){var rd=Uo(),sd=!0;ge.exports=td()(rd.isElement,sd)}else ge.exports=nd()();function Mr(){return Mr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr.apply(this,arguments)}function id(e,t){if(e==null)return{};var n=od(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function od(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Rr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=id(e,["color","size"]);return x.createElement("svg",Mr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("polyline",{points:"20 6 9 17 4 12"}))});Rr.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])},Rr.displayName="Check";const ad=Rr;function Vr(){return Vr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vr.apply(this,arguments)}function ld(e,t){if(e==null)return{};var n=cd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Dr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=ld(e,["color","size"]);return x.createElement("svg",Vr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),x.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))});Dr.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])},Dr.displayName="Copy";const ud=Dr;function Or(){return Or=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Or.apply(this,arguments)}function fd(e,t){if(e==null)return{};var n=dd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Lr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=fd(e,["color","size"]);return x.createElement("svg",Or({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),x.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});Lr.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])},Lr.displayName="Edit";const hd=Lr;function kr(){return kr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kr.apply(this,arguments)}function pd(e,t){if(e==null)return{};var n=md(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function md(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var _r=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=pd(e,["color","size"]);return x.createElement("svg",kr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("polyline",{points:"3 6 5 6 21 6"}),x.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))});_r.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])},_r.displayName="Trash";const gd=_r,yd=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:s,isSendingDefultForNewMessage:i,isSendingDefultForEdited:o,onDeleteMessage:a})=>{const l=x.useRef(null),[c,u]=x.useState(!1),[f,h]=x.useState(null),[m,y]=x.useState(),[v,S]=x.useState(null),b=()=>{setTimeout(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},100)};x.useEffect(()=>{const M=()=>{S(null)};return window.addEventListener("scroll",M,!0),()=>{window.removeEventListener("scroll",M,!0)}},[S]);const P=(M,q)=>{M.preventDefault();const ie=window.scrollX,W=window.scrollY;S({x:M.clientX+ie,y:M.clientY+W,message:q})},j=()=>{S(null)},D=(M,q)=>{const ie=new yt({id:new Date().toString(),text:M,htmlContent:q,user:e,isRightSided:!0,isSending:i,createdDate:new Date().toString()});n([...t,ie]),r(ie),b()},g=M=>{n(t.map(q=>q.id===M.id?(M.updateIsSending(Boolean(o)),M):q)),s(M)},O=M=>{const q=URL.createObjectURL(M),ie=new yt({id:new Date().toString(),text:"",attachmentUrl:q,attachmentType:ke.Voice,attachmentBlob:M,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,ie]),r(ie),b()},Y=(M,q)=>{const ie=URL.createObjectURL(M),W=M instanceof File?M.name:"",ce=M instanceof File?M.name.split(".").pop():"",ye=new yt({id:new Date().toString(),text:"",attachmentUrl:ie,attachmentBlob:M,attachmentType:q,attachmentFormat:ce,attachmentName:W,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,ye]),r(ye),b()};return{handleDeleteConfirmation:()=>{f&&(a(f),h(null)),u(!1)},handleCloseContextMenu:j,contextMenuItems:[{name:"Edit",icon:p.exports.jsx(hd,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:M=>{y(t.find(q=>q.id===M)),j()}},{name:"Delete",icon:p.exports.jsx(gd,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:M=>{h(M),u(!0),j()}},{name:"Select",icon:p.exports.jsx(ad,{className:"text-green-600"}),disabled:!0,onClick:()=>{console.log("Select clicked"),j()}},{name:"Copy",icon:p.exports.jsx(ud,{className:"text-blue-600"}),onClick:M=>{const q=t.find(ie=>ie.id===M);q&&navigator.clipboard.writeText(q.text),j()}}],handleSendFile:Y,handleSendVoice:O,handleSendMessage:D,handleContextMenu:P,isModalOpen:c,contextMenu:v,chatRef:l,setIsModalOpen:u,messageToEdit:m,setMessageToEdit:y,handleEditMessage:g}},vd=({width:e="400px",height:t="600px",isLoadingChat:n,className:r,style:s,messages:i,user:o,updateMessages:a,onMessageSent:l,onDeleteMessage:c,onEditMessage:u,dynamicSymbolAssignments:f,onDynamicSymbolListSet:h,onDynamicSymbolListDelete:m,isSendingDefultForNewMessage:y,isSendingDefultForEdited:v,backgroundImage:S,messageBubbleBiggerSize:b,uploadProgress:P,onUploadCancellationToken:j,them:D=le.Telegram})=>{var ve,w;const{handleDeleteConfirmation:g,handleCloseContextMenu:O,handleSendFile:Y,handleSendVoice:k,handleSendMessage:ee,handleContextMenu:M,contextMenuItems:q,isModalOpen:ie,contextMenu:W,chatRef:ce,setIsModalOpen:ye,messageToEdit:me,setMessageToEdit:X,handleEditMessage:ue}=yd({user:o,messages:i,updateMessages:a,onMessageSent:l,onEditMessage:u,onDeleteMessage:c,isSendingDefultForNewMessage:y,isSendingDefultForEdited:v});return p.exports.jsxs("div",{className:`flex flex-col !bg-cover ${r}`,style:{width:e,height:t,background:"url("+S+")",...s},onClick:O,children:[p.exports.jsx("div",{ref:ce,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${W?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n?p.exports.jsx(No,{className:"mt-3",size:27,color:"text-gray-800"}):p.exports.jsx(Hr,{children:i.length>0?i.map((T,B)=>{var K,N,U;const $=T!=null&&T.attachmentUrl?p.exports.jsx(Hf,{attachmentUrl:T.attachmentUrl,attachmentType:T==null?void 0:T.attachmentType,attachmentFormat:T==null?void 0:T.attachmentFormat,attachmentName:T==null?void 0:T.attachmentName,attachmentSize:T==null?void 0:T.attachmentSize,uploadProgres:P==null?void 0:P.find(z=>z.messageId===T.id),cancellationToken:()=>j?j(T.id):null},B):null;if(T.isRightSided)return p.exports.jsx(Xf,{maxWidth:b,media:$,handleContextMenu:M,message:T,them:D},B);const I=((N=(K=i[B-1])==null?void 0:K.user)==null?void 0:N.id)!==((U=T==null?void 0:T.user)==null?void 0:U.id);return p.exports.jsx(qf,{maxWidth:b,showUserProfile:I,media:$,handleContextMenu:M,message:T,them:D},B)}):null})}),p.exports.jsx(Nf,{isOpen:ie,onClose:()=>ye(!1),onConfirm:g,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),W&&((ve=W==null?void 0:W.message)!=null&&ve.id)?p.exports.jsx(Ff,{items:q,isVisible:Boolean(W),messageId:String(W==null?void 0:W.message.id),isCurrentUserMessage:((w=W==null?void 0:W.message)==null?void 0:w.user.id)===o.id,position:{x:W==null?void 0:W.x,y:W==null?void 0:W.y}}):null,p.exports.jsx(Wf,{onSendVoice:k,onSendMessage:ee,onFileSend:T=>Y(T,ke.File),onImageSend:T=>Y(T,ke.Image),onVideoSend:T=>Y(T,ke.Video),dynamicSymbolAssignments:f,onDynamicSymbolListSet:h,onDynamicSymbolListDelete:m,messageToEdit:me,setMessageToEdit:X,onEditMessage:ue})]})};pe.AttachmentTypeEnum=ke,pe.Button=ua,pe.Chat=vd,pe.ChatThemEntity=le,pe.MessageEntity=yt,pe.SymbolsListComponent=fa,Object.defineProperty(pe,Symbol.toStringTag,{value:"Module"})});
21
21
  //# sourceMappingURL=index.umd.js.map