code: function setFocusedElement(cstOption) {
      if (focusedElement) {
        focusedElement.classList.remove(builderParams.hasFocusClass);
      }
      if (typeof cstOption !== 'undefined') {
        focusedElement = cstOption;
        focusedElement.classList.add(builderParams.hasFocusClass);
        // Offset update: checks if the focused element is in the visible part of the panelClass
        // if not dispatches a custom event
        if (isOpen) {
          if (cstOption.offsetTop < cstOption.offsetParent.scrollTop
            || cstOption.offsetTop >
              (cstOption.offsetParent.scrollTop + cstOption.offsetParent.clientHeight)
              - cstOption.clientHeight) {
            cstOption.dispatchEvent(new CustomEvent('custom-select:focus-outside-panel', { bubbles: true }));
          }
        }
      } else {
        focusedElement = undefined;
      }
    }
docs: Inner Functions  Sets the focused element with the neccessary classes substitutions