magento2 – how to show customer authentication popup when clicking on checkout button in minicart while guest checkout is enable mangento 2

I want to check if a user is logged in before proceeding to checkout. On the basis of customer login condition, i want to show the login popup if not login, and redirect to checkout if logged in already.

IMPORTANT: I have guest checkout enabled in the configuration. Because I want user to checkout with guest account

I am able to redirect user to login page when not logged in. But not able to use popup instead of redirecting it to login page.

to redirect user to login page, I did the following changes in my minicart.js file:

var cc = customerData.get('customer');
    var urls = window.checkout.checkoutUrl; 
    $( document.body ).removeClass( "logedin" );
    var urls = window.checkout.customerLoginUrl;

please help me find out how to use popup login instead redirecting to login page.