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