framer-motion 12.4.13 → 12.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.js +1 -1
- package/dist/cjs/{create-DkTZDHiS.js → create-BErQMR-o.js} +4234 -4792
- package/dist/cjs/debug.js +5 -281
- package/dist/cjs/dom-mini.js +9 -7
- package/dist/cjs/dom.js +81 -639
- package/dist/cjs/index.js +1555 -1553
- package/dist/cjs/m.js +11 -179
- package/dist/cjs/mini.js +8 -0
- package/dist/debug.d.ts +2 -35
- package/dist/dom-mini.d.ts +1 -181
- package/dist/dom-mini.js +1 -1
- package/dist/dom.d.ts +3 -242
- package/dist/dom.js +1 -1
- package/dist/es/animation/animate/single-value.mjs +1 -1
- package/dist/es/animation/animators/BaseAnimation.mjs +1 -1
- package/dist/es/animation/animators/MainThreadAnimation.mjs +1 -2
- package/dist/es/animation/animators/drivers/driver-frameloop.mjs +1 -2
- package/dist/es/animation/animators/waapi/index.mjs +1 -3
- package/dist/es/animation/generators/utils/velocity.mjs +1 -1
- package/dist/es/animation/interfaces/motion-value.mjs +2 -4
- package/dist/es/animation/interfaces/visual-element-target.mjs +1 -2
- package/dist/es/animation/optimized-appear/start.mjs +3 -3
- package/dist/es/animation/sequence/utils/edit.mjs +1 -1
- package/dist/es/components/AnimatePresence/index.mjs +1 -1
- package/dist/es/components/Reorder/utils/check-reorder.mjs +1 -1
- package/dist/es/debug.mjs +1 -1
- package/dist/es/dom.mjs +1 -5
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +1 -2
- package/dist/es/gestures/hover.mjs +1 -2
- package/dist/es/gestures/pan/PanSession.mjs +1 -2
- package/dist/es/gestures/pan/index.mjs +1 -1
- package/dist/es/gestures/press.mjs +1 -2
- package/dist/es/index.mjs +14 -19
- package/dist/es/motion/features/layout/MeasureLayout.mjs +1 -2
- package/dist/es/motion/utils/use-visual-element.mjs +6 -6
- package/dist/es/projection/node/create-projection-node.mjs +2 -8
- package/dist/es/projection/shared/stack.mjs +1 -1
- package/dist/es/projection.mjs +1 -3
- package/dist/es/render/VisualElement.mjs +2 -5
- package/dist/es/render/components/create-proxy.mjs +1 -1
- package/dist/es/render/dom/DOMVisualElement.mjs +1 -1
- package/dist/es/render/dom/scroll/info.mjs +1 -2
- package/dist/es/render/dom/scroll/observe.mjs +1 -1
- package/dist/es/render/dom/scroll/on-scroll-handler.mjs +1 -1
- package/dist/es/render/dom/scroll/track.mjs +1 -1
- package/dist/es/render/svg/SVGVisualElement.mjs +1 -1
- package/dist/es/render/svg/config-motion.mjs +1 -1
- package/dist/es/render/utils/KeyframesResolver.mjs +1 -1
- package/dist/es/render/utils/flat-tree.mjs +1 -1
- package/dist/es/render/utils/motion-values.mjs +3 -3
- package/dist/es/render/utils/setters.mjs +1 -1
- package/dist/es/utils/delay.mjs +1 -2
- package/dist/es/utils/reduced-motion/use-reduced-motion.mjs +1 -1
- package/dist/es/utils/use-animation-frame.mjs +1 -1
- package/dist/es/utils/use-force-update.mjs +1 -1
- package/dist/es/utils/use-instant-transition.mjs +1 -1
- package/dist/es/value/scroll/use-element-scroll.mjs +1 -1
- package/dist/es/value/scroll/use-viewport-scroll.mjs +1 -1
- package/dist/es/value/use-combine-values.mjs +2 -2
- package/dist/es/value/use-computed.mjs +1 -1
- package/dist/es/value/use-inverted-scale.mjs +3 -3
- package/dist/es/value/use-motion-value.mjs +1 -1
- package/dist/es/value/use-scroll.mjs +4 -4
- package/dist/es/value/use-spring.mjs +1 -1
- package/dist/es/value/use-transform.mjs +1 -1
- package/dist/es/value/use-velocity.mjs +1 -1
- package/dist/es/value/use-will-change/WillChangeMotionValue.mjs +2 -2
- package/dist/framer-motion.dev.js +8227 -8251
- package/dist/framer-motion.js +1 -1
- package/dist/m.d.ts +49 -241
- package/dist/size-rollup-animate.js +1 -1
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max-assets.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-rollup-scroll.js +1 -1
- package/dist/types/client.d.ts +2 -2
- package/dist/types/index.d.ts +43 -79
- package/dist/{types.d-6pKw1mTI.d.ts → types.d-B50aGbjN.d.ts} +81 -289
- package/package.json +4 -6
- package/dist/es/frameloop/batcher.mjs +0 -69
- package/dist/es/frameloop/frame.mjs +0 -6
- package/dist/es/frameloop/index-legacy.mjs +0 -20
- package/dist/es/frameloop/microtask.mjs +0 -5
- package/dist/es/frameloop/order.mjs +0 -10
- package/dist/es/frameloop/render-step.mjs +0 -92
- package/dist/es/frameloop/sync-time.mjs +0 -31
- package/dist/es/stats/animation-count.mjs +0 -7
- package/dist/es/stats/buffer.mjs +0 -6
- package/dist/es/stats/index.mjs +0 -113
- package/dist/es/utils/GlobalConfig.mjs +0 -6
- package/dist/es/utils/array.mjs +0 -21
- package/dist/es/utils/subscription-manager.mjs +0 -40
- package/dist/es/utils/velocity-per-second.mjs +0 -11
- package/dist/es/utils/warn-once.mjs +0 -11
- package/dist/es/value/index.mjs +0 -319
- package/dist/three.d.ts +0 -2833
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as t,r as e,x as n,y as s,q as i,z as r,d as o,o as a,A as l,B as u,C as h,D as c,E as d,F as p,G as m,H as f,I as v,J as y,K as g,t as b,a as w,L as T,n as S,M as A,N as V,b as M,i as P,m as x,f as C,O as E,P as k,g as F,s as I,u as D,Q as O,R,p as B,h as K,v as N,j as L,k as U}from"./size-rollup-dom-animation-assets.js";import{Fragment as j}from"react";let q=t;function Y(t){let e;return()=>(void 0===e&&(e=t()),e)}const z=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},W=t=>1e3*t,X=t=>t/1e3,$=!1;function G(t,n,s){const i=t.getProps();return e(i,n,void 0!==s?s:i.custom,t)}const H=Y(()=>void 0!==window.ScrollTimeline);class _ 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=>H()&&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 Z(t,e){return t?t[e]||t.default||t:void 0}function J(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 Q(t){return"function"==typeof t}function tt(t,e){t.timeline=e,t.onfinish=null}const et=t=>Array.isArray(t)&&"number"==typeof t[0],nt={linearEasing:void 0};function st(t,e){const n=Y(t);return()=>{var t;return null!==(t=nt[e])&&void 0!==t?t:n()}}const it=st(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),rt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=t(z(0,i-1,e))+", ";return`linear(${s.substring(0,s.length-2)})`};function ot(t){return Boolean("function"==typeof t&&it()||!t||"string"==typeof t&&(t in lt||it())||et(t)||Array.isArray(t)&&t.every(ot))}const at=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,lt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:at([0,.65,.55,1]),circOut:at([.55,0,1,.45]),backIn:at([.31,.01,.66,-.59]),backOut:at([.33,1.53,.69,.99])};const ut=!1;function ht(){return ut}function ct(t,e){const n=function(t,e,n){var s;if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const r=null!==(s=null==n?void 0:n[t])&&void 0!==s?s:i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function dt(t){return!("touch"===t.pointerType||ht())}function pt(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 mt=(t,e)=>!!e&&(t===e||mt(t,e.parentElement)),ft=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const vt=new WeakSet;function yt(t){return e=>{"Enter"===e.key&&t(e)}}function gt(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function bt(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!ht()}function wt(t,e,n={}){const[s,i,r]=ct(t,n),o=t=>{const n=t.currentTarget;if(!n||!bt(t)||vt.has(n))return;vt.add(n),pt(t,"set");const s=e(n,t),r=(t,e)=>{n.removeEventListener("pointerup",o),n.removeEventListener("pointercancel",a),pt(t,"release"),bt(t)&&vt.has(n)&&(vt.delete(n),"function"==typeof s&&s(t,{success:e}))},o=t=>{const e=!!t.isTrusted&&(s=t,i=n instanceof Element?n.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},s.clientX<i.left||s.clientX>i.right||s.clientY<i.top||s.clientY>i.bottom);var s,i;r(t,!e&&(!(n instanceof Element)||mt(n,t.target)))},a=t=>{r(t,!1)};n.addEventListener("pointerup",o,i),n.addEventListener("pointercancel",a,i),n.addEventListener("lostpointercapture",a,i)};return s.forEach(t=>{let e=!1;var s;(t=n.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,s=t,ft.has(s.tagName)||-1!==s.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",o,i),e&&t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=yt(()=>{if(vt.has(n))return;gt(n,"down");const t=yt(()=>{gt(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>gt(n,"cancel"),e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)})(t,i),i)}),r}const Tt=new Set(["width","height","top","left","right","bottom",...n]);let St;function At(){St=void 0}const Vt={now:()=>(void 0===St&&Vt.set(s.isProcessing||$?s.timestamp:performance.now()),St),set:t=>{St=t,queueMicrotask(At)}};class Mt{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Pt(t,e){return e?t*(1e3/e):0}class xt{constructor(t,e={}){this.version="12.4.13",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=Vt.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=Vt.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 Mt);const n=this.events[t].add(e);return"change"===t?()=>{n(),i.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 this.current}getPrevious(){return this.prev}getVelocity(){const t=Vt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Pt(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 Ct(t,e){return new xt(t,e)}function Et(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ct(n))}function kt(t,e){const n=t.getValue("willChange");if(s=n,Boolean(o(s)&&s.add))return n.add(e);var s}function Ft(t){return t.props[a]}const It=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Dt(e,n,s,i){if(e===n&&s===i)return t;const r=t=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=It(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,s);return t=>0===t||1===t?t:It(r(t),n,i)}const Ot=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Rt=t=>e=>1-t(1-e),Bt=Dt(.33,1.53,.69,.99),Kt=Rt(Bt),Nt=Ot(Kt),Lt=t=>(t*=2)<1?.5*Kt(t):.5*(2-Math.pow(2,-10*(t-1))),Ut=t=>1-Math.sin(Math.acos(t)),jt=Rt(Ut),qt=Ot(Ut),Yt=t=>/^0[^.\s]+$/u.test(t);const zt=t=>Math.round(1e5*t)/1e5,Wt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Xt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$t=(t,e)=>n=>Boolean("string"==typeof n&&Xt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Gt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(Wt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Ht={...l,transform:t=>Math.round((t=>h(0,255,t))(t))},_t={test:$t("rgb","red"),parse:Gt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Ht.transform(t)+", "+Ht.transform(e)+", "+Ht.transform(n)+", "+zt(u.transform(s))+")"};const Zt={test:$t("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:_t.transform},Jt={test:$t("hsl","hue"),parse:Gt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+c.transform(zt(e))+", "+c.transform(zt(n))+", "+zt(u.transform(s))+")"},Qt={test:t=>_t.test(t)||Zt.test(t)||Jt.test(t),parse:t=>_t.test(t)?_t.parse(t):Jt.test(t)?Jt.parse(t):Zt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?_t.transform(t):Jt.transform(t)},te=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const ee=/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 ne(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(ee,t=>(Qt.test(t)?(s.color.push(r),i.push("color"),n.push(Qt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push("number"),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:s,types:i}}function se(t){return ne(t).values}function ie(t){const{split:e,types:n}=ne(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+="number"===e?zt(t[r]):"color"===e?Qt.transform(t[r]):t[r]}return i}}const re=t=>"number"==typeof t?0:t;const oe={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Wt))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(te))||void 0===n?void 0:n.length)||0)>0},parse:se,createTransformer:ie,getAnimatableNone:function(t){const e=se(t);return ie(t)(e.map(re))}},ae=new Set(["brightness","contrast","saturate","opacity"]);function le(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(Wt)||[];if(!s)return t;const i=n.replace(s,"");let r=ae.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const ue=/\b([a-z-]*)\(.*?\)/gu,he={...oe,getAnimatableNone:t=>{const e=t.match(ue);return e?e.map(le).join(" "):t}},ce={...d,color:Qt,backgroundColor:Qt,outlineColor:Qt,fill:Qt,stroke:Qt,borderColor:Qt,borderTopColor:Qt,borderRightColor:Qt,borderBottomColor:Qt,borderLeftColor:Qt,filter:he,WebkitFilter:he},de=t=>ce[t];function pe(t,e){let n=de(t);return n!==he&&(n=oe),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const me=new Set(["auto","none","0"]);const fe=t=>180*t/Math.PI,ve=t=>{const e=fe(Math.atan2(t[1],t[0]));return ge(e)},ye={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ve,rotateZ:ve,skewX:t=>fe(Math.atan(t[1])),skewY:t=>fe(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ge=t=>((t%=360)<0&&(t+=360),t),be=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),we=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Te={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:be,scaleY:we,scale:t=>(be(t)+we(t))/2,rotateX:t=>ge(fe(Math.atan2(t[6],t[5]))),rotateY:t=>ge(fe(Math.atan2(-t[2],t[0]))),rotateZ:ve,rotate:ve,skewX:t=>fe(Math.atan(t[4])),skewY:t=>fe(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Se(t){return t.includes("scale")?1:0}function Ae(t,e){if(!t||"none"===t)return Se(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Te,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=ye,i=e}if(!i)return Se(e);const r=s[e],o=i[1].split(",").map(Ve);return"function"==typeof r?r(o):o[r]}function Ve(t){return parseFloat(t.trim())}const Me=t=>t===l||t===p,Pe=new Set(["x","y","z"]),xe=n.filter(t=>!Pe.has(t));const Ce={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:(t,{transform:e})=>Ae(e,"x"),y:(t,{transform:e})=>Ae(e,"y")};Ce.translateX=Ce.x,Ce.translateY=Ce.y;const Ee=new Set;let ke=!1,Fe=!1;function Ie(){if(Fe){const t=Array.from(Ee).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 xe.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.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 s;null===(s=t.getValue(e))||void 0===s||s.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Fe=!1,ke=!1,Ee.forEach(t=>t.complete()),Ee.clear()}function De(){Ee.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Fe=!0)})}class Oe{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ee.add(this),ke||(ke=!0,i.read(De),i.resolveKeyframes(Ie))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let i=0;i<t.length;i++)if(null===t[i])if(0===i){const i=null==s?void 0:s.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ee.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ee.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Re=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Be=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ke(t,e,n=1){const[s,i]=function(t){const e=Be.exec(t);if(!e)return[,];const[,n,s,i]=e;return["--"+(null!=n?n:s),i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return Re(t)?parseFloat(t):t}return m(i)?Ke(i,e,n+1):i}const Ne=t=>e=>e.test(t),Le=[l,p,c,f,v,y,{test:t=>"auto"===t,parse:t=>t}],Ue=t=>Le.find(Ne(t));class je extends Oe{constructor(t,e,n,s,i){super(t,e,n,s,i,!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 s=t[n];if("string"==typeof s&&(s=s.trim(),m(s))){const i=Ke(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Tt.has(n)||2!==t.length)return;const[s,i]=t,r=Ue(s),o=Ue(i);if(r!==o)if(Me(r)&&Me(o))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(s=t[e])?0===s:null===s||"none"===s||"0"===s||Yt(s))&&n.push(e);var s;n.length&&function(t,e,n){let s=0,i=void 0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!me.has(e)&&ne(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=pe(n,i)}(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=Ce[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=Ce[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const qe=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!oe.test(t)&&"0"!==t||t.startsWith("url(")));function Ye(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=qe(i,e),a=qe(r,e);return!(!o||!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||Q(n))&&s)}const ze=t=>null!==t;function We(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ze),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}class Xe{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Vt.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(De(),Ie()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=Vt.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:i,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!Ye(t,n,s,i)){if(!r)return a&&a(We(t,this.options,e)),o&&o(),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.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const $e=(t,e,n)=>t+(e-t)*n;function Ge(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 He(t,e){return n=>n>0?e:t}const _e=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Ze=[Zt,_t,Jt];function Je(t){const e=(n=t,Ze.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Jt&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Ge(a,s,t+1/3),r=Ge(a,s,t),o=Ge(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const Qe=(t,e)=>{const n=Je(t),s=Je(e);if(!n||!s)return He(t,e);const i={...n};return t=>(i.red=_e(n.red,s.red,t),i.green=_e(n.green,s.green,t),i.blue=_e(n.blue,s.blue,t),i.alpha=$e(n.alpha,s.alpha,t),_t.transform(i))},tn=(t,e)=>n=>e(t(n)),en=(...t)=>t.reduce(tn),nn=new Set(["none","hidden"]);function sn(t,e){return n=>$e(t,e,n)}function rn(t){return"number"==typeof t?sn:"string"==typeof t?m(t)?He:Qt.test(t)?Qe:ln:Array.isArray(t)?on:"object"==typeof t?Qt.test(t)?Qe:an:He}function on(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>rn(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function an(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=rn(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const ln=(t,e)=>{const n=oe.createTransformer(e),s=ne(t),i=ne(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?nn.has(t)&&!i.values.length||nn.has(e)&&!s.values.length?function(t,e){return nn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):en(on(function(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[r]=l,i[o]++}return s}(s,i),i.values),n):He(t,e)};function un(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return $e(t,e,n);return rn(t)(t,e)}function hn(t,e,n){const s=Math.max(e-5,0);return Pt(n-t(s),e-s)}const cn=100,dn=10,pn=1,mn=0,fn=800,vn=.3,yn=.3,gn={granular:.01,default:2},bn={granular:.005,default:.5},wn=.01,Tn=10,Sn=.05,An=1;function Vn({duration:t=fn,bounce:e=vn,velocity:n=mn,mass:s=pn}){let i,r,o=1-e;o=h(Sn,An,o),t=h(wn,Tn,X(t)),o<1?(i=e=>{const s=e*o,i=s*t;return.001-(s-n)/Mn(e,o)*Math.exp(-i)},r=e=>{const s=e*o*t,r=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=Mn(Math.pow(e,2),o);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(i,r,5/t);if(t=W(t),isNaN(a))return{stiffness:cn,damping:dn,duration:t};{const e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}function Mn(t,e){return t*Math.sqrt(1-e*e)}const Pn=["duration","bounce"],xn=["stiffness","damping","mass"];function Cn(t,e){return e.some(e=>void 0!==t[e])}function En(t=yn,e=vn){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:u,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:mn,stiffness:cn,damping:dn,mass:pn,isResolvedFromDuration:!1,...t};if(!Cn(t,xn)&&Cn(t,Pn))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,r=2*h(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:pn,stiffness:i,damping:r}}else{const n=Vn(t);e={...e,...n,mass:pn},e.isResolvedFromDuration=!0}return e}({...n,velocity:-X(n.velocity||0)}),f=p||0,v=u/(2*Math.sqrt(l*c)),y=o-r,g=X(Math.sqrt(l/c)),b=Math.abs(y)<5;let w;if(s||(s=b?gn.granular:gn.default),i||(i=b?bn.granular:bn.default),v<1){const t=Mn(g,v);w=e=>{const n=Math.exp(-v*g*e);return o-n*((f+v*g*y)/t*Math.sin(t*e)+y*Math.cos(t*e))}}else if(1===v)w=t=>o-Math.exp(-g*t)*(y+(f+g*y)*t);else{const t=g*Math.sqrt(v*v-1);w=e=>{const n=Math.exp(-v*g*e),s=Math.min(t*e,300);return o-n*((f+v*g*y)*Math.sinh(s)+t*y*Math.cosh(s))/t}}const T={calculatedDuration:m&&d||null,next:t=>{const e=w(t);if(m)a.done=t>=d;else{let n=0;v<1&&(n=0===t?W(f):hn(w,t,e));const r=Math.abs(n)<=s,l=Math.abs(o-e)<=i;a.done=r&&l}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(J(T),2e4),e=rt(e=>T.next(t*e).value,t,30);return t+"ms "+e}};return T}function kn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},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=c+m,v=void 0===o?f:o(f);v!==f&&(m=v-c);const y=t=>-m*Math.exp(-t/s),g=t=>v+y(t),b=t=>{const e=y(t),n=g(t);d.done=Math.abs(e)<=u,d.value=d.done?v:n};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,T=En({keyframes:[d.value,p(d.value)],velocity:hn(g,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:h}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,b(t),S(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&b(t),d)}}}const Fn=Dt(.42,0,1,1),In=Dt(0,0,.58,1),Dn=Dt(.42,0,.58,1),On={linear:t,easeIn:Fn,easeInOut:Dn,easeOut:In,circIn:Ut,circInOut:qt,circOut:jt,backIn:Kt,backInOut:Nt,backOut:Bt,anticipate:Lt},Rn=t=>{if(et(t)){q(4===t.length);const[e,n,s,i]=t;return Dt(e,n,s,i)}return"string"==typeof t?On[t]:t};function Bn(e,n,{clamp:s=!0,ease:i,mixer:r}={}){const o=e.length;if(q(o===n.length),1===o)return()=>n[0];if(2===o&&n[0]===n[1])return()=>n[1];const a=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),n=[...n].reverse());const l=function(e,n,s){const i=[],r=s||un,o=e.length-1;for(let s=0;s<o;s++){let o=r(e[s],e[s+1]);if(n){const e=Array.isArray(n)?n[s]||t:n;o=en(e,o)}i.push(o)}return i}(n,i,r),u=l.length,c=t=>{if(a&&t<e[0])return n[0];let s=0;if(u>1)for(;s<e.length-2&&!(t<e[s+1]);s++);const i=z(e[s],e[s+1],t);return l[s](i)};return s?t=>c(h(e[0],e[o-1],t)):c}function Kn(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=z(0,e,s);t.push($e(n,1,i))}}(e,t.length-1),e}function Nn({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(s)?s.map(Rn):Rn(s),r={done:!1,value:e[0]},o=Bn(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Kn(e),t),e,{ease:Array.isArray(i)?i:(a=e,l=i,a.map(()=>l||Dn).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const Ln=t=>{const e=({timestamp:e})=>t(e);return{start:()=>i.update(e,!0),stop:()=>g(e),now:()=>s.isProcessing?s.timestamp:Vt.now()}},Un={decay:kn,inertia:kn,tween:Nn,keyframes:Nn,spring:En},jn=t=>t/100;class qn extends Xe{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:s,keyframes:i}=this.options,r=(null==s?void 0:s.KeyframeResolver)||Oe;this.resolver=new r(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),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:s=0,repeatType:i,velocity:r=0}=this.options,o=Q(e)?e:Un[e]||Nn;let a,l;o!==Nn&&"number"!=typeof t[0]&&(a=en(jn,un(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===i&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=J(u));const{calculatedDuration:h}=u,c=h+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:c,totalDuration:c*(n+1)-s}}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:s,generator:i,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return i.next(0);const{delay:d,repeat:p,repeatType:m,repeatDelay:f,onUpdate:v}=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 y=this.currentTime-d*(this.speed>=0?1:-1),g=this.speed>=0?y<0:y>u;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let b=this.currentTime,w=i;if(p){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,p+1);Boolean(e%2)&&("reverse"===m?(n=1-n,f&&(n-=f/c)):"mirror"===m&&(w=r)),b=h(0,1,n)*c}const T=g?{done:!1,value:a[0]}:w.next(b);o&&(T.value=o(T.value));let{done:S}=T;g||null===l||(S=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const A=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return A&&void 0!==s&&(T.value=We(a,this.options,s)),v&&v(T.value),A&&this.finish(),T}get duration(){const{resolved:t}=this;return t?X(t.calculatedDuration):0}get time(){return X(this.currentTime)}set time(t){t=W(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=X(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Ln,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):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)}}const Yn=new Set(["opacity","clipPath","filter","transform"]);function zn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const h=function t(e,n){return e?"function"==typeof e&&it()?rt(e,n):et(e)?at(e):Array.isArray(e)?e.map(e=>t(e,n)||lt.easeOut):lt[e]:void 0}(a,i);Array.isArray(h)&&(u.easing=h);return t.animate(u,{delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}const Wn=Y(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const Xn={anticipate:Lt,backInOut:Nt,circInOut:qt};class $n extends Xe{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:i}=this.options;this.resolver=new je(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:s,ease:i,type:r,motionValue:o,name:a,startTime:l}=this.options;if(!o.owner||!o.owner.current)return!1;var u;if("string"==typeof i&&it()&&i in Xn&&(i=Xn[i]),Q((u=this.options).type)||"spring"===u.type||!ot(u.ease)){const{onComplete:e,onUpdate:o,motionValue:a,element:l,...u}=this.options,h=function(t,e){const n=new qn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<2e4;)s=n.sample(r),i.push(s.value),r+=10;return{times:void 0,keyframes:i,duration:r-10,ease:"linear"}}(t,u);1===(t=h.keyframes).length&&(t[1]=t[0]),n=h.duration,s=h.times,i=h.ease,r="keyframes"}const h=zn(o.owner.current,a,t,{...this.options,duration:n,times:s,ease:i});return h.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(tt(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;o.set(We(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:n,times:s,type:r,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return X(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return X(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=W(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(e){if(this._resolved){const{resolved:n}=this;if(!n)return t;const{animation:s}=n;tt(s,e)}else this.pendingTimeline=e;return t}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:s,type:i,ease:r,times:o}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,h=new qn({...u,keyframes:n,duration:s,type:i,ease:r,times:o,isGenerator:!0}),c=W(this.time);t.setWithVelocity(h.sample(c-10).value,h.sample(c).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:s,repeatType:i,damping:r,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return Wn()&&n&&Yn.has(n)&&!a&&!l&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}}const Gn={type:"spring",stiffness:500,damping:25,restSpeed:10},Hn={type:"keyframes",duration:.8},_n={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Zn=(t,{keyframes:e})=>e.length>2?Hn:b.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Gn:_n;const Jn=(t,e,n,s={},r,o)=>a=>{const l=Z(s,t)||{},u=l.delay||s.delay||0;let{elapsed:h=0}=s;h-=W(u);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-h,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:o?void 0:r};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(l)||(c={...c,...Zn(t,c)}),c.duration&&(c.duration=W(c.duration)),c.repeatDelay&&(c.repeatDelay=W(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(d=!0)),c.allowFlatten=!l.type&&!l.ease,d&&!o&&void 0!==e.get()){const t=We(c.keyframes,l);if(void 0!==t)return i.update(()=>{c.onUpdate(t),c.onComplete()}),new _([])}return!o&&$n.supports(c)?new $n(c):new qn(c)};function Qn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function ts(t,e,{delay:n=0,transitionOverride:s,type:o}={}){var a;let{transition:l=t.getDefaultTransition(),transitionEnd:u,...h}=e;s&&(l=s);const c=[],d=o&&t.animationState&&t.animationState.getState()[o];for(const e in h){const s=t.getValue(e,null!==(a=t.latestValues[e])&&void 0!==a?a:null),r=h[e];if(void 0===r||d&&Qn(d,e))continue;const o={delay:n,...Z(l||{},e)};let u=!1;if(window.MotionHandoffAnimation){const n=Ft(t);if(n){const t=window.MotionHandoffAnimation(n,e,i);null!==t&&(o.startTime=t,u=!0)}}kt(t,e),s.start(Jn(e,s,r,t.shouldReduceMotion&&Tt.has(e)?{type:!1}:o,t,u));const p=s.animation;p&&c.push(p)}return u&&Promise.all(c).then(()=>{i.update(()=>{u&&function(t,e){const n=G(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const e in o){Et(t,e,r(o[e]))}}(t,u)})}),c}function es(t,e,n={}){var s;const i=G(t,e,"exit"===n.type?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(ts(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:i=0,staggerChildren:o,staggerDirection:a}=r;return function(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,l=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(ns).forEach((t,s)=>{t.notify("AnimationStart",e),o.push(es(t,e,{...r,delay:n+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(o)}(t,e,i+s,o,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[o,a]:[a,o];return t().then(()=>e())}return Promise.all([o(),a(n.delay)])}function ns(t,e){return t.sortNodePosition(e)}function ss(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const is=T.length;const rs=[...V].reverse(),os=V.length;function as(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>es(t,e,n));s=Promise.all(i)}else if("string"==typeof e)s=es(t,e,n);else{const i="function"==typeof e?G(t,e,n.custom):e;s=Promise.all(ts(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function ls(t){let e=as(t),n=cs(),s=!0;const i=e=>(n,s)=>{var i;const r=G(t,s,"exit"===e?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);if(r){const{transition:t,transitionEnd:e,...s}=r;n={...n,...s,...e}}return n};function r(r){const{props:o}=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<is;t++){const s=T[t],i=e.props[s];(w(i)||!1===i)&&(n[s]=i)}return n}(t.parent)||{},l=[],u=new Set;let h={},c=1/0;for(let e=0;e<os;e++){const d=rs[e],p=n[d],m=void 0!==o[d]?o[d]:a[d],f=w(m),v=d===r?p.isActive:null;!1===v&&(c=e);let y=m===a[d]&&m!==o[d]&&f;if(y&&s&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...h},!p.isActive&&null===v||!m&&!p.prevProp||S(m)||"boolean"==typeof m)continue;const g=us(p.prevProp,m);let b=g||d===r&&p.isActive&&!y&&f||e>c&&f,T=!1;const V=Array.isArray(m)?m:[m];let M=V.reduce(i(d),{});!1===v&&(M={});const{prevResolvedValues:P={}}=p,x={...P,...M},C=e=>{b=!0,u.has(e)&&(T=!0,u.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in x){const e=M[t],n=P[t];if(h.hasOwnProperty(t))continue;let s=!1;s=A(e)&&A(n)?!ss(e,n):e!==n,s?null!=e?C(t):u.add(t):void 0!==e&&u.has(t)?C(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=M,p.isActive&&(h={...h,...M}),s&&t.blockInitialAnimation&&(b=!1);const E=!(y&&g)||T;b&&E&&l.push(...V.map(t=>({animation:t,options:{type:d}})))}if(u.size){const e={};if("boolean"!=typeof o.initial){const n=G(t,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const s=t.getBaseTarget(n),i=t.getValue(n);i&&(i.liveStyle=!0),e[n]=null!=s?s:null}),l.push({animation:e})}let d=Boolean(l.length);return!s||!1!==o.initial&&o.initial!==o.animate||t.manuallyAnimateOnMount||(d=!1),s=!1,d?e(l):Promise.resolve()}return{animateChanges:r,setActive:function(e,s){var i;if(n[e].isActive===s)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,s)}),n[e].isActive=s;const o=r(e);for(const t in n)n[t].protectedKeys={};return o},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=cs(),s=!0}}}function us(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!ss(e,t)}function hs(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function cs(){return{animate:hs(!0),whileInView:hs(),whileHover:hs(),whileTap:hs(),whileDrag:hs(),whileFocus:hs(),exit:hs()}}class ds{constructor(t){this.isMounted=!1,this.node=t}update(){}}let ps=0;const ms={animation:{Feature:class extends ds{constructor(t){super(t),t.animationState||(t.animationState=ls(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();S(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 ds{constructor(){super(...arguments),this.id=ps++}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 s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function fs(t){return{point:{x:t.pageX,y:t.pageY}}}function vs(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover","Start"===n);const r=s["onHover"+n];r&&i.postRender(()=>r(e,fs(e)))}function ys(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function gs(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap","Start"===n);const r=s["onTap"+("End"===n?"":n)];r&&i.postRender(()=>r(e,fs(e)))}const bs=new WeakMap,ws=new WeakMap,Ts=t=>{const e=bs.get(t.target);e&&e(t)},Ss=t=>{t.forEach(Ts)};function As(t,e,n){const s=function({root:t,...e}){const n=t||document;ws.has(n)||ws.set(n,{});const s=ws.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Ss,{root:t,...e})),s[i]}(e);return bs.set(t,n),s.observe(t),()=>{bs.delete(t),s.unobserve(t)}}const Vs={some:0,all:1};const Ms={inView:{Feature:class extends ds{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Vs[s]};return As(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),r=e?n:s;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ds{mount(){const{current:t}=this.node;t&&(this.unmount=wt(t,(t,e)=>(gs(this.node,e,"Start"),(t,{success:e})=>gs(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends ds{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=en(ys(this.node.current,"focus",()=>this.onFocus()),ys(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ds{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[s,i,r]=ct(t,n),o=t=>{if(!dt(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{dt(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach(t=>{t.addEventListener("pointerenter",o,i)}),r}(t,(t,e)=>(vs(this.node,e,"Start"),t=>vs(this.node,t,"End"))))}unmount(){}}}};const Ps=()=>({x:{min:0,max:0},y:{min:0,max:0}}),xs={current:null},Cs={current:!1};const Es=[...Le,Qt,oe],ks=new WeakMap;const Fs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Is extends class{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:r,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Oe,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=Vt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,i.render(this.render,!1,!0))};const{latestValues:u,renderState:h,onUpdate:c}=a;this.onUpdate=c,this.latestValues=u,this.baseTarget={...u},this.initialValues=e.initial?{...u}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=P(e),this.isVariantNode=x(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:d,...p}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in p){const e=p[t];void 0!==u[t]&&o(e)&&e.set(u[t],!1)}}mount(t){this.current=t,ks.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Cs.current||function(){if(Cs.current=!0,M)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>xs.current=t.matches;t.addListener(e),e()}else xs.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||xs.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),g(this.notifyUpdate),g(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=b.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&i.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),r=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),r(),o&&o(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in C){const e=C[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Fs.length;e++){const n=Fs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(o(i))t.addValue(s,i);else if(o(r))t.addValue(s,Ct(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,Ct(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Ct(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=s&&("string"==typeof s&&(Re(s)||Yt(s))?s=parseFloat(s):(i=s,!Es.find(Ne(i))&&oe.test(e)&&(s=pe(t,e))),this.setBaseTarget(t,o(s)?s.get():s)),o(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var n;const{initial:s}=this.props;let i;if("string"==typeof s||"object"==typeof s){const r=e(this.props,s,null===(n=this.presenceContext)||void 0===n?void 0:n.custom);r&&(i=r[t])}if(s&&void 0!==i)return i;const r=this.getBaseTargetFromProps(this.props,t);return void 0===r||o(r)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:r}on(t,e){return this.events[t]||(this.events[t]=new Mt),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=je}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;o(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}class Ds extends Is{constructor(){super(...arguments),this.type="html",this.renderInstance=E}readValueFromInstance(t,e){if(b.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ae(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(k(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){F(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return I(t,e,n)}}class Os extends Is{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ps,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&D(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(b.has(e)){const t=de(e);return t&&t.default||0}return e=O.has(e)?e:R(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return B(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&i.postRender(this.updateDimensions)}build(t,e,n){K(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){N(t,e,n,s)}mount(t){this.isSVGTag=L(t.tagName),super.mount(t)}}const Rs={renderer:(t,e)=>U(t)?new Os(e):new Ds(e,{allowProjection:t!==j}),...ms,...Ms};export{Rs as domAnimation};
|
|
1
|
+
import{w as t,x as e,q as n,r as s,y as i,z as r,d as o,o as a,A as l,B as u,C as h,D as c,E as d,F as p,G as m,H as f,I as v,J as y,K as g,t as b,a as w,L as T,n as S,M as A,N as V,b as M,i as P,m as x,f as C,O as E,P as k,g as F,s as I,u as D,Q as O,R,p as B,h as K,v as N,j as L,k as U}from"./size-rollup-dom-animation-assets.js";import{Fragment as j}from"react";let q=t;const Y=!1;function z(t){let e;return()=>(void 0===e&&(e=t()),e)}const W=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class X{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const $=t=>1e3*t,G=t=>t/1e3;function H(t,e){return e?t*(1e3/e):0}const _=z(()=>void 0!==window.ScrollTimeline);class Z 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=>_()&&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 J(t,e){return t?t[e]||t.default||t:void 0}function Q(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 tt(t){return"function"==typeof t}function et(t,e){t.timeline=e,t.onfinish=null}const nt=t=>Array.isArray(t)&&"number"==typeof t[0],st={linearEasing:void 0};function it(t,e){const n=z(t);return()=>{var t;return null!==(t=st[e])&&void 0!==t?t:n()}}const rt=it(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),ot=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=t(W(0,i-1,e))+", ";return`linear(${s.substring(0,s.length-2)})`};function at(t){return Boolean("function"==typeof t&&rt()||!t||"string"==typeof t&&(t in ut||rt())||nt(t)||Array.isArray(t)&&t.every(at))}const lt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,ut={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:lt([0,.65,.55,1]),circOut:lt([.55,0,1,.45]),backIn:lt([.31,.01,.66,-.59]),backOut:lt([.33,1.53,.69,.99])};let ht;function ct(){ht=void 0}const dt={now:()=>(void 0===ht&&dt.set(e.isProcessing||Y?e.timestamp:performance.now()),ht),set:t=>{ht=t,queueMicrotask(ct)}},pt=!1;function mt(){return pt}function ft(t,e){const n=function(t,e,n){var s;if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const r=null!==(s=null==n?void 0:n[t])&&void 0!==s?s:i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function vt(t){return!("touch"===t.pointerType||mt())}function yt(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 gt=(t,e)=>!!e&&(t===e||gt(t,e.parentElement)),bt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const wt=new WeakSet;function Tt(t){return e=>{"Enter"===e.key&&t(e)}}function St(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function At(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!mt()}function Vt(t,e,n={}){const[s,i,r]=ft(t,n),o=t=>{const n=t.currentTarget;if(!n||!At(t)||wt.has(n))return;wt.add(n),yt(t,"set");const s=e(n,t),r=(t,e)=>{n.removeEventListener("pointerup",o),n.removeEventListener("pointercancel",a),yt(t,"release"),At(t)&&wt.has(n)&&(wt.delete(n),"function"==typeof s&&s(t,{success:e}))},o=t=>{const e=!!t.isTrusted&&(s=t,i=n instanceof Element?n.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},s.clientX<i.left||s.clientX>i.right||s.clientY<i.top||s.clientY>i.bottom);var s,i;r(t,!e&&(!(n instanceof Element)||gt(n,t.target)))},a=t=>{r(t,!1)};n.addEventListener("pointerup",o,i),n.addEventListener("pointercancel",a,i),n.addEventListener("lostpointercapture",a,i)};return s.forEach(t=>{let e=!1;var s;(t=n.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,s=t,bt.has(s.tagName)||-1!==s.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",o,i),e&&t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=Tt(()=>{if(wt.has(n))return;St(n,"down");const t=Tt(()=>{St(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>St(n,"cancel"),e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)})(t,i),i)}),r}class Mt{constructor(t,e={}){this.version="12.5.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=dt.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=dt.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 X);const s=this.events[t].add(e);return"change"===t?()=>{s(),n.read(()=>{this.events.change.getSize()||this.stop()})}:s}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 this.current}getPrevious(){return this.prev}getVelocity(){const t=dt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return H(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 Pt(t,e){return new Mt(t,e)}function xt(t,e,n){const i=t.getProps();return s(i,e,void 0!==n?n:i.custom,t)}const Ct=new Set(["width","height","top","left","right","bottom",...i]);function Et(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Pt(n))}function kt(t,e){const n=t.getValue("willChange");if(s=n,Boolean(o(s)&&s.add))return n.add(e);var s}function Ft(t){return t.props[a]}const It=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Dt(e,n,s,i){if(e===n&&s===i)return t;const r=t=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=It(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,s);return t=>0===t||1===t?t:It(r(t),n,i)}const Ot=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Rt=t=>e=>1-t(1-e),Bt=Dt(.33,1.53,.69,.99),Kt=Rt(Bt),Nt=Ot(Kt),Lt=t=>(t*=2)<1?.5*Kt(t):.5*(2-Math.pow(2,-10*(t-1))),Ut=t=>1-Math.sin(Math.acos(t)),jt=Rt(Ut),qt=Ot(Ut),Yt=t=>/^0[^.\s]+$/u.test(t);const zt=t=>Math.round(1e5*t)/1e5,Wt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Xt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$t=(t,e)=>n=>Boolean("string"==typeof n&&Xt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Gt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(Wt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Ht={...l,transform:t=>Math.round((t=>h(0,255,t))(t))},_t={test:$t("rgb","red"),parse:Gt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Ht.transform(t)+", "+Ht.transform(e)+", "+Ht.transform(n)+", "+zt(u.transform(s))+")"};const Zt={test:$t("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:_t.transform},Jt={test:$t("hsl","hue"),parse:Gt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+c.transform(zt(e))+", "+c.transform(zt(n))+", "+zt(u.transform(s))+")"},Qt={test:t=>_t.test(t)||Zt.test(t)||Jt.test(t),parse:t=>_t.test(t)?_t.parse(t):Jt.test(t)?Jt.parse(t):Zt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?_t.transform(t):Jt.transform(t)},te=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const ee=/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 ne(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(ee,t=>(Qt.test(t)?(s.color.push(r),i.push("color"),n.push(Qt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push("number"),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:s,types:i}}function se(t){return ne(t).values}function ie(t){const{split:e,types:n}=ne(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+="number"===e?zt(t[r]):"color"===e?Qt.transform(t[r]):t[r]}return i}}const re=t=>"number"==typeof t?0:t;const oe={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Wt))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(te))||void 0===n?void 0:n.length)||0)>0},parse:se,createTransformer:ie,getAnimatableNone:function(t){const e=se(t);return ie(t)(e.map(re))}},ae=new Set(["brightness","contrast","saturate","opacity"]);function le(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(Wt)||[];if(!s)return t;const i=n.replace(s,"");let r=ae.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const ue=/\b([a-z-]*)\(.*?\)/gu,he={...oe,getAnimatableNone:t=>{const e=t.match(ue);return e?e.map(le).join(" "):t}},ce={...d,color:Qt,backgroundColor:Qt,outlineColor:Qt,fill:Qt,stroke:Qt,borderColor:Qt,borderTopColor:Qt,borderRightColor:Qt,borderBottomColor:Qt,borderLeftColor:Qt,filter:he,WebkitFilter:he},de=t=>ce[t];function pe(t,e){let n=de(t);return n!==he&&(n=oe),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const me=new Set(["auto","none","0"]);const fe=t=>180*t/Math.PI,ve=t=>{const e=fe(Math.atan2(t[1],t[0]));return ge(e)},ye={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ve,rotateZ:ve,skewX:t=>fe(Math.atan(t[1])),skewY:t=>fe(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ge=t=>((t%=360)<0&&(t+=360),t),be=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),we=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Te={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:be,scaleY:we,scale:t=>(be(t)+we(t))/2,rotateX:t=>ge(fe(Math.atan2(t[6],t[5]))),rotateY:t=>ge(fe(Math.atan2(-t[2],t[0]))),rotateZ:ve,rotate:ve,skewX:t=>fe(Math.atan(t[4])),skewY:t=>fe(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Se(t){return t.includes("scale")?1:0}function Ae(t,e){if(!t||"none"===t)return Se(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Te,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=ye,i=e}if(!i)return Se(e);const r=s[e],o=i[1].split(",").map(Ve);return"function"==typeof r?r(o):o[r]}function Ve(t){return parseFloat(t.trim())}const Me=t=>t===l||t===p,Pe=new Set(["x","y","z"]),xe=i.filter(t=>!Pe.has(t));const Ce={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:(t,{transform:e})=>Ae(e,"x"),y:(t,{transform:e})=>Ae(e,"y")};Ce.translateX=Ce.x,Ce.translateY=Ce.y;const Ee=new Set;let ke=!1,Fe=!1;function Ie(){if(Fe){const t=Array.from(Ee).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 xe.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.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 s;null===(s=t.getValue(e))||void 0===s||s.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Fe=!1,ke=!1,Ee.forEach(t=>t.complete()),Ee.clear()}function De(){Ee.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Fe=!0)})}class Oe{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ee.add(this),ke||(ke=!0,n.read(De),n.resolveKeyframes(Ie))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let i=0;i<t.length;i++)if(null===t[i])if(0===i){const i=null==s?void 0:s.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ee.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ee.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Re=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Be=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ke(t,e,n=1){const[s,i]=function(t){const e=Be.exec(t);if(!e)return[,];const[,n,s,i]=e;return["--"+(null!=n?n:s),i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return Re(t)?parseFloat(t):t}return m(i)?Ke(i,e,n+1):i}const Ne=t=>e=>e.test(t),Le=[l,p,c,f,v,y,{test:t=>"auto"===t,parse:t=>t}],Ue=t=>Le.find(Ne(t));class je extends Oe{constructor(t,e,n,s,i){super(t,e,n,s,i,!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 s=t[n];if("string"==typeof s&&(s=s.trim(),m(s))){const i=Ke(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Ct.has(n)||2!==t.length)return;const[s,i]=t,r=Ue(s),o=Ue(i);if(r!==o)if(Me(r)&&Me(o))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(s=t[e])?0===s:null===s||"none"===s||"0"===s||Yt(s))&&n.push(e);var s;n.length&&function(t,e,n){let s=0,i=void 0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!me.has(e)&&ne(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=pe(n,i)}(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=Ce[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=Ce[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const qe=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!oe.test(t)&&"0"!==t||t.startsWith("url(")));function Ye(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=qe(i,e),a=qe(r,e);return!(!o||!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||tt(n))&&s)}const ze=t=>null!==t;function We(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ze),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}class Xe{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=dt.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(De(),Ie()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=dt.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:i,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!Ye(t,n,s,i)){if(!r)return a&&a(We(t,this.options,e)),o&&o(),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.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const $e=(t,e,n)=>t+(e-t)*n;function Ge(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 He(t,e){return n=>n>0?e:t}const _e=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Ze=[Zt,_t,Jt];function Je(t){const e=(n=t,Ze.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Jt&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Ge(a,s,t+1/3),r=Ge(a,s,t),o=Ge(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const Qe=(t,e)=>{const n=Je(t),s=Je(e);if(!n||!s)return He(t,e);const i={...n};return t=>(i.red=_e(n.red,s.red,t),i.green=_e(n.green,s.green,t),i.blue=_e(n.blue,s.blue,t),i.alpha=$e(n.alpha,s.alpha,t),_t.transform(i))},tn=(t,e)=>n=>e(t(n)),en=(...t)=>t.reduce(tn),nn=new Set(["none","hidden"]);function sn(t,e){return n=>$e(t,e,n)}function rn(t){return"number"==typeof t?sn:"string"==typeof t?m(t)?He:Qt.test(t)?Qe:ln:Array.isArray(t)?on:"object"==typeof t?Qt.test(t)?Qe:an:He}function on(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>rn(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function an(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=rn(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const ln=(t,e)=>{const n=oe.createTransformer(e),s=ne(t),i=ne(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?nn.has(t)&&!i.values.length||nn.has(e)&&!s.values.length?function(t,e){return nn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):en(on(function(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[r]=l,i[o]++}return s}(s,i),i.values),n):He(t,e)};function un(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return $e(t,e,n);return rn(t)(t,e)}function hn(t,e,n){const s=Math.max(e-5,0);return H(n-t(s),e-s)}const cn=100,dn=10,pn=1,mn=0,fn=800,vn=.3,yn=.3,gn={granular:.01,default:2},bn={granular:.005,default:.5},wn=.01,Tn=10,Sn=.05,An=1;function Vn({duration:t=fn,bounce:e=vn,velocity:n=mn,mass:s=pn}){let i,r,o=1-e;o=h(Sn,An,o),t=h(wn,Tn,G(t)),o<1?(i=e=>{const s=e*o,i=s*t;return.001-(s-n)/Mn(e,o)*Math.exp(-i)},r=e=>{const s=e*o*t,r=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=Mn(Math.pow(e,2),o);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(i,r,5/t);if(t=$(t),isNaN(a))return{stiffness:cn,damping:dn,duration:t};{const e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}function Mn(t,e){return t*Math.sqrt(1-e*e)}const Pn=["duration","bounce"],xn=["stiffness","damping","mass"];function Cn(t,e){return e.some(e=>void 0!==t[e])}function En(t=yn,e=vn){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:u,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:mn,stiffness:cn,damping:dn,mass:pn,isResolvedFromDuration:!1,...t};if(!Cn(t,xn)&&Cn(t,Pn))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,r=2*h(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:pn,stiffness:i,damping:r}}else{const n=Vn(t);e={...e,...n,mass:pn},e.isResolvedFromDuration=!0}return e}({...n,velocity:-G(n.velocity||0)}),f=p||0,v=u/(2*Math.sqrt(l*c)),y=o-r,g=G(Math.sqrt(l/c)),b=Math.abs(y)<5;let w;if(s||(s=b?gn.granular:gn.default),i||(i=b?bn.granular:bn.default),v<1){const t=Mn(g,v);w=e=>{const n=Math.exp(-v*g*e);return o-n*((f+v*g*y)/t*Math.sin(t*e)+y*Math.cos(t*e))}}else if(1===v)w=t=>o-Math.exp(-g*t)*(y+(f+g*y)*t);else{const t=g*Math.sqrt(v*v-1);w=e=>{const n=Math.exp(-v*g*e),s=Math.min(t*e,300);return o-n*((f+v*g*y)*Math.sinh(s)+t*y*Math.cosh(s))/t}}const T={calculatedDuration:m&&d||null,next:t=>{const e=w(t);if(m)a.done=t>=d;else{let n=0;v<1&&(n=0===t?$(f):hn(w,t,e));const r=Math.abs(n)<=s,l=Math.abs(o-e)<=i;a.done=r&&l}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(Q(T),2e4),e=ot(e=>T.next(t*e).value,t,30);return t+"ms "+e}};return T}function kn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},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=c+m,v=void 0===o?f:o(f);v!==f&&(m=v-c);const y=t=>-m*Math.exp(-t/s),g=t=>v+y(t),b=t=>{const e=y(t),n=g(t);d.done=Math.abs(e)<=u,d.value=d.done?v:n};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,T=En({keyframes:[d.value,p(d.value)],velocity:hn(g,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:h}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,b(t),S(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&b(t),d)}}}const Fn=Dt(.42,0,1,1),In=Dt(0,0,.58,1),Dn=Dt(.42,0,.58,1),On={linear:t,easeIn:Fn,easeInOut:Dn,easeOut:In,circIn:Ut,circInOut:qt,circOut:jt,backIn:Kt,backInOut:Nt,backOut:Bt,anticipate:Lt},Rn=t=>{if(nt(t)){q(4===t.length);const[e,n,s,i]=t;return Dt(e,n,s,i)}return"string"==typeof t?On[t]:t};function Bn(e,n,{clamp:s=!0,ease:i,mixer:r}={}){const o=e.length;if(q(o===n.length),1===o)return()=>n[0];if(2===o&&n[0]===n[1])return()=>n[1];const a=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),n=[...n].reverse());const l=function(e,n,s){const i=[],r=s||un,o=e.length-1;for(let s=0;s<o;s++){let o=r(e[s],e[s+1]);if(n){const e=Array.isArray(n)?n[s]||t:n;o=en(e,o)}i.push(o)}return i}(n,i,r),u=l.length,c=t=>{if(a&&t<e[0])return n[0];let s=0;if(u>1)for(;s<e.length-2&&!(t<e[s+1]);s++);const i=W(e[s],e[s+1],t);return l[s](i)};return s?t=>c(h(e[0],e[o-1],t)):c}function Kn(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=W(0,e,s);t.push($e(n,1,i))}}(e,t.length-1),e}function Nn({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(s)?s.map(Rn):Rn(s),r={done:!1,value:e[0]},o=Bn(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Kn(e),t),e,{ease:Array.isArray(i)?i:(a=e,l=i,a.map(()=>l||Dn).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const Ln=t=>{const s=({timestamp:e})=>t(e);return{start:()=>n.update(s,!0),stop:()=>g(s),now:()=>e.isProcessing?e.timestamp:dt.now()}},Un={decay:kn,inertia:kn,tween:Nn,keyframes:Nn,spring:En},jn=t=>t/100;class qn extends Xe{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:s,keyframes:i}=this.options,r=(null==s?void 0:s.KeyframeResolver)||Oe;this.resolver=new r(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),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:s=0,repeatType:i,velocity:r=0}=this.options,o=tt(e)?e:Un[e]||Nn;let a,l;o!==Nn&&"number"!=typeof t[0]&&(a=en(jn,un(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===i&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=Q(u));const{calculatedDuration:h}=u,c=h+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:c,totalDuration:c*(n+1)-s}}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:s,generator:i,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return i.next(0);const{delay:d,repeat:p,repeatType:m,repeatDelay:f,onUpdate:v}=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 y=this.currentTime-d*(this.speed>=0?1:-1),g=this.speed>=0?y<0:y>u;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let b=this.currentTime,w=i;if(p){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,p+1);Boolean(e%2)&&("reverse"===m?(n=1-n,f&&(n-=f/c)):"mirror"===m&&(w=r)),b=h(0,1,n)*c}const T=g?{done:!1,value:a[0]}:w.next(b);o&&(T.value=o(T.value));let{done:S}=T;g||null===l||(S=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const A=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return A&&void 0!==s&&(T.value=We(a,this.options,s)),v&&v(T.value),A&&this.finish(),T}get duration(){const{resolved:t}=this;return t?G(t.calculatedDuration):0}get time(){return G(this.currentTime)}set time(t){t=$(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=G(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Ln,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):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)}}const Yn=new Set(["opacity","clipPath","filter","transform"]);function zn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const h=function t(e,n){return e?"function"==typeof e&&rt()?ot(e,n):nt(e)?lt(e):Array.isArray(e)?e.map(e=>t(e,n)||ut.easeOut):ut[e]:void 0}(a,i);Array.isArray(h)&&(u.easing=h);return t.animate(u,{delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}const Wn=z(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const Xn={anticipate:Lt,backInOut:Nt,circInOut:qt};class $n extends Xe{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:i}=this.options;this.resolver=new je(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:s,ease:i,type:r,motionValue:o,name:a,startTime:l}=this.options;if(!o.owner||!o.owner.current)return!1;var u;if("string"==typeof i&&rt()&&i in Xn&&(i=Xn[i]),tt((u=this.options).type)||"spring"===u.type||!at(u.ease)){const{onComplete:e,onUpdate:o,motionValue:a,element:l,...u}=this.options,h=function(t,e){const n=new qn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<2e4;)s=n.sample(r),i.push(s.value),r+=10;return{times:void 0,keyframes:i,duration:r-10,ease:"linear"}}(t,u);1===(t=h.keyframes).length&&(t[1]=t[0]),n=h.duration,s=h.times,i=h.ease,r="keyframes"}const h=zn(o.owner.current,a,t,{...this.options,duration:n,times:s,ease:i});return h.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(et(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;o.set(We(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:n,times:s,type:r,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return G(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return G(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=$(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(e){if(this._resolved){const{resolved:n}=this;if(!n)return t;const{animation:s}=n;et(s,e)}else this.pendingTimeline=e;return t}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:s,type:i,ease:r,times:o}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,h=new qn({...u,keyframes:n,duration:s,type:i,ease:r,times:o,isGenerator:!0}),c=$(this.time);t.setWithVelocity(h.sample(c-10).value,h.sample(c).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:s,repeatType:i,damping:r,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return Wn()&&n&&Yn.has(n)&&!a&&!l&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}}const Gn={type:"spring",stiffness:500,damping:25,restSpeed:10},Hn={type:"keyframes",duration:.8},_n={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Zn=(t,{keyframes:e})=>e.length>2?Hn:b.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Gn:_n;const Jn=(t,e,s,i={},r,o)=>a=>{const l=J(i,t)||{},u=l.delay||i.delay||0;let{elapsed:h=0}=i;h-=$(u);let c={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-h,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:o?void 0:r};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(l)||(c={...c,...Zn(t,c)}),c.duration&&(c.duration=$(c.duration)),c.repeatDelay&&(c.repeatDelay=$(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(d=!0)),c.allowFlatten=!l.type&&!l.ease,d&&!o&&void 0!==e.get()){const t=We(c.keyframes,l);if(void 0!==t)return n.update(()=>{c.onUpdate(t),c.onComplete()}),new Z([])}return!o&&$n.supports(c)?new $n(c):new qn(c)};function Qn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function ts(t,e,{delay:s=0,transitionOverride:i,type:o}={}){var a;let{transition:l=t.getDefaultTransition(),transitionEnd:u,...h}=e;i&&(l=i);const c=[],d=o&&t.animationState&&t.animationState.getState()[o];for(const e in h){const i=t.getValue(e,null!==(a=t.latestValues[e])&&void 0!==a?a:null),r=h[e];if(void 0===r||d&&Qn(d,e))continue;const o={delay:s,...J(l||{},e)};let u=!1;if(window.MotionHandoffAnimation){const s=Ft(t);if(s){const t=window.MotionHandoffAnimation(s,e,n);null!==t&&(o.startTime=t,u=!0)}}kt(t,e),i.start(Jn(e,i,r,t.shouldReduceMotion&&Ct.has(e)?{type:!1}:o,t,u));const p=i.animation;p&&c.push(p)}return u&&Promise.all(c).then(()=>{n.update(()=>{u&&function(t,e){const n=xt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const e in o){Et(t,e,r(o[e]))}}(t,u)})}),c}function es(t,e,n={}){var s;const i=xt(t,e,"exit"===n.type?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(ts(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:i=0,staggerChildren:o,staggerDirection:a}=r;return function(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,l=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(ns).forEach((t,s)=>{t.notify("AnimationStart",e),o.push(es(t,e,{...r,delay:n+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(o)}(t,e,i+s,o,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[o,a]:[a,o];return t().then(()=>e())}return Promise.all([o(),a(n.delay)])}function ns(t,e){return t.sortNodePosition(e)}function ss(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const is=T.length;const rs=[...V].reverse(),os=V.length;function as(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>es(t,e,n));s=Promise.all(i)}else if("string"==typeof e)s=es(t,e,n);else{const i="function"==typeof e?xt(t,e,n.custom):e;s=Promise.all(ts(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function ls(t){let e=as(t),n=cs(),s=!0;const i=e=>(n,s)=>{var i;const r=xt(t,s,"exit"===e?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);if(r){const{transition:t,transitionEnd:e,...s}=r;n={...n,...s,...e}}return n};function r(r){const{props:o}=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<is;t++){const s=T[t],i=e.props[s];(w(i)||!1===i)&&(n[s]=i)}return n}(t.parent)||{},l=[],u=new Set;let h={},c=1/0;for(let e=0;e<os;e++){const d=rs[e],p=n[d],m=void 0!==o[d]?o[d]:a[d],f=w(m),v=d===r?p.isActive:null;!1===v&&(c=e);let y=m===a[d]&&m!==o[d]&&f;if(y&&s&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...h},!p.isActive&&null===v||!m&&!p.prevProp||S(m)||"boolean"==typeof m)continue;const g=us(p.prevProp,m);let b=g||d===r&&p.isActive&&!y&&f||e>c&&f,T=!1;const V=Array.isArray(m)?m:[m];let M=V.reduce(i(d),{});!1===v&&(M={});const{prevResolvedValues:P={}}=p,x={...P,...M},C=e=>{b=!0,u.has(e)&&(T=!0,u.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in x){const e=M[t],n=P[t];if(h.hasOwnProperty(t))continue;let s=!1;s=A(e)&&A(n)?!ss(e,n):e!==n,s?null!=e?C(t):u.add(t):void 0!==e&&u.has(t)?C(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=M,p.isActive&&(h={...h,...M}),s&&t.blockInitialAnimation&&(b=!1);const E=!(y&&g)||T;b&&E&&l.push(...V.map(t=>({animation:t,options:{type:d}})))}if(u.size){const e={};if("boolean"!=typeof o.initial){const n=xt(t,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const s=t.getBaseTarget(n),i=t.getValue(n);i&&(i.liveStyle=!0),e[n]=null!=s?s:null}),l.push({animation:e})}let d=Boolean(l.length);return!s||!1!==o.initial&&o.initial!==o.animate||t.manuallyAnimateOnMount||(d=!1),s=!1,d?e(l):Promise.resolve()}return{animateChanges:r,setActive:function(e,s){var i;if(n[e].isActive===s)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,s)}),n[e].isActive=s;const o=r(e);for(const t in n)n[t].protectedKeys={};return o},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=cs(),s=!0}}}function us(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!ss(e,t)}function hs(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function cs(){return{animate:hs(!0),whileInView:hs(),whileHover:hs(),whileTap:hs(),whileDrag:hs(),whileFocus:hs(),exit:hs()}}class ds{constructor(t){this.isMounted=!1,this.node=t}update(){}}let ps=0;const ms={animation:{Feature:class extends ds{constructor(t){super(t),t.animationState||(t.animationState=ls(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();S(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 ds{constructor(){super(...arguments),this.id=ps++}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 s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function fs(t){return{point:{x:t.pageX,y:t.pageY}}}function vs(t,e,s){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===s);const r=i["onHover"+s];r&&n.postRender(()=>r(e,fs(e)))}function ys(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function gs(t,e,s){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===s);const r=i["onTap"+("End"===s?"":s)];r&&n.postRender(()=>r(e,fs(e)))}const bs=new WeakMap,ws=new WeakMap,Ts=t=>{const e=bs.get(t.target);e&&e(t)},Ss=t=>{t.forEach(Ts)};function As(t,e,n){const s=function({root:t,...e}){const n=t||document;ws.has(n)||ws.set(n,{});const s=ws.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Ss,{root:t,...e})),s[i]}(e);return bs.set(t,n),s.observe(t),()=>{bs.delete(t),s.unobserve(t)}}const Vs={some:0,all:1};const Ms={inView:{Feature:class extends ds{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Vs[s]};return As(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),r=e?n:s;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ds{mount(){const{current:t}=this.node;t&&(this.unmount=Vt(t,(t,e)=>(gs(this.node,e,"Start"),(t,{success:e})=>gs(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends ds{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=en(ys(this.node.current,"focus",()=>this.onFocus()),ys(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ds{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[s,i,r]=ft(t,n),o=t=>{if(!vt(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{vt(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach(t=>{t.addEventListener("pointerenter",o,i)}),r}(t,(t,e)=>(vs(this.node,e,"Start"),t=>vs(this.node,t,"End"))))}unmount(){}}}};const Ps=()=>({x:{min:0,max:0},y:{min:0,max:0}}),xs={current:null},Cs={current:!1};const Es=[...Le,Qt,oe],ks=new WeakMap;const Fs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Is extends class{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Oe,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=dt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,n.render(this.render,!1,!0))};const{latestValues:u,renderState:h,onUpdate:c}=a;this.onUpdate=c,this.latestValues=u,this.baseTarget={...u},this.initialValues=e.initial?{...u}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=l,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=P(e),this.isVariantNode=x(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:d,...p}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in p){const e=p[t];void 0!==u[t]&&o(e)&&e.set(u[t],!1)}}mount(t){this.current=t,ks.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Cs.current||function(){if(Cs.current=!0,M)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>xs.current=t.matches;t.addListener(e),e()}else xs.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||xs.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),g(this.notifyUpdate),g(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=b.has(t);s&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&n.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),r(),o&&o(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in C){const e=C[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Fs.length;e++){const n=Fs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(o(i))t.addValue(s,i);else if(o(r))t.addValue(s,Pt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,Pt(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Pt(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=s&&("string"==typeof s&&(Re(s)||Yt(s))?s=parseFloat(s):(i=s,!Es.find(Ne(i))&&oe.test(e)&&(s=pe(t,e))),this.setBaseTarget(t,o(s)?s.get():s)),o(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let i;if("string"==typeof n||"object"==typeof n){const r=s(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);r&&(i=r[t])}if(n&&void 0!==i)return i;const r=this.getBaseTargetFromProps(this.props,t);return void 0===r||o(r)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:r}on(t,e){return this.events[t]||(this.events[t]=new X),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=je}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;o(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}class Ds extends Is{constructor(){super(...arguments),this.type="html",this.renderInstance=E}readValueFromInstance(t,e){if(b.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ae(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(k(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){F(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return I(t,e,n)}}class Os extends Is{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ps,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&D(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(b.has(e)){const t=de(e);return t&&t.default||0}return e=O.has(e)?e:R(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return B(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&n.postRender(this.updateDimensions)}build(t,e,n){K(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){N(t,e,n,s)}mount(t){this.isSVGTag=L(t.tagName),super.mount(t)}}const Rs={renderer:(t,e)=>U(t)?new Os(e):new Ds(e,{allowProjection:t!==j}),...ms,...Ms};export{Rs as domAnimation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as t}from"react";const e=t=>t,s=t({});function r(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function n(t){return"string"==typeof t||Array.isArray(t)}const a=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],o=["initial",...a];function i(t){return r(t.animate)||o.some(e=>n(t[e]))}function c(t){return Boolean(i(t)||t.variants)}const l="undefined"!=typeof window,f={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},d={};for(const t in f)d[t]={isEnabled:e=>f[t].some(t=>!!e[t])};function u(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const p=
|
|
1
|
+
import{createContext as t}from"react";const e=t=>t,s=t({});function r(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function n(t){return"string"==typeof t||Array.isArray(t)}const a=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],o=["initial",...a];function i(t){return r(t.animate)||o.some(e=>n(t[e]))}function c(t){return Boolean(i(t)||t.variants)}const l="undefined"!=typeof window,f={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},d={};for(const t in f)d[t]={isEnabled:e=>f[t].some(t=>!!e[t])};function u(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const p=["read","resolveKeyframes","update","preRender","render","postRender"],m={value:null,addProjectionMetrics:null};function g(t,e){let s=!1,r=!0;const n={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=p.reduce((t,s)=>(t[s]=function(t,e){let s=new Set,r=new Set,n=!1,a=!1;const o=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1},c=0;function l(e){o.has(e)&&(f.schedule(e),t()),c++,e(i)}const f={schedule:(t,e=!1,a=!1)=>{const i=a&&n?s:r;return e&&o.add(t),i.has(t)||i.add(t),t},cancel:t=>{r.delete(t),o.delete(t)},process:t=>{i=t,n?a=!0:(n=!0,[s,r]=[r,s],s.forEach(l),e&&m.value&&m.value.frameloop[e].push(c),c=0,s.clear(),n=!1,a&&(a=!1,f.process(t)))}};return f}(a,e?s:void 0),t),{}),{read:i,resolveKeyframes:c,update:l,preRender:f,render:d,postRender:u}=o,g=()=>{const a=performance.now();s=!1,n.delta=r?1e3/60:Math.max(Math.min(a-n.timestamp,40),1),n.timestamp=a,n.isProcessing=!0,i.process(n),c.process(n),l.process(n),f.process(n),d.process(n),u.process(n),n.isProcessing=!1,s&&e&&(r=!1,t(g))};return{schedule:p.reduce((e,a)=>{const i=o[a];return e[a]=(e,a=!1,o=!1)=>(s||(s=!0,r=!0,n.isProcessing||t(g)),i.schedule(e,a,o)),e},{}),cancel:t=>{for(let e=0;e<p.length;e++)o[p[e]].cancel(t)},state:n,steps:o}}const{schedule:h,cancel:y,state:v,steps:w}=g("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e,!0),{schedule:x,cancel:b}=g(queueMicrotask,!1),k=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),P="data-"+k("framerAppearId"),S=t(null),B=t({}),R=t=>e=>"string"==typeof e&&e.startsWith(t),X=R("--"),Y=R("var(--"),O=t=>!!Y(t)&&A.test(t.split("/*")[0].trim()),A=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,L={};function T(t){for(const e in t)L[e]=t[e],X(e)&&(L[e].isCSSVariable=!0)}const V=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],W=new Set(V);function $(t,{layout:e,layoutId:s}){return W.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!L[t]||"opacity"===t)}const C=t=>Boolean(t&&t.getVelocity),F=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Z=(t,e,s)=>s>e?e:s<t?t:s,j={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},E={...j,transform:t=>Z(0,1,t)},H={...j,default:1},I=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),z=I("deg"),M=I("%"),D=I("px"),q=I("vh"),K=I("vw"),U={...M,parse:t=>M.parse(t)/100,transform:t=>M.transform(100*t)},G={borderWidth:D,borderTopWidth:D,borderRightWidth:D,borderBottomWidth:D,borderLeftWidth:D,borderRadius:D,radius:D,borderTopLeftRadius:D,borderTopRightRadius:D,borderBottomRightRadius:D,borderBottomLeftRadius:D,width:D,maxWidth:D,height:D,maxHeight:D,top:D,right:D,bottom:D,left:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,backgroundPositionX:D,backgroundPositionY:D},J={rotate:z,rotateX:z,rotateY:z,rotateZ:z,scale:H,scaleX:H,scaleY:H,scaleZ:H,skew:z,skewX:z,skewY:z,distance:D,translateX:D,translateY:D,translateZ:D,x:D,y:D,z:D,perspective:D,transformPerspective:D,opacity:E,originX:U,originY:U,originZ:D},N={...j,transform:Math.round},Q={...G,...J,zIndex:N,size:D,fillOpacity:E,strokeOpacity:E,numOctaves:N},_={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tt=V.length;function et(t,e,s){const{style:r,vars:n,transformOrigin:a}=t;let o=!1,i=!1;for(const t in e){const s=e[t];if(W.has(t))o=!0;else if(X(t))n[t]=s;else{const e=F(s,Q[t]);t.startsWith("origin")?(i=!0,a[t]=e):r[t]=e}}if(e.transform||(o||s?r.transform=function(t,e,s){let r="",n=!0;for(let a=0;a<tt;a++){const o=V[a],i=t[o];if(void 0===i)continue;let c=!0;if(c="number"==typeof i?i===(o.startsWith("scale")?1:0):0===parseFloat(i),!c||s){const t=F(i,Q[o]);if(!c){n=!1;r+=`${_[o]||o}(${t}) `}s&&(e[o]=t)}}return r=r.trim(),s?r=s(e,n?"":r):n&&(r="none"),r}(e,t.transform,s):r.transform&&(r.transform="none")),i){const{originX:t="50%",originY:e="50%",originZ:s=0}=a;r.transformOrigin=`${t} ${e} ${s}`}}const st=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function rt(t){return"string"==typeof t&&!t.includes("-")&&!!(st.indexOf(t)>-1||/[A-Z]/u.test(t))}const nt={offset:"stroke-dashoffset",array:"stroke-dasharray"},at={offset:"strokeDashoffset",array:"strokeDasharray"};function ot(t,e,s){return"string"==typeof t?t:D.transform(e+s*t)}function it(t,{attrX:e,attrY:s,attrScale:r,originX:n,originY:a,pathLength:o,pathSpacing:i=1,pathOffset:c=0,...l},f,d){if(et(t,l,d),f)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:u,style:p,dimensions:m}=t;u.transform&&(m&&(p.transform=u.transform),delete u.transform),m&&(void 0!==n||void 0!==a||p.transform)&&(p.transformOrigin=function(t,e,s){return`${ot(e,t.x,t.width)} ${ot(s,t.y,t.height)}`}(m,void 0!==n?n:.5,void 0!==a?a:.5)),void 0!==e&&(u.x=e),void 0!==s&&(u.y=s),void 0!==r&&(u.scale=r),void 0!==o&&function(t,e,s=1,r=0,n=!0){t.pathLength=1;const a=n?nt:at;t[a.offset]=D.transform(-r);const o=D.transform(e),i=D.transform(s);t[a.array]=`${o} ${i}`}(u,o,i,c,!1)}const ct=t=>"string"==typeof t&&"svg"===t.toLowerCase();function lt(t){const e=[{},{}];return null==t||t.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function ft(t,e,s,r){if("function"==typeof e){const[n,a]=lt(r);e=e(void 0!==s?s:t.custom,n,a)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[n,a]=lt(r);e=e(void 0!==s?s:t.custom,n,a)}return e}const dt=t=>Array.isArray(t),ut=t=>dt(t)?t[t.length-1]||0:t;function pt(t){const e=C(t)?t.get():t;return s=e,Boolean(s&&"object"==typeof s&&s.mix&&s.toValue)?e.toValue():e;var s}function mt(t,e,s){var r;const{style:n}=t,a={};for(const o in n)(C(n[o])||e.style&&C(e.style[o])||$(o,t)||void 0!==(null===(r=null==s?void 0:s.getValue(o))||void 0===r?void 0:r.liveStyle))&&(a[o]=n[o]);return a}function gt(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}function ht(t,{style:e,vars:s},r,n){Object.assign(t.style,e,n&&n.getProjectionStyles(r));for(const e in s)t.style.setProperty(e,s[e])}const yt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function vt(t,e,s,r){ht(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(yt.has(s)?s:k(s),e.attrs[s])}function wt(t,e,s){const r=mt(t,e,s);for(const s in t)if(C(t[s])||C(e[s])){r[-1!==V.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return r}export{j as A,E as B,Z as C,M as D,Q as E,D as F,O as G,z as H,K as I,q as J,y as K,s as L,w as M,L as N,ht as O,S as P,X as Q,T as R,B as S,ut as T,o as U,dt as V,a as W,yt as X,k as Y,n as a,u as b,l as c,C as d,$ as e,d as f,et as g,it as h,i,ct as j,rt as k,c as l,x as m,r as n,P as o,ft as p,wt as q,pt as r,mt as s,W as t,h as u,gt as v,vt as w,e as x,v as y,V as z};
|