local o=_G.HDAdminMain local W={custom=o.gui.MainFrame.Pages.Settings.Custom}local x=o.settings.ThemeColors or{{"\082\101\100",Color3.fromRGB(150,0,0)};{"\079\114\097\110\103\101",Color3.fromRGB(150,75,0)},{"\066\114\111\119\110";Color3.fromRGB(120,80,30)},{"\089\101\108\108\111\119",Color3.fromRGB(130,120,0)};{"\071\114\101\101\110",Color3.fromRGB(0,120,0)};{"\066\108\117\101";Color3.fromRGB(0,100,150)};{"\080\117\114\112\108\101",Color3.fromRGB(100,0,150)},{"\080\105\110\107";Color3.fromRGB(150,0,100)},{"\066\108\097\099\107",Color3.fromRGB(60,60,60)}}local t=6.1/#x local k=true local h=W.custom["\065\066 \084\104\101\109\101\083\101\108\101\099\116\105\111\110"]local function C(W,t)if W==nil then for x,k in pairs(x)do if k[1]==o.pdata.Theme then W=k[1]t=k[2]break end end end if W then local x={}for o,W in pairs(o.gui:GetDescendants())do if W:IsA("\066\111\111\108\086\097\108\117\101")and W.Name=="\084\104\101\109\101"then table.insert(x,W.Parent)end end local k,C,F=pairs(x)while true do local o,W=k(C,F)if not o then break end local x=t if W.Theme.Value then local o,W,k=Color3.toHSV(t)x=Color3.fromHSV(o,W,k*1.35)end if W:IsA("\084\101\120\116\076\097\098\101\108")then local o,x,k=Color3.toHSV(t)W.TextColor3=Color3.fromHSV(o,x,k*2)else W.BackgroundColor3=x end end for o,x in pairs(h:GetChildren())do if x:IsA("\084\101\120\116\066\117\116\116\111\110")then if x.Name==W then x.BorderSizePixel=1 else x.BorderSizePixel=0 end end end end end for W,x in pairs(x)do local F=x[1]local S=x[2]local b=h.ThemeTemplate:Clone()b.Name=F b.UIAspectRatioConstraint.AspectRatio=t b.BackgroundColor3=S local d=k b.MouseButton1Down:Connect(function()if d then d=false o.signals.ChangeSetting:InvokeServer({"\084\104\101\109\101";F})C(F,S)d=true end end)b.Visible=true b.Parent=h end local function F()for W,x in pairs(W.custom:GetChildren())do local t=string.sub(x.Name,5)if x:FindFirstChild("\083\101\116\116\105\110\103\086\097\108\117\101")then x.SettingName.TextLabel.Text=t.."\058"local W=o.pdata[t]x.SettingValue.TextBox.Text=tostring(W)local k=nil local h=nil if string.sub(t,1,5)=="\069\114\114\111\114"then k="\069\114\114\111\114"h=6 elseif string.sub(t,1,6)=="\078\111\116\105\099\101"then k="\078\111\116\105\099\101"h=7 end if k then local x=string.sub(t,h)if x=="\083\111\117\110\100\073\100"then W="\114\098\120\097\115\115\101\116\105\100\058\047\047"..W end o.audio[k][x]=W end end end C()end for W,x in pairs(W.custom:GetChildren())do local t=string.sub(x.Name,5)if x:FindFirstChild("\083\101\116\116\105\110\103\086\097\108\117\101")then local W=true local k=x.SettingValue.TextBox local h=x.SettingValue.TextLabel x.SettingValue.TextBox.FocusLost:connect(function(C)if W then local C=x.SettingValue.TextBox.Text W=false k.Visible=false h.Visible=true h.Text="\076\111\097\100\105\110\103\046\046\046"local S=o.signals.ChangeSetting:InvokeServer({t;C})if S=="\083\117\099\099\101\115\115"then local W=nil F()local x="\078\111\116\105\099\101"local k=string.sub(t,1,5)if k=="\069\114\114\111\114"or k=="\065\108\101\114\116"then x=k end if t=="\080\114\101\102\105\120"then(o:GetModule("\080\097\103\101\067\111\109\109\097\110\100\115")):CreateCommands()end W="\083\117\099\099\101\115\115\102\117\108\108\121 \099\104\097\110\103\101\100 \'"..(t..("\' \116\111 \'"..(C.."\'")))if x=="\065\108\101\114\116"then(o:GetModule("\099\102")):CreateNewCommandMenu("\115\101\116\116\105\110\103\115",{"\083\101\116\116\105\110\103\115 \065\108\101\114\116",W},8,true)else(o:GetModule("\078\111\116\105\099\101\115")):Notice(x,"\083\101\116\116\105\110\103\115",W)end else h.Text=S wait(1)end k.Visible=true h.Visible=false x.SettingValue.TextBox.Text=tostring(o.pdata[t])W=true end end)end end F()local S=W.custom["\065\088 \082\101\115\116\111\114\101"]local b=0 local d=S.Loading S.MouseButton1Down:Connect(function()if b<2 then local W,x,t=Color3.toHSV(S.BackgroundColor3)d.BackgroundColor3=Color3.fromHSV(W,x,t*.5)d.Visible=true if b==0 then b=1 d.Blocker.Visible=false d.TextLabel.Text="\067\111\110\102\105\114\109\063"wait(1)elseif b==1 then b=2 d.Blocker.Visible=true d.TextLabel.Text="\076\111\097\100\105\110\103\046\046\046"local W=o.signals.RestoreDefaultSettings:InvokeServer()if W=="\083\117\099\099\101\115\115"then F();(o:GetModule("\080\097\103\101\067\111\109\109\097\110\100\115")):CreateCommands()local W=(o:GetModule("\099\102")):FormatNotice("\082\101\115\116\111\114\101\068\101\102\097\117\108\116\083\101\116\116\105\110\103\115");(o:GetModule("\078\111\116\105\099\101\115")):Notice("\078\111\116\105\099\101",W[1],W[2])else S.TextLabel.Text=W end wait(1)end b=0 d.Visible=false d.Blocker.Visible=false end end)local U=W.custom["\065\090 \083\112\097\099\101"]W.custom.CanvasSize=UDim2.new(0,0,0,(U.AbsolutePosition.Y-W.custom["\065\065 \083\112\097\099\101"].AbsolutePosition.Y)+U.AbsoluteSize.Y*1)return{}


local l__HDAdminMain__1 = _G.HDAdminMain;
local v2 = {
	custom = l__HDAdminMain__1.gui.MainFrame.Pages.Settings.Custom
};
local v3 = l__HDAdminMain__1.settings.ThemeColors or { { "Red", Color3.fromRGB(150, 0, 0) }, { "Orange", Color3.fromRGB(150, 75, 0) }, { "Brown", Color3.fromRGB(120, 80, 30) }, { "Yellow", Color3.fromRGB(130, 120, 0) }, { "Green", Color3.fromRGB(0, 120, 0) }, { "Blue", Color3.fromRGB(0, 100, 150) }, { "Purple", Color3.fromRGB(100, 0, 150) }, { "Pink", Color3.fromRGB(150, 0, 100) }, { "Black", Color3.fromRGB(60, 60, 60) } };
local v4 = 6.1 / #v3;
local v5 = true;
local u1 = v2.custom["AB ThemeSelection"];
local function v6(p1, p2)
	if p1 == nil then
		for v7, v8 in pairs(v3) do
			if v8[1] == l__HDAdminMain__1.pdata.Theme then
				p1 = v8[1];
				p2 = v8[2];
				break;
			end;
		end;
	end;
	if p1 then
		local v9 = {};
		for v10, v11 in pairs(l__HDAdminMain__1.gui:GetDescendants()) do
			if v11:IsA("BoolValue") and v11.Name == "Theme" then
				table.insert(v9, v11.Parent);
			end;
		end;
		local v12, v13, v14 = pairs(v9);
		while true do
			local v15, v16 = v12(v13, v14);
			if not v15 then
				break;
			end;
			local v17 = p2;
			if v16.Theme.Value then
				local v18, v19, v20 = Color3.toHSV(p2);
				v17 = Color3.fromHSV(v18, v19, v20 * 1.35);
			end;
			if v16:IsA("TextLabel") then
				local v21, v22, v23 = Color3.toHSV(p2);
				v16.TextColor3 = Color3.fromHSV(v21, v22, v23 * 2);
			else
				v16.BackgroundColor3 = v17;
			end;		
		end;
		for v24, v25 in pairs(u1:GetChildren()) do
			if v25:IsA("TextButton") then
				if v25.Name == p1 then
					v25.BorderSizePixel = 1;
				else
					v25.BorderSizePixel = 0;
				end;
			end;
		end;
	end;
end;
for v26, v27 in pairs(v3) do
	local v28 = v27[1];
	local v29 = v27[2];
	local v30 = u1.ThemeTemplate:Clone();
	v30.Name = v28;
	v30.UIAspectRatioConstraint.AspectRatio = v4;
	v30.BackgroundColor3 = v29;
	local u2 = v5;
	v30.MouseButton1Down:Connect(function()
		if u2 then
			u2 = false;
			l__HDAdminMain__1.signals.ChangeSetting:InvokeServer({ "Theme", v28 });
			v6(v28, v29);
			u2 = true;
		end;
	end);
	v30.Visible = true;
	v30.Parent = u1;
end;
local function v31()
	for v32, v33 in pairs(v2.custom:GetChildren()) do
		local v34 = string.sub(v33.Name, 5);
		if v33:FindFirstChild("SettingValue") then
			v33.SettingName.TextLabel.Text = v34 .. ":";
			local v35 = l__HDAdminMain__1.pdata[v34];
			v33.SettingValue.TextBox.Text = tostring(v35);
			local v36 = nil;
			local v37 = nil;
			if string.sub(v34, 1, 5) == "Error" then
				v36 = "Error";
				v37 = 6;
			elseif string.sub(v34, 1, 6) == "Notice" then
				v36 = "Notice";
				v37 = 7;
			end;
			if v36 then
				local v38 = string.sub(v34, v37);
				if v38 == "SoundId" then
					v35 = "rbxassetid://" .. v35;
				end;
				l__HDAdminMain__1.audio[v36][v38] = v35;
			end;
		end;
	end;
	v6();
end;
for v39, v40 in pairs(v2.custom:GetChildren()) do
	local v41 = string.sub(v40.Name, 5);
	if v40:FindFirstChild("SettingValue") then
		local u3 = true;
		local l__TextBox__4 = v40.SettingValue.TextBox;
		local l__TextLabel__5 = v40.SettingValue.TextLabel;
		v40.SettingValue.TextBox.FocusLost:connect(function(p3)
			if u3 then
				local l__Text__42 = v40.SettingValue.TextBox.Text;
				u3 = false;
				l__TextBox__4.Visible = false;
				l__TextLabel__5.Visible = true;
				l__TextLabel__5.Text = "Loading...";
				local v43 = l__HDAdminMain__1.signals.ChangeSetting:InvokeServer({ v41, l__Text__42 });
				if v43 == "Success" then
					local v44 = nil;
					v31();
					local v45 = "Notice";
					local v46 = string.sub(v41, 1, 5);
					if v46 == "Error" or v46 == "Alert" then
						v45 = v46;
					end;
					if v41 == "Prefix" then
						l__HDAdminMain__1:GetModule("PageCommands"):CreateCommands();
					end;
					v44 = "Successfully changed '" .. v41 .. "' to '" .. l__Text__42 .. "'";
					if v45 == "Alert" then
						l__HDAdminMain__1:GetModule("cf"):CreateNewCommandMenu("settings", { "Settings Alert", v44 }, 8, true);
					else
						l__HDAdminMain__1:GetModule("Notices"):Notice(v45, "Settings", v44);
					end;
				else
					l__TextLabel__5.Text = v43;
					wait(1);
				end;
				l__TextBox__4.Visible = true;
				l__TextLabel__5.Visible = false;
				v40.SettingValue.TextBox.Text = tostring(l__HDAdminMain__1.pdata[v41]);
				u3 = true;
			end;
		end);
	end;
end;
v31();
local v47 = v2.custom["AX Restore"];
local u6 = 0;
local l__Loading__7 = v47.Loading;
v47.MouseButton1Down:Connect(function()
	if u6 < 2 then
		local v48, v49, v50 = Color3.toHSV(v47.BackgroundColor3);
		l__Loading__7.BackgroundColor3 = Color3.fromHSV(v48, v49, v50 * 0.5);
		l__Loading__7.Visible = true;
		if u6 == 0 then
			u6 = 1;
			l__Loading__7.Blocker.Visible = false;
			l__Loading__7.TextLabel.Text = "Confirm?";
			wait(1);
		elseif u6 == 1 then
			u6 = 2;
			l__Loading__7.Blocker.Visible = true;
			l__Loading__7.TextLabel.Text = "Loading...";
			local v51 = l__HDAdminMain__1.signals.RestoreDefaultSettings:InvokeServer();
			if v51 == "Success" then
				v31();
				l__HDAdminMain__1:GetModule("PageCommands"):CreateCommands();
				local v52 = l__HDAdminMain__1:GetModule("cf"):FormatNotice("RestoreDefaultSettings");
				l__HDAdminMain__1:GetModule("Notices"):Notice("Notice", v52[1], v52[2]);
			else
				v47.TextLabel.Text = v51;
			end;
			wait(1);
		end;
		u6 = 0;
		l__Loading__7.Visible = false;
		l__Loading__7.Blocker.Visible = false;
	end;
end);
local v53 = v2.custom["AZ Space"];
v2.custom.CanvasSize = UDim2.new(0, 0, 0, v53.AbsolutePosition.Y - v2.custom["AA Space"].AbsolutePosition.Y + v53.AbsoluteSize.Y * 1);
return {};
