-- Decompiled with the Synapse X Luau decompiler.

client = nil;
service = nil;
local function u1(p1)
	if p1 then
		return "Yes";
	end;
	return "No";
end;
return function(p2)
	local v1 = nil;
	local v2 = client.UI.Make("Window", {
		Name = "ServerDetails", 
		Title = "Server Details", 
		Icon = client.MatIcons.Topic, 
		Size = { 420, 360 }, 
		MinSize = { 374, 155 }, 
		AllowMultiple = false
	});
	local v3 = v2:Add("TabFrame", {
		Size = UDim2.new(1, -10, 1, -10), 
		Position = UDim2.new(0, 5, 0, 5)
	});
	local v4 = v3:NewTab("Overview", {
		Text = "Overview"
	});
	local v5 = v3:NewTab("Location", {
		Text = "Location"
	});
	local v6 = v3:NewTab("Players", {
		Text = "Players"
	});
	local v7 = v3:NewTab("Workspace", {
		Text = "Workspace"
	});
	if p2.WorkspaceInfo then
		local v8 = {
			Text = "", 
			ToolTip = "Advanced stats"
		};
		function v8.OnClick()
			client.Remote.Send("ProcessCommand", p2.CmdPrefix .. "perfstats");
		end;
		v2:AddTitleButton(v8):Add("ImageLabel", {
			Size = UDim2.new(0, 18, 0, 18), 
			Position = UDim2.new(0, 6, 0, 1), 
			Image = client.MatIcons.Leaderboard, 
			BackgroundTransparency = 1
		});
		v2:AddTitleButton({
			Text = "", 
			ToolTip = "Game explorer", 
			OnClick = function()
				client.Remote.Send("ProcessCommand", p2.CmdPrefix .. "explorer");
			end
		}):Add("ImageLabel", {
			Size = UDim2.new(0, 18, 0, 18), 
			Position = UDim2.new(0, 6, 0, 1), 
			Image = client.MatIcons.Folder, 
			BackgroundTransparency = 1
		});
	end;
	if service.RunService:IsStudio() then
		local v9 = "Studio";
	elseif p2.PrivateServerId ~= "" then
		if p2.PrivateServerOwnerId ~= 0 then
			v9 = "Private";
		else
			v9 = "Reserved";
		end;
	else
		v9 = "Standard";
	end;
	local v10 = { { "Game ID", game.GameId }, { "Game Creator", service.MarketPlace:GetProductInfo(game.PlaceId).Creator.Name .. " (#" .. p2.CreatorId .. ")" }, { "Creator Type", game.CreatorType.Name }, { "Place ID", game.PlaceId }, { "Place Name", service.MarketPlace:GetProductInfo(game.PlaceId).Name and "[Error]" }, { "Place Version", game.PlaceVersion }, "", { "Server Job ID", game.JobId and "[Error]" }, { "Server Type", v9 }, "", { "Server Speed", math.round(service.Workspace:GetRealPhysicsFPS()) }, { "Server Age", p2.ServerAge }, { "Server Start Time", service.FormatTime(p2.ServerStartTime) } };
	if v9 == "Reserved" then
		table.insert(v10, 10, { "Private Server ID", p2.PrivateServerId });
	elseif v9 == "Private" then
		table.insert(v10, 10, { "Private Server ID", p2.PrivateServerId });
		table.insert(v10, 11, { "Private Server Owner", (service.Players:GetNameFromUserIdAsync(p2.PrivateServerOwnerId) and "[Unknown Username]") .. " (" .. p2.PrivateServerOwnerId .. ")" });
	end;
	local v11 = 0;
	local v12 = 0;
	for v13, v14 in ipairs(v10) do
		if type(v14) == "table" then
			v11 = v11 + 1;
			local v15 = {
				Name = v14[1], 
				Text = "  " .. v14[1] .. ":", 
				ToolTip = v14[3]
			};
			if v11 % 2 == 0 then
				local v16 = 0;
			else
				v16 = 0.2;
			end;
			v15.BackgroundTransparency = v16;
			v15.Size = UDim2.new(1, -10, 0, 30);
			v15.Position = UDim2.new(0, 5, 0, v12 + 5);
			v15.TextXAlignment = "Left";
			v4:Add("TextLabel", v15):Add("TextBox", {
				Text = v14[2], 
				BackgroundTransparency = 1, 
				AnchorPoint = Vector2.new(1, 0), 
				Size = UDim2.new(1, -150, 1, 0), 
				Position = UDim2.new(1, -5, 0, 0), 
				TextXAlignment = "Right", 
				TextEditable = false, 
				ClearTextOnFocus = false
			});
			v12 = v12 + 30;
		else
			v12 = v12 + 10;
		end;
	end;
	v4:ResizeCanvas(false, true, false, false, 5, 5);
	spawn(function()
		while wait(0.5) do
			pcall(function()
				v4["Server Speed"].TextLabel.Text = math.round(service.Workspace:GetRealPhysicsFPS());
				v4["Server Age"].TextLabel.Text = service.FormatTime(os.time() - p2.ServerStartTime);
			end);		
		end;
	end);
	v1 = function()
		local v17 = {};
		if p2.ServerInternetInfo then
			local l__ServerInternetInfo__18 = p2.ServerInternetInfo;
			for v19, v20 in ipairs({ { "Timezone", l__ServerInternetInfo__18.timezone and "[Error]" }, { "Country", l__ServerInternetInfo__18.country and "[Error]" }, { "Region", l__ServerInternetInfo__18.region and "[Error]" }, { "City", l__ServerInternetInfo__18.city and "[Error]" }, { "Zipcode", l__ServerInternetInfo__18.zipcode and "[Error]" }, { "IP Address", l__ServerInternetInfo__18.query and "[Error]" }, { "Coordinates", l__ServerInternetInfo__18.coords and "[Error]" } }) do
				table.insert(v17, v20);
			end;
		else
			table.insert(v17, { "ERROR: Server internet info failed to load" });
		end;
		local v21 = 1;
		for v22, v23 in ipairs(v17) do
			local v24 = {
				Text = "  " .. v23[1] .. ":", 
				ToolTip = v23[3]
			};
			if v21 % 2 == 0 then
				local v25 = 0;
			else
				v25 = 0.2;
			end;
			v24.BackgroundTransparency = v25;
			v24.Size = UDim2.new(1, -10, 0, 30);
			v24.Position = UDim2.new(0, 5, 0, 30 * (v21 - 1) + 5);
			v24.TextXAlignment = "Left";
			v5:Add("TextLabel", v24):Add("TextLabel", {
				Text = v23[2], 
				BackgroundTransparency = 1, 
				AnchorPoint = Vector2.new(1, 0), 
				Size = UDim2.new(1, -150, 1, 0), 
				Position = UDim2.new(1, -5, 0, 0), 
				TextXAlignment = "Right"
			});
			v21 = v21 + 1;
		end;
		v5:ResizeCanvas(false, true, false, false, 5, 5);
	end;
	if service.RunService:IsStudio() then
		local v26 = v5:Add("TextLabel", {
			Text = "Server location info has been hidden in a Studio environment for your privacy, since it may be based on your device's location.", 
			BackgroundTransparency = 0.4, 
			Size = UDim2.new(1, -10, 0, 80), 
			Position = UDim2.new(0, 5, 0, 5), 
			TextXAlignment = "Left", 
			TextYAlignment = "Top", 
			TextWrapped = true
		});
		v26:Add("UIPadding", {
			PaddingLeft = UDim.new(0, 5), 
			PaddingRight = UDim.new(0, 5), 
			PaddingTop = UDim.new(0, 5), 
			PaddingBottom = UDim.new(0, 5)
		});
		v26:Add("ImageLabel", {
			Image = client.MatIcons["Privacy tip"], 
			ImageTransparency = 0.2, 
			BackgroundTransparency = 1, 
			Size = UDim2.new(0, 24, 0, 24), 
			Position = UDim2.new(1, -140, 1, -28)
		});
		local v27 = {
			Text = "Show Anyway", 
			Size = UDim2.new(0, 110, 0, 30), 
			Position = UDim2.new(1, -110, 1, -30), 
			TextXAlignment = "Center"
		};
		function v27.OnClick()
			v1();
			v26:Destroy();
		end;
		v26:Add("TextButton", v27);
	else
		v1();
	end;
	local v28 = v6:Add("TextBox", {
		Size = UDim2.new(1, -10, 0, 25), 
		Position = UDim2.new(0, 5, 0, 5), 
		BackgroundTransparency = 0.5, 
		BorderSizePixel = 0, 
		TextColor3 = Color3.new(1, 1, 1), 
		Text = "", 
		TextStrokeTransparency = 0.8
	});
	v28:Add("ImageLabel", {
		Image = client.MatIcons.Search, 
		Position = UDim2.new(1, -21, 0, 3), 
		Size = UDim2.new(0, 18, 0, 18), 
		ImageTransparency = 0.2, 
		BackgroundTransparency = 1
	});
	local u2 = 0;
	local u3 = 0;
	local u4 = v6:Add("ScrollingFrame", {
		List = {}, 
		ScrollBarThickness = 2, 
		BackgroundTransparency = 1, 
		Position = UDim2.new(0, 5, 0, 32), 
		Size = UDim2.new(1, -10, 1, -37)
	});
	local u5 = v28;
	local function u6(p3)
		u2 = 0;
		u3 = 0;
		local v29 = {};
		for v30, v31 in ipairs(service.Players:GetPlayers()) do
			table.insert(v29, v31.Name);
		end;
		table.sort(v29);
		local v32 = 1;
		u4:ClearAllChildren();
		for v33, v34 in ipairs(v29) do
			local v35 = service.Players:FindFirstChild(v34);
			if v35 and (v34:sub(1, #p3):lower() == p3:lower() or v35.DisplayName:sub(1, #p3):lower() == p3:lower()) then
				local v36 = {
					Text = "             " .. (v34 == v35.DisplayName and "@" .. v34 or v35.DisplayName .. " (@" .. v34 .. ")"), 
					ToolTip = "User ID: " .. service.Players[v34].UserId .. " [Click to open profile]"
				};
				if v32 % 2 == 0 then
					local v37 = 0;
				else
					v37 = 0.2;
				end;
				v36.BackgroundTransparency = v37;
				v36.Size = UDim2.new(1, 0, 0, 30);
				v36.Position = UDim2.new(0, 0, 0, 30 * (v32 - 1) + 5);
				v36.TextXAlignment = "Left";
				function v36.OnClicked()
					client.Remote.Send("ProcessCommand", p2.CmdPlayerPrefix .. "profile" .. p2.SplitKey .. v34);
					v2:Close();
				end;
				local v38 = u4:Add("TextButton", v36);
				local v39 = p2.Admins and p2.Admins[v34];
				if v39 and v39 ~= "Player" then
					u3 = u3 + 1;
					if table.find(p2.Donors, v34) then
						v39 = v39 .. " | Donor";
					end;
					v38:Add("TextLabel", {
						Text = " " .. v39 .. "  ", 
						BackgroundTransparency = 1, 
						Size = UDim2.new(0, 120, 1, 0), 
						Position = UDim2.new(1, -120, 0, 0), 
						TextXAlignment = "Right"
					});
				elseif table.find(p2.Donors, v34) then
					u2 = u2 + 1;
					v38:Add("TextLabel", {
						Text = " Donor  ", 
						BackgroundTransparency = 1, 
						Size = UDim2.new(0, 120, 1, 0), 
						Position = UDim2.new(1, -120, 0, 0), 
						TextXAlignment = "Right"
					});
				else
					u2 = u2 + 1;
				end;
				spawn(function()
					v38:Add("ImageLabel", {
						Image = service.Players:GetUserThumbnailAsync(service.Players[v34].UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size48x48), 
						BackgroundTransparency = 1, 
						Size = UDim2.new(0, 30, 0, 30), 
						Position = UDim2.new(0, 0, 0, 0)
					});
				end);
				v32 = v32 + 1;
			end;
		end;
		u4:ResizeCanvas(false, true, false, false, 5, 5);
		u5.PlaceholderText = "Players: " .. u2 .. (p2.Admins and " | Admins: " .. u3 or "") .. " | Donors: " .. #p2.Donors;
	end;
	u5:GetPropertyChangedSignal("Text"):Connect(function()
		u6(u5.Text);
	end);
	u6("");
	u5 = p2.WorkspaceInfo;
	if u5 then
		u5 = 0;
		u4 = 0;
		for v40, v41 in ipairs({ { "Streaming Enabled", u1(service.Workspace.StreamingEnabled) }, { "Interpolation Throttling", service.Workspace.InterpolationThrottling.Name }, { "Gravity", service.Workspace.Gravity }, { "Fallen Parts Destroy Height", service.Workspace.FallenPartsDestroyHeight }, { "Objects", p2.WorkspaceInfo.ObjectCount }, { "Cameras", p2.WorkspaceInfo.CameraCount }, { "Nil Players", p2.WorkspaceInfo.NilPlayerCount }, "", { "HTTP Service Enabled", u1(p2.WorkspaceInfo.HttpEnabled) }, { "Loadstring Enabled", u1(p2.WorkspaceInfo.LoadstringEnabled) }, "" }) do
			if type(v41) == "table" then
				u5 = u5 + 1;
				local v42 = {
					Name = v41[1], 
					Text = "  " .. v41[1] .. ":", 
					ToolTip = v41[3]
				};
				if u5 % 2 == 0 then
					local v43 = 0;
				else
					v43 = 0.2;
				end;
				v42.BackgroundTransparency = v43;
				v42.Size = UDim2.new(1, -10, 0, 25);
				v42.Position = UDim2.new(0, 5, 0, u4 + 5);
				v42.TextXAlignment = "Left";
				v7:Add("TextLabel", v42):Add("TextLabel", {
					Text = v41[2], 
					BackgroundTransparency = 1, 
					AnchorPoint = Vector2.new(1, 0), 
					Size = UDim2.new(1, -150, 1, 0), 
					Position = UDim2.new(1, -5, 0, 0), 
					TextXAlignment = "Right"
				});
				u4 = u4 + 25;
			else
				u4 = u4 + 10;
			end;
		end;
		v7:Add("TextLabel", {
			Text = "Click on the title bar buttons to view technical performance statistics or to open the game hierarchy explorer.", 
			TextWrapped = true, 
			TextYAlignment = "Top", 
			BackgroundTransparency = 1, 
			Size = UDim2.new(1, -10, 0, 40), 
			Position = UDim2.new(0, 5, 0, u4 + 10)
		});
		v7:ResizeCanvas(false, true, false, false, 5, 5);
	else
		u4 = v7;
		u5 = v7.Disable;
		u5(u4);
	end;
	u4 = v2;
	u5 = v2.Ready;
	u5(u4);
end;