import { ChangeDetectionStrategy, Component } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@vendure/admin-ui/core";
import * as i2 from "@clr/angular";
import * as i3 from "@angular/common";
import * as i4 from "@ngx-translate/core";
export class HealthCheckComponent {
    constructor(healthCheckService) {
        this.healthCheckService = healthCheckService;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: HealthCheckComponent, deps: [{ token: i1.HealthCheckService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: HealthCheckComponent, selector: "vdr-health-check", ngImport: i0, template: "<vdr-page-header>\n    <vdr-page-title></vdr-page-title>\n</vdr-page-header>\n<vdr-page-body>\n    <vdr-page-block>\n        <vdr-action-bar>\n            <vdr-ab-left>\n                <div class=\"system-status-header\" *ngIf=\"healthCheckService.status$ | async as status\">\n                    <div class=\"status-icon\">\n                        <clr-icon\n                            [attr.shape]=\"status === 'ok' ? 'check-circle' : 'exclamation-circle'\"\n                            [ngClass]=\"{ 'is-success': status === 'ok', 'is-danger': status !== 'ok' }\"\n                            size=\"48\"\n                        ></clr-icon>\n                    </div>\n                    <div class=\"status-detail\">\n                        <ng-container *ngIf=\"status === 'ok'; else error\">\n                            {{ 'system.health-all-systems-up' | translate }}\n                        </ng-container>\n                        <ng-template #error>\n                            {{ 'system.health-error' | translate }}\n                        </ng-template>\n                        <div class=\"last-checked\">\n                            {{ 'system.health-last-checked' | translate }}:\n                            {{ healthCheckService.lastCheck$ | async | localeDate : 'mediumTime' }}\n                        </div>\n                    </div>\n                </div>\n            </vdr-ab-left>\n            <vdr-ab-right>\n                <vdr-action-bar-items locationId=\"system-status\"></vdr-action-bar-items>\n                <button class=\"btn btn-secondary\" (click)=\"healthCheckService.refresh()\">\n                    <clr-icon shape=\"refresh\"></clr-icon> {{ 'system.health-refresh' | translate }}\n                </button>\n            </vdr-ab-right>\n        </vdr-action-bar>\n    </vdr-page-block>\n    <vdr-page-block>\n        <table class=\"table\">\n            <thead>\n                <tr>\n                    <th class=\"left\">\n                        {{ 'common.name' | translate }}\n                    </th>\n                    <th class=\"left\">\n                        {{ 'system.health-status' | translate }}\n                    </th>\n                    <th class=\"left\">\n                        {{ 'system.health-message' | translate }}\n                    </th>\n                </tr>\n            </thead>\n            <tbody>\n                <tr *ngFor=\"let row of healthCheckService.details$ | async\">\n                    <td class=\"align-middle left\">{{ row.key }}</td>\n                    <td class=\"align-middle left\">\n                        <vdr-chip [colorType]=\"row.result.status === 'up' ? 'success' : 'error'\">\n                            <ng-container *ngIf=\"row.result.status === 'up'; else down\">\n                                <clr-icon shape=\"check-circle\"></clr-icon>\n                                {{ 'system.health-status-up' | translate }}\n                            </ng-container>\n                            <ng-template #down>\n                                <clr-icon shape=\"exclamation-circle\"></clr-icon>\n                                {{ 'system.health-status-down' | translate }}\n                            </ng-template>\n                        </vdr-chip>\n                    </td>\n                    <td class=\"align-middle left\">{{ row.result.message }}</td>\n                </tr>\n            </tbody>\n        </table>\n    </vdr-page-block>\n</vdr-page-body>\n", styles: [".system-status-header{display:flex;justify-content:space-between;align-items:flex-start}.system-status-header .status-detail{font-weight:700;margin-inline-end:6px}.system-status-header .last-checked{font-weight:400;color:var(--color-grey-500)}\n"], dependencies: [{ kind: "directive", type: i2.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.ActionBarComponent, selector: "vdr-action-bar" }, { kind: "component", type: i1.ActionBarLeftComponent, selector: "vdr-ab-left", inputs: ["grow"] }, { kind: "component", type: i1.ActionBarRightComponent, selector: "vdr-ab-right", inputs: ["grow"] }, { kind: "component", type: i1.ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "component", type: i1.ActionBarItemsComponent, selector: "vdr-action-bar-items", inputs: ["locationId"] }, { kind: "component", type: i1.PageHeaderComponent, selector: "vdr-page-header" }, { kind: "component", type: i1.PageTitleComponent, selector: "vdr-page-title", inputs: ["title"] }, { kind: "component", type: i1.PageBodyComponent, selector: "vdr-page-body" }, { kind: "component", type: i1.PageBlockComponent, selector: "vdr-page-block" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.LocaleDatePipe, name: "localeDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: HealthCheckComponent, decorators: [{
            type: Component,
            args: [{ selector: 'vdr-health-check', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-page-header>\n    <vdr-page-title></vdr-page-title>\n</vdr-page-header>\n<vdr-page-body>\n    <vdr-page-block>\n        <vdr-action-bar>\n            <vdr-ab-left>\n                <div class=\"system-status-header\" *ngIf=\"healthCheckService.status$ | async as status\">\n                    <div class=\"status-icon\">\n                        <clr-icon\n                            [attr.shape]=\"status === 'ok' ? 'check-circle' : 'exclamation-circle'\"\n                            [ngClass]=\"{ 'is-success': status === 'ok', 'is-danger': status !== 'ok' }\"\n                            size=\"48\"\n                        ></clr-icon>\n                    </div>\n                    <div class=\"status-detail\">\n                        <ng-container *ngIf=\"status === 'ok'; else error\">\n                            {{ 'system.health-all-systems-up' | translate }}\n                        </ng-container>\n                        <ng-template #error>\n                            {{ 'system.health-error' | translate }}\n                        </ng-template>\n                        <div class=\"last-checked\">\n                            {{ 'system.health-last-checked' | translate }}:\n                            {{ healthCheckService.lastCheck$ | async | localeDate : 'mediumTime' }}\n                        </div>\n                    </div>\n                </div>\n            </vdr-ab-left>\n            <vdr-ab-right>\n                <vdr-action-bar-items locationId=\"system-status\"></vdr-action-bar-items>\n                <button class=\"btn btn-secondary\" (click)=\"healthCheckService.refresh()\">\n                    <clr-icon shape=\"refresh\"></clr-icon> {{ 'system.health-refresh' | translate }}\n                </button>\n            </vdr-ab-right>\n        </vdr-action-bar>\n    </vdr-page-block>\n    <vdr-page-block>\n        <table class=\"table\">\n            <thead>\n                <tr>\n                    <th class=\"left\">\n                        {{ 'common.name' | translate }}\n                    </th>\n                    <th class=\"left\">\n                        {{ 'system.health-status' | translate }}\n                    </th>\n                    <th class=\"left\">\n                        {{ 'system.health-message' | translate }}\n                    </th>\n                </tr>\n            </thead>\n            <tbody>\n                <tr *ngFor=\"let row of healthCheckService.details$ | async\">\n                    <td class=\"align-middle left\">{{ row.key }}</td>\n                    <td class=\"align-middle left\">\n                        <vdr-chip [colorType]=\"row.result.status === 'up' ? 'success' : 'error'\">\n                            <ng-container *ngIf=\"row.result.status === 'up'; else down\">\n                                <clr-icon shape=\"check-circle\"></clr-icon>\n                                {{ 'system.health-status-up' | translate }}\n                            </ng-container>\n                            <ng-template #down>\n                                <clr-icon shape=\"exclamation-circle\"></clr-icon>\n                                {{ 'system.health-status-down' | translate }}\n                            </ng-template>\n                        </vdr-chip>\n                    </td>\n                    <td class=\"align-middle left\">{{ row.result.message }}</td>\n                </tr>\n            </tbody>\n        </table>\n    </vdr-page-block>\n</vdr-page-body>\n", styles: [".system-status-header{display:flex;justify-content:space-between;align-items:flex-start}.system-status-header .status-detail{font-weight:700;margin-inline-end:6px}.system-status-header .last-checked{font-weight:400;color:var(--color-grey-500)}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.HealthCheckService }]; } });
//# sourceMappingURL=data:application/json;base64, 