// (C) 2021-2025 GoodData Corporation
import { BucketNames } from "@gooddata/sdk-ui";
import { PluggableXirr } from "./PluggableXirr.js";
import { executionConfigInsightConversion, filtersInsightConversion, getInsightToPropsConverter, getReactEmbeddingCodeGenerator, localeInsightConversion, singleAttributeBucketConversion, singleMeasureBucketConversion, } from "../../../utils/embeddingCodeGenerator/index.js";
import { MAX_VISUALIZATION_HEIGHT } from "../constants.js";
export class XirrDescriptor {
    getFactory() {
        return (params) => new PluggableXirr(params);
    }
    getSizeInfo(_insight, layoutDescriptor, _settings) {
        return {
            width: {
                default: 2,
                min: 2,
                max: layoutDescriptor.gridColumnsCount,
            },
            height: {
                default: this.getDefaultHeight(),
                min: this.getMinHeight(),
                max: this.getMaxHeight(),
            },
        };
    }
    getDefaultHeight() {
        return 8;
    }
    getMinHeight() {
        return 6;
    }
    getMaxHeight() {
        return MAX_VISUALIZATION_HEIGHT;
    }
    applyDrillDown(insight) {
        return insight;
    }
    getEmbeddingCode = getReactEmbeddingCodeGenerator({
        component: {
            importType: "named",
            name: "Xirr",
            package: "@gooddata/sdk-ui-charts",
        },
        insightToProps: getInsightToPropsConverter({
            measure: singleMeasureBucketConversion("measure", BucketNames.MEASURES),
            attribute: singleAttributeBucketConversion("attribute", BucketNames.ATTRIBUTE),
            filters: filtersInsightConversion("filters"),
            locale: localeInsightConversion("locale"),
            execConfig: executionConfigInsightConversion("execConfig"),
        }),
    });
    getMeta() {
        return {
            supportsExport: false,
            supportsZooming: false,
        };
    }
}
//# sourceMappingURL=XirrDescriptor.js.map