import { NgClass } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
export class IconComponent {
    constructor() {
        this.icon = '';
        this.fill = 'currentColor';
        this.strokeWidth = 1.5;
        this.strokeColor = 'currentColor';
        this.size = 'base';
        this.variant = 'outline';
    }
    ngOnInit() {
        this.strokeColor = this.getFormattedColor(this.strokeColor);
        this.fill = this.getFormattedColor(this.fill);
    }
    get iconPath() {
        const icon = this.variant === 'solid' ? `${this.icon}-solid` : this.icon;
        return `/assets/images/icons.svg#${icon}`;
    }
    getFormattedColor(color) {
        if (color.startsWith('--')) {
            const rgbValue = getComputedStyle(document.documentElement).getPropertyValue(color).trim();
            return `rgb(${rgbValue})`;
        }
        return color;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: IconComponent, isStandalone: true, selector: "ct-icon", inputs: { icon: "icon", fill: "fill", strokeWidth: "strokeWidth", strokeColor: "strokeColor", size: "size", variant: "variant" }, ngImport: i0, template: "<svg\n  [attr.fill]=\"variant === 'solid' ? fill : 'none'\"\n  [attr.stroke-width]=\"variant === 'outline' ? strokeWidth : 0\"\n  [attr.stroke]=\"strokeColor\"\n  class=\"flex\"\n  [class.size-3]=\"size === 'xs'\"\n  [class.size-4]=\"size === 'sm'\"\n  [class.size-5]=\"size === 'base'\"\n  [class.size-6]=\"size === 'lg'\"\n  [class.size-8]=\"size === 'xl'\"\n  [class.size-10]=\"size === '2xl'\"\n  [class.size-20]=\"size === '3xl'\">\n  <use [attr.xlink:href]=\"iconPath\"></use>\n</svg>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: IconComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ct-icon', standalone: true, imports: [NgClass], changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg\n  [attr.fill]=\"variant === 'solid' ? fill : 'none'\"\n  [attr.stroke-width]=\"variant === 'outline' ? strokeWidth : 0\"\n  [attr.stroke]=\"strokeColor\"\n  class=\"flex\"\n  [class.size-3]=\"size === 'xs'\"\n  [class.size-4]=\"size === 'sm'\"\n  [class.size-5]=\"size === 'base'\"\n  [class.size-6]=\"size === 'lg'\"\n  [class.size-8]=\"size === 'xl'\"\n  [class.size-10]=\"size === '2xl'\"\n  [class.size-20]=\"size === '3xl'\">\n  <use [attr.xlink:href]=\"iconPath\"></use>\n</svg>\n" }]
        }], propDecorators: { icon: [{
                type: Input
            }], fill: [{
                type: Input
            }], strokeWidth: [{
                type: Input
            }], strokeColor: [{
                type: Input
            }], size: [{
                type: Input
            }], variant: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,[encoded data, 4340 characters]