PageSourceSearch

https://newgrowthpress.com/cdn/shop/t/12/assets/focus.js?v=128104998552316998751783622928

js newgrowthpress.com collected 2026-10-02 04:04:40 UTC 2,206 bytes, 2 lines download raw bytes

1const trapFocusHandlers={};function getFocusableElements(container){return Array.from(container.querySelectorAll("summary, a[href], button:enabled, [tabindex]:not([tabindex^='-']):not([unless-el]), [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe")).filter(el=>el.offsetParent!==null&&el.tabIndex>=0&&!el.disabled&&!el.classList.contains("hidden"))}export function trapFocus(container,elementToFocus=container){removeTrapFocus();const focusable=getFocusableElements(container);if(!focusable.length)return;const first=focusable[0],last=focusable[focusable.length-1];trapFocusHandlers.keydown=event=>{if(event.key!=="Tab")return;const activeEl=document.activeElement;!event.shiftKey&&activeEl===last?(event.preventDefault(),first?.focus()):event.shiftKey&&(activeEl===first||activeEl===container)&&(event.preventDefault(),last?.focus())},trapFocusHandlers.focusin=event=>{event.target instanceof Node&&!container.contains(event.target)&&(event.stopPropagation(),first?.focus())},document.addEventListener("keydown",trapFocusHandlers.keydown,!0),document.addEventListener("focusin",trapFocusHandlers.focusin,!0),elementToFocus?.focus({focusVisible:!1})}export function removeTrapFocus(elementToFocus=null){trapFocusHandlers.keydown&&document.removeEventListener("keydown",trapFocusHandlers.keydown,!0),trapFocusHandlers.focusin&&document.removeEventListener("focusin",trapFocusHandlers.focusin,!0),elementToFocus?.focus()}export function cycleFocus(items,increment){let targetIndex=items.findIndex(item=>item.matches(":focus"))+increment;targetIndex>=items.length?targetIndex=0:targetIndex<0&&(targetIndex=items.length-1);const targetItem=items[targetIndex];targetItem&&targetItem.focus()}export function elFocus(element,focusVisible=!0,preventScroll=!1){element?.focus({focusVisible,preventScroll})}if(!("ontouchstart"in window)&&!(navigator.maxTouchPoints>0)){const controller=new AbortController;document.addEventListener("keydown",e=>{e.key==="Tab"&&(document.documentElement.classList.add("hdt-a11y"),controller.abort())},{capture:!0,signal:controller.signal})}
2//# sourceMappingURL=/cdn/shop/t/12/assets/focus.js.map?v=128104998552316998751783622928

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.