UNPKG

reactbits-animation

Version:

A comprehensive collection of beautiful, performant React animation components including bounce effects, click sparks, star borders, scroll-triggered animations, and fade transitions.

8 lines 2.83 MB
import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as r from"react";import i,{useRef as o,useEffect as a,createContext as s,useLayoutEffect as l,useId as c,useContext as u,useInsertionEffect as d,useMemo as h,useCallback as p,Children as f,isValidElement as m,useState as g,forwardRef as v,Fragment as y,createElement as x,Component as b,Suspense as w,cloneElement as A,memo as S,useImperativeHandle as C}from"react";import E,{gsap as T}from"gsap";import{ScrollTrigger as M}from"gsap/ScrollTrigger";import*as _ from"react-dom/client";import{flushSync as P}from"react-dom"; /*! * SplitText 3.13.0 * https://gsap.com * * @license Copyright 2025, GreenSock. All rights reserved. Subject to the terms at https://gsap.com/standard-license. * @author: Jack Doyle */let I,R,D,k="undefined"!=typeof Intl?new Intl.Segmenter:0,B=e=>"string"==typeof e?B(document.querySelectorAll(e)):"length"in e?Array.from(e):[e],O=e=>B(e).filter(e=>e instanceof HTMLElement),F=[],L=function(){},N=/\s+/g,z=new RegExp("\\p{RI}\\p{RI}|\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?(\\u{200D}\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?)*|.","gu"),U={left:0,top:0,width:0,height:0},V=(e,t)=>{if(t){let n,r,i,o,a=new Set(e.join("").match(t)||F),s=e.length;if(a.size)for(;--s>-1;)for(i of(r=e[s],a))if(i.startsWith(r)&&i.length>r.length){for(n=0,o=r;i.startsWith(o+=e[s+ ++n])&&o.length<i.length;);if(n&&o.length===i.length){e[s]=i,e.splice(s+1,n);break}}}return e},H=e=>"inline"===window.getComputedStyle(e).display&&(e.style.display="inline-block"),G=(e,t,n)=>t.insertBefore("string"==typeof e?document.createTextNode(e):e,n),W=(e,t,n)=>{let r=t[e+"sClass"]||"",{tag:i="div",aria:o="auto",propIndex:a=!1}=t,s="line"===e?"block":"inline-block",l=r.indexOf("++")>-1,c=t=>{let c=document.createElement(i),u=n.length+1;return r&&(c.className=r+(l?" "+r+u:"")),a&&c.style.setProperty("--"+e,u+""),"none"!==o&&c.setAttribute("aria-hidden","true"),"span"!==i&&(c.style.position="relative",c.style.display=s),c.textContent=t,n.push(c),c};return l&&(r=r.replace("++","")),c.collection=n,c},j=(e,t,n,r,i,o,a,s,l,c)=>{var u;let d,h,p,f,m,g,v,y,x,b,w,A,S,C,E,T,M,_,P=Array.from(e.childNodes),I=0,{wordDelimiter:R,reduceWhiteSpace:D=!0,prepareText:B}=t,O=e.getBoundingClientRect(),L=O,z=!D&&"pre"===window.getComputedStyle(e).whiteSpace.substring(0,3),U=0,W=n.collection;for("object"==typeof R?(p=R.delimiter||R,h=R.replaceWith||""):h=""===R?"":R||" ",d=" "!==h;I<P.length;I++)if(f=P[I],3===f.nodeType){for(E=f.textContent||"",D?E=E.replace(N," "):z&&(E=E.replace(/\n/g,h+"\n")),B&&(E=B(E,e)),f.textContent=E,m=h||p?E.split(p||h):E.match(s)||F,M=m[m.length-1],y=d?" "===M.slice(-1):!M,M||m.pop(),L=O,v=d?" "===m[0].charAt(0):!m[0],v&&G(" ",e,f),m[0]||m.shift(),V(m,l),o&&c||(f.textContent=""),x=1;x<=m.length;x++)if(T=m[x-1],!D&&z&&"\n"===T.charAt(0)&&(null==(u=f.previousSibling)||u.remove(),G(document.createElement("br"),e,f),T=T.slice(1)),D||""!==T)if(" "===T)e.insertBefore(document.createTextNode(" "),f);else{if(d&&" "===T.charAt(0)&&G(" ",e,f),U&&1===x&&!v&&W.indexOf(U.parentNode)>-1?(g=W[W.length-1],g.appendChild(document.createTextNode(r?"":T))):(g=n(r?"":T),G(g,e,f),U&&1===x&&!v&&g.insertBefore(U,g.firstChild)),r)for(w=k?V([...k.segment(T)].map(e=>e.segment),l):T.match(s)||F,_=0;_<w.length;_++)g.appendChild(" "===w[_]?document.createTextNode(" "):r(w[_]));if(o&&c){if(E=f.textContent=E.substring(T.length+1,E.length),b=g.getBoundingClientRect(),b.top>L.top&&b.left<=L.left){for(A=e.cloneNode(),S=e.childNodes[0];S&&S!==g;)C=S,S=S.nextSibling,A.appendChild(C);e.parentNode.insertBefore(A,e),i&&H(A)}L=b}(x<m.length||y)&&G(x>=m.length?" ":d&&" "===T.slice(-1)?" "+h:h,e,f)}else G(h,e,f);e.removeChild(f),U=0}else 1===f.nodeType&&(a&&a.indexOf(f)>-1?(W.indexOf(f.previousSibling)>-1&&W[W.length-1].appendChild(f),U=f):(j(f,t,n,r,i,o,a,s,l,!0),U=0),i&&H(f))};const X=class e{constructor(e,t){this.isSplit=!1,D||Y.register(window.gsap),this.elements=O(e),this.chars=[],this.words=[],this.lines=[],this.masks=[],this.vars=t,this._split=()=>this.isSplit&&this.split(this.vars);let n,r=[],i=()=>{let e,t=r.length;for(;t--;){e=r[t];let n=e.element.offsetWidth;if(n!==e.width)return e.width=n,void this._split()}};this._data={orig:r,obs:"undefined"!=typeof ResizeObserver&&new ResizeObserver(()=>{clearTimeout(n),n=setTimeout(i,200)})},L(this),this.split(t)}split(e){this.isSplit&&this.revert(),this.vars=e=e||this.vars||{};let t,{type:n="chars,words,lines",aria:r="auto",deepSlice:i=!0,smartWrap:o,onSplit:a,autoSplit:s=!1,specialChars:l,mask:c}=this.vars,u=n.indexOf("lines")>-1,d=n.indexOf("chars")>-1,h=n.indexOf("words")>-1,p=d&&!h&&!u,f=l&&("push"in l?new RegExp("(?:"+l.join("|")+")","gu"):l),m=f?new RegExp(f.source+"|"+z.source,"gu"):z,g=!!e.ignore&&O(e.ignore),{orig:v,animTime:y,obs:x}=this._data;return(d||h||u)&&(this.elements.forEach((t,n)=>{v[n]={element:t,html:t.innerHTML,ariaL:t.getAttribute("aria-label"),ariaH:t.getAttribute("aria-hidden")},"auto"===r?t.setAttribute("aria-label",(t.textContent||"").trim()):"hidden"===r&&t.setAttribute("aria-hidden","true");let a,s,l,c,y=[],x=[],b=[],w=d?W("char",e,y):null,A=W("word",e,x);if(j(t,e,A,w,p,i&&(u||p),g,m,f,!1),u){let n,r=B(t.childNodes),i=((e,t,n,r)=>{let i=W("line",n,r),o=window.getComputedStyle(e).textAlign||"left";return(n,r)=>{let a=i("");for(a.style.textAlign=o,e.insertBefore(a,t[n]);n<r;n++)a.appendChild(t[n]);a.normalize()}})(t,r,e,b),o=[],s=0,l=r.map(e=>1===e.nodeType?e.getBoundingClientRect():U),c=U;for(a=0;a<r.length;a++)n=r[a],1===n.nodeType&&("BR"===n.nodeName?(o.push(n),i(s,a+1),s=a+1,c=l[s]):(a&&l[a].top>c.top&&l[a].left<=c.left&&(i(s,a),s=a),c=l[a]));s<a&&i(s,a),o.forEach(e=>{var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)})}if(!h){for(a=0;a<x.length;a++)if(s=x[a],d||!s.nextSibling||3!==s.nextSibling.nodeType)if(o&&!u){for(l=document.createElement("span"),l.style.whiteSpace="nowrap";s.firstChild;)l.appendChild(s.firstChild);s.replaceWith(l)}else s.replaceWith(...s.childNodes);else c=s.nextSibling,c&&3===c.nodeType&&(c.textContent=(s.textContent||"")+(c.textContent||""),s.remove());x.length=0,t.normalize()}this.lines.push(...b),this.words.push(...x),this.chars.push(...y)}),c&&this[c]&&this.masks.push(...this[c].map(e=>{let t=e.cloneNode();return e.replaceWith(t),t.appendChild(e),e.className&&(t.className=e.className.replace(/(\b\w+\b)/g,"$1-mask")),t.style.overflow="clip",t}))),this.isSplit=!0,R&&(s?R.addEventListener("loadingdone",this._split):"loading"===R.status&&console.warn("SplitText called before fonts loaded")),(t=a&&a(this))&&t.totalTime&&(this._data.anim=y?t.totalTime(y):t),u&&s&&this.elements.forEach((e,t)=>{v[t].width=e.offsetWidth,x&&x.observe(e)}),this}revert(){var e,t;let{orig:n,anim:r,obs:i}=this._data;return i&&i.disconnect(),n.forEach(({element:e,html:t,ariaL:n,ariaH:r})=>{e.innerHTML=t,n?e.setAttribute("aria-label",n):e.removeAttribute("aria-label"),r?e.setAttribute("aria-hidden",r):e.removeAttribute("aria-hidden")}),this.chars.length=this.words.length=this.lines.length=n.length=this.masks.length=0,this.isSplit=!1,null==R||R.removeEventListener("loadingdone",this._split),r&&(this._data.animTime=r.totalTime(),r.revert()),null==(t=(e=this.vars).onRevert)||t.call(e,this),this}static create(t,n){return new e(t,n)}static register(e){I=I||e||window.gsap,I&&(B=I.utils.toArray,L=I.core.context||L),!D&&window.innerWidth>0&&(R=document.fonts,D=!0)}};X.version="3.13.0";let Y=X;T.registerPlugin(M,Y);const q=({text:t,className:n="",delay:r=100,duration:i=.6,ease:s="power3.out",splitType:l="chars",from:c={opacity:0,y:40},to:u={opacity:1,y:0},threshold:d=.1,rootMargin:h="-100px",textAlign:p="center",onLetterAnimationComplete:f})=>{const m=o(null);return a(()=>{const e=m.current;if(!e)return;const t="lines"===l;t&&(e.style.position="relative");const n=new Y(e,{type:l,absolute:t,linesClass:"split-line"});let o;switch(l){case"lines":o=n.lines;break;case"words":o=n.words;break;case"words, chars":o=[...n.words,...n.chars];break;default:o=n.chars}o.forEach(e=>{e.style.willChange="transform, opacity"});const a=100*(1-d),p=/^(-?\d+)px$/.exec(h),g=p?parseInt(p[1],10):0,v=`top ${a}%${g<0?`-=${Math.abs(g)}px`:`+=${g}px`}`,y=T.timeline({scrollTrigger:{trigger:e,start:v,toggleActions:"play none none none",once:!0},smoothChildTiming:!0,onComplete:f});return y.set(o,{...c,immediateRender:!1,force3D:!0}),y.to(o,{...u,duration:i,ease:s,stagger:r/1e3,force3D:!0}),()=>{y.kill(),M.getAll().forEach(e=>e.kill()),T.killTweensOf(o),n.revert()}},[t,r,i,s,l,c,u,d,h,f]),e("p",{ref:m,className:`split-parent ${n}`,style:{textAlign:p,overflow:"hidden",display:"inline-block",whiteSpace:"normal",wordWrap:"break-word"},children:t})},K=s({});function Q(e){const t=o(null);return null===t.current&&(t.current=e()),t.current}const J="undefined"!=typeof window,Z=J?l:a,$=s(null);function ee(e,t){-1===e.indexOf(t)&&e.push(t)}function te(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ne=(e,t,n)=>n>t?t:n<e?e:n;let re=()=>{},ie=()=>{};"production"!==process.env.NODE_ENV&&(re=(e,t)=>{e||"undefined"==typeof console||console.warn(t)},ie=(e,t)=>{if(!e)throw new Error(t)});const oe={},ae=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function se(e){return"object"==typeof e&&null!==e}const le=e=>/^0[^.\s]+$/u.test(e);function ce(e){let t;return()=>(void 0===t&&(t=e()),t)}const ue=e=>e,de=(e,t)=>n=>t(e(n)),he=(...e)=>e.reduce(de),pe=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};class fe{constructor(){this.subscriptions=[]}add(e){return ee(this.subscriptions,e),()=>te(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){const r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const me=e=>1e3*e,ge=e=>e/1e3;function ve(e,t){return t?e*(1e3/t):0}const ye=new Set;function xe(e,t,n){e||ye.has(t)||(console.warn(t),ye.add(t))}const be=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function we(e,t,n,r){if(e===t&&n===r)return ue;const i=t=>function(e,t,n,r,i){let o,a,s=0;do{a=t+(n-t)/2,o=be(a,r,i)-e,o>0?n=a:t=a}while(Math.abs(o)>1e-7&&++s<12);return a}(t,0,1,e,n);return e=>0===e||1===e?e:be(i(e),t,r)}const Ae=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Se=e=>t=>1-e(1-t),Ce=we(.33,1.53,.69,.99),Ee=Se(Ce),Te=Ae(Ee),Me=e=>(e*=2)<1?.5*Ee(e):.5*(2-Math.pow(2,-10*(e-1))),_e=e=>1-Math.sin(Math.acos(e)),Pe=Se(_e),Ie=Ae(_e),Re=we(.42,0,1,1),De=we(0,0,.58,1),ke=we(.42,0,.58,1),Be=e=>Array.isArray(e)&&"number"!=typeof e[0];function Oe(e,t){return Be(e)?e[((e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e})(0,e.length,t)]:e}const Fe=e=>Array.isArray(e)&&"number"==typeof e[0],Le={linear:ue,easeIn:Re,easeInOut:ke,easeOut:De,circIn:_e,circInOut:Ie,circOut:Pe,backIn:Ee,backInOut:Te,backOut:Ce,anticipate:Me},Ne=e=>{if(Fe(e)){ie(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,i]=e;return we(t,n,r,i)}return"string"==typeof e?(ie(void 0!==Le[e],`Invalid easing type '${e}'`),Le[e]):e},ze=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ue(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=ze.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function s(t){o.has(t)&&(l.schedule(t),e()),t(a)}const l={schedule:(e,i=!1,a=!1)=>{const s=a&&r?t:n;return i&&o.add(e),s.has(e)||s.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{a=e,r?i=!0:(r=!0,[t,n]=[n,t],t.forEach(s),t.clear(),r=!1,i&&(i=!1,l.process(e)))}};return l}(o),e),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:p,postRender:f}=a,m=()=>{const o=oe.useManualTiming?i.timestamp:performance.now();n=!1,oe.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),l.process(i),c.process(i),u.process(i),d.process(i),h.process(i),p.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))};return{schedule:ze.reduce((t,o)=>{const s=a[o];return t[o]=(t,o=!1,a=!1)=>(n||(n=!0,r=!0,i.isProcessing||e(m)),s.schedule(t,o,a)),t},{}),cancel:e=>{for(let t=0;t<ze.length;t++)a[ze[t]].cancel(e)},state:i,steps:a}}const{schedule:Ve,cancel:He,state:Ge,steps:We}=Ue("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:ue,!0);let je;function Xe(){je=void 0}const Ye={now:()=>(void 0===je&&Ye.set(Ge.isProcessing||oe.useManualTiming?Ge.timestamp:performance.now()),je),set:e=>{je=e,queueMicrotask(Xe)}},qe=e=>t=>"string"==typeof t&&t.startsWith(e),Ke=qe("--"),Qe=qe("var(--"),Je=e=>!!Qe(e)&&Ze.test(e.split("/*")[0].trim()),Ze=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,$e={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},et={...$e,transform:e=>ne(0,1,e)},tt={...$e,default:1},nt=e=>Math.round(1e5*e)/1e5,rt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const it=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ot=(e,t)=>n=>Boolean("string"==typeof n&&it.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),at=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[i,o,a,s]=r.match(rt);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:void 0!==s?parseFloat(s):1}},st={...$e,transform:e=>Math.round((e=>ne(0,255,e))(e))},lt={test:ot("rgb","red"),parse:at("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+st.transform(e)+", "+st.transform(t)+", "+st.transform(n)+", "+nt(et.transform(r))+")"};const ct={test:ot("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:lt.transform},ut=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),dt=ut("deg"),ht=ut("%"),pt=ut("px"),ft=ut("vh"),mt=ut("vw"),gt=(()=>({...ht,parse:e=>ht.parse(e)/100,transform:e=>ht.transform(100*e)}))(),vt={test:ot("hsl","hue"),parse:at("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ht.transform(nt(t))+", "+ht.transform(nt(n))+", "+nt(et.transform(r))+")"},yt={test:e=>lt.test(e)||ct.test(e)||vt.test(e),parse:e=>lt.test(e)?lt.parse(e):vt.test(e)?vt.parse(e):ct.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?lt.transform(e):vt.transform(e),getAnimatableNone:e=>{const t=yt.parse(e);return t.alpha=0,yt.transform(t)}},xt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const bt="number",wt="color",At=/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 St(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const a=t.replace(At,e=>(yt.test(e)?(r.color.push(o),i.push(wt),n.push(yt.parse(e))):e.startsWith("var(")?(r.var.push(o),i.push("var"),n.push(e)):(r.number.push(o),i.push(bt),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:a,indexes:r,types:i}}function Ct(e){return St(e).values}function Et(e){const{split:t,types:n}=St(e),r=t.length;return e=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],void 0!==e[o]){const t=n[o];i+=t===bt?nt(e[o]):t===wt?yt.transform(e[o]):e[o]}return i}}const Tt=e=>"number"==typeof e?0:yt.test(e)?yt.getAnimatableNone(e):e;const Mt={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(rt)?.length||0)+(e.match(xt)?.length||0)>0},parse:Ct,createTransformer:Et,getAnimatableNone:function(e){const t=Ct(e);return Et(e)(t.map(Tt))}};function _t(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Pt(e,t){return n=>n>0?t:e}const It=(e,t,n)=>e+(t-e)*n,Rt=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Dt=[ct,lt,vt];function kt(e){const t=(n=e,Dt.find(e=>e.test(n)));var n;if(re(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let r=t.parse(e);return t===vt&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,o=0,a=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=_t(s,r,e+1/3),o=_t(s,r,e),a=_t(s,r,e-1/3)}else i=o=a=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*a),alpha:r}}(r)),r}const Bt=(e,t)=>{const n=kt(e),r=kt(t);if(!n||!r)return Pt(e,t);const i={...n};return e=>(i.red=Rt(n.red,r.red,e),i.green=Rt(n.green,r.green,e),i.blue=Rt(n.blue,r.blue,e),i.alpha=It(n.alpha,r.alpha,e),lt.transform(i))},Ot=new Set(["none","hidden"]);function Ft(e,t){return n=>It(e,t,n)}function Lt(e){return"number"==typeof e?Ft:"string"==typeof e?Je(e)?Pt:yt.test(e)?Bt:Ut:Array.isArray(e)?Nt:"object"==typeof e?yt.test(e)?Bt:zt:Pt}function Nt(e,t){const n=[...e],r=n.length,i=e.map((e,n)=>Lt(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function zt(e,t){const n={...e,...t},r={};for(const i in n)void 0!==e[i]&&void 0!==t[i]&&(r[i]=Lt(e[i])(e[i],t[i]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const Ut=(e,t)=>{const n=Mt.createTransformer(t),r=St(e),i=St(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ot.has(e)&&!i.values.length||Ot.has(t)&&!r.values.length?function(e,t){return Ot.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):he(Nt(function(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],a=e.indexes[o][r[o]],s=e.values[a]??0;n[i]=s,r[o]++}return n}(r,i),i.values),n):(re(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Pt(e,t))};function Vt(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return It(e,t,n);return Lt(e)(e,t)}const Ht=e=>{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>Ve.update(t,e),stop:()=>He(t),now:()=>Ge.isProcessing?Ge.timestamp:Ye.now()}},Gt=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(1e4*e(t/(i-1)))/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Wt=2e4;function jt(e){let t=0;let n=e.next(t);for(;!n.done&&t<Wt;)t+=50,n=e.next(t);return t>=Wt?1/0:t}function Xt(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(jt(r),Wt);return{type:"keyframes",ease:e=>r.next(i*e).value/t,duration:ge(i)}}function Yt(e,t,n){const r=Math.max(t-5,0);return ve(n-e(r),t-r)}const qt=100,Kt=10,Qt=1,Jt=0,Zt=800,$t=.3,en=.3,tn={granular:.01,default:2},nn={granular:.005,default:.5},rn=.01,on=10,an=.05,sn=1,ln=.001;function cn({duration:e=Zt,bounce:t=$t,velocity:n=Jt,mass:r=Qt}){let i,o;re(e<=me(on),"Spring duration must be 10 seconds or less");let a=1-t;a=ne(an,sn,a),e=ne(rn,on,ge(e)),a<1?(i=t=>{const r=t*a,i=r*e,o=r-n,s=dn(t,a),l=Math.exp(-i);return ln-o/s*l},o=t=>{const r=t*a*e,o=r*n+n,s=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=dn(Math.pow(t,2),a);return(-i(t)+ln>0?-1:1)*((o-s)*l)/c}):(i=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,o=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let n=1;n<un;n++)r-=e(r)/t(r);return r}(i,o,5/e);if(e=me(e),isNaN(s))return{stiffness:qt,damping:Kt,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*a*Math.sqrt(r*t),duration:e}}}const un=12;function dn(e,t){return e*Math.sqrt(1-t*t)}const hn=["duration","bounce"],pn=["stiffness","damping","mass"];function fn(e,t){return t.some(t=>void 0!==e[t])}function mn(e=en,t=$t){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],s={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:p}=function(e){let t={velocity:Jt,stiffness:qt,damping:Kt,mass:Qt,isResolvedFromDuration:!1,...e};if(!fn(e,pn)&&fn(e,hn))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),i=r*r,o=2*ne(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Qt,stiffness:i,damping:o}}else{const n=cn(e);t={...t,...n,mass:Qt},t.isResolvedFromDuration=!0}return t}({...n,velocity:-ge(n.velocity||0)}),f=h||0,m=c/(2*Math.sqrt(l*u)),g=a-o,v=ge(Math.sqrt(l/u)),y=Math.abs(g)<5;let x;if(r||(r=y?tn.granular:tn.default),i||(i=y?nn.granular:nn.default),m<1){const e=dn(v,m);x=t=>{const n=Math.exp(-m*v*t);return a-n*((f+m*v*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===m)x=e=>a-Math.exp(-v*e)*(g+(f+v*g)*e);else{const e=v*Math.sqrt(m*m-1);x=t=>{const n=Math.exp(-m*v*t),r=Math.min(e*t,300);return a-n*((f+m*v*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}const b={calculatedDuration:p&&d||null,next:e=>{const t=x(e);if(p)s.done=e>=d;else{let n=0===e?f:0;m<1&&(n=0===e?me(f):Yt(x,e,t));const o=Math.abs(n)<=r,l=Math.abs(a-t)<=i;s.done=o&&l}return s.value=s.done?a:t,s},toString:()=>{const e=Math.min(jt(b),Wt),t=Gt(t=>b.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return b}function gn({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:a,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},p=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let f=n*t;const m=d+f,g=void 0===a?m:a(m);g!==m&&(f=g-d);const v=e=>-f*Math.exp(-e/r),y=e=>g+v(e),x=e=>{const t=v(e),n=y(e);h.done=Math.abs(t)<=c,h.value=h.done?g:n};let b,w;const A=e=>{var t;(t=h.value,void 0!==s&&t<s||void 0!==l&&t>l)&&(b=e,w=mn({keyframes:[h.value,p(h.value)],velocity:Yt(y,e,h.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return A(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==b||(t=!0,x(e),A(e)),void 0!==b&&e>=b?w.next(e-b):(!t&&x(e),h)}}}function vn(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(ie(o===t.length,"Both input and output ranges must be the same length"),1===o)return()=>t[0];if(2===o&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],i=n||oe.mix||Vt,o=e.length-1;for(let n=0;n<o;n++){let o=i(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||ue:t;o=he(e,o)}r.push(o)}return r}(t,r,i),l=s.length,c=n=>{if(a&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);const i=pe(e[r],e[r+1],n);return s[r](i)};return n?t=>c(ne(e[0],e[o-1],t)):c}function yn(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=pe(0,t,r);e.push(It(n,1,i))}}function xn(e){const t=[0];return yn(t,e.length-1),t}function bn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Be(r)?r.map(Ne):Ne(r),o={done:!1,value:t[0]},a=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:xn(t),e),s=vn(a,t,{ease:Array.isArray(i)?i:(l=t,c=i,l.map(()=>c||ke).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(o.value=s(t),o.done=t>=e,o)}}mn.applyToOptions=e=>{const t=Xt(e,100,mn);return e.ease=t.ease,e.duration=me(t.duration),e.type="keyframes",e};const wn=e=>null!==e;function An(e,{repeat:t,repeatType:n="loop"},r,i=1){const o=e.filter(wn),a=i<0||t&&"loop"!==n&&t%2==1?0:o.length-1;return a&&void 0!==r?r:o[a]}const Sn={decay:gn,inertia:gn,tween:bn,keyframes:bn,spring:mn};function Cn(e){"string"==typeof e.type&&(e.type=Sn[e.type])}class En{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const Tn=e=>e/100;class Mn extends En{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==Ye.now()&&this.tick(Ye.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){const{options:e}=this;Cn(e);const{type:t=bn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=e;let{keyframes:a}=e;const s=t||bn;"production"!==process.env.NODE_ENV&&s!==bn&&ie(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),s!==bn&&"number"!=typeof a[0]&&(this.mixKeyframes=he(Tn,Vt(a[0],a[1])),a=[0,100]);const l=s({...e,keyframes:a});"mirror"===i&&(this.mirroredGenerator=s({...e,keyframes:[...a].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=jt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=l}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:d,repeatDelay:h,type:p,onUpdate:f,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);let y=this.currentTime,x=n;if(u){const e=Math.min(this.currentTime,r)/a;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,u+1);Boolean(t%2)&&("reverse"===d?(n=1-n,h&&(n-=h/a)):"mirror"===d&&(x=o)),y=ne(0,1,n)*a}const b=v?{done:!1,value:c[0]}:x.next(y);i&&(b.value=i(b.value));let{done:w}=b;v||null===s||(w=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const A=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return A&&p!==gn&&(b.value=An(c,this.options,m,this.speed)),f&&f(b.value),A&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return ge(this.calculatedDuration)}get time(){return ge(this.currentTime)}set time(e){e=me(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Ye.now());const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=ge(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Ht,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=t??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ye.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}const _n=e=>180*e/Math.PI,Pn=e=>{const t=_n(Math.atan2(e[1],e[0]));return Rn(t)},In={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Pn,rotateZ:Pn,skewX:e=>_n(Math.atan(e[1])),skewY:e=>_n(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Rn=e=>((e%=360)<0&&(e+=360),e),Dn=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),kn=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Bn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Dn,scaleY:kn,scale:e=>(Dn(e)+kn(e))/2,rotateX:e=>Rn(_n(Math.atan2(e[6],e[5]))),rotateY:e=>Rn(_n(Math.atan2(-e[2],e[0]))),rotateZ:Pn,rotate:Pn,skewX:e=>_n(Math.atan(e[4])),skewY:e=>_n(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function On(e){return e.includes("scale")?1:0}function Fn(e,t){if(!e||"none"===e)return On(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=Bn,i=n;else{const t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=In,i=t}if(!i)return On(t);const o=r[t],a=i[1].split(",").map(Ln);return"function"==typeof o?o(a):a[o]}function Ln(e){return parseFloat(e.trim())}const Nn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zn=(()=>new Set(Nn))(),Un=e=>e===$e||e===pt,Vn=new Set(["x","y","z"]),Hn=Nn.filter(e=>!Vn.has(e));const Gn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Fn(t,"x"),y:(e,{transform:t})=>Fn(t,"y")};Gn.translateX=Gn.x,Gn.translateY=Gn.y;const Wn=new Set;let jn=!1,Xn=!1,Yn=!1;function qn(){if(Xn){const e=Array.from(Wn).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return Hn.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}Xn=!1,jn=!1,Wn.forEach(e=>e.complete(Yn)),Wn.clear()}function Kn(){Wn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Xn=!0)})}class Qn{constructor(e,t,n,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Wn.add(this),jn||(jn=!0,Ve.read(Kn),Ve.resolveKeyframes(qn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(null===e[0]){const i=r?.get(),o=e[e.length-1];if(void 0!==i)e[0]=i;else if(n&&t){const r=n.readValue(t,o);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=o),r&&void 0===i&&r.set(e[0])}!function(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Wn.delete(this)}cancel(){"scheduled"===this.state&&(Wn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Jn=ce(()=>void 0!==window.ScrollTimeline),Zn={};function $n(e,t){const n=ce(e);return()=>Zn[t]??n()}const er=$n(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),tr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,nr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tr([0,.65,.55,1]),circOut:tr([.55,0,1,.45]),backIn:tr([.31,.01,.66,-.59]),backOut:tr([.33,1.53,.69,.99])};function rr(e,t){return e?"function"==typeof e?er()?Gt(e,t):"ease-out":Fe(e)?tr(e):Array.isArray(e)?e.map(e=>rr(e,t)||nr.easeOut):nr[e]:void 0}function ir(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:a="loop",ease:s="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=rr(s,i);Array.isArray(d)&&(u.easing=d);const h={delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"};c&&(h.pseudoElement=c);return e.animate(u,h)}function or(e){return"function"==typeof e&&"applyToOptions"in e}class ar extends En{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:s}=e;this.isPseudoElement=Boolean(i),this.allowFlatten=o,this.options=e,ie("string"!=typeof e.type,'animateMini doesn\'t support "type" as a string. Did you mean to import { spring } from "motion"?');const l=function({type:e,...t}){return or(e)&&er()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=ir(t,n,r,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const e=An(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(e):function(e,t,n){(e=>e.startsWith("--"))(t)?e.style.setProperty(t,n):e.style[t]=n}(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return ge(Number(e))}get time(){return ge(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=me(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Jn()?(this.animation.timeline=e,ue):t(this)}}const sr={anticipate:Me,backInOut:Te,circInOut:Ie};function lr(e){"string"==typeof e.ease&&e.ease in sr&&(e.ease=sr[e.ease])}class cr extends ar{constructor(e){lr(e),Cn(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:n,onComplete:r,element:i,...o}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);const a=new Mn({...o,autoplay:!1}),s=me(this.finishedTime??this.time);t.setWithVelocity(a.sample(s-10).value,a.sample(s).value,10),a.stop()}}const ur=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Mt.test(e)&&"0"!==e||e.startsWith("url(")));function dr(e){return se(e)&&"offsetHeight"in e}const hr=new Set(["opacity","clipPath","filter","transform"]),pr=ce(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class fr extends En{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:s,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ye.now();const d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:o,name:s,motionValue:l,element:c,...u},h=c?.KeyframeResolver||Qn;this.keyframeResolver=new h(a,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:s,isHandoff:l,onUpdate:c}=n;this.resolvedAt=Ye.now(),function(e,t,n,r){const i=e[0];if(null===i)return!1;if("display"===t||"visibility"===t)return!0;const o=e[e.length-1],a=ur(i,t),s=ur(o,t);return re(a===s,`You are trying to animate ${t} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`),!(!a||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||or(n))&&r)}(e,i,o,a)||(!oe.instantAnimations&&s||c?.(An(e,n,t)),e[0]=e[e.length-1],n.duration=0,n.repeat=0);const u={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!l&&function(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:o,type:a}=e;if(!dr(t?.owner?.current))return!1;const{onUpdate:s,transformTemplate:l}=t.owner.getProps();return pr()&&n&&hr.has(n)&&("transform"!==n||!l)&&!s&&!r&&"mirror"!==i&&0!==o&&"inertia"!==a}(u)?new cr({...u,element:u.motionValue.owner.current}):new Mn(u);d.finished.then(()=>this.notifyFinished()).catch(ue),this.pendingTimeline&&(this.stopTimeline=d.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Yn=!0,Kn(),qn(),Yn=!1),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class mr{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){const t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].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 state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class gr extends mr{then(e,t){return this.finished.finally(e).then(()=>{})}}const vr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yr(e,t,n=1){ie(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,i]=function(e){const t=vr.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const e=o.trim();return ae(e)?parseFloat(e):e}return Je(i)?yr(i,t,n+1):i}function xr(e,t){return e?.[t]??e?.default??e}const br=new Set(["width","height","top","left","right","bottom",...Nn]),wr=e=>t=>t.test(e),Ar=[$e,pt,ht,dt,mt,ft,{test:e=>"auto"===e,parse:e=>e}],Sr=e=>Ar.find(wr(e));function Cr(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||le(e))}const Er=new Set(["brightness","contrast","saturate","opacity"]);function Tr(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(rt)||[];if(!r)return e;const i=n.replace(r,"");let o=Er.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const Mr=/\b([a-z-]*)\(.*?\)/gu,_r={...Mt,getAnimatableNone:e=>{const t=e.match(Mr);return t?t.map(Tr).join(" "):e}},Pr={...$e,transform:Math.round},Ir={borderWidth:pt,borderTopWidth:pt,borderRightWidth:pt,borderBottomWidth:pt,borderLeftWidth:pt,borderRadius:pt,radius:pt,borderTopLeftRadius:pt,borderTopRightRadius:pt,borderBottomRightRadius:pt,borderBottomLeftRadius:pt,width:pt,maxWidth:pt,height:pt,maxHeight:pt,top:pt,right:pt,bottom:pt,left:pt,padding:pt,paddingTop:pt,paddingRight:pt,paddingBottom:pt,paddingLeft:pt,margin:pt,marginTop:pt,marginRight:pt,marginBottom:pt,marginLeft:pt,backgroundPositionX:pt,backgroundPositionY:pt,...{rotate:dt,rotateX:dt,rotateY:dt,rotateZ:dt,scale:tt,scaleX:tt,scaleY:tt,scaleZ:tt,skew:dt,skewX:dt,skewY:dt,distance:pt,translateX:pt,translateY:pt,translateZ:pt,x:pt,y:pt,z:pt,perspective:pt,transformPerspective:pt,opacity:et,originX:gt,originY:gt,originZ:pt},zIndex:Pr,fillOpacity:et,strokeOpacity:et,numOctaves:Pr},Rr={...Ir,color:yt,backgroundColor:yt,outlineColor:yt,fill:yt,stroke:yt,borderColor:yt,borderTopColor:yt,borderRightColor:yt,borderBottomColor:yt,borderLeftColor:yt,filter:_r,WebkitFilter:_r},Dr=e=>Rr[e];function kr(e,t){let n=Dr(e);return n!==_r&&(n=Mt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Br=new Set(["auto","none","0"]);class Or extends Qn{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if("string"==typeof r&&(r=r.trim(),Je(r))){const i=yr(r,t.current);void 0!==i&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!br.has(n)||2!==e.length)return;const[r,i]=e,o=Sr(r),a=Sr(i);if(o!==a)if(Un(o)&&Un(a))for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else Gn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(null===e[t]||Cr(e[t]))&&n.push(t);n.length&&function(e,t,n){let r,i=0;for(;i<e.length&&!r;){const t=e[i];"string"==typeof t&&!Br.has(t)&&St(t).values.length&&(r=e[i]),i++}if(r&&n)for(const i of t)e[i]=kr(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Gn[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){const{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);const i=n.length-1,o=n[i];n[i]=Gn[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}function Fr(e,t,n){if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document;const r=n?.[e]??t.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}const Lr=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Nr={current:void 0};class zr{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=Ye.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const e of this.dependents)e.dirty();t&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Ye.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return"production"!==process.env.NODE_ENV&&xe(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new fe);const n=this.events[e].add(t);return"change"===e?()=>{n(),Ve.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Nr.current&&Nr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Ye.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return ve(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ur(e,t){return new zr(e,t)}const{schedule:Vr}=Ue(queueMicrotask,!1),Hr={x:!1,y:!1};function Gr(){return Hr.x||Hr.y}function Wr(e,t){const n=Fr(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function jr(e){return!("touch"===e.pointerType||Gr())}const Xr=(e,t)=>!!t&&(e===t||Xr(e,t.parentElement)),Yr=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,qr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Kr=new WeakSet;function Qr(e){return t=>{"Enter"===t.key&&e(t)}}function Jr(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Zr(e){return Yr(e)&&!Gr()}function $r(e,t,n={}){const[r,i,o]=Wr(e,n),a=e=>{const r=e.currentTarget;if(!Zr(e))return;Kr.add(r);const o=t(r,e),a=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),Kr.has(r)&&Kr.delete(r),Zr(e)&&"function"==typeof o&&o(e,{success:t})},s=e=>{a(e,r===window||r===document||n.useGlobalTarget||Xr(r,e.target))},l=e=>{a(e,!1)};window.addEventListener("pointerup",s,i),window.addEventListener("pointercancel",l,i)};return r.forEach(e=>{var t;(n.useGlobalTarget?window:e).addEventListener("pointerdown",a,i),dr(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=Qr(()=>{if(Kr.has(n))return;Jr(n,"down");const e=Qr(()=>{Jr(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>Jr(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,i)),t=e,qr.has(t.tagName)||-1!==t.tabIndex||e.hasAttribute("tabindex")||(e.tabIndex=0))}),o}function ei(e){return se(e)&&"ownerSVGElement"in e}const ti=new WeakMap;let ni;const ri=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:ei(r)&&"getBBox"in r?r.getBBox()[t]:r[n],ii=ri("inline","width","offsetWidth"),oi=ri("block","height","offsetHeight");function ai({target:e,borderBoxSize:t}){ti.get(e)?.forEach(n=>{n(e,{get width(){return ii(e,t)},get height(){return oi(e,t)}})})}function si(e){e.forEach(ai)}function li(e,t){ni||"undefined"!=typeof ResizeObserver&&(ni=new ResizeObserver(si));const n=Fr(e);return n.forEach(e=>{let n=ti.get(e);n||(n=new Set,ti.set(e,n)),n.add(t),ni?.observe(e)}),()=>{n.forEach(e=>{const n=ti.get(e);n?.delete(t),n?.size||ni?.unobserve(e)})}}const ci=new Set;let ui;function di(e){return ci.add(e),ui||(ui=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ci.forEach(t=>t(e))},window.addEventListener("resize",ui)),()=>{ci.delete(e),ci.size||"function"!=typeof ui||(window.removeEventListener("resize",ui),ui=void 0)}}function hi(e,t){let n;const r=()=>{const{currentTime:r}=t,i=(null===r?0:r.value)/100;n!==i&&e(i),n=i};return Ve.preUpdate(r,!0),()=>He(r)}function pi(e){return ei(e)&&"svg"===e.tagName}const fi=e=>Boolean(e&&e.getVelocity);function mi(e,t){return t?e+t:e}function gi(e){return"number"==typeof e?e:parseFloat(e)}const vi=[...Ar,yt,Mt],yi=s({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class xi extends r.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=t.offsetParent,n=dr(e)&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function bi({children:t,isPresent:n,anchorX:i}){const a=c(),s=o(null),l=o({width:0,height:0,top:0,left:0,rig