UNPKG

framer-motion

Version:

A simple and powerful JavaScript animation library

1 lines • 145 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(e),s=React,o=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function c(t,e,n){var i,s={},r=null,c=null;for(i in void 0!==n&&(r=""+n),void 0!==e.key&&(r=""+e.key),void 0!==e.ref&&(c=e.ref),e)a.call(e,i)&&!u.hasOwnProperty(i)&&(s[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===s[i]&&(s[i]=e[i]);return{$$typeof:o,type:t,key:r,ref:c,props:s,_owner:l.current}}const h=r,d=c,p=c,m=e.createContext({});function f(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function g(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function y(t,e,n,i){if("function"==typeof e){const[s,o]=g(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=g(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function v(t,e,n){const i=t.getProps();return y(i,e,void 0!==n?n:i.custom,t)}const x=t=>t;let w=x,P=x;function T(t){let e;return()=>(void 0===e&&(e=t()),e)}const S=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},b=t=>1e3*t,A=t=>t/1e3,E=T(()=>void 0!==window.ScrollTimeline);class C extends class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>E()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0);return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function M(t,e){return t?t[e]||t.default||t:void 0}function V(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}function R(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(V(i),2e4);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:A(s)}}function D(t){return"function"==typeof t}function k(t,e){t.timeline=e,t.onfinish=null}const L=t=>Array.isArray(t)&&"number"==typeof t[0],B={linearEasing:void 0};function F(t,e){const n=T(t);return()=>{var t;return null!==(t=B[e])&&void 0!==t?t:n()}}const O=F(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),j=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=t(S(0,s-1,e))+", ";return`linear(${i.substring(0,i.length-2)})`};function I(t){return Boolean("function"==typeof t&&O()||!t||"string"==typeof t&&(t in W||O())||L(t)||Array.isArray(t)&&t.every(I))}const U=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,W={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:U([0,.65,.55,1]),circOut:U([.55,0,1,.45]),backIn:U([.31,.01,.66,-.59]),backOut:U([.33,1.53,.69,.99])};const N={x:!1,y:!1};function z(){return N.x||N.y}function $(t,e,n){var i;if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const o=null!==(i=null==n?void 0:n[t])&&void 0!==i?i:s.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t)}function H(t,e){const n=$(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function X(t){return!("touch"===t.pointerType||z())}function Y(t,e,n={}){const[i,s,o]=H(t,n),r=t=>{if(!X(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{X(t)&&(i(t),n.removeEventListener("pointerleave",o))};n.addEventListener("pointerleave",o,s)};return i.forEach(t=>{t.addEventListener("pointerenter",r,s)}),o}function K(t,e){const n=e+"PointerCapture";if(t.target instanceof Element&&n in t.target&&void 0!==t.pointerId)try{t.target[n](t.pointerId)}catch(t){}}const G=(t,e)=>!!e&&(t===e||G(t,e.parentElement)),_=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,q=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Z=new WeakSet;function J(t){return e=>{"Enter"===e.key&&t(e)}}function Q(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function tt(t){return _(t)&&!z()}function et(t,e,n={}){const[i,s,o]=H(t,n),r=t=>{const n=t.currentTarget;if(!n||!tt(t)||Z.has(n))return;Z.add(n),K(t,"set");const i=e(n,t),o=(t,e)=>{n.removeEventListener("pointerup",r),n.removeEventListener("pointercancel",a),K(t,"release"),tt(t)&&Z.has(n)&&(Z.delete(n),"function"==typeof i&&i(t,{success:e}))},r=t=>{const e=!!t.isTrusted&&(i=t,s=n instanceof Element?n.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},i.clientX<s.left||i.clientX>s.right||i.clientY<s.top||i.clientY>s.bottom);var i,s;o(t,!e&&(!(n instanceof Element)||G(n,t.target)))},a=t=>{o(t,!1)};n.addEventListener("pointerup",r,s),n.addEventListener("pointercancel",a,s),n.addEventListener("lostpointercapture",a,s)};return i.forEach(t=>{let e=!1;var i;(t=n.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,i=t,q.has(i.tagName)||-1!==i.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",r,s),e&&t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=J(()=>{if(Z.has(n))return;Q(n,"down");const t=J(()=>{Q(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Q(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s),s)}),o}const nt={skipAnimations:!1,useManualTiming:!1},it=["read","resolveKeyframes","update","preRender","render","postRender"],st={value:null,addProjectionMetrics:null};function ot(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=it.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){r.has(e)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(u),e&&st.value&&st.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,c.process(t)))}};return c}(o,e?n:void 0),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=r,p=()=>{const o=nt.useManualTiming?s.timestamp:performance.now();n=!1,nt.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),c.process(s),h.process(s),d.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(p))};return{schedule:it.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(p)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<it.length;e++)r[it[e]].cancel(t)},state:s,steps:r}}const{schedule:rt,cancel:at,state:lt,steps:ut}=ot("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:x,!0),ct=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ht=new Set(ct),dt=new Set(["width","height","top","left","right","bottom",...ct]),pt=t=>Array.isArray(t);let mt;function ft(){mt=void 0}const gt={now:()=>(void 0===mt&&gt.set(lt.isProcessing||nt.useManualTiming?lt.timestamp:performance.now()),mt),set:t=>{mt=t,queueMicrotask(ft)}};function yt(t,e){-1===t.indexOf(e)&&t.push(e)}function vt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class xt{constructor(){this.subscriptions=[]}add(t){return yt(this.subscriptions,t),()=>vt(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function wt(t,e){return e?t*(1e3/e):0}const Pt={current:void 0};class Tt{constructor(t,e={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=gt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=gt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new xt);const n=this.events[t].add(e);return"change"===t?()=>{n(),rt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Pt.current&&Pt.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=gt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return wt(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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 St(t,e){return new Tt(t,e)}function bt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,St(n))}function At(t,e){const n=v(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){bt(t,e,(r=o[e],pt(r)?r[r.length-1]||0:r))}var r}const Et=t=>Boolean(t&&t.getVelocity);function Ct(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Et(i)&&i.add))return n.add(e);var i}const Mt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Vt="data-"+Mt("framerAppearId");function Rt(t){return t.props[Vt]}const Dt={current:!1},kt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Lt(t,e,n,i){if(t===e&&n===i)return x;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=kt(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:kt(s(t),e,i)}const Bt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ft=t=>e=>1-t(1-e),Ot=Lt(.33,1.53,.69,.99),jt=Ft(Ot),It=Bt(jt),Ut=t=>(t*=2)<1?.5*jt(t):.5*(2-Math.pow(2,-10*(t-1))),Wt=t=>1-Math.sin(Math.acos(t)),Nt=Ft(Wt),zt=Bt(Wt),$t=t=>/^0[^.\s]+$/u.test(t);const Ht=(t,e,n)=>n>e?e:n<t?t:n,Xt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Yt={...Xt,transform:t=>Ht(0,1,t)},Kt={...Xt,default:1},Gt=t=>Math.round(1e5*t)/1e5,_t=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const qt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Zt=(t,e)=>n=>Boolean("string"==typeof n&&qt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Jt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(_t);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Qt={...Xt,transform:t=>Math.round((t=>Ht(0,255,t))(t))},te={test:Zt("rgb","red"),parse:Jt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Qt.transform(t)+", "+Qt.transform(e)+", "+Qt.transform(n)+", "+Gt(Yt.transform(i))+")"};const ee={test:Zt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:te.transform},ne=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ie=ne("deg"),se=ne("%"),oe=ne("px"),re=ne("vh"),ae=ne("vw"),le={...se,parse:t=>se.parse(t)/100,transform:t=>se.transform(100*t)},ue={test:Zt("hsl","hue"),parse:Jt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+se.transform(Gt(e))+", "+se.transform(Gt(n))+", "+Gt(Yt.transform(i))+")"},ce={test:t=>te.test(t)||ee.test(t)||ue.test(t),parse:t=>te.test(t)?te.parse(t):ue.test(t)?ue.parse(t):ee.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?te.transform(t):ue.transform(t)},he=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const de=/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 pe(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(de,t=>(ce.test(t)?(i.color.push(o),s.push("color"),n.push(ce.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push("number"),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function me(t){return pe(t).values}function fe(t){const{split:e,types:n}=pe(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+="number"===e?Gt(t[o]):"color"===e?ce.transform(t[o]):t[o]}return s}}const ge=t=>"number"==typeof t?0:t;const ye={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(_t))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(he))||void 0===n?void 0:n.length)||0)>0},parse:me,createTransformer:fe,getAnimatableNone:function(t){const e=me(t);return fe(t)(e.map(ge))}},ve=new Set(["brightness","contrast","saturate","opacity"]);function xe(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(_t)||[];if(!i)return t;const s=n.replace(i,"");let o=ve.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const we=/\b([a-z-]*)\(.*?\)/gu,Pe={...ye,getAnimatableNone:t=>{const e=t.match(we);return e?e.map(xe).join(" "):t}},Te={borderWidth:oe,borderTopWidth:oe,borderRightWidth:oe,borderBottomWidth:oe,borderLeftWidth:oe,borderRadius:oe,radius:oe,borderTopLeftRadius:oe,borderTopRightRadius:oe,borderBottomRightRadius:oe,borderBottomLeftRadius:oe,width:oe,maxWidth:oe,height:oe,maxHeight:oe,top:oe,right:oe,bottom:oe,left:oe,padding:oe,paddingTop:oe,paddingRight:oe,paddingBottom:oe,paddingLeft:oe,margin:oe,marginTop:oe,marginRight:oe,marginBottom:oe,marginLeft:oe,backgroundPositionX:oe,backgroundPositionY:oe},Se={rotate:ie,rotateX:ie,rotateY:ie,rotateZ:ie,scale:Kt,scaleX:Kt,scaleY:Kt,scaleZ:Kt,skew:ie,skewX:ie,skewY:ie,distance:oe,translateX:oe,translateY:oe,translateZ:oe,x:oe,y:oe,z:oe,perspective:oe,transformPerspective:oe,opacity:Yt,originX:le,originY:le,originZ:oe},be={...Xt,transform:Math.round},Ae={...Te,...Se,zIndex:be,size:oe,fillOpacity:Yt,strokeOpacity:Yt,numOctaves:be},Ee={...Ae,color:ce,backgroundColor:ce,outlineColor:ce,fill:ce,stroke:ce,borderColor:ce,borderTopColor:ce,borderRightColor:ce,borderBottomColor:ce,borderLeftColor:ce,filter:Pe,WebkitFilter:Pe},Ce=t=>Ee[t];function Me(t,e){let n=Ce(t);return n!==Pe&&(n=ye),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ve=new Set(["auto","none","0"]);const Re=t=>t===Xt||t===oe,De=(t,e)=>parseFloat(t.split(", ")[e]),ke=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/u);if(s)return De(s[1],e);{const e=i.match(/^matrix\((.+)\)$/u);return e?De(e[1],t):0}},Le=new Set(["x","y","z"]),Be=ct.filter(t=>!Le.has(t));const Fe={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:ke(4,13),y:ke(5,14)};Fe.translateX=Fe.x,Fe.translateY=Fe.y;const Oe=new Set;let je=!1,Ie=!1;function Ue(){if(Ie){const t=Array.from(Oe).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Be.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{var i;null===(i=t.getValue(e))||void 0===i||i.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ie=!1,je=!1,Oe.forEach(t=>t.complete()),Oe.clear()}function We(){Oe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ie=!0)})}class Ne{constructor(t,e,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Oe.add(this),je||(je=!0,rt.read(We),rt.resolveKeyframes(Ue))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;for(let s=0;s<t.length;s++)if(null===t[s])if(0===s){const s=null==i?void 0:i.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Oe.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Oe.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ze=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),$e=t=>e=>"string"==typeof e&&e.startsWith(t),He=$e("--"),Xe=$e("var(--"),Ye=t=>!!Xe(t)&&Ke.test(t.split("/*")[0].trim()),Ke=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ge=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _e(t,e,n=1){const[i,s]=function(t){const e=Ge.exec(t);if(!e)return[,];const[,n,i,s]=e;return["--"+(null!=n?n:i),s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return ze(t)?parseFloat(t):t}return Ye(s)?_e(s,e,n+1):s}const qe=t=>e=>e.test(t),Ze=[Xt,oe,se,ie,ae,re,{test:t=>"auto"===t,parse:t=>t}],Je=t=>Ze.find(qe(t));class Qe extends Ne{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),Ye(i))){const s=_e(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!dt.has(n)||2!==t.length)return;const[i,s]=t,o=Je(i),r=Je(s);if(o!==r)if(Re(o)&&Re(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(i=t[e])?0===i:null===i||"none"===i||"0"===i||$t(i))&&n.push(e);var i;n.length&&function(t,e,n){let i=0,s=void 0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!Ve.has(e)&&pe(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Me(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Fe[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,r=i[o];i[o]=Fe[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const tn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!ye.test(t)&&"0"!==t||t.startsWith("url(")));function en(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=tn(s,e),a=tn(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||D(n))&&i)}const nn=t=>null!==t;function sn(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(nn),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}class on{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=gt.now(),this.options={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(We(),Ue()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=gt.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!en(t,n,i,s)){if(Dt.current||!o)return a&&a(sn(t,this.options,e)),r&&r(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const rn=(t,e,n)=>t+(e-t)*n;function an(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ln(t,e){return n=>n>0?e:t}const un=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},cn=[ee,te,ue];function hn(t){const e=(n=t,cn.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let i=e.parse(t);return e===ue&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=an(a,i,t+1/3),o=an(a,i,t),r=an(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const dn=(t,e)=>{const n=hn(t),i=hn(e);if(!n||!i)return ln(t,e);const s={...n};return t=>(s.red=un(n.red,i.red,t),s.green=un(n.green,i.green,t),s.blue=un(n.blue,i.blue,t),s.alpha=rn(n.alpha,i.alpha,t),te.transform(s))},pn=(t,e)=>n=>e(t(n)),mn=(...t)=>t.reduce(pn),fn=new Set(["none","hidden"]);function gn(t,e){return n=>rn(t,e,n)}function yn(t){return"number"==typeof t?gn:"string"==typeof t?Ye(t)?ln:ce.test(t)?dn:wn:Array.isArray(t)?vn:"object"==typeof t?ce.test(t)?dn:xn:ln}function vn(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>yn(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function xn(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=yn(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const wn=(t,e)=>{const n=ye.createTransformer(e),i=pe(t),s=pe(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?fn.has(t)&&!s.values.length||fn.has(e)&&!i.values.length?function(t,e){return fn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):mn(vn(function(t,e){var n;const i=[],s={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][s[r]],l=null!==(n=t.values[a])&&void 0!==n?n:0;i[o]=l,s[r]++}return i}(i,s),s.values),n):ln(t,e)};function Pn(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return rn(t,e,n);return yn(t)(t,e)}function Tn(t,e,n){const i=Math.max(e-5,0);return wt(n-t(i),e-i)}const Sn=100,bn=10,An=1,En=0,Cn=800,Mn=.3,Vn=.3,Rn={granular:.01,default:2},Dn={granular:.005,default:.5},kn=.01,Ln=10,Bn=.05,Fn=1;function On({duration:t=Cn,bounce:e=Mn,velocity:n=En,mass:i=An}){let s,o,r=1-e;r=Ht(Bn,Fn,r),t=Ht(kn,Ln,A(t)),r<1?(s=e=>{const i=e*r,s=i*t;return.001-(i-n)/jn(e,r)*Math.exp(-s)},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=jn(Math.pow(e,2),r);return(.001-s(e)>0?-1:1)*((o-a)*l)/u}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=b(t),isNaN(a))return{stiffness:Sn,damping:bn,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function jn(t,e){return t*Math.sqrt(1-e*e)}const In=["duration","bounce"],Un=["stiffness","damping","mass"];function Wn(t,e){return e.some(e=>void 0!==t[e])}function Nn(t=Vn,e=Mn){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=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:p}=function(t){let e={velocity:En,stiffness:Sn,damping:bn,mass:An,isResolvedFromDuration:!1,...t};if(!Wn(t,Un)&&Wn(t,In))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*Ht(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:An,stiffness:s,damping:o}}else{const n=On(t);e={...e,...n,mass:An},e.isResolvedFromDuration=!0}return e}({...n,velocity:-A(n.velocity||0)}),m=d||0,f=u/(2*Math.sqrt(l*c)),g=r-o,y=A(Math.sqrt(l/c)),v=Math.abs(g)<5;let x;if(i||(i=v?Rn.granular:Rn.default),s||(s=v?Dn.granular:Dn.default),f<1){const t=jn(y,f);x=e=>{const n=Math.exp(-f*y*e);return r-n*((m+f*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===f)x=t=>r-Math.exp(-y*t)*(g+(m+y*g)*t);else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),i=Math.min(t*e,300);return r-n*((m+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const w={calculatedDuration:p&&h||null,next:t=>{const e=x(t);if(p)a.done=t>=h;else{let n=0;f<1&&(n=0===t?b(m):Tn(x,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(V(w),2e4),e=j(e=>w.next(t*e).value,t,30);return t+"ms "+e}};return w}function zn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,g=void 0===r?f:r(f);g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let w,P;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,P=Nn({keyframes:[d.value,p(d.value)],velocity:Tn(v,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return P||void 0!==w||(e=!0,x(t),T(t)),void 0!==w&&t>=w?P.next(t-w):(!e&&x(t),d)}}}const $n=Lt(.42,0,1,1),Hn=Lt(0,0,.58,1),Xn=Lt(.42,0,.58,1),Yn=t=>Array.isArray(t)&&"number"!=typeof t[0],Kn={linear:x,easeIn:$n,easeInOut:Xn,easeOut:Hn,circIn:Wt,circInOut:zt,circOut:Nt,backIn:jt,backInOut:It,backOut:Ot,anticipate:Ut},Gn=t=>{if(L(t)){P(4===t.length);const[e,n,i,s]=t;return Lt(e,n,i,s)}return"string"==typeof t?Kn[t]:t};function _n(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(P(o===e.length),1===o)return()=>e[0];if(2===o&&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=function(t,e,n){const i=[],s=n||Pn,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||x:e;o=mn(t,o)}i.push(o)}return i}(e,i,s),l=a.length,u=n=>{if(r&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=S(t[i],t[i+1],n);return a[i](s)};return n?e=>u(Ht(t[0],t[o-1],e)):u}function qn(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=S(0,e,i);t.push(rn(n,1,s))}}function Zn(t){const e=[0];return qn(e,t.length-1),e}function Jn({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=Yn(i)?i.map(Gn):Gn(i),o={done:!1,value:e[0]},r=_n(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Zn(e),t),e,{ease:Array.isArray(s)?s:(a=e,l=s,a.map(()=>l||Xn).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}const Qn=t=>{const e=({timestamp:e})=>t(e);return{start:()=>rt.update(e,!0),stop:()=>at(e),now:()=>lt.isProcessing?lt.timestamp:gt.now()}},ti={decay:zn,inertia:zn,tween:Jn,keyframes:Jn,spring:Nn},ei=t=>t/100;class ni extends on{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:i,keyframes:s}=this.options,o=(null==i?void 0:i.KeyframeResolver)||Ne;this.resolver=new o(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,r=D(e)?e:ti[e]||Jn;let a,l;r!==Jn&&"number"!=typeof t[0]&&(a=mn(ei,Pn(t[0],t[1])),t=[0,100]);const u=r({...this.options,keyframes:t});"mirror"===s&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===u.calculatedDuration&&(u.calculatedDuration=V(u));const{calculatedDuration:c}=u,h=c+i;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-i}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:r,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return s.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),y=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let v=this.currentTime,x=s;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,m&&(n-=m/c)):"mirror"===p&&(x=o)),v=Ht(0,1,n)*c}const w=y?{done:!1,value:a[0]}:x.next(v);r&&(w.value=r(w.value));let{done:P}=w;y||null===l||(P=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&P);return T&&void 0!==i&&(w.value=sn(a,this.options,i)),f&&f(w.value),T&&this.finish(),w}get duration(){const{resolved:t}=this;return t?A(t.calculatedDuration):0}get time(){return A(this.currentTime)}set time(t){t=b(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=A(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Qn,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&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(t){return this.startTime=0,this.tick(t,!0)}}function ii(t){return new ni(t)}const si=new Set(["opacity","clipPath","filter","transform"]);function oi(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=function t(e,n){return e?"function"==typeof e&&O()?j(e,n):L(e)?U(e):Array.isArray(e)?e.map(e=>t(e,n)||W.easeOut):W[e]:void 0}(a,s);Array.isArray(c)&&(u.easing=c);return t.animate(u,{delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}const ri=T(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const ai={anticipate:Ut,backInOut:It,circInOut:zt};class li extends on{constructor(t){super(t);const{name:e,motionValue:n,element:i,keyframes:s}=this.options;this.resolver=new Qe(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:i,ease:s,type:o,motionValue:r,name:a,startTime:l}=this.options;if(!r.owner||!r.owner.current)return!1;var u;if("string"==typeof s&&O()&&s in ai&&(s=ai[s]),D((u=this.options).type)||"spring"===u.type||!I(u.ease)){const{onComplete:e,onUpdate:r,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new ni({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:t[0]};const s=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),s.push(i.value),o+=10;return{times:void 0,keyframes:s,duration:o-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),n=c.duration,i=c.times,s=c.ease,o="keyframes"}const c=oi(r.owner.current,a,t,{...this.options,duration:n,times:i,ease:s});return c.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(k(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;r.set(sn(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return A(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return A(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=b(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return x;const{animation:n}=e;k(n,t)}else this.pendingTimeline=t;return x}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:i,type:s,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,c=new ni({...u,keyframes:n,duration:i,type:s,ease:o,times:r,isGenerator:!0}),h=b(this.time);t.setWithVelocity(c.sample(h-10).value,c.sample(h).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return ri()&&n&&si.has(n)&&!a&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}}const ui={type:"spring",stiffness:500,damping:25,restSpeed:10},ci={type:"keyframes",duration:.8},hi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},di=(t,{keyframes:e})=>e.length>2?ci:ht.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ui:hi;const pi=(t,e,n,i={},s,o)=>r=>{const a=M(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u-=b(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(a)||(c={...c,...di(t,c)}),c.duration&&(c.duration=b(c.duration)),c.repeatDelay&&(c.repeatDelay=b(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(h=!0)),(Dt.current||nt.skipAnimations)&&(h=!0,c.duration=0,c.delay=0),h&&!o&&void 0!==e.get()){const t=sn(c.keyframes,a);if(void 0!==t)return rt.update(()=>{c.onUpdate(t),c.onComplete()}),new C([])}return!o&&li.supports(c)?new li(c):new ni(c)};function mi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function fi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;i&&(r=i);const u=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in l){const i=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),s=l[e];if(void 0===s||c&&mi(c,e))continue;const a={delay:n,...M(r||{},e)};let h=!1;if(window.MotionHandoffAnimation){const n=Rt(t);if(n){const t=window.MotionHandoffAnimation(n,e,rt);null!==t&&(a.startTime=t,h=!0)}}Ct(t,e),i.start(pi(e,i,s,t.shouldReduceMotion&&dt.has(e)?{type:!1}:a,t,h));const d=i.animation;d&&u.push(d)}return a&&Promise.all(u).then(()=>{rt.update(()=>{a&&At(t,a)})}),u}function gi(t,e,n={}){var i;const s=v(t,e,"exit"===n.type?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const r=s?()=>Promise.all(fi(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,s=1,o){const r=[],a=(t.variantChildren.size-1)*i,l=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(yi).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(gi(t,e,{...o,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,s+i,r,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(()=>e())}return Promise.all([r(),a(n.delay)])}function yi(t,e){return t.sortNodePosition(e)}function vi(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>gi(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=gi(t,e,n);else{const s="function"==typeof e?v(t,e,n.custom):e;i=Promise.all(fi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}function xi(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}function wi(t){return"string"==typeof t||Array.isArray(t)}const Pi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ti=["initial",...Pi],Si=Ti.length;const bi=[...Pi].reverse(),Ai=Pi.length;function Ei(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>vi(t,e,n)))}(t),n=Vi(),i=!0;const s=e=>(n,i)=>{var s;const o=v(t,i,"exit"===e?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=function t(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(n.initial=e.props.initial),n}const n={};for(let t=0;t<Si;t++){const i=Ti[t],s=e.props[i];(wi(s)||!1===s)&&(n[i]=s)}return n}(t.parent)||{},l=[],u=new Set;let c={},h=1/0;for(let e=0;e<Ai;e++){const d=bi[e],p=n[d],m=void 0!==r[d]?r[d]:a[d],g=wi(m),y=d===o?p.isActive:null;!1===y&&(h=e);let v=m===a[d]&&m!==r[d]&&g;if(v&&i&&t.manuallyAnimateOnMount&&(v=!1),p.protectedKeys={...c},!p.isActive&&null===y||!m&&!p.prevProp||f(m)||"boolean"==typeof m)continue;const x=Ci(p.prevProp,m);let w=x||d===o&&p.isActive&&!v&&g||e>h&&g,P=!1;const T=Array.isArray(m)?m:[m];let S=T.reduce(s(d),{});!1===y&&(S={});const{prevResolvedValues:b={}}=p,A={...b,...S},E=e=>{w=!0,u.has(e)&&(P=!0,u.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in A){const e=S[t],n=b[t];if(c.hasOwnProperty(t))continue;let i=!1;i=pt(e)&&pt(n)?!xi(e,n):e!==n,i?null!=e?E(t):u.add(t):void 0!==e&&u.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(c={...c,...S}),i&&t.blockInitialAnimation&&(w=!1);const C=!(v&&x)||P;w&&C&&l.push(...T.map(t=>({animation:t,options:{type:d}})))}if(u.size){const e={};if("boolean"!=typeof r.initial){const n=v(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=null!=i?i:null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){var s;if(n[e].isActive===i)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const r=o(e);for(const t in n)n[t].protectedKeys={};return r},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Vi(),i=!0}}}function Ci(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!xi(e,t)}function Mi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Vi(){return{animate:Mi(!0),whileInView:Mi(),whileHover:Mi(),whileTap:Mi(),whileDrag:Mi(),whileFocus:Mi(),exit:Mi()}}class Ri{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Di=0;const ki={animation:{Feature:class extends Ri{constructor(t){super(t),t.animationState||(t.animationState=Ei(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();f(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends Ri{constructor(){super(...arguments),this.id=Di++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}},Li=e.createContext({}),Bi=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Fi(t){return t.max-t.min}function Oi(t,e,n,i=.5){t.origin=i,t.originPoint=rn(e.min,e.max,t.origin),t.scale=Fi(n)/Fi(e),t.translate=rn(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function ji(t,e,n,i){Oi(t.x,e.x,n.x,i?i.originX:void 0),Oi(t.y,e.y,n.y,i?i.originY:void 0)}function Ii(t,e,n){t.min=n.min+e.min,t.max=t.min+Fi(e)}function Ui(t,e,n){t.min=e.min-n.min,t.max=t.min+Fi(e)}function Wi(t,e,n){Ui(t.x,e.x,n.x),Ui(t.y,e.y,n.y)}const Ni=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 zi(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ni.has(t)}let $i=t=>!zi(t);function Hi(t){t&&($i=e=>e.startsWith("on")?!zi(e):t(e))}try{Hi(require("@emotion/is-prop-valid").default)}catch(t){}function Xi(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||($i(s)||!0===n&&zi(s)||!e&&!zi(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}const Yi=e.createContext(null);function Ki(t){return f(t.animate)||Ti.some(e=>wi(t[e]))}function Gi(t){return Boolean(Ki(t)||t.variants)}function _i(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}function qi(t){const e=Et(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const Zi=t=>(n,i)=>{const s=e.useContext(Li),o=e.useContext(Yi),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},i,s,o){const r={latestValues:Ji(i,s,o,t),renderState:e()};return n&&(r.onMount=t=>n({props:i,current:t,...r}),r.onUpdate=t=>n(t)),r}(t,n,s,o);return i?r():_i(r)};function Ji(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=qi(o[t]);let{initial:r,animate:a}=t;const l=Ki(t),u=Gi(t);e&&u&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===r;const h=c?a:r;if(h&&"boolean"!=typeof h&&!f(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=y(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}function Qi(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function ts(t){return{point:{x:t.pageX,y:t.pageY}}}const es=t=>e=>_(e)&&t(e,ts(e));function ns(t,e,n,i){return Qi(t,e,es(n),i)}const is="undefined"!=typeof window;function ss(t){return e.useEffect(()=>()=>t(),[])}const os=is?e.useLayoutEffect:e.useEffect;function rs(){const t=function(){const t=e.useRef(!1);return os(()=>(t.current=!0,()=>{t.current=!1}),[]),t}(),[n,i]=e.useState(0),s=e.useCallback(()=>{t.current&&i(n+1)},[n]);return[e.useCallback(()=>rt.postRender(s),[s]),n]}const as=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}