local r=(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 i=r("\066\108\101\110\100")local j=r("\077\097\105\100")return function(r)local t=j.new()local x=i.State("\104\105")t:GiveTask(((i.New("\070\114\097\109\101"))({Size=UDim2.new(1,0,1,0);BackgroundTransparency=1,Parent=r,[i.Children]={(i.New("\084\101\120\116\066\111\120"))({Size=UDim2.new(0,200,0,50);Text=x;[i.OnChange("\084\101\120\116")]=x,[i.OnEvent("\070\111\099\117\115\101\100")]=function()print("\070\111\099\117\115\101\100")end,[function(r)return r.Focused end]=function()print("\070\111\099\117\115\101\100 \040\118\105\097 \102\117\110\099\041")end,[function(r)return r:GetPropertyChangedSignal("\084\101\120\116")end]=function()print("\080\114\111\112\101\114\116\121 \099\104\097\110\103\101\100 \102\114\111\109 \058\071\101\116\080\114\111\112\101\114\116\121\067\104\097\110\103\101\100\083\105\103\110\097\108\040\041")end}),(i.New("\084\101\120\116\066\111\120"))({Size=UDim2.new(0,200,0,50),[i.OnChange("\084\101\120\116")]=x;Text=x}),(i.New("\085\073\076\105\115\116\076\097\121\111\117\116"))({Padding=UDim.new(0,10)})}})):Subscribe())return function()t:DoCleaning()end end
--[[
	@class BlendTextbox.story
]]

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

local Blend = require("Blend")
local Maid = require("Maid")

return function(target)
	local maid = Maid.new()

	local state = Blend.State("hi")

	maid:GiveTask((Blend.New("Frame")({
		Size = UDim2.new(1, 0, 1, 0),
		BackgroundTransparency = 1,
		Parent = target,

		[Blend.Children] = {
			Blend.New("TextBox")({
				Size = UDim2.new(0, 200, 0, 50),
				Text = state,
				[Blend.OnChange("Text")] = state,
				[Blend.OnEvent("Focused")] = function()
					print("Focused")
				end,

				[function(inst)
					return inst.Focused
				end] = function()
					print("Focused (via func)")
				end,

				-- this also works
				[function(inst)
					return inst:GetPropertyChangedSignal("Text")
				end] = function()
					print("Property changed from :GetPropertyChangedSignal()")
				end,
			}),

			Blend.New("TextBox")({
				Size = UDim2.new(0, 200, 0, 50),
				[Blend.OnChange("Text")] = state, -- read state
				Text = state, -- write state
			}),

			Blend.New("UIListLayout")({
				Padding = UDim.new(0, 10),
			}),
		},
	})):Subscribe())

	return function()
		maid:DoCleaning()
	end
end
