PageSourceSearch

https://www.rockymountainsoap.com/cdn/shop/t/506/assets/r-sticky-sidebar.js?v=180158486285571629961790287389

js rockymountainsoap.com collected 2026-09-25 14:18:51 UTC 3,679 bytes, 2 lines download raw bytes

1const TAG_NAME="r-sticky-sidebar",DEFAULT_MIN_WIDTH=750,MODE_VIEWPORT_PIN="viewport-pin",COLUMN_HEIGHT_PROP="--r-sticky-column-height";class RStickySidebar extends HTMLElement{_topSpacing=0;_bottomSpacing=0;_minWidth=750;_viewportPin=!1;_tall=!1;_top=0;_minTop=0;_maxTop=0;_lastScrollY=0;_bootId=0;_rafId=0;_lastTop="";_lastHeight="";_setupDone=!1;_onResize=null;_onScroll=null;_resizeObs=null;_mutationObs=null;connectedCallback(){this._setupDone||(this._viewportPin=this.getAttribute("mode")===MODE_VIEWPORT_PIN,this._topSpacing=parseFloat(this.getAttribute("top-spacing")??"")||0,this._bottomSpacing=parseFloat(this.getAttribute("bottom-spacing")??"")||0,this._minWidth=parseFloat(this.getAttribute("min-width")??"")||750,this._bootId=requestAnimationFrame(()=>this._setup()))}disconnectedCallback(){cancelAnimationFrame(this._bootId),cancelAnimationFrame(this._rafId),this._rafId=0,this._setupDone&&(this._onResize&&window.removeEventListener("resize",this._onResize),this._onScroll&&window.removeEventListener("scroll",this._onScroll),this._resizeObs?.disconnect(),this._mutationObs?.disconnect(),this.style.top="",this.style.removeProperty(COLUMN_HEIGHT_PROP),this._lastTop="",this._lastHeight="",this._setupDone=!1)}update(){this._setupDone&&this._schedule()}_setup(){const onResize=()=>this._schedule();if(this._onResize=onResize,window.addEventListener("resize",onResize,{passive:!0}),!this._viewportPin){const onScroll=()=>this._travel();this._onScroll=onScroll,window.addEventListener("scroll",onScroll,{passive:!0}),this._lastScrollY=window.scrollY}"ResizeObserver"in window&&(this._resizeObs=new ResizeObserver(()=>this._schedule()),this._resizeObs.observe(this)),"MutationObserver"in window&&(this._mutationObs=new MutationObserver(()=>{(this._viewportPin?this.style.getPropertyValue(COLUMN_HEIGHT_PROP)!==this._lastHeight:this.style.top!==this._lastTop)&&this._schedule()}),this._mutationObs.observe(this,{attributes:!0,attributeFilter:["style"]})),document.fonts?.ready&&document.fonts.ready.then(()=>this._schedule()).catch(()=>{}),this._setupDone=!0,this._reposition()}_schedule(){this._rafId||(this._rafId=requestAnimationFrame(()=>{this._rafId=0,this._reposition()}))}_travel(){const y=window.scrollY,dy=y-this._lastScrollY;if(this._lastScrollY=y,!this._tall||dy===0)return;const top=Math.min(this._maxTop,Math.max(this._minTop,this._top-dy));top!==this._top&&(this._top=top,this._writeTop(`${top}px`))}_reposition(){if(!this.isConnected)return;if(window.innerWidth<=this._minWidth){this._tall=!1,this._writeTop(""),this._writeHeight("");return}if(this._viewportPin){const height=Math.round(this.offsetHeight);this._writeHeight(height>0?`${height}px`:"");return}const columnHeight=this.offsetHeight,viewportHeight=window.innerHeight,maxTop=(parseFloat(getComputedStyle(this).getPropertyValue("--r-sticky-header-offset"))||0)+this._topSpacing,minTop=viewportHeight-columnHeight-this._bottomSpacing;if(columnHeight>0&&minTop<maxTop){const wasTall=this._tall;this._tall=!0,this._minTop=minTop,this._maxTop=maxTop;const seed=wasTall?this._top:this.getBoundingClientRect().top;this._top=Math.min(maxTop,Math.max(minTop,seed)),this._writeTop(`${this._top}px`)}else this._tall=!1,this._writeTop("")}_writeTop(value){this.style.top!==value&&(this.style.top=value),this._lastTop=value}_writeHeight(value){this.style.getPropertyValue(COLUMN_HEIGHT_PROP)!==value&&(value?this.style.setProperty(COLUMN_HEIGHT_PROP,value):this.style.removeProperty(COLUMN_HEIGHT_PROP)),this._lastHeight=value}}customElements.get(TAG_NAME)||customElements.define(TAG_NAME,RStickySidebar);
2//# sourceMappingURL=/cdn/shop/t/506/assets/r-sticky-sidebar.js.map?v=180158486285571629961790287389

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.