import { split, path } from 'ramda';
import { isAttributeSearchUri } from '@reltio/mdm-sdk';
export var REFERENCE_HEIGHT = 28;
export var BLOB_HEIGHT = 100;
export var IMAGE_HEIGHT = 76;
var PADDING = 17;
export var getAttributeHeight = function (_a) {
    var columnData = _a.columnData, cell = _a.cell;
    var countAttributes = cell.values.length;
    var defaultHeight = 28 * Math.max(countAttributes, 1) + 20;
    if (!countAttributes) {
        return defaultHeight;
    }
    switch (path(['dataTypeDefinition', 'type'], columnData)) {
        case 'Reference':
            return REFERENCE_HEIGHT * countAttributes + PADDING;
        case 'Blob':
            return BLOB_HEIGHT * countAttributes;
        case 'Image':
            return IMAGE_HEIGHT * countAttributes + PADDING;
        default:
            return defaultHeight;
    }
};
export var getAttrPathFromColumnId = split('.');
export var getNestedPathByColumnId = function (columnId) {
    if (isAttributeSearchUri(columnId)) {
        var _a = getAttrPathFromColumnId(columnId), attrPath = _a.slice(1);
        return attrPath.length > 1 ? attrPath.slice(0, -1) : null;
    }
    else {
        return null;
    }
};
