<commit_before>import '../../less/users.less';
import '../../node_modules/jquery-contextmenu/dist/jquery.contextMenu.css';

import 'jquery-contextmenu';
import default_emus from '../app/default_emus';
import _ from 'lodash';

export default function ($target) {
	var displayed_users_once = false; // for mobile

	get_page('users', function (page) {
		$target.replaceWith(page.$container);

		var update_user_list_style = function () {
			page.$("#users_list .user").each(function () {
				var $user = $(this);

				var user_colors = {
					bg_color: 'white',
					fg_color: 'black',
					font_family: 'Verdana',
					font_size: '1.25em'
				};

				var user = $user.prop('user');
				var extend_from = app.world.user_settings[user.username] && app.world.user_settings[user.username].outfit && app.world.user_settings[user.username].outfit.user;

				$.extend(user_colors, extend_from);
				$user.css({
					background: user_colors.bg_color,
					color: user_colors.fg_color,
					fontFamily: user_colors.font_family,
					fontSize: user_colors.font_size + 'px'
				})
			});
		};

		page.listen('user_settings', function (data) {
			if (data.user_settings[app.profile.username] && data.user_settings[app.profile.username].outfit && data.user_settings[app.profile.username].outfit.holy_cow) {
				app.holy_cow = data.user_settings[app.profile.username].outfit.holy_cow;
			} else {
				app.holy_cow = default_emus;
			}

			app.world.user_settings = data.user_settings;
			update_user_list_style();
		});

		page.user_list_data = null;
		app.render_users_list = function (data) {
			if (data != null) {
				page.user_list_data = data;
			} else if (page.user_list_data == null) {
				return;
			} else {
				data = page.user_list_data;
			}

			var $users = page.$("#users_list").empty();
			var users = data.users_and_rooms.users;

			users.sort(function (a, b) {
				var rank_a = a.rocket_league_rank || 0;
				var rank_b = b.rocket_league_rank || 0;

				return rank_b - rank_a;
			});

			var rooms = data.users_and_rooms.rooms;

			users.filter(function (user) {
				var room_id = app.get_active_room(true);

				var in_room = rooms[room_id] && rooms[room_id].users.some(function (room_user) {
					return room_user.username == user.username;
				});


				return in_room;
			}).map(function (user) {
				var nice_username = user.username.toLowerCase();
				// var display_name = user.username;
				var display_name = user.username;
				var $user = $('<div class="user"><span class="username">' + display_name + '</span></div>');

				if (user.idle == true) {
					var duration = (user.idle_duration + (5000 * 60)) / 1000;
					var unit = "s";

					if (duration >= 60) {
						duration /= 60;
						unit = "m";
					}

					if (duration >= 60) {
						duration /= 60;
						unit = "h";
					}

					duration = duration.toFixed(0);

					var $away = $('<div class="away">' + "Idle: " + duration + unit + "</div>");
					$user.append($away);
				}

				var ping = '';
				if (user.ping != null) {<commit_msg>Remove 5 minute thing<commit_after>import '../../less/users.less';
import '../../node_modules/jquery-contextmenu/dist/jquery.contextMenu.css';

import 'jquery-contextmenu';
import default_emus from '../app/default_emus';
import _ from 'lodash';

export default function ($target) {
	var displayed_users_once = false; // for mobile

	get_page('users', function (page) {
		$target.replaceWith(page.$container);

		var update_user_list_style = function () {
			page.$("#users_list .user").each(function () {
				var $user = $(this);

				var user_colors = {
					bg_color: 'white',
					fg_color: 'black',
					font_family: 'Verdana',
					font_size: '1.25em'
				};

				var user = $user.prop('user');
				var extend_from = app.world.user_settings[user.username] && app.world.user_settings[user.username].outfit && app.world.user_settings[user.username].outfit.user;

				$.extend(user_colors, extend_from);
				$user.css({
					background: user_colors.bg_color,
					color: user_colors.fg_color,
					fontFamily: user_colors.font_family,
					fontSize: user_colors.font_size + 'px'
				})
			});
		};

		page.listen('user_settings', function (data) {
			if (data.user_settings[app.profile.username] && data.user_settings[app.profile.username].outfit && data.user_settings[app.profile.username].outfit.holy_cow) {
				app.holy_cow = data.user_settings[app.profile.username].outfit.holy_cow;
			} else {
				app.holy_cow = default_emus;
			}

			app.world.user_settings = data.user_settings;
			update_user_list_style();
		});

		page.user_list_data = null;
		app.render_users_list = function (data) {
			if (data != null) {
				page.user_list_data = data;
			} else if (page.user_list_data == null) {
				return;
			} else {
				data = page.user_list_data;
			}

			var $users = page.$("#users_list").empty();
			var users = data.users_and_rooms.users;

			users.sort(function (a, b) {
				var rank_a = a.rocket_league_rank || 0;
				var rank_b = b.rocket_league_rank || 0;

				return rank_b - rank_a;
			});

			var rooms = data.users_and_rooms.rooms;

			users.filter(function (user) {
				var room_id = app.get_active_room(true);

				var in_room = rooms[room_id] && rooms[room_id].users.some(function (room_user) {
					return room_user.username == user.username;
				});


				return in_room;
			}).map(function (user) {
				var nice_username = user.username.toLowerCase();
				// var display_name = user.username;
				var display_name = user.username;
				var $user = $('<div class="user"><span class="username">' + display_name + '</span></div>');

				if (user.idle == true) {
					var duration = user.idle_duration / 1000;
					var unit = "s";

					if (duration >= 60) {
						duration /= 60;
						unit = "m";
					}

					if (duration >= 60) {
						duration /= 60;
						unit = "h";
					}

					duration = duration.toFixed(0);

					var $away = $('<div class="away">' + "Idle: " + duration + unit + "</div>");
					$user.append($away);
				}

				var ping = '';
				if (user.ping != null) {
{'fraction_non_alphanumeric': 0.1576321915530429, 'fraction_numerical': 0.007149983372131693, 'mean_word_length': 3.131181318681319, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, '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': '3360667', 'n_tokens_mistral': 2557, 'n_tokens_neox': 2052, 'n_words': 391}