/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "ng-zorro-antd/core";
var _c0 = ["template"];
function NzTimelineItemComponent_ng_template_0_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtext(1);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    var ctx_r1045 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r1045.nzDot);
} }
function NzTimelineItemComponent_ng_template_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "li", 1);
    i0.ɵɵelement(1, "div", 2);
    i0.ɵɵelementStart(2, "div", 3);
    i0.ɵɵtemplate(3, NzTimelineItemComponent_ng_template_0_ng_container_3_Template, 2, 1, "ng-container", 4);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "div", 5);
    i0.ɵɵprojection(5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r1044 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("ant-timeline-item-right", ctx_r1044.position === "right")("ant-timeline-item-left", ctx_r1044.position === "left")("ant-timeline-item-last", ctx_r1044.isLast);
    i0.ɵɵadvance(2);
    i0.ɵɵstyleProp("border-color", ctx_r1044.borderColor);
    i0.ɵɵclassProp("ant-timeline-item-head-red", ctx_r1044.nzColor === "red")("ant-timeline-item-head-blue", ctx_r1044.nzColor === "blue")("ant-timeline-item-head-green", ctx_r1044.nzColor === "green")("ant-timeline-item-head-gray", ctx_r1044.nzColor === "gray")("ant-timeline-item-head-custom", !!ctx_r1044.nzDot);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("nzStringTemplateOutlet", ctx_r1044.nzDot);
} }
var _c1 = ["*"];
var TimelineTimeDefaultColors = ['red', 'blue', 'green', 'grey', 'gray'];
function isDefaultColor(color) {
    return TimelineTimeDefaultColors.findIndex(function (i) { return i === color; }) !== -1;
}
var NzTimelineItemComponent = /** @class */ (function () {
    function NzTimelineItemComponent(cdr) {
        this.cdr = cdr;
        this.nzColor = 'blue';
        this.isLast = false;
        this.borderColor = null;
    }
    NzTimelineItemComponent.prototype.ngOnChanges = function (changes) {
        if (changes.nzColor) {
            this.updateCustomColor();
        }
    };
    NzTimelineItemComponent.prototype.detectChanges = function () {
        this.cdr.detectChanges();
    };
    NzTimelineItemComponent.prototype.updateCustomColor = function () {
        this.borderColor = isDefaultColor(this.nzColor) ? null : this.nzColor;
    };
    /** @nocollapse */ NzTimelineItemComponent.ɵfac = function NzTimelineItemComponent_Factory(t) { return new (t || NzTimelineItemComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
    /** @nocollapse */ NzTimelineItemComponent.ɵcmp = i0.ɵɵdefineComponent({ type: NzTimelineItemComponent, selectors: [["nz-timeline-item"], ["", "nz-timeline-item", ""]], viewQuery: function NzTimelineItemComponent_Query(rf, ctx) { if (rf & 1) {
            i0.ɵɵviewQuery(_c0, true);
        } if (rf & 2) {
            var _t;
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.template = _t.first);
        } }, inputs: { nzColor: "nzColor", nzDot: "nzDot" }, exportAs: ["nzTimelineItem"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c1, decls: 2, vars: 0, consts: [["template", ""], [1, "ant-timeline-item"], [1, "ant-timeline-item-tail"], [1, "ant-timeline-item-head"], [4, "nzStringTemplateOutlet"], [1, "ant-timeline-item-content"]], template: function NzTimelineItemComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef();
            i0.ɵɵtemplate(0, NzTimelineItemComponent_ng_template_0_Template, 6, 19, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
        } }, directives: [i1.NzStringTemplateOutletDirective], encapsulation: 2, changeDetection: 0 });
    return NzTimelineItemComponent;
}());
export { NzTimelineItemComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(NzTimelineItemComponent, [{
        type: Component,
        args: [{
                changeDetection: ChangeDetectionStrategy.OnPush,
                encapsulation: ViewEncapsulation.None,
                preserveWhitespaces: false,
                selector: 'nz-timeline-item, [nz-timeline-item]',
                exportAs: 'nzTimelineItem',
                template: "\n    <ng-template #template>\n      <li\n        class=\"ant-timeline-item\"\n        [class.ant-timeline-item-right]=\"position === 'right'\"\n        [class.ant-timeline-item-left]=\"position === 'left'\"\n        [class.ant-timeline-item-last]=\"isLast\"\n      >\n        <div class=\"ant-timeline-item-tail\"></div>\n        <div\n          class=\"ant-timeline-item-head\"\n          [class.ant-timeline-item-head-red]=\"nzColor === 'red'\"\n          [class.ant-timeline-item-head-blue]=\"nzColor === 'blue'\"\n          [class.ant-timeline-item-head-green]=\"nzColor === 'green'\"\n          [class.ant-timeline-item-head-gray]=\"nzColor === 'gray'\"\n          [class.ant-timeline-item-head-custom]=\"!!nzDot\"\n          [style.border-color]=\"borderColor\"\n        >\n          <ng-container *nzStringTemplateOutlet=\"nzDot\">{{ nzDot }}</ng-container>\n        </div>\n        <div class=\"ant-timeline-item-content\">\n          <ng-content></ng-content>\n        </div>\n      </li>\n    </ng-template>\n  "
            }]
    }], function () { return [{ type: i0.ChangeDetectorRef }]; }, { template: [{
            type: ViewChild,
            args: ['template', { static: false }]
        }], nzColor: [{
            type: Input
        }], nzDot: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 