PageSourceSearch

https://rare-paris.com/cdn/shop/t/3/assets/collection-section.js?v=125026409532283919951745259115

js rare-paris.com collected 2026-10-03 21:35:12 UTC 4,332 bytes, 2 lines download raw bytes

1class CollectionSection extends HTMLElement{constructor(){super(),this.pageOverlayClass="page-overlay",this.activeOverlayBodyClass=`${this.pageOverlayClass}-on`,this.drawer=()=>document.querySelector(".wt-filter"),this.classDrawerActive="wt-filter--drawer-open",this.getCloseButton=()=>document.querySelector(".wt-filter__close"),this.getTrigger=()=>document.querySelector(".collection__filter-trigger"),this.isOpen=()=>document.body.classList.contains(this.activeOverlayBodyClass),this.sectionsTriggers=()=>this.drawer().querySelectorAll(".wt-collapse__trigger"),this.isDrawer=this.dataset.filterPosition==="drawer",this.triggerClasses=["wt-filter__close",this.pageOverlayClass,"collection__filter-trigger"],this.toggleDrawerElements=()=>this.drawer().querySelectorAll(this.drawer().dataset.toggleTabindex),this.overlay=document.createElement("div"),this.breakpoint=1200,this.currentDrawerMode=this.isDrawerMode(),this.init()}init(){this.createOverlay(),this.updateTabindexes(this.isOpen()),document.body.addEventListener("click",e=>{this.triggerClasses.some(cls=>e.target.classList.contains(cls))&&this.toggleDrawer(e)}),this.addEventListener("keydown",e=>{const isTabPressed=e.key==="Tab"||e.keyCode===9||e.code==="Tab",{first,last}=this.getFocusableElements();(e.key==="Escape"||e.keyCode===27||e.code==="Escape")&&this.isOpen()&&this.toggleDrawer(e),isTabPressed&&this.isOpen()&&this.currentDrawerMode&&(e.shiftKey&&document.activeElement===first?(last.focus(),e.preventDefault()):!e.shiftKey&&document.activeElement===last&&(first.focus(),e.preventDefault()))}),window.addEventListener("resize",this.handleResize.bind(this)),this.handleResize()}isDrawerMode(){const width=window.innerWidth;return this.isDrawer||width<=this.breakpoint}handleResize(){const isDrawerMode=this.isDrawerMode();isDrawerMode!==this.currentDrawerMode&&(this.currentDrawerMode=isDrawerMode,isDrawerMode?(this.isOpen()||(this.drawer()?.classList.remove(this.classDrawerActive),document.body.classList.remove(this.activeOverlayBodyClass)),this.updateTabindexes(this.isOpen())):(this.drawer()?.classList.add(this.classDrawerActive),document.body.classList.remove(this.activeOverlayBodyClass),this.updateTabindexes(!0)))}temporaryHideFocusVisible(){document.body.classList.add("no-focus-visible")}getFocusableElements(){const elements=Array.from(this.drawer().querySelectorAll("button, [href], input:not([type='hidden']), select, [tabindex]")).filter(el=>!el.hasAttribute("disabled")&&el.tabIndex>=0&&el.offsetParent!==null);return{focusableElements:elements,first:elements[0],last:elements[elements.length-1]}}updateTabindexes(isOpen){this.currentDrawerMode?isOpen?(this.getCloseButton()?.focus(),this.temporaryHideFocusVisible(),setTabindex(this.sectionsTriggers(),"0"),setTabindex(this.toggleDrawerElements(),"0")):(this.getTrigger()?.focus(),this.temporaryHideFocusVisible(),setTabindex(this.sectionsTriggers(),"-1"),setTabindex(this.toggleDrawerElements(),"-1"),this.closeAllCollapsibleSections()):(setTabindex(this.sectionsTriggers(),"0"),setTabindex(this.toggleDrawerElements(),"0"))}toggleDrawer(e){if(e&&e.preventDefault(),!!this.currentDrawerMode){if(this.isOpen()){const offsetTop=-parseInt(document.body.style.top,10);document.body.style.position="",document.body.style.top="",document.body.style.left="",window.scrollTo(0,offsetTop),this.closeAllCollapsibleSections()}else document.body.style.top=`${-document.documentElement.scrollTop}px`,document.body.style.left="0px";this.drawer()?.classList.toggle(this.classDrawerActive),document.body.classList.toggle(this.activeOverlayBodyClass),this.updateTabindexes(this.isOpen())}}closeAllCollapsibleSections(){this.drawer().querySelectorAll('[data-open="true"]').forEach(section=>{const trigger=section.querySelector(".wt-collapse__trigger");if(trigger){trigger.classList.remove("wt-collapse__trigger--active"),section.dataset.open="false";const focusableElementsWithTabindex=section.querySelectorAll('[tabindex="0"]');setTabindex(focusableElementsWithTabindex,"-1")}})}createOverlay(){document.querySelector(`.${this.pageOverlayClass}`)||(this.overlay?.classList.add(this.pageOverlayClass),document.body.appendChild(this.overlay))}}customElements.define("collection-section",CollectionSection);
2//# sourceMappingURL=/cdn/shop/t/3/assets/collection-section.js.map?v=125026409532283919951745259115

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.