(function () {
    'use strict';

    angular.module('web').config(config);

    config.$inject = [];

    config.$inject = ['apiFactoryProvider', 'CONTEXT', 'DEBUG_MODE'];
    function config(apiFactoryProvider, CONTEXT, DEBUG_MODE) {
        apiFactoryProvider.defaultRootUrl = location.baseUrl;
        apiFactoryProvider.customHeaders = {
            'ctx-contextId': CONTEXT.contextId,
            'ctx-year': CONTEXT.currentYear
        };
    }

})();
(function() {

'use strict';

    angular
        .module('web')
        .constant('LOGIN_PATH', 'login')
        .constant('DEFAULT_PATH', '')
        .constant('AUTH_PATH', 'auth/')
        .constant('ENDED_SESSION_HASH', '#/sessionEnded')
        .constant('LOST_SESSION_HASH', '#/sessionLost');

})();

    
(function () {
    'use strict';

    angular.module('web').run(run);

    run.$inject = ['$rootScope', 'CONTEXT', 'LEGACY_URL', '$location', '$anchorScroll'];

    function run($rootScope, CONTEXT, LEGACY_URL, $location, $anchorScroll) {
		$rootScope.context = CONTEXT;
        $rootScope.variables = CONTEXT.variables;
        $rootScope.query = location.query;
        $rootScope.legacyUrl = LEGACY_URL;
		$rootScope.now = new Date();
		$rootScope.scrollTo = function(id) {
		  $location.hash(id);
		  $anchorScroll();
     	};
		
		$rootScope.constructor.prototype.context = $rootScope.context;
        $rootScope.constructor.prototype.variables = $rootScope.variables;
        $rootScope.constructor.prototype.query = $rootScope.query;
        $rootScope.constructor.prototype.legacyUrl = $rootScope.legacyUrl;
		$rootScope.constructor.prototype.now = $rootScope.now;
	};

})();
