local T=game:GetService("\080\108\097\121\101\114\115")local B=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local O=game:GetService("\067\104\097\116")local u=game:GetService("\084\101\120\116\083\101\114\118\105\099\101")local F=T.LocalPlayer while F==nil do T.ChildAdded:wait()F=T.LocalPlayer end local L=F:WaitForChild("\080\108\097\121\101\114\071\117\105")local h,H=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\083\104\111\117\108\100\076\111\099\097\108\105\122\101\071\097\109\101\067\104\097\116\066\117\098\098\108\101")end)local x,G=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\070\105\120\066\117\098\098\108\101\067\104\097\116\084\101\120\116")end)local a,U=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\082\111\097\099\116\066\117\098\098\108\101\067\104\097\116\066\101\116\097")end)local i,V=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\080\114\101\118\101\110\116\079\108\100\066\117\098\098\108\101\067\104\097\116\079\118\101\114\108\097\112")end)local function N(T)return utf8.len(utf8.nfcnormalize(T))end local X=(128-N("\046\046\046"))-1 local W=Instance.new("\083\099\114\101\101\110\071\117\105")W.Name="\066\117\098\098\108\101\067\104\097\116"W.ResetOnSpawn=false W.Parent=L local function A()local T={data={}}local B=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")T.Emptied=B.Event function T.Size(B)return#T.data end function T.Empty(B)return T:Size()<=0 end function T.PopFront(O)table.remove(T.data,1)if T:Empty()then B:Fire()end end function T.Front(B)return T.data[1]end function T.Get(B,O)return T.data[O]end function T.PushBack(B,O)table.insert(T.data,O)end function T.GetData(B)return T.data end return T end local function E()return{Fifo=A();BillboardGui=nil}end local function m(T,B,O)return B+(O-B)*math.min(N(T)/75,1)end local function I(T,B,O)local u={ComputeBubbleLifetime=function(T,B,O)if O then return m(B,8,15)end return m(B,12,20)end,Origin=nil;RenderBubble=nil;Message=T}u.BubbleDieDelay=u:ComputeBubbleLifetime(T,O)u.BubbleColor=B u.IsLocalPlayer=O return u end local J={WHITE="\100\117\098",BLUE="\098\108\117",GREEN="\103\114\101";RED="\114\101\100"}function createChatBubbleMain(T,B)local O=Instance.new("\073\109\097\103\101\076\097\098\101\108")O.Name="\067\104\097\116\066\117\098\098\108\101"O.ScaleType=Enum.ScaleType.Slice O.SliceCenter=B O.Image="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\047"..(tostring(T).."\046\112\110\103")O.BackgroundTransparency=1 O.BorderSizePixel=0 O.Size=UDim2.new(1,0,1,0)O.Position=UDim2.new(0,0,0,0)return O end function createChatBubbleTail(T,B)local O=Instance.new("\073\109\097\103\101\076\097\098\101\108")O.Name="\067\104\097\116\066\117\098\098\108\101\084\097\105\108"O.Image="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\047\117\105\047\100\105\097\108\111\103\095\116\097\105\108\046\112\110\103"O.BackgroundTransparency=1 O.BorderSizePixel=0 O.Position=T O.Size=B return O end function createChatBubbleWithTail(T,B,O,u)local F=createChatBubbleMain(T,u);(createChatBubbleTail(B,O)).Parent=F return F end function createScaledChatBubbleWithTail(T,B,O,u)local F=createChatBubbleMain(T,u)local L=Instance.new("\070\114\097\109\101")L.Name="\067\104\097\116\066\117\098\098\108\101\084\097\105\108\070\114\097\109\101"L.BackgroundTransparency=1 L.SizeConstraint=Enum.SizeConstraint.RelativeXX L.Position=UDim2.new(.5,0,1,0)L.Size=UDim2.new(B,0,B,0)L.Parent=F;(createChatBubbleTail(O,UDim2.new(1,0,.5,0))).Parent=L return F end function createChatImposter(T,B,O)local u=Instance.new("\073\109\097\103\101\076\097\098\101\108")u.Name="\068\105\097\108\111\103\080\108\097\099\101\104\111\108\100\101\114"u.Image="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\047"..(tostring(T).."\046\112\110\103")u.BackgroundTransparency=1 u.BorderSizePixel=0 u.Position=UDim2.new(0,0,-1.25,0)u.Size=UDim2.new(1,0,1,0)local F=Instance.new("\073\109\097\103\101\076\097\098\101\108")F.Name="\068\111\116\068\111\116\068\111\116"F.Image="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\047"..(tostring(B).."\046\112\110\103")F.BackgroundTransparency=1 F.BorderSizePixel=0 F.Position=UDim2.new(.001,0,O,0)F.Size=UDim2.new(1,0,.7,0)F.Parent=u return u end local Y={ChatBubble={};ChatBubbleWithTail={},ScalingChatBubbleWithTail={},CharacterSortedMsg=(function()local T={data={}}local B=0 function T.Size(T)return B end function T.Erase(O,u)if T.data[u]then B=B-1 end T.data[u]=nil end function T.Set(O,u,F)T.data[u]=F if F then B=B+1 end end function T.Get(B,O)if not O then return end if not T.data[O]then T.data[O]=E()local B=nil B=T.data[O].Fifo.Emptied:connect(function()B:disconnect()T:Erase(O)end)end return T.data[O]end function T.GetData(B)return T.data end return T end)()}local function l(T,B,O,u,F)Y.ChatBubble[T]=createChatBubbleMain(B,F)if u then local T=-1 else v30=0 end Y.ChatBubbleWithTail[T]=createChatBubbleWithTail(B,UDim2.new(.5,-14,1,v30),UDim2.new(0,30,0,14),F)if u then local T=-1 else v31=0 end Y.ScalingChatBubbleWithTail[T]=createScaledChatBubbleWithTail(B,.5,UDim2.new(-0.5,0,0,v31),F)end l(J.WHITE,"\117\105\047\100\105\097\108\111\103\095\119\104\105\116\101","\117\105\047\099\104\097\116\066\117\098\098\108\101\095\119\104\105\116\101\095\110\111\116\105\102\121\095\098\107\103",false,Rect.new(5,5,15,15))l(J.BLUE,"\117\105\047\100\105\097\108\111\103\095\098\108\117\101","\117\105\047\099\104\097\116\066\117\098\098\108\101\095\098\108\117\101\095\110\111\116\105\102\121\095\098\107\103",true,Rect.new(7,7,33,33))l(J.RED,"\117\105\047\100\105\097\108\111\103\095\114\101\100","\117\105\047\099\104\097\116\066\117\098\098\108\101\095\114\101\100\095\110\111\116\105\102\121\095\098\107\103",true,Rect.new(7,7,33,33))l(J.GREEN,"\117\105\047\100\105\097\108\111\103\095\103\114\101\101\110","\117\105\047\099\104\097\116\066\117\098\098\108\101\095\103\114\101\101\110\095\110\111\116\105\102\121\095\098\107\103",true,Rect.new(7,7,33,33))function Y.SanitizeChatLine(T,B)if not(X<N(B))then return B end return string.sub(B,1,utf8.offset(B,(X+N("\046\046\046"))+1)-1)end local function R(T)local B=Instance.new("\066\105\108\108\098\111\097\114\100\071\117\105")B.Adornee=T B.Size=UDim2.new(0,400,0,250)B.StudsOffset=Vector3.new(0,1.5,2)B.Parent=W local O=Instance.new("\070\114\097\109\101")O.Name="\066\105\108\108\098\111\097\114\100\070\114\097\109\101"O.Size=UDim2.new(1,0,1,0)O.Position=UDim2.new(0,0,-0.5,0)O.BackgroundTransparency=1 O.Parent=B local u=nil u=O.ChildRemoved:connect(function()if#O:GetChildren()<=1 then u:disconnect()B:Destroy()end end);(Y:CreateSmallTalkBubble(J.WHITE)).Parent=O return B end function Y.CreateBillboardGuiHelper(T,B,O)if B and not(Y.CharacterSortedMsg:Get(B)).BillboardGui then if not O and B:IsA("\066\097\115\101\080\097\114\116")then(Y.CharacterSortedMsg:Get(B)).BillboardGui=R(B)return end if B:IsA("\077\111\100\101\108")then local T=B:FindFirstChild("\072\101\097\100")if T and T:IsA("\066\097\115\101\080\097\114\116")then(Y.CharacterSortedMsg:Get(B)).BillboardGui=R(T)end end end end local function z(B)if not B or not T.LocalPlayer.Character then return end return B:IsDescendantOf(T.LocalPlayer.Character)end function Y.SetBillboardLODNear(T,B)local O=z(B.Adornee)B.Size=UDim2.new(0,400,0,250)if O then local T=1.5 else v36=2.5 end if O then local T=2 else v37=.1 end B.StudsOffset=Vector3.new(0,v36,v37)B.Enabled=true local u=B.BillboardFrame:GetChildren()for T=1,#u,1 do u[T].Visible=true end B.BillboardFrame.SmallTalkBubble.Visible=false end function Y.SetBillboardLODDistant(T,B)B.Size=UDim2.new(4,0,3,0)if z(B.Adornee)then local T=2 else v40=.1 end B.StudsOffset=Vector3.new(0,3,v40)B.Enabled=true local O=B.BillboardFrame:GetChildren()for T=1,#O,1 do O[T].Visible=false end B.BillboardFrame.SmallTalkBubble.Visible=true end function Y.SetBillboardLODVeryFar(T,B)B.Enabled=false end local function b(T)if not T then return 100000 end return(T.Position-game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude end function Y.SetBillboardGuiLOD(T,B,O)if not O then return end if O:IsA("\077\111\100\101\108")then local T=O:FindFirstChild("\072\101\097\100")if not T then O=O.PrimaryPart else O=T end end local u=b(O)if u<65 then Y:SetBillboardLODNear(B)return end if u>=65 and u<100 then Y:SetBillboardLODDistant(B)return end Y:SetBillboardLODVeryFar(B)end function Y.CameraCFrameChanged(T)for T,B in pairs(Y.CharacterSortedMsg:GetData())do local O=B.BillboardGui if O then Y:SetBillboardGuiLOD(O,T)end end end local Z=x or G local v=Enum.Font.SourceSans local q=Enum.FontSize.Size24 function Y.CreateBubbleText(T,B,O)local u=Instance.new("\084\101\120\116\076\097\098\101\108")u.Name="\066\117\098\098\108\101\084\101\120\116"u.BackgroundTransparency=1 if Z then u.Size=UDim2.fromScale(1,1)else u.Position=UDim2.new(0,15,0,0)u.Size=UDim2.new(1,-30,1,0)end u.Font=v u.ClipsDescendants=true u.TextWrapped=true u.FontSize=q u.Text=B u.Visible=false u.AutoLocalize=O if Z then local T=Instance.new("\085\073\080\097\100\100\105\110\103")T.PaddingTop=UDim.new(0,12)T.PaddingRight=UDim.new(0,12)T.PaddingBottom=UDim.new(0,12)T.PaddingLeft=UDim.new(0,12)T.Parent=u end return u end function Y.CreateSmallTalkBubble(T,B)local O=Y.ScalingChatBubbleWithTail[B]:Clone()O.Name="\083\109\097\108\108\084\097\108\107\066\117\098\098\108\101"O.AnchorPoint=Vector2.new(0,.5)O.Position=UDim2.new(0,0,.5,0)O.Visible=false local u=Y:CreateBubbleText("\046\046\046")u.TextScaled=true u.TextWrapped=false u.Visible=true u.Parent=O return O end function Y.UpdateChatLinesForOrigin(T,B,O)local u=(Y.CharacterSortedMsg:Get(B)).Fifo local F=u:Size()local L=u:GetData()if#L<=1 then return end for T=#L-1,1,-1 do local B=L[T].RenderBubble if not B then return end if(F-T)+1>1 then local T=B:FindFirstChild("\067\104\097\116\066\117\098\098\108\101\084\097\105\108")if T then T:Destroy()end local O=B:FindFirstChild("\066\117\098\098\108\101\084\101\120\116")if O then O.TextTransparency=.5 end end B:TweenPosition(UDim2.new(B.Position.X.Scale,B.Position.X.Offset,1,(O-B.Size.Y.Offset)-14),Enum.EasingDirection.Out,Enum.EasingStyle.Bounce,.1,true)O=(O-B.Size.Y.Offset)-14 end end function Y.DestroyBubble(T,B,O)if not B then return end if B:Empty()then return end local u=(B:Front()).RenderBubble if u then local T=u spawn(function()while(B:Front()).RenderBubble~=O do wait()end T=(B:Front()).RenderBubble local u=T:FindFirstChild("\066\117\098\098\108\101\084\101\120\116")local F=T:FindFirstChild("\067\104\097\116\066\117\098\098\108\101\084\097\105\108")while T and T.ImageTransparency<1 do local B=wait()if T then local O=B*1.5 T.ImageTransparency=T.ImageTransparency+O if u then u.TextTransparency=u.TextTransparency+O end if F then F.ImageTransparency=F.ImageTransparency+O end end end if T then T:Destroy()B:PopFront()end end)return end B:PopFront()end function Y.CreateChatLineRender(T,B,O,F,L,h)if not B then return end if not(Y.CharacterSortedMsg:Get(B)).BillboardGui then Y:CreateBillboardGuiHelper(B,F)end local H=(Y.CharacterSortedMsg:Get(B)).BillboardGui if H then local T=nil local B=Y.ChatBubbleWithTail[O.BubbleColor]:Clone()B.Visible=false local F=Y:CreateBubbleText(O.Message,h)F.Parent=B B.Parent=H.BillboardFrame O.RenderBubble=B local x=u:GetTextSize(F.Text,24,v,Vector2.new(400,250))T=x.Y/24 if Z then local u=math.ceil(x.X+24)local L=T*34 B.Size=UDim2.fromOffset(0,0)B.Position=UDim2.fromScale(.5,1)B:TweenSizeAndPosition(UDim2.fromOffset(u,L),UDim2.new(.5,-u/2,1,-L),Enum.EasingDirection.Out,Enum.EasingStyle.Elastic,.1,true,function()F.Visible=true end)Y:SetBillboardGuiLOD(H,O.Origin)Y:UpdateChatLinesForOrigin(O.Origin,-L)else local u=math.max((x.X+30)/400,.1)B.Size=UDim2.new(0,0,0,0)B.Position=UDim2.new(.5,0,1,0)local L=T*34 B:TweenSizeAndPosition(UDim2.new(u,0,0,L),UDim2.new((1-u)/2,0,1,-L),Enum.EasingDirection.Out,Enum.EasingStyle.Elastic,.1,true,function()F.Visible=true end)Y:SetBillboardGuiLOD(H,O.Origin)Y:UpdateChatLinesForOrigin(O.Origin,-L)end delay(O.BubbleDieDelay,function()Y:DestroyBubble(L,B)end)end end local function n(T,B,O)local u=I(B,J.WHITE,O)if T then u.User=T.Name u.Origin=T.Character end return u end function Y.OnPlayerChatMessage(B,O,u,F)if not Y:BubbleChatEnabled()then return end local L=T.LocalPlayer local h=false if L~=nil then h=O~=L end local H=n(O,Y:SanitizeChatLine(u),not h)if O and H.Origin then local T=(Y.CharacterSortedMsg:Get(H.Origin)).Fifo T:PushBack(H)Y:CreateChatLineRender(O.Character,H,true,T,false)end end local p=a or U local S=i or V local function y(T,B,O,u)local F=I(B,u,O)F.Origin=T return F end local P=h or H function Y.OnGameChatMessage(B,u,F,L)if p or S and O.BubbleChatEnabled then return end local h=T.LocalPlayer local H=false if h~=nil then H=h.Character~=u end local x=J.WHITE if L==Enum.ChatColor.Blue then x=J.BLUE elseif L==Enum.ChatColor.Green then x=J.GREEN elseif L==Enum.ChatColor.Red then x=J.RED end local G=y(u,Y:SanitizeChatLine(F),not H,x);(Y.CharacterSortedMsg:Get(G.Origin)).Fifo:PushBack(G)if P then Y:CreateChatLineRender(u,G,false,(Y.CharacterSortedMsg:Get(G.Origin)).Fifo,true)return end Y:CreateChatLineRender(u,G,false,(Y.CharacterSortedMsg:Get(G.Origin)).Fifo,false)end function Y.BubbleChatEnabled(B)if p or S and O.BubbleChatEnabled then return false end local u=O:FindFirstChild("\067\108\105\101\110\116\067\104\097\116\077\111\100\117\108\101\115")if u then local T=u:FindFirstChild("\067\104\097\116\083\101\116\116\105\110\103\115")if T then local B=require(T)if B.BubbleChatEnabled~=nil then return B.BubbleChatEnabled end end end return T.BubbleChat end function Y.ShowOwnFilteredMessage(T)local B=nil local u=O:FindFirstChild("\067\108\105\101\110\116\067\104\097\116\077\111\100\117\108\101\115")if u then B=u:FindFirstChild("\067\104\097\116\083\101\116\116\105\110\103\115")if not B then return false end else return false end return(require(B)).ShowUserOwnFilteredMessage end function findPlayer(B)local O,u,F=pairs(T:GetPlayers())while true do local T,L=O(u,F)if T then else break end F=T if L.Name==B then return L end end end O.Chatted:connect(function(T,B,O)Y:OnGameChatMessage(T,B,O)end)local Q=nil if game.Workspace.CurrentCamera then Q=(game.Workspace.CurrentCamera:GetPropertyChangedSignal("\067\070\114\097\109\101")):connect(function(T)Y:CameraCFrameChanged()end)end local c=Q game.Workspace.Changed:connect(function(T)if T=="\067\117\114\114\101\110\116\067\097\109\101\114\097"then if c then c:disconnect()end if game.Workspace.CurrentCamera then c=(game.Workspace.CurrentCamera:GetPropertyChangedSignal("\067\070\114\097\109\101")):connect(function(T)Y:CameraCFrameChanged()end)end end end)local D=nil function getAllowedMessageTypes()if D then return D end local T=O:FindFirstChild("\067\108\105\101\110\116\067\104\097\116\077\111\100\117\108\101\115")if T then else return{"\077\101\115\115\097\103\101","\087\104\105\115\112\101\114"}end local B=T:FindFirstChild("\067\104\097\116\083\101\116\116\105\110\103\115")if B then local T=require(B)if T.BubbleChatMessageTypes then D=T.BubbleChatMessageTypes return D end end local u=T:FindFirstChild("\067\104\097\116\067\111\110\115\116\097\110\116\115")if u then local T=require(u)D={T.MessageTypeDefault;T.MessageTypeWhisper}end return D end function checkAllowedMessageType(T)local B=getAllowedMessageTypes()local O=#B local u=0 while true do if B[u]==T.MessageType then return true end if true then if u<O then else break end elseif O<u then else break end u=u+1 end return false end local C=B:WaitForChild("\068\101\102\097\117\108\116\067\104\097\116\083\121\115\116\101\109\067\104\097\116\069\118\101\110\116\115")local d=C:WaitForChild("\079\110\077\101\115\115\097\103\101\068\111\110\101\070\105\108\116\101\114\105\110\103");(C:WaitForChild("\079\110\078\101\119\077\101\115\115\097\103\101")).OnClientEvent:connect(function(T,B)if not checkAllowedMessageType(T)then return end local O=findPlayer(T.FromSpeaker)if not O then return end if(not T.IsFiltered or T.FromSpeaker==F.Name)and(T.FromSpeaker~=F.Name or Y:ShowOwnFilteredMessage())then return end Y:OnPlayerChatMessage(O,T.Message,nil)end)d.OnClientEvent:connect(function(T,B)if not checkAllowedMessageType(T)then return end local O=findPlayer(T.FromSpeaker)if not O then return end if T.FromSpeaker==F.Name and not Y:ShowOwnFilteredMessage()then return end Y:OnPlayerChatMessage(O,T.Message,nil)end)


local l__Players__1 = game:GetService("Players");
local l__ReplicatedStorage__2 = game:GetService("ReplicatedStorage");
local l__Chat__3 = game:GetService("Chat");
local l__TextService__4 = game:GetService("TextService");
local v5 = l__Players__1.LocalPlayer;
while v5 == nil do
	l__Players__1.ChildAdded:wait();
	v5 = l__Players__1.LocalPlayer;
end;
local l__PlayerGui__6 = v5:WaitForChild("PlayerGui");
local v7, v8 = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserShouldLocalizeGameChatBubble");
end);
local v9, v10 = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserFixBubbleChatText");
end);
local v11, v12 = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserRoactBubbleChatBeta");
end);
local v13, v14 = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserPreventOldBubbleChatOverlap");
end);
local function v15(p1)
	return utf8.len(utf8.nfcnormalize(p1));
end;
local v16 = 128 - v15("...") - 1;
local v17 = Instance.new("ScreenGui");
v17.Name = "BubbleChat";
v17.ResetOnSpawn = false;
v17.Parent = l__PlayerGui__6;
local function u1()
	local v18 = {
		data = {}
	};
	local v19 = Instance.new("BindableEvent");
	v18.Emptied = v19.Event;
	function v18.Size(p2)
		return #v18.data;
	end;
	function v18.Empty(p3)
		return v18:Size() <= 0;
	end;
	function v18.PopFront(p4)
		table.remove(v18.data, 1);
		if v18:Empty() then
			v19:Fire();
		end;
	end;
	function v18.Front(p5)
		return v18.data[1];
	end;
	function v18.Get(p6, p7)
		return v18.data[p7];
	end;
	function v18.PushBack(p8, p9)
		table.insert(v18.data, p9);
	end;
	function v18.GetData(p10)
		return v18.data;
	end;
	return v18;
end;
local function u2()
	return {
		Fifo = u1(), 
		BillboardGui = nil
	};
end;
local function u3(p11, p12, p13)
	return p12 + (p13 - p12) * math.min(v15(p11) / 75, 1);
end;
local function u4(p14, p15, p16)
	local v20 = {
		ComputeBubbleLifetime = function(p17, p18, p19)
			if p19 then
				return u3(p18, 8, 15);
			end;
			return u3(p18, 12, 20);
		end, 
		Origin = nil, 
		RenderBubble = nil, 
		Message = p14
	};
	v20.BubbleDieDelay = v20:ComputeBubbleLifetime(p14, p16);
	v20.BubbleColor = p15;
	v20.IsLocalPlayer = p16;
	return v20;
end;
local u5 = {
	WHITE = "dub", 
	BLUE = "blu", 
	GREEN = "gre", 
	RED = "red"
};
function createChatBubbleMain(p20, p21)
	local v21 = Instance.new("ImageLabel");
	v21.Name = "ChatBubble";
	v21.ScaleType = Enum.ScaleType.Slice;
	v21.SliceCenter = p21;
	v21.Image = "rbxasset://textures/" .. tostring(p20) .. ".png";
	v21.BackgroundTransparency = 1;
	v21.BorderSizePixel = 0;
	v21.Size = UDim2.new(1, 0, 1, 0);
	v21.Position = UDim2.new(0, 0, 0, 0);
	return v21;
end;
function createChatBubbleTail(p22, p23)
	local v22 = Instance.new("ImageLabel");
	v22.Name = "ChatBubbleTail";
	v22.Image = "rbxasset://textures/ui/dialog_tail.png";
	v22.BackgroundTransparency = 1;
	v22.BorderSizePixel = 0;
	v22.Position = p22;
	v22.Size = p23;
	return v22;
end;
function createChatBubbleWithTail(p24, p25, p26, p27)
	local v23 = createChatBubbleMain(p24, p27);
	createChatBubbleTail(p25, p26).Parent = v23;
	return v23;
end;
function createScaledChatBubbleWithTail(p28, p29, p30, p31)
	local v24 = createChatBubbleMain(p28, p31);
	local v25 = Instance.new("Frame");
	v25.Name = "ChatBubbleTailFrame";
	v25.BackgroundTransparency = 1;
	v25.SizeConstraint = Enum.SizeConstraint.RelativeXX;
	v25.Position = UDim2.new(0.5, 0, 1, 0);
	v25.Size = UDim2.new(p29, 0, p29, 0);
	v25.Parent = v24;
	createChatBubbleTail(p30, UDim2.new(1, 0, 0.5, 0)).Parent = v25;
	return v24;
end;
function createChatImposter(p32, p33, p34)
	local v26 = Instance.new("ImageLabel");
	v26.Name = "DialogPlaceholder";
	v26.Image = "rbxasset://textures/" .. tostring(p32) .. ".png";
	v26.BackgroundTransparency = 1;
	v26.BorderSizePixel = 0;
	v26.Position = UDim2.new(0, 0, -1.25, 0);
	v26.Size = UDim2.new(1, 0, 1, 0);
	local v27 = Instance.new("ImageLabel");
	v27.Name = "DotDotDot";
	v27.Image = "rbxasset://textures/" .. tostring(p33) .. ".png";
	v27.BackgroundTransparency = 1;
	v27.BorderSizePixel = 0;
	v27.Position = UDim2.new(0.001, 0, p34, 0);
	v27.Size = UDim2.new(1, 0, 0.7, 0);
	v27.Parent = v26;
	return v26;
end;
local u6 = {
	ChatBubble = {}, 
	ChatBubbleWithTail = {}, 
	ScalingChatBubbleWithTail = {}, 
	CharacterSortedMsg = (function()
		local v28 = {
			data = {}
		};
		local u7 = 0;
		function v28.Size(p35)
			return u7;
		end;
		function v28.Erase(p36, p37)
			if v28.data[p37] then
				u7 = u7 - 1;
			end;
			v28.data[p37] = nil;
		end;
		function v28.Set(p38, p39, p40)
			v28.data[p39] = p40;
			if p40 then
				u7 = u7 + 1;
			end;
		end;
		function v28.Get(p41, p42)
			if not p42 then
				return;
			end;
			if not v28.data[p42] then
				v28.data[p42] = u2();
				local u8 = nil;
				u8 = v28.data[p42].Fifo.Emptied:connect(function()
					u8:disconnect();
					v28:Erase(p42);
				end);
			end;
			return v28.data[p42];
		end;
		function v28.GetData(p43)
			return v28.data;
		end;
		return v28;
	end)()
};
local function v29(p44, p45, p46, p47, p48)
	u6.ChatBubble[p44] = createChatBubbleMain(p45, p48);
	if p47 then
		local v30 = -1;
	else
		v30 = 0;
	end;
	u6.ChatBubbleWithTail[p44] = createChatBubbleWithTail(p45, UDim2.new(0.5, -14, 1, v30), UDim2.new(0, 30, 0, 14), p48);
	if p47 then
		local v31 = -1;
	else
		v31 = 0;
	end;
	u6.ScalingChatBubbleWithTail[p44] = createScaledChatBubbleWithTail(p45, 0.5, UDim2.new(-0.5, 0, 0, v31), p48);
end;
v29(u5.WHITE, "ui/dialog_white", "ui/chatBubble_white_notify_bkg", false, Rect.new(5, 5, 15, 15));
v29(u5.BLUE, "ui/dialog_blue", "ui/chatBubble_blue_notify_bkg", true, Rect.new(7, 7, 33, 33));
v29(u5.RED, "ui/dialog_red", "ui/chatBubble_red_notify_bkg", true, Rect.new(7, 7, 33, 33));
v29(u5.GREEN, "ui/dialog_green", "ui/chatBubble_green_notify_bkg", true, Rect.new(7, 7, 33, 33));
function u6.SanitizeChatLine(p49, p50)
	if not (v16 < v15(p50)) then
		return p50;
	end;
	return string.sub(p50, 1, utf8.offset(p50, v16 + v15("...") + 1) - 1);
end;
local function u9(p51)
	local v32 = Instance.new("BillboardGui");
	v32.Adornee = p51;
	v32.Size = UDim2.new(0, 400, 0, 250);
	v32.StudsOffset = Vector3.new(0, 1.5, 2);
	v32.Parent = v17;
	local v33 = Instance.new("Frame");
	v33.Name = "BillboardFrame";
	v33.Size = UDim2.new(1, 0, 1, 0);
	v33.Position = UDim2.new(0, 0, -0.5, 0);
	v33.BackgroundTransparency = 1;
	v33.Parent = v32;
	local u10 = nil;
	u10 = v33.ChildRemoved:connect(function()
		if #v33:GetChildren() <= 1 then
			u10:disconnect();
			v32:Destroy();
		end;
	end);
	u6:CreateSmallTalkBubble(u5.WHITE).Parent = v33;
	return v32;
end;
function u6.CreateBillboardGuiHelper(p52, p53, p54)
	if p53 and not u6.CharacterSortedMsg:Get(p53).BillboardGui then
		if not p54 and p53:IsA("BasePart") then
			u6.CharacterSortedMsg:Get(p53).BillboardGui = u9(p53);
			return;
		end;
		if p53:IsA("Model") then
			local l__Head__34 = p53:FindFirstChild("Head");
			if l__Head__34 and l__Head__34:IsA("BasePart") then
				u6.CharacterSortedMsg:Get(p53).BillboardGui = u9(l__Head__34);
			end;
		end;
	end;
end;
local function u11(p55)
	if not p55 or not l__Players__1.LocalPlayer.Character then
		return;
	end;
	return p55:IsDescendantOf(l__Players__1.LocalPlayer.Character);
end;
function u6.SetBillboardLODNear(p56, p57)
	local v35 = u11(p57.Adornee);
	p57.Size = UDim2.new(0, 400, 0, 250);
	if v35 then
		local v36 = 1.5;
	else
		v36 = 2.5;
	end;
	if v35 then
		local v37 = 2;
	else
		v37 = 0.1;
	end;
	p57.StudsOffset = Vector3.new(0, v36, v37);
	p57.Enabled = true;
	local v38 = p57.BillboardFrame:GetChildren();
	for v39 = 1, #v38 do
		v38[v39].Visible = true;
	end;
	p57.BillboardFrame.SmallTalkBubble.Visible = false;
end;
function u6.SetBillboardLODDistant(p58, p59)
	p59.Size = UDim2.new(4, 0, 3, 0);
	if u11(p59.Adornee) then
		local v40 = 2;
	else
		v40 = 0.1;
	end;
	p59.StudsOffset = Vector3.new(0, 3, v40);
	p59.Enabled = true;
	local v41 = p59.BillboardFrame:GetChildren();
	for v42 = 1, #v41 do
		v41[v42].Visible = false;
	end;
	p59.BillboardFrame.SmallTalkBubble.Visible = true;
end;
function u6.SetBillboardLODVeryFar(p60, p61)
	p61.Enabled = false;
end;
local function u12(p62)
	if not p62 then
		return 100000;
	end;
	return (p62.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude;
end;
function u6.SetBillboardGuiLOD(p63, p64, p65)
	if not p65 then
		return;
	end;
	if p65:IsA("Model") then
		local l__Head__43 = p65:FindFirstChild("Head");
		if not l__Head__43 then
			p65 = p65.PrimaryPart;
		else
			p65 = l__Head__43;
		end;
	end;
	local v44 = u12(p65);
	if v44 < 65 then
		u6:SetBillboardLODNear(p64);
		return;
	end;
	if v44 >= 65 and v44 < 100 then
		u6:SetBillboardLODDistant(p64);
		return;
	end;
	u6:SetBillboardLODVeryFar(p64);
end;
function u6.CameraCFrameChanged(p66)
	for v45, v46 in pairs(u6.CharacterSortedMsg:GetData()) do
		local l__BillboardGui__47 = v46.BillboardGui;
		if l__BillboardGui__47 then
			u6:SetBillboardGuiLOD(l__BillboardGui__47, v45);
		end;
	end;
end;
local u13 = v9 or v10;
local l__Enum_Font_SourceSans__14 = Enum.Font.SourceSans;
local l__Enum_FontSize_Size24__15 = Enum.FontSize.Size24;
function u6.CreateBubbleText(p67, p68, p69)
	local v48 = Instance.new("TextLabel");
	v48.Name = "BubbleText";
	v48.BackgroundTransparency = 1;
	if u13 then
		v48.Size = UDim2.fromScale(1, 1);
	else
		v48.Position = UDim2.new(0, 15, 0, 0);
		v48.Size = UDim2.new(1, -30, 1, 0);
	end;
	v48.Font = l__Enum_Font_SourceSans__14;
	v48.ClipsDescendants = true;
	v48.TextWrapped = true;
	v48.FontSize = l__Enum_FontSize_Size24__15;
	v48.Text = p68;
	v48.Visible = false;
	v48.AutoLocalize = p69;
	if u13 then
		local v49 = Instance.new("UIPadding");
		v49.PaddingTop = UDim.new(0, 12);
		v49.PaddingRight = UDim.new(0, 12);
		v49.PaddingBottom = UDim.new(0, 12);
		v49.PaddingLeft = UDim.new(0, 12);
		v49.Parent = v48;
	end;
	return v48;
end;
function u6.CreateSmallTalkBubble(p70, p71)
	local v50 = u6.ScalingChatBubbleWithTail[p71]:Clone();
	v50.Name = "SmallTalkBubble";
	v50.AnchorPoint = Vector2.new(0, 0.5);
	v50.Position = UDim2.new(0, 0, 0.5, 0);
	v50.Visible = false;
	local v51 = u6:CreateBubbleText("...");
	v51.TextScaled = true;
	v51.TextWrapped = false;
	v51.Visible = true;
	v51.Parent = v50;
	return v50;
end;
function u6.UpdateChatLinesForOrigin(p72, p73, p74)
	local l__Fifo__52 = u6.CharacterSortedMsg:Get(p73).Fifo;
	local v53 = l__Fifo__52:Size();
	local v54 = l__Fifo__52:GetData();
	if #v54 <= 1 then
		return;
	end;
	for v55 = #v54 - 1, 1, -1 do
		local l__RenderBubble__56 = v54[v55].RenderBubble;
		if not l__RenderBubble__56 then
			return;
		end;
		if v53 - v55 + 1 > 1 then
			local l__ChatBubbleTail__57 = l__RenderBubble__56:FindFirstChild("ChatBubbleTail");
			if l__ChatBubbleTail__57 then
				l__ChatBubbleTail__57:Destroy();
			end;
			local l__BubbleText__58 = l__RenderBubble__56:FindFirstChild("BubbleText");
			if l__BubbleText__58 then
				l__BubbleText__58.TextTransparency = 0.5;
			end;
		end;
		l__RenderBubble__56:TweenPosition(UDim2.new(l__RenderBubble__56.Position.X.Scale, l__RenderBubble__56.Position.X.Offset, 1, p74 - l__RenderBubble__56.Size.Y.Offset - 14), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 0.1, true);
		p74 = p74 - l__RenderBubble__56.Size.Y.Offset - 14;
	end;
end;
function u6.DestroyBubble(p75, p76, p77)
	if not p76 then
		return;
	end;
	if p76:Empty() then
		return;
	end;
	local l__RenderBubble__59 = p76:Front().RenderBubble;
	if l__RenderBubble__59 then
		local u16 = l__RenderBubble__59;
		spawn(function()
			while p76:Front().RenderBubble ~= p77 do
				wait();			
			end;
			u16 = p76:Front().RenderBubble;
			local l__BubbleText__60 = u16:FindFirstChild("BubbleText");
			local l__ChatBubbleTail__61 = u16:FindFirstChild("ChatBubbleTail");
			while u16 and u16.ImageTransparency < 1 do
				local v62 = wait();
				if u16 then
					local v63 = v62 * 1.5;
					u16.ImageTransparency = u16.ImageTransparency + v63;
					if l__BubbleText__60 then
						l__BubbleText__60.TextTransparency = l__BubbleText__60.TextTransparency + v63;
					end;
					if l__ChatBubbleTail__61 then
						l__ChatBubbleTail__61.ImageTransparency = l__ChatBubbleTail__61.ImageTransparency + v63;
					end;
				end;			
			end;
			if u16 then
				u16:Destroy();
				p76:PopFront();
			end;
		end);
		return;
	end;
	p76:PopFront();
end;
function u6.CreateChatLineRender(p78, p79, p80, p81, p82, p83)
	if not p79 then
		return;
	end;
	if not u6.CharacterSortedMsg:Get(p79).BillboardGui then
		u6:CreateBillboardGuiHelper(p79, p81);
	end;
	local l__BillboardGui__64 = u6.CharacterSortedMsg:Get(p79).BillboardGui;
	if l__BillboardGui__64 then
		local v65 = nil;
		local v66 = u6.ChatBubbleWithTail[p80.BubbleColor]:Clone();
		v66.Visible = false;
		local v67 = u6:CreateBubbleText(p80.Message, p83);
		v67.Parent = v66;
		v66.Parent = l__BillboardGui__64.BillboardFrame;
		p80.RenderBubble = v66;
		local v68 = l__TextService__4:GetTextSize(v67.Text, 24, l__Enum_Font_SourceSans__14, Vector2.new(400, 250));
		v65 = v68.Y / 24;
		if u13 then
			local v69 = math.ceil(v68.X + 24);
			local v70 = v65 * 34;
			v66.Size = UDim2.fromOffset(0, 0);
			v66.Position = UDim2.fromScale(0.5, 1);
			v66:TweenSizeAndPosition(UDim2.fromOffset(v69, v70), UDim2.new(0.5, -v69 / 2, 1, -v70), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true, function()
				v67.Visible = true;
			end);
			u6:SetBillboardGuiLOD(l__BillboardGui__64, p80.Origin);
			u6:UpdateChatLinesForOrigin(p80.Origin, -v70);
		else
			local v71 = math.max((v68.X + 30) / 400, 0.1);
			v66.Size = UDim2.new(0, 0, 0, 0);
			v66.Position = UDim2.new(0.5, 0, 1, 0);
			local v72 = v65 * 34;
			v66:TweenSizeAndPosition(UDim2.new(v71, 0, 0, v72), UDim2.new((1 - v71) / 2, 0, 1, -v72), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true, function()
				v67.Visible = true;
			end);
			u6:SetBillboardGuiLOD(l__BillboardGui__64, p80.Origin);
			u6:UpdateChatLinesForOrigin(p80.Origin, -v72);
		end;
		delay(p80.BubbleDieDelay, function()
			u6:DestroyBubble(p82, v66);
		end);
	end;
end;
local function u17(p84, p85, p86)
	local v73 = u4(p85, u5.WHITE, p86);
	if p84 then
		v73.User = p84.Name;
		v73.Origin = p84.Character;
	end;
	return v73;
end;
function u6.OnPlayerChatMessage(p87, p88, p89, p90)
	if not u6:BubbleChatEnabled() then
		return;
	end;
	local l__LocalPlayer__74 = l__Players__1.LocalPlayer;
	local v75 = false;
	if l__LocalPlayer__74 ~= nil then
		v75 = p88 ~= l__LocalPlayer__74;
	end;
	local v76 = u17(p88, u6:SanitizeChatLine(p89), not v75);
	if p88 and v76.Origin then
		local l__Fifo__77 = u6.CharacterSortedMsg:Get(v76.Origin).Fifo;
		l__Fifo__77:PushBack(v76);
		u6:CreateChatLineRender(p88.Character, v76, true, l__Fifo__77, false);
	end;
end;
local u18 = v11 or v12;
local u19 = v13 or v14;
local function u20(p91, p92, p93, p94)
	local v78 = u4(p92, p94, p93);
	v78.Origin = p91;
	return v78;
end;
local u21 = v7 or v8;
function u6.OnGameChatMessage(p95, p96, p97, p98)
	if u18 or u19 and l__Chat__3.BubbleChatEnabled then
		return;
	end;
	local l__LocalPlayer__79 = l__Players__1.LocalPlayer;
	local v80 = false;
	if l__LocalPlayer__79 ~= nil then
		v80 = l__LocalPlayer__79.Character ~= p96;
	end;
	local v81 = u5.WHITE;
	if p98 == Enum.ChatColor.Blue then
		v81 = u5.BLUE;
	elseif p98 == Enum.ChatColor.Green then
		v81 = u5.GREEN;
	elseif p98 == Enum.ChatColor.Red then
		v81 = u5.RED;
	end;
	local v82 = u20(p96, u6:SanitizeChatLine(p97), not v80, v81);
	u6.CharacterSortedMsg:Get(v82.Origin).Fifo:PushBack(v82);
	if u21 then
		u6:CreateChatLineRender(p96, v82, false, u6.CharacterSortedMsg:Get(v82.Origin).Fifo, true);
		return;
	end;
	u6:CreateChatLineRender(p96, v82, false, u6.CharacterSortedMsg:Get(v82.Origin).Fifo, false);
end;
function u6.BubbleChatEnabled(p99)
	if u18 or u19 and l__Chat__3.BubbleChatEnabled then
		return false;
	end;
	local l__ClientChatModules__83 = l__Chat__3:FindFirstChild("ClientChatModules");
	if l__ClientChatModules__83 then
		local l__ChatSettings__84 = l__ClientChatModules__83:FindFirstChild("ChatSettings");
		if l__ChatSettings__84 then
			local v85 = require(l__ChatSettings__84);
			if v85.BubbleChatEnabled ~= nil then
				return v85.BubbleChatEnabled;
			end;
		end;
	end;
	return l__Players__1.BubbleChat;
end;
function u6.ShowOwnFilteredMessage(p100)
	local v86 = nil;
	local l__ClientChatModules__87 = l__Chat__3:FindFirstChild("ClientChatModules");
	if l__ClientChatModules__87 then
		v86 = l__ClientChatModules__87:FindFirstChild("ChatSettings");
		if not v86 then
			return false;
		end;
	else
		return false;
	end;
	return require(v86).ShowUserOwnFilteredMessage;
end;
function findPlayer(p101)
	local v88, v89, v90 = pairs(l__Players__1:GetPlayers());
	while true do
		local v91, v92 = v88(v89, v90);
		if v91 then

		else
			break;
		end;
		v90 = v91;
		if v92.Name == p101 then
			return v92;
		end;	
	end;
end;
l__Chat__3.Chatted:connect(function(p102, p103, p104)
	u6:OnGameChatMessage(p102, p103, p104);
end);
local v93 = nil;
if game.Workspace.CurrentCamera then
	v93 = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):connect(function(p105)
		u6:CameraCFrameChanged();
	end);
end;
local u22 = v93;
game.Workspace.Changed:connect(function(p106)
	if p106 == "CurrentCamera" then
		if u22 then
			u22:disconnect();
		end;
		if game.Workspace.CurrentCamera then
			u22 = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):connect(function(p107)
				u6:CameraCFrameChanged();
			end);
		end;
	end;
end);
local u23 = nil;
function getAllowedMessageTypes()
	if u23 then
		return u23;
	end;
	local l__ClientChatModules__94 = l__Chat__3:FindFirstChild("ClientChatModules");
	if l__ClientChatModules__94 then

	else
		return { "Message", "Whisper" };
	end;
	local l__ChatSettings__95 = l__ClientChatModules__94:FindFirstChild("ChatSettings");
	if l__ChatSettings__95 then
		local v96 = require(l__ChatSettings__95);
		if v96.BubbleChatMessageTypes then
			u23 = v96.BubbleChatMessageTypes;
			return u23;
		end;
	end;
	local l__ChatConstants__97 = l__ClientChatModules__94:FindFirstChild("ChatConstants");
	if l__ChatConstants__97 then
		local v98 = require(l__ChatConstants__97);
		u23 = { v98.MessageTypeDefault, v98.MessageTypeWhisper };
	end;
	return u23;
end;
function checkAllowedMessageType(p108)
	local v99 = getAllowedMessageTypes();
	local v100 = #v99;
	local v101 = 1 - 1;
	while true do
		if v99[v101] == p108.MessageType then
			return true;
		end;
		if 0 <= 1 then
			if v101 < v100 then

			else
				break;
			end;
		elseif v100 < v101 then

		else
			break;
		end;
		v101 = v101 + 1;	
	end;
	return false;
end;
local v102 = l__ReplicatedStorage__2:WaitForChild("DefaultChatSystemChatEvents");
local l__OnMessageDoneFiltering__103 = v102:WaitForChild("OnMessageDoneFiltering");
v102:WaitForChild("OnNewMessage").OnClientEvent:connect(function(p109, p110)
	if not checkAllowedMessageType(p109) then
		return;
	end;
	local v104 = findPlayer(p109.FromSpeaker);
	if not v104 then
		return;
	end;
	if (not p109.IsFiltered or p109.FromSpeaker == v5.Name) and (p109.FromSpeaker ~= v5.Name or u6:ShowOwnFilteredMessage()) then
		return;
	end;
	u6:OnPlayerChatMessage(v104, p109.Message, nil);
end);
l__OnMessageDoneFiltering__103.OnClientEvent:connect(function(p111, p112)
	if not checkAllowedMessageType(p111) then
		return;
	end;
	local v105 = findPlayer(p111.FromSpeaker);
	if not v105 then
		return;
	end;
	if p111.FromSpeaker == v5.Name and not u6:ShowOwnFilteredMessage() then
		return;
	end;
	u6:OnPlayerChatMessage(v105, p111.Message, nil);
end);
