local v0 = {};
local l_InsertService_0 = game:GetService("InsertService");
local l_CollectionService_0 = game:GetService("CollectionService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_Modules_0 = l_script_FirstAncestor_0.Src.Modules;
local v5 = require(l_Modules_0.CharacterMeshesMap);
local v6 = require(l_Modules_0.ClassicHeadsMap);
local v7 = require(l_Modules_0.NpcIdManager);
local v8 = require(l_script_FirstAncestor_0.Src.Util.findAllInServices);
local v9 = require(l_script_FirstAncestor_0.Src.Util.areCFramesEqual);
local v10 = require(l_script_FirstAncestor_0.Src.Util.AnimationConversion.normalizeAssetId);
local v11 = require(l_script_FirstAncestor_0.Src.Util.ScriptAnalysis.Constants);
local v12 = require(l_script_FirstAncestor_0.Src.Util.SaveInterface);
local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
local l_StarterCharacterScripts_0 = game:GetService("StarterPlayer"):FindFirstChild("StarterCharacterScripts");
local v15 = {
    AdaptInstance = "rbxasset://avatar/unification/AdaptInstance.lua",
    SetupAdapterParts = "rbxasset://avatar/unification/SetupAdapterParts.lua"
};
local v16 = "rbxasset://avatar/unification/" .. "LocalEffects" .. ".lua";
local v17 = "rbxasset://avatar/unification/" .. "UnificationServerScript" .. "R15Migrator" .. ".lua";
local v18 = l_InsertService_0:LoadLocalAsset("rbxasset://avatar/unification/AdapterReference.rbxm");
local v19 = l_InsertService_0:LoadLocalAsset("rbxasset://avatar/unification/R15.rbxm");
local l_Color_0 = v19.UpperTorso.Color;
local v21 = CFrame.Angles(1.5707963267948966, -3.141592653589793, 0);
local v22 = CFrame.Angles(0, -1.5707963267948966, 0);
local v23 = CFrame.Angles(0, 1.5707963267948966, 0);
local v24 = {
    RootJoint = {
        C0 = v21,
        C1 = v21
    },
    Neck = {
        C0 = CFrame.new(0, 1, 0) * v21,
        C1 = CFrame.new(0, -0.5, 0) * v21
    },
    ["Right Shoulder"] = {
        C0 = CFrame.new(1, 0.5, 0) * v23,
        C1 = CFrame.new(-0.5, 0.5, 0) * v23
    },
    ["Right Hip"] = {
        C0 = CFrame.new(1, -1, 0) * v23,
        C1 = CFrame.new(0.5, 1, 0) * v23
    },
    ["Left Shoulder"] = {
        C0 = CFrame.new(-1, 0.5, 0) * v22,
        C1 = CFrame.new(0.5, 0.5, 0) * v22
    },
    ["Left Hip"] = {
        C0 = CFrame.new(-1, -1, 0) * v22,
        C1 = CFrame.new(-0.5, 1, 0) * v22
    }
};
local v25 = {
    Root = v21:Inverse(),
    Neck = v21:Inverse(),
    RightShoulder = v23:Inverse(),
    RightHip = v23:Inverse(),
    LeftShoulder = v22:Inverse(),
    LeftHip = v22:Inverse()
};
local v26 = {
    ["Left Hip"] = "LeftHip",
    ["Right Hip"] = "RightHip",
    ["Left Shoulder"] = "LeftShoulder",
    ["Right Shoulder"] = "RightShoulder",
    Neck = "Neck",
    RootJoint = "Root"
};
local v27 = {
    ["Left Hip"] = {
        Part0Name = "Torso",
        Part1Name = "Left Leg"
    },
    ["Right Hip"] = {
        Part0Name = "Torso",
        Part1Name = "Right Leg"
    },
    ["Left Shoulder"] = {
        Part0Name = "Torso",
        Part1Name = "Left Arm"
    },
    ["Right Shoulder"] = {
        Part0Name = "Torso",
        Part1Name = "Right Arm"
    },
    Neck = {
        Part0Name = "Torso",
        Part1Name = "Head"
    },
    RootJoint = {
        Part0Name = "HumanoidRootPart",
        Part1Name = "Torso"
    }
};
local v28 = {
    [Enum.BodyPart.Head] = {
        "Head"
    },
    [Enum.BodyPart.Torso] = {
        "UpperTorso",
        "LowerTorso"
    },
    [Enum.BodyPart.LeftArm] = {
        "LeftUpperArm",
        "LeftLowerArm",
        "LeftHand"
    },
    [Enum.BodyPart.RightArm] = {
        "RightUpperArm",
        "RightLowerArm",
        "RightHand"
    },
    [Enum.BodyPart.LeftLeg] = {
        "LeftUpperLeg",
        "LeftLowerLeg",
        "LeftFoot"
    },
    [Enum.BodyPart.RightLeg] = {
        "RightUpperLeg",
        "RightLowerLeg",
        "RightFoot"
    }
};
local v29 = {
    [Enum.BodyPart.Head] = "Head",
    [Enum.BodyPart.Torso] = "Torso",
    [Enum.BodyPart.LeftArm] = "Left Arm",
    [Enum.BodyPart.RightArm] = "Right Arm",
    [Enum.BodyPart.LeftLeg] = "Left Leg",
    [Enum.BodyPart.RightLeg] = "Right Leg"
};
local v30 = {};
for v31, v32 in v29, nil, nil do
    v30[v32] = v31;
end;
local v33 = {};
for v34, v35 in v28, nil, nil do
    for _, v37 in v35, nil, nil do
        v33[v37] = v34;
    end;
end;
local v38 = {
    "R15ArtistIntent",
    "R15",
    "R15Fixed"
};
v0.GetBodyPartR6 = function(v39)
    if v39 then
        return v30[v39.Name];
    else
        return ;
    end;
end;
v0.GetR15PartsFromBodyPart = function(v40)
    if v40 then
        return v28[v40];
    else
        return ;
    end;
end;
v0.GetLimbForR15Part = function(v41)
    if v41 then
        local v42 = v33[v41];
        if v42 then
            return v29[v42];
        else
            return ;
        end;
    else
        return ;
    end;
end;
local function _(v43, v44)
    local l_Humanoid_0 = v43:FindFirstChildOfClass("Humanoid");
    if not l_Humanoid_0 then
        return false;
    else
        return l_Humanoid_0.RigType == v44;
    end;
end;
v0.GetR6Npcs = function()
    return v8(function(v47)
        local v48 = v47:IsA("Model");
        if v48 then
            local l_R6_0 = Enum.HumanoidRigType.R6;
            local l_Humanoid_1 = v47:FindFirstChildOfClass("Humanoid");
            if not l_Humanoid_1 then
                v48 = false;
            else
                return l_Humanoid_1.RigType == l_R6_0;
            end;
        end;
        return v48;
    end);
end;
v0.GetR15ConvertedNpcs = function()
    return v8(function(v51)
        if v51:IsA("Model") then
            local l_R15_0 = Enum.HumanoidRigType.R15;
            local l_Humanoid_2 = v51:FindFirstChildOfClass("Humanoid");
            if not not l_Humanoid_2 and l_Humanoid_2.RigType == l_R15_0 then
                return v12.hasConvertedFrom(v51);
            end;
        end;
        return false;
    end);
end;
v0.IsR15Complete = function(v54)
    if v54:IsA("Model") then
        local l_R15_1 = Enum.HumanoidRigType.R15;
        local l_Humanoid_3 = v54:FindFirstChildOfClass("Humanoid");
        if not not l_Humanoid_3 and l_Humanoid_3.RigType == l_R15_1 then
            for _, v58 in v28, nil, nil do
                for _, v60 in v58, nil, nil do
                    if not v54:FindFirstChild(v60) then
                        return false;
                    end;
                end;
            end;
            return true;
        end;
    end;
    return false;
end;
v0.ClearAdapterSetup = function()
    for _, v63 in (v8(function(v61)
        return v61:IsA("Model") and v61:FindFirstChild("Humanoid");
    end)), nil, nil do
        for _, v65 in v63:GetDescendants() do
            if v65:IsA("LuaSourceContainer") and v65.Name == "UnificationServerScript" then
                v65:Destroy();
            end;
        end;
    end;
    local l_AvatarUnification_0 = l_ReplicatedStorage_0:FindFirstChild("AvatarUnification");
    if l_AvatarUnification_0 then
        l_AvatarUnification_0:Destroy();
    end;
    local l_LocalEffects_0 = l_StarterCharacterScripts_0:FindFirstChild("LocalEffects");
    if l_LocalEffects_0 then
        l_LocalEffects_0:Destroy();
    end;
end;
local function v77(v68)
    local v69 = {};
    for _, v71 in v68:GetChildren() do
        if v71:IsA("CharacterMesh") then
            v69[v71.BodyPart] = tostring(v71.MeshId);
        end;
    end;
    for _, v73 in v68:GetChildren() do
        if not (not v73:IsA("Part") or not v30[v73.Name]) then
            local l_SpecialMesh_0 = v73:FindFirstChildOfClass("SpecialMesh");
            local v75 = v30[v73.Name];
            if not (not l_SpecialMesh_0 or v69[v75]) then
                local v76 = v10(l_SpecialMesh_0.MeshId);
                if v76 then
                    v69[v75] = tostring(v76);
                end;
            end;
        end;
    end;
    return v69;
end;
local function _(v78)
    if v78 then
        local l_Decal_0 = Instance.new("Decal");
        l_Decal_0.Name = "face";
        l_Decal_0.Color3 = v78.Color3;
        l_Decal_0.Texture = v78.Texture;
        l_Decal_0.Transparency = v78.Transparency;
        l_Decal_0.ZIndex = v78.ZIndex;
        return l_Decal_0;
    else
        return ;
    end;
end;
local function v94(v81, v82, v83, v84)
    local v85 = v28[v81];
    if v85 then
        for _, v87 in v85, nil, nil do
            local l_v19_FirstChild_0 = v19:FindFirstChild(v87);
            if l_v19_FirstChild_0 then
                local l_v82_FirstChild_0 = v82:FindFirstChild(v87);
                if l_v82_FirstChild_0 then
                    l_v82_FirstChild_0:Destroy();
                end;
                local v90 = l_v19_FirstChild_0:Clone();
                v90.Color = v83;
                if v81 == Enum.BodyPart.Head then
                    local l_Decal_1 = v90:FindFirstChildOfClass("Decal");
                    if l_Decal_1 and l_Decal_1.Name == "face" then
                        l_Decal_1:Destroy();
                    end;
                    local v92;
                    if v84 then
                        local l_Decal_2 = Instance.new("Decal");
                        l_Decal_2.Name = "face";
                        l_Decal_2.Color3 = v84.Color3;
                        l_Decal_2.Texture = v84.Texture;
                        l_Decal_2.Transparency = v84.Transparency;
                        l_Decal_2.ZIndex = v84.ZIndex;
                        v92 = l_Decal_2;
                    else
                        v92 = nil;
                    end;
                    if v92 then
                        v92.Parent = v90;
                    end;
                end;
                v90.Parent = v82;
            end;
        end;
        return ;
    else
        return ;
    end;
end;
local function v114(v95, v96, v97, v98, v99, v100)
    local v101 = v5[v97];
    local l_status_0, l_result_0 = pcall(function()
        return l_InsertService_0:LoadAsset(v101);
    end);
    if l_status_0 then
        local v104 = nil;
        for _, v106 in v38, nil, nil do
            v104 = l_result_0:FindFirstChild(v106);
            if v104 then
                break;
            end;
        end;
        if v104 then
            for v107, v108 in v28[v95], nil, nil do
                local l_v104_FirstChild_0 = v104:FindFirstChild(v108);
                if l_v104_FirstChild_0 then
                    local v110 = l_v104_FirstChild_0:Clone();
                    v110.Color = v98;
                    if v95 == Enum.BodyPart.Head then
                        local l_Decal_3 = v110:FindFirstChildOfClass("Decal");
                        if l_Decal_3 and l_Decal_3.Name == "face" then
                            l_Decal_3:Destroy();
                        end;
                        local v112;
                        if v99 then
                            local l_Decal_4 = Instance.new("Decal");
                            l_Decal_4.Name = "face";
                            l_Decal_4.Color3 = v99.Color3;
                            l_Decal_4.Texture = v99.Texture;
                            l_Decal_4.Transparency = v99.Transparency;
                            l_Decal_4.ZIndex = v99.ZIndex;
                            v112 = l_Decal_4;
                        else
                            v112 = nil;
                        end;
                        if v112 then
                            v112.Parent = v110;
                        end;
                    elseif not (not (v107 == 1) or not v100) then
                        v110.TextureID = v100;
                    end;
                    v110.Parent = v96;
                end;
            end;
            return ;
        else
            warn("Failed to find R15 folder for " .. tostring(v95) .. " with meshId " .. v97);
            v94(v95, v96);
            return ;
        end;
    else
        warn("Failed to load R15 part for " .. tostring(v95) .. " with meshId " .. v97);
        v94(v95, v96);
        return ;
    end;
end;
local function v128(v115)
    local l_l_InsertService_0_MeshPartAsync_0 = l_InsertService_0:CreateMeshPartAsync(v115.MeshId, Enum.CollisionFidelity.Default, Enum.RenderFidelity.Automatic);
    l_l_InsertService_0_MeshPartAsync_0.TextureID = v115.TextureId;
    l_l_InsertService_0_MeshPartAsync_0.Size = l_l_InsertService_0_MeshPartAsync_0.Size * v115.Scale;
    l_l_InsertService_0_MeshPartAsync_0.Name = "Head";
    if not l_CollectionService_0:HasTag(v115, "NoFace") then
        local l_Decal_5 = Instance.new("Decal");
        l_Decal_5.Parent = l_l_InsertService_0_MeshPartAsync_0;
        l_Decal_5.Name = "face";
        l_Decal_5.Texture = "rbxasset://textures/face.png";
    end;
    for _, v119 in v115:GetChildren() do
        if v119:IsA("Vector3Value") and string.sub(v119.Name, -10) == "Attachment" then
            local l_Attachment_0 = Instance.new("Attachment");
            l_Attachment_0.Name = v119.Name;
            l_Attachment_0.Position = v119.Value;
            l_Attachment_0.Parent = l_l_InsertService_0_MeshPartAsync_0;
        else
            local v121 = v119:Clone();
            v121.Parent = l_l_InsertService_0_MeshPartAsync_0;
            if v121:IsA("Attachment") then
                v121.Position = v121.Position - v115.Offset;
            end;
        end;
    end;
    if not l_l_InsertService_0_MeshPartAsync_0:FindFirstChild("AvatarPartScaleType") then
        local l_StringValue_0 = Instance.new("StringValue");
        l_StringValue_0.Name = "AvatarPartScaleType";
        l_StringValue_0.Value = "Classic";
        l_StringValue_0.Parent = l_l_InsertService_0_MeshPartAsync_0;
    end;
    if not l_l_InsertService_0_MeshPartAsync_0:FindFirstChild("FaceCenterAttachment") then
        local l_Attachment_1 = Instance.new("Attachment");
        l_Attachment_1.Name = "FaceCenterAttachment";
        l_Attachment_1.Position = Vector3.new(0, 0, 0);
        l_Attachment_1.Parent = l_l_InsertService_0_MeshPartAsync_0;
    end;
    if not l_l_InsertService_0_MeshPartAsync_0:FindFirstChild("FaceFrontAttachment") then
        local l_Attachment_2 = Instance.new("Attachment");
        l_Attachment_2.Name = "FaceFrontAttachment";
        l_Attachment_2.Position = Vector3.new(0, 0, -0.6);
        l_Attachment_2.Parent = l_l_InsertService_0_MeshPartAsync_0;
    end;
    if not l_l_InsertService_0_MeshPartAsync_0:FindFirstChild("HairAttachment") then
        local l_Attachment_3 = Instance.new("Attachment");
        l_Attachment_3.Name = "HairAttachment";
        l_Attachment_3.Position = Vector3.new(0, 0.6, 0);
        l_Attachment_3.Parent = l_l_InsertService_0_MeshPartAsync_0;
    end;
    if not l_l_InsertService_0_MeshPartAsync_0:FindFirstChild("HatAttachment") then
        local l_Attachment_4 = Instance.new("Attachment");
        l_Attachment_4.Name = "HatAttachment";
        l_Attachment_4.Position = Vector3.new(0, 0.6, 0);
        l_Attachment_4.Parent = l_l_InsertService_0_MeshPartAsync_0;
    end;
    if not l_l_InsertService_0_MeshPartAsync_0:FindFirstChild("NeckRigAttachment") then
        local l_Attachment_5 = Instance.new("Attachment");
        l_Attachment_5.Name = "NeckRigAttachment";
        l_Attachment_5.Position = Vector3.new(0, -0.5, 0);
        l_Attachment_5.Parent = l_l_InsertService_0_MeshPartAsync_0;
    end;
    return l_l_InsertService_0_MeshPartAsync_0;
end;
local function v145(v129, v130, v131, v132)
    local l_SpecialMesh_1 = v132:FindFirstChildOfClass("SpecialMesh");
    local v134 = tostring(v10(l_SpecialMesh_1.MeshId));
    assert(l_SpecialMesh_1, "SpecialMesh must exist if loadMeshPartHead() is called");
    local v135 = v6[v134];
    local l_status_1, l_result_1 = pcall(function()
        return l_InsertService_0:LoadAsset(v135);
    end);
    if not (not (not l_status_1 or not l_result_1) and #l_result_1:GetChildren() > 0) or not l_result_1:GetChildren()[1]:IsA("SpecialMesh") then
        warn("Failed to load R15 head for meshId " .. v134);
    else
        l_SpecialMesh_1.MeshId = l_result_1:GetChildren()[1].MeshId;
    end;
    local v138 = v128(l_SpecialMesh_1);
    for _, v140 in v132:GetChildren() do
        if not v140:IsA("SpecialMesh") and (not v140:IsA("Weld") or v140.Name ~= "HeadWeld") then
            local l_v138_FirstChild_0 = v138:FindFirstChild(v140.Name);
            if l_v138_FirstChild_0 and l_v138_FirstChild_0.ClassName == v140.ClassName then
                l_v138_FirstChild_0:Destroy();
            end;
            v140.Parent = v138;
        end;
    end;
    v132:Destroy();
    v138.Color = v130;
    local l_Decal_6 = v138:FindFirstChildOfClass("Decal");
    if l_Decal_6 and l_Decal_6.Name == "face" then
        l_Decal_6:Destroy();
    end;
    local v143;
    if v131 then
        local l_Decal_7 = Instance.new("Decal");
        l_Decal_7.Name = "face";
        l_Decal_7.Color3 = v131.Color3;
        l_Decal_7.Texture = v131.Texture;
        l_Decal_7.Transparency = v131.Transparency;
        l_Decal_7.ZIndex = v131.ZIndex;
        v143 = l_Decal_7;
    else
        v143 = nil;
    end;
    if v143 then
        v143.Parent = v138;
    end;
    v138.Parent = v129;
end;
local function _(v146, v147)
    local l_l_InsertService_0_LocalFileContents_0 = l_InsertService_0:GetLocalFileContents(v147);
    local l_ModuleScript_0 = Instance.new("ModuleScript");
    l_ModuleScript_0.Name = v146;
    l_ModuleScript_0.Source = l_l_InsertService_0_LocalFileContents_0;
    return l_ModuleScript_0;
end;
v0.RemoveUnificationScripts = function(v151)
    local l_UnificationServerScript_0 = v151:FindFirstChild("UnificationServerScript");
    if l_UnificationServerScript_0 then
        l_UnificationServerScript_0:Destroy();
    end;
end;
v0.HasUnificationScripts = function(v153)
    return v153:FindFirstChild("UnificationServerScript") ~= nil;
end;
v0.SetupUnificationScripts = function(v154)
    if not l_ReplicatedStorage_0:FindFirstChild("AvatarUnification") then
        local l_Folder_0 = Instance.new("Folder");
        l_Folder_0.Parent = l_ReplicatedStorage_0;
        l_Folder_0.Name = "AvatarUnification";
        for v156, v157 in v15, nil, nil do
            local l_l_InsertService_0_LocalFileContents_1 = l_InsertService_0:GetLocalFileContents(v157);
            local l_ModuleScript_1 = Instance.new("ModuleScript");
            l_ModuleScript_1.Name = v156;
            l_ModuleScript_1.Source = l_l_InsertService_0_LocalFileContents_1;
            local l_l_ModuleScript_1_0 = l_ModuleScript_1;
            l_l_ModuleScript_1_0:SetAttribute(v11.AttributeUnificationScriptName, true);
            l_l_ModuleScript_1_0.Parent = l_Folder_0;
        end;
    end;
    if not v154:FindFirstChild("UnificationServerScript") then
        local l_Script_0 = Instance.new("Script");
        l_Script_0.Name = "UnificationServerScript";
        l_Script_0.Source = l_InsertService_0:GetLocalFileContents(v17);
        l_Script_0:SetAttribute(v11.AttributeUnificationScriptName, true);
        l_Script_0.Parent = v154;
        v18:Clone().Parent = l_Script_0;
    end;
    if not l_StarterCharacterScripts_0:FindFirstChild("LocalEffects") then
        local l_LocalScript_0 = Instance.new("LocalScript");
        l_LocalScript_0.Name = "LocalEffects";
        l_LocalScript_0.Source = l_InsertService_0:GetLocalFileContents(v16);
        l_LocalScript_0:SetAttribute(v11.AttributeUnificationScriptName, true);
        l_LocalScript_0.Parent = l_StarterCharacterScripts_0;
    end;
end;
local function v167(v163)
    for v164, v165 in {
        BodyHeightScale = 1,
        BodyDepthScale = 1,
        BodyWidthScale = 1,
        HeadScale = 1,
        BodyProportionScale = 0
    }, nil, nil do
        local l_NumberValue_0 = Instance.new("NumberValue");
        l_NumberValue_0.Name = v164;
        l_NumberValue_0.Value = v165;
        l_NumberValue_0.Parent = v163;
    end;
end;
v0.FindInstanceUnderNewModel = function(v168, v169, v170)
    local v171 = {};
    local l_v168_0 = v168;
    while l_v168_0 ~= v169 do
        table.insert(v171, 1, l_v168_0.Name);
        l_v168_0 = l_v168_0.Parent;
    end;
    local l_v170_0 = v170;
    for _, v175 in v171, nil, nil do
        local l_l_v170_0_FirstChild_0 = l_v170_0:FindFirstChild(v175);
        assert(l_l_v170_0_FirstChild_0, "can't find " .. v175 .. " under " .. v170:GetFullName());
        l_v170_0 = l_l_v170_0_FirstChild_0;
    end;
    return l_v170_0;
end;
v0.ReplaceModel = function(v177, v178, v179, v180)
    local v181 = v7.GetNpcFromId(v177);
    if v181 then
        v178.Name = v181.Name;
        local l_Parent_0 = v181.Parent;
        v181.Parent = nil;
        for _, v184 in v181:GetDescendants() do
            if not (not v184:IsA("LuaSourceContainer") or v184:GetAttribute(v11.AttributeUnificationScriptName)) then
                local v185 = v0.FindInstanceUnderNewModel(v184, v181, v178);
                local l_Parent_1 = v185.Parent;
                v185:Destroy();
                v184.Parent = l_Parent_1;
            end;
        end;
        v178.Parent = l_Parent_0;
        if v179 then
            v0.ConvertR6ToR15(v178);
            if v180 then
                v0.SetupUnificationScripts(v178);
            end;
        end;
        v181:Destroy();
        v7.SetNpcWithId(v178, v177);
        return ;
    else
        return ;
    end;
end;
v0.FixRootAttachment = function(v187)
    local l_HumanoidRootPart_0 = v187:FindFirstChild("HumanoidRootPart");
    assert(l_HumanoidRootPart_0, "There must be a HumanoidRootPart on the npc");
    if not l_HumanoidRootPart_0:FindFirstChild("RootRigAttachment") then
        local l_RootAttachment_0 = l_HumanoidRootPart_0:FindFirstChild("RootAttachment");
        if not l_RootAttachment_0 then
            l_RootAttachment_0 = Instance.new("Attachment");
            l_RootAttachment_0.Parent = l_HumanoidRootPart_0;
        end;
        l_RootAttachment_0.Name = "RootRigAttachment";
        return ;
    else
        return ;
    end;
end;
v0.GetNumCharactersHaveWarnings = function(v190)
    local v191 = 0;
    for _, v193 in v190, nil, nil do
        if v0.GetNpcHasWarnings(v193.model) then
            v191 = v191 + 1;
        end;
    end;
    return v191;
end;
v0.GetNpcHasWarnings = function(v194)
    return v0.GetNpcHasCustomMesh(v194);
end;
v0.GetNumCharactersHaveCustomMesh = function(v195)
    local v196 = 0;
    for _, v198 in v195, nil, nil do
        if v0.GetNpcHasCustomMesh(v198.model) then
            v196 = v196 + 1;
        end;
    end;
    return v196;
end;
v0.GetNpcHasCustomMesh = function(v199)
    local v200 = v77(v199);
    for v201 in v28, nil, nil do
        local v202 = v200[v201];
        if not ((not v202 or v5[v202]) or v6[v202]) then
            return true;
        end;
    end;
    return false;
end;
local function v207(v203)
    local v204 = {};
    for _, v206 in v203:GetDescendants() do
        if not v206:IsA("Part") then
            if not (not ((not (((not v206:IsA("Motor6D") or not v27[v206.Name]) or not v206.Part0) or not v206.Part1) and v203 == v206.Part1.Parent) and v27[v206.Name].Part1Name == v206.Part1.Name) or not v30[v206.Part1.Name]) then
                v204[v30[v206.Part1.Name]] = {
                    Part = v206.Part1,
                    Motor6D = v206
                };
            end;
        elseif not (not v30[v206.Name] or v204[v30[v206.Name]]) and v206.Parent == v203 then
            v204[v30[v206.Name]] = {
                Part = v206
            };
        end;
    end;
    return v204;
end;
local function v223(v208, v209)
    local function _(v210)
        v210.Part0 = nil;
    end;
    local function v217(v212, v213, v214)
        local l_Position_0 = v213.CFrame.Position;
        if v214 ~= Enum.BodyPart.Head then
            local v216 = (v213.Size.Y - v212.Size.Y) / 2;
            if v214 == Enum.BodyPart.Torso then
                v216 = -v216;
            end;
            l_Position_0 = v213.CFrame.Position + v213.CFrame.Rotation * Vector3.new(0, v216, 0);
        end;
        v212.CFrame = v213.CFrame.Rotation + l_Position_0;
    end;
    for v218, v219 in v27, nil, nil do
        local v220 = v209[v30[v219.Part1Name]];
        if not (not v220 or v220.Motor6D) then
            local l_v208_FirstChild_0 = v208:FindFirstChild(v26[v218], true);
            if l_v208_FirstChild_0 then
                l_v208_FirstChild_0.Part0 = nil;
                local l_Part1_0 = l_v208_FirstChild_0.Part1;
                if l_Part1_0 then
                    l_Part1_0.Anchored = true;
                    v217(l_Part1_0, v220.Part, v30[v219.Part1Name]);
                end;
            end;
        end;
    end;
end;
local function v230(v224, v225)
    for v226, v227 in v27, nil, nil do
        local v228 = v225[v30[v227.Part1Name]];
        if not (not v228 or not v228.Motor6D) then
            local l_v224_FirstChild_0 = v224:FindFirstChild(v26[v226], true);
            if not (not l_v224_FirstChild_0 or not v25[l_v224_FirstChild_0.Name]) then
                l_v224_FirstChild_0.C0 = (CFrame.new(l_v224_FirstChild_0.C0.Position - v24[v226].C0.Position) * v228.Motor6D.C0) * v25[l_v224_FirstChild_0.Name];
                l_v224_FirstChild_0.C1 = (CFrame.new(l_v224_FirstChild_0.C1.Position - v24[v226].C1.Position) * v228.Motor6D.C1) * v25[l_v224_FirstChild_0.Name];
            end;
        end;
    end;
end;
local function _(v231)
    local v232 = v24.RootJoint.C0 * v24.RootJoint.C1:Inverse();
    local v233 = v231.C0 * v231.C1:Inverse();
    return v233.Rotation:Inverse() * (v233.Position - v232.Position);
end;
v0.ConvertR6ToR15 = function(v235)
    local l_v235_Pivot_0 = v235:GetPivot();
    local l_HumanoidRootPart_1 = v235:FindFirstChild("HumanoidRootPart");
    if not l_HumanoidRootPart_1 then
        l_HumanoidRootPart_1 = v19:FindFirstChild("HumanoidRootPart"):Clone();
        l_HumanoidRootPart_1.Parent = v235;
        l_HumanoidRootPart_1.CFrame = if not v235.PrimaryPart then l_v235_Pivot_0 else v235.PrimaryPart.CFrame;
    end;
    local v238 = false;
    if v235.PrimaryPart ~= nil then
        v238 = l_HumanoidRootPart_1 ~= v235.PrimaryPart;
    end;
    if l_HumanoidRootPart_1 ~= v235.PrimaryPart then
        v235.PrimaryPart = l_HumanoidRootPart_1;
    end;
    local v239 = {};
    local v240 = {};
    local v241 = nil;
    local v242 = nil;
    local v243 = {};
    local v244 = v77(v235);
    local v245 = v207(v235);
    for v246, v247 in v245, nil, nil do
        local l_Part_0 = v247.Part;
        if l_Part_0 then
            v243[v246] = true;
            if v246 == Enum.BodyPart.Head then
                local l_Decal_8 = l_Part_0:FindFirstChildOfClass("Decal");
                if l_Decal_8 then
                    v241 = {
                        Color3 = l_Decal_8.Color3,
                        Texture = l_Decal_8.Texture,
                        Transparency = l_Decal_8.Transparency,
                        ZIndex = l_Decal_8.ZIndex
                    };
                end;
                v242 = l_Part_0;
            end;
            v239[v246] = l_Part_0.Color;
            local l_Decal_9 = l_Part_0:FindFirstChildOfClass("Decal");
            if l_Decal_9 then
                v240[v246] = if l_Decal_9.Texture ~= "" then l_Decal_9.Texture else nil;
            end;
            l_Part_0.Parent = nil;
        end;
    end;
    local l_BindableEvent_0 = Instance.new("BindableEvent");
    local v252 = 0 + 1;
    task.delay(0, function()
        local v253 = v239[Enum.BodyPart.Head];
        if not v244[Enum.BodyPart.Head] or not v6[v244[Enum.BodyPart.Head]] then
            v94(Enum.BodyPart.Head, v235, v253, v241);
        else
            assert(v242:FindFirstChildOfClass("SpecialMesh"), "SpecialMesh must exist if characterMeshes[Enum.BodyPart.Head] has a value");
            assert(v244[Enum.BodyPart.Head] == tostring(v10(v242:FindFirstChildOfClass("SpecialMesh").MeshId)));
            v145(v235, v253, v241, v242);
        end;
        v252 = v252 - 1;
        if v252 == 0 then
            l_BindableEvent_0:Fire();
        end;
    end);
    for v254, _ in pairs(v28) do
        if v243[v254] and Enum.BodyPart.Head ~= v254 then
            v252 = v252 + 1;
            task.delay(0, function()
                local v256 = v239[v254] or l_Color_0;
                local v257 = v244[v254];
                if not v257 or not v5[v257] then
                    v94(v254, v235, v256, v241);
                else
                    v114(v254, v235, v257, v256, v241, v240[v254]);
                end;
                v252 = v252 - 1;
                if v252 == 0 then
                    l_BindableEvent_0:Fire();
                end;
            end);
        end;
    end;
    l_BindableEvent_0.Event:Wait();
    v0.FixRootAttachment(v235);
    for _, v259 in v235:GetChildren() do
        if v259:IsA("CharacterMesh") then
            v259:Destroy();
        end;
    end;
    local l_Humanoid_4 = v235:FindFirstChildOfClass("Humanoid");
    l_Humanoid_4.RigType = Enum.HumanoidRigType.R15;
    v167(l_Humanoid_4);
    l_Humanoid_4:BuildRigFromAttachments();
    v223(v235, v245);
    local v261 = nil;
    local v262 = v245[Enum.BodyPart.Torso];
    local v263 = nil;
    if not ((not v262 or not v262.Motor6D) or v9(v262.Motor6D.C0, v24.RootJoint.C0) and v9(v262.Motor6D.C1, v24.RootJoint.C1)) then
        v263 = v235:FindFirstChild(v26[v262.Motor6D.Name], true);
        if v263 then
            local l_v263_0 = v263;
            local v265 = v24.RootJoint.C0 * v24.RootJoint.C1:Inverse();
            local v266 = l_v263_0.C0 * l_v263_0.C1:Inverse();
            v261 = v266.Rotation:Inverse() * (v266.Position - v265.Position);
        end;
    end;
    v230(v235, v245);
    local v267 = false;
    if v261 ~= nil then
        v267 = false;
        if v263 ~= nil then
            v267 = v262 ~= nil;
        end;
    end;
    if v267 then
        local v268 = (l_HumanoidRootPart_1.CFrame * v263.C0) * v263.C1:Inverse();
        v235:TranslateBy((v262.Part.CFrame.Position + v268.Rotation * v261) - v268.Position);
    end;
    if v238 then
        l_HumanoidRootPart_1.PivotOffset = l_HumanoidRootPart_1.CFrame:Inverse() * l_v235_Pivot_0;
    end;
    for _, v270 in v245, nil, nil do
        if v270.Part then
            v270.Part:Destroy();
        end;
    end;
end;
return v0;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Framework);
local v3 = require(l_Parent_0.Src.Resources.MakeTheme);
local v4 = require(l_Parent_0.Src.Resources.Constants);
local l_CrossPluginCommunication_0 = v2.Util.CrossPluginCommunication;
local v6 = require(l_Parent_0.Src.Components.PublishBlocked.PublishBlockedDialog);
local v7 = v1.PureComponent:extend("PublishBlockedPlugin");
local l_ContextServices_0 = v2.ContextServices;
local l_Plugin_0 = l_ContextServices_0.Plugin;
v7.init = function(v10)
    v10.connection = l_CrossPluginCommunication_0.new(v4.CrossPluginCommunicationName);
end;
v7.render = function(v11)
    local l_props_0 = v11.props;
    local l_OnClose_0 = l_props_0.OnClose;
    return l_ContextServices_0.provide({
        l_Plugin_0.new(plugin),
        v3(),
        l_props_0.Localization
    }, {
        v1.createElement(v6, {
            OnClose = l_OnClose_0,
            OnOpen = function()
                v11.connection:Fire(v4.CrossPluginCommunicationInstructions.Open);
                l_OnClose_0();
            end
        })
    });
end;
return v7;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Framework);
local v3 = require(l_Parent_0.Src.Resources.MakeTheme);
local v4 = require(l_Parent_0.Src.Components.PublishWarning.PublishWarningDialog);
local v5 = v1.PureComponent:extend("PublishWarningPlugin");
local l_ContextServices_0 = v2.ContextServices;
local l_Plugin_0 = l_ContextServices_0.Plugin;
v5.render = function(v8)
    local l_props_0 = v8.props;
    return l_ContextServices_0.provide({
        l_Plugin_0.new(plugin),
        v3(),
        l_props_0.Localization
    }, {
        v1.createElement(v4, {
            OnCancel = l_props_0.OnCancel,
            OnContinue = l_props_0.OnContinue
        })
    });
end;
return v5;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Packages.Rodux);
local v2 = require(l_script_FirstAncestor_0.Packages.Cryo);
local l_Actions_0 = l_script_FirstAncestor_0.Src.Actions;
local v4 = require(l_Actions_0.SetAdapted);
local v5 = require(l_Actions_0.ResetAllAdapter);
local v6 = require(l_script_FirstAncestor_0.Src.Util.SaveInterface);
local function _()
    return {
        adapted = v6.GetAdapted()
    };
end;
return (v1.createReducer({
    adapted = v6.GetAdapted()
}, {
    [v4.name] = function(v8, v9)
        return v2.Dictionary.join(v8, {
            adapted = v9.adapted
        });
    end,
    [v5.name] = function(v10)
        return v2.Dictionary.join(v10, {
            adapted = v6.GetAdapted()
        });
    end
}));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Packages.Rodux);
local v2 = require(l_script_FirstAncestor_0.Packages.Cryo);
local v3 = require(l_script_FirstAncestor_0.Src.Util.AnimationConversion.constants);
local function v4()
    return {
        selection = {},
        previewSelection = v2.None,
        previewSpeed = 1,
        animations = {},
        status = v3.Status.NotStarted
    };
end;
return v1.createReducer(v4(), {
    SetSelection = function(v5, v6)
        return v2.Dictionary.join(v5, {
            selection = v6.selection
        });
    end,
    SetPreviewSelection = function(v7, v8)
        return v2.Dictionary.join(v7, {
            previewSelection = if not v8.previewSelection then v2.None else v8.previewSelection
        });
    end,
    SetPreviewSpeed = function(v9, v10)
        return v2.Dictionary.join(v9, {
            previewSpeed = v10.previewSpeed
        });
    end,
    SetAnimation = function(v11, v12)
        return v2.Dictionary.join(v11, {
            animations = v2.Dictionary.join(v11.animations, {
                [v12.id] = v12.animation
            })
        });
    end,
    SetAnimations = function(v13, v14)
        return v2.Dictionary.join(v13, {
            animations = v14.animations
        });
    end,
    SetStatus = function(v15, v16)
        return v2.Dictionary.join(v15, {
            status = v16.status
        });
    end,
    ResetAllAnimationConversion = function(v17)
        return v2.Dictionary.join(v17, (v4()));
    end
});


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Packages.Rodux);
local v2 = require(l_script_FirstAncestor_0.Packages.Cryo);
local l_Actions_0 = l_script_FirstAncestor_0.Src.Actions;
local v4 = require(l_Actions_0.ResetConvertedCharacters);
local v5 = require(l_Actions_0.SetCharacterConverted);
local v6 = require(l_Actions_0.SetCharacterMetadata);
local v7 = require(l_Actions_0.SetCharacterSelection);
local v8 = require(l_Actions_0.SetWorldModels);
local v9 = require(l_Actions_0.ResetAllCharacterConversion);
local function v10()
    return {
        characterMetadataLoadedVersion = 0,
        characters = {},
        convertedCharacters = {},
        worldModels = {},
        selection = {}
    };
end;
return (v1.createReducer(v10(), {
    [v5.name] = function(v11, v12)
        return v2.Dictionary.join(v11, {
            characters = v2.Dictionary.join(v11.characters, {
                [v12.characterInfo.key] = if not v12.isConverted then v12.characterInfo else v2.None
            }),
            convertedCharacters = v2.Dictionary.join(v11.convertedCharacters, {
                [v12.characterInfo.key] = if not v12.isConverted then v2.None else v12.characterInfo
            })
        });
    end,
    [v4.name] = function(v13, _)
        return v2.Dictionary.join(v13, {
            convertedCharacters = {}
        });
    end,
    [v6.name] = function(v15, v16)
        return v2.Dictionary.join(v15, {
            characterMetadataLoadedVersion = v15.characterMetadataLoadedVersion + 1,
            characters = v16.characters,
            convertedCharacters = v16.convertedCharacters,
            worldModels = {}
        });
    end,
    [v7.name] = function(v17, v18)
        return v2.Dictionary.join(v17, {
            selection = v18.selection
        });
    end,
    [v8.name] = function(v19, v20)
        return v2.Dictionary.join(v19, {
            worldModels = v2.Dictionary.join(v19.worldModels, v20.newWorldModelEntries)
        });
    end,
    [v9.name] = function(v21, _)
        return v2.Dictionary.join(v21, (v10()));
    end
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local l_Actions_0 = l_Parent_0.Src.Actions;
local v4 = require(l_Actions_0.SuccessfullyPublished);
local v5 = require(l_Actions_0.SetExperienceData);
local function _()
    return {
        isSuccessfullyPublished = false,
        experienceData = nil
    };
end;
return (v1.createReducer({
    isSuccessfullyPublished = false,
    experienceData = nil
}, {
    [v4.name] = function(v7, v8)
        return v2.Dictionary.join(v7, {
            isSuccessfullyPublished = v8.isSuccessfullyPublished
        });
    end,
    [v5.name] = function(v9, v10)
        return v2.Dictionary.join(v9, {
            experienceData = v10.experienceData or v2.None
        });
    end
}));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Packages.Rodux);
local v2 = require(l_script_FirstAncestor_0.Packages.Cryo);
local v3 = require(l_script_FirstAncestor_0.Src.Actions.SetSortSelection);
local function _()
    return {
        sortSelection = nil
    };
end;
return (v1.createReducer({
    sortSelection = nil
}, {
    [v3.name] = function(v5, v6)
        return v2.Dictionary.join(v5, {
            sortSelection = v6.sortSelection
        });
    end
}));


return (require(script:FindFirstAncestor("R15Migrator").Packages.Rodux).combineReducers({
    AnimationConversion = require(script.Parent.AnimationConversion),
    CharacterConversion = require(script.Parent.CharacterConversion),
    ScriptConversion = require(script.Parent.ScriptConversion),
    Adapter = require(script.Parent.Adapter),
    PanelSelection = require(script.Parent.PanelSelection),
    DataDisplay = require(script.Parent.DataDisplay),
    AvatarType = function(v0, v1)
        if v1.type == "SetAvatarType" then
            return v1.avatarType;
        else
            return v0;
        end;
    end,
    ConversionProgress = require(script.Parent.ConversionProgress)
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local l_Actions_0 = l_Parent_0.Src.Actions;
local v4 = require(l_Actions_0.SetSelectedTab);
local v5 = require(l_Actions_0.SetAllTabsData);
local function _()
    return {
        selectedTab = nil,
        allTabsData = nil
    };
end;
return (v1.createReducer({
    selectedTab = nil,
    allTabsData = nil
}, {
    [v4.name] = function(v7, v8)
        return v2.Dictionary.join(v7, {
            selectedTab = v8.selectedTab
        });
    end,
    [v5.name] = function(v9, v10)
        return v2.Dictionary.join(v9, {
            allTabsData = v10.allTabsData
        });
    end
}));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Packages.Rodux);
local v2 = require(l_script_FirstAncestor_0.Packages.Cryo);
local v3 = require(l_script_FirstAncestor_0.Src.Util.SaveInterface);
local function v4()
    return {
        diagnostics = {},
        completedScripts = {},
        selection = {},
        expansion = {},
        initialIssueCounts = {},
        revertedScripts = {},
        filter = nil,
        replaceRules = v3.getScriptConversionRules() or {
            {
                FromText = "Left Arm",
                ToText = "LeftUpperArm",
                Enabled = true
            },
            {
                FromText = "Right Arm",
                ToText = "RightUpperArm",
                Enabled = true
            },
            {
                FromText = "Left Leg",
                ToText = "LeftUpperLeg",
                Enabled = true
            },
            {
                FromText = "Right Leg",
                ToText = "RightUpperLeg",
                Enabled = true
            },
            {
                FromText = "Torso",
                ToText = "LowerTorso",
                Enabled = true
            }
        },
        replaceProgress = nil,
        messageKey = "",
        processResult = {},
        analyticsSent = false
    };
end;
return (v1.createReducer(v4(), {
    SetDiagnostics = function(v5, v6)
        return v2.Dictionary.join(v5, {
            diagnostics = v6.diagnostics
        });
    end,
    SetFilter = function(v7, v8)
        return v2.Dictionary.join(v7, {
            filter = v8.filter
        });
    end,
    SetScriptSelection = function(v9, v10)
        return v2.Dictionary.join(v9, {
            selection = v10.selection
        });
    end,
    SetScriptExpansion = function(v11, v12)
        return v2.Dictionary.join(v11, {
            expansion = v12.expansion
        });
    end,
    SetCompletedScripts = function(v13, v14)
        return v2.Dictionary.join(v13, {
            completedScripts = v14.completedScripts
        });
    end,
    SetInitialIssueCounts = function(v15, v16)
        return v2.Dictionary.join(v15, {
            initialIssueCounts = v16.initialIssueCounts
        });
    end,
    SetRevertedScripts = function(v17, v18)
        return v2.Dictionary.join(v17, {
            revertedScripts = v18.revertedScripts
        });
    end,
    SetReplaceRules = function(v19, v20)
        return v2.Dictionary.join(v19, {
            replaceRules = v20.replaceRules
        });
    end,
    SetReplaceProgress = function(v21, v22)
        return v2.Dictionary.join(v21, {
            replaceProgress = v22.progress
        });
    end,
    SetProgressBarMessageKey = function(v23, v24)
        return v2.Dictionary.join(v23, {
            messageKey = v24.messageKey
        });
    end,
    SetProcessResult = function(v25, v26)
        return v2.Dictionary.join(v25, {
            processResult = v26.processResult
        });
    end,
    ResetAllScriptConversion = function(v27)
        return v2.Dictionary.join(v27, (v4()));
    end,
    SetScriptAnalyticsSent = function(v28, v29)
        return v2.Dictionary.join(v28, {
            analyticsSent = v29.analyticsSent
        });
    end
}));


return {
    _root = {
        Children = {
            [1] = {
                Children = {
                    [1] = {
                        Children = {
                            [1] = {
                                Children = {},
                                Lines = {
                                    [1] = {
                                        LineNo = 2
                                    }
                                },
                                Variables = {}
                            }
                        },
                        Lines = {
                            [1] = {
                                LineNo = 2
                            },
                            [2] = {
                                LineNo = 2
                            }
                        },
                        Variables = {
                            func = {}
                        }
                    },
                    [2] = {
                        Children = {
                            [1] = {
                                Children = {},
                                Lines = {
                                    [1] = {
                                        LineNo = 2
                                    }
                                },
                                Variables = {
                                    s = {}
                                }
                            },
                            [2] = {
                                Children = {},
                                Lines = {
                                    [1] = {
                                        LineNo = 2
                                    }
                                },
                                Variables = {
                                    s = {}
                                }
                            },
                            [3] = {
                                Children = {},
                                Lines = {
                                    [1] = {
                                        LineNo = 2
                                    }
                                },
                                Variables = {
                                    s = {}
                                }
                            }
                        },
                        Lines = {
                            [1] = {
                                LineNo = 2
                            },
                            [2] = {
                                LineNo = 2
                            },
                            [3] = {
                                LineNo = 2
                            },
                            [4] = {
                                LineNo = 2
                            }
                        },
                        Variables = {}
                    },
                    [3] = {
                        Children = {
                            [1] = {
                                Children = {},
                                Lines = {
                                    [1] = {
                                        LineNo = 2
                                    }
                                },
                                Variables = {}
                            }
                        },
                        Lines = {
                            [1] = {
                                LineNo = 2
                            },
                            [2] = {
                                LineNo = 2
                            }
                        },
                        Variables = {}
                    }
                },
                Lines = {
                    [1] = {
                        LineNo = 2
                    },
                    [2] = {
                        LineNo = 2
                    },
                    [3] = {
                        LineNo = 2
                    },
                    [4] = {
                        LineNo = 2
                    },
                    [5] = {
                        LineNo = 3
                    }
                },
                Variables = {
                    c = {},
                    x = {},
                    y = {}
                }
            }
        },
        Lines = {
            [1] = {
                LineNo = 1
            },
            [2] = {
                LineNo = 2
            }
        },
        Variables = {
            a = {},
            b = {}
        }
    }
};


local v0 = {
    PublishTags = {
        AdapterTagging = {
            Name = "R15MigratorHasAdapter",
            Mask = 1
        },
        CharacterTagging = {
            Name = "R15MigratorUnconvertedCharacter",
            Mask = 2
        },
        AnimationTagging = {
            Name = "R15MigratorUnconvertedAnimation",
            Mask = 4
        },
        ScriptTagging = {
            Name = "R15MigratorUnconvertedScript",
            Mask = 8
        }
    },
    NonePublishTags = {
        CharactersConvertedToR15Tag = "R15MigratorCharactersConvertedToR15"
    },
    AttributePrefix = "RBX_R15Migrator_",
    PreviewSpeeds = {
        0.25,
        0.5,
        0.75,
        1,
        1.25,
        1.5,
        1.75,
        2
    },
    StatusTableData = {
        TEXT_COLUMN_INDEX = 1,
        STATUS_COLUMN_INDEX = 2
    },
    CrossPluginCommunicationName = "R15Migrator",
    CrossPluginCommunicationInstructions = {
        Open = "Open",
        Published = "Published"
    },
    ScriptMenuActions = {
        GoToScript = "GoToScript",
        ShowInExplorer = "ShowInExplorer",
        RevertScript = "RevertScript",
        SelectAllSimilar = "SelectAllSimilar"
    }
};
v0.Attributes = {
    TempId = v0.AttributePrefix .. "R15MigratorTempId",
    OriginalId = v0.AttributePrefix .. "OriginalId",
    Name = v0.AttributePrefix .. "name",
    Adapted = v0.AttributePrefix .. "Adapted"
};
return v0;


return {
    RESET_CAM_DARK = "rbxasset://textures/AssetImport/btn_dark_resetcam_28x28.png",
    RESET_CAM_LIGHT = "rbxasset://textures/AssetImport/btn_light_resetcam_28x28.png",
    PLAY_BUTTON = "rbxasset://textures/DeveloperFramework/MediaPlayerControls/play_button.png",
    PAUSE_BUTTON = "rbxasset://textures/DeveloperFramework/MediaPlayerControls/pause_button.png",
    LOADING_BUTTON = "rbxasset://textures/StudioSharedUI/pending.png"
};


return {
    [1] = {
        code = "R6 Script Warning",
        instanceName = "Right Arm",
        message = "Right Arm found, possible replacements are: RightHand",
        range = {
            ["end"] = {
                character = 57,
                line = 61
            },
            start = {
                character = 48,
                line = 61
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightHand"
        }
    },
    [2] = {
        code = "R6 Script Warning",
        instanceName = "Torso",
        message = "Torso found, possible replacements are: RightUpperArm",
        range = {
            ["end"] = {
                character = 23,
                line = 94
            },
            start = {
                character = 18,
                line = 94
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightUpperArm"
        }
    },
    [3] = {
        code = "R6 Script Warning",
        instanceName = "Right Shoulder",
        message = "Right Shoulder found, possible replacements are: RightShoulder",
        range = {
            ["end"] = {
                character = 54,
                line = 94
            },
            start = {
                character = 40,
                line = 94
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightShoulder"
        }
    },
    [4] = {
        code = "R6 Script Warning",
        instanceName = "Torso",
        message = "Torso found, possible replacements are: UpperTorso, LowerTorso, HumanoidRootPart",
        range = {
            ["end"] = {
                character = 34,
                line = 129
            },
            start = {
                character = 29,
                line = 129
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "UpperTorso",
            [2] = "LowerTorso",
            [3] = "HumanoidRootPart"
        }
    },
    [5] = {
        code = "R6 Script Warning",
        instanceName = "right_arm",
        message = "Variable must reference RightHand.",
        range = {
            ["end"] = {
                character = 27,
                line = 63
            },
            start = {
                character = 18,
                line = 63
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {}
    },
    [6] = {
        code = "R6 Script Warning",
        instanceName = "Torso",
        message = "Torso found, possible replacements are: RightUpperArm",
        range = {
            ["end"] = {
                character = 20,
                line = 95
            },
            start = {
                character = 15,
                line = 95
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightUpperArm"
        }
    },
    [7] = {
        code = "R6 Script Warning",
        instanceName = "Right Shoulder",
        message = "Right Shoulder found, possible replacements are: RightShoulder",
        range = {
            ["end"] = {
                character = 36,
                line = 95
            },
            start = {
                character = 22,
                line = 95
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightShoulder"
        }
    },
    [8] = {
        code = "R6 Script Warning",
        instanceName = "Torso",
        message = "Torso found, possible replacements are: RightUpperArm",
        range = {
            ["end"] = {
                character = 20,
                line = 96
            },
            start = {
                character = 15,
                line = 96
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightUpperArm"
        }
    },
    [9] = {
        code = "R6 Script Warning",
        instanceName = "Right Shoulder",
        message = "Right Shoulder found, possible replacements are: RightShoulder",
        range = {
            ["end"] = {
                character = 36,
                line = 96
            },
            start = {
                character = 22,
                line = 96
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightShoulder"
        }
    },
    [10] = {
        code = "R6 Script Warning",
        instanceName = "Torso",
        message = "Torso found, possible replacements are: RightUpperArm",
        range = {
            ["end"] = {
                character = 24,
                line = 99
            },
            start = {
                character = 19,
                line = 99
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightUpperArm"
        }
    },
    [11] = {
        code = "R6 Script Warning",
        instanceName = "Right Shoulder",
        message = "Right Shoulder found, possible replacements are: RightShoulder",
        range = {
            ["end"] = {
                character = 55,
                line = 99
            },
            start = {
                character = 41,
                line = 99
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightShoulder"
        }
    },
    [12] = {
        code = "R6 Script Warning",
        instanceName = "Torso",
        message = "Torso found, possible replacements are: RightUpperArm",
        range = {
            ["end"] = {
                character = 22,
                line = 100
            },
            start = {
                character = 17,
                line = 100
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightUpperArm"
        }
    },
    [13] = {
        code = "R6 Script Warning",
        instanceName = "Right Shoulder",
        message = "Right Shoulder found, possible replacements are: RightShoulder",
        range = {
            ["end"] = {
                character = 38,
                line = 100
            },
            start = {
                character = 24,
                line = 100
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightShoulder"
        }
    }
};


return {
    [1] = {
        code = "R6 Script Error",
        instanceName = "Torso",
        message = "Reference to R6 Avatar found with Torso",
        range = {
            ["end"] = {
                character = 35,
                line = 11
            },
            start = {
                character = 30,
                line = 11
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "Head"
        }
    },
    [2] = {
        code = "R6 Script Error",
        instanceName = "Right Shoulder",
        message = "Reference to R6 Avatar found with Right Shoulder",
        range = {
            ["end"] = {
                character = 51,
                line = 12
            },
            start = {
                character = 37,
                line = 12
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightShoulder"
        }
    },
    [3] = {
        code = "R6 Script Warning",
        instanceName = "Torso",
        message = "Variable must reference RightUpperArm.",
        range = {
            ["end"] = {
                character = 22,
                line = 12
            },
            start = {
                character = 17,
                line = 12
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {}
    },
    [4] = {
        code = "R6 Script Error",
        instanceName = "Left Shoulder",
        message = "Reference to R6 Avatar found with Left Shoulder",
        range = {
            ["end"] = {
                character = 49,
                line = 13
            },
            start = {
                character = 36,
                line = 13
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "LeftShoulder"
        }
    },
    [5] = {
        code = "R6 Script Warning",
        instanceName = "Torso",
        message = "Variable must reference LeftUpperArm.",
        range = {
            ["end"] = {
                character = 21,
                line = 13
            },
            start = {
                character = 16,
                line = 13
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {}
    },
    [6] = {
        code = "R6 Script Error",
        instanceName = "Right Hip",
        message = "Reference to R6 Avatar found with Right Hip",
        range = {
            ["end"] = {
                character = 41,
                line = 14
            },
            start = {
                character = 32,
                line = 14
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "RightHip"
        }
    },
    [7] = {
        code = "R6 Script Warning",
        instanceName = "Torso",
        message = "Variable must reference RightUpperLeg.",
        range = {
            ["end"] = {
                character = 17,
                line = 14
            },
            start = {
                character = 12,
                line = 14
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {}
    },
    [8] = {
        code = "R6 Script Error",
        instanceName = "Left Hip",
        message = "Reference to R6 Avatar found with Left Hip",
        range = {
            ["end"] = {
                character = 39,
                line = 15
            },
            start = {
                character = 31,
                line = 15
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {
            [1] = "LeftHip"
        }
    },
    [9] = {
        code = "R6 Script Warning",
        instanceName = "Torso",
        message = "Variable must reference LeftUpperLeg.",
        range = {
            ["end"] = {
                character = 16,
                line = 15
            },
            start = {
                character = 11,
                line = 15
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {}
    },
    [10] = {
        code = "R6 Script Warning",
        instanceName = "Torso",
        message = "Variable must reference Head.",
        range = {
            ["end"] = {
                character = 13,
                line = 16
            },
            start = {
                character = 8,
                line = 16
            }
        },
        severity = Enum.Severity.Error,
        suggestions = {}
    }
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_Util_0 = l_script_FirstAncestor_0.Src.Util;
local l_AdapterTagging_0 = require(l_Util_0.PublishTagging).AdapterTagging;
local l_CharactersConvertedToR15Tagging_0 = require(l_Util_0.QuickAccessTagging).CharactersConvertedToR15Tagging;
local v4 = require(l_script_FirstAncestor_0.Src.Actions.SetAdapted);
local v5 = require(l_script_FirstAncestor_0.Src.Modules.NpcManager);
local v6 = require(l_script_FirstAncestor_0.Src.Util.SaveInterface);
return function(v7)
    return function(v8)
        v7:getHandler("onAdapterToggle")(true);
        for _, v10 in pairs(l_CharactersConvertedToR15Tagging_0:getTagged()) do
            v5.SetupUnificationScripts(v10);
            l_AdapterTagging_0:addTag(v10);
        end;
        v6.SetAdapted(true);
        v8:dispatch(v4(true));
        game:GetService("Workspace"):SetAvatarUnificationMode(Enum.AvatarUnificationMode.Enabled);
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_deepCopy_0 = require(l_script_FirstAncestor_0.Packages.Framework).Util.deepCopy;
local v2 = require(l_script_FirstAncestor_0.Src.Actions.SetDiagnostics);
local v3 = require(l_script_FirstAncestor_0.Src.Util.ScriptReplacement);
return function(v4, v5, v6, v7)
    return function(v8)
        local v9 = l_deepCopy_0(v8:getState().ScriptConversion.diagnostics);
        local v10 = v9[v4];
        for v11 = #v10._list, 1, -1 do
            local v12 = v10._list[v11];
            local l_range_0 = v12.range;
            for _, v15 in v5, nil, nil do
                if v12.diagnosticId == v15 then
                    local v16 = if v6 == v3.UNASSIGNED then v12.instanceName else v6;
                    v3.goToScript(v4, l_range_0, v7):EditTextAsync(v16, l_range_0.startLine, l_range_0.startCharacter, l_range_0.endLine, l_range_0.endCharacter);
                    v12.range.endCharacter = (v12.range.endCharacter - #(v12.resolution or v12.instanceName)) + #v16;
                    v12.resolution = if v6 == v3.UNASSIGNED then nil else v6;
                    break;
                end;
            end;
        end;
        v8:dispatch(v2(v9));
    end;
end;


local v0 = require(script:FindFirstAncestor("R15Migrator").Src.Actions.SetAvatarType);
return function(v1)
    return function(v2)
        task.spawn(function()
            while true do
                v2:dispatch(v0((v1:getAvatarType(game))));
                wait(5);
            end;
        end);
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_deepCopy_0 = require(l_script_FirstAncestor_0.Packages.Framework).Util.deepCopy;
local v2 = require(l_script_FirstAncestor_0.Src.Actions.SetAnimations);
local v3 = require(l_script_FirstAncestor_0.Src.Actions.SetAnimation);
local l_Thunks_0 = l_script_FirstAncestor_0.Src.Thunks;
local v5 = require(l_Thunks_0.UpdateScriptSuggestion);
local v6 = require(l_Thunks_0.ReplaceAnimation);
local l_AnimationConversion_0 = l_script_FirstAncestor_0.Src.Util.AnimationConversion;
local v8 = require(l_AnimationConversion_0.serializeInstances);
local v9 = require(l_AnimationConversion_0.AnimationConversionManager);
local v10 = require(l_AnimationConversion_0.constants);
local l_AssetType_0 = v10.AssetType;
local l_AnimationStatus_0 = v10.AnimationStatus;
local v13 = require(l_script_FirstAncestor_0.Src.Util.SaveInterface);
local l_MarketplaceService_0 = game:GetService("MarketplaceService");
local l_PublishService_0 = game:GetService("PublishService");
local l_StudioService_0 = game:GetService("StudioService");
local function v26(v17, v18, v19, v20, v21)
    local v22 = l_deepCopy_0(v17:getState().AnimationConversion.animations);
    local v23 = 0;
    for v24, _ in v18, nil, nil do
        if v22[v24] then
            v22[v24].status = v19;
            v22[v24].errCode = v21;
            v22[v24].converted = v20;
            v23 = v23 + 1;
        end;
    end;
    if v23 == 1 then
        v17:dispatch(v3(next(v18), v22[next(v18)]));
        return ;
    else
        v17:dispatch(v2(v22));
        return ;
    end;
end;
local function v46(v27, v28, v29, v30, _)
    local l_id_0 = v28.id;
    local l_status_0, l_result_0 = pcall(function()
        return l_MarketplaceService_0:GetProductInfo(l_id_0);
    end);
    if l_status_0 then
        local v35 = l_result_0.Name .. " R15";
        local l_Description_0 = l_result_0.Description;
        local v37 = nil;
        if l_result_0.Creator.CreatorType == Enum.CreatorType.Group.Name then
            v37 = l_result_0.Creator.CreatorTargetId;
        end;
        local v38 = {};
        table.insert(v38, v27);
        local l_status_1, l_result_1 = pcall(function()
            return v8(v38);
        end);
        if l_status_1 then
            local v41 = if not v37 then Enum.AssetCreatorType.User else Enum.AssetCreatorType.Group;
            local v42 = if not v37 then l_StudioService_0:GetUserId() else v37;
            local l_status_2, l_result_2 = pcall(function()
                return l_PublishService_0:CreateAssetOrAssetVersionAndPollAssetWithTelemetryAsync(l_result_1, v41, v42, "Animation", 0, v35, l_Description_0, "", "model/x-rbxm", 0);
            end);
            if l_status_2 then
                local l_AssetId_0 = l_result_2.AssetId;
                v9.addCacheEntry(l_id_0, l_AssetId_0);
                v13.setTargetAssetId(tonumber(l_id_0), (tonumber(l_AssetId_0)));
                v26(v30, {
                    [l_id_0] = true
                }, nil, l_AssetId_0);
                v30:dispatch(v5(l_id_0, v9.getAnimationId(l_AssetId_0), v29));
                return true;
            else
                v26(v30, {
                    [l_id_0] = true
                }, l_AnimationStatus_0.FailedWithError, nil, l_result_2);
                return false;
            end;
        else
            v26(v30, {
                [l_id_0] = true
            }, l_AnimationStatus_0.FailedSerialization);
            return false;
        end;
    else
        v26(v30, {
            [l_id_0] = true
        }, l_AnimationStatus_0.FailedToGetProductInfo);
        return false;
    end;
end;
return function(v47, v48)
    return function(v49)
        local v50 = v49:getState();
        local v51 = {};
        local v52 = {};
        for v53 in v50.AnimationConversion.selection, nil, nil do
            local v54 = v9.getAnimationAssetInfo(v53);
            if v54:IsA(l_AssetType_0.RobloxAsset) and not v50.AnimationConversion.animations[v53].converted then
                local l_status_3 = v50.AnimationConversion.animations[v53].status;
                if not (not (l_status_3 ~= l_AnimationStatus_0.Uploading and l_status_3 ~= l_AnimationStatus_0.Done) or not v9.getConvertedKeyframeSequence(v54)) then
                    v51[v53] = v54;
                end;
            else
                table.insert(v52, v54);
            end;
        end;
        v26(v49, v51, l_AnimationStatus_0.Uploading);
        for _, v57 in v51, nil, nil do
            if v46(v9.getConvertedKeyframeSequence(v57):Clone(), v57, v47, v49, v48) then
                table.insert(v52, v57);
            end;
        end;
        v49:dispatch(v6(v52, v47, v48));
        v48:getHandler("onAnimationsConverted")(v50.AnimationConversion.animations, v50.AnimationConversion.selection);
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_Actions_0 = l_script_FirstAncestor_0.Src.Actions;
local _ = require(l_Actions_0.SetAdapted);
local v3 = require(l_Actions_0.SetCharacterConverted);
local v4 = require(l_script_FirstAncestor_0.Src.Modules.NpcManager);
local l_Util_0 = l_script_FirstAncestor_0.Src.Util;
local l_AdapterTagging_0 = require(l_Util_0.PublishTagging).AdapterTagging;
local l_CharacterTagging_0 = require(l_Util_0.PublishTagging).CharacterTagging;
local l_CharactersConvertedToR15Tagging_0 = require(l_Util_0.QuickAccessTagging).CharactersConvertedToR15Tagging;
return function(v9)
    return function(v10)
        local v11 = v10:getState();
        local l_selection_0 = v11.CharacterConversion.selection;
        local l_characters_0 = v11.CharacterConversion.characters;
        for _, v15 in l_selection_0, nil, nil do
            local v16 = l_characters_0[v15];
            if not (not v16 or not v16.model) then
                local v17 = v16.model:Clone();
                v4.ReplaceModel(v15, v17, true, v11.Adapter.adapted);
                l_CharactersConvertedToR15Tagging_0:addTag(v17);
                l_AdapterTagging_0:addTag(v17);
                l_CharacterTagging_0:removeTag(v17);
                v10:dispatch(v3(v16, true));
            end;
        end;
        v9:getHandler("onCharactersConverted")(l_characters_0, l_selection_0);
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Src.Modules.NpcManager);
local v2 = require(l_script_FirstAncestor_0.Src.Util.AnimationConversion.resetCharacter);
local v3 = require(l_script_FirstAncestor_0.Src.Actions.SetWorldModels);
local l_RobloxReplicatedStorage_0 = game:GetService("RobloxReplicatedStorage");
local function v13(...)
    local v5 = {
        ...
    };
    local v6 = {};
    for _, v8 in v5, nil, nil do
        local l_WorldModel_0 = Instance.new("WorldModel");
        l_WorldModel_0.Parent = l_RobloxReplicatedStorage_0;
        v8.Parent = l_WorldModel_0;
        table.insert(v6, v8);
    end;
    task.wait();
    for _, v11 in v6, nil, nil do
        v11.PrimaryPart = v11:FindFirstChild("HumanoidRootPart") or v11:FindFirstChild("Torso");
        if not v11.PrimaryPart then
            v11:MoveTo((Vector3.new(0, 0, 0)));
        else
            v11:SetPrimaryPartCFrame(CFrame.new(0, 0, 0));
        end;
        local l_Parent_0 = v11.Parent;
        l_Parent_0:MoveTo((Vector3.new(0, 0, 0)));
        l_Parent_0.Parent = nil;
    end;
end;
local function v17(v14)
    for _, v16 in v14:GetDescendants() do
        if v16:IsA("ModuleScript") and v16.Name == "SetupAdapterParts" then
            v16:ClearAllChildren();
        end;
    end;
end;
return function(v18, v19)
    return function(v20)
        if not v20:getState().CharacterConversion.worldModels[v18] then
            local v21 = v19:Clone();
            local v22 = v19:Clone();
            v1.ConvertR6ToR15(v22);
            v17(v22);
            local v23 = v21:Clone();
            local v24 = v22:Clone();
            v13(v21, v22, v23, v24);
            v2(v23);
            v2(v24);
            v20:dispatch(v3(v18, v21.Parent, v22.Parent, v23.Parent, v24.Parent));
            return ;
        else
            return ;
        end;
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_Modules_0 = l_script_FirstAncestor_0.Src.Modules;
local v2 = require(l_Modules_0.NpcManager);
local v3 = require(l_Modules_0.NpcIdManager);
local l_Util_0 = l_script_FirstAncestor_0.Src.Util;
local v5 = require(l_Util_0.SaveInterface);
local l_CharacterTagging_0 = require(l_Util_0.PublishTagging).CharacterTagging;
local l_AdapterTagging_0 = require(l_Util_0.PublishTagging).AdapterTagging;
local l_CharactersConvertedToR15Tagging_0 = require(l_Util_0.QuickAccessTagging).CharactersConvertedToR15Tagging;
local v9 = require(l_script_FirstAncestor_0.Src.Actions.SetCharacterMetadata);
local _ = require(l_script_FirstAncestor_0.Src.Actions.SetAdapted);
local function v20(v11)
    local v12 = nil;
    local v13 = {};
    for _, v15 in v11, nil, nil do
        local v16 = nil;
        if v15:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R6 then
            v16 = v15:Clone();
        else
            v12 = v12 or v5.getR6Characters();
            local v17 = v12[v5.getConversionId(v15)];
            if v17 then
                l_CharactersConvertedToR15Tagging_0:addTag(v15);
                if not v2.HasUnificationScripts(v15) then
                    l_AdapterTagging_0:removeTag(v15);
                else
                    l_AdapterTagging_0:addTag(v15);
                end;
                v16 = v17:Clone();
                v16.Name = v15.Name;
            else
                warn("Original R6 character is unavailable. Was the save folder edited?");
                continue;
            end;
        end;
        local l_v15_FullName_0 = v15:GetFullName();
        local v19 = v5.getConversionId(v15);
        if not v19 then
            v19 = v3.AddNpc(v15);
        else
            v3.SetNpcWithId(v15, v19);
        end;
        v13[v19] = {
            key = v19,
            fullName = l_v15_FullName_0,
            model = v16
        };
    end;
    return v13;
end;
local function v25(v21, v22)
    for _, v24 in pairs(v21) do
        if l_CharacterTagging_0:hasTagged(v24) then
            if v22 then
                v2.SetupUnificationScripts(v24);
                l_AdapterTagging_0:addTag(v24);
            end;
            l_CharactersConvertedToR15Tagging_0:addTag(v24);
            l_CharacterTagging_0:removeTag(v24);
        end;
    end;
end;
local function v38(v26, v27)
    local v28 = v26:getState();
    v3.Reset();
    local v29 = v2.GetR6Npcs();
    v5.addConvertibleCharacters(v29);
    local v30 = v20(v29);
    local v31 = v2.GetR15ConvertedNpcs();
    local l_adapted_0 = v28.Adapter.adapted;
    v25(v31, l_adapted_0);
    local v33 = v20(v31);
    for _, v35 in pairs(v29) do
        l_CharacterTagging_0:addTag(v35);
    end;
    for _, v37 in pairs(v31) do
        l_CharacterTagging_0:removeTag(v37);
    end;
    v26:dispatch(v9(v30, v33));
    v27:getHandler("onCharactersLoaded")(v30, v33);
    game:GetService("Workspace"):SetAvatarUnificationMode(not not l_adapted_0 and Enum.AvatarUnificationMode.Enabled or Enum.AvatarUnificationMode.Disabled);
end;
return function(v39)
    return function(v40)
        coroutine.wrap(v38)(v40, v39);
    end;
end;


local l_R15MigDocumentChanges_0 = game:GetFastFlag("R15MigDocumentChanges");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Src.Util.ScriptHistory.backupScript);
local l_deepCopy_0 = v2.Util.deepCopy;
local v5 = require(l_script_FirstAncestor_0.Src.Actions.SetDiagnostics);
local v6 = require(l_script_FirstAncestor_0.Src.Actions.SetCompletedScripts);
local v7 = require(l_script_FirstAncestor_0.Src.Actions.SetInitialIssueCounts);
local v8 = require(l_script_FirstAncestor_0.Src.Actions.SetRevertedScripts);
local v9 = require(l_script_FirstAncestor_0.Src.Util.ScriptAnalysis.Constants);
local v10 = require(l_script_FirstAncestor_0.Src.Util.ScriptAnalysis.findAssetId);
local v11 = require(l_script_FirstAncestor_0.Src.Util.ScriptHistory.ChunkUtil);
local l_ScriptTagging_0 = require(l_script_FirstAncestor_0.Src.Util.PublishTagging).ScriptTagging;
local v13 = require(l_script_FirstAncestor_0.Src.Util.AnimationConversion.DiagRef);
local v14 = require(l_script_FirstAncestor_0.Src.Thunks.UpdateAnimationIssues);
local function v21(v15, v16)
    local v17 = {};
    if v15 then
        for _, v19 in v15._list, nil, nil do
            local v20 = v10("'" .. v19.instanceName .. "'");
            if v20 then
                if not v17[v20] then
                    v17[v20] = {};
                end;
                table.insert(v17[v20], v13.new(v20, v19.range, v16));
            end;
        end;
        return v17;
    else
        return v17;
    end;
end;
local function v26(v22, v23, v24, v25)
    v22:dispatch(v14(v21(l_deepCopy_0(v22:getState().ScriptConversion.diagnostics)[v23], v25), (v21(v24, v25))));
end;
local function _(v27, v28, v29)
    local v30 = l_deepCopy_0(v27:getState().ScriptConversion.diagnostics);
    v30[v28] = v29;
    v27:dispatch(v5(v30));
end;
local function v37(v32, v33, v34, v35)
    local v36 = l_deepCopy_0(v32:getState().ScriptConversion.completedScripts);
    if v35 then
        if not v35:HasErrors() then
            l_ScriptTagging_0:removeTag(v34);
            v36[v33] = true;
        else
            l_ScriptTagging_0:addTag(v34);
            v36[v33] = nil;
        end;
        v32:dispatch(v6(v36));
        return ;
    else
        return ;
    end;
end;
local function _(v38, v39, v40)
    if v40 then
        local v41 = l_deepCopy_0(v38:getState().ScriptConversion.revertedScripts);
        v41[v39] = nil;
        v38:dispatch(v8(v41));
        return ;
    else
        return ;
    end;
end;
local function v50(v43, v44, v45, v46)
    local l_initialIssueCounts_0 = v43:getState().ScriptConversion.initialIssueCounts;
    if not v46 then
        if l_initialIssueCounts_0[v44] or v45 == 0 then
            return ;
        else
            local v48 = l_deepCopy_0(l_initialIssueCounts_0);
            v48[v44] = v45;
            v43:dispatch(v7(v48));
            return ;
        end;
    else
        local v49 = l_deepCopy_0(l_initialIssueCounts_0);
        v49[v44] = nil;
        v43:dispatch(v7(v49));
        return ;
    end;
end;
return function(v51, v52, v53)
    return function(v54)
        local l_diagnostics_0 = v54:getState().ScriptConversion.diagnostics;
        local v56 = v51:addOrFindScript(v52);
        local l_v52_Attribute_0 = v52:GetAttribute(v9.AttributeChunkCountName);
        local l_v52_Attribute_1 = v52:GetAttribute(v9.AttributeInitialIssueCountName);
        local v59 = l_diagnostics_0[v56] ~= nil;
        if (not (v53 and v53:GetSize() == 0) or v59) or l_v52_Attribute_0 then
            if l_diagnostics_0[v56] == v53 then
                return ;
            else
                if not l_v52_Attribute_0 then
                    v3(v52);
                end;
                if not l_v52_Attribute_1 then
                    v52:SetAttribute(v9.AttributeInitialIssueCountName, v53:GetSize());
                end;
                v50(v54, v56, v52:GetAttribute(v9.AttributeInitialIssueCountName), v53 == nil);
                if l_R15MigDocumentChanges_0 then
                    local l_diagnostics_1 = v54:getState().ScriptConversion.diagnostics;
                    local v61 = l_diagnostics_1 and l_diagnostics_1[v56];
                    if not (not v61 or not v53) then
                        v53 = v61:Merge(v53);
                    end;
                end;
                local v62 = v11:DidSourceChange(v52);
                v26(v54, v56, v53, v52);
                local l_v53_0 = v53;
                local v64 = l_deepCopy_0(v54:getState().ScriptConversion.diagnostics);
                v64[v56] = l_v53_0;
                v54:dispatch(v5(v64));
                if v62 then
                    local v65 = l_deepCopy_0(v54:getState().ScriptConversion.revertedScripts);
                    v65[v56] = nil;
                    v54:dispatch(v8(v65));
                end;
                v37(v54, v56, v52, v53);
                return ;
            end;
        else
            return ;
        end;
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Packages.Cryo);
local v2 = require(l_script_FirstAncestor_0.Src.Actions.SetRevertedScripts);
local v3 = require(l_script_FirstAncestor_0.Src.Actions.SetCompletedScripts);
local function v11(v4, v5)
    local v6 = v5:getState();
    local _ = v6.ScriptConversion.revertedScripts;
    local l_completedScripts_0 = v6.ScriptConversion.completedScripts;
    local v9 = v1.Dictionary.join(l_completedScripts_0);
    for v10 in l_completedScripts_0, nil, nil do
        if v4[v10] then
            v9[v10] = nil;
        end;
    end;
    v5:dispatch(v3(v9));
end;
return function(v12)
    return function(v13)
        local v14 = v13:getState();
        local l_revertedScripts_1 = v14.ScriptConversion.revertedScripts;
        local _ = v14.ScriptConversion.completedScripts;
        v13:dispatch(v2(v1.Dictionary.join(v12, l_revertedScripts_1)));
        v11(v12, v13);
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_AdapterTagging_0 = require(l_script_FirstAncestor_0.Src.Util.PublishTagging).AdapterTagging;
local v2 = require(l_script_FirstAncestor_0.Src.Actions.SetAdapted);
local v3 = require(l_script_FirstAncestor_0.Src.Modules.NpcManager);
local v4 = require(l_script_FirstAncestor_0.Src.Util.SaveInterface);
return function(v5)
    return function(v6)
        local v7 = v6:getState();
        local l_diagnostics_0 = v7.ScriptConversion.diagnostics;
        local v9 = 0;
        for _, v11 in l_diagnostics_0, nil, nil do
            v9 = v9 + #v11._list;
        end;
        local l_animations_0 = v7.AnimationConversion.animations;
        local v13 = 0;
        for _, v15 in l_animations_0, nil, nil do
            if v15.status ~= nil then
                if v15.status ~= "Done" and v15.status ~= "Published" then
                    v13 = v13 + 1;
                end;
            else
                v13 = v13 + 1;
            end;
        end;
        local l_characters_0 = v7.CharacterConversion.characters;
        local v17 = 0;
        for _, _ in l_characters_0, nil, nil do
            v17 = v17 + 1;
        end;
        v5:getHandler("onAdapterToggle")(false, v9, v13, v17);
        v3.ClearAdapterSetup();
        l_AdapterTagging_0:removeAllTags();
        game:GetService("Workspace"):SetAvatarUnificationMode(Enum.AvatarUnificationMode.Disabled);
        v4.SetAdapted(false);
        v6:dispatch(v2(false));
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_ChangeHistoryService_0 = game:GetService("ChangeHistoryService");
local l_deepCopy_0 = require(l_script_FirstAncestor_0.Packages.Framework).Util.deepCopy;
local l_Util_0 = l_script_FirstAncestor_0.Src.Util;
local l_AnimationTagging_0 = require(l_Util_0.PublishTagging).AnimationTagging;
local v5 = require(l_Util_0.ScriptReplacement);
local l_AnimationConversion_0 = l_Util_0.AnimationConversion;
local v7 = require(l_AnimationConversion_0.AnimationConversionManager);
local l_AssetType_0 = require(l_AnimationConversion_0.constants).AssetType;
local v9 = require(l_script_FirstAncestor_0.Src.Actions.SetAnimation);
local function v22(v10, v11, v12, v13)
    local v14 = nil;
    for v15, v16 in v10, nil, nil do
        local v17 = v12:findScriptGUID(v15);
        if v14 == nil then
            v14 = v17;
        end;
        for _, v19 in v16, nil, nil do
            local v20 = v11[v17];
            local v21 = v7.getConvertedAnimationAssetInfo(v19.info);
            if v21.id then
                v5.replaceWithSuggestion(v17, v19.ref.range, v12, v21.url, v20, v13);
            end;
        end;
        if v17 ~= v14 then
            v12:closeScriptIfOpen(v17);
        end;
    end;
    if v14 then
        v12:closeScriptIfOpen(v14);
    end;
end;
return function(v23, v24, v25)
    return function(v26)
        local v27 = v26:getState();
        local l_animations_0 = v27.AnimationConversion.animations;
        local l_diagnostics_0 = v27.ScriptConversion.diagnostics;
        l_ChangeHistoryService_0:SetWaypoint("preReplace");
        local v30 = {};
        for _, v32 in v23, nil, nil do
            local v33 = v7.getConvertedAnimationAssetInfo(v32);
            if v33.id then
                if v32:IsA(v33._type) then
                    if next(l_animations_0[v32.id].refs) then
                        local v34 = l_deepCopy_0(l_animations_0[v32.id]);
                        local v35 = v7.getConvertedKeyframeSequence(v32);
                        local v36 = {};
                        local v37 = 0;
                        for v38, v39 in v34.refs, nil, nil do
                            if not v39:IsA(l_AssetType_0.LocalAsset) then
                                if not v39:IsA(l_AssetType_0.AnimationInstance) then
                                    if v39:IsA(l_AssetType_0.AssetIdString) then
                                        local l_scriptInstance_0 = v38.scriptInstance;
                                        if not v30[l_scriptInstance_0] then
                                            v30[l_scriptInstance_0] = {
                                                {
                                                    ref = v38,
                                                    info = v32
                                                }
                                            };
                                        else
                                            table.insert(v30[l_scriptInstance_0], {
                                                ref = v38,
                                                info = v32
                                            });
                                        end;
                                    end;
                                else
                                    v38.AnimationId = v33.url;
                                    table.insert(v36, v38);
                                    l_AnimationTagging_0:removeTag(v38);
                                end;
                            else
                                v38:ClearAllChildren();
                                for _, v42 in v35:GetChildren() do
                                    v42:Clone().Parent = v38;
                                end;
                                table.insert(v36, v38);
                                l_AnimationTagging_0:removeTag(v38);
                            end;
                            v37 = v37 + 1;
                        end;
                        if v37 == #v36 then
                            v34:complete();
                        else
                            v34:removeRefs(v36);
                        end;
                        v26:dispatch(v9(v32.id, v34));
                    end;
                else
                    return ;
                end;
            else
                return ;
            end;
        end;
        v22(v30, l_diagnostics_0, v24, v25);
        l_ChangeHistoryService_0:SetWaypoint("postReplace");
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Src.Util.SaveInterface);
local v2 = require(l_script_FirstAncestor_0.Src.Actions.SetReplaceRules);
return function(v3)
    return function(v4)
        v1.addScriptConversionRules(v3);
        v4:dispatch(v2(v3));
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Src.Actions.SetProcessResult);
local v2 = require(l_script_FirstAncestor_0.Src.Util.ScriptReplacement);
local v3 = require(l_script_FirstAncestor_0.Src.Util.ScriptIssueSorting);
local v4 = require(l_script_FirstAncestor_0.Src.Util.ScriptConversionProgressTracker);
local v5 = require(l_script_FirstAncestor_0.Src.Util.ScriptAnalysis.Constants);
local function v10(v6)
    local v7 = {};
    for _, v9 in v6, nil, nil do
        if (v9.FromText ~= "" and v9.ToText ~= "") and v9.Enabled ~= false then
            v7[v9.FromText] = v9.ToText;
        end;
    end;
    return v7;
end;
local _ = function(v11)
    local v12 = 0;
    for _, v14 in v11, nil, nil do
        v12 = v12 + #v14;
    end;
    return v12;
end;
local function v29(v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26)
    local v27 = nil;
    if not v19 or #v20 > 0 then
        v27 = v21[v18];
    end;
    if v20 and #v20 == 1 then
        v27 = v20[1];
        v23.autoConverted = v23.autoConverted + 1;
    end;
    if v27 then
        v2.replaceWithSuggestion(v16, v17, v22, v27, v24, v25);
        return true;
    else
        local v28 = v23[v26 == v5.ReferenceKey and "failedVar" or "failed"];
        if not v28[v16] then
            v28[v16] = {};
        end;
        v28[v16][v18] = true;
        return false;
    end;
end;
local function v45(_, v31, v32, v33, v34, v35, v36, v37, v38)
    local v39 = next(v33);
    for v40, v41 in v33, nil, nil do
        local v42 = v37[v40];
        for _, v44 in v41, nil, nil do
            v31:updateProgress();
            if v29(v40, v44.range, v44.instanceName, v35, v44.suggestions, v36, v32, v34, v42, v38, v44.issueType) then
                v34.succeeded = v34.succeeded + 1;
            end;
        end;
        if v40 ~= v39 then
            v32:closeScriptIfOpen(v40);
        end;
    end;
    if v39 then
        v32:closeScriptIfOpen(v39);
    end;
end;
return function(v46, _, v48, v49)
    return function(v50)
        local v51 = v50:getState();
        local l_selection_0 = v51.ScriptConversion.selection;
        local l_diagnostics_0 = v51.ScriptConversion.diagnostics;
        local v54 = v3:sortSelectionForConversion(l_selection_0, l_diagnostics_0);
        local v55 = {
            autoConverted = 0,
            succeeded = 0,
            failed = {},
            failedVar = {}
        };
        local v56 = v10(v51.ScriptConversion.replaceRules);
        local v57 = 0;
        for _, v59 in v54, nil, nil do
            v57 = v57 + #v59;
        end;
        local l_v57_0 = v57;
        if l_v57_0 > 0 then
            v57 = "ReplaceWithRules";
            if v48 then
                v57 = "Convert";
            end;
            local v61 = v4.new(v57, l_v57_0, v50);
            v45(v51, v61, v46, v54, v55, v48, v56, l_diagnostics_0, v49);
            v61:clearProgressBar();
        end;
        v57 = {
            replaceResult = v55
        };
        v50:dispatch(v1(v57));
        v49:getHandler("onScriptConvertSelection")(v57, v56);
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Src.Actions.SetProcessResult);
local v2 = require(l_script_FirstAncestor_0.Src.Util.ScriptReplacement);
return function(v3, v4, v5, v6, _, _, v9, v10)
    return function(v11)
        v2.replaceWithSuggestion(v3, v4, v5, v6, v11:getState().ScriptConversion.diagnostics[v3], v10);
        local v12 = v5:getScriptInstanceFromGUID(v3);
        if v9 then
            v11:dispatch(v1({
                scriptInstance = v12:GetFullName()
            }));
        end;
    end;
end;


local l_Actions_0 = script:FindFirstAncestor("R15Migrator").Src.Actions;
local v1 = require(l_Actions_0.ResetAllAnimationConversion);
local v2 = require(l_Actions_0.ResetAllCharacterConversion);
local v3 = require(l_Actions_0.ResetAllScriptConversion);
local v4 = require(l_Actions_0.ResetAllAdapter);
return function()
    return function(v5)
        v5:dispatch(v1());
        v5:dispatch(v2());
        v5:dispatch(v3());
        v5:dispatch(v4());
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local l_deepCopy_0 = require(l_script_FirstAncestor_0.Packages.Framework).Util.deepCopy;
local v2 = require(l_script_FirstAncestor_0.Packages.Cryo);
local l_Util_0 = l_script_FirstAncestor_0.Src.Util;
local v4 = require(l_Util_0.SaveInterface);
local l_AnimationTagging_0 = require(l_Util_0.PublishTagging).AnimationTagging;
local l_AssetType_0 = require(l_Util_0.AnimationConversion.constants).AssetType;
local v7 = require(l_Util_0.ScriptHistory.revertScripts);
local v8 = require(l_Util_0.ScriptConversionProgressTracker);
local v9 = require(l_script_FirstAncestor_0.Src.Actions.SetAnimations);
return function(v10)
    return function(v11)
        local v12 = v11:getState();
        local v13 = l_deepCopy_0(v12.AnimationConversion.animations);
        local v14 = {};
        for v15 in v12.AnimationConversion.selection, nil, nil do
            local v16 = {};
            local v17 = v13[v15];
            if next(v17.oldRefs) then
                for v18, v19 in v17.oldRefs, nil, nil do
                    if not v19:IsA(l_AssetType_0.LocalAsset) then
                        if not v19:IsA(l_AssetType_0.AnimationInstance) then
                            if v19:IsA(l_AssetType_0.AssetIdString) then
                                v14[v10:findScriptGUID(v18.scriptInstance)] = true;
                            end;
                        else
                            v18.AnimationId = v19.url;
                            table.insert(v16, v18);
                            l_AnimationTagging_0:addTag(v18);
                        end;
                    else
                        local v20 = v4.getR6KeyframeSequence(v18);
                        v18:ClearAllChildren();
                        for _, v22 in v20:GetChildren() do
                            v22:Clone().Parent = v18;
                        end;
                        table.insert(v16, v18);
                        l_AnimationTagging_0:addTag(v18);
                    end;
                end;
                v17:addRefs(v16);
            end;
        end;
        if next(v14) then
            local v23 = v2.Dictionary.keys(v14);
            local v24 = v8.new("Revert", #v23, v11);
            v7(v23, v10, function()
                v24:updateProgress();
            end);
            v24:clearProgressBar();
        end;
        v11:dispatch(v9(v13));
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Packages.Cryo);
local l_Actions_0 = l_script_FirstAncestor_0.Src.Actions;
local _ = require(l_Actions_0.SetAdapted);
local v4 = require(l_Actions_0.SetCharacterConverted);
local v5 = require(l_script_FirstAncestor_0.Src.Modules.NpcManager);
local l_Util_0 = l_script_FirstAncestor_0.Src.Util;
local l_CharacterTagging_0 = require(l_Util_0.PublishTagging).CharacterTagging;
local l_AdapterTagging_0 = require(l_Util_0.PublishTagging).AdapterTagging;
local l_CharactersConvertedToR15Tagging_0 = require(l_Util_0.QuickAccessTagging).CharactersConvertedToR15Tagging;
return function(v10)
    return function(v11)
        local v12 = v11:getState();
        local l_selection_0 = v12.CharacterConversion.selection;
        local l_convertedCharacters_0 = v12.CharacterConversion.convertedCharacters;
        for _, v16 in l_selection_0, nil, nil do
            local v17 = l_convertedCharacters_0[v16];
            if not (not v17 or not v17.model) then
                l_AdapterTagging_0:removeTag(v17.model);
                l_CharactersConvertedToR15Tagging_0:removeTag(v17.model);
                local v18 = v17.model:Clone();
                v5.ReplaceModel(v16, v18, false);
                l_CharacterTagging_0:addTag(v18);
                v11:dispatch(v4(v17, false));
            end;
        end;
        if #v1.Dictionary.keys(v11:getState().CharacterConversion.convertedCharacters) == 0 then
            local l_AvatarUnification_0 = game:GetService("ReplicatedStorage"):FindFirstChild("AvatarUnification");
            if l_AvatarUnification_0 then
                l_AvatarUnification_0:Destroy();
            end;
            local l_StarterCharacterScripts_0 = game:GetService("StarterPlayer"):FindFirstChild("StarterCharacterScripts");
            if l_StarterCharacterScripts_0 then
                local l_LocalEffects_0 = l_StarterCharacterScripts_0:FindFirstChild("LocalEffects");
                if l_LocalEffects_0 then
                    l_LocalEffects_0:Destroy();
                end;
            end;
        end;
        v10:getHandler("onCharactersReverted")(l_convertedCharacters_0, l_selection_0);
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("R15Migrator");
local v1 = require(l_script_FirstAncestor_0.Packages.Cryo);
local v2 = require(l_script_FirstAncestor_0.Src.Thunks.OnScriptsReverted);
local v3 = require(l_script_FirstAncestor_0.Src.Actions.SetProcessResult);
local v4 = require(l_script_FirstAncestor_0.Src.Util.ScriptHistory.revertScripts);
local v5 = require(l_script_FirstAncestor_0.Src.Util.ScriptIssueSorting);
local v6 = require(l_script_FirstAncestor_0.Src.Util.ScriptConversionProgressTracker);
return function(v7, _, v9)
    return function(v10)
        local v11 = v10:getState();
        local v12 = v1.Dictionary.keys(v5:sortSelectionForConversion(v11.ScriptConversion.selection, v11.ScriptConversion.diagnostics));
        local v13 = v6.new("Revert", #v12, v10);
        local v14 = v4(v12, v7, function()
            v13:updateProgress();
        end);
        v13:clearProgressBar();
        v10:dispatch(v2(v14));
        local v15 = {
            revertResult = #v1.Dictionary.keys(v14)
        };
        v10:dispatch(v3(v15));
        v9:getHandler("onScriptSelectionReverted")(v15);
    end;
end;