/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

define(function () {
    'use strict';

    var mixin = {
    	/**
         * @override
         */
        initObservable: function () {
        	var self = this;
        	
            this._super();

//MNM - select first rate if none selected yet
            this.shippingRates.subscribe(function (rates) {
                if(!self.selectedShippingMethod() && rates.length)
            	{
                	self.selectShippingMethod(rates[0]);
            	}
            });
            
            return this;
        }
    };
    
    return function (target) {
        return target.extend(mixin);
	}
});
