import * as i0 from '@angular/core';
import { input, computed, Component, NgModule } from '@angular/core';
import { elementStateTick, elementStateExclamationMark, elementOutOfService, elementNotChecked, elementCircleFilled } from '@siemens/element-icons';
import { addIcons, SiIconComponent } from '@siemens/element-ng/icon';
import { SiLoadingSpinnerComponent } from '@siemens/element-ng/loading-spinner';
import { SiTranslatePipe } from '@siemens/element-translate-ng/translate';

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
class SiResultDetailsListComponent {
    /**
     * Array of steps to show in the list.
     *
     * @defaultValue []
     */
    steps = input([], ...(ngDevMode ? [{ debugName: "steps" }] : []));
    stepHasValue = computed(() => this.steps().some(item => !!item.value), ...(ngDevMode ? [{ debugName: "stepHasValue" }] : []));
    icons = addIcons({
        elementCircleFilled,
        elementNotChecked,
        elementOutOfService,
        elementStateExclamationMark,
        elementStateTick
    });
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiResultDetailsListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiResultDetailsListComponent, isStandalone: true, selector: "si-result-details-list", inputs: { steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ul class=\"list-unstyled d-flex flex-column mb-0\">\n  @for (step of steps(); track $index) {\n    <li\n      class=\"position-relative d-flex align-items-center timeline px-6 py-5\"\n      [class.text-primary]=\"step.state === 'running'\"\n    >\n      @if (step.state === 'running') {\n        <si-loading-spinner class=\"me-4\" />\n      }\n      @if (step.icon && step.state !== 'running') {\n        <si-icon class=\"me-4 icon\" [icon]=\"step.icon\" />\n      }\n      @if (!step.icon && step.state !== 'running') {\n        @switch (step.state) {\n          @case ('passed') {\n            <span class=\"me-4 icon icon-stack\">\n              <si-icon class=\"status-success\" [icon]=\"icons.elementCircleFilled\" />\n              <si-icon class=\"status-critical-contrast\" [icon]=\"icons.elementStateTick\" />\n            </span>\n          }\n          @case ('failed') {\n            <span class=\"me-4 icon icon-stack\">\n              <si-icon class=\"status-danger\" [icon]=\"icons.elementCircleFilled\" />\n              <si-icon\n                class=\"status-critical-contrast\"\n                [icon]=\"icons.elementStateExclamationMark\"\n              />\n            </span>\n          }\n          @case ('not-started') {\n            <si-icon class=\"me-4 icon\" [icon]=\"icons.elementNotChecked\" />\n          }\n          @default {\n            <si-icon class=\"me-4 icon\" [icon]=\"icons.elementOutOfService\" />\n          }\n        }\n      }\n      <div class=\"d-flex flex-column justify-content-center w-100 overflow-hidden\">\n        <div class=\"d-flex\">\n          <div class=\"result-description\">\n            <span class=\"si-h5\">{{ step.description | translate: step.translationParams }}</span>\n            @if (step.detail) {\n              <div class=\"si-body text-secondary result-detail\">{{\n                step.detail | translate: step.translationParams\n              }}</div>\n            }\n            @if (step.errorMessage) {\n              <div class=\"si-h5 text-danger\">{{\n                step.errorMessage | translate: step.translationParams\n              }}</div>\n            }\n          </div>\n          @if (step.value) {\n            <span class=\"result-value\">{{ step.value }}</span>\n          } @else if (stepHasValue()) {\n            <!-- empty placeholder to align step description with other steps-->\n            <span class=\"result-value\"></span>\n          }\n        </div>\n      </div>\n    </li>\n  }\n</ul>\n", styles: ["si-loading-spinner{--loading-spinner-size: 1.25rem;--loading-spinner-color: var(--element-text-active)}.result-description{flex:2 1;align-self:center;overflow:hidden}.result-value{flex:1 1;white-space:nowrap;align-self:top}.result-detail{letter-spacing:.15px;display:block;display:-webkit-box;max-block-size:2rem;word-wrap:break-word;line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.timeline:not(:last-child):after,.timeline:not(:first-child):before{content:\"\";position:absolute;inline-size:1px;background-color:var(--element-ui-2);block-size:calc(50% - .625rem);margin-inline-start:calc(.625rem - .5px)}si-icon{color:var(--element-ui-2)}.timeline:not(:first-child):before{inset-block-start:0}.timeline:not(:last-child):after{inset-block-end:0}\n"], dependencies: [{ kind: "component", type: SiLoadingSpinnerComponent, selector: "si-loading-spinner", inputs: ["isBlockingSpinner", "isSpinnerOverlay", "ariaLabel"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiResultDetailsListComponent, decorators: [{
            type: Component,
            args: [{ selector: 'si-result-details-list', imports: [SiLoadingSpinnerComponent, SiIconComponent, SiTranslatePipe], template: "<ul class=\"list-unstyled d-flex flex-column mb-0\">\n  @for (step of steps(); track $index) {\n    <li\n      class=\"position-relative d-flex align-items-center timeline px-6 py-5\"\n      [class.text-primary]=\"step.state === 'running'\"\n    >\n      @if (step.state === 'running') {\n        <si-loading-spinner class=\"me-4\" />\n      }\n      @if (step.icon && step.state !== 'running') {\n        <si-icon class=\"me-4 icon\" [icon]=\"step.icon\" />\n      }\n      @if (!step.icon && step.state !== 'running') {\n        @switch (step.state) {\n          @case ('passed') {\n            <span class=\"me-4 icon icon-stack\">\n              <si-icon class=\"status-success\" [icon]=\"icons.elementCircleFilled\" />\n              <si-icon class=\"status-critical-contrast\" [icon]=\"icons.elementStateTick\" />\n            </span>\n          }\n          @case ('failed') {\n            <span class=\"me-4 icon icon-stack\">\n              <si-icon class=\"status-danger\" [icon]=\"icons.elementCircleFilled\" />\n              <si-icon\n                class=\"status-critical-contrast\"\n                [icon]=\"icons.elementStateExclamationMark\"\n              />\n            </span>\n          }\n          @case ('not-started') {\n            <si-icon class=\"me-4 icon\" [icon]=\"icons.elementNotChecked\" />\n          }\n          @default {\n            <si-icon class=\"me-4 icon\" [icon]=\"icons.elementOutOfService\" />\n          }\n        }\n      }\n      <div class=\"d-flex flex-column justify-content-center w-100 overflow-hidden\">\n        <div class=\"d-flex\">\n          <div class=\"result-description\">\n            <span class=\"si-h5\">{{ step.description | translate: step.translationParams }}</span>\n            @if (step.detail) {\n              <div class=\"si-body text-secondary result-detail\">{{\n                step.detail | translate: step.translationParams\n              }}</div>\n            }\n            @if (step.errorMessage) {\n              <div class=\"si-h5 text-danger\">{{\n                step.errorMessage | translate: step.translationParams\n              }}</div>\n            }\n          </div>\n          @if (step.value) {\n            <span class=\"result-value\">{{ step.value }}</span>\n          } @else if (stepHasValue()) {\n            <!-- empty placeholder to align step description with other steps-->\n            <span class=\"result-value\"></span>\n          }\n        </div>\n      </div>\n    </li>\n  }\n</ul>\n", styles: ["si-loading-spinner{--loading-spinner-size: 1.25rem;--loading-spinner-color: var(--element-text-active)}.result-description{flex:2 1;align-self:center;overflow:hidden}.result-value{flex:1 1;white-space:nowrap;align-self:top}.result-detail{letter-spacing:.15px;display:block;display:-webkit-box;max-block-size:2rem;word-wrap:break-word;line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.timeline:not(:last-child):after,.timeline:not(:first-child):before{content:\"\";position:absolute;inline-size:1px;background-color:var(--element-ui-2);block-size:calc(50% - .625rem);margin-inline-start:calc(.625rem - .5px)}si-icon{color:var(--element-ui-2)}.timeline:not(:first-child):before{inset-block-start:0}.timeline:not(:last-child):after{inset-block-end:0}\n"] }]
        }], propDecorators: { steps: [{ type: i0.Input, args: [{ isSignal: true, alias: "steps", required: false }] }] } });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
class SiResultDetailsListModule {
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiResultDetailsListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
    static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.8", ngImport: i0, type: SiResultDetailsListModule, imports: [SiResultDetailsListComponent], exports: [SiResultDetailsListComponent] });
    static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiResultDetailsListModule, imports: [SiResultDetailsListComponent] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiResultDetailsListModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [SiResultDetailsListComponent],
                    exports: [SiResultDetailsListComponent]
                }]
        }] });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */

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

export { SiResultDetailsListComponent, SiResultDetailsListModule };
//# sourceMappingURL=siemens-element-ng-result-details-list.mjs.map
