text: window.cdMenu=function(e){function t(e,t){return Array.prototype.forEach.call(e,t)}e||(e={});var n=e.zenBase||"https://zen.coderdojo.com";n=n.replace(/\/$/,""),window.addEventListener("load",function(){function e(){o.setAttribute("data-toggle","closed"),c.className="cd-menu__scrim",t(u,function(e){e.setAttribute("data-toggle","closed")})}function n(){o.setAttribute("data-toggle","open"),c.className="cd-menu__scrim cd-menu__scrim--visible"}var r=document.querySelector(".cd-menu__hamburger"),o=document.querySelector("#cd-menu__sliding-menu-primary"),c=document.querySelector(".cd-menu__scrim"),u=document.querySelectorAll(".cd-menu__sliding-menu-secondary"),i=document.querySelectorAll(".cd-menu__close-button"),d=document.querySelectorAll(".cd-menu__sliding-menu .cd-menu__content > ul > li > span");r.addEventListener("click",function(){"open"===o.getAttribute("data-toggle")?e():n()}),c.addEventListener("click",e),t(i,function(t){t.addEventListener("click",e)}),t(d,function(e){var t=e.parentElement.querySelector(".cd-menu__sliding-menu-secondary"),n=t.querySelector(".cd-menu__back-button");n&&n.addEventListener("click",function(){t.setAttribute("data-toggle","closed")}),e&&e.addEventListener("click",function(){t.setAttribute("data-toggle","open")})})}),window.addEventListener("load",function(){function e(e){e.target!==n&&e.target.parentElement!==n&&n.setAttribute("data-toggle","closed"),t(r,function(t){e.target!==t&&e.target.parentElement!==t&&e.target.parentElement.parentElement!==t&&t.setAttribute("data-toggle","closed")})}var n=document.querySelector(".cd-menu__desktop-nav .cd-menu__profile"),r=document.querySelectorAll(".cd-menu__dropdown");t(r,function(e){e.addEventListener("click",function(){"open"===this.getAttribute("data-toggle")?this.setAttribute("data-toggle","closed"):this.setAttribute("data-toggle","open")})}),document.getElementsByTagName("body")[0].addEventListener("click",e),document.getElementsByTagName("body")[0].addEventListener("touchstart",e)}),window.addEventListener("load",function(){function e(e,t,n,r){var o=new XMLHttpRequest;o.onreadystatechange=function(){if(4===this.readyState&&200===this.status)try{var e=JSON.parse(this.responseText);n(e)}catch(e){r(e)}else 4===this.readyState&&r(this)},o.open(t?"POST":"GET",e,!0),o.withCredentials=!0,t&&o.setRequestHeader("Content-type","application/json"),o.send(t)}function r(e){e.style.display="block",e.setAttribute("style","display: block !important;")}function o(){t(i,r)}function c(e){for(var t=0,n=0,r=!1,o=["mentor","champion","parent-guardian"];!r&&n<e.length;){for(var c=e[n];!r&&t<c.userTypes.length;){var u=c.userTypes[t];o.indexOf(u)>-1&&(r=!0),t+=1}n+=1}return r}var u=document.querySelectorAll(".cd-menu__cdf-admin-link"),i=document.querySelectorAll(".cd-menu__account"),d=document.querySelectorAll(".cd-menu__profile"),l=document.querySelectorAll(".cd-menu__profile-name"),a=document.querySelectorAll(".cd-menu__profile-link"),s=document.querySelectorAll(".cd-menu__profile-pic"),m=document.querySelector(".cd-menu__desktop-nav .cd-menu__profile"),f=document.querySelectorAll(".cd-menu__referer-link"),p=document.querySelectorAll(".cd-menu__e-learning-link"),g=document.querySelectorAll(".cd-menu__parent-link");m.addEventListener("click",function(){"open"===this.getAttribute("data-toggle")?this.setAttribute("data-toggle","closed"):this.setAttribute("data-toggle","open")}),e(n+"/api/2.0/users/instance",null,function(i){i&&i.user?(t(l,function(e){e.innerText=i.user.name}),t(a,function(e){e.href=n+"/profile/"+i.user.id}),t(s,function(e){e.style.backgroundImage="url("+n+"/api/2.0/profiles/"+i.user.profileId+"/avatar_img)"}),i.user.roles.indexOf("cdf-admin")!==-1&&t(u,r),t(d,function(e){e.style.display="flex"}),t(f,function(e){e.addEventListener("click",function(e){e.preventDefault(),window.location.href=this.href+"?referer="+encodeURIComponent(window.location)})}),e(n+"/api/2.0/profiles/children-for-user/"+i.user.id,null,function(e){e.length>0&&t(g,r)}),e(n+"/api/2.0/dojos/users",'{"query": {"userId":"'+i.user.id+'"}}',function(e){var n=JSON.parse(i.user.initUserType);if(e.push({userTypes:[n.name]}),e&&e.length>0){var o=c(e);o&&t(p,r)}})):o()},o)})};