@motion.page/sdk 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -4
- package/dist/index.cjs +10 -10
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +10 -10
- package/dist/index.js.map +3 -3
- package/dist/triggers/CursorTrigger.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var{defineProperty:f0,getOwnPropertyNames:N6,getOwnPropertyDescriptor:W6}=Object,_6=Object.prototype.hasOwnProperty;function B6(J){return this[J]}var Y6=(J)=>{var $=(UJ??=new WeakMap).get(J),Q;if($)return $;if($=f0({},"__esModule",{value:!0}),J&&typeof J==="object"||typeof J==="function"){for(var q of N6(J))if(!_6.call($,q))f0($,q,{get:B6.bind(J,q),enumerable:!(Q=W6(J,q))||Q.enumerable})}return UJ.set(J,$),$},UJ;var H6=(J)=>J;function X6(J,$){this[J]=H6.bind(null,$)}var K6=(J,$)=>{for(var Q in $)f0(J,Q,{get:$[Q],enumerable:!0,configurable:!0,set:X6.bind($,Q)})};var P7={};K6(P7,{Types:()=>$6,Timeline:()=>R,MotionUtils:()=>S0,Motion:()=>J6});module.exports=Y6(P7);function x(J,$){switch(J){case"play":case"resume":$.play();break;case"pause":$.pause();break;case"reverse":$.reverse();break;case"restart":$.restart();break;case"reset":$.pause(),$.progress(0);break;case"complete":$.progress(1),$.pause();break;case"none":break;default:console.warn(`[Motion] Unknown timeline action: "${J}". Valid actions: play, pause, resume, reverse, restart, reset, complete, none`)}}var X={color:null,filter:null,drawSVG:null,stagger:null,textSplitter:null,triggerManager:null,styleReset:null,fit:null};class F{static _instance;static _triggerRegistry=new Map;static _pageLoadTriggerFactory=null;static _RESIZE_DEBOUNCE_MS=200;_pageLoadTrigger=null;_scrollTriggers=new Map;_eventTriggers=new Map;_mouseMoveTriggers=new Map;_gestureTriggers=new Map;_cursorTriggers=new Map;_pageExitTriggers=new Map;_resizeHandler=null;_resizeTimer=null;get _allTriggerMaps(){return[this._scrollTriggers,this._eventTriggers,this._mouseMoveTriggers,this._gestureTriggers,this._cursorTriggers,this._pageExitTriggers]}constructor(){}static getInstance(){if(!F._instance)F._instance=new F;return F._instance}static registerTrigger(J,$){F._triggerRegistry.set(J,$)}static registerPageLoadTrigger(J){F._pageLoadTriggerFactory=J}_getPageLoadTrigger(){if(!this._pageLoadTrigger&&F._pageLoadTriggerFactory)this._pageLoadTrigger=new F._pageLoadTriggerFactory;return this._pageLoadTrigger}_createTrigger(J,...$){let Q=F._triggerRegistry.get(J);if(!Q){let q=Array.from(F._triggerRegistry.keys());return console.warn(`[Motion SDK] Trigger type '${J}' is not available in this bundle. Available triggers: ${q.join(", ")||"none"}. Animations using .on${J.charAt(0).toUpperCase()+J.slice(1)}() will be skipped.`),null}return new Q(...$)}registerPageLoad(J,$){this.unregister(J);let Q=this._getPageLoadTrigger();if(Q)Q.register(J,$)}_attachResizeListener(){if(this._resizeHandler||typeof window>"u")return;this._resizeHandler=()=>{if(this._resizeTimer!==null)clearTimeout(this._resizeTimer);this._resizeTimer=setTimeout(()=>{this._resizeTimer=null,this.refreshScrollTriggers()},F._RESIZE_DEBOUNCE_MS)},window.addEventListener("resize",this._resizeHandler,{passive:!0})}_detachResizeListener(){if(!this._resizeHandler||typeof window>"u")return;if(window.removeEventListener("resize",this._resizeHandler),this._resizeTimer!==null)clearTimeout(this._resizeTimer),this._resizeTimer=null;this._resizeHandler=null}registerScroll(J,$){this.unregister(J);let Q=this._createTrigger("scroll",J,$);if(!Q)return;this._scrollTriggers.set(J,Q),J._trigger=Q,Q.enable(),this._attachResizeListener()}registerHover(J,$){this.unregister(J);let Q=this._createTrigger("event",J,{type:"hover",target:$.target,onLeave:$.onLeave,leaveDelay:$.leaveDelay});if(!Q)return;this._eventTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerClick(J,$){this.unregister(J);let Q=this._createTrigger("event",J,{type:"click",target:$.target,secondTarget:$.secondTarget,toggle:$.toggle,preventDefault:$.preventDefault});if(!Q)return;this._eventTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerMouseMove(J,$){this.unregister(J);let Q=this._createTrigger("mouseMove",J,$);if(!Q)return;this._mouseMoveTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerGesture(J,$){this.unregister(J);let Q=this._createTrigger("gesture",J,$);if(!Q)return;this._gestureTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerCursor(J,$){this.unregister(J);let Q=this._createTrigger("cursor",J,$);if(!Q)return;this._cursorTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerPageExit(J,$){this.unregister(J);let Q=this._createTrigger("pageExit",J,$);if(!Q)return;this._pageExitTriggers.set(J,Q),J._trigger=Q,Q.enable()}unregister(J){let $=this._getPageLoadTrigger();if($)$.unregister(J);for(let Q of this._allTriggerMaps){let q=Q.get(J);if(q)q.disable(),Q.delete(J)}if(J._trigger=void 0,this._scrollTriggers.size===0)this._detachResizeListener()}refreshScrollTriggers(){let J=Array.from(this._scrollTriggers.values()),$=typeof window<"u"?window.scrollY:0;J.sort((Q,q)=>{let Z=Q._pinManager?.getLayoutRect?.(),j=q._pinManager?.getLayoutRect?.();if(!Z&&!j)return 0;if(!Z)return 1;if(!j)return-1;return Z.top+$-(j.top+$)}),J.forEach((Q)=>Q.refresh?.()),this._eventTriggers.forEach((Q)=>Q.refresh?.()),this._gestureTriggers.forEach((Q)=>Q.refresh?.()),this._mouseMoveTriggers.forEach((Q)=>Q.refresh?.())}killAll(){let J=this._getPageLoadTrigger();if(J)J.clear();for(let $ of this._allTriggerMaps)$.forEach((Q)=>Q.disable()),$.clear();this._detachResizeListener()}static _reset(){if(F._instance){if(F._instance._pageLoadTrigger)F._instance._pageLoadTrigger._reset();F._instance.killAll(),F._instance=void 0}}}X.triggerManager={getInstance:F.getInstance};function AJ(J){if(typeof document>"u"){J();return}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",J,{once:!0});else J()}function IJ(J){if(J===null||typeof J!=="object")return!1;if(J instanceof Element)return!1;if("nodeType"in J)return!1;if("style"in J)return!1;let $=J;if("x"in $&&typeof $.x==="number")return!0;if("length"in J)return!1;return!0}function u0(J){return J instanceof Element||typeof J==="object"&&J!==null&&(("nodeType"in J)||("style"in J))}function X0(J){if(IJ(J))return[J];if(typeof J==="string"){if(typeof document<"u")try{return Array.from(document.querySelectorAll(J))}catch($){return console.warn(`[Motion] Invalid selector "${J}":`,$),[]}return[]}if(J instanceof Element)return[J];if(J&&typeof J==="object"&&"style"in J&&!Array.isArray(J))return[J];if(J instanceof NodeList)return Array.from(J);if(Array.isArray(J)){if(J.length===0)return[];if(typeof J[0]==="string"){if(typeof document>"u")return[];let $=[];for(let Q of J)try{$.push(...Array.from(document.querySelectorAll(Q)))}catch(q){console.warn(`[Motion] Invalid selector "${Q}":`,q)}return $}if(IJ(J[0]))return J;return J}if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}class h{_timeline;_config;_enabled=!1;constructor(J,$){this._timeline=J,this._config=$}enable(){if(this._enabled)return;this._enabled=!0,AJ(()=>{if(!this._enabled)return;this._onEnable()})}disable(){if(!this._enabled)return;this._enabled=!1,this._onDisable()}_resolveElement(J,$){if(J===void 0||J===null)return $??null;if(typeof J!=="string")return J;if(typeof document<"u")try{let Q=document.querySelector(J);if(Q!==null)return Q}catch(Q){console.warn(`[Motion] Invalid selector "${J}":`,Q)}return $??null}_resolveElements(J){if(J===void 0||J===null)return[];if(typeof J!=="string")return[J];if(typeof document<"u")try{let $=document.querySelectorAll(J);return Array.from($)}catch($){return console.warn(`[Motion] Invalid selector "${J}":`,$),[]}return[]}_cleanupListenerMap(J){J.forEach(($,Q)=>{$.forEach((q,Z)=>{Q.removeEventListener(Z,q)})}),J.clear()}}function V(J){let $=J,Q=$.style.transform,q=$.style.transition,Z=$.style.position,j=$.style.top,z=$.style.left,G=$.style.width;$.style.transition="none",$.style.transform="none";let N=typeof window<"u"&&typeof window.getComputedStyle==="function"&&window.getComputedStyle($).position==="fixed";if(N)$.style.position="",$.style.top="",$.style.left="",$.style.width="";let W=$.getBoundingClientRect();if($.style.transform=Q,$.style.transition=q,N)$.style.position=Z,$.style.top=j,$.style.left=z,$.style.width=G;return $.offsetHeight,W}class FJ extends h{_targets=[];_secondTargets=[];_listeners=new Map;_isForward=!0;_frozenRects=new Map;_wasHovering=!1;_hoverLeaveTimeout=null;_boundMouseMoveHandler=null;constructor(J,$){super(J,$)}_onEnable(){if(this._resolveTargets(),this._config.type==="hover")this._addHoverListeners();else if(this._config.type==="click")this._addClickListeners()}_onDisable(){if(this._boundMouseMoveHandler)window.removeEventListener("mousemove",this._boundMouseMoveHandler),this._boundMouseMoveHandler=null;if(this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;this._frozenRects.clear(),this._wasHovering=!1,this._cleanupListenerMap(this._listeners)}refresh(){if(this._config.type!=="hover")return;for(let J of this._targets)this._frozenRects.set(J,V(J))}_resolveTargets(){if(this._targets=this._resolveElements(this._config.target),this._config.secondTarget)this._secondTargets=this._resolveElements(this._config.secondTarget);else this._secondTargets=this._targets}_addHoverListeners(){let J=this._config.onLeave||"reverse",$=this._config.leaveDelay||0;for(let Q of this._targets)this._frozenRects.set(Q,V(Q));this._boundMouseMoveHandler=(Q)=>{let{clientX:q,clientY:Z}=Q,j=!1;for(let z of this._frozenRects.values())if(q>=z.left&&q<=z.right&&Z>=z.top&&Z<=z.bottom){j=!0;break}if(j&&!this._wasHovering){if(this._wasHovering=!0,this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;this._timeline.play()}else if(!j&&this._wasHovering){if(this._wasHovering=!1,J==="none")return;let z=()=>{this._handleLeaveAction(J),this._hoverLeaveTimeout=null};if($>0)this._hoverLeaveTimeout=window.setTimeout(z,$*1000);else z()}},window.addEventListener("mousemove",this._boundMouseMoveHandler)}_handleLeaveAction(J){x(J==="stop"?"reset":J,this._timeline)}_addClickListeners(){let J=this._config.toggle||"play",$=this._config.preventDefault||!1,Q=this._config.secondTarget&&this._config.secondTarget!==this._config.target;if(this._targets.forEach((q)=>{let Z=this._listeners.get(q)||new Map,j=(z)=>{if($)z.preventDefault();if(!Q)if(this._isForward){if(this._timeline.restart(),J!=="play")this._isForward=!1}else this._handleSecondClick(J),this._isForward=!0;else this._timeline.restart()};q.addEventListener("click",j),Z.set("click",j),this._listeners.set(q,Z)}),Q)this._secondTargets.forEach((q)=>{if(this._listeners.has(q))return;let Z=new Map,j=(z)=>{if($)z.preventDefault();this._handleSecondClick(J)};q.addEventListener("click",j),Z.set("click",j),this._listeners.set(q,Z)})}_handleSecondClick(J){x(J,this._timeline)}}F.registerTrigger("event",FJ);var c0={perspective:0,x:1,y:2,z:3,rotate:4,rotateX:5,rotateY:6,rotateZ:7,scale:8,scaleX:9,scaleY:10,scaleZ:11,skewX:12,skewY:13},LJ=["px","px","px","px","deg","deg","deg","deg","","","","","deg","deg"],$0=new WeakMap,K0=new WeakMap,D=[];function d(J){let $=J.trim().match(/([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z%]*)/i);if(!$)return{value:0,unit:""};return{value:parseFloat($[1]),unit:$[2]||""}}function J0(J,$){switch($){case"rad":return J*180/Math.PI;case"turn":return J*360;case"grad":return J*0.9;default:return J}}function i(J){let $=d(J);return J0($.value,$.unit||"deg")}function I(J,$,Q,q){let Z=c0[$];if(Z===void 0)return;J.values[Z]=Q;let j=q&&q.length>0?q:LJ[Z]||"";J.units[Z]=j,J.used|=1<<Z}function U6(J,$){let Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,q;while((q=Q.exec(J))!==null){let Z=q[1],j=q[2].match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?[a-z%]*/gi)||[];switch(Z){case"translate":{let z=j[0]?d(j[0]):{value:0,unit:""},G=j[1]?d(j[1]):{value:0,unit:""};I($,"x",z.value,z.unit),I($,"y",G.value,G.unit);break}case"translate3d":{let z=j[0]?d(j[0]):{value:0,unit:""},G=j[1]?d(j[1]):{value:0,unit:""},N=j[2]?d(j[2]):{value:0,unit:""};I($,"x",z.value,z.unit),I($,"y",G.value,G.unit),I($,"z",N.value,N.unit);break}case"translateX":{let z=j[0]?d(j[0]):{value:0,unit:""};I($,"x",z.value,z.unit);break}case"translateY":{let z=j[0]?d(j[0]):{value:0,unit:""};I($,"y",z.value,z.unit);break}case"translateZ":{let z=j[0]?d(j[0]):{value:0,unit:""};I($,"z",z.value,z.unit);break}case"scale":{let z=j[0]?parseFloat(j[0]):1,G=j[1]?parseFloat(j[1]):z;I($,"scaleX",z),I($,"scaleY",G);break}case"scale3d":{let z=j[0]?parseFloat(j[0]):1,G=j[1]?parseFloat(j[1]):1,N=j[2]?parseFloat(j[2]):1;I($,"scaleX",z),I($,"scaleY",G),I($,"scaleZ",N);break}case"scaleX":{let z=j[0]?parseFloat(j[0]):1;I($,"scaleX",z);break}case"scaleY":{let z=j[0]?parseFloat(j[0]):1;I($,"scaleY",z);break}case"scaleZ":{let z=j[0]?parseFloat(j[0]):1;I($,"scaleZ",z);break}case"rotate":I($,"rotate",j[0]?i(j[0]):0,"deg");break;case"rotateX":I($,"rotateX",j[0]?i(j[0]):0,"deg");break;case"rotateY":I($,"rotateY",j[0]?i(j[0]):0,"deg");break;case"rotateZ":I($,"rotateZ",j[0]?i(j[0]):0,"deg");break;case"skew":{let z=j[0]?i(j[0]):0,G=j[1]?i(j[1]):0;I($,"skewX",z,"deg"),I($,"skewY",G,"deg");break}case"skewX":I($,"skewX",j[0]?i(j[0]):0,"deg");break;case"skewY":I($,"skewY",j[0]?i(j[0]):0,"deg");break;case"perspective":{let z=j[0]?d(j[0]):{value:0,unit:""};I($,"perspective",z.value,z.unit);break}default:break}}}function d0(J,$,Q,q,Z,j,z,G,N,W,_,B,U,Y){if(U){let a=Math.hypot(J,$),j6=J*Z-$*q,G6=a!==0?j6/a:0,z6=a!==0?Math.atan2($,J):0,KJ=a!==0?Math.atan2(J*q+$*Z,a*a):0;if(I(Y,"x",W,"px"),I(Y,"y",_,"px"),I(Y,"scaleX",a||1),I(Y,"scaleY",G6||1),I(Y,"rotate",J0(z6,"rad"),"deg"),Math.abs(KJ)>0.000001)I(Y,"skewX",J0(KJ,"rad"),"deg");return}let H=Math.hypot(J,$,Q)||1,A=Math.hypot(q,Z,j)||1,K=Math.hypot(z,G,N)||1,M=J/H,k=$/H,L=Q/H,O=q/A,v=Z/A,P0=j/A,XJ=z/K,Q6=G/K,q6=N/K,y0=Math.sqrt(M*M+O*O),Z6=y0<0.000001,v0=0,h0=0,T0=0;if(!Z6)v0=Math.atan2(Q6,q6),h0=Math.atan2(-XJ,y0),T0=Math.atan2(O,M);else v0=Math.atan2(-P0,v),h0=Math.atan2(-XJ,y0),T0=0;I(Y,"x",W,"px"),I(Y,"y",_,"px"),I(Y,"z",B,"px"),I(Y,"scaleX",H),I(Y,"scaleY",A),I(Y,"scaleZ",K),I(Y,"rotateX",J0(v0,"rad"),"deg"),I(Y,"rotateY",J0(h0,"rad"),"deg"),I(Y,"rotateZ",J0(T0,"rad"),"deg")}function I6(J,$){if(!J||J==="none")return;if(typeof DOMMatrixReadOnly<"u"){let q=new DOMMatrixReadOnly(J);d0(q.m11,q.m12,q.m13,q.m21,q.m22,q.m23,q.m31,q.m32,q.m33,q.m41,q.m42,q.m43,q.is2D,$);return}let Q=J.match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];if(J.startsWith("matrix3d")&&Q.length>=16){let q=Q.map(Number);d0(q[0],q[1],q[2],q[4],q[5],q[6],q[8],q[9],q[10],q[12],q[13],q[14],!1,$);return}if(J.startsWith("matrix")&&Q.length>=6){let q=Q.map(Number);d0(q[0],q[1],0,q[2],q[3],0,0,0,1,q[4],q[5],0,!0,$)}}function A6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let q=J.style.transform;if(q&&q!=="none"){U6(q,$),$.cachedString=q;return}try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J),j=Z.transform||Z.getPropertyValue("transform");if(j&&j!=="none")I6(j,$),$.cachedString=j}}catch{}}function MJ(J){let $=$0.get(J);if(!$){let Q=new Float32Array(14);Q[8]=1,Q[9]=1,Q[10]=1,Q[11]=1,$={values:Q,units:[...LJ],dirty:0,used:0,cachedString:"",pinDirty:!1},A6(J,$),$0.set(J,$)}return $}function P(J,$,Q,q){let Z=MJ(J),j=c0[$];if(j!==void 0){if(Z.values[j]=Q,q!==void 0)Z.units[j]=q;if(Z.used|=1<<j,$==="scale")Z.values[9]=Q,Z.values[10]=Q,Z.dirty|=1536;else if($==="scaleX"||$==="scaleY")Z.values[8]=1,Z.dirty|=256;if($==="rotate")Z.values[7]=0,Z.dirty|=128;else if($==="rotateZ")Z.values[4]=0,Z.dirty|=16;Z.dirty|=1<<j}}function m0(J,$){let Q=MJ(J),q=c0[$];if(q===void 0)return $.startsWith("scale")?1:0;if($==="scale"){if(Q.values[q]!==1)return Q.values[q];let Z=Q.values[9],j=Q.values[10];if(Math.abs(Z-j)<0.000001&&Z!==1)return Z;return Q.values[q]}if($==="rotate"){if(Q.values[q]!==0)return Q.values[q];let Z=Q.values[7];if(Z!==0&&Q.values[5]===0&&Q.values[6]===0)return Z;return Q.values[q]}return Q.values[q]}function p0(J){return J===0?"0":`${Math.round(J)}px`}function OJ(J,$,Q){return`translate3d(${p0(J)}, ${p0($)}, ${p0(Q)})`}function U0(J,$,Q,q){K0.set(J,{x:$,y:Q,z:q});let Z=$0.get(J);if(Z)Z.pinDirty=!0}function G0(J){let $=K0.has(J);if(K0.delete(J),$){let Q=$0.get(J);if(Q)Q.pinDirty=!0}}function E(J){let $=$0.get(J),Q=K0.get(J);if(!$){if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0))return OJ(Q.x,Q.y,Q.z);return""}if($.dirty===0&&!$.pinDirty&&$.cachedString)return $.cachedString;let{values:q,units:Z}=$;D.length=0;let j=$.used,z=q[0];if(z!==0){let O=Z[0];D.push(`perspective(${z}${O})`)}let G=q[1],N=q[2],W=q[3],_=Z[1],B=Z[2],U=Z[3],Y=j&2,H=j&4,A=j&8;if(G!==0||N!==0||W!==0||Y||H||A){let O=_===B&&(W===0&&!A||B===U);if(W!==0||A)if(O)D.push(`translate3d(${G}${_}, ${N}${B}, ${W}${U})`);else{if(G!==0||Y)D.push(`translateX(${G}${_})`);if(N!==0||H)D.push(`translateY(${N}${B})`);D.push(`translateZ(${W}${U})`)}else if(O&&(G!==0||Y)&&(N!==0||H))D.push(`translate(${G}${_}, ${N}${B})`);else{if(G!==0||Y)D.push(`translateX(${G}${_})`);if(N!==0||H)D.push(`translateY(${N}${B})`)}}if(q[4]!==0||j&16)D.push(`rotate(${q[4]}deg)`);if(q[5]!==0||j&32)D.push(`rotateX(${q[5]}deg)`);if(q[6]!==0||j&64)D.push(`rotateY(${q[6]}deg)`);if(q[7]!==0||j&128)D.push(`rotateZ(${q[7]}deg)`);let K=j&256,M=j&512,k=j&1024;if(q[8]!==1||K)D.push(`scale(${q[8]})`);else if(q[9]!==1||q[10]!==1||M||k)D.push(`scaleX(${q[9]})`),D.push(`scaleY(${q[10]})`);if(q[11]!==1||j&2048)D.push(`scaleZ(${q[11]})`);if(q[12]!==0||j&4096)D.push(`skewX(${q[12]}deg)`);if(q[13]!==0||j&8192)D.push(`skewY(${q[13]}deg)`);let L=D.join(" ");if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0)){let O=OJ(Q.x,Q.y,Q.z);$.cachedString=L?`${O} ${L}`:O}else $.cachedString=L;return $.dirty=0,$.pinDirty=!1,$.cachedString}function y(J,$=!1){if($0.delete(J),$&&J instanceof HTMLElement)J.style.transform=""}var g0=new Set,I0=new Map,A0=!1;function F0(J){g0.add(J),A0=!0}function O0(J,$,Q){let q=I0.get(J);if(!q)q=new Map,I0.set(J,q);q.set($,Q),A0=!0}function s0(){if(!A0)return;for(let J of g0){let $=J;if($.style){let Q=E(J);$.style.transform=Q}}g0.clear();for(let[J,$]of I0){let Q=J;if(Q.style)for(let[q,Z]of $)try{if(q.startsWith("--"))Q.style.setProperty(q,Z);else Q.style[q]=Z}catch{}}I0.clear(),A0=!1}var r=!1;function Q0(){return r}function o0(J){if(r){J();return}r=!0;try{J(),s0()}finally{r=!1}}class w{static instance;listeners=[];_listenersDirty=!0;_listenersSnapshot=[];_isRunning=!1;rafId=null;lastTime=0;elapsedTime=0;lagThreshold=500;maxDelta=33;fpsFrames=0;fpsTime=0;currentFPS=60;lastFrameTime=0;constructor(){}static getInstance(){if(!w.instance)w.instance=new w;return w.instance}add(J,$=0){let Q=this.listeners.findIndex((q)=>q.callback===J);if(Q!==-1)this.listeners[Q].priority=$;else this.listeners.push({callback:J,priority:$});if(this.listeners.sort((q,Z)=>Z.priority-q.priority),this._listenersDirty=!0,!this._isRunning&&this.listeners.length>0)this.start()}remove(J){let $=this.listeners.findIndex((Q)=>Q.callback===J);if($!==-1)this.listeners.splice($,1),this._listenersDirty=!0;if(this.listeners.length===0&&this._isRunning)this.stop()}start(){if(this._isRunning)return;if(typeof requestAnimationFrame>"u"){this._isRunning=!1;return}this._isRunning=!0,this.lastTime=performance.now(),this.rafId=requestAnimationFrame(this.tick)}stop(){if(!this._isRunning)return;if(this._isRunning=!1,this.rafId!==null&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(this.rafId),this.rafId=null}pause(){this.stop()}resume(){if(this.listeners.length>0)this.start()}tick=()=>{if(!this._isRunning)return;let J=performance.now(),$=J-this.lastTime;if($>this.lagThreshold)$=this.maxDelta,this.lastTime=J-$;else this.lastTime=J;let Q=$/1000;if(this.elapsedTime+=Q,this.lastFrameTime=$,this.updateFPS($),r=!0,this._listenersDirty)this._listenersSnapshot=[...this.listeners],this._listenersDirty=!1;for(let q of this._listenersSnapshot)try{q.callback(Q,this.elapsedTime)}catch(Z){console.error("[Motion] Uncaught error in animation callback:",Z)}try{s0()}catch(q){console.error("[Motion] Uncaught error in render batch flush:",q)}if(r=!1,typeof requestAnimationFrame<"u")this.rafId=requestAnimationFrame(this.tick)};updateFPS(J){if(this.fpsFrames++,this.fpsTime+=J,this.fpsTime>=1000)this.currentFPS=Math.round(this.fpsFrames*1000/this.fpsTime),this.fpsFrames=0,this.fpsTime=0}getFPS(){return this.currentFPS}getLastDelta(){return this.lastFrameTime}isRunning(){return this._isRunning}isInTick(){return r}getListenerCount(){return this.listeners.length}removeAll(){this.listeners=[],this.stop()}}var c=null,q0=null,F6=100,p=new Map;function O6(J){let $=p.get(J);if($!==void 0)p.delete(J),p.set(J,$);return $}function L6(J,$){if(p.has(J))p.delete(J);while(p.size>=F6){let Q=p.keys().next().value;if(Q!==void 0)p.delete(Q);else break}p.set(J,$)}function M6(J){return/^\s*[Mm]/.test(J)}function kJ(){if(q0)return q0;if(typeof document>"u")throw Error("PathParser requires a browser environment");return c=document.createElementNS("http://www.w3.org/2000/svg","svg"),c.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;",c.setAttribute("aria-hidden","true"),q0=document.createElementNS("http://www.w3.org/2000/svg","path"),c.appendChild(q0),document.body.appendChild(c),q0}function DJ(J){if(J instanceof Element)return J.getAttribute("d");if(typeof J==="string"){if(M6(J))return J;if(typeof document<"u"){let $=document.querySelector(J);if($)return $.getAttribute("d")}}return null}function EJ(J){let $=O6(J);if($!==void 0)return $;try{let Q=kJ();Q.setAttribute("d",J);let q=Q.getTotalLength();return L6(J,q),q}catch{return 0}}function l0(J,$,Q=!1){try{let q=kJ();q.setAttribute("d",J);let Z=q.getTotalLength(),j=Math.max(0,Math.min(1,$)),z=Z*j,G=q.getPointAtLength(z),N=0;if(Q)N=k6(q,z,Z);return{x:G.x,y:G.y,angle:N}}catch{return{x:0,y:0,angle:0}}}function k6(J,$,Q){let q=Math.min(0.1,Q*0.001),Z=Math.max(0,$-q),j=Math.min(Q,$+q),z=J.getPointAtLength(Z),G=J.getPointAtLength(j),N=G.x-z.x,W=G.y-z.y;return Math.atan2(W,N)*(180/Math.PI)}function RJ(J,$=[50,50]){if(!J)return{x:0,y:0};let Q=null;if(J instanceof Element)Q=J;else if(typeof J==="string"&&typeof document<"u")Q=document.querySelector(J);if(!Q||typeof Q.getBoundingClientRect!=="function")return{x:0,y:0};let q=Q.getBoundingClientRect(),Z=q.width*$[0]/100,j=q.height*$[1]/100;return{x:Z,y:j}}function bJ(J,$,Q){if(!J)return{x:0,y:0};let q=null;if(J instanceof Element)q=J;else if(typeof J==="string"&&typeof document<"u")q=document.querySelector(J);if(!q)return{x:0,y:0};let Z=l0($,0,!1);if(Q&&Q instanceof HTMLElement){let j=Q.style.transform,z=j&&j!=="none"&&j!=="";if(z)Q.style.transform="none";let G=Q.getBoundingClientRect(),N=q.getBoundingClientRect();if(z)Q.style.transform=j;let W=N.left+N.width/2-(G.left+G.width/2),_=N.top+N.height/2-(G.top+G.height/2);return{x:W-Z.x,y:_-Z.y}}return{x:-Z.x,y:-Z.y}}function wJ(){if(c&&c.parentNode)c.parentNode.removeChild(c);c=null,q0=null,p.clear()}var D6=new Set(["perspective","x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY"]),E6=new Set(["perspective","x","y","z","width","height","top","left","right","bottom","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderRadius","fontSize","lineHeight"]),R6=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),b6=new Set(["opacity","scale","scaleX","scaleY","scaleZ","z-index","zIndex"]),w6=new Set(["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","caretColor","fill","stroke"]),C6=new Set(["red","green","blue","yellow","orange","purple","pink","cyan","magenta","white","black","gray","grey","transparent","crimson","gold","silver","navy","teal","maroon","olive","lime","aqua","fuchsia","coral","salmon","tomato","indigo"]);function T(J){return D6.has(J)}function t(J){return w6.has(J)}function l(J){return J==="filter"}function i0(J){return J==="drawSVG"}function n0(J){return J==="path"}function e(J){return J.startsWith("--")}function CJ(J){if(typeof J!=="string")return!1;let $=J.trim().toLowerCase();if($.startsWith("#"))return!0;if(/^(rgb|rgba|hsl|hsla)\s*\(/.test($))return!0;let Q=X.color;if(Q)return Q.parseColor($)!==null;return C6.has($)}function o(J){if(typeof J==="number"){if(isNaN(J)||!isFinite(J))return console.warn(`[Motion] Property value is ${J}. This property will not animate correctly.`),{value:0,unit:""};return{value:J,unit:""}}if(typeof J==="string"){let $=J.match(/^([+\-*/])=(.+)/);if($){let q=$[2].match(/([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)/i);if(q)return{value:parseFloat(q[1]),unit:q[2]||""}}let Q=J.match(/([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)/i);if(Q)return{value:parseFloat(Q[1]),unit:Q[2]||""}}return{value:0,unit:""}}function z0(J){if(b6.has(J))return"";if(R6.has(J))return"deg";if(E6.has(J))return"px";return""}function xJ(J){if(J==="opacity")return 1;if(J.startsWith("scale"))return 1;return 0}function L0(J,$){if(!(J instanceof Element)){let Q=J;if($ in Q)return Q[$];return x6($)}if(T($))return m0(J,$);try{if(typeof window<"u"&&window.getComputedStyle){let q=window.getComputedStyle(J).getPropertyValue(m($));if(q)return o(q).value}}catch(Q){}return xJ($)}function VJ(J,$){let Q=J,q=m($);if(T($)){let Z=Q.style.transform;y(J),Q.style.transform="";let j=m0(J,$);return Q.style.transform=Z,y(J),{value:j,unit:z0($)}}try{if(typeof window<"u"&&window.getComputedStyle){let Z=Q.style.getPropertyValue(q);Q.style.removeProperty(q);let z=window.getComputedStyle(J).getPropertyValue(q);if(Z)Q.style.setProperty(q,Z);if(z){let G=o(z);return{value:G.value,unit:G.unit}}}}catch(Z){}return{value:xJ($),unit:z0($)}}function x6(J){if(J.startsWith("scale"))return 1;return 0}function m(J){return J.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)}function V6(J){if(typeof J==="string")return/^[+\-*/]=/.test(J);return!1}function S6(J){let $=J.match(/^([+\-*/])=/);return $?$[0]:null}function P6(J,$,Q){switch(Q){case"+=":return J+$;case"-=":return J-$;case"*=":return J*$;case"/=":return $!==0?J/$:J;default:return $}}function y6(J,$,Q,q){let Z=X.color;if(!Z)return null;let j=String(Q),z=j===""?Z.getCurrentColor(J,$):Z.parseColor(j,J),G=q!==void 0?Z.parseColor(String(q),J):Z.getCurrentColor(J,$);return{type:"color",property:$,isTransform:!1,startColor:G||new Float32Array([0,0,0,1]),endColor:z||new Float32Array([0,0,0,1])}}function v6(J,$,Q,q){let Z=X.filter;if(!Z)return null;let j=String(Q),z=j===""?Z.getCurrentFilter(J):Z.parseFilter(j),G=q!==void 0?Z.parseFilter(String(q)):Z.getCurrentFilter(J);G=G||[],z=z||[];let N=Z.mergeFilterArrays(G,z);return{type:"filter",property:$,isTransform:!1,startFilters:N.start,endFilters:N.end}}function h6(J,$,Q,q){if(CJ(Q)||q!==void 0&&CJ(q)){let G=X.color;if(G){let N=String(Q),W=G.parseColor(N,J),_=q!==void 0?G.parseColor(String(q),J):T6(J,$);return{type:"color",property:$,isTransform:!1,startColor:_||new Float32Array([0,0,0,1]),endColor:W||new Float32Array([0,0,0,1])}}}let j=o(Q),z;if(q!==void 0)z=o(q).value;else z=f6(J,$);return{type:"scalar",property:$,isTransform:!1,startValue:z,endValue:j.value,unit:j.unit}}function T6(J,$){let Q=X.color;if(!Q)return null;try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue($).trim();if(Z)return Q.parseColor(Z,J)}}catch{}return null}function f6(J,$){try{if(typeof window<"u"&&window.getComputedStyle){let q=window.getComputedStyle(J).getPropertyValue($).trim();if(q)return o(q).value}}catch{}return 0}function u6(J,$,Q,q){let Z=X.drawSVG;if(!Z)return null;let j=Z.getPathLength(J),z=Z.parseDrawSVG(Q,J)||{start:0,end:1},G=q!==void 0?Z.parseDrawSVG(q,J)||{start:0,end:1}:Z.getCurrentDrawSVG(J);return{type:"drawSVG",property:$,isTransform:!1,startDraw:G,endDraw:z,length:j}}function d6(J,$,Q,q){let Z=Q,j=q,z=Z?.target?Z:j;if(!z?.target)return null;let G=DJ(z.target);if(!G)return null;let N=EJ(G);if(N===0)return null;let W,_;if(Z?.target&&j?.target)W=j.start??0,_=Z.end??1;else if(Z?.target)W=Z.start??0,_=Z.end??1;else W=j.start??0,_=j.end??1;let B=Z?.rotate??j?.rotate??!1,U=Z?.alignAt??j?.alignAt??[50,50],Y=RJ(J,U),H=Z?.align??j?.align,A=bJ(H,G,J);return{type:"path",property:$,isTransform:!1,pathData:G,pathLength:N,startProgress:W,endProgress:_,rotate:B,alignOffset:Y,pathOffset:A}}function SJ(J,$,Q,q){let Z=J instanceof Element;if(Z&&e($))return h6(J,$,Q,q);if(Z&&t($)){let _=y6(J,$,Q,q);if(_)return _}if(Z&&l($)){let _=v6(J,$,Q,q);if(_)return _}if(Z&&i0($)){let _=u6(J,$,Q,q);if(_)return _}if(Z&&n0($)){let _=d6(J,$,Q,q);if(_)return _}let j=T($),z=q===void 0&&V6(Q),G,N,W;if(q!==void 0){let _=o(q),B=o(Q);G=_.value,N=B.value,W=B.unit||_.unit||z0($)}else if(z){let _=S6(Q),B=L0(J,$),U=o(Q);G=B,N=P6(B,U.value,_),W=U.unit||z0($)}else{let _=L0(J,$),B=o(Q);G=_,N=B.value,W=B.unit||z0($)}return{type:"scalar",property:$,isTransform:j,startValue:G,endValue:N,unit:W}}function PJ(){let J=new WeakMap;return{register($,Q){let q=J.get($);if(!q)q=new Set,J.set($,q);q.add(Q)},registerMany($,Q){for(let q of Q)this.register($,q)},get($){return J.get($)},clearRegistry($){J.delete($)}}}var a0=PJ(),M0=new WeakMap,r0=PJ();function yJ(J){if(T(J))return["transform"];if(l(J))return["filter"];if(i0(J))return["strokeDasharray","strokeDashoffset"];return[J]}function p6(J,$){if(T($)&&!M0.has(J)){if(J instanceof HTMLElement||J instanceof SVGElement){let q=J.style.transform;M0.set(J,q||null)}}let Q=yJ($);for(let q of Q)a0.register(J,q)}function c6(J,$){for(let Q of $)p6(J,Q)}function m6(J){a0.clearRegistry(J),M0.delete(J)}function g6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Q=new Set;for(let q of $)for(let Z of yJ(q))Q.add(Z);for(let q of Q)if(e(q))J.style.removeProperty(q);else J.style[q]=""}function s6(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=a0.get(J);if(!$||$.size===0)return;for(let Q of $){if(Q==="transform"){let q=M0.get(J);if(q!==void 0){if(q)J.style.transform=q;else J.style.removeProperty("transform");continue}}if(e(Q))J.style.removeProperty(Q);else J.style[Q]=""}}function o6(J){s6(J),m6(J)}function k0(J,$){r0.registerMany(J,$)}function t0(J){r0.clearRegistry(J)}function l6(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=r0.get(J);if(!$||$.size===0)return;for(let Q of $)J.style[Q]=""}function i6(J){l6(J),t0(J)}X.styleReset={registerAnimatedProps:c6,clearAnimationStylesForProps:g6,clearAnimationStylesAndUnregister:o6,clearPinStylesAndUnregister:i6};class C{static _registry=new Map;static _users=new Map;static getOrCreate(J,$){let Q=C._registry.get($);if(!Q)Q=new C(J),C._registry.set($,Q);let q=C._users.get($);if(!q)q=new Set,C._users.set($,q);return q.add(J),Q}static release(J,$){let Q=C._users.get($);if(!Q)return;if(Q.delete(J),Q.size===0){let q=C._registry.get($);C._registry.delete($),C._users.delete($),q?.cleanup()}}_id;_element=null;_originalStyles=null;_spacer=null;_currentState="before";_pinStart=0;_pinEnd=0;_pinDistance=0;_useFixedPin=!1;_pinSpacing;_elementHeight=0;_fixedTop=0;_fixedLeft=0;_width=0;constructor(J){this._id=J}setup(J,$,Q,q,Z,j){if(typeof document>"u")return;this._element=J,this._pinStart=$,this._pinEnd=Q;let z=this._pinDistance;this._pinDistance=Q-$,this._useFixedPin=Z,this._pinSpacing=j;let G=this._spacer!==null;if(G&&this._currentState==="pinned"&&Z)this._updateFixed("before");let N=J.getBoundingClientRect(),W=G&&this._spacer?window.getComputedStyle(this._spacer):window.getComputedStyle(J);if(this._elementHeight=N.height,!G)this._originalStyles={position:J.style.position,top:J.style.top,left:J.style.left,width:J.style.width,marginTop:J.style.marginTop,marginBottom:J.style.marginBottom,marginLeft:J.style.marginLeft,marginRight:J.style.marginRight,zIndex:J.style.zIndex};if(Z){this._fixedTop=q,this._fixedLeft=N.left,this._width=N.width;let _=this._resolvePinSpacing(),B=`
|
|
1
|
+
var{defineProperty:f0,getOwnPropertyNames:W6,getOwnPropertyDescriptor:N6}=Object,B6=Object.prototype.hasOwnProperty;function Y6(J){return this[J]}var _6=(J)=>{var $=(UJ??=new WeakMap).get(J),Q;if($)return $;if($=f0({},"__esModule",{value:!0}),J&&typeof J==="object"||typeof J==="function"){for(var q of W6(J))if(!B6.call($,q))f0($,q,{get:Y6.bind(J,q),enumerable:!(Q=N6(J,q))||Q.enumerable})}return UJ.set(J,$),$},UJ;var H6=(J)=>J;function X6(J,$){this[J]=H6.bind(null,$)}var K6=(J,$)=>{for(var Q in $)f0(J,Q,{get:$[Q],enumerable:!0,configurable:!0,set:X6.bind($,Q)})};var y7={};K6(y7,{Types:()=>$6,Timeline:()=>R,MotionUtils:()=>S0,Motion:()=>J6});module.exports=_6(y7);function C(J,$){switch(J){case"play":case"resume":$.play();break;case"pause":$.pause();break;case"reverse":$.reverse();break;case"restart":$.restart();break;case"reset":$.pause(),$.progress(0);break;case"complete":$.progress(1),$.pause();break;case"none":break;default:console.warn(`[Motion] Unknown timeline action: "${J}". Valid actions: play, pause, resume, reverse, restart, reset, complete, none`)}}var X={color:null,filter:null,drawSVG:null,stagger:null,textSplitter:null,triggerManager:null,styleReset:null,fit:null};class F{static _instance;static _triggerRegistry=new Map;static _pageLoadTriggerFactory=null;static _RESIZE_DEBOUNCE_MS=200;_pageLoadTrigger=null;_scrollTriggers=new Map;_eventTriggers=new Map;_mouseMoveTriggers=new Map;_gestureTriggers=new Map;_cursorTriggers=new Map;_pageExitTriggers=new Map;_resizeHandler=null;_resizeTimer=null;get _allTriggerMaps(){return[this._scrollTriggers,this._eventTriggers,this._mouseMoveTriggers,this._gestureTriggers,this._cursorTriggers,this._pageExitTriggers]}constructor(){}static getInstance(){if(!F._instance)F._instance=new F;return F._instance}static registerTrigger(J,$){F._triggerRegistry.set(J,$)}static registerPageLoadTrigger(J){F._pageLoadTriggerFactory=J}_getPageLoadTrigger(){if(!this._pageLoadTrigger&&F._pageLoadTriggerFactory)this._pageLoadTrigger=new F._pageLoadTriggerFactory;return this._pageLoadTrigger}_createTrigger(J,...$){let Q=F._triggerRegistry.get(J);if(!Q){let q=Array.from(F._triggerRegistry.keys());return console.warn(`[Motion SDK] Trigger type '${J}' is not available in this bundle. Available triggers: ${q.join(", ")||"none"}. Animations using .on${J.charAt(0).toUpperCase()+J.slice(1)}() will be skipped.`),null}return new Q(...$)}registerPageLoad(J,$){this.unregister(J);let Q=this._getPageLoadTrigger();if(Q)Q.register(J,$)}_attachResizeListener(){if(this._resizeHandler||typeof window>"u")return;this._resizeHandler=()=>{if(this._resizeTimer!==null)clearTimeout(this._resizeTimer);this._resizeTimer=setTimeout(()=>{this._resizeTimer=null,this.refreshScrollTriggers()},F._RESIZE_DEBOUNCE_MS)},window.addEventListener("resize",this._resizeHandler,{passive:!0})}_detachResizeListener(){if(!this._resizeHandler||typeof window>"u")return;if(window.removeEventListener("resize",this._resizeHandler),this._resizeTimer!==null)clearTimeout(this._resizeTimer),this._resizeTimer=null;this._resizeHandler=null}registerScroll(J,$){this.unregister(J);let Q=this._createTrigger("scroll",J,$);if(!Q)return;this._scrollTriggers.set(J,Q),J._trigger=Q,Q.enable(),this._attachResizeListener()}registerHover(J,$){this.unregister(J);let Q=this._createTrigger("event",J,{type:"hover",target:$.target,onLeave:$.onLeave,leaveDelay:$.leaveDelay});if(!Q)return;this._eventTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerClick(J,$){this.unregister(J);let Q=this._createTrigger("event",J,{type:"click",target:$.target,secondTarget:$.secondTarget,toggle:$.toggle,preventDefault:$.preventDefault});if(!Q)return;this._eventTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerMouseMove(J,$){this.unregister(J);let Q=this._createTrigger("mouseMove",J,$);if(!Q)return;this._mouseMoveTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerGesture(J,$){this.unregister(J);let Q=this._createTrigger("gesture",J,$);if(!Q)return;this._gestureTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerCursor(J,$){this.unregister(J);let Q=this._createTrigger("cursor",J,$);if(!Q)return;this._cursorTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerPageExit(J,$){this.unregister(J);let Q=this._createTrigger("pageExit",J,$);if(!Q)return;this._pageExitTriggers.set(J,Q),J._trigger=Q,Q.enable()}unregister(J){let $=this._getPageLoadTrigger();if($)$.unregister(J);for(let Q of this._allTriggerMaps){let q=Q.get(J);if(q)q.disable(),Q.delete(J)}if(J._trigger=void 0,this._scrollTriggers.size===0)this._detachResizeListener()}refreshScrollTriggers(){let J=Array.from(this._scrollTriggers.values()),$=typeof window<"u"?window.scrollY:0;J.sort((Q,q)=>{let Z=Q._pinManager?.getLayoutRect?.(),j=q._pinManager?.getLayoutRect?.();if(!Z&&!j)return 0;if(!Z)return 1;if(!j)return-1;return Z.top+$-(j.top+$)}),J.forEach((Q)=>Q.refresh?.()),this._eventTriggers.forEach((Q)=>Q.refresh?.()),this._gestureTriggers.forEach((Q)=>Q.refresh?.()),this._mouseMoveTriggers.forEach((Q)=>Q.refresh?.())}killAll(){let J=this._getPageLoadTrigger();if(J)J.clear();for(let $ of this._allTriggerMaps)$.forEach((Q)=>Q.disable()),$.clear();this._detachResizeListener()}static _reset(){if(F._instance){if(F._instance._pageLoadTrigger)F._instance._pageLoadTrigger._reset();F._instance.killAll(),F._instance=void 0}}}X.triggerManager={getInstance:F.getInstance};function AJ(J){if(typeof document>"u"){J();return}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",J,{once:!0});else J()}function IJ(J){if(J===null||typeof J!=="object")return!1;if(J instanceof Element)return!1;if("nodeType"in J)return!1;if("style"in J)return!1;let $=J;if("x"in $&&typeof $.x==="number")return!0;if("length"in J)return!1;return!0}function u0(J){return J instanceof Element||typeof J==="object"&&J!==null&&(("nodeType"in J)||("style"in J))}function X0(J){if(IJ(J))return[J];if(typeof J==="string"){if(typeof document<"u")try{return Array.from(document.querySelectorAll(J))}catch($){return console.warn(`[Motion] Invalid selector "${J}":`,$),[]}return[]}if(J instanceof Element)return[J];if(J&&typeof J==="object"&&"style"in J&&!Array.isArray(J))return[J];if(J instanceof NodeList)return Array.from(J);if(Array.isArray(J)){if(J.length===0)return[];if(typeof J[0]==="string"){if(typeof document>"u")return[];let $=[];for(let Q of J)try{$.push(...Array.from(document.querySelectorAll(Q)))}catch(q){console.warn(`[Motion] Invalid selector "${Q}":`,q)}return $}if(IJ(J[0]))return J;return J}if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}class v{_timeline;_config;_enabled=!1;constructor(J,$){this._timeline=J,this._config=$}enable(){if(this._enabled)return;this._enabled=!0,AJ(()=>{if(!this._enabled)return;this._onEnable()})}disable(){if(!this._enabled)return;this._enabled=!1,this._onDisable()}_resolveElement(J,$){if(J===void 0||J===null)return $??null;if(typeof J!=="string")return J;if(typeof document<"u")try{let Q=document.querySelector(J);if(Q!==null)return Q}catch(Q){console.warn(`[Motion] Invalid selector "${J}":`,Q)}return $??null}_resolveElements(J){if(J===void 0||J===null)return[];if(typeof J!=="string")return[J];if(typeof document<"u")try{let $=document.querySelectorAll(J);return Array.from($)}catch($){return console.warn(`[Motion] Invalid selector "${J}":`,$),[]}return[]}_cleanupListenerMap(J){J.forEach(($,Q)=>{$.forEach((q,Z)=>{Q.removeEventListener(Z,q)})}),J.clear()}}function h(J){let $=J,Q=$.style.transform,q=$.style.transition,Z=$.style.position,j=$.style.top,z=$.style.left,G=$.style.width;$.style.transition="none",$.style.transform="none";let W=typeof window<"u"&&typeof window.getComputedStyle==="function"&&window.getComputedStyle($).position==="fixed";if(W)$.style.position="",$.style.top="",$.style.left="",$.style.width="";let N=$.getBoundingClientRect();if($.style.transform=Q,$.style.transition=q,W)$.style.position=Z,$.style.top=j,$.style.left=z,$.style.width=G;return $.offsetHeight,N}class FJ extends v{_targets=[];_secondTargets=[];_listeners=new Map;_isForward=!0;_frozenRects=new Map;_wasHovering=!1;_hoverLeaveTimeout=null;_boundMouseMoveHandler=null;constructor(J,$){super(J,$)}_onEnable(){if(this._resolveTargets(),this._config.type==="hover")this._addHoverListeners();else if(this._config.type==="click")this._addClickListeners()}_onDisable(){if(this._boundMouseMoveHandler)window.removeEventListener("mousemove",this._boundMouseMoveHandler),this._boundMouseMoveHandler=null;if(this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;this._frozenRects.clear(),this._wasHovering=!1,this._cleanupListenerMap(this._listeners)}refresh(){if(this._config.type!=="hover")return;for(let J of this._targets)this._frozenRects.set(J,h(J))}_resolveTargets(){if(this._targets=this._resolveElements(this._config.target),this._config.secondTarget)this._secondTargets=this._resolveElements(this._config.secondTarget);else this._secondTargets=this._targets}_addHoverListeners(){let J=this._config.onLeave||"reverse",$=this._config.leaveDelay||0;for(let Q of this._targets)this._frozenRects.set(Q,h(Q));this._boundMouseMoveHandler=(Q)=>{let{clientX:q,clientY:Z}=Q,j=!1;for(let z of this._frozenRects.values())if(q>=z.left&&q<=z.right&&Z>=z.top&&Z<=z.bottom){j=!0;break}if(j&&!this._wasHovering){if(this._wasHovering=!0,this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;this._timeline.play()}else if(!j&&this._wasHovering){if(this._wasHovering=!1,J==="none")return;let z=()=>{this._handleLeaveAction(J),this._hoverLeaveTimeout=null};if($>0)this._hoverLeaveTimeout=window.setTimeout(z,$*1000);else z()}},window.addEventListener("mousemove",this._boundMouseMoveHandler)}_handleLeaveAction(J){C(J==="stop"?"reset":J,this._timeline)}_addClickListeners(){let J=this._config.toggle||"play",$=this._config.preventDefault||!1,Q=this._config.secondTarget&&this._config.secondTarget!==this._config.target;if(this._targets.forEach((q)=>{let Z=this._listeners.get(q)||new Map,j=(z)=>{if($)z.preventDefault();if(!Q)if(this._isForward){if(this._timeline.restart(),J!=="play")this._isForward=!1}else this._handleSecondClick(J),this._isForward=!0;else this._timeline.restart()};q.addEventListener("click",j),Z.set("click",j),this._listeners.set(q,Z)}),Q)this._secondTargets.forEach((q)=>{if(this._listeners.has(q))return;let Z=new Map,j=(z)=>{if($)z.preventDefault();this._handleSecondClick(J)};q.addEventListener("click",j),Z.set("click",j),this._listeners.set(q,Z)})}_handleSecondClick(J){C(J,this._timeline)}}F.registerTrigger("event",FJ);var c0={perspective:0,x:1,y:2,z:3,rotate:4,rotateX:5,rotateY:6,rotateZ:7,scale:8,scaleX:9,scaleY:10,scaleZ:11,skewX:12,skewY:13},LJ=["px","px","px","px","deg","deg","deg","deg","","","","","deg","deg"],$0=new WeakMap,K0=new WeakMap,D=[];function d(J){let $=J.trim().match(/([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z%]*)/i);if(!$)return{value:0,unit:""};return{value:parseFloat($[1]),unit:$[2]||""}}function J0(J,$){switch($){case"rad":return J*180/Math.PI;case"turn":return J*360;case"grad":return J*0.9;default:return J}}function i(J){let $=d(J);return J0($.value,$.unit||"deg")}function I(J,$,Q,q){let Z=c0[$];if(Z===void 0)return;J.values[Z]=Q;let j=q&&q.length>0?q:LJ[Z]||"";J.units[Z]=j,J.used|=1<<Z}function U6(J,$){let Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,q;while((q=Q.exec(J))!==null){let Z=q[1],j=q[2].match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?[a-z%]*/gi)||[];switch(Z){case"translate":{let z=j[0]?d(j[0]):{value:0,unit:""},G=j[1]?d(j[1]):{value:0,unit:""};I($,"x",z.value,z.unit),I($,"y",G.value,G.unit);break}case"translate3d":{let z=j[0]?d(j[0]):{value:0,unit:""},G=j[1]?d(j[1]):{value:0,unit:""},W=j[2]?d(j[2]):{value:0,unit:""};I($,"x",z.value,z.unit),I($,"y",G.value,G.unit),I($,"z",W.value,W.unit);break}case"translateX":{let z=j[0]?d(j[0]):{value:0,unit:""};I($,"x",z.value,z.unit);break}case"translateY":{let z=j[0]?d(j[0]):{value:0,unit:""};I($,"y",z.value,z.unit);break}case"translateZ":{let z=j[0]?d(j[0]):{value:0,unit:""};I($,"z",z.value,z.unit);break}case"scale":{let z=j[0]?parseFloat(j[0]):1,G=j[1]?parseFloat(j[1]):z;I($,"scaleX",z),I($,"scaleY",G);break}case"scale3d":{let z=j[0]?parseFloat(j[0]):1,G=j[1]?parseFloat(j[1]):1,W=j[2]?parseFloat(j[2]):1;I($,"scaleX",z),I($,"scaleY",G),I($,"scaleZ",W);break}case"scaleX":{let z=j[0]?parseFloat(j[0]):1;I($,"scaleX",z);break}case"scaleY":{let z=j[0]?parseFloat(j[0]):1;I($,"scaleY",z);break}case"scaleZ":{let z=j[0]?parseFloat(j[0]):1;I($,"scaleZ",z);break}case"rotate":I($,"rotate",j[0]?i(j[0]):0,"deg");break;case"rotateX":I($,"rotateX",j[0]?i(j[0]):0,"deg");break;case"rotateY":I($,"rotateY",j[0]?i(j[0]):0,"deg");break;case"rotateZ":I($,"rotateZ",j[0]?i(j[0]):0,"deg");break;case"skew":{let z=j[0]?i(j[0]):0,G=j[1]?i(j[1]):0;I($,"skewX",z,"deg"),I($,"skewY",G,"deg");break}case"skewX":I($,"skewX",j[0]?i(j[0]):0,"deg");break;case"skewY":I($,"skewY",j[0]?i(j[0]):0,"deg");break;case"perspective":{let z=j[0]?d(j[0]):{value:0,unit:""};I($,"perspective",z.value,z.unit);break}default:break}}}function d0(J,$,Q,q,Z,j,z,G,W,N,B,Y,U,_){if(U){let a=Math.hypot(J,$),j6=J*Z-$*q,G6=a!==0?j6/a:0,z6=a!==0?Math.atan2($,J):0,KJ=a!==0?Math.atan2(J*q+$*Z,a*a):0;if(I(_,"x",N,"px"),I(_,"y",B,"px"),I(_,"scaleX",a||1),I(_,"scaleY",G6||1),I(_,"rotate",J0(z6,"rad"),"deg"),Math.abs(KJ)>0.000001)I(_,"skewX",J0(KJ,"rad"),"deg");return}let H=Math.hypot(J,$,Q)||1,A=Math.hypot(q,Z,j)||1,K=Math.hypot(z,G,W)||1,M=J/H,k=$/H,L=Q/H,O=q/A,y=Z/A,P0=j/A,XJ=z/K,Q6=G/K,q6=W/K,y0=Math.sqrt(M*M+O*O),Z6=y0<0.000001,v0=0,h0=0,T0=0;if(!Z6)v0=Math.atan2(Q6,q6),h0=Math.atan2(-XJ,y0),T0=Math.atan2(O,M);else v0=Math.atan2(-P0,y),h0=Math.atan2(-XJ,y0),T0=0;I(_,"x",N,"px"),I(_,"y",B,"px"),I(_,"z",Y,"px"),I(_,"scaleX",H),I(_,"scaleY",A),I(_,"scaleZ",K),I(_,"rotateX",J0(v0,"rad"),"deg"),I(_,"rotateY",J0(h0,"rad"),"deg"),I(_,"rotateZ",J0(T0,"rad"),"deg")}function I6(J,$){if(!J||J==="none")return;if(typeof DOMMatrixReadOnly<"u"){let q=new DOMMatrixReadOnly(J);d0(q.m11,q.m12,q.m13,q.m21,q.m22,q.m23,q.m31,q.m32,q.m33,q.m41,q.m42,q.m43,q.is2D,$);return}let Q=J.match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];if(J.startsWith("matrix3d")&&Q.length>=16){let q=Q.map(Number);d0(q[0],q[1],q[2],q[4],q[5],q[6],q[8],q[9],q[10],q[12],q[13],q[14],!1,$);return}if(J.startsWith("matrix")&&Q.length>=6){let q=Q.map(Number);d0(q[0],q[1],0,q[2],q[3],0,0,0,1,q[4],q[5],0,!0,$)}}function A6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let q=J.style.transform;if(q&&q!=="none"){U6(q,$),$.cachedString=q;return}try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J),j=Z.transform||Z.getPropertyValue("transform");if(j&&j!=="none")I6(j,$),$.cachedString=j}}catch{}}function MJ(J){let $=$0.get(J);if(!$){let Q=new Float32Array(14);Q[8]=1,Q[9]=1,Q[10]=1,Q[11]=1,$={values:Q,units:[...LJ],dirty:0,used:0,cachedString:"",pinDirty:!1},A6(J,$),$0.set(J,$)}return $}function S(J,$,Q,q){let Z=MJ(J),j=c0[$];if(j!==void 0){if(Z.values[j]=Q,q!==void 0)Z.units[j]=q;if(Z.used|=1<<j,$==="scale")Z.values[9]=Q,Z.values[10]=Q,Z.dirty|=1536;else if($==="scaleX"||$==="scaleY")Z.values[8]=1,Z.dirty|=256;if($==="rotate")Z.values[7]=0,Z.dirty|=128;else if($==="rotateZ")Z.values[4]=0,Z.dirty|=16;Z.dirty|=1<<j}}function m0(J,$){let Q=MJ(J),q=c0[$];if(q===void 0)return $.startsWith("scale")?1:0;if($==="scale"){if(Q.values[q]!==1)return Q.values[q];let Z=Q.values[9],j=Q.values[10];if(Math.abs(Z-j)<0.000001&&Z!==1)return Z;return Q.values[q]}if($==="rotate"){if(Q.values[q]!==0)return Q.values[q];let Z=Q.values[7];if(Z!==0&&Q.values[5]===0&&Q.values[6]===0)return Z;return Q.values[q]}return Q.values[q]}function p0(J){return J===0?"0":`${Math.round(J)}px`}function OJ(J,$,Q){return`translate3d(${p0(J)}, ${p0($)}, ${p0(Q)})`}function U0(J,$,Q,q){K0.set(J,{x:$,y:Q,z:q});let Z=$0.get(J);if(Z)Z.pinDirty=!0}function G0(J){let $=K0.has(J);if(K0.delete(J),$){let Q=$0.get(J);if(Q)Q.pinDirty=!0}}function E(J){let $=$0.get(J),Q=K0.get(J);if(!$){if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0))return OJ(Q.x,Q.y,Q.z);return""}if($.dirty===0&&!$.pinDirty&&$.cachedString)return $.cachedString;let{values:q,units:Z}=$;D.length=0;let j=$.used,z=q[0];if(z!==0){let O=Z[0];D.push(`perspective(${z}${O})`)}let G=q[1],W=q[2],N=q[3],B=Z[1],Y=Z[2],U=Z[3],_=j&2,H=j&4,A=j&8;if(G!==0||W!==0||N!==0||_||H||A){let O=B===Y&&(N===0&&!A||Y===U);if(N!==0||A)if(O)D.push(`translate3d(${G}${B}, ${W}${Y}, ${N}${U})`);else{if(G!==0||_)D.push(`translateX(${G}${B})`);if(W!==0||H)D.push(`translateY(${W}${Y})`);D.push(`translateZ(${N}${U})`)}else if(O&&(G!==0||_)&&(W!==0||H))D.push(`translate(${G}${B}, ${W}${Y})`);else{if(G!==0||_)D.push(`translateX(${G}${B})`);if(W!==0||H)D.push(`translateY(${W}${Y})`)}}if(q[4]!==0||j&16)D.push(`rotate(${q[4]}deg)`);if(q[5]!==0||j&32)D.push(`rotateX(${q[5]}deg)`);if(q[6]!==0||j&64)D.push(`rotateY(${q[6]}deg)`);if(q[7]!==0||j&128)D.push(`rotateZ(${q[7]}deg)`);let K=j&256,M=j&512,k=j&1024;if(q[8]!==1||K)D.push(`scale(${q[8]})`);else if(q[9]!==1||q[10]!==1||M||k)D.push(`scaleX(${q[9]})`),D.push(`scaleY(${q[10]})`);if(q[11]!==1||j&2048)D.push(`scaleZ(${q[11]})`);if(q[12]!==0||j&4096)D.push(`skewX(${q[12]}deg)`);if(q[13]!==0||j&8192)D.push(`skewY(${q[13]}deg)`);let L=D.join(" ");if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0)){let O=OJ(Q.x,Q.y,Q.z);$.cachedString=L?`${O} ${L}`:O}else $.cachedString=L;return $.dirty=0,$.pinDirty=!1,$.cachedString}function P(J,$=!1){if($0.delete(J),$&&J instanceof HTMLElement)J.style.transform=""}var g0=new Set,I0=new Map,A0=!1;function F0(J){g0.add(J),A0=!0}function O0(J,$,Q){let q=I0.get(J);if(!q)q=new Map,I0.set(J,q);q.set($,Q),A0=!0}function s0(){if(!A0)return;for(let J of g0){let $=J;if($.style){let Q=E(J);$.style.transform=Q}}g0.clear();for(let[J,$]of I0){let Q=J;if(Q.style)for(let[q,Z]of $)try{if(q.startsWith("--"))Q.style.setProperty(q,Z);else Q.style[q]=Z}catch{}}I0.clear(),A0=!1}var r=!1;function Q0(){return r}function o0(J){if(r){J();return}r=!0;try{J(),s0()}finally{r=!1}}class w{static instance;listeners=[];_listenersDirty=!0;_listenersSnapshot=[];_isRunning=!1;rafId=null;lastTime=0;elapsedTime=0;lagThreshold=500;maxDelta=33;fpsFrames=0;fpsTime=0;currentFPS=60;lastFrameTime=0;constructor(){}static getInstance(){if(!w.instance)w.instance=new w;return w.instance}add(J,$=0){let Q=this.listeners.findIndex((q)=>q.callback===J);if(Q!==-1)this.listeners[Q].priority=$;else this.listeners.push({callback:J,priority:$});if(this.listeners.sort((q,Z)=>Z.priority-q.priority),this._listenersDirty=!0,!this._isRunning&&this.listeners.length>0)this.start()}remove(J){let $=this.listeners.findIndex((Q)=>Q.callback===J);if($!==-1)this.listeners.splice($,1),this._listenersDirty=!0;if(this.listeners.length===0&&this._isRunning)this.stop()}start(){if(this._isRunning)return;if(typeof requestAnimationFrame>"u"){this._isRunning=!1;return}this._isRunning=!0,this.lastTime=performance.now(),this.rafId=requestAnimationFrame(this.tick)}stop(){if(!this._isRunning)return;if(this._isRunning=!1,this.rafId!==null&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(this.rafId),this.rafId=null}pause(){this.stop()}resume(){if(this.listeners.length>0)this.start()}tick=()=>{if(!this._isRunning)return;let J=performance.now(),$=J-this.lastTime;if($>this.lagThreshold)$=this.maxDelta,this.lastTime=J-$;else this.lastTime=J;let Q=$/1000;if(this.elapsedTime+=Q,this.lastFrameTime=$,this.updateFPS($),r=!0,this._listenersDirty)this._listenersSnapshot=[...this.listeners],this._listenersDirty=!1;for(let q of this._listenersSnapshot)try{q.callback(Q,this.elapsedTime)}catch(Z){console.error("[Motion] Uncaught error in animation callback:",Z)}try{s0()}catch(q){console.error("[Motion] Uncaught error in render batch flush:",q)}if(r=!1,typeof requestAnimationFrame<"u")this.rafId=requestAnimationFrame(this.tick)};updateFPS(J){if(this.fpsFrames++,this.fpsTime+=J,this.fpsTime>=1000)this.currentFPS=Math.round(this.fpsFrames*1000/this.fpsTime),this.fpsFrames=0,this.fpsTime=0}getFPS(){return this.currentFPS}getLastDelta(){return this.lastFrameTime}isRunning(){return this._isRunning}isInTick(){return r}getListenerCount(){return this.listeners.length}removeAll(){this.listeners=[],this.stop()}}var c=null,q0=null,F6=100,p=new Map;function O6(J){let $=p.get(J);if($!==void 0)p.delete(J),p.set(J,$);return $}function L6(J,$){if(p.has(J))p.delete(J);while(p.size>=F6){let Q=p.keys().next().value;if(Q!==void 0)p.delete(Q);else break}p.set(J,$)}function M6(J){return/^\s*[Mm]/.test(J)}function kJ(){if(q0)return q0;if(typeof document>"u")throw Error("PathParser requires a browser environment");return c=document.createElementNS("http://www.w3.org/2000/svg","svg"),c.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;",c.setAttribute("aria-hidden","true"),q0=document.createElementNS("http://www.w3.org/2000/svg","path"),c.appendChild(q0),document.body.appendChild(c),q0}function DJ(J){if(J instanceof Element)return J.getAttribute("d");if(typeof J==="string"){if(M6(J))return J;if(typeof document<"u"){let $=document.querySelector(J);if($)return $.getAttribute("d")}}return null}function EJ(J){let $=O6(J);if($!==void 0)return $;try{let Q=kJ();Q.setAttribute("d",J);let q=Q.getTotalLength();return L6(J,q),q}catch{return 0}}function l0(J,$,Q=!1){try{let q=kJ();q.setAttribute("d",J);let Z=q.getTotalLength(),j=Math.max(0,Math.min(1,$)),z=Z*j,G=q.getPointAtLength(z),W=0;if(Q)W=k6(q,z,Z);return{x:G.x,y:G.y,angle:W}}catch{return{x:0,y:0,angle:0}}}function k6(J,$,Q){let q=Math.min(0.1,Q*0.001),Z=Math.max(0,$-q),j=Math.min(Q,$+q),z=J.getPointAtLength(Z),G=J.getPointAtLength(j),W=G.x-z.x,N=G.y-z.y;return Math.atan2(N,W)*(180/Math.PI)}function RJ(J,$=[50,50]){if(!J)return{x:0,y:0};let Q=null;if(J instanceof Element)Q=J;else if(typeof J==="string"&&typeof document<"u")Q=document.querySelector(J);if(!Q||typeof Q.getBoundingClientRect!=="function")return{x:0,y:0};let q=Q.getBoundingClientRect(),Z=q.width*$[0]/100,j=q.height*$[1]/100;return{x:Z,y:j}}function bJ(J,$,Q){if(!J)return{x:0,y:0};let q=null;if(J instanceof Element)q=J;else if(typeof J==="string"&&typeof document<"u")q=document.querySelector(J);if(!q)return{x:0,y:0};let Z=l0($,0,!1);if(Q&&Q instanceof HTMLElement){let j=Q.style.transform,z=j&&j!=="none"&&j!=="";if(z)Q.style.transform="none";let G=Q.getBoundingClientRect(),W=q.getBoundingClientRect();if(z)Q.style.transform=j;let N=W.left+W.width/2-(G.left+G.width/2),B=W.top+W.height/2-(G.top+G.height/2);return{x:N-Z.x,y:B-Z.y}}return{x:-Z.x,y:-Z.y}}function wJ(){if(c&&c.parentNode)c.parentNode.removeChild(c);c=null,q0=null,p.clear()}var D6=new Set(["perspective","x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY"]),E6=new Set(["perspective","x","y","z","width","height","top","left","right","bottom","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderRadius","fontSize","lineHeight"]),R6=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),b6=new Set(["opacity","scale","scaleX","scaleY","scaleZ","z-index","zIndex"]),w6=new Set(["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","caretColor","fill","stroke"]),x6=new Set(["red","green","blue","yellow","orange","purple","pink","cyan","magenta","white","black","gray","grey","transparent","crimson","gold","silver","navy","teal","maroon","olive","lime","aqua","fuchsia","coral","salmon","tomato","indigo"]);function T(J){return D6.has(J)}function t(J){return w6.has(J)}function l(J){return J==="filter"}function i0(J){return J==="drawSVG"}function n0(J){return J==="path"}function e(J){return J.startsWith("--")}function xJ(J){if(typeof J!=="string")return!1;let $=J.trim().toLowerCase();if($.startsWith("#"))return!0;if(/^(rgb|rgba|hsl|hsla)\s*\(/.test($))return!0;let Q=X.color;if(Q)return Q.parseColor($)!==null;return x6.has($)}function o(J){if(typeof J==="number"){if(isNaN(J)||!isFinite(J))return console.warn(`[Motion] Property value is ${J}. This property will not animate correctly.`),{value:0,unit:""};return{value:J,unit:""}}if(typeof J==="string"){let $=J.match(/^([+\-*/])=(.+)/);if($){let q=$[2].match(/([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)/i);if(q)return{value:parseFloat(q[1]),unit:q[2]||""}}let Q=J.match(/([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)/i);if(Q)return{value:parseFloat(Q[1]),unit:Q[2]||""}}return{value:0,unit:""}}function z0(J){if(b6.has(J))return"";if(R6.has(J))return"deg";if(E6.has(J))return"px";return""}function CJ(J){if(J==="opacity")return 1;if(J.startsWith("scale"))return 1;return 0}function L0(J,$){if(!(J instanceof Element)){let Q=J;if($ in Q)return Q[$];return C6($)}if(T($))return m0(J,$);try{if(typeof window<"u"&&window.getComputedStyle){let q=window.getComputedStyle(J).getPropertyValue(m($));if(q)return o(q).value}}catch(Q){}return CJ($)}function VJ(J,$){let Q=J,q=m($);if(T($)){let Z=Q.style.transform;P(J),Q.style.transform="";let j=m0(J,$);return Q.style.transform=Z,P(J),{value:j,unit:z0($)}}try{if(typeof window<"u"&&window.getComputedStyle){let Z=Q.style.getPropertyValue(q);Q.style.removeProperty(q);let z=window.getComputedStyle(J).getPropertyValue(q);if(Z)Q.style.setProperty(q,Z);if(z){let G=o(z);return{value:G.value,unit:G.unit}}}}catch(Z){}return{value:CJ($),unit:z0($)}}function C6(J){if(J.startsWith("scale"))return 1;return 0}function m(J){return J.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)}function V6(J){if(typeof J==="string")return/^[+\-*/]=/.test(J);return!1}function S6(J){let $=J.match(/^([+\-*/])=/);return $?$[0]:null}function P6(J,$,Q){switch(Q){case"+=":return J+$;case"-=":return J-$;case"*=":return J*$;case"/=":return $!==0?J/$:J;default:return $}}function y6(J,$,Q,q){let Z=X.color;if(!Z)return null;let j=String(Q),z=j===""?Z.getCurrentColor(J,$):Z.parseColor(j,J),G=q!==void 0?Z.parseColor(String(q),J):Z.getCurrentColor(J,$);return{type:"color",property:$,isTransform:!1,startColor:G||new Float32Array([0,0,0,1]),endColor:z||new Float32Array([0,0,0,1])}}function v6(J,$,Q,q){let Z=X.filter;if(!Z)return null;let j=String(Q),z=j===""?Z.getCurrentFilter(J):Z.parseFilter(j),G=q!==void 0?Z.parseFilter(String(q)):Z.getCurrentFilter(J);G=G||[],z=z||[];let W=Z.mergeFilterArrays(G,z);return{type:"filter",property:$,isTransform:!1,startFilters:W.start,endFilters:W.end}}function h6(J,$,Q,q){if(xJ(Q)||q!==void 0&&xJ(q)){let G=X.color;if(G){let W=String(Q),N=G.parseColor(W,J),B=q!==void 0?G.parseColor(String(q),J):T6(J,$);return{type:"color",property:$,isTransform:!1,startColor:B||new Float32Array([0,0,0,1]),endColor:N||new Float32Array([0,0,0,1])}}}let j=o(Q),z;if(q!==void 0)z=o(q).value;else z=f6(J,$);return{type:"scalar",property:$,isTransform:!1,startValue:z,endValue:j.value,unit:j.unit}}function T6(J,$){let Q=X.color;if(!Q)return null;try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue($).trim();if(Z)return Q.parseColor(Z,J)}}catch{}return null}function f6(J,$){try{if(typeof window<"u"&&window.getComputedStyle){let q=window.getComputedStyle(J).getPropertyValue($).trim();if(q)return o(q).value}}catch{}return 0}function u6(J,$,Q,q){let Z=X.drawSVG;if(!Z)return null;let j=Z.getPathLength(J),z=Z.parseDrawSVG(Q,J)||{start:0,end:1},G=q!==void 0?Z.parseDrawSVG(q,J)||{start:0,end:1}:Z.getCurrentDrawSVG(J);return{type:"drawSVG",property:$,isTransform:!1,startDraw:G,endDraw:z,length:j}}function d6(J,$,Q,q){let Z=Q,j=q,z=Z?.target?Z:j;if(!z?.target)return null;let G=DJ(z.target);if(!G)return null;let W=EJ(G);if(W===0)return null;let N,B;if(Z?.target&&j?.target)N=j.start??0,B=Z.end??1;else if(Z?.target)N=Z.start??0,B=Z.end??1;else N=j.start??0,B=j.end??1;let Y=Z?.rotate??j?.rotate??!1,U=Z?.alignAt??j?.alignAt??[50,50],_=RJ(J,U),H=Z?.align??j?.align,A=bJ(H,G,J);return{type:"path",property:$,isTransform:!1,pathData:G,pathLength:W,startProgress:N,endProgress:B,rotate:Y,alignOffset:_,pathOffset:A}}function SJ(J,$,Q,q){let Z=J instanceof Element;if(Z&&e($))return h6(J,$,Q,q);if(Z&&t($)){let B=y6(J,$,Q,q);if(B)return B}if(Z&&l($)){let B=v6(J,$,Q,q);if(B)return B}if(Z&&i0($)){let B=u6(J,$,Q,q);if(B)return B}if(Z&&n0($)){let B=d6(J,$,Q,q);if(B)return B}let j=T($),z=q===void 0&&V6(Q),G,W,N;if(q!==void 0){let B=o(q),Y=o(Q);G=B.value,W=Y.value,N=Y.unit||B.unit||z0($)}else if(z){let B=S6(Q),Y=L0(J,$),U=o(Q);G=Y,W=P6(Y,U.value,B),N=U.unit||z0($)}else{let B=L0(J,$),Y=o(Q);G=B,W=Y.value,N=Y.unit||z0($)}return{type:"scalar",property:$,isTransform:j,startValue:G,endValue:W,unit:N}}function PJ(){let J=new WeakMap;return{register($,Q){let q=J.get($);if(!q)q=new Set,J.set($,q);q.add(Q)},registerMany($,Q){for(let q of Q)this.register($,q)},get($){return J.get($)},clearRegistry($){J.delete($)}}}var a0=PJ(),M0=new WeakMap,r0=PJ();function yJ(J){if(T(J))return["transform"];if(l(J))return["filter"];if(i0(J))return["strokeDasharray","strokeDashoffset"];return[J]}function p6(J,$){if(T($)&&!M0.has(J)){if(J instanceof HTMLElement||J instanceof SVGElement){let q=J.style.transform;M0.set(J,q||null)}}let Q=yJ($);for(let q of Q)a0.register(J,q)}function c6(J,$){for(let Q of $)p6(J,Q)}function m6(J){a0.clearRegistry(J),M0.delete(J)}function g6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Q=new Set;for(let q of $)for(let Z of yJ(q))Q.add(Z);for(let q of Q)if(e(q))J.style.removeProperty(q);else J.style[q]=""}function s6(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=a0.get(J);if(!$||$.size===0)return;for(let Q of $){if(Q==="transform"){let q=M0.get(J);if(q!==void 0){if(q)J.style.transform=q;else J.style.removeProperty("transform");continue}}if(e(Q))J.style.removeProperty(Q);else J.style[Q]=""}}function o6(J){s6(J),m6(J)}function k0(J,$){r0.registerMany(J,$)}function t0(J){r0.clearRegistry(J)}function l6(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=r0.get(J);if(!$||$.size===0)return;for(let Q of $)J.style[Q]=""}function i6(J){l6(J),t0(J)}X.styleReset={registerAnimatedProps:c6,clearAnimationStylesForProps:g6,clearAnimationStylesAndUnregister:o6,clearPinStylesAndUnregister:i6};class x{static _registry=new Map;static _users=new Map;static getOrCreate(J,$){let Q=x._registry.get($);if(!Q)Q=new x(J),x._registry.set($,Q);let q=x._users.get($);if(!q)q=new Set,x._users.set($,q);return q.add(J),Q}static release(J,$){let Q=x._users.get($);if(!Q)return;if(Q.delete(J),Q.size===0){let q=x._registry.get($);x._registry.delete($),x._users.delete($),q?.cleanup()}}_id;_element=null;_originalStyles=null;_spacer=null;_currentState="before";_pinStart=0;_pinEnd=0;_pinDistance=0;_useFixedPin=!1;_pinSpacing;_elementHeight=0;_fixedTop=0;_fixedLeft=0;_width=0;constructor(J){this._id=J}setup(J,$,Q,q,Z,j){if(typeof document>"u")return;this._element=J,this._pinStart=$,this._pinEnd=Q;let z=this._pinDistance;this._pinDistance=Q-$,this._useFixedPin=Z,this._pinSpacing=j;let G=this._spacer!==null;if(G&&this._currentState==="pinned"&&Z)this._updateFixed("before");let W=J.getBoundingClientRect(),N=G&&this._spacer?window.getComputedStyle(this._spacer):window.getComputedStyle(J);if(this._elementHeight=W.height,!G)this._originalStyles={position:J.style.position,top:J.style.top,left:J.style.left,width:J.style.width,marginTop:J.style.marginTop,marginBottom:J.style.marginBottom,marginLeft:J.style.marginLeft,marginRight:J.style.marginRight,zIndex:J.style.zIndex};if(Z){this._fixedTop=q,this._fixedLeft=W.left,this._width=W.width;let B=this._resolvePinSpacing(),Y=`
|
|
2
2
|
display: block;
|
|
3
3
|
box-sizing: content-box;
|
|
4
|
-
width: ${
|
|
5
|
-
height: ${
|
|
6
|
-
margin-top: ${
|
|
7
|
-
margin-left: ${
|
|
8
|
-
margin-right: ${
|
|
4
|
+
width: ${W.width}px;
|
|
5
|
+
height: ${W.height}px;
|
|
6
|
+
margin-top: ${N.marginTop};
|
|
7
|
+
margin-left: ${N.marginLeft};
|
|
8
|
+
margin-right: ${N.marginRight};
|
|
9
9
|
overflow: visible;
|
|
10
|
-
`;if(
|
|
10
|
+
`;if(B==="padding")Y+=`padding-bottom: ${this._pinDistance}px;`,Y+=`margin-bottom: ${N.marginBottom};`;else if(B==="margin"){let U=parseFloat(N.marginBottom)||0,_=G?U-z:U;Y+=`margin-bottom: ${_+this._pinDistance}px;`}else Y+=`margin-bottom: ${N.marginBottom};`;if(!this._spacer)this._spacer=document.createElement("div"),J.parentNode?.insertBefore(this._spacer,J),this._spacer.appendChild(J),J.style.marginTop="0",J.style.marginBottom="0",J.style.marginLeft="0",J.style.marginRight="0";this._spacer.style.cssText=Y,this._spacer.setAttribute("data-scrolltrigger-spacer",String(this._id))}this._currentState="before"}update(J){if(!this._element)return;let $=J<this._pinStart?"before":J<this._pinEnd?"pinned":"after";if(this._useFixedPin){if($!==this._currentState)this._updateFixed($),this._currentState=$}else if($!==this._currentState||$==="pinned")this._updateTransform($,J),this._currentState=$}cleanup(){if(this._element&&x._registry.get(this._element)===this)x._registry.delete(this._element),x._users.delete(this._element);if(this._element&&this._originalStyles){let J=this._element;G0(J),J.style.position=this._originalStyles.position,J.style.top=this._originalStyles.top,J.style.left=this._originalStyles.left,J.style.width=this._originalStyles.width,J.style.marginTop=this._originalStyles.marginTop,J.style.marginBottom=this._originalStyles.marginBottom,J.style.marginLeft=this._originalStyles.marginLeft,J.style.marginRight=this._originalStyles.marginRight,J.style.zIndex=this._originalStyles.zIndex,J.style.transform="",t0(J)}if(this._spacer?.parentNode&&this._element)this._spacer.parentNode.insertBefore(this._element,this._spacer),this._spacer.parentNode.removeChild(this._spacer);this._element=null,this._originalStyles=null,this._spacer=null,this._currentState="before",this._pinSpacing=void 0}getElement(){return this._element}getPinDistance(){return this._pinDistance}getState(){return this._currentState}getLayoutRect(){if(this._spacer?.parentNode){let J=this._spacer.getBoundingClientRect();return{top:J.top,left:J.left,width:J.width,height:this._elementHeight,bottom:J.top+this._elementHeight,right:J.left+J.width}}return null}isFixedPin(){return this._useFixedPin}_resolvePinSpacing(){if(this._pinSpacing===!1)return!1;if(this._pinSpacing==="margin")return"margin";return"padding"}_updateFixed(J){let $=this._element;if(J==="before")$.style.position=this._originalStyles?.position||"",$.style.top=this._originalStyles?.top||"",$.style.left=this._originalStyles?.left||"",$.style.width=this._originalStyles?.width||"",$.style.marginTop="0",$.style.marginLeft="0",$.style.zIndex=this._originalStyles?.zIndex||"",G0($),$.style.transform=E($);else if(J==="pinned")$.style.position="fixed",$.style.top=`${this._fixedTop}px`,$.style.left=`${this._fixedLeft}px`,$.style.width=`${this._width}px`,$.style.marginTop="0",$.style.marginLeft="0",$.style.zIndex="100",G0($),$.style.transform=E($),k0($,["position","top","left","width","marginTop","marginLeft","zIndex","transform"]);else $.style.position=this._originalStyles?.position||"",$.style.top=this._originalStyles?.top||"",$.style.left=this._originalStyles?.left||"",$.style.width=this._originalStyles?.width||"",$.style.marginTop="0",$.style.marginLeft="0",$.style.zIndex=this._originalStyles?.zIndex||"",U0($,0,this._pinDistance,0),$.style.transform=E($)}_updateTransform(J,$){let Q=this._element;if(J==="before")Q.style.zIndex=this._originalStyles?.zIndex||"",G0(Q),Q.style.transform=E(Q);else if(J==="pinned"){let q=Math.round($-this._pinStart);Q.style.zIndex="100",U0(Q,0,q,0),Q.style.transform=E(Q),k0(Q,["transform","zIndex"])}else Q.style.zIndex=this._originalStyles?.zIndex||"",U0(Q,0,this._pinDistance,0),Q.style.transform=E(Q),k0(Q,["transform","zIndex"])}}function V(J,$,Q,q){if(!J)return 0;let Z=J.trim().toLowerCase(),j=Z.match(/^(top|center|bottom)([+-])(-?\d+(?:\.\d+)?)(px|%|vh|vw)?$/);if(j){let G=j[1],W=j[2]==="-"?-1:1,N=parseFloat(j[3]),B=j[4]||"px",Y=0;switch(G){case"top":Y=0;break;case"center":Y=$/2;break;case"bottom":Y=$;break}let U=vJ(N,B,$,Q,q);return Y+W*U}switch(Z){case"top":return 0;case"center":return $/2;case"bottom":return $}let z=Z.match(/^(-?\d+(?:\.\d+)?)(px|%|vh|vw)?$/);if(z){let G=parseFloat(z[1]),W=z[2]||"px";return vJ(G,W,$,Q,q)}return 0}function vJ(J,$,Q,q,Z){switch($){case"px":return J;case"%":return J/100*Q;case"vh":return J/100*q;case"vw":return J/100*(Z??(typeof window<"u"?window.innerWidth:0));default:return J}}class e0{_id;_markers;_markerContainer;_triggerElement;_scrollerStartOffset=0;_scrollerEndOffset=0;_scroller=window;_startConfig="top top";_endConfig="bottom top";constructor(J){this._id=J}setup(J){if(typeof document>"u")return;this._scroller=J.scroller,this._triggerElement=J.triggerElement||void 0,this._startConfig=J.startConfig,this._endConfig=J.endConfig;let $=J.markerConfig,Q=(typeof $==="object"?$.startColor:null)||"lime",q=(typeof $==="object"?$.endColor:null)||"red",Z=(typeof $==="object"?$.fontSize:null)||"10px",j=this._scroller!==window,z=J.viewportHeight,G=this._startConfig.split(" "),W=V(G[1]||"top",z,z),N=this._endConfig.startsWith("+=")?W:V(this._endConfig.split(" ")[1]||"top",z,z);this._markerContainer=document.createElement("div"),this._markerContainer.setAttribute("data-scrolltrigger-markers",String(this._id)),this._markerContainer.style.cssText="position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 9999;";let B=(A,K,M)=>{let k=document.createElement("div");k.setAttribute("data-marker",A),k.style.cssText=`
|
|
11
11
|
position: absolute;
|
|
12
12
|
${M}: 0;
|
|
13
13
|
height: 1px;
|
|
@@ -26,9 +26,9 @@ var{defineProperty:f0,getOwnPropertyNames:N6,getOwnPropertyDescriptor:W6}=Object
|
|
|
26
26
|
white-space: nowrap;
|
|
27
27
|
border-radius: 2px;
|
|
28
28
|
line-height: 1.2;
|
|
29
|
-
`,k.appendChild(L),k},B=_("scroller-start",Q,"right"),U=_("scroller-end",q,"right"),Y=_("start",Q,"left"),H=_("end",q,"left");if(!this._triggerElement)Y.style.display="none",H.style.display="none";if(this._markerContainer.appendChild(B),this._markerContainer.appendChild(U),this._markerContainer.appendChild(Y),this._markerContainer.appendChild(H),this._markers={scrollerStart:B,scrollerEnd:U,elementStart:Y,elementEnd:H},j){let A=this._scroller;if(window.getComputedStyle(A).position==="static")A.style.position="relative";A.appendChild(this._markerContainer)}else document.body.appendChild(this._markerContainer),this._markerContainer.style.position="fixed";this._scrollerStartOffset=N,this._scrollerEndOffset=W}update(J,$,Q){if(!this._markers||!this._markerContainer)return;this._triggerElement=$||void 0;let q=this._scroller!==window;if(q)this._markers.scrollerStart.style.top=`${J+this._scrollerStartOffset}px`,this._markers.scrollerEnd.style.top=`${J+this._scrollerEndOffset}px`;else this._markers.scrollerStart.style.top=`${this._scrollerStartOffset}px`,this._markers.scrollerEnd.style.top=`${this._scrollerEndOffset}px`;if(this._triggerElement){let Z=V(this._triggerElement),j=S(this._startConfig.split(" ")[0]||"top",Z.height,Q),z=this._endConfig.startsWith("+=")?j:S(this._endConfig.split(" ")[0]||"bottom",Z.height,Q);if(this._markers.elementStart.style.display="",this._markers.elementEnd.style.display="",q){let G=this._scroller.getBoundingClientRect(),N=Z.top-G.top+J;this._markers.elementStart.style.top=`${N+j}px`,this._markers.elementEnd.style.top=`${N+z}px`}else this._markers.elementStart.style.top=`${Z.top+j}px`,this._markers.elementEnd.style.top=`${Z.top+z}px`}else this._markers.elementStart.style.display="none",this._markers.elementEnd.style.display="none"}cleanup(){if(this._markerContainer&&this._markerContainer.parentNode)this._markerContainer.parentNode.removeChild(this._markerContainer);this._markerContainer=void 0,this._markers=void 0,this._triggerElement=void 0}}class g extends h{static _nextId=0;_id;static _SCRUB_TICKER_PRIORITY=1;static _activeInstances=new Set;static _loadListenerAdded=!1;_scrollListener;_scrubTickListener=null;_currentProgress=0;_targetProgress=0;_scrubLag=0;_scroller;_triggerStart=0;_triggerEnd=0;_pinManager=null;_markerManager=null;_triggerState="before";_toggleActions=["play","reverse","play","reverse"];_initializing=!1;constructor(J,$){super(J,$);this._id=g._nextId++,this._scrubLag=typeof $.scrub==="number"?$.scrub:0}static _ensureLoadListener(){if(g._loadListenerAdded||typeof window>"u")return;if(g._loadListenerAdded=!0,document.readyState==="complete")return;window.addEventListener("load",()=>{setTimeout(()=>{for(let J of g._activeInstances)J.refresh()},100)},{once:!0})}_resolveScroller(){if(this._config.scroller)if(typeof this._config.scroller==="string"){if(typeof document>"u"){this._scroller=window;return}try{let J=document.querySelector(this._config.scroller);this._scroller=J??window}catch(J){console.warn(`[Motion] Invalid scroller selector "${this._config.scroller}":`,J),this._scroller=window}}else this._scroller=this._config.scroller;else this._scroller=window}_resolvePinElement(){if(!this._config.pin||typeof document>"u")return null;if(typeof this._config.pin==="string")return document.querySelector(this._config.pin);else if(this._config.pin===!0){let J=this._timeline.getFirstChildAnimation();if(J){let $=J.getTargets();if($.length>0&&$[0]instanceof HTMLElement)return $[0]}}return null}_defaultStart(){return this._config.start||(this._config.pin?"top top":"top bottom")}_defaultEnd(){return this._config.end||"bottom top"}_getFirstAnimatedElement(){let J=this._timeline.getFirstChildAnimation();if(J){let $=J.getTargets();if($.length>0&&$[0]instanceof HTMLElement)return $[0]}return null}_resolveTriggerElement(){if(this._config.target instanceof HTMLElement)return this._config.target;if(typeof this._config.target==="string"&&typeof document<"u"){let J=document.querySelector(this._config.target);if(J instanceof HTMLElement)return J}return this._getFirstAnimatedElement()}_calculateTriggerPositions(J){let $=J||this._resolveTriggerElement(),Q=this._getViewportHeight(),q=this._getScrollTop();if(!$){this._triggerStart=0,this._triggerEnd=this._getScrollHeight();return}let Z=this._pinManager?.getLayoutRect()??V($),j;if(this._scroller instanceof Element){let Y=this._scroller.getBoundingClientRect();j=Z.top-Y.top+q}else j=Z.top+q;let G=this._defaultStart().split(" "),N=G[0]||"top",W=G[1]||"top",_=S(N,Z.height,Q),B=S(W,Q,Q);this._triggerStart=j+_-B;let U=this._defaultEnd();if(U.startsWith("+=")){let Y=S(U.slice(2),Q,Q);this._triggerEnd=this._triggerStart+Y}else{let Y=U.split(" "),H=Y[0]||"bottom",A=Y[1]||"top",K=S(H,Z.height,Q),M=S(A,Q,Q);this._triggerEnd=j+K-M}if(this._triggerEnd<=this._triggerStart)this._triggerEnd=this._triggerStart+Math.max(Q,100)}_onEnable(){this._resolveScroller();let J=this._resolvePinElement();this._calculateTriggerPositions(J),g._activeInstances.add(this),g._ensureLoadListener();let Q=(this._config.toggleActions||"play reverse play reverse").trim().split(/\s+/);if(this._toggleActions=[Q[0]||"play",Q[1]||"reverse",Q[2]||"play",Q[3]||"reverse"],J){let Z=this._defaultStart().split(" "),j=this._getViewportHeight(),z=S(Z[0]||"top",J.getBoundingClientRect().height,j),N=S(Z[1]||"top",j,j)-z;this._pinManager=C.getOrCreate(this._id,J),this._pinManager.setup(J,this._triggerStart,this._triggerEnd,N,this._scroller===window,this._config.pinSpacing)}if(this._config.markers&&typeof document<"u"){let q=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager=new e0(this._id),this._markerManager.setup({scroller:this._scroller,triggerElement:q,startConfig:this._defaultStart(),endConfig:this._defaultEnd(),markerConfig:this._config.markers,viewportHeight:this._getViewportHeight()})}if(this._scrollListener=()=>this._onScroll(),this._scroller){if(this._scroller.addEventListener("scroll",this._scrollListener,{passive:!0}),this._initializing=!0,this._onScroll(),this._initializing=!1,this._config.scrub===!1||this._config.scrub===void 0){if(this._triggerState==="active")x(this._toggleActions[0],this._timeline);else if(this._triggerState==="after")this._timeline.progress(1),this._timeline.pause()}}}_onDisable(){if(this._scrollListener&&this._scroller)this._scroller.removeEventListener("scroll",this._scrollListener);if(this._markerManager?.cleanup(),this._markerManager=null,this._pinManager){let J=this._pinManager.getElement();if(J)C.release(this._id,J);else this._pinManager.cleanup();this._pinManager=null}this._stopSmoothScrollLoop(),g._activeInstances.delete(this)}refresh(){if(!this._enabled)return;let J=this._pinManager?.getElement()||null;if(this._calculateTriggerPositions(J),this._pinManager&&J){let Q=this._defaultStart().split(" "),q=this._getViewportHeight(),Z=this._pinManager.getLayoutRect()?.height??J.getBoundingClientRect().height,j=S(Q[0]||"top",Z,q),G=S(Q[1]||"top",q,q)-j;this._pinManager.setup(J,this._triggerStart,this._triggerEnd,G,this._scroller===window,this._config.pinSpacing)}if(this._markerManager&&this._config.markers){let $=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager.setup({scroller:this._scroller,triggerElement:$,startConfig:this._defaultStart(),endConfig:this._defaultEnd(),markerConfig:this._config.markers,viewportHeight:this._getViewportHeight()})}this._onScroll()}_getViewportHeight(){if(this._scroller===window)return typeof window<"u"?window.innerHeight:0;else if(this._scroller instanceof Element)return this._scroller.clientHeight;return 0}_getScrollTop(){if(this._scroller===window)return typeof window<"u"?window.scrollY||window.pageYOffset:0;else if(this._scroller instanceof Element)return this._scroller.scrollTop;return 0}_getScrollHeight(){if(this._scroller===window){if(typeof document<"u"&&document.documentElement)return document.documentElement.scrollHeight-window.innerHeight;return 0}else if(this._scroller instanceof Element)return this._scroller.scrollHeight-this._scroller.clientHeight;return 0}_onScroll(){if(!this._enabled)return;let J=this._getScrollTop(),$=this._triggerEnd-this._triggerStart,Q=$>0?(J-this._triggerStart)/$:0;if(Q=Math.max(0,Math.min(1,Q)),Q=this._applySnap(Q),this._targetProgress=Q,this._pinManager?.update(J),this._markerManager){let q=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager.update(J,q,this._getViewportHeight())}if(this._config.scrub!==!1&&this._config.scrub!==void 0)if(this._scrubLag===0)this._currentProgress=this._targetProgress,o0(()=>this._timeline.progress(this._currentProgress));else this._startSmoothScrollLoop();else{let q;if(Q<=0)q="before";else if(Q>=1)q="after";else q="active";if(q!==this._triggerState){let Z=this._triggerState;if(this._triggerState=q,this._initializing)return;o0(()=>{if(q==="active"&&Z==="before")x(this._toggleActions[0],this._timeline);else if(q==="after"&&Z==="active")x(this._toggleActions[1],this._timeline);else if(q==="active"&&Z==="after")x(this._toggleActions[2],this._timeline);else if(q==="before"&&Z==="active")x(this._toggleActions[3],this._timeline);else if(q==="after"&&Z==="before")x(this._toggleActions[0],this._timeline),this._timeline.progress(1),x(this._toggleActions[1],this._timeline);else if(q==="before"&&Z==="after")x(this._toggleActions[2],this._timeline),this._timeline.progress(0),x(this._toggleActions[3],this._timeline)})}}}_applySnap(J){let $=this._config.snap;if($==null)return J;if(typeof $==="function")return $(J);if(Array.isArray($)){let Q=$[0]??J,q=Math.abs(J-Q);for(let Z=1;Z<$.length;Z++){let j=Math.abs(J-$[Z]);if(j<q)q=j,Q=$[Z]}return Q}if(typeof $==="number"&&$>0)return Math.round(J/$)*$;return J}_startSmoothScrollLoop(){if(this._scrubTickListener)return;this._scrubTickListener=(J,$)=>{if(!this._enabled){this._stopSmoothScrollLoop();return}let Q=this._targetProgress-this._currentProgress,q=1-Math.exp(-J*3/this._scrubLag);if(this._currentProgress+=Q*q,Math.abs(this._targetProgress-this._currentProgress)<0.0001){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress),this._stopSmoothScrollLoop();return}this._timeline.progress(this._currentProgress)},w.getInstance().add(this._scrubTickListener,g._SCRUB_TICKER_PRIORITY)}_stopSmoothScrollLoop(){if(this._scrubTickListener)w.getInstance().remove(this._scrubTickListener),this._scrubTickListener=null}}F.registerTrigger("scroll",g);class hJ{_registrations=[];_domContentLoaded=!1;_windowLoaded=!1;_initialized=!1;constructor(){this._initialize()}_initialize(){if(this._initialized)return;if(this._initialized=!0,typeof document<"u"){if(document.addEventListener("DOMContentLoaded",()=>{this._domContentLoaded=!0,this._triggerDuring()}),typeof window<"u")window.addEventListener("load",()=>{this._windowLoaded=!0,this._triggerAfter()});if(document.readyState==="interactive"||document.readyState==="complete")this._domContentLoaded=!0;if(document.readyState==="complete")this._windowLoaded=!0}}register(J,$){let Q=$.timing||"during";if(this._registrations.push({timeline:J,timing:Q}),Q==="before")J.play();else if(Q==="during"&&this._domContentLoaded)J.play();else if(Q==="after"&&this._windowLoaded)J.play()}unregister(J){this._registrations=this._registrations.filter(($)=>$.timeline!==J)}clear(){this._registrations=[]}_triggerDuring(){this._registrations.filter((J)=>J.timing==="during").forEach((J)=>J.timeline.play())}_triggerAfter(){this._registrations.filter((J)=>J.timing==="after").forEach((J)=>J.timeline.play())}_reset(){this._registrations=[],this._domContentLoaded=!1,this._windowLoaded=!1,this._initialized=!1,this._initialize()}}F.registerPageLoadTrigger(hJ);class TJ extends h{_targets=[];_listeners=new Map;_frozenRects=new Map;_state={x:0.5,y:0.5,distance:0.5,isInside:!1};_targetState={targetX:0.5,targetY:0.5,targetDistance:0.5};_tickerCallback;_defaultStartProgress=0.5;_defaultLeaveProgress=0.5;constructor(J,$){super(J,$);this._config={type:"distance",startProgress:this._defaultStartProgress,leaveProgress:this._defaultLeaveProgress,...$};let Q=this._config.startProgress??this._defaultStartProgress;this._state.x=Q,this._state.y=Q,this._state.distance=Q,this._targetState.targetX=Q,this._targetState.targetY=Q,this._targetState.targetDistance=Q}_onEnable(){if(this._targets=this._resolveElements(this._config.target),this._targets.length===0)this._addViewportListeners();else this._addTargetListeners();if(this._config.smooth!==void 0&&this._config.smooth>0)this._startSmoothingTicker();this._updateTimelineProgress()}_onDisable(){if(this._tickerCallback)w.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;this._frozenRects.clear(),this._cleanupListenerMap(this._listeners)}_addViewportListeners(){if(typeof window>"u")return;let J=new Map,$=(Q)=>{let q=Q;this._handleViewportMouseMove(q.clientX,q.clientY)};window.addEventListener("mousemove",$),J.set("mousemove",$),this._state.isInside=!0,this._listeners.set(window,J)}refresh(){for(let J of this._targets)this._frozenRects.set(J,V(J))}_addTargetListeners(){this._targets.forEach((J)=>{this._frozenRects.set(J,V(J));let $=new Map,Q=(j)=>{let z=j;this._handleTargetMouseMove(J,z.clientX,z.clientY)};J.addEventListener("mousemove",Q),$.set("mousemove",Q);let q=()=>{this._state.isInside=!0};J.addEventListener("mouseenter",q),$.set("mouseenter",q);let Z=()=>{this._state.isInside=!1,this._handleMouseLeave()};J.addEventListener("mouseleave",Z),$.set("mouseleave",Z),this._listeners.set(J,$)})}_handleViewportMouseMove(J,$){if(typeof window>"u")return;let{innerWidth:Q,innerHeight:q}=window,Z=Q/2,j=q/2;if(this._config.type==="axis")this._targetState.targetX=J/Q,this._targetState.targetY=$/q;else{let z=J-Z,G=$-j,N=Math.sqrt(z*z+G*G),W=Math.sqrt(Z*Z+j*j);this._targetState.targetDistance=1-Math.min(N/W,1)}this._applyProgress()}_handleTargetMouseMove(J,$,Q){let q=this._frozenRects.get(J)??J.getBoundingClientRect(),Z=q.left+q.width/2,j=q.top+q.height/2;if(this._config.type==="axis"){let z=$-q.left,G=Q-q.top;this._targetState.targetX=Math.max(0,Math.min(1,z/q.width)),this._targetState.targetY=Math.max(0,Math.min(1,G/q.height))}else{let z=$-Z,G=Q-j,N=Math.sqrt(z*z+G*G),W=Math.sqrt(Math.pow(q.width/2,2)+Math.pow(q.height/2,2));this._targetState.targetDistance=1-Math.min(N/W,1)}this._applyProgress()}_handleMouseLeave(){let J=this._config.leaveProgress??this._defaultLeaveProgress;if(this._targetState.targetX=J,this._targetState.targetY=J,this._targetState.targetDistance=J,!this._config.smooth)this._state.x=J,this._state.y=J,this._state.distance=J,this._updateTimelineProgress()}_applyProgress(){if(this._config.smooth)return;this._state.x=this._targetState.targetX,this._state.y=this._targetState.targetY,this._state.distance=this._targetState.targetDistance,this._updateTimelineProgress()}_startSmoothingTicker(){let J=Math.max(0,Math.min(1,this._config.smooth??0.1));this._tickerCallback=($)=>{let Q=this._lerp(this._state.x,this._targetState.targetX,J,$),q=this._lerp(this._state.y,this._targetState.targetY,J,$),Z=this._lerp(this._state.distance,this._targetState.targetDistance,J,$),j=0.0001,z=Math.abs(Q-this._state.x)<0.0001&&Math.abs(Q-this._targetState.targetX)<0.0001,G=Math.abs(q-this._state.y)<0.0001&&Math.abs(q-this._targetState.targetY)<0.0001,N=Math.abs(Z-this._state.distance)<0.0001&&Math.abs(Z-this._targetState.targetDistance)<0.0001;if(this._state.x=Q,this._state.y=q,this._state.distance=Z,!z||!G||!N)this._updateTimelineProgress()},w.getInstance().add(this._tickerCallback)}_lerp(J,$,Q,q){let Z=$-J;if(Math.abs(Z)<0.0001)return $;let j=0.5*Math.pow(1-Q,2)+0.005,z=1-Math.pow(1-j,q*60);return J+Z*z}_updateTimelineProgress(){if(this._config.type==="axis")this._timeline.setAxisProgress("x",this._state.x),this._timeline.setAxisProgress("y",this._state.y);else this._timeline.progress(this._state.distance)}}F.registerTrigger("mouseMove",TJ);class N0 extends h{_target=window;_tolerance;_dragMinimum;_dragMinimumSquared;_wheelSpeed;_scrollSpeed;_stopDelay;_preventDefault;_lockAxis;_animationStep;_smooth;_startX=0;_startY=0;_deltaX=0;_deltaY=0;_lockedAxis=null;_isPressed=!1;_isDragging=!1;_lastDirectionX=null;_lastDirectionY=null;_lastScrollX=0;_lastScrollY=0;_stopTimeout=null;_isMoving=!1;_lastActivityTime=0;_pendingActions=new Map;_rafScheduled=!1;_rafId=null;_wheelAccumulatorX=0;_wheelAccumulatorY=0;_wheelRafId=null;_scrollRafId=null;_lastPointerX=0;_lastPointerY=0;_activatedDirections=new Set;_targetProgress=0;_currentProgress=0;_interpolationRafId=null;_siblings=null;_index=0;static _sequenceStates=new WeakMap;_boundHandlers={};_frozenHoverRect=null;_gestureHoverActive=!1;_boundHoverMoveHandler=null;constructor(J,$){super(J,$);this._tolerance=$.tolerance??1,this._dragMinimum=$.dragMinimum??10,this._dragMinimumSquared=this._dragMinimum*this._dragMinimum,this._wheelSpeed=$.wheelSpeed??1,this._scrollSpeed=$.scrollSpeed??1,this._stopDelay=$.stopDelay??150,this._preventDefault=$.preventDefault??!1,this._lockAxis=$.lockAxis??!1,this._animationStep=$.animationStep??0.1,this._smooth=Math.max(0,Math.min(1,$.smooth??0));let Q=$;if(Q._siblings&&Q._index!==void 0){if(this._siblings=Q._siblings,this._index=Q._index,!N0._sequenceStates.has(this._siblings))N0._sequenceStates.set(this._siblings,{lastIndex:0})}}_onEnable(){let J=this._resolveElement(this._config.target,window);this._target=J??window;let $=this._config.types;if($.includes("pointer"))this._addPointerListeners();if($.includes("touch"))this._addTouchListeners();if($.includes("wheel"))this._addWheelListener();if($.includes("scroll"))this._addScrollListener();if(this._config.events.Hover||this._config.events.HoverEnd)this._addHoverListeners()}_onDisable(){if(this._stopTimeout)clearTimeout(this._stopTimeout),this._stopTimeout=null;if(this._rafId!==null)cancelAnimationFrame(this._rafId),this._rafId=null;if(this._wheelRafId!==null)cancelAnimationFrame(this._wheelRafId),this._wheelRafId=null;if(this._scrollRafId!==null)cancelAnimationFrame(this._scrollRafId),this._scrollRafId=null;if(this._interpolationRafId!==null)cancelAnimationFrame(this._interpolationRafId),this._interpolationRafId=null;this._rafScheduled=!1,this._pendingActions.clear();let J=this._target;if(this._boundHandlers.pointerDown)J.removeEventListener("pointerdown",this._boundHandlers.pointerDown),window.removeEventListener("pointermove",this._boundHandlers.pointerMove),window.removeEventListener("pointerup",this._boundHandlers.pointerUp);if(this._boundHandlers.touchStart)J.removeEventListener("touchstart",this._boundHandlers.touchStart),window.removeEventListener("touchmove",this._boundHandlers.touchMove),window.removeEventListener("touchend",this._boundHandlers.touchEnd);if(this._boundHandlers.wheel)J.removeEventListener("wheel",this._boundHandlers.wheel);if(this._boundHandlers.scroll)(this._target===window?window:this._target).removeEventListener("scroll",this._boundHandlers.scroll);if(this._boundHoverMoveHandler)window.removeEventListener("mousemove",this._boundHoverMoveHandler),this._boundHoverMoveHandler=null;this._frozenHoverRect=null,this._gestureHoverActive=!1,this._boundHandlers={}}_addPointerListeners(){this._boundHandlers.pointerDown=this._handlePointerDown.bind(this),this._boundHandlers.pointerMove=this._handlePointerMove.bind(this),this._boundHandlers.pointerUp=this._handlePointerUp.bind(this);let J={passive:!this._preventDefault};this._target.addEventListener("pointerdown",this._boundHandlers.pointerDown,J),window.addEventListener("pointermove",this._boundHandlers.pointerMove,J),window.addEventListener("pointerup",this._boundHandlers.pointerUp)}_handlePointerDown(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;if(this._preventDefault)J.preventDefault();this._handleInputStart(J.clientX,J.clientY)}_handlePointerMove(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;if(this._handleInputMove(J.clientX,J.clientY)){if(this._preventDefault)J.preventDefault()}}_handlePointerUp(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;this._handleInputEnd()}_addTouchListeners(){this._boundHandlers.touchStart=this._handleTouchStart.bind(this),this._boundHandlers.touchMove=this._handleTouchMove.bind(this),this._boundHandlers.touchEnd=this._handleTouchEnd.bind(this);let J={passive:!this._preventDefault};this._target.addEventListener("touchstart",this._boundHandlers.touchStart,J),window.addEventListener("touchmove",this._boundHandlers.touchMove,J),window.addEventListener("touchend",this._boundHandlers.touchEnd)}_handleTouchStart(J){if(this._preventDefault)J.preventDefault();let $=J.touches[0];if(!$)return;this._handleInputStart($.clientX,$.clientY)}_handleTouchMove(J){let $=J.touches[0];if(!$)return;if(this._handleInputMove($.clientX,$.clientY)){if(this._preventDefault)J.preventDefault()}}_handleTouchEnd(J){this._handleInputEnd()}_handleInputStart(J,$){this._fireEvent("PressInit"),this._startX=J,this._startY=$,this._lastPointerX=J,this._lastPointerY=$,this._deltaX=0,this._deltaY=0,this._isPressed=!0,this._isDragging=!1,this._lockedAxis=null,this._fireEvent("Press")}_handleInputMove(J,$){if(!this._isPressed)return!1;let Q=J-this._lastPointerX,q=$-this._lastPointerY;if(Math.abs(Q)<1&&Math.abs(q)<1)return!1;this._lastPointerX=J,this._lastPointerY=$;let Z=J-this._startX,j=$-this._startY;if(this._updateDeltas(Z,j),this._checkDragStart(),this._checkDirectionAndFire(!1),this._checkToggle(Z,j),this._scheduleStopCheck(),this._isDragging)this._fireEvent("Drag");return!0}_handleInputEnd(){if(!this._isPressed)return;if(this._isDragging)this._fireEvent("DragEnd");this._fireEvent("Release"),this._fireCompleteCallbacks(),this._fireEvent("Stop"),this._resetGestureState()}_addWheelListener(){this._boundHandlers.wheel=this._handleWheel.bind(this),this._target.addEventListener("wheel",this._boundHandlers.wheel,{passive:!this._preventDefault})}_handleWheel(J){if(this._preventDefault)J.preventDefault();if(this._wheelAccumulatorX+=J.deltaX*this._wheelSpeed,this._wheelAccumulatorY+=J.deltaY*this._wheelSpeed,this._wheelRafId!==null)return;this._wheelRafId=requestAnimationFrame(()=>{this._wheelRafId=null,this._deltaX=this._wheelAccumulatorX,this._deltaY=this._wheelAccumulatorY,this._wheelAccumulatorX=0,this._wheelAccumulatorY=0,this._checkDirectionAndFire(!0),this._checkToggle(this._deltaX,this._deltaY),this._scheduleStopCheck(),this._deltaX=0,this._deltaY=0})}_addScrollListener(){if(this._boundHandlers.scroll=this._handleScroll.bind(this),this._target===window)this._lastScrollX=window.scrollX,this._lastScrollY=window.scrollY;else{let J=this._target;this._lastScrollX=J.scrollLeft,this._lastScrollY=J.scrollTop}this._target.addEventListener("scroll",this._boundHandlers.scroll,{passive:!0})}_handleScroll(){if(this._scrollRafId!==null)return;this._scrollRafId=requestAnimationFrame(()=>{this._scrollRafId=null,this._processScroll()})}_processScroll(){let J,$;if(this._target===window)J=window.scrollX,$=window.scrollY;else{let Z=this._target;J=Z.scrollLeft,$=Z.scrollTop}let Q=(J-this._lastScrollX)*this._scrollSpeed,q=($-this._lastScrollY)*this._scrollSpeed;this._lastScrollX=J,this._lastScrollY=$,this._deltaX=Q,this._deltaY=q,this._checkDirectionAndFire(!0),this._checkToggle(Q,q),this._scheduleStopCheck(),this._deltaX=0,this._deltaY=0}_addHoverListeners(){if(this._target===window)return;let J=this._target;this._frozenHoverRect=V(J),this._boundHoverMoveHandler=($)=>{if(!this._frozenHoverRect)return;let Q=this._frozenHoverRect,q=$.clientX>=Q.left&&$.clientX<=Q.right&&$.clientY>=Q.top&&$.clientY<=Q.bottom;if(q&&!this._gestureHoverActive)this._gestureHoverActive=!0,this._fireEvent("Hover");else if(!q&&this._gestureHoverActive)this._gestureHoverActive=!1,this._fireEvent("HoverEnd")},window.addEventListener("mousemove",this._boundHoverMoveHandler)}refresh(){if(this._target===window||!this._frozenHoverRect)return;this._frozenHoverRect=V(this._target)}_updateDeltas(J,$){if(this._lockAxis&&this._lockedAxis)if(this._lockedAxis==="x")this._deltaX=J,this._deltaY=0;else this._deltaX=0,this._deltaY=$;else this._deltaX=J,this._deltaY=$;if(this._lockAxis&&!this._lockedAxis){let Q=this._tolerance;if(Math.abs(this._deltaX)>Q||Math.abs(this._deltaY)>Q)this._lockedAxis=Math.abs(this._deltaX)>Math.abs(this._deltaY)?"x":"y"}}_checkDirectionAndFire(J){let $=this._tolerance;if(J||!this._lockedAxis||this._lockedAxis==="y"){if(this._deltaY<-$){if(this._fireEvent("Up"),!J)this._activatedDirections.add("Up")}if(this._deltaY>$){if(this._fireEvent("Down"),!J)this._activatedDirections.add("Down")}}if(J||!this._lockedAxis||this._lockedAxis==="x"){if(this._deltaX<-$){if(this._fireEvent("Left"),!J)this._activatedDirections.add("Left")}if(this._deltaX>$){if(this._fireEvent("Right"),!J)this._activatedDirections.add("Right")}}if(Math.abs(this._deltaX)>$||Math.abs(this._deltaY)>$){if(this._fireEvent("Change"),Math.abs(this._deltaX)>$)this._fireEvent("ChangeX");if(Math.abs(this._deltaY)>$)this._fireEvent("ChangeY")}}_checkToggle(J,$){let Q=this._tolerance;if(Math.abs(J)>=Q){let q=J>0?1:-1;if(this._lastDirectionX!==null&&q!==this._lastDirectionX)this._fireEvent("ToggleX");this._lastDirectionX=q}if(Math.abs($)>=Q){let q=$>0?1:-1;if(this._lastDirectionY!==null&&q!==this._lastDirectionY)this._fireEvent("ToggleY");this._lastDirectionY=q}}_checkDragStart(){if(this._isDragging)return;if(this._deltaX*this._deltaX+this._deltaY*this._deltaY>this._dragMinimumSquared)this._isDragging=!0}_scheduleStopCheck(){if(this._isMoving=!0,this._lastActivityTime=performance.now(),this._stopTimeout)return;let J=()=>{let $=performance.now()-this._lastActivityTime;if($>=this._stopDelay){if(this._stopTimeout=null,this._isMoving){if(this._isMoving=!1,this._lastDirectionX=null,this._lastDirectionY=null,!this._isPressed)this._fireEvent("Stop")}}else this._stopTimeout=setTimeout(J,this._stopDelay-$)};this._stopTimeout=setTimeout(J,this._stopDelay)}_fireEvent(J){let $=this._config.events[J];if($)this._pendingActions.set($,J),this._scheduleRAF()}_scheduleRAF(){if(this._rafScheduled)return;this._rafScheduled=!0,this._rafId=requestAnimationFrame(()=>{this._rafScheduled=!1,this._rafId=null;for(let[J,$]of this._pendingActions)this._executeAction(J,$);this._pendingActions.clear()})}_getStepForEvent(J){if(typeof this._animationStep==="number")return this._animationStep;if(J&&this._animationStep[J]!==void 0)return this._animationStep[J];let $=Object.values(this._animationStep);return $.length>0?$[0]:0.1}_executeAction(J,$){switch(J){case"play":case"pause":case"reverse":case"restart":case"reset":case"complete":x(J,this._timeline);break;case"toggle":if(this._timeline.isActive())this._timeline.pause();else this._timeline.play();break;case"kill":this._timeline.kill();break;case"playReverse":this._timeline.reverse();break;case"progressUp":this._interpolateProgress(this._getStepForEvent($));break;case"progressDown":this._interpolateProgress(-this._getStepForEvent($));break;case"playNext":this._playSequenceItem(1);break;case"playPrevious":this._playSequenceItem(-1);break}}_playSequenceItem(J){if(!this._siblings||this._siblings.length===0)return;let $=N0._sequenceStates.get(this._siblings);if(!$)return;let Q=this._siblings.length,q=$.lastIndex,Z=(q+J+Q)%Q,j=this._siblings[q];if(j&&j.progress()>0)j.reverse();let z=this._siblings[Z];if(z)z.restart();$.lastIndex=Z}_interpolateProgress(J){let $=this._timeline.progress();if(Math.abs($-this._currentProgress)>0.01)this._currentProgress=$,this._targetProgress=$;if(this._interpolationRafId===null)this._currentProgress=$,this._targetProgress=$;if(this._targetProgress=Math.max(0,Math.min(1,this._targetProgress+J)),this._smooth===0){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress);return}if(this._interpolationRafId===null)this._startInterpolationLoop()}_startInterpolationLoop(){if(this._interpolationRafId!==null)return;let J=0.08+(1-this._smooth)*0.12,$=()=>{let Q=this._targetProgress-this._currentProgress;if(Math.abs(Q)<0.0001){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress),this._interpolationRafId=null;return}this._currentProgress+=Q*J,this._timeline.progress(this._currentProgress),this._interpolationRafId=requestAnimationFrame($)};this._interpolationRafId=requestAnimationFrame($)}_fireCompleteCallbacks(){if(this._activatedDirections.has("Up"))this._fireEvent("UpComplete");if(this._activatedDirections.has("Down"))this._fireEvent("DownComplete");if(this._activatedDirections.has("Left"))this._fireEvent("LeftComplete");if(this._activatedDirections.has("Right"))this._fireEvent("RightComplete");this._activatedDirections.clear()}_resetGestureState(){this._isPressed=!1,this._isDragging=!1,this._deltaX=0,this._deltaY=0,this._lockedAxis=null,this._lastDirectionX=null,this._lastDirectionY=null,this._activatedDirections.clear()}}F.registerTrigger("gesture",N0);var D0=null;function fJ(J,$,Q,q){let Z=J;if(!Z.style)return;let j=Q0();if(T($))if(P(J,$,Q,q),j)F0(J);else Z.style.transform=E(J);else{let z=q?`${Q}${q}`:`${Q}`;if(j)O0(J,$,z);else try{if(e($))Z.style.setProperty($,z);else if($ in Z.style)Z.style[$]=z;else Z.style.setProperty(m($),z)}catch{}}}function uJ(J,$,Q,q,Z,j){let z=J;if(!z.style)return;let G=j===1?`rgb(${Math.round(Q)}, ${Math.round(q)}, ${Math.round(Z)})`:`rgba(${Math.round(Q)}, ${Math.round(q)}, ${Math.round(Z)}, ${j})`;if(Q0())O0(J,$,G);else try{if(e($))z.style.setProperty($,G);else if($ in z.style)z.style[$]=G;else z.style.setProperty(m($),G)}catch{}}function dJ(J,$,Q,q){let Z=J;if(!Z.style)return;if(D0||(D0=X.filter)){let j=D0.interpolateFilters($,Q,q),z=D0.filterToString(j);if(Q0())O0(J,"filter",z);else Z.style.filter=z}}function pJ(J,$,Q){let{pathLUT:q,alignOffset:Z,pathOffset:j,pathRotate:z}=Q;if(!q||q.length===0)return;let G=$*(q.length-1),N=Math.floor(G),W=Math.min(N+1,q.length-1),_=G-N,B=q[N],U=q[W],Y=B.x+(U.x-B.x)*_,H=B.y+(U.y-B.y)*_,A=(j?.x??0)+Y-(Z?.x??0),K=(j?.y??0)+H-(Z?.y??0);if(P(J,"x",A,"px"),P(J,"y",K,"px"),z){let M=n6(B.angle,U.angle,_);P(J,"rotate",M,"deg")}if(Q0())F0(J);else J.style.transform=E(J)}function n6(J,$,Q){let q=$-J;if(q>180)q-=360;if(q<-180)q+=360;return J+q*Q}var JJ=null,a6=100,r6=500,t6=0.5,W0=[],e6=50;function J7(J){for(let $=0;$<W0.length;$++)if(W0[$].length>=J){let Q=W0.splice($,1)[0];return Q.length=J,Q}return Array(J)}function $7(J){if(W0.length<e6)W0.push(J)}class $J{target=null;property="";startValue=0;endValue=0;change=0;unit="";next=null;valueType="scalar";startColor=null;endColor=null;changeColor=new Float32Array(4);startFilters=null;endFilters=null;startDraw=null;endDraw=null;pathLength=0;pathData=null;motionPathLength=0;startProgress=0;endProgress=0;pathRotate=!1;alignOffset=null;pathOffset=null;pathLUT=null;_isElement=!1;init(J,$,Q,q,Z=""){return this.target=J,this.property=$,this.startValue=Q,this.endValue=q,this.change=q-Q,this.unit=Z,this.valueType="scalar",this._isElement=J instanceof Element,this}initColor(J,$,Q,q){return this.target=J,this.property=$,this.valueType="color",this.startColor=Q,this.endColor=q,this.changeColor[0]=q[0]-Q[0],this.changeColor[1]=q[1]-Q[1],this.changeColor[2]=q[2]-Q[2],this.changeColor[3]=q[3]-Q[3],this._isElement=J instanceof Element,this}initFilter(J,$,Q,q){return this.target=J,this.property=$,this.valueType="filter",this.startFilters=Q,this.endFilters=q,this._isElement=J instanceof Element,this}initDrawSVG(J,$,Q,q,Z){return this.target=J,this.property=$,this.valueType="drawSVG",this.startDraw=Q,this.endDraw=q,this.pathLength=Z,this._isElement=J instanceof Element,this}initPath(J,$,Q,q,Z,j,z,G,N){if(J instanceof Element)y(J,!0);this.target=J,this.property=$,this.valueType="path",this.pathData=Q,this.motionPathLength=q,this.startProgress=Z,this.endProgress=j,this.pathRotate=z,this.alignOffset=G,this.pathOffset=N,this._isElement=J instanceof Element;let W=Math.abs(j-Z),_=q*W,B=Math.min(r6,Math.max(a6,Math.ceil(_*t6)));this.pathLUT=J7(B+1);for(let U=0;U<=B;U++){let Y=U/B,H=Z+(j-Z)*Y;this.pathLUT[U]=l0(Q,H,z)}return this}render(J){if(!this.target)return;if(this.valueType==="color"&&this.startColor){let $=this.startColor[0]+this.changeColor[0]*J,Q=this.startColor[1]+this.changeColor[1]*J,q=this.startColor[2]+this.changeColor[2]*J,Z=this.startColor[3]+this.changeColor[3]*J;if(this._isElement)uJ(this.target,this.property,$,Q,q,Z)}else if(this.valueType==="filter"&&this.startFilters&&this.endFilters){if(this._isElement)dJ(this.target,this.startFilters,this.endFilters,J)}else if(this.valueType==="drawSVG"&&this.startDraw&&this.endDraw){if(this._isElement&&this.pathLength>0){let $=this.startDraw.start+(this.endDraw.start-this.startDraw.start)*J,Q=this.startDraw.end+(this.endDraw.end-this.startDraw.end)*J;if(JJ||(JJ=X.drawSVG))JJ.applyDrawSVG(this.target,$,Q,this.pathLength)}}else if(this.valueType==="path"&&this.pathLUT&&this.pathLUT.length>0){if(this._isElement)pJ(this.target,J,{pathLUT:this.pathLUT,alignOffset:this.alignOffset??{x:0,y:0},pathOffset:this.pathOffset??{x:0,y:0},pathRotate:this.pathRotate})}else{let $=this.startValue+this.change*J;if(this._isElement)fJ(this.target,this.property,$,this.unit);else this.target[this.property]=$}}reset(){if(this.target=null,this.property="",this.startValue=0,this.endValue=0,this.change=0,this.unit="",this.next=null,this.valueType="scalar",this.startColor=null,this.endColor=null,this.startFilters=null,this.endFilters=null,this.startDraw=null,this.endDraw=null,this.pathLength=0,this.pathData=null,this.motionPathLength=0,this.startProgress=0,this.endProgress=0,this.pathRotate=!1,this.alignOffset=null,this.pathOffset=null,this.pathLUT)$7(this.pathLUT);this.pathLUT=null,this._isElement=!1}}class _0{pool=[];totalCreated=0;factory;maxSize;constructor(J,$){this.factory=J,this.maxSize=$}acquire(){if(this.pool.length>0)return this.pool.pop();return this.totalCreated++,this.factory()}release(J){if(J.reset(),this.maxSize===void 0||this.pool.length<this.maxSize)this.pool.push(J)}getPoolSize(){return this.pool.length}getTotalCreated(){return this.totalCreated}clear(){this.pool=[]}}var B0=new _0(()=>new $J,500),n={acquire:()=>B0.acquire(),release:(J)=>B0.release(J),getPoolSize:()=>B0.getPoolSize(),getTotalCreated:()=>B0.getTotalCreated(),clear:()=>B0.clear()};var cJ={x:0,y:0,z:0,rotate:0,rotateX:0,rotateY:0,rotateZ:0,scale:1,scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,opacity:1};class f{static _createAnimationCallback=null;static setCreateAnimationCallback(J){f._createAnimationCallback=J}_targets;_originalTargets;_fromVars;_toVars;_duration=0.5;_delay=0;_ease="power1.out";_animation=null;_animations=[];_built=!1;_splitType;_mask;_repeat;_repeatDelay;_yoyo;_stagger;_axis;_fitConfig;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_skipInitialFromRender=!1;_plainObjectInitialValues=new Map;_expectedAnimationIds=[];_propsToAnimate=[];constructor(J,$){if(this._targets=X0(J),this._originalTargets=this._targets,this._targets.length===0&&typeof J==="string")console.warn(`[Motion] Selector "${J}" matched no elements. Animation will not run.`);if($)this._applyAnimationConfig($)}_applyAnimationConfig(J){if(J.from)this._fromVars=J.from;if(J.to)this._toVars=J.to;if(J.duration!==void 0)if(typeof J.duration!=="number"||!isFinite(J.duration)||J.duration<0)console.warn(`[Motion] Invalid duration: ${J.duration}. Must be a finite number >= 0. Using default.`);else this._duration=J.duration;if(J.delay!==void 0)if(typeof J.delay!=="number"||isNaN(J.delay))console.warn(`[Motion] Invalid delay: ${J.delay}. Must be a number. Using default 0.`);else if(!isFinite(J.delay))console.warn(`[Motion] Invalid delay: ${J.delay}. Infinity is not a valid delay. Using default 0.`);else this._delay=J.delay;if(J.ease)this._ease=J.ease;if(J.split)this._splitType=J.split;if(J.mask)this._mask=J.mask;if(J.stagger!==void 0)this._stagger=J.stagger;if(J.axis)this._axis=J.axis;if(J.fit)this._fitConfig=J.fit;if(J.repeat)if(typeof J.repeat==="number")this._repeat=J.repeat;else this._repeat=J.repeat.times,this._repeatDelay=J.repeat.delay,this._yoyo=J.repeat.yoyo;if(J.onStart)this._onStart=J.onStart;if(J.onUpdate)this._onUpdate=J.onUpdate;if(J.onComplete)this._onComplete=J.onComplete;if(J.onRepeat)this._onRepeat=J.onRepeat;if(J.onReverseComplete)this._onReverseComplete=J.onReverseComplete}_capturePlainObjectValues(J){for(let $ of this._targets){if($ instanceof Element)continue;let Q=$,q={};for(let Z of J)if(Z in Q&&typeof Q[Z]==="number")q[Z]=Q[Z];if(Object.keys(q).length>0)this._plainObjectInitialValues.set($,q)}}_restorePlainObjectValues(){for(let[J,$]of this._plainObjectInitialValues){let Q=J;for(let[q,Z]of Object.entries($))Q[q]=Z}}_ensureBuilt(){if(!this._built)this._build()}_isInvalidated(){if(this._animations.length===0)return!1;return this._animations.some((J,$)=>{let Q=J.getId(),q=this._expectedAnimationIds[$];return Q===0||Q!==q})}rebuildIfPooled(){if(this._isInvalidated()){this._restorePlainObjectValues();for(let J of this._targets)if(J instanceof Element)y(J),X.styleReset?.clearAnimationStylesForProps?.(J,this._propsToAnimate);this._resetBuildState(),this._ensureBuilt()}}_build(){if(this._built)return;if(this._targets.length===0)return;if(!this._fromVars&&!this._toVars&&!this._fitConfig)return;if(this._fitConfig){if(!X.fit){console.warn("[Motion] FitResolver not loaded. Did you import the SDK?");return}if(this._built=!0,!f._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call Engine.init() first.");let j={};if(this._repeat!==void 0)j.repeat=this._repeat;if(this._repeatDelay!==void 0)j.repeatDelay=this._repeatDelay;if(this._yoyo)j.yoyo=this._yoyo;if(this._onStart)j.onStart=this._onStart;if(this._onUpdate)j.onUpdate=this._onUpdate;if(this._onComplete)j.onComplete=this._onComplete;if(this._onRepeat)j.onRepeat=this._onRepeat;if(this._onReverseComplete)j.onReverseComplete=this._onReverseComplete;if(this._stagger!==void 0)j.stagger=this._stagger;let z=[];for(let N of this._targets){if(!(N instanceof Element))continue;let W=f._createAnimationCallback([N],{},this._duration,this._delay,this._ease,!1,void 0,j);if(Array.isArray(W))z.push(...W);else z.push(W)}let G=this._fitConfig;for(let N of z)for(let W of N.getTargets())if(W instanceof Element)X.fit.registerPendingSetup(N,W,G,n);this._animation=z[0]??null,this._animations=z,this._expectedAnimationIds=z.map((N)=>N.getId());return}this._built=!0;let J={},$=!1,Q;if(this._fromVars&&this._toVars){J={...this._toVars},Q={...this._fromVars},$=!0;for(let j of Object.keys(Q))if(!(j in J)){if(j in cJ)J[j]=cJ[j];else if(t(j))J[j]="";else if(l(j))J[j]=""}}else if(this._fromVars)J={...this._fromVars},$=!0;else if(this._toVars)J={...this._toVars};if(this._splitType&&X.textSplitter?.split){let j=this._mask?{mask:!0}:void 0,z=[];for(let G of this._originalTargets)if(G instanceof Element){let N=X.textSplitter?.split(G,this._splitType,j);z.push(...N)}if(z.length>0)this._targets=z}if(this._propsToAnimate=Object.keys(J),Q){for(let j of Object.keys(Q))if(!this._propsToAnimate.includes(j))this._propsToAnimate.push(j)}if(this._plainObjectInitialValues.size===0)this._capturePlainObjectValues(this._propsToAnimate);if($){for(let j of this._targets)if(j instanceof Element)y(j),X.styleReset?.clearAnimationStylesForProps?.(j,this._propsToAnimate)}if(X.styleReset?.registerAnimatedProps){for(let j of this._targets)if(j instanceof Element)X.styleReset?.registerAnimatedProps(j,this._propsToAnimate)}let q={repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,stagger:this._stagger,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete,_skipInitialRender:this._skipInitialFromRender||void 0};if(!f._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call AnimationBuilder.setCreateAnimationCallback first.");let Z=f._createAnimationCallback(this._targets,J,this._duration,this._delay,this._ease,$,Q,q);if(Array.isArray(Z))this._animations=Z,this._animation=Z[0]||null;else this._animation=Z,this._animations=[Z];this._expectedAnimationIds=this._animations.map((j)=>j.getId())}getAnimation(){return this._ensureBuilt(),this._animation}getAnimations(){return this._ensureBuilt(),this._animations}getTargets(){return this._targets}getOriginalTargets(){return this._originalTargets}hasSplit(){return!!this._splitType}_resetBuildState(){this._built=!1,this._animations=[],this._animation=null,this._expectedAnimationIds=[]}getConfig(){return{fromVars:this._fromVars?{...this._fromVars}:void 0,toVars:this._toVars?{...this._toVars}:void 0,duration:this._duration,delay:this._delay,ease:this._ease,axis:this._axis,fit:this._fitConfig?{...this._fitConfig}:void 0,split:this._splitType,mask:this._mask,stagger:this._stagger,repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete}}setAxis(J){this._axis=J}getAxis(){return this._axis}setSkipInitialFromRender(J){this._skipInitialFromRender=J}}class E0{static parse(J,$,Q,q){if(J===void 0)return $;if(typeof J==="number")return J;let Z=J.trim();if(Z==="<")return Q;if(Z===">")return q;if(Z.startsWith("<")){let j=parseFloat(Z.substring(1));if(!isNaN(j))return Q+j}if(Z.startsWith(">")){let j=parseFloat(Z.substring(1));if(!isNaN(j))return q+j}if(Z.startsWith("+=")){let j=parseFloat(Z.substring(2));return $+j}if(Z.startsWith("-=")){let j=parseFloat(Z.substring(2));return $-j}return console.warn(`Invalid position parameter: "${Z}", using current end`),$}}class R{static _eachCounter=0;static _registerWithEngine=null;static setEngineRegisterCallback(J){R._registerWithEngine=J}_name;_children=[];_duration=0;_time=0;_progress=0;_timeScale=1;_isActive=!1;_isReversed=!1;_killed=!1;_onStart;_onUpdate;_onComplete;_startFired=!1;_trigger;_unregisterCallback;setUnregisterCallback(J){this._unregisterCallback=J}_previousStart=0;_previousEnd=0;_eachInstances;_eachDuration;_initialValues=new Map;_initialTransforms=new Map;_transformElements=new Set;_savedTransitions=new Map;_transitionsDisabled=!1;_savedWillChange=new Map;constructor(J){if(this._name=J,J&&R._registerWithEngine)R._registerWithEngine(J,this)}duration(){if(this._eachDuration!==void 0)return this._eachDuration;return this._duration}clear(){for(let J of this._children)if(J.type==="animation")J.child.kill();else if(J.type==="timeline")J.child.kill();return this._children=[],this._duration=0,this._time=0,this._progress=0,this._isActive=!1,this._isReversed=!1,this._startFired=!1,this._previousStart=0,this._previousEnd=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._clearTransitionData(),this}_captureInitialValues(J){let $=J.getTargets(),Q=J.getFirstPropTween();while(Q){let q=Q.property;for(let Z of $){if(!(Z instanceof Element))continue;let j=this._initialValues.get(Z);if(!j)j=new Map,this._initialValues.set(Z,j);if(!j.has(q)){let z=Z;if(T(q)||n0(q)){if(this._transformElements.add(Z),!this._initialTransforms.has(Z)){let G=z.style.transform;this._initialTransforms.set(Z,G||null)}j.set(q,{removeInline:!0})}else if(t(q)||l(q))j.set(q,{removeInline:!0});else{let G=q.replace(/([A-Z])/g,"-$1").toLowerCase();if(z.style.getPropertyValue(G)!==""){let W=VJ(Z,q);j.set(q,{removeInline:!1,value:W.value,unit:W.unit})}else j.set(q,{removeInline:!0})}}}Q=Q.next}}_restoreInitialValues(){for(let J of this._transformElements){let $=J;y(J);let Q=this._initialTransforms.get(J);if(Q)$.style.transform=Q;else $.style.removeProperty("transform")}for(let[J,$]of this._initialValues){let Q=J;for(let[q,Z]of $){if(T(q))continue;let j=q.replace(/([A-Z])/g,"-$1").toLowerCase();if(Z.removeInline)Q.style.removeProperty(j);else{let z=`${Z.value}${Z.unit}`;Q.style.setProperty(j,z)}}}}_disableTransitions(){if(this._transitionsDisabled)return;for(let J of this._savedTransitions.keys())J.style.transition="none";this._transitionsDisabled=!0}_restoreTransitions(){if(!this._transitionsDisabled)return;for(let[J,$]of this._savedTransitions)J.style.transition=$;this._transitionsDisabled=!1}_clearTransitionData(){this._restoreTransitions(),this._savedTransitions.clear(),this._transitionsDisabled=!1,this._restoreWillChange()}_restoreWillChange(){for(let[J,$]of this._savedWillChange)if($)J.style.willChange=$;else J.style.removeProperty("will-change");this._savedWillChange.clear()}_addEntry(J,$,Q){let q=E0.parse(Q,this._duration,this._previousStart,this._previousEnd),Z=new f(J,$);return this._addBuilder(Z,q)}_addBuilder(J,$){J.setSkipInitialFromRender(!0);let Q=J.getAnimations();if(Q.length===0)return this;let q=$;for(let Z of Q){let j=Z.getDelay(),z=$+j;Z.clearDelay();let G=Z.totalDuration(),N={type:"animation",child:Z,builder:J,startTime:z,duration:G};this._children.push(N),Z.setTimelineChild(!0),Z.pause(),this._captureInitialValues(Z);for(let B of Z.getTargets())if(B instanceof HTMLElement&&!this._savedTransitions.has(B))this._savedTransitions.set(B,B.style.transition);for(let B of Z.getTargets())if(B instanceof HTMLElement&&this._transformElements.has(B)&&!this._savedWillChange.has(B))this._savedWillChange.set(B,B.style.willChange),B.style.willChange="transform";let W=!!J.getConfig().fromVars;if(z>0&&!W)Z.setLazyStartCapture(!0);if(W)Z.renderAtTime(0);if(J.hasSplit()){for(let B of J.getOriginalTargets())if(B instanceof Element)B.style.opacity="1"}let _=z+G;if(_>q)q=_}if(this._previousStart=$,this._previousEnd=q,q>this._duration)this._duration=q;return this}call(J,$,Q){let q=E0.parse(Q,this._duration,this._previousStart,this._previousEnd),Z={type:"callback",child:J,startTime:q,duration:0,params:$};if(this._children.push(Z),this._previousStart=q,this._previousEnd=q,q>this._duration)this._duration=q;return this}_getFirstAnimationTarget(){let J=this.getFirstChildAnimation();if(J){let $=J.getTargets();for(let Q of $)if(u0(Q))return Q}return}_getAllAnimationTargets(){for(let J of this._children)if(J.type==="animation"&&J.builder)return(J.builder.hasSplit()?J.builder.getOriginalTargets():J.builder.getTargets()).filter((Q)=>u0(Q));return[]}_createInstanceForElement(J,$){let q=`${this._name||"__each"}__each_${$}_${R._eachCounter++}`,Z=new R(q),j=new Set;for(let z of this._children)if(z.type==="animation"&&z.builder){if(j.has(z.builder))continue;j.add(z.builder);let G=z.builder.getConfig(),N=G.repeat!=null?{times:G.repeat,delay:G.repeatDelay,yoyo:G.yoyo}:void 0,W=z.builder.hasSplit(),_=new f(J,{from:G.fromVars,to:G.toVars,duration:G.duration,delay:G.delay,ease:G.ease,repeat:N,...W&&G.split?{split:G.split}:{},...W&&G.mask?{mask:G.mask}:{},...W&&G.stagger!==void 0?{stagger:G.stagger}:{},onStart:G.onStart,onUpdate:G.onUpdate,onComplete:G.onComplete,onRepeat:G.onRepeat,onReverseComplete:G.onReverseComplete});if(G.axis)_.setAxis(G.axis);Z._addBuilder(_,z.startTime)}else if(z.type==="callback")Z.call(z.child,z.params,z.startTime);return Z}_createInstanceForElements(J,$){let q=`${this._name||"__each"}__each_${$}_${R._eachCounter++}`,Z=new R(q),j=new Set;for(let z of this._children)if(z.type==="animation"&&z.builder){if(j.has(z.builder))continue;j.add(z.builder);let G=z.builder.getConfig(),N=G.repeat!=null?{times:G.repeat,delay:G.repeatDelay,yoyo:G.yoyo}:void 0,W=z.builder.hasSplit(),_=new f(J,{from:G.fromVars,to:G.toVars,duration:G.duration,delay:G.delay,ease:G.ease,repeat:N,...W&&G.split?{split:G.split}:{},...W&&G.mask?{mask:G.mask}:{},...W&&G.stagger!==void 0?{stagger:G.stagger}:{},onStart:G.onStart,onUpdate:G.onUpdate,onComplete:G.onComplete,onRepeat:G.onRepeat,onReverseComplete:G.onReverseComplete});if(G.axis)_.setAxis(G.axis);Z._addBuilder(_,z.startTime)}else if(z.type==="callback")Z.call(z.child,z.params,z.startTime);return Z}_resolveTargetElements(J){if(typeof J!=="string")return[J];if(typeof document<"u")try{return Array.from(document.querySelectorAll(J))}catch($){console.warn(`[Motion] Invalid selector "${J}":`,$)}return[]}_setupEachModeGeneric(J,$){if(J.length===0)return;if(this._eachInstances=[],this._children.some((q)=>q.type==="animation"&&q.builder?.hasSplit()))for(let q of J)X.textSplitter?.revert?.(q);this._clearTransitionData();for(let q=0;q<J.length;q++){let Z=J[q],j=this._createInstanceForElement(Z,q);$(j,Z),this._eachInstances.push(j)}this._eachDuration=this._duration;for(let q of this._children)if(q.type==="animation"){let Z=q.child;Z.setTimelineChild(!1),Z.kill()}else if(q.type==="timeline")q.child.kill();this._children=[],this._duration=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._isActive=!1,this._time=0,this._progress=0,this._isReversed=!1,this._startFired=!1}_setupEachMode(J,$){let Q=X.triggerManager?.getInstance?.();if(!Q)return;let{each:q,...Z}=$;if($.target){let z=this._resolveTargetElements($.target);if(z.length===0)return;let G=this._getAllAnimationTargets();if(this._children.some((W)=>W.type==="animation"&&W.builder?.hasSplit()))for(let W of G)X.textSplitter?.revert?.(W);this._clearTransitionData(),this._eachInstances=[];for(let W=0;W<z.length;W++){let _=z[W],B=G.filter((Y)=>_.contains(Y));if(B.length===0)continue;let U=this._createInstanceForElements(B,W);if(J==="scroll")Q.registerScroll(U,{...Z,target:_});else if(J==="hover")Q.registerHover(U,{...Z,target:_});else Q.registerClick(U,{...Z,target:_});this._eachInstances.push(U)}this._eachDuration=this._duration;for(let W of this._children)if(W.type==="animation"){let _=W.child;_.setTimelineChild(!1),_.kill()}else if(W.type==="timeline")W.child.kill();this._children=[],this._duration=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._isActive=!1,this._time=0,this._progress=0,this._isReversed=!1,this._startFired=!1;return}let j=this._getAllAnimationTargets();this._setupEachModeGeneric(j,(z,G)=>{if(J==="scroll")Q.registerScroll(z,{...Z,target:G});else if(J==="hover")Q.registerHover(z,{...Z,target:G});else Q.registerClick(z,{...Z,target:G})})}onHover(J){if(J?.each)return this._setupEachMode("hover",J),this;let $=J?.target??this._getFirstAnimationTarget();return X.triggerManager?.getInstance?.().registerHover(this,{target:$,onLeave:J?.onLeave,leaveDelay:J?.leaveDelay}),this}onClick(J){if(J?.each)return this._setupEachMode("click",J),this;let $=J?.target??this._getFirstAnimationTarget();return X.triggerManager?.getInstance?.().registerClick(this,{target:$,secondTarget:J?.secondTarget,toggle:J?.toggle,preventDefault:J?.preventDefault}),this}onScroll(J){if(J?.each)return this._setupEachMode("scroll",J),this;let $=J?.target??this._getFirstAnimationTarget();return X.triggerManager?.getInstance?.().registerScroll(this,{...J,target:$}),this}onMouseMove(J){if(J?.each&&J.target)return this._setupMouseMoveEachMode(J),this;return X.triggerManager?.getInstance?.().registerMouseMove(this,{type:J?.type??"distance",target:J?.target,smooth:J?.smooth,startProgress:J?.startProgress,leaveProgress:J?.leaveProgress}),this}_setupMouseMoveEachMode(J){if(!J.target)return;let $=[];if(typeof J.target==="string"){if(typeof document<"u")$=Array.from(document.querySelectorAll(J.target))}else $=[J.target];let Q=X.triggerManager?.getInstance?.();if(!Q)return;this._setupEachModeGeneric($,(q,Z)=>{Q.registerMouseMove(q,{type:J.type??"distance",target:Z,smooth:J.smooth,startProgress:J.startProgress,leaveProgress:J.leaveProgress})})}onPageLoad(){return X.triggerManager?.getInstance?.().registerPageLoad(this,{}),this}onPageExit(J){return X.triggerManager?.getInstance?.().registerPageExit(this,J||{}),this}onGesture(J){if(J.each)return this._setupGestureEachMode(J),this;return X.triggerManager?.getInstance?.().registerGesture(this,J),this}_setupGestureEachMode(J){let $=[];if(J.target)if(typeof J.target==="string"){if(typeof document<"u")$=Array.from(document.querySelectorAll(J.target))}else $=[J.target];else $=this._getAllAnimationTargets();if(this._setupEachModeGeneric($,()=>{}),!this._eachInstances||this._eachInstances.length===0)return;let Q=X.triggerManager?.getInstance?.();if(!Q)return;for(let q=0;q<$.length;q++){let Z=$[q],j=this._eachInstances[q];Q.registerGesture(j,{...J,target:Z,each:!1,_siblings:this._eachInstances,_index:q})}}onCursor(J){return X.triggerManager?.getInstance?.().registerCursor(this,J),this}_updateCallbackChild(J,$,Q){let q=J.startTime,Z=$<q&&this._time>=q,j=$>q&&this._time<=q,z=Math.abs(this._time-q)<0.001;if(Z||j||z&&Q===0){let G=J.child,N=J.params||[];G(...N)}}_updateAnimationChild(J,$){let Q=J.child,q=Math.abs(Q.getTimeScale())||1,Z=Q.totalDuration()/q,j=this._time-J.startTime,z=j*q;if(j>=0&&j<=Z){if(!Q.isActive())Q.captureStartValues(),Q.play();Q.renderAtTime(z)}else if(j<0){if(!Q.isLazyCapture())Q.renderAtTime(0);if(Q.isActive())Q.pause(),Q.fireReverseComplete()}else if(Q.isActive())Q.renderAtTime(Q.totalDuration()),Q.pause();else if($===0)Q.renderAtTime(Q.totalDuration())}_updateTimelineChild(J,$){let Q=J.child,q=Q.duration(),Z=this._time-J.startTime;if(Z>=0&&Z<=q){if(!Q.isActive())Q.play();Q.time(Z)}else if(Q.isActive())if(Z<0)Q.time(0),Q.pause();else Q.time(q),Q.pause();else if($===0)if(Z<0);else Q.time(q)}update(J){if(this._eachInstances){for(let q of this._eachInstances)q.update(J);return}let $=this._time;if(!this._isActive&&J===0);else if(!this._isActive)return;let Q=J*this._timeScale;if(this._time+=this._isReversed?-Q:Q,this._time<0)this._time=0;else if(this._time>this._duration)this._time=this._duration;if(this._progress=this._duration>0?this._time/this._duration:0,!this._startFired&&this._isActive&&this._progress>0)this._startFired=!0,this._disableTransitions(),this._onStart?.();if(this._isActive)this._onUpdate?.(this._progress,this._time);for(let q of this._children)if(q.type==="callback")this._updateCallbackChild(q,$,J);else if(q.type==="animation")this._updateAnimationChild(q,J);else if(q.type==="timeline")this._updateTimelineChild(q,J);if(!this._isReversed&&this._time>=this._duration)this._isActive=!1,this._startFired=!1,this._restoreTransitions(),this._onComplete?.();else if(this._isReversed&&this._time<=0)this._isActive=!1,this._startFired=!1,this._restoreTransitions(),this._onComplete?.()}play(J){if(this._killed)return console.warn("[Motion] Cannot play a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.play(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;return this._isReversed=!1,this._isActive=!0,this}pause(J){if(this._killed)return console.warn("[Motion] Cannot pause a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.pause(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;this._isActive=!1;for(let $ of this._children)if($.type!=="callback"){let Q=$.child;if("pause"in Q)Q.pause()}return this}reverse(J){if(this._killed)return console.warn("[Motion] Cannot reverse a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.reverse(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;return this._isReversed=!0,this._isActive=!0,this}restart(){if(this._killed)return console.warn("[Motion] Cannot restart a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let J of this._eachInstances)J.restart();return this}this._time=0,this._progress=0,this._isActive=!0,this._isReversed=!1,this._startFired=!1;for(let J of this._children)if(J.type==="animation")J.child.resetForReplay();return this._restoreInitialValues(),this._renderPositionZeroAnimations(),this}_renderPositionZeroAnimations(){for(let J of this._children)if(J.type==="animation"){let $=J.child;if(!$.isLazyCapture())$.renderAtTime(0);if($.isActive())$.pause()}else if(J.type==="timeline")J.child.progress(0)}seek(J){if(this._killed)return console.warn("[Motion] Cannot seek a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.seek(J);return this}return this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this.update(0),this}setAxisProgress(J,$){let Q=Math.max(0,Math.min(1,$));for(let q of this._children)if(q.type==="animation"&&q.builder){if(q.builder.getConfig().axis===J){let j=q.child,z=j.totalDuration();if(!j.isActive())j.captureStartValues(),j.play();j.renderAtTime(Q*z)}}return this}onStart(J){return this._onStart=J,this}onUpdate(J){return this._onUpdate=J,this}onComplete(J){return this._onComplete=J,this}progress(J){if(J===void 0){if(this._eachInstances&&this._eachInstances.length>0){let Q=0;for(let q of this._eachInstances){let Z=q.progress();if(Z>Q)Q=Z}return Q}return this._progress}if(this._eachInstances){for(let Q of this._eachInstances)Q.progress(J);return this}let $=Math.max(0,Math.min(1,J));if($===0){for(let Q of this._children)if(Q.type==="animation")Q.child.resetForReplay()}if(this._time=$*this._duration,this._progress=$,$===0)this._restoreInitialValues(),this._renderPositionZeroAnimations();else this.update(0);return this._onUpdate?.(this._progress,this._time),this}time(J){if(J===void 0){if(this._eachInstances&&this._eachInstances.length>0){let $=0;for(let Q of this._eachInstances){let q=Q.time();if(q>$)$=q}return $}return this._time}if(this._eachInstances){for(let $ of this._eachInstances)$.time(J);return this}return this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this.update(0),this}timeScale(J){if(J===void 0)return this._timeScale;return this._timeScale=J,this}kill(J=!0){if(this._killed=!0,this._isActive=!1,X.triggerManager?.getInstance?.().unregister(this),this._eachInstances){for(let $ of this._eachInstances)$.kill(J);this._eachInstances=void 0}if(this._clearTransitionData(),J&&(this._initialValues.size>0||this._transformElements.size>0))this._restoreInitialValues();for(let $ of this._children)if($.type==="animation"){let Q=$.child;Q.setTimelineChild(!1),Q.kill()}else if($.type==="timeline")$.child.kill(J);if(this._unregisterCallback)this._unregisterCallback(),this._unregisterCallback=void 0;this._children=[],this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._savedTransitions.clear(),this._savedWillChange.clear(),this._transitionsDisabled=!1,this._duration=0,this._time=0,this._progress=0,this._previousStart=0,this._previousEnd=0,this._isReversed=!1,this._startFired=!1}isActive(){if(this._eachInstances)return this._eachInstances.some((J)=>J.isActive());return this._isActive}getName(){return this._name}getFirstChildAnimation(){let J=this._children[0];if(J?.type==="animation")return J.child;return null}}function R0(J,$,Q){let q=J;if(T($)){let z=Q??($.startsWith("scale")?"":"px");return(G)=>{P(J,$,G,z),q.style.transform=E(J)}}if($.startsWith("--")){let z=Q??"";return(G)=>{q.style.setProperty($,`${G}${z}`)}}let Z=$.replace(/([A-Z])/g,"-$1").toLowerCase(),j=Q??"";return(z)=>{q.style.setProperty(Z,`${z}${j}`)}}function Q7(J){if(typeof location>"u")return!J.includes(":");try{let $=new URL(J,location.href);return $.protocol==="https:"||$.protocol==="http:"}catch{return!J.includes(":")}}class Z0 extends h{_element=null;_innerElement=null;_mousePos={x:-100,y:-100};_cursorPos={x:-100,y:-100};_xSetter=null;_ySetter=null;_squeezeSetter=null;_squeezeConfig={min:0.55,max:1.2,multiplier:150};_state="default";_stateTimelines=new Map;_parsedStates=new Map;_textElement=null;_mediaElement=null;_tickerCallback;_boundMouseMove;_boundMouseDown;_boundMouseUp;_hoverFrozenRects=new Map;_isHoveringCursorTarget=!1;_boundHoverTargetMoveHandler=null;_hoverListeners=new Map;_attributeListeners=new Map;constructor(J,$){super(J,$);if(this._config={type:"basic",smooth:0.25,hideNative:!1,...$},$.squeeze===!0)this._squeezeConfig={min:0.55,max:1.2,multiplier:150};else if(typeof $.squeeze==="object")this._squeezeConfig={min:$.squeeze.min??0.55,max:$.squeeze.max??1.2,multiplier:$.squeeze.multiplier??150};if(this._parsedStates.set("default",this._parseStateConfig($.default)),$.hover)this._parsedStates.set("hover",this._parseStateConfig($.hover));if($.click)this._parsedStates.set("click",this._parseStateConfig($.click))}_parseStateConfig(J){let{targets:$,duration:Q,ease:q,enabled:Z,...j}=J;return{properties:j,duration:Q??0.15,ease:q??"power3.inOut",targets:$,enabled:Z??!0}}_onEnable(){if(this._element=this._createContainer(),this._innerElement=document.createElement("div"),this._innerElement.setAttribute("data-cursor-inner",""),this._innerElement.style.cssText="pointer-events:none;position:absolute;top:0;left:0;",this._element.appendChild(this._innerElement),P(this._innerElement,"x",-50,"%"),P(this._innerElement,"y",-50,"%"),this._xSetter=R0(this._element,"x","px"),this._ySetter=R0(this._element,"y","px"),this._config.squeeze)this._squeezeSetter=R0(this._element,"scale");if(this._cursorPos={x:-100,y:-100},this._mousePos={x:-100,y:-100},this._xSetter(-100),this._ySetter(-100),this._applyProperties(this._parsedStates.get("default").properties),this._innerElement.style.transform=E(this._innerElement),this._config.hideNative)document.body.style.cursor="none";if(this._config.type==="text")this._setupTextCursor();else if(this._config.type==="media")this._setupMediaCursor();this._createStateTimelines(),this._setupEventListeners(),this._tickerCallback=(J)=>this._tick(J),w.getInstance().add(this._tickerCallback)}_onDisable(){if(this._tickerCallback)w.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;if(this._config.hideNative)document.body.style.cursor="";if(this._removeEventListeners(),this._stateTimelines.forEach((J)=>J.kill()),this._stateTimelines.clear(),this._innerElement?.parentNode)this._innerElement.remove();if(this._innerElement=null,this._element?.parentNode)this._element.remove();this._element=null}_createContainer(){let J=document.createElement("div");return J.setAttribute("data-cursor-container",""),J.style.cssText="position:fixed;top:0;left:0;pointer-events:none;z-index:999999;width:0;height:0;",document.body.appendChild(J),J}_applyProperties(J){if(!this._innerElement)return;for(let[$,Q]of Object.entries(J))if($==="transform"){let q=Z0._expandTransformShorthand(String(Q));for(let[Z,j]of Object.entries(q))P(this._innerElement,Z,j)}else this._innerElement.style.setProperty(m($),String(Q))}_createStateTimelines(){if(!this._innerElement)return;let J=this._parsedStates.get("hover");if(J&&J.enabled){let Q=new R;Q._addEntry(this._innerElement,{to:Z0._expandStateProperties(J.properties),duration:J.duration,ease:J.ease}),this._stateTimelines.set("hover",Q)}let $=this._parsedStates.get("click");if($&&$.enabled){let Q=new R;Q._addEntry(this._innerElement,{to:Z0._expandStateProperties($.properties),duration:$.duration,ease:$.ease}),this._stateTimelines.set("click",Q)}}static _expandStateProperties(J){let $={};for(let[Q,q]of Object.entries(J))if(Q==="transform"){let Z=Z0._expandTransformShorthand(String(q));Object.assign($,Z)}else $[Q]=q;return $}static _expandTransformShorthand(J){let $={},Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,q;while((q=Q.exec(J))!==null){let Z=q[1],j=q[2].split(",").map((z)=>parseFloat(z.trim()));switch(Z){case"scale":{let z=j[0]??1,G=j.length>1?j[1]:z;if(z===G)$.scale=z;else $.scaleX=z,$.scaleY=G;break}case"scaleX":$.scaleX=j[0]??1;break;case"scaleY":$.scaleY=j[0]??1;break;case"scaleZ":$.scaleZ=j[0]??1;break;case"rotate":$.rotate=j[0]??0;break;case"rotateX":$.rotateX=j[0]??0;break;case"rotateY":$.rotateY=j[0]??0;break;case"rotateZ":$.rotateZ=j[0]??0;break;case"skewX":$.skewX=j[0]??0;break;case"skewY":$.skewY=j[0]??0;break}}return $}_setupEventListeners(){if(this._boundMouseMove=(Q)=>{this._mousePos.x=Q.clientX,this._mousePos.y=Q.clientY},document.addEventListener("mousemove",this._boundMouseMove),this._parsedStates.get("click")?.enabled)this._boundMouseDown=()=>this._setState("click"),this._boundMouseUp=()=>this._setState(this._state==="click"?"default":this._state),document.addEventListener("mousedown",this._boundMouseDown),document.addEventListener("mouseup",this._boundMouseUp);let $=this._parsedStates.get("hover");if($?.enabled&&$.targets&&$.targets.length>0)this._setupHoverTargets($.targets)}_setupHoverTargets(J){for(let $ of J){let Q;try{Q=document.querySelectorAll($)}catch(q){console.warn(`[Motion] Invalid hover target selector "${$}":`,q);continue}for(let q of Q)this._hoverFrozenRects.set(q,V(q))}if(this._hoverFrozenRects.size===0)return;this._boundHoverTargetMoveHandler=($)=>{let{clientX:Q,clientY:q}=$,Z=!1;for(let j of this._hoverFrozenRects.values())if(Q>=j.left&&Q<=j.right&&q>=j.top&&q<=j.bottom){Z=!0;break}if(Z&&!this._isHoveringCursorTarget)this._isHoveringCursorTarget=!0,this._setState("hover");else if(!Z&&this._isHoveringCursorTarget){if(this._isHoveringCursorTarget=!1,this._state==="hover")this._setState("default")}},window.addEventListener("mousemove",this._boundHoverTargetMoveHandler)}_setupTextCursor(){if(!this._innerElement)return;this._innerElement.style.display="grid",this._innerElement.style.placeItems="center",this._innerElement.style.overflow="visible",this._textElement=document.createElement("div"),this._textElement.setAttribute("data-cursor-text",""),this._textElement.style.whiteSpace="nowrap",this._textElement.style.opacity="0",this._innerElement.appendChild(this._textElement);let $=this._parsedStates.get("hover")?.duration??0.15;if(this._textElement.style.transition=`opacity ${$}s ease-in-out`,this._config.text)for(let[q,Z]of Object.entries(this._config.text))this._textElement.style.setProperty(m(q),String(Z));let Q=document.querySelectorAll("[mp-cursor-text], [mp-cursor-tooltip]");for(let q of Q){let Z=(z)=>{let G=z.target,N=G.getAttribute("mp-cursor-text")??G.getAttribute("mp-cursor-tooltip")??"";if(this._textElement)this._textElement.textContent=N,this._textElement.style.opacity="1";this._setState("hover")},j=()=>{if(this._textElement)this._textElement.style.opacity="0";if(this._state==="hover")this._setState("default")};q.addEventListener("mouseenter",Z),q.addEventListener("mouseleave",j),this._attributeListeners.set(q,{enter:Z,leave:j})}}_setupMediaCursor(){if(!this._innerElement)return;let J=document.createElement("img");J.setAttribute("data-cursor-media",""),J.style.display="none",this._innerElement.appendChild(J);let $=document.createElement("video");if($.setAttribute("data-cursor-media",""),$.autoplay=!0,$.muted=!0,$.loop=!0,$.style.display="none",this._innerElement.appendChild($),this._config.media)for(let[q,Z]of Object.entries(this._config.media))J.style.setProperty(m(q),String(Z)),$.style.setProperty(m(q),String(Z));let Q=document.querySelectorAll("[mp-cursor-media]");for(let q of Q){let Z=(z)=>{let G=z.target.getAttribute("mp-cursor-media")||"";if(!G||!Q7(G)){if(G)console.warn(`[Motion] Blocked unsafe media URL: "${G}". Only http/https URLs and relative paths are allowed.`);return}if(G.endsWith(".mp4")||G.endsWith(".webm"))$.src=G,$.style.display="block",J.style.display="none",$.play().catch(()=>{}),this._mediaElement=$;else J.src=G,J.style.display="block",$.style.display="none",this._mediaElement=J;this._setState("hover")},j=()=>{if(J.style.display="none",$.style.display="none",$.pause(),this._state==="hover")this._setState("default")};q.addEventListener("mouseenter",Z),q.addEventListener("mouseleave",j),this._attributeListeners.set(q,{enter:Z,leave:j})}}_removeEventListeners(){if(this._boundMouseMove)document.removeEventListener("mousemove",this._boundMouseMove);if(this._boundMouseDown)document.removeEventListener("mousedown",this._boundMouseDown);if(this._boundMouseUp)document.removeEventListener("mouseup",this._boundMouseUp);if(this._boundHoverTargetMoveHandler)window.removeEventListener("mousemove",this._boundHoverTargetMoveHandler),this._boundHoverTargetMoveHandler=null;this._hoverFrozenRects.clear(),this._isHoveringCursorTarget=!1,this._hoverListeners.clear(),this._attributeListeners.forEach((J,$)=>{$.removeEventListener("mouseenter",J.enter),$.removeEventListener("mouseleave",J.leave)}),this._attributeListeners.clear()}_setState(J){if(this._state===J)return;let $=this._state;this._state=J;let Q=this._stateTimelines.get(J),q=this._stateTimelines.get($);if(J==="default"){if(q)q.reverse()}else{if($!=="default"&&q)q.reverse();if(Q)Q.play()}}_tick(J){if(!this._xSetter||!this._ySetter)return;let $=this._config.smooth??0.25,Q=Math.pow($,2.5)||0.000001,q=1-Math.pow(1-Q,J*60);if(this._cursorPos.x+=(this._mousePos.x-this._cursorPos.x)*q,this._cursorPos.y+=(this._mousePos.y-this._cursorPos.y)*q,this._xSetter(this._cursorPos.x),this._ySetter(this._cursorPos.y),this._squeezeSetter&&this._config.squeeze){let Z=this._calculateSqueeze();this._squeezeSetter(Z)}for(let Z of this._stateTimelines.values())if(Z.isActive())Z.update(J)}_calculateSqueeze(){let J=this._cursorPos.x-this._mousePos.x,$=this._cursorPos.y-this._mousePos.y,Q=Math.sqrt(J*J+$*$),{min:q,max:Z,multiplier:j}=this._squeezeConfig,z=1-(Math.exp(Q/j)-1)/10;if(Number.isNaN(z))return 1;return Math.max(q,Math.min(Z,z))}getElement(){return this._element}getState(){return this._state}}F.registerTrigger("cursor",Z0);class mJ extends h{_links=[];_listeners=new Map;_isNavigating=!1;_pendingUrl=null;_onCompleteHandler=null;_pollTimerId=null;constructor(J,$){super(J,$)}_onEnable(){if(this._isInsideBuilder())return;this._resolveLinks(),this._addClickListeners()}_onDisable(){if(this._cleanupListenerMap(this._listeners),this._links=[],this._isNavigating=!1,this._pendingUrl=null,this._pollTimerId!==null)clearTimeout(this._pollTimerId),this._pollTimerId=null;if(this._onCompleteHandler)this._onCompleteHandler=null}_isInsideBuilder(){try{if(typeof window<"u"&&window.top?.mp_iframe)return!0}catch{}return!1}_resolveLinks(){if(typeof document>"u")return;let J=this._config.mode||"all",$;if(J==="include"&&this._config.selectors&&this._config.selectors.trim()!=="")try{$=Array.from(document.querySelectorAll(this._config.selectors)).filter((q)=>q.tagName==="A"),document.querySelectorAll(this._config.selectors).forEach((q)=>{if(q.tagName!=="A"){let Z=q.querySelectorAll("a");$.push(...Array.from(Z))}})}catch(Q){console.warn(`[Motion] Invalid selector "${this._config.selectors}":`,Q),$=[]}else if(J==="include")$=[];else if(J==="exclude"&&this._config.selectors&&this._config.selectors.trim()!==""){let Q=Array.from(document.querySelectorAll("a")),q;try{q=new Set(document.querySelectorAll(this._config.selectors))}catch(Z){console.warn(`[Motion] Invalid selector "${this._config.selectors}":`,Z),q=new Set}$=Q.filter((Z)=>!q.has(Z))}else $=Array.from(document.querySelectorAll("a"));this._links=[...new Set($)],this._links=this._links.filter((Q)=>this._shouldIntercept(Q))}_shouldIntercept(J){let $=J.getAttribute("href");if(!$||$==="")return!1;let Q=this._config.skipHref||[];if($.startsWith("#"))return!Q.includes("anchor");if($.toLowerCase().startsWith("javascript:"))return!Q.includes("javascript");if($.toLowerCase().startsWith("mailto:")||$.toLowerCase().startsWith("tel:"))return!Q.includes("mailto");return!0}_addClickListeners(){this._links.forEach((J)=>{let $=new Map,Q=(q)=>{if(this._isNavigating)return;let Z=q;if(Z.ctrlKey||Z.metaKey||Z.shiftKey||Z.altKey)return;let j=J.getAttribute("target");if(j&&j!=="_self")return;let z=J.href;if(!z)return;q.preventDefault(),q.stopPropagation(),this._isNavigating=!0,this._pendingUrl=z,this._onCompleteHandler=()=>{this._navigate()},this._timeline.restart(),this._waitForCompletion()};J.addEventListener("click",Q),$.set("click",Q),this._listeners.set(J,$)})}_waitForCompletion(){let J=this._timeline,$=16,Q=()=>{if(this._pollTimerId=null,!this._enabled||!this._isNavigating||!this._pendingUrl)return;let q=J.progress(),Z=J.isActive();if(q>=1||!Z&&q>0)this._navigate();else this._pollTimerId=setTimeout(Q,16)};this._pollTimerId=setTimeout(Q,16)}_navigate(){if(!this._pendingUrl)return;let J=this._pendingUrl;if(this._pendingUrl=null,this._isNavigating=!1,typeof window<"u")window.location.href=J}}F.registerTrigger("pageExit",mJ);var QJ=null;function q7(){if(!QJ&&typeof document<"u"){let J=document.createElement("canvas");J.width=1,J.height=1,QJ=J.getContext("2d")}return QJ}function gJ(J){let $=J.replace("#",""),Q,q,Z,j=1;if($.length===3)Q=parseInt($[0]+$[0],16),q=parseInt($[1]+$[1],16),Z=parseInt($[2]+$[2],16);else if($.length===4)Q=parseInt($[0]+$[0],16),q=parseInt($[1]+$[1],16),Z=parseInt($[2]+$[2],16),j=parseInt($[3]+$[3],16)/255;else if($.length===6)Q=parseInt($.slice(0,2),16),q=parseInt($.slice(2,4),16),Z=parseInt($.slice(4,6),16);else if($.length===8)Q=parseInt($.slice(0,2),16),q=parseInt($.slice(2,4),16),Z=parseInt($.slice(4,6),16),j=parseInt($.slice(6,8),16)/255;else return null;if(isNaN(Q)||isNaN(q)||isNaN(Z)||isNaN(j))return null;return new Float32Array([Q,q,Z,j])}function Z7(J){let $=J.match(/rgba?\s*\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*(?:[,\/]\s*([\d.]+))?\s*\)/i);if(!$)return null;let Q=parseFloat($[1]),q=parseFloat($[2]),Z=parseFloat($[3]),j=$[4]!==void 0?parseFloat($[4]):1;if(isNaN(Q)||isNaN(q)||isNaN(Z)||isNaN(j))return null;return new Float32Array([Q,q,Z,j])}function j7(J,$,Q){J=J/360,$=$/100,Q=Q/100;let q,Z,j;if($===0)q=Z=j=Q;else{let z=(W,_,B)=>{if(B<0)B+=1;if(B>1)B-=1;if(B<0.16666666666666666)return W+(_-W)*6*B;if(B<0.5)return _;if(B<0.6666666666666666)return W+(_-W)*(0.6666666666666666-B)*6;return W},G=Q<0.5?Q*(1+$):Q+$-Q*$,N=2*Q-G;q=z(N,G,J+0.3333333333333333),Z=z(N,G,J),j=z(N,G,J-0.3333333333333333)}return[Math.round(q*255),Math.round(Z*255),Math.round(j*255)]}function G7(J){let $=J.match(/hsla?\s*\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)%\s*[,\s]\s*([\d.]+)%\s*(?:[,\/]\s*([\d.]+))?\s*\)/i);if(!$)return null;let Q=parseFloat($[1]),q=parseFloat($[2]),Z=parseFloat($[3]),j=$[4]!==void 0?parseFloat($[4]):1;if(isNaN(Q)||isNaN(q)||isNaN(Z)||isNaN(j))return null;let[z,G,N]=j7(Q,q,Z);return new Float32Array([z,G,N,j])}function z7(J,$){if(!$||typeof window>"u")return null;let Q=J.match(/var\s*\(\s*(--[\w-]+)\s*\)/i);if(!Q)return null;let q=Q[1],Z=window.getComputedStyle($).getPropertyValue(q).trim();if(!Z)return null;return qJ(Z,$)}function N7(J){let $=q7();if(!$)return null;$.fillStyle="#000000",$.fillStyle=J;let Q=$.fillStyle;if(Q==="#000000"&&J.toLowerCase()!=="black"&&J!=="#000000"&&J!=="#000")return null;return gJ(Q)}function qJ(J,$){if(!J||typeof J!=="string")return null;let Q=J.trim().toLowerCase();if(Q==="transparent")return new Float32Array([0,0,0,0]);if(Q.startsWith("#"))return gJ(Q);if(Q.startsWith("rgb"))return Z7(Q);if(Q.startsWith("hsl"))return G7(Q);if(Q.startsWith("var("))return z7(Q,$);return N7(Q)}function W7(J,$){if(typeof window>"u")return new Float32Array([0,0,0,1]);let Q=window.getComputedStyle(J),q=$.replace(/[A-Z]/g,(z)=>`-${z.toLowerCase()}`),Z=Q.getPropertyValue(q).trim();if(!Z||Z==="none")return new Float32Array([0,0,0,0]);return qJ(Z,J)||new Float32Array([0,0,0,1])}X.color={parseColor:qJ,getCurrentColor:W7};var _7={blur:{value:0,unit:"px"},brightness:{value:1,unit:""},contrast:{value:1,unit:""},saturate:{value:1,unit:""},grayscale:{value:0,unit:""},sepia:{value:0,unit:""},"hue-rotate":{value:0,unit:"deg"},invert:{value:0,unit:""},opacity:{value:1,unit:""}};function B7(J){let $=J.trim().match(/^([\w-]+)\(\s*([\d.]+)(px|%|deg)?\s*\)$/);if(!$)return null;let Q=$[1].toLowerCase(),q=parseFloat($[2]),Z=$[3]||"";if(Z==="%")q=q/100,Z="";return{name:Q,value:q,unit:Z}}function sJ(J){if(J===null||J===void 0||typeof J!=="string")return null;let $=J.trim().toLowerCase();if($==="none"||$==="")return[];let Q=[],q=/([\w-]+)\([^)]+\)/g,Z;while((Z=q.exec($))!==null){let j=B7(Z[0]);if(j)Q.push(j)}return Q.length>0?Q:null}function Y7(J){if(!J||J.length===0)return"none";return J.map(($)=>{let Q;if($.name==="blur")Q=`${$.value}${$.unit||"px"}`;else if($.name==="hue-rotate")Q=`${$.value}${$.unit||"deg"}`;else Q=`${$.value}`;return`${$.name}(${Q})`}).join(" ")}function H7(J){if(typeof window>"u")return[];let $=window.getComputedStyle(J),Q=$.filter||$.getPropertyValue("filter");if(!Q||Q==="none")return[];return sJ(Q)||[]}function X7(J){let $=_7[J];if($)return{name:J,value:$.value,unit:$.unit};return{name:J,value:0,unit:""}}function K7(J,$){let Q=new Set;for(let j of J)Q.add(j.name);for(let j of $)Q.add(j.name);let q=[],Z=[];for(let j of Q){let z=J.find((W)=>W.name===j),G=$.find((W)=>W.name===j),N=X7(j);q.push(z||N),Z.push(G||N)}return{start:q,end:Z}}var j0=[];function U7(J,$,Q){let q=J.length;if(j0.length<q)for(let Z=j0.length;Z<q;Z++)j0.push({name:"",value:0,unit:""});for(let Z=0;Z<q;Z++){let j=J[Z],z=$[Z],G=j0[Z];G.name=j.name,G.value=j.value+(z.value-j.value)*Q,G.unit=j.unit||z.unit}return j0.length=q,j0}X.filter={parseFilter:sJ,getCurrentFilter:H7,mergeFilterArrays:K7,interpolateFilters:U7,filterToString:Y7};var oJ=new WeakMap;function I7(J){return"getTotalLength"in J&&typeof J.getTotalLength==="function"}function b0(J){let $=oJ.get(J);if($!==void 0)return $;if(I7(J)){let Q=J.getTotalLength();return oJ.set(J,Q),Q}return 0}function A7(J,$){if(J===null||J===void 0)return null;if(typeof J==="object"){let Q=J.start??0,q=J.end??100;return{start:Q/100,end:q/100}}if(typeof J==="string"){let Q=J.trim();if(Q==="true")return{start:0,end:1};if(Q==="false"||Q===""||Q==="none")return{start:0,end:0};let q=Q.match(/^([-\d.]+)(px|%)?\s+([-\d.]+)(px|%)?$/);if(q){let j=parseFloat(q[1]),z=q[2]||"%",G=parseFloat(q[3]),N=q[4]||"%",W=$?b0($):0,_=ZJ(j,z,W),B=ZJ(G,N,W);return{start:_,end:B}}let Z=Q.match(/^([-\d.]+)(px|%)?$/);if(Z){let j=parseFloat(Z[1]),z=Z[2]||"%",G=$?b0($):0;return{start:0,end:ZJ(j,z,G)}}}return null}function ZJ(J,$,Q){if($==="px"&&Q>0)return J/Q;return J/100}function F7(J){let $=b0(J);if($===0)return{start:0,end:1};try{if(typeof window<"u"&&window.getComputedStyle){let Q=window.getComputedStyle(J),q=Q.strokeDasharray,Z=Q.strokeDashoffset;if(!q||q==="none")return{start:0,end:1};let j=q.split(/[\s,]+/).map(parseFloat).filter((G)=>!isNaN(G)),z=parseFloat(Z)||0;if(j.length>=1){let G=j[0],N=z/$,W=(z+G)/$;return{start:N,end:W}}}}catch{}return{start:0,end:1}}function O7(J,$,Q,q){if(!(J instanceof SVGElement)||q===0)return;let Z=J,j=Math.abs(Q-$)*q,z=Math.min($,Q)*q;Z.style.strokeDasharray=`${j} ${q}`,Z.style.strokeDashoffset=`${-z}`}X.drawSVG={parseDrawSVG:A7,getCurrentDrawSVG:F7,getPathLength:b0,applyDrawSVG:O7};var w0=new WeakMap,C0=new WeakMap;class x0{static split(J,$,Q){if(!(J instanceof HTMLElement))return[];let q=w0.get(J);if(q!==void 0)J.innerHTML=q,J.removeAttribute("data-split"),C0.delete(J);else w0.set(J,J.innerHTML);let Z={chars:[],words:[],lines:[],elements:[]},j=$.split(",").map((W)=>W.trim()),z=j.includes("chars"),G=j.includes("words"),N=j.includes("lines");if(N)this._splitWithLinesDom(J,G,z,Z);else if(G&&z)this._splitWordsWithCharsDom(J,Z);else if(G)this._splitWordsDom(J,Z);else if(z)this._splitCharsDom(J,Z);if(z)Z.elements=Z.chars;else if(G)Z.elements=Z.words;else if(N)Z.elements=Z.lines;if(Q?.mask&&Z.elements.length>0)this._applyMaskWrappers(Z);return C0.set(J,Z),J.setAttribute("data-split",$),Z.elements}static _splitWordsDom(J,$){let Q=Array.from(J.childNodes);for(let q of Q)if(q.nodeType===3){let Z=q.textContent||"";if(!Z)continue;let j=Z.split(/(\s+)/),z=document.createDocumentFragment(),G=!1;for(let N of j)if(/^\s+$/.test(N))z.appendChild(document.createTextNode(N.replace(/\n/g," "))),G=!0;else if(N){let W=document.createElement("span");W.setAttribute("data-split-word",""),W.setAttribute("data-word-index",String($.words.length)),W.style.display="inline-block",W.textContent=N,$.words.push(W),z.appendChild(W),G=!0}if(G)J.replaceChild(z,q)}else if(q.nodeType===1){let Z=q;if(Z.tagName==="BR")continue;this._splitWordsDom(Z,$)}}static _splitCharsDom(J,$){let Q=Array.from(J.childNodes);for(let q of Q)if(q.nodeType===3){let Z=q.textContent||"";if(!Z)continue;let j=document.createDocumentFragment();for(let z of Z)if(z===" "||z===`
|
|
29
|
+
`,k.appendChild(L),k},Y=B("scroller-start",Q,"right"),U=B("scroller-end",q,"right"),_=B("start",Q,"left"),H=B("end",q,"left");if(!this._triggerElement)_.style.display="none",H.style.display="none";if(this._markerContainer.appendChild(Y),this._markerContainer.appendChild(U),this._markerContainer.appendChild(_),this._markerContainer.appendChild(H),this._markers={scrollerStart:Y,scrollerEnd:U,elementStart:_,elementEnd:H},j){let A=this._scroller;if(window.getComputedStyle(A).position==="static")A.style.position="relative";A.appendChild(this._markerContainer)}else document.body.appendChild(this._markerContainer),this._markerContainer.style.position="fixed";this._scrollerStartOffset=W,this._scrollerEndOffset=N}update(J,$,Q){if(!this._markers||!this._markerContainer)return;this._triggerElement=$||void 0;let q=this._scroller!==window;if(q)this._markers.scrollerStart.style.top=`${J+this._scrollerStartOffset}px`,this._markers.scrollerEnd.style.top=`${J+this._scrollerEndOffset}px`;else this._markers.scrollerStart.style.top=`${this._scrollerStartOffset}px`,this._markers.scrollerEnd.style.top=`${this._scrollerEndOffset}px`;if(this._triggerElement){let Z=h(this._triggerElement),j=V(this._startConfig.split(" ")[0]||"top",Z.height,Q),z=this._endConfig.startsWith("+=")?j:V(this._endConfig.split(" ")[0]||"bottom",Z.height,Q);if(this._markers.elementStart.style.display="",this._markers.elementEnd.style.display="",q){let G=this._scroller.getBoundingClientRect(),W=Z.top-G.top+J;this._markers.elementStart.style.top=`${W+j}px`,this._markers.elementEnd.style.top=`${W+z}px`}else this._markers.elementStart.style.top=`${Z.top+j}px`,this._markers.elementEnd.style.top=`${Z.top+z}px`}else this._markers.elementStart.style.display="none",this._markers.elementEnd.style.display="none"}cleanup(){if(this._markerContainer&&this._markerContainer.parentNode)this._markerContainer.parentNode.removeChild(this._markerContainer);this._markerContainer=void 0,this._markers=void 0,this._triggerElement=void 0}}class g extends v{static _nextId=0;_id;static _SCRUB_TICKER_PRIORITY=1;static _activeInstances=new Set;static _loadListenerAdded=!1;_scrollListener;_scrubTickListener=null;_currentProgress=0;_targetProgress=0;_scrubLag=0;_scroller;_triggerStart=0;_triggerEnd=0;_pinManager=null;_markerManager=null;_triggerState="before";_toggleActions=["play","reverse","play","reverse"];_initializing=!1;constructor(J,$){super(J,$);this._id=g._nextId++,this._scrubLag=typeof $.scrub==="number"?$.scrub:0}static _ensureLoadListener(){if(g._loadListenerAdded||typeof window>"u")return;if(g._loadListenerAdded=!0,document.readyState==="complete")return;window.addEventListener("load",()=>{setTimeout(()=>{for(let J of g._activeInstances)J.refresh()},100)},{once:!0})}_resolveScroller(){if(this._config.scroller)if(typeof this._config.scroller==="string"){if(typeof document>"u"){this._scroller=window;return}try{let J=document.querySelector(this._config.scroller);this._scroller=J??window}catch(J){console.warn(`[Motion] Invalid scroller selector "${this._config.scroller}":`,J),this._scroller=window}}else this._scroller=this._config.scroller;else this._scroller=window}_resolvePinElement(){if(!this._config.pin||typeof document>"u")return null;if(typeof this._config.pin==="string")return document.querySelector(this._config.pin);else if(this._config.pin===!0){let J=this._timeline.getFirstChildAnimation();if(J){let $=J.getTargets();if($.length>0&&$[0]instanceof HTMLElement)return $[0]}}return null}_defaultStart(){return this._config.start||(this._config.pin?"top top":"top bottom")}_defaultEnd(){return this._config.end||"bottom top"}_getFirstAnimatedElement(){let J=this._timeline.getFirstChildAnimation();if(J){let $=J.getTargets();if($.length>0&&$[0]instanceof HTMLElement)return $[0]}return null}_resolveTriggerElement(){if(this._config.target instanceof HTMLElement)return this._config.target;if(typeof this._config.target==="string"&&typeof document<"u"){let J=document.querySelector(this._config.target);if(J instanceof HTMLElement)return J}return this._getFirstAnimatedElement()}_calculateTriggerPositions(J){let $=J||this._resolveTriggerElement(),Q=this._getViewportHeight(),q=this._getScrollTop();if(!$){this._triggerStart=0,this._triggerEnd=this._getScrollHeight();return}let Z=this._pinManager?.getLayoutRect()??h($),j;if(this._scroller instanceof Element){let _=this._scroller.getBoundingClientRect();j=Z.top-_.top+q}else j=Z.top+q;let G=this._defaultStart().split(" "),W=G[0]||"top",N=G[1]||"top",B=V(W,Z.height,Q),Y=V(N,Q,Q);this._triggerStart=j+B-Y;let U=this._defaultEnd();if(U.startsWith("+=")){let _=V(U.slice(2),Q,Q);this._triggerEnd=this._triggerStart+_}else{let _=U.split(" "),H=_[0]||"bottom",A=_[1]||"top",K=V(H,Z.height,Q),M=V(A,Q,Q);this._triggerEnd=j+K-M}if(this._triggerEnd<=this._triggerStart)this._triggerEnd=this._triggerStart+Math.max(Q,100)}_onEnable(){this._resolveScroller();let J=this._resolvePinElement();this._calculateTriggerPositions(J),g._activeInstances.add(this),g._ensureLoadListener();let Q=(this._config.toggleActions||"play reverse play reverse").trim().split(/\s+/);if(this._toggleActions=[Q[0]||"play",Q[1]||"reverse",Q[2]||"play",Q[3]||"reverse"],J){let Z=this._defaultStart().split(" "),j=this._getViewportHeight(),z=V(Z[0]||"top",J.getBoundingClientRect().height,j),W=V(Z[1]||"top",j,j)-z;this._pinManager=x.getOrCreate(this._id,J),this._pinManager.setup(J,this._triggerStart,this._triggerEnd,W,this._scroller===window,this._config.pinSpacing)}if(this._config.markers&&typeof document<"u"){let q=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager=new e0(this._id),this._markerManager.setup({scroller:this._scroller,triggerElement:q,startConfig:this._defaultStart(),endConfig:this._defaultEnd(),markerConfig:this._config.markers,viewportHeight:this._getViewportHeight()})}if(this._scrollListener=()=>this._onScroll(),this._scroller){if(this._scroller.addEventListener("scroll",this._scrollListener,{passive:!0}),this._initializing=!0,this._onScroll(),this._initializing=!1,this._config.scrub===!1||this._config.scrub===void 0){if(this._triggerState==="active")C(this._toggleActions[0],this._timeline);else if(this._triggerState==="after")this._timeline.progress(1),this._timeline.pause()}}}_onDisable(){if(this._scrollListener&&this._scroller)this._scroller.removeEventListener("scroll",this._scrollListener);if(this._markerManager?.cleanup(),this._markerManager=null,this._pinManager){let J=this._pinManager.getElement();if(J)x.release(this._id,J);else this._pinManager.cleanup();this._pinManager=null}this._stopSmoothScrollLoop(),g._activeInstances.delete(this)}refresh(){if(!this._enabled)return;let J=this._pinManager?.getElement()||null;if(this._calculateTriggerPositions(J),this._pinManager&&J){let Q=this._defaultStart().split(" "),q=this._getViewportHeight(),Z=this._pinManager.getLayoutRect()?.height??J.getBoundingClientRect().height,j=V(Q[0]||"top",Z,q),G=V(Q[1]||"top",q,q)-j;this._pinManager.setup(J,this._triggerStart,this._triggerEnd,G,this._scroller===window,this._config.pinSpacing)}if(this._markerManager&&this._config.markers){let $=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager.setup({scroller:this._scroller,triggerElement:$,startConfig:this._defaultStart(),endConfig:this._defaultEnd(),markerConfig:this._config.markers,viewportHeight:this._getViewportHeight()})}this._onScroll()}_getViewportHeight(){if(this._scroller===window)return typeof window<"u"?window.innerHeight:0;else if(this._scroller instanceof Element)return this._scroller.clientHeight;return 0}_getScrollTop(){if(this._scroller===window)return typeof window<"u"?window.scrollY||window.pageYOffset:0;else if(this._scroller instanceof Element)return this._scroller.scrollTop;return 0}_getScrollHeight(){if(this._scroller===window){if(typeof document<"u"&&document.documentElement)return document.documentElement.scrollHeight-window.innerHeight;return 0}else if(this._scroller instanceof Element)return this._scroller.scrollHeight-this._scroller.clientHeight;return 0}_onScroll(){if(!this._enabled)return;let J=this._getScrollTop(),$=this._triggerEnd-this._triggerStart,Q=$>0?(J-this._triggerStart)/$:0;if(Q=Math.max(0,Math.min(1,Q)),Q=this._applySnap(Q),this._targetProgress=Q,this._pinManager?.update(J),this._markerManager){let q=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager.update(J,q,this._getViewportHeight())}if(this._config.scrub!==!1&&this._config.scrub!==void 0)if(this._scrubLag===0)this._currentProgress=this._targetProgress,o0(()=>this._timeline.progress(this._currentProgress));else this._startSmoothScrollLoop();else{let q;if(Q<=0)q="before";else if(Q>=1)q="after";else q="active";if(q!==this._triggerState){let Z=this._triggerState;if(this._triggerState=q,this._initializing)return;o0(()=>{if(q==="active"&&Z==="before")C(this._toggleActions[0],this._timeline);else if(q==="after"&&Z==="active")C(this._toggleActions[1],this._timeline);else if(q==="active"&&Z==="after")C(this._toggleActions[2],this._timeline);else if(q==="before"&&Z==="active")C(this._toggleActions[3],this._timeline);else if(q==="after"&&Z==="before")C(this._toggleActions[0],this._timeline),this._timeline.progress(1),C(this._toggleActions[1],this._timeline);else if(q==="before"&&Z==="after")C(this._toggleActions[2],this._timeline),this._timeline.progress(0),C(this._toggleActions[3],this._timeline)})}}}_applySnap(J){let $=this._config.snap;if($==null)return J;if(typeof $==="function")return $(J);if(Array.isArray($)){let Q=$[0]??J,q=Math.abs(J-Q);for(let Z=1;Z<$.length;Z++){let j=Math.abs(J-$[Z]);if(j<q)q=j,Q=$[Z]}return Q}if(typeof $==="number"&&$>0)return Math.round(J/$)*$;return J}_startSmoothScrollLoop(){if(this._scrubTickListener)return;this._scrubTickListener=(J,$)=>{if(!this._enabled){this._stopSmoothScrollLoop();return}let Q=this._targetProgress-this._currentProgress,q=1-Math.exp(-J*3/this._scrubLag);if(this._currentProgress+=Q*q,Math.abs(this._targetProgress-this._currentProgress)<0.0001){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress),this._stopSmoothScrollLoop();return}this._timeline.progress(this._currentProgress)},w.getInstance().add(this._scrubTickListener,g._SCRUB_TICKER_PRIORITY)}_stopSmoothScrollLoop(){if(this._scrubTickListener)w.getInstance().remove(this._scrubTickListener),this._scrubTickListener=null}}F.registerTrigger("scroll",g);class hJ{_registrations=[];_domContentLoaded=!1;_windowLoaded=!1;_initialized=!1;constructor(){this._initialize()}_initialize(){if(this._initialized)return;if(this._initialized=!0,typeof document<"u"){if(document.addEventListener("DOMContentLoaded",()=>{this._domContentLoaded=!0,this._triggerDuring()}),typeof window<"u")window.addEventListener("load",()=>{this._windowLoaded=!0,this._triggerAfter()});if(document.readyState==="interactive"||document.readyState==="complete")this._domContentLoaded=!0;if(document.readyState==="complete")this._windowLoaded=!0}}register(J,$){let Q=$.timing||"during";if(this._registrations.push({timeline:J,timing:Q}),Q==="before")J.play();else if(Q==="during"&&this._domContentLoaded)J.play();else if(Q==="after"&&this._windowLoaded)J.play()}unregister(J){this._registrations=this._registrations.filter(($)=>$.timeline!==J)}clear(){this._registrations=[]}_triggerDuring(){this._registrations.filter((J)=>J.timing==="during").forEach((J)=>J.timeline.play())}_triggerAfter(){this._registrations.filter((J)=>J.timing==="after").forEach((J)=>J.timeline.play())}_reset(){this._registrations=[],this._domContentLoaded=!1,this._windowLoaded=!1,this._initialized=!1,this._initialize()}}F.registerPageLoadTrigger(hJ);class TJ extends v{_targets=[];_listeners=new Map;_frozenRects=new Map;_state={x:0.5,y:0.5,distance:0.5,isInside:!1};_targetState={targetX:0.5,targetY:0.5,targetDistance:0.5};_tickerCallback;_defaultStartProgress=0.5;_defaultLeaveProgress=0.5;constructor(J,$){super(J,$);this._config={type:"distance",startProgress:this._defaultStartProgress,leaveProgress:this._defaultLeaveProgress,...$};let Q=this._config.startProgress??this._defaultStartProgress;this._state.x=Q,this._state.y=Q,this._state.distance=Q,this._targetState.targetX=Q,this._targetState.targetY=Q,this._targetState.targetDistance=Q}_onEnable(){if(this._targets=this._resolveElements(this._config.target),this._targets.length===0)this._addViewportListeners();else this._addTargetListeners();if(this._config.smooth!==void 0&&this._config.smooth>0)this._startSmoothingTicker();this._updateTimelineProgress()}_onDisable(){if(this._tickerCallback)w.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;this._frozenRects.clear(),this._cleanupListenerMap(this._listeners)}_addViewportListeners(){if(typeof window>"u")return;let J=new Map,$=(Q)=>{let q=Q;this._handleViewportMouseMove(q.clientX,q.clientY)};window.addEventListener("mousemove",$),J.set("mousemove",$),this._state.isInside=!0,this._listeners.set(window,J)}refresh(){for(let J of this._targets)this._frozenRects.set(J,h(J))}_addTargetListeners(){this._targets.forEach((J)=>{this._frozenRects.set(J,h(J));let $=new Map,Q=(j)=>{let z=j;this._handleTargetMouseMove(J,z.clientX,z.clientY)};J.addEventListener("mousemove",Q),$.set("mousemove",Q);let q=()=>{this._state.isInside=!0};J.addEventListener("mouseenter",q),$.set("mouseenter",q);let Z=()=>{this._state.isInside=!1,this._handleMouseLeave()};J.addEventListener("mouseleave",Z),$.set("mouseleave",Z),this._listeners.set(J,$)})}_handleViewportMouseMove(J,$){if(typeof window>"u")return;let{innerWidth:Q,innerHeight:q}=window,Z=Q/2,j=q/2;if(this._config.type==="axis")this._targetState.targetX=J/Q,this._targetState.targetY=$/q;else{let z=J-Z,G=$-j,W=Math.sqrt(z*z+G*G),N=Math.sqrt(Z*Z+j*j);this._targetState.targetDistance=1-Math.min(W/N,1)}this._applyProgress()}_handleTargetMouseMove(J,$,Q){let q=this._frozenRects.get(J)??J.getBoundingClientRect(),Z=q.left+q.width/2,j=q.top+q.height/2;if(this._config.type==="axis"){let z=$-q.left,G=Q-q.top;this._targetState.targetX=Math.max(0,Math.min(1,z/q.width)),this._targetState.targetY=Math.max(0,Math.min(1,G/q.height))}else{let z=$-Z,G=Q-j,W=Math.sqrt(z*z+G*G),N=Math.sqrt(Math.pow(q.width/2,2)+Math.pow(q.height/2,2));this._targetState.targetDistance=1-Math.min(W/N,1)}this._applyProgress()}_handleMouseLeave(){let J=this._config.leaveProgress??this._defaultLeaveProgress;if(this._targetState.targetX=J,this._targetState.targetY=J,this._targetState.targetDistance=J,!this._config.smooth)this._state.x=J,this._state.y=J,this._state.distance=J,this._updateTimelineProgress()}_applyProgress(){if(this._config.smooth)return;this._state.x=this._targetState.targetX,this._state.y=this._targetState.targetY,this._state.distance=this._targetState.targetDistance,this._updateTimelineProgress()}_startSmoothingTicker(){let J=Math.max(0,Math.min(1,this._config.smooth??0.1));this._tickerCallback=($)=>{let Q=this._lerp(this._state.x,this._targetState.targetX,J,$),q=this._lerp(this._state.y,this._targetState.targetY,J,$),Z=this._lerp(this._state.distance,this._targetState.targetDistance,J,$),j=0.0001,z=Math.abs(Q-this._state.x)<0.0001&&Math.abs(Q-this._targetState.targetX)<0.0001,G=Math.abs(q-this._state.y)<0.0001&&Math.abs(q-this._targetState.targetY)<0.0001,W=Math.abs(Z-this._state.distance)<0.0001&&Math.abs(Z-this._targetState.targetDistance)<0.0001;if(this._state.x=Q,this._state.y=q,this._state.distance=Z,!z||!G||!W)this._updateTimelineProgress()},w.getInstance().add(this._tickerCallback)}_lerp(J,$,Q,q){let Z=$-J;if(Math.abs(Z)<0.0001)return $;let j=0.5*Math.pow(1-Q,2)+0.005,z=1-Math.pow(1-j,q*60);return J+Z*z}_updateTimelineProgress(){if(this._config.type==="axis")this._timeline.setAxisProgress("x",this._state.x),this._timeline.setAxisProgress("y",this._state.y);else this._timeline.progress(this._state.distance)}}F.registerTrigger("mouseMove",TJ);class W0 extends v{_target=window;_tolerance;_dragMinimum;_dragMinimumSquared;_wheelSpeed;_scrollSpeed;_stopDelay;_preventDefault;_lockAxis;_animationStep;_smooth;_startX=0;_startY=0;_deltaX=0;_deltaY=0;_lockedAxis=null;_isPressed=!1;_isDragging=!1;_lastDirectionX=null;_lastDirectionY=null;_lastScrollX=0;_lastScrollY=0;_stopTimeout=null;_isMoving=!1;_lastActivityTime=0;_pendingActions=new Map;_rafScheduled=!1;_rafId=null;_wheelAccumulatorX=0;_wheelAccumulatorY=0;_wheelRafId=null;_scrollRafId=null;_lastPointerX=0;_lastPointerY=0;_activatedDirections=new Set;_targetProgress=0;_currentProgress=0;_interpolationRafId=null;_siblings=null;_index=0;static _sequenceStates=new WeakMap;_boundHandlers={};_frozenHoverRect=null;_gestureHoverActive=!1;_boundHoverMoveHandler=null;constructor(J,$){super(J,$);this._tolerance=$.tolerance??1,this._dragMinimum=$.dragMinimum??10,this._dragMinimumSquared=this._dragMinimum*this._dragMinimum,this._wheelSpeed=$.wheelSpeed??1,this._scrollSpeed=$.scrollSpeed??1,this._stopDelay=$.stopDelay??150,this._preventDefault=$.preventDefault??!1,this._lockAxis=$.lockAxis??!1,this._animationStep=$.animationStep??0.1,this._smooth=Math.max(0,Math.min(1,$.smooth??0));let Q=$;if(Q._siblings&&Q._index!==void 0){if(this._siblings=Q._siblings,this._index=Q._index,!W0._sequenceStates.has(this._siblings))W0._sequenceStates.set(this._siblings,{lastIndex:0})}}_onEnable(){let J=this._resolveElement(this._config.target,window);this._target=J??window;let $=this._config.types;if($.includes("pointer"))this._addPointerListeners();if($.includes("touch"))this._addTouchListeners();if($.includes("wheel"))this._addWheelListener();if($.includes("scroll"))this._addScrollListener();if(this._config.events.Hover||this._config.events.HoverEnd)this._addHoverListeners()}_onDisable(){if(this._stopTimeout)clearTimeout(this._stopTimeout),this._stopTimeout=null;if(this._rafId!==null)cancelAnimationFrame(this._rafId),this._rafId=null;if(this._wheelRafId!==null)cancelAnimationFrame(this._wheelRafId),this._wheelRafId=null;if(this._scrollRafId!==null)cancelAnimationFrame(this._scrollRafId),this._scrollRafId=null;if(this._interpolationRafId!==null)cancelAnimationFrame(this._interpolationRafId),this._interpolationRafId=null;this._rafScheduled=!1,this._pendingActions.clear();let J=this._target;if(this._boundHandlers.pointerDown)J.removeEventListener("pointerdown",this._boundHandlers.pointerDown),window.removeEventListener("pointermove",this._boundHandlers.pointerMove),window.removeEventListener("pointerup",this._boundHandlers.pointerUp);if(this._boundHandlers.touchStart)J.removeEventListener("touchstart",this._boundHandlers.touchStart),window.removeEventListener("touchmove",this._boundHandlers.touchMove),window.removeEventListener("touchend",this._boundHandlers.touchEnd);if(this._boundHandlers.wheel)J.removeEventListener("wheel",this._boundHandlers.wheel);if(this._boundHandlers.scroll)(this._target===window?window:this._target).removeEventListener("scroll",this._boundHandlers.scroll);if(this._boundHoverMoveHandler)window.removeEventListener("mousemove",this._boundHoverMoveHandler),this._boundHoverMoveHandler=null;this._frozenHoverRect=null,this._gestureHoverActive=!1,this._boundHandlers={}}_addPointerListeners(){this._boundHandlers.pointerDown=this._handlePointerDown.bind(this),this._boundHandlers.pointerMove=this._handlePointerMove.bind(this),this._boundHandlers.pointerUp=this._handlePointerUp.bind(this);let J={passive:!this._preventDefault};this._target.addEventListener("pointerdown",this._boundHandlers.pointerDown,J),window.addEventListener("pointermove",this._boundHandlers.pointerMove,J),window.addEventListener("pointerup",this._boundHandlers.pointerUp)}_handlePointerDown(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;if(this._preventDefault)J.preventDefault();this._handleInputStart(J.clientX,J.clientY)}_handlePointerMove(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;if(this._handleInputMove(J.clientX,J.clientY)){if(this._preventDefault)J.preventDefault()}}_handlePointerUp(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;this._handleInputEnd()}_addTouchListeners(){this._boundHandlers.touchStart=this._handleTouchStart.bind(this),this._boundHandlers.touchMove=this._handleTouchMove.bind(this),this._boundHandlers.touchEnd=this._handleTouchEnd.bind(this);let J={passive:!this._preventDefault};this._target.addEventListener("touchstart",this._boundHandlers.touchStart,J),window.addEventListener("touchmove",this._boundHandlers.touchMove,J),window.addEventListener("touchend",this._boundHandlers.touchEnd)}_handleTouchStart(J){if(this._preventDefault)J.preventDefault();let $=J.touches[0];if(!$)return;this._handleInputStart($.clientX,$.clientY)}_handleTouchMove(J){let $=J.touches[0];if(!$)return;if(this._handleInputMove($.clientX,$.clientY)){if(this._preventDefault)J.preventDefault()}}_handleTouchEnd(J){this._handleInputEnd()}_handleInputStart(J,$){this._fireEvent("PressInit"),this._startX=J,this._startY=$,this._lastPointerX=J,this._lastPointerY=$,this._deltaX=0,this._deltaY=0,this._isPressed=!0,this._isDragging=!1,this._lockedAxis=null,this._fireEvent("Press")}_handleInputMove(J,$){if(!this._isPressed)return!1;let Q=J-this._lastPointerX,q=$-this._lastPointerY;if(Math.abs(Q)<1&&Math.abs(q)<1)return!1;this._lastPointerX=J,this._lastPointerY=$;let Z=J-this._startX,j=$-this._startY;if(this._updateDeltas(Z,j),this._checkDragStart(),this._checkDirectionAndFire(!1),this._checkToggle(Z,j),this._scheduleStopCheck(),this._isDragging)this._fireEvent("Drag");return!0}_handleInputEnd(){if(!this._isPressed)return;if(this._isDragging)this._fireEvent("DragEnd");this._fireEvent("Release"),this._fireCompleteCallbacks(),this._fireEvent("Stop"),this._resetGestureState()}_addWheelListener(){this._boundHandlers.wheel=this._handleWheel.bind(this),this._target.addEventListener("wheel",this._boundHandlers.wheel,{passive:!this._preventDefault})}_handleWheel(J){if(this._preventDefault)J.preventDefault();if(this._wheelAccumulatorX+=J.deltaX*this._wheelSpeed,this._wheelAccumulatorY+=J.deltaY*this._wheelSpeed,this._wheelRafId!==null)return;this._wheelRafId=requestAnimationFrame(()=>{this._wheelRafId=null,this._deltaX=this._wheelAccumulatorX,this._deltaY=this._wheelAccumulatorY,this._wheelAccumulatorX=0,this._wheelAccumulatorY=0,this._checkDirectionAndFire(!0),this._checkToggle(this._deltaX,this._deltaY),this._scheduleStopCheck(),this._deltaX=0,this._deltaY=0})}_addScrollListener(){if(this._boundHandlers.scroll=this._handleScroll.bind(this),this._target===window)this._lastScrollX=window.scrollX,this._lastScrollY=window.scrollY;else{let J=this._target;this._lastScrollX=J.scrollLeft,this._lastScrollY=J.scrollTop}this._target.addEventListener("scroll",this._boundHandlers.scroll,{passive:!0})}_handleScroll(){if(this._scrollRafId!==null)return;this._scrollRafId=requestAnimationFrame(()=>{this._scrollRafId=null,this._processScroll()})}_processScroll(){let J,$;if(this._target===window)J=window.scrollX,$=window.scrollY;else{let Z=this._target;J=Z.scrollLeft,$=Z.scrollTop}let Q=(J-this._lastScrollX)*this._scrollSpeed,q=($-this._lastScrollY)*this._scrollSpeed;this._lastScrollX=J,this._lastScrollY=$,this._deltaX=Q,this._deltaY=q,this._checkDirectionAndFire(!0),this._checkToggle(Q,q),this._scheduleStopCheck(),this._deltaX=0,this._deltaY=0}_addHoverListeners(){if(this._target===window)return;let J=this._target;this._frozenHoverRect=h(J),this._boundHoverMoveHandler=($)=>{if(!this._frozenHoverRect)return;let Q=this._frozenHoverRect,q=$.clientX>=Q.left&&$.clientX<=Q.right&&$.clientY>=Q.top&&$.clientY<=Q.bottom;if(q&&!this._gestureHoverActive)this._gestureHoverActive=!0,this._fireEvent("Hover");else if(!q&&this._gestureHoverActive)this._gestureHoverActive=!1,this._fireEvent("HoverEnd")},window.addEventListener("mousemove",this._boundHoverMoveHandler)}refresh(){if(this._target===window||!this._frozenHoverRect)return;this._frozenHoverRect=h(this._target)}_updateDeltas(J,$){if(this._lockAxis&&this._lockedAxis)if(this._lockedAxis==="x")this._deltaX=J,this._deltaY=0;else this._deltaX=0,this._deltaY=$;else this._deltaX=J,this._deltaY=$;if(this._lockAxis&&!this._lockedAxis){let Q=this._tolerance;if(Math.abs(this._deltaX)>Q||Math.abs(this._deltaY)>Q)this._lockedAxis=Math.abs(this._deltaX)>Math.abs(this._deltaY)?"x":"y"}}_checkDirectionAndFire(J){let $=this._tolerance;if(J||!this._lockedAxis||this._lockedAxis==="y"){if(this._deltaY<-$){if(this._fireEvent("Up"),!J)this._activatedDirections.add("Up")}if(this._deltaY>$){if(this._fireEvent("Down"),!J)this._activatedDirections.add("Down")}}if(J||!this._lockedAxis||this._lockedAxis==="x"){if(this._deltaX<-$){if(this._fireEvent("Left"),!J)this._activatedDirections.add("Left")}if(this._deltaX>$){if(this._fireEvent("Right"),!J)this._activatedDirections.add("Right")}}if(Math.abs(this._deltaX)>$||Math.abs(this._deltaY)>$){if(this._fireEvent("Change"),Math.abs(this._deltaX)>$)this._fireEvent("ChangeX");if(Math.abs(this._deltaY)>$)this._fireEvent("ChangeY")}}_checkToggle(J,$){let Q=this._tolerance;if(Math.abs(J)>=Q){let q=J>0?1:-1;if(this._lastDirectionX!==null&&q!==this._lastDirectionX)this._fireEvent("ToggleX");this._lastDirectionX=q}if(Math.abs($)>=Q){let q=$>0?1:-1;if(this._lastDirectionY!==null&&q!==this._lastDirectionY)this._fireEvent("ToggleY");this._lastDirectionY=q}}_checkDragStart(){if(this._isDragging)return;if(this._deltaX*this._deltaX+this._deltaY*this._deltaY>this._dragMinimumSquared)this._isDragging=!0}_scheduleStopCheck(){if(this._isMoving=!0,this._lastActivityTime=performance.now(),this._stopTimeout)return;let J=()=>{let $=performance.now()-this._lastActivityTime;if($>=this._stopDelay){if(this._stopTimeout=null,this._isMoving){if(this._isMoving=!1,this._lastDirectionX=null,this._lastDirectionY=null,!this._isPressed)this._fireEvent("Stop")}}else this._stopTimeout=setTimeout(J,this._stopDelay-$)};this._stopTimeout=setTimeout(J,this._stopDelay)}_fireEvent(J){let $=this._config.events[J];if($)this._pendingActions.set($,J),this._scheduleRAF()}_scheduleRAF(){if(this._rafScheduled)return;this._rafScheduled=!0,this._rafId=requestAnimationFrame(()=>{this._rafScheduled=!1,this._rafId=null;for(let[J,$]of this._pendingActions)this._executeAction(J,$);this._pendingActions.clear()})}_getStepForEvent(J){if(typeof this._animationStep==="number")return this._animationStep;if(J&&this._animationStep[J]!==void 0)return this._animationStep[J];let $=Object.values(this._animationStep);return $.length>0?$[0]:0.1}_executeAction(J,$){switch(J){case"play":case"pause":case"reverse":case"restart":case"reset":case"complete":C(J,this._timeline);break;case"toggle":if(this._timeline.isActive())this._timeline.pause();else this._timeline.play();break;case"kill":this._timeline.kill();break;case"playReverse":this._timeline.reverse();break;case"progressUp":this._interpolateProgress(this._getStepForEvent($));break;case"progressDown":this._interpolateProgress(-this._getStepForEvent($));break;case"playNext":this._playSequenceItem(1);break;case"playPrevious":this._playSequenceItem(-1);break}}_playSequenceItem(J){if(!this._siblings||this._siblings.length===0)return;let $=W0._sequenceStates.get(this._siblings);if(!$)return;let Q=this._siblings.length,q=$.lastIndex,Z=(q+J+Q)%Q,j=this._siblings[q];if(j&&j.progress()>0)j.reverse();let z=this._siblings[Z];if(z)z.restart();$.lastIndex=Z}_interpolateProgress(J){let $=this._timeline.progress();if(Math.abs($-this._currentProgress)>0.01)this._currentProgress=$,this._targetProgress=$;if(this._interpolationRafId===null)this._currentProgress=$,this._targetProgress=$;if(this._targetProgress=Math.max(0,Math.min(1,this._targetProgress+J)),this._smooth===0){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress);return}if(this._interpolationRafId===null)this._startInterpolationLoop()}_startInterpolationLoop(){if(this._interpolationRafId!==null)return;let J=0.08+(1-this._smooth)*0.12,$=()=>{let Q=this._targetProgress-this._currentProgress;if(Math.abs(Q)<0.0001){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress),this._interpolationRafId=null;return}this._currentProgress+=Q*J,this._timeline.progress(this._currentProgress),this._interpolationRafId=requestAnimationFrame($)};this._interpolationRafId=requestAnimationFrame($)}_fireCompleteCallbacks(){if(this._activatedDirections.has("Up"))this._fireEvent("UpComplete");if(this._activatedDirections.has("Down"))this._fireEvent("DownComplete");if(this._activatedDirections.has("Left"))this._fireEvent("LeftComplete");if(this._activatedDirections.has("Right"))this._fireEvent("RightComplete");this._activatedDirections.clear()}_resetGestureState(){this._isPressed=!1,this._isDragging=!1,this._deltaX=0,this._deltaY=0,this._lockedAxis=null,this._lastDirectionX=null,this._lastDirectionY=null,this._activatedDirections.clear()}}F.registerTrigger("gesture",W0);var D0=null;function fJ(J,$,Q,q){let Z=J;if(!Z.style)return;let j=Q0();if(T($))if(S(J,$,Q,q),j)F0(J);else Z.style.transform=E(J);else{let z=q?`${Q}${q}`:`${Q}`;if(j)O0(J,$,z);else try{if(e($))Z.style.setProperty($,z);else if($ in Z.style)Z.style[$]=z;else Z.style.setProperty(m($),z)}catch{}}}function uJ(J,$,Q,q,Z,j){let z=J;if(!z.style)return;let G=j===1?`rgb(${Math.round(Q)}, ${Math.round(q)}, ${Math.round(Z)})`:`rgba(${Math.round(Q)}, ${Math.round(q)}, ${Math.round(Z)}, ${j})`;if(Q0())O0(J,$,G);else try{if(e($))z.style.setProperty($,G);else if($ in z.style)z.style[$]=G;else z.style.setProperty(m($),G)}catch{}}function dJ(J,$,Q,q){let Z=J;if(!Z.style)return;if(D0||(D0=X.filter)){let j=D0.interpolateFilters($,Q,q),z=D0.filterToString(j);if(Q0())O0(J,"filter",z);else Z.style.filter=z}}function pJ(J,$,Q){let{pathLUT:q,alignOffset:Z,pathOffset:j,pathRotate:z}=Q;if(!q||q.length===0)return;let G=$*(q.length-1),W=Math.floor(G),N=Math.min(W+1,q.length-1),B=G-W,Y=q[W],U=q[N],_=Y.x+(U.x-Y.x)*B,H=Y.y+(U.y-Y.y)*B,A=(j?.x??0)+_-(Z?.x??0),K=(j?.y??0)+H-(Z?.y??0);if(S(J,"x",A,"px"),S(J,"y",K,"px"),z){let M=n6(Y.angle,U.angle,B);S(J,"rotate",M,"deg")}if(Q0())F0(J);else J.style.transform=E(J)}function n6(J,$,Q){let q=$-J;if(q>180)q-=360;if(q<-180)q+=360;return J+q*Q}var JJ=null,a6=100,r6=500,t6=0.5,N0=[],e6=50;function J7(J){for(let $=0;$<N0.length;$++)if(N0[$].length>=J){let Q=N0.splice($,1)[0];return Q.length=J,Q}return Array(J)}function $7(J){if(N0.length<e6)N0.push(J)}class $J{target=null;property="";startValue=0;endValue=0;change=0;unit="";next=null;valueType="scalar";startColor=null;endColor=null;changeColor=new Float32Array(4);startFilters=null;endFilters=null;startDraw=null;endDraw=null;pathLength=0;pathData=null;motionPathLength=0;startProgress=0;endProgress=0;pathRotate=!1;alignOffset=null;pathOffset=null;pathLUT=null;_isElement=!1;init(J,$,Q,q,Z=""){return this.target=J,this.property=$,this.startValue=Q,this.endValue=q,this.change=q-Q,this.unit=Z,this.valueType="scalar",this._isElement=J instanceof Element,this}initColor(J,$,Q,q){return this.target=J,this.property=$,this.valueType="color",this.startColor=Q,this.endColor=q,this.changeColor[0]=q[0]-Q[0],this.changeColor[1]=q[1]-Q[1],this.changeColor[2]=q[2]-Q[2],this.changeColor[3]=q[3]-Q[3],this._isElement=J instanceof Element,this}initFilter(J,$,Q,q){return this.target=J,this.property=$,this.valueType="filter",this.startFilters=Q,this.endFilters=q,this._isElement=J instanceof Element,this}initDrawSVG(J,$,Q,q,Z){return this.target=J,this.property=$,this.valueType="drawSVG",this.startDraw=Q,this.endDraw=q,this.pathLength=Z,this._isElement=J instanceof Element,this}initPath(J,$,Q,q,Z,j,z,G,W){if(J instanceof Element)P(J,!0);this.target=J,this.property=$,this.valueType="path",this.pathData=Q,this.motionPathLength=q,this.startProgress=Z,this.endProgress=j,this.pathRotate=z,this.alignOffset=G,this.pathOffset=W,this._isElement=J instanceof Element;let N=Math.abs(j-Z),B=q*N,Y=Math.min(r6,Math.max(a6,Math.ceil(B*t6)));this.pathLUT=J7(Y+1);for(let U=0;U<=Y;U++){let _=U/Y,H=Z+(j-Z)*_;this.pathLUT[U]=l0(Q,H,z)}return this}render(J){if(!this.target)return;if(this.valueType==="color"&&this.startColor){let $=this.startColor[0]+this.changeColor[0]*J,Q=this.startColor[1]+this.changeColor[1]*J,q=this.startColor[2]+this.changeColor[2]*J,Z=this.startColor[3]+this.changeColor[3]*J;if(this._isElement)uJ(this.target,this.property,$,Q,q,Z)}else if(this.valueType==="filter"&&this.startFilters&&this.endFilters){if(this._isElement)dJ(this.target,this.startFilters,this.endFilters,J)}else if(this.valueType==="drawSVG"&&this.startDraw&&this.endDraw){if(this._isElement&&this.pathLength>0){let $=this.startDraw.start+(this.endDraw.start-this.startDraw.start)*J,Q=this.startDraw.end+(this.endDraw.end-this.startDraw.end)*J;if(JJ||(JJ=X.drawSVG))JJ.applyDrawSVG(this.target,$,Q,this.pathLength)}}else if(this.valueType==="path"&&this.pathLUT&&this.pathLUT.length>0){if(this._isElement)pJ(this.target,J,{pathLUT:this.pathLUT,alignOffset:this.alignOffset??{x:0,y:0},pathOffset:this.pathOffset??{x:0,y:0},pathRotate:this.pathRotate})}else{let $=this.startValue+this.change*J;if(this._isElement)fJ(this.target,this.property,$,this.unit);else this.target[this.property]=$}}reset(){if(this.target=null,this.property="",this.startValue=0,this.endValue=0,this.change=0,this.unit="",this.next=null,this.valueType="scalar",this.startColor=null,this.endColor=null,this.startFilters=null,this.endFilters=null,this.startDraw=null,this.endDraw=null,this.pathLength=0,this.pathData=null,this.motionPathLength=0,this.startProgress=0,this.endProgress=0,this.pathRotate=!1,this.alignOffset=null,this.pathOffset=null,this.pathLUT)$7(this.pathLUT);this.pathLUT=null,this._isElement=!1}}class B0{pool=[];totalCreated=0;factory;maxSize;constructor(J,$){this.factory=J,this.maxSize=$}acquire(){if(this.pool.length>0)return this.pool.pop();return this.totalCreated++,this.factory()}release(J){if(J.reset(),this.maxSize===void 0||this.pool.length<this.maxSize)this.pool.push(J)}getPoolSize(){return this.pool.length}getTotalCreated(){return this.totalCreated}clear(){this.pool=[]}}var Y0=new B0(()=>new $J,500),n={acquire:()=>Y0.acquire(),release:(J)=>Y0.release(J),getPoolSize:()=>Y0.getPoolSize(),getTotalCreated:()=>Y0.getTotalCreated(),clear:()=>Y0.clear()};var cJ={x:0,y:0,z:0,rotate:0,rotateX:0,rotateY:0,rotateZ:0,scale:1,scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,opacity:1};class f{static _createAnimationCallback=null;static setCreateAnimationCallback(J){f._createAnimationCallback=J}_targets;_originalTargets;_fromVars;_toVars;_duration=0.5;_delay=0;_ease="power1.out";_animation=null;_animations=[];_built=!1;_splitType;_mask;_repeat;_repeatDelay;_yoyo;_stagger;_axis;_fitConfig;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_skipInitialFromRender=!1;_plainObjectInitialValues=new Map;_expectedAnimationIds=[];_propsToAnimate=[];constructor(J,$){if(this._targets=X0(J),this._originalTargets=this._targets,this._targets.length===0&&typeof J==="string")console.warn(`[Motion] Selector "${J}" matched no elements. Animation will not run.`);if($)this._applyAnimationConfig($)}_applyAnimationConfig(J){if(J.from)this._fromVars=J.from;if(J.to)this._toVars=J.to;if(J.duration!==void 0)if(typeof J.duration!=="number"||!isFinite(J.duration)||J.duration<0)console.warn(`[Motion] Invalid duration: ${J.duration}. Must be a finite number >= 0. Using default.`);else this._duration=J.duration;if(J.delay!==void 0)if(typeof J.delay!=="number"||isNaN(J.delay))console.warn(`[Motion] Invalid delay: ${J.delay}. Must be a number. Using default 0.`);else if(!isFinite(J.delay))console.warn(`[Motion] Invalid delay: ${J.delay}. Infinity is not a valid delay. Using default 0.`);else this._delay=J.delay;if(J.ease)this._ease=J.ease;if(J.split)this._splitType=J.split;if(J.mask)this._mask=J.mask;if(J.stagger!==void 0)this._stagger=J.stagger;if(J.axis)this._axis=J.axis;if(J.fit)this._fitConfig=J.fit;if(J.repeat)if(typeof J.repeat==="number")this._repeat=J.repeat;else this._repeat=J.repeat.times,this._repeatDelay=J.repeat.delay,this._yoyo=J.repeat.yoyo;if(J.onStart)this._onStart=J.onStart;if(J.onUpdate)this._onUpdate=J.onUpdate;if(J.onComplete)this._onComplete=J.onComplete;if(J.onRepeat)this._onRepeat=J.onRepeat;if(J.onReverseComplete)this._onReverseComplete=J.onReverseComplete}_capturePlainObjectValues(J){for(let $ of this._targets){if($ instanceof Element)continue;let Q=$,q={};for(let Z of J)if(Z in Q&&typeof Q[Z]==="number")q[Z]=Q[Z];if(Object.keys(q).length>0)this._plainObjectInitialValues.set($,q)}}_restorePlainObjectValues(){for(let[J,$]of this._plainObjectInitialValues){let Q=J;for(let[q,Z]of Object.entries($))Q[q]=Z}}_ensureBuilt(){if(!this._built)this._build()}_isInvalidated(){if(this._animations.length===0)return!1;return this._animations.some((J,$)=>{let Q=J.getId(),q=this._expectedAnimationIds[$];return Q===0||Q!==q})}rebuildIfPooled(){if(this._isInvalidated()){this._restorePlainObjectValues();for(let J of this._targets)if(J instanceof Element)P(J),X.styleReset?.clearAnimationStylesForProps?.(J,this._propsToAnimate);this._resetBuildState(),this._ensureBuilt()}}_build(){if(this._built)return;if(this._targets.length===0)return;if(!this._fromVars&&!this._toVars&&!this._fitConfig)return;if(this._fitConfig){if(!X.fit){console.warn("[Motion] FitResolver not loaded. Did you import the SDK?");return}if(this._built=!0,!f._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call Engine.init() first.");let j={};if(this._repeat!==void 0)j.repeat=this._repeat;if(this._repeatDelay!==void 0)j.repeatDelay=this._repeatDelay;if(this._yoyo)j.yoyo=this._yoyo;if(this._onStart)j.onStart=this._onStart;if(this._onUpdate)j.onUpdate=this._onUpdate;if(this._onComplete)j.onComplete=this._onComplete;if(this._onRepeat)j.onRepeat=this._onRepeat;if(this._onReverseComplete)j.onReverseComplete=this._onReverseComplete;if(this._stagger!==void 0)j.stagger=this._stagger;let z=[];for(let W of this._targets){if(!(W instanceof Element))continue;let N=f._createAnimationCallback([W],{},this._duration,this._delay,this._ease,!1,void 0,j);if(Array.isArray(N))z.push(...N);else z.push(N)}let G=this._fitConfig;for(let W of z)for(let N of W.getTargets())if(N instanceof Element)X.fit.registerPendingSetup(W,N,G,n);this._animation=z[0]??null,this._animations=z,this._expectedAnimationIds=z.map((W)=>W.getId());return}this._built=!0;let J={},$=!1,Q;if(this._fromVars&&this._toVars){J={...this._toVars},Q={...this._fromVars},$=!0;for(let j of Object.keys(Q))if(!(j in J)){if(j in cJ)J[j]=cJ[j];else if(t(j))J[j]="";else if(l(j))J[j]=""}}else if(this._fromVars)J={...this._fromVars},$=!0;else if(this._toVars)J={...this._toVars};if(this._splitType&&X.textSplitter?.split){let j=this._mask?{mask:!0}:void 0,z=[];for(let G of this._originalTargets)if(G instanceof Element){let W=X.textSplitter?.split(G,this._splitType,j);z.push(...W)}if(z.length>0)this._targets=z}if(this._propsToAnimate=Object.keys(J),Q){for(let j of Object.keys(Q))if(!this._propsToAnimate.includes(j))this._propsToAnimate.push(j)}if(this._plainObjectInitialValues.size===0)this._capturePlainObjectValues(this._propsToAnimate);if($){for(let j of this._targets)if(j instanceof Element)P(j),X.styleReset?.clearAnimationStylesForProps?.(j,this._propsToAnimate)}if(X.styleReset?.registerAnimatedProps){for(let j of this._targets)if(j instanceof Element)X.styleReset?.registerAnimatedProps(j,this._propsToAnimate)}let q={repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,stagger:this._stagger,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete,_skipInitialRender:this._skipInitialFromRender||void 0};if(!f._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call AnimationBuilder.setCreateAnimationCallback first.");let Z=f._createAnimationCallback(this._targets,J,this._duration,this._delay,this._ease,$,Q,q);if(Array.isArray(Z))this._animations=Z,this._animation=Z[0]||null;else this._animation=Z,this._animations=[Z];this._expectedAnimationIds=this._animations.map((j)=>j.getId())}getAnimation(){return this._ensureBuilt(),this._animation}getAnimations(){return this._ensureBuilt(),this._animations}getTargets(){return this._targets}getOriginalTargets(){return this._originalTargets}hasSplit(){return!!this._splitType}_resetBuildState(){this._built=!1,this._animations=[],this._animation=null,this._expectedAnimationIds=[]}getConfig(){return{fromVars:this._fromVars?{...this._fromVars}:void 0,toVars:this._toVars?{...this._toVars}:void 0,duration:this._duration,delay:this._delay,ease:this._ease,axis:this._axis,fit:this._fitConfig?{...this._fitConfig}:void 0,split:this._splitType,mask:this._mask,stagger:this._stagger,repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete}}setAxis(J){this._axis=J}getAxis(){return this._axis}setSkipInitialFromRender(J){this._skipInitialFromRender=J}}class E0{static parse(J,$,Q,q){if(J===void 0)return $;if(typeof J==="number")return J;let Z=J.trim();if(Z==="<")return Q;if(Z===">")return q;if(Z.startsWith("<")){let j=parseFloat(Z.substring(1));if(!isNaN(j))return Q+j}if(Z.startsWith(">")){let j=parseFloat(Z.substring(1));if(!isNaN(j))return q+j}if(Z.startsWith("+=")){let j=parseFloat(Z.substring(2));return $+j}if(Z.startsWith("-=")){let j=parseFloat(Z.substring(2));return $-j}return console.warn(`Invalid position parameter: "${Z}", using current end`),$}}class R{static _eachCounter=0;static _registerWithEngine=null;static setEngineRegisterCallback(J){R._registerWithEngine=J}_name;_children=[];_duration=0;_time=0;_progress=0;_timeScale=1;_isActive=!1;_isReversed=!1;_killed=!1;_onStart;_onUpdate;_onComplete;_startFired=!1;_trigger;_unregisterCallback;setUnregisterCallback(J){this._unregisterCallback=J}_previousStart=0;_previousEnd=0;_eachInstances;_eachDuration;_initialValues=new Map;_initialTransforms=new Map;_transformElements=new Set;_savedTransitions=new Map;_transitionsDisabled=!1;_savedWillChange=new Map;constructor(J){if(this._name=J,J&&R._registerWithEngine)R._registerWithEngine(J,this)}duration(){if(this._eachDuration!==void 0)return this._eachDuration;return this._duration}clear(){for(let J of this._children)if(J.type==="animation")J.child.kill();else if(J.type==="timeline")J.child.kill();return this._children=[],this._duration=0,this._time=0,this._progress=0,this._isActive=!1,this._isReversed=!1,this._startFired=!1,this._previousStart=0,this._previousEnd=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._clearTransitionData(),this}_captureInitialValues(J){let $=J.getTargets(),Q=J.getFirstPropTween();while(Q){let q=Q.property;for(let Z of $){if(!(Z instanceof Element))continue;let j=this._initialValues.get(Z);if(!j)j=new Map,this._initialValues.set(Z,j);if(!j.has(q)){let z=Z;if(T(q)||n0(q)){if(this._transformElements.add(Z),!this._initialTransforms.has(Z)){let G=z.style.transform;this._initialTransforms.set(Z,G||null)}j.set(q,{removeInline:!0})}else if(t(q)||l(q))j.set(q,{removeInline:!0});else{let G=q.replace(/([A-Z])/g,"-$1").toLowerCase();if(z.style.getPropertyValue(G)!==""){let N=VJ(Z,q);j.set(q,{removeInline:!1,value:N.value,unit:N.unit})}else j.set(q,{removeInline:!0})}}}Q=Q.next}}_restoreInitialValues(){for(let J of this._transformElements){let $=J;P(J);let Q=this._initialTransforms.get(J);if(Q)$.style.transform=Q;else $.style.removeProperty("transform")}for(let[J,$]of this._initialValues){let Q=J;for(let[q,Z]of $){if(T(q))continue;let j=q.replace(/([A-Z])/g,"-$1").toLowerCase();if(Z.removeInline)Q.style.removeProperty(j);else{let z=`${Z.value}${Z.unit}`;Q.style.setProperty(j,z)}}}}_disableTransitions(){if(this._transitionsDisabled)return;for(let J of this._savedTransitions.keys())J.style.transition="none";this._transitionsDisabled=!0}_restoreTransitions(){if(!this._transitionsDisabled)return;for(let[J,$]of this._savedTransitions)J.style.transition=$;this._transitionsDisabled=!1}_clearTransitionData(){this._restoreTransitions(),this._savedTransitions.clear(),this._transitionsDisabled=!1,this._restoreWillChange()}_restoreWillChange(){for(let[J,$]of this._savedWillChange)if($)J.style.willChange=$;else J.style.removeProperty("will-change");this._savedWillChange.clear()}_addEntry(J,$,Q){let q=E0.parse(Q,this._duration,this._previousStart,this._previousEnd),Z=new f(J,$);return this._addBuilder(Z,q)}_addBuilder(J,$){J.setSkipInitialFromRender(!0);let Q=J.getAnimations();if(Q.length===0)return this;let q=$;for(let Z of Q){let j=Z.getDelay(),z=$+j;Z.clearDelay();let G=Z.totalDuration(),W={type:"animation",child:Z,builder:J,startTime:z,duration:G};this._children.push(W),Z.setTimelineChild(!0),Z.pause(),this._captureInitialValues(Z);for(let Y of Z.getTargets())if(Y instanceof HTMLElement&&!this._savedTransitions.has(Y))this._savedTransitions.set(Y,Y.style.transition);for(let Y of Z.getTargets())if(Y instanceof HTMLElement&&this._transformElements.has(Y)&&!this._savedWillChange.has(Y))this._savedWillChange.set(Y,Y.style.willChange),Y.style.willChange="transform";let N=!!J.getConfig().fromVars;if(z>0&&!N)Z.setLazyStartCapture(!0);if(N)Z.renderAtTime(0);if(J.hasSplit()){for(let Y of J.getOriginalTargets())if(Y instanceof Element)Y.style.opacity="1"}let B=z+G;if(B>q)q=B}if(this._previousStart=$,this._previousEnd=q,q>this._duration)this._duration=q;return this}call(J,$,Q){let q=E0.parse(Q,this._duration,this._previousStart,this._previousEnd),Z={type:"callback",child:J,startTime:q,duration:0,params:$};if(this._children.push(Z),this._previousStart=q,this._previousEnd=q,q>this._duration)this._duration=q;return this}_getFirstAnimationTarget(){let J=this.getFirstChildAnimation();if(J){let $=J.getTargets();for(let Q of $)if(u0(Q))return Q}return}_getAllAnimationTargets(){for(let J of this._children)if(J.type==="animation"&&J.builder)return(J.builder.hasSplit()?J.builder.getOriginalTargets():J.builder.getTargets()).filter((Q)=>u0(Q));return[]}_createInstanceForElement(J,$){let q=`${this._name||"__each"}__each_${$}_${R._eachCounter++}`,Z=new R(q),j=new Set;for(let z of this._children)if(z.type==="animation"&&z.builder){if(j.has(z.builder))continue;j.add(z.builder);let G=z.builder.getConfig(),W=G.repeat!=null?{times:G.repeat,delay:G.repeatDelay,yoyo:G.yoyo}:void 0,N=z.builder.hasSplit(),B=new f(J,{from:G.fromVars,to:G.toVars,duration:G.duration,delay:G.delay,ease:G.ease,repeat:W,...N&&G.split?{split:G.split}:{},...N&&G.mask?{mask:G.mask}:{},...N&&G.stagger!==void 0?{stagger:G.stagger}:{},onStart:G.onStart,onUpdate:G.onUpdate,onComplete:G.onComplete,onRepeat:G.onRepeat,onReverseComplete:G.onReverseComplete});if(G.axis)B.setAxis(G.axis);Z._addBuilder(B,z.startTime)}else if(z.type==="callback")Z.call(z.child,z.params,z.startTime);return Z}_createInstanceForElements(J,$){let q=`${this._name||"__each"}__each_${$}_${R._eachCounter++}`,Z=new R(q),j=new Set;for(let z of this._children)if(z.type==="animation"&&z.builder){if(j.has(z.builder))continue;j.add(z.builder);let G=z.builder.getConfig(),W=G.repeat!=null?{times:G.repeat,delay:G.repeatDelay,yoyo:G.yoyo}:void 0,N=z.builder.hasSplit(),B=new f(J,{from:G.fromVars,to:G.toVars,duration:G.duration,delay:G.delay,ease:G.ease,repeat:W,...N&&G.split?{split:G.split}:{},...N&&G.mask?{mask:G.mask}:{},...N&&G.stagger!==void 0?{stagger:G.stagger}:{},onStart:G.onStart,onUpdate:G.onUpdate,onComplete:G.onComplete,onRepeat:G.onRepeat,onReverseComplete:G.onReverseComplete});if(G.axis)B.setAxis(G.axis);Z._addBuilder(B,z.startTime)}else if(z.type==="callback")Z.call(z.child,z.params,z.startTime);return Z}_resolveTargetElements(J){if(typeof J!=="string")return[J];if(typeof document<"u")try{return Array.from(document.querySelectorAll(J))}catch($){console.warn(`[Motion] Invalid selector "${J}":`,$)}return[]}_setupEachModeGeneric(J,$){if(J.length===0)return;if(this._eachInstances=[],this._children.some((q)=>q.type==="animation"&&q.builder?.hasSplit()))for(let q of J)X.textSplitter?.revert?.(q);this._clearTransitionData();for(let q=0;q<J.length;q++){let Z=J[q],j=this._createInstanceForElement(Z,q);$(j,Z),this._eachInstances.push(j)}this._eachDuration=this._duration;for(let q of this._children)if(q.type==="animation"){let Z=q.child;Z.setTimelineChild(!1),Z.kill()}else if(q.type==="timeline")q.child.kill();this._children=[],this._duration=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._isActive=!1,this._time=0,this._progress=0,this._isReversed=!1,this._startFired=!1}_setupEachMode(J,$){let Q=X.triggerManager?.getInstance?.();if(!Q)return;let{each:q,...Z}=$;if($.target){let z=this._resolveTargetElements($.target);if(z.length===0)return;let G=this._getAllAnimationTargets();if(this._children.some((N)=>N.type==="animation"&&N.builder?.hasSplit()))for(let N of G)X.textSplitter?.revert?.(N);this._clearTransitionData(),this._eachInstances=[];for(let N=0;N<z.length;N++){let B=z[N],Y=G.filter((_)=>B.contains(_));if(Y.length===0)continue;let U=this._createInstanceForElements(Y,N);if(J==="scroll")Q.registerScroll(U,{...Z,target:B});else if(J==="hover")Q.registerHover(U,{...Z,target:B});else Q.registerClick(U,{...Z,target:B});this._eachInstances.push(U)}this._eachDuration=this._duration;for(let N of this._children)if(N.type==="animation"){let B=N.child;B.setTimelineChild(!1),B.kill()}else if(N.type==="timeline")N.child.kill();this._children=[],this._duration=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._isActive=!1,this._time=0,this._progress=0,this._isReversed=!1,this._startFired=!1;return}let j=this._getAllAnimationTargets();this._setupEachModeGeneric(j,(z,G)=>{if(J==="scroll")Q.registerScroll(z,{...Z,target:G});else if(J==="hover")Q.registerHover(z,{...Z,target:G});else Q.registerClick(z,{...Z,target:G})})}onHover(J){if(J?.each)return this._setupEachMode("hover",J),this;let $=J?.target??this._getFirstAnimationTarget();return X.triggerManager?.getInstance?.().registerHover(this,{target:$,onLeave:J?.onLeave,leaveDelay:J?.leaveDelay}),this}onClick(J){if(J?.each)return this._setupEachMode("click",J),this;let $=J?.target??this._getFirstAnimationTarget();return X.triggerManager?.getInstance?.().registerClick(this,{target:$,secondTarget:J?.secondTarget,toggle:J?.toggle,preventDefault:J?.preventDefault}),this}onScroll(J){if(J?.each)return this._setupEachMode("scroll",J),this;let $=J?.target??this._getFirstAnimationTarget();return X.triggerManager?.getInstance?.().registerScroll(this,{...J,target:$}),this}onMouseMove(J){if(J?.each&&J.target)return this._setupMouseMoveEachMode(J),this;return X.triggerManager?.getInstance?.().registerMouseMove(this,{type:J?.type??"distance",target:J?.target,smooth:J?.smooth,startProgress:J?.startProgress,leaveProgress:J?.leaveProgress}),this}_setupMouseMoveEachMode(J){if(!J.target)return;let $=[];if(typeof J.target==="string"){if(typeof document<"u")$=Array.from(document.querySelectorAll(J.target))}else $=[J.target];let Q=X.triggerManager?.getInstance?.();if(!Q)return;this._setupEachModeGeneric($,(q,Z)=>{Q.registerMouseMove(q,{type:J.type??"distance",target:Z,smooth:J.smooth,startProgress:J.startProgress,leaveProgress:J.leaveProgress})})}onPageLoad(){return X.triggerManager?.getInstance?.().registerPageLoad(this,{}),this}onPageExit(J){return X.triggerManager?.getInstance?.().registerPageExit(this,J||{}),this}onGesture(J){if(J.each)return this._setupGestureEachMode(J),this;return X.triggerManager?.getInstance?.().registerGesture(this,J),this}_setupGestureEachMode(J){let $=[];if(J.target)if(typeof J.target==="string"){if(typeof document<"u")$=Array.from(document.querySelectorAll(J.target))}else $=[J.target];else $=this._getAllAnimationTargets();if(this._setupEachModeGeneric($,()=>{}),!this._eachInstances||this._eachInstances.length===0)return;let Q=X.triggerManager?.getInstance?.();if(!Q)return;for(let q=0;q<$.length;q++){let Z=$[q],j=this._eachInstances[q];Q.registerGesture(j,{...J,target:Z,each:!1,_siblings:this._eachInstances,_index:q})}}onCursor(J){return X.triggerManager?.getInstance?.().registerCursor(this,J),this}_updateCallbackChild(J,$,Q){let q=J.startTime,Z=$<q&&this._time>=q,j=$>q&&this._time<=q,z=Math.abs(this._time-q)<0.001;if(Z||j||z&&Q===0){let G=J.child,W=J.params||[];G(...W)}}_updateAnimationChild(J,$){let Q=J.child,q=Math.abs(Q.getTimeScale())||1,Z=Q.totalDuration()/q,j=this._time-J.startTime,z=j*q;if(j>=0&&j<=Z){if(!Q.isActive())Q.captureStartValues(),Q.play();Q.renderAtTime(z)}else if(j<0){if(!Q.isLazyCapture())Q.renderAtTime(0);if(Q.isActive())Q.pause(),Q.fireReverseComplete()}else if(Q.isActive())Q.renderAtTime(Q.totalDuration()),Q.pause();else if($===0)Q.renderAtTime(Q.totalDuration())}_updateTimelineChild(J,$){let Q=J.child,q=Q.duration(),Z=this._time-J.startTime;if(Z>=0&&Z<=q){if(!Q.isActive())Q.play();Q.time(Z)}else if(Q.isActive())if(Z<0)Q.time(0),Q.pause();else Q.time(q),Q.pause();else if($===0)if(Z<0);else Q.time(q)}update(J){if(this._eachInstances){for(let q of this._eachInstances)q.update(J);return}let $=this._time;if(!this._isActive&&J===0);else if(!this._isActive)return;let Q=J*this._timeScale;if(this._time+=this._isReversed?-Q:Q,this._time<0)this._time=0;else if(this._time>this._duration)this._time=this._duration;if(this._progress=this._duration>0?this._time/this._duration:0,!this._startFired&&this._isActive&&this._progress>0)this._startFired=!0,this._disableTransitions(),this._onStart?.();if(this._isActive)this._onUpdate?.(this._progress,this._time);for(let q of this._children)if(q.type==="callback")this._updateCallbackChild(q,$,J);else if(q.type==="animation")this._updateAnimationChild(q,J);else if(q.type==="timeline")this._updateTimelineChild(q,J);if(!this._isReversed&&this._time>=this._duration)this._isActive=!1,this._startFired=!1,this._restoreTransitions(),this._onComplete?.();else if(this._isReversed&&this._time<=0)this._isActive=!1,this._startFired=!1,this._restoreTransitions(),this._onComplete?.()}play(J){if(this._killed)return console.warn("[Motion] Cannot play a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.play(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;return this._isReversed=!1,this._isActive=!0,this}pause(J){if(this._killed)return console.warn("[Motion] Cannot pause a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.pause(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;this._isActive=!1;for(let $ of this._children)if($.type!=="callback"){let Q=$.child;if("pause"in Q)Q.pause()}return this}reverse(J){if(this._killed)return console.warn("[Motion] Cannot reverse a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.reverse(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;return this._isReversed=!0,this._isActive=!0,this}restart(){if(this._killed)return console.warn("[Motion] Cannot restart a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let J of this._eachInstances)J.restart();return this}this._time=0,this._progress=0,this._isActive=!0,this._isReversed=!1,this._startFired=!1;for(let J of this._children)if(J.type==="animation")J.child.resetForReplay();return this._restoreInitialValues(),this._renderPositionZeroAnimations(),this}_renderPositionZeroAnimations(){for(let J of this._children)if(J.type==="animation"){let $=J.child;if(!$.isLazyCapture())$.renderAtTime(0);if($.isActive())$.pause()}else if(J.type==="timeline")J.child.progress(0)}seek(J){if(this._killed)return console.warn("[Motion] Cannot seek a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.seek(J);return this}return this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this.update(0),this}setAxisProgress(J,$){let Q=Math.max(0,Math.min(1,$));for(let q of this._children)if(q.type==="animation"&&q.builder){if(q.builder.getConfig().axis===J){let j=q.child,z=j.totalDuration();if(!j.isActive())j.captureStartValues(),j.play();j.renderAtTime(Q*z)}}return this}onStart(J){return this._onStart=J,this}onUpdate(J){return this._onUpdate=J,this}onComplete(J){return this._onComplete=J,this}progress(J){if(J===void 0){if(this._eachInstances&&this._eachInstances.length>0){let Q=0;for(let q of this._eachInstances){let Z=q.progress();if(Z>Q)Q=Z}return Q}return this._progress}if(this._eachInstances){for(let Q of this._eachInstances)Q.progress(J);return this}let $=Math.max(0,Math.min(1,J));if($===0){for(let Q of this._children)if(Q.type==="animation")Q.child.resetForReplay()}if(this._time=$*this._duration,this._progress=$,$===0)this._restoreInitialValues(),this._renderPositionZeroAnimations();else this.update(0);return this._onUpdate?.(this._progress,this._time),this}time(J){if(J===void 0){if(this._eachInstances&&this._eachInstances.length>0){let $=0;for(let Q of this._eachInstances){let q=Q.time();if(q>$)$=q}return $}return this._time}if(this._eachInstances){for(let $ of this._eachInstances)$.time(J);return this}return this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this.update(0),this}timeScale(J){if(J===void 0)return this._timeScale;return this._timeScale=J,this}kill(J=!0){if(this._killed=!0,this._isActive=!1,X.triggerManager?.getInstance?.().unregister(this),this._eachInstances){for(let $ of this._eachInstances)$.kill(J);this._eachInstances=void 0}if(this._clearTransitionData(),J&&(this._initialValues.size>0||this._transformElements.size>0))this._restoreInitialValues();for(let $ of this._children)if($.type==="animation"){let Q=$.child;Q.setTimelineChild(!1),Q.kill()}else if($.type==="timeline")$.child.kill(J);if(this._unregisterCallback)this._unregisterCallback(),this._unregisterCallback=void 0;this._children=[],this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._savedTransitions.clear(),this._savedWillChange.clear(),this._transitionsDisabled=!1,this._duration=0,this._time=0,this._progress=0,this._previousStart=0,this._previousEnd=0,this._isReversed=!1,this._startFired=!1}isActive(){if(this._eachInstances)return this._eachInstances.some((J)=>J.isActive());return this._isActive}getName(){return this._name}getFirstChildAnimation(){let J=this._children[0];if(J?.type==="animation")return J.child;return null}}function R0(J,$,Q){let q=J;if(T($)){let z=Q??($.startsWith("scale")?"":"px");return(G)=>{S(J,$,G,z),q.style.transform=E(J)}}if($.startsWith("--")){let z=Q??"";return(G)=>{q.style.setProperty($,`${G}${z}`)}}let Z=$.replace(/([A-Z])/g,"-$1").toLowerCase(),j=Q??"";return(z)=>{q.style.setProperty(Z,`${z}${j}`)}}var Q7=new Set(["opacity","z-index","font-weight","line-height","flex","flex-grow","flex-shrink","order","scale","column-count","columns","tab-size","orphans","widows","zoom"]);function q7(J){if(typeof location>"u")return!J.includes(":");try{let $=new URL(J,location.href);return $.protocol==="https:"||$.protocol==="http:"}catch{return!J.includes(":")}}class Z0 extends v{_element=null;_innerElement=null;_mousePos={x:-100,y:-100};_cursorPos={x:-100,y:-100};_xSetter=null;_ySetter=null;_squeezeSetter=null;_squeezeConfig={min:0.55,max:1.2,multiplier:150};_state="default";_stateTimelines=new Map;_parsedStates=new Map;_textElement=null;_mediaElement=null;_tickerCallback;_boundMouseMove;_boundMouseDown;_boundMouseUp;_hoverSelectors=null;_isHoveringCursorTarget=!1;_boundHoverTargetMoveHandler=null;_cursorStyleTag=null;_attributeListeners=new Map;constructor(J,$){super(J,$);if(this._config={type:"basic",smooth:0.25,hideNative:!1,...$},$.squeeze===!0)this._squeezeConfig={min:0.55,max:1.2,multiplier:150};else if(typeof $.squeeze==="object")this._squeezeConfig={min:$.squeeze.min??0.55,max:$.squeeze.max??1.2,multiplier:$.squeeze.multiplier??150};if(this._parsedStates.set("default",this._parseStateConfig($.default)),$.hover)this._parsedStates.set("hover",this._parseStateConfig($.hover));if($.click)this._parsedStates.set("click",this._parseStateConfig($.click))}_parseStateConfig(J){let{targets:$,duration:Q,ease:q,enabled:Z,...j}=J;return{properties:j,duration:Q??0.15,ease:q??"power3.inOut",targets:$,enabled:Z??!0}}_onEnable(){if(this._element=this._createContainer(),this._innerElement=document.createElement("div"),this._innerElement.setAttribute("data-cursor-inner",""),this._innerElement.style.cssText="pointer-events:none;position:absolute;top:0;left:0;",this._element.appendChild(this._innerElement),S(this._innerElement,"x",-50,"%"),S(this._innerElement,"y",-50,"%"),this._xSetter=R0(this._element,"x","px"),this._ySetter=R0(this._element,"y","px"),this._config.squeeze)this._squeezeSetter=R0(this._element,"scale");if(this._cursorPos={x:-100,y:-100},this._mousePos={x:-100,y:-100},this._xSetter(-100),this._ySetter(-100),this._applyProperties(this._parsedStates.get("default").properties),this._innerElement.style.transform=E(this._innerElement),this._config.hideNative)this._cursorStyleTag=document.createElement("style"),this._cursorStyleTag.setAttribute("data-cursor-hide",""),this._cursorStyleTag.textContent="* { cursor: none !important; }",document.head.appendChild(this._cursorStyleTag);if(this._config.type==="text")this._setupTextCursor();else if(this._config.type==="media")this._setupMediaCursor();this._createStateTimelines(),this._setupEventListeners(),this._tickerCallback=(J)=>this._tick(J),w.getInstance().add(this._tickerCallback)}_onDisable(){if(this._tickerCallback)w.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;if(this._cursorStyleTag)this._cursorStyleTag.remove(),this._cursorStyleTag=null;if(this._removeEventListeners(),this._stateTimelines.forEach((J)=>J.kill()),this._stateTimelines.clear(),this._innerElement?.parentNode)this._innerElement.remove();if(this._innerElement=null,this._element?.parentNode)this._element.remove();this._element=null}_createContainer(){let J=document.createElement("div");return J.setAttribute("data-cursor-container",""),J.style.cssText="position:fixed;top:0;left:0;pointer-events:none;z-index:999999;width:0;height:0;",document.body.appendChild(J),J}_applyProperties(J){if(!this._innerElement)return;for(let[$,Q]of Object.entries(J))if($==="transform"){let q=Z0._expandTransformShorthand(String(Q));for(let[Z,j]of Object.entries(q))S(this._innerElement,Z,j)}else{let q=m($),Z=typeof Q==="number"&&!Q7.has(q)?`${Q}px`:String(Q);this._innerElement.style.setProperty(q,Z)}}_createStateTimelines(){if(!this._innerElement)return;let J=this._parsedStates.get("hover");if(J&&J.enabled){let Q=new R;Q._addEntry(this._innerElement,{to:Z0._expandStateProperties(J.properties),duration:J.duration,ease:J.ease}),this._stateTimelines.set("hover",Q)}let $=this._parsedStates.get("click");if($&&$.enabled){let Q=new R;Q._addEntry(this._innerElement,{to:Z0._expandStateProperties($.properties),duration:$.duration,ease:$.ease}),this._stateTimelines.set("click",Q)}}static _expandStateProperties(J){let $={};for(let[Q,q]of Object.entries(J))if(Q==="transform"){let Z=Z0._expandTransformShorthand(String(q));Object.assign($,Z)}else $[Q]=q;return $}static _expandTransformShorthand(J){let $={},Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,q;while((q=Q.exec(J))!==null){let Z=q[1],j=q[2].split(",").map((z)=>parseFloat(z.trim()));switch(Z){case"scale":{let z=j[0]??1,G=j.length>1?j[1]:z;if(z===G)$.scale=z;else $.scaleX=z,$.scaleY=G;break}case"scaleX":$.scaleX=j[0]??1;break;case"scaleY":$.scaleY=j[0]??1;break;case"scaleZ":$.scaleZ=j[0]??1;break;case"rotate":$.rotate=j[0]??0;break;case"rotateX":$.rotateX=j[0]??0;break;case"rotateY":$.rotateY=j[0]??0;break;case"rotateZ":$.rotateZ=j[0]??0;break;case"skewX":$.skewX=j[0]??0;break;case"skewY":$.skewY=j[0]??0;break}}return $}_setupEventListeners(){if(this._boundMouseMove=(Q)=>{this._mousePos.x=Q.clientX,this._mousePos.y=Q.clientY},document.addEventListener("mousemove",this._boundMouseMove),this._parsedStates.get("click")?.enabled)this._boundMouseDown=()=>this._setState("click"),this._boundMouseUp=()=>this._setState(this._state==="click"?"default":this._state),document.addEventListener("mousedown",this._boundMouseDown),document.addEventListener("mouseup",this._boundMouseUp);let $=this._parsedStates.get("hover");if($?.enabled&&$.targets&&$.targets.length>0)this._setupHoverTargets($.targets)}_setupHoverTargets(J){this._hoverSelectors=J,this._boundHoverTargetMoveHandler=($)=>{let q=document.elementsFromPoint($.clientX,$.clientY).some((Z)=>this._hoverSelectors.some((j)=>{try{return Z.matches(j)}catch{return!1}}));if(q&&!this._isHoveringCursorTarget)this._isHoveringCursorTarget=!0,this._setState("hover");else if(!q&&this._isHoveringCursorTarget){if(this._isHoveringCursorTarget=!1,this._state==="hover")this._setState("default")}},window.addEventListener("mousemove",this._boundHoverTargetMoveHandler)}_setupTextCursor(){if(!this._innerElement)return;this._innerElement.style.display="grid",this._innerElement.style.placeItems="center",this._innerElement.style.overflow="visible",this._textElement=document.createElement("div"),this._textElement.setAttribute("data-cursor-text",""),this._textElement.style.whiteSpace="nowrap",this._textElement.style.opacity="0",this._innerElement.appendChild(this._textElement);let $=this._parsedStates.get("hover")?.duration??0.15;if(this._textElement.style.transition=`opacity ${$}s ease-in-out`,this._config.text)for(let[q,Z]of Object.entries(this._config.text))this._textElement.style.setProperty(m(q),String(Z));let Q=document.querySelectorAll("[mp-cursor-text], [mp-cursor-tooltip]");for(let q of Q){let Z=(z)=>{let G=z.target,W=G.getAttribute("mp-cursor-text")??G.getAttribute("mp-cursor-tooltip")??"";if(this._textElement)this._textElement.textContent=W,this._textElement.style.opacity="1";this._setState("hover")},j=()=>{if(this._textElement)this._textElement.style.opacity="0";if(this._state==="hover")this._setState("default")};q.addEventListener("mouseenter",Z),q.addEventListener("mouseleave",j),this._attributeListeners.set(q,{enter:Z,leave:j})}}_setupMediaCursor(){if(!this._innerElement)return;let J=document.createElement("img");J.setAttribute("data-cursor-media",""),J.style.display="none",this._innerElement.appendChild(J);let $=document.createElement("video");if($.setAttribute("data-cursor-media",""),$.autoplay=!0,$.muted=!0,$.loop=!0,$.style.display="none",this._innerElement.appendChild($),this._config.media)for(let[q,Z]of Object.entries(this._config.media))J.style.setProperty(m(q),String(Z)),$.style.setProperty(m(q),String(Z));let Q=document.querySelectorAll("[mp-cursor-media]");for(let q of Q){let Z=(z)=>{let G=z.target.getAttribute("mp-cursor-media")||"";if(!G||!q7(G)){if(G)console.warn(`[Motion] Blocked unsafe media URL: "${G}". Only http/https URLs and relative paths are allowed.`);return}if(G.endsWith(".mp4")||G.endsWith(".webm"))$.src=G,$.style.display="block",J.style.display="none",$.play().catch(()=>{}),this._mediaElement=$;else J.src=G,J.style.display="block",$.style.display="none",this._mediaElement=J;this._setState("hover")},j=()=>{if(J.style.display="none",$.style.display="none",$.pause(),this._state==="hover")this._setState("default")};q.addEventListener("mouseenter",Z),q.addEventListener("mouseleave",j),this._attributeListeners.set(q,{enter:Z,leave:j})}}_removeEventListeners(){if(this._boundMouseMove)document.removeEventListener("mousemove",this._boundMouseMove);if(this._boundMouseDown)document.removeEventListener("mousedown",this._boundMouseDown);if(this._boundMouseUp)document.removeEventListener("mouseup",this._boundMouseUp);if(this._boundHoverTargetMoveHandler)window.removeEventListener("mousemove",this._boundHoverTargetMoveHandler),this._boundHoverTargetMoveHandler=null;this._hoverSelectors=null,this._isHoveringCursorTarget=!1,this._attributeListeners.forEach((J,$)=>{$.removeEventListener("mouseenter",J.enter),$.removeEventListener("mouseleave",J.leave)}),this._attributeListeners.clear()}_setState(J){if(this._state===J)return;let $=this._state;this._state=J;let Q=this._stateTimelines.get(J),q=this._stateTimelines.get($);if(J==="default"){if(q)q.reverse()}else{if($!=="default"&&q)q.reverse();if(Q)Q.play()}}_tick(J){if(!this._xSetter||!this._ySetter)return;let $=this._config.smooth??0.25,Q=Math.pow($,2.5)||0.000001,q=1-Math.pow(1-Q,J*60);if(this._cursorPos.x+=(this._mousePos.x-this._cursorPos.x)*q,this._cursorPos.y+=(this._mousePos.y-this._cursorPos.y)*q,this._xSetter(this._cursorPos.x),this._ySetter(this._cursorPos.y),this._squeezeSetter&&this._config.squeeze){let Z=this._calculateSqueeze();this._squeezeSetter(Z)}for(let Z of this._stateTimelines.values())if(Z.isActive())Z.update(J)}_calculateSqueeze(){let J=this._cursorPos.x-this._mousePos.x,$=this._cursorPos.y-this._mousePos.y,Q=Math.sqrt(J*J+$*$),{min:q,max:Z,multiplier:j}=this._squeezeConfig,z=1-(Math.exp(Q/j)-1)/10;if(Number.isNaN(z))return 1;return Math.max(q,Math.min(Z,z))}getElement(){return this._element}getState(){return this._state}}F.registerTrigger("cursor",Z0);class mJ extends v{_links=[];_listeners=new Map;_isNavigating=!1;_pendingUrl=null;_onCompleteHandler=null;_pollTimerId=null;constructor(J,$){super(J,$)}_onEnable(){if(this._isInsideBuilder())return;this._resolveLinks(),this._addClickListeners()}_onDisable(){if(this._cleanupListenerMap(this._listeners),this._links=[],this._isNavigating=!1,this._pendingUrl=null,this._pollTimerId!==null)clearTimeout(this._pollTimerId),this._pollTimerId=null;if(this._onCompleteHandler)this._onCompleteHandler=null}_isInsideBuilder(){try{if(typeof window<"u"&&window.top?.mp_iframe)return!0}catch{}return!1}_resolveLinks(){if(typeof document>"u")return;let J=this._config.mode||"all",$;if(J==="include"&&this._config.selectors&&this._config.selectors.trim()!=="")try{$=Array.from(document.querySelectorAll(this._config.selectors)).filter((q)=>q.tagName==="A"),document.querySelectorAll(this._config.selectors).forEach((q)=>{if(q.tagName!=="A"){let Z=q.querySelectorAll("a");$.push(...Array.from(Z))}})}catch(Q){console.warn(`[Motion] Invalid selector "${this._config.selectors}":`,Q),$=[]}else if(J==="include")$=[];else if(J==="exclude"&&this._config.selectors&&this._config.selectors.trim()!==""){let Q=Array.from(document.querySelectorAll("a")),q;try{q=new Set(document.querySelectorAll(this._config.selectors))}catch(Z){console.warn(`[Motion] Invalid selector "${this._config.selectors}":`,Z),q=new Set}$=Q.filter((Z)=>!q.has(Z))}else $=Array.from(document.querySelectorAll("a"));this._links=[...new Set($)],this._links=this._links.filter((Q)=>this._shouldIntercept(Q))}_shouldIntercept(J){let $=J.getAttribute("href");if(!$||$==="")return!1;let Q=this._config.skipHref||[];if($.startsWith("#"))return!Q.includes("anchor");if($.toLowerCase().startsWith("javascript:"))return!Q.includes("javascript");if($.toLowerCase().startsWith("mailto:")||$.toLowerCase().startsWith("tel:"))return!Q.includes("mailto");return!0}_addClickListeners(){this._links.forEach((J)=>{let $=new Map,Q=(q)=>{if(this._isNavigating)return;let Z=q;if(Z.ctrlKey||Z.metaKey||Z.shiftKey||Z.altKey)return;let j=J.getAttribute("target");if(j&&j!=="_self")return;let z=J.href;if(!z)return;q.preventDefault(),q.stopPropagation(),this._isNavigating=!0,this._pendingUrl=z,this._onCompleteHandler=()=>{this._navigate()},this._timeline.restart(),this._waitForCompletion()};J.addEventListener("click",Q),$.set("click",Q),this._listeners.set(J,$)})}_waitForCompletion(){let J=this._timeline,$=16,Q=()=>{if(this._pollTimerId=null,!this._enabled||!this._isNavigating||!this._pendingUrl)return;let q=J.progress(),Z=J.isActive();if(q>=1||!Z&&q>0)this._navigate();else this._pollTimerId=setTimeout(Q,16)};this._pollTimerId=setTimeout(Q,16)}_navigate(){if(!this._pendingUrl)return;let J=this._pendingUrl;if(this._pendingUrl=null,this._isNavigating=!1,typeof window<"u")window.location.href=J}}F.registerTrigger("pageExit",mJ);var QJ=null;function Z7(){if(!QJ&&typeof document<"u"){let J=document.createElement("canvas");J.width=1,J.height=1,QJ=J.getContext("2d")}return QJ}function gJ(J){let $=J.replace("#",""),Q,q,Z,j=1;if($.length===3)Q=parseInt($[0]+$[0],16),q=parseInt($[1]+$[1],16),Z=parseInt($[2]+$[2],16);else if($.length===4)Q=parseInt($[0]+$[0],16),q=parseInt($[1]+$[1],16),Z=parseInt($[2]+$[2],16),j=parseInt($[3]+$[3],16)/255;else if($.length===6)Q=parseInt($.slice(0,2),16),q=parseInt($.slice(2,4),16),Z=parseInt($.slice(4,6),16);else if($.length===8)Q=parseInt($.slice(0,2),16),q=parseInt($.slice(2,4),16),Z=parseInt($.slice(4,6),16),j=parseInt($.slice(6,8),16)/255;else return null;if(isNaN(Q)||isNaN(q)||isNaN(Z)||isNaN(j))return null;return new Float32Array([Q,q,Z,j])}function j7(J){let $=J.match(/rgba?\s*\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*(?:[,\/]\s*([\d.]+))?\s*\)/i);if(!$)return null;let Q=parseFloat($[1]),q=parseFloat($[2]),Z=parseFloat($[3]),j=$[4]!==void 0?parseFloat($[4]):1;if(isNaN(Q)||isNaN(q)||isNaN(Z)||isNaN(j))return null;return new Float32Array([Q,q,Z,j])}function G7(J,$,Q){J=J/360,$=$/100,Q=Q/100;let q,Z,j;if($===0)q=Z=j=Q;else{let z=(N,B,Y)=>{if(Y<0)Y+=1;if(Y>1)Y-=1;if(Y<0.16666666666666666)return N+(B-N)*6*Y;if(Y<0.5)return B;if(Y<0.6666666666666666)return N+(B-N)*(0.6666666666666666-Y)*6;return N},G=Q<0.5?Q*(1+$):Q+$-Q*$,W=2*Q-G;q=z(W,G,J+0.3333333333333333),Z=z(W,G,J),j=z(W,G,J-0.3333333333333333)}return[Math.round(q*255),Math.round(Z*255),Math.round(j*255)]}function z7(J){let $=J.match(/hsla?\s*\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)%\s*[,\s]\s*([\d.]+)%\s*(?:[,\/]\s*([\d.]+))?\s*\)/i);if(!$)return null;let Q=parseFloat($[1]),q=parseFloat($[2]),Z=parseFloat($[3]),j=$[4]!==void 0?parseFloat($[4]):1;if(isNaN(Q)||isNaN(q)||isNaN(Z)||isNaN(j))return null;let[z,G,W]=G7(Q,q,Z);return new Float32Array([z,G,W,j])}function W7(J,$){if(!$||typeof window>"u")return null;let Q=J.match(/var\s*\(\s*(--[\w-]+)\s*\)/i);if(!Q)return null;let q=Q[1],Z=window.getComputedStyle($).getPropertyValue(q).trim();if(!Z)return null;return qJ(Z,$)}function N7(J){let $=Z7();if(!$)return null;$.fillStyle="#000000",$.fillStyle=J;let Q=$.fillStyle;if(Q==="#000000"&&J.toLowerCase()!=="black"&&J!=="#000000"&&J!=="#000")return null;return gJ(Q)}function qJ(J,$){if(!J||typeof J!=="string")return null;let Q=J.trim().toLowerCase();if(Q==="transparent")return new Float32Array([0,0,0,0]);if(Q.startsWith("#"))return gJ(Q);if(Q.startsWith("rgb"))return j7(Q);if(Q.startsWith("hsl"))return z7(Q);if(Q.startsWith("var("))return W7(Q,$);return N7(Q)}function B7(J,$){if(typeof window>"u")return new Float32Array([0,0,0,1]);let Q=window.getComputedStyle(J),q=$.replace(/[A-Z]/g,(z)=>`-${z.toLowerCase()}`),Z=Q.getPropertyValue(q).trim();if(!Z||Z==="none")return new Float32Array([0,0,0,0]);return qJ(Z,J)||new Float32Array([0,0,0,1])}X.color={parseColor:qJ,getCurrentColor:B7};var Y7={blur:{value:0,unit:"px"},brightness:{value:1,unit:""},contrast:{value:1,unit:""},saturate:{value:1,unit:""},grayscale:{value:0,unit:""},sepia:{value:0,unit:""},"hue-rotate":{value:0,unit:"deg"},invert:{value:0,unit:""},opacity:{value:1,unit:""}};function _7(J){let $=J.trim().match(/^([\w-]+)\(\s*([\d.]+)(px|%|deg)?\s*\)$/);if(!$)return null;let Q=$[1].toLowerCase(),q=parseFloat($[2]),Z=$[3]||"";if(Z==="%")q=q/100,Z="";return{name:Q,value:q,unit:Z}}function sJ(J){if(J===null||J===void 0||typeof J!=="string")return null;let $=J.trim().toLowerCase();if($==="none"||$==="")return[];let Q=[],q=/([\w-]+)\([^)]+\)/g,Z;while((Z=q.exec($))!==null){let j=_7(Z[0]);if(j)Q.push(j)}return Q.length>0?Q:null}function H7(J){if(!J||J.length===0)return"none";return J.map(($)=>{let Q;if($.name==="blur")Q=`${$.value}${$.unit||"px"}`;else if($.name==="hue-rotate")Q=`${$.value}${$.unit||"deg"}`;else Q=`${$.value}`;return`${$.name}(${Q})`}).join(" ")}function X7(J){if(typeof window>"u")return[];let $=window.getComputedStyle(J),Q=$.filter||$.getPropertyValue("filter");if(!Q||Q==="none")return[];return sJ(Q)||[]}function K7(J){let $=Y7[J];if($)return{name:J,value:$.value,unit:$.unit};return{name:J,value:0,unit:""}}function U7(J,$){let Q=new Set;for(let j of J)Q.add(j.name);for(let j of $)Q.add(j.name);let q=[],Z=[];for(let j of Q){let z=J.find((N)=>N.name===j),G=$.find((N)=>N.name===j),W=K7(j);q.push(z||W),Z.push(G||W)}return{start:q,end:Z}}var j0=[];function I7(J,$,Q){let q=J.length;if(j0.length<q)for(let Z=j0.length;Z<q;Z++)j0.push({name:"",value:0,unit:""});for(let Z=0;Z<q;Z++){let j=J[Z],z=$[Z],G=j0[Z];G.name=j.name,G.value=j.value+(z.value-j.value)*Q,G.unit=j.unit||z.unit}return j0.length=q,j0}X.filter={parseFilter:sJ,getCurrentFilter:X7,mergeFilterArrays:U7,interpolateFilters:I7,filterToString:H7};var oJ=new WeakMap;function A7(J){return"getTotalLength"in J&&typeof J.getTotalLength==="function"}function b0(J){let $=oJ.get(J);if($!==void 0)return $;if(A7(J)){let Q=J.getTotalLength();return oJ.set(J,Q),Q}return 0}function F7(J,$){if(J===null||J===void 0)return null;if(typeof J==="object"){let Q=J.start??0,q=J.end??100;return{start:Q/100,end:q/100}}if(typeof J==="string"){let Q=J.trim();if(Q==="true")return{start:0,end:1};if(Q==="false"||Q===""||Q==="none")return{start:0,end:0};let q=Q.match(/^([-\d.]+)(px|%)?\s+([-\d.]+)(px|%)?$/);if(q){let j=parseFloat(q[1]),z=q[2]||"%",G=parseFloat(q[3]),W=q[4]||"%",N=$?b0($):0,B=ZJ(j,z,N),Y=ZJ(G,W,N);return{start:B,end:Y}}let Z=Q.match(/^([-\d.]+)(px|%)?$/);if(Z){let j=parseFloat(Z[1]),z=Z[2]||"%",G=$?b0($):0;return{start:0,end:ZJ(j,z,G)}}}return null}function ZJ(J,$,Q){if($==="px"&&Q>0)return J/Q;return J/100}function O7(J){let $=b0(J);if($===0)return{start:0,end:1};try{if(typeof window<"u"&&window.getComputedStyle){let Q=window.getComputedStyle(J),q=Q.strokeDasharray,Z=Q.strokeDashoffset;if(!q||q==="none")return{start:0,end:1};let j=q.split(/[\s,]+/).map(parseFloat).filter((G)=>!isNaN(G)),z=parseFloat(Z)||0;if(j.length>=1){let G=j[0],W=z/$,N=(z+G)/$;return{start:W,end:N}}}}catch{}return{start:0,end:1}}function L7(J,$,Q,q){if(!(J instanceof SVGElement)||q===0)return;let Z=J,j=Math.abs(Q-$)*q,z=Math.min($,Q)*q;Z.style.strokeDasharray=`${j} ${q}`,Z.style.strokeDashoffset=`${-z}`}X.drawSVG={parseDrawSVG:F7,getCurrentDrawSVG:O7,getPathLength:b0,applyDrawSVG:L7};var w0=new WeakMap,x0=new WeakMap;class C0{static split(J,$,Q){if(!(J instanceof HTMLElement))return[];let q=w0.get(J);if(q!==void 0)J.innerHTML=q,J.removeAttribute("data-split"),x0.delete(J);else w0.set(J,J.innerHTML);let Z={chars:[],words:[],lines:[],elements:[]},j=$.split(",").map((N)=>N.trim()),z=j.includes("chars"),G=j.includes("words"),W=j.includes("lines");if(W)this._splitWithLinesDom(J,G,z,Z);else if(G&&z)this._splitWordsWithCharsDom(J,Z);else if(G)this._splitWordsDom(J,Z);else if(z)this._splitCharsDom(J,Z);if(z)Z.elements=Z.chars;else if(G)Z.elements=Z.words;else if(W)Z.elements=Z.lines;if(Q?.mask&&Z.elements.length>0)this._applyMaskWrappers(Z);return x0.set(J,Z),J.setAttribute("data-split",$),Z.elements}static _splitWordsDom(J,$){let Q=Array.from(J.childNodes);for(let q of Q)if(q.nodeType===3){let Z=q.textContent||"";if(!Z)continue;let j=Z.split(/(\s+)/),z=document.createDocumentFragment(),G=!1;for(let W of j)if(/^\s+$/.test(W))z.appendChild(document.createTextNode(W.replace(/\n/g," "))),G=!0;else if(W){let N=document.createElement("span");N.setAttribute("data-split-word",""),N.setAttribute("data-word-index",String($.words.length)),N.style.display="inline-block",N.textContent=W,$.words.push(N),z.appendChild(N),G=!0}if(G)J.replaceChild(z,q)}else if(q.nodeType===1){let Z=q;if(Z.tagName==="BR")continue;this._splitWordsDom(Z,$)}}static _splitCharsDom(J,$){let Q=Array.from(J.childNodes);for(let q of Q)if(q.nodeType===3){let Z=q.textContent||"";if(!Z)continue;let j=document.createDocumentFragment();for(let z of Z)if(z===" "||z===`
|
|
30
30
|
`||z==="\t")j.appendChild(document.createTextNode(z===`
|
|
31
|
-
`?" ":z));else{let G=document.createElement("span");G.setAttribute("data-split-char",""),G.setAttribute("data-char-index",String($.chars.length)),G.style.display="inline-block",G.textContent=z,$.chars.push(G),j.appendChild(G)}J.replaceChild(j,q)}else if(q.nodeType===1){let Z=q;if(Z.tagName==="BR")continue;this._splitCharsDom(Z,$)}}static _splitWordsWithCharsDom(J,$){let Q=Array.from(J.childNodes);for(let q of Q)if(q.nodeType===3){let Z=q.textContent||"";if(!Z)continue;let j=Z.split(/(\s+)/),z=document.createDocumentFragment();for(let G of j)if(/^\s+$/.test(G))z.appendChild(document.createTextNode(G.replace(/\n/g," ")));else if(G){let N=document.createElement("span");N.setAttribute("data-split-word",""),N.setAttribute("data-word-index",String($.words.length)),N.style.display="inline-block",N.style.whiteSpace="nowrap";for(let W of G){let _=document.createElement("span");_.setAttribute("data-split-char",""),_.setAttribute("data-char-index",String($.chars.length)),_.style.display="inline-block",_.textContent=W,$.chars.push(_),N.appendChild(_)}$.words.push(N),z.appendChild(N)}J.replaceChild(z,q)}else if(q.nodeType===1){let Z=q;if(Z.tagName==="BR")continue;this._splitWordsWithCharsDom(Z,$)}}static _splitWithLinesDom(J,$,Q,q){let Z={chars:[],words:[],lines:[],elements:[]};this._splitWordsDom(J,Z);let j=[],z=[],G=-1/0;for(let Y of Z.words){let H=Y.getBoundingClientRect();if(H.top>G+2){if(z.length>0)j.push(z);z=[Y],G=H.top}else z.push(Y)}if(z.length>0)j.push(z);let N=new Map;for(let Y of Z.words)N.set(Y,this._getWrapperChain(Y,J));let W="",_=0,B=0,U=0;for(let Y of j){let H="",A=[];for(let K=0;K<Y.length;K++){let M=Y[K],k=M.textContent||"",L=N.get(M)||[],O=0;while(O<A.length&&O<L.length&&A[O]===L[O])O++;for(let v=A.length-1;v>=O;v--)H+=`</${A[v].tagName.toLowerCase()}>`;if(K>0)H+=" ";for(let v=O;v<L.length;v++)H+=this._openTag(L[v]);if(Q){let v="";for(let P0 of k)v+=`<span data-split-char data-char-index="${U}" style="display:inline-block">${this._escapeHtml(P0)}</span>`,U++;if($)H+=`<span data-split-word data-word-index="${B}" style="display:inline-block;white-space:nowrap">${v}</span>`;else H+=v}else if($)H+=`<span data-split-word data-word-index="${B}" style="display:inline-block">${this._escapeHtml(k)}</span>`;else H+=this._escapeHtml(k);B++,A=L}for(let K=A.length-1;K>=0;K--)H+=`</${A[K].tagName.toLowerCase()}>`;W+=`<span data-split-line data-line-index="${_}" style="display:block">${H}</span>`,_++}if(J.innerHTML=W,Q)q.chars=Array.from(J.querySelectorAll("[data-split-char]"));if($)q.words=Array.from(J.querySelectorAll("[data-split-word]"));q.lines=Array.from(J.querySelectorAll("[data-split-line]"))}static _applyMaskWrappers(J){let $=J.elements;for(let Q of $){let q=Q.hasAttribute("data-split-line"),Z=Q.hasAttribute("data-split-word"),j=document.createElement("span");if(j.setAttribute("data-split-mask",""),j.style.overflow="hidden",j.style.display=q?"block":"inline-block",!q)j.style.verticalAlign=Z?"bottom":"bottom";Q.parentNode.insertBefore(j,Q),j.appendChild(Q)}}static revert(J){let $=w0.get(J);if($!==void 0&&J instanceof HTMLElement)return J.innerHTML=$,J.removeAttribute("data-split"),w0.delete(J),C0.delete(J),!0;return!1}static isSplit(J){return J.hasAttribute("data-split")}static getResult(J){return C0.get(J)}static _getWrapperChain(J,$){let Q=[],q=J.parentElement;while(q&&q!==$)Q.unshift(q),q=q.parentElement;return Q}static _openTag(J){let $=J.tagName.toLowerCase(),Q="";for(let q of Array.from(J.attributes))Q+=` ${q.name}="${this._escapeHtml(q.value)}"`;return`<${$}${Q}>`}static _escapeHtml(J){return J.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}}X.textSplitter={split:(J,$,Q)=>x0.split(J,$,Q),revert:x0.revert,isSplit:x0.isSplit};class lJ{static resolve(J,$){if(J.length===0)return[];if(J.length===1)return[0];if(typeof $==="number")return J.map((Q,q)=>q*$);return this.resolveComplexStagger(J,$)}static resolveComplexStagger(J,$){let Q=J.length;if(Q===1)return[0];let q;if($.each!==void 0)q=$.each;else if($.amount!==void 0)q=$.amount/(Q-1);else q=0.1;let Z=this.getOrdering(J,$),j=Array(Q);for(let z=0;z<Q;z++)j[Z[z].originalIndex]=Z[z].order*q;return j}static getOrdering(J,$){let Q=J.length,q=$.from??"start";if($.grid)return this.getGridOrdering(J,$);switch(q){case"start":return J.map((Z,j)=>({originalIndex:j,order:j}));case"end":return J.map((Z,j)=>({originalIndex:j,order:Q-1-j}));case"center":{let Z=Math.floor(Q/2);return J.map((j,z)=>{let G=Math.abs(z-Z);return{originalIndex:z,order:G}})}case"edges":return J.map((Z,j)=>{let z=Math.min(j,Q-1-j);return{originalIndex:j,order:z}});case"random":{let Z=J.map((j,z)=>({originalIndex:z,order:Math.random()}));return Z.sort((j,z)=>j.order-z.order),Z.forEach((j,z)=>{j.order=z}),Z}default:if(typeof q==="number"){let Z=Math.max(0,Math.min(Q-1,q));return J.map((j,z)=>{let G=Math.abs(z-Z);return{originalIndex:z,order:G}})}return J.map((Z,j)=>({originalIndex:j,order:j}))}}static getGridOrdering(J,$){let Q,q;if($.grid==="auto"){let G=this.detectGrid(J);Q=G.cols,q=G.rows}else[Q,q]=$.grid;let Z=$.from??"start",j=$.axis??"x",z=J.map((G,N)=>{let W=N%Q,_=Math.floor(N/Q);return{originalIndex:N,col:W,row:_}});if(Z==="random"){let G=z.map((N)=>({originalIndex:N.originalIndex,order:Math.random()}));return G.sort((N,W)=>N.order-W.order),G.forEach((N,W)=>{N.order=W}),G}return z.map((G)=>{let N;if(typeof Z==="number"){let W=Z%Q,_=Math.floor(Z/Q);N=j==="x"?Math.abs(G.col-W)+Math.abs(G.row-_)*0.5:Math.abs(G.row-_)+Math.abs(G.col-W)*0.5}else if(Z==="center"){let W=(Q-1)/2,_=(q-1)/2;N=Math.abs(G.col-W)+Math.abs(G.row-_)}else if(Z==="edges"){let W=Math.min(G.col,Q-1-G.col),_=Math.min(G.row,q-1-G.row);N=Math.min(W,_)}else if(Z==="end")N=j==="x"?(q-1-G.row)*Q+(Q-1-G.col):(Q-1-G.col)*q+(q-1-G.row);else N=j==="x"?G.row*Q+G.col:G.col*q+G.row;return{originalIndex:G.originalIndex,order:N}})}static detectGrid(J){if(J.length===0)return{cols:0,rows:0};let $=J.filter((j)=>j instanceof Element);if($.length===0)return{cols:J.length,rows:1};let Q=new Map;$.forEach((j)=>{let z=j.getBoundingClientRect(),G=Math.round(z.top);Q.set(G,(Q.get(G)||0)+1)});let q=Q.size;return{cols:Math.ceil(J.length/q),rows:q}}}X.stagger={resolve:(J,$)=>lJ.resolve(J,$)};function L7(J,$,Q){if(!(J instanceof HTMLElement))return console.warn("[Motion Fit] Fit animations only support HTML elements. SVG elements are not supported."),null;let q=document.querySelector($);if(!q)return console.warn(`[Motion Fit] Target element not found: "${$}". Animation skipped.`),null;if(!(q instanceof HTMLElement))return console.warn("[Motion Fit] Fit animations only support HTML elements. SVG elements are not supported."),null;if(q===J)return console.warn("[Motion Fit] Target element is the same as source element. Animation skipped."),null;let Z=J.getBoundingClientRect(),j=q.getBoundingClientRect(),z=Z.width===0?1:Z.width,G=Z.height===0?1:Z.height,N=Z.left+z/2,W=Z.top+G/2,_=j.left+j.width/2,B=j.top+j.height/2,U=_-N,Y=B-W,H=j.width/z,A=j.height/G;if(!Q)return{dx:U,dy:Y,sx:H,sy:A,sourceWidth:Z.width,sourceHeight:Z.height,targetWidth:j.width,targetHeight:j.height};let K=J.offsetParent??document.documentElement,M=K.getBoundingClientRect(),k=K.scrollLeft??0,L=K.scrollTop??0;return{dx:U,dy:Y,sx:H,sy:A,sourceWidth:Z.width,sourceHeight:Z.height,targetWidth:j.width,targetHeight:j.height,sourceLeft:J.offsetLeft,sourceTop:J.offsetTop,targetLeft:j.left-M.left+k,targetTop:j.top-M.top+L}}var s=0.01,iJ=0.001;function M7(J,$,Q,q){let{absolute:Z=!1,scale:j=!0,resize:z=!1}=Q;if($ instanceof HTMLElement){if(y($,!0),z)$.style.width="",$.style.height="";if(Z)$.style.width="",$.style.height="",$.style.left="",$.style.top=""}let G=L7($,Q.target,Z);if(!G)return;if(!Z)if(z){let N=G.dx-(G.targetWidth-G.sourceWidth)/2,W=G.dy-(G.targetHeight-G.sourceHeight)/2;if(Math.abs(N)>s){let _=q.acquire();_.init($,"x",0,N,"px"),J.addPropTween(_)}if(Math.abs(W)>s){let _=q.acquire();_.init($,"y",0,W,"px"),J.addPropTween(_)}if(Math.abs(G.targetWidth-G.sourceWidth)>s){let _=q.acquire();_.init($,"width",G.sourceWidth,G.targetWidth,"px"),J.addPropTween(_)}if(Math.abs(G.targetHeight-G.sourceHeight)>s){let _=q.acquire();_.init($,"height",G.sourceHeight,G.targetHeight,"px"),J.addPropTween(_)}}else{if(Math.abs(G.dx)>s){let N=q.acquire();N.init($,"x",0,G.dx,"px"),J.addPropTween(N)}if(Math.abs(G.dy)>s){let N=q.acquire();N.init($,"y",0,G.dy,"px"),J.addPropTween(N)}if(j){if(Math.abs(G.sx-1)>iJ){let N=q.acquire();N.init($,"scaleX",1,G.sx,""),J.addPropTween(N)}if(Math.abs(G.sy-1)>iJ){let N=q.acquire();N.init($,"scaleY",1,G.sy,""),J.addPropTween(N)}}}else{let N=$;if(window.getComputedStyle(N).position==="static")N.style.position="absolute";let{sourceLeft:_,sourceTop:B,targetLeft:U,targetTop:Y}=G;if(Math.abs(U-_)>s){let H=q.acquire();H.init($,"left",_,U,"px"),J.addPropTween(H)}if(Math.abs(Y-B)>s){let H=q.acquire();H.init($,"top",B,Y,"px"),J.addPropTween(H)}if(j){if(Math.abs(G.targetWidth-G.sourceWidth)>s){let H=q.acquire();H.init($,"width",G.sourceWidth,G.targetWidth,"px"),J.addPropTween(H)}if(Math.abs(G.targetHeight-G.sourceHeight)>s){let H=q.acquire();H.init($,"height",G.sourceHeight,G.targetHeight,"px"),J.addPropTween(H)}}}}function k7(J,$,Q,q){J.setPendingFitSetup((Z)=>M7(J,$,Q,Z)),J.setLazyStartCapture(!0)}X.fit={registerPendingSetup:k7};var rJ=(J)=>J,D7=rJ,V0={in:(J)=>J*J,out:(J)=>J*(2-J),inOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J},jJ={in:(J)=>J*J*J,out:(J)=>--J*J*J+1,inOut:(J)=>J<0.5?4*J*J*J:(J-1)*(2*J-2)*(2*J-2)+1},GJ={in:(J)=>J*J*J*J,out:(J)=>1- --J*J*J*J,inOut:(J)=>J<0.5?8*J*J*J*J:1-8*--J*J*J*J},zJ={in:(J)=>J*J*J*J*J,out:(J)=>1+--J*J*J*J*J,inOut:(J)=>J<0.5?16*J*J*J*J*J:1+16*--J*J*J*J*J},NJ={in:(J)=>1-Math.cos(J*Math.PI/2),out:(J)=>Math.sin(J*Math.PI/2),inOut:(J)=>-(Math.cos(Math.PI*J)-1)/2},WJ={in:(J)=>J===0?0:Math.pow(2,10*(J-1)),out:(J)=>J===1?1:1-Math.pow(2,-10*J),inOut:(J)=>{if(J===0)return 0;if(J===1)return 1;if((J*=2)<1)return 0.5*Math.pow(2,10*(J-1));return 0.5*(2-Math.pow(2,-10*(J-1)))}},_J={in:(J)=>1-Math.sqrt(1-J*J),out:(J)=>Math.sqrt(1- --J*J),inOut:(J)=>{if((J*=2)<1)return-0.5*(Math.sqrt(1-J*J)-1);return 0.5*(Math.sqrt(1-(J-=2)*J)+1)}};var BJ={in:(J)=>J*J*(2.70158*J-1.70158),out:(J)=>--J*J*(2.70158*J+1.70158)+1,inOut:(J)=>{if((J*=2)<1)return 0.5*(J*J*(3.5949095*J-2.5949095));return 0.5*((J-=2)*J*(3.5949095*J+2.5949095)+2)}},YJ={in:(J)=>{if(J===0)return 0;if(J===1)return 1;let $=0.3,Q=$/4;return-(Math.pow(2,10*(J-=1))*Math.sin((J-Q)*(2*Math.PI)/$))},out:(J)=>{if(J===0)return 0;if(J===1)return 1;let $=0.3,Q=$/4;return Math.pow(2,-10*J)*Math.sin((J-Q)*(2*Math.PI)/$)+1},inOut:(J)=>{if(J===0)return 0;if(J===1)return 1;let $=0.44999999999999996,Q=$/4;if((J*=2)<1)return-0.5*(Math.pow(2,10*(J-=1))*Math.sin((J-Q)*(2*Math.PI)/$));return Math.pow(2,-10*(J-=1))*Math.sin((J-Q)*(2*Math.PI)/$)*0.5+1}},nJ=(J)=>{if(J<0.36363636363636365)return 7.5625*J*J;else if(J<0.7272727272727273)return 7.5625*(J-=0.5454545454545454)*J+0.75;else if(J<0.9090909090909091)return 7.5625*(J-=0.8181818181818182)*J+0.9375;else return 7.5625*(J-=0.9545454545454546)*J+0.984375},Y0={in:(J)=>1-nJ(1-J),out:nJ,inOut:(J)=>{if(J<0.5)return Y0.in(J*2)*0.5;return Y0.out(J*2-1)*0.5+0.5}},aJ={linear:rJ,none:D7,"power1.in":V0.in,"power1.out":V0.out,"power1.inout":V0.inOut,"power2.in":jJ.in,"power2.out":jJ.out,"power2.inout":jJ.inOut,"power3.in":GJ.in,"power3.out":GJ.out,"power3.inout":GJ.inOut,"power4.in":zJ.in,"power4.out":zJ.out,"power4.inout":zJ.inOut,"sine.in":NJ.in,"sine.out":NJ.out,"sine.inout":NJ.inOut,"expo.in":WJ.in,"expo.out":WJ.out,"expo.inout":WJ.inOut,"circ.in":_J.in,"circ.out":_J.out,"circ.inout":_J.inOut,"back.in":BJ.in,"back.out":BJ.out,"back.inout":BJ.inOut,"elastic.in":YJ.in,"elastic.out":YJ.out,"elastic.inout":YJ.inOut,"bounce.in":Y0.in,"bounce.out":Y0.out,"bounce.inout":Y0.inOut};function tJ(J){let $=J.toLowerCase();if(!aJ[$])console.warn(`[Motion] Unknown easing "${J}". Falling back to "power1.out". Valid easings: linear, power1-4.in/out/inOut, sine, expo, circ, back, elastic, bounce`);return aJ[$]||V0.out}class HJ{_id=0;_targets=[];_duration=0.5;_delay=0;_time=0;_progress=0;_timeScale=1;_isActive=!1;_isReversed=!1;_propTweens=null;_lastPropTween=null;_easingFn=null;_repeat=0;_repeatDelay=0;_yoyo=!1;_currentRepeat=0;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_startFired=!1;_completeFired=!1;_timelineChild=!1;_needsStartCapture=!1;_startCaptured=!1;_fitSetupFn=null;_pendingFitSetup=null;_unregisterCallback=null;init(J,$,Q,q,Z,j){return this._id=J,this._targets=$,this._duration=Q,this._delay=q,this._easingFn=tJ(Z),this._time=0,this._progress=0,this._timeScale=1,this._isActive=!1,this._isReversed=!1,this._startFired=!1,this._completeFired=!1,this._currentRepeat=0,this._repeat=j?.repeat??0,this._repeatDelay=j?.repeatDelay??0,this._yoyo=j?.yoyo??!1,this._onStart=j?.onStart,this._onUpdate=j?.onUpdate,this._onComplete=j?.onComplete,this._onRepeat=j?.onRepeat,this._onReverseComplete=j?.onReverseComplete,this}update(J){if(!this._isActive)return;let $=J*this._timeScale;if(this._time+=this._isReversed?-$:$,!this._isReversed&&this._time<0){this._time=0;return}let Q=Math.max(0,this._time-this._delay);if(this._progress=this._duration>0?Math.min(1,Q/this._duration):1,!this._startFired&&this._progress>0)this._startFired=!0,this._onStart?.();if(this.render(this._progress),this._onUpdate?.(this._progress),this._isReversed){if(this._time<=0)this.handleComplete()}else if(this._progress>=1)this.handleComplete()}render(J){let $=this.applyEasing(J),Q=this._propTweens;while(Q)Q.render($),Q=Q.next}renderAtTime(J){let $=Math.max(0,J),Q=this._duration,q=this._delay,Z=this._currentRepeat;if(Q===0){let j=$>=q?1:0;this._time=$,this._progress=j,this.render(j)}else{let j=Math.max(0,$-q);if(this._repeat===0){let z=Math.min(1,j/Q);this._time=Math.min(Q,j),this._progress=z,this.render(z)}else{let z=this._repeatDelay,G=Q+z,N=this._repeat===-1?1/0:Q*(this._repeat+1)+z*this._repeat,W=this._repeat===-1?j:Math.min(j,N),_=G>0?Math.floor(W/G):0,B=W-_*G,U=B>Q,Y=Q>0?Math.min(1,B/Q):1,H=this._yoyo&&_%2===1;if(U)Y=H?0:1;else if(H)Y=1-Y;this._currentRepeat=this._repeat===-1?_:Math.min(_,this._repeat),this._isReversed=H,this._progress=Y,this._time=Q*Y,this.render(Y)}}if(this._isActive){if(!this._startFired){this._startFired=!0;try{this._onStart?.()}catch(j){console.error("[Motion] onStart callback error:",j)}}try{this._onUpdate?.(this._progress)}catch(j){console.error("[Motion] onUpdate callback error:",j)}if(this._currentRepeat>Z)try{this._onRepeat?.(this._currentRepeat)}catch(j){console.error("[Motion] onRepeat callback error:",j)}if(!this._completeFired&&this._repeat!==-1){if($>=this.totalDuration()){this._completeFired=!0;try{this._onComplete?.()}catch(j){console.error("[Motion] onComplete callback error:",j)}}}}}applyEasing(J){if(!this._easingFn)return J;return this._easingFn(J)}handleComplete(){if(this._repeat===-1||this._currentRepeat<this._repeat){if(this._currentRepeat++,this._onRepeat?.(this._currentRepeat),this._yoyo)this._isReversed=!this._isReversed,this._time=this._isReversed?this._duration+this._delay:0;else this._time=0,this._startFired=!1;this._time-=this._repeatDelay;return}if(this._isReversed)this._onReverseComplete?.();else this._onComplete?.();this._isActive=!1}play(J){if(J!==void 0)return this.seek(J),this._isActive=!0,this._isReversed=!1,this;if(this._isActive&&!this._isReversed)return this;return this._isActive=!0,this._isReversed=!1,this}pause(J){if(J!==void 0){this._time=J;let $=Math.max(0,this._time-this._delay);this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress)}return this._isActive=!1,this}reverse(J){if(J!==void 0)this.seek(J);return this._isActive=!0,this._isReversed=!0,this}restart(J=!0){return this._time=J?0:this._delay,this._progress=0,this._isActive=!0,this._isReversed=!1,this._startFired=!1,this._currentRepeat=0,this.render(0),this}seek(J){this._time=J;let $=Math.max(0,this._time-this._delay);return this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress),this}progress(J){if(J===void 0)return this._progress;if(this._progress=Math.max(0,Math.min(1,J)),this._progress===0)this._time=0;else this._time=this._progress*this._duration+this._delay;return this.render(this._progress),this}time(J){if(J===void 0)return this._time;this._time=J;let $=Math.max(0,this._time-this._delay);return this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress),this}timeScale(J){if(J===void 0)return this._timeScale;return this._timeScale=J,this}getTimeScale(){return this._timeScale}kill(){this._isActive=!1,this._unregisterCallback?.()}isActive(){return this._isActive}isTimelineChild(){return this._timelineChild}setTimelineChild(J){this._timelineChild=J}setLazyStartCapture(J){this._needsStartCapture=J,this._startCaptured=!1}setPendingFitSetup(J){this._fitSetupFn=J,this._pendingFitSetup=J}resetForReplay(){if(this._fitSetupFn)this._pendingFitSetup=this._fitSetupFn,this._startCaptured=!1;this._startFired=!1,this._completeFired=!1}needsStartCapture(){return this._needsStartCapture&&!this._startCaptured}isLazyCapture(){return this._needsStartCapture}fireReverseComplete(){try{this._onReverseComplete?.()}catch(J){console.error("[Motion] onReverseComplete callback error:",J)}this._startFired=!1,this._completeFired=!1}setUnregisterCallback(J){this._unregisterCallback=J}captureStartValues(){if(!this._needsStartCapture||this._startCaptured)return;if(this._pendingFitSetup){let $=this._propTweens;while($){let Q=$.next;n.release($),$=Q}this._propTweens=null,this._lastPropTween=null,this._pendingFitSetup(n),this._pendingFitSetup=null,this._startCaptured=!0;return}let J=this._propTweens;while(J){if(J.target instanceof Element){let{target:$,property:Q}=J;if(J.valueType==="color"&&t(Q)){let q=X.color?.getCurrentColor($,Q);if(q&&J.endColor)J.startColor=q,J.changeColor=new Float32Array([J.endColor[0]-q[0],J.endColor[1]-q[1],J.endColor[2]-q[2],J.endColor[3]-q[3]])}else if(J.valueType==="filter"&&l(Q)){let q=X.filter?.getCurrentFilter($);if(q&&J.endFilters){let Z=X.filter.mergeFilterArrays(q,J.endFilters);J.startFilters=Z.start,J.endFilters=Z.end}}else{let q=L0($,Q);J.startValue=q,J.change=J.endValue-J.startValue}}J=J.next}this._startCaptured=!0}getId(){return this._id}getTargets(){return this._targets}getDuration(){return this._duration}getDelay(){return this._delay}clearDelay(){this._delay=0}getFirstPropTween(){return this._propTweens}addPropTween(J){if(!this._lastPropTween)this._propTweens=J;else this._lastPropTween.next=J;this._lastPropTween=J}totalDuration(){if(this._repeat===-1)return 1/0;let $=this._duration*(this._repeat+1)+this._repeatDelay*this._repeat;return this._delay+$}reset(){this._id=0,this._targets=[],this._duration=0.5,this._delay=0,this._time=0,this._progress=0,this._timeScale=1,this._isActive=!1,this._isReversed=!1,this._easingFn=null,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this._currentRepeat=0,this._onStart=void 0,this._onUpdate=void 0,this._onComplete=void 0,this._onRepeat=void 0,this._onReverseComplete=void 0,this._startFired=!1,this._completeFired=!1,this._timelineChild=!1,this._needsStartCapture=!1,this._startCaptured=!1,this._fitSetupFn=null,this._pendingFitSetup=null,this._unregisterCallback=null;let J=n,$=this._propTweens;while($){let Q=$.next;J.release($),$=Q}this._propTweens=null,this._lastPropTween=null}}var H0=new _0(()=>new HJ,100),eJ={acquire:()=>H0.acquire(),release:(J)=>H0.release(J),getPoolSize:()=>H0.getPoolSize(),getTotalCreated:()=>H0.getTotalCreated(),clear:()=>H0.clear()};class b{static instance;animations=[];animationIdToIndex=new Map;nextAnimationId=1;totalCreated=0;_animationSnapshot=[];timelines=new Map;ticker;animationPool;propTweenPool;constructor(){this.ticker=w.getInstance(),this.animationPool=eJ,this.propTweenPool=n,this.ticker.add(this.update,0)}static getInstance(){if(!b.instance)b.instance=new b,R.setEngineRegisterCallback((J,$)=>{let Q=b.instance;if(!Q.hasTimeline(J))Q.registerTimeline(J,$)}),f.setCreateAnimationCallback((J,$,Q,q,Z,j,z,G)=>{return b.instance.createAnimation(J,$,Q,q,Z,j,z,G)});return b.instance}update=(J)=>{let $=this._animationSnapshot,Q=this.animations.length;$.length=Q;for(let Z=0;Z<Q;Z++)$[Z]=this.animations[Z];let q=[];for(let Z=0,j=$.length;Z<j;Z++){let z=$[Z];if(z.isTimelineChild())continue;if(z.isActive()){if(z.update(J),!z.isActive()&&!z.isTimelineChild())q.push(z.getId())}}for(let Z of q)this.unregisterAnimation(Z);for(let Z of this.timelines.values())if(Z.isActive())Z.update(J)};createAnimation(J,$,Q,q,Z,j,z,G){let N=G?.stagger;if(N&&J.length>1)return this.createStaggeredAnimations(J,$,Q,q,Z,j,z,N,G);let W=this.animationPool.acquire(),_=this.registerAnimation(W);if(W.init(_,J,Q,q,Z,G),this.setupPropertyTweens(W,J,$,j,z),Q===0)W.render(1);else if(j&&!G?._skipInitialRender)W.render(0);return W}createStaggeredAnimations(J,$,Q,q,Z,j,z,G,N){if(!X.stagger){let B=this.animationPool.acquire(),U=this.registerAnimation(B);if(B.init(U,J,Q,q,Z,N),this.setupPropertyTweens(B,J,$,j,z),Q===0)B.render(1);else if(j&&!N?._skipInitialRender)B.render(0);return[B]}let W=X.stagger.resolve(J,G),_=[];for(let B=0;B<J.length;B++){let U=J[B],Y=W[B],H=this.animationPool.acquire(),A=this.registerAnimation(H);if(H.init(A,[U],Q,q+Y,Z,N),this.setupPropertyTweens(H,[U],$,j,z),Q===0)H.render(1);else if(j&&!N?._skipInitialRender)H.render(0);_.push(H)}return _}setupPropertyTweens(J,$,Q,q,Z){let j=Object.keys(Q),z=Z?Object.keys(Z):[],G=[...new Set([...j,...z])],N=Q,W=Z,_="perspective"in N,B=W&&"perspective"in W,U=_&&B;for(let Y of $){if(!U&&(_||B)&&Y instanceof Element){let H=_?N.perspective:W.perspective,A=typeof H==="number"?H:parseFloat(String(H))||0;if(A>0)P(Y,"perspective",A,"px"),Y.style.transform=E(Y)}for(let H of G){if(H==="perspective"&&!U)continue;let A=N[H],K=SJ(Y,H,A,W?W[H]:void 0),M=this.propTweenPool.acquire(),k=q&&!Z;switch(K.type){case"color":{let L=k?K.endColor:K.startColor,O=k?K.startColor:K.endColor;M.initColor(Y,H,L,O);break}case"filter":{let L=k?K.endFilters:K.startFilters,O=k?K.startFilters:K.endFilters;M.initFilter(Y,H,L,O);break}case"scalar":{let L=k?K.endValue:K.startValue,O=k?K.startValue:K.endValue;M.init(Y,H,L,O,K.unit);break}case"drawSVG":{let L=k?K.endDraw:K.startDraw,O=k?K.startDraw:K.endDraw;M.initDrawSVG(Y,H,L,O,K.length);break}case"path":{let L=k?K.endProgress:K.startProgress,O=k?K.startProgress:K.endProgress;M.initPath(Y,H,K.pathData,K.pathLength,L,O,K.rotate,K.alignOffset,K.pathOffset);break}}J.addPropTween(M)}}}registerAnimation(J){let $=this.nextAnimationId++,Q=this.animations.length;return this.animations.push(J),this.animationIdToIndex.set($,Q),this.totalCreated++,J.setUnregisterCallback(()=>this.unregisterAnimation($)),$}unregisterAnimation(J){let $=this.animationIdToIndex.get(J);if($===void 0)return;let Q=this.animations[$],q=this.animations.length-1;if($!==q){let Z=this.animations[q];this.animations[$]=Z,this.animationIdToIndex.set(Z.getId(),$)}this.animations.pop(),this.animationIdToIndex.delete(J),this.animationPool.release(Q)}getAnimation(J){let $=this.animationIdToIndex.get(J);return $!==void 0?this.animations[$]:void 0}killAll(){let J=[...this.animations];for(let $=0,Q=J.length;$<Q;$++)J[$].kill();this.animations.length=0,this.animationIdToIndex.clear()}killAnimationsForTargets(J){if(J.length===0)return;let $=new Set(J),Q=[];for(let q=0,Z=this.animations.length;q<Z;q++){let j=this.animations[q],z=j.getTargets();for(let G of z)if(G instanceof Element&&$.has(G)){Q.push(j);break}}for(let q of Q)q.kill()}getActiveCount(){let J=0;for(let $=0,Q=this.animations.length;$<Q;$++)if(this.animations[$].isActive())J++;return J}getTotalCreated(){return this.totalCreated}getTimeline(J){let $=this.timelines.get(J);if(!$){if($=new R(J),!this.timelines.has(J))this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}return $}hasTimeline(J){return this.timelines.has(J)}registerTimeline(J,$){this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}getTimelineCount(){return this.timelines.size}getTimelineNames(){return Array.from(this.timelines.keys())}removeTimeline(J){this.timelines.delete(J)}killAllTimelines(){for(let J of this.timelines.values())J.kill();this.timelines.clear()}killEverything(){this.killAllTimelines(),this.killAll(),wJ()}getAnimationPool(){return this.animationPool}getPropTweenPool(){return this.propTweenPool}getPoolStats(){return{animations:this.animationPool.getPoolSize(),propTweens:this.propTweenPool.getPoolSize()}}clearPools(){this.animationPool.clear(),this.propTweenPool.clear()}getMemoryEstimate(){let J=this.animations.length,$=this.animationPool.getPoolSize(),Q=this.propTweenPool.getPoolSize();return(J+$)*500+Q*100}getTicker(){return this.ticker}}function E7(J,$){if(typeof J==="string"){let Q=$||(typeof document<"u"?document:null);if(!Q)return[];try{return Array.from(Q.querySelectorAll(J))}catch{return[]}}if(typeof Element<"u"&&J instanceof Element)return[J];if(typeof NodeList<"u"&&J instanceof NodeList||typeof HTMLCollection<"u"&&J instanceof HTMLCollection)return Array.from(J);if(Array.isArray(J))return J;if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}function R7(J,$,Q){if(Q===void 0)return(q)=>Math.min($,Math.max(J,q));return Math.min($,Math.max(J,Q))}function b7(J,$,Q){let q=J+Math.random()*($-J);if(Q&&Q>0)return Math.round(q/Q)*Q;return q}function w7(J,$){let Q=(q)=>{if(typeof J==="number"){if(J<=0)return q;return Math.round(q/J)*J}let Z=J,j=Z[0],z=Math.abs(q-j);for(let G=1;G<Z.length;G++){let N=Math.abs(q-Z[G]);if(N<z)z=N,j=Z[G]}return j};if($===void 0)return Q;return Q($)}function C7(J,$,Q){return J+($-J)*Q}function x7(J,$,Q,q,Z){let j=(z)=>{let G=(z-J)/($-J);return Q+G*(q-Q)};if(Z===void 0)return j;return j(Z)}function V7(J,$,Q){let q=(Z)=>(Z-J)/($-J);if(Q===void 0)return q;return q(Q)}function S7(J,$,Q){let q=$-J,Z=(j)=>{return((j-J)%q+q)%q+J};if(Q===void 0)return Z;return Z(Q)}var S0={toArray:E7,clamp:R7,random:b7,snap:w7,interpolate:C7,mapRange:x7,normalize:V7,wrap:S7};function u(J,$,Q){let Z=b.getInstance().getTimeline(J);if($!==void 0&&Z.duration()>0)console.warn(`[Motion] Timeline "${J}" already has animations. New entries will be appended. Call Motion("${J}").kill() first to rebuild from scratch.`);if(Array.isArray($)&&$.length>0&&typeof $[0]==="object"&&$[0]!==null&&"target"in $[0])for(let j of $)Z._addEntry(j.target,j,j.position);else if($!==void 0&&Q!==void 0)Z._addEntry($,Q);return Z}u.reset=function(J){b.getInstance();let $=X0(J),Q=[];for(let q of $)if(q instanceof Element)Q.push(q);if(Q.length>0)b.getInstance().killAnimationsForTargets(Q);for(let q of $){if(!(q instanceof Element))continue;if(X.textSplitter?.isSplit?.(q))X.textSplitter?.revert?.(q);y(q),X.styleReset?.clearAnimationStylesAndUnregister?.(q),X.styleReset?.clearPinStylesAndUnregister?.(q)}};u.set=function(J,$){b.getInstance();let Q=new R;Q._addEntry(J,{to:$,duration:0}),Q.kill(!1)};u.get=function(J){let $=b.getInstance();return $.hasTimeline(J)?$.getTimeline(J):void 0};u.has=function(J){return b.getInstance().hasTimeline(J)};u.getNames=function(){return b.getInstance().getTimelineNames()};u.kill=function(J){let $=b.getInstance();if($.hasTimeline(J))$.getTimeline(J).kill()};u.killAll=function(){b.getInstance().killEverything()};u.refreshScrollTriggers=function(){X.triggerManager?.getInstance?.()?.refreshScrollTriggers()};u.cleanup=function(){if(typeof document>"u")return;document.querySelectorAll("[data-scrolltrigger-spacer]").forEach((J)=>J.remove()),document.querySelectorAll("[data-scrolltrigger-markers]").forEach((J)=>J.remove())};u.utils=S0;var J6=u;var $6={};
|
|
31
|
+
`?" ":z));else{let G=document.createElement("span");G.setAttribute("data-split-char",""),G.setAttribute("data-char-index",String($.chars.length)),G.style.display="inline-block",G.textContent=z,$.chars.push(G),j.appendChild(G)}J.replaceChild(j,q)}else if(q.nodeType===1){let Z=q;if(Z.tagName==="BR")continue;this._splitCharsDom(Z,$)}}static _splitWordsWithCharsDom(J,$){let Q=Array.from(J.childNodes);for(let q of Q)if(q.nodeType===3){let Z=q.textContent||"";if(!Z)continue;let j=Z.split(/(\s+)/),z=document.createDocumentFragment();for(let G of j)if(/^\s+$/.test(G))z.appendChild(document.createTextNode(G.replace(/\n/g," ")));else if(G){let W=document.createElement("span");W.setAttribute("data-split-word",""),W.setAttribute("data-word-index",String($.words.length)),W.style.display="inline-block",W.style.whiteSpace="nowrap";for(let N of G){let B=document.createElement("span");B.setAttribute("data-split-char",""),B.setAttribute("data-char-index",String($.chars.length)),B.style.display="inline-block",B.textContent=N,$.chars.push(B),W.appendChild(B)}$.words.push(W),z.appendChild(W)}J.replaceChild(z,q)}else if(q.nodeType===1){let Z=q;if(Z.tagName==="BR")continue;this._splitWordsWithCharsDom(Z,$)}}static _splitWithLinesDom(J,$,Q,q){let Z={chars:[],words:[],lines:[],elements:[]};this._splitWordsDom(J,Z);let j=[],z=[],G=-1/0;for(let _ of Z.words){let H=_.getBoundingClientRect();if(H.top>G+2){if(z.length>0)j.push(z);z=[_],G=H.top}else z.push(_)}if(z.length>0)j.push(z);let W=new Map;for(let _ of Z.words)W.set(_,this._getWrapperChain(_,J));let N="",B=0,Y=0,U=0;for(let _ of j){let H="",A=[];for(let K=0;K<_.length;K++){let M=_[K],k=M.textContent||"",L=W.get(M)||[],O=0;while(O<A.length&&O<L.length&&A[O]===L[O])O++;for(let y=A.length-1;y>=O;y--)H+=`</${A[y].tagName.toLowerCase()}>`;if(K>0)H+=" ";for(let y=O;y<L.length;y++)H+=this._openTag(L[y]);if(Q){let y="";for(let P0 of k)y+=`<span data-split-char data-char-index="${U}" style="display:inline-block">${this._escapeHtml(P0)}</span>`,U++;if($)H+=`<span data-split-word data-word-index="${Y}" style="display:inline-block;white-space:nowrap">${y}</span>`;else H+=y}else if($)H+=`<span data-split-word data-word-index="${Y}" style="display:inline-block">${this._escapeHtml(k)}</span>`;else H+=this._escapeHtml(k);Y++,A=L}for(let K=A.length-1;K>=0;K--)H+=`</${A[K].tagName.toLowerCase()}>`;N+=`<span data-split-line data-line-index="${B}" style="display:block">${H}</span>`,B++}if(J.innerHTML=N,Q)q.chars=Array.from(J.querySelectorAll("[data-split-char]"));if($)q.words=Array.from(J.querySelectorAll("[data-split-word]"));q.lines=Array.from(J.querySelectorAll("[data-split-line]"))}static _applyMaskWrappers(J){let $=J.elements;for(let Q of $){let q=Q.hasAttribute("data-split-line"),Z=Q.hasAttribute("data-split-word"),j=document.createElement("span");if(j.setAttribute("data-split-mask",""),j.style.overflow="hidden",j.style.display=q?"block":"inline-block",!q)j.style.verticalAlign=Z?"bottom":"bottom";Q.parentNode.insertBefore(j,Q),j.appendChild(Q)}}static revert(J){let $=w0.get(J);if($!==void 0&&J instanceof HTMLElement)return J.innerHTML=$,J.removeAttribute("data-split"),w0.delete(J),x0.delete(J),!0;return!1}static isSplit(J){return J.hasAttribute("data-split")}static getResult(J){return x0.get(J)}static _getWrapperChain(J,$){let Q=[],q=J.parentElement;while(q&&q!==$)Q.unshift(q),q=q.parentElement;return Q}static _openTag(J){let $=J.tagName.toLowerCase(),Q="";for(let q of Array.from(J.attributes))Q+=` ${q.name}="${this._escapeHtml(q.value)}"`;return`<${$}${Q}>`}static _escapeHtml(J){return J.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}}X.textSplitter={split:(J,$,Q)=>C0.split(J,$,Q),revert:C0.revert,isSplit:C0.isSplit};class lJ{static resolve(J,$){if(J.length===0)return[];if(J.length===1)return[0];if(typeof $==="number")return J.map((Q,q)=>q*$);return this.resolveComplexStagger(J,$)}static resolveComplexStagger(J,$){let Q=J.length;if(Q===1)return[0];let q;if($.each!==void 0)q=$.each;else if($.amount!==void 0)q=$.amount/(Q-1);else q=0.1;let Z=this.getOrdering(J,$),j=Array(Q);for(let z=0;z<Q;z++)j[Z[z].originalIndex]=Z[z].order*q;return j}static getOrdering(J,$){let Q=J.length,q=$.from??"start";if($.grid)return this.getGridOrdering(J,$);switch(q){case"start":return J.map((Z,j)=>({originalIndex:j,order:j}));case"end":return J.map((Z,j)=>({originalIndex:j,order:Q-1-j}));case"center":{let Z=Math.floor(Q/2);return J.map((j,z)=>{let G=Math.abs(z-Z);return{originalIndex:z,order:G}})}case"edges":return J.map((Z,j)=>{let z=Math.min(j,Q-1-j);return{originalIndex:j,order:z}});case"random":{let Z=J.map((j,z)=>({originalIndex:z,order:Math.random()}));return Z.sort((j,z)=>j.order-z.order),Z.forEach((j,z)=>{j.order=z}),Z}default:if(typeof q==="number"){let Z=Math.max(0,Math.min(Q-1,q));return J.map((j,z)=>{let G=Math.abs(z-Z);return{originalIndex:z,order:G}})}return J.map((Z,j)=>({originalIndex:j,order:j}))}}static getGridOrdering(J,$){let Q,q;if($.grid==="auto"){let G=this.detectGrid(J);Q=G.cols,q=G.rows}else[Q,q]=$.grid;let Z=$.from??"start",j=$.axis??"x",z=J.map((G,W)=>{let N=W%Q,B=Math.floor(W/Q);return{originalIndex:W,col:N,row:B}});if(Z==="random"){let G=z.map((W)=>({originalIndex:W.originalIndex,order:Math.random()}));return G.sort((W,N)=>W.order-N.order),G.forEach((W,N)=>{W.order=N}),G}return z.map((G)=>{let W;if(typeof Z==="number"){let N=Z%Q,B=Math.floor(Z/Q);W=j==="x"?Math.abs(G.col-N)+Math.abs(G.row-B)*0.5:Math.abs(G.row-B)+Math.abs(G.col-N)*0.5}else if(Z==="center"){let N=(Q-1)/2,B=(q-1)/2;W=Math.abs(G.col-N)+Math.abs(G.row-B)}else if(Z==="edges"){let N=Math.min(G.col,Q-1-G.col),B=Math.min(G.row,q-1-G.row);W=Math.min(N,B)}else if(Z==="end")W=j==="x"?(q-1-G.row)*Q+(Q-1-G.col):(Q-1-G.col)*q+(q-1-G.row);else W=j==="x"?G.row*Q+G.col:G.col*q+G.row;return{originalIndex:G.originalIndex,order:W}})}static detectGrid(J){if(J.length===0)return{cols:0,rows:0};let $=J.filter((j)=>j instanceof Element);if($.length===0)return{cols:J.length,rows:1};let Q=new Map;$.forEach((j)=>{let z=j.getBoundingClientRect(),G=Math.round(z.top);Q.set(G,(Q.get(G)||0)+1)});let q=Q.size;return{cols:Math.ceil(J.length/q),rows:q}}}X.stagger={resolve:(J,$)=>lJ.resolve(J,$)};function M7(J,$,Q){if(!(J instanceof HTMLElement))return console.warn("[Motion Fit] Fit animations only support HTML elements. SVG elements are not supported."),null;let q=document.querySelector($);if(!q)return console.warn(`[Motion Fit] Target element not found: "${$}". Animation skipped.`),null;if(!(q instanceof HTMLElement))return console.warn("[Motion Fit] Fit animations only support HTML elements. SVG elements are not supported."),null;if(q===J)return console.warn("[Motion Fit] Target element is the same as source element. Animation skipped."),null;let Z=J.getBoundingClientRect(),j=q.getBoundingClientRect(),z=Z.width===0?1:Z.width,G=Z.height===0?1:Z.height,W=Z.left+z/2,N=Z.top+G/2,B=j.left+j.width/2,Y=j.top+j.height/2,U=B-W,_=Y-N,H=j.width/z,A=j.height/G;if(!Q)return{dx:U,dy:_,sx:H,sy:A,sourceWidth:Z.width,sourceHeight:Z.height,targetWidth:j.width,targetHeight:j.height};let K=J.offsetParent??document.documentElement,M=K.getBoundingClientRect(),k=K.scrollLeft??0,L=K.scrollTop??0;return{dx:U,dy:_,sx:H,sy:A,sourceWidth:Z.width,sourceHeight:Z.height,targetWidth:j.width,targetHeight:j.height,sourceLeft:J.offsetLeft,sourceTop:J.offsetTop,targetLeft:j.left-M.left+k,targetTop:j.top-M.top+L}}var s=0.01,iJ=0.001;function k7(J,$,Q,q){let{absolute:Z=!1,scale:j=!0,resize:z=!1}=Q;if($ instanceof HTMLElement){if(P($,!0),z)$.style.width="",$.style.height="";if(Z)$.style.width="",$.style.height="",$.style.left="",$.style.top=""}let G=M7($,Q.target,Z);if(!G)return;if(!Z)if(z){let W=G.dx-(G.targetWidth-G.sourceWidth)/2,N=G.dy-(G.targetHeight-G.sourceHeight)/2;if(Math.abs(W)>s){let B=q.acquire();B.init($,"x",0,W,"px"),J.addPropTween(B)}if(Math.abs(N)>s){let B=q.acquire();B.init($,"y",0,N,"px"),J.addPropTween(B)}if(Math.abs(G.targetWidth-G.sourceWidth)>s){let B=q.acquire();B.init($,"width",G.sourceWidth,G.targetWidth,"px"),J.addPropTween(B)}if(Math.abs(G.targetHeight-G.sourceHeight)>s){let B=q.acquire();B.init($,"height",G.sourceHeight,G.targetHeight,"px"),J.addPropTween(B)}}else{if(Math.abs(G.dx)>s){let W=q.acquire();W.init($,"x",0,G.dx,"px"),J.addPropTween(W)}if(Math.abs(G.dy)>s){let W=q.acquire();W.init($,"y",0,G.dy,"px"),J.addPropTween(W)}if(j){if(Math.abs(G.sx-1)>iJ){let W=q.acquire();W.init($,"scaleX",1,G.sx,""),J.addPropTween(W)}if(Math.abs(G.sy-1)>iJ){let W=q.acquire();W.init($,"scaleY",1,G.sy,""),J.addPropTween(W)}}}else{let W=$;if(window.getComputedStyle(W).position==="static")W.style.position="absolute";let{sourceLeft:B,sourceTop:Y,targetLeft:U,targetTop:_}=G;if(Math.abs(U-B)>s){let H=q.acquire();H.init($,"left",B,U,"px"),J.addPropTween(H)}if(Math.abs(_-Y)>s){let H=q.acquire();H.init($,"top",Y,_,"px"),J.addPropTween(H)}if(j){if(Math.abs(G.targetWidth-G.sourceWidth)>s){let H=q.acquire();H.init($,"width",G.sourceWidth,G.targetWidth,"px"),J.addPropTween(H)}if(Math.abs(G.targetHeight-G.sourceHeight)>s){let H=q.acquire();H.init($,"height",G.sourceHeight,G.targetHeight,"px"),J.addPropTween(H)}}}}function D7(J,$,Q,q){J.setPendingFitSetup((Z)=>k7(J,$,Q,Z)),J.setLazyStartCapture(!0)}X.fit={registerPendingSetup:D7};var rJ=(J)=>J,E7=rJ,V0={in:(J)=>J*J,out:(J)=>J*(2-J),inOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J},jJ={in:(J)=>J*J*J,out:(J)=>--J*J*J+1,inOut:(J)=>J<0.5?4*J*J*J:(J-1)*(2*J-2)*(2*J-2)+1},GJ={in:(J)=>J*J*J*J,out:(J)=>1- --J*J*J*J,inOut:(J)=>J<0.5?8*J*J*J*J:1-8*--J*J*J*J},zJ={in:(J)=>J*J*J*J*J,out:(J)=>1+--J*J*J*J*J,inOut:(J)=>J<0.5?16*J*J*J*J*J:1+16*--J*J*J*J*J},WJ={in:(J)=>1-Math.cos(J*Math.PI/2),out:(J)=>Math.sin(J*Math.PI/2),inOut:(J)=>-(Math.cos(Math.PI*J)-1)/2},NJ={in:(J)=>J===0?0:Math.pow(2,10*(J-1)),out:(J)=>J===1?1:1-Math.pow(2,-10*J),inOut:(J)=>{if(J===0)return 0;if(J===1)return 1;if((J*=2)<1)return 0.5*Math.pow(2,10*(J-1));return 0.5*(2-Math.pow(2,-10*(J-1)))}},BJ={in:(J)=>1-Math.sqrt(1-J*J),out:(J)=>Math.sqrt(1- --J*J),inOut:(J)=>{if((J*=2)<1)return-0.5*(Math.sqrt(1-J*J)-1);return 0.5*(Math.sqrt(1-(J-=2)*J)+1)}};var YJ={in:(J)=>J*J*(2.70158*J-1.70158),out:(J)=>--J*J*(2.70158*J+1.70158)+1,inOut:(J)=>{if((J*=2)<1)return 0.5*(J*J*(3.5949095*J-2.5949095));return 0.5*((J-=2)*J*(3.5949095*J+2.5949095)+2)}},_J={in:(J)=>{if(J===0)return 0;if(J===1)return 1;let $=0.3,Q=$/4;return-(Math.pow(2,10*(J-=1))*Math.sin((J-Q)*(2*Math.PI)/$))},out:(J)=>{if(J===0)return 0;if(J===1)return 1;let $=0.3,Q=$/4;return Math.pow(2,-10*J)*Math.sin((J-Q)*(2*Math.PI)/$)+1},inOut:(J)=>{if(J===0)return 0;if(J===1)return 1;let $=0.44999999999999996,Q=$/4;if((J*=2)<1)return-0.5*(Math.pow(2,10*(J-=1))*Math.sin((J-Q)*(2*Math.PI)/$));return Math.pow(2,-10*(J-=1))*Math.sin((J-Q)*(2*Math.PI)/$)*0.5+1}},nJ=(J)=>{if(J<0.36363636363636365)return 7.5625*J*J;else if(J<0.7272727272727273)return 7.5625*(J-=0.5454545454545454)*J+0.75;else if(J<0.9090909090909091)return 7.5625*(J-=0.8181818181818182)*J+0.9375;else return 7.5625*(J-=0.9545454545454546)*J+0.984375},_0={in:(J)=>1-nJ(1-J),out:nJ,inOut:(J)=>{if(J<0.5)return _0.in(J*2)*0.5;return _0.out(J*2-1)*0.5+0.5}},aJ={linear:rJ,none:E7,"power1.in":V0.in,"power1.out":V0.out,"power1.inout":V0.inOut,"power2.in":jJ.in,"power2.out":jJ.out,"power2.inout":jJ.inOut,"power3.in":GJ.in,"power3.out":GJ.out,"power3.inout":GJ.inOut,"power4.in":zJ.in,"power4.out":zJ.out,"power4.inout":zJ.inOut,"sine.in":WJ.in,"sine.out":WJ.out,"sine.inout":WJ.inOut,"expo.in":NJ.in,"expo.out":NJ.out,"expo.inout":NJ.inOut,"circ.in":BJ.in,"circ.out":BJ.out,"circ.inout":BJ.inOut,"back.in":YJ.in,"back.out":YJ.out,"back.inout":YJ.inOut,"elastic.in":_J.in,"elastic.out":_J.out,"elastic.inout":_J.inOut,"bounce.in":_0.in,"bounce.out":_0.out,"bounce.inout":_0.inOut};function tJ(J){let $=J.toLowerCase();if(!aJ[$])console.warn(`[Motion] Unknown easing "${J}". Falling back to "power1.out". Valid easings: linear, power1-4.in/out/inOut, sine, expo, circ, back, elastic, bounce`);return aJ[$]||V0.out}class HJ{_id=0;_targets=[];_duration=0.5;_delay=0;_time=0;_progress=0;_timeScale=1;_isActive=!1;_isReversed=!1;_propTweens=null;_lastPropTween=null;_easingFn=null;_repeat=0;_repeatDelay=0;_yoyo=!1;_currentRepeat=0;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_startFired=!1;_completeFired=!1;_timelineChild=!1;_needsStartCapture=!1;_startCaptured=!1;_fitSetupFn=null;_pendingFitSetup=null;_unregisterCallback=null;init(J,$,Q,q,Z,j){return this._id=J,this._targets=$,this._duration=Q,this._delay=q,this._easingFn=tJ(Z),this._time=0,this._progress=0,this._timeScale=1,this._isActive=!1,this._isReversed=!1,this._startFired=!1,this._completeFired=!1,this._currentRepeat=0,this._repeat=j?.repeat??0,this._repeatDelay=j?.repeatDelay??0,this._yoyo=j?.yoyo??!1,this._onStart=j?.onStart,this._onUpdate=j?.onUpdate,this._onComplete=j?.onComplete,this._onRepeat=j?.onRepeat,this._onReverseComplete=j?.onReverseComplete,this}update(J){if(!this._isActive)return;let $=J*this._timeScale;if(this._time+=this._isReversed?-$:$,!this._isReversed&&this._time<0){this._time=0;return}let Q=Math.max(0,this._time-this._delay);if(this._progress=this._duration>0?Math.min(1,Q/this._duration):1,!this._startFired&&this._progress>0)this._startFired=!0,this._onStart?.();if(this.render(this._progress),this._onUpdate?.(this._progress),this._isReversed){if(this._time<=0)this.handleComplete()}else if(this._progress>=1)this.handleComplete()}render(J){let $=this.applyEasing(J),Q=this._propTweens;while(Q)Q.render($),Q=Q.next}renderAtTime(J){let $=Math.max(0,J),Q=this._duration,q=this._delay,Z=this._currentRepeat;if(Q===0){let j=$>=q?1:0;this._time=$,this._progress=j,this.render(j)}else{let j=Math.max(0,$-q);if(this._repeat===0){let z=Math.min(1,j/Q);this._time=Math.min(Q,j),this._progress=z,this.render(z)}else{let z=this._repeatDelay,G=Q+z,W=this._repeat===-1?1/0:Q*(this._repeat+1)+z*this._repeat,N=this._repeat===-1?j:Math.min(j,W),B=G>0?Math.floor(N/G):0,Y=N-B*G,U=Y>Q,_=Q>0?Math.min(1,Y/Q):1,H=this._yoyo&&B%2===1;if(U)_=H?0:1;else if(H)_=1-_;this._currentRepeat=this._repeat===-1?B:Math.min(B,this._repeat),this._isReversed=H,this._progress=_,this._time=Q*_,this.render(_)}}if(this._isActive){if(!this._startFired){this._startFired=!0;try{this._onStart?.()}catch(j){console.error("[Motion] onStart callback error:",j)}}try{this._onUpdate?.(this._progress)}catch(j){console.error("[Motion] onUpdate callback error:",j)}if(this._currentRepeat>Z)try{this._onRepeat?.(this._currentRepeat)}catch(j){console.error("[Motion] onRepeat callback error:",j)}if(!this._completeFired&&this._repeat!==-1){if($>=this.totalDuration()){this._completeFired=!0;try{this._onComplete?.()}catch(j){console.error("[Motion] onComplete callback error:",j)}}}}}applyEasing(J){if(!this._easingFn)return J;return this._easingFn(J)}handleComplete(){if(this._repeat===-1||this._currentRepeat<this._repeat){if(this._currentRepeat++,this._onRepeat?.(this._currentRepeat),this._yoyo)this._isReversed=!this._isReversed,this._time=this._isReversed?this._duration+this._delay:0;else this._time=0,this._startFired=!1;this._time-=this._repeatDelay;return}if(this._isReversed)this._onReverseComplete?.();else this._onComplete?.();this._isActive=!1}play(J){if(J!==void 0)return this.seek(J),this._isActive=!0,this._isReversed=!1,this;if(this._isActive&&!this._isReversed)return this;return this._isActive=!0,this._isReversed=!1,this}pause(J){if(J!==void 0){this._time=J;let $=Math.max(0,this._time-this._delay);this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress)}return this._isActive=!1,this}reverse(J){if(J!==void 0)this.seek(J);return this._isActive=!0,this._isReversed=!0,this}restart(J=!0){return this._time=J?0:this._delay,this._progress=0,this._isActive=!0,this._isReversed=!1,this._startFired=!1,this._currentRepeat=0,this.render(0),this}seek(J){this._time=J;let $=Math.max(0,this._time-this._delay);return this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress),this}progress(J){if(J===void 0)return this._progress;if(this._progress=Math.max(0,Math.min(1,J)),this._progress===0)this._time=0;else this._time=this._progress*this._duration+this._delay;return this.render(this._progress),this}time(J){if(J===void 0)return this._time;this._time=J;let $=Math.max(0,this._time-this._delay);return this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress),this}timeScale(J){if(J===void 0)return this._timeScale;return this._timeScale=J,this}getTimeScale(){return this._timeScale}kill(){this._isActive=!1,this._unregisterCallback?.()}isActive(){return this._isActive}isTimelineChild(){return this._timelineChild}setTimelineChild(J){this._timelineChild=J}setLazyStartCapture(J){this._needsStartCapture=J,this._startCaptured=!1}setPendingFitSetup(J){this._fitSetupFn=J,this._pendingFitSetup=J}resetForReplay(){if(this._fitSetupFn)this._pendingFitSetup=this._fitSetupFn,this._startCaptured=!1;this._startFired=!1,this._completeFired=!1}needsStartCapture(){return this._needsStartCapture&&!this._startCaptured}isLazyCapture(){return this._needsStartCapture}fireReverseComplete(){try{this._onReverseComplete?.()}catch(J){console.error("[Motion] onReverseComplete callback error:",J)}this._startFired=!1,this._completeFired=!1}setUnregisterCallback(J){this._unregisterCallback=J}captureStartValues(){if(!this._needsStartCapture||this._startCaptured)return;if(this._pendingFitSetup){let $=this._propTweens;while($){let Q=$.next;n.release($),$=Q}this._propTweens=null,this._lastPropTween=null,this._pendingFitSetup(n),this._pendingFitSetup=null,this._startCaptured=!0;return}let J=this._propTweens;while(J){if(J.target instanceof Element){let{target:$,property:Q}=J;if(J.valueType==="color"&&t(Q)){let q=X.color?.getCurrentColor($,Q);if(q&&J.endColor)J.startColor=q,J.changeColor=new Float32Array([J.endColor[0]-q[0],J.endColor[1]-q[1],J.endColor[2]-q[2],J.endColor[3]-q[3]])}else if(J.valueType==="filter"&&l(Q)){let q=X.filter?.getCurrentFilter($);if(q&&J.endFilters){let Z=X.filter.mergeFilterArrays(q,J.endFilters);J.startFilters=Z.start,J.endFilters=Z.end}}else{let q=L0($,Q);J.startValue=q,J.change=J.endValue-J.startValue}}J=J.next}this._startCaptured=!0}getId(){return this._id}getTargets(){return this._targets}getDuration(){return this._duration}getDelay(){return this._delay}clearDelay(){this._delay=0}getFirstPropTween(){return this._propTweens}addPropTween(J){if(!this._lastPropTween)this._propTweens=J;else this._lastPropTween.next=J;this._lastPropTween=J}totalDuration(){if(this._repeat===-1)return 1/0;let $=this._duration*(this._repeat+1)+this._repeatDelay*this._repeat;return this._delay+$}reset(){this._id=0,this._targets=[],this._duration=0.5,this._delay=0,this._time=0,this._progress=0,this._timeScale=1,this._isActive=!1,this._isReversed=!1,this._easingFn=null,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this._currentRepeat=0,this._onStart=void 0,this._onUpdate=void 0,this._onComplete=void 0,this._onRepeat=void 0,this._onReverseComplete=void 0,this._startFired=!1,this._completeFired=!1,this._timelineChild=!1,this._needsStartCapture=!1,this._startCaptured=!1,this._fitSetupFn=null,this._pendingFitSetup=null,this._unregisterCallback=null;let J=n,$=this._propTweens;while($){let Q=$.next;J.release($),$=Q}this._propTweens=null,this._lastPropTween=null}}var H0=new B0(()=>new HJ,100),eJ={acquire:()=>H0.acquire(),release:(J)=>H0.release(J),getPoolSize:()=>H0.getPoolSize(),getTotalCreated:()=>H0.getTotalCreated(),clear:()=>H0.clear()};class b{static instance;animations=[];animationIdToIndex=new Map;nextAnimationId=1;totalCreated=0;_animationSnapshot=[];timelines=new Map;ticker;animationPool;propTweenPool;constructor(){this.ticker=w.getInstance(),this.animationPool=eJ,this.propTweenPool=n,this.ticker.add(this.update,0)}static getInstance(){if(!b.instance)b.instance=new b,R.setEngineRegisterCallback((J,$)=>{let Q=b.instance;if(!Q.hasTimeline(J))Q.registerTimeline(J,$)}),f.setCreateAnimationCallback((J,$,Q,q,Z,j,z,G)=>{return b.instance.createAnimation(J,$,Q,q,Z,j,z,G)});return b.instance}update=(J)=>{let $=this._animationSnapshot,Q=this.animations.length;$.length=Q;for(let Z=0;Z<Q;Z++)$[Z]=this.animations[Z];let q=[];for(let Z=0,j=$.length;Z<j;Z++){let z=$[Z];if(z.isTimelineChild())continue;if(z.isActive()){if(z.update(J),!z.isActive()&&!z.isTimelineChild())q.push(z.getId())}}for(let Z of q)this.unregisterAnimation(Z);for(let Z of this.timelines.values())if(Z.isActive())Z.update(J)};createAnimation(J,$,Q,q,Z,j,z,G){let W=G?.stagger;if(W&&J.length>1)return this.createStaggeredAnimations(J,$,Q,q,Z,j,z,W,G);let N=this.animationPool.acquire(),B=this.registerAnimation(N);if(N.init(B,J,Q,q,Z,G),this.setupPropertyTweens(N,J,$,j,z),Q===0)N.render(1);else if(j&&!G?._skipInitialRender)N.render(0);return N}createStaggeredAnimations(J,$,Q,q,Z,j,z,G,W){if(!X.stagger){let Y=this.animationPool.acquire(),U=this.registerAnimation(Y);if(Y.init(U,J,Q,q,Z,W),this.setupPropertyTweens(Y,J,$,j,z),Q===0)Y.render(1);else if(j&&!W?._skipInitialRender)Y.render(0);return[Y]}let N=X.stagger.resolve(J,G),B=[];for(let Y=0;Y<J.length;Y++){let U=J[Y],_=N[Y],H=this.animationPool.acquire(),A=this.registerAnimation(H);if(H.init(A,[U],Q,q+_,Z,W),this.setupPropertyTweens(H,[U],$,j,z),Q===0)H.render(1);else if(j&&!W?._skipInitialRender)H.render(0);B.push(H)}return B}setupPropertyTweens(J,$,Q,q,Z){let j=Object.keys(Q),z=Z?Object.keys(Z):[],G=[...new Set([...j,...z])],W=Q,N=Z,B="perspective"in W,Y=N&&"perspective"in N,U=B&&Y;for(let _ of $){if(!U&&(B||Y)&&_ instanceof Element){let H=B?W.perspective:N.perspective,A=typeof H==="number"?H:parseFloat(String(H))||0;if(A>0)S(_,"perspective",A,"px"),_.style.transform=E(_)}for(let H of G){if(H==="perspective"&&!U)continue;let A=W[H],K=SJ(_,H,A,N?N[H]:void 0),M=this.propTweenPool.acquire(),k=q&&!Z;switch(K.type){case"color":{let L=k?K.endColor:K.startColor,O=k?K.startColor:K.endColor;M.initColor(_,H,L,O);break}case"filter":{let L=k?K.endFilters:K.startFilters,O=k?K.startFilters:K.endFilters;M.initFilter(_,H,L,O);break}case"scalar":{let L=k?K.endValue:K.startValue,O=k?K.startValue:K.endValue;M.init(_,H,L,O,K.unit);break}case"drawSVG":{let L=k?K.endDraw:K.startDraw,O=k?K.startDraw:K.endDraw;M.initDrawSVG(_,H,L,O,K.length);break}case"path":{let L=k?K.endProgress:K.startProgress,O=k?K.startProgress:K.endProgress;M.initPath(_,H,K.pathData,K.pathLength,L,O,K.rotate,K.alignOffset,K.pathOffset);break}}J.addPropTween(M)}}}registerAnimation(J){let $=this.nextAnimationId++,Q=this.animations.length;return this.animations.push(J),this.animationIdToIndex.set($,Q),this.totalCreated++,J.setUnregisterCallback(()=>this.unregisterAnimation($)),$}unregisterAnimation(J){let $=this.animationIdToIndex.get(J);if($===void 0)return;let Q=this.animations[$],q=this.animations.length-1;if($!==q){let Z=this.animations[q];this.animations[$]=Z,this.animationIdToIndex.set(Z.getId(),$)}this.animations.pop(),this.animationIdToIndex.delete(J),this.animationPool.release(Q)}getAnimation(J){let $=this.animationIdToIndex.get(J);return $!==void 0?this.animations[$]:void 0}killAll(){let J=[...this.animations];for(let $=0,Q=J.length;$<Q;$++)J[$].kill();this.animations.length=0,this.animationIdToIndex.clear()}killAnimationsForTargets(J){if(J.length===0)return;let $=new Set(J),Q=[];for(let q=0,Z=this.animations.length;q<Z;q++){let j=this.animations[q],z=j.getTargets();for(let G of z)if(G instanceof Element&&$.has(G)){Q.push(j);break}}for(let q of Q)q.kill()}getActiveCount(){let J=0;for(let $=0,Q=this.animations.length;$<Q;$++)if(this.animations[$].isActive())J++;return J}getTotalCreated(){return this.totalCreated}getTimeline(J){let $=this.timelines.get(J);if(!$){if($=new R(J),!this.timelines.has(J))this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}return $}hasTimeline(J){return this.timelines.has(J)}registerTimeline(J,$){this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}getTimelineCount(){return this.timelines.size}getTimelineNames(){return Array.from(this.timelines.keys())}removeTimeline(J){this.timelines.delete(J)}killAllTimelines(){for(let J of this.timelines.values())J.kill();this.timelines.clear()}killEverything(){this.killAllTimelines(),this.killAll(),wJ()}getAnimationPool(){return this.animationPool}getPropTweenPool(){return this.propTweenPool}getPoolStats(){return{animations:this.animationPool.getPoolSize(),propTweens:this.propTweenPool.getPoolSize()}}clearPools(){this.animationPool.clear(),this.propTweenPool.clear()}getMemoryEstimate(){let J=this.animations.length,$=this.animationPool.getPoolSize(),Q=this.propTweenPool.getPoolSize();return(J+$)*500+Q*100}getTicker(){return this.ticker}}function R7(J,$){if(typeof J==="string"){let Q=$||(typeof document<"u"?document:null);if(!Q)return[];try{return Array.from(Q.querySelectorAll(J))}catch{return[]}}if(typeof Element<"u"&&J instanceof Element)return[J];if(typeof NodeList<"u"&&J instanceof NodeList||typeof HTMLCollection<"u"&&J instanceof HTMLCollection)return Array.from(J);if(Array.isArray(J))return J;if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}function b7(J,$,Q){if(Q===void 0)return(q)=>Math.min($,Math.max(J,q));return Math.min($,Math.max(J,Q))}function w7(J,$,Q){let q=J+Math.random()*($-J);if(Q&&Q>0)return Math.round(q/Q)*Q;return q}function x7(J,$){let Q=(q)=>{if(typeof J==="number"){if(J<=0)return q;return Math.round(q/J)*J}let Z=J,j=Z[0],z=Math.abs(q-j);for(let G=1;G<Z.length;G++){let W=Math.abs(q-Z[G]);if(W<z)z=W,j=Z[G]}return j};if($===void 0)return Q;return Q($)}function C7(J,$,Q){return J+($-J)*Q}function V7(J,$,Q,q,Z){let j=(z)=>{let G=(z-J)/($-J);return Q+G*(q-Q)};if(Z===void 0)return j;return j(Z)}function S7(J,$,Q){let q=(Z)=>(Z-J)/($-J);if(Q===void 0)return q;return q(Q)}function P7(J,$,Q){let q=$-J,Z=(j)=>{return((j-J)%q+q)%q+J};if(Q===void 0)return Z;return Z(Q)}var S0={toArray:R7,clamp:b7,random:w7,snap:x7,interpolate:C7,mapRange:V7,normalize:S7,wrap:P7};function u(J,$,Q){let Z=b.getInstance().getTimeline(J);if($!==void 0&&Z.duration()>0)console.warn(`[Motion] Timeline "${J}" already has animations. New entries will be appended. Call Motion("${J}").kill() first to rebuild from scratch.`);if(Array.isArray($)&&$.length>0&&typeof $[0]==="object"&&$[0]!==null&&"target"in $[0])for(let j of $)Z._addEntry(j.target,j,j.position);else if($!==void 0&&Q!==void 0)Z._addEntry($,Q);return Z}u.reset=function(J){b.getInstance();let $=X0(J),Q=[];for(let q of $)if(q instanceof Element)Q.push(q);if(Q.length>0)b.getInstance().killAnimationsForTargets(Q);for(let q of $){if(!(q instanceof Element))continue;if(X.textSplitter?.isSplit?.(q))X.textSplitter?.revert?.(q);P(q),X.styleReset?.clearAnimationStylesAndUnregister?.(q),X.styleReset?.clearPinStylesAndUnregister?.(q)}};u.set=function(J,$){b.getInstance();let Q=new R;Q._addEntry(J,{to:$,duration:0}),Q.kill(!1)};u.get=function(J){let $=b.getInstance();return $.hasTimeline(J)?$.getTimeline(J):void 0};u.has=function(J){return b.getInstance().hasTimeline(J)};u.getNames=function(){return b.getInstance().getTimelineNames()};u.kill=function(J){let $=b.getInstance();if($.hasTimeline(J))$.getTimeline(J).kill()};u.killAll=function(){b.getInstance().killEverything()};u.refreshScrollTriggers=function(){X.triggerManager?.getInstance?.()?.refreshScrollTriggers()};u.cleanup=function(){if(typeof document>"u")return;document.querySelectorAll("[data-scrolltrigger-spacer]").forEach((J)=>J.remove()),document.querySelectorAll("[data-scrolltrigger-markers]").forEach((J)=>J.remove())};u.utils=S0;var J6=u;var $6={};
|
|
32
32
|
|
|
33
|
-
//# debugId=
|
|
33
|
+
//# debugId=DCAB72E9D421252264756E2164756E21
|
|
34
34
|
//# sourceMappingURL=index.js.map
|