PageSourceSearch

https://www.karenmabon.com/cdn/shop/t/26/assets/product-media-gall…?v=128134474538015972301783431766

js karenmabon.com collected 2026-09-25 18:47:52 UTC 6,233 bytes, 2 lines download raw bytes

1(function(){const registry=new Map;function isMobile(){return window.innerWidth<=768}function isDesktopVertical(){return window.innerWidth>=750}function destroyGallery(sectionId){const entry=registry.get(sectionId);entry&&(entry.list&&entry.onScroll&&entry.list.removeEventListener("scroll",entry.onScroll),entry.listResizeObserver&&entry.listResizeObserver.disconnect(),entry.thumbResizeObserver&&entry.thumbResizeObserver.disconnect(),entry.resizeHandler&&window.removeEventListener("resize",entry.resizeHandler),entry.syncTimeouts&&entry.syncTimeouts.forEach(clearTimeout),registry.delete(sectionId))}function updateThumbnailScrollFade(mediaGallery){try{if(!mediaGallery||!isDesktopVertical())return;const thumbSlider=mediaGallery.querySelector(".lm-slider-thumb--vertical");if(!thumbSlider)return;const list=thumbSlider.querySelector(".thumbnail-list-lm");if(!list)return;const threshold=2,canScroll=list.scrollHeight>list.clientHeight+threshold,prevBtn=thumbSlider.querySelector(".slider-button--prev"),nextBtn=thumbSlider.querySelector(".slider-button--next");if(!canScroll){thumbSlider.classList.remove("is-fade-top","is-fade-bottom","is-arrow-top","is-arrow-bottom"),prevBtn&&prevBtn.setAttribute("disabled","disabled"),nextBtn&&nextBtn.setAttribute("disabled","disabled");return}const atTop=list.scrollTop<=threshold,atBottom=list.scrollTop+list.clientHeight>=list.scrollHeight-threshold,showTop=!atTop,showBottom=!atBottom;thumbSlider.dataset.showVerticalFade==="true"?(thumbSlider.classList.toggle("is-fade-top",showTop),thumbSlider.classList.toggle("is-fade-bottom",showBottom)):thumbSlider.classList.remove("is-fade-top","is-fade-bottom"),thumbSlider.dataset.showVerticalArrows==="true"?(thumbSlider.classList.toggle("is-arrow-top",showTop),thumbSlider.classList.toggle("is-arrow-bottom",showBottom),prevBtn&&(showTop?prevBtn.removeAttribute("disabled"):prevBtn.setAttribute("disabled","disabled")),nextBtn&&(showBottom?nextBtn.removeAttribute("disabled"):nextBtn.setAttribute("disabled","disabled"))):thumbSlider.classList.remove("is-arrow-top","is-arrow-bottom")}catch(error){console.warn("Vertical thumbnail fade update failed:",error)}}function resetThumbnailHeight(mediaGallery){const thumbnailSlider=mediaGallery?.querySelector(".lm-slider-thumb");thumbnailSlider&&(thumbnailSlider.style.height="",thumbnailSlider.classList.remove("height-synced"))}function syncThumbnailHeight(mediaGallery){try{let setThumbnailHeight2=function(){const containerWidth=mainSlider.offsetWidth;if(!containerWidth||!mainImage.naturalWidth)return;const aspectRatio=mainImage.naturalHeight/mainImage.naturalWidth;thumbnailSlider.style.height=containerWidth*aspectRatio+"px",thumbnailSlider.classList.add("height-synced"),updateThumbnailScrollFade(mediaGallery)};var setThumbnailHeight=setThumbnailHeight2;if(!mediaGallery)return;if(isMobile()){resetThumbnailHeight(mediaGallery);return}const mainSlider=mediaGallery.querySelector(".lm-slider-main"),thumbnailSlider=mediaGallery.querySelector(".lm-slider-thumb");if(!mainSlider||!thumbnailSlider)return;const activeSlide=mainSlider.querySelector(".slider__slide.is-active");if(!activeSlide)return;const mainImage=activeSlide.querySelector("img");if(!mainImage)return;mainImage.complete?setThumbnailHeight2():mainImage.addEventListener("load",setThumbnailHeight2,{once:!0})}catch(error){console.warn("Vertical thumbnail height sync failed:",error)}}function initVerticalGallery(mediaGallery){try{if(!mediaGallery)return;const sectionId=mediaGallery.dataset.section;if(!sectionId)return;destroyGallery(sectionId);const thumbSlider=mediaGallery.querySelector(".lm-slider-thumb--vertical"),list=thumbSlider?.querySelector(".thumbnail-list-lm");if(!list)return;const entry={mediaGallery,syncTimeouts:[],resizeHandler:null,listResizeObserver:null,thumbResizeObserver:null},onScroll=()=>updateThumbnailScrollFade(mediaGallery);if(list.addEventListener("scroll",onScroll,{passive:!0}),entry.onScroll=onScroll,entry.list=list,window.ResizeObserver&&(entry.listResizeObserver=new ResizeObserver(()=>updateThumbnailScrollFade(mediaGallery)),entry.listResizeObserver.observe(list),thumbSlider&&(entry.thumbResizeObserver=new ResizeObserver(()=>{syncThumbnailHeight(mediaGallery),updateThumbnailScrollFade(mediaGallery)}),entry.thumbResizeObserver.observe(thumbSlider))),entry.resizeHandler=()=>{window.setTimeout(()=>{isMobile()?resetThumbnailHeight(mediaGallery):syncThumbnailHeight(mediaGallery),updateThumbnailScrollFade(mediaGallery)},100)},window.addEventListener("resize",entry.resizeHandler),registry.set(sectionId,entry),updateThumbnailScrollFade(mediaGallery),isMobile()){resetThumbnailHeight(mediaGallery);return}syncThumbnailHeight(mediaGallery),[50,200,500,100,500,1200].forEac
1h(delay=>{const id=window.setTimeout(()=>{delay<=500?syncThumbnailHeight(mediaGallery):updateThumbnailScrollFade(mediaGallery)},delay);entry.syncTimeouts.push(id)}),entry.syncTimeouts.push(window.setTimeout(()=>{if(isMobile())return;const thumbnailSlider=mediaGallery.querySelector(".lm-slider-thumb");thumbnailSlider&&!thumbnailSlider.classList.contains("height-synced")&&(thumbnailSlider.style.height="500px",thumbnailSlider.classList.add("height-synced"),updateThumbnailScrollFade(mediaGallery))},2e3))}catch(error){console.warn("Vertical gallery init failed:",error)}}function initFromSectionId(sectionId){sectionId&&window.requestAnimationFrame(()=>{const mediaGallery=document.getElementById("MediaGallery-"+sectionId);mediaGallery?.querySelector(".lm-slider-thumb--vertical")&&initVerticalGallery(mediaGallery)})}function initAll(){document.querySelectorAll("media-gallery").forEach(mediaGallery=>{mediaGallery.querySelector(".lm-slider-thumb--vertical")&&initVerticalGallery(mediaGallery)})}window.__verticalGalleryListenersReady?initAll():(window.__verticalGalleryListenersReady=!0,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initAll):initAll(),document.addEventListener("shopify:section:load",event=>{initFromSectionId(event.detail?.sectionId)}),document.addEventListener("shopify:section:unload",event=>{destroyGallery(event.detail?.sectionId)}))})();
2//# sourceMappingURL=/cdn/shop/t/26/assets/product-media-gallery-vertical.js.map?v=128134474538015972301783431766

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.