var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { MelodicComponent } from '@melodicdev/core';
import { getColorForExtension } from './file-upload.types.js';
import { fileIconTemplate } from './file-icon.template.js';
import { fileIconStyles } from './file-icon.styles.js';
let FileIconComponent = class FileIconComponent {
    constructor() {
        this.extension = '';
        this.color = '';
        this.size = 'md';
    }
    get resolvedColor() {
        if (this.color)
            return this.color;
        return this.extension ? getColorForExtension(this.extension) : 'gray';
    }
    get displayExtension() {
        return this.extension.toUpperCase();
    }
};
FileIconComponent = __decorate([
    MelodicComponent({
        selector: 'ml-file-icon',
        template: fileIconTemplate,
        styles: fileIconStyles,
        attributes: ['extension', 'color', 'size']
    })
], FileIconComponent);
export { FileIconComponent };
