(()=>{function t(t,e="chars"){const o=t.querySelector("h1, h2, h3, h4, h5, h6, p, span");if(!o)return[];const n=o.textContent,s=o.innerHTML;o.innerHTML="";let r=[];if("chars"===e)r=n.split("").map(t=>{const e=document.createElement("span");return e.style.display="inline-block",e.style.whiteSpace="pre",e.textContent=" "===t?" ":t,o.appendChild(e),e});else if("words"===e){const t=n.split(" ");r=t.map((e,n)=>{const s=document.createElement("span");return s.style.display="inline-block",s.style.whiteSpace="pre",s.textContent=e+(n<t.length-1?" ":""),o.appendChild(s),s})}else"lines"===e&&(r=s.split(/<br\s*\/?>/i).map(t=>t.trim()).filter(Boolean).map((t,e)=>{const n=document.createElement("div");return n.style.display="block",n.style.whiteSpace="pre",n.innerHTML=t,o.appendChild(n),n}));return r}document.addEventListener("DOMContentLoaded",()=>{if(!window.ABlocksAnimationSettings)return;const s=document.querySelectorAll(".ablocks-block"),r=e();gsap.registerPlugin(ScrollTrigger),s.forEach(e=>{const s=Array.from(e.classList).find(t=>t.startsWith("ablocks-block-")&&!t.startsWith("ablocks-block--"));if(!s)return;const i=s.replace("ablocks-block-",""),l=ABlocksAnimationSettings[i];if(!l)return;const c=l.flat(),a=e,p=e;c.forEach(e=>{const s=e.trigger,i=e.actions||[];if(function(t,e){return!("desktop"!=e||!t.allowDesktop)||!(!t.allowTablet||"tablet"!=e)||!(!t.allowMobile||"mobile"!=e)}(e?.settings||{},r)){if("click"===s){let t=0;a.addEventListener("click",()=>{t++;const n=i[t%2==1?0:1];n&&o(e,p,[n])})}if("whileScroll"===s){ScrollTrigger.getAll().forEach(t=>t.kill());const t=gsap.timeline({scrollTrigger:{trigger:p,start:"top bottom",end:"bottom top",scrub:!0}});i.forEach(e=>{e.from&&e.to&&t.fromTo(p,e.from,e.to,0)})}if("scroll"===s)if(e?.settings?.isSplit){var l;const o=t(a,e?.settings?.splitType);gsap.fromTo(o,e.actions[0].from,{...e.actions[0].to,stagger:null!==(l=e.settings.stagger)&&void 0!==l?l:.1,scrollTrigger:{trigger:a,start:"top 80%",end:"bottom 20%",scrub:!0}})}else ScrollTrigger.create({trigger:a,start:"top center",end:"bottom center",onEnter:()=>{const t=i[0];t&&n(e,a,t)},onLeaveBack:()=>{const t=i[1]||i[0];t&&n(e,a,t)}});"mousemove"===s&&a.addEventListener("mousemove",t=>{const o=a.getBoundingClientRect(),s=(t.clientX-o.left)/o.width,r=(t.clientY-o.top)/o.height;i.forEach(t=>{const o={...t.from},i={...t.to};void 0!==i.x&&(i.x=o.x+100*s),void 0!==i.y&&(i.y=o.y+100*r),n(e,p,{from:o,to:i})})}),"hover"===s&&(a.addEventListener("mouseenter",()=>{const t=i[0];t&&o(e,p,[t],!1)}),a.addEventListener("mouseleave",()=>{const t=i[1]||i[0];t&&o(e,p,[t],!1)}))}})})});const e=()=>{const t=window.innerWidth;return t>=1024?"desktop":t>=768?"tablet":"mobile"};function o(t,e,o,s=!1){o.forEach(o=>{n(t,e,o,s)})}function n(e,o,n,s=!1){if(!n.from||!n.to)return void console.warn("Missing action",n.type,n);const r=s?n.to:n.from,i=s?n.from:n.to;if(e?.settings?.isSplit){var l;const n=e?.settings.splitType,s=`__abSplit_${n}`;o[s]||(o[s]=t(o,n));const r=o[s];gsap.set(r,e.actions[0].from),gsap.to(r,{...e.actions[0].to,stagger:null!==(l=e.settings.stagger)&&void 0!==l?l:.1})}else gsap.set(o,r),requestAnimationFrame(()=>{gsap.to(o,{...i,clearProps:"transform, opacity"})})}})();