"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ColumnFaceting = void 0;
//
exports.ColumnFaceting = {
    createColumn: (column, table) => {
        column._getFacetedRowModel =
            table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, column.id);
        column.getFacetedRowModel = () => {
            if (!column._getFacetedRowModel) {
                return table.getPreFilteredRowModel();
            }
            return column._getFacetedRowModel();
        };
        column._getFacetedUniqueValues =
            table.options.getFacetedUniqueValues &&
                table.options.getFacetedUniqueValues(table, column.id);
        column.getFacetedUniqueValues = () => {
            if (!column._getFacetedUniqueValues) {
                return new Map();
            }
            return column._getFacetedUniqueValues();
        };
        column._getFacetedMinMaxValues =
            table.options.getFacetedMinMaxValues &&
                table.options.getFacetedMinMaxValues(table, column.id);
        column.getFacetedMinMaxValues = () => {
            if (!column._getFacetedMinMaxValues) {
                return undefined;
            }
            return column._getFacetedMinMaxValues();
        };
    },
};
