"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.getForestRootSummaryContentKey = exports.minVersionToForestSummaryFormatVersion = void 0;
const internal_1 = require("@fluidframework/runtime-utils/internal");
const index_js_1 = require("../../codec/index.js");
const summaryFormatCommon_js_1 = require("./summaryFormatCommon.js");
const summaryFormatV1ToV2_js_1 = require("./summaryFormatV1ToV2.js");
const summaryFormatV3_js_1 = require("./summaryFormatV3.js");
/**
 * Returns the summary format version to use as per the given minimum version for collab.
 */
function minVersionToForestSummaryFormatVersion(version) {
    return (0, internal_1.getConfigForMinVersionForCollab)(version, {
        [internal_1.lowestMinVersionForCollab]: summaryFormatCommon_js_1.ForestSummaryFormatVersion.v2,
        [index_js_1.FluidClientVersion.v2_74]: summaryFormatCommon_js_1.ForestSummaryFormatVersion.v3,
    });
}
exports.minVersionToForestSummaryFormatVersion = minVersionToForestSummaryFormatVersion;
/**
 * Gets the key for the blob containing the forest summary root content based on the summary format version.
 * @param summaryFormatVersion - The version of the forest summary format.
 * @returns The key for the forest summary root content blob.
 */
function getForestRootSummaryContentKey(summaryFormatVersion) {
    return summaryFormatVersion === undefined ||
        summaryFormatVersion < summaryFormatCommon_js_1.ForestSummaryFormatVersion.v3
        ? summaryFormatV1ToV2_js_1.summaryContentBlobKey
        : summaryFormatV3_js_1.summaryContentBlobKey;
}
exports.getForestRootSummaryContentKey = getForestRootSummaryContentKey;
//# sourceMappingURL=summaryTypes.js.map