!function(t){function e(){gsap.registerPlugin(ScrollTrigger),gsap.ticker.lagSmoothing(0),t("[data-motion-effects]").each(function(){const t=function(t){const e=t.dataset.motionEffects;try{return JSON.parse(e)}catch(t){return null}}(this),e=this;gsap.set(e,{force3D:!0,z:.01});const o=[],n=e.dataset.scrollDevices||"small-visibility, medium-visibility, large-visibility";let a=!0,r="large-visibility";Modernizr.mq("only screen and (max-width: "+fusionJSVars.visibility_medium+"px)")&&(r="medium-visibility"),Modernizr.mq("only screen and (max-width: "+fusionJSVars.visibility_small+"px)")&&(r="small-visibility"),n.includes(r)||(a=!1),t.forEach(t=>{const n={};if("scroll"===t.type&&a){const s=t.scroll_type||"transition",l=t.start_element||"top",c=t.start_viewport||"bottom",p=t.end_element||"bottom",u=t.end_viewport||"up";let d="+=0";if(n.type=s,"transition"===s){const f=t.scroll_direction||"up",y=t.transition_speed||1;"up"===f?(n.from={y:50*y},n.y=-50*y,d="-="+50*y):"down"===f?(n.from={y:-50*y},n.y=50*y):"right"===f?(n.from={x:-50*y},n.x=50*y):"left"===f&&(n.from={x:50*y},n.x=-50*y)}else if("fade"===s){const m=t.fade_type||"in";"in"===m?(n.from={opacity:0},n.opacity=1):"out"===m&&(n.from={opacity:1},n.opacity=0)}else if("scale"===s){const g=t.scale_type||"up",_=t.initial_scale||1,w=t.max_scale||1.5,b=t.min_scale||.5;n.from={scale:_},"up"===g?n.scale=w:"down"===g&&(n.scale=b)}else if("rotate"===s){const x=t.initial_rotate||1,v=t.end_rotate||30;n.from={rotation:x},n.rotation=v}else if("blur"===s){const h=t.initial_blur||0,O=t.end_blur||3;n.from={filter:`blur(${h}px)`},n.blur=O}n.start=`${l}${d} ${c}`,n.end=`${p} ${u}`,o.push(n)}if("mouse"===t.type){const $=t.mouse_effect||"track",P=t.mouse_effect_direction||"opposite",k=t.mouse_effect_speed||2;let z,E,S,T,D=5*k;function r(){S=gsap.utils.mapRange(0,innerWidth,-D,D),T=gsap.utils.mapRange(0,innerHeight,-D,D)}if("tilt"===$&&(D=3*k),window.addEventListener("resize",r),r(),"track"===$){const J=function(){gsap.to(e,{xPercent:"same"===P?z:-z,yPercent:"same"===P?E:-E,ease:"none"})};gsap.ticker.add(J)}else if("tilt"===$){const M=function(){z||(z=0),E||(E=0),gsap.to(e,{rotationX:"same"===P?-E*k:E*k,rotationY:"same"===P?z*k:-z*k,ease:"none",transformPerspective:1500})};gsap.ticker.add(M)}window.addEventListener("mousemove",function(t){z=S(t.clientX),E=T(t.clientY)},{passive:!0})}if("infinite"===t.type){const q=t.infinite_animation||"float",L=t.infinite_animation_speed||2;if("float"===q){gsap.timeline({repeat:-1}).to(e,{duration:6/L,y:"-="+i(22,30),x:"+="+i(13,20),rotation:"-=3",ease:"power1.inOut"}).to(e,{duration:6/L,y:"+="+i(22,30),x:"-="+i(13,20),rotation:"+=3",ease:"power1.inOut"}).to(e,{duration:6/L,y:"-="+i(22,30),rotation:"+="+i(2,4),ease:"power1.inOut"}).to(e,{duration:6/L,y:"+="+i(22,30),rotation:"-="+i(2,4),ease:"power1.inOut"}).to(e,{duration:6/L,y:"-="+i(22,30),rotation:"+="+i(2,4),ease:"power1.inOut"}).to(e,{duration:6/L,y:"+="+i(22,30),rotation:"-="+i(2,4),ease:"power1.inOut"}).to(e,{duration:6/L,y:"-="+i(22,30),rotation:"+="+i(2,4),ease:"power1.inOut"}).to(e,{duration:6/L,y:"+="+i(22,30),rotation:"-="+i(2,4),ease:"power1.inOut"}).to(e,{duration:6/L,y:"-="+i(12,20),ease:"power1.inOut"}).to(e,{duration:6/L,y:"+="+i(12,20),ease:"power1.inOut"})}else"pulse"===q?gsap.to(e,{duration:3/L,scale:1.3,repeat:-1,yoyo:!0,ease:"power3.inOut"}):"rotate"===q?gsap.timeline().fromTo(e,{opacity:0,scale:0},{opacity:1,scale:1,duration:1,ease:"power2.out"}).fromTo(e,{rotation:0},{rotation:360,duration:10/L,repeat:-1,repeatDelay:.01,ease:"linear"},0):"wiggle"===q&&(gsap.set(e,{xPercent:-10,x:-1}),gsap.to(e,{repeat:-1,yoyo:!0,xPercent:10,duration:2/L,ease:"power1.inOut"}))}}),o.length&&o.forEach(t=>{const i={scrollTrigger:{trigger:e,scrub:.05,start:t.start,end:t.end},lazy:!1};"y"in t&&(i.y=t.y),"x"in t&&(i.x=t.x),"opacity"in t&&(i.opacity=t.opacity),"scale"in t&&(i.scale=t.scale),"rotation"in t&&(i.rotation=t.rotation),"blur"in t&&(i.filter=`blur(${t.blur}px)`),gsap.set(e,t.from),gsap.to(e,i)})})}function i(t,e){return t+(e-t)*Math.random()}e(),t("body").on("avada-studio-preview-done",function(){e()})}(jQuery);