PageSourceSearch

https://floydhome.com/cdn/shop/t/354/assets/component-tab.js?v=161680444551404056471700080795

js floydhome.com collected 2026-09-25 20:14:17 UTC 3,704 bytes, 2 lines download raw bytes

1class TabElement extends HTMLElement{constructor(){super(),this.tabs=[...this.querySelectorAll(".js-tab")],this.tabList=this.querySelector(".js-tablist"),this.tabPanels=[...this.querySelectorAll(".js-tabpanel")],this.mobileOnly=this.dataset.mobileOnly,this.tabs.forEach(tab=>{tab.addEventListener("click",(event2=>{this.showTabPanel(event2,tab)}).bind(this)),tab.addEventListener("click",this.addCookies)}),this.tabList.addEventListener("keydown",e=>{this.onKeydown(e)}),this.mobileOnly&&(this.resizeFunction(),window.addEventListener("resize",this.resizeFunction)),this.mobileOnly&&(this.checkCookie(),window.addEventListener("resize",this.checkCookie))}get autofocus(){return this.getAttribute("autofocus")}setCookie=(name,value,options={})=>{options={path:"/"},options.expires instanceof Date&&(options.expires=options.expires.toUTCString());let updatedCookie=encodeURIComponent(name)+"="+encodeURIComponent(value);for(let optionKey in options){updatedCookie+="; "+optionKey;let optionValue=options[optionKey];optionValue!==!0&&(updatedCookie+="="+optionValue)}document.cookie=updatedCookie};deleteCookie=name=>{this.setCookie(name,"",{"max-age":-1})};getCookie=name=>{let matches=document.cookie.match(new RegExp("(?:^|; )"+name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return matches?decodeURIComponent(matches[1]):void 0};addCookies=()=>{let id=event.target.id;this.deleteCookie("activeTab"),this.setCookie("activeTab",id,{secure:!0,"max-age":3600})};checkCookie=()=>{let mobile=window.matchMedia("(max-width: 429px)").matches,activeTab=this.getCookie("activeTab");if(activeTab.length!==0)if(mobile){let tab=document.querySelector("#"+activeTab);this.showTabPanel(tab)}else this.deleteCookie("activeTab")};showTabPanel=(event2,button)=>{event2.preventDefault(),this.tabPanels.forEach(tabPanel=>{tabPanel.classList.add("hidden"),tabPanel.removeAttribute("tabindex"),tabPanel.setAttribute("aria-hidden",!0)}
1),this.tabs.forEach(tab=>{tab.setAttribute("aria-selected","false"),tab.classList.remove("active")});var tabPanelToOpen=document.getElementById(button.getAttribute("aria-controls"));tabPanelToOpen.classList.remove("hidden"),tabPanelToOpen.setAttribute("tabindex",-1),tabPanelToOpen.setAttribute("aria-hidden",!1),this.autofocus||tabPanelToOpen.focus(),button.setAttribute("aria-selected","true"),button.classList.add("active")};onKeydown=e=>{if(e.keyCode===39||e.keyCode===37){var selected=document.activeElement;e.keyCode===39?selected.nextElementSibling&&(selected.nextElementSibling.click(),selected.nextElementSibling.focus()):e.keyCode===37&&selected.previousElementSibling&&(selected.previousElementSibling.click(),selected.previousElementSibling.focus())}};resizeFunction=()=>{const mobile=window.matchMedia("(max-width: 429px)").matches;mobile?(this.tabList.classList.remove("hidden"),this.tabList.setAttribute("aria-hidden",!1)):(this.tabList.classList.add("hidden"),this.tabList.setAttribute("aria-hidden",!0)),this.tabPanels.forEach((tabPanel,i)=>{const tabId=tabPanel.id.split("-")[0];mobile?(tabPanel.classList.add("hidden"),tabPanel.setAttribute("aria-hidden",!0),i==0&&tabPanel.classList.remove("hidden"),i==0&&tabPanel.setAttribute("aria-hidden",!1),tabPanel.setAttribute("role","tabpanel"),tabPanel.setAttribute("aria-labelledby",`${tabId}-tab`)):(tabPanel.classList.remove("hidden"),tabPanel.setAttribute("aria-hidden",!1),tabPanel.removeAttribute("role"),tabPanel.removeAttribute("aria-labelledby"))}
1),this.tabs.forEach((tab,i)=>{mobile&&(tab.classList.remove("active"),i==0&&tab.classList.add("active"))})}}customElements.define("tab-element",TabElement);
2//# sourceMappingURL=/cdn/shop/t/354/assets/component-tab.js.map?v=161680444551404056471700080795

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.