<commit_before>;
(function(window, undefined) {
	'use strict';

	var utils = easemobim.utils;
	var api = easemobim.api;
	var eventCollector = easemobim.eventCollector;
	var chat;
	var afterChatReady;

	getConfig();

	function getConfig() {
		if (utils.isTop) {
			var tenantId = utils.query('tenantId');
			var config = {};
			//get config from referrer's config
			try {
				config = JSON.parse(utils.code.decode(utils.getStore('emconfig' + tenantId)));
			} catch (e) {}

			config.tenantId = tenantId;
			config.hide = true;
			config.offDutyType = utils.query('offDutyType');
			config.grUserId = utils.query('grUserId');

			// H5 方式集成时不支持eventCollector配置
			config.to = utils.convertFalse(utils.query('to'));
			config.xmppServer = utils.convertFalse(utils.query('xmppServer'));
			config.restServer = utils.convertFalse(utils.query('restServer'));
			config.agentName = utils.convertFalse(utils.query('agentName'));
			config.satisfaction = utils.convertFalse(utils.query('sat'));
			config.resources = utils.convertFalse(utils.query('resources'));
			config.hideStatus = utils.convertFalse(utils.query('hideStatus'));
			config.satisfaction = utils.convertFalse(utils.query('sat'));
			config.wechatAuth = utils.convertFalse(utils.query('wechatAuth'));
			config.hideKeyboard = utils.convertFalse(utils.query('hideKeyboard'));

			config.appKey = utils.convertFalse(decodeURIComponent(utils.query('appKey')));
			config.domain = config.domain || '//' + location.host;
			config.offDutyWord = decodeURIComponent(utils.query('offDutyWord'));
			config.language = utils.query('language') || 'zh_CN';
			config.ticket = utils.query('ticket') === '' ? true : utils.convertFalse(utils.query('ticket')); //true default
			try {
				config.emgroup = decodeURIComponent(utils.query('emgroup'));
			} catch (e) {
				config.emgroup = utils.query('emgroup');
			}


			//没绑定user直接取cookie
			if (!utils.query('user')) {
				config.user = {
					username: utils.get('root' + config.tenantId + config.emgroup),
					password: '',
					token: ''
				};
			} else if (!config.user || (config.user.username && config.user.username !== utils.query('user'))) {
				config.user = {
					username: '',
					password: '',
					token: ''
				};
			}
			initUI(config, initAfterUI);
		} else {
			window.transfer = new easemobim.Transfer(null, 'main').listen(function(msg) {
				if (msg.parentId) {
					chat = easemobim.chat(msg);
					window.transfer.to = msg.parentId;
					initUI(msg, initAfterUI);
				}
				else if (msg.event) {
					switch (msg.event) {<commit_msg>修复移动端初始化问题<commit_after>;
(function(window, undefined) {
	'use strict';

	var utils = easemobim.utils;
	var api = easemobim.api;
	var eventCollector = easemobim.eventCollector;
	var chat;
	var afterChatReady;

	getConfig();

	function getConfig() {
		if (utils.isTop) {
			var tenantId = utils.query('tenantId');
			var config = {};
			//get config from referrer's config
			try {
				config = JSON.parse(utils.code.decode(utils.getStore('emconfig' + tenantId)));
			} catch (e) {}

			config.tenantId = tenantId;
			config.hide = true;
			config.offDutyType = utils.query('offDutyType');
			config.grUserId = utils.query('grUserId');

			// H5 方式集成时不支持eventCollector配置
			config.to = utils.convertFalse(utils.query('to'));
			config.xmppServer = utils.convertFalse(utils.query('xmppServer'));
			config.restServer = utils.convertFalse(utils.query('restServer'));
			config.agentName = utils.convertFalse(utils.query('agentName'));
			config.satisfaction = utils.convertFalse(utils.query('sat'));
			config.resources = utils.convertFalse(utils.query('resources'));
			config.hideStatus = utils.convertFalse(utils.query('hideStatus'));
			config.satisfaction = utils.convertFalse(utils.query('sat'));
			config.wechatAuth = utils.convertFalse(utils.query('wechatAuth'));
			config.hideKeyboard = utils.convertFalse(utils.query('hideKeyboard'));

			config.appKey = utils.convertFalse(decodeURIComponent(utils.query('appKey')));
			config.domain = config.domain || '//' + location.host;
			config.offDutyWord = decodeURIComponent(utils.query('offDutyWord'));
			config.language = utils.query('language') || 'zh_CN';
			config.ticket = utils.query('ticket') === '' ? true : utils.convertFalse(utils.query('ticket')); //true default
			try {
				config.emgroup = decodeURIComponent(utils.query('emgroup'));
			} catch (e) {
				config.emgroup = utils.query('emgroup');
			}


			//没绑定user直接取cookie
			if (!utils.query('user')) {
				config.user = {
					username: utils.get('root' + config.tenantId + config.emgroup),
					password: '',
					token: ''
				};
			} else if (!config.user || (config.user.username && config.user.username !== utils.query('user'))) {
				config.user = {
					username: '',
					password: '',
					token: ''
				};
			}
			chat = easemobim.chat(config);
			initUI(config, initAfterUI);
		} else {
			window.transfer = new easemobim.Transfer(null, 'main').listen(function(msg) {
				if (msg.parentId) {
					chat = easemobim.chat(msg);
					window.transfer.to = msg.parentId;
					initUI(msg, initAfterUI);
				}
				else if (msg.event) {
					switch (msg.event) {
{'fraction_non_alphanumeric': 0.16391211355240132, 'fraction_numerical': 0.00038887808671981335, 'mean_word_length': 3.9461538461538463, 'pattern_counts': {'":': 0, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7519362', 'n_tokens_mistral': 1965, 'n_tokens_neox': 1731, 'n_words': 266}