local i=(require(((game:GetService("\083\101\114\118\101\114\083\099\114\105\112\116\083\101\114\118\105\099\101")):FindFirstChild("\076\111\097\100\101\114\085\116\105\108\115",true)).Parent)).load(script)local D=i("\077\097\105\100")local m=i("\083\111\102\116\083\104\117\116\100\111\119\110\084\114\097\110\115\108\097\116\111\114")local I=i("\083\111\102\116\083\104\117\116\100\111\119\110\085\073")local e=i("\083\101\114\118\105\099\101\066\097\103")return function(i)local b=D.new()local C=e.new()b:GiveTask(C)local z=C:GetService(m)local t=I.new()b:GiveTask(t);(b:GivePromise(z:PromiseFormatByKey("\115\104\117\116\100\111\119\110\046\108\111\098\098\121\046\116\105\116\108\101"))):Then(function(i)t:SetTitle(i)end);(b:GivePromise(z:PromiseFormatByKey("\115\104\117\116\100\111\119\110\046\108\111\098\098\121\046\115\117\098\116\105\116\108\101"))):Then(function(i)t:SetSubtitle(i)end)t:Show()t.Gui.Parent=i return function()b:DoCleaning()end end


local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).load(script)

local Maid = require("Maid")
local SoftShutdownTranslator = require("SoftShutdownTranslator")
local SoftShutdownUI = require("SoftShutdownUI")
local ServiceBag = require("ServiceBag")

return function(target)
	local maid = Maid.new()
	local serviceBag = ServiceBag.new()
	maid:GiveTask(serviceBag)

	local translator = serviceBag:GetService(SoftShutdownTranslator)

	local softShutdownUI = SoftShutdownUI.new()
	maid:GiveTask(softShutdownUI)

	maid:GivePromise(translator:PromiseFormatByKey("shutdown.lobby.title")):Then(function(text)
		softShutdownUI:SetTitle(text)
	end)

	maid:GivePromise(translator:PromiseFormatByKey("shutdown.lobby.subtitle")):Then(function(text)
		softShutdownUI:SetSubtitle(text)
	end)

	softShutdownUI:Show()

	softShutdownUI.Gui.Parent = target

	return function()
		maid:DoCleaning()
	end
end
