transformers-js-demos / assets /App-BNpxOcs9.js
dwb2023's picture
Update with latest build
95fc2fa
import{r as P,j as w}from"./index-DVHLcSXM.js";const ws=P.createContext({});function tr(t){const e=P.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ce=P.createContext(null),As=P.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function er(t=!0){const e=P.useContext(Ce);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 De=typeof window<"u",nr=De?P.useLayoutEffect:P.useEffect,I=t=>t;let Vs=I;const sr={useManualTiming:!1};function ir(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 jt=["read","resolveKeyframes","update","preRender","render","postRender"],rr=40;function Cs(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=jt.reduce((g,v)=>(g[v]=ir(o),g),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=r,f=()=>{const g=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,rr),1),i.timestamp=g,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:jt.reduce((g,v)=>{const x=r[v];return g[v]=(A,b=!1,V=!1)=>(n||m(),x.schedule(A,b,V)),g},{}),cancel:g=>{for(let v=0;v<jt.length;v++)r[jt[v]].cancel(g)},state:i,steps:r}}const{schedule:C,cancel:q,state:L,steps:Qt}=Cs(typeof requestAnimationFrame<"u"?requestAnimationFrame:I,!0),Ds=P.createContext({strict:!1}),ln={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"]},ht={};for(const t in ln)ht[t]={isEnabled:e=>ln[t].some(n=>!!e[n])};function or(t){for(const e in t)ht[e]={...ht[e],...t[e]}}const ar=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 Nt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ar.has(t)}let Ms=t=>!Nt(t);function lr(t){t&&(Ms=e=>e.startsWith("on")?!Nt(e):t(e))}try{lr(require("@emotion/is-prop-valid").default)}catch{}function ur(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Ms(i)||n===!0&&Nt(i)||!e&&!Nt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function cr(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 zt=P.createContext({});function wt(t){return typeof t=="string"||Array.isArray(t)}function Ht(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Me=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Re=["initial",...Me];function Xt(t){return Ht(t.animate)||Re.some(e=>wt(t[e]))}function Rs(t){return!!(Xt(t)||t.variants)}function hr(t,e){if(Xt(t)){const{initial:n,animate:s}=t;return{initial:n===!1||wt(n)?n:void 0,animate:wt(s)?s:void 0}}return t.inherit!==!1?e:{}}function dr(t){const{initial:e,animate:n}=hr(t,P.useContext(zt));return P.useMemo(()=>({initial:e,animate:n}),[un(e),un(n)])}function un(t){return Array.isArray(t)?t.join(" "):t}const fr=Symbol.for("motionComponentSymbol");function ot(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function mr(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):ot(n)&&(n.current=s))},[e])}const Ee=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),pr="framerAppearId",Es="data-"+Ee(pr),{schedule:Le}=Cs(queueMicrotask,!1),Ls=P.createContext({});function gr(t,e,n,s,i){var o,r;const{visualElement:a}=P.useContext(zt),l=P.useContext(Ds),u=P.useContext(Ce),c=P.useContext(As).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(Ls);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&yr(h.current,n,i,f);const m=P.useRef(!1);P.useInsertionEffect(()=>{d&&m.current&&d.update(n,u)});const p=n[Es],y=P.useRef(!!p&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,p))&&((r=window.MotionHasOptimisedAnimation)===null||r===void 0?void 0:r.call(window,p)));return nr(()=>{d&&(m.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),Le.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),P.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,p)}),y.current=!1))}),d}function yr(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:js(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&ot(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:u})}function js(t){if(t)return t.options.allowProjection!==!1?t.projection:js(t.parent)}function vr({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){var o,r;t&&or(t);function a(u,c){let h;const d={...P.useContext(As),...u,layoutId:xr(u)},{isStatic:f}=d,m=dr(u),p=s(u,f);if(!f&&De){Tr();const y=Pr(d);h=y.MeasureLayout,m.visualElement=gr(i,p,d,e,y.ProjectionNode)}return w.jsxs(zt.Provider,{value:m,children:[h&&m.visualElement?w.jsx(h,{visualElement:m.visualElement,...d}):null,n(i,u,mr(p,m.visualElement,c),p,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[fr]=i,l}function xr({layoutId:t}){const e=P.useContext(ws).id;return e&&t!==void 0?e+"-"+t:t}function Tr(t,e){P.useContext(Ds).strict}function Pr(t){const{drag:e,layout:n}=ht;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const br=["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 je(t){return typeof t!="string"||t.includes("-")?!1:!!(br.indexOf(t)>-1||/[A-Z]/u.test(t))}function cn(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Fe(t,e,n,s){if(typeof e=="function"){const[i,o]=cn(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]=cn(s);e=e(n!==void 0?n:t.custom,i,o)}return e}const he=t=>Array.isArray(t),Sr=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),wr=t=>he(t)?t[t.length-1]||0:t,F=t=>!!(t&&t.getVelocity);function Bt(t){const e=F(t)?t.get():t;return Sr(e)?e.toValue():e}function Ar({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},s,i,o){const r={latestValues:Vr(s,i,o,t),renderState:e()};return n&&(r.onMount=a=>n({props:s,current:a,...r}),r.onUpdate=a=>n(a)),r}const Fs=t=>(e,n)=>{const s=P.useContext(zt),i=P.useContext(Ce),o=()=>Ar(t,e,s,i);return n?o():tr(o)};function Vr(t,e,n,s){const i={},o=s(t,{});for(const d in o)i[d]=Bt(o[d]);let{initial:r,animate:a}=t;const l=Xt(t),u=Rs(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"&&!Ht(h)){const d=Array.isArray(h)?h:[h];for(let f=0;f<d.length;f++){const m=Fe(t,d[f]);if(m){const{transitionEnd:p,transition:y,...g}=m;for(const v in g){let x=g[v];if(Array.isArray(x)){const A=c?x.length-1:0;x=x[A]}x!==null&&(i[v]=x)}for(const v in p)i[v]=p[v]}}}return i}const mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],it=new Set(mt),ks=t=>e=>typeof e=="string"&&e.startsWith(t),Bs=ks("--"),Cr=ks("var(--"),ke=t=>Cr(t)?Dr.test(t.split("/*")[0].trim()):!1,Dr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Is=(t,e)=>e&&typeof t=="number"?e.transform(t):t,X=(t,e,n)=>n>e?e:n<t?t:n,pt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},At={...pt,transform:t=>X(0,1,t)},Ft={...pt,default:1},Mt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Y=Mt("deg"),W=Mt("%"),T=Mt("px"),Mr=Mt("vh"),Rr=Mt("vw"),hn={...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(t*100)},Er={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,backgroundPositionX:T,backgroundPositionY:T},Lr={rotate:Y,rotateX:Y,rotateY:Y,rotateZ:Y,scale:Ft,scaleX:Ft,scaleY:Ft,scaleZ:Ft,skew:Y,skewX:Y,skewY:Y,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:At,originX:hn,originY:hn,originZ:T},dn={...pt,transform:Math.round},Be={...Er,...Lr,zIndex:dn,size:T,fillOpacity:At,strokeOpacity:At,numOctaves:dn},jr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Fr=mt.length;function kr(t,e,n){let s="",i=!0;for(let o=0;o<Fr;o++){const r=mt[o],a=t[r];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(r.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Is(a,Be[r]);if(!l){i=!1;const c=jr[r]||r;s+=`${c}(${u}) `}n&&(e[r]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Ie(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const u=e[l];if(it.has(l)){r=!0;continue}else if(Bs(l)){i[l]=u;continue}else{const c=Is(u,Be[l]);l.startsWith("origin")?(a=!0,o[l]=c):s[l]=c}}if(e.transform||(r||n?s.transform=kr(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=o;s.transformOrigin=`${l} ${u} ${c}`}}const Br={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ir={offset:"strokeDashoffset",array:"strokeDasharray"};function Or(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?Br:Ir;t[o.offset]=T.transform(-s);const r=T.transform(e),a=T.transform(n);t[o.array]=`${r} ${a}`}function fn(t,e,n){return typeof t=="string"?t:T.transform(e+n*t)}function Nr(t,e,n){const s=fn(e,t.x,t.width),i=fn(n,t.y,t.height);return`${s} ${i}`}function Oe(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(Ie(t,u,h),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:f,dimensions:m}=t;d.transform&&(m&&(f.transform=d.transform),delete d.transform),m&&(i!==void 0||o!==void 0||f.transform)&&(f.transformOrigin=Nr(m,i!==void 0?i:.5,o!==void 0?o:.5)),e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&Or(d,r,a,l,!1)}const Ne=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Os=()=>({...Ne(),attrs:{}}),Ue=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Ns(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 Us=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 _s(t,e,n,s){Ns(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Us.has(i)?i:Ee(i),e.attrs[i])}const Ut={};function Ur(t){Object.assign(Ut,t)}function Ks(t,{layout:e,layoutId:n}){return it.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ut[t]||t==="opacity")}function _e(t,e,n){var s;const{style:i}=t,o={};for(const r in i)(F(i[r])||e.style&&F(e.style[r])||Ks(r,t)||((s=n?.getValue(r))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(o[r]=i[r]);return o}function Ws(t,e,n){const s=_e(t,e,n);for(const i in t)if(F(t[i])||F(e[i])){const o=mt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}function _r(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 mn=["x","y","width","height","cx","cy","r"],Kr={useVisualState:Fs({scrapeMotionValuesFromProps:Ws,createRenderState:Os,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(it.has(a)){o=!0;break}}if(!o)return;let r=!e;if(e)for(let a=0;a<mn.length;a++){const l=mn[a];t[l]!==e[l]&&(r=!0)}r&&C.read(()=>{_r(n,s),C.render(()=>{Oe(s,i,Ue(n.tagName),t.transformTemplate),_s(n,s)})})}})},Wr={useVisualState:Fs({scrapeMotionValuesFromProps:_e,createRenderState:Ne})};function Gs(t,e,n){for(const s in e)!F(e[s])&&!Ks(s,n)&&(t[s]=e[s])}function Gr({transformTemplate:t},e){return P.useMemo(()=>{const n=Ne();return Ie(n,e,t),Object.assign({},n.vars,n.style)},[e])}function $r(t,e){const n=t.style||{},s={};return Gs(s,n,t),Object.assign(s,Gr(t,e)),s}function zr(t,e){const n={},s=$r(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 Hr(t,e,n,s){const i=P.useMemo(()=>{const o=Os();return Oe(o,e,Ue(s),t.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Gs(o,t.style,t),i.style={...o,...i.style}}return i}function Xr(t=!1){return(n,s,i,{latestValues:o},r)=>{const l=(je(n)?Hr:zr)(s,o,r,n),u=ur(s,typeof n=="string",t),c=n!==P.Fragment?{...u,...l,ref:i}:{},{children:h}=s,d=P.useMemo(()=>F(h)?h.get():h,[h]);return P.createElement(n,{...c,children:d})}}function Yr(t,e){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const r={...je(s)?Kr:Wr,preloadedFeatures:t,useRender:Xr(i),createVisualElement:e,Component:s};return vr(r)}}function $s(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function Yt(t,e,n){const s=t.getProps();return Fe(s,e,n!==void 0?n:s.custom,t)}function Ke(t,e){return t?t[e]||t.default||t:void 0}const zs=new Set(["width","height","top","left","right","bottom",...mt]);let It;function qr(){It=void 0}const G={now:()=>(It===void 0&&G.set(L.isProcessing||sr.useManualTiming?L.timestamp:performance.now()),It),set:t=>{It=t,queueMicrotask(qr)}};function We(t,e){t.indexOf(e)===-1&&t.push(e)}function Ge(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class $e{constructor(){this.subscriptions=[]}add(e){return We(this.subscriptions,e),()=>Ge(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<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Hs(t,e){return e?t*(1e3/e):0}const pn=30,Zr=t=>!isNaN(parseFloat(t));class Jr{constructor(e,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const o=G.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=G.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Zr(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 $e);const s=this.events[e].add(n);return e==="change"?()=>{s(),C.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=G.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>pn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,pn);return Hs(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 Vt(t,e){return new Jr(t,e)}function Qr(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Vt(n))}function to(t,e){const n=Yt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=wr(o[r]);Qr(t,r,a)}}function eo(t){return!!(F(t)&&t.add)}function de(t,e){const n=t.getValue("willChange");if(eo(n))return n.add(e)}function Xs(t){return t.props[Es]}function ze(t){let e;return()=>(e===void 0&&(e=t()),e)}const no=ze(()=>window.ScrollTimeline!==void 0);class so{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<this.animations.length;s++)this.animations[s][e]=n}attachTimeline(e,n){const s=this.animations.map(i=>{if(no()&&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;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class io extends so{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}const z=t=>t*1e3,H=t=>t/1e3;function He(t){return typeof t=="function"}function gn(t,e){t.timeline=e,t.onfinish=null}const Xe=t=>Array.isArray(t)&&typeof t[0]=="number",ro={linearEasing:void 0};function oo(t,e){const n=ze(t);return()=>{var s;return(s=ro[e])!==null&&s!==void 0?s:n()}}const _t=oo(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),dt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},Ys=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=t(dt(0,i-1,o))+", ";return`linear(${s.substring(0,s.length-2)})`};function qs(t){return!!(typeof t=="function"&&_t()||!t||typeof t=="string"&&(t in fe||_t())||Xe(t)||Array.isArray(t)&&t.every(qs))}const yt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,fe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yt([0,.65,.55,1]),circOut:yt([.55,0,1,.45]),backIn:yt([.31,.01,.66,-.59]),backOut:yt([.33,1.53,.69,.99])};function Zs(t,e){if(t)return typeof t=="function"&&_t()?Ys(t,e):Xe(t)?yt(t):Array.isArray(t)?t.map(n=>Zs(n,e)||fe.easeOut):fe[t]}const Js=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,ao=1e-7,lo=12;function uo(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=Js(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>ao&&++a<lo);return r}function Rt(t,e,n,s){if(t===e&&n===s)return I;const i=o=>uo(o,0,1,t,n);return o=>o===0||o===1?o:Js(i(o),e,s)}const Qs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ti=t=>e=>1-t(1-e),ei=Rt(.33,1.53,.69,.99),Ye=ti(ei),ni=Qs(Ye),si=t=>(t*=2)<1?.5*Ye(t):.5*(2-Math.pow(2,-10*(t-1))),qe=t=>1-Math.sin(Math.acos(t)),ii=ti(qe),ri=Qs(qe),oi=t=>/^0[^.\s]+$/u.test(t);function co(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||oi(t):!0}const Tt=t=>Math.round(t*1e5)/1e5,Ze=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ho(t){return t==null}const fo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Je=(t,e)=>n=>!!(typeof n=="string"&&fo.test(n)&&n.startsWith(t)||e&&!ho(n)&&Object.prototype.hasOwnProperty.call(n,e)),ai=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(Ze);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},mo=t=>X(0,255,t),te={...pt,transform:t=>Math.round(mo(t))},nt={test:Je("rgb","red"),parse:ai("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+te.transform(t)+", "+te.transform(e)+", "+te.transform(n)+", "+Tt(At.transform(s))+")"};function po(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 me={test:Je("#"),parse:po,transform:nt.transform},at={test:Je("hsl","hue"),parse:ai("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+W.transform(Tt(e))+", "+W.transform(Tt(n))+", "+Tt(At.transform(s))+")"},j={test:t=>nt.test(t)||me.test(t)||at.test(t),parse:t=>nt.test(t)?nt.parse(t):at.test(t)?at.parse(t):me.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?nt.transform(t):at.transform(t)},go=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function yo(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Ze))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(go))===null||n===void 0?void 0:n.length)||0)>0}const li="number",ui="color",vo="var",xo="var(",yn="${}",To=/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 Ct(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(To,l=>(j.test(l)?(s.color.push(o),i.push(ui),n.push(j.parse(l))):l.startsWith(xo)?(s.var.push(o),i.push(vo),n.push(l)):(s.number.push(o),i.push(li),n.push(parseFloat(l))),++o,yn)).split(yn);return{values:n,split:a,indexes:s,types:i}}function ci(t){return Ct(t).values}function hi(t){const{split:e,types:n}=Ct(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===li?o+=Tt(i[r]):a===ui?o+=j.transform(i[r]):o+=i[r]}return o}}const Po=t=>typeof t=="number"?0:t;function bo(t){const e=ci(t);return hi(t)(e.map(Po))}const Z={test:yo,parse:ci,createTransformer:hi,getAnimatableNone:bo},So=new Set(["brightness","contrast","saturate","opacity"]);function wo(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Ze)||[];if(!s)return t;const i=n.replace(s,"");let o=So.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const Ao=/\b([a-z-]*)\(.*?\)/gu,pe={...Z,getAnimatableNone:t=>{const e=t.match(Ao);return e?e.map(wo).join(" "):t}},Vo={...Be,color:j,backgroundColor:j,outlineColor:j,fill:j,stroke:j,borderColor:j,borderTopColor:j,borderRightColor:j,borderBottomColor:j,borderLeftColor:j,filter:pe,WebkitFilter:pe},Qe=t=>Vo[t];function di(t,e){let n=Qe(t);return n!==pe&&(n=Z),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Co=new Set(["auto","none","0"]);function Do(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!Co.has(o)&&Ct(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=di(n,i)}const vn=t=>t===pt||t===T,xn=(t,e)=>parseFloat(t.split(", ")[e]),Tn=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return xn(i[1],e);{const o=s.match(/^matrix\((.+)\)$/u);return o?xn(o[1],t):0}},Mo=new Set(["x","y","z"]),Ro=mt.filter(t=>!Mo.has(t));function Eo(t){const e=[];return Ro.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const ft={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:Tn(4,13),y:Tn(5,14)};ft.translateX=ft.x;ft.translateY=ft.y;const st=new Set;let ge=!1,ye=!1;function fi(){if(ye){const t=Array.from(st).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Eo(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)})}ye=!1,ge=!1,st.forEach(t=>t.complete()),st.clear()}function mi(){st.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ye=!0)})}function Lo(){mi(),fi()}class tn{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?(st.add(this),ge||(ge=!0,C.read(mi),C.resolveKeyframes(fi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let o=0;o<e.length;o++)if(e[o]===null)if(o===0){const r=i?.get(),a=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&r===void 0&&i.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),st.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,st.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const pi=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),jo=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Fo(t){const e=jo.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function gi(t,e,n=1){const[s,i]=Fo(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return pi(r)?parseFloat(r):r}return ke(i)?gi(i,e,n+1):i}const yi=t=>e=>e.test(t),ko={test:t=>t==="auto",parse:t=>t},vi=[pt,T,W,Y,Rr,Mr,ko],Pn=t=>vi.find(yi(t));class xi extends tn{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<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),ke(u))){const c=gi(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!zs.has(s)||e.length!==2)return;const[i,o]=e,r=Pn(i),a=Pn(o);if(r!==a)if(vn(r)&&vn(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)co(e[i])&&s.push(i);s.length&&Do(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ft[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const o=n.getValue(s);o&&o.jump(this.measuredOrigin,!1);const r=i.length-1,a=i[r];i[r]=ft[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const bn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Z.test(t)||t==="0")&&!t.startsWith("url("));function Bo(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Io(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=bn(i,e),a=bn(o,e);return!r||!a?!1:Bo(t)||(n==="spring"||He(n))&&s}const Oo=t=>t!==null;function qt(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Oo),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return!o||s===void 0?i[o]:s}const No=40;class Ti{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=G.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>No?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Lo(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=G.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:o,delay:r,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Io(e,s,i,o))if(r)this.options.duration=0;else{l&&l(qt(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 ve=2e4;function Pi(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<ve;)e+=n,s=t.next(e);return e>=ve?1/0:e}const D=(t,e,n)=>t+(e-t)*n;function ee(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 Uo({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=ee(l,a,t+1/3),o=ee(l,a,t),r=ee(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function Kt(t,e){return n=>n>0?e:t}const ne=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},_o=[me,nt,at],Ko=t=>_o.find(e=>e.test(t));function Sn(t){const e=Ko(t);if(!e)return!1;let n=e.parse(t);return e===at&&(n=Uo(n)),n}const wn=(t,e)=>{const n=Sn(t),s=Sn(e);if(!n||!s)return Kt(t,e);const i={...n};return o=>(i.red=ne(n.red,s.red,o),i.green=ne(n.green,s.green,o),i.blue=ne(n.blue,s.blue,o),i.alpha=D(n.alpha,s.alpha,o),nt.transform(i))},Wo=(t,e)=>n=>e(t(n)),Et=(...t)=>t.reduce(Wo),xe=new Set(["none","hidden"]);function Go(t,e){return xe.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function $o(t,e){return n=>D(t,e,n)}function en(t){return typeof t=="number"?$o:typeof t=="string"?ke(t)?Kt:j.test(t)?wn:Xo:Array.isArray(t)?bi:typeof t=="object"?j.test(t)?wn:zo:Kt}function bi(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>en(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function zo(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=en(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function Ho(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][i[r]],l=(n=t.values[a])!==null&&n!==void 0?n:0;s[o]=l,i[r]++}return s}const Xo=(t,e)=>{const n=Z.createTransformer(e),s=Ct(t),i=Ct(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?xe.has(t)&&!i.values.length||xe.has(e)&&!s.values.length?Go(t,e):Et(bi(Ho(s,i),i.values),n):Kt(t,e)};function Si(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?D(t,e,n):en(t)(t,e)}const Yo=5;function wi(t,e,n){const s=Math.max(e-Yo,0);return Hs(n-t(s),e-s)}const M={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},An=.001;function qo({duration:t=M.duration,bounce:e=M.bounce,velocity:n=M.velocity,mass:s=M.mass}){let i,o,r=1-e;r=X(M.minDamping,M.maxDamping,r),t=X(M.minDuration,M.maxDuration,H(t)),r<1?(i=u=>{const c=u*r,h=c*t,d=c-n,f=Te(u,r),m=Math.exp(-h);return An-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),p=Te(Math.pow(u,2),r);return(-i(u)+An>0?-1:1)*((d-f)*m)/p}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-.001+c*h},o=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=Jo(i,o,a);if(t=z(t),isNaN(l))return{stiffness:M.stiffness,damping:M.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const Zo=12;function Jo(t,e,n){let s=n;for(let i=1;i<Zo;i++)s=s-t(s)/e(s);return s}function Te(t,e){return t*Math.sqrt(1-e*e)}const Qo=["duration","bounce"],ta=["stiffness","damping","mass"];function Vn(t,e){return e.some(n=>t[n]!==void 0)}function ea(t){let e={velocity:M.velocity,stiffness:M.stiffness,damping:M.damping,mass:M.mass,isResolvedFromDuration:!1,...t};if(!Vn(t,ta)&&Vn(t,Qo))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*X(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:M.mass,stiffness:i,damping:o}}else{const n=qo(t);e={...e,...n,mass:M.mass},e.isResolvedFromDuration=!0}return e}function Ai(t=M.visualDuration,e=M.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}=ea({...n,velocity:-H(n.velocity||0)}),m=d||0,p=u/(2*Math.sqrt(l*c)),y=r-o,g=H(Math.sqrt(l/c)),v=Math.abs(y)<5;s||(s=v?M.restSpeed.granular:M.restSpeed.default),i||(i=v?M.restDelta.granular:M.restDelta.default);let x;if(p<1){const b=Te(g,p);x=V=>{const E=Math.exp(-p*g*V);return r-E*((m+p*g*y)/b*Math.sin(b*V)+y*Math.cos(b*V))}}else if(p===1)x=b=>r-Math.exp(-g*b)*(y+(m+g*y)*b);else{const b=g*Math.sqrt(p*p-1);x=V=>{const E=Math.exp(-p*g*V),S=Math.min(b*V,300);return r-E*((m+p*g*y)*Math.sinh(S)+b*y*Math.cosh(S))/b}}const A={calculatedDuration:f&&h||null,next:b=>{const V=x(b);if(f)a.done=b>=h;else{let E=0;p<1&&(E=b===0?z(m):wi(x,b,V));const S=Math.abs(E)<=s,B=Math.abs(r-V)<=i;a.done=S&&B}return a.value=a.done?r:V,a},toString:()=>{const b=Math.min(Pi(A),ve),V=Ys(E=>A.next(b*E).value,b,30);return b+"ms "+V}};return A}function Cn({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&&S<a||l!==void 0&&S>l,m=S=>a===void 0?l:l===void 0||Math.abs(a-S)<Math.abs(l-S)?a:l;let p=n*e;const y=h+p,g=r===void 0?y:r(y);g!==y&&(p=g-h);const v=S=>-p*Math.exp(-S/s),x=S=>g+v(S),A=S=>{const B=v(S),N=x(S);d.done=Math.abs(B)<=u,d.value=d.done?g:N};let b,V;const E=S=>{f(d.value)&&(b=S,V=Ai({keyframes:[d.value,m(d.value)],velocity:wi(x,S,d.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return E(0),{calculatedDuration:null,next:S=>{let B=!1;return!V&&b===void 0&&(B=!0,A(S),E(S)),b!==void 0&&S>=b?V.next(S-b):(!B&&A(S),d)}}}const na=Rt(.42,0,1,1),sa=Rt(0,0,.58,1),Vi=Rt(.42,0,.58,1),ia=t=>Array.isArray(t)&&typeof t[0]!="number",ra={linear:I,easeIn:na,easeInOut:Vi,easeOut:sa,circIn:qe,circInOut:ri,circOut:ii,backIn:Ye,backInOut:ni,backOut:ei,anticipate:si},Dn=t=>{if(Xe(t)){Vs(t.length===4);const[e,n,s,i]=t;return Rt(e,n,s,i)}else if(typeof t=="string")return ra[t];return t};function oa(t,e,n){const s=[],i=n||Si,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||I:e;a=Et(l,a)}s.push(a)}return s}function aa(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(Vs(o===e.length),o===1)return()=>e[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=oa(e,s,i),l=a.length,u=c=>{if(r&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const d=dt(t[h],t[h+1],c);return a[h](d)};return n?c=>u(X(t[0],t[o-1],c)):u}function la(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=dt(0,e,s);t.push(D(n,1,i))}}function ua(t){const e=[0];return la(e,t.length-1),e}function ca(t,e){return t.map(n=>n*e)}function ha(t,e){return t.map(()=>e||Vi).splice(0,t.length-1)}function Wt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=ia(s)?s.map(Dn):Dn(s),o={done:!1,value:e[0]},r=ca(n&&n.length===e.length?n:ua(e),t),a=aa(r,e,{ease:Array.isArray(i)?i:ha(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const da=t=>{const e=({timestamp:n})=>t(n);return{start:()=>C.update(e,!0),stop:()=>q(e),now:()=>L.isProcessing?L.timestamp:G.now()}},fa={decay:Cn,inertia:Cn,tween:Wt,keyframes:Wt,spring:Ai},ma=t=>t/100;class nn extends Ti{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?.KeyframeResolver||tn,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=He(n)?n:fa[n]||Wt;let l,u;a!==Wt&&typeof e[0]!="number"&&(l=Et(ma,Si(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:p,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 g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let x=this.currentTime,A=o;if(f){const S=Math.min(this.currentTime,c)/h;let B=Math.floor(S),N=S%1;!N&&S>=1&&(N=1),N===1&&B--,B=Math.min(B,f+1),!!(B%2)&&(m==="reverse"?(N=1-N,p&&(N-=p/h)):m==="mirror"&&(A=r)),x=X(0,1,N)*h}const b=v?{done:!1,value:l[0]}:A.next(x);a&&(b.value=a(b.value));let{done:V}=b;!v&&u!==null&&(V=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return E&&i!==void 0&&(b.value=qt(l,this.options,i)),y&&y(b.value),E&&this.finish(),b}get duration(){const{resolved:e}=this;return e?H(e.calculatedDuration):0}get time(){return H(this.currentTime)}set time(e){e=z(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=H(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=da,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 pa=new Set(["opacity","clipPath","filter","transform"]);function ga(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=Zs(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 ya=ze(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Gt=10,va=2e4;function xa(t){return He(t.type)||t.type==="spring"||!qs(t.ease)}function Ta(t,e){const n=new nn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let o=0;for(;!s.done&&o<va;)s=n.sample(o),i.push(s.value),o+=Gt;return{times:void 0,keyframes:i,duration:o-Gt,ease:"linear"}}const Ci={anticipate:si,backInOut:ni,circInOut:ri};function Pa(t){return t in Ci}class Mn extends Ti{constructor(e){super(e);const{name:n,motionValue:s,element:i,keyframes:o}=this.options;this.resolver=new xi(o,(r,a)=>this.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"&&_t()&&Pa(o)&&(o=Ci[o]),xa(this.options)){const{onComplete:h,onUpdate:d,motionValue:f,element:m,...p}=this.options,y=Ta(e,p);e=y.keyframes,e.length===1&&(e[1]=e[0]),s=y.duration,i=y.times,o=y.ease,r="keyframes"}const c=ga(a.owner.current,l,e,{...this.options,duration:s,times:i,ease:o});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(gn(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:h}=this.options;a.set(qt(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 H(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return H(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=z(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 I;const{animation:s}=n;gn(s,e)}return I}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 nn({...f,keyframes:s,duration:i,type:o,ease:r,times:a,isGenerator:!0}),p=z(this.time);u.setWithVelocity(m.sample(p-Gt).value,m.sample(p).value,Gt)}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 ya()&&s&&pa.has(s)&&!l&&!u&&!i&&o!=="mirror"&&r!==0&&a!=="inertia"}}const ba={type:"spring",stiffness:500,damping:25,restSpeed:10},Sa=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),wa={type:"keyframes",duration:.8},Aa={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Va=(t,{keyframes:e})=>e.length>2?wa:it.has(t)?t.startsWith("scale")?Sa(e[1]):ba:Aa;function Ca({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 sn=(t,e,n,s={},i,o)=>r=>{const a=Ke(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-z(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};Ca(a)||(c={...c,...Va(t,c)}),c.duration&&(c.duration=z(c.duration)),c.repeatDelay&&(c.repeatDelay=z(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=qt(c.keyframes,a);if(d!==void 0)return C.update(()=>{c.onUpdate(d),c.onComplete()}),new io([])}return!o&&Mn.supports(c)?new Mn(c):new nn(c)};function Da({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Di(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&&Da(c,h))continue;const m={delay:n,...Ke(r||{},h)};let p=!1;if(window.MotionHandoffAnimation){const g=Xs(t);if(g){const v=window.MotionHandoffAnimation(g,h,C);v!==null&&(m.startTime=v,p=!0)}}de(t,h),d.start(sn(h,d,f,t.shouldReduceMotion&&zs.has(h)?{type:!1}:m,t,p));const y=d.animation;y&&u.push(y)}return a&&Promise.all(u).then(()=>{C.update(()=>{a&&to(t,a)})}),u}function Pe(t,e,n={}){var s;const i=Yt(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(Di(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:d}=o;return Ma(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 Ma(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(Ra).forEach((u,c)=>{u.notify("AnimationStart",e),r.push(Pe(u,e,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(r)}function Ra(t,e){return t.sortNodePosition(e)}function Ea(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>Pe(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=Pe(t,e,n);else{const i=typeof e=="function"?Yt(t,e,n.custom):e;s=Promise.all(Di(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const La=Re.length;function Mi(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Mi(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<La;n++){const s=Re[n],i=t.props[s];(wt(i)||i===!1)&&(e[s]=i)}return e}const ja=[...Me].reverse(),Fa=Me.length;function ka(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Ea(t,n,s)))}function Ba(t){let e=ka(t),n=Rn(),s=!0;const i=l=>(u,c)=>{var h;const d=Yt(t,c,l==="exit"?(h=t.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(d){const{transition:f,transitionEnd:m,...p}=d;u={...u,...p,...m}}return u};function o(l){e=l(t)}function r(l){const{props:u}=t,c=Mi(t.parent)||{},h=[],d=new Set;let f={},m=1/0;for(let y=0;y<Fa;y++){const g=ja[y],v=n[g],x=u[g]!==void 0?u[g]:c[g],A=wt(x),b=g===l?v.isActive:null;b===!1&&(m=y);let V=x===c[g]&&x!==u[g]&&A;if(V&&s&&t.manuallyAnimateOnMount&&(V=!1),v.protectedKeys={...f},!v.isActive&&b===null||!x&&!v.prevProp||Ht(x)||typeof x=="boolean")continue;const E=Ia(v.prevProp,x);let S=E||g===l&&v.isActive&&!V&&A||y>m&&A,B=!1;const N=Array.isArray(x)?x:[x];let rt=N.reduce(i(g),{});b===!1&&(rt={});const{prevResolvedValues:on={}}=v,Qi={...on,...rt},an=k=>{S=!0,d.has(k)&&(B=!0,d.delete(k)),v.needsAnimating[k]=!0;const $=t.getValue(k);$&&($.liveStyle=!1)};for(const k in Qi){const $=rt[k],Zt=on[k];if(f.hasOwnProperty(k))continue;let Jt=!1;he($)&&he(Zt)?Jt=!$s($,Zt):Jt=$!==Zt,Jt?$!=null?an(k):d.add(k):$!==void 0&&d.has(k)?an(k):v.protectedKeys[k]=!0}v.prevProp=x,v.prevResolvedValues=rt,v.isActive&&(f={...f,...rt}),s&&t.blockInitialAnimation&&(S=!1),S&&(!(V&&E)||B)&&h.push(...N.map(k=>({animation:k,options:{type:g}})))}if(d.size){const y={};d.forEach(g=>{const v=t.getBaseTarget(g),x=t.getValue(g);x&&(x.liveStyle=!0),y[g]=v??null}),h.push({animation:y})}let p=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(p=!1),s=!1,p?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=Rn(),s=!0}}}function Ia(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!$s(e,t):!1}function Q(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Rn(){return{animate:Q(!0),whileInView:Q(),whileHover:Q(),whileTap:Q(),whileDrag:Q(),whileFocus:Q(),exit:Q()}}class J{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Oa extends J{constructor(e){super(e),e.animationState||(e.animationState=Ba(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Ht(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 Na=0;class Ua extends J{constructor(){super(...arguments),this.id=Na++}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 _a={animation:{Feature:Oa},exit:{Feature:Ua}},K={x:!1,y:!1};function Ri(){return K.x||K.y}function Ka(t){return t==="x"||t==="y"?K[t]?null:(K[t]=!0,()=>{K[t]=!1}):K.x||K.y?null:(K.x=K.y=!0,()=>{K.x=K.y=!1})}const rn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function Dt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Lt(t){return{point:{x:t.pageX,y:t.pageY}}}const Wa=t=>e=>rn(e)&&t(e,Lt(e));function Pt(t,e,n,s){return Dt(t,e,Wa(n),s)}const En=(t,e)=>Math.abs(t-e);function Ga(t,e){const n=En(t.x,e.x),s=En(t.y,e.y);return Math.sqrt(n**2+s**2)}class Ei{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=ie(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,f=Ga(h.offset,{x:0,y:0})>=3;if(!d&&!f)return;const{point:m}=h,{timestamp:p}=L;this.history.push({...m,timestamp:p});const{onStart:y,onMove:g}=this.handlers;d||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,h)},this.handlePointerMove=(h,d)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=se(d,this.transformPagePoint),C.update(this.updatePoint,!0)},this.handlePointerUp=(h,d)=>{this.end();const{onEnd:f,onSessionEnd:m,resumeAnimation:p}=this.handlers;if(this.dragSnapToOrigin&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ie(h.type==="pointercancel"?this.lastMoveEventInfo:se(d,this.transformPagePoint),this.history);this.startEvent&&f&&f(h,y),m&&m(h,y)},!rn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const r=Lt(e),a=se(r,this.transformPagePoint),{point:l}=a,{timestamp:u}=L;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,ie(a,this.history)),this.removeListeners=Et(Pt(this.contextWindow,"pointermove",this.handlePointerMove),Pt(this.contextWindow,"pointerup",this.handlePointerUp),Pt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),q(this.updatePoint)}}function se(t,e){return e?{point:e(t.point)}:t}function Ln(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ie({point:t},e){return{point:t,delta:Ln(t,Li(e)),offset:Ln(t,$a(e)),velocity:za(e,.1)}}function $a(t){return t[0]}function Li(t){return t[t.length-1]}function za(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Li(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>z(e)));)n--;if(!s)return{x:0,y:0};const o=H(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 ji=1e-4,Ha=1-ji,Xa=1+ji,Fi=.01,Ya=0-Fi,qa=0+Fi;function O(t){return t.max-t.min}function Za(t,e,n){return Math.abs(t-e)<=n}function jn(t,e,n,s=.5){t.origin=s,t.originPoint=D(e.min,e.max,t.origin),t.scale=O(n)/O(e),t.translate=D(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Ha&&t.scale<=Xa||isNaN(t.scale))&&(t.scale=1),(t.translate>=Ya&&t.translate<=qa||isNaN(t.translate))&&(t.translate=0)}function bt(t,e,n,s){jn(t.x,e.x,n.x,s?s.originX:void 0),jn(t.y,e.y,n.y,s?s.originY:void 0)}function Fn(t,e,n){t.min=n.min+e.min,t.max=t.min+O(e)}function Ja(t,e,n){Fn(t.x,e.x,n.x),Fn(t.y,e.y,n.y)}function kn(t,e,n){t.min=e.min-n.min,t.max=t.min+O(e)}function St(t,e,n){kn(t.x,e.x,n.x),kn(t.y,e.y,n.y)}function Qa(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?D(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?D(n,t,s.max):Math.min(t,n)),t}function Bn(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 tl(t,{top:e,left:n,bottom:s,right:i}){return{x:Bn(t.x,n,i),y:Bn(t.y,e,s)}}function In(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function el(t,e){return{x:In(t.x,e.x),y:In(t.y,e.y)}}function nl(t,e){let n=.5;const s=O(t),i=O(e);return i>s?n=dt(e.min,e.max-s,t.min):s>i&&(n=dt(t.min,t.max-i,e.min)),X(0,1,n)}function sl(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 be=.35;function il(t=be){return t===!1?t=0:t===!0&&(t=be),{x:On(t,"left","right"),y:On(t,"top","bottom")}}function On(t,e,n){return{min:Nn(t,e),max:Nn(t,n)}}function Nn(t,e){return typeof t=="number"?t:t[e]||0}const Un=()=>({translate:0,scale:1,origin:0,originPoint:0}),lt=()=>({x:Un(),y:Un()}),_n=()=>({min:0,max:0}),R=()=>({x:_n(),y:_n()});function _(t){return[t("x"),t("y")]}function ki({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function rl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function ol(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 re(t){return t===void 0||t===1}function Se({scale:t,scaleX:e,scaleY:n}){return!re(t)||!re(e)||!re(n)}function tt(t){return Se(t)||Bi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Bi(t){return Kn(t.x)||Kn(t.y)}function Kn(t){return t&&t!=="0%"}function $t(t,e,n){const s=t-n,i=e*s;return n+i}function Wn(t,e,n,s,i){return i!==void 0&&(t=$t(t,i,s)),$t(t,n,s)+e}function we(t,e=0,n=1,s,i){t.min=Wn(t.min,e,n,s,i),t.max=Wn(t.max,e,n,s,i)}function Ii(t,{x:e,y:n}){we(t.x,e.translate,e.scale,e.originPoint),we(t.y,n.translate,n.scale,n.originPoint)}const Gn=.999999999999,$n=1.0000000000001;function al(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&ct(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Ii(t,r)),s&&tt(o.latestValues)&&ct(t,o.latestValues))}e.x<$n&&e.x>Gn&&(e.x=1),e.y<$n&&e.y>Gn&&(e.y=1)}function ut(t,e){t.min=t.min+e,t.max=t.max+e}function zn(t,e,n,s,i=.5){const o=D(t.min,t.max,i);we(t,e,n,o,s)}function ct(t,e){zn(t.x,e.x,e.scaleX,e.scale,e.originX),zn(t.y,e.y,e.scaleY,e.scale,e.originY)}function Oi(t,e){return ki(ol(t.getBoundingClientRect(),e))}function ll(t,e,n){const s=Oi(t,n),{scroll:i}=e;return i&&(ut(s.x,i.offset.x),ut(s.y,i.offset.y)),s}const Ni=({current:t})=>t?t.ownerDocument.defaultView:null,ul=new WeakMap;class cl{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=R(),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(Lt(c).point)},o=(c,h)=>{const{drag:d,dragPropagation:f,onDragStart:m}=this.getProps();if(d&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ka(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),_(y=>{let g=this.getAxisMotionValue(y).get()||0;if(W.test(g)){const{projection:v}=this.visualElement;if(v&&v.layout){const x=v.layout.layoutBox[y];x&&(g=O(x)*(parseFloat(g)/100))}}this.originPoint[y]=g}),m&&C.postRender(()=>m(c,h)),de(this.visualElement,"transform");const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},r=(c,h)=>{const{dragPropagation:d,dragDirectionLock:f,onDirectionLock:m,onDrag:p}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=h;if(f&&this.currentDirection===null){this.currentDirection=hl(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),p&&p(c,h)},a=(c,h)=>this.stop(c,h),l=()=>_(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 Ei(e,{onSessionStart:i,onStart:o,onMove:r,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Ni(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&&C.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||!kt(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=Qa(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&&ot(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=tl(i.layoutBox,n):this.constraints=!1,this.elastic=il(s),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&_(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=sl(i.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ot(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=ll(s,i.root,this.visualElement.getTransformPagePoint());let r=el(i.layout.layoutBox,o);if(n){const a=n(rl(r));this.hasMutatedConstraints=!!a,a&&(r=ki(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=_(c=>{if(!kt(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 de(this.visualElement,e),s.start(sn(e,s,0,n,this.visualElement,!1))}stopAnimation(){_(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){_(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){_(n=>{const{drag:s}=this.getProps();if(!kt(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]-D(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!ot(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};_(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=nl({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(),_(r=>{if(!kt(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:u}=this.constraints[r];a.set(D(l,u,i[r]))})}addListeners(){if(!this.visualElement.current)return;ul.set(this.visualElement,this);const e=this.visualElement.current,n=Pt(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();ot(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()),C.read(s);const r=Dt(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&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=be,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function kt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function hl(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class dl extends J{constructor(e){super(e),this.removeGroupControls=I,this.removeListeners=I,this.controls=new cl(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||I}unmount(){this.removeGroupControls(),this.removeListeners()}}const Hn=t=>(e,n)=>{t&&C.postRender(()=>t(e,n))};class fl extends J{constructor(){super(...arguments),this.removePointerDownListener=I}onPointerDown(e){this.session=new Ei(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ni(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Hn(e),onStart:Hn(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&C.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Pt(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 Ot={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Xn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const gt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(T.test(t))t=parseFloat(t);else return t;const n=Xn(t,e.target.x),s=Xn(t,e.target.y);return`${n}% ${s}%`}},ml={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Z.parse(t);if(i.length>5)return s;const o=Z.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=D(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 pl extends P.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;Ur(gl),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()})),Ot.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()||C.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Le.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 Ui(t){const[e,n]=er(),s=P.useContext(ws);return w.jsx(pl,{...t,layoutGroup:s,switchLayoutGroup:P.useContext(Ls),isPresent:e,safeToRemove:n})}const gl={borderRadius:{...gt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gt,borderTopRightRadius:gt,borderBottomLeftRadius:gt,borderBottomRightRadius:gt,boxShadow:ml};function yl(t,e,n){const s=F(t)?t:Vt(t);return s.start(sn("",s,e,n)),s.animation}function vl(t){return t instanceof SVGElement&&t.tagName!=="svg"}const xl=(t,e)=>t.depth-e.depth;class Tl{constructor(){this.children=[],this.isDirty=!1}add(e){We(this.children,e),this.isDirty=!0}remove(e){Ge(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(xl),this.isDirty=!1,this.children.forEach(e)}}function Pl(t,e){const n=G.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(q(s),t(o-e))};return C.read(s,!0),()=>q(s)}const _i=["TopLeft","TopRight","BottomLeft","BottomRight"],bl=_i.length,Yn=t=>typeof t=="string"?parseFloat(t):t,qn=t=>typeof t=="number"||T.test(t);function Sl(t,e,n,s,i,o){i?(t.opacity=D(0,n.opacity!==void 0?n.opacity:1,wl(s)),t.opacityExit=D(e.opacity!==void 0?e.opacity:1,0,Al(s))):o&&(t.opacity=D(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let r=0;r<bl;r++){const a=`border${_i[r]}Radius`;let l=Zn(e,a),u=Zn(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||qn(l)===qn(u)?(t[a]=Math.max(D(Yn(l),Yn(u),s),0),(W.test(u)||W.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=D(e.rotate||0,n.rotate||0,s))}function Zn(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const wl=Ki(0,.5,ii),Al=Ki(.5,.95,I);function Ki(t,e,n){return s=>s<t?0:s>e?1:n(dt(t,e,s))}function Jn(t,e){t.min=e.min,t.max=e.max}function U(t,e){Jn(t.x,e.x),Jn(t.y,e.y)}function Qn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function ts(t,e,n,s,i){return t-=e,t=$t(t,1/n,s),i!==void 0&&(t=$t(t,1/i,s)),t}function Vl(t,e=0,n=1,s=.5,i,o=t,r=t){if(W.test(e)&&(e=parseFloat(e),e=D(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=D(o.min,o.max,s);t===o&&(a-=e),t.min=ts(t.min,e,n,a,i),t.max=ts(t.max,e,n,a,i)}function es(t,e,[n,s,i],o,r){Vl(t,e[n],e[s],e[i],e.scale,o,r)}const Cl=["x","scaleX","originX"],Dl=["y","scaleY","originY"];function ns(t,e,n,s){es(t.x,e,Cl,n?n.x:void 0,s?s.x:void 0),es(t.y,e,Dl,n?n.y:void 0,s?s.y:void 0)}function ss(t){return t.translate===0&&t.scale===1}function Wi(t){return ss(t.x)&&ss(t.y)}function is(t,e){return t.min===e.min&&t.max===e.max}function Ml(t,e){return is(t.x,e.x)&&is(t.y,e.y)}function rs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Gi(t,e){return rs(t.x,e.x)&&rs(t.y,e.y)}function os(t){return O(t.x)/O(t.y)}function as(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Rl{constructor(){this.members=[]}add(e){We(this.members,e),e.scheduleRender()}remove(e){if(Ge(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 El(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=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 et={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},vt=typeof window<"u"&&window.MotionDebug!==void 0,oe=["","X","Y","Z"],Ll={visibility:"hidden"},ls=1e3;let jl=0;function ae(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function $i(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Xs(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",C,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&$i(s)}function zi({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e?.()){this.id=jl++,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,vt&&(et.totalNodes=et.resolvedTargetDeltas=et.recalculatedProjection=0),this.nodes.forEach(Bl),this.nodes.forEach(_l),this.nodes.forEach(Kl),this.nodes.forEach(Il),vt&&window.MotionDebug.record(et)},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;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Tl)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new $e),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=vl(r),this.instance=r;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let h;const d=()=>this.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=Pl(d,250),Ot.hasAnimatedSinceResize&&(Ot.hasAnimatedSinceResize=!1,this.nodes.forEach(cs))})}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 p=this.options.transition||c.getDefaultTransition()||Hl,{onLayoutAnimationStart:y,onLayoutAnimationComplete:g}=c.getProps(),v=!this.targetLayout||!Gi(this.targetLayout,m)||f,x=!d&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,x);const A={...Ke(p,"layout"),onPlay:y,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else d||cs(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,q(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(Wl),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&&$i(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(us);return}this.isUpdating||this.nodes.forEach(Nl),this.isUpdating=!1,this.nodes.forEach(Ul),this.nodes.forEach(Fl),this.nodes.forEach(kl),this.clearAllSnapshots();const a=G.now();L.delta=X(0,1e3/60,a-L.timestamp),L.timestamp=a,L.isProcessing=!0,Qt.update.process(L),Qt.preRender.process(L),Qt.render.process(L),L.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Le.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ol),this.sharedNodes.forEach(Gl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,C.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){C.postRender(()=>{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<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutCorrected=R(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Wi(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;r&&(a||tt(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),Xl(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var r;const{visualElement:a}=this.options;if(!a)return R();const l=a.measureViewportBox();if(!(((r=this.scroll)===null||r===void 0?void 0:r.wasRoot)||this.path.some(Yl))){const{scroll:c}=this.root;c&&(ut(l.x,c.offset.x),ut(l.y,c.offset.y))}return l}removeElementScroll(r){var a;const l=R();if(U(l,r),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:d}=c;c!==this.root&&h&&d.layoutScroll&&(h.wasRoot&&U(l,r),ut(l.x,h.offset.x),ut(l.y,h.offset.y))}return l}applyTransform(r,a=!1){const l=R();U(l,r);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&ct(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),tt(c.latestValues)&&ct(l,c.latestValues)}return tt(this.latestValues)&&ct(l,this.latestValues),l}removeTransform(r){const a=R();U(a,r);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!tt(u.latestValues))continue;Se(u.latestValues)&&u.updateSnapshot();const c=R(),h=u.measurePageBox();U(c,h),ns(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return tt(this.latestValues)&&ns(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==L.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(r||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:d}=this.options;if(!(!this.layout||!(h||d))){if(this.resolvedRelativeTargetAt=L.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=R(),this.relativeTargetOrigin=R(),St(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),U(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=R(),this.targetWithTransforms=R()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ja(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):U(this.target,this.layout.layoutBox),Ii(this.target,this.targetDelta)):U(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=R(),this.relativeTargetOrigin=R(),St(this.relativeTargetOrigin,this.target,f.target),U(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}vt&&et.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Se(this.parent.latestValues)||Bi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var r;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((r=this.parent)===null||r===void 0)&&r.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===L.timestamp&&(u=!1),u)return;const{layout:c,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||h))return;U(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;al(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=R());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Qn(this.prevProjectionDelta.x,this.projectionDelta.x),Qn(this.prevProjectionDelta.y,this.projectionDelta.y)),bt(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!as(this.projectionDelta.x,this.prevProjectionDelta.x)||!as(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),vt&&et.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),r){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=lt(),this.projectionDelta=lt(),this.projectionDeltaWithTransform=lt()}setAnimationOrigin(r,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=lt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=R(),f=l?l.source:void 0,m=this.layout?this.layout.source:void 0,p=f!==m,y=this.getStack(),g=!y||y.members.length<=1,v=!!(p&&!g&&this.options.crossfade===!0&&!this.path.some(zl));this.animationProgress=0;let x;this.mixTargetDelta=A=>{const b=A/1e3;hs(h.x,r.x,b),hs(h.y,r.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(St(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),$l(this.relativeTarget,this.relativeTargetOrigin,d,b),x&&Ml(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=R()),U(x,this.relativeTarget)),p&&(this.animationValues=c,Sl(c,u,this.latestValues,b,v,g)),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&&(q(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=C.update(()=>{Ot.hasAnimatedSinceResize=!0,this.currentAnimation=yl(0,ls,{...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(ls),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&&Hi(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||R();const h=O(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const d=O(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+d}U(a,l),ct(a,c),bt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Rl),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&&ae("z",r,u,this.animationValues);for(let c=0;c<oe.length;c++)ae(`rotate${oe[c]}`,r,u,this.animationValues),ae(`skew${oe[c]}`,r,u,this.animationValues);r.render();for(const c in u)r.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);r.scheduleRender()}getProjectionStyles(r){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Ll;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Bt(r?.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=Bt(r?.pointerEvents)||""),this.hasProjected&&!tt(this.latestValues)&&(p.transform=c?c({},""):"none",this.hasProjected=!1),p}const d=h.animationValues||h.latestValues;this.applyTransformsToTarget(),u.transform=El(this.projectionDeltaWithTransform,this.treeScale,d),c&&(u.transform=c(d,u.transform));const{x:f,y:m}=this.projectionDelta;u.transformOrigin=`${f.origin*100}% ${m.origin*100}% 0`,h.animationValues?u.opacity=h===this?(l=(a=d.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:u.opacity=h===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const p in Ut){if(d[p]===void 0)continue;const{correct:y,applyTo:g}=Ut[p],v=u.transform==="none"?d[p]:y(d[p],h);if(g){const x=g.length;for(let A=0;A<x;A++)u[g[A]]=v}else u[p]=v}return this.options.layoutId&&(u.pointerEvents=h===this?Bt(r?.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var a;return(a=r.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(us),this.root.sharedNodes.clear()}}}function Fl(t){t.updateLayout()}function kl(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"?_(h=>{const d=r?n.measuredBox[h]:n.layoutBox[h],f=O(d);d.min=s[h].min,d.max=d.min+f}):Hi(o,n.layoutBox,s)&&_(h=>{const d=r?n.measuredBox[h]:n.layoutBox[h],f=O(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=lt();bt(a,s,n.layoutBox);const l=lt();r?bt(l,t.applyTransform(i,!0),n.measuredBox):bt(l,s,n.layoutBox);const u=!Wi(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=R();St(m,n.layoutBox,d.layoutBox);const p=R();St(p,s,f.layoutBox),Gi(m,p)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=p,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 Bl(t){vt&&et.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 Il(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ol(t){t.clearSnapshot()}function us(t){t.clearMeasurements()}function Nl(t){t.isLayoutDirty=!1}function Ul(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function cs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function _l(t){t.resolveTargetDelta()}function Kl(t){t.calcProjection()}function Wl(t){t.resetSkewAndRotation()}function Gl(t){t.removeLeadSnapshot()}function hs(t,e,n){t.translate=D(e.translate,0,n),t.scale=D(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ds(t,e,n,s){t.min=D(e.min,n.min,s),t.max=D(e.max,n.max,s)}function $l(t,e,n,s){ds(t.x,e.x,n.x,s),ds(t.y,e.y,n.y,s)}function zl(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Hl={duration:.45,ease:[.4,0,.1,1]},fs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ms=fs("applewebkit/")&&!fs("chrome/")?Math.round:I;function ps(t){t.min=ms(t.min),t.max=ms(t.max)}function Xl(t){ps(t.x),ps(t.y)}function Hi(t,e,n){return t==="position"||t==="preserve-aspect"&&!Za(os(e),os(n),.2)}function Yl(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const ql=zi({attachResizeListener:(t,e)=>Dt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),le={current:void 0},Xi=zi({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!le.current){const t=new ql({});t.mount(window),t.setOptions({layoutScroll:!0}),le.current=t}return le.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Zl={pan:{Feature:fl},drag:{Feature:dl,ProjectionNode:Xi,MeasureLayout:Ui}};function Jl(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 Yi(t,e){const n=Jl(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function gs(t){return e=>{e.pointerType==="touch"||Ri()||t(e)}}function Ql(t,e,n={}){const[s,i,o]=Yi(t,n),r=gs(a=>{const{target:l}=a,u=e(a);if(typeof u!="function"||!l)return;const c=gs(h=>{u(h),l.removeEventListener("pointerleave",c)});l.addEventListener("pointerleave",c,i)});return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}function ys(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&&C.postRender(()=>o(e,Lt(e)))}class tu extends J{mount(){const{current:e}=this.node;e&&(this.unmount=Ql(e,n=>(ys(this.node,n,"Start"),s=>ys(this.node,s,"End"))))}unmount(){}}class eu extends J{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=Et(Dt(this.node.current,"focus",()=>this.onFocus()),Dt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const qi=(t,e)=>e?t===e?!0:qi(t,e.parentElement):!1,nu=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function su(t){return nu.has(t.tagName)||t.tabIndex!==-1}const xt=new WeakSet;function vs(t){return e=>{e.key==="Enter"&&t(e)}}function ue(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const iu=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=vs(()=>{if(xt.has(n))return;ue(n,"down");const i=vs(()=>{ue(n,"up")}),o=()=>ue(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 xs(t){return rn(t)&&!Ri()}function ru(t,e,n={}){const[s,i,o]=Yi(t,n),r=a=>{const l=a.currentTarget;if(!xs(a)||xt.has(l))return;xt.add(l);const u=e(a),c=(f,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),!(!xs(f)||!xt.has(l))&&(xt.delete(l),typeof u=="function"&&u(f,{success:m}))},h=f=>{c(f,n.useGlobalTarget||qi(l,f.target))},d=f=>{c(f,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",d,i)};return s.forEach(a=>{!su(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),a.addEventListener("focus",u=>iu(u,i),i)}),o}function Ts(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&&C.postRender(()=>o(e,Lt(e)))}class ou extends J{mount(){const{current:e}=this.node;e&&(this.unmount=ru(e,n=>(Ts(this.node,n,"Start"),(s,{success:i})=>Ts(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ae=new WeakMap,ce=new WeakMap,au=t=>{const e=Ae.get(t.target);e&&e(t)},lu=t=>{t.forEach(au)};function uu({root:t,...e}){const n=t||document;ce.has(n)||ce.set(n,{});const s=ce.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(lu,{root:t,...e})),s[i]}function cu(t,e,n){const s=uu(e);return Ae.set(t,n),s.observe(t),()=>{Ae.delete(t),s.unobserve(t)}}const hu={some:0,all:1};class du extends J{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:hu[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 cu(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(fu(e,n))&&this.startObserver()}unmount(){}}function fu({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const mu={inView:{Feature:du},tap:{Feature:ou},focus:{Feature:eu},hover:{Feature:tu}},pu={layout:{ProjectionNode:Xi,MeasureLayout:Ui}},Ve={current:null},Zi={current:!1};function gu(){if(Zi.current=!0,!!De)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ve.current=t.matches;t.addListener(e),e()}else Ve.current=!1}const yu=[...vi,j,Z],vu=t=>yu.find(yi(t)),Ps=new WeakMap;function xu(t,e,n){for(const s in e){const i=e[s],o=n[s];if(F(i))t.addValue(s,i);else if(F(o))t.addValue(s,Vt(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,Vt(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const bs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Tu{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=tn,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=G.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,C.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:c}=r;this.onUpdate=c,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Xt(n),this.isVariantNode=Rs(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const m=d[f];l[f]!==void 0&&F(m)&&m.set(l[f],!1)}}mount(e){this.current=e,Ps.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Zi.current||gu(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ve.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ps.delete(this.current),this.projection&&this.projection.unmount(),q(this.notifyUpdate),q(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=it.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&C.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 ht){const n=ht[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):R()}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;s<bs.length;s++){const i=bs[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=xu(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.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=Vt(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"&&(pi(i)||oi(i))?i=parseFloat(i):!vu(i)&&Z.test(n)&&(i=di(e,n)),this.setBaseTarget(e,F(i)?i.get():i)),F(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=Fe(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&&!F(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 $e),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Ji extends Tu{constructor(){super(...arguments),this.KeyframeResolver=xi}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;F(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Pu(t){return window.getComputedStyle(t)}class bu extends Ji{constructor(){super(...arguments),this.type="html",this.renderInstance=Ns}readValueFromInstance(e,n){if(it.has(n)){const s=Qe(n);return s&&s.default||0}else{const s=Pu(e),i=(Bs(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Oi(e,n)}build(e,n,s){Ie(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return _e(e,n,s)}}class Su extends Ji{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=R}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(it.has(n)){const s=Qe(n);return s&&s.default||0}return n=Us.has(n)?n:Ee(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Ws(e,n,s)}build(e,n,s){Oe(e,n,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,s,i){_s(e,n,s,i)}mount(e){this.isSVGTag=Ue(e.tagName),super.mount(e)}}const wu=(t,e)=>je(t)?new Su(e):new bu(e,{allowProjection:t!==P.Fragment}),Au=Yr({..._a,...mu,...Zl,...pu},wu),Ss=cr(Au);function Ru(){const t=P.useRef(null),[e,n]=P.useState("Speech synthesis is the artificial production of human speech."),[s,i]=P.useState("male_1"),[o,r]=P.useState(null),[a,l]=P.useState(null),[u,c]=P.useState("Detecting WebGPU support..."),[h,d]=P.useState([]);P.useEffect(()=>{t.current??=new Worker(new URL("/assets/worker-DnonFzIY.js",import.meta.url),{type:"module"});const m=y=>{switch(y.data.status){case"feature-success":c("Loading model (only downloaded once)...");break;case"feature-error":l(y.data.data);break;case"ready":r("ready");break;case"complete":const{audio:g,text:v}=y.data;d(x=>[{text:v,src:g},...x]),r("ready");break}},p=y=>{console.error("Worker error:",y)};return t.current.addEventListener("message",m),t.current.addEventListener("error",p),()=>{t.current.removeEventListener("message",m),t.current.removeEventListener("error",p)}},[]);const f=m=>{m.preventDefault(),r("running"),t.current.postMessage({type:"generate",text:e.trim(),speaker_id:s})};return w.jsxs("div",{className:"relative w-full min-h-screen bg-gradient-to-br from-gray-900 to-gray-700 flex flex-col items-center justify-center p-4 relative overflow-hidden font-sans",children:[w.jsxs(Ss.div,{initial:{opacity:1},animate:{opacity:o===null?1:0},transition:{duration:.5},className:"absolute w-screen h-screen justify-center flex flex-col items-center z-10 bg-gray-800/95 backdrop-blur-md",style:{pointerEvents:o===null?"auto":"none"},children:[w.jsx("div",{className:"w-[250px] h-[250px] border-4 border-white shadow-[0_0_0_5px_#4973ff] rounded-full overflow-hidden",children:w.jsx("div",{className:"loading-wave"})}),w.jsx("p",{className:`text-3xl my-5 text-center ${a?"text-red-500":"text-white"}`,children:a??u})]}),w.jsxs("div",{className:"max-w-3xl w-full space-y-8 relative z-[2]",children:[w.jsxs("div",{className:"text-center",children:[w.jsx("h1",{className:"text-5xl font-extrabold text-gray-100 mb-2 drop-shadow-lg font-heading",children:"WebGPU Text-to-Speech"}),w.jsxs("p",{className:"text-2xl text-gray-300 font-semibold font-subheading",children:["Powered by ",w.jsx("a",{href:"https://github.com/edwko/OuteTTS",target:"_blank",rel:"noreferrer",className:"underline",children:"OuteTTS"})," and ",w.jsxs("a",{href:"https://huggingface.co./docs/transformers.js",target:"_blank",rel:"noreferrer",className:"underline",children:[w.jsx("img",{width:"40",src:"hf-logo.svg",className:"inline translate-y-[-2px] me-1"}),"Transformers.js"]})]})]}),w.jsx("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-lg p-6",children:w.jsxs("form",{onSubmit:f,className:"space-y-4",children:[w.jsx("textarea",{placeholder:"Enter text...",value:e,onChange:m=>n(m.target.value),className:"w-full min-h-[100px] max-h-[300px] bg-gray-700/50 backdrop-blur-sm border-2 border-gray-600 rounded-xl resize-y text-gray-100 placeholder-gray-400 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",rows:Math.min(8,e.split(`
`).length)}),w.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[w.jsxs("select",{value:s,onChange:m=>i(m.target.value),className:"w-full bg-gray-700/50 backdrop-blur-sm border-2 border-gray-600 rounded-xl text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[w.jsx("option",{value:"male_1",children:"Male 1"}),w.jsx("option",{value:"male_2",children:"Male 2"}),w.jsx("option",{value:"male_3",children:"Male 3"}),w.jsx("option",{value:"male_4",children:"Male 4"}),w.jsx("option",{value:"female_1",children:"Female 1"}),w.jsx("option",{value:"female_2",children:"Female 2"}),w.jsx("option",{value:"random",children:"Random"})]}),w.jsx("button",{type:"submit",className:"inline-flex justify-center items-center px-6 py-2 text-lg font-semibold bg-gradient-to-t from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 transition-colors duration-300 rounded-xl text-white disabled:opacity-50",disabled:o==="running"||e.trim()==="",children:o==="running"?"Generating...":"Generate"})]})]})}),h.length>0&&w.jsx(Ss.div,{initial:{y:50,opacity:0},animate:{y:0,opacity:1},transition:{duration:.5},className:"max-h-[250px] overflow-y-auto px-2 mt-4 space-y-6 relative z-[2]",children:h.map((m,p)=>w.jsx("div",{children:w.jsxs("div",{className:"text-white bg-gray-800/70 backdrop-blur-sm border border-gray-700 rounded-lg p-4 z-10",children:[w.jsxs("span",{className:"absolute right-5 font-bold",children:["#",h.length-p]}),w.jsx("p",{className:"mb-3 max-w-[95%]",children:m.text}),w.jsx("audio",{controls:!0,src:m.src,className:"w-full",children:"Your browser does not support the audio element."})]})},p))})]}),w.jsxs("div",{className:"bg-[#015871] pointer-events-none absolute left-0 w-full h-[5%] bottom-[-50px]",children:[w.jsx("div",{className:"wave"}),w.jsx("div",{className:"wave"})]})]})}export{Ru as default};