import * as i0 from '@angular/core';
import { inject, ElementRef, input, signal, computed, afterNextRender, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
import { TranslatePipe } from '@ngx-translate/core';
import { ZIconComponent } from '@shival99/z-ui/components/z-icon';
import { zTransform, zMergeClasses } from '@shival99/z-ui/utils';
import { cva } from 'class-variance-authority';

const zButtonVariants = cva("cursor-pointer relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm font-[450] select-none transition-[background-color,border-color,color,box-shadow,opacity] duration-200 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
    variants: {
        zType: {
            default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 [--z-wave-color:var(--color-primary)]',
            primary: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 [--z-wave-color:var(--color-primary)]',
            secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80 [--z-wave-color:var(--color-secondary-foreground)]',
            destructive: 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 [--z-wave-color:var(--color-destructive)]',
            'destructive-heartbeat': 'z-button-heartbeat bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 [--z-wave-color:var(--color-destructive)]',
            success: 'bg-green-600 text-white shadow-xs hover:bg-green-700 focus-visible:ring-green-500/20 dark:bg-green-600 dark:hover:bg-green-700 [--z-wave-color:var(--color-green-600)]',
            info: 'bg-blue-600 text-white shadow-xs hover:bg-blue-700 focus-visible:ring-blue-500/20 dark:bg-blue-600 dark:hover:bg-blue-700 [--z-wave-color:var(--color-blue-600)]',
            warning: 'bg-amber-500 text-white shadow-xs hover:bg-amber-600 focus-visible:ring-amber-500/20 dark:bg-amber-500 dark:hover:bg-amber-600 [--z-wave-color:var(--color-amber-500)]',
            error: 'bg-red-600 text-white shadow-xs hover:bg-red-700 focus-visible:ring-red-500/20 dark:bg-red-600 dark:hover:bg-red-700 [--z-wave-color:var(--color-red-600)]',
            outline: 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 [--z-wave-color:var(--color-foreground)]',
            'outline-primary': 'border border-primary text-primary bg-transparent shadow-xs hover:bg-primary hover:text-primary-foreground focus-visible:ring-primary/20 [--z-wave-color:var(--color-primary)]',
            'outline-secondary': 'border border-secondary-foreground/20 text-secondary-foreground bg-transparent shadow-xs hover:bg-secondary hover:text-secondary-foreground focus-visible:ring-secondary/20 [--z-wave-color:var(--color-secondary-foreground)]',
            'outline-success': 'border border-green-600 text-green-600 bg-transparent shadow-xs hover:bg-green-600 hover:text-white focus-visible:ring-green-500/20 dark:border-green-500 dark:text-green-500 dark:hover:bg-green-600 [--z-wave-color:var(--color-green-600)]',
            'outline-info': 'border border-blue-600 text-blue-600 bg-transparent shadow-xs hover:bg-blue-600 hover:text-white focus-visible:ring-blue-500/20 dark:border-blue-500 dark:text-blue-500 dark:hover:bg-blue-600 [--z-wave-color:var(--color-blue-600)]',
            'outline-warning': 'border border-amber-500 text-amber-600 bg-transparent shadow-xs hover:bg-amber-500 hover:text-white focus-visible:ring-amber-500/20 dark:border-amber-400 dark:text-amber-400 dark:hover:bg-amber-500 [--z-wave-color:var(--color-amber-500)]',
            'outline-error': 'border border-red-600 text-red-600 bg-transparent shadow-xs hover:bg-red-600 hover:text-white focus-visible:ring-red-500/20 dark:border-red-500 dark:text-red-500 dark:hover:bg-red-600 [--z-wave-color:var(--color-red-600)]',
            'outline-destructive': 'border border-destructive text-destructive bg-transparent shadow-xs hover:bg-destructive hover:text-white focus-visible:ring-destructive/20 [--z-wave-color:var(--color-destructive)]',
            'outline-shimmer': 'z-button-shimmer border border-transparent bg-background text-foreground shadow-xs hover:bg-background dark:bg-background dark:hover:bg-background [--z-wave-color:var(--color-primary)]',
            'outline-success-secondary': 'border bg-background shadow-xs hover:bg-green-600/10 hover:text-green-600 hover:border-green-600 dark:bg-input/30 dark:border-input dark:hover:bg-green-500/20 dark:hover:text-green-500 dark:hover:border-green-500 [--z-wave-color:var(--color-green-600)]',
            'outline-info-secondary': 'border bg-background shadow-xs hover:bg-blue-600/10 hover:text-blue-600 hover:border-blue-600 dark:bg-input/30 dark:border-input dark:hover:bg-blue-500/20 dark:hover:text-blue-500 dark:hover:border-blue-500 [--z-wave-color:var(--color-blue-600)]',
            'outline-warning-secondary': 'border bg-background shadow-xs hover:bg-amber-500/10 hover:text-amber-600 hover:border-amber-500 dark:bg-input/30 dark:border-input dark:hover:bg-amber-400/20 dark:hover:text-amber-400 dark:hover:border-amber-400 [--z-wave-color:var(--color-amber-500)]',
            'outline-error-secondary': 'border bg-background shadow-xs hover:bg-red-600/10 hover:text-red-600 hover:border-red-600 dark:bg-input/30 dark:border-input dark:hover:bg-red-500/20 dark:hover:text-red-500 dark:hover:border-red-500 [--z-wave-color:var(--color-red-600)]',
            'outline-destructive-secondary': 'border bg-background shadow-xs hover:bg-destructive/10 hover:text-destructive hover:border-destructive dark:bg-input/30 dark:border-input dark:hover:bg-destructive/20 dark:hover:border-destructive [--z-wave-color:var(--color-destructive)]',
            'outline-primary-secondary': 'border bg-background shadow-xs hover:bg-primary/10 hover:text-primary hover:border-primary dark:bg-input/30 dark:border-input dark:hover:bg-primary/20 dark:hover:border-primary [--z-wave-color:var(--color-primary)]',
            'outline-primary-soft': 'border bg-background text-primary shadow-xs hover:bg-primary/10 hover:border-primary dark:bg-input/30 dark:border-input dark:hover:bg-primary/20 dark:hover:border-primary [--z-wave-color:var(--color-primary)]',
            'outline-success-soft': 'border bg-background text-green-600 shadow-xs hover:bg-green-600/10 hover:border-green-600 dark:bg-input/30 dark:border-input dark:text-green-500 dark:hover:bg-green-500/20 dark:hover:border-green-500 [--z-wave-color:var(--color-green-600)]',
            'outline-info-soft': 'border bg-background text-blue-600 shadow-xs hover:bg-blue-600/10 hover:border-blue-600 dark:bg-input/30 dark:border-input dark:text-blue-500 dark:hover:bg-blue-500/20 dark:hover:border-blue-500 [--z-wave-color:var(--color-blue-600)]',
            'outline-warning-soft': 'border bg-background text-amber-600 shadow-xs hover:bg-amber-500/10 hover:border-amber-500 dark:bg-input/30 dark:border-input dark:text-amber-400 dark:hover:bg-amber-400/20 dark:hover:border-amber-400 [--z-wave-color:var(--color-amber-500)]',
            'outline-error-soft': 'border bg-background text-red-600 shadow-xs hover:bg-red-600/10 hover:border-red-600 dark:bg-input/30 dark:border-input dark:text-red-500 dark:hover:bg-red-500/20 dark:hover:border-red-500 [--z-wave-color:var(--color-red-600)]',
            'outline-destructive-soft': 'border bg-background text-destructive shadow-xs hover:bg-destructive/10 hover:border-destructive dark:bg-input/30 dark:border-input dark:hover:bg-destructive/20 dark:hover:border-destructive [--z-wave-color:var(--color-destructive)]',
            'outline-primary-soft-border': 'border border-primary! bg-background text-primary shadow-xs hover:bg-primary/10 dark:bg-input/30 dark:hover:bg-primary/20 [--z-wave-color:var(--color-primary)]',
            'outline-success-soft-border': 'border border-green-600! bg-background text-green-600 shadow-xs hover:bg-green-600/10 dark:bg-input/30 dark:border-green-500! dark:text-green-500 dark:hover:bg-green-500/20 [--z-wave-color:var(--color-green-600)]',
            'outline-info-soft-border': 'border border-blue-600! bg-background text-blue-600 shadow-xs hover:bg-blue-600/10 dark:bg-input/30 dark:border-blue-500! dark:text-blue-500 dark:hover:bg-blue-500/20 [--z-wave-color:var(--color-blue-600)]',
            'outline-warning-soft-border': 'border border-amber-500! bg-background text-amber-600 shadow-xs hover:bg-amber-500/10 dark:bg-input/30 dark:border-amber-400! dark:text-amber-400 dark:hover:bg-amber-400/20 [--z-wave-color:var(--color-amber-500)]',
            'outline-error-soft-border': 'border border-red-600! bg-background text-red-600 shadow-xs hover:bg-red-600/10 dark:bg-input/30 dark:border-red-500! dark:text-red-500 dark:hover:bg-red-500/20 [--z-wave-color:var(--color-red-600)]',
            'outline-destructive-soft-border': 'border border-destructive! bg-background text-destructive shadow-xs hover:bg-destructive/10 dark:bg-input/30 dark:hover:bg-destructive/20 [--z-wave-color:var(--color-destructive)]',
            ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 [--z-wave-color:var(--color-foreground)]',
            'ghost-primary': 'text-primary hover:bg-primary/10 dark:hover:bg-primary/20 [--z-wave-color:var(--color-primary)]',
            'ghost-success': 'text-green-600 hover:bg-green-600/10 dark:text-green-500 dark:hover:bg-green-500/20 [--z-wave-color:var(--color-green-600)]',
            'ghost-info': 'text-blue-600 hover:bg-blue-600/10 dark:text-blue-500 dark:hover:bg-blue-500/20 [--z-wave-color:var(--color-blue-600)]',
            'ghost-warning': 'text-amber-600 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:bg-amber-400/20 [--z-wave-color:var(--color-amber-500)]',
            'ghost-error': 'text-red-600 hover:bg-red-600/10 dark:text-red-500 dark:hover:bg-red-500/20 [--z-wave-color:var(--color-red-600)]',
            'ghost-destructive': 'text-destructive hover:bg-destructive/10 dark:hover:bg-destructive/20 [--z-wave-color:var(--color-destructive)]',
            subtle: 'bg-accent text-accent-foreground shadow-xs hover:bg-accent/80 dark:bg-accent/50 dark:hover:bg-accent/70 [--z-wave-color:var(--color-foreground)]',
            'subtle-primary': 'bg-primary/10 text-primary shadow-xs hover:bg-primary/20 dark:bg-primary/15 dark:text-primary dark:hover:bg-primary/25 [--z-wave-color:var(--color-primary)]',
            'subtle-success': 'bg-green-600/10 text-green-600 shadow-xs hover:bg-green-600/20 dark:bg-green-500/10 dark:text-green-500 dark:hover:bg-green-500/20 [--z-wave-color:var(--color-green-600)]',
            'subtle-info': 'bg-blue-600/10 text-blue-600 shadow-xs hover:bg-blue-600/20 dark:bg-blue-500/10 dark:text-blue-500 dark:hover:bg-blue-500/20 [--z-wave-color:var(--color-blue-600)]',
            'subtle-warning': 'bg-amber-500/10 text-amber-600 shadow-xs hover:bg-amber-500/20 dark:bg-amber-400/10 dark:text-amber-400 dark:hover:bg-amber-400/20 [--z-wave-color:var(--color-amber-500)]',
            'subtle-destructive': 'bg-destructive/10 text-destructive shadow-xs hover:bg-destructive/20 dark:bg-destructive/15 dark:text-destructive-foreground dark:hover:bg-destructive/25 [--z-wave-color:var(--color-destructive)]',
            'subtle-outline': 'border border-border bg-accent text-accent-foreground shadow-xs hover:bg-accent/80 dark:border-input dark:bg-accent/50 dark:hover:bg-accent/70 [--z-wave-color:var(--color-foreground)]',
            'subtle-primary-outline': 'border border-border bg-primary/10 text-primary shadow-xs hover:bg-primary/20 dark:border-input dark:bg-primary/15 dark:text-primary dark:hover:bg-primary/25 [--z-wave-color:var(--color-primary)]',
            'subtle-success-outline': 'border border-border bg-green-600/10 text-green-600 shadow-xs hover:bg-green-600/20 dark:border-input dark:bg-green-500/10 dark:text-green-500 dark:hover:bg-green-500/20 [--z-wave-color:var(--color-green-600)]',
            'subtle-info-outline': 'border border-border bg-blue-600/10 text-blue-600 shadow-xs hover:bg-blue-600/20 dark:border-input dark:bg-blue-500/10 dark:text-blue-500 dark:hover:bg-blue-500/20 [--z-wave-color:var(--color-blue-600)]',
            'subtle-warning-outline': 'border border-border bg-amber-500/10 text-amber-600 shadow-xs hover:bg-amber-500/20 dark:border-input dark:bg-amber-400/10 dark:text-amber-400 dark:hover:bg-amber-400/20 [--z-wave-color:var(--color-amber-500)]',
            'subtle-destructive-outline': 'border border-border bg-destructive/10 text-destructive shadow-xs hover:bg-destructive/20 dark:border-input dark:bg-destructive/15 dark:text-destructive-foreground dark:hover:bg-destructive/25 [--z-wave-color:var(--color-destructive)]',
            link: 'text-primary underline-offset-4 hover:underline',
        },
        zSize: {
            default: 'h-9 px-3 py-2 [&[data-icon-only]]:size-9 [&[data-icon-only]]:p-0',
            xs: 'h-7 px-3 py-1 [&[data-icon-only]]:size-7 [&[data-icon-only]]:p-0',
            sm: 'h-8 rounded-sm gap-1.5 px-3 [&[data-icon-only]]:size-8 [&[data-icon-only]]:p-0',
            lg: 'h-10 rounded-sm px-3 [&[data-icon-only]]:size-10 [&[data-icon-only]]:p-0',
            xl: 'h-12 rounded-sm px-3 text-base [&[data-icon-only]]:size-12 [&[data-icon-only]]:p-0',
        },
        zShape: {
            default: 'rounded-sm',
            circle: 'rounded-full',
            square: 'rounded-none',
        },
        zLoading: {
            true: 'opacity-50 pointer-events-none',
        },
        zDisabled: {
            true: 'opacity-50 pointer-events-none',
        },
    },
    defaultVariants: {
        zType: 'default',
        zSize: 'default',
        zShape: 'default',
    },
});

class ZButtonComponent {
    _elementRef = inject((ElementRef));
    class = input('', ...(ngDevMode ? [{ debugName: "class" }] : []));
    zType = input('default', ...(ngDevMode ? [{ debugName: "zType" }] : []));
    zSize = input('default', ...(ngDevMode ? [{ debugName: "zSize" }] : []));
    zShape = input('default', ...(ngDevMode ? [{ debugName: "zShape" }] : []));
    zLabel = input('', ...(ngDevMode ? [{ debugName: "zLabel" }] : []));
    zLoading = input(false, { ...(ngDevMode ? { debugName: "zLoading" } : {}), transform: zTransform });
    zDisabled = input(false, ...(ngDevMode ? [{ debugName: "zDisabled" }] : []));
    zTypeIcon = input(undefined, ...(ngDevMode ? [{ debugName: "zTypeIcon" }] : []));
    zAnimatedTypeIcon = input(undefined, ...(ngDevMode ? [{ debugName: "zAnimatedTypeIcon" }] : []));
    zAnimateIcon = input(false, { ...(ngDevMode ? { debugName: "zAnimateIcon" } : {}), transform: zTransform });
    zAnimationTriggerIcon = input('manual', ...(ngDevMode ? [{ debugName: "zAnimationTriggerIcon" }] : []));
    zSizeIcon = input('20', ...(ngDevMode ? [{ debugName: "zSizeIcon" }] : []));
    zStrokeWidthIcon = input(2, ...(ngDevMode ? [{ debugName: "zStrokeWidthIcon" }] : []));
    zWave = input(true, { ...(ngDevMode ? { debugName: "zWave" } : {}), transform: zTransform });
    _zIconOnlyState = signal(false, ...(ngDevMode ? [{ debugName: "_zIconOnlyState" }] : []));
    _mutationObserver = null;
    zIconOnly = this._zIconOnlyState.asReadonly();
    zClasses = computed(() => zMergeClasses(zButtonVariants({
        zType: this.zType(),
        zSize: this.zSize(),
        zShape: this.zShape(),
        zLoading: this.zLoading(),
        zDisabled: this.zDisabled(),
    }), this.class()), ...(ngDevMode ? [{ debugName: "zClasses" }] : []));
    constructor() {
        afterNextRender(() => {
            const check = () => {
                const el = this._elementRef.nativeElement;
                const hasIcon = el.querySelector('z-icon, [z-icon]') !== null;
                const children = Array.from(el.childNodes);
                const hasText = children.some(node => {
                    if (node.nodeType === 3) {
                        return node.textContent?.trim() !== '';
                    }
                    if (node.nodeType === 1) {
                        const element = node;
                        if (element.matches('z-icon, [z-icon]')) {
                            return false;
                        }
                        return element.textContent?.trim() !== '';
                    }
                    return false;
                });
                this._zIconOnlyState.set(hasIcon && !hasText);
            };
            check();
            this._mutationObserver = new MutationObserver(check);
            this._mutationObserver.observe(this._elementRef.nativeElement, {
                childList: true,
                characterData: true,
                subtree: true,
            });
        });
    }
    ngOnDestroy() {
        if (this._mutationObserver) {
            this._mutationObserver.disconnect();
            this._mutationObserver = null;
        }
    }
    onWaveClick() {
        const type = this.zType();
        if (!this.zWave() || this.zLoading() || type === 'link') {
            return;
        }
        const el = this._elementRef.nativeElement;
        const waveEl = document.createElement('span');
        waveEl.className = 'z-animate-wave';
        el.appendChild(waveEl);
        el.classList.add('z-wave-active');
        const onWaveAnimationEnd = (event) => {
            if (event.animationName !== 'z-fade-effect') {
                return;
            }
            waveEl.remove();
            el.classList.remove('z-wave-active');
            waveEl.removeEventListener('animationend', onWaveAnimationEnd);
        };
        waveEl.addEventListener('animationend', onWaveAnimationEnd);
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZButtonComponent, isStandalone: true, selector: "z-button, button[z-button], a[z-button]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zType: { classPropertyName: "zType", publicName: "zType", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zShape: { classPropertyName: "zShape", publicName: "zShape", isSignal: true, isRequired: false, transformFunction: null }, zLabel: { classPropertyName: "zLabel", publicName: "zLabel", isSignal: true, isRequired: false, transformFunction: null }, zLoading: { classPropertyName: "zLoading", publicName: "zLoading", isSignal: true, isRequired: false, transformFunction: null }, zDisabled: { classPropertyName: "zDisabled", publicName: "zDisabled", isSignal: true, isRequired: false, transformFunction: null }, zTypeIcon: { classPropertyName: "zTypeIcon", publicName: "zTypeIcon", isSignal: true, isRequired: false, transformFunction: null }, zAnimatedTypeIcon: { classPropertyName: "zAnimatedTypeIcon", publicName: "zAnimatedTypeIcon", isSignal: true, isRequired: false, transformFunction: null }, zAnimateIcon: { classPropertyName: "zAnimateIcon", publicName: "zAnimateIcon", isSignal: true, isRequired: false, transformFunction: null }, zAnimationTriggerIcon: { classPropertyName: "zAnimationTriggerIcon", publicName: "zAnimationTriggerIcon", isSignal: true, isRequired: false, transformFunction: null }, zSizeIcon: { classPropertyName: "zSizeIcon", publicName: "zSizeIcon", isSignal: true, isRequired: false, transformFunction: null }, zStrokeWidthIcon: { classPropertyName: "zStrokeWidthIcon", publicName: "zStrokeWidthIcon", isSignal: true, isRequired: false, transformFunction: null }, zWave: { classPropertyName: "zWave", publicName: "zWave", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onWaveClick()" }, properties: { "class": "zClasses()", "attr.data-icon-only": "zIconOnly() || null" } }, exportAs: ["zButton"], ngImport: i0, template: "@if ((zTypeIcon() || zAnimatedTypeIcon()) && !zLoading()) {\n  <i\n    z-icon\n    [zType]=\"zTypeIcon() || 'lucideLoader'\"\n    [zAnimatedType]=\"zAnimatedTypeIcon()\"\n    [zAnimate]=\"zAnimateIcon()\"\n    [zAnimationTrigger]=\"zAnimationTriggerIcon()\"\n    [zSize]=\"zSizeIcon()\"\n    [zStrokeWidth]=\"zStrokeWidthIcon()\"></i>\n}\n@if (zLoading()) {\n  <i z-icon zType=\"lucideLoader\" class=\"z-animate-spin\" [zSize]=\"zSizeIcon()\" [zStrokeWidth]=\"2.8\"></i>\n}\n@if (zLabel()) {\n  <span>{{ zLabel() | translate }}</span>\n} @else {\n  <ng-content />\n}\n", styles: ["@property --z-button-shimmer-angle{syntax: \"<angle>\"; inherits: false; initial-value: 0deg;}@keyframes z-button-shimmer-spin{to{--z-button-shimmer-angle: 360deg}}@keyframes z-button-heartbeat{0%{box-shadow:0 0 0 0 var(--z-button-heartbeat-color, var(--destructive))}50%{box-shadow:0 0 0 7px transparent}to{box-shadow:0 0 0 0 transparent}}.z-button-shimmer{border-color:transparent;background:linear-gradient(var(--background),var(--background)) padding-box,conic-gradient(from var(--z-button-shimmer-angle),transparent 0deg,transparent 300deg,var(--primary) 326deg,transparent 352deg,transparent 360deg) border-box;animation:z-button-shimmer-spin 4s linear infinite}.z-button-shimmer:hover{background:linear-gradient(var(--background),var(--background)) padding-box,conic-gradient(from var(--z-button-shimmer-angle),transparent 0deg,transparent 300deg,var(--primary) 326deg,transparent 352deg,transparent 360deg) border-box}.z-button-heartbeat{--z-button-heartbeat-color: var(--destructive);animation:z-button-heartbeat 2s ease-in-out infinite;will-change:box-shadow}@media(prefers-reduced-motion:reduce){.z-button-shimmer,.z-button-heartbeat{animation:none}}\n"], dependencies: [{ kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'z-button, button[z-button], a[z-button]', imports: [ZIconComponent, TranslatePipe], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
                        '[class]': 'zClasses()',
                        '[attr.data-icon-only]': 'zIconOnly() || null',
                        '(click)': 'onWaveClick()',
                    }, exportAs: 'zButton', template: "@if ((zTypeIcon() || zAnimatedTypeIcon()) && !zLoading()) {\n  <i\n    z-icon\n    [zType]=\"zTypeIcon() || 'lucideLoader'\"\n    [zAnimatedType]=\"zAnimatedTypeIcon()\"\n    [zAnimate]=\"zAnimateIcon()\"\n    [zAnimationTrigger]=\"zAnimationTriggerIcon()\"\n    [zSize]=\"zSizeIcon()\"\n    [zStrokeWidth]=\"zStrokeWidthIcon()\"></i>\n}\n@if (zLoading()) {\n  <i z-icon zType=\"lucideLoader\" class=\"z-animate-spin\" [zSize]=\"zSizeIcon()\" [zStrokeWidth]=\"2.8\"></i>\n}\n@if (zLabel()) {\n  <span>{{ zLabel() | translate }}</span>\n} @else {\n  <ng-content />\n}\n", styles: ["@property --z-button-shimmer-angle{syntax: \"<angle>\"; inherits: false; initial-value: 0deg;}@keyframes z-button-shimmer-spin{to{--z-button-shimmer-angle: 360deg}}@keyframes z-button-heartbeat{0%{box-shadow:0 0 0 0 var(--z-button-heartbeat-color, var(--destructive))}50%{box-shadow:0 0 0 7px transparent}to{box-shadow:0 0 0 0 transparent}}.z-button-shimmer{border-color:transparent;background:linear-gradient(var(--background),var(--background)) padding-box,conic-gradient(from var(--z-button-shimmer-angle),transparent 0deg,transparent 300deg,var(--primary) 326deg,transparent 352deg,transparent 360deg) border-box;animation:z-button-shimmer-spin 4s linear infinite}.z-button-shimmer:hover{background:linear-gradient(var(--background),var(--background)) padding-box,conic-gradient(from var(--z-button-shimmer-angle),transparent 0deg,transparent 300deg,var(--primary) 326deg,transparent 352deg,transparent 360deg) border-box}.z-button-heartbeat{--z-button-heartbeat-color: var(--destructive);animation:z-button-heartbeat 2s ease-in-out infinite;will-change:box-shadow}@media(prefers-reduced-motion:reduce){.z-button-shimmer,.z-button-heartbeat{animation:none}}\n"] }]
        }], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zType: [{ type: i0.Input, args: [{ isSignal: true, alias: "zType", required: false }] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", required: false }] }], zShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShape", required: false }] }], zLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLabel", required: false }] }], zLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLoading", required: false }] }], zDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDisabled", required: false }] }], zTypeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTypeIcon", required: false }] }], zAnimatedTypeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAnimatedTypeIcon", required: false }] }], zAnimateIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAnimateIcon", required: false }] }], zAnimationTriggerIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAnimationTriggerIcon", required: false }] }], zSizeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSizeIcon", required: false }] }], zStrokeWidthIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "zStrokeWidthIcon", required: false }] }], zWave: [{ type: i0.Input, args: [{ isSignal: true, alias: "zWave", required: false }] }] } });

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

export { ZButtonComponent, zButtonVariants };
//# sourceMappingURL=shival99-z-ui-components-z-button.mjs.map
