local G={}G.__index=G function G.new()local l=setmetatable({},G)l.lastUpdate=tick()l.transparencyDirty=false l.enabled=false l.lastTransparency=nil l.descendantAddedConn=nil l.descendantRemovingConn=nil l.toolDescendantAddedConns={}l.toolDescendantRemovingConns={}l.cachedParts={}return l end function G.HasToolAncestor(G,l)if l.Parent==nil then return false end return l.Parent:IsA("\084\111\111\108")or G:HasToolAncestor(l.Parent)end function G.IsValidPartToModify(G,l)if not l:IsA("\066\097\115\101\080\097\114\116")and not l:IsA("\068\101\099\097\108")then return false end return not G:HasToolAncestor(l)end function G.CachePartsRecursive(G,l)if l then if G:IsValidPartToModify(l)then G.cachedParts[l]=true G.transparencyDirty=true end for l,E in pairs(l:GetChildren())do G:CachePartsRecursive(E)end end end function G.TeardownTransparency(G)for G,l in pairs(G.cachedParts)do G.LocalTransparencyModifier=0 end G.cachedParts={}G.transparencyDirty=true G.lastTransparency=nil if G.descendantAddedConn then G.descendantAddedConn:disconnect()G.descendantAddedConn=nil end if G.descendantRemovingConn then G.descendantRemovingConn:disconnect()G.descendantRemovingConn=nil end for l,E in pairs(G.toolDescendantAddedConns)do E:Disconnect()G.toolDescendantAddedConns[l]=nil end for l,E in pairs(G.toolDescendantRemovingConns)do E:Disconnect()G.toolDescendantRemovingConns[l]=nil end end function G.SetupTransparency(G,l)G:TeardownTransparency()if G.descendantAddedConn then G.descendantAddedConn:disconnect()end G.descendantAddedConn=l.DescendantAdded:Connect(function(E)if G:IsValidPartToModify(E)then G.cachedParts[E]=true G.transparencyDirty=true return end if E:IsA("\084\111\111\108")then if G.toolDescendantAddedConns[E]then G.toolDescendantAddedConns[E]:Disconnect()end G.toolDescendantAddedConns[E]=E.DescendantAdded:Connect(function(l)G.cachedParts[l]=nil if l:IsA("\066\097\115\101\080\097\114\116")or l:IsA("\068\101\099\097\108")then l.LocalTransparencyModifier=0 end end)if G.toolDescendantRemovingConns[E]then G.toolDescendantRemovingConns[E]:disconnect()end G.toolDescendantRemovingConns[E]=E.DescendantRemoving:Connect(function(E)wait()if l and(E and(E:IsDescendantOf(l)and G:IsValidPartToModify(E)))then G.cachedParts[E]=true G.transparencyDirty=true end end)end end)if G.descendantRemovingConn then G.descendantRemovingConn:disconnect()end G.descendantRemovingConn=l.DescendantRemoving:connect(function(l)if G.cachedParts[l]then G.cachedParts[l]=nil l.LocalTransparencyModifier=0 end end)G:CachePartsRecursive(l)end function G.Enable(G,l)if G.enabled~=l then G.enabled=l G:Update()end end function G.SetSubject(G,l)local E=nil if l and l:IsA("\072\117\109\097\110\111\105\100")then E=l.Parent end if l and(l:IsA("\086\101\104\105\099\108\101\083\101\097\116")and l.Occupant)then E=l.Occupant.Parent end if not E then G:TeardownTransparency()return end G:SetupTransparency(E)end local l=require(script.Parent:WaitForChild("\067\097\109\101\114\097\085\116\105\108\115"))function G.Update(G)local E=tick()local Y=workspace.CurrentCamera if Y then local B=0 if G.enabled then local p=(Y.Focus.p-Y.CoordinateFrame.p).magnitude local J=p<2 and 1-(p-.5)/1.5 or 0 if J<.5 then J=0 end if G.lastTransparency then local l=J-G.lastTransparency if true and(J<1 and G.lastTransparency<.95)then local Y=2.8*(E-G.lastUpdate)l=math.clamp(l,-Y,Y)end J=G.lastTransparency+l else G.transparencyDirty=true end B=math.clamp(l.Round(J,2),0,1)end if G.transparencyDirty or G.lastTransparency~=B then for G,l in pairs(G.cachedParts)do G.LocalTransparencyModifier=B end G.transparencyDirty=false G.lastTransparency=B end end G.lastUpdate=E end return G
-- Decompiled with the Synapse X Luau decompiler.

local v1 = {}
v1.__index = v1
function v1.new()
	local v2 = setmetatable({}, v1)
	v2.lastUpdate = tick()
	v2.transparencyDirty = false
	v2.enabled = false
	v2.lastTransparency = nil
	v2.descendantAddedConn = nil
	v2.descendantRemovingConn = nil
	v2.toolDescendantAddedConns = {}
	v2.toolDescendantRemovingConns = {}
	v2.cachedParts = {}
	return v2
end
function v1.HasToolAncestor(p1, p2)
	if p2.Parent == nil then
		return false
	end
	return p2.Parent:IsA("Tool") or p1:HasToolAncestor(p2.Parent)
end
function v1.IsValidPartToModify(p3, p4)
	if not p4:IsA("BasePart") and not p4:IsA("Decal") then
		return false
	end
	return not p3:HasToolAncestor(p4)
end
function v1.CachePartsRecursive(p5, p6)
	if p6 then
		if p5:IsValidPartToModify(p6) then
			p5.cachedParts[p6] = true
			p5.transparencyDirty = true
		end
		for v3, v4 in pairs(p6:GetChildren()) do
			p5:CachePartsRecursive(v4)
		end
	end
end
function v1.TeardownTransparency(p7)
	for v5, v6 in pairs(p7.cachedParts) do
		v5.LocalTransparencyModifier = 0
	end
	p7.cachedParts = {}
	p7.transparencyDirty = true
	p7.lastTransparency = nil
	if p7.descendantAddedConn then
		p7.descendantAddedConn:disconnect()
		p7.descendantAddedConn = nil
	end
	if p7.descendantRemovingConn then
		p7.descendantRemovingConn:disconnect()
		p7.descendantRemovingConn = nil
	end
	for v7, v8 in pairs(p7.toolDescendantAddedConns) do
		v8:Disconnect()
		p7.toolDescendantAddedConns[v7] = nil
	end
	for v9, v10 in pairs(p7.toolDescendantRemovingConns) do
		v10:Disconnect()
		p7.toolDescendantRemovingConns[v9] = nil
	end
end
function v1.SetupTransparency(p8, p9)
	p8:TeardownTransparency()
	if p8.descendantAddedConn then
		p8.descendantAddedConn:disconnect()
	end
	p8.descendantAddedConn = p9.DescendantAdded:Connect(function(p10)
		if p8:IsValidPartToModify(p10) then
			p8.cachedParts[p10] = true
			p8.transparencyDirty = true
			return
		end
		if p10:IsA("Tool") then
			if p8.toolDescendantAddedConns[p10] then
				p8.toolDescendantAddedConns[p10]:Disconnect()
			end
			p8.toolDescendantAddedConns[p10] = p10.DescendantAdded:Connect(function(p11)
				p8.cachedParts[p11] = nil
				if p11:IsA("BasePart") or p11:IsA("Decal") then
					p11.LocalTransparencyModifier = 0
				end
			end)
			if p8.toolDescendantRemovingConns[p10] then
				p8.toolDescendantRemovingConns[p10]:disconnect()
			end
			p8.toolDescendantRemovingConns[p10] = p10.DescendantRemoving:Connect(function(p12)
				wait()
				if p9 and p12 and p12:IsDescendantOf(p9) and p8:IsValidPartToModify(p12) then
					p8.cachedParts[p12] = true
					p8.transparencyDirty = true
				end
			end)
		end
	end)
	if p8.descendantRemovingConn then
		p8.descendantRemovingConn:disconnect()
	end
	p8.descendantRemovingConn = p9.DescendantRemoving:connect(function(p13)
		if p8.cachedParts[p13] then
			p8.cachedParts[p13] = nil
			p13.LocalTransparencyModifier = 0
		end
	end)
	p8:CachePartsRecursive(p9)
end
function v1.Enable(p14, p15)
	if p14.enabled ~= p15 then
		p14.enabled = p15
		p14:Update()
	end
end
function v1.SetSubject(p16, p17)
	local v11 = nil
	if p17 and p17:IsA("Humanoid") then
		v11 = p17.Parent
	end
	if p17 and p17:IsA("VehicleSeat") and p17.Occupant then
		v11 = p17.Occupant.Parent
	end
	if not v11 then
		p16:TeardownTransparency()
		return
	end
	p16:SetupTransparency(v11)
end
local u1 = require(script.Parent:WaitForChild("CameraUtils"))
function v1.Update(p18)
	local v12 = tick()
	local l__CurrentCamera__13 = workspace.CurrentCamera
	if l__CurrentCamera__13 then
		local v14 = 0
		if p18.enabled then
			local l__magnitude__15 = (l__CurrentCamera__13.Focus.p - l__CurrentCamera__13.CoordinateFrame.p).magnitude
			local v16 = l__magnitude__15 < 2 and 1 - (l__magnitude__15 - 0.5) / 1.5 or 0
			if v16 < 0.5 then
				v16 = 0
			end
			if p18.lastTransparency then
				local v17 = v16 - p18.lastTransparency
				if not false and v16 < 1 and p18.lastTransparency < 0.95 then
					local v18 = 2.8 * (v12 - p18.lastUpdate)
					v17 = math.clamp(v17, -v18, v18)
				end
				v16 = p18.lastTransparency + v17
			else
				p18.transparencyDirty = true
			end
			v14 = math.clamp(u1.Round(v16, 2), 0, 1)
		end
		if p18.transparencyDirty or p18.lastTransparency ~= v14 then
			for v19, v20 in pairs(p18.cachedParts) do
				v19.LocalTransparencyModifier = v14
			end
			p18.transparencyDirty = false
			p18.lastTransparency = v14
		end
	end
	p18.lastUpdate = v12
end
return v1
