/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { makeCodecFamily, } from "../../codec/index.js";
import { TreeCompressionStrategy } from "../treeCompressionUtils.js";
import { makeModularChangeCodecV1 } from "./modularChangeCodecV1.js";
import { makeModularChangeCodecV2 } from "./modularChangeCodecV2.js";
export function makeModularChangeCodecFamily(fieldKindConfigurations, revisionTagCodec, fieldsCodec, codecOptions, chunkCompressionStrategy = TreeCompressionStrategy.Compressed) {
    return makeCodecFamily(Array.from(fieldKindConfigurations.entries(), ([version, fieldKinds]) => [
        version,
        makeModularChangeCodec(version, fieldKinds, revisionTagCodec, fieldsCodec, codecOptions, chunkCompressionStrategy),
    ]));
}
const minVersionForCodec2 = 101;
function makeModularChangeCodec(version, fieldKinds, revisionTagCodec, fieldsCodec, codecOptions, chunkCompressionStrategy = TreeCompressionStrategy.Compressed) {
    if (version < minVersionForCodec2) {
        return makeModularChangeCodecV1(fieldKinds, revisionTagCodec, fieldsCodec, codecOptions, chunkCompressionStrategy);
    }
    return makeModularChangeCodecV2(fieldKinds, revisionTagCodec, fieldsCodec, codecOptions, chunkCompressionStrategy);
}
//# sourceMappingURL=modularChangeCodecs.js.map