import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { AlertComponent } from '../../components/atoms/alert/alert.component';
import { KeyValuePipe } from '@angular/common';
import { IconComponent } from '../../components/atoms/icon/icon.component';
import * as i0 from "@angular/core";
export class FormErrorComponent {
    constructor() {
        this.size = 'base';
        this.hasErrors = false;
        this.fullSize = false;
        this.helper = '';
        this.errorMessages = {};
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: FormErrorComponent, isStandalone: true, selector: "ct-form-alert", inputs: { errors: "errors", size: "size", hasErrors: "hasErrors", fullSize: "fullSize", helper: "helper", errorMessages: "errorMessages" }, ngImport: i0, template: "<div\n  class=\"flex min-h-4 flex-col justify-between gap-1 font-primary text-xs transition-opacity duration-500 ease-in-out sm:flex-row sm:items-center\"\n  [class.w-full]=\"fullSize\"\n  [class.w-fit]=\"!fullSize\"\n  [class.opacity-0]=\"!hasErrors\"\n  [class.opacity-100]=\"hasErrors\">\n  @if (hasErrors) {\n    <div class=\"flex flex-row items-center gap-1 text-error dark:text-error-variant-dark\">\n      <ct-icon icon=\"exclamation-triangle\" size=\"sm\" />\n      @for (error of errors | keyvalue; track error; let isLast = $last) {\n        <span class=\"after:mx-1 after:inline-block after:content-[','] last:after:content-none\">{{\n          errorMessages[error.key] ? errorMessages[error.key] : error.key\n        }}</span>\n      }\n    </div>\n    @if (helper) {\n      <span>{{ helper }}</span>\n    }\n  }\n</div>\n", dependencies: [{ kind: "pipe", type: KeyValuePipe, name: "keyvalue" }, { kind: "component", type: IconComponent, selector: "ct-icon", inputs: ["icon", "fill", "strokeWidth", "strokeColor", "size", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormErrorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ct-form-alert', standalone: true, imports: [AlertComponent, KeyValuePipe, IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n  class=\"flex min-h-4 flex-col justify-between gap-1 font-primary text-xs transition-opacity duration-500 ease-in-out sm:flex-row sm:items-center\"\n  [class.w-full]=\"fullSize\"\n  [class.w-fit]=\"!fullSize\"\n  [class.opacity-0]=\"!hasErrors\"\n  [class.opacity-100]=\"hasErrors\">\n  @if (hasErrors) {\n    <div class=\"flex flex-row items-center gap-1 text-error dark:text-error-variant-dark\">\n      <ct-icon icon=\"exclamation-triangle\" size=\"sm\" />\n      @for (error of errors | keyvalue; track error; let isLast = $last) {\n        <span class=\"after:mx-1 after:inline-block after:content-[','] last:after:content-none\">{{\n          errorMessages[error.key] ? errorMessages[error.key] : error.key\n        }}</span>\n      }\n    </div>\n    @if (helper) {\n      <span>{{ helper }}</span>\n    }\n  }\n</div>\n" }]
        }], propDecorators: { errors: [{
                type: Input,
                args: [{ required: true }]
            }], size: [{
                type: Input
            }], hasErrors: [{
                type: Input
            }], fullSize: [{
                type: Input
            }], helper: [{
                type: Input
            }], errorMessages: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3IuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2lyY2xldG9uZS9zcmMvbGliL2Zvcm1zL2Vycm9yL2Vycm9yLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NpcmNsZXRvbmUvc3JjL2xpYi9mb3Jtcy9lcnJvci9lcnJvci5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsU0FBUyxFQU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