PageSourceSearch

https://www.kayak.com/c/wp-content/plugins/r9-components/public/PageMenu/scripts.js?ver=35848223867

js kayak.com collected 2026-09-24 07:34:01 UTC 3,950 bytes, 2 lines download raw bytes

1(()=>{"use strict";class t{constructor(t,e={}){this.el=t;this.options=Object.assign({triggerSelector:".accordion-link",targetSelector:".accordion-content",focusElOnShow:null,focusTrap:!1},e),this.trigger=null,this.target=null,this.isOpen=!1,this.boundHandleFocusTrap=this.handleFocusTrap.bind(this),this.init()}init(){this.trigger=this.el.querySelector(this.options.triggerSelector),this.target=this.el.querySelector(this.options.targetSelector),this.trigger&&this.target&&(this.trigger.addEventListener("click",t=>{t.stopPropagation(),JSON.parse(this.trigger.getAttribute("aria-expanded"))?this.hide():this.show()}),window.addEventListener("click",this.handleClosure.bind(this)),window.addEventListener("focusin",this.handleClosure.bind(this)),window.addEventListener("keyup",this.handleClosure.bind(this)))}show(){this.options.focusTrap&&this.target.addEventListener("keydown",this.boundHandleFocusTrap),this.trigger.setAttribute("aria-expanded",!0),this.target.setAttribute("aria-hidden",!1),this.el.classList.add("open"),this.target.classList.remove("is-hidden"),this.target.classList.add("transition-show"),setTimeout(()=>{this.isOpen=!0,this.target.classList.remove("transition-show"),this.target.classList.add("is-shown"),this.options.focusElOnShow&&this.options.focusElOnShow.focus()},300)}hide(){this.isOpen&&(this.options.focusTrap&&this.target.removeEventListener("keydown",this.boundHandleFocusTrap),this.target.classList.remove("is-shown"),this.target.classList.add("transition-hide"),setTimeout(()=>{this.isOpen=!1,this.el.classList.remove("open"),this.target.classList.remove("transition-hide"),this.target.classList.add("is-hidden"),this.trigger.setAttribute("aria-expanded",!1),this.target.setAttribute("aria-hidden",!0),this.options.focusTrap&&this.trigger.focus()},200))}handleClosure(t){return"keyup"===t.type&&"Escape"===t.code?(this.hide(),!1):!this.el.contains(t.target)&&this.hide()}handleFocusTrap(t){"Tab"===t.key&&(t.shiftKey?document.activeElement===this.getFirstFocusableTargetElement()&&(t.preventDefault(),this.getLastFocusableTargetElement().focus()):document.activeElement===this.getLastFocusableTargetElement()&&(t.preventDefault(),this.getFirstFocusableTargetElement().focus()))}getLastFocusableTargetElement(){const t=this.getFocusableTargetElements();return t[t.length-1]}getFirstFocusableTargetElement(){return this.getFocusableTargetElements()[0]}getFocusableTargetElements(){return this.target.querySelectorAll('a:not([disabled]), button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), details:not([disabled]), [tabindex]:not([tabindex="-1"])')}}const e=".collapse-toggle",s=".collapse-panel",i=s;class o{constructor(t,e={}){this.el=t;const s={menuSelector:".menu.menu--js-accordion-toggle",menuItemSelector:".accordion-item",collapseSelector:i};this.options=Object.assign(s,e),this.init()}init(){this.hasMenuCollapse()&&this.initMenuCollapse();const t=this.selectMenus();t&&(this.initMenuItemsTogglers(t),this.convertLinksToAnchorLinks())}hasMenuCollapse(){return this.el.querySelectorAll(this.options.collapseSelector).length>0}selectMenus(){return this.el.querySelectorAll(this.options.menuSelector)}initMenuCollapse(){const i=this.el.querySelectorAll(e);[].forEach.call(i,i=>{const o=i.parentElement;new t(o,{triggerSelector:e,targetSelector:s})})}initMenuItemsTogglers(e){[].forEach.call(e,e=>{const s=e.querySelectorAll(this.options.menuItemSelector);[].forEach.call(s,e=>{new t(e)})})}convertLinksToAnchorLinks(){const t=this.el.querySelectorAll(".menu-item .non-accordion-link[href]");[].forEach.call(t,t=>{let e=URL.parse(t.getAttribute("href"));if(e&&e.hash.length>0){const s=e.protocol+"//"+e.host+e.pathname;location.protocol+"//"+location.host+location.pathname===s&&t.setAttribute("href",e.hash)}})}}(()=>{const t=document.querySelectorAll(".navigation.navigation--page-menu");[].forEach.call(t,t=>{new o(t)})})()})();
2//# sourceMappingURL=scripts.js.map

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.