local O=require(script.FiOne)local g=script.Parent local Y=script.ReturnPass local M=function(...)return...end g:BindToMessage("\119\114\097\112\095\115\116\097\116\101",function(g,Y,D)M=O.wrap_state(g,Y,D)end)g:BindToMessageParallel("\114\117\110\095\099\097\108\108\098\097\099\107",function(O,...)Y:Fire(O,pcall(M,...))end)
--!native
--!optimize 2
--[[
	Description: Wrapper for FiOne multithread closures
	Author: github@ccuser44
	Date: 2024
	License: CC0
]]

local fiOne = require(script.FiOne)
local actor = script.Parent
local event = script.ReturnPass
local callback = function(...) return ... end

actor:BindToMessage("wrap_state", function(proto, env, upval)
	callback = fiOne.wrap_state(proto, env, upval)
end)

actor:BindToMessageParallel("run_callback", function(tag, ...)
	event:Fire(tag, pcall(callback, ...))
end)
