import{r as p}from"./vendor-Dq1MSLOW.js";var zs={exports:{}},se={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Er=p,Rr=Symbol.for("react.element"),Lr=Symbol.for("react.fragment"),kr=Object.prototype.hasOwnProperty,Fr=Er.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,jr={key:!0,ref:!0,__self:!0,__source:!0};function Gs(t,e,n){var s,i={},o=null,r=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(r=e.ref);for(s in e)kr.call(e,s)&&!jr.hasOwnProperty(s)&&(i[s]=e[s]);if(t&&t.defaultProps)for(s in e=t.defaultProps,e)i[s]===void 0&&(i[s]=e[s]);return{$$typeof:Rr,type:t,key:o,ref:r,props:i,_owner:Fr.current}}se.Fragment=Lr;se.jsx=Gs;se.jsxs=Gs;zs.exports=se;var Y=zs.exports;let Br={data:""},Or=t=>{if(typeof window=="object"){let e=(t?t.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(t||document.head).appendChild(e),e.firstChild}return t||Br},Ir=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Nr=/\/\*[^]*?\*\/| +/g,Mn=/\n+/g,tt=(t,e)=>{let n="",s="",i="";for(let o in t){let r=t[o];o[0]=="@"?o[1]=="i"?n=o+" "+r+";":s+=o[1]=="f"?tt(r,o):o+"{"+tt(r,o[1]=="k"?"":e)+"}":typeof r=="object"?s+=tt(r,e?e.replace(/([^,])+/g,a=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):o):r!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=tt.p?tt.p(o,r):o+":"+r+";")}return n+(e&&i?e+"{"+i+"}":i)+s},H={},Hs=t=>{if(typeof t=="object"){let e="";for(let n in t)e+=n+Hs(t[n]);return e}return t},_r=(t,e,n,s,i)=>{let o=Hs(t),r=H[o]||(H[o]=(l=>{let u=0,c=11;for(;u>>0;return"go"+c})(o));if(!H[r]){let l=o!==t?t:(u=>{let c,h,d=[{}];for(;c=Ir.exec(u.replace(Nr,""));)c[4]?d.shift():c[3]?(h=c[3].replace(Mn," ").trim(),d.unshift(d[0][h]=d[0][h]||{})):d[0][c[1]]=c[2].replace(Mn," ").trim();return d[0]})(t);H[r]=tt(i?{["@keyframes "+r]:l}:l,n?"":"."+r)}let a=n&&H.g?H.g:null;return n&&(H.g=H[r]),((l,u,c,h)=>{h?u.data=u.data.replace(h,l):u.data.indexOf(l)===-1&&(u.data=c?l+u.data:u.data+l)})(H[r],e,s,a),r},Ur=(t,e,n)=>t.reduce((s,i,o)=>{let r=e[o];if(r&&r.call){let a=r(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;r=l?"."+l:a&&typeof a=="object"?a.props?"":tt(a,""):a===!1?"":a}return s+i+(r??"")},"");function ie(t){let e=this||{},n=t.call?t(e.p):t;return _r(n.unshift?n.raw?Ur(n,[].slice.call(arguments,1),e.p):n.reduce((s,i)=>Object.assign(s,i&&i.call?i(e.p):i),{}):n,Or(e.target),e.g,e.o,e.k)}let Ys,Ce,De;ie.bind({g:1});let Z=ie.bind({k:1});function $r(t,e,n,s){tt.p=e,Ys=t,Ce=n,De=s}function st(t,e){let n=this||{};return function(){let s=arguments;function i(o,r){let a=Object.assign({},o),l=a.className||i.className;n.p=Object.assign({theme:Ce&&Ce()},a),n.o=/ *go\d+/.test(l),a.className=ie.apply(n,s)+(l?" "+l:"");let u=t;return t[0]&&(u=a.as||t,delete a.as),De&&u[0]&&De(a),Ys(u,a)}return i}}var Kr=t=>typeof t=="function",Xt=(t,e)=>Kr(t)?t(e):t,Wr=(()=>{let t=0;return()=>(++t).toString()})(),Xs=(()=>{let t;return()=>{if(t===void 0&&typeof window<"u"){let e=matchMedia("(prefers-reduced-motion: reduce)");t=!e||e.matches}return t}})(),zr=20,ze="default",qs=(t,e)=>{let{toastLimit:n}=t.settings;switch(e.type){case 0:return{...t,toasts:[e.toast,...t.toasts].slice(0,n)};case 1:return{...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case 2:let{toast:s}=e;return qs(t,{type:t.toasts.find(r=>r.id===s.id)?1:0,toast:s});case 3:let{toastId:i}=e;return{...t,toasts:t.toasts.map(r=>r.id===i||i===void 0?{...r,dismissed:!0,visible:!1}:r)};case 4:return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)};case 5:return{...t,pausedAt:e.time};case 6:let o=e.time-(t.pausedAt||0);return{...t,pausedAt:void 0,toasts:t.toasts.map(r=>({...r,pauseDuration:r.pauseDuration+o}))}}},zt=[],Zs={toasts:[],pausedAt:void 0,settings:{toastLimit:zr}},K={},Js=(t,e=ze)=>{K[e]=qs(K[e]||Zs,t),zt.forEach(([n,s])=>{n===e&&s(K[e])})},Qs=t=>Object.keys(K).forEach(e=>Js(t,e)),Gr=t=>Object.keys(K).find(e=>K[e].toasts.some(n=>n.id===t)),re=(t=ze)=>e=>{Js(e,t)},Hr={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Yr=(t={},e=ze)=>{let[n,s]=p.useState(K[e]||Zs),i=p.useRef(K[e]);p.useEffect(()=>(i.current!==K[e]&&s(K[e]),zt.push([e,s]),()=>{let r=zt.findIndex(([a])=>a===e);r>-1&&zt.splice(r,1)}),[e]);let o=n.toasts.map(r=>{var a,l,u;return{...t,...t[r.type],...r,removeDelay:r.removeDelay||((a=t[r.type])==null?void 0:a.removeDelay)||(t==null?void 0:t.removeDelay),duration:r.duration||((l=t[r.type])==null?void 0:l.duration)||(t==null?void 0:t.duration)||Hr[r.type],style:{...t.style,...(u=t[r.type])==null?void 0:u.style,...r.style}}});return{...n,toasts:o}},Xr=(t,e="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:e,ariaProps:{role:"status","aria-live":"polite"},message:t,pauseDuration:0,...n,id:(n==null?void 0:n.id)||Wr()}),jt=t=>(e,n)=>{let s=Xr(e,t,n);return re(s.toasterId||Gr(s.id))({type:2,toast:s}),s.id},R=(t,e)=>jt("blank")(t,e);R.error=jt("error");R.success=jt("success");R.loading=jt("loading");R.custom=jt("custom");R.dismiss=(t,e)=>{let n={type:3,toastId:t};e?re(e)(n):Qs(n)};R.dismissAll=t=>R.dismiss(void 0,t);R.remove=(t,e)=>{let n={type:4,toastId:t};e?re(e)(n):Qs(n)};R.removeAll=t=>R.remove(void 0,t);R.promise=(t,e,n)=>{let s=R.loading(e.loading,{...n,...n==null?void 0:n.loading});return typeof t=="function"&&(t=t()),t.then(i=>{let o=e.success?Xt(e.success,i):void 0;return o?R.success(o,{id:s,...n,...n==null?void 0:n.success}):R.dismiss(s),i}).catch(i=>{let o=e.error?Xt(e.error,i):void 0;o?R.error(o,{id:s,...n,...n==null?void 0:n.error}):R.dismiss(s)}),t};var qr=1e3,Zr=(t,e="default")=>{let{toasts:n,pausedAt:s}=Yr(t,e),i=p.useRef(new Map).current,o=p.useCallback((h,d=qr)=>{if(i.has(h))return;let f=setTimeout(()=>{i.delete(h),r({type:4,toastId:h})},d);i.set(h,f)},[]);p.useEffect(()=>{if(s)return;let h=Date.now(),d=n.map(f=>{if(f.duration===1/0)return;let m=(f.duration||0)+f.pauseDuration-(h-f.createdAt);if(m<0){f.visible&&R.dismiss(f.id);return}return setTimeout(()=>R.dismiss(f.id,e),m)});return()=>{d.forEach(f=>f&&clearTimeout(f))}},[n,s,e]);let r=p.useCallback(re(e),[e]),a=p.useCallback(()=>{r({type:5,time:Date.now()})},[r]),l=p.useCallback((h,d)=>{r({type:1,toast:{id:h,height:d}})},[r]),u=p.useCallback(()=>{s&&r({type:6,time:Date.now()})},[s,r]),c=p.useCallback((h,d)=>{let{reverseOrder:f=!1,gutter:m=8,defaultPosition:g}=d||{},y=n.filter(x=>(x.position||g)===(h.position||g)&&x.height),v=y.findIndex(x=>x.id===h.id),T=y.filter((x,w)=>wx.visible).slice(...f?[T+1]:[0,T]).reduce((x,w)=>x+(w.height||0)+m,0)},[n]);return p.useEffect(()=>{n.forEach(h=>{if(h.dismissed)o(h.id,h.removeDelay);else{let d=i.get(h.id);d&&(clearTimeout(d),i.delete(h.id))}})},[n,o]),{toasts:n,handlers:{updateHeight:l,startPause:a,endPause:u,calculateOffset:c}}},Jr=Z` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,Qr=Z` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,to=Z` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,eo=st("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${t=>t.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${Jr} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${Qr} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${t=>t.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${to} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,no=Z` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,so=st("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${t=>t.secondary||"#e0e0e0"}; border-right-color: ${t=>t.primary||"#616161"}; animation: ${no} 1s linear infinite; `,io=Z` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,ro=Z` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,oo=st("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${t=>t.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${io} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${ro} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${t=>t.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,ao=st("div")` position: absolute; `,lo=st("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,uo=Z` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,co=st("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${uo} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,ho=({toast:t})=>{let{icon:e,type:n,iconTheme:s}=t;return e!==void 0?typeof e=="string"?p.createElement(co,null,e):e:n==="blank"?null:p.createElement(lo,null,p.createElement(so,{...s}),n!=="loading"&&p.createElement(ao,null,n==="error"?p.createElement(eo,{...s}):p.createElement(oo,{...s})))},fo=t=>` 0% {transform: translate3d(0,${t*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,po=t=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${t*-150}%,-1px) scale(.6); opacity:0;} `,mo="0%{opacity:0;} 100%{opacity:1;}",go="0%{opacity:1;} 100%{opacity:0;}",yo=st("div")` display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; `,vo=st("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,xo=(t,e)=>{let n=t.includes("top")?1:-1,[s,i]=Xs()?[mo,go]:[fo(n),po(n)];return{animation:e?`${Z(s)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Z(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},To=p.memo(({toast:t,position:e,style:n,children:s})=>{let i=t.height?xo(t.position||e||"top-center",t.visible):{opacity:0},o=p.createElement(ho,{toast:t}),r=p.createElement(vo,{...t.ariaProps},Xt(t.message,t));return p.createElement(yo,{className:t.className,style:{...i,...n,...t.style}},typeof s=="function"?s({icon:o,message:r}):p.createElement(p.Fragment,null,o,r))});$r(p.createElement);var bo=({id:t,className:e,style:n,onHeightUpdate:s,children:i})=>{let o=p.useCallback(r=>{if(r){let a=()=>{let l=r.getBoundingClientRect().height;s(t,l)};a(),new MutationObserver(a).observe(r,{subtree:!0,childList:!0,characterData:!0})}},[t,s]);return p.createElement("div",{ref:o,className:e,style:n},i)},Po=(t,e)=>{let n=t.includes("top"),s=n?{top:0}:{bottom:0},i=t.includes("center")?{justifyContent:"center"}:t.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Xs()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${e*(n?1:-1)}px)`,...s,...i}},wo=ie` z-index: 9999; > * { pointer-events: auto; } `,_t=16,Qc=({reverseOrder:t,position:e="top-center",toastOptions:n,gutter:s,children:i,toasterId:o,containerStyle:r,containerClassName:a})=>{let{toasts:l,handlers:u}=Zr(n,o);return p.createElement("div",{"data-rht-toaster":o||"",style:{position:"fixed",zIndex:9999,top:_t,left:_t,right:_t,bottom:_t,pointerEvents:"none",...r},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(c=>{let h=c.position||e,d=u.calculateOffset(c,{reverseOrder:t,gutter:s,defaultPosition:e}),f=Po(h,d);return p.createElement(bo,{id:c.id,key:c.id,onHeightUpdate:u.updateHeight,className:c.visible?wo:"",style:f},c.type==="custom"?Xt(c.message,c):i?i(c):p.createElement(To,{toast:c,position:h}))}))},th=R;const Ge=p.createContext({});function He(t){const e=p.useRef(null);return e.current===null&&(e.current=t()),e.current}const oe=p.createContext(null),Ye=p.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class So extends p.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ao({children:t,isPresent:e}){const n=p.useId(),s=p.useRef(null),i=p.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=p.useContext(Ye);return p.useInsertionEffect(()=>{const{width:r,height:a,top:l,left:u}=i.current;if(e||!s.current||!r||!a)return;s.current.dataset.motionPopId=n;const c=document.createElement("style");return o&&(c.nonce=o),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${r}px !important; height: ${a}px !important; top: ${l}px !important; left: ${u}px !important; } `),()=>{document.head.removeChild(c)}},[e]),Y.jsx(So,{isPresent:e,childRef:s,sizeRef:i,children:p.cloneElement(t,{ref:s})})}const Vo=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r})=>{const a=He(Co),l=p.useId(),u=p.useCallback(h=>{a.set(h,!0);for(const d of a.values())if(!d)return;s&&s()},[a,s]),c=p.useMemo(()=>({id:l,initial:e,isPresent:n,custom:i,onExitComplete:u,register:h=>(a.set(h,!1),()=>a.delete(h))}),o?[Math.random(),u]:[n,u]);return p.useMemo(()=>{a.forEach((h,d)=>a.set(d,!1))},[n]),p.useEffect(()=>{!n&&!a.size&&s&&s()},[n]),r==="popLayout"&&(t=Y.jsx(Ao,{isPresent:n,children:t})),Y.jsx(oe.Provider,{value:c,children:t})};function Co(){return new Map}function ti(t=!0){const e=p.useContext(oe);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=p.useId();p.useEffect(()=>{t&&i(o)},[t]);const r=p.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Ut=t=>t.key||"";function En(t){const e=[];return p.Children.forEach(t,n=>{p.isValidElement(n)&&e.push(n)}),e}const Xe=typeof window<"u",ei=Xe?p.useLayoutEffect:p.useEffect,eh=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1})=>{const[a,l]=ti(r),u=p.useMemo(()=>En(t),[t]),c=r&&!a?[]:u.map(Ut),h=p.useRef(!0),d=p.useRef(u),f=He(()=>new Map),[m,g]=p.useState(u),[y,v]=p.useState(u);ei(()=>{h.current=!1,d.current=u;for(let w=0;w{const b=Ut(w),A=r&&!a?!1:u===y||c.includes(b),M=()=>{if(f.has(b))f.set(b,!0);else return;let S=!0;f.forEach(k=>{k||(S=!1)}),S&&(x==null||x(),v(d.current),r&&(l==null||l()),s&&s())};return Y.jsx(Vo,{isPresent:A,initial:!h.current||n?void 0:!1,custom:A?void 0:e,presenceAffectsLayout:i,mode:o,onExitComplete:A?void 0:M,children:w},b)})})},O=t=>t;let ni=O;function qe(t){let e;return()=>(e===void 0&&(e=t()),e)}const yt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},X=t=>t*1e3,q=t=>t/1e3,Do={useManualTiming:!1};function Mo(t){let e=new Set,n=new Set,s=!1,i=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(u){o.has(u)&&(l.schedule(u),t()),u(r)}const l={schedule:(u,c=!1,h=!1)=>{const f=h&&s?e:n;return c&&o.add(u),f.has(u)||f.add(u),u},cancel:u=>{n.delete(u),o.delete(u)},process:u=>{if(r=u,s){i=!0;return}s=!0,[e,n]=[n,e],e.forEach(a),e.clear(),s=!1,i&&(i=!1,l.process(u))}};return l}const $t=["read","resolveKeyframes","update","preRender","render","postRender"],Eo=40;function si(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=$t.reduce((v,T)=>(v[T]=Mo(o),v),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=r,f=()=>{const v=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(v-i.timestamp,Eo),1),i.timestamp=v,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(f))},m=()=>{n=!0,s=!0,i.isProcessing||t(f)};return{schedule:$t.reduce((v,T)=>{const x=r[T];return v[T]=(w,b=!1,A=!1)=>(n||m(),x.schedule(w,b,A)),v},{}),cancel:v=>{for(let T=0;T<$t.length;T++)r[$t[T]].cancel(v)},state:i,steps:r}}const{schedule:V,cancel:et,state:L,steps:pe}=si(typeof requestAnimationFrame<"u"?requestAnimationFrame:O,!0),ii=p.createContext({strict:!1}),Rn={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"]},vt={};for(const t in Rn)vt[t]={isEnabled:e=>Rn[t].some(n=>!!e[n])};function Ro(t){for(const e in t)vt[e]={...vt[e],...t[e]}}const Lo=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 qt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Lo.has(t)}let ri=t=>!qt(t);function ko(t){t&&(ri=e=>e.startsWith("on")?!qt(e):t(e))}try{ko(require("@emotion/is-prop-valid").default)}catch{}function Fo(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(ri(i)||n===!0&&qt(i)||!e&&!qt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function jo(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...s)=>t(...s);return new Proxy(n,{get:(s,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const ae=p.createContext({});function Et(t){return typeof t=="string"||Array.isArray(t)}function le(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Ze=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Je=["initial",...Ze];function ue(t){return le(t.animate)||Je.some(e=>Et(t[e]))}function oi(t){return!!(ue(t)||t.variants)}function Bo(t,e){if(ue(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Et(n)?n:void 0,animate:Et(s)?s:void 0}}return t.inherit!==!1?e:{}}function Oo(t){const{initial:e,animate:n}=Bo(t,p.useContext(ae));return p.useMemo(()=>({initial:e,animate:n}),[Ln(e),Ln(n)])}function Ln(t){return Array.isArray(t)?t.join(" "):t}const Io=Symbol.for("motionComponentSymbol");function dt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function No(t,e,n){return p.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):dt(n)&&(n.current=s))},[e])}const Qe=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),_o="framerAppearId",ai="data-"+Qe(_o),{schedule:tn}=si(queueMicrotask,!1),li=p.createContext({});function Uo(t,e,n,s,i){var o,r;const{visualElement:a}=p.useContext(ae),l=p.useContext(ii),u=p.useContext(oe),c=p.useContext(Ye).reducedMotion,h=p.useRef(null);s=s||l.renderer,!h.current&&s&&(h.current=s(t,{visualState:e,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const d=h.current,f=p.useContext(li);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&$o(h.current,n,i,f);const m=p.useRef(!1);p.useInsertionEffect(()=>{d&&m.current&&d.update(n,u)});const g=n[ai],y=p.useRef(!!g&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,g))&&((r=window.MotionHasOptimisedAnimation)===null||r===void 0?void 0:r.call(window,g)));return ei(()=>{d&&(m.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),tn.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),p.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var v;(v=window.MotionHandoffMarkAsComplete)===null||v===void 0||v.call(window,g)}),y.current=!1))}),d}function $o(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ui(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&dt(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:u})}function ui(t){if(t)return t.options.allowProjection!==!1?t.projection:ui(t.parent)}function Ko({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){var o,r;t&&Ro(t);function a(u,c){let h;const d={...p.useContext(Ye),...u,layoutId:Wo(u)},{isStatic:f}=d,m=Oo(u),g=s(u,f);if(!f&&Xe){zo();const y=Go(d);h=y.MeasureLayout,m.visualElement=Uo(i,g,d,e,y.ProjectionNode)}return Y.jsxs(ae.Provider,{value:m,children:[h&&m.visualElement?Y.jsx(h,{visualElement:m.visualElement,...d}):null,n(i,u,No(g,m.visualElement,c),g,f,m.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(r=(o=i.displayName)!==null&&o!==void 0?o:i.name)!==null&&r!==void 0?r:""})`}`;const l=p.forwardRef(a);return l[Io]=i,l}function Wo({layoutId:t}){const e=p.useContext(Ge).id;return e&&t!==void 0?e+"-"+t:t}function zo(t,e){p.useContext(ii).strict}function Go(t){const{drag:e,layout:n}=vt;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const Ho=["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 en(t){return typeof t!="string"||t.includes("-")?!1:!!(Ho.indexOf(t)>-1||/[A-Z]/u.test(t))}function kn(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function nn(t,e,n,s){if(typeof e=="function"){const[i,o]=kn(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=kn(s);e=e(n!==void 0?n:t.custom,i,o)}return e}const Me=t=>Array.isArray(t),Yo=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Xo=t=>Me(t)?t[t.length-1]||0:t,j=t=>!!(t&&t.getVelocity);function Gt(t){const e=j(t)?t.get():t;return Yo(e)?e.toValue():e}function qo({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},s,i,o){const r={latestValues:Zo(s,i,o,t),renderState:e()};return n&&(r.onMount=a=>n({props:s,current:a,...r}),r.onUpdate=a=>n(a)),r}const ci=t=>(e,n)=>{const s=p.useContext(ae),i=p.useContext(oe),o=()=>qo(t,e,s,i);return n?o():He(o)};function Zo(t,e,n,s){const i={},o=s(t,{});for(const d in o)i[d]=Gt(o[d]);let{initial:r,animate:a}=t;const l=ue(t),u=oi(t);e&&u&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||r===!1;const h=c?a:r;if(h&&typeof h!="boolean"&&!le(h)){const d=Array.isArray(h)?h:[h];for(let f=0;fe=>typeof e=="string"&&e.startsWith(t),di=hi("--"),Jo=hi("var(--"),sn=t=>Jo(t)?Qo.test(t.split("/*")[0].trim()):!1,Qo=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,fi=(t,e)=>e&&typeof t=="number"?e.transform(t):t,J=(t,e,n)=>n>e?e:ntypeof t=="number",parse:parseFloat,transform:t=>t},Rt={...bt,transform:t=>J(0,1,t)},Kt={...bt,default:1},Bt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Q=Bt("deg"),W=Bt("%"),P=Bt("px"),ta=Bt("vh"),ea=Bt("vw"),Fn={...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(t*100)},na={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,radius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,backgroundPositionX:P,backgroundPositionY:P},sa={rotate:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:Kt,scaleX:Kt,scaleY:Kt,scaleZ:Kt,skew:Q,skewX:Q,skewY:Q,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:Rt,originX:Fn,originY:Fn,originZ:P},jn={...bt,transform:Math.round},rn={...na,...sa,zIndex:jn,size:P,fillOpacity:Rt,strokeOpacity:Rt,numOctaves:jn},ia={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ra=Tt.length;function oa(t,e,n){let s="",i=!0;for(let o=0;o({style:{},transform:{},transformOrigin:{},vars:{}}),pi=()=>({...ln(),attrs:{}}),un=t=>typeof t=="string"&&t.toLowerCase()==="svg";function mi(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const o in n)t.style.setProperty(o,n[o])}const gi=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 yi(t,e,n,s){mi(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(gi.has(i)?i:Qe(i),e.attrs[i])}const Zt={};function ha(t){Object.assign(Zt,t)}function vi(t,{layout:e,layoutId:n}){return ct.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Zt[t]||t==="opacity")}function cn(t,e,n){var s;const{style:i}=t,o={};for(const r in i)(j(i[r])||e.style&&j(e.style[r])||vi(r,t)||((s=n==null?void 0:n.getValue(r))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(o[r]=i[r]);return o}function xi(t,e,n){const s=cn(t,e,n);for(const i in t)if(j(t[i])||j(e[i])){const o=Tt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}function da(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const On=["x","y","width","height","cx","cy","r"],fa={useVisualState:ci({scrapeMotionValuesFromProps:xi,createRenderState:pi,onUpdate:({props:t,prevProps:e,current:n,renderState:s,latestValues:i})=>{if(!n)return;let o=!!t.drag;if(!o){for(const a in i)if(ct.has(a)){o=!0;break}}if(!o)return;let r=!e;if(e)for(let a=0;a{da(n,s),V.render(()=>{an(s,i,un(n.tagName),t.transformTemplate),yi(n,s)})})}})},pa={useVisualState:ci({scrapeMotionValuesFromProps:cn,createRenderState:ln})};function Ti(t,e,n){for(const s in e)!j(e[s])&&!vi(s,n)&&(t[s]=e[s])}function ma({transformTemplate:t},e){return p.useMemo(()=>{const n=ln();return on(n,e,t),Object.assign({},n.vars,n.style)},[e])}function ga(t,e){const n=t.style||{},s={};return Ti(s,n,t),Object.assign(s,ma(t,e)),s}function ya(t,e){const n={},s=ga(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}function va(t,e,n,s){const i=p.useMemo(()=>{const o=pi();return an(o,e,un(s),t.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Ti(o,t.style,t),i.style={...o,...i.style}}return i}function xa(t=!1){return(n,s,i,{latestValues:o},r)=>{const l=(en(n)?va:ya)(s,o,r,n),u=Fo(s,typeof n=="string",t),c=n!==p.Fragment?{...u,...l,ref:i}:{},{children:h}=s,d=p.useMemo(()=>j(h)?h.get():h,[h]);return p.createElement(n,{...c,children:d})}}function Ta(t,e){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const r={...en(s)?fa:pa,preloadedFeatures:t,useRender:xa(i),createVisualElement:e,Component:s};return Ko(r)}}function bi(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;swindow.ScrollTimeline!==void 0);class Pa{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let s=0;s{if(ba()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;nn[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class wa extends Pa{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}function hn(t,e){return t?t[e]||t.default||t:void 0}const Ee=2e4;function Pi(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e=Ee?1/0:e}function dn(t){return typeof t=="function"}function In(t,e){t.timeline=e,t.onfinish=null}const fn=t=>Array.isArray(t)&&typeof t[0]=="number",Sa={linearEasing:void 0};function Aa(t,e){const n=qe(t);return()=>{var s;return(s=Sa[e])!==null&&s!==void 0?s:n()}}const Jt=Aa(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),wi=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Re={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:wt([0,.65,.55,1]),circOut:wt([.55,0,1,.45]),backIn:wt([.31,.01,.66,-.59]),backOut:wt([.33,1.53,.69,.99])};function Ai(t,e){if(t)return typeof t=="function"&&Jt()?wi(t,e):fn(t)?wt(t):Array.isArray(t)?t.map(n=>Ai(n,e)||Re.easeOut):Re[t]}const $={x:!1,y:!1};function Vi(){return $.x||$.y}function Va(t,e,n){var s;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const o=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t)}function Ci(t,e){const n=Va(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Nn(t){return e=>{e.pointerType==="touch"||Vi()||t(e)}}function Ca(t,e,n={}){const[s,i,o]=Ci(t,n),r=Nn(a=>{const{target:l}=a,u=e(a);if(typeof u!="function"||!l)return;const c=Nn(h=>{u(h),l.removeEventListener("pointerleave",c)});l.addEventListener("pointerleave",c,i)});return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const Di=(t,e)=>e?t===e?!0:Di(t,e.parentElement):!1,pn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Da=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ma(t){return Da.has(t.tagName)||t.tabIndex!==-1}const St=new WeakSet;function _n(t){return e=>{e.key==="Enter"&&t(e)}}function me(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ea=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=_n(()=>{if(St.has(n))return;me(n,"down");const i=_n(()=>{me(n,"up")}),o=()=>me(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Un(t){return pn(t)&&!Vi()}function Ra(t,e,n={}){const[s,i,o]=Ci(t,n),r=a=>{const l=a.currentTarget;if(!Un(a)||St.has(l))return;St.add(l);const u=e(a),c=(f,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),!(!Un(f)||!St.has(l))&&(St.delete(l),typeof u=="function"&&u(f,{success:m}))},h=f=>{c(f,n.useGlobalTarget||Di(l,f.target))},d=f=>{c(f,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",d,i)};return s.forEach(a=>{!Ma(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),a.addEventListener("focus",u=>Ea(u,i),i)}),o}function La(t){return t==="x"||t==="y"?$[t]?null:($[t]=!0,()=>{$[t]=!1}):$.x||$.y?null:($.x=$.y=!0,()=>{$.x=$.y=!1})}const Mi=new Set(["width","height","top","left","right","bottom",...Tt]);let Ht;function ka(){Ht=void 0}const z={now:()=>(Ht===void 0&&z.set(L.isProcessing||Do.useManualTiming?L.timestamp:performance.now()),Ht),set:t=>{Ht=t,queueMicrotask(ka)}};function mn(t,e){t.indexOf(e)===-1&&t.push(e)}function gn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class yn{constructor(){this.subscriptions=[]}add(e){return mn(this.subscriptions,e),()=>gn(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o!isNaN(parseFloat(t));class ja{constructor(e,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const o=z.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=z.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Fa(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new yn);const s=this.events[e].add(n);return e==="change"?()=>{s(),V.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=z.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>$n)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,$n);return Ei(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(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 Lt(t,e){return new ja(t,e)}function Ba(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Lt(n))}function Oa(t,e){const n=ce(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=Xo(o[r]);Ba(t,r,a)}}function Ia(t){return!!(j(t)&&t.add)}function Le(t,e){const n=t.getValue("willChange");if(Ia(n))return n.add(e)}function Ri(t){return t.props[ai]}const Li=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Na=1e-7,_a=12;function Ua(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=Li(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Na&&++a<_a);return r}function Ot(t,e,n,s){if(t===e&&n===s)return O;const i=o=>Ua(o,0,1,t,n);return o=>o===0||o===1?o:Li(i(o),e,s)}const ki=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Fi=t=>e=>1-t(1-e),ji=Ot(.33,1.53,.69,.99),vn=Fi(ji),Bi=ki(vn),Oi=t=>(t*=2)<1?.5*vn(t):.5*(2-Math.pow(2,-10*(t-1))),xn=t=>1-Math.sin(Math.acos(t)),Ii=Fi(xn),Ni=ki(xn),_i=t=>/^0[^.\s]+$/u.test(t);function $a(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||_i(t):!0}const Vt=t=>Math.round(t*1e5)/1e5,Tn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ka(t){return t==null}const Wa=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,bn=(t,e)=>n=>!!(typeof n=="string"&&Wa.test(n)&&n.startsWith(t)||e&&!Ka(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ui=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(Tn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},za=t=>J(0,255,t),ge={...bt,transform:t=>Math.round(za(t))},lt={test:bn("rgb","red"),parse:Ui("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ge.transform(t)+", "+ge.transform(e)+", "+ge.transform(n)+", "+Vt(Rt.transform(s))+")"};function Ga(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const ke={test:bn("#"),parse:Ga,transform:lt.transform},ft={test:bn("hsl","hue"),parse:Ui("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+W.transform(Vt(e))+", "+W.transform(Vt(n))+", "+Vt(Rt.transform(s))+")"},F={test:t=>lt.test(t)||ke.test(t)||ft.test(t),parse:t=>lt.test(t)?lt.parse(t):ft.test(t)?ft.parse(t):ke.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?lt.transform(t):ft.transform(t)},Ha=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ya(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Tn))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Ha))===null||n===void 0?void 0:n.length)||0)>0}const $i="number",Ki="color",Xa="var",qa="var(",Kn="${}",Za=/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 kt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(Za,l=>(F.test(l)?(s.color.push(o),i.push(Ki),n.push(F.parse(l))):l.startsWith(qa)?(s.var.push(o),i.push(Xa),n.push(l)):(s.number.push(o),i.push($i),n.push(parseFloat(l))),++o,Kn)).split(Kn);return{values:n,split:a,indexes:s,types:i}}function Wi(t){return kt(t).values}function zi(t){const{split:e,types:n}=kt(t),s=e.length;return i=>{let o="";for(let r=0;rtypeof t=="number"?0:t;function Qa(t){const e=Wi(t);return zi(t)(e.map(Ja))}const nt={test:Ya,parse:Wi,createTransformer:zi,getAnimatableNone:Qa},tl=new Set(["brightness","contrast","saturate","opacity"]);function el(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Tn)||[];if(!s)return t;const i=n.replace(s,"");let o=tl.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const nl=/\b([a-z-]*)\(.*?\)/gu,Fe={...nt,getAnimatableNone:t=>{const e=t.match(nl);return e?e.map(el).join(" "):t}},sl={...rn,color:F,backgroundColor:F,outlineColor:F,fill:F,stroke:F,borderColor:F,borderTopColor:F,borderRightColor:F,borderBottomColor:F,borderLeftColor:F,filter:Fe,WebkitFilter:Fe},Pn=t=>sl[t];function Gi(t,e){let n=Pn(t);return n!==Fe&&(n=nt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const il=new Set(["auto","none","0"]);function rl(t,e,n){let s=0,i;for(;st===bt||t===P,zn=(t,e)=>parseFloat(t.split(", ")[e]),Gn=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return zn(i[1],e);{const o=s.match(/^matrix\((.+)\)$/u);return o?zn(o[1],t):0}},ol=new Set(["x","y","z"]),al=Tt.filter(t=>!ol.has(t));function ll(t){const e=[];return al.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const xt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Gn(4,13),y:Gn(5,14)};xt.translateX=xt.x;xt.translateY=xt.y;const ut=new Set;let je=!1,Be=!1;function Hi(){if(Be){const t=Array.from(ut).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=ll(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{var a;(a=s.getValue(o))===null||a===void 0||a.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Be=!1,je=!1,ut.forEach(t=>t.complete()),ut.clear()}function Yi(){ut.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Be=!0)})}function ul(){Yi(),Hi()}class wn{constructor(e,n,s,i,o,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ut.add(this),je||(je=!0,V.read(Yi),V.resolveKeyframes(Hi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let o=0;o/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),cl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function hl(t){const e=cl.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function qi(t,e,n=1){const[s,i]=hl(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return Xi(r)?parseFloat(r):r}return sn(i)?qi(i,e,n+1):i}const Zi=t=>e=>e.test(t),dl={test:t=>t==="auto",parse:t=>t},Ji=[bt,P,W,Q,ea,ta,dl],Hn=t=>Ji.find(Zi(t));class Qi extends wn{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Yn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(nt.test(t)||t==="0")&&!t.startsWith("url("));function fl(t){const e=t[0];if(t.length===1)return!0;for(let n=0;nt!==null;function he(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ml),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return!o||s===void 0?i[o]:s}const gl=40;class tr{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=z.now(),this.options={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>gl?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&ul(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=z.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:o,delay:r,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!pl(e,s,i,o))if(r)this.options.duration=0;else{l&&l(he(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const C=(t,e,n)=>t+(e-t)*n;function ye(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function yl({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=ye(l,a,t+1/3),o=ye(l,a,t),r=ye(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function Qt(t,e){return n=>n>0?e:t}const ve=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},vl=[ke,lt,ft],xl=t=>vl.find(e=>e.test(t));function Xn(t){const e=xl(t);if(!e)return!1;let n=e.parse(t);return e===ft&&(n=yl(n)),n}const qn=(t,e)=>{const n=Xn(t),s=Xn(e);if(!n||!s)return Qt(t,e);const i={...n};return o=>(i.red=ve(n.red,s.red,o),i.green=ve(n.green,s.green,o),i.blue=ve(n.blue,s.blue,o),i.alpha=C(n.alpha,s.alpha,o),lt.transform(i))},Tl=(t,e)=>n=>e(t(n)),It=(...t)=>t.reduce(Tl),Oe=new Set(["none","hidden"]);function bl(t,e){return Oe.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Pl(t,e){return n=>C(t,e,n)}function Sn(t){return typeof t=="number"?Pl:typeof t=="string"?sn(t)?Qt:F.test(t)?qn:Al:Array.isArray(t)?er:typeof t=="object"?F.test(t)?qn:wl:Qt}function er(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>Sn(o)(o,e[r]));return o=>{for(let r=0;r{for(const o in s)n[o]=s[o](i);return n}}function Sl(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let o=0;o{const n=nt.createTransformer(e),s=kt(t),i=kt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Oe.has(t)&&!i.values.length||Oe.has(e)&&!s.values.length?bl(t,e):It(er(Sl(s,i),i.values),n):Qt(t,e)};function nr(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?C(t,e,n):Sn(t)(t,e)}const Vl=5;function sr(t,e,n){const s=Math.max(e-Vl,0);return Ei(n-t(s),e-s)}const D={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},xe=.001;function Cl({duration:t=D.duration,bounce:e=D.bounce,velocity:n=D.velocity,mass:s=D.mass}){let i,o,r=1-e;r=J(D.minDamping,D.maxDamping,r),t=J(D.minDuration,D.maxDuration,q(t)),r<1?(i=u=>{const c=u*r,h=c*t,d=c-n,f=Ie(u,r),m=Math.exp(-h);return xe-d/f*m},o=u=>{const h=u*r*t,d=h*n+n,f=Math.pow(r,2)*Math.pow(u,2)*t,m=Math.exp(-h),g=Ie(Math.pow(u,2),r);return(-i(u)+xe>0?-1:1)*((d-f)*m)/g}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-xe+c*h},o=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=Ml(i,o,a);if(t=X(t),isNaN(l))return{stiffness:D.stiffness,damping:D.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const Dl=12;function Ml(t,e,n){let s=n;for(let i=1;it[n]!==void 0)}function Ll(t){let e={velocity:D.velocity,stiffness:D.stiffness,damping:D.damping,mass:D.mass,isResolvedFromDuration:!1,...t};if(!Zn(t,Rl)&&Zn(t,El))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*J(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:D.mass,stiffness:i,damping:o}}else{const n=Cl(t);e={...e,...n,mass:D.mass},e.isResolvedFromDuration=!0}return e}function ir(t=D.visualDuration,e=D.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:f}=Ll({...n,velocity:-q(n.velocity||0)}),m=d||0,g=u/(2*Math.sqrt(l*c)),y=r-o,v=q(Math.sqrt(l/c)),T=Math.abs(y)<5;s||(s=T?D.restSpeed.granular:D.restSpeed.default),i||(i=T?D.restDelta.granular:D.restDelta.default);let x;if(g<1){const b=Ie(v,g);x=A=>{const M=Math.exp(-g*v*A);return r-M*((m+g*v*y)/b*Math.sin(b*A)+y*Math.cos(b*A))}}else if(g===1)x=b=>r-Math.exp(-v*b)*(y+(m+v*y)*b);else{const b=v*Math.sqrt(g*g-1);x=A=>{const M=Math.exp(-g*v*A),S=Math.min(b*A,300);return r-M*((m+g*v*y)*Math.sinh(S)+b*y*Math.cosh(S))/b}}const w={calculatedDuration:f&&h||null,next:b=>{const A=x(b);if(f)a.done=b>=h;else{let M=0;g<1&&(M=b===0?X(m):sr(x,b,A));const S=Math.abs(M)<=s,k=Math.abs(r-A)<=i;a.done=S&&k}return a.value=a.done?r:A,a},toString:()=>{const b=Math.min(Pi(w),Ee),A=wi(M=>w.next(b*M).value,b,30);return b+"ms "+A}};return w}function Jn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},f=S=>a!==void 0&&Sl,m=S=>a===void 0?l:l===void 0||Math.abs(a-S)-g*Math.exp(-S/s),x=S=>v+T(S),w=S=>{const k=T(S),N=x(S);d.done=Math.abs(k)<=u,d.value=d.done?v:N};let b,A;const M=S=>{f(d.value)&&(b=S,A=ir({keyframes:[d.value,m(d.value)],velocity:sr(x,S,d.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return M(0),{calculatedDuration:null,next:S=>{let k=!1;return!A&&b===void 0&&(k=!0,w(S),M(S)),b!==void 0&&S>=b?A.next(S-b):(!k&&w(S),d)}}}const kl=Ot(.42,0,1,1),Fl=Ot(0,0,.58,1),rr=Ot(.42,0,.58,1),jl=t=>Array.isArray(t)&&typeof t[0]!="number",Bl={linear:O,easeIn:kl,easeInOut:rr,easeOut:Fl,circIn:xn,circInOut:Ni,circOut:Ii,backIn:vn,backInOut:Bi,backOut:ji,anticipate:Oi},Qn=t=>{if(fn(t)){ni(t.length===4);const[e,n,s,i]=t;return Ot(e,n,s,i)}else if(typeof t=="string")return Bl[t];return t};function Ol(t,e,n){const s=[],i=n||nr,o=t.length-1;for(let r=0;re[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Ol(e,s,i),l=a.length,u=c=>{if(r&&c1)for(;hu(J(t[0],t[o-1],c)):u}function Nl(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=yt(0,e,s);t.push(C(n,1,i))}}function _l(t){const e=[0];return Nl(e,t.length-1),e}function Ul(t,e){return t.map(n=>n*e)}function $l(t,e){return t.map(()=>e||rr).splice(0,t.length-1)}function te({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=jl(s)?s.map(Qn):Qn(s),o={done:!1,value:e[0]},r=Ul(n&&n.length===e.length?n:_l(e),t),a=Il(r,e,{ease:Array.isArray(i)?i:$l(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const Kl=t=>{const e=({timestamp:n})=>t(n);return{start:()=>V.update(e,!0),stop:()=>et(e),now:()=>L.isProcessing?L.timestamp:z.now()}},Wl={decay:Jn,inertia:Jn,tween:te,keyframes:te,spring:ir},zl=t=>t/100;class An extends tr{constructor(e){super(e),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:s,element:i,keyframes:o}=this.options,r=(i==null?void 0:i.KeyframeResolver)||wn,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new r(o,a,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=this.options,a=dn(n)?n:Wl[n]||te;let l,u;a!==te&&typeof e[0]!="number"&&(l=It(zl,nr(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});o==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-r})),c.calculatedDuration===null&&(c.calculatedDuration=Pi(c));const{calculatedDuration:h}=c,d=h+i,f=d*(s+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:d,totalDuration:f}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:S}=this.options;return{done:!0,value:S[S.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:r,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:h}=s;if(this.startTime===null)return o.next(0);const{delay:d,repeat:f,repeatType:m,repeatDelay:g,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const v=this.currentTime-d*(this.speed>=0?1:-1),T=this.speed>=0?v<0:v>c;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let x=this.currentTime,w=o;if(f){const S=Math.min(this.currentTime,c)/h;let k=Math.floor(S),N=S%1;!N&&S>=1&&(N=1),N===1&&k--,k=Math.min(k,f+1),!!(k%2)&&(m==="reverse"?(N=1-N,g&&(N-=g/h)):m==="mirror"&&(w=r)),x=J(0,1,N)*h}const b=T?{done:!1,value:l[0]}:w.next(x);a&&(b.value=a(b.value));let{done:A}=b;!T&&u!==null&&(A=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return M&&i!==void 0&&(b.value=he(l,this.options,i)),y&&y(b.value),M&&this.finish(),b}get duration(){const{resolved:e}=this;return e?q(e.calculatedDuration):0}get time(){return q(this.currentTime)}set time(e){e=X(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=q(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Kl,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}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()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Gl=new Set(["opacity","clipPath","filter","transform"]);function Hl(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=Ai(a,i);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"})}const Yl=qe(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ee=10,Xl=2e4;function ql(t){return dn(t.type)||t.type==="spring"||!Si(t.ease)}function Zl(t,e){const n=new An({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let o=0;for(;!s.done&&othis.onKeyframesResolved(r,a),n,s,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:s=300,times:i,ease:o,type:r,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof o=="string"&&Jt()&&Jl(o)&&(o=or[o]),ql(this.options)){const{onComplete:h,onUpdate:d,motionValue:f,element:m,...g}=this.options,y=Zl(e,g);e=y.keyframes,e.length===1&&(e[1]=e[0]),s=y.duration,i=y.times,o=y.ease,r="keyframes"}const c=Hl(a.owner.current,l,e,{...this.options,duration:s,times:i,ease:o});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(In(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:h}=this.options;a.set(he(e,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:s,times:i,type:r,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return q(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return q(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=X(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return O;const{animation:s}=n;In(s,e)}return O}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:i,type:o,ease:r,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:h,element:d,...f}=this.options,m=new An({...f,keyframes:s,duration:i,type:o,ease:r,times:a,isGenerator:!0}),g=X(this.time);u.setWithVelocity(m.sample(g-ee).value,m.sample(g).value,ee)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:i,repeatType:o,damping:r,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return Yl()&&s&&Gl.has(s)&&!l&&!u&&!i&&o!=="mirror"&&r!==0&&a!=="inertia"}}const Ql={type:"spring",stiffness:500,damping:25,restSpeed:10},tu=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),eu={type:"keyframes",duration:.8},nu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},su=(t,{keyframes:e})=>e.length>2?eu:ct.has(t)?t.startsWith("scale")?tu(e[1]):Ql:nu;function iu({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const Vn=(t,e,n,s={},i,o)=>r=>{const a=hn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-X(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};iu(a)||(c={...c,...su(t,c)}),c.duration&&(c.duration=X(c.duration)),c.repeatDelay&&(c.repeatDelay=X(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(h=!0)),h&&!o&&e.get()!==void 0){const d=he(c.keyframes,a);if(d!==void 0)return V.update(()=>{c.onUpdate(d),c.onComplete()}),new wa([])}return!o&&ts.supports(c)?new ts(c):new An(c)};function ru({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function ar(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(r=s);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const h in l){const d=t.getValue(h,(o=t.latestValues[h])!==null&&o!==void 0?o:null),f=l[h];if(f===void 0||c&&ru(c,h))continue;const m={delay:n,...hn(r||{},h)};let g=!1;if(window.MotionHandoffAnimation){const v=Ri(t);if(v){const T=window.MotionHandoffAnimation(v,h,V);T!==null&&(m.startTime=T,g=!0)}}Le(t,h),d.start(Vn(h,d,f,t.shouldReduceMotion&&Mi.has(h)?{type:!1}:m,t,g));const y=d.animation;y&&u.push(y)}return a&&Promise.all(u).then(()=>{V.update(()=>{a&&Oa(t,a)})}),u}function Ne(t,e,n={}){var s;const i=ce(t,e,n.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const r=i?()=>Promise.all(ar(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:d}=o;return ou(t,e,c+u,h,d,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,c]=l==="beforeChildren"?[r,a]:[a,r];return u().then(()=>c())}else return Promise.all([r(),a(n.delay)])}function ou(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=i===1?(u=0)=>u*s:(u=0)=>a-u*s;return Array.from(t.variantChildren).sort(au).forEach((u,c)=>{u.notify("AnimationStart",e),r.push(Ne(u,e,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(r)}function au(t,e){return t.sortNodePosition(e)}function lu(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>Ne(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=Ne(t,e,n);else{const i=typeof e=="function"?ce(t,e,n.custom):e;s=Promise.all(ar(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const uu=Je.length;function lr(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?lr(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;nPromise.all(e.map(({animation:n,options:s})=>lu(t,n,s)))}function fu(t){let e=du(t),n=es(),s=!0;const i=l=>(u,c)=>{var h;const d=ce(t,c,l==="exit"?(h=t.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(d){const{transition:f,transitionEnd:m,...g}=d;u={...u,...g,...m}}return u};function o(l){e=l(t)}function r(l){const{props:u}=t,c=lr(t.parent)||{},h=[],d=new Set;let f={},m=1/0;for(let y=0;ym&&w,k=!1;const N=Array.isArray(x)?x:[x];let ht=N.reduce(i(v),{});b===!1&&(ht={});const{prevResolvedValues:Cn={}}=T,Mr={...Cn,...ht},Dn=B=>{S=!0,d.has(B)&&(k=!0,d.delete(B)),T.needsAnimating[B]=!0;const G=t.getValue(B);G&&(G.liveStyle=!1)};for(const B in Mr){const G=ht[B],de=Cn[B];if(f.hasOwnProperty(B))continue;let fe=!1;Me(G)&&Me(de)?fe=!bi(G,de):fe=G!==de,fe?G!=null?Dn(B):d.add(B):G!==void 0&&d.has(B)?Dn(B):T.protectedKeys[B]=!0}T.prevProp=x,T.prevResolvedValues=ht,T.isActive&&(f={...f,...ht}),s&&t.blockInitialAnimation&&(S=!1),S&&(!(A&&M)||k)&&h.push(...N.map(B=>({animation:B,options:{type:v}})))}if(d.size){const y={};d.forEach(v=>{const T=t.getBaseTarget(v),x=t.getValue(v);x&&(x.liveStyle=!0),y[v]=T??null}),h.push({animation:y})}let g=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,g?e(h):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(d=>{var f;return(f=d.animationState)===null||f===void 0?void 0:f.setActive(l,u)}),n[l].isActive=u;const h=r(l);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=es(),s=!0}}}function pu(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!bi(e,t):!1}function rt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function es(){return{animate:rt(!0),whileInView:rt(),whileHover:rt(),whileTap:rt(),whileDrag:rt(),whileFocus:rt(),exit:rt()}}class it{constructor(e){this.isMounted=!1,this.node=e}update(){}}class mu extends it{constructor(e){super(e),e.animationState||(e.animationState=fu(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();le(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let gu=0;class yu extends it{constructor(){super(...arguments),this.id=gu++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const vu={animation:{Feature:mu},exit:{Feature:yu}};function Ft(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Nt(t){return{point:{x:t.pageX,y:t.pageY}}}const xu=t=>e=>pn(e)&&t(e,Nt(e));function Ct(t,e,n,s){return Ft(t,e,xu(n),s)}const ns=(t,e)=>Math.abs(t-e);function Tu(t,e){const n=ns(t.x,e.x),s=ns(t.y,e.y);return Math.sqrt(n**2+s**2)}class ur{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=be(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,f=Tu(h.offset,{x:0,y:0})>=3;if(!d&&!f)return;const{point:m}=h,{timestamp:g}=L;this.history.push({...m,timestamp:g});const{onStart:y,onMove:v}=this.handlers;d||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,d)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Te(d,this.transformPagePoint),V.update(this.updatePoint,!0)},this.handlePointerUp=(h,d)=>{this.end();const{onEnd:f,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=be(h.type==="pointercancel"?this.lastMoveEventInfo:Te(d,this.transformPagePoint),this.history);this.startEvent&&f&&f(h,y),m&&m(h,y)},!pn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const r=Nt(e),a=Te(r,this.transformPagePoint),{point:l}=a,{timestamp:u}=L;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,be(a,this.history)),this.removeListeners=It(Ct(this.contextWindow,"pointermove",this.handlePointerMove),Ct(this.contextWindow,"pointerup",this.handlePointerUp),Ct(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),et(this.updatePoint)}}function Te(t,e){return e?{point:e(t.point)}:t}function ss(t,e){return{x:t.x-e.x,y:t.y-e.y}}function be({point:t},e){return{point:t,delta:ss(t,cr(e)),offset:ss(t,bu(e)),velocity:Pu(e,.1)}}function bu(t){return t[0]}function cr(t){return t[t.length-1]}function Pu(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=cr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>X(e)));)n--;if(!s)return{x:0,y:0};const o=q(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}const hr=1e-4,wu=1-hr,Su=1+hr,dr=.01,Au=0-dr,Vu=0+dr;function I(t){return t.max-t.min}function Cu(t,e,n){return Math.abs(t-e)<=n}function is(t,e,n,s=.5){t.origin=s,t.originPoint=C(e.min,e.max,t.origin),t.scale=I(n)/I(e),t.translate=C(n.min,n.max,t.origin)-t.originPoint,(t.scale>=wu&&t.scale<=Su||isNaN(t.scale))&&(t.scale=1),(t.translate>=Au&&t.translate<=Vu||isNaN(t.translate))&&(t.translate=0)}function Dt(t,e,n,s){is(t.x,e.x,n.x,s?s.originX:void 0),is(t.y,e.y,n.y,s?s.originY:void 0)}function rs(t,e,n){t.min=n.min+e.min,t.max=t.min+I(e)}function Du(t,e,n){rs(t.x,e.x,n.x),rs(t.y,e.y,n.y)}function os(t,e,n){t.min=e.min-n.min,t.max=t.min+I(e)}function Mt(t,e,n){os(t.x,e.x,n.x),os(t.y,e.y,n.y)}function Mu(t,{min:e,max:n},s){return e!==void 0&&tn&&(t=s?C(n,t,s.max):Math.min(t,n)),t}function as(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Eu(t,{top:e,left:n,bottom:s,right:i}){return{x:as(t.x,n,i),y:as(t.y,e,s)}}function ls(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.mins?n=yt(e.min,e.max-s,t.min):s>i&&(n=yt(t.min,t.max-i,e.min)),J(0,1,n)}function ku(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const _e=.35;function Fu(t=_e){return t===!1?t=0:t===!0&&(t=_e),{x:us(t,"left","right"),y:us(t,"top","bottom")}}function us(t,e,n){return{min:cs(t,e),max:cs(t,n)}}function cs(t,e){return typeof t=="number"?t:t[e]||0}const hs=()=>({translate:0,scale:1,origin:0,originPoint:0}),pt=()=>({x:hs(),y:hs()}),ds=()=>({min:0,max:0}),E=()=>({x:ds(),y:ds()});function U(t){return[t("x"),t("y")]}function fr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function ju({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Bu(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Pe(t){return t===void 0||t===1}function Ue({scale:t,scaleX:e,scaleY:n}){return!Pe(t)||!Pe(e)||!Pe(n)}function ot(t){return Ue(t)||pr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function pr(t){return fs(t.x)||fs(t.y)}function fs(t){return t&&t!=="0%"}function ne(t,e,n){const s=t-n,i=e*s;return n+i}function ps(t,e,n,s,i){return i!==void 0&&(t=ne(t,i,s)),ne(t,n,s)+e}function $e(t,e=0,n=1,s,i){t.min=ps(t.min,e,n,s,i),t.max=ps(t.max,e,n,s,i)}function mr(t,{x:e,y:n}){$e(t.x,e.translate,e.scale,e.originPoint),$e(t.y,n.translate,n.scale,n.originPoint)}const ms=.999999999999,gs=1.0000000000001;function Ou(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;ams&&(e.x=1),e.yms&&(e.y=1)}function mt(t,e){t.min=t.min+e,t.max=t.max+e}function ys(t,e,n,s,i=.5){const o=C(t.min,t.max,i);$e(t,e,n,o,s)}function gt(t,e){ys(t.x,e.x,e.scaleX,e.scale,e.originX),ys(t.y,e.y,e.scaleY,e.scale,e.originY)}function gr(t,e){return fr(Bu(t.getBoundingClientRect(),e))}function Iu(t,e,n){const s=gr(t,n),{scroll:i}=e;return i&&(mt(s.x,i.offset.x),mt(s.y,i.offset.y)),s}const yr=({current:t})=>t?t.ownerDocument.defaultView:null,Nu=new WeakMap;class _u{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=E(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Nt(c).point)},o=(c,h)=>{const{drag:d,dragPropagation:f,onDragStart:m}=this.getProps();if(d&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=La(d),!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),U(y=>{let v=this.getAxisMotionValue(y).get()||0;if(W.test(v)){const{projection:T}=this.visualElement;if(T&&T.layout){const x=T.layout.layoutBox[y];x&&(v=I(x)*(parseFloat(v)/100))}}this.originPoint[y]=v}),m&&V.postRender(()=>m(c,h)),Le(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},r=(c,h)=>{const{dragPropagation:d,dragDirectionLock:f,onDirectionLock:m,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=h;if(f&&this.currentDirection===null){this.currentDirection=Uu(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),g&&g(c,h)},a=(c,h)=>this.stop(c,h),l=()=>U(c=>{var h;return this.getAnimationState(c)==="paused"&&((h=this.getAxisMotionValue(c).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new ur(e,{onSessionStart:i,onStart:o,onMove:r,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:yr(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&V.postRender(()=>o(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Wt(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=Mu(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,o=this.constraints;n&&dt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Eu(i.layoutBox,n):this.constraints=!1,this.elastic=Fu(s),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&U(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=ku(i.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!dt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Iu(s,i.root,this.visualElement.getTransformPagePoint());let r=Ru(i.layout.layoutBox,o);if(n){const a=n(ju(r));this.hasMutatedConstraints=!!a,a&&(r=fr(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=U(c=>{if(!Wt(c,n,this.currentDirection))return;let h=l&&l[c]||{};r&&(h={min:0,max:0});const d=i?200:1e6,f=i?40:1e7,m={type:"inertia",velocity:s?e[c]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Le(this.visualElement,e),s.start(Vn(e,s,0,n,this.visualElement,!1))}stopAnimation(){U(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){U(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){U(n=>{const{drag:s}=this.getProps();if(!Wt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n];o.set(e[n]-C(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!dt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};U(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=Lu({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),U(r=>{if(!Wt(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:u}=this.constraints[r];a.set(C(l,u,i[r]))})}addListeners(){if(!this.visualElement.current)return;Nu.set(this.visualElement,this);const e=this.visualElement.current,n=Ct(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();dt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),V.read(s);const r=Ft(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(U(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())});return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=_e,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Wt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Uu(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class $u extends it{constructor(e){super(e),this.removeGroupControls=O,this.removeListeners=O,this.controls=new _u(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||O}unmount(){this.removeGroupControls(),this.removeListeners()}}const vs=t=>(e,n)=>{t&&V.postRender(()=>t(e,n))};class Ku extends it{constructor(){super(...arguments),this.removePointerDownListener=O}onPointerDown(e){this.session=new ur(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:yr(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:vs(e),onStart:vs(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&V.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Ct(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Yt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function xs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Pt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(P.test(t))t=parseFloat(t);else return t;const n=xs(t,e.target.x),s=xs(t,e.target.y);return`${n}% ${s}%`}},Wu={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=nt.parse(t);if(i.length>5)return s;const o=nt.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const u=C(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}};class zu extends p.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;ha(Gu),o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Yt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,r=s.projection;return r&&(r.isPresent=o,i||e.layoutDependency!==n||n===void 0?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||V.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),tn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function vr(t){const[e,n]=ti(),s=p.useContext(Ge);return Y.jsx(zu,{...t,layoutGroup:s,switchLayoutGroup:p.useContext(li),isPresent:e,safeToRemove:n})}const Gu={borderRadius:{...Pt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Pt,borderTopRightRadius:Pt,borderBottomLeftRadius:Pt,borderBottomRightRadius:Pt,boxShadow:Wu};function Hu(t,e,n){const s=j(t)?t:Lt(t);return s.start(Vn("",s,e,n)),s.animation}function Yu(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Xu=(t,e)=>t.depth-e.depth;class qu{constructor(){this.children=[],this.isDirty=!1}add(e){mn(this.children,e),this.isDirty=!0}remove(e){gn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Xu),this.isDirty=!1,this.children.forEach(e)}}function Zu(t,e){const n=z.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(et(s),t(o-e))};return V.read(s,!0),()=>et(s)}const xr=["TopLeft","TopRight","BottomLeft","BottomRight"],Ju=xr.length,Ts=t=>typeof t=="string"?parseFloat(t):t,bs=t=>typeof t=="number"||P.test(t);function Qu(t,e,n,s,i,o){i?(t.opacity=C(0,n.opacity!==void 0?n.opacity:1,tc(s)),t.opacityExit=C(e.opacity!==void 0?e.opacity:1,0,ec(s))):o&&(t.opacity=C(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let r=0;rse?1:n(yt(t,e,s))}function ws(t,e){t.min=e.min,t.max=e.max}function _(t,e){ws(t.x,e.x),ws(t.y,e.y)}function Ss(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function As(t,e,n,s,i){return t-=e,t=ne(t,1/n,s),i!==void 0&&(t=ne(t,1/i,s)),t}function nc(t,e=0,n=1,s=.5,i,o=t,r=t){if(W.test(e)&&(e=parseFloat(e),e=C(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=C(o.min,o.max,s);t===o&&(a-=e),t.min=As(t.min,e,n,a,i),t.max=As(t.max,e,n,a,i)}function Vs(t,e,[n,s,i],o,r){nc(t,e[n],e[s],e[i],e.scale,o,r)}const sc=["x","scaleX","originX"],ic=["y","scaleY","originY"];function Cs(t,e,n,s){Vs(t.x,e,sc,n?n.x:void 0,s?s.x:void 0),Vs(t.y,e,ic,n?n.y:void 0,s?s.y:void 0)}function Ds(t){return t.translate===0&&t.scale===1}function br(t){return Ds(t.x)&&Ds(t.y)}function Ms(t,e){return t.min===e.min&&t.max===e.max}function rc(t,e){return Ms(t.x,e.x)&&Ms(t.y,e.y)}function Es(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Pr(t,e){return Es(t.x,e.x)&&Es(t.y,e.y)}function Rs(t){return I(t.x)/I(t.y)}function Ls(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class oc{constructor(){this.members=[]}add(e){mn(this.members,e),e.scheduleRender()}remove(e){if(gn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ac(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=(n==null?void 0:n.z)||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:d,skewX:f,skewY:m}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),d&&(s+=`rotateY(${d}deg) `),f&&(s+=`skewX(${f}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const at={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},At=typeof window<"u"&&window.MotionDebug!==void 0,we=["","X","Y","Z"],lc={visibility:"hidden"},ks=1e3;let uc=0;function Se(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function wr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ri(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",V,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&wr(s)}function Sr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=uc++,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,At&&(at.totalNodes=at.resolvedTargetDeltas=at.recalculatedProjection=0),this.nodes.forEach(dc),this.nodes.forEach(yc),this.nodes.forEach(vc),this.nodes.forEach(fc),At&&window.MotionDebug.record(at)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,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;lthis.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=Zu(d,250),Yt.hasAnimatedSinceResize&&(Yt.hasAnimatedSinceResize=!1,this.nodes.forEach(js))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:d,hasRelativeTargetChanged:f,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||wc,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=c.getProps(),T=!this.targetLayout||!Pr(this.targetLayout,m)||f,x=!d&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||d&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,x);const w={...hn(g,"layout"),onPlay:y,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else d||js(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,et(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(xc),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&wr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}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{const b=w/1e3;Bs(h.x,r.x,b),Bs(h.y,r.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mt(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),bc(this.relativeTarget,this.relativeTargetOrigin,d,b),x&&rc(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=E()),_(x,this.relativeTarget)),g&&(this.animationValues=c,Qu(c,u,this.latestValues,b,T,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(et(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=V.update(()=>{Yt.hasAnimatedSinceResize=!0,this.currentAnimation=Hu(0,ks,{...r,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onComplete:()=>{r.onComplete&&r.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 r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ks),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=r;if(!(!a||!l||!u)){if(this!==r&&this.layout&&u&&Ar(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||E();const h=I(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const d=I(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+d}_(a,l),gt(a,c),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new oc),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var r;const{layoutId:a}=this.options;return a?((r=this.getStack())===null||r===void 0?void 0:r.lead)||this:this}getPrevLead(){var r;const{layoutId:a}=this.options;return a?(r=this.getStack())===null||r===void 0?void 0:r.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Se("z",r,u,this.animationValues);for(let c=0;c{var a;return(a=r.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(Fs),this.root.sharedNodes.clear()}}}function cc(t){t.updateLayout()}function hc(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:o}=t.options,r=n.source!==t.layout.source;o==="size"?U(h=>{const d=r?n.measuredBox[h]:n.layoutBox[h],f=I(d);d.min=s[h].min,d.max=d.min+f}):Ar(o,n.layoutBox,s)&&U(h=>{const d=r?n.measuredBox[h]:n.layoutBox[h],f=I(s[h]);d.max=d.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+f)});const a=pt();Dt(a,s,n.layoutBox);const l=pt();r?Dt(l,t.applyTransform(i,!0),n.measuredBox):Dt(l,s,n.layoutBox);const u=!br(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:f}=h;if(d&&f){const m=E();Mt(m,n.layoutBox,d.layoutBox);const g=E();Mt(g,s,f.layoutBox),Pr(m,g)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function dc(t){At&&at.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function fc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function pc(t){t.clearSnapshot()}function Fs(t){t.clearMeasurements()}function mc(t){t.isLayoutDirty=!1}function gc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function js(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function yc(t){t.resolveTargetDelta()}function vc(t){t.calcProjection()}function xc(t){t.resetSkewAndRotation()}function Tc(t){t.removeLeadSnapshot()}function Bs(t,e,n){t.translate=C(e.translate,0,n),t.scale=C(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Os(t,e,n,s){t.min=C(e.min,n.min,s),t.max=C(e.max,n.max,s)}function bc(t,e,n,s){Os(t.x,e.x,n.x,s),Os(t.y,e.y,n.y,s)}function Pc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const wc={duration:.45,ease:[.4,0,.1,1]},Is=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ns=Is("applewebkit/")&&!Is("chrome/")?Math.round:O;function _s(t){t.min=Ns(t.min),t.max=Ns(t.max)}function Sc(t){_s(t.x),_s(t.y)}function Ar(t,e,n){return t==="position"||t==="preserve-aspect"&&!Cu(Rs(e),Rs(n),.2)}function Ac(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const Vc=Sr({attachResizeListener:(t,e)=>Ft(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ae={current:void 0},Vr=Sr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ae.current){const t=new Vc({});t.mount(window),t.setOptions({layoutScroll:!0}),Ae.current=t}return Ae.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Cc={pan:{Feature:Ku},drag:{Feature:$u,ProjectionNode:Vr,MeasureLayout:vr}};function Us(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&V.postRender(()=>o(e,Nt(e)))}class Dc extends it{mount(){const{current:e}=this.node;e&&(this.unmount=Ca(e,n=>(Us(this.node,n,"Start"),s=>Us(this.node,s,"End"))))}unmount(){}}class Mc extends it{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=It(Ft(this.node.current,"focus",()=>this.onFocus()),Ft(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function $s(t,e,n){const{props:s}=t;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&V.postRender(()=>o(e,Nt(e)))}class Ec extends it{mount(){const{current:e}=this.node;e&&(this.unmount=Ra(e,n=>($s(this.node,n,"Start"),(s,{success:i})=>$s(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ke=new WeakMap,Ve=new WeakMap,Rc=t=>{const e=Ke.get(t.target);e&&e(t)},Lc=t=>{t.forEach(Rc)};function kc({root:t,...e}){const n=t||document;Ve.has(n)||Ve.set(n,{});const s=Ve.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Lc,{root:t,...e})),s[i]}function Fc(t,e,n){const s=kc(e);return Ke.set(t,n),s.observe(t),()=>{Ke.delete(t),s.unobserve(t)}}const jc={some:0,all:1};class Bc extends it{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:jc[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),d=u?c:h;d&&d(l)};return Fc(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Oc(e,n))&&this.startObserver()}unmount(){}}function Oc({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Ic={inView:{Feature:Bc},tap:{Feature:Ec},focus:{Feature:Mc},hover:{Feature:Dc}},Nc={layout:{ProjectionNode:Vr,MeasureLayout:vr}},We={current:null},Cr={current:!1};function _c(){if(Cr.current=!0,!!Xe)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>We.current=t.matches;t.addListener(e),e()}else We.current=!1}const Uc=[...Ji,F,nt],$c=t=>Uc.find(Zi(t)),Ks=new WeakMap;function Kc(t,e,n){for(const s in e){const i=e[s],o=n[s];if(j(i))t.addValue(s,i);else if(j(o))t.addValue(s,Lt(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,Lt(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Ws=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Wc{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=wn,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 f=z.now();this.renderScheduledAtthis.bindToMotionValue(s,n)),Cr.current||_c(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:We.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ks.delete(this.current),this.projection&&this.projection.unmount(),et(this.notifyUpdate),et(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=ct.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&V.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in vt){const n=vt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):E()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;sn.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Lt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){var s;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(s=this.getBaseTargetFromProps(this.props,e))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Xi(i)||_i(i))?i=parseFloat(i):!$c(i)&&nt.test(n)&&(i=Gi(e,n)),this.setBaseTarget(e,j(i)?i.get():i)),j(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const r=nn(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);r&&(i=r[e])}if(s&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!j(o)?o:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new yn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Dr extends Wc{constructor(){super(...arguments),this.KeyframeResolver=Qi}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;j(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function zc(t){return window.getComputedStyle(t)}class Gc extends Dr{constructor(){super(...arguments),this.type="html",this.renderInstance=mi}readValueFromInstance(e,n){if(ct.has(n)){const s=Pn(n);return s&&s.default||0}else{const s=zc(e),i=(di(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return gr(e,n)}build(e,n,s){on(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return cn(e,n,s)}}class Hc extends Dr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=E}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(ct.has(n)){const s=Pn(n);return s&&s.default||0}return n=gi.has(n)?n:Qe(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return xi(e,n,s)}build(e,n,s){an(e,n,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,s,i){yi(e,n,s,i)}mount(e){this.isSVGTag=un(e.tagName),super.mount(e)}}const Yc=(t,e)=>en(t)?new Hc(e):new Gc(e,{allowProjection:t!==p.Fragment}),Xc=Ta({...vu,...Ic,...Cc,...Nc},Yc),sh=jo(Xc);export{eh as A,Qc as F,Y as j,sh as m,th as z};