PageSourceSearch

https://www.cocoahyundai.com/resources/components/navigation/navig….9.1438c351f0114d50b33068f234773d29b19a5961

js cocoahyundai.com collected 2026-10-04 11:59:07 UTC 18,202 bytes, 1 lines download raw bytes

1"use strict";var __awaiter=this&&this.__awaiter||function(u,e,t,i){function s(r){return r instanceof t?r:new t(function(n){n(r)})}return new(t||(t=Promise))(function(r,n){function c(l){try{a(i.next(l))}catch(d){n(d)}}function o(l){try{a(i.throw(l))}catch(d){n(d)}}function a(l){l.done?r(l.value):s(l.value).then(c,o)}a((i=i.apply(u,e||[])).next())})},__generator=this&&this.__generator||function(u,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,s,r,n;return n={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function c(a){return function(l){return o([a,l])}}function o(a){if(i)throw new TypeError("Generator is already executing.");for(;n&&(n=0,a[0]&&(t=0)),t;)try{if(i=1,s&&(r=a[0]&2?s.return:a[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;switch(s=0,r&&(a=[a[0]&2,r.value]),a[0]){case 0:case 1:r=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,s=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){t.label=a[1];break}if(a[0]===6&&t.label<r[1]){t.label=r[1],r=a;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(a);break}r[2]&&t.ops.pop(),t.trys.pop();continue}a=e.call(u,t)}catch(l){a=[6,l],s=0}finally{i=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Navigation=(function(){function u(){var e=this;this._isOrionNav=!1,this._scrollHeight=0,this._megaMenuContainerDistanceFromViewportTop=0,this._startX=0,this._startY=0,this._menuShouldOpenOnHover=!0,this._navHasMegaMenu=!1,this._submenus=[],this._openMenu=null,this._headerScrolls=!1,this._initializeSticky=function(){e._nav.dataset.stickyOffset="".concat(e._header.offsetHeight)},this._handleScroll=function(){var t=e._nav.dataset.stickyOffset;typeof t=="string"&&(t=Number.parseInt(t)),window.innerWidth<=991&&(window.pageYOffset>t?e._enableSticky():e._disableSticky())},this._handleResize=function(){e._initializeSticky(),window.innerWidth>=992||window.pageYOffset===0?e._disableSticky():e._enableSticky()},this._enableSticky=function(){e._headerWrapper.style.marginBottom=e._navHeader.offsetHeight+"px",e._body.classList.add("sticky-is-enabled")},this._disableSticky=function(){e._headerWrapper.style.marginBottom="0",e._body.classList.remove("sticky-is-enabled")},this._enableHover=function(){e._hoverItems.forEach(function(t){var i=t.querySelector("a.navlink");i&&(i.addEventListener("mouseover",e._hoverOpen),i.addEventListener("mouseout",e._hoverClose))})},this._disableHover=function(){e._hoverItems.forEach(function(t){var i=t.querySelector("a.navlink");i&&(i.removeEventListener("mouseover",e._hoverOpen),i.removeEventListener("mouseout",e._hoverClose),t.classList.remove("open"))})},this._enableMobile=function(){document.querySelectorAll(".navbar-nav .hideOnMobile").forEach(function(t){return t.remove()}),e._disableHover(),e._horizontalNav.setAttribute("aria-hidden","true"),u.removeChildrenFromTabOrder(e._horizontalNav)},this._enableDesktop=function(){document.querySelectorAll(".navbar-nav .hideOnDesktop").forEach(function(t){return t.remove()}),e._menuShouldOpenOnHover?e._enableHover():e._disableHover()},this._captureSwipe=function(t){var i=t.changedTouches[0];e._startX=i.pageX,e._startY=i.pageY},this._evaluateSwipe=function(t){var i=t.changedTouches[0],s=i.pageX-e._startX,r=i.pageY-e._startY;s>=u.threshold&&Math.abs(r)<u.threshold/2&&(e._closeSidebar(),t.preventDefault())},this._openSidebar=function(){e._scrollHeight=window.pageYOffset,e._body.style.top=-e._scrollHeight+"px",e._body.dataset.scroll="".concat(e._scrollHeight),e._body.classList.add("sidebar-is-open"),e._wrapper.insertBefore(e._backdrop,e._wrapper.childNodes[0]),document.addEventListener("keydown",e._handleEsc),e._backdrop.classList.add("in"),e._backdrop.classList.remove("invisible"),u.reAddChildrenToTabOrder(e._verticalNav),e._verticalNav.removeAttribute("aria-hidden"),e._isOrionNav&&e._navToggle.setAttribute("aria-expanded","true")},this._closeSidebar=function(){e._body.classList.remove("sidebar-is-open"),e._backdrop.classList.remove("in"),document.querySelectorAll("#vertical-navbar-collapse .navbar-nav .mega-menu-container").forEach(function(t){t.parentElement.children[0].classList.contains("active")||t.classList.remove("open")}),setTimeout(function(){e._backdrop.classList.add("invisible"),e._backdrop.remove()},250),window.scrollTo({top:e._scrollHeight}),e._verticalNav.setAttribute("aria-hidden","true"),u.removeChildrenFromTabOrder(e._verticalNav),e._isOrionNav&&e._navToggle.setAttribute("aria-expanded","fal
1se")},this._hoverOpen=function(t){var i;(i=t.currentTarget)===null||i===void 0||i.parentElement.classList.add("open")},this._hoverClose=function(t){var i,s;(s=(i=t.currentTarget)===null||i===void 0?void 0:i.parentElement)===null||s===void 0||s.classList.remove("open")},this._handleEsc=function(t){t.key==="Escape"&&e._closeSidebar()},this._handleMenuOpen=function(t){var i,s,r,n,c=(i=e._openMenu)===null||i===void 0?void 0:i._menu.parentElement.classList.contains("mega-menu-container__nav-list"),o=c&&((s=e._openMenu)===null||s===void 0?void 0:s._megaMenuContainer.classList.contains("open")),a=!c&&((r=e._openMenu)===null||r===void 0?void 0:r._menu.parentElement.classList.contains("open"));(o||a)&&((n=e._openMenu)===null||n===void 0||n.closeSubmenu(!0,!1)),e._openMenu=t},this.initialize()}return u.prototype.initialize=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){switch(e.label){case 0:return[4,this._initializeNavComponentVariables()];case 1:return e.sent(),this._initializeSticky(),this._enableMenuForDeviceType(),this._initializeSubmenus(),this._navHasMegaMenu?[4,this._initializeMegaMenuStyling()]:[3,3];case 2:e.sent(),this._headerScrolls?this._makeMegaMenuScrollWithHeader():this._makeMegaMenuFixedWithHeader(),e.label=3;case 3:return this._addEventListeners(),[2]}})})},u.prototype.doBeforeNextRepaint=function(e){return new Promise(function(t){requestAnimationFrame(function(){e(),t()})})},u.prototype._initializeNavComponentVariables=function(){var e,t;return __awaiter(this,void 0,void 0,function(){var i=this;return __generator(this,function(s){switch(s.label){case 0:return this._body=document.body,this._wrapper=document.getElementById("content"),this._header=document.querySelector("header"),this._nav=document.getElementById("nav"),this._offCanvasNav=document.getElementById("nav-sidebar"),this._headerWrapper=document.querySelector(".headerWrapper"),this._navHeader=document.getElementById("navbar-header"),this._hoverItems=this._nav.querySelectorAll(".dropdown"),this._navToggle=document.getElementById("open-right"),this._isOrionNav=(t=(e=this._navToggle)===null||e===void 0?void 0:e.hasAttribute("data-orion-nav"))!==null&&t!==void 0?t:!1,this._horizontalNav=document.getElementById("horizontal-navbar-collapse"),this._verticalNav=document.getElementById("vertical-navbar-collapse"),this._collapseItems=this._nav.querySelectorAll(".dropdown-has-children"),this._sidebarCloseBtn=this._offCanvasNav.querySelector(".navbar-close-button"),this._menuShouldOpenOnHover=this._nav.dataset.openMenuOnHover==="True",[4,this.doBeforeNextRepaint(function(){i._megaMenuContainerDistanceFromViewportTop=i._headerWrapper.getBoundingClientRect().bottom})];case 1:return s.sent(),this._backdrop=document.createElement("div"),this._backdrop.id="navbar-backdrop",this._backdrop.className="fade invisible",this._navHasMegaMenu=this._nav.classList.contains("mega-menu-nav"),[4,this.doBeforeNextRepaint(function(){i._headerScrolls=getComputedStyle(i._headerWrapper).position!=="fixed"})];case 2:return s.sent(),[2]}})})},u.prototype._enableMenuForDeviceType=function(){window.matchMedia("(max-width: 991px)").matches?this._enableMobile():this._enableDesktop()},u.prototype._makeMegaMenuScrollWithHeader=function(){var e=document.querySelectorAll(".full.mega-menu-nav .mega-menu-container--fixed");e.forEach(function(t){t.classList.remove("mega-menu-container--fixed")})},u.prototype._makeMegaMenuFixedWithHeader=function(){var e=this,t=document.querySelectorAll(".full.mega-menu-nav .mega-menu-container--fixed");t.forEach(function(i){i.style.top="".concat(e._megaMenuContainerDistanceFromViewportTop,"px")})},u.prototype._menuScrollingObserver=function(e){var t=this,i=new IntersectionObserver(function(s){var r;s[0].intersectionRatio===0&&((r=t._openMenu)===null||r===void 0||r.closeSubmenu(!1,!1))});i.observe(e)},u.prototype._initializeSubmenus=function(){var e=this;this._collapseItems.forEach(function(t){var i=t.firstElementChild;if(i){var s=i.dataset.menuName,r=document.querySelector('.mega-menu-container--desktop[data-menu-name="'.concat(s,'"]'));
1e._menuScrollingObserver(t),e._submenus.push(new Submenu(i,e._menuShouldOpenOnHover,r,e._handleMenuOpen,e._isOrionNav))}})},u.prototype._addEventListeners=function(){this._verticalNav.addEventListener("touchstart",this._captureSwipe,{passive:!0}),this._verticalNav.addEventListener("touchmove",this._evaluateSwipe,{passive:!0}),this._navToggle.addEventListener("click",this._openSidebar),this._backdrop.addEventListener("click",this._closeSidebar),this._backdrop.addEventListener("touchstart",this._captureSwipe,{passive:!0}),this._backdrop.addEventListener("touchmove",this._evaluateSwipe,{passive:!0}),this._sidebarCloseBtn.addEventListener("click",this._closeSidebar),this._sidebarCloseBtn.addEventListener("touchend",this._closeSidebar,{passive:!0}),window.addEventListener("scroll",this._handleScroll),window.addEventListener("resize",this._handleResize),this._isOrionNav&&this._addOrionSidebarKeyboardListeners(),$(".nav-sidebar .dropdown-menu").on("show.bs.collapse",function(){var e,t,i=this.parentElement.parentElement,s=i.classList.contains("mega-menu-container");s?(i.classList.toggle("open"),(e=i.previousElementSibling)===null||e===void 0||e.classList.add("active")):(t=this.previousElementSibling)===null||t===void 0||t.classList.add("active")}),$(".nav-sidebar .dropdown-menu").on("hide.bs.collapse",function(){var e,t,i=this.parentElement.parentElement,s=i.classList.contains("mega-menu-container");s?(i.classList.toggle("open"),(e=i.previousElementSibling)===null||e===void 0||e.classList.remove("active")):(t=this.previousElementSibling)===null||t===void 0||t.classList.remove("active")})},u.prototype._initializeMegaMenuStyling=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){switch(e.label){case 0:return[4,this._styleMegaMenuBackgroundColorVariable()];case 1:return e.sent(),this._styleMegaMenuMaxHeight(),[2]}})})},u.prototype._styleMegaMenuBackgroundColorVariable=function(){return __awaiter(this,void 0,void 0,function(){var e,t,i;return __generator(this,function(s){switch(s.label){case 0:return e=null,t=document.querySelectorAll(".full.mega-menu-nav .dropdown-has-children"),i=Array.from(t).find(function(r){return e=r.querySelector(".dropdown-menu"),e!==null}),i?[4,this.doBeforeNextRepaint(function(){i.classList.add("open"),e.style.height="0px";var r="";r=getComputedStyle(i.querySelector("a")).backgroundColor;var n=document.documentElement;n.style.setProperty("--submenu-text-background-color",r),i.classList.remove("open"),e.style.height="unset"})]:[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}})})},u.prototype._styleMegaMenuMaxHeight=function(){var e=this,t=this._megaMenuContainerDistanceFromViewportTop,i="calc(98vh - ".concat(t,"px)"),s=document.querySelectorAll(".full.mega-menu-nav .mega-menu-container--desktop");s.forEach(function(r){return __awaiter(e,void 0,void 0,function(){return __generator(this,function(n){switch(n.label){case 0:return[4,this.doBeforeNextRepaint(function(){r.style.maxHeight=i,r.style.opacity="0",r.classList.add("open");var c=r.querySelector(".mega-menu-container__content"),o=c.children[1],a="";a=getComputedStyle(o).height,r.style.height=a,r.classList.remove("open"),r.style.opacity="1"})];case 1:return n.sent(),[2]}})})})},u.prototype._addOrionSidebarKeyboardListeners=function(){this._offCanvasNav.querySelectorAll("[role='button'][data-bs-toggle='collapse']").forEach(function(e){e.addEventListener("keydown",function(t){t.key===" "&&(t.preventDefault(),t.repeat||e.click())})})},u.removeChildrenFromTabOrder=function(e){var t=e.querySelectorAll("a button");t.forEach(function(i){return i.setAttribute("tabindex","-1")})},u.reAddChildrenToTabOrder=function(e){var t=e.querySelectorAll("[tabindex='-1']");t.forEach(function(i){return i.removeAttribute("tabindex")})},u.toggleExpanded=function(e){e.getAttribute("aria-expanded")==="true"?e.setAttribute("aria-expanded","false"):e.setAttribute("aria-expanded","true")},u.threshold=50,u})(),Submenu=(function(){function u(e,t,i,s,r){r===void 0&&(r=!1);var n=this;this.handleMenuOpen=s,this.isOrionNav=r,this._megaMenuContainer=null,this._activeIndex=0,this._firstLetters=[],this._isHovering=!1,this._openedByClick=!1,this._addEventListeners=function(){var o;n._trigger.addEventListener("click",n._handleTriggerClick),n._trigger.addEventListener("keydown",function(a){(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n._trigger.click())}),n._menu.addEventListener("keydown",n._handleMenuNavigation),(o=n._megaMenuLinkItems)===null||o===void 0||o.forEach(function(a){a.addEventListener("keydown",function(l){(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),a.click())})}),n._menuShouldOpenOnHover&&n._addOpenOnHoverEventListeners(),n._submenuHasMegaMenu&&n._addMegaMenuCloseBtnListeners()},this._handleTriggerClick=function(o){n._isHovering||(n._openedByClick?n.closeSubmenu(!1,!0):(n._openedByClick=!0,n._openSubmenu(!0)))},this._handleHoverOver=function(){n._openedByClick||(n._isHovering=!0,n._openSubmenu(!1))},this._handleHoverOut=function(){var o,a,l;n.closeSubmenu(!1),n.isOrionNav&&((l=(a=(o=window.bootstrap)===null||o===void 0?void 0:o.Dropdown)===null||a===void 0?void 0:a.getInstance(n._trigger))===null||l===void 0||l.hide())},this._openSubmenu=function(o){o||n._trigger.parentElement.classList.add("open"),n._trigger.setAttribute("aria-expanded","true"),o&&(n.handleMenuOpen(n),n._submenuHasMegaMenu&&n._openMegaMenu(),n._focusFirstItem()),document.addEventListener("keydown",n._handleEscape)},this.closeSubmenu=function(o,a){o===void 0&&(o=!0),a===void 0&&(a=!1),n._trigger.setAttribute("aria-expanded","fal
1se"),a||n._trigger.parentElement.classList.remove("open"),n._submenuHasMegaMenu&&n._closeMegaMenu(),n._isHovering=!1,n._openedByClick=!1,o&&n._trigger.focus(),document.removeEventListener("keydown",n._handleEscape)},this._handleEscape=function(o){o.key==="Escape"&&(o.preventDefault(),n.closeSubmenu())},this._handleMenuNavigation=function(o){var a;if(o.key!=="Enter"){if(o.key===" "){(a=document.activeElement)===null||a===void 0||a.click();return}if(o.key.length===1){n._focusNextByFirstLetter(o.key.toLowerCase());return}if(u.NavigationKeys.includes(o.key))switch(o.preventDefault(),o.stopImmediatePropagation(),o.key){case"Home":n._focusFirstItem();break;case"End":n._focusLastItem();break;case"ArrowLeft":case"ArrowUp":n._activeIndex===0?n._focusLastItem():n._focusPrevItem();break;case"ArrowRight":case"ArrowDown":n._activeIndex===n._menuItems.length-1?n._focusFirstItem(0):n._focusNextItem()}}},this._focusFirstItem=function(o){o===void 0&&(o=250),setTimeout(function(){n._menuItems[0].focus(),n._activeIndex=0},o)},this._focusLastItem=function(){var o=n._menuItems.length-1;n._menuItems[o].focus(),n._activeIndex=o},this._focusPrevItem=function(){var o=n._activeIndex-1;n._menuItems[o].focus(),n._activeIndex=o},this._focusNextItem=function(){var o=n._activeIndex+1;n._menuItems[o].focus(),n._activeIndex=o},this._focusNextByFirstLetter=function(o){var a=n._firstLetters.indexOf(o,n._activeIndex+1);a===-1&&(a=n._firstLetters.indexOf(o)),a>-1&&(n._menuItems[a].focus(),n._activeIndex=a)};var c=null;if(this._megaMenuContainer=i,this._trigger=e,this._menuShouldOpenOnHover=t,this._submenuHasMegaMenu?(c=i.querySelector(".dropdown-mega-menu"),this._megaMenuLinkItems=i.querySelectorAll("a"),this._addMegaMenuListeners()):c=e.parentElement.querySelector(".dropdown-menu"),!c){console.error("Menu button ".concat(e.id," is marked up as if it has a sub menu but does not."));return}this._menu=c,this._menuItems=c.querySelectorAll("[role='menuitem']"),this._menuItems.forEach(function(o){n._firstLetters.push(o.textContent.trim().substring(0,1).toLowerCase())}),this._addEventListeners()}return Object.defineProperty(u.prototype,"_submenuHasMegaMenu",{get:function(){return this._megaMenuContainer!==null},enumerable:!1,configurable:!0}),u.prototype._addOpenOnHoverEventListeners=function(){this._trigger.addEventListener("mouseover",this._handleHoverOver),this._trigger.addEventListener("mouseout",this._handleHoverOut),this._menu.addEventListener("mouseover",this._handleHoverOver),this._menu.addEventListener("mouseout",this._handleHoverOut)},u.prototype._addMegaMenuCloseBtnListeners=function(){var e=this,t=this._megaMenuContainer.querySelector(".mega-menu-container__close");t.addEventListener("click",function(r){e.closeSubmenu()}),t.addEventListener("keydown",function(r){r.key==="Tab"&&r.shiftKey&&(r.preventDefault(),e._focusLastItem())});var i={attributes:!0,childList:!0,subtree:!0},s=new MutationObserver(function(){setTimeout(function(){e._trigger.parentElement.classList.contains("open")?e._openMegaMenu():e._closeMegaMenu()},100)});s.observe(this._trigger.parentElement,i)},u.prototype._addMegaMenuListeners=function(){var e=this;this._megaMenuContainer.addEventListener("keydown",function(t){t.target===e._megaMenuContainer&&t.key==="Tab"&&t.shiftKey&&e._trigger.parentElement.nextElementSibling.firstElementChild.focus()})},u.prototype._openMegaMenu=function(){this._megaMenuContainer.classList.add("open")},u.prototype._closeMegaMenu=function(){var e;(e=this._megaMenuContainer)===null||e===void 0||e.classList.remove("open")},u.NavigationKeys=["End","Home","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"],u})();typeof window<"u"&&(window.Navigation=Navigation,DoUtility.SelfInstantiateOnLoad(Navigation)),typeof module<"u"&&module.exports&&(module.exports={Navigation,Submenu});

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.