define(
    [
        'ko',
        'Magento_Customer/js/model/customer',
        'Magento_Checkout/js/model/quote',
        'Magento_Checkout/js/model/step-navigator'
    ], function (ko, customer, quote, stepNavigator) {
        'use strict';

        var mixin = {
            /**
             * @param {Object} item
             * @return {*|Boolean}
             */
            isNotLoggedIn: function (item) {
                var isUserLoggedIn,
                    isLoginStepComplete;

                if (item.code === 'login_step') {
                    isUserLoggedIn = customer.isLoggedIn();
                    isLoginStepComplete = stepNavigator.isProcessed(item.code);

                    if (isUserLoggedIn && isLoginStepComplete) {
                        return false;
                    }
                }

                return true;
            }
        };

        return function (target) {
            return target.extend(mixin);
        };
    }
);