(function(){"use strict";/**
 * @copyright  (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */(function(){function v(s,r){var n=s.querySelector("ul");n&&(n.setAttribute("aria-hidden","false"),n.classList.add(r.menuHoverClass))}function h(s,r){var n=s.querySelector("ul");n&&(n.setAttribute("aria-hidden","true"),n.classList.remove(r.menuHoverClass))}function b(s){var r={menuHoverClass:"show-menu",dir:"ltr"},n=s.querySelectorAll(":scope > li");n.forEach(function(a){var c=a.querySelector("a");c&&(c.tabIndex="0",c.addEventListener("mouseover",v(a,r)),c.addEventListener("mouseout",h(a,r)));var d=a.querySelector("span");d&&(d.tabIndex="0",d.addEventListener("mouseover",v(a,r)),d.addEventListener("mouseout",h(a,r))),a.addEventListener("mouseover",function(t){var i=t.target,e=i.querySelector("ul");e&&(e.setAttribute("aria-hidden","false"),e.classList.add(r.menuHoverClass))}),a.addEventListener("mouseout",function(t){var i=t.target,e=i.querySelector("ul");e&&(e.setAttribute("aria-hidden","true"),e.classList.remove(r.menuHoverClass))}),a.addEventListener("focus",function(t){var i=t.target,e=i.querySelector("ul");e&&(e.setAttribute("aria-hidden","true"),e.classList.add(r.menuHoverClass))}),a.addEventListener("blur",function(t){var i=t.target,e=i.querySelector("ul");e&&(e.setAttribute("aria-hidden","false"),e.classList.remove(r.menuHoverClass))}),a.addEventListener("keydown",function(t){var i=t.key,e=t.target,u=e.parentElement,f=u.parentElement,o=u.previousElementSibling,l=u.nextElementSibling;if(o||(o=f.children[f.children.length-1]),!l){var g=f.children;l=g[0]}switch(i){case"ArrowLeft":t.preventDefault(),r.dir==="rtl"?l.children[0].focus():o.children[0].focus();break;case"ArrowRight":t.preventDefault(),r.dir==="rtl"?o.children[0].focus():l.children[0].focus();break;case"ArrowUp":{t.preventDefault();var m=u.parentElement.parentElement;m.nodeName==="LI"?m.children[0].focus():o.children[0].focus();break}case"ArrowDown":if(t.preventDefault(),u.classList.contains("parent")){var L=u.querySelector("ul");if(L!=null){var y=L.querySelector("li");y.children[0].focus()}else l.children[0].focus()}else l.children[0].focus();break}})})}document.addEventListener("DOMContentLoaded",function(){var s=document.querySelectorAll(".nav");[].forEach.call(s,function(r){b(r)})})})()})();
