1var x=Object.defineProperty;var D=(t,i,e)=>i in t?x(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e;var r=(t,i,e)=>D(t,typeof i!="symbol"?i+"":i,e);var L="1.3.25";function R(t,i,e){return Math.max(t,Math.min(i,e))}function k(t,i,e){return(1-e)*t+e*i}function X(t,i,e,s){return k(t,i,1-Math.exp(-e*s))}function Y(t,i){return(t%i+i)%i}var P=class{constructor(){r(this,"isRunning",!1);r(this,"value",0);r(this,"from",0);r(this,"to",0);r(this,"currentTime",0);r(this,"lerp");r(this,"duration");r(this,"easing");r(this,"onUpdate")}advance(t){var e;if(!this.isRunning)return;let i=!1;if(this.duration&&this.easing){this.currentTime+=t;const s=R(0,this.currentTime/this.duration,1);i=s>=1;const o=i?1:this.easing(s);this.value=this.from+(this.to-this.from)*o}else this.lerp?(this.value=X(this.value,this.to,this.lerp*60,t),Math.round(this.value)===Math.round(this.to)&&(this.value=this.to,i=!0)):(this.value=this.to,i=!0);i&&this.stop(),(e=this.onUpdate)==null||e.call(this,this.value,i)}stop(){this.isRunning=!1}fromTo(t,i,{lerp:e,duration:s,easing:o,onStart:h,onUpdate:c}){this.from=this.value=t,this.to=i,this.lerp=e,this.duration=s,this.easing=o,this.currentTime=0,this.isRunning=!0,h==null||h(),this.onUpdate=c}};function A(t,i){let e;return function(...s){clearTimeout(e),e=setTimeout(()=>{e=void 0,t.apply(this,s)},i)}}var I=class{constructor(t,i,{autoResize:e=!0,debounce:s=250}={}){r(this,"width",0);r(this,"height",0);r(this,"scrollHeight",0);r(this,"scrollWidth",0);r(this,"debouncedResize");r(this,"wrapperResizeObserver");r(this,"contentResizeObserver");r(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});r(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});r(this,"onContentResize",()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)});this.wrapper=t,this.content=i,e&&(this.debouncedResize=A(this.resize,s),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){var t,i;(t=this.wrapperResizeObserver)==null||t.disconnect(),(i=this.contentResizeObserver)==null||i.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},H=class{constructor(){r(this,"events",{})}emit(t,...i){var s;const e=this.events[t]||[];for(let o=0,h=e.length;o<h;o++)(s=e[o])==null||s.call(e,...i)}on(t,i){return this.events[t]?this.events[t].push(i):this.events[t]=[i],()=>{var e;this.events[t]=(e=this.events[t])==null?void 0:e.filter(s=>i!==s)}}off(t,i){var e;this.events[t]=(e=this.events[t])==null?void 0:e.filter(s=>i!==s)}destroy(){this.events={}}};const V=100/6,T={passive:!1};function N(t,i){return t===1?V:t===2?i:1}var B=class{constructor(t,i={wheelMultiplier:1,touchMultiplier:1}){r(this,"touchStart",{x:0,y:0});r(this,"lastDelta",{x:0,y:0});r(this,"window",{width:0,height:0});r(this,"emitter",new H);r(this,"onTouchStart",t=>{const{clientX:i,clientY:e}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=i,this.touchStart.y=e,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:t})});r(this,"onTouchMove",t=>{const{clientX:i,clientY:e}=t.targetTouches?t.targetTouches[0]:t,s=-(i-this.touchStart.x)*this.options.touchMultiplier,o=-(e-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=i,this.touchStart.y=e,this.lastDelta={x:s,y:o},this.emitter.emit("scroll",{deltaX:s,deltaY:o,event:t})});r(this,"onTouchEnd",t=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})});r(this,"onWheel",t=>{let{deltaX:i,deltaY:e,deltaMode:s}=t;const o=N(s,this.window.width),h=N(s,this.window.height);i*=o,e*=h,i*=this.options.wheelMultiplier,e*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:i,deltaY:e,event:t})});r(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=t,this.options=i,window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,T),this.element.addEventListener("touchstart",this.onTouchStart,T),this.element.addEventListener("touchmove",this.onTouchMove,T),this.element.addEventListener("touchend",this.onTouchEnd,T)}on(t,i){return this.emitter.on(t,i)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize),this.element.removeEventListener("wheel",this.onWheel,T),this.element.removeEventListener("touchstart",this.onTouchStart,T),this.element.removeEventListener("touchmove",this.onTouchMove,T),this.element.removeEventListener("touchend",this.onTouchEnd,T)}};const O=t=>Math.min(1,1.001-2**(-10*t));var U=class{constructor({wrapper:t=window,content:i=document.documentElement,eventsTarget:e=t,smoothWheel:s=!0,syncTouch:o=!1,syncTouchLerp:h=.075,touchInertiaExponent:c=1.7,duration:p,easing:a,lerp:u=.1,infinite:w=!1,orientation:d="vertical",gestureOrientation:n=d==="horizontal"?"both":"vertical",touchMultiplier:f=1,wheelMultiplier:l=1,autoResize:m=!0,prevent:v,virtualScroll:g,overscroll:S=!0,autoRaf:y=!1,anchors:E=!1,autoToggle:z=!1,allowNestedScroll:b=!1,__experimental__naiveDimensions:_=!1,naiveDimensions:W=_,stopInertiaOnNavigate:M=!1}={}){r(this,"_isScrolling",!1);r(this,"_isStopped",!1);r(this,"_isLocked",!1);r(this,"_preventNextNativeScrollEvent",!1);r(this,"_resetVelocityTimeout",null);r(this,"_rafId",null);r(this,"_isDraggingSelection",!1);r(this,"isTouching");r(this,"isIos");r(this,"time",0);r(this,"userData",{});r(this,"lastVelocity",0);r(this,"velocity",0);r(this,"direction",0);r(this,"options");r(this,"targetScroll");r(this,"animatedScroll");r(this,"animate",new P);r(this,"emitter",new H);r(this,"dimensions");r(this,"virtualScroll");r(this,"onScrollEnd",t=>{t instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&t.stopPropagation()});r(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});r(this,"onTransitionEnd",t=>{var i;(i=t.propertyName)!=null&&i.includes("overflow")&&t.target===this.rootElement&&this.checkOverflow()});r(this,"onClick",t=>{const i=t.composedPath().filter(s=>s instanceof HTMLAnchorElement&&s.href).map(s=>
1new URL(s.href)),e=new URL(window.location.href);if(this.options.anchors){const s=i.find(o=>e.host===o.host&&e.pathname===o.pathname&&o.hash);if(s){const o=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,h=decodeURIComponent(s.hash);this.scrollTo(h,o);return}}if(this.options.stopInertiaOnNavigate&&i.some(s=>e.host===s.host&&e.pathname!==s.pathname)){this.reset();return}});r(this,"onPointerDown",t=>{t.button===1&&this.reset()});r(this,"onVirtualScroll",t=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(t)===!1)return;const{deltaX:i,deltaY:e,event:s}=t;if(this.emitter.emit("virtual-scroll",{deltaX:i,deltaY:e,event:s}),s.ctrlKey||s.lenisStopPropagation)return;const o=s.type.includes("touch"),h=s.type.includes("wheel");if(o&&this.isIos&&(s.type==="touchstart"&&(this._isDraggingSelection=this.isTouchOnSelectionHandle(s)),this._isDraggingSelection)){s.type==="touchend"&&(this._isDraggingSelection=!1);return}this.isTouching=s.type==="touchstart"||s.type==="touchmove";const c=i===0&&e===0;if(this.options.syncTouch&&o&&s.type==="touchstart"&&c&&!this.isStopped&&!this.isLocked){this.reset();return}const p=this.options.gestureOrientation==="vertical"&&e===0||this.options.gestureOrientation==="horizontal"&&i===0;if(c||p)return;let a=s.composedPath();a=a.slice(0,a.indexOf(this.rootElement));const u=this.options.prevent,w=Math.abs(i)>=Math.abs(e)?"horizontal":"vertical";if(a.find(l=>{var m,v,g,S,y;return l instanceof HTMLElement&&(typeof u=="function"&&(u==null?void 0:u(l))||((m=l.hasAttribute)==null?void 0:m.call(l,"data-lenis-prevent"))||w==="vertical"&&((v=l.hasAttribute)==null?void 0:v.call(l,"data-lenis-prevent-vertical"))||w==="horizontal"&&((g=l.hasAttribute)==null?void 0:g.call(l,"data-lenis-prevent-horizontal"))||o&&((S=l.hasAttribute)==null?void 0:S.call(l,"data-lenis-prevent-touch"))||h&&((y=l.hasAttribute)==null?void 0:y.call(l,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.hasNestedScroll(l,{deltaX:i,deltaY:e}))}))return;if(this.isStopped||this.isLocked){s.cancelable&&s.preventDefault();return}if(!(this.options.syncTouch&&o||this.options.smoothWheel&&h)){this.isScrolling="native",this.animate.stop(),s.lenisStopPropagation=!0;return}let d=e;this.options.gestureOrientation==="both"?d=Math.abs(e)>Math.abs(i)?e:i:this.options.gestureOrientation==="horizontal"&&(d=i),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&e>0||this.animatedScroll===this.limit&&e<0))&&(s.lenisStopPropagation=!0),s.cancelable&&s.preventDefault();const n=o&&this.options.syncTouch,f=o&&s.type==="touchend";f&&(d=Math.sign(d)*Math.abs(this.velocity)**this.options.touchInertiaExponent),this.scrollTo(this.targetScroll+d,{programmatic:!1,...n?{lerp:f?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});r(this,"onNativeScroll",()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){const t=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-t,this.direction=Math.sign(this.animatedScroll-t),this.isStopped||(this.isScrolling="native"),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}});r(this,"raf",t=>{const i=t-(this.time||t);this.time=t,this.animate.advance(i*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=L,window.lenis||(window.lenis={}),window.lenis.version=L,d==="horizontal"&&(window.lenis.horizontal=!0),o===!0&&(window.lenis.touch=!0),this.isIos=/(iPad|iPhone|iPod)/g.test(navigator.userAgent),(!t||t===document.documentElement)&&(t=window),typeof p=="number"&&typeof a!="function"?a=O:typeof a=="function"&&typeof p!="number"&&(p=1),this.options={wrapper:t,content:i,eventsTarget:e,smoothWheel:s,syncTouch:o,syncTouchLerp:h,touchInertiaExponent:c,duration:p,easing:a,lerp:u,infinite:w,gestureOrientation:n,orientation:d,touchMultiplier:f,
1wheelMultiplier:l,autoResize:m,prevent:v,virtualScroll:g,overscroll:S,autoRaf:y,anchors:E,autoToggle:z,allowNestedScroll:b,naiveDimensions:W,stopInertiaOnNavigate:M},this.dimensions=new I(t,i,{autoResize:m}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown),this.virtualScroll=new B(e,{touchMultiplier:f,wheelMultiplier:l}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd)),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(t,i){return this.emitter.on(t,i)}off(t,i){return this.emitter.off(t,i)}get overflow(){const t=this.isHorizontal?"overflow-x":"overflow-y";return getComputedStyle(this.rootElement)[t]}checkOverflow(){["hidden","clip"].includes(this.overflow)?this.internalStop():this.internalStart()}setScroll(t){this.isHorizontal?this.options.wrapper.scrollTo({left:t,behavior:"instant"}):this.options.wrapper.scrollTo({top:t,behavior:"instant"})}isTouchOnSelectionHandle(t){const i=window.getSelection();if(!i||i.isCollapsed||i.rangeCount===0)return!1;const e=t.targetTouches[0]??t.changedTouches[0];if(!e)return!1;const s=i.getRangeAt(0).getClientRects();if(s.length===0)return!1;const o=s[0],h=s[s.length-1],c=40,p=Math.hypot(e.clientX-o.left,e.clientY-o.top)<=c,a=Math.hypot(e.clientX-h.right,e.clientY-h.bottom)<=c;return p||a}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty("overflow");return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty("overflow","clip");return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}scrollTo(t,{offset:i=0,immediate:e=!1,lock:s=!1,programmatic:o=!0,lerp:h=o?this.options.lerp:void 0,duration:c=o?this.options.duration:void 0,easing:p=o?this.options.easing:void 0,onStart:a,onComplete:u,force:w=!1,userData:d}={}){if((this.isStopped||this.isLocked)&&!w)return;let n=t,f=i;if(typeof n=="string"&&["top","left","start","#"].includes(n))n=0;else if(typeof n=="string"&&["bottom","right","end"].includes(n))n=this.limit;else{let l=null;if(typeof n=="string"?(l=n.startsWith("#")?document.getElementById(n.slice(1)):document.querySelector(n),l||(n==="#top"?n=0:console.warn("Lenis: Target not found",n))):n instanceof HTMLElement&&(n!=null&&n.nodeType)&&(l=n),l){if(this.options.wrapper!==window){const E=this.rootElement.getBoundingClientRect();f-=this.isHorizontal?E.left:E.top}const m=l.getBoundingClientRect(),v=getComputedStyle(l),g=this.isHorizontal?Number.parseFloat(v.scrollMarginLeft):Number.parseFloat(v.scrollMarginTop),S=getComputedStyle(this.rootElement),y=this.isHorizontal?Number.parseFloat(S.scrollPaddingLeft):Number.parseFloat(S.scrollPaddingTop);n=(this.isHorizontal?m.left:m.top)+this.animatedScroll-(Number.isNaN(g)?0:g)-(Number.isNaN(y)?0:y)}}if(typeof n=="number"){if(n+=f,this.options.infinite){if(o){this.targetScroll=this.animatedScroll=this.scroll;const l=n-this.animatedScroll;l>this.limit/2?n-=this.limit:l<-this.limit/2&&(n+=this.limit)}}else n=R(0,n,this.limit);if(n===this.targetScroll){a==null||a(this),u==null||u(this);return}if(this.userData=d??{},e){this.animatedScroll=this.targetScroll=n,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit
vendor: 3,735 bytes, line 1
1(),u==null||u(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}o||(this.targetScroll=n),typeof c=="number"&&typeof p!="function"?p=O:typeof p=="function"&&typeof c!="number"&&(c=1),this.animate.fromTo(this.animatedScroll,n,{duration:c,easing:p,lerp:h,onStart:()=>{s&&(this.isLocked=!0),this.isScrolling="smooth",a==null||a(this)},onUpdate:(l,m)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=l-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=l,this.setScroll(this.scroll),o&&(this.targetScroll=l),m||this.emit(),m&&(this.reset(),this.emit(),u==null||u(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}hasNestedScroll(t,{deltaX:i,deltaY:e}){const s=Date.now();t._lenis||(t._lenis={});const o=t._lenis;let h,c,p,a,u,w,d,n,f,l;if(s-(o.time??0)>2e3){o.time=Date.now();const b=window.getComputedStyle(t);if(o.computedStyle=b,h=["auto","overlay","scroll"].includes(b.overflowX),c=["auto","overlay","scroll"].includes(b.overflowY),u=["auto"].includes(b.overscrollBehaviorX),w=["auto"].includes(b.overscrollBehaviorY),o.hasOverflowX=h,o.hasOverflowY=c,!(h||c))return!1;d=t.scrollWidth,n=t.scrollHeight,f=t.clientWidth,l=t.clientHeight,p=d>f,a=n>l,o.isScrollableX=p,o.isScrollableY=a,o.scrollWidth=d,o.scrollHeight=n,o.clientWidth=f,o.clientHeight=l,o.hasOverscrollBehaviorX=u,o.hasOverscrollBehaviorY=w}else p=o.isScrollableX,a=o.isScrollableY,h=o.hasOverflowX,c=o.hasOverflowY,d=o.scrollWidth,n=o.scrollHeight,f=o.clientWidth,l=o.clientHeight,u=o.hasOverscrollBehaviorX,w=o.hasOverscrollBehaviorY;if(!(h&&p||c&&a))return!1;const m=Math.abs(i)>=Math.abs(e)?"horizontal":"vertical";let v,g,S,y,E,z;if(m==="horizontal")v=Math.round(t.scrollLeft),g=d-f,S=i,y=h,E=p,z=u;else if(m==="vertical")v=Math.round(t.scrollTop),g=n-l,S=e,y=c,E=a,z=w;else return!1;return!z&&(v>=g||v<=0)?!0:(S>0?v<g:v>0)&&y&&E}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){const t=this.options.wrapper;return this.isHorizontal?t.scrollX??t.scrollLeft:t.scrollY??t.scrollTop}get scroll(){return this.options.infinite?Y(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(t){this._isScrolling!==t&&(this._isScrolling=t,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(t){this._isStopped!==t&&(this._isStopped=t,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(t){this._isLocked!==t&&(this._isLocked=t,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get className(){let t="lenis";return this.options.autoToggle&&(t+=" lenis-autoToggle"),this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isScrolling==="smooth"&&(t+=" lenis-smooth"),t}updateClassName(){this.cleanUpClassName(),this.className.split(" ").forEach(t=>{this.rootElement.classList.add(t)})}cleanUpClassName(){for(const t of Array.from(this.rootElement.classList))(t==="lenis"||t.startsWith("lenis-"))&&this.rootElement.classList.remove(t)}};export{U as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.