import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { Pipe, Injectable, Input, Component } from '@angular/core';
import { SdBadge } from '@sd-angular/core/components/badge';
import { DateUtilities, SD_EMPTY_STR } from '@sd-angular/core/utilities';

class ViewDateTimePipe {
    transform(value) {
        if (!value || !DateUtilities.isDate(value)) {
            return SD_EMPTY_STR;
        }
        return DateUtilities.toFormat(value, 'HH:mm dd/MM/yyyy');
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ViewDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
    static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: ViewDateTimePipe, isStandalone: true, name: "viewDateTime" });
    static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ViewDateTimePipe, providedIn: 'root' });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ViewDateTimePipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'viewDateTime',
                    standalone: true,
                }]
        }, {
            type: Injectable,
            args: [{
                    providedIn: 'root',
                }]
        }] });

class SdHistoryItem {
    items = [];
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdHistoryItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdHistoryItem, isStandalone: true, selector: "sd-history", inputs: { items: "items" }, ngImport: i0, template: "<div class=\"sd-history\">\r\n  <div class=\"history-container\">\r\n    <div class=\"history-line\"></div>\r\n    <div *ngFor=\"let item of items; let i = index\" class=\"history-item\">\r\n      <div class=\"dot\"></div>\r\n      <div class=\"card\">\r\n        <div class=\"header\">\r\n          <div class=\"title-wrapper\">\r\n            <span class=\"title\">{{ item.title }}</span>\r\n            <span class=\"status\">\r\n                @if (item?.status) {\r\n                  <sd-badge\r\n                  [icon]=\"item.status?.icon\"\r\n                  [title]=\"item.status?.title\"\r\n                  [color]=\"item.status?.color\"></sd-badge>\r\n                }\r\n            </span>\r\n          </div>\r\n            <span class=\"date\">{{ item?.date | viewDateTime }}</span>\r\n        </div>\r\n        <div class=\"meta\">\r\n          @if (item?.actor) {\r\n            <span>B\u1EDFi <strong>&#64;{{ item.actor }}</strong></span>\r\n          }\r\n          @if (item?.source) {\r\n            <span> &#183; {{ item.source }}</span>\r\n          }\r\n        </div>\r\n        <div class=\"description\">\r\n          {{ item?.description }}\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n", styles: [".sd-history{padding:16px}.history-container{position:relative;padding-left:20px;font-size:14px;line-height:20px;min-width:470px;max-width:100%}.history-line{position:absolute;left:8px;top:0;bottom:0;width:2px;background-color:#94b0ff}.history-item{position:relative;margin-bottom:16px;padding-left:10px}.history-item .dot{position:absolute;left:-16px;top:12px;width:12px;height:12px;background-color:#94b0ff;border-radius:50%}.history-item .card{background:#fff;border-radius:6px;box-shadow:0 2px 4px #0000001a;padding:8px 8px 8px 16px}.history-item .card .header{display:flex;justify-content:space-between;align-items:center}.history-item .card .header .title-wrapper{display:flex;align-items:flex-start;padding-right:8px}.history-item .card .header .title{margin-right:8px;color:#757575}.history-item .card .header .status{display:flex;align-items:center}.history-item .card .header .status mat-icon{margin-right:4px}.history-item .card .header .date{color:#757575;font-size:12px;line-height:16px}.history-item .card .meta{color:#757575;margin-top:4px}.history-item .card .meta strong{color:#000}.history-item .card .description{margin-top:4px;color:#000;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SdBadge, selector: "sd-badge", inputs: ["type", "color", "primary", "secondary", "success", "info", "warning", "error", "fontSet", "title", "description", "tooltip", "icon", "size"], outputs: ["sdClick"] }, { kind: "pipe", type: ViewDateTimePipe, name: "viewDateTime" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdHistoryItem, decorators: [{
            type: Component,
            args: [{ selector: 'sd-history', imports: [CommonModule, SdBadge, ViewDateTimePipe], template: "<div class=\"sd-history\">\r\n  <div class=\"history-container\">\r\n    <div class=\"history-line\"></div>\r\n    <div *ngFor=\"let item of items; let i = index\" class=\"history-item\">\r\n      <div class=\"dot\"></div>\r\n      <div class=\"card\">\r\n        <div class=\"header\">\r\n          <div class=\"title-wrapper\">\r\n            <span class=\"title\">{{ item.title }}</span>\r\n            <span class=\"status\">\r\n                @if (item?.status) {\r\n                  <sd-badge\r\n                  [icon]=\"item.status?.icon\"\r\n                  [title]=\"item.status?.title\"\r\n                  [color]=\"item.status?.color\"></sd-badge>\r\n                }\r\n            </span>\r\n          </div>\r\n            <span class=\"date\">{{ item?.date | viewDateTime }}</span>\r\n        </div>\r\n        <div class=\"meta\">\r\n          @if (item?.actor) {\r\n            <span>B\u1EDFi <strong>&#64;{{ item.actor }}</strong></span>\r\n          }\r\n          @if (item?.source) {\r\n            <span> &#183; {{ item.source }}</span>\r\n          }\r\n        </div>\r\n        <div class=\"description\">\r\n          {{ item?.description }}\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n", styles: [".sd-history{padding:16px}.history-container{position:relative;padding-left:20px;font-size:14px;line-height:20px;min-width:470px;max-width:100%}.history-line{position:absolute;left:8px;top:0;bottom:0;width:2px;background-color:#94b0ff}.history-item{position:relative;margin-bottom:16px;padding-left:10px}.history-item .dot{position:absolute;left:-16px;top:12px;width:12px;height:12px;background-color:#94b0ff;border-radius:50%}.history-item .card{background:#fff;border-radius:6px;box-shadow:0 2px 4px #0000001a;padding:8px 8px 8px 16px}.history-item .card .header{display:flex;justify-content:space-between;align-items:center}.history-item .card .header .title-wrapper{display:flex;align-items:flex-start;padding-right:8px}.history-item .card .header .title{margin-right:8px;color:#757575}.history-item .card .header .status{display:flex;align-items:center}.history-item .card .header .status mat-icon{margin-right:4px}.history-item .card .header .date{color:#757575;font-size:12px;line-height:16px}.history-item .card .meta{color:#757575;margin-top:4px}.history-item .card .meta strong{color:#000}.history-item .card .description{margin-top:4px;color:#000;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}\n"] }]
        }], propDecorators: { items: [{
                type: Input
            }] } });

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

export { SdHistoryItem };
//# sourceMappingURL=sd-angular-core-components-history.mjs.map
