import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../pipe/nick-name-from-body.pipe";
import * as i3 from "../pipe/time-elapsed.pipe";
function MemberNotificationComponent_ng_container_5_div_1_Template(rf, ctx) { if (rf & 1) {
    var _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 8);
    i0.ɵɵelementStart(1, "div", 9);
    i0.ɵɵlistener("click", function MemberNotificationComponent_ng_container_5_div_1_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r6); var notification_r4 = ctx.$implicit; var ctx_r5 = i0.ɵɵnextContext(2); return ctx_r5.onSelect(notification_r4); });
    i0.ɵɵelementStart(2, "figure", 10);
    i0.ɵɵelement(3, "img", 11);
    i0.ɵɵpipe(4, "nickNameFromBody");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "div", 12);
    i0.ɵɵelementStart(6, "div", 13);
    i0.ɵɵtext(7);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(8, "div", 14);
    i0.ɵɵtext(9);
    i0.ɵɵpipe(10, "timeElapsed");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(11, "a", 15);
    i0.ɵɵlistener("click", function MemberNotificationComponent_ng_container_5_div_1_Template_a_click_11_listener() { i0.ɵɵrestoreView(_r6); var notification_r4 = ctx.$implicit; var ctx_r7 = i0.ɵɵnextContext(2); return ctx_r7.onMarkRead(notification_r4); });
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var notification_r4 = ctx.$implicit;
    var ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(3);
    i0.ɵɵpropertyInterpolate2("src", "", ctx_r3.envUrl, "/api/member/", i0.ɵɵpipeBind1(4, 4, notification_r4.body), "/avatar/s", i0.ɵɵsanitizeUrl);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate1(" ", notification_r4.body, "");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(10, 6, notification_r4.t_pushed), "");
} }
function MemberNotificationComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, MemberNotificationComponent_ng_container_5_div_1_Template, 12, 8, "div", 7);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    var ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngForOf", ctx_r0.notifications.slice(0, ctx_r0.maxCount));
} }
function MemberNotificationComponent_p_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p", 16);
    i0.ɵɵtext(1, " No New Notifications ");
    i0.ɵɵelementEnd();
} }
function MemberNotificationComponent_div_7_a_1_Template(rf, ctx) { if (rf & 1) {
    var _r10 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "a", 19);
    i0.ɵɵlistener("click", function MemberNotificationComponent_div_7_a_1_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r10); var ctx_r9 = i0.ɵɵnextContext(2); return ctx_r9.onViewAll(); });
    i0.ɵɵtext(1, "View all");
    i0.ɵɵelementEnd();
} }
function MemberNotificationComponent_div_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 17);
    i0.ɵɵtemplate(1, MemberNotificationComponent_div_7_a_1_Template, 2, 0, "a", 18);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r2.notifications == null ? null : ctx_r2.notifications.length);
} }
var MemberNotificationComponent = /** @class */ (function () {
    function MemberNotificationComponent() {
        this.notifications = [];
        this.maxCount = 5;
        this.viewAll = new EventEmitter();
        this.markRead = new EventEmitter();
        this.selectNotification = new EventEmitter();
    }
    MemberNotificationComponent.prototype.ngOnInit = function () {
    };
    MemberNotificationComponent.prototype.onViewAll = function () {
        this.viewAll.emit();
    };
    MemberNotificationComponent.prototype.onMarkRead = function (notification) {
        this.markRead.emit(notification);
    };
    MemberNotificationComponent.prototype.onSelect = function (notification) {
        this.selectNotification.emit(notification);
    };
    MemberNotificationComponent.ɵfac = function MemberNotificationComponent_Factory(t) { return new (t || MemberNotificationComponent)(); };
    MemberNotificationComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MemberNotificationComponent, selectors: [["ins-member-notification"]], inputs: { envUrl: "envUrl", notifications: "notifications", maxCount: "maxCount" }, outputs: { viewAll: "viewAll", markRead: "markRead", selectNotification: "selectNotification" }, decls: 8, vars: 3, consts: [[1, "widget-pack"], [1, "wp-head"], [1, "wp-title"], [1, "wp-body"], [4, "ngIf"], ["class", "neutral-info", "id", "no-notifications", 4, "ngIf"], ["class", "wp-foot", 4, "ngIf"], ["class", "avatar-block", 4, "ngFor", "ngForOf"], [1, "avatar-block"], [1, "ab-inner", 3, "click"], [1, "ab-fig"], ["alt", "No image", 3, "src"], [1, "ab-meta"], [1, "ab-label"], [1, "ab-stamp"], [1, "icn-cross-o", "ab-remove", 3, "click"], ["id", "no-notifications", 1, "neutral-info"], [1, "wp-foot"], ["class", "wp-link", 3, "click", 4, "ngIf"], [1, "wp-link", 3, "click"]], template: function MemberNotificationComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "section", 0);
            i0.ɵɵelementStart(1, "div", 1);
            i0.ɵɵelementStart(2, "h1", 2);
            i0.ɵɵtext(3, "Notifications");
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(4, "div", 3);
            i0.ɵɵtemplate(5, MemberNotificationComponent_ng_container_5_Template, 2, 1, "ng-container", 4);
            i0.ɵɵtemplate(6, MemberNotificationComponent_p_6_Template, 2, 0, "p", 5);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(7, MemberNotificationComponent_div_7_Template, 2, 1, "div", 6);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵadvance(5);
            i0.ɵɵproperty("ngIf", ctx.notifications == null ? null : ctx.notifications.length);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", !(ctx.notifications == null ? null : ctx.notifications.length));
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.notifications && (ctx.notifications == null ? null : ctx.notifications.length) > ctx.maxCount);
        } }, directives: [i1.NgIf, i1.NgForOf], pipes: [i2.NickNameFromBodyPipe, i3.TimeElapsedPipe], styles: ["a[_ngcontent-%COMP%]{text-decoration:none}*[_ngcontent-%COMP%]{font-family:Lato,sans-serif;outline:0}.widget-pack[_ngcontent-%COMP%]{background:#fff;border-radius:.5rem;padding:.9375rem}.wp-body[_ngcontent-%COMP%], .wp-foot[_ngcontent-%COMP%]{margin-top:.9375rem}.wp-title[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;color:#061a73;margin:0;font-family:Lato,sans-serif}.wp-link[_ngcontent-%COMP%]{color:#6e6f70;font-size:.875rem;cursor:pointer}.wp-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.avatar-block[_ngcontent-%COMP%]{align-items:center}.avatar-block[_ngcontent-%COMP%]   .ab-fig[_ngcontent-%COMP%]{width:2rem;height:2rem;border-radius:50%;margin:0 .75rem 0 0;flex:0 0 auto;position:relative;overflow:hidden;border:1px solid #e2e5e4;background:#fff}.avatar-block[_ngcontent-%COMP%]   .ab-fig[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{display:block;width:100%;height:100%;-o-object-fit:cover;object-fit:cover;image-rendering:auto}.avatar-block[_ngcontent-%COMP%]   .ab-meta[_ngcontent-%COMP%]{flex:1 1 auto}.avatar-block[_ngcontent-%COMP%]   .ab-label[_ngcontent-%COMP%]{color:#000;line-height:1.3;font-size:.75rem}.avatar-block[_ngcontent-%COMP%]   .ab-stamp[_ngcontent-%COMP%]{flex:0 0 auto;font-size:.75rem;margin-left:.625rem;color:#6e6f70;position:absolute;right:26px;top:2px}.avatar-block[_ngcontent-%COMP%]{background:#f8f9fb;border-radius:.625rem;padding:1.25rem .8125rem .75rem;min-height:3.625rem;position:relative;display:block}.avatar-block[_ngcontent-%COMP%]:not(:last-child){margin-bottom:.625rem}.avatar-block[_ngcontent-%COMP%]   .ab-inner[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer}.ab-remove[_ngcontent-%COMP%]{font-size:.625rem;color:#000;right:.3125rem;top:.3125rem;position:absolute;cursor:pointer}.neutral-info[_ngcontent-%COMP%]{color:#6e6f70;font-size:.8125rem}"] });
    return MemberNotificationComponent;
}());
export { MemberNotificationComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(MemberNotificationComponent, [{
        type: Component,
        args: [{
                selector: 'ins-member-notification',
                templateUrl: './member-notification.component.html',
                styleUrls: ['./member-notification.component.scss']
            }]
    }], function () { return []; }, { envUrl: [{
            type: Input
        }], notifications: [{
            type: Input
        }], maxCount: [{
            type: Input
        }], viewAll: [{
            type: Output
        }], markRead: [{
            type: Output
        }], selectNotification: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 