local l_Parent_0 = script.Parent.Parent.Parent;
local l_Parent_1 = l_Parent_0.Parent;
local l_HttpService_0 = game:GetService("HttpService");
local v3 = require(l_Parent_1.LuauPolyfill);
local l_Array_0 = v3.Array;
local l_Object_0 = v3.Object;
local l_Set_0 = v3.Set;
local l_Map_0 = v3.Map;
local v8 = require(l_Parent_0.luaUtils.isCallable);
local v9 = require(l_Parent_0.luaUtils.objectKeysForEach);
local v10 = require(l_Parent_1.LuauRegExp);
local v11 = {};
local v12 = nil;
local v13 = nil;
local v14 = nil;
local v15 = nil;
local v16 = nil;
local v17 = nil;
local _ = require(l_Parent_1.GraphQL);
local l_Trie_0 = require(l_Parent_0.wry.trie).Trie;
local v20 = require(l_Parent_0.jsutils.invariant);
local l_invariant_0 = v20.invariant;
local l_InvariantError_0 = v20.InvariantError;
local v23 = require(script.Parent.Parent.Parent.utilities);
local l_getFragmentFromSelection_0 = v23.getFragmentFromSelection;
local l_isField_0 = v23.isField;
local l_getTypenameFromResult_0 = v23.getTypenameFromResult;
local l_storeKeyNameFromField_0 = v23.storeKeyNameFromField;
local l_argumentsObjectFromField_0 = v23.argumentsObjectFromField;
local l_isReference_0 = v23.isReference;
local l_getStoreKeyName_0 = v23.getStoreKeyName;
local l_canUseWeakMap_0 = v23.canUseWeakMap;
local l_isNonNullObject_0 = v23.isNonNullObject;
local l_stringifyForDisplay_0 = v23.stringifyForDisplay;
local v34 = require(script.Parent.helpers);
local v35 = require(l_Parent_0.luaUtils.hasOwnProperty);
local l_fieldNameFromStoreName_0 = v34.fieldNameFromStoreName;
local l_storeValueIsStoreObject_0 = v34.storeValueIsStoreObject;
local l_selectionSetMatchesResult_0 = v34.selectionSetMatchesResult;
local l_TypeOrFieldNameRegExp_0 = v34.TypeOrFieldNameRegExp;
local l_cacheSlot_0 = require(script.Parent.reactiveVars).cacheSlot;
local _ = require(script.Parent.Parent.core.types.common);
local _ = require(script.Parent.writeToStore_types);
l_getStoreKeyName_0:setStringify(require(script.Parent["object-canon"]).canonicalStringify);
local _ = require(script.Parent.policies_types);
local function _(v44)
    if v44.args ~= nil then
        return v44.args;
    elseif not v44.field then
        return nil;
    else
        return (l_argumentsObjectFromField_0(v44.field, v44.variables));
    end;
end;
local function v53(_, v47, v48)
    local l___typename_0 = v47.__typename;
    local l_id_0 = v47.id;
    local l__id_0 = v47._id;
    if type(l___typename_0) == "string" then
        if v48 then
            if l_id_0 ~= nil then
                v48.keyObject = {
                    id = l_id_0
                };
            elseif l__id_0 ~= nil then
                v48.keyObject = {
                    _id = l__id_0
                };
            else
                v48.keyObject = nil;
            end;
        end;
        if l_id_0 == nil then
            l_id_0 = l__id_0;
        end;
        if l_id_0 ~= nil then
            local v52 = type(l_id_0);
            return string.format("%s:%s", l___typename_0, if not (v52 ~= "number") or v52 == "string" then l_id_0 else l_HttpService_0:JSONEncode(l_id_0));
        end;
    end;
    return nil;
end;
v11.defaultDataIdFromObject = v53;
local function v55(_)
    return nil;
end;
local function v58(_, v57)
    return v57.fieldName;
end;
local v59 = nil;
v59 = function(_, v61, v62, v63)
    return v63:mergeObjects(v61, v62);
end;
local v64 = nil;
v64 = function(_, _, v67)
    return v67;
end;
local v68 = {};
v68.__index = v68;
v68.new = function(v69)
    local v70 = setmetatable({}, v68);
    v70.typePolicies = {};
    v70.toBeAdded = {};
    v70.supertypeMap = l_Map_0.new(nil);
    v70.fuzzySubtypes = l_Map_0.new(nil);
    v70.cache = nil;
    v70.rootIdsByTypename = {};
    v70.rootTypenamesById = {};
    v70.usingPossibleTypes = false;
    v70.config = v69;
    v70.config = l_Object_0.assign({
        dataIdFromObject = v53
    }, v69);
    v70.cache = v70.config.cache;
    v70:setRootTypename("Query");
    v70:setRootTypename("Mutation");
    v70:setRootTypename("Subscription");
    if v69.possibleTypes then
        v70:addPossibleTypes(v69.possibleTypes);
    end;
    if v69.typePolicies then
        v70:addTypePolicies(v69.typePolicies);
    end;
    return v70;
end;
v68.identify = function(v71, v72, v73, v74)
    local v75 = nil;
    v75 = if not not v73 and v74 then l_getTypenameFromResult_0(v72, v73, v74) else v72.__typename;
    if v75 == v71.rootTypenamesById.ROOT_QUERY then
        return {
            "ROOT_QUERY"
        };
    else
        local v76 = {
            typename = v75,
            selectionSet = v73,
            fragmentMap = v74
        };
        local v77 = nil;
        local v78 = nil;
        v78 = v75 and v71:getTypePolicy(v75);
        local v79 = nil;
        v79 = if not not v78 and v78.keyFn then v78.keyFn else v71.config.dataIdFromObject;
        while v79 do
            local v80 = v79(v78, v72, v76);
            if type(v80) == "table" then
                v79 = v15(v80);
            else
                v77 = v80;
                break;
            end;
        end;
        v77 = if not v77 then nil else tostring(v77);
        if not v76.keyObject then
            return {
                v77
            };
        else
            return {
                v77,
                v76.keyObject
            };
        end;
    end;
end;
v68.addTypePolicies = function(v81, v82)
    v9(v82, function(v83)
        local v84 = v82[v83];
        local l_queryType_0 = v84.queryType;
        local l_mutationType_0 = v84.mutationType;
        local l_subscriptionType_0 = v84.subscriptionType;
        local v88 = l_Object_0.assign({}, v84, {
            queryType = l_Object_0.None,
            mutationType = l_Object_0.None,
            subscriptionType = l_Object_0.None
        });
        if l_queryType_0 then
            v81:setRootTypename("Query", v83);
        end;
        if l_mutationType_0 then
            v81:setRootTypename("Mutation", v83);
        end;
        if l_subscriptionType_0 then
            v81:setRootTypename("Subscription", v83);
        end;
        if not v35(v81.toBeAdded, v83) then
            v81.toBeAdded[v83] = {
                v88
            };
            return ;
        else
            table.insert(v81.toBeAdded[v83], v88);
            return ;
        end;
    end);
end;
v68.updateTypePolicy = function(v89, v90, v91)
    local v92 = v89:getTypePolicy(v90);
    local l_keyFields_0 = v91.keyFields;
    local l_fields_0 = v91.fields;
    local function _(v95, v96)
        if not v8(v96) then
            if v96 == true then
                v95.merge = v59;
                return ;
            elseif v96 == false then
                v95.merge = v64;
                return ;
            else
                v95.merge = v95.merge;
                return ;
            end;
        else
            v95.merge = v96;
            return ;
        end;
    end;
    local l_merge_0 = v91.merge;
    if not v8(l_merge_0) then
        if l_merge_0 == true then
            v92.merge = v59;
        elseif l_merge_0 == false then
            v92.merge = v64;
        else
            v92.merge = v92.merge;
        end;
    else
        v92.merge = l_merge_0;
    end;
    if l_keyFields_0 == false then
        v92.keyFn = v55;
    else
        l_merge_0 = type(l_keyFields_0);
        if l_merge_0 == "table" then
            v92.keyFn = v15(l_keyFields_0);
        elseif l_merge_0 == "function" then
            v92.keyFn = l_keyFields_0;
        else
            v92.keyFn = v92.keyFn;
        end;
    end;
    if l_fields_0 then
        v9(l_fields_0, function(v99)
            local v100 = v89:getFieldPolicy(v90, v99, true);
            local v101 = l_fields_0[v99];
            if type(v101) == "function" then
                v100.read = v101;
            else
                local l_keyArgs_0 = v101.keyArgs;
                local l_read_0 = v101.read;
                local l_merge_1 = v101.merge;
                if l_keyArgs_0 == false then
                    v100.keyFn = v58;
                else
                    local v105 = type(l_keyArgs_0);
                    if v105 == "table" then
                        v100.keyFn = v14(l_keyArgs_0);
                    elseif v105 == "function" then
                        v100.keyFn = l_keyArgs_0;
                    else
                        v100.keyFn = v100.keyFn;
                    end;
                end;
                if type(l_read_0) == "function" then
                    v100.read = l_read_0;
                end;
                if not v8(l_merge_1) then
                    if l_merge_1 == true then
                        v100.merge = v59;
                    elseif l_merge_1 == false then
                        v100.merge = v64;
                    else
                        v100.merge = v100.merge;
                    end;
                else
                    v100.merge = l_merge_1;
                end;
            end;
            if not (not v100.read or not v100.merge) then
                v100.keyFn = v100.keyFn or v58;
            end;
        end);
    end;
end;
v68.setRootTypename = function(v106, v107, v108)
    local l_v108_0 = v108;
    if l_v108_0 == nil then
        l_v108_0 = v107;
    end;
    local v110 = "ROOT_" .. string.upper(v107);
    local v111 = v106.rootTypenamesById[v110];
    if l_v108_0 ~= v111 then
        local v112 = not v111 or v111 == v107;
        if not v112 then
            l_invariant_0(v112, ("Cannot change root %s __typename more than once"):format(v107));
        end;
        if v111 then
            v106.rootIdsByTypename[v111] = nil;
        end;
        v106.rootIdsByTypename[l_v108_0] = v110;
        v106.rootTypenamesById[v110] = l_v108_0;
    end;
end;
v68.addPossibleTypes = function(v113, v114)
    v113.usingPossibleTypes = true;
    v9(v114, function(v115)
        v113:getSupertypeSet(v115, true);
        l_Array_0.forEach(v114[v115], function(v116)
            v113:getSupertypeSet(v116, true):add(v115);
            local v117 = l_TypeOrFieldNameRegExp_0:exec(v116);
            if not v117 or v117[1] ~= v116 then
                v113.fuzzySubtypes:set(v116, v10.new(v116));
            end;
        end);
    end);
end;
v68.getTypePolicy = function(v118, v119)
    if not v35(v118.typePolicies, v119) then
        v118.typePolicies[v119] = {};
        local v120 = v118.typePolicies[v119];
        v120.fields = {};
        local v121 = v118.supertypeMap:get(v119);
        if v121 and v121.size > 0 then
            local l_v120_0 = v120 --[[ copy: 2 -> 4 ]];
            v121:forEach(function(v123)
                local v124 = v118:getTypePolicy(v123);
                local l_fields_1 = v124.fields;
                l_Object_0.assign(l_v120_0, (l_Object_0.assign(table.clone(v124), {
                    fields = l_Object_0.None
                })));
                l_Object_0.assign(l_v120_0.fields, l_fields_1);
            end);
        end;
    end;
    local v126 = v118.toBeAdded[v119];
    if v126 and #v126 > 0 then
        l_Array_0.forEach(l_Array_0.splice(v126, 1), function(v127)
            v118:updateTypePolicy(v119, v127);
        end);
    end;
    return v118.typePolicies[v119];
end;
v68.getFieldPolicy = function(v128, v129, v130, v131)
    if not v129 then
        return nil;
    else
        local l_fields_2 = v128:getTypePolicy(v129).fields;
        if not l_fields_2[v130] then
            if not v131 then
                return nil;
            else
                l_fields_2[v130] = {};
                return l_fields_2[v130];
            end;
        else
            return l_fields_2[v130];
        end;
    end;
end;
v68.getSupertypeSet = function(v133, v134, v135)
    local v136 = v133.supertypeMap:get(v134);
    if not (v136 or not v135) then
        v136 = l_Set_0.new();
        v133.supertypeMap:set(v134, v136);
    end;
    return v136;
end;
v68.fragmentMatches = function(v137, v138, v139, v140, v141)
    if v138.typeCondition then
        if v139 then
            local l_value_0 = v138.typeCondition.name.value;
            if v139 == l_value_0 then
                return true;
            else
                if not (not v137.usingPossibleTypes or not v137.supertypeMap:has(l_value_0)) then
                    local v143 = v137:getSupertypeSet(v139, true);
                    local v144 = {
                        v143
                    };
                    local function v147(v145)
                        local v146 = v137:getSupertypeSet(v145, false);
                        if (v146 and v146.size > 0) and l_Array_0.indexOf(v144, v146) < 1 then
                            table.insert(v144, v146);
                        end;
                    end;
                    local v148 = false;
                    if v140 ~= nil then
                        v148 = v137.fuzzySubtypes.size > 0;
                    end;
                    local v149 = false;
                    for v150, _ in v144, nil, nil do
                        local v152 = v144[v150];
                        if not v152:has(l_value_0) then
                            v152:forEach(v147);
                            if not (not (v148 and v150 == #v144) or not l_selectionSetMatchesResult_0(v138.selectionSet, v140, v141)) then
                                v148 = false;
                                v149 = true;
                                l_Array_0.forEach(v137.fuzzySubtypes:entries(), function(v153)
                                    local v154 = v153[2];
                                    local v155 = v153[1];
                                    local v156 = v154:exec(v139);
                                    if v156 and v156[1] == v139 then
                                        local v157 = v137:getSupertypeSet(v155, false);
                                        if (v157 and v157.size > 0) and l_Array_0.indexOf(v144, v157) < 1 then
                                            table.insert(v144, v157);
                                        end;
                                    end;
                                    return 1;
                                end);
                            end;
                        else
                            if not v143:has(l_value_0) then
                                if v149 then
                                    l_invariant_0.warn(("Inferring subtype %s of supertype %s"):format(v139, l_value_0));
                                end;
                                v143:add(l_value_0);
                            end;
                            return true;
                        end;
                    end;
                end;
                return false;
            end;
        else
            return false;
        end;
    else
        return true;
    end;
end;
v68.hasKeyArgs = function(v158, v159, v160)
    local v161 = v158:getFieldPolicy(v159, v160, false);
    local v162 = false;
    if v161 ~= nil then
        v162 = v161.keyFn ~= nil;
    end;
    return v162;
end;
v68.getStoreFieldName = function(v163, v164)
    local l_typename_0 = v164.typename;
    local l_fieldName_0 = v164.fieldName;
    local v167 = v163:getFieldPolicy(l_typename_0, l_fieldName_0, false);
    local v168 = nil;
    local v169 = nil;
    v169 = if not v167 then nil else v167.keyFn;
    if not (not v169 or not l_typename_0) then
        local v170 = {
            typename = l_typename_0,
            fieldName = l_fieldName_0,
            field = v164.field or nil,
            variables = v164.variables
        };
        local v171 = if v164.args ~= nil then v164.args else if v164.field then l_argumentsObjectFromField_0(v164.field, v164.variables) else nil;
        while v169 do
            local v172 = v169(v171, v170);
            if type(v172) == "table" then
                v169 = v14(v172);
            else
                v168 = v172 or l_fieldName_0;
                break;
            end;
        end;
    end;
    if v168 == nil then
        v168 = if not v164.field then l_getStoreKeyName_0(l_fieldName_0, if v164.args ~= nil then v164.args else if v164.field then l_argumentsObjectFromField_0(v164.field, v164.variables) else nil) else l_storeKeyNameFromField_0(v164.field, v164.variables);
    end;
    if v168 == false then
        return l_fieldName_0;
    elseif l_fieldName_0 == l_fieldNameFromStoreName_0(v168) then
        return v168;
    else
        return l_fieldName_0 .. ":" .. v168;
    end;
end;
v68.readField = function(v173, v174, v175)
    local l_from_0 = v174.from;
    if l_from_0 then
        if v174.field or v174.fieldName then
            if v174.typename == nil then
                local v177 = v175.store:getFieldValue(l_from_0, "__typename");
                if v177 then
                    v174.typename = v177;
                end;
            end;
            local v178 = v173:getStoreFieldName(v174);
            local v179 = l_fieldNameFromStoreName_0(v178);
            local v180 = v175.store:getFieldValue(l_from_0, v178);
            local v181 = v173:getFieldPolicy(v174.typename, v179, false);
            local v182 = nil;
            v182 = if not v181 then nil else v181.read;
            if not v182 then
                return v180;
            else
                return (l_cacheSlot_0:withValue(v173.cache, v182, {
                    v180,
                    (v12(v173, l_from_0, v174, v175, v175.store:getStorage(if not l_from_0.__ref then l_from_0 else l_from_0.__ref, v178)))
                }));
            end;
        else
            return ;
        end;
    else
        return ;
    end;
end;
v68.getMergeFunction = function(v183, v184, v185, v186)
    local v187 = v183:getFieldPolicy(v184, v185, false);
    local v188 = nil;
    v188 = v187 and v187.merge;
    if not (v188 or not v186) then
        v187 = v183:getTypePolicy(v186);
        if not v187 then
            v188 = v187;
        else
            return v187.merge;
        end;
    end;
    return v188;
end;
v68.runMergeFunction = function(v189, v190, v191, v192, v193, v194)
    local l_field_0 = v192.field;
    local l_typename_1 = v192.typename;
    local l_merge_2 = v192.merge;
    if l_merge_2 == v59 then
        return v13(v193.store)(v192, v190, v191);
    elseif l_merge_2 == v64 then
        return v191;
    else
        if v193.overwrite then
            v190 = nil;
        end;
        return l_merge_2(v192, v190, v191, v12(v189, nil, {
            typename = l_typename_1,
            fieldName = l_field_0.name.value,
            field = l_field_0,
            variables = v193.variables
        }, v193, v194 or {}));
    end;
end;
v11.Policies = v68;
v12 = function(v198, v199, v200, v201, v202)
    local v203 = v198:getStoreFieldName(v200);
    local v204 = l_fieldNameFromStoreName_0(v203);
    local v205 = v200.variables or v201.variables;
    return {
        args = if v200.args ~= nil then v200.args else if v200.field then l_argumentsObjectFromField_0(v200.field, v200.variables) else nil,
        field = v200.field or nil,
        fieldName = v204,
        storeFieldName = v203,
        variables = v205,
        isReference = function(_, ...)
            return l_isReference_0(...);
        end,
        toReference = v201.store.toReference,
        storage = v202,
        cache = v198.cache,
        canRead = v201.store.canRead,
        readField = function(_, v208, ...)
            local v209 = type(v208);
            local v210 = {
                if v209 == "table" then l_Object_0.assign(table.clone(v208), if v208.from == l_Object_0.None then {
                    from = "<Object.None>"
                } else nil) else v208,
                select("#", ...) >= 1 and "<nil>" or nil
            };
            local v211 = nil;
            if v209 == "string" then
                v211 = {
                    fieldName = v208,
                    from = if select("#", ...) >= 1 then ... else v199
                };
            elseif v209 == "table" then
                v211 = l_Object_0.assign({}, v208);
                if not v35(v208, "from") then
                    v211.from = v199;
                end;
            else
                l_invariant_0.warn(("Unexpected readField arguments: %s"):format(l_stringifyForDisplay_0(l_Array_0.from(v210))));
                return ;
            end;
            if _G.__DEV__ and v211.from == nil then
                l_invariant_0.warn(("Undefined 'from' passed to readField with arguments %s"):format(l_stringifyForDisplay_0(l_Array_0.from(v210))));
            end;
            if v211.variables == nil then
                v211.variables = v205;
            end;
            return v198:readField(v211, v201);
        end,
        mergeObjects = v13(v201.store)
    };
end;
v13 = function(v212)
    return function(_, v214, v215)
        if not (not l_Array_0.isArray(v214) and not l_Array_0.isArray(v215)) then
            error(l_InvariantError_0.new("Cannot automatically merge arrays"));
        end;
        if not (not l_isNonNullObject_0(v214) or not l_isNonNullObject_0(v215)) then
            local v216 = v212:getFieldValue(v214, "__typename");
            local v217 = v212:getFieldValue(v215, "__typename");
            local v218 = false;
            if v216 ~= nil then
                v218 = false;
                if v217 ~= nil then
                    v218 = v216 ~= v217;
                end;
            end;
            if not v218 then
                if not l_isReference_0(v214) or not l_storeValueIsStoreObject_0(v215) then
                    if not l_storeValueIsStoreObject_0(v214) or not l_isReference_0(v215) then
                        if not (not l_storeValueIsStoreObject_0(v214) or not l_storeValueIsStoreObject_0(v215)) then
                            return l_Object_0.assign({}, v214, v215);
                        end;
                    else
                        v212:merge(v214, v215.__ref);
                        return v215;
                    end;
                else
                    v212:merge(v214.__ref, v215);
                    return v214;
                end;
            else
                return v215;
            end;
        end;
        return v215;
    end;
end;
local function v219(v220, v221)
    assert(typeof(v221) == "table", "specifier must be an array");
    if next(v221) then
        return "{" .. l_Array_0.join(l_Array_0.filter(l_Array_0.map(v221, function(v222, v223)
            if not l_Array_0.isArray(v222) then
                local _ = nil;
                if v220[v222] then
                    if v223 < #v221 then
                        return l_HttpService_0:JSONEncode(v222) .. ":" .. if not l_Array_0.isArray(v221[v223 + 1]) then l_HttpService_0:JSONEncode(v220[v222]) else v219(v220[v222], v221[v223 + 1]);
                    else
                        return l_HttpService_0:JSONEncode(v222) .. ":" .. l_HttpService_0:JSONEncode(v220[v222]);
                    end;
                else
                    return "";
                end;
            else
                return "";
            end;
        end), function(v225)
            return v225 ~= "";
        end), ",") .. "}";
    else
        return "[]";
    end;
end;
v14 = function(v226)
    return function(v227, v228)
        if not v227 then
            return v228.fieldName;
        else
            return ("%s:%s"):format(v228.fieldName, (v219(v17(v227, v226, false), v226)));
        end;
    end;
end;
v15 = function(v229)
    local v230 = l_Trie_0.new(l_canUseWeakMap_0);
    return function(_, v232, v233)
        local v234 = nil;
        if not (not v233.selectionSet or not v233.fragmentMap) then
            local v235 = v230:lookupArray({
                v233.selectionSet,
                v233.fragmentMap
            });
            if not v235.aliasMap then
                v235.aliasMap = v16(v233.selectionSet, v233.fragmentMap);
                v234 = v235.aliasMap;
            else
                v234 = v235.aliasMap;
            end;
        end;
        v233.keyObject = v17(v232, v229, true, v234);
        return ("%s:%s"):format(v233.typename or "null", (v219(v233.keyObject, v229)));
    end;
end;
v16 = function(v236, v237)
    local v238 = {};
    local v239 = l_Set_0.new({
        v236
    });
    for _, v241 in v239, nil, nil do
        l_Array_0.forEach(v241.selections, function(v242)
            if not l_isField_0(v242) then
                local v243 = l_getFragmentFromSelection_0(v242, v237);
                if v243 then
                    v239:add(v243.selectionSet);
                end;
            else
                if v242.alias then
                    local l_value_1 = v242.alias.value;
                    local l_value_2 = v242.name.value;
                    if l_value_2 ~= l_value_1 then
                        local v246 = nil;
                        if not v238.aliases then
                            v238.aliases = {};
                            v246 = v238.aliases;
                        else
                            v246 = v238.aliases;
                        end;
                        v246[l_value_2] = l_value_1;
                    end;
                end;
                if v242.selectionSet then
                    local v247 = nil;
                    if not v238.subsets then
                        v238.subsets = {};
                        v247 = v238.subsets;
                    else
                        v247 = v238.subsets;
                    end;
                    v247[v242.name.value] = v16(v242.selectionSet, v237);
                    return ;
                end;
            end;
        end);
    end;
    return v238;
end;
v17 = function(v248, v249, v250, v251)
    local v252 = {};
    local v253 = nil;
    for _, v255 in v249, nil, nil do
        if type(v255) == "table" then
            if type(v253) == "string" then
                local v256 = nil;
                v256 = v251 and v251.subsets;
                local _ = nil;
                v252[v253] = v17(v248[v253], v255, v250, v256 and v256[v253]);
            end;
        else
            local v258 = nil;
            v258 = v251 and v251.aliases;
            local v259 = nil;
            v259 = if not not v258 and v258[v255] then v258[v255] else v255;
            if not v35(v248, v259) then
                l_invariant_0(not v250, ("Missing field '%s' while computing key fields"):format(v259));
                v253 = nil;
            else
                v253 = v255;
                v252[v253] = v248[v259];
            end;
        end;
    end;
    return v252;
end;
v11.None = l_Object_0.None;
return v11;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local _ = require(l_Parent_0.LuauPolyfill);
local _ = require(l_Parent_0.GraphQL);
local _ = require(script.Parent.Parent.Parent.utilities.graphql.types);
local _ = require(script.Parent.Parent.core.types.common);
return {};


local l_Parent_0 = script.Parent.Parent.Parent;
local l_Parent_1 = l_Parent_0.Parent;
local v2 = {};
local l_dep_0 = require(l_Parent_0.optimism).dep;
local l_Slot_0 = require(l_Parent_0.wry.context).Slot;
local _ = require(script.Parent.Parent.core.cache);
local v6 = require(l_Parent_1.LuauPolyfill);
local l_Array_0 = v6.Array;
local l_Set_0 = v6.Set;
local l_WeakMap_0 = v6.WeakMap;
local v10 = nil;
local v11 = l_Slot_0.new();
v2.cacheSlot = v11;
local v12 = l_WeakMap_0.new();
local function v15(v13)
    local v14 = v12:get(v13);
    if not v14 then
        v14 = {
            vars = l_Set_0.new(),
            dep = l_dep_0()
        };
        v12:set(v13, v14);
    end;
    return v14;
end;
v2.forgetCache = function(v16)
    v15(v16).vars:forEach(function(v17)
        return v17:forgetCache(v16);
    end);
end;
v2.recallCache = function(v18)
    v15(v18).vars:forEach(function(v19)
        return v19:attachCache(v18);
    end);
end;
v2.makeVar = function(v20)
    local v21 = l_Set_0.new();
    local v22 = l_Set_0.new();
    local v23 = nil;
    local v24 = nil;
    v23 = setmetatable({}, {
        __call = function(_, ...)
            if select("#", ...) >= 1 then
                local v26 = ({
                    ...
                })[1];
                if v20 ~= v26 then
                    v20 = v26;
                    v21:forEach(function(v27)
                        v15(v27).dep:dirty(v23);
                        v10(v27);
                    end);
                    local v28 = l_Array_0.from(v22);
                    v22:clear();
                    l_Array_0.forEach(v28, function(v29)
                        v29(v20);
                    end);
                end;
            else
                local v30 = v11:getValue();
                if v30 then
                    v24(v30);
                    v15(v30).dep(v23);
                end;
            end;
            return v20;
        end
    });
    v23.onNextChange = function(_, v32)
        v22:add(v32);
        return function()
            v22:delete(v32);
        end;
    end;
    v24 = function(v33)
        v21:add(v33);
        v15(v33).vars:add(v23);
        return v23;
    end;
    v23.attachCache = function(_, v35)
        return v24(v35);
    end;
    v23.forgetCache = function(_, v37)
        return v21:delete(v37);
    end;
    return v23;
end;
v10 = function(v38)
    if v38.broadcastWatches ~= nil then
        v38:broadcastWatches();
    end;
end;
return v2;


local l_Parent_0 = script.Parent.Parent.Parent;
local l_Parent_1 = l_Parent_0.Parent;
local v2 = require(l_Parent_1.LuauPolyfill);
local l_Array_0 = v2.Array;
local l_Object_0 = v2.Object;
local l_Boolean_0 = v2.Boolean;
local l_Set_0 = v2.Set;
local l_WeakMap_0 = v2.WeakMap;
local l_HttpService_0 = game:GetService("HttpService");
local l_NULL_0 = require(l_Parent_0.utilities).NULL;
local v10 = nil;
local v11 = {};
local _ = require(l_Parent_1.GraphQL);
local l_wrap_0 = require(l_Parent_0.optimism).wrap;
local v14 = require(l_Parent_0.jsutils.invariant);
local l_invariant_0 = v14.invariant;
local l_InvariantError_0 = v14.InvariantError;
local v17 = require(script.Parent.Parent.Parent.utilities);
local l_isField_0 = v17.isField;
local l_resultKeyNameFromField_0 = v17.resultKeyNameFromField;
local l_isReference_0 = v17.isReference;
local l_makeReference_0 = v17.makeReference;
local l_createFragmentMap_0 = v17.createFragmentMap;
local l_shouldInclude_0 = v17.shouldInclude;
local l_addTypenameToDocument_0 = v17.addTypenameToDocument;
local l_getDefaultValues_0 = v17.getDefaultValues;
local l_getFragmentDefinitions_0 = v17.getFragmentDefinitions;
local l_getMainDefinition_0 = v17.getMainDefinition;
local l_getQueryDefinition_0 = v17.getQueryDefinition;
local l_mergeDeepArray_0 = v17.mergeDeepArray;
local l_getFragmentFromSelection_0 = v17.getFragmentFromSelection;
local l_maybeDeepFreeze_0 = v17.maybeDeepFreeze;
local l_isNonNullObject_0 = v17.isNonNullObject;
local _ = v17.canUseWeakMap;
local _ = require(script.Parent.Parent.core.types.Cache);
local _ = require(script.Parent.types);
local v36 = require(script.Parent.entityStore);
local l_maybeDependOnExistenceOfEntity_0 = v36.maybeDependOnExistenceOfEntity;
local l_supportsResultCaching_0 = v36.supportsResultCaching;
local l_getTypenameFromStoreObject_0 = require(script.Parent.helpers).getTypenameFromStoreObject;
local _ = require(script.Parent.policies);
local l_MissingFieldError_0 = require(script.Parent.Parent.core.types.common).MissingFieldError;
local v42 = require(script.Parent["object-canon"]);
local l_canonicalStringify_0 = v42.canonicalStringify;
local l_ObjectCanon_0 = v42.ObjectCanon;
local function v47(v45, v46)
    return l_MissingFieldError_0.new(v45.message, l_Array_0.slice(v46.path), v46.query, v46.variables);
end;
local function _(v48)
    return {
        v48.selectionSet,
        v48.objectOrReference,
        v48.context,
        v48.context.canonizeResults
    };
end;
local v50 = {};
v50.__index = v50;
v50.resetCanon = function(v51)
    v51.canon = l_ObjectCanon_0.new();
end;
local function v57(_, v53, v54, v55, v56)
    if not l_supportsResultCaching_0(v55.store) then
        return nil;
    else
        return v55.store:makeCacheKey(v53, not not l_isReference_0(v54) and v54.__ref or v54, v55.varString, v56);
    end;
end;
local function v63(_, v59)
    local l_field_0 = v59.field;
    local l_array_0 = v59.array;
    local l_context_0 = v59.context;
    if not l_supportsResultCaching_0(l_context_0.store) then
        return nil;
    else
        return l_context_0.store:makeCacheKey(l_field_0, l_array_0, l_context_0.varString);
    end;
end;
v50.new = function(v64)
    local v65 = setmetatable({}, v50);
    v65.knownResults = l_WeakMap_0.new();
    v65.config = l_Object_0.assign(table.clone(v64), {
        addTypename = v64.addTypename ~= false
    });
    v65.canon = v64.canon or l_ObjectCanon_0.new();
    v65.executeSelectionSet = l_wrap_0(function(_, v67)
        local l_canonizeResults_0 = v67.context.canonizeResults;
        local v69 = v65.executeSelectionSet:peek(table.unpack({
            v67.selectionSet,
            v67.objectOrReference,
            v67.context,
            v67.context.canonizeResults;
            [4] = not l_canonizeResults_0
        }));
        if v69 ~= nil then
            if not l_canonizeResults_0 then
                return v69;
            else
                return l_Object_0.assign(table.clone(v69), {
                    result = v65.canon:admit(v69.result)
                });
            end;
        else
            l_maybeDependOnExistenceOfEntity_0(v67.context.store, v67.enclosingRef.__ref);
            return v65:execSelectionSetImpl(v67);
        end;
    end, {
        max = v65.config.resultCacheMaxSize,
        keyArgs = function(_, ...)
            local v71 = ...;
            return {
                v71.selectionSet,
                v71.objectOrReference,
                v71.context,
                v71.context.canonizeResults
            };
        end,
        makeCacheKey = v57
    }, v65);
    v65.executeSubSelectedArray = l_wrap_0(function(_, v73)
        l_maybeDependOnExistenceOfEntity_0(v73.context.store, v73.enclosingRef.__ref);
        return v65:execSubSelectedArrayImpl(v73);
    end, {
        max = v65.config.resultCacheMaxSize,
        makeCacheKey = v63
    }, v65);
    return v65;
end;
v50.diffQueryAgainstStore = function(v74, v75)
    local l_store_0 = v75.store;
    local l_query_0 = v75.query;
    local l_rootId_0 = v75.rootId;
    local l_variables_0 = v75.variables;
    local l_returnPartialData_0 = v75.returnPartialData;
    local l_canonizeResults_1 = v75.canonizeResults;
    if l_rootId_0 == nil then
        l_rootId_0 = "ROOT_QUERY";
    end;
    if l_returnPartialData_0 == nil then
        l_returnPartialData_0 = true;
    end;
    if l_canonizeResults_1 == nil then
        l_canonizeResults_1 = true;
    end;
    local l_policies_0 = v74.config.cache.policies;
    l_variables_0 = l_Object_0.assign({}, l_getDefaultValues_0(l_getQueryDefinition_0(l_query_0)), l_variables_0);
    local v83 = l_makeReference_0(l_rootId_0);
    local v84 = v74:executeSelectionSet({
        selectionSet = l_getMainDefinition_0(l_query_0).selectionSet,
        objectOrReference = v83,
        enclosingRef = v83,
        context = {
            store = l_store_0,
            query = l_query_0,
            policies = l_policies_0,
            variables = l_variables_0,
            varString = l_canonicalStringify_0(l_variables_0),
            canonizeResults = l_canonizeResults_1,
            fragmentMap = l_createFragmentMap_0(l_getFragmentDefinitions_0(l_query_0)),
            path = {}
        }
    });
    local v85 = v84.missing and #v84.missing > 0;
    if not (not v85 or l_returnPartialData_0) then
        error(v84.missing[1]);
    end;
    return {
        result = v84.result,
        missing = v84.missing,
        complete = not v85
    };
end;
v50.isFresh = function(v86, v87, v88, v89, v90)
    if l_supportsResultCaching_0(v90.store) and v86.knownResults:get(v87) == v89 then
        local v91 = v86.executeSelectionSet:peek(v89, v88, v90, v86.canon:isKnown(v87));
        if v91 and v87 == v91.result then
            return true;
        end;
    end;
    return false;
end;
v50.execSelectionSetImpl = function(v92, v93)
    local l_selectionSet_0 = v93.selectionSet;
    local l_objectOrReference_0 = v93.objectOrReference;
    local l_enclosingRef_0 = v93.enclosingRef;
    local l_context_1 = v93.context;
    if (not l_objectOrReference_0.__ref or l_context_1.policies.rootTypenamesById[l_objectOrReference_0.__ref]) or l_context_1.store:has(l_objectOrReference_0.__ref) then
        local l_variables_1 = l_context_1.variables;
        local l_policies_1 = l_context_1.policies;
        local l_store_1 = l_context_1.store;
        local v101 = {};
        local v102 = {
            result = l_NULL_0
        };
        local v103 = l_store_1:getFieldValue(l_objectOrReference_0, "__typename");
        if not (not (v92.config.addTypename and type(v103) == "string") or l_policies_1.rootIdsByTypename[v103]) then
            table.insert(v101, {
                __typename = v103
            });
        end;
        local function _()
            if not v102.missing then
                v102.missing = {};
            end;
            return v102.missing;
        end;
        local _ = function(v105)
            if v105.missing then
                if not v102.missing then
                    v102.missing = {};
                end;
                local l_missing_0 = v102.missing;
                for _, v108 in v105.missing, nil, nil do
                    table.insert(l_missing_0, v108);
                end;
            end;
            return v105.result;
        end;
        local v110 = l_Set_0.new(l_selectionSet_0.selections);
        for _, v112 in v110, nil, nil do
            if l_shouldInclude_0(v112, l_variables_1) then
                if not l_isField_0(v112) then
                    local v113 = l_getFragmentFromSelection_0(v112, l_context_1.fragmentMap);
                    if not (not v113 or not l_policies_1:fragmentMatches(v113, v103)) then
                        l_Array_0.forEach(v113.selectionSet.selections, v110.add, v110);
                    end;
                else
                    local v114 = l_policies_1:readField({
                        fieldName = v112.name.value,
                        field = v112,
                        variables = l_context_1.variables,
                        from = l_objectOrReference_0
                    }, l_context_1);
                    local v115 = l_resultKeyNameFromField_0(v112);
                    table.insert(l_context_1.path, v115);
                    if v114 == nil then
                        if not l_addTypenameToDocument_0:added(v112) then
                            if not v102.missing then
                                v102.missing = {};
                            end;
                            table.insert(v102.missing, v47(l_InvariantError_0.new(("Can't find field '%s' on %s"):format(v112.name.value, not not l_isReference_0(l_objectOrReference_0) and l_objectOrReference_0.__ref .. " object" or "object " .. l_HttpService_0:JSONEncode(l_objectOrReference_0))), l_context_1));
                        end;
                    elseif not l_Array_0.isArray(v114) then
                        if v112.selectionSet then
                            if v114 ~= l_NULL_0 then
                                local v116 = v92:executeSelectionSet({
                                    selectionSet = v112.selectionSet,
                                    objectOrReference = v114,
                                    enclosingRef = not not l_isReference_0(v114) and v114 or l_enclosingRef_0,
                                    context = l_context_1
                                });
                                if v116.missing then
                                    if not v102.missing then
                                        v102.missing = {};
                                    end;
                                    local l_missing_1 = v102.missing;
                                    for _, v119 in v116.missing, nil, nil do
                                        table.insert(l_missing_1, v119);
                                    end;
                                end;
                                v114 = v116.result;
                            end;
                        elseif l_context_1.canonizeResults then
                            v114 = v92.canon:pass(v114);
                        end;
                    else
                        local v120 = v92:executeSubSelectedArray({
                            field = v112,
                            array = v114,
                            enclosingRef = l_enclosingRef_0,
                            context = l_context_1
                        });
                        if v120.missing then
                            if not v102.missing then
                                v102.missing = {};
                            end;
                            local l_missing_2 = v102.missing;
                            for _, v123 in v120.missing, nil, nil do
                                table.insert(l_missing_2, v123);
                            end;
                        end;
                        v114 = v120.result;
                    end;
                    if v114 ~= nil then
                        table.insert(v101, {
                            [v115] = v114
                        });
                    end;
                    local v124 = table.remove(l_context_1.path) == v115;
                    if not v124 then
                        l_invariant_0(v124);
                    end;
                end;
            end;
        end;
        local v125 = l_mergeDeepArray_0(v101);
        if not l_context_1.canonizeResults then
            v102.result = l_maybeDeepFreeze_0(v125);
        else
            v102.result = v92.canon:admit(v125);
        end;
        v92.knownResults:set(v102.result, l_selectionSet_0);
        return v102;
    else
        return {
            result = v92.canon.empty,
            missing = {
                v47(l_InvariantError_0.new(("Dangling reference to missing %s object"):format(l_objectOrReference_0.__ref)), l_context_1)
            }
        };
    end;
end;
v50.execSubSelectedArrayImpl = function(v126, v127)
    local l_field_1 = v127.field;
    local l_array_1 = v127.array;
    local l_enclosingRef_1 = v127.enclosingRef;
    local l_context_2 = v127.context;
    local v132 = nil;
    local function v137(v133, v134)
        if v133.missing then
            v132 = v132 or {};
            local l_missing_3 = v133.missing;
            for v136 = 1, #l_missing_3 do
                table.insert(v132, l_missing_3[v136]);
            end;
        end;
        l_invariant_0(table.remove(l_context_2.path) == v134);
        return v133.result;
    end;
    if l_field_1.selectionSet then
        l_array_1 = l_Array_0.filter(l_array_1, function(v138)
            return l_context_2.store:canRead(v138);
        end);
    end;
    l_array_1 = l_Array_0.map(l_array_1, function(v139, v140)
        if v139 == l_NULL_0 then
            return l_NULL_0;
        else
            table.insert(l_context_2.path, v140);
            if l_Array_0.isArray(v139) and #v139 > 0 then
                return (v137(v126:executeSubSelectedArray({
                    field = l_field_1,
                    array = v139,
                    enclosingRef = l_enclosingRef_1,
                    context = l_context_2
                }), v140));
            elseif not l_Boolean_0.toJSBoolean(l_field_1.selectionSet) then
                if _G.__DEV__ then
                    v10(l_context_2.store, l_field_1, v139);
                end;
                local v141 = table.remove(l_context_2.path) == v140;
                if not v141 then
                    l_invariant_0(v141);
                end;
                return v139;
            else
                return (v137(v126:executeSelectionSet({
                    selectionSet = l_field_1.selectionSet,
                    objectOrReference = v139,
                    enclosingRef = not not l_isReference_0(v139) and v139 or l_enclosingRef_1,
                    context = l_context_2
                }), v140));
            end;
        end;
    end);
    return {
        result = if not l_context_2.canonizeResults then l_array_1 else v126.canon:admit(l_array_1),
        missing = v132
    };
end;
v11.StoreReader = v50;
v10 = function(v142, v143, v144)
    if not v143.selectionSet then
        local v145 = l_Set_0.new({
            v144
        });
        for _, v147 in v145, nil, nil do
            if l_isNonNullObject_0(v147) then
                l_invariant_0(not l_isReference_0(v147), ("Missing selection set for object of type %s returned for query field %s"):format(l_getTypenameFromStoreObject_0(v142, v147) or "nil", v143.name.value));
                l_Array_0.forEach(l_Object_0.values(v147), v145.add, v145);
            end;
        end;
    end;
end;
return v11;


local l_Parent_0 = script.Parent.Parent.Parent;
local l_Parent_1 = l_Parent_0.Parent;
local _ = require(l_Parent_1.LuauPolyfill);
local _ = require(l_Parent_1.GraphQL);
local _ = require(l_Parent_0.utilities.graphql.types);
local _ = require(script.Parent.policies_types);
local _ = require(l_Parent_0.cache.core.types.common);
return {};


local l___DEV___0 = _G.__DEV__;
local v1 = {};
local l_Parent_0 = script.Parent.Parent.Parent;
local l_Parent_1 = l_Parent_0.Parent;
local v4 = require(l_Parent_1.LuauPolyfill);
local l_Boolean_0 = v4.Boolean;
local l_Object_0 = v4.Object;
local l_Map_0 = v4.Map;
local l_Set_0 = v4.Set;
local l_Array_0 = v4.Array;
local l_NULL_0 = require(l_Parent_0.utilities).NULL;
local l_HttpService_0 = game:GetService("HttpService");
local _ = require(l_Parent_1.GraphQL);
local v13 = require(l_Parent_0.jsutils.invariant);
local l_invariant_0 = v13.invariant;
local l_InvariantError_0 = v13.InvariantError;
local v16 = require(l_Parent_0.jsutils.equal);
local v17 = require(l_Parent_0.luaUtils.objectKeysForEach);
local v18 = require(l_Parent_0.utilities);
local l_createFragmentMap_0 = v18.createFragmentMap;
local l_getFragmentFromSelection_0 = v18.getFragmentFromSelection;
local l_getDefaultValues_0 = v18.getDefaultValues;
local l_getFragmentDefinitions_0 = v18.getFragmentDefinitions;
local l_getOperationDefinition_0 = v18.getOperationDefinition;
local l_getTypenameFromResult_0 = v18.getTypenameFromResult;
local l_makeReference_0 = v18.makeReference;
local l_isField_0 = v18.isField;
local l_resultKeyNameFromField_0 = v18.resultKeyNameFromField;
local l_isReference_0 = v18.isReference;
local l_shouldInclude_0 = v18.shouldInclude;
local l_cloneDeep_0 = v18.cloneDeep;
local l_addTypenameToDocument_0 = v18.addTypenameToDocument;
local _ = require(script.Parent.types);
local v33 = require(script.Parent.helpers);
local l_makeProcessedFieldsMerger_0 = v33.makeProcessedFieldsMerger;
local l_fieldNameFromStoreName_0 = v33.fieldNameFromStoreName;
local l_storeValueIsStoreObject_0 = v33.storeValueIsStoreObject;
local _ = require(script.Parent.entityStore);
local _ = require(script.Parent.Parent.core.types.Cache);
local l_canonicalStringify_0 = require(script.Parent["object-canon"]).canonicalStringify;
local _ = require(script.Parent.writeToStore_types);
local v41 = nil;
local v42 = nil;
local v43 = nil;
local v44 = nil;
local v45 = nil;
local v46 = {};
v46.__index = v46;
v46.new = function(v47, v48)
    local v49 = setmetatable({}, v46);
    v49.cache = v47;
    v49.reader = v48;
    return v49;
end;
v46.writeToStore = function(v50, v51, v52)
    local l_query_0 = v52.query;
    local l_result_0 = v52.result;
    local l_dataId_0 = v52.dataId;
    local l_variables_0 = v52.variables;
    local l_overwrite_0 = v52.overwrite;
    local v58 = l_getOperationDefinition_0(l_query_0);
    local v59 = l_makeProcessedFieldsMerger_0();
    l_variables_0 = l_Object_0.assign(l_getDefaultValues_0(v58), l_variables_0);
    local v62 = {
        store = v51,
        written = {},
        merge = function(v60, v61)
            return v59:merge(v60, v61);
        end,
        variables = l_variables_0,
        varString = l_canonicalStringify_0(l_variables_0),
        fragmentMap = l_createFragmentMap_0(l_getFragmentDefinitions_0(l_query_0)),
        overwrite = l_overwrite_0 or false,
        incomingById = l_Map_0.new(nil),
        clientOnly = false
    };
    local v63 = v50:processSelectionSet({
        result = l_result_0 or {},
        dataId = l_dataId_0,
        selectionSet = v58.selectionSet,
        mergeTree = {
            map = l_Map_0.new(nil)
        },
        context = v62
    });
    if not l_isReference_0(v63) then
        error(l_InvariantError_0.new(("Could not identify object %s"):format(l_HttpService_0:JSONEncode(l_result_0))));
    end;
    v62.incomingById:forEach(function(v64, v65)
        local l_fields_0 = v64.fields;
        local l_mergeTree_0 = v64.mergeTree;
        local l_selections_0 = v64.selections;
        local v69 = l_makeReference_0(v65);
        if l_mergeTree_0.map.size > 0 then
            local v70 = v50:applyMerges(l_mergeTree_0, v69, l_fields_0, v62);
            if not l_isReference_0(v70) then
                l_fields_0 = v70;
            else
                return ;
            end;
        end;
        if not (not l___DEV___0 or v62.overwrite) then
            local v71 = nil;
            do
                local l_v71_0 = v71;
                local function _(v73)
                    return l_v71_0:has(l_fieldNameFromStoreName_0(v73));
                end;
                l_v71_0 = l_Set_0.new();
                l_selections_0:forEach(function(v75)
                    if not (not l_isField_0(v75) or not v75.selectionSet) then
                        l_v71_0:add(v75.name.value);
                    end;
                end);
                local function _(v76)
                    local v77 = l_mergeTree_0.map:get(v76);
                    local v78 = false;
                    if v77 ~= nil then
                        v78 = false;
                        if v77.info ~= nil then
                            v78 = v77.info.merge ~= nil;
                        end;
                    end;
                    return v78;
                end;
                v17(l_fields_0, function(v80)
                    if l_v71_0:has(l_fieldNameFromStoreName_0(v80)) then
                        local v81 = l_mergeTree_0.map:get(v80);
                        local v82 = false;
                        if v81 ~= nil then
                            v82 = false;
                            if v81.info ~= nil then
                                v82 = v81.info.merge ~= nil;
                            end;
                        end;
                        if not v82 then
                            v41(v69, l_fields_0, v80, v62.store);
                        end;
                    end;
                end);
            end;
        end;
        v51:merge(v65, l_fields_0);
    end);
    v51:retain(v63.__ref);
    return v63;
end;
v46.processSelectionSet = function(v83, v84)
    local l_dataId_1 = v84.dataId;
    local l_result_1 = v84.result;
    local l_selectionSet_0 = v84.selectionSet;
    local l_context_0 = v84.context;
    local l_mergeTree_1 = v84.mergeTree;
    local l_policies_0 = v83.cache.policies;
    local v91, v92 = table.unpack(l_policies_0:identify(l_result_1, l_selectionSet_0, l_context_0.fragmentMap), 1, 2);
    l_dataId_1 = l_dataId_1 or v91;
    if type(l_dataId_1) == "string" then
        local v93 = nil;
        if l_context_0.written[l_dataId_1] ~= nil then
            v93 = l_context_0.written[l_dataId_1];
        else
            v93 = {};
            l_context_0.written[l_dataId_1] = v93;
        end;
        local v94 = l_makeReference_0(l_dataId_1);
        if l_Array_0.indexOf(v93, l_selectionSet_0) >= 1 then
            return v94;
        else
            table.insert(v93, l_selectionSet_0);
            if not (not (v83.reader ~= nil) or not v83.reader:isFresh(l_result_1, v94, l_selectionSet_0, l_context_0)) then
                return v94;
            end;
        end;
    end;
    local v95 = {};
    if v92 ~= nil then
        v95 = l_context_0.merge(v95, v92);
    end;
    local v96 = (l_dataId_1 and l_policies_0.rootTypenamesById[l_dataId_1] or l_getTypenameFromResult_0(l_result_1, l_selectionSet_0, l_context_0.fragmentMap)) or l_dataId_1 and l_context_0.store:get(l_dataId_1, "__typename");
    if type(v96) == "string" then
        v95.__typename = v96;
    end;
    local v97 = l_Set_0.new(l_selectionSet_0.selections);
    for _, v99 in v97, nil, nil do
        if l_shouldInclude_0(v99, l_context_0.variables) then
            if not l_isField_0(v99) then
                local v100 = l_getFragmentFromSelection_0(v99, l_context_0.fragmentMap);
                if not (not v100 or not l_policies_0:fragmentMatches(v100, v96, l_result_1, l_context_0.variables)) then
                    l_Array_0.forEach(v100.selectionSet.selections, v97.add, v97);
                end;
            else
                local v101 = l_result_1[l_resultKeyNameFromField_0(v99)];
                local l_clientOnly_0 = l_context_0.clientOnly;
                l_context_0.clientOnly = l_clientOnly_0 or v99.directives and l_Array_0.some(v99.directives, function(v103)
                    return v103.name.value == "client";
                end);
                if v101 ~= nil then
                    local v104 = l_policies_0:getStoreFieldName({
                        typename = v96,
                        fieldName = v99.name.value,
                        field = v99,
                        variables = l_context_0.variables
                    });
                    local v105 = v42(l_mergeTree_1, v104);
                    local v106 = v83:processFieldValue(v101, v99, l_context_0, v105);
                    local v107 = nil;
                    if v99.selectionSet ~= nil then
                        v107 = l_context_0.store:getFieldValue(v106, "__typename");
                        if not (v107 or not l_isReference_0(v106)) then
                            local v108 = l_context_0.incomingById:get(v106.__ref);
                            v107 = if v108 ~= nil then v108.fields.__typename else nil;
                        end;
                    end;
                    local v109 = l_policies_0:getMergeFunction(v96, v99.name.value, v107);
                    if v109 ~= nil then
                        v105.info = {
                            field = v99,
                            typename = v96,
                            merge = v109
                        };
                    else
                        v43(l_mergeTree_1, v104);
                    end;
                    v95 = l_context_0.merge(v95, {
                        [v104] = v106
                    });
                elseif not (l_context_0.clientOnly or l_addTypenameToDocument_0:added(v99)) then
                    l_invariant_0.error((string.sub(("Missing field '%s' while writing result %s"):format(l_resultKeyNameFromField_0(v99), l_HttpService_0:JSONEncode(l_result_1)), 1, 1000)));
                end;
                l_context_0.clientOnly = l_clientOnly_0;
            end;
        end;
    end;
    if type(l_dataId_1) == "string" then
        local v110 = l_context_0.incomingById:get(l_dataId_1);
        if not v110 then
            l_context_0.incomingById:set(l_dataId_1, {
                fields = v95,
                mergeTree = l_mergeTree_1,
                selections = v97
            });
        else
            v110.fields = l_context_0.merge(v110.fields, v95);
            v110.mergeTree = v44(v110.mergeTree, l_mergeTree_1);
            v110.selections:forEach(v97.add, v97);
            v110.selections = v97;
        end;
        return l_makeReference_0(l_dataId_1);
    else
        return v95;
    end;
end;
v46.processFieldValue = function(v111, v112, v113, v114, v115)
    if not v113.selectionSet or v112 == l_NULL_0 then
        if not l___DEV___0 then
            return v112;
        else
            return l_cloneDeep_0(v112);
        end;
    elseif not l_Array_0.isArray(v112) then
        return v111:processSelectionSet({
            result = v112,
            selectionSet = v113.selectionSet,
            context = v114,
            mergeTree = v115
        });
    else
        return l_Array_0.map(v112, function(v116, v117)
            local v118 = v111:processFieldValue(v116, v113, v114, v42(v115, v117));
            v43(v115, v117);
            return v118;
        end);
    end;
end;
v46.applyMerges = function(v119, v120, v121, v122, v123, v124)
    if not (not (v120.map.size > 0) or l_isReference_0(v122)) then
        local v125 = if not (not l_Array_0.isArray(v122) and (l_isReference_0(v121) or l_storeValueIsStoreObject_0(v121))) then nil else v121;
        local l_v122_0 = v122;
        if not (not (v125 ~= nil) or v124) then
            v124 = if not l_isReference_0(v125) then {
                v125
            } else {
                v125.__ref
            };
        end;
        local v127 = nil;
        local function _(v128, v129)
            if not l_Array_0.isArray(v128) then
                return v123.store:getFieldValue(v128, (tostring(v129)));
            elseif typeof(v129) == "number" then
                return v128[v129];
            else
                return nil;
            end;
        end;
        do
            local l_v127_0 = v127;
            v120.map:forEach(function(v132, v133)
                local l_v125_0 = v125;
                local v135 = if not l_Array_0.isArray(l_v125_0) then v123.store:getFieldValue(l_v125_0, (tostring(v133))) else if typeof(v133) == "number" then l_v125_0[v133] else nil;
                local l_l_v122_0_0 = l_v122_0;
                l_v125_0 = if not l_Array_0.isArray(l_l_v122_0_0) then v123.store:getFieldValue(l_l_v122_0_0, (tostring(v133))) else if typeof(v133) == "number" then l_l_v122_0_0[v133] else nil;
                if l_v125_0 == nil then
                    return ;
                else
                    if v124 ~= nil then
                        table.insert(v124, v133);
                    end;
                    l_l_v122_0_0 = v119:applyMerges(v132, v135, l_v125_0, v123, v124);
                    if l_l_v122_0_0 ~= l_v125_0 then
                        l_v127_0 = l_v127_0 or l_Map_0.new(nil);
                        l_v127_0:set(v133, l_l_v122_0_0);
                    end;
                    if v124 ~= nil then
                        l_invariant_0(table.remove(v124, #v124) == v133);
                    end;
                    return ;
                end;
            end);
            if l_v127_0 ~= nil then
                v122 = table.clone(l_v122_0);
                l_v127_0:forEach(function(v137, v138)
                    v122[v138] = v137;
                end);
            end;
        end;
    end;
    if not v120.info then
        return v122;
    else
        return v119.cache.policies:runMergeFunction(v121, v122, v120.info, v123, not not l_Boolean_0.toJSBoolean(v124) and v123.store:getStorage(table.unpack(v124)) or nil);
    end;
end;
v1.StoreWriter = v46;
local v139 = {};
v42 = function(v140, v141)
    local l_map_0 = v140.map;
    if not l_map_0:has(v141) then
        l_map_0:set(v141, table.remove(v139, #v139) or {
            map = l_Map_0.new(nil)
        });
    end;
    return (l_map_0:get(v141));
end;
v44 = function(v143, v144)
    if (v143 ~= v144 and v144 ~= nil) and not v45(v144) then
        if v143 ~= nil and not v45(v143) then
            local v145 = if not not v143.info and v144.info then l_Object_0.assign(table.clone(v143.info), v144.info) else v143.info or v144.info;
            local v146 = if v143.map.size > 0 then v144.map.size else v143.map.size;
            local v147 = {
                info = v145,
                map = if v146 > 0 then l_Map_0.new() else if v143.map.size > 0 then v143.map else v144.map
            };
            if v146 > 0 then
                local v148 = l_Set_0.new(v144.map:keys());
                v143.map:forEach(function(v149, v150)
                    v147.map:set(v150, v44(v149, v144.map:get(v150)));
                    v148:delete(v150);
                end);
                v148:forEach(function(v151)
                    v147.map:set(v151, v44(v144.map:get(v151), v143.map:get(v151)));
                end);
            end;
            return v147;
        else
            return v144;
        end;
    else
        return v143;
    end;
end;
v45 = function(v152)
    return not v152 or not (v152.info or v152.map.size > 0);
end;
v43 = function(v153, v154)
    local l_map_1 = v153.map;
    local v156 = l_map_1:get(v154);
    if not (not (v156 ~= nil) or not v45(v156)) then
        table.insert(v139, v156);
        l_map_1:delete(v154);
    end;
end;
local v157 = l_Set_0.new();
v41 = function(v158, v159, v160, v161)
    local function _(v162)
        local v163 = v161:getFieldValue(v162, v160);
        local v164 = false;
        if typeof(v163) == "table" then
            v164 = v163;
        end;
        return v164;
    end;
    local v166 = v161:getFieldValue(v158, v160);
    local v167 = false;
    if typeof(v166) == "table" then
        v167 = v166;
    end;
    if v167 then
        local v168 = v161:getFieldValue(v159, v160);
        v166 = false;
        if typeof(v168) == "table" then
            v166 = v168;
        end;
        if v166 then
            if not l_isReference_0(v167) then
                if not v16(v167, v166) then
                    if not l_Array_0.every(l_Object_0.keys(v167), function(v169)
                        return v161:getFieldValue(v166, v169) ~= nil;
                    end) then
                        v168 = v161:getFieldValue(v158, "__typename");
                        local v170 = not not l_Boolean_0.toJSBoolean(v168) and v168 or v161:getFieldValue(v159, "__typename");
                        local v171 = l_fieldNameFromStoreName_0(v160);
                        local v172 = ("%s.%s"):format(v170, v171);
                        if not v157:has(v172) then
                            v157:add(v172);
                            local v173 = {};
                            if not (l_Array_0.isArray(v167) or l_Array_0.isArray(v166)) then
                                l_Array_0.forEach({
                                    v167,
                                    v166
                                }, function(v174)
                                    local v175 = v161:getFieldValue(v174, "__typename");
                                    if not (not (typeof(v175) == "string") or l_Array_0.includes(v173, v175)) then
                                        table.insert(v173, v175);
                                    end;
                                end);
                            end;
                            l_invariant_0.warn(("Cache data may be lost when replacing the %s field of a %s object.\n\n\tTo address this problem (which is not a bug in Apollo Client), %sdefine a custom merge function for the %s field, so InMemoryCache can safely merge these objects:\n\n\t  existing: %s\n\t  incoming: %s\n\n\tFor more information about these options, please refer to the documentation:\n\n\t  * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n\t  * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n\t"):format(v171, v170, not l_Boolean_0.toJSBoolean(#v173) and "" or "either ensure all objects of type " .. l_Array_0.join(v173, " and ") .. " have an ID or a custom merge function, or ", v172, string.sub(l_HttpService_0:JSONEncode(v167), 1, 1000), (string.sub(l_HttpService_0:JSONEncode(v166), 1, 1000))));
                            return ;
                        else
                            return ;
                        end;
                    else
                        return ;
                    end;
                else
                    return ;
                end;
            else
                return ;
            end;
        else
            return ;
        end;
    else
        return ;
    end;
end;
return v1;


local l_Parent_0 = script.Parent.Parent.Parent;
local l_Parent_1 = l_Parent_0.Parent;
local _ = require(l_Parent_1.LuauPolyfill);
local _ = require(l_Parent_1.GraphQL);
local _ = require(l_Parent_0.utilities.graphql.types);
local _ = require(script.Parent.types);
return {};


local v0 = {};
local l_Parent_0 = script.Parent.Parent;
local l_Parent_1 = l_Parent_0.Parent;
local v3 = require(l_Parent_1.LuauPolyfill);
local l_Array_0 = v3.Array;
local l_Boolean_0 = v3.Boolean;
local l_Object_0 = v3.Object;
local l_setTimeout_0 = v3.setTimeout;
local v8 = require(l_Parent_1.Promise);
local _ = require(l_Parent_1.GraphQL);
local v10 = require(l_Parent_0.jsutils.invariant);
local l_invariant_0 = v10.invariant;
local l_InvariantError_0 = v10.InvariantError;
local v13 = require(script.Parent.Parent.link.core);
local l_ApolloLink_0 = v13.ApolloLink;
local l_execute_0 = v13.execute;
local _ = require(script.Parent.Parent.cache);
local l_compact_0 = require(script.Parent.Parent.utilities).compact;
local l_version_0 = require(script.Parent.Parent.version).version;
local l_HttpLink_0 = require(script.Parent.Parent.link.http).HttpLink;
local l_QueryManager_0 = require(script.Parent.QueryManager).QueryManager;
local _ = require(script.Parent.ObservableQuery_types);
local _ = require(l_Parent_0.core.types);
local _ = require(script.Parent.watchQueryOptions_types);
local _ = require(script.Parent.watchQueryOptions);
local l_LocalState_0 = require(script.Parent.LocalState).LocalState;
local _ = require(script.Parent.ApolloClient_types);
local function v29(v27, v28)
    return l_compact_0(v27, v28, not not l_Boolean_0.toJSBoolean(v28.variables) and {
        variables = l_Object_0.assign({}, v27.variables, v28.variables)
    } or v28.variables);
end;
v0.mergeOptions = v29;
local v30 = {};
v30.__index = v30;
v30.new = function(v31)
    local v32 = setmetatable({}, v30);
    v32.defaultOptions = {};
    v32.resetStoreCallbacks = {};
    v32.clearStoreCallbacks = {};
    local l_uri_0 = v31.uri;
    local l_credentials_0 = v31.credentials;
    local l_headers_0 = v31.headers;
    local l_cache_0 = v31.cache;
    local l_defaultOptions_0 = v31.defaultOptions;
    local l_resolvers_0 = v31.resolvers;
    local l_typeDefs_0 = v31.typeDefs;
    local l_fragmentMatcher_0 = v31.fragmentMatcher;
    local l_name_0 = v31.name;
    local l_version_1 = v31.version;
    local v43 = nil;
    local v44 = nil;
    local v45 = nil;
    local v46 = nil;
    local v47 = nil;
    v43 = not (v31.ssrMode == nil) and v31.ssrMode;
    v44 = v31.ssrForceFetchDelay == nil and 0 or v31.ssrForceFetchDelay;
    if v31.connectToDevTools == nil then
        local v48 = false;
        if typeof(_G) == "table" then
            v48 = not l_Boolean_0.toJSBoolean(_G.__APOLLO_CLIENT__) and _G.__DEV__;
        end;
        v45 = v48;
    else
        v45 = v31.connectToDevTools;
    end;
    v46 = v31.queryDeduplication == nil and true or v31.queryDeduplication;
    v47 = not (v31.assumeImmutableResults == nil) and v31.assumeImmutableResults;
    local l_link_0 = v31.link;
    if not l_Boolean_0.toJSBoolean(l_link_0) then
        l_link_0 = if not l_Boolean_0.toJSBoolean(l_uri_0) then l_ApolloLink_0.empty() else l_HttpLink_0.new({
            uri = l_uri_0,
            credentials = l_credentials_0,
            headers = l_headers_0
        });
    end;
    if not l_Boolean_0.toJSBoolean(l_cache_0) then
        error(l_InvariantError_0.new("To initialize Apollo Client, you must specify a 'cache' property " .. "in the options object. \n" .. "For more information, please visit: https://go.apollo.dev/c/docs"));
    end;
    v32.link = l_link_0;
    v32.cache = l_cache_0;
    v32.disableNetworkFetches = not not l_Boolean_0.toJSBoolean(v43) and v43 or v44 > 0;
    v32.queryDeduplication = v46;
    v32.defaultOptions = not not l_Boolean_0.toJSBoolean(l_defaultOptions_0) and l_defaultOptions_0 or {};
    v32.typeDefs = l_typeDefs_0;
    if l_Boolean_0.toJSBoolean(v44) then
        l_setTimeout_0(function()
            v32.disableNetworkFetches = false;
            return v32.disableNetworkFetches;
        end, v44);
    end;
    v32.version = l_version_0;
    v32.localState = l_LocalState_0.new({
        cache = l_cache_0,
        client = v32,
        resolvers = l_resolvers_0,
        fragmentMatcher = l_fragmentMatcher_0
    });
    v32.queryManager = l_QueryManager_0.new({
        cache = v32.cache,
        link = v32.link,
        queryDeduplication = v46,
        ssrMode = v43,
        clientAwareness = {
            name = l_name_0,
            version = l_version_1
        },
        localState = v32.localState,
        assumeImmutableResults = v47,
        onBroadcast = if not v45 then nil else function()
        end
    });
    return v32;
end;
v30.stop = function(v50)
    v50.queryManager:stop();
end;
v30.watchQuery = function(v51, v52)
    if l_Boolean_0.toJSBoolean(v51.defaultOptions.watchQuery) then
        v52 = v29(v51.defaultOptions.watchQuery, v52);
    end;
    if v51.disableNetworkFetches and (not (v52.fetchPolicy ~= "network-only") or v52.fetchPolicy == "cache-and-network") then
        v52 = l_Object_0.assign({}, v52, {
            fetchPolicy = "cache-first"
        });
    end;
    return v51.queryManager:watchQuery(v52);
end;
v30.query = function(v53, v54)
    if l_Boolean_0.toJSBoolean(v53.defaultOptions.query) then
        v54 = v29(v53.defaultOptions.query, v54);
    end;
    l_invariant_0(v54.fetchPolicy ~= "cache-and-network", "The cache-and-network fetchPolicy does not work with client.query, because " .. "client.query can only return a single result. Please use client.watchQuery " .. "to receive multiple results from the cache and the network, or consider " .. "using a different fetchPolicy, such as cache-first or network-only.");
    if v53.disableNetworkFetches and v54.fetchPolicy == "network-only" then
        v54 = l_Object_0.assign({}, v54, {
            fetchPolicy = "cache-first"
        });
    end;
    return v53.queryManager:query(v54);
end;
v30.mutate = function(v55, v56)
    if l_Boolean_0.toJSBoolean(v55.defaultOptions.mutate) then
        v56 = v29(v55.defaultOptions.mutate, v56);
    end;
    return v55.queryManager:mutate(v56);
end;
v30.subscribe = function(v57, v58)
    return v57.queryManager:startGraphQLSubscription(v58);
end;
v30.readQuery = function(v59, v60, v61)
    if v61 == nil then
        v61 = false;
    end;
    return v59.cache:readQuery(v60, v61);
end;
v30.readFragment = function(v62, v63, v64)
    if v64 == nil then
        v64 = false;
    end;
    return v62.cache:readFragment(v63, v64);
end;
v30.writeQuery = function(v65, v66)
    v65.cache:writeQuery(v66);
    v65.queryManager:broadcastQueries();
end;
v30.writeFragment = function(v67, v68)
    v67.cache:writeFragment(v68);
    v67.queryManager:broadcastQueries();
end;
v30.__actionHookForDevTools = function(v69, v70)
    v69.devToolsHookCb = v70;
end;
v30.__requestRaw = function(v71, v72)
    return l_execute_0(v71.link, v72);
end;
v30.resetStore = function(v73)
    return v8.delay(0):andThen(function()
        return v73.queryManager:clearStore();
    end):andThen(function()
        return v8.all(l_Array_0.map(v73.resetStoreCallbacks, function(v74)
            return v74();
        end));
    end):andThen(function()
        return v73:reFetchObservableQueries();
    end);
end;
v30.clearStore = function(v75)
    return v8.delay(0):andThen(function()
        return v75.queryManager:clearStore();
    end):andThen(function()
        return v8.all(l_Array_0.map(v75.clearStoreCallbacks, function(v76)
            return v76();
        end));
    end);
end;
v30.onResetStore = function(v77, v78)
    table.insert(v77.resetStoreCallbacks, v78);
    return function()
        v77.resetStoreCallbacks = l_Array_0.filter(v77.resetStoreCallbacks, function(v79)
            return v79 ~= v78;
        end);
    end;
end;
v30.onClearStore = function(v80, v81)
    table.insert(v80.clearStoreCallbacks, v81);
    return function()
        v80.clearStoreCallbacks = l_Array_0.filter(v80.clearStoreCallbacks, function(v82)
            return v82 ~= v81;
        end);
    end;
end;
v30.reFetchObservableQueries = function(v83, v84)
    return v83.queryManager:reFetchObservableQueries(v84);
end;
v30.refetchQueries = function(v85, v86)
    local v87 = v85.queryManager:refetchQueries(v86);
    local v88 = {};
    local v89 = {};
    v87:forEach(function(v90, v91)
        table.insert(v88, v91);
        table.insert(v89, v90);
    end);
    local v92 = v8.all(v89);
    v92.queries = v88;
    v92.results = v89;
    v92:catch(function(v93)
        l_invariant_0.debug(("In client.refetchQueries, Promise.all promise rejected with error %s"):format(v93.message));
    end);
    return v92;
end;
v30.getObservableQueries = function(v94, v95)
    if v95 == nil then
        v95 = "active";
    end;
    return v94.queryManager:getObservableQueries(v95);
end;
v30.extract = function(v96, v97)
    return v96.cache:extract(v97);
end;
v30.restore = function(v98, v99)
    return v98.cache:restore(v99);
end;
v30.addResolvers = function(v100, v101)
    v100.localState:addResolvers(v101);
end;
v30.setResolvers = function(v102, v103)
    v102.localState:setResolvers(v103);
end;
v30.getResolvers = function(v104)
    return v104.localState:getResolvers();
end;
v30.setLocalStateFragmentMatcher = function(v105, v106)
    v105.localState:setFragmentMatcher(v106);
end;
v30.setLink = function(v107, v108)
    v107.queryManager.link = v108;
    v107.link = v107.queryManager.link;
end;
v0.ApolloClient = v30;
return v0;


local l_Parent_0 = script.Parent.Parent;
local l_Parent_1 = l_Parent_0.Parent;
local _ = require(l_Parent_1.LuauPolyfill);
local _ = require(l_Parent_1.GraphQL);
local _ = require(script.Parent.Parent.link.core);
local _ = require(script.Parent.Parent.cache);
local _ = require(script.Parent.Parent.utilities);
local _ = require(script.Parent.Parent.link.http);
local _ = require(script.Parent.ObservableQuery_types);
local _ = require(l_Parent_0.core.types);
local _ = require(script.Parent.watchQueryOptions_types);
local _ = require(script.Parent.watchQueryOptions);
return {};


local l_Parent_0 = script.Parent.Parent;
local l_Parent_1 = l_Parent_0.Parent;
local v2 = require(l_Parent_1.LuauPolyfill);
local l_Array_0 = v2.Array;
local l_Object_0 = v2.Object;
local l_Boolean_0 = v2.Boolean;
local l_String_0 = v2.String;
local v7 = require(l_Parent_1.Promise);
local l_NULL_0 = require(l_Parent_0.utilities.globals.null).NULL;
local v9 = {};
local v10 = require(l_Parent_1.GraphQL);
local l_visit_0 = v10.visit;
local l_BREAK_0 = v10.BREAK;
local l_invariant_0 = require(l_Parent_0.jsutils.invariant).invariant;
local _ = require(script.Parent.Parent.cache);
local v15 = require(script.Parent.Parent.utilities);
local l_argumentsObjectFromField_0 = v15.argumentsObjectFromField;
local l_buildQueryFromSelectionSet_0 = v15.buildQueryFromSelectionSet;
local l_createFragmentMap_0 = v15.createFragmentMap;
local l_getFragmentDefinitions_0 = v15.getFragmentDefinitions;
local l_getMainDefinition_0 = v15.getMainDefinition;
local l_hasDirectives_0 = v15.hasDirectives;
local l_isField_0 = v15.isField;
local l_isInlineFragment_0 = v15.isInlineFragment;
local l_mergeDeep_0 = v15.mergeDeep;
local l_mergeDeepArray_0 = v15.mergeDeepArray;
local l_removeClientSetsFromDocument_0 = v15.removeClientSetsFromDocument;
local l_resultKeyNameFromField_0 = v15.resultKeyNameFromField;
local l_shouldInclude_0 = v15.shouldInclude;
local _ = require(script.Parent.ApolloClient_types);
local _ = require(script.Parent.types);
local _ = require(script.Parent.Parent.link.core);
local l_cacheSlot_0 = require(script.Parent.Parent.cache).cacheSlot;
local v33 = {};
v33.__index = v33;
v33.new = function(v34)
    local v35 = setmetatable({}, v33);
    local l_cache_0 = v34.cache;
    local l_client_0 = v34.client;
    local l_resolvers_0 = v34.resolvers;
    local l_fragmentMatcher_0 = v34.fragmentMatcher;
    v35.cache = l_cache_0;
    if l_client_0 ~= nil then
        v35.client = l_client_0;
    end;
    if l_resolvers_0 ~= nil then
        v35:addResolvers(l_resolvers_0);
    end;
    if l_fragmentMatcher_0 ~= nil then
        v35:setFragmentMatcher(l_fragmentMatcher_0);
    end;
    return v35;
end;
v33.addResolvers = function(v40, v41)
    v40.resolvers = not not l_Boolean_0.toJSBoolean(v40.resolvers) and v40.resolvers or {};
    if not l_Array_0.isArray(v41) then
        v40.resolvers = l_mergeDeep_0(v40.resolvers, v41);
        return ;
    else
        l_Array_0.forEach(v41, function(v42)
            v40.resolvers = l_mergeDeep_0(v40.resolvers, v42);
        end);
        return ;
    end;
end;
v33.setResolvers = function(v43, v44)
    v43.resolvers = {};
    v43:addResolvers(v44);
end;
v33.getResolvers = function(v45)
    return not not l_Boolean_0.toJSBoolean(v45.resolvers) and v45.resolvers or {};
end;
v33.runResolvers = function(v46, v47)
    local l_document_0 = v47.document;
    local l_remoteResult_0 = v47.remoteResult;
    local l_context_0 = v47.context;
    local l_variables_0 = v47.variables;
    local l_onlyRunForcedResolvers_0 = v47.onlyRunForcedResolvers;
    if v47.onlyRunForcedResolvers == nil then
        l_onlyRunForcedResolvers_0 = false;
    end;
    if not l_Boolean_0.toJSBoolean(l_document_0) then
        return v7.resolve(l_remoteResult_0);
    else
        return v46:resolveDocument(l_document_0, l_remoteResult_0.data, l_context_0, l_variables_0, v46.fragmentMatcher, l_onlyRunForcedResolvers_0):andThen(function(v53)
            return l_Object_0.assign({}, l_remoteResult_0, {
                data = v53.result
            });
        end);
    end;
end;
v33.setFragmentMatcher = function(v54, v55)
    v54.fragmentMatcher = v55;
end;
v33.getFragmentMatcher = function(v56)
    return v56.fragmentMatcher;
end;
v33.clientQuery = function(v57, v58)
    if not l_hasDirectives_0({
        "client"
    }, v58) or not l_Boolean_0.toJSBoolean(v57.resolvers) then
        return l_NULL_0;
    else
        return v58;
    end;
end;
v33.serverQuery = function(_, v60)
    return l_removeClientSetsFromDocument_0(v60);
end;
v33.prepareContext = function(v61, v62)
    local l_cache_1 = v61.cache;
    return l_Object_0.assign({}, v62, {
        cache = l_cache_1,
        getCacheKey = function(_, v65)
            return l_cache_1:identify(v65);
        end
    });
end;
v33.addExportedVariables = function(v66, v67, v68, v69)
    if v68 == nil then
        v68 = {};
    end;
    if v69 == nil then
        v69 = {};
    end;
    if not l_Boolean_0.toJSBoolean(v67) then
        return v7.resolve(l_Object_0.assign({}, v68));
    else
        local v70 = v66:buildRootValueFromCache(v67, v68);
        return v66:resolveDocument(v67, not not l_Boolean_0.toJSBoolean(v70) and v70 or {}, v66:prepareContext(v69), v68):andThen(function(v71)
            return l_Object_0.assign({}, v68, v71.exportedVariables);
        end);
    end;
end;
v33.shouldForceResolvers = function(_, v73)
    local v74 = false;
    l_visit_0(v73, {
        Directive = {
            enter = function(_, v76)
                if not (not (v76.name.value == "client") or not l_Boolean_0.toJSBoolean(v76.arguments)) then
                    v74 = l_Array_0.some(v76.arguments, function(v77)
                        local v78 = false;
                        if v77.name.value == "always" then
                            v78 = false;
                            if v77.value.kind == "BooleanValue" then
                                v78 = v77.value.value == true;
                            end;
                        end;
                        return v78;
                    end);
                    if v74 then
                        return l_BREAK_0;
                    end;
                end;
                return nil;
            end
        }
    });
    return v74;
end;
v33.buildRootValueFromCache = function(v79, v80, v81)
    return v79.cache:diff({
        query = l_buildQueryFromSelectionSet_0(v80),
        variables = v81,
        returnPartialData = true,
        optimistic = false
    }).result;
end;
v33.resolveDocument = function(v82, v83, v84, v85, v86, v87, v88)
    if v85 == nil then
        v85 = {};
    end;
    if v86 == nil then
        v86 = {};
    end;
    if v87 == nil then
        v87 = function()
            return true;
        end;
    end;
    if v88 == nil then
        v88 = false;
    end;
    local v89 = l_getMainDefinition_0(v83);
    local v90 = l_createFragmentMap_0((l_getFragmentDefinitions_0(v83)));
    local l_operation_0 = v89.operation;
    local _ = nil;
    local v93 = {
        fragmentMap = v90,
        context = l_Object_0.assign({}, v85, {
            cache = v82.cache,
            client = v82.client
        }),
        variables = v86,
        fragmentMatcher = v87,
        defaultOperationType = not l_Boolean_0.toJSBoolean(l_operation_0) and "Query" or string.upper((string.sub(l_operation_0, 1, 1))) .. l_String_0.slice(l_operation_0, 2),
        exportedVariables = {},
        onlyRunForcedResolvers = v88
    };
    return v82:resolveSelectionSet(v89.selectionSet, v84, v93):andThen(function(v94)
        return {
            result = v94,
            exportedVariables = v93.exportedVariables
        };
    end);
end;
v33.resolveSelectionSet = function(v95, v96, v97, v98)
    local l_fragmentMap_0 = v98.fragmentMap;
    local l_context_1 = v98.context;
    local l_variables_1 = v98.variables;
    local v102 = {
        v97
    };
    return v7.all(l_Array_0.map(v96.selections, function(v103)
        if l_Boolean_0.toJSBoolean(l_shouldInclude_0(v103, l_variables_1)) then
            if not l_isField_0(v103) then
                local v104 = nil;
                if not l_isInlineFragment_0(v103) then
                    v104 = l_fragmentMap_0[v103.name.value];
                    l_invariant_0(v104, ("No fragment named %s"):format(v103.name.value));
                else
                    v104 = v103;
                end;
                if not (v104 and v104.typeCondition ~= nil) or not l_Boolean_0.toJSBoolean(v98:fragmentMatcher(v97, v104.typeCondition.name.value, l_context_1)) then
                    return v7.resolve(nil);
                else
                    return v95:resolveSelectionSet(v104.selectionSet, v97, v98):andThen(function(v105)
                        table.insert(v102, v105);
                    end);
                end;
            else
                return v95:resolveField(v103, v97, v98):andThen(function(v106)
                    if typeof(v106) ~= "nil" then
                        table.insert(v102, {
                            [l_resultKeyNameFromField_0(v103)] = v106
                        });
                    end;
                end);
            end;
        else
            return v7.resolve(nil);
        end;
    end)):andThen(function()
        return l_mergeDeepArray_0(v102);
    end);
end;
v33.resolveField = function(v107, v108, v109, v110)
    local l_variables_2 = v110.variables;
    local l_value_0 = v108.name.value;
    local v113 = l_resultKeyNameFromField_0(v108);
    local v114 = l_value_0 ~= v113;
    local v115 = not not l_Boolean_0.toJSBoolean(v109[v113]) and v109[v113] or v109[l_value_0];
    local v116 = v7.resolve(v115);
    if not (v110.onlyRunForcedResolvers and not v107:shouldForceResolvers(v108)) then
        local v117 = not not l_Boolean_0.toJSBoolean(v109.__typename) and v109.__typename or v110.defaultOperationType;
        local v118 = nil;
        v118 = if not l_Boolean_0.toJSBoolean(v107.resolvers) then v107.resolvers else v107.resolvers[tostring(v117)];
        if l_Boolean_0.toJSBoolean(v118) then
            local v119 = v118[if not v114 then v113 else l_value_0];
            if l_Boolean_0.toJSBoolean(v119) then
                v116 = v7.resolve(l_cacheSlot_0:withValue(v107.cache, v119, {
                    v109,
                    l_argumentsObjectFromField_0(v108, l_variables_2),
                    v110.context,
                    {
                        field = v108,
                        fragmentMap = v110.fragmentMap
                    }
                }));
            end;
        end;
    end;
    return v116:andThen(function(v120)
        if v120 == nil then
            v120 = v115;
        end;
        if v108.directives ~= nil then
            l_Array_0.forEach(v108.directives, function(v121)
                if not (not (v121.name.value == "export") or not l_Boolean_0.toJSBoolean(v121.arguments)) then
                    l_Array_0.forEach(v121.arguments, function(v122)
                        if v122.name.value == "as" and v122.value.kind == "StringValue" then
                            v110.exportedVariables[v122.value.value] = v120;
                        end;
                    end);
                end;
            end);
        end;
        if l_Boolean_0.toJSBoolean(v108.selectionSet) then
            if not (v120 ~= nil) or v120 == l_NULL_0 then
                return v120;
            elseif not l_Array_0.isArray(v120) then
                if not l_Boolean_0.toJSBoolean(v108.selectionSet) then
                    return nil;
                else
                    return v107:resolveSelectionSet(v108.selectionSet, v120, v110);
                end;
            else
                return v107:resolveSubSelectedArray(v108, v120, v110);
            end;
        else
            return v120;
        end;
    end);
end;
v33.resolveSubSelectedArray = function(v123, v124, v125, v126)
    return v7.all(l_Array_0.map(v125, function(v127)
        if v127 == l_NULL_0 then
            return l_NULL_0;
        elseif not l_Array_0.isArray(v127) then
            if not l_Boolean_0.toJSBoolean(v124.selectionSet) then
                return nil;
            else
                return v123:resolveSelectionSet(v124.selectionSet, v127, v126);
            end;
        else
            return v123:resolveSubSelectedArray(v124, v127, v126);
        end;
    end));
end;
v9.LocalState = v33;
return v9;