1let mfrStackingTriggers=[];class MFRStackingSection{constructor(){this.mainSelector="#MainContent",this.sectionSelector=".shopify-section",this.stackingClass="as-stacking-section",this.stackedShadowClass="as-stacking-section--shadow",this.teardown(),this.init()}teardown(){mfrStackingTriggers.forEach(t=>t.kill()),mfrStackingTriggers=[],this.getMainChildren().forEach(t=>{t.style.zIndex="",t.classList.remove(this.stackedShadowClass),t.querySelectorAll("[data-stacking-section-icon-parallax]").forEach(t=>{window.gsap&&window.gsap.set(t,{clearProps:"transform"})})})}init(){const t=this.getMainChildren(),e=this.findConsecutiveRuns(t);e.length?e.forEach((t,e)=>{console.log(`[MFRStackingSection] Run ${e+1}: ${t.length} consecutive stacking sections`,t)}):console.log("[MFRStackingSection] No consecutive stacking sections found."),e.forEach(t=>this.setupStacking(t)),this.initIconParallax(t)}getMainChildren(){const t=document.querySelector(this.mainSelector);return t?Array.from(t.children).filter(t=>t.matches(this.sectionSelector)):[]}isStackingSection(t){return!!t.querySelector(`section.${this.stackingClass}`)}findConsecutiveRuns(t){const e=[];let i=[];return t.forEach(t=>{this.isStackingSection(t)?i.push(t):(i.length>=2&&e.push(i),i=[])}),i.length>=2&&e.push(i),e}isTallerThanViewport(t){return t.getBoundingClientRect().height>window.innerHeight}getHeaderHeight(){const t=document.querySelector("header.header");return t?t.offsetHeight:0}getPinStart(t){return this.isTallerThanViewport(t)?"bottom bottom":`top top+=${this.getHeaderHeight()}`}getStackDistance(t,e){const i=e[e.length-1].getBoundingClientRect().bottom,n=t.getBoundingClientRect().bottom;return Math.max(i-n,0)}setupStacking(t){if("undefined"==typeof gsap||"undefined"==typeof ScrollTrigger||!ScrollTrigger.create)return;if(t.length<2)return;t.forEach((t,e)=>{t.style.zIndex=e+1});t.slice(0,-1).forEach(e=>{const i=ScrollTrigger.create({trigger:e,start:()=>this.getPinStart(e),end:()=>`+=${this.getStackDistance(e,t)}`,pin:!0,pinSpacing:!1});mfrStackingTriggers.push(i)}),t.slice(1).forEach(t=>{const e=ScrollTrigger.create({trigger:t,start:"top bottom",end:()=>this.getPinStart(t),toggleClass:{targets:t,className:this.stackedShadowClass}});mfrStackingTriggers.push(e)})}initIconParallax(t){"undefined"!=typeof gsap&&"undefined"!=typeof ScrollTrigger&&ScrollTrigger.create&&t.forEach((e,i)=>{if(!this.isStackingSection(e))return;const n=e.querySelectorAll("[data-stacking-section-icon-parallax]");if(!n.length)return;const r=t[i+1],o=r&&this.isStackingSection(r),s=ScrollTrigger.create({trigger:e,start:"top bottom",endTrigger:o?r:e,end:()=>o?this.getPinStart(r):"bottom top",scrub:!0,onUpdate:t=>{const e=25-50*t.progress;n.forEach(t=>gsap.set(t,{yPercent:e}))}});mfrStackingTriggers.push(s)})}}function initMFRStackingSection(){window.Shopify&&window.Shopify.designMode||new MFRStackingSection}onReady(()=>{initMFRStackingSection(),setTimeout(()=>{window.ScrollTrigger&&window.ScrollTrigger.refresh()},410)}),window.addEventListener("load",()=>{window.ScrollTrigger&&window.ScrollTrigger.refresh()}),document.addEventListener("shopify:section:load",initMFRStackingSection),onReady(()=>{const t=document.querySelector("header.header");if(!t)return;let e;new ResizeObserver(()=>{clearTimeout(e),e=setTimeout(()=>{window.ScrollTrigger&&window.ScrollTrigger.refresh()},401)}).observe(t)}); 2//# sourceMappingURL=mfr-stacking-sections.min.js.map
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.