Current File : /home/kelaby89/babyl0n.restaurant/wp-content/themes/restar/assets/js/ScrollSmoother.min.js
/*!
 * ScrollSmoother 3.11.4
 * https://greensock.com
 * 
 * @license Copyright 2022, GreenSock. All rights reserved.
 * This plugin is a membership benefit of Club GreenSock and is only authorized for use in sites/apps/products developed by individuals/companies with an active Club GreenSock membership. See https://greensock.com/club
 * @author: Jack Doyle, [email protected]
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).window=e.window||{})}(this,(function(e){"use strict";function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(){return"undefined"!=typeof window}function n(){return o||r()&&(o=window.gsap)&&o.registerPlugin&&o}var o,i,s,a,l,c,u,f,d,h,g,p,v,m,y,w=(b.register=function(e){return i||(o=e||n(),r()&&window.document&&(s=window,a=document,l=a.documentElement,c=a.body),o&&(u=o.utils.toArray,f=o.utils.clamp,g=o.parseEase("expo"),m=o.core.context||function(){},y=o.delayedCall(.2,(function(){return d.isRefreshing||h&&h.refresh()})).pause(),d=o.core.globals().ScrollTrigger,o.core.globals("ScrollSmoother",b),c&&d&&(p=d.core._getVelocityProp,v=d.core._inputObserver,b.refresh=d.refresh,i=1))),i},function(e,r,n){r&&t(e.prototype,r),n&&t(e,n)}(b,[{key:"progress",get:function(){return this.scrollTrigger?this.scrollTrigger.animation._time/100:0}}]),b);function b(e){var t=this;function r(){return le.update(-ie)}function n(){return M.style.overflow="visible"}function w(e){e.update();var t=e.getTween();t&&(t.pause(),t._time=t._dur,t._tTime=t._tDur),D=!1,e.animation.progress(e.progress,!0)}function S(e,t){(e!==ie&&!U||t)&&(Z&&(e=Math.round(e)),ne&&(M.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+e+", 0, 1)",M._gsap.y=e+"px"),se=e-ie,ie=e,d.isUpdating||d.update())}function T(e){return arguments.length?(e<0&&(e=0),ce.y=-e,D=!0,U?ie=-e:S(-e),d.isRefreshing?B.update():re(e),this):-ie}function x(e){z.scrollTop=0,e.target.contains&&e.target.contains(z)||Q&&!1===Q(t,e)||(d.isInViewport(e.target)||e.target===Y||t.scrollTo(e.target,!1,"center center"),Y=e.target)}function E(e){var t,r,n,i;H.forEach((function(s){t=s.pins,i=s.markers,e.forEach((function(e){s.trigger&&e.trigger&&s!==e&&(e.trigger===s.trigger||e.pinnedContainer===s.trigger||s.trigger.contains(e.trigger))&&(r=e.start,n=(r-s.start-s.offset)/s.ratio-(r-s.start),t.forEach((function(e){return n-=e.distance/s.ratio-e.distance})),e.setPositions(r+n,e.end+n),e.markerStart&&i.push(o.quickSetter([e.markerStart,e.markerEnd],"y","px")),e.pin&&0<e.end&&(n=e.end-e.start,t.push({start:e.start,end:e.end,distance:n,trig:e}),s.setPositions(s.start,s.end+n),s.vars.onRefresh(s)))}))}))}function P(){n(),requestAnimationFrame(n),H&&(H.forEach((function(e){var t=e.start,r=e.auto?Math.min(d.maxScroll(e.scroller),e.end):t+(e.end-t)/e.ratio,n=(r-e.end)/2;t-=n,r-=n,e.offset=n||1e-4,e.pins.length=0,e.setPositions(Math.min(t,r),Math.max(t,r)),e.vars.onRefresh(e)})),E(d.sort())),le.reset()}function k(){return d.addEventListener("refresh",P)}function R(){return H&&H.forEach((function(e){return e.vars.onRefresh(e)}))}function C(){return H&&H.forEach((function(e){return e.vars.onRefreshInit(e)})),R}function _(e,t,r,n){return function(){var o="function"==typeof t?t(r,n):t;return o||0===o||(o=n.getAttribute("data-"+te+e)||("speed"===e?1:0)),n.setAttribute("data-"+te+e,o),"auto"===o?o:parseFloat(o)}}function A(e,t,r,n,i){function a(){t=b(),r=S(),h=parseFloat(t)||1,y=(v="auto"===t)?0:.5,m&&m.kill(),m=r&&o.to(e,{ease:g,overwrite:!1,y:"+=0",duration:r}),p&&(p.ratio=h,p.autoSpeed=v)}function c(){x.y=T+"px",x.renderTransform(1),a()}function u(t){if(v){c();var r=function(e,t){var r,n,o=e.parentNode||l,i=e.getBoundingClientRect(),a=o.getBoundingClientRect(),c=a.top-i.top,u=a.bottom-i.bottom,f=(Math.abs(c)>Math.abs(u)?c:u)/(1-t),d=-f*t;return 0<f&&(n=.5==(r=a.height/(s.innerHeight+a.height))?2*a.height:2*Math.min(a.height,-f*r/(2*r-1))*(t||1),d+=t?-n*t:-n/2,f+=n),{change:f,offset:d}}(e,f(0,1,-t.start/(t.end-t.start)));k=r.change,w=r.offset}else k=(t.end-t.start)*(1-h),w=0;E.forEach((function(e){return k-=e.distance*(1-h)})),t.vars.onUpdate(t),m&&m.progress(1)}i=("function"==typeof i?i(n,e):i)||0;var h,p,v,m,y,w,b=_("speed",t,n,e),S=_("lag",r,n,e),T=o.getProperty(e,"y"),x=e._gsap,E=[],P=[],k=0;return a(),(1!==h||v||m)&&(u(p=d.create({trigger:v?e.parentNode:e,start:"top bottom+="+i,end:"bottom top-="+i,scroller:z,scrub:!0,refreshPriority:-999,onRefreshInit:c,onRefresh:u,onKill:function(e){var t=H.indexOf(e);0<=t&&H.splice(t,1),c()},onUpdate:function(e){var t,r,n,i=T+k*(e.progress-y),s=E.length,a=0;if(e.offset){if(s){for(r=-ie,n=e.end;s--;){if((t=E[s]).trig.isActive||r>=t.start&&r<=t.end)return void(m&&(t.trig.progress+=t.trig.direction<0?.001:-.001,t.trig.update(0,0,1),m.resetTo("y",parseFloat(x.y),-se,!0),ae&&m.progress(1)));r>t.end&&(a+=t.distance),n-=t.distance}i=T+a+k*((o.utils.clamp(e.start,e.end,r)-e.start-a)/(n-e.start)-y)}i=function(e){return Math.round(1e5*e)/1e5||0}(i+w),P.length&&!v&&P.forEach((function(e){return e(i-a)})),m?(m.resetTo("y",i,-se,!0),ae&&m.progress(1)):(x.y=i+"px",x.renderTransform(1))}}})),o.core.getCache(p.trigger).stRevert=C,p.startY=T,p.pins=E,p.markers=P,p.ratio=h,p.autoSpeed=v,e.style.willChange="transform"),p}i||b.register(o)||console.warn("Please gsap.registerPlugin(ScrollSmoother)"),e=this.vars=e||{},h&&h.kill(),m(h=this);var M,z,F,B,H,I,L,O,N,U,q,V,j,D,Y,K=e.smoothTouch,W=e.onUpdate,G=e.onStop,J=e.smooth,Q=e.onFocusIn,X=e.normalizeScroll,Z=e.wholePixels,$=this,ee="undefined"!=typeof ResizeObserver&&!1!==e.autoResize&&new ResizeObserver((function(){return d.isRefreshing||y.restart(!0)})),te=e.effectsPrefix||"",re=d.getScrollFunc(s),ne=1===d.isTouch?!0===K?.8:parseFloat(K)||0:0===J||!1===J?0:parseFloat(J)||.8,oe=ne&&+e.speed||1,ie=0,se=0,ae=1,le=p(0),ce={y:0};function ue(){return F=M.clientHeight,M.style.overflow="visible",c.style.height=s.innerHeight+(F-s.innerHeight)/oe+"px",F-s.innerHeight}k(),d.addEventListener("killAll",k),o.delayedCall(.5,(function(){return ae=0})),this.scrollTop=T,this.scrollTo=function(e,r,n){var i=o.utils.clamp(0,d.maxScroll(s),isNaN(e)?t.offset(e,n):+e);r?U?o.to(t,{duration:ne,scrollTop:i,overwrite:"auto",ease:g}):re(i):T(i)},this.offset=function(e,t){var r,n=(e=u(e)[0]).style.cssText,i=d.create({trigger:e,start:t||"top top"});return H&&E([i]),r=i.start,i.kill(!1),e.style.cssText=n,o.core.getCache(e).uncache=1,r},this.content=function(e){if(arguments.length){var t=u(e||"#smooth-content")[0]||console.warn("ScrollSmoother needs a valid content element.")||c.children[0];return t!==M&&(N=(M=t).getAttribute("style")||"",ee&&ee.observe(M),o.set(M,{overflow:"visible",width:"100%",boxSizing:"border-box",y:"+=0"}),ne||o.set(M,{clearProps:"transform"})),this}return M},this.wrapper=function(e){return arguments.length?(z=u(e||"#smooth-wrapper")[0]||function(e){var t=a.querySelector(".ScrollSmoother-wrapper");return t||((t=a.createElement("div")).classList.add("ScrollSmoother-wrapper"),e.parentNode.insertBefore(t,e),t.appendChild(e)),t}(M),O=z.getAttribute("style")||"",ue(),o.set(z,ne?{overflow:"hidden",position:"fixed",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0}:{overflow:"visible",position:"relative",width:"100%",height:"auto",top:"auto",bottom:"auto",left:"auto",right:"auto"}),this):z},this.effects=function(e,t){if(H=H||[],!e)return H.slice(0);(e=u(e)).forEach((function(e){for(var t=H.length;t--;)H[t].trigger===e&&H[t].kill()}));var r,n,o=(t=t||{}).speed,i=t.lag,s=t.effectsPadding,a=[];for(r=0;r<e.length;r++)(n=A(e[r],o,i,r,s))&&a.push(n);return H.push.apply(H,a),a},this.sections=function(e,t){if(I=I||[],!e)return I.slice(0);var r=u(e).map((function(e){return d.create({trigger:e,start:"top 120%",end:"bottom -20%",onToggle:function(t){e.style.opacity=t.isActive?"1":"0",e.style.pointerEvents=t.isActive?"all":"none"}})}));return t&&t.add?I.push.apply(I,r):I=r.slice(0),r},this.content(e.content),this.wrapper(e.wrapper),this.render=function(e){return S(e||0===e?e:ie)},this.getVelocity=function(){return le.getVelocity(-ie)},d.scrollerProxy(z,{scrollTop:T,scrollHeight:function(){return ue()&&c.scrollHeight},fixedMarkers:!1!==e.fixedMarkers&&!!ne,content:M,getBoundingClientRect:function(){return{top:0,left:0,width:s.innerWidth,height:s.innerHeight}}}),d.defaults({scroller:z});var fe=d.getAll().filter((function(e){return e.scroller===s||e.scroller===z}));fe.forEach((function(e){return e.revert(!0,!0)})),B=d.create({animation:o.fromTo(ce,{y:0},{y:function(){return-ue()},immediateRender:!1,ease:"none",data:"ScrollSmoother",duration:100,onUpdate:function(){if(this._dur){var e=D;e&&(w(B),ce.y=ie),S(ce.y,e),r(),W&&!U&&W($)}}}),onRefreshInit:function(e){if(H){var t=d.getAll().filter((function(e){return!!e.pin}));H.forEach((function(e){e.vars.pinnedContainer||t.forEach((function(t){if(t.pin.contains(e.trigger)){var r=e.vars;r.pinnedContainer=t.pin,e.vars=null,e.init(r,e.animation)}}))}))}var r=e.getTween();j=r&&r._end>r._dp._time,V=ie,ce.y=0,ne&&(z.style.pointerEvents="none",z.scrollTop=0,setTimeout((function(){return z.style.removeProperty("pointer-events")}),50))},onRefresh:function(e){e.animation.invalidate(),e.setPositions(e.start,ue()/oe),j||w(e),ce.y=-re(),S(ce.y),ae||e.animation.progress(o.utils.clamp(0,1,V/-e.end)),j&&(e.progress-=.001,e.update())},id:"ScrollSmoother",scroller:s,invalidateOnRefresh:!0,start:0,refreshPriority:-9999,end:function(){return ue()/oe},onScrubComplete:function(){le.reset(),G&&G(t)},scrub:ne||!0}),this.smooth=function(t){return arguments.length&&(oe=(ne=t||0)&&+e.speed||1,B.scrubDuration(t)),B.getTween()?B.getTween().duration():0},B.getTween()&&(B.getTween().vars.ease=e.ease||g),this.scrollTrigger=B,e.effects&&this.effects(!0===e.effects?"[data-"+te+"speed], [data-"+te+"lag]":e.effects,{effectsPadding:e.effectsPadding}),e.sections&&this.sections(!0===e.sections?"[data-section]":e.sections),fe.forEach((function(e){e.vars.scroller=z,e.revert(!1,!0),e.init(e.vars,e.animation)})),this.paused=function(e,t){return arguments.length?(!!U!==e&&(e?(B.getTween()&&B.getTween().pause(),re(-ie),le.reset(),(q=d.normalizeScroll())&&q.disable(),(U=d.observe({preventDefault:!0,type:"wheel,touch,scroll",debounce:!1,allowClicks:!0,onChangeY:function(){return T(-ie)}})).nested=v(l,"wheel,touch,scroll",!0,!1!==t)):(U.nested.kill(),U.kill(),U=0,q&&q.enable(),B.progress=(-ie-B.start)/(B.end-B.start),w(B))),this):!!U},this.kill=this.revert=function(){t.paused(!1),w(B),B.kill();for(var e=(H||[]).concat(I||[]),r=e.length;r--;)e[r].kill();d.scrollerProxy(z),d.removeEventListener("killAll",k),d.removeEventListener("refresh",P),z.style.cssText=O,M.style.cssText=N;var n=d.defaults({});n&&n.scroller===z&&d.defaults({scroller:s}),t.normalizer&&d.normalizeScroll(!1),clearInterval(L),h=null,ee&&ee.disconnect(),c.style.removeProperty("height"),s.removeEventListener("focusin",x)},this.refresh=function(e,t){return B.refresh(e,t)},X&&(this.normalizer=d.normalizeScroll(!0===X?{debounce:!0,content:!ne&&M}:X)),d.config(e),"overscrollBehavior"in s.getComputedStyle(c)&&o.set([c,l],{overscrollBehavior:"none"}),"scrollBehavior"in s.getComputedStyle(c)&&o.set([c,l],{scrollBehavior:"auto"}),s.addEventListener("focusin",x),L=setInterval(r,250),"loading"===a.readyState||requestAnimationFrame((function(){return d.refresh()}))}w.version="3.11.4",w.create=function(e){return h&&e&&h.content()===u(e.content)[0]?h:new w(e)},w.get=function(){return h},n()&&o.registerPlugin(w),e.ScrollSmoother=w,e.default=w,"undefined"==typeof window||window!==e?Object.defineProperty(e,"__esModule",{value:!0}):delete e.default}));
Page not found – Hello World !