1(function () { 2 var MENU_ID = "comp-izlfmv4g"; 3 var ITEMS_ID = "comp-izlfmv4gitemsContainer"; 4 5 function buildStandardNav() { 6 var host = document.getElementById(MENU_ID); 7 if (!host || document.getElementById("mf-standard-nav")) return; 8 9 var items = host.querySelectorAll("#" + ITEMS_ID + " > li.wixui-dropdown-menu__item"); 10 if (!items.length) return; 11 12 var nav = document.createElement("nav"); 13 nav.id = "mf-standard-nav"; 14 nav.className = "mf-standard-nav"; 15 nav.setAttribute("aria-label", "Site"); 16 17 var list = document.createElement("ul"); 18 list.className = "mf-nav-list"; 19 20 items.forEach(function (item) { 21 if (item.id === "comp-izlfmv4g__more__") return; 22 23 var labelNode = item.querySelector(".JS76Uv"); 24 var label = labelNode ? labelNode.textContent.replace(/\s+/g, " ").trim() : ""; 25 if (!label) return; 26 27 var topLink = item.querySelector(":scope > a[data-testid='linkElement']"); 28 var subRoot = item.querySelector(":scope > ul"); 29 var subLinks = subRoot ? subRoot.querySelectorAll("a[href]") : []; 30 31 var li = document.createElement("li"); 32 if (subLinks.length) { 33 li.className = "mf-has-children"; 34 var trigger = document.createElement("button"); 35 trigger.type = "button"; 36 trigger.className = "mf-nav-label"; 37 trigger.textContent = label; 38 trigger.setAttribute("aria-haspopup", "true"); 39 trigger.setAttribute("aria-expanded", "false"); 40 41 var sub = document.createElement("ul"); 42 sub.className = "mf-submenu"; 43 subLinks.forEach(function (oldA) { 44 var subLi = document.createElement("li"); 45 var a = document.createElement("a"); 46 a.href = oldA.getAttribute("href"); 47 a.textContent = oldA.textContent.replace(/\s+/g, " ").trim(); 48 var target = oldA.getAttribute("target"); 49 if (target && target !== "_self") a.target = target; 50 if (oldA.rel) a.rel = oldA.rel; 51 subLi.appendChild(a); 52 sub.appendChild(subLi); 53 }); 54 55 li.appendChild(trigger); 56 li.appendChild(sub); 57 58 li.addEventListener("mouseenter", function () { 59 openItem(li); 60 }); 61 li.addEventListener("mouseleave", function () { 62 closeItem(li); 63 }); 64 trigger.addEventListener("click", function (e) { 65 e.preventDefault(); 66 e.stopPropagation(); 67 if (li.classList.contains("mf-open")) closeItem(li); 68 else openItem(li); 69 }); 70 } else if (topLink) { 71 var a = document.createElement("a"); 72 a.href = topLink.getAttribute("href"); 73 a.textContent = label; 74 var target = topLink.getAttribute("target"); 75 if (target && target !== "_self") a.target = target; 76 li.appendChild(a); 77 } else { 78 return; 79 } 80 81 list.appendChild(li); 82 }); 83 84 nav.appendChild(list); 85 host.classList.remove("hidden-during-prewarmup"); 86 host.innerHTML = ""; 87 host.appendChild(nav); 88 host.removeAttribute("tabindex"); 89 } 90 91 function openItem(li) { 92 document.querySelectorAll("#mf-standard-nav .mf-open").forEach(function (el) { 93 closeItem(el); 94 }); 95 li.classList.add("mf-open"); 96 var btn = li.querySelector(".mf-nav-label"); 97 if (btn) btn.setAttribute("aria-expanded", "true"); 98 } 99 100 function closeItem(li) { 101 li.classList.remove("mf-open"); 102 var btn = li.querySelector(".mf-nav-label"); 103 if (btn) btn.setAttribute("aria-expanded", "false"); 104 } 105 106 function init() { 107 document.querySelectorAll(".hidden-during-prewarmup").forEach(function (el) { 108 el.classList.remove("hidden-during-prewarmup"); 109 }); 110 buildStandardNav(); 111 112 document.addEventListener("click", function (e) { 113 if (!e.target.closest("#mf-standard-nav")) { 114 document.querySelectorAll("#mf-standard-nav .mf-open").forEach(closeItem); 115 } 116 }); 117 } 118 119 if (document.readyState === "loading") { 120 document.addEventListener("DOMContentLoaded", init); 121 } else { 122 init(); 123 } 124})();
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.