From 548ed6e0f5ce6edb2896ed9debc65e4e22525ec1 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Wed, 11 Jun 2025 00:29:41 +0200 Subject: [PATCH 01/15] feat: part 2 - Finish workspace creation form, refactor collapsed toolbar and update motion to `v12.16.0`, b=no-bug, c=workspaces, common, tabs, vendor --- .../base/content/zen-keysets.inc.xhtml | 4 + .../base/content/zen-locales.inc.xhtml | 3 + .../base/content/zen-panels/emojis-picker.inc | 11 ++ .../content/zen-panels/gradient-generator.inc | 61 +++++++++ .../base/content/zen-panels/popups.inc | 29 +++++ .../content/zen-panels/workspaces-panel.inc | 23 ++++ .../base/content/zen-popupset.inc.xhtml | 117 ++---------------- .../base/content/zen-preloaded.inc.xhtml | 4 + .../base/content/zen-sidebar-icons.inc.xhtml | 7 +- .../content/zen-tabbrowser-elements.inc.xhtml | 4 + src/zen/common/ZenCustomizableUI.sys.mjs | 6 +- src/zen/tabs/zen-tabs/vertical-tabs.css | 40 ++++-- src/zen/vendor/motion.dep | 1 + src/zen/vendor/motion.min.mjs | 4 +- src/zen/workspaces/ZenGradientGenerator.mjs | 10 +- src/zen/workspaces/ZenWorkspaceCreation.mjs | 62 ++++++++-- src/zen/workspaces/ZenWorkspaces.mjs | 7 +- src/zen/workspaces/create-workspace-form.css | 9 +- 18 files changed, 250 insertions(+), 152 deletions(-) create mode 100644 src/browser/base/content/zen-panels/emojis-picker.inc create mode 100644 src/browser/base/content/zen-panels/gradient-generator.inc create mode 100644 src/browser/base/content/zen-panels/popups.inc create mode 100644 src/browser/base/content/zen-panels/workspaces-panel.inc create mode 100644 src/zen/vendor/motion.dep diff --git a/src/browser/base/content/zen-keysets.inc.xhtml b/src/browser/base/content/zen-keysets.inc.xhtml index 4babb0fb..98f609e5 100644 --- a/src/browser/base/content/zen-keysets.inc.xhtml +++ b/src/browser/base/content/zen-keysets.inc.xhtml @@ -1,3 +1,7 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + diff --git a/src/browser/base/content/zen-locales.inc.xhtml b/src/browser/base/content/zen-locales.inc.xhtml index 643f917a..7d48fa05 100644 --- a/src/browser/base/content/zen-locales.inc.xhtml +++ b/src/browser/base/content/zen-locales.inc.xhtml @@ -1,3 +1,6 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/src/browser/base/content/zen-panels/emojis-picker.inc b/src/browser/base/content/zen-panels/emojis-picker.inc new file mode 100644 index 00000000..cc3a9fe9 --- /dev/null +++ b/src/browser/base/content/zen-panels/emojis-picker.inc @@ -0,0 +1,11 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + + + + + + + diff --git a/src/browser/base/content/zen-panels/gradient-generator.inc b/src/browser/base/content/zen-panels/gradient-generator.inc new file mode 100644 index 00000000..e73cb20a --- /dev/null +++ b/src/browser/base/content/zen-panels/gradient-generator.inc @@ -0,0 +1,61 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/browser/base/content/zen-panels/popups.inc b/src/browser/base/content/zen-panels/popups.inc new file mode 100644 index 00000000..158a8b67 --- /dev/null +++ b/src/browser/base/content/zen-panels/popups.inc @@ -0,0 +1,29 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + + + + + + + + + + + + + + + + + + diff --git a/src/browser/base/content/zen-panels/workspaces-panel.inc b/src/browser/base/content/zen-panels/workspaces-panel.inc new file mode 100644 index 00000000..ba42669d --- /dev/null +++ b/src/browser/base/content/zen-panels/workspaces-panel.inc @@ -0,0 +1,23 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + + + + + +

+ + + + + + +
+
+ + +
+
+
\ No newline at end of file diff --git a/src/browser/base/content/zen-popupset.inc.xhtml b/src/browser/base/content/zen-popupset.inc.xhtml index 9b9c03e0..a5743f28 100644 --- a/src/browser/base/content/zen-popupset.inc.xhtml +++ b/src/browser/base/content/zen-popupset.inc.xhtml @@ -1,112 +1,9 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +#include zen-panels/gradient-generator.inc +#include zen-panels/workspaces-panel.inc +#include zen-panels/emojis-picker.inc - - - - - -

- - - - - - -
-
- - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - +#include zen-panels/popups.inc diff --git a/src/browser/base/content/zen-preloaded.inc.xhtml b/src/browser/base/content/zen-preloaded.inc.xhtml index dbf0730c..ca6f88a9 100644 --- a/src/browser/base/content/zen-preloaded.inc.xhtml +++ b/src/browser/base/content/zen-preloaded.inc.xhtml @@ -1,3 +1,7 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + # This needs to be here, before all the other scripts, because it's used before # the window is fully loaded. # Make sure they are loaded before the global-scripts.inc file. diff --git a/src/browser/base/content/zen-sidebar-icons.inc.xhtml b/src/browser/base/content/zen-sidebar-icons.inc.xhtml index 7a519463..3a5791d0 100644 --- a/src/browser/base/content/zen-sidebar-icons.inc.xhtml +++ b/src/browser/base/content/zen-sidebar-icons.inc.xhtml @@ -1,6 +1,11 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + #include ../../../zen/media/zen-media-controls.inc.xhtml + #include ../../../zen/split-view/zen-splitview-overlay.inc.xhtml diff --git a/src/zen/common/ZenCustomizableUI.sys.mjs b/src/zen/common/ZenCustomizableUI.sys.mjs index cd30306f..cbe5641e 100644 --- a/src/zen/common/ZenCustomizableUI.sys.mjs +++ b/src/zen/common/ZenCustomizableUI.sys.mjs @@ -20,7 +20,7 @@ export var ZenCustomizableUI = new (class { true ); CustomizableUIInternal.registerArea( - 'zen-sidebar-bottom-buttons', + 'zen-sidebar-foot-buttons', { type: this.TYPE_TOOLBAR, defaultPlacements: this.defaultSidebarIcons, @@ -148,7 +148,7 @@ export var ZenCustomizableUI = new (class { } _hideToolbarButtons(window) { - const wrapper = window.document.getElementById('zen-sidebar-bottom-buttons'); + const wrapper = window.document.getElementById('zen-sidebar-foot-buttons'); const elementsToHide = ['new-tab-button']; for (let id of elementsToHide) { const elem = window.document.getElementById(id); @@ -167,7 +167,7 @@ export var ZenCustomizableUI = new (class { window.document.getElementById('zen-sidebar-top-buttons') ); window.CustomizableUI.registerToolbarNode( - window.document.getElementById('zen-sidebar-bottom-buttons') + window.document.getElementById('zen-sidebar-foot-buttons') ); } })(); diff --git a/src/zen/tabs/zen-tabs/vertical-tabs.css b/src/zen/tabs/zen-tabs/vertical-tabs.css index bde63e03..80043e45 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs.css @@ -423,20 +423,18 @@ /* ========================================================================== Sidebar Bottom Buttons Area ========================================================================== */ -#zen-sidebar-bottom-buttons { +#zen-sidebar-foot-buttons { background: transparent; - gap: 5px; /* Spacing between buttons */ - align-items: center; /* Center vertically */ - padding-top: var(--zen-element-separation); /* Add padding above */ - --toolbarbutton-inner-padding: 5px; /* Define inner padding for buttons */ + gap: 5px; + align-items: center; + padding-top: var(--zen-element-separation); + --toolbarbutton-inner-padding: 5px; - /* Remove padding from direct children (except workspaces button) */ & > toolbarbutton:not(#zen-workspaces-button) { padding: 0 !important; } } -/* Hide the default new tab button container */ #newtab-button-container { display: none !important; } @@ -445,7 +443,6 @@ Tab Arrow Scrollbox Adjustments ========================================================================== */ #tabbrowser-arrowscrollbox { - /* Remove gap within the scrollbox part */ &::part(scrollbox) { gap: 0px !important; } @@ -561,10 +558,10 @@ } /* Style bottom buttons area when expanded */ - & #zen-sidebar-bottom-buttons { + & #zen-sidebar-foot-buttons { display: flex; - flex-direction: row; /* Arrange buttons horizontally */ - justify-content: space-between; /* Distribute space */ + flex-direction: row; + justify-content: space-between; width: 100%; position: relative; } @@ -780,10 +777,27 @@ } /* Ensure bottom buttons container fits content during customization */ - :root[customizing] & #zen-sidebar-bottom-buttons { + :root[customizing] & #zen-sidebar-foot-buttons { min-width: unset !important; } + #zen-sidebar-foot-buttons { + & > .toolbarbutton-1 { + min-height: var(--tab-min-height); + line-height: var(--tab-label-line-height); + border-radius: var(--border-radius-medium); + padding: 0 calc(var(--tab-inline-padding) - var(--tab-inner-inline-margin)); + width: var(--tab-collapsed-background-width); + margin-inline: var(--tab-inner-inline-margin); + + & .toolbarbutton-badge-stack { + justify-content: center; + padding: 8px; + width: var(--tab-collapsed-background-width); + } + } + } + /* Center top buttons container */ & #zen-sidebar-top-buttons { justify-content: center; @@ -805,7 +819,7 @@ } /* Style bottom buttons area when collapsed */ - & #zen-sidebar-bottom-buttons { + & #zen-sidebar-foot-buttons { display: flex; flex-direction: column; /* Stack vertically */ padding-top: var(--zen-element-separation); diff --git a/src/zen/vendor/motion.dep b/src/zen/vendor/motion.dep new file mode 100644 index 00000000..36206bd2 --- /dev/null +++ b/src/zen/vendor/motion.dep @@ -0,0 +1 @@ +https://cdn.jsdelivr.net/npm/motion@latest/+esm: v12.16.0 \ No newline at end of file diff --git a/src/zen/vendor/motion.min.mjs b/src/zen/vendor/motion.min.mjs index 2f9747ec..fdb4cd59 100644 --- a/src/zen/vendor/motion.min.mjs +++ b/src/zen/vendor/motion.min.mjs @@ -1,7 +1,7 @@ /** * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. - * Original file: /npm/motion@12.7.4/dist/es/motion/lib/index.mjs + * Original file: /npm/motion@12.16.0/dist/es/motion/lib/index.mjs * * 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; \ No newline at end of file +function t(t){return"object"==typeof t&&!Array.isArray(t)}function e(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 n(n,s,r,i){return"string"==typeof n&&t(s)?e(n,r,i):n instanceof NodeList?Array.from(n):Array.isArray(n)?n:[n]}function s(t,e,n){return t*(e+1)}function r(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}const i=(t,e,n)=>t+(e-t)*n,o=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},a=t=>Array.isArray(t)&&"number"!=typeof t[0];function u(t,e){return a(t)?t[o(0,t.length,e)]:t}function l(t,e){-1===t.indexOf(e)&&t.push(e)}function c(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function h([...t],e,n){const s=e<0?t.length+e:e;if(s>=0&&se&&r.atBoolean(t&&t.getVelocity),g=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};function y(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=g(0,e,s);t.push(i(n,1,r))}}function v(t){const e=[0];return y(e,t.length-1),e}function w(t){return"function"==typeof t&&"applyToOptions"in t}const b=2e4;function T(t){let e=0;let n=t.next(e);for(;!n.done&&e=b?1/0:e}const x=t=>1e3*t,M=t=>t/1e3;function A(t,e=100,n){const s=n({...t,keyframes:[0,e]}),r=Math.min(T(s),b);return{type:"keyframes",ease:t=>s.next(r*t).value/e,duration:M(r)}}let S=()=>{},V=()=>{};function k(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function E(t,e){return e[t]||(e[t]=[]),e[t]}function P(t){return Array.isArray(t)?t:[t]}function C(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const O=t=>"number"==typeof t,F=t=>t.every(O),R=new WeakMap;function B(t){const e=[{},{}];return t?.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function L(t,e,n,s){if("function"==typeof e){const[r,i]=B(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]=B(s);e=e(void 0!==n?n:t.custom,r,i)}return e}const D=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],W={value:null,addProjectionMetrics:null};const I={};function j(t,e){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=D.reduce(((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,r=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},u=0;function l(e){o.has(e)&&(c.schedule(e),t()),u++,e(a)}const c={schedule:(t,e=!1,i=!1)=>{const a=i&&r?n:s;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{s.delete(t),o.delete(t)},process:t=>{a=t,r?i=!0:(r=!0,[n,s]=[s,n],n.forEach(l),e&&W.value&&W.value.frameloop[e].push(u),u=0,n.clear(),r=!1,i&&(i=!1,c.process(t)))}};return c}(i,e?n:void 0),t)),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:d,render:p,postRender:f}=o,m=()=>{const i=I.useManualTiming?r.timestamp:performance.now();n=!1,I.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(i-r.timestamp,40),1)),r.timestamp=i,r.isProcessing=!0,a.process(r),u.process(r),l.process(r),c.process(r),h.process(r),d.process(r),p.process(r),f.process(r),r.isProcessing=!1,n&&e&&(s=!1,t(m))};return{schedule:D.reduce(((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(n||(n=!0,s=!0,r.isProcessing||t(m)),a.schedule(e,i,o)),e}),{}),cancel:t=>{for(let e=0;et,{schedule:$,cancel:K,state:U,steps:Y}=j("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:N,!0);let X;function z(){X=void 0}const H={now:()=>(void 0===X&&H.set(U.isProcessing||I.useManualTiming?U.timestamp:performance.now()),X),set:t=>{X=t,queueMicrotask(z)}},q=new Set;function Z(t){return q.has(t)}function _(t,e,n){t||q.has(e)||(console.warn(e),n&&console.warn(n),q.add(e))}class G{constructor(){this.subscriptions=[]}add(t){return l(this.subscriptions,t),()=>c(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();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty();e&&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 G);const n=this.events[t].add(e);return"change"===t?()=>{n(),$.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()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return Q.current&&Q.current.push(this),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 J(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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function et(t,e){return new tt(t,e)}function nt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,et(n))}function st(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function rt(t,e){const n=function(t,e,n){const s=t.getProps();return L(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){nt(t,e,st(i[e]))}}function it(t,e){const n=t.getValue("willChange");if(s=n,Boolean(m(s)&&s.add))return n.add(e);if(!n&&I.WillChange){const n=new I.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}const ot=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),at="data-"+ot("framerAppearId");function ut(t){return t.props[at]}const lt=t=>null!==t;const ct=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ht=(()=>new Set(ct))(),dt={type:"spring",stiffness:500,damping:25,restSpeed:10},pt={type:"keyframes",duration:.8},ft={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mt=(t,{keyframes:e})=>e.length>2?pt:ht.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:dt:ft;function gt(t,e){return t?.[e]??t?.default??t}const yt={layout:0,mainThread:0,waapi:0},vt=t=>e=>"string"==typeof e&&e.startsWith(t),wt=vt("--"),bt=vt("var(--"),Tt=t=>!!bt(t)&&xt.test(t.split("/*")[0].trim()),xt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Mt=(t,e,n)=>n>e?e:n"number"==typeof t,parse:parseFloat,transform:t=>t},St={...At,transform:t=>Mt(0,1,t)},Vt={...At,default:1},kt=t=>Math.round(1e5*t)/1e5,Et=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Pt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ct=(t,e)=>n=>Boolean("string"==typeof n&&Pt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ot=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[r,i,o,a]=s.match(Et);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Ft={...At,transform:t=>Math.round((t=>Mt(0,255,t))(t))},Rt={test:Ct("rgb","red"),parse:Ot("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Ft.transform(t)+", "+Ft.transform(e)+", "+Ft.transform(n)+", "+kt(St.transform(s))+")"};const Bt={test:Ct("#"),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:Rt.transform},Lt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Dt=Lt("deg"),Wt=Lt("%"),It=Lt("px"),jt=Lt("vh"),Nt=Lt("vw"),$t=(()=>({...Wt,parse:t=>Wt.parse(t)/100,transform:t=>Wt.transform(100*t)}))(),Kt={test:Ct("hsl","hue"),parse:Ot("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Wt.transform(kt(e))+", "+Wt.transform(kt(n))+", "+kt(St.transform(s))+")"},Ut={test:t=>Rt.test(t)||Bt.test(t)||Kt.test(t),parse:t=>Rt.test(t)?Rt.parse(t):Kt.test(t)?Kt.parse(t):Bt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Rt.transform(t):Kt.transform(t)},Yt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Xt="number",zt="color",Ht=/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 qt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const o=e.replace(Ht,(t=>(Ut.test(t)?(s.color.push(i),r.push(zt),n.push(Ut.parse(t))):t.startsWith("var(")?(s.var.push(i),r.push("var"),n.push(t)):(s.number.push(i),r.push(Xt),n.push(parseFloat(t))),++i,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:r}}function Zt(t){return qt(t).values}function _t(t){const{split:e,types:n}=qt(t),s=e.length;return t=>{let r="";for(let i=0;i"number"==typeof t?0:t;const Jt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Et)?.length||0)+(t.match(Yt)?.length||0)>0},parse:Zt,createTransformer:_t,getAnimatableNone:function(t){const e=Zt(t);return _t(t)(e.map(Gt))}};function Qt(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 te({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=Qt(a,s,t+1/3),i=Qt(a,s,t),o=Qt(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}}function ee(t,e){return n=>n>0?e:t}const ne=(t,e,n)=>{const s=t*t,r=n*(e*e-s)+s;return r<0?0:Math.sqrt(r)},se=[Bt,Rt,Kt];function re(t){const e=(n=t,se.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Kt&&(s=te(s)),s}const ie=(t,e)=>{const n=re(t),s=re(e);if(!n||!s)return ee(t,e);const r={...n};return t=>(r.red=ne(n.red,s.red,t),r.green=ne(n.green,s.green,t),r.blue=ne(n.blue,s.blue,t),r.alpha=i(n.alpha,s.alpha,t),Rt.transform(r))},oe=new Set(["none","hidden"]);function ae(t,e){return oe.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}const ue=(t,e)=>n=>e(t(n)),le=(...t)=>t.reduce(ue);function ce(t,e){return n=>i(t,e,n)}function he(t){return"number"==typeof t?ce:"string"==typeof t?Tt(t)?ee:Ut.test(t)?ie:fe:Array.isArray(t)?de:"object"==typeof t?Ut.test(t)?ie:pe:ee}function de(t,e){const n=[...t],s=n.length,r=t.map(((t,n)=>he(t)(t,e[n])));return t=>{for(let e=0;e{for(const e in s)n[e]=s[e](t);return n}}const fe=(t,e)=>{const n=Jt.createTransformer(e),s=qt(t),r=qt(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?oe.has(t)&&!r.values.length||oe.has(e)&&!s.values.length?ae(t,e):le(de(function(t,e){const n=[],s={color:0,var:0,number:0};for(let r=0;r{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>$.update(e,t),stop:()=>K(e),now:()=>U.isProcessing?U.timestamp:H.now()}},ye=(t,e,n=10)=>{let s="";const r=Math.max(Math.round(e/n),2);for(let e=0;e{const s=e*o,r=s*t,i=s-n,a=Le(e,o),u=Math.exp(-r);return Fe-i/a*u},i=e=>{const s=e*o*t,i=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,u=Math.exp(-s),l=Le(Math.pow(e,2),o);return(-r(e)+Fe>0?-1:1)*((i-a)*u)/l}):(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;nvoid 0!==t[e]))}function je(t=Se,e=Ae){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:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:xe,stiffness:we,damping:be,mass:Te,isResolvedFromDuration:!1,...t};if(!Ie(t,We)&&Ie(t,De))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),r=s*s,i=2*Mt(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Te,stiffness:r,damping:i}}else{const n=Re(t);e={...e,...n,mass:Te},e.isResolvedFromDuration=!0}return e}({...n,velocity:-M(n.velocity||0)}),f=d||0,m=l/(2*Math.sqrt(u*c)),g=o-i,y=M(Math.sqrt(u/c)),v=Math.abs(g)<5;let w;if(s||(s=v?Ve.granular:Ve.default),r||(r=v?ke.granular:ke.default),m<1){const t=Le(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 A={calculatedDuration:p&&h||null,next:t=>{const e=w(t);if(p)a.done=t>=h;else{let n=0===t?f:0;m<1&&(n=0===t?x(f):ve(w,t,e));const i=Math.abs(n)<=s,u=Math.abs(o-e)<=r;a.done=i&&u}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(T(A),b),e=ye((e=>A.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return A}function Ne({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?u:void 0===u||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)<=l,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&eu)&&(b=t,T=je({keyframes:[d.value,p(d.value)],velocity:ve(v,t,d.value),damping:r,stiffness:i,restDelta:l,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)}}}function $e(t,e,{clamp:n=!0,ease:s,mixer:r}={}){const i=t.length;if(e.length,1===i)return()=>e[0];if(2===i&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const s=[],r=n||I.mix||me,i=t.length-1;for(let n=0;n{if(o&&n1)for(;sl(Mt(t[0],t[i-1],e)):l}function Ke(t,e){return t.map((t=>t*e))}je.applyToOptions=t=>{const e=A(t,100,je);return t.ease=e.ease,t.duration=x(e.duration),t.type="keyframes",t};const Ue=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Ye(t,e,n,s){if(t===e&&n===s)return N;const r=e=>function(t,e,n,s,r){let i,o,a=0;do{o=e+(n-e)/2,i=Ue(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:Ue(r(t),e,s)}const Xe=Ye(.42,0,1,1),ze=Ye(0,0,.58,1),He=Ye(.42,0,.58,1),qe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ze=t=>e=>1-t(1-e),_e=Ye(.33,1.53,.69,.99),Ge=Ze(_e),Je=qe(Ge),Qe=t=>(t*=2)<1?.5*Ge(t):.5*(2-Math.pow(2,-10*(t-1))),tn=t=>1-Math.sin(Math.acos(t)),en=Ze(tn),nn=qe(tn),sn=t=>Array.isArray(t)&&"number"==typeof t[0],rn={linear:N,easeIn:Xe,easeInOut:He,easeOut:ze,circIn:tn,circInOut:nn,circOut:en,backIn:Ge,backInOut:Je,backOut:_e,anticipate:Qe},on=t=>{if(sn(t)){t.length;const[e,n,s,r]=t;return Ye(e,n,s,r)}return"string"==typeof t?rn[t]:t};function an(t,e){return t.map((()=>e||He)).splice(0,t.length-1)}function un({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const r=a(s)?s.map(on):on(s),i={done:!1,value:e[0]},o=$e(Ke(n&&n.length===e.length?n:v(e),t),e,{ease:Array.isArray(r)?r:an(e,r)});return{calculatedDuration:t,next:e=>(i.value=o(e),i.done=e>=t,i)}}const ln=t=>null!==t;function cn(t,{repeat:e,repeatType:n="loop"},s,r=1){const i=t.filter(ln),o=r<0||e&&"loop"!==n&&e%2==1?0:i.length-1;return o&&void 0!==s?s:i[o]}const hn={decay:Ne,inertia:Ne,tween:un,keyframes:un,spring:je};function dn(t){"string"==typeof t.type&&(t.type=hn[t.type])}class pn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise((t=>{this.resolve=t}))}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const fn=t=>t/100;class mn extends pn{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==H.now()&&this.tick(H.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},yt.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;dn(t);const{type:e=un,repeat:n=0,repeatDelay:s=0,repeatType:r,velocity:i=0}=t;let{keyframes:o}=t;const a=e||un;a!==un&&"number"!=typeof o[0]&&(this.mixKeyframes=le(fn,me(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===r&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-i})),null===u.calculatedDuration&&(u.calculatedDuration=T(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:s,mixKeyframes:r,mirroredGenerator:i,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:l,repeat:c,repeatType:h,repeatDelay:d,type:p,onUpdate:f,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let v=this.currentTime,w=n;if(c){const t=Math.min(this.currentTime,s)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(w=i)),v=Mt(0,1,n)*o}const b=y?{done:!1,value:l[0]}:w.next(v);r&&(b.value=r(b.value));let{done:T}=b;y||null===a||(T=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&p!==Ne&&(b.value=cn(l,this.options,m,this.speed)),f&&f(b.value),x&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return M(this.calculatedDuration)}get time(){return M(this.currentTime)}set time(t){t=x(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(H.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=M(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ge,startTime:e}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(H.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,yt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function gn(t){return new mn(t)}function yn(t){for(let e=1;e180*t/Math.PI,wn=t=>{const e=vn(Math.atan2(t[1],t[0]));return Tn(e)},bn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:wn,rotateZ:wn,skewX:t=>vn(Math.atan(t[1])),skewY:t=>vn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Tn=t=>((t%=360)<0&&(t+=360),t),xn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Mn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),An={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:xn,scaleY:Mn,scale:t=>(xn(t)+Mn(t))/2,rotateX:t=>Tn(vn(Math.atan2(t[6],t[5]))),rotateY:t=>Tn(vn(Math.atan2(-t[2],t[0]))),rotateZ:wn,rotate:wn,skewX:t=>vn(Math.atan(t[4])),skewY:t=>vn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Sn(t){return t.includes("scale")?1:0}function Vn(t,e){if(!t||"none"===t)return Sn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=An,r=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=bn,r=e}if(!r)return Sn(e);const i=s[e],o=r[1].split(",").map(En);return"function"==typeof i?i(o):o[i]}const kn=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Vn(n,e)};function En(t){return parseFloat(t.trim())}const Pn=t=>t===At||t===It,Cn=new Set(["x","y","z"]),On=ct.filter((t=>!Cn.has(t)));const Fn={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})=>Vn(e,"x"),y:(t,{transform:e})=>Vn(e,"y")};Fn.translateX=Fn.x,Fn.translateY=Fn.y;const Rn=new Set;let Bn=!1,Ln=!1,Dn=!1;function Wn(){if(Ln){const t=Array.from(Rn).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 On.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)}))}Ln=!1,Bn=!1,Rn.forEach((t=>t.complete(Dn))),Rn.clear()}function In(){Rn.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Ln=!0)}))}function jn(){Dn=!0,In(),Wn(),Dn=!1}class Nn{constructor(t,e,n,s,r,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=r,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Rn.add(this),Bn||(Bn=!0,$.read(In),$.resolveKeyframes(Wn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const r=s?.get(),i=t[t.length-1];if(void 0!==r)t[0]=r;else if(n&&e){const s=n.readValue(e,i);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=i),s&&void 0===r&&s.set(t[0])}yn(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Rn.delete(this)}cancel(){"scheduled"===this.state&&(Rn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const $n=t=>t.startsWith("--");function Kn(t,e,n){$n(e)?t.style.setProperty(e,n):t.style[e]=n}function Un(t){let e;return()=>(void 0===e&&(e=t()),e)}const Yn=Un((()=>void 0!==window.ScrollTimeline)),Xn={};function zn(t,e){const n=Un(t);return()=>Xn[e]??n()}const Hn=zn((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),qn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Zn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qn([0,.65,.55,1]),circOut:qn([.55,0,1,.45]),backIn:qn([.31,.01,.66,-.59]),backOut:qn([.33,1.53,.69,.99])};function _n(t,e){return t?"function"==typeof t?Hn()?ye(t,e):"ease-out":sn(t)?qn(t):Array.isArray(t)?t.map((t=>_n(t,e)||Zn.easeOut)):Zn[t]:void 0}function Gn(t,e,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){const c={[e]:n};u&&(c.offset=u);const h=_n(a,r);Array.isArray(h)&&(c.easing=h),W.value&&yt.waapi++;const d={delay:s,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:"reverse"===o?"alternate":"normal"};l&&(d.pseudoElement=l);const p=t.animate(c,d);return W.value&&p.finished.finally((()=>{yt.waapi--})),p}function Jn({type:t,...e}){return w(t)&&Hn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Qn extends pn{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:i=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=i,this.options=t,t.type;const u=Jn(t);this.animation=Gn(e,n,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=cn(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):Kn(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return M(Number(t))}get time(){return M(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=x(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Yn()?(this.animation.timeline=t,N):e(this)}}const ts={anticipate:Qe,backInOut:Je,circInOut:nn};function es(t){"string"==typeof t.ease&&t.ease in ts&&(t.ease=ts[t.ease])}class ns extends Qn{constructor(t){es(t),dn(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:r,...i}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new mn({...i,autoplay:!1}),a=x(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const ss=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Jt.test(t)&&"0"!==t||t.startsWith("url(")));function rs(t){return"object"==typeof t&&null!==t}function is(t){return rs(t)&&"offsetHeight"in t}const os=new Set(["opacity","clipPath","filter","transform"]),as=Un((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));function us(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=t;if(!is(e?.owner?.current))return!1;const{onUpdate:a,transformTemplate:u}=e.owner.getProps();return as()&&n&&os.has(n)&&("transform"!==n||!u)&&!a&&!s&&"mirror"!==r&&0!==i&&"inertia"!==o}class ls extends pn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:i="loop",keyframes:o,name:a,motionValue:u,element:l,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=H.now();const h={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:r,repeatType:i,name:a,motionValue:u,element:l,...c},d=l?.KeyframeResolver||Nn;this.keyframeResolver=new d(o,((t,e,n)=>this.onKeyframesResolved(t,e,h,!n)),a,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,s){this.keyframeResolver=void 0;const{name:r,type:i,velocity:o,delay:a,isHandoff:u,onUpdate:l}=n;this.resolvedAt=H.now(),function(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=ss(r,e),a=ss(i,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},h=!u&&us(c)?new ns({...c,element:c.motionValue.owner.current}):new mn(c);h.finished.then((()=>this.notifyFinished())).catch(N),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then((()=>{}))}get animation(){return this._animation||(this.keyframeResolver?.resume(),jn()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const cs=(t,e,n,s={},r,i)=>o=>{const a=gt(s,t)||{},u=a.delay||s.delay||0;let{elapsed:l=0}=s;l-=x(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:i?void 0:r};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return!!Object.keys(c).length})(a)||Object.assign(c,mt(t,c)),c.duration&&(c.duration=x(c.duration)),c.repeatDelay&&(c.repeatDelay=x(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(h=!0)),(I.instantAnimations||I.skipAnimations)&&(h=!0,c.duration=0,c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!i&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(lt),i=e&&"loop"!==n&&e%2==1?0:r.length-1;return i&&void 0!==s?s:r[i]}(c.keyframes,a);if(void 0!==t)return void $.update((()=>{c.onUpdate(t),c.onComplete()}))}return a.isSync?new mn(c):new ls(c)},hs=new Set(["width","height","top","left","right","bottom",...ct]);function ds({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function ps(t,e,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(i=s);const u=[],l=r&&t.animationState&&t.animationState.getState()[r];for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),r=a[e];if(void 0===r||l&&ds(l,e))continue;const o={delay:n,...gt(i||{},e)},c=s.get();if(void 0!==c&&!s.isAnimating&&!Array.isArray(r)&&r===c&&!o.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const n=ut(t);if(n){const t=window.MotionHandoffAnimation(n,e,$);null!==t&&(o.startTime=t,h=!0)}}it(t,e),s.start(cs(e,s,r,t.shouldReduceMotion&&hs.has(e)?{type:!1}:o,t,h));const d=s.animation;d&&u.push(d)}return o&&Promise.all(u).then((()=>{$.update((()=>{o&&rt(t,o)}))})),u}const fs={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"]},ms={};for(const t in fs)ms[t]={isEnabled:e=>fs[t].some((t=>!!e[t]))};const gs=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ys="undefined"!=typeof window,vs={current:null},ws={current:!1};const bs=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function Ts(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||bs.some((e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e])));var e}const xs=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Ms=t=>/^0[^.\s]+$/u.test(t),As=t=>e=>e.test(t),Ss=[At,It,Wt,Dt,Nt,jt,{test:t=>"auto"===t,parse:t=>t}],Vs=t=>Ss.find(As(t)),ks=[...Ss,Ut,Jt],Es=t=>ks.find(As(t)),Ps=new Set(["brightness","contrast","saturate","opacity"]);function Cs(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(Et)||[];if(!s)return t;const r=n.replace(s,"");let i=Ps.has(e)?1:0;return s!==n&&(i*=100),e+"("+i+r+")"}const Os=/\b([a-z-]*)\(.*?\)/gu,Fs={...Jt,getAnimatableNone:t=>{const e=t.match(Os);return e?e.map(Cs).join(" "):t}},Rs={...At,transform:Math.round},Bs={rotate:Dt,rotateX:Dt,rotateY:Dt,rotateZ:Dt,scale:Vt,scaleX:Vt,scaleY:Vt,scaleZ:Vt,skew:Dt,skewX:Dt,skewY:Dt,distance:It,translateX:It,translateY:It,translateZ:It,x:It,y:It,z:It,perspective:It,transformPerspective:It,opacity:St,originX:$t,originY:$t,originZ:It},Ls={borderWidth:It,borderTopWidth:It,borderRightWidth:It,borderBottomWidth:It,borderLeftWidth:It,borderRadius:It,radius:It,borderTopLeftRadius:It,borderTopRightRadius:It,borderBottomRightRadius:It,borderBottomLeftRadius:It,width:It,maxWidth:It,height:It,maxHeight:It,top:It,right:It,bottom:It,left:It,padding:It,paddingTop:It,paddingRight:It,paddingBottom:It,paddingLeft:It,margin:It,marginTop:It,marginRight:It,marginBottom:It,marginLeft:It,backgroundPositionX:It,backgroundPositionY:It,...Bs,zIndex:Rs,fillOpacity:St,strokeOpacity:St,numOctaves:Rs},Ds={...Ls,color:Ut,backgroundColor:Ut,outlineColor:Ut,fill:Ut,stroke:Ut,borderColor:Ut,borderTopColor:Ut,borderRightColor:Ut,borderBottomColor:Ut,borderLeftColor:Ut,filter:Fs,WebkitFilter:Fs},Ws=t=>Ds[t];function Is(t,e){let n=Ws(t);return n!==Fs&&(n=Jt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const js=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ns{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Nn,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))),ws.current||function(){if(ws.current=!0,ys)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>vs.current=t.matches;t.addListener(e),e()}else vs.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||vs.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),K(this.notifyUpdate),K(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=ht.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&$.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),r=e.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{s(),r(),i&&i(),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 ms){const e=ms[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=et(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];return null!=n&&("string"==typeof n&&(xs(n)||Ms(n))?n=parseFloat(n):!Es(n)&&Jt.test(e)&&(n=Is(t,e)),this.setBaseTarget(t,m(n)?n.get():n)),m(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=L(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||m(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 G),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}const $s=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ks(t){const e=$s.exec(t);if(!e)return[,];const[,n,s,r]=e;return[`--${n??s}`,r]}function Us(t,e,n=1){const[s,r]=Ks(t);if(!s)return;const i=window.getComputedStyle(e).getPropertyValue(s);if(i){const t=i.trim();return xs(t)?parseFloat(t):t}return Tt(r)?Us(r,e,n+1):r}const Ys=new Set(["auto","none","0"]);class Xs extends Nn{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()}}class zs extends Ns{constructor(){super(...arguments),this.KeyframeResolver=Xs}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;m(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}const Hs=(t,e)=>e&&"number"==typeof t?e.transform(t):t,qs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Zs=ct.length;function _s(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(ht.has(t))o=!0;else if(wt(t))r[t]=n;else{const e=Hs(n,Ls[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{const c=P(t),{delay:h=0,times:f=v(c),type:m="keyframes",repeat:g,repeatType:b,repeatDelay:T=0,...M}=n;let{ease:k=e.ease||"easeOut",duration:E}=n;const C="function"==typeof h?h(i,o):h,O=c.length,B=w(m)?m:a?.[m];if(O<=2&&B){let t=100;if(2===O&&F(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...M};void 0!==E&&(e.duration=x(E));const n=A(e,t,B);k=n.ease,E=n.duration}E??(E=l);const L=S+C;1===f.length&&0===f[0]&&(f[1]=1);const D=f.length-c.length;if(D>0&&y(f,D),1===c.length&&c.unshift(null),g){E=s(E,g);const t=[...c],e=[...f];k=Array.isArray(k)?[...k]:[k];const n=[...k];for(let s=0;s{for(const s in t){const r=t[s];r.sort(f);const o=[],a=[],u=[];for(let t=0;t{o.push(...dr(n,t,e))})),o}class fr{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;ne.attachTimeline(t)));return()=>{e.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 state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;ee[t]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class mr extends fr{then(t,e){return this.finished.finally(t).then((()=>{}))}}function gr(t){return function(e,n,s){let r=[];var i;i=e,r=Array.isArray(i)&&i.some(Array.isArray)?pr(e,n,t):dr(e,n,s,t);const o=new mr(r);return t&&t.animations.push(o),o}}const yr=gr(),vr=new WeakMap,wr=(t,e="")=>`${t}:${e}`;function br(t){const e=vr.get(t)||new Map;return vr.set(t,e),e}function Tr(t,e){const n=window.getComputedStyle(t);return $n(e)?n.getPropertyValue(e):n[e]}const xr=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"]);function Mr(t,e){for(let n=0;nfunction(n,s,r){return new mr(function(t,n,s,r){const i=e(t,r),o=i.length,a=[];for(let t=0;te.delete(n))),u.push(r)}return u}(n,s,r,t))},Sr=Ar(),Vr={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function kr(t,e,n,s){const r=n[e],{length:i,position:o}=Vr[e],a=r.current,u=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=g(0,r.scrollLength,r.current);const l=s-u;r.velocity=l>50?0:J(r.current-a,l)}const Er={start:0,center:.5,end:1};function Pr(t,e,n=0){let s=0;if(t in Er&&(t=Er[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 Cr=[0,0];function Or(t,e,n,s){let r=Array.isArray(t)?t:Cr,i=0,o=0;return"number"==typeof t?r=[t,t]:"string"==typeof t&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,Er[t]?t:"0"]),i=Pr(r[0],n,s),o=Pr(r[1],e),i-o}const Fr={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Rr={x:0,y:0};function Br(t,e,n){const{offset:s=Fr.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(is(s))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):Rr,u=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),l={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const h=s.length;for(let t=0;t{!function(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),function(t,e,n){kr(t,"x",e,n),kr(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&Br(t,n,s)},notify:()=>e(n)}}const Dr=new WeakMap;let Wr;const Ir=(t,e,n)=>(s,r)=>r&&r[0]?r[0][t+"Size"]:ur(s)&&"getBBox"in s?s.getBBox()[e]:s[n],jr=Ir("inline","width","offsetWidth"),Nr=Ir("block","height","offsetHeight");function $r({target:t,borderBoxSize:e}){Dr.get(t)?.forEach((n=>{n(t,{get width(){return jr(t,e)},get height(){return Nr(t,e)}})}))}function Kr(t){t.forEach($r)}function Ur(t,n){Wr||"undefined"!=typeof ResizeObserver&&(Wr=new ResizeObserver(Kr));const s=e(t);return s.forEach((t=>{let e=Dr.get(t);e||(e=new Set,Dr.set(t,e)),e.add(n),Wr?.observe(t)})),()=>{s.forEach((t=>{const e=Dr.get(t);e?.delete(n),e?.size||Wr?.unobserve(t)}))}}const Yr=new Set;let Xr;function zr(t){return Yr.add(t),Xr||(Xr=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yr.forEach((e=>e(t)))},window.addEventListener("resize",Xr)),()=>{Yr.delete(t),Yr.size||"function"!=typeof Xr||(window.removeEventListener("resize",Xr),Xr=void 0)}}function Hr(t,e){return"function"==typeof t?zr(t):Ur(t,e)}const qr=new WeakMap,Zr=new WeakMap,_r=new WeakMap,Gr=t=>t===document.scrollingElement?window:t;function Jr(t,{container:e=document.scrollingElement,...n}={}){if(!e)return N;let s=_r.get(e);s||(s=new Set,_r.set(e,s));const r=Lr(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),!qr.has(e)){const t=()=>{for(const t of s)t.measure(U.timestamp);$.preUpdate(n)},n=()=>{for(const t of s)t.notify()},r=()=>$.read(t);qr.set(e,r);const i=Gr(e);window.addEventListener("resize",r,{passive:!0}),e!==document.documentElement&&Zr.set(e,Hr(e,r)),i.addEventListener("scroll",r,{passive:!0}),r()}const i=qr.get(e);return $.read(i,!1,!0),()=>{K(i);const t=_r.get(e);if(!t)return;if(t.delete(r),t.size)return;const n=qr.get(e);qr.delete(e),n&&(Gr(e).removeEventListener("scroll",n),Zr.get(e)?.(),window.removeEventListener("resize",n))}}const Qr=new Map;function ti({source:t,container:e,...n}){const{axis:s}=n;t&&(e=t);const r=Qr.get(e)??new Map;Qr.set(e,r);const i=n.target??"self",o=r.get(i)??{},a=s+(n.offset??[]).join(",");return o[a]||(o[a]=!n.target&&Yn()?new ScrollTimeline({source:e,axis:s}):function(t){const e={value:0},n=Jr((n=>{e.value=100*n[t.axis].progress}),t);return{currentTime:e,cancel:n}}({container:e,...n})),o[a]}function ei(t,e){let n;const s=()=>{const{currentTime:s}=e,r=(null===s?0:s.value)/100;n!==r&&t(r),n=r};return $.preUpdate(s,!0),()=>K(s)}function ni(t,{axis:e="y",container:n=document.scrollingElement,...s}={}){if(!n)return N;const r={axis:e,container:n,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?Jr((n=>{t(n[e.axis].progress,n)}),e):ei(t,ti(e))}(t,r):function(t,e){const n=ti(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:t=>(t.pause(),ei((e=>{t.time=t.duration*e}),n))})}(t,r)}const si={some:0,all:1};function ri(t,n,{root:s,margin:r,amount:i="some"}={}){const o=e(t),a=new WeakMap,u=new IntersectionObserver((t=>{t.forEach((t=>{const e=a.get(t.target);if(t.isIntersecting!==Boolean(e))if(t.isIntersecting){const e=n(t.target,t);"function"==typeof e?a.set(t.target,e):u.unobserve(t.target)}else"function"==typeof e&&(e(t),a.delete(t.target))}))}),{root:s,rootMargin:r,threshold:"number"==typeof i?i:si[i]});return o.forEach((t=>u.observe(t))),()=>u.disconnect()}function ii(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 u=t*a;if(s){const e=i*t;u=on(s)(u/e)*e}return e+u}}function oi(t,e){return function(t,e){const n=H.now(),s=({timestamp:r})=>{const i=r-n;i>=e&&(K(s),t(i-e))};return $.setup(s,!0),()=>K(s)}(t,x(e))}const ai=(t,e)=>Math.abs(t-e);function ui(t,e){const n=ai(t.x,e.x),s=ai(t.y,e.y);return Math.sqrt(n**2+s**2)}class li extends Qn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}function ci(t){return Boolean("function"==typeof t&&Hn()||!t||"string"==typeof t&&(t in Zn||Hn())||sn(t)||Array.isArray(t)&&t.every(ci))}const hi=Un((()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0})),di=new Set(["opacity","clipPath","filter","transform"]);function pi(t){return(n,s)=>{const r=e(n),i=[];for(const e of r){const n=t(e,s);i.push(n)}return()=>{for(const t of i)t()}}}class fi{constructor(){this.latest={},this.values=new Map}set(t,e,n,s,r=!0){const i=this.values.get(t);i&&i.onRemove();const o=()=>{const s=e.get();this.latest[t]=r?Hs(s,Ls[t]):s,n&&$.render(n)};o();const a=e.on("change",o);s&&e.addDependent(s);const u=()=>{a(),n&&K(n),this.values.delete(t),s&&e.removeDependent(s)};return this.values.set(t,{value:e,onRemove:u}),u}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function mi(t){const e=new WeakMap,n=[];return(s,r)=>{const i=e.get(s)??new fi;e.set(s,i);for(const e in r){const o=r[e],a=t(s,i,e,o);n.push(a)}return()=>{for(const t of n)t()}}}const gi=(t,e,n,s)=>{const r=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),i=r?n:n.startsWith("data")||n.startsWith("aria")?n.replace(/([A-Z])/g,(t=>`-${t.toLowerCase()}`)):n;const o=r?()=>{t[i]=e.latest[n]}:()=>{const s=e.latest[n];null==s?t.removeAttribute(i):t.setAttribute(i,String(s))};return e.set(n,s,o)},yi=pi(mi(gi)),vi=mi(((t,e,n,s)=>e.set(n,s,(()=>{t[n]=e.latest[n]}),void 0,!1))),wi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const bi=new Set(["originX","originY","originZ"]),Ti=(t,e,n,s)=>{let r,i;return ht.has(n)?(e.get("transform")||(is(t)||e.get("transformBox")||Ti(t,e,"transformBox",new tt("fill-box")),e.set("transform",new tt("none"),(()=>{t.style.transform=function(t){let e="",n=!0;for(let s=0;s{const n=e.latest.originX??"50%",s=e.latest.originY??"50%",r=e.latest.originZ??0;t.style.transformOrigin=`${n} ${s} ${r}`})),i=e.get("transformOrigin")):r=$n(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,s,r,i)},xi=pi(mi(Ti)),Mi=It.transform;const Ai=pi(mi(((t,e,n,s)=>{if(n.startsWith("path"))return function(t,e,n,s){return $.render((()=>t.setAttribute("pathLength","1"))),"pathOffset"===n?e.set(n,s,(()=>t.setAttribute("stroke-dashoffset",Mi(-e.latest[n])))):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new tt("1 1"),(()=>{const{pathLength:n=1,pathSpacing:s}=e.latest;t.setAttribute("stroke-dasharray",`${Mi(n)} ${Mi(s??1-Number(n))}`)})),e.set(n,s,void 0,e.get("stroke-dasharray")))}(t,e,n,s);if(n.startsWith("attr"))return gi(t,e,function(t){return t.replace(/^attr([A-Z])/,((t,e)=>e.toLowerCase()))}(n),s);return(n in t.style?Ti:gi)(t,e,n,s)})));const{schedule:Si,cancel:Vi}=j(queueMicrotask,!1),ki={x:!1,y:!1};function Ei(){return ki.x||ki.y}function Pi(t){return"x"===t||"y"===t?ki[t]?null:(ki[t]=!0,()=>{ki[t]=!1}):ki.x||ki.y?null:(ki.x=ki.y=!0,()=>{ki.x=ki.y=!1})}function Ci(t,n){const s=e(t),r=new AbortController;return[s,{passive:!0,...n,signal:r.signal},()=>r.abort()]}function Oi(t){return!("touch"===t.pointerType||Ei())}function Fi(t,e,n={}){const[s,r,i]=Ci(t,n),o=t=>{if(!Oi(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const i=t=>{Oi(t)&&(s(t),n.removeEventListener("pointerleave",i))};n.addEventListener("pointerleave",i,r)};return s.forEach((t=>{t.addEventListener("pointerenter",o,r)})),i}const Ri=(t,e)=>!!e&&(t===e||Ri(t,e.parentElement)),Bi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Li=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Di=new WeakSet;function Wi(t){return e=>{"Enter"===e.key&&t(e)}}function Ii(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function ji(t){return Bi(t)&&!Ei()}function Ni(t,e,n={}){const[s,r,i]=Ci(t,n),o=t=>{const s=t.currentTarget;if(!ji(t))return;Di.add(s);const i=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),Di.has(s)&&Di.delete(s),ji(t)&&"function"==typeof i&&i(t,{success:e})},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||Ri(s,t.target))},u=t=>{o(t,!1)};window.addEventListener("pointerup",a,r),window.addEventListener("pointercancel",u,r)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,r),is(t)&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=Wi((()=>{if(Di.has(n))return;Ii(n,"down");const t=Wi((()=>{Ii(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>Ii(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,r))),e=t,Li.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),i}function $i(){const{value:t}=W;null!==t?(t.frameloop.rate.push(U.delta),t.animations.mainThread.push(yt.mainThread),t.animations.waapi.push(yt.waapi),t.animations.layout.push(yt.layout)):K($i)}function Ki(t){return t.reduce(((t,e)=>t+e),0)/t.length}function Ui(t,e=Ki){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const Yi=t=>Math.round(1e3/t);function Xi(){W.value=null,W.addProjectionMetrics=null}function zi(){const{value:t}=W;if(!t)throw new Error("Stats are not being measured");Xi(),K($i);const e={frameloop:{setup:Ui(t.frameloop.setup),rate:Ui(t.frameloop.rate),read:Ui(t.frameloop.read),resolveKeyframes:Ui(t.frameloop.resolveKeyframes),preUpdate:Ui(t.frameloop.preUpdate),update:Ui(t.frameloop.update),preRender:Ui(t.frameloop.preRender),render:Ui(t.frameloop.render),postRender:Ui(t.frameloop.postRender)},animations:{mainThread:Ui(t.animations.mainThread),waapi:Ui(t.animations.waapi),layout:Ui(t.animations.layout)},layoutProjection:{nodes:Ui(t.layoutProjection.nodes),calculatedTargetDeltas:Ui(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:Ui(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=Yi(n.min),n.max=Yi(n.max),n.avg=Yi(n.avg),[n.min,n.max]=[n.max,n.min],e}function Hi(){if(W.value)throw Xi(),new Error("Stats are already being measured");const t=W;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},$.postRender($i,!0),zi}function qi(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],r=$e(t[1+n],t[2+n],t[3+n]);return e?r(s):r}function Zi(t){const e=[];Q.current=e;const n=t();Q.current=void 0;const s=et(n);return function(t,e,n){const s=()=>e.set(n()),r=()=>$.preRender(s,!1,!0),i=t.map((t=>t.on("change",r)));e.on("destroy",(()=>{i.forEach((t=>t())),K(s)}))}(e,s,t),s}function _i(t,e,n,s){const r=qi(e,n,s);return Zi((()=>r(t.get())))}function Gi(t,e){const n=et(m(t)?t.get():t);return Ji(n,t,e),n}function Ji(t,e,n){const s=t.get();let r,i=null,o=s;const a="string"==typeof s?s.replace(/[\d.-]/g,""):void 0,u=()=>{i&&(i.stop(),i=null)},l=()=>{u(),i=new mn({keyframes:[to(t.get()),to(o)],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:r})};let c;return t.attach(((e,n)=>(o=e,r=t=>n(Qi(t,a)),$.postRender(l),t.get())),u),m(e)&&(c=e.on("change",(e=>t.set(Qi(e,a)))),t.on("destroy",c)),c}function Qi(t,e){return e?t+e:t}function to(t){return"number"==typeof t?t:parseFloat(t)}function eo(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let no={},so=null;const ro=(t,e)=>{no[t]=e},io=()=>{so||(so=document.createElement("style"),so.id="motion-view");let t="";for(const e in no){const n=no[e];t+=`${e} {\n`;for(const[e,s]of Object.entries(n))t+=` ${e}: ${s};\n`;t+="}\n"}so.textContent=t,document.head.appendChild(so),no={}},oo=()=>{so&&so.parentElement&&so.parentElement.removeChild(so)};function ao(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function uo(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}const lo=["layout","enter","exit","new","old"];function co(t){const{update:e,targets:n,options:s}=t;if(!document.startViewTransition)return new Promise((async t=>{await e(),t(new fr([]))}));(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||ro(":root",{"view-transition-name":"none"}),ro("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),io();const r=document.startViewTransition((async()=>{await e()}));return r.finished.finally((()=>{oo()})),new Promise((t=>{r.ready.then((()=>{const e=document.getAnimations().filter(uo),r=[];n.forEach(((t,e)=>{for(const n of lo){if(!t[n])continue;const{keyframes:i,options:o}=t[n];for(let[t,a]of Object.entries(i)){if(!a)continue;const i={...gt(s,t),...gt(o,t)},u=eo(n);if("opacity"===t&&!Array.isArray(a)){a=["new"===u?0:1,a]}"function"==typeof i.delay&&(i.delay=i.delay(0,1)),i.duration&&(i.duration=x(i.duration)),i.delay&&(i.delay=x(i.delay));const l=new Qn({...i,element:document.documentElement,name:t,pseudoElement:`::view-transition-${u}(${e})`,keyframes:a});r.push(l)}}}));for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:i}=e;if(!i)continue;const o=ao(i);if(!o)continue;const a=n.get(o.layer);if(a)ho(a,"enter")&&ho(a,"exit")&&e.getKeyframes().some((t=>t.mixBlendMode))?r.push(new li(t)):t.cancel();else{const n="group"===o.type?"layout":"";let i={...gt(s,n)};i.duration&&(i.duration=x(i.duration)),i=Jn(i);const a=_n(i.ease,i.duration);e.updateTiming({delay:x(i.delay??0),duration:i.duration,easing:a}),r.push(new li(t))}}t(new fr(r))}))}))}function ho(t,e){return t?.[e]?.keyframes.opacity}let po=[],fo=null;function mo(){fo=null;const[t]=po;var e;t&&(c(po,e=t),fo=e,co(e).then((t=>{e.notifyReady(t),t.finished.finally(mo)})))}function go(){for(let t=po.length-1;t>=0;t--){const e=po[t],{interrupt:n}=e.options;if("immediate"===n){const n=po.slice(0,t+1).map((t=>t.update)),s=po.slice(t+1);e.update=()=>{n.forEach((t=>t()))},po=[e,...s];break}}fo&&"immediate"!==po[0]?.options.interrupt||mo()}class yo{constructor(t,e={}){var n;this.currentTarget="root",this.targets=new Map,this.notifyReady=N,this.readyPromise=new Promise((t=>{this.notifyReady=t})),this.update=t,this.options={interrupt:"wait",...e},n=this,po.push(n),Si.render(go)}get(t){return this.currentTarget=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentTarget:s,targets:r}=this;r.has(s)||r.set(s,{});r.get(s)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}function vo(t,e={}){return new yo(t,e)}const wo=$,bo=D.reduce(((t,e)=>(t[e]=t=>K(t),t)),{});function To(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 Mt(0,1,r/t)}}export{ls as AsyncMotionValueAnimation,Xs as DOMKeyframesResolver,fr as GroupAnimation,mr as GroupAnimationWithThen,mn as JSAnimation,Nn as KeyframeResolver,I as MotionGlobalConfig,tt as MotionValue,Qn as NativeAnimation,ns as NativeAnimationExtended,li as NativeAnimationWrapper,G as SubscriptionManager,yo as ViewTransitionBuilder,di as acceleratedValues,yt as activeAnimations,gi as addAttrValue,Ti as addStyleValue,l as addUniqueItem,St as alpha,qt as analyseComplexValue,yr as animate,Sr as animateMini,gn as animateValue,vo as animateView,wr as animationMapKey,Qe as anticipate,Mr as applyPxDefaults,Ji as attachSpring,yi as attrEffect,Ge as backIn,Je as backInOut,_e as backOut,T as calcGeneratorDuration,K as cancelFrame,Vi as cancelMicrotask,bo as cancelSync,tn as circIn,nn as circInOut,en as circOut,Mt as clamp,Q as collectMotionValues,Ut as color,Jt as complex,Ke as convertOffsetToTimes,A as createGeneratorEasing,j as createRenderBatcher,gr as createScopedAnimate,Ye as cubicBezier,qn as cubicBezierAsString,an as defaultEasing,v as defaultOffset,Sn as defaultTransformValue,Ds as defaultValueTypes,Dt as degrees,oi as delay,Ss as dimensionValueTypes,ai as distance,ui as distance2D,Xe as easeIn,He as easeInOut,ze as easeOut,on as easingDefinitionToFunction,y as fillOffset,yn as fillWildcards,Vs as findDimensionValueType,Es as findValueType,jn as flushKeyframeResolvers,$ as frame,U as frameData,Y as frameSteps,ye as generateLinearEasing,Is as getAnimatableNone,br as getAnimationMap,Tr as getComputedStyle,Ws as getDefaultValueType,u as getEasingForSegment,he as getMixer,Hs as getValueAsType,gt as getValueTransition,Us as getVariableValue,Z as hasWarned,Bt as hex,Fi as hover,Kt as hsla,te as hslaToRgba,ri as inView,Ne as inertia,$e as interpolate,V as invariant,oe as invisibleValues,sn as isBezierDefinition,wt as isCSSVariableName,Tt as isCSSVariableToken,Ei as isDragActive,ki as isDragging,a as isEasingArray,w as isGenerator,is as isHTMLElement,m as isMotionValue,Ri as isNodeOrChild,xs as isNumericalString,rs as isObject,Bi as isPrimaryPointer,ur as isSVGElement,lr as isSVGSVGElement,ci as isWaapiSupportedEasing,Ms as isZeroValueString,un as keyframes,_n as mapEasingToNativeEasing,_i as mapValue,b as maxGeneratorDuration,Un as memo,Si as microtask,M as millisecondsToSeconds,qe as mirrorEasing,me as mix,de as mixArray,ie as mixColor,fe as mixComplex,ee as mixImmediate,ne as mixLinearColor,i as mixNumber,pe as mixObject,ae as mixVisibility,et as motionValue,h as moveItem,N as noop,At as number,Ls as numberValueTypes,ei as observeTimeline,Ks as parseCSSVariable,Vn as parseValueFromTransform,Wt as percent,le as pipe,hs as positionalKeys,Ni as press,g as progress,$t as progressPercentage,vi as propEffect,It as px,kn as readTransformValue,Hi as recordStats,c as removeItem,Hr as resize,e as resolveElements,Ze as reverseEasing,Ft as rgbUnit,Rt as rgba,Vt as scale,ni as scroll,Jr as scrollInfo,x as secondsToMilliseconds,Pi as setDragLock,Kn as setStyle,je as spring,Gi as springValue,ii as stagger,Gn as startWaapiAnimation,W as statsBuffer,To as steps,xi as styleEffect,Zn as supportedWaapiEasing,us as supportsBrowserAnimation,Xn as supportsFlags,Hn as supportsLinearEasing,hi as supportsPartialKeyframes,Yn as supportsScrollTimeline,Ai as svgEffect,wo as sync,As as testValueType,H as time,qi as transform,ct as transformPropOrder,ht as transformProps,Zi as transformValue,Bs as transformValueTypes,J as velocityPerSecond,jt as vh,Nt as vw,_ as warnOnce,S as warning,o as wrap};export default null; \ No newline at end of file diff --git a/src/zen/workspaces/ZenGradientGenerator.mjs b/src/zen/workspaces/ZenGradientGenerator.mjs index 39d52b2b..8a6745ca 100644 --- a/src/zen/workspaces/ZenGradientGenerator.mjs +++ b/src/zen/workspaces/ZenGradientGenerator.mjs @@ -76,13 +76,13 @@ } openThemePicker(event) { - const target = event.explicitOriginalTarget?.classList?.contains( + const position = event.explicitOriginalTarget?.classList?.contains( 'zen-workspace-creation-edit-theme-button' ) - ? event.explicitOriginalTarget - : this.toolbox; - PanelMultiView.openPopup(this.panel, target, { - position: 'bottomright topright', + ? 'end_before' + : 'topright topleft'; + PanelMultiView.openPopup(this.panel, this.toolbox, { + position, triggerEvent: event, }); } diff --git a/src/zen/workspaces/ZenWorkspaceCreation.mjs b/src/zen/workspaces/ZenWorkspaceCreation.mjs index 7ab31465..e3d2c82f 100644 --- a/src/zen/workspaces/ZenWorkspaceCreation.mjs +++ b/src/zen/workspaces/ZenWorkspaceCreation.mjs @@ -59,6 +59,18 @@ return this.getAttribute('workspace-id'); } + get elementsToAnimate() { + return [ + this.querySelector('.zen-workspace-creation-title'), + this.querySelector('.zen-workspace-creation-label'), + this.querySelector('.zen-workspace-creation-name-wrapper'), + this.querySelector('.zen-workspace-creation-profile-wrapper'), + this.querySelector('.zen-workspace-creation-edit-theme-button'), + this.createButton, + this.cancelButton, + ]; + } + connectedCallback() { if (this.delayConnectedCallback()) { // If we are not ready yet, or if we have already connected, we @@ -71,6 +83,16 @@ this.appendChild(this.constructor.fragment); this.initializeAttributeInheritance(); + this.inputName = this.querySelector('.zen-workspace-creation-name'); + this.inputIcon = this.querySelector('.zen-workspace-creation-icon-label'); + this.inputProfile = this.querySelector('.zen-workspace-creation-profile'); + this.createButton = this.querySelector('.zen-workspace-creation-create-button'); + this.cancelButton = this.querySelector('.zen-workspace-creation-cancel-button'); + + for (const element of this.elementsToAnimate) { + element.style.opacity = 0; + } + this.#wasInCollapsedMode = document.documentElement.getAttribute('zen-sidebar-expanded') !== 'true'; @@ -103,12 +125,6 @@ } } - this.inputName = this.querySelector('.zen-workspace-creation-name'); - this.inputIcon = this.querySelector('.zen-workspace-creation-icon-label'); - this.inputProfile = this.querySelector('.zen-workspace-creation-profile'); - this.createButton = this.querySelector('.zen-workspace-creation-create-button'); - this.cancelButton = this.querySelector('.zen-workspace-creation-cancel-button'); - this.createButton.addEventListener('command', this.onCreateButtonCommand.bind(this)); this.cancelButton.addEventListener('command', this.onCancelButtonCommand.bind(this)); @@ -133,6 +149,20 @@ this.inputProfile.parentNode.hidden = true; } + gZenUIManager.motion.animate( + this.elementsToAnimate, + { + y: [20, 0], + opacity: [0, 1], + }, + { + duration: 0.9, + type: 'spring', + bounce: 0, + delay: gZenUIManager.motion.stagger(0.05, { startDelay: 0.2 }), + } + ); + this.resolveInitialized(); } @@ -143,7 +173,7 @@ workspace.containerTabId = this.currentProfile; await gZenWorkspaces.saveWorkspace(workspace); - this.#cleanup(); + await this.#cleanup(); await gZenWorkspaces._organizeWorkspaceStripLocations(workspace, true); await gZenWorkspaces.updateTabsContainers(); @@ -208,10 +238,24 @@ async handleZenWorkspacesChange() { await gZenWorkspaces.removeWorkspace(this.workspaceId); - this.#cleanup(); + await this.#cleanup(); } - #cleanup() { + async #cleanup() { + await gZenUIManager.motion.animate( + this.elementsToAnimate.reverse(), + { + y: [0, 20], + opacity: [1, 0], + }, + { + duration: 0.9, + type: 'spring', + bounce: 0, + delay: gZenUIManager.motion.stagger(0.05), + } + ); + gZenWorkspaces.removeChangeListeners(this.handleZenWorkspacesChangeBind); for (const element of this.constructor.elementsToDisable) { const el = document.getElementById(element); diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index 134dd013..fc5e11d0 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -643,7 +643,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { _handleSwipeMayStart(event) { if (this.privateWindowOrDisabled || this._inChangingWorkspace) return; - if (event.target.closest('#zen-sidebar-bottom-buttons')) return; + if (event.target.closest('#zen-sidebar-foot-buttons')) return; // Only handle horizontal swipes if (event.direction === event.DIRECTION_LEFT || event.direction === event.DIRECTION_RIGHT) { @@ -2627,6 +2627,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { _initializeWorkspaceTabContextMenus() { if (this.privateWindowOrDisabled) { + document.getElementById('cmd_zenOpenWorkspaceCreation').setAttribute('disabled', true); return; } const menu = document.createXULElement('menu'); @@ -2639,10 +2640,6 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { menu.appendChild(menuPopup); document.getElementById('context_closeDuplicateTabs').after(menu); - - document - .getElementById('cmd_zenOpenWorkspaceCreation') - .setAttribute('disabled', this.privateWindowOrDisabled); } async changeTabWorkspace(workspaceID) { diff --git a/src/zen/workspaces/create-workspace-form.css b/src/zen/workspaces/create-workspace-form.css index a4e5a7f2..b5244e5e 100644 --- a/src/zen/workspaces/create-workspace-form.css +++ b/src/zen/workspaces/create-workspace-form.css @@ -6,29 +6,30 @@ zen-workspace-creation { flex: 1; - max-width: calc(var(--zen-sidebar-width) - var(--zen-toolbox-padding) * 2); + max-width: calc(var(--zen-sidebar-width) - var(--zen-toolbox-padding)); & .zen-workspace-creation { justify-content: center; & .zen-workspace-creation-title { font-size: large; + margin-bottom: 5px; } & .zen-workspace-creation-label { margin: 0; - opacity: 0.6; + opacity: 0.4; } & form { --input-border-color: light-dark(rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.2)); - --input-bgcolor: light-dark(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.15)); + --input-bgcolor: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1)); display: flex; flex-direction: column; width: calc(100% - 10px); margin: auto; - gap: 1rem; + gap: 1.2rem; & .zen-workspace-creation-form { gap: 0.6rem; From 376c64c892ddef3ff4478e9f3fd19264bbd586a9 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Wed, 11 Jun 2025 02:17:24 +0200 Subject: [PATCH 02/15] chore: Updated l10n packs and fixed opening glance and startup, b=no-bug, c=glance, workspaces --- l10n | 2 +- src/zen/glance/ZenGlanceManager.mjs | 2 + src/zen/workspaces/ZenWorkspaces.mjs | 72 +++++++++++++++------------- 3 files changed, 42 insertions(+), 34 deletions(-) diff --git a/l10n b/l10n index a98bf797..1bcb131a 160000 --- a/l10n +++ b/l10n @@ -1 +1 @@ -Subproject commit a98bf797971ff06742aa4179400e18e0fd465946 +Subproject commit 1bcb131a45ea5e5f7ced55bffb5386156542278a diff --git a/src/zen/glance/ZenGlanceManager.mjs b/src/zen/glance/ZenGlanceManager.mjs index fe893bc2..e59e926e 100644 --- a/src/zen/glance/ZenGlanceManager.mjs +++ b/src/zen/glance/ZenGlanceManager.mjs @@ -228,6 +228,7 @@ } ) .then(() => { + gBrowser.tabContainer._invalidateCachedTabs(); this.#currentBrowser.removeAttribute('animate-glance-open'); this.overlay.style.removeProperty('overflow'); this.browserWrapper.removeAttribute('animate'); @@ -615,6 +616,7 @@ } finishOpeningGlance() { + gBrowser.tabContainer._invalidateCachedTabs(); gZenWorkspaces.updateTabsContainers(); this.browserWrapper.removeAttribute('animate-full'); this.overlay.classList.remove('zen-glance-overlay'); diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index fc5e11d0..0693e6f4 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -381,42 +381,48 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { } async initializeTabsStripSections() { + await SessionStore.promiseInitialized; await SessionStore.promiseAllWindowsRestored; const perifery = document.getElementById('tabbrowser-arrowscrollbox-periphery'); perifery.setAttribute('hidden', 'true'); - const tabs = gBrowser.tabContainer.allTabs; - const workspaces = await this._workspaces(); - for (const workspace of workspaces.workspaces) { - await this._createWorkspaceTabsSection(workspace, tabs); - } - if (tabs.length) { - const defaultSelectedContainer = this.workspaceElement(this.activeWorkspace).querySelector( - '.zen-workspace-normal-tabs-section' - ); - const pinnedContainer = this.workspaceElement(this.activeWorkspace).querySelector( - '.zen-workspace-pinned-tabs-section' - ); - // New profile with no workspaces does not have a default selected container - if (defaultSelectedContainer) { - for (const tab of tabs) { - if (tab.hasAttribute('zen-essential')) { - this.getEssentialsSection(tab).appendChild(tab); - continue; - } else if (tab.pinned) { - pinnedContainer.insertBefore(tab, pinnedContainer.lastChild); - continue; - } - // before to the last child (perifery) - defaultSelectedContainer.insertBefore(tab, defaultSelectedContainer.lastChild); + await new Promise((resolve) => { + setTimeout(async () => { + const tabs = gBrowser.tabContainer.allTabs; + const workspaces = await this._workspaces(); + for (const workspace of workspaces.workspaces) { + await this._createWorkspaceTabsSection(workspace, tabs); } - } - gBrowser.tabContainer._invalidateCachedTabs(); - } - perifery.setAttribute('hidden', 'true'); - this._hasInitializedTabsStrip = true; - this.registerPinnedResizeObserver(); - this._fixIndicatorsNames(workspaces); - this._resolveSectionsInitialized(); + if (tabs.length) { + const defaultSelectedContainer = this.workspaceElement( + this.activeWorkspace + ).querySelector('.zen-workspace-normal-tabs-section'); + const pinnedContainer = this.workspaceElement(this.activeWorkspace).querySelector( + '.zen-workspace-pinned-tabs-section' + ); + // New profile with no workspaces does not have a default selected container + if (defaultSelectedContainer) { + for (const tab of tabs) { + if (tab.hasAttribute('zen-essential')) { + this.getEssentialsSection(tab).appendChild(tab); + continue; + } else if (tab.pinned) { + pinnedContainer.insertBefore(tab, pinnedContainer.lastChild); + continue; + } + // before to the last child (perifery) + defaultSelectedContainer.insertBefore(tab, defaultSelectedContainer.lastChild); + } + } + gBrowser.tabContainer._invalidateCachedTabs(); + } + perifery.setAttribute('hidden', 'true'); + this._hasInitializedTabsStrip = true; + this.registerPinnedResizeObserver(); + this._fixIndicatorsNames(workspaces); + this._resolveSectionsInitialized(); + resolve(); + }, 0); + }); } getEssentialsSection(container = 0) { @@ -859,9 +865,9 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { } this.onWindowResize(); await gZenSessionStore.promiseInitialized; + await this.workspaceBookmarks(); await this.initializeTabsStripSections(); this._initializeEmptyTab(); - await this.workspaceBookmarks(); await gZenPinnedTabManager.refreshPinnedTabs({ init: true }); await this.changeWorkspace(activeWorkspace, { onInit: true }); this._fixTabPositions(); From b932558ad63e23298a93cbaa67ebcd3d079ab52d Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Wed, 11 Jun 2025 03:00:14 +0200 Subject: [PATCH 03/15] fix: Fixed compact mode not working at startup and finished workspace creation form, b=no-bug, c=compact-mode, workspaces --- src/zen/compact-mode/ZenCompactMode.mjs | 8 +- src/zen/workspaces/ZenGradientGenerator.mjs | 8 +- src/zen/workspaces/ZenWorkspaceCreation.mjs | 87 +++++++++++++++----- src/zen/workspaces/create-workspace-form.css | 1 + 4 files changed, 77 insertions(+), 27 deletions(-) diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index 624e60c0..2525e635 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -36,10 +36,12 @@ var gZenCompactModeManager = { preInit() { // Remove it before initializing so we can properly calculate the width // of the sidebar at startup and avoid overflowing items not being hidden - const isCompactMode = - lazyCompactMode.mainAppWrapper.getAttribute('zen-compact-mode') === 'true'; + this._wasInCompactMode = Services.xulStore.getValue( + AppConstants.BROWSER_CHROME_URL, + 'zen-main-app-wrapper', + 'zen-compact-mode' + ); lazyCompactMode.mainAppWrapper.removeAttribute('zen-compact-mode'); - this._wasInCompactMode = isCompactMode; this.addContextMenu(); }, diff --git a/src/zen/workspaces/ZenGradientGenerator.mjs b/src/zen/workspaces/ZenGradientGenerator.mjs index 8a6745ca..6608e5d9 100644 --- a/src/zen/workspaces/ZenGradientGenerator.mjs +++ b/src/zen/workspaces/ZenGradientGenerator.mjs @@ -76,14 +76,14 @@ } openThemePicker(event) { - const position = event.explicitOriginalTarget?.classList?.contains( + const fromForm = event.explicitOriginalTarget?.classList?.contains( 'zen-workspace-creation-edit-theme-button' - ) - ? 'end_before' - : 'topright topleft'; + ); + const position = fromForm ? 'bottomleft bottomright' : 'topright topleft'; PanelMultiView.openPopup(this.panel, this.toolbox, { position, triggerEvent: event, + y: fromForm ? -160 : 0, }); } diff --git a/src/zen/workspaces/ZenWorkspaceCreation.mjs b/src/zen/workspaces/ZenWorkspaceCreation.mjs index e3d2c82f..fc3214fa 100644 --- a/src/zen/workspaces/ZenWorkspaceCreation.mjs +++ b/src/zen/workspaces/ZenWorkspaceCreation.mjs @@ -45,8 +45,10 @@ -