<commit_before>define([
	'esri/urlUtils',
	'dojo/Deferred', 
	'dojo/promise/all', 
	'esri/arcgis/utils'
], function (urlUtils, Deferred, all, arcgisUtils) {

	return {

		getApplicationInformation: function () {

			var deferred = new Deferred();
			var urlParams = urlUtils.urlToObject(location.href);
			var appid = urlParams && urlParams.query && urlParams.query.appid;

			if (!appid) {
				// If there is no app id, just show the application defaults and don't query agol for information
				deferred.reject(new Error("There is no application configuration imformation."));
				return deferred.promise;
			}

			arcgisUtils.getItem(appid).then(function (res) {
				// Pull All Relevant Config Values Here
				var commonConfig = {},
					values = res.itemData && res.itemData.values;

				if (values) {
					// Country Code
					commonConfig.country = values.country;
					// appLanguages
					// Add Default language with some default values
					commonConfig.appLanguages = {
						"en": {
							"title": values.englishTitle,
							"flagTitle": values.flagTitle
						}
					};
					// Add Additional Languages
					commonConfig.appLanguages[values.appLanguages] = {
						"title": values.languageTitle,
						"flagTitle": values.languageFlagTitle
					};

					commonConfig.layersToShow = values.layersToShow && values.layersToShow.split(",").map(function(layer) { return parseInt(layer); });
					commonConfig.downloadAll = values.downloadAll;
					commonConfig.maskMapUrl = values.maskMapUrl;
					commonConfig.webMapID = values.webmap;

					commonConfig.countryFlagRight = values.countryFlagRight + "px";
					commonConfig.countryTextWidth = values.countryTextWidth + "px";<commit_msg>fixed potential hangup with language options<commit_after>define([
	'esri/urlUtils',
	'dojo/Deferred', 
	'dojo/promise/all', 
	'esri/arcgis/utils'
], function (urlUtils, Deferred, all, arcgisUtils) {

	return {

		getApplicationInformation: function () {

			var deferred = new Deferred();
			var urlParams = urlUtils.urlToObject(location.href);
			var appid = urlParams && urlParams.query && urlParams.query.appid;

			if (!appid) {
				// If there is no app id, just show the application defaults and don't query agol for information
				deferred.reject(new Error("There is no application configuration imformation."));
				return deferred.promise;
			}

			arcgisUtils.getItem(appid).then(function (res) {
				// Pull All Relevant Config Values Here
				var commonConfig = {},
					values = res.itemData && res.itemData.values,
					language;

				if (values) {
					// Country Code
					commonConfig.country = values.country;
					// appLanguages
					// Add Default language with some default values
					commonConfig.appLanguages = {
						"en": {
							"title": values.englishTitle,
							"flagTitle": values.flagTitle
						}
					};
					// Add Additional Languages
					// The default id french, or fr, so test for a valid value first and then use that if necessary
					language = ((values.appLanguages !== undefined && values.appLanguages !== '') ? values.appLanguages : 'fr');
					commonConfig.appLanguages[language] = {
						"title": values.languageTitle,
						"flagTitle": values.languageFlagTitle
					};

					commonConfig.layersToShow = values.layersToShow && values.layersToShow.split(",").map(function(layer) { return parseInt(layer); });
					commonConfig.downloadAll = values.downloadAll;
					commonConfig.maskMapUrl = values.maskMapUrl;
					commonConfig.webMapID = values.webmap;

					commonConfig.countryFlagRight = values.countryFlagRight + "px";
					commonConfig.countryTextWidth = values.countryTextWidth + "px";
{'fraction_non_alphanumeric': 0.11437191442676906, 'fraction_numerical': 0.0, 'mean_word_length': 3.388688327316486, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6155672', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1043, 'n_words': 252}