The jet vertex for Mueller-Navelet and forward jet production