diff --git a/src/zen/tests/.prettierignore b/src/zen/tests/.prettierignore deleted file mode 100644 index 245773fb9..000000000 --- a/src/zen/tests/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -run.sh diff --git a/src/zen/tests/urlbar/browser.toml b/src/zen/tests/urlbar/browser.toml index 5038b3e4b..f7eb5d0e8 100644 --- a/src/zen/tests/urlbar/browser.toml +++ b/src/zen/tests/urlbar/browser.toml @@ -5,3 +5,4 @@ support-files = [ ] ["browser_floating_urlbar.js"] +["browser_issue_7385.js"] diff --git a/src/zen/tests/urlbar/browser_issue_7385.js b/src/zen/tests/urlbar/browser_issue_7385.js new file mode 100644 index 000000000..3296cb360 --- /dev/null +++ b/src/zen/tests/urlbar/browser_issue_7385.js @@ -0,0 +1,31 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +ChromeUtils.defineESModuleGetters(this, { + UrlbarTestUtils: 'resource://testing-common/UrlbarTestUtils.sys.mjs', +}); + +add_task(async function test_Selection_Remains_Double_Toolbar() { + await goToMultipleLayouts(async () => { + const untrimmedValue = 'http://example.com'; + let trimmedValue = UrlbarTestUtils.trimURL(untrimmedValue); + gURLBar._setValue(untrimmedValue, { + allowTrim: true, + valueIsTyped: false, + }); + gURLBar.blur(); + await SimpleTest.promiseFocus(window); + Assert.equal(gURLBar.value, trimmedValue, 'Value has been trimmed'); + await selectWithMouseDrag(100, 200); + + Assert.greater(gURLBar.selectionStart, 0, 'Selection start is positive.'); + Assert.greater(gURLBar.selectionEnd, gURLBar.selectionStart, 'Selection is not empty.'); + + Assert.equal(gURLBar.value, untrimmedValue, `Value should be untrimmed`); + + gURLBar.handleRevert(); + gURLBar.view.close(); + }); +}); diff --git a/src/zen/tests/urlbar/head.js b/src/zen/tests/urlbar/head.js index d0e0460c8..2f65e22f9 100644 --- a/src/zen/tests/urlbar/head.js +++ b/src/zen/tests/urlbar/head.js @@ -9,3 +9,29 @@ function simulateClick(win = window) { EventUtils.synthesizeMouseAtCenter(target, {}); return promise; } + +function selectWithMouseDrag(fromX, toX, win = window) { + let target = win.gURLBar.inputField; + let rect = target.getBoundingClientRect(); + let promise = BrowserTestUtils.waitForEvent(target, 'mouseup'); + EventUtils.synthesizeMouse(target, fromX, rect.height / 2, { type: 'mousemove' }, target.ownerGlobal); + EventUtils.synthesizeMouse(target, fromX, rect.height / 2, { type: 'mousedown' }, target.ownerGlobal); + EventUtils.synthesizeMouse(target, toX, rect.height / 2, { type: 'mousemove' }, target.ownerGlobal); + EventUtils.synthesizeMouse(target, toX, rect.height / 2, { type: 'mouseup' }, target.ownerGlobal); + return promise; +} + +function goToMultipleLayouts(callback) { + return new Promise(async (resolve) => { + await SpecialPowers.pushPrefEnv({ + set: [['zen.view.use-single-toolbar', false]], + }); + setTimeout(async () => { + await callback(); + await SpecialPowers.popPrefEnv(); + setTimeout(() => { + resolve(); + }, 1000); // Wait for new layout + }, 1000); // Wait for new layout + }); +} diff --git a/src/zen/vendor/motion.min.mjs b/src/zen/vendor/motion.min.mjs index ec84ad10a..2f9747ec8 100644 --- a/src/zen/vendor/motion.min.mjs +++ b/src/zen/vendor/motion.min.mjs @@ -4,5 +4,4 @@ * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ -const t=["read","resolveKeyframes","update","preRender","render","postRender"],e={value:null,addProjectionMetrics:null};const n={skipAnimations:!1,useManualTiming:!1};function s(n,s){let r=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,l=t.reduce(((t,n)=>(t[n]=function(t,n){let s=new Set,r=new Set,i=!1,o=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},u=0;function c(e){a.has(e)&&(h.schedule(e),t()),u++,e(l)}const h={schedule:(t,e=!1,n=!1)=>{const o=n&&i?s:r;return e&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{r.delete(t),a.delete(t)},process:t=>{l=t,i?o=!0:(i=!0,[s,r]=[r,s],s.forEach(c),n&&e.value&&e.value.frameloop[n].push(u),u=0,s.clear(),i=!1,o&&(o=!1,h.process(t)))}};return h}(a,s?n:void 0),t)),{}),{read:u,resolveKeyframes:c,update:h,preRender:d,render:p,postRender:f}=l,m=()=>{const t=performance.now();r=!1,o.delta=i?1e3/60:Math.max(Math.min(t-o.timestamp,40),1),o.timestamp=t,o.isProcessing=!0,u.process(o),c.process(o),h.process(o),d.process(o),p.process(o),f.process(o),o.isProcessing=!1,r&&s&&(i=!1,n(m))};return{schedule:t.reduce(((t,e)=>{const s=l[e];return t[e]=(t,e=!1,a=!1)=>(r||(r=!0,i=!0,o.isProcessing||n(m)),s.schedule(t,e,a)),t}),{}),cancel:e=>{for(let n=0;nt,{schedule:i,cancel:o,state:a,steps:l}=s("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:r,!0);let u;function c(){u=void 0}const h={now:()=>(void 0===u&&h.set(a.isProcessing||n.useManualTiming?a.timestamp:performance.now()),u),set:t=>{u=t,queueMicrotask(c)}};function d(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class p{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>d(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 r=0;r{const n=h.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=h.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 p);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=h.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return f(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 g(t,e){return new m(t,e)}const y=i,v=t.reduce(((t,e)=>(t[e]=t=>o(t),t)),{}),w=!1;function b(){return w}function T(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const r=n?.[t]??s.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function x(t,e){const n=T(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function S(t){return!("touch"===t.pointerType||b())}function M(t,e,n={}){const[s,r,i]=x(t,n),o=t=>{if(!S(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const i=t=>{S(t)&&(s(t),n.removeEventListener("pointerleave",i))};n.addEventListener("pointerleave",i,r)};return s.forEach((t=>{t.addEventListener("pointerenter",o,r)})),i}const A=(t,e)=>!!e&&(t===e||A(t,e.parentElement)),V=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const k=new WeakSet;function P(t){return e=>{"Enter"===e.key&&t(e)}}function E(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function C(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!b()}function F(t,e,n={}){const[s,r,i]=x(t,n),o=t=>{const s=t.currentTarget;if(!C(t)||k.has(s))return;k.add(s);const i=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),C(t)&&k.has(s)&&(k.delete(s),"function"==typeof i&&i(t,{success:e}))},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||A(s,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,r),window.addEventListener("pointercancel",l,r)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,r),t instanceof HTMLElement&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=P((()=>{if(k.has(n))return;E(n,"down");const t=P((()=>{E(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>E(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,r))),e=t,V.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),i}let R=()=>{};const B=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},L=(t,e,n)=>n>e?e:n1e3*t,Z=t=>t/1e3,_=.001;function J({duration:t=K,bounce:e=$,velocity:n=N,mass:s=D}){let r,i,o=1-e;o=L(H,q,o),t=L(U,X,Z(t)),o<1?(r=e=>{const s=e*o,r=s*t,i=s-n,a=tt(e,o),l=Math.exp(-r);return _-i/a*l},i=e=>{const s=e*o*t,i=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=tt(Math.pow(e,2),o);return(-r(e)+_>0?-1:1)*((i-a)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;n=et?1/0:e}function st(t,e=100,n){const s=n({...t,keyframes:[0,e]}),r=Math.min(nt(s),et);return{type:"keyframes",ease:t=>s.next(r*t).value/e,duration:Z(r)}}const rt={};function it(t){let e;return()=>(void 0===e&&(e=t()),e)}function ot(t,e){const n=it(t);return()=>rt[e]??n()}const at=ot((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),lt=(t,e,n=10)=>{let s="";const r=Math.max(Math.round(e/n),2);for(let e=0;evoid 0!==t[e]))}function dt(t=j,e=$){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:N,stiffness:I,damping:W,mass:D,isResolvedFromDuration:!1,...t};if(!ht(t,ct)&&ht(t,ut))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),r=s*s,i=2*L(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:D,stiffness:r,damping:i}}else{const n=J(t);e={...e,...n,mass:D},e.isResolvedFromDuration=!0}return e}({...n,velocity:-Z(n.velocity||0)}),f=d||0,m=u/(2*Math.sqrt(l*c)),g=o-i,y=Z(Math.sqrt(l/c)),v=Math.abs(g)<5;let w;if(s||(s=v?z.granular:z.default),r||(r=v?Y.granular:Y.default),m<1){const t=tt(y,m);w=e=>{const n=Math.exp(-m*y*e);return o-n*((f+m*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===m)w=t=>o-Math.exp(-y*t)*(g+(f+y*g)*t);else{const t=y*Math.sqrt(m*m-1);w=e=>{const n=Math.exp(-m*y*e),s=Math.min(t*e,300);return o-n*((f+m*y*g)*Math.sinh(s)+t*g*Math.cosh(s))/t}}const b={calculatedDuration:p&&h||null,next:t=>{const e=w(t);if(p)a.done=t>=h;else{let n=0;m<1&&(n=0===t?G(f):O(w,t,e));const i=Math.abs(n)<=s,l=Math.abs(o-e)<=r;a.done=i&&l}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(nt(b),et),e=lt((e=>b.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return b}dt.applyToOptions=t=>{const e=st(t,100,dt);return t.ease=at()?e.ease:"easeOut",t.duration=G(e.duration),t.type="keyframes",t};const pt=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},ft=t=>Array.isArray(t)&&"number"!=typeof t[0];function mt(t,e){return ft(t)?t[pt(0,t.length,e)]:t}const gt=(t,e,n)=>t+(e-t)*n;function yt(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=B(0,e,s);t.push(gt(n,1,r))}}function vt(t){const e=[0];return yt(e,t.length-1),e}const wt=t=>Boolean(t&&t.getVelocity);function bt(t){return"object"==typeof t&&!Array.isArray(t)}function Tt(t,e,n,s){return"string"==typeof t&&bt(e)?T(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function xt(t,e,n){return t*(e+1)}function St(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:s.get(e)??t}function Mt(t,e,n,s,r,i){!function(t,e,n){for(let s=0;se&&r.at"number"==typeof t,Bt=t=>t.every(Rt),Lt=new WeakMap,Ot=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],It=new Set(Ot),Wt=new Set(["width","height","top","left","right","bottom",...Ot]),Dt=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t;function Nt(t){const e=[{},{}];return t?.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function Kt(t,e,n,s){if("function"==typeof e){const[r,i]=Nt(s);e=e(void 0!==n?n:t.custom,r,i)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[r,i]=Nt(s);e=e(void 0!==n?n:t.custom,r,i)}return e}function $t(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,g(n))}function jt(t,e){const n=function(t,e,n){const s=t.getProps();return Kt(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const e in i){$t(t,e,Dt(i[e]))}}function zt(t,e){const s=t.getValue("willChange");if(r=s,Boolean(wt(r)&&r.add))return s.add(e);if(!s&&n.WillChange){const s=new n.WillChange("auto");t.addValue("willChange",s),s.add(e)}var r}const Yt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ut="data-"+Yt("framerAppearId");function Xt(t){return t.props[Ut]}const Ht=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function qt(t,e,n,s){if(t===e&&n===s)return r;const i=e=>function(t,e,n,s,r){let i,o,a=0;do{o=e+(n-e)/2,i=Ht(o,s,r)-t,i>0?n=o:e=o}while(Math.abs(i)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:Ht(i(t),e,s)}const Gt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Zt=t=>e=>1-t(1-e),_t=qt(.33,1.53,.69,.99),Jt=Zt(_t),Qt=Gt(Jt),te=t=>(t*=2)<1?.5*Jt(t):.5*(2-Math.pow(2,-10*(t-1))),ee=t=>1-Math.sin(Math.acos(t)),ne=Zt(ee),se=Gt(ee),re=t=>/^0[^.\s]+$/u.test(t);const ie={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},oe={...ie,transform:t=>L(0,1,t)},ae={...ie,default:1},le=t=>Math.round(1e5*t)/1e5,ue=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ce=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,he=(t,e)=>n=>Boolean("string"==typeof n&&ce.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),de=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[r,i,o,a]=s.match(ue);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},pe={...ie,transform:t=>Math.round((t=>L(0,255,t))(t))},fe={test:he("rgb","red"),parse:de("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+pe.transform(t)+", "+pe.transform(e)+", "+pe.transform(n)+", "+le(oe.transform(s))+")"};const me={test:he("#"),parse:function(t){let e="",n="",s="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}},transform:fe.transform},ge=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ye=ge("deg"),ve=ge("%"),we=ge("px"),be=ge("vh"),Te=ge("vw"),xe={...ve,parse:t=>ve.parse(t)/100,transform:t=>ve.transform(100*t)},Se={test:he("hsl","hue"),parse:de("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ve.transform(le(e))+", "+ve.transform(le(n))+", "+le(oe.transform(s))+")"},Me={test:t=>fe.test(t)||me.test(t)||Se.test(t),parse:t=>fe.test(t)?fe.parse(t):Se.test(t)?Se.parse(t):me.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?fe.transform(t):Se.transform(t)},Ae=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ve="number",ke="color",Pe=/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 Ee(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const o=e.replace(Pe,(t=>(Me.test(t)?(s.color.push(i),r.push(ke),n.push(Me.parse(t))):t.startsWith("var(")?(s.var.push(i),r.push("var"),n.push(t)):(s.number.push(i),r.push(Ve),n.push(parseFloat(t))),++i,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:r}}function Ce(t){return Ee(t).values}function Fe(t){const{split:e,types:n}=Ee(t),s=e.length;return t=>{let r="";for(let i=0;i"number"==typeof t?0:t;const Be={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(ue)?.length||0)+(t.match(Ae)?.length||0)>0},parse:Ce,createTransformer:Fe,getAnimatableNone:function(t){const e=Ce(t);return Fe(t)(e.map(Re))}},Le=new Set(["brightness","contrast","saturate","opacity"]);function Oe(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(ue)||[];if(!s)return t;const r=n.replace(s,"");let i=Le.has(e)?1:0;return s!==n&&(i*=100),e+"("+i+r+")"}const Ie=/\b([a-z-]*)\(.*?\)/gu,We={...Be,getAnimatableNone:t=>{const e=t.match(Ie);return e?e.map(Oe).join(" "):t}},De={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,top:we,right:we,bottom:we,left:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,backgroundPositionX:we,backgroundPositionY:we},Ne={rotate:ye,rotateX:ye,rotateY:ye,rotateZ:ye,scale:ae,scaleX:ae,scaleY:ae,scaleZ:ae,skew:ye,skewX:ye,skewY:ye,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:oe,originX:xe,originY:xe,originZ:we},Ke={...ie,transform:Math.round},$e={...De,...Ne,zIndex:Ke,size:we,fillOpacity:oe,strokeOpacity:oe,numOctaves:Ke},je={...$e,color:Me,backgroundColor:Me,outlineColor:Me,fill:Me,stroke:Me,borderColor:Me,borderTopColor:Me,borderRightColor:Me,borderBottomColor:Me,borderLeftColor:Me,filter:We,WebkitFilter:We},ze=t=>je[t];function Ye(t,e){let n=ze(t);return n!==We&&(n=Be),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ue=new Set(["auto","none","0"]);const Xe=t=>180*t/Math.PI,He=t=>{const e=Xe(Math.atan2(t[1],t[0]));return Ge(e)},qe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:He,rotateZ:He,skewX:t=>Xe(Math.atan(t[1])),skewY:t=>Xe(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ge=t=>((t%=360)<0&&(t+=360),t),Ze=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),_e=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Je={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ze,scaleY:_e,scale:t=>(Ze(t)+_e(t))/2,rotateX:t=>Ge(Xe(Math.atan2(t[6],t[5]))),rotateY:t=>Ge(Xe(Math.atan2(-t[2],t[0]))),rotateZ:He,rotate:He,skewX:t=>Xe(Math.atan(t[4])),skewY:t=>Xe(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Qe(t){return t.includes("scale")?1:0}function tn(t,e){if(!t||"none"===t)return Qe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=Je,r=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=qe,r=e}if(!r)return Qe(e);const i=s[e],o=r[1].split(",").map(en);return"function"==typeof i?i(o):o[i]}function en(t){return parseFloat(t.trim())}const nn=t=>t===ie||t===we,sn=new Set(["x","y","z"]),rn=Ot.filter((t=>!sn.has(t)));const on={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})=>tn(e,"x"),y:(t,{transform:e})=>tn(e,"y")};on.translateX=on.x,on.translateY=on.y;const an=new Set;let ln=!1,un=!1;function cn(){if(un){const t=Array.from(an).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 rn.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])=>{t.getValue(e)?.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}un=!1,ln=!1,an.forEach((t=>t.complete())),an.clear()}function hn(){an.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(un=!0)}))}class dn{constructor(t,e,n,s,r,i=!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=r,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(an.add(this),ln||(ln=!0,i.read(hn),i.resolveKeyframes(cn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let r=0;r/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),fn=t=>e=>"string"==typeof e&&e.startsWith(t),mn=fn("--"),gn=fn("var(--"),yn=t=>!!gn(t)&&vn.test(t.split("/*")[0].trim()),vn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,wn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bn(t,e,n=1){const[s,r]=function(t){const e=wn.exec(t);if(!e)return[,];const[,n,s,r]=e;return[`--${n??s}`,r]}(t);if(!s)return;const i=window.getComputedStyle(e).getPropertyValue(s);if(i){const t=i.trim();return pn(t)?parseFloat(t):t}return yn(r)?bn(r,e,n+1):r}const Tn=t=>e=>e.test(t),xn=[ie,we,ve,ye,Te,be,{test:t=>"auto"===t,parse:t=>t}],Sn=t=>xn.find(Tn(t));class Mn extends dn{constructor(t,e,n,s,r){super(t,e,n,s,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const An=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Be.test(t)&&"0"!==t||t.startsWith("url(")));function Vn(t,e,n,s){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const i=t[t.length-1],o=An(r,e),a=An(i,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;nnull!==t;function Pn(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(kn),i=e&&"loop"!==n&&e%2==1?0:r.length-1;return i&&void 0!==s?s:r[i]}class En{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:i="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=h.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:r,repeatType:i,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(hn(),cn()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=h.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:r,delay:i,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!Vn(t,n,s,r)){if(!i)return a&&a(Pn(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}))}}function Cn(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 Fn(t,e){return n=>n>0?e:t}const Rn=(t,e,n)=>{const s=t*t,r=n*(e*e-s)+s;return r<0?0:Math.sqrt(r)},Bn=[me,fe,Se];function Ln(t){const e=(n=t,Bn.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Se&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let r=0,i=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;r=Cn(a,s,t+1/3),i=Cn(a,s,t),o=Cn(a,s,t-1/3)}else r=i=o=n;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*o),alpha:s}}(s)),s}const On=(t,e)=>{const n=Ln(t),s=Ln(e);if(!n||!s)return Fn(t,e);const r={...n};return t=>(r.red=Rn(n.red,s.red,t),r.green=Rn(n.green,s.green,t),r.blue=Rn(n.blue,s.blue,t),r.alpha=gt(n.alpha,s.alpha,t),fe.transform(r))},In=(t,e)=>n=>e(t(n)),Wn=(...t)=>t.reduce(In),Dn=new Set(["none","hidden"]);function Nn(t,e){return n=>gt(t,e,n)}function Kn(t){return"number"==typeof t?Nn:"string"==typeof t?yn(t)?Fn:Me.test(t)?On:zn:Array.isArray(t)?$n:"object"==typeof t?Me.test(t)?On:jn:Fn}function $n(t,e){const n=[...t],s=n.length,r=t.map(((t,n)=>Kn(t)(t,e[n])));return t=>{for(let e=0;e{for(const e in s)n[e]=s[e](t);return n}}const zn=(t,e)=>{const n=Be.createTransformer(e),s=Ee(t),r=Ee(e);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?Dn.has(t)&&!r.values.length||Dn.has(e)&&!s.values.length?function(t,e){return Dn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Wn($n(function(t,e){const n=[],s={color:0,var:0,number:0};for(let r=0;rvoid 0===a?l:void 0===l||Math.abs(a-t)-f*Math.exp(-t/s),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&el)&&(b=t,T=dt({keyframes:[d.value,p(d.value)],velocity:O(v,t,d.value),damping:r,stiffness:i,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}const Xn=qt(.42,0,1,1),Hn=qt(0,0,.58,1),qn=qt(.42,0,.58,1),Gn=t=>Array.isArray(t)&&"number"==typeof t[0],Zn={linear:r,easeIn:Xn,easeInOut:qn,easeOut:Hn,circIn:ee,circInOut:se,circOut:ne,backIn:Jt,backInOut:Qt,backOut:_t,anticipate:te},_n=t=>{if(Gn(t)){t.length;const[e,n,s,r]=t;return qt(e,n,s,r)}return"string"==typeof t?Zn[t]:t};function Jn(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(e.length,1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=function(t,e,n){const s=[],i=n||Yn,o=t.length-1;for(let n=0;n{if(a&&n1)for(;sc(L(t[0],t[o-1],e)):c}function Qn({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const r=ft(s)?s.map(_n):_n(s),i={done:!1,value:e[0]},o=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:vt(e),t),a=Jn(o,e,{ease:Array.isArray(r)?r:(l=e,u=r,l.map((()=>u||qn)).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(i.value=a(e),i.done=e>=t,i)}}const ts=t=>{const e=({timestamp:e})=>t(e);return{start:()=>i.update(e,!0),stop:()=>o(e),now:()=>a.isProcessing?a.timestamp:h.now()}},es={decay:Un,inertia:Un,tween:Qn,keyframes:Qn,spring:dt},ns=t=>t/100;class ss extends En{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:r}=this.options,i=s?.KeyframeResolver||dn;this.resolver=new i(r,((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:r,velocity:i=0}=this.options,o=kt(e)?e:es[e]||Qn;let a,l;o!==Qn&&"number"!=typeof t[0]&&(a=Wn(ns,Yn(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===r&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-i})),null===u.calculatedDuration&&(u.calculatedDuration=nt(u));const{calculatedDuration:c}=u,h=c+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(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:r,mirroredGenerator:i,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return r.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),y=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let v=this.currentTime,w=r;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=i)),v=L(0,1,n)*c}const b=y?{done:!1,value:a[0]}:w.next(v);o&&(b.value=o(b.value));let{done:T}=b;y||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&void 0!==s&&(b.value=Pn(a,this.options,s)),m&&m(b.value),x&&this.finish(),b}get duration(){const{resolved:t}=this;return t?Z(t.calculatedDuration):0}get time(){return Z(this.currentTime)}set time(t){t=G(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=Z(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=ts,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=n??this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){this._resolved?(this.state="paused",this.holdTime=this.currentTime??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)}get finished(){return this.currentFinishedPromise}}const rs=new Set(["opacity","clipPath","filter","transform"]),is=it((()=>Object.hasOwnProperty.call(Element.prototype,"animate"))),os=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,as={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:os([0,.65,.55,1]),circOut:os([.55,0,1,.45]),backIn:os([.31,.01,.66,-.59]),backOut:os([.33,1.53,.69,.99])};function ls(t,e){return t?"function"==typeof t&&at()?lt(t,e):Gn(t)?os(t):Array.isArray(t)?t.map((t=>ls(t,e)||as.easeOut)):as[t]:void 0}function us(t,e,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=ls(a,r);Array.isArray(h)&&(c.easing=h);return t.animate(c,{delay:s,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:"reverse"===o?"alternate":"normal",pseudoElement:u})}function cs(t,e){t.timeline=e,t.onfinish=null}function hs(t){return Boolean("function"==typeof t&&at()||!t||"string"==typeof t&&(t in as||at())||Gn(t)||Array.isArray(t)&&t.every(hs))}const ds={anticipate:te,backInOut:Qt,circInOut:se};class ps extends En{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:r}=this.options;this.resolver=new Mn(r,((t,e)=>this.onKeyframesResolved(t,e)),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:s,ease:r,type:i,motionValue:o,name:a,startTime:l}=this.options;if(!o.owner||!o.owner.current)return!1;var u;if("string"==typeof r&&at()&&r in ds&&(r=ds[r]),kt((u=this.options).type)||"spring"===u.type||!hs(u.ease)){const{onComplete:e,onUpdate:o,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new ss({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const r=[];let i=0;for(;!s.done&&i<2e4;)s=n.sample(i),r.push(s.value),i+=10;return{times:void 0,keyframes:r,duration:i-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),n=c.duration,s=c.times,r=c.ease,i="keyframes"}const c=us(o.owner.current,a,t,{...this.options,duration:n,times:s,ease:r});return c.startTime=l??this.calcStartTime(),this.pendingTimeline?(cs(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;o.set(Pn(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:s,type:i,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return Z(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return Z(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=G(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return r;const{animation:n}=e;cs(n,t)}else this.pendingTimeline=t;return r}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:r,ease:i,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,c=new ss({...u,keyframes:n,duration:s,type:r,ease:i,times:o,isGenerator:!0}),h=G(this.time);t.setWithVelocity(c.sample(h-10).value,c.sample(h).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return is()&&n&&rs.has(n)&&("transform"!==n||!l)&&!a&&!s&&"mirror"!==r&&0!==i&&"inertia"!==o}}const fs={type:"spring",stiffness:500,damping:25,restSpeed:10},ms={type:"keyframes",duration:.8},gs={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ys=(t,{keyframes:e})=>e.length>2?ms:It.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:fs:gs;function vs(t,e){return t?.[e]??t?.default??t}const ws=it((()=>void 0!==window.ScrollTimeline));class bs{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map((t=>t.finished)))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;nws()&&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;ee[t]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Ts extends bs{then(t,e){return this.finished.finally(t).then((()=>{}))}}const xs=(t,e,n,s={},r,o)=>a=>{const l=vs(s,t)||{},u=l.delay||s.delay||0;let{elapsed:c=0}=s;c-=G(u);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,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:r,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(l)||(h={...h,...ys(t,h)}),h.duration&&(h.duration=G(h.duration)),h.repeatDelay&&(h.repeatDelay=G(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),h.allowFlatten=!l.type&&!l.ease,d&&!o&&void 0!==e.get()){const t=Pn(h.keyframes,l);if(void 0!==t)return i.update((()=>{h.onUpdate(t),h.onComplete()})),new Ts([])}return!o&&ps.supports(h)?new ps(h):new ss(h)};function Ss({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function Ms(t,e,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const u=[],c=r&&t.animationState&&t.animationState.getState()[r];for(const e in l){const s=t.getValue(e,t.latestValues[e]??null),r=l[e];if(void 0===r||c&&Ss(c,e))continue;const a={delay:n,...vs(o||{},e)};let h=!1;if(window.MotionHandoffAnimation){const n=Xt(t);if(n){const t=window.MotionHandoffAnimation(n,e,i);null!==t&&(a.startTime=t,h=!0)}}zt(t,e),s.start(xs(e,s,r,t.shouldReduceMotion&&Wt.has(e)?{type:!1}:a,t,h));const d=s.animation;d&&u.push(d)}return a&&Promise.all(u).then((()=>{i.update((()=>{a&&jt(t,a)}))})),u}const As=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Vs={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"]},ks={};for(const t in Vs)ks[t]={isEnabled:e=>Vs[t].some((t=>!!e[t]))};const Ps="undefined"!=typeof window,Es={current:null},Cs={current:!1};const Fs=[...xn,Me,Be];const Rs=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function Bs(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||Rs.some((e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e])));var e}const Ls=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Os{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=dn,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=h.now();this.renderScheduledAtthis.bindToMotionValue(e,t))),Cs.current||function(){if(Cs.current=!0,Ps)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Es.current=t.matches;t.addListener(e),e()}else Es.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Es.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),o(this.notifyUpdate),o(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=It.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 ks){const e=ks[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;ee.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=g(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(pn(n)||re(n))?n=parseFloat(n):(s=n,!Fs.find(Tn(s))&&Be.test(e)&&(n=Ye(t,e))),this.setBaseTarget(t,wt(n)?n.get():n)),wt(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=Kt(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||wt(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Is extends Os{constructor(){super(...arguments),this.KeyframeResolver=Mn}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;wt(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}const Ws=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Ds={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ns=Ot.length;function Ks(t,e,n){const{style:s,vars:r,transformOrigin:i}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(It.has(t))o=!0;else if(mn(t))r[t]=n;else{const e=Ws(n,$e[t]);t.startsWith("origin")?(a=!0,i[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",r=!0;for(let i=0;i{this.current&&!this.renderState.dimensions&&function(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}}}(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(It.has(e)){const t=ze(e);return t&&t.default||0}return e=Us.has(e)?e:Yt(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Gs(t,e,n);for(const n in t)(wt(t[n])||wt(e[n]))&&(s[-1!==Ot.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&i.postRender(this.updateDimensions)}build(t,e,n){Ys(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Xs(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Us.has(n)?n:Yt(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}class _s extends Is{constructor(){super(...arguments),this.type="html",this.renderInstance=Xs}readValueFromInstance(t,e){if(It.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return tn(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),r=(mn(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof r?r.trim():r}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){Ks(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Gs(t,e,n)}}class Js extends Os{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Qs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new Zs(e):new _s(e);n.mount(t),Lt.set(t,n)}function tr(t){const e=new Js({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Lt.set(t,e)}function er(t,e,n,s){const r=[];if(function(t,e){return wt(t)||"number"==typeof t||"string"==typeof t&&!bt(e)}(t,e))r.push(function(t,e,n){const s=wt(t)?t:g(t);return s.start(xs("",s,e,n)),s.animation}(t,bt(e)&&e.default||e,n&&n.default||n));else{const i=Tt(t,e,s),o=i.length;for(let t=0;t{const l=Ct(t),{delay:u=0,times:c=vt(l),type:p="keyframes",repeat:f,repeatType:m,repeatDelay:y=0,...v}=n;let{ease:w=e.ease||"easeOut",duration:b}=n;const T="function"==typeof u?u(o,a):u,x=l.length,S=kt(p)?p:r?.[p];if(x<=2&&S){let t=100;if(2===x&&Bt(l)){const e=l[1]-l[0];t=Math.abs(e)}const e={...v};void 0!==b&&(e.duration=G(b));const n=st(e,t,S);w=n.ease,b=n.duration}b??(b=i);const M=h+T;1===c.length&&0===c[0]&&(c[1]=1);const A=c.length-l.length;if(A>0&&yt(c,A),1===l.length&&l.unshift(null),f){b=xt(b,f);const t=[...l],e=[...c];w=Array.isArray(w)?[...w]:[w];const n=[...w];for(let s=0;s{for(const r in t){const i=t[r];i.sort(Vt);const a=[],l=[],u=[];for(let t=0;t{s.push(...er(n,t,e))})),s}function sr(t){return function(e,n,s){let r=[];var i;i=e,r=Array.isArray(i)&&i.some(Array.isArray)?nr(e,n,t):er(e,n,s,t);const o=new Ts(r);return t&&t.animations.push(o),o}}const rr=sr(),ir=t=>t.startsWith("--"),or=(t,e,n)=>{ir(e)?t.style.setProperty(e,n):t.style[e]=n},ar=(t,e)=>ir(e)?t.style.getPropertyValue(e):t.style[e],lr=t=>null!==t;const ur=it((()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0})),cr=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","backgroundPositionX","backgroundPositionY"]);const hr=new WeakMap;class dr{constructor(t){if("animation"in t)return void(this.animation=t.animation);const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:i=!1}=t;let{transition:o}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=i;const a=function(t){const e=hr.get(t)||new Map;return hr.set(t,e),e}(e),l=((t,e)=>`${t}:${e}`)(n,r||""),u=a.get(l);u&&u.stop();const c=function(t,e,n,s){Array.isArray(n)||(n=[n]);for(let r=0;ra.delete(l),this.animation.onfinish=()=>{r||(or(e,n,function(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(lr),i=e&&"loop"!==n&&e%2==1?0:r.length-1;return i&&void 0!==s?s:r[i]}(c,o)),this.cancel())},a.set(l,this)}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.finish()}cancel(){try{this.animation.cancel()}catch(t){}this.removeAnimation()}stop(){const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.commitStyles(),this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming().duration||0;return Z(Number(t))}get time(){return Z(Number(this.animation.currentTime)||0)}set time(t){this.animation.currentTime=G(t)}get speed(){return this.animation.playbackRate}set speed(t){this.animation.playbackRate=t}get state(){return this.animation.playState}get startTime(){return Number(this.animation.startTime)}get finished(){return this.animation.finished}flatten(){this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"})}attachTimeline(t){return this.animation.timeline=t,this.animation.onfinish=null,r}then(t,e){return this.finished.then(t).catch(e)}}const pr=t=>function(e,n,s){return new Ts(function(t,e,n,s){const r=T(t,s),i=r.length,o=[];for(let t=0;t{const{currentTime:s}=e,r=(null===s?0:s.value)/100;n!==r&&t(r),n=r};return i.update(s,!0),()=>o(s)}const gr=new WeakMap;let yr;function vr({target:t,contentRect:e,borderBoxSize:n}){gr.get(t)?.forEach((s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})}))}function wr(t){t.forEach(vr)}function br(t,e){yr||"undefined"!=typeof ResizeObserver&&(yr=new ResizeObserver(wr));const n=T(t);return n.forEach((t=>{let n=gr.get(t);n||(n=new Set,gr.set(t,n)),n.add(e),yr?.observe(t)})),()=>{n.forEach((t=>{const n=gr.get(t);n?.delete(e),n?.size||yr?.unobserve(t)}))}}const Tr=new Set;let xr;function Sr(t){return Tr.add(t),xr||(xr=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};Tr.forEach((t=>t(e)))},window.addEventListener("resize",xr)),()=>{Tr.delete(t),!Tr.size&&xr&&(xr=void 0)}}const Mr={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Ar(t,e,n,s){const r=n[e],{length:i,position:o}=Mr[e],a=r.current,l=n.time;r.current=t[`scroll${o}`],r.scrollLength=t[`scroll${i}`]-t[`client${i}`],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=B(0,r.scrollLength,r.current);const u=s-l;r.velocity=u>50?0:f(r.current-a,u)}const Vr={start:0,center:.5,end:1};function kr(t,e,n=0){let s=0;if(t in Vr&&(t=Vr[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const Pr=[0,0];function Er(t,e,n,s){let r=Array.isArray(t)?t:Pr,i=0,o=0;return"number"==typeof t?r=[t,t]:"string"==typeof t&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,Vr[t]?t:"0"]),i=kr(r[0],n,s),o=kr(r[1],e),i-o}const Cr={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Fr={x:0,y:0};function Rr(t,e,n){const{offset:s=Cr.All}=n,{target:r=t,axis:i="y"}=n,o="y"===i?"height":"width",a=r!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let r=null,i=s.parentNode;for(;!r;)"svg"===i.tagName&&(r=i),i=s.parentNode;s=r}}return n}(r,t):Fr,l=r===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(r),u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const h=s.length;for(let t=0;tfunction(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){Ar(t,"x",e,n),Ar(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&Rr(t,n,s)},notify:()=>e(n)}}const Lr=new WeakMap,Or=new WeakMap,Ir=new WeakMap,Wr=t=>t===document.documentElement?window:t;function Dr(t,{container:e=document.documentElement,...n}={}){let s=Ir.get(e);s||(s=new Set,Ir.set(e,s));const r=Br(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(r),!Lr.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(a.timestamp)},r=()=>{for(const t of s)t.notify()},o=()=>{i.read(t,!1,!0),i.read(n,!1,!0),i.update(r,!1,!0)};Lr.set(e,o);const c=Wr(e);window.addEventListener("resize",o,{passive:!0}),e!==document.documentElement&&Or.set(e,(u=o,"function"==typeof(l=e)?Sr(l):br(l,u))),c.addEventListener("scroll",o,{passive:!0})}var l,u;const c=Lr.get(e);return i.read(c,!1,!0),()=>{o(c);const t=Ir.get(e);if(!t)return;if(t.delete(r),t.size)return;const n=Lr.get(e);Lr.delete(e),n&&(Wr(e).removeEventListener("scroll",n),Or.get(e)?.(),window.removeEventListener("resize",n))}}const Nr=new Map;function Kr({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),Nr.has(e)||Nr.set(e,{});const s=Nr.get(e);return s[n]||(s[n]=ws()?new ScrollTimeline({source:e,axis:n}):function({source:t,container:e,axis:n="y"}){t&&(e=t);const s={value:0},r=Dr((t=>{s.value=100*t[n].progress}),{container:e,axis:n});return{currentTime:s,cancel:r}}({source:e,axis:n})),s[n]}function $r(t){return t&&(t.target||t.offset)}function jr(t,{axis:e="y",...n}={}){const s={axis:e,...n};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||$r(e)?Dr((n=>{t(n[e.axis].progress,n)}),e):mr(t,Kr(e))}(t,s):function(t,e){if(t.flatten(),$r(e))return t.pause(),Dr((n=>{t.time=t.duration*n[e.axis].progress}),e);{const n=Kr(e);return t.attachTimeline?t.attachTimeline(n,(t=>(t.pause(),mr((e=>{t.time=t.duration*e}),n)))):r}}(t,s)}const zr={some:0,all:1};function Yr(t,e,{root:n,margin:s,amount:r="some"}={}){const i=T(t),o=new WeakMap,a=new IntersectionObserver((t=>{t.forEach((t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),o.delete(t.target))}))}),{root:n,rootMargin:s,threshold:"number"==typeof r?r:zr[r]});return i.forEach((t=>a.observe(t))),()=>a.disconnect()}function Ur(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,r="end"===e?Math.floor(s):Math.ceil(s);return L(0,1,r/t)}}function Xr(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(r,i)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,i),a=Math.abs(o-r);let l=t*a;if(s){const e=i*t;l=_n(s)(l/e)*e}return e+l}}function Hr(t,e){return function(t,e){const n=h.now(),s=({timestamp:r})=>{const i=r-n;i>=e&&(o(s),t(i-e))};return i.read(s,!0),()=>o(s)}(t,G(e))}const qr=(t,e)=>Math.abs(t-e);function Gr(t,e){const n=qr(t.x,e.x),s=qr(t.y,e.y);return Math.sqrt(n**2+s**2)}function Zr(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],r=t[1+n],i=t[2+n],o=t[3+n],a=Jn(r,i,{mixer:(l=i[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a}export{m as MotionValue,rr as animate,fr as animateMini,te as anticipate,Jt as backIn,Qt as backInOut,_t as backOut,o as cancelFrame,v as cancelSync,ee as circIn,se as circInOut,ne as circOut,L as clamp,sr as createScopedAnimate,qt as cubicBezier,Hr as delay,qr as distance,Gr as distance2D,Xn as easeIn,qn as easeInOut,Hn as easeOut,i as frame,a as frameData,M as hover,Yr as inView,Un as inertia,Jn as interpolate,R as invariant,b as isDragActive,Qn as keyframes,Gt as mirrorEasing,Yn as mix,g as motionValue,r as noop,Wn as pipe,F as press,B as progress,Zt as reverseEasing,jr as scroll,Dr as scrollInfo,dt as spring,Xr as stagger,Ur as steps,y as sync,h as time,Zr as transform,pt as wrap};export default null; -//# sourceMappingURL=/sm/c3a9c94d052a4b74d68bc150209257e1cd84d24eaba9be175f872e4bbf76c300.map \ No newline at end of file +const t=["read","resolveKeyframes","update","preRender","render","postRender"],e={value:null,addProjectionMetrics:null};const n={skipAnimations:!1,useManualTiming:!1};function s(n,s){let r=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,l=t.reduce(((t,n)=>(t[n]=function(t,n){let s=new Set,r=new Set,i=!1,o=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},u=0;function c(e){a.has(e)&&(h.schedule(e),t()),u++,e(l)}const h={schedule:(t,e=!1,n=!1)=>{const o=n&&i?s:r;return e&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{r.delete(t),a.delete(t)},process:t=>{l=t,i?o=!0:(i=!0,[s,r]=[r,s],s.forEach(c),n&&e.value&&e.value.frameloop[n].push(u),u=0,s.clear(),i=!1,o&&(o=!1,h.process(t)))}};return h}(a,s?n:void 0),t)),{}),{read:u,resolveKeyframes:c,update:h,preRender:d,render:p,postRender:f}=l,m=()=>{const t=performance.now();r=!1,o.delta=i?1e3/60:Math.max(Math.min(t-o.timestamp,40),1),o.timestamp=t,o.isProcessing=!0,u.process(o),c.process(o),h.process(o),d.process(o),p.process(o),f.process(o),o.isProcessing=!1,r&&s&&(i=!1,n(m))};return{schedule:t.reduce(((t,e)=>{const s=l[e];return t[e]=(t,e=!1,a=!1)=>(r||(r=!0,i=!0,o.isProcessing||n(m)),s.schedule(t,e,a)),t}),{}),cancel:e=>{for(let n=0;nt,{schedule:i,cancel:o,state:a,steps:l}=s("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:r,!0);let u;function c(){u=void 0}const h={now:()=>(void 0===u&&h.set(a.isProcessing||n.useManualTiming?a.timestamp:performance.now()),u),set:t=>{u=t,queueMicrotask(c)}};function d(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class p{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>d(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 r=0;r{const n=h.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=h.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 p);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=h.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return f(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 g(t,e){return new m(t,e)}const y=i,v=t.reduce(((t,e)=>(t[e]=t=>o(t),t)),{}),w=!1;function b(){return w}function T(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const r=n?.[t]??s.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function x(t,e){const n=T(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function S(t){return!("touch"===t.pointerType||b())}function M(t,e,n={}){const[s,r,i]=x(t,n),o=t=>{if(!S(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const i=t=>{S(t)&&(s(t),n.removeEventListener("pointerleave",i))};n.addEventListener("pointerleave",i,r)};return s.forEach((t=>{t.addEventListener("pointerenter",o,r)})),i}const A=(t,e)=>!!e&&(t===e||A(t,e.parentElement)),V=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const k=new WeakSet;function P(t){return e=>{"Enter"===e.key&&t(e)}}function E(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function C(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!b()}function F(t,e,n={}){const[s,r,i]=x(t,n),o=t=>{const s=t.currentTarget;if(!C(t)||k.has(s))return;k.add(s);const i=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),C(t)&&k.has(s)&&(k.delete(s),"function"==typeof i&&i(t,{success:e}))},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||A(s,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,r),window.addEventListener("pointercancel",l,r)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,r),t instanceof HTMLElement&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=P((()=>{if(k.has(n))return;E(n,"down");const t=P((()=>{E(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>E(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,r))),e=t,V.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),i}let R=()=>{};const B=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},L=(t,e,n)=>n>e?e:n1e3*t,Z=t=>t/1e3,_=.001;function J({duration:t=K,bounce:e=$,velocity:n=N,mass:s=D}){let r,i,o=1-e;o=L(H,q,o),t=L(U,X,Z(t)),o<1?(r=e=>{const s=e*o,r=s*t,i=s-n,a=tt(e,o),l=Math.exp(-r);return _-i/a*l},i=e=>{const s=e*o*t,i=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=tt(Math.pow(e,2),o);return(-r(e)+_>0?-1:1)*((i-a)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;n=et?1/0:e}function st(t,e=100,n){const s=n({...t,keyframes:[0,e]}),r=Math.min(nt(s),et);return{type:"keyframes",ease:t=>s.next(r*t).value/e,duration:Z(r)}}const rt={};function it(t){let e;return()=>(void 0===e&&(e=t()),e)}function ot(t,e){const n=it(t);return()=>rt[e]??n()}const at=ot((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),lt=(t,e,n=10)=>{let s="";const r=Math.max(Math.round(e/n),2);for(let e=0;evoid 0!==t[e]))}function dt(t=j,e=$){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:N,stiffness:I,damping:W,mass:D,isResolvedFromDuration:!1,...t};if(!ht(t,ct)&&ht(t,ut))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),r=s*s,i=2*L(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:D,stiffness:r,damping:i}}else{const n=J(t);e={...e,...n,mass:D},e.isResolvedFromDuration=!0}return e}({...n,velocity:-Z(n.velocity||0)}),f=d||0,m=u/(2*Math.sqrt(l*c)),g=o-i,y=Z(Math.sqrt(l/c)),v=Math.abs(g)<5;let w;if(s||(s=v?z.granular:z.default),r||(r=v?Y.granular:Y.default),m<1){const t=tt(y,m);w=e=>{const n=Math.exp(-m*y*e);return o-n*((f+m*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===m)w=t=>o-Math.exp(-y*t)*(g+(f+y*g)*t);else{const t=y*Math.sqrt(m*m-1);w=e=>{const n=Math.exp(-m*y*e),s=Math.min(t*e,300);return o-n*((f+m*y*g)*Math.sinh(s)+t*g*Math.cosh(s))/t}}const b={calculatedDuration:p&&h||null,next:t=>{const e=w(t);if(p)a.done=t>=h;else{let n=0;m<1&&(n=0===t?G(f):O(w,t,e));const i=Math.abs(n)<=s,l=Math.abs(o-e)<=r;a.done=i&&l}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(nt(b),et),e=lt((e=>b.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return b}dt.applyToOptions=t=>{const e=st(t,100,dt);return t.ease=at()?e.ease:"easeOut",t.duration=G(e.duration),t.type="keyframes",t};const pt=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},ft=t=>Array.isArray(t)&&"number"!=typeof t[0];function mt(t,e){return ft(t)?t[pt(0,t.length,e)]:t}const gt=(t,e,n)=>t+(e-t)*n;function yt(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=B(0,e,s);t.push(gt(n,1,r))}}function vt(t){const e=[0];return yt(e,t.length-1),e}const wt=t=>Boolean(t&&t.getVelocity);function bt(t){return"object"==typeof t&&!Array.isArray(t)}function Tt(t,e,n,s){return"string"==typeof t&&bt(e)?T(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function xt(t,e,n){return t*(e+1)}function St(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:s.get(e)??t}function Mt(t,e,n,s,r,i){!function(t,e,n){for(let s=0;se&&r.at"number"==typeof t,Bt=t=>t.every(Rt),Lt=new WeakMap,Ot=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],It=new Set(Ot),Wt=new Set(["width","height","top","left","right","bottom",...Ot]),Dt=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t;function Nt(t){const e=[{},{}];return t?.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function Kt(t,e,n,s){if("function"==typeof e){const[r,i]=Nt(s);e=e(void 0!==n?n:t.custom,r,i)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[r,i]=Nt(s);e=e(void 0!==n?n:t.custom,r,i)}return e}function $t(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,g(n))}function jt(t,e){const n=function(t,e,n){const s=t.getProps();return Kt(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const e in i){$t(t,e,Dt(i[e]))}}function zt(t,e){const s=t.getValue("willChange");if(r=s,Boolean(wt(r)&&r.add))return s.add(e);if(!s&&n.WillChange){const s=new n.WillChange("auto");t.addValue("willChange",s),s.add(e)}var r}const Yt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ut="data-"+Yt("framerAppearId");function Xt(t){return t.props[Ut]}const Ht=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function qt(t,e,n,s){if(t===e&&n===s)return r;const i=e=>function(t,e,n,s,r){let i,o,a=0;do{o=e+(n-e)/2,i=Ht(o,s,r)-t,i>0?n=o:e=o}while(Math.abs(i)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:Ht(i(t),e,s)}const Gt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Zt=t=>e=>1-t(1-e),_t=qt(.33,1.53,.69,.99),Jt=Zt(_t),Qt=Gt(Jt),te=t=>(t*=2)<1?.5*Jt(t):.5*(2-Math.pow(2,-10*(t-1))),ee=t=>1-Math.sin(Math.acos(t)),ne=Zt(ee),se=Gt(ee),re=t=>/^0[^.\s]+$/u.test(t);const ie={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},oe={...ie,transform:t=>L(0,1,t)},ae={...ie,default:1},le=t=>Math.round(1e5*t)/1e5,ue=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ce=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,he=(t,e)=>n=>Boolean("string"==typeof n&&ce.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),de=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[r,i,o,a]=s.match(ue);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},pe={...ie,transform:t=>Math.round((t=>L(0,255,t))(t))},fe={test:he("rgb","red"),parse:de("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+pe.transform(t)+", "+pe.transform(e)+", "+pe.transform(n)+", "+le(oe.transform(s))+")"};const me={test:he("#"),parse:function(t){let e="",n="",s="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}},transform:fe.transform},ge=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ye=ge("deg"),ve=ge("%"),we=ge("px"),be=ge("vh"),Te=ge("vw"),xe={...ve,parse:t=>ve.parse(t)/100,transform:t=>ve.transform(100*t)},Se={test:he("hsl","hue"),parse:de("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ve.transform(le(e))+", "+ve.transform(le(n))+", "+le(oe.transform(s))+")"},Me={test:t=>fe.test(t)||me.test(t)||Se.test(t),parse:t=>fe.test(t)?fe.parse(t):Se.test(t)?Se.parse(t):me.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?fe.transform(t):Se.transform(t)},Ae=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ve="number",ke="color",Pe=/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 Ee(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const o=e.replace(Pe,(t=>(Me.test(t)?(s.color.push(i),r.push(ke),n.push(Me.parse(t))):t.startsWith("var(")?(s.var.push(i),r.push("var"),n.push(t)):(s.number.push(i),r.push(Ve),n.push(parseFloat(t))),++i,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:r}}function Ce(t){return Ee(t).values}function Fe(t){const{split:e,types:n}=Ee(t),s=e.length;return t=>{let r="";for(let i=0;i"number"==typeof t?0:t;const Be={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(ue)?.length||0)+(t.match(Ae)?.length||0)>0},parse:Ce,createTransformer:Fe,getAnimatableNone:function(t){const e=Ce(t);return Fe(t)(e.map(Re))}},Le=new Set(["brightness","contrast","saturate","opacity"]);function Oe(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(ue)||[];if(!s)return t;const r=n.replace(s,"");let i=Le.has(e)?1:0;return s!==n&&(i*=100),e+"("+i+r+")"}const Ie=/\b([a-z-]*)\(.*?\)/gu,We={...Be,getAnimatableNone:t=>{const e=t.match(Ie);return e?e.map(Oe).join(" "):t}},De={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,top:we,right:we,bottom:we,left:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,backgroundPositionX:we,backgroundPositionY:we},Ne={rotate:ye,rotateX:ye,rotateY:ye,rotateZ:ye,scale:ae,scaleX:ae,scaleY:ae,scaleZ:ae,skew:ye,skewX:ye,skewY:ye,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:oe,originX:xe,originY:xe,originZ:we},Ke={...ie,transform:Math.round},$e={...De,...Ne,zIndex:Ke,size:we,fillOpacity:oe,strokeOpacity:oe,numOctaves:Ke},je={...$e,color:Me,backgroundColor:Me,outlineColor:Me,fill:Me,stroke:Me,borderColor:Me,borderTopColor:Me,borderRightColor:Me,borderBottomColor:Me,borderLeftColor:Me,filter:We,WebkitFilter:We},ze=t=>je[t];function Ye(t,e){let n=ze(t);return n!==We&&(n=Be),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ue=new Set(["auto","none","0"]);const Xe=t=>180*t/Math.PI,He=t=>{const e=Xe(Math.atan2(t[1],t[0]));return Ge(e)},qe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:He,rotateZ:He,skewX:t=>Xe(Math.atan(t[1])),skewY:t=>Xe(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ge=t=>((t%=360)<0&&(t+=360),t),Ze=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),_e=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Je={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ze,scaleY:_e,scale:t=>(Ze(t)+_e(t))/2,rotateX:t=>Ge(Xe(Math.atan2(t[6],t[5]))),rotateY:t=>Ge(Xe(Math.atan2(-t[2],t[0]))),rotateZ:He,rotate:He,skewX:t=>Xe(Math.atan(t[4])),skewY:t=>Xe(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Qe(t){return t.includes("scale")?1:0}function tn(t,e){if(!t||"none"===t)return Qe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=Je,r=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=qe,r=e}if(!r)return Qe(e);const i=s[e],o=r[1].split(",").map(en);return"function"==typeof i?i(o):o[i]}function en(t){return parseFloat(t.trim())}const nn=t=>t===ie||t===we,sn=new Set(["x","y","z"]),rn=Ot.filter((t=>!sn.has(t)));const on={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})=>tn(e,"x"),y:(t,{transform:e})=>tn(e,"y")};on.translateX=on.x,on.translateY=on.y;const an=new Set;let ln=!1,un=!1;function cn(){if(un){const t=Array.from(an).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 rn.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])=>{t.getValue(e)?.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}un=!1,ln=!1,an.forEach((t=>t.complete())),an.clear()}function hn(){an.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(un=!0)}))}class dn{constructor(t,e,n,s,r,i=!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=r,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(an.add(this),ln||(ln=!0,i.read(hn),i.resolveKeyframes(cn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let r=0;r/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),fn=t=>e=>"string"==typeof e&&e.startsWith(t),mn=fn("--"),gn=fn("var(--"),yn=t=>!!gn(t)&&vn.test(t.split("/*")[0].trim()),vn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,wn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bn(t,e,n=1){const[s,r]=function(t){const e=wn.exec(t);if(!e)return[,];const[,n,s,r]=e;return[`--${n??s}`,r]}(t);if(!s)return;const i=window.getComputedStyle(e).getPropertyValue(s);if(i){const t=i.trim();return pn(t)?parseFloat(t):t}return yn(r)?bn(r,e,n+1):r}const Tn=t=>e=>e.test(t),xn=[ie,we,ve,ye,Te,be,{test:t=>"auto"===t,parse:t=>t}],Sn=t=>xn.find(Tn(t));class Mn extends dn{constructor(t,e,n,s,r){super(t,e,n,s,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const An=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Be.test(t)&&"0"!==t||t.startsWith("url(")));function Vn(t,e,n,s){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const i=t[t.length-1],o=An(r,e),a=An(i,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;nnull!==t;function Pn(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(kn),i=e&&"loop"!==n&&e%2==1?0:r.length-1;return i&&void 0!==s?s:r[i]}class En{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:i="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=h.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:r,repeatType:i,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(hn(),cn()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=h.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:r,delay:i,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!Vn(t,n,s,r)){if(!i)return a&&a(Pn(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}))}}function Cn(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 Fn(t,e){return n=>n>0?e:t}const Rn=(t,e,n)=>{const s=t*t,r=n*(e*e-s)+s;return r<0?0:Math.sqrt(r)},Bn=[me,fe,Se];function Ln(t){const e=(n=t,Bn.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Se&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let r=0,i=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;r=Cn(a,s,t+1/3),i=Cn(a,s,t),o=Cn(a,s,t-1/3)}else r=i=o=n;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*o),alpha:s}}(s)),s}const On=(t,e)=>{const n=Ln(t),s=Ln(e);if(!n||!s)return Fn(t,e);const r={...n};return t=>(r.red=Rn(n.red,s.red,t),r.green=Rn(n.green,s.green,t),r.blue=Rn(n.blue,s.blue,t),r.alpha=gt(n.alpha,s.alpha,t),fe.transform(r))},In=(t,e)=>n=>e(t(n)),Wn=(...t)=>t.reduce(In),Dn=new Set(["none","hidden"]);function Nn(t,e){return n=>gt(t,e,n)}function Kn(t){return"number"==typeof t?Nn:"string"==typeof t?yn(t)?Fn:Me.test(t)?On:zn:Array.isArray(t)?$n:"object"==typeof t?Me.test(t)?On:jn:Fn}function $n(t,e){const n=[...t],s=n.length,r=t.map(((t,n)=>Kn(t)(t,e[n])));return t=>{for(let e=0;e{for(const e in s)n[e]=s[e](t);return n}}const zn=(t,e)=>{const n=Be.createTransformer(e),s=Ee(t),r=Ee(e);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?Dn.has(t)&&!r.values.length||Dn.has(e)&&!s.values.length?function(t,e){return Dn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Wn($n(function(t,e){const n=[],s={color:0,var:0,number:0};for(let r=0;rvoid 0===a?l:void 0===l||Math.abs(a-t)-f*Math.exp(-t/s),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&el)&&(b=t,T=dt({keyframes:[d.value,p(d.value)],velocity:O(v,t,d.value),damping:r,stiffness:i,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}const Xn=qt(.42,0,1,1),Hn=qt(0,0,.58,1),qn=qt(.42,0,.58,1),Gn=t=>Array.isArray(t)&&"number"==typeof t[0],Zn={linear:r,easeIn:Xn,easeInOut:qn,easeOut:Hn,circIn:ee,circInOut:se,circOut:ne,backIn:Jt,backInOut:Qt,backOut:_t,anticipate:te},_n=t=>{if(Gn(t)){t.length;const[e,n,s,r]=t;return qt(e,n,s,r)}return"string"==typeof t?Zn[t]:t};function Jn(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(e.length,1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=function(t,e,n){const s=[],i=n||Yn,o=t.length-1;for(let n=0;n{if(a&&n1)for(;sc(L(t[0],t[o-1],e)):c}function Qn({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const r=ft(s)?s.map(_n):_n(s),i={done:!1,value:e[0]},o=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:vt(e),t),a=Jn(o,e,{ease:Array.isArray(r)?r:(l=e,u=r,l.map((()=>u||qn)).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(i.value=a(e),i.done=e>=t,i)}}const ts=t=>{const e=({timestamp:e})=>t(e);return{start:()=>i.update(e,!0),stop:()=>o(e),now:()=>a.isProcessing?a.timestamp:h.now()}},es={decay:Un,inertia:Un,tween:Qn,keyframes:Qn,spring:dt},ns=t=>t/100;class ss extends En{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:r}=this.options,i=s?.KeyframeResolver||dn;this.resolver=new i(r,((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:r,velocity:i=0}=this.options,o=kt(e)?e:es[e]||Qn;let a,l;o!==Qn&&"number"!=typeof t[0]&&(a=Wn(ns,Yn(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===r&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-i})),null===u.calculatedDuration&&(u.calculatedDuration=nt(u));const{calculatedDuration:c}=u,h=c+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(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:r,mirroredGenerator:i,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return r.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),y=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let v=this.currentTime,w=r;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=i)),v=L(0,1,n)*c}const b=y?{done:!1,value:a[0]}:w.next(v);o&&(b.value=o(b.value));let{done:T}=b;y||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&void 0!==s&&(b.value=Pn(a,this.options,s)),m&&m(b.value),x&&this.finish(),b}get duration(){const{resolved:t}=this;return t?Z(t.calculatedDuration):0}get time(){return Z(this.currentTime)}set time(t){t=G(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=Z(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=ts,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=n??this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){this._resolved?(this.state="paused",this.holdTime=this.currentTime??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)}get finished(){return this.currentFinishedPromise}}const rs=new Set(["opacity","clipPath","filter","transform"]),is=it((()=>Object.hasOwnProperty.call(Element.prototype,"animate"))),os=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,as={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:os([0,.65,.55,1]),circOut:os([.55,0,1,.45]),backIn:os([.31,.01,.66,-.59]),backOut:os([.33,1.53,.69,.99])};function ls(t,e){return t?"function"==typeof t&&at()?lt(t,e):Gn(t)?os(t):Array.isArray(t)?t.map((t=>ls(t,e)||as.easeOut)):as[t]:void 0}function us(t,e,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=ls(a,r);Array.isArray(h)&&(c.easing=h);return t.animate(c,{delay:s,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:"reverse"===o?"alternate":"normal",pseudoElement:u})}function cs(t,e){t.timeline=e,t.onfinish=null}function hs(t){return Boolean("function"==typeof t&&at()||!t||"string"==typeof t&&(t in as||at())||Gn(t)||Array.isArray(t)&&t.every(hs))}const ds={anticipate:te,backInOut:Qt,circInOut:se};class ps extends En{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:r}=this.options;this.resolver=new Mn(r,((t,e)=>this.onKeyframesResolved(t,e)),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:s,ease:r,type:i,motionValue:o,name:a,startTime:l}=this.options;if(!o.owner||!o.owner.current)return!1;var u;if("string"==typeof r&&at()&&r in ds&&(r=ds[r]),kt((u=this.options).type)||"spring"===u.type||!hs(u.ease)){const{onComplete:e,onUpdate:o,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new ss({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const r=[];let i=0;for(;!s.done&&i<2e4;)s=n.sample(i),r.push(s.value),i+=10;return{times:void 0,keyframes:r,duration:i-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),n=c.duration,s=c.times,r=c.ease,i="keyframes"}const c=us(o.owner.current,a,t,{...this.options,duration:n,times:s,ease:r});return c.startTime=l??this.calcStartTime(),this.pendingTimeline?(cs(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;o.set(Pn(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:s,type:i,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return Z(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return Z(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=G(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return r;const{animation:n}=e;cs(n,t)}else this.pendingTimeline=t;return r}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:r,ease:i,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,c=new ss({...u,keyframes:n,duration:s,type:r,ease:i,times:o,isGenerator:!0}),h=G(this.time);t.setWithVelocity(c.sample(h-10).value,c.sample(h).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return is()&&n&&rs.has(n)&&("transform"!==n||!l)&&!a&&!s&&"mirror"!==r&&0!==i&&"inertia"!==o}}const fs={type:"spring",stiffness:500,damping:25,restSpeed:10},ms={type:"keyframes",duration:.8},gs={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ys=(t,{keyframes:e})=>e.length>2?ms:It.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:fs:gs;function vs(t,e){return t?.[e]??t?.default??t}const ws=it((()=>void 0!==window.ScrollTimeline));class bs{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map((t=>t.finished)))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;nws()&&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;ee[t]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Ts extends bs{then(t,e){return this.finished.finally(t).then((()=>{}))}}const xs=(t,e,n,s={},r,o)=>a=>{const l=vs(s,t)||{},u=l.delay||s.delay||0;let{elapsed:c=0}=s;c-=G(u);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,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:r,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(l)||(h={...h,...ys(t,h)}),h.duration&&(h.duration=G(h.duration)),h.repeatDelay&&(h.repeatDelay=G(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),h.allowFlatten=!l.type&&!l.ease,d&&!o&&void 0!==e.get()){const t=Pn(h.keyframes,l);if(void 0!==t)return i.update((()=>{h.onUpdate(t),h.onComplete()})),new Ts([])}return!o&&ps.supports(h)?new ps(h):new ss(h)};function Ss({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function Ms(t,e,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const u=[],c=r&&t.animationState&&t.animationState.getState()[r];for(const e in l){const s=t.getValue(e,t.latestValues[e]??null),r=l[e];if(void 0===r||c&&Ss(c,e))continue;const a={delay:n,...vs(o||{},e)};let h=!1;if(window.MotionHandoffAnimation){const n=Xt(t);if(n){const t=window.MotionHandoffAnimation(n,e,i);null!==t&&(a.startTime=t,h=!0)}}zt(t,e),s.start(xs(e,s,r,t.shouldReduceMotion&&Wt.has(e)?{type:!1}:a,t,h));const d=s.animation;d&&u.push(d)}return a&&Promise.all(u).then((()=>{i.update((()=>{a&&jt(t,a)}))})),u}const As=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Vs={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"]},ks={};for(const t in Vs)ks[t]={isEnabled:e=>Vs[t].some((t=>!!e[t]))};const Ps="undefined"!=typeof window,Es={current:null},Cs={current:!1};const Fs=[...xn,Me,Be];const Rs=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function Bs(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||Rs.some((e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e])));var e}const Ls=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Os{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=dn,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=h.now();this.renderScheduledAtthis.bindToMotionValue(e,t))),Cs.current||function(){if(Cs.current=!0,Ps)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Es.current=t.matches;t.addListener(e),e()}else Es.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Es.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),o(this.notifyUpdate),o(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=It.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 ks){const e=ks[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;ee.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=g(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(pn(n)||re(n))?n=parseFloat(n):(s=n,!Fs.find(Tn(s))&&Be.test(e)&&(n=Ye(t,e))),this.setBaseTarget(t,wt(n)?n.get():n)),wt(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=Kt(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||wt(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Is extends Os{constructor(){super(...arguments),this.KeyframeResolver=Mn}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;wt(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}const Ws=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Ds={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ns=Ot.length;function Ks(t,e,n){const{style:s,vars:r,transformOrigin:i}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(It.has(t))o=!0;else if(mn(t))r[t]=n;else{const e=Ws(n,$e[t]);t.startsWith("origin")?(a=!0,i[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",r=!0;for(let i=0;i{this.current&&!this.renderState.dimensions&&function(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}}}(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(It.has(e)){const t=ze(e);return t&&t.default||0}return e=Us.has(e)?e:Yt(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Gs(t,e,n);for(const n in t)(wt(t[n])||wt(e[n]))&&(s[-1!==Ot.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&i.postRender(this.updateDimensions)}build(t,e,n){Ys(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Xs(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Us.has(n)?n:Yt(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}class _s extends Is{constructor(){super(...arguments),this.type="html",this.renderInstance=Xs}readValueFromInstance(t,e){if(It.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return tn(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),r=(mn(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof r?r.trim():r}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){Ks(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Gs(t,e,n)}}class Js extends Os{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Qs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new Zs(e):new _s(e);n.mount(t),Lt.set(t,n)}function tr(t){const e=new Js({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Lt.set(t,e)}function er(t,e,n,s){const r=[];if(function(t,e){return wt(t)||"number"==typeof t||"string"==typeof t&&!bt(e)}(t,e))r.push(function(t,e,n){const s=wt(t)?t:g(t);return s.start(xs("",s,e,n)),s.animation}(t,bt(e)&&e.default||e,n&&n.default||n));else{const i=Tt(t,e,s),o=i.length;for(let t=0;t{const l=Ct(t),{delay:u=0,times:c=vt(l),type:p="keyframes",repeat:f,repeatType:m,repeatDelay:y=0,...v}=n;let{ease:w=e.ease||"easeOut",duration:b}=n;const T="function"==typeof u?u(o,a):u,x=l.length,S=kt(p)?p:r?.[p];if(x<=2&&S){let t=100;if(2===x&&Bt(l)){const e=l[1]-l[0];t=Math.abs(e)}const e={...v};void 0!==b&&(e.duration=G(b));const n=st(e,t,S);w=n.ease,b=n.duration}b??(b=i);const M=h+T;1===c.length&&0===c[0]&&(c[1]=1);const A=c.length-l.length;if(A>0&&yt(c,A),1===l.length&&l.unshift(null),f){b=xt(b,f);const t=[...l],e=[...c];w=Array.isArray(w)?[...w]:[w];const n=[...w];for(let s=0;s{for(const r in t){const i=t[r];i.sort(Vt);const a=[],l=[],u=[];for(let t=0;t{s.push(...er(n,t,e))})),s}function sr(t){return function(e,n,s){let r=[];var i;i=e,r=Array.isArray(i)&&i.some(Array.isArray)?nr(e,n,t):er(e,n,s,t);const o=new Ts(r);return t&&t.animations.push(o),o}}const rr=sr(),ir=t=>t.startsWith("--"),or=(t,e,n)=>{ir(e)?t.style.setProperty(e,n):t.style[e]=n},ar=(t,e)=>ir(e)?t.style.getPropertyValue(e):t.style[e],lr=t=>null!==t;const ur=it((()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0})),cr=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","backgroundPositionX","backgroundPositionY"]);const hr=new WeakMap;class dr{constructor(t){if("animation"in t)return void(this.animation=t.animation);const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:i=!1}=t;let{transition:o}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=i;const a=function(t){const e=hr.get(t)||new Map;return hr.set(t,e),e}(e),l=((t,e)=>`${t}:${e}`)(n,r||""),u=a.get(l);u&&u.stop();const c=function(t,e,n,s){Array.isArray(n)||(n=[n]);for(let r=0;ra.delete(l),this.animation.onfinish=()=>{r||(or(e,n,function(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(lr),i=e&&"loop"!==n&&e%2==1?0:r.length-1;return i&&void 0!==s?s:r[i]}(c,o)),this.cancel())},a.set(l,this)}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.finish()}cancel(){try{this.animation.cancel()}catch(t){}this.removeAnimation()}stop(){const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.commitStyles(),this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming().duration||0;return Z(Number(t))}get time(){return Z(Number(this.animation.currentTime)||0)}set time(t){this.animation.currentTime=G(t)}get speed(){return this.animation.playbackRate}set speed(t){this.animation.playbackRate=t}get state(){return this.animation.playState}get startTime(){return Number(this.animation.startTime)}get finished(){return this.animation.finished}flatten(){this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"})}attachTimeline(t){return this.animation.timeline=t,this.animation.onfinish=null,r}then(t,e){return this.finished.then(t).catch(e)}}const pr=t=>function(e,n,s){return new Ts(function(t,e,n,s){const r=T(t,s),i=r.length,o=[];for(let t=0;t{const{currentTime:s}=e,r=(null===s?0:s.value)/100;n!==r&&t(r),n=r};return i.update(s,!0),()=>o(s)}const gr=new WeakMap;let yr;function vr({target:t,contentRect:e,borderBoxSize:n}){gr.get(t)?.forEach((s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})}))}function wr(t){t.forEach(vr)}function br(t,e){yr||"undefined"!=typeof ResizeObserver&&(yr=new ResizeObserver(wr));const n=T(t);return n.forEach((t=>{let n=gr.get(t);n||(n=new Set,gr.set(t,n)),n.add(e),yr?.observe(t)})),()=>{n.forEach((t=>{const n=gr.get(t);n?.delete(e),n?.size||yr?.unobserve(t)}))}}const Tr=new Set;let xr;function Sr(t){return Tr.add(t),xr||(xr=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};Tr.forEach((t=>t(e)))},window.addEventListener("resize",xr)),()=>{Tr.delete(t),!Tr.size&&xr&&(xr=void 0)}}const Mr={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Ar(t,e,n,s){const r=n[e],{length:i,position:o}=Mr[e],a=r.current,l=n.time;r.current=t[`scroll${o}`],r.scrollLength=t[`scroll${i}`]-t[`client${i}`],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=B(0,r.scrollLength,r.current);const u=s-l;r.velocity=u>50?0:f(r.current-a,u)}const Vr={start:0,center:.5,end:1};function kr(t,e,n=0){let s=0;if(t in Vr&&(t=Vr[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const Pr=[0,0];function Er(t,e,n,s){let r=Array.isArray(t)?t:Pr,i=0,o=0;return"number"==typeof t?r=[t,t]:"string"==typeof t&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,Vr[t]?t:"0"]),i=kr(r[0],n,s),o=kr(r[1],e),i-o}const Cr={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Fr={x:0,y:0};function Rr(t,e,n){const{offset:s=Cr.All}=n,{target:r=t,axis:i="y"}=n,o="y"===i?"height":"width",a=r!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let r=null,i=s.parentNode;for(;!r;)"svg"===i.tagName&&(r=i),i=s.parentNode;s=r}}return n}(r,t):Fr,l=r===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(r),u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const h=s.length;for(let t=0;tfunction(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){Ar(t,"x",e,n),Ar(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&Rr(t,n,s)},notify:()=>e(n)}}const Lr=new WeakMap,Or=new WeakMap,Ir=new WeakMap,Wr=t=>t===document.documentElement?window:t;function Dr(t,{container:e=document.documentElement,...n}={}){let s=Ir.get(e);s||(s=new Set,Ir.set(e,s));const r=Br(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(r),!Lr.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(a.timestamp)},r=()=>{for(const t of s)t.notify()},o=()=>{i.read(t,!1,!0),i.read(n,!1,!0),i.update(r,!1,!0)};Lr.set(e,o);const c=Wr(e);window.addEventListener("resize",o,{passive:!0}),e!==document.documentElement&&Or.set(e,(u=o,"function"==typeof(l=e)?Sr(l):br(l,u))),c.addEventListener("scroll",o,{passive:!0})}var l,u;const c=Lr.get(e);return i.read(c,!1,!0),()=>{o(c);const t=Ir.get(e);if(!t)return;if(t.delete(r),t.size)return;const n=Lr.get(e);Lr.delete(e),n&&(Wr(e).removeEventListener("scroll",n),Or.get(e)?.(),window.removeEventListener("resize",n))}}const Nr=new Map;function Kr({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),Nr.has(e)||Nr.set(e,{});const s=Nr.get(e);return s[n]||(s[n]=ws()?new ScrollTimeline({source:e,axis:n}):function({source:t,container:e,axis:n="y"}){t&&(e=t);const s={value:0},r=Dr((t=>{s.value=100*t[n].progress}),{container:e,axis:n});return{currentTime:s,cancel:r}}({source:e,axis:n})),s[n]}function $r(t){return t&&(t.target||t.offset)}function jr(t,{axis:e="y",...n}={}){const s={axis:e,...n};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||$r(e)?Dr((n=>{t(n[e.axis].progress,n)}),e):mr(t,Kr(e))}(t,s):function(t,e){if(t.flatten(),$r(e))return t.pause(),Dr((n=>{t.time=t.duration*n[e.axis].progress}),e);{const n=Kr(e);return t.attachTimeline?t.attachTimeline(n,(t=>(t.pause(),mr((e=>{t.time=t.duration*e}),n)))):r}}(t,s)}const zr={some:0,all:1};function Yr(t,e,{root:n,margin:s,amount:r="some"}={}){const i=T(t),o=new WeakMap,a=new IntersectionObserver((t=>{t.forEach((t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),o.delete(t.target))}))}),{root:n,rootMargin:s,threshold:"number"==typeof r?r:zr[r]});return i.forEach((t=>a.observe(t))),()=>a.disconnect()}function Ur(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,r="end"===e?Math.floor(s):Math.ceil(s);return L(0,1,r/t)}}function Xr(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(r,i)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,i),a=Math.abs(o-r);let l=t*a;if(s){const e=i*t;l=_n(s)(l/e)*e}return e+l}}function Hr(t,e){return function(t,e){const n=h.now(),s=({timestamp:r})=>{const i=r-n;i>=e&&(o(s),t(i-e))};return i.read(s,!0),()=>o(s)}(t,G(e))}const qr=(t,e)=>Math.abs(t-e);function Gr(t,e){const n=qr(t.x,e.x),s=qr(t.y,e.y);return Math.sqrt(n**2+s**2)}function Zr(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],r=t[1+n],i=t[2+n],o=t[3+n],a=Jn(r,i,{mixer:(l=i[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a}export{m as MotionValue,rr as animate,fr as animateMini,te as anticipate,Jt as backIn,Qt as backInOut,_t as backOut,o as cancelFrame,v as cancelSync,ee as circIn,se as circInOut,ne as circOut,L as clamp,sr as createScopedAnimate,qt as cubicBezier,Hr as delay,qr as distance,Gr as distance2D,Xn as easeIn,qn as easeInOut,Hn as easeOut,i as frame,a as frameData,M as hover,Yr as inView,Un as inertia,Jn as interpolate,R as invariant,b as isDragActive,Qn as keyframes,Gt as mirrorEasing,Yn as mix,g as motionValue,r as noop,Wn as pipe,F as press,B as progress,Zt as reverseEasing,jr as scroll,Dr as scrollInfo,dt as spring,Xr as stagger,Ur as steps,y as sync,h as time,Zr as transform,pt as wrap};export default null; \ No newline at end of file