/**
 * @preserve
 * @author    ThemePunch <info@themepunch.com>
 * @link      http://www.themepunch.com/
 * @copyright 2026 ThemePunch
 */
(()=>{"use strict";const t=window.SR7ScrollAnimPE||{},e=(t,n=0)=>{if(window._tpt&&_tpt.regResource&&_tpt.checkResources)return t();n>400||setTimeout(()=>e(t,n+1),50)};let n=null;let r="down",o=0,s=!1;const i=[];let l=!1;const c=()=>{l=!1;for(const t of i.slice())try{t()}catch(t){}},a=()=>{l||(l=!0,requestAnimationFrame(c))},u=t=>{i.length||(addEventListener("scroll",a,{passive:!0}),addEventListener("resize",a,{passive:!0}),addEventListener("load",a,!0)),i.push(t),t()},p=t=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)},d=()=>(window.scrollY||window.pageYOffset||0)>=Math.max(0,(document.documentElement.scrollHeight||0)-(window.innerHeight||0))-2,h=t=>{let e=0;for(let n=t;n;n=n.offsetParent)e+=n.offsetTop;return e},w=t=>({top:h(t)-(window.scrollY||window.pageYOffset||0),height:t.offsetHeight}),f=(t,e,n)=>{const i=t&&t.body;if(!i||!SR7.ANIM||!_tpt.gsap)return;const l=_tpt.gsap,c=SR7.PE&&SR7.PE.levelForWidth?SR7.PE.levelForWidth(window.innerWidth||1600):1,a=Math.max(0,Math.min(600,t.stagger||0)),h=a?Array.prototype.filter.call(e.children,t=>1===t.nodeType):[],f=h.length>1?h:[e],m=(t,e)=>{const n=l.timeline();let r=!1;return f.forEach((o,s)=>{let i=null;try{i=SR7.ANIM.build(t,{content:o},{level:c,scene:e})}catch(t){}i&&(r=!0,n.add(i,f.length>1?s*a/1e3:0))}),r?n:null},g=t=>{for(const e of f)e.style.willChange=t?"transform":""},S=n.tl=m(i,"in");if(!S)return;S.timeScale(Math.max(.25,t.speed||1)),S.pause(0),g(!0),S.eventCallback("onComplete",()=>g(!1));const R=t.out;let y=!1,v=!1;const E=()=>{if(!v)return;const t=(()=>{const t=w(e),n=(window.innerHeight||1)*((null==R.at?20:R.at)/100),r=n+t.height;return r>0?Math.max(0,Math.min(1,(n-t.top)/r)):0})(),r=(!n.otl&&R&&(n.otl=m(R.body,"out"),n.otl&&n.otl.pause(0)),n.otl);r&&("trigger"!==R.mode?r.progress(t).pause():t>0&&!y?(y=!0,r.play()):t<=0&&y&&(y=!1,r.pause(0)))};if("scroll"===t.inMode){const r=Math.max(10,Math.min(90,null==t.inSpan?50:t.inSpan))/100,o=()=>{const t=w(e),n=window.innerHeight||1;let o=(n-t.top)/(n*r);d()&&(o=1),o=Math.max(0,Math.min(1,o)),S.progress(o).pause(),g(o>0&&o<1),v=o>=1,R&&E()};return void u(n.scrub=o)}const M=()=>{n.t=0,S.play()},b=t.mode||"once";s||(s=!0,o=window.scrollY||window.pageYOffset||0,addEventListener("scroll",()=>{const t=window.scrollY||window.pageYOffset||0;t!==o&&(r=t>o?"down":"up",o=t)},{passive:!0}));let P=!0;const _=()=>{if(P=!1,v=!0,"down"===b&&"down"!==r||"up"===b&&"up"!==r)return n.t=0,S.progress(1).pause(),void g(!1);t.delay?n.t=setTimeout(M,t.delay):M()},x=Math.max(0,Math.min(50,null==t.offset?15:t.offset));u(n.scrub=()=>{if(P){if(!(()=>{const t=w(e),n=window.innerHeight||1;return t.top<n-n*x/100&&t.top+t.height>0})())return;return _(),void("once"===b&&n.scrub&&(p(n.scrub),n.scrub=null))}(()=>{const t=w(e),n=window.innerHeight||1;return t.top+t.height<=0||t.top>=n})()?(n.t&&(clearTimeout(n.t),n.t=0),y=!1,n.otl&&n.otl.pause(0),S.pause(0),g(!0),P=!0,v=!1):R&&E()})},m=()=>!!(window.SR7&&SR7.PE&&SR7.PE.registerRuntime)&&(SR7.PE.registerRuntime("scrollanim",{mount:(r,o)=>{const s='[data-sr7pe~="'+(window.CSS&&CSS.escape?CSS.escape(o):o)+'"]',i=document.querySelector(s);if(!i)return!1;if((()=>{try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch(t){return!1}})()||!(t=>{const e=t&&t.devices||"all";if("all"===e)return!0;const n=SR7.PE&&SR7.PE.levelForWidth?SR7.PE.levelForWidth(window.innerWidth||1600):0;return"nomobile"===e?n<4:n<3})(r))return!0;const l={};return(n??=new Promise(n=>{e(()=>{window.SR7??={},SR7.E??={},_tpt.R??={};const e=[];if(!_tpt.gsap&&t.gsap&&(_tpt.regResource({id:"tpgsap",url:t.gsap}),e.push("tpgsap")),!SR7.ANIM&&t.player&&(_tpt.regResource({id:"animpreset",url:t.player}),e.push("animpreset")),!e.length)return n();_tpt.checkResources(e).then(n).catch(n)})})).then(()=>{try{f(r,i,l)}catch(t){}}),l},unmount:t=>{try{t&&t.t&&clearTimeout(t.t)}catch(t){}try{t&&t.scrub&&p(t.scrub)}catch(t){}try{t&&t.tl&&t.tl.kill()}catch(t){}try{t&&t.otl&&t.otl.kill()}catch(t){}}}),!0);if(!m()){let t=0;const e=setInterval(()=>{(m()||++t>200)&&clearInterval(e)},16)}})();