import * as i0 from '@angular/core';
import { Component, inject, Injectable } from '@angular/core';
import * as i1 from 'primeng/toast';
import { ToastModule } from 'primeng/toast';
import { TranslocoService } from '@jsverse/transloco';
import { MessageService } from 'primeng/api';

class Toast {
    toastPosition = 'bottom-right';
    toastTransX = 'translateX(100%)';
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Toast, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: Toast, isStandalone: true, selector: "mt-toast", ngImport: i0, template: "<p-toast [position]=\"toastPosition\" [showTransformOptions]=\"toastTransX\">\r\n  <!-- <ng-template let-message #headless let-closeFn=\"closeFn\"> -->\r\n  <!--   <div> -->\r\n  <!--     <div class=\"flex justify-between p-3\"> -->\r\n  <!--       <h6> -->\r\n  <!--         {{ message.summary }} -->\r\n  <!--       </h6> -->\r\n  <!--       <mt-button -->\r\n  <!--         size=\"small\" -->\r\n  <!--         icon=\"general.x\" -->\r\n  <!--         severity=\"secondary\" -->\r\n  <!--         text -->\r\n  <!--         (onClick)=\"closeFn()\" -->\r\n  <!--       /> -->\r\n  <!--     </div> -->\r\n  <!--   </div> -->\r\n  <!-- </ng-template> -->\r\n</p-toast>\r\n", dependencies: [{ kind: "ngmodule", type: ToastModule }, { kind: "component", type: i1.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "motionOptions", "breakpoints"], outputs: ["onClose"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Toast, decorators: [{
            type: Component,
            args: [{ standalone: true, imports: [ToastModule], selector: 'mt-toast', template: "<p-toast [position]=\"toastPosition\" [showTransformOptions]=\"toastTransX\">\r\n  <!-- <ng-template let-message #headless let-closeFn=\"closeFn\"> -->\r\n  <!--   <div> -->\r\n  <!--     <div class=\"flex justify-between p-3\"> -->\r\n  <!--       <h6> -->\r\n  <!--         {{ message.summary }} -->\r\n  <!--       </h6> -->\r\n  <!--       <mt-button -->\r\n  <!--         size=\"small\" -->\r\n  <!--         icon=\"general.x\" -->\r\n  <!--         severity=\"secondary\" -->\r\n  <!--         text -->\r\n  <!--         (onClick)=\"closeFn()\" -->\r\n  <!--       /> -->\r\n  <!--     </div> -->\r\n  <!--   </div> -->\r\n  <!-- </ng-template> -->\r\n</p-toast>\r\n" }]
        }] });

class ToastService {
    messageService = inject(MessageService);
    translocoService = inject(TranslocoService);
    add(message) {
        this.messageService.add(message);
    }
    addAll(messages) {
        this.messageService.addAll(messages);
    }
    clear(key) {
        this.messageService.clear(key);
    }
    success(detail = '', summary) {
        this.messageService.add({
            severity: 'success',
            summary: summary ?? this.translocoService.translate('components.toast.success'),
            detail,
        });
    }
    warn(detail = '', summary) {
        this.messageService.add({
            severity: 'warn',
            summary: summary ?? this.translocoService.translate('components.toast.warning'),
            detail,
        });
    }
    error(detail = '', summary) {
        this.messageService.add({
            severity: 'error',
            summary: summary ?? this.translocoService.translate('components.toast.error'),
            detail,
        });
    }
    info(detail = '', summary) {
        this.messageService.add({
            severity: 'info',
            summary: summary ?? this.translocoService.translate('components.toast.info'),
            detail,
        });
    }
    secondary(detail = '', summary = '') {
        this.messageService.add({ severity: 'secondary', summary, detail });
    }
    contrast(detail = '', summary = '') {
        this.messageService.add({ severity: 'contrast', summary, detail });
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
    static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ToastService, providedIn: 'root' });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ToastService, decorators: [{
            type: Injectable,
            args: [{
                    providedIn: 'root',
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { Toast, ToastService };
//# sourceMappingURL=masterteam-components-toast.mjs.map
