import * as i0 from '@angular/core';
import { Directive, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, NgModule } from '@angular/core';
import { KbqColorDirective, KbqComponentColors } from '@koobiq/components/core';
import { PlatformModule } from '@angular/cdk/platform';

let idIterator = 0;
const MIN_PERCENT = 0;
const MAX_PERCENT = 100;
class KbqProgressBarText {
    /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqProgressBarText, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
    /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: KbqProgressBarText, selector: "[kbq-progress-bar-text]", host: { classAttribute: "kbq-progress-bar-text" }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqProgressBarText, decorators: [{
            type: Directive,
            args: [{
                    selector: '[kbq-progress-bar-text]',
                    host: {
                        class: 'kbq-progress-bar-text'
                    }
                }]
        }] });
class KbqProgressBarCaption {
    /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqProgressBarCaption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
    /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: KbqProgressBarCaption, selector: "[kbq-progress-bar-caption]", host: { classAttribute: "kbq-progress-bar-caption" }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqProgressBarCaption, decorators: [{
            type: Directive,
            args: [{
                    selector: '[kbq-progress-bar-caption]',
                    host: {
                        class: 'kbq-progress-bar-caption'
                    }
                }]
        }] });
class KbqProgressBar extends KbqColorDirective {
    get percentage() {
        return Math.max(MIN_PERCENT, Math.min(MAX_PERCENT, this.value));
    }
    constructor() {
        super();
        this.id = `kbq-progress-bar-${idIterator++}`;
        this.value = 0;
        this.mode = 'determinate';
        this.color = KbqComponentColors.Theme;
    }
    /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqProgressBar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: KbqProgressBar, selector: "kbq-progress-bar", inputs: { id: "id", value: "value", mode: "mode" }, host: { properties: { "attr.id": "id", "class.kbq-progress-bar_determinate": "mode === \"determinate\"", "class.kbq-progress-bar_indeterminate": "mode === \"indeterminate\"" }, classAttribute: "kbq-progress-bar" }, usesInheritance: true, ngImport: i0, template: "<ng-content select=\"[kbq-progress-bar-text]\" />\n\n<div class=\"kbq-progress-bar__inner\" [id]=\"id\">\n    @switch (mode) {\n        @case ('indeterminate') {\n            <div class=\"kbq-progress-bar__line kbq-progress-bar__line_indeterminate\"></div>\n        }\n        @default {\n            <div class=\"kbq-progress-bar__line kbq-progress-bar__line_determinate\" [style.width.%]=\"percentage\"></div>\n        }\n    }\n</div>\n\n<ng-content select=\"[kbq-progress-bar-caption]\" />\n", styles: ["@keyframes kbq-progress-bar-indeterminate{0%{width:25%;transform:translate(-150%)}to{width:40%;transform:translate(250%)}}.kbq-progress-bar{display:block;overflow:hidden}.kbq-progress-bar .kbq-progress-bar-text{margin-bottom:var(--kbq-progress-bar-size-container-content-gap)}.kbq-progress-bar .kbq-progress-bar-caption{margin-top:var(--kbq-progress-bar-size-container-content-gap)}.kbq-progress-bar .kbq-progress-bar__inner{overflow:hidden;height:var(--kbq-progress-bar-size-bar-height);border-radius:var(--kbq-progress-bar-size-container-border-radius)}.kbq-progress-bar .kbq-progress-bar__line{height:100%;transform-origin:top left;border-radius:var(--kbq-progress-bar-size-bar-border-radius)}.kbq-progress-bar.kbq-progress-bar_determinate .kbq-progress-bar__line{transition:width .3s}.kbq-progress-bar.kbq-progress-bar_indeterminate .kbq-progress-bar__line{animation:kbq-progress-bar-indeterminate 2.1s cubic-bezier(.455,.03,.515,.955) infinite}.kbq-progress-bar.kbq-theme .kbq-progress-bar__inner{background-color:var(--kbq-progress-bar-bar-background)}.kbq-progress-bar.kbq-theme .kbq-progress-bar__line{background-color:var(--kbq-progress-bar-bar-foreground)}.kbq-progress-bar-text{color:var(--kbq-progress-bar-text-color)}.kbq-progress-bar-caption{color:var(--kbq-progress-bar-caption-color)}.kbq-progress-bar-text{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}.kbq-progress-bar-caption{font-size:var(--kbq-typography-text-compact-font-size);font-style:var(--kbq-typography-text-compact-font-style);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}\n", ".kbq-progress-bar{--kbq-progress-bar-size-container-content-gap: var(--kbq-size-s);--kbq-progress-bar-size-container-border-radius: var(--kbq-size-3xs);--kbq-progress-bar-size-bar-height: var(--kbq-size-xxs);--kbq-progress-bar-size-bar-border-radius: var(--kbq-size-3xs);--kbq-progress-bar-bar-background: var(--kbq-background-contrast-fade);--kbq-progress-bar-bar-foreground: var(--kbq-icon-theme);--kbq-progress-bar-text-color: var(--kbq-foreground-contrast);--kbq-progress-bar-caption-color: var(--kbq-foreground-contrast-secondary)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqProgressBar, decorators: [{
            type: Component,
            args: [{ selector: 'kbq-progress-bar', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
                        '[attr.id]': 'id',
                        class: 'kbq-progress-bar',
                        '[class.kbq-progress-bar_determinate]': 'mode === "determinate"',
                        '[class.kbq-progress-bar_indeterminate]': 'mode === "indeterminate"'
                    }, template: "<ng-content select=\"[kbq-progress-bar-text]\" />\n\n<div class=\"kbq-progress-bar__inner\" [id]=\"id\">\n    @switch (mode) {\n        @case ('indeterminate') {\n            <div class=\"kbq-progress-bar__line kbq-progress-bar__line_indeterminate\"></div>\n        }\n        @default {\n            <div class=\"kbq-progress-bar__line kbq-progress-bar__line_determinate\" [style.width.%]=\"percentage\"></div>\n        }\n    }\n</div>\n\n<ng-content select=\"[kbq-progress-bar-caption]\" />\n", styles: ["@keyframes kbq-progress-bar-indeterminate{0%{width:25%;transform:translate(-150%)}to{width:40%;transform:translate(250%)}}.kbq-progress-bar{display:block;overflow:hidden}.kbq-progress-bar .kbq-progress-bar-text{margin-bottom:var(--kbq-progress-bar-size-container-content-gap)}.kbq-progress-bar .kbq-progress-bar-caption{margin-top:var(--kbq-progress-bar-size-container-content-gap)}.kbq-progress-bar .kbq-progress-bar__inner{overflow:hidden;height:var(--kbq-progress-bar-size-bar-height);border-radius:var(--kbq-progress-bar-size-container-border-radius)}.kbq-progress-bar .kbq-progress-bar__line{height:100%;transform-origin:top left;border-radius:var(--kbq-progress-bar-size-bar-border-radius)}.kbq-progress-bar.kbq-progress-bar_determinate .kbq-progress-bar__line{transition:width .3s}.kbq-progress-bar.kbq-progress-bar_indeterminate .kbq-progress-bar__line{animation:kbq-progress-bar-indeterminate 2.1s cubic-bezier(.455,.03,.515,.955) infinite}.kbq-progress-bar.kbq-theme .kbq-progress-bar__inner{background-color:var(--kbq-progress-bar-bar-background)}.kbq-progress-bar.kbq-theme .kbq-progress-bar__line{background-color:var(--kbq-progress-bar-bar-foreground)}.kbq-progress-bar-text{color:var(--kbq-progress-bar-text-color)}.kbq-progress-bar-caption{color:var(--kbq-progress-bar-caption-color)}.kbq-progress-bar-text{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}.kbq-progress-bar-caption{font-size:var(--kbq-typography-text-compact-font-size);font-style:var(--kbq-typography-text-compact-font-style);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}\n", ".kbq-progress-bar{--kbq-progress-bar-size-container-content-gap: var(--kbq-size-s);--kbq-progress-bar-size-container-border-radius: var(--kbq-size-3xs);--kbq-progress-bar-size-bar-height: var(--kbq-size-xxs);--kbq-progress-bar-size-bar-border-radius: var(--kbq-size-3xs);--kbq-progress-bar-bar-background: var(--kbq-background-contrast-fade);--kbq-progress-bar-bar-foreground: var(--kbq-icon-theme);--kbq-progress-bar-text-color: var(--kbq-foreground-contrast);--kbq-progress-bar-caption-color: var(--kbq-foreground-contrast-secondary)}\n"] }]
        }], ctorParameters: () => [], propDecorators: { id: [{
                type: Input
            }], value: [{
                type: Input
            }], mode: [{
                type: Input
            }] } });

class KbqProgressBarModule {
    /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqProgressBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: KbqProgressBarModule, declarations: [KbqProgressBar,
            KbqProgressBarText,
            KbqProgressBarCaption], imports: [PlatformModule], exports: [KbqProgressBar,
            KbqProgressBarText,
            KbqProgressBarCaption] }); }
    /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqProgressBarModule, imports: [PlatformModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqProgressBarModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        PlatformModule
                    ],
                    declarations: [
                        KbqProgressBar,
                        KbqProgressBarText,
                        KbqProgressBarCaption
                    ],
                    exports: [
                        KbqProgressBar,
                        KbqProgressBarText,
                        KbqProgressBarCaption
                    ]
                }]
        }] });

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

export { KbqProgressBar, KbqProgressBarCaption, KbqProgressBarModule, KbqProgressBarText };
//# sourceMappingURL=koobiq-components-progress-bar.mjs.map
