( function( window, document ) {
  function web_graphic_designer_keepFocusInMenu() {
    document.addEventListener( 'keydown', function( e ) {
      const web_graphic_designer_nav = document.querySelector( '.sidenav' );
      if ( ! web_graphic_designer_nav || ! web_graphic_designer_nav.classList.contains( 'open' ) ) {
        return;
      }
      const elements = [...web_graphic_designer_nav.querySelectorAll( 'input, a, button' )],
        web_graphic_designer_lastEl = elements[ elements.length - 1 ],
        web_graphic_designer_firstEl = elements[0],
        web_graphic_designer_activeEl = document.activeElement,
        tabKey = e.keyCode === 9,
        shiftKey = e.shiftKey;
      if ( ! shiftKey && tabKey && web_graphic_designer_lastEl === web_graphic_designer_activeEl ) {
        e.preventDefault();
        web_graphic_designer_firstEl.focus();
      }
      if ( shiftKey && tabKey && web_graphic_designer_firstEl === web_graphic_designer_activeEl ) {
        e.preventDefault();
        web_graphic_designer_lastEl.focus();
      }
    } );
  }
  web_graphic_designer_keepFocusInMenu();
} )( window, document );