import { Component, EventEmitter, Input, Output } from '@angular/core';
import { JOIN_BUTTON_TEXTS } from '../inspire-library.const';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
function CommunityHeaderComponent_div_1_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelement(1, "span", 16);
    i0.ɵɵelementStart(2, "a", 17);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵpropertyInterpolate1("href", "/groups/", ctx_r4.community == null ? null : ctx_r4.community.name_id, "/", i0.ɵɵsanitizeUrl);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", ctx_r4.community == null ? null : ctx_r4.community.name, " ");
} }
function CommunityHeaderComponent_div_1_ng_container_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelement(1, "span", 16);
    i0.ɵɵelementStart(2, "a", 18);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r5 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵpropertyInterpolate1("href", "/groups/", ctx_r5.community == null ? null : ctx_r5.community.name_id, "/", i0.ɵɵsanitizeUrl);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", ctx_r5.community == null ? null : ctx_r5.community.topics[0] == null ? null : ctx_r5.community.topics[0].name, " ");
} }
function CommunityHeaderComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 13);
    i0.ɵɵelementStart(1, "a", 14);
    i0.ɵɵtext(2, "Inspire");
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(3, CommunityHeaderComponent_div_1_ng_container_3_Template, 4, 2, "ng-container", 15);
    i0.ɵɵtemplate(4, CommunityHeaderComponent_div_1_ng_container_4_Template, 4, 2, "ng-container", 15);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngIf", ctx_r0.showCommunityBreadcrumb);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.showTopicBreadcrumb && (ctx_r0.community == null ? null : ctx_r0.community.topics == null ? null : ctx_r0.community.topics.length));
} }
function CommunityHeaderComponent_ul_7_li_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "li", 21);
    i0.ɵɵelementStart(1, "a", 22);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const link_r7 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("href", link_r7.link, i0.ɵɵsanitizeUrl);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(link_r7.label);
} }
function CommunityHeaderComponent_ul_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ul", 19);
    i0.ɵɵtemplate(1, CommunityHeaderComponent_ul_7_li_1_Template, 3, 2, "li", 20);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngForOf", ctx_r1.community == null ? null : ctx_r1.community.cs_data == null ? null : ctx_r1.community.cs_data.heading_links == null ? null : ctx_r1.community.cs_data.heading_links.links);
} }
function CommunityHeaderComponent_button_9_Template(rf, ctx) { if (rf & 1) {
    const _r9 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 23);
    i0.ɵɵlistener("click", function CommunityHeaderComponent_button_9_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r9); const ctx_r8 = i0.ɵɵnextContext(); return ctx_r8.onGoBack(); });
    i0.ɵɵelementEnd();
} }
const _c0 = function (a0) { return { "background": a0 }; };
function CommunityHeaderComponent_button_13_Template(rf, ctx) { if (rf & 1) {
    const _r11 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 24);
    i0.ɵɵlistener("click", function CommunityHeaderComponent_button_13_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r11); const ctx_r10 = i0.ɵɵnextContext(); return ctx_r10.onToggleMobileResourcesView(); });
    i0.ɵɵtext(1, " Resources ");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(1, _c0, ctx_r3.community == null ? null : ctx_r3.community.assets == null ? null : ctx_r3.community.assets.accent_color));
} }
const _c1 = function (a0, a1) { return { "icn-community": a0, "icn-checked": a1 }; };
export class CommunityHeaderComponent {
    constructor() {
        this.isLoggedIn = false;
        this.hasJoinedCommunity = false;
        this.isMobile = false;
        this.communitySectionLinks = [];
        this.showBack = false;
        this.showCommunityBreadcrumb = false;
        this.showTopicBreadcrumb = false;
        this.post = new EventEmitter();
        this.join = new EventEmitter();
        this.toggleMobileResourcesView = new EventEmitter();
        this.back = new EventEmitter();
        this.joinButtonText = '';
    }
    ngOnInit() {
    }
    ngOnChanges() {
        this.setJoinButtonText();
    }
    setJoinButtonText() {
        const bits = `${+this.isLoggedIn}${+this.hasJoinedCommunity}${+this.isMobile}`;
        this.joinButtonText = JOIN_BUTTON_TEXTS[bits];
    }
    onPost() {
        this.post.emit();
    }
    onJoin() {
        this.join.emit();
    }
    onToggleMobileResourcesView() {
        this.toggleMobileResourcesView.emit();
    }
    onGoBack() {
        this.back.emit();
    }
}
CommunityHeaderComponent.ɵfac = function CommunityHeaderComponent_Factory(t) { return new (t || CommunityHeaderComponent)(); };
CommunityHeaderComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CommunityHeaderComponent, selectors: [["ins-community-header"]], inputs: { isLoggedIn: "isLoggedIn", hasJoinedCommunity: "hasJoinedCommunity", community: "community", communitySubtitle: "communitySubtitle", isMobile: "isMobile", communitySectionLinks: "communitySectionLinks", showBack: "showBack", showCommunityBreadcrumb: "showCommunityBreadcrumb", showTopicBreadcrumb: "showTopicBreadcrumb" }, outputs: { post: "post", join: "join", toggleMobileResourcesView: "toggleMobileResourcesView", back: "back" }, features: [i0.ɵɵNgOnChangesFeature], decls: 16, vars: 16, consts: [[1, "community-header"], ["class", "ch-breadcrumbs", 4, "ngIf"], [1, "ch-title"], [1, "ch-desc"], ["id", "community-description-link", "target", "_blank"], ["class", "ch-links", 4, "ngIf"], [1, "ch-btn-group"], ["class", "ch-back icn-arrow-left", 3, "click", 4, "ngIf"], ["type", "button", "id", "join_button", 1, "ch-action-btn", 3, "ngStyle", "disabled", "click"], [1, "bttn-icon", 3, "ngClass"], ["id", "community-resources-button", "class", "ch-action-btn ch-resource-btn", "type", "button", 3, "ngStyle", "click", 4, "ngIf"], ["type", "button", "id", "post_button", 1, "ch-create-btn", 3, "click"], [1, "icn-edit"], [1, "ch-breadcrumbs"], ["id", "breadcrumb-inspire", "href", "/", 1, "ch-b-item"], [4, "ngIf"], [1, "ch-b-icon", "icn-arrow-right"], ["id", "breadcrumb-community", 1, "ch-b-item", 3, "href"], ["id", "breadcrumb-topic", 1, "ch-b-item", 3, "href"], [1, "ch-links"], ["class", "ch-l-item", 4, "ngFor", "ngForOf"], [1, "ch-l-item"], [1, "ch-l-link", 3, "href"], [1, "ch-back", "icn-arrow-left", 3, "click"], ["id", "community-resources-button", "type", "button", 1, "ch-action-btn", "ch-resource-btn", 3, "ngStyle", "click"]], template: function CommunityHeaderComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵtemplate(1, CommunityHeaderComponent_div_1_Template, 5, 2, "div", 1);
        i0.ɵɵelementStart(2, "h1", 2);
        i0.ɵɵtext(3);
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(4, "p", 3);
        i0.ɵɵelementStart(5, "a", 4);
        i0.ɵɵtext(6);
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(7, CommunityHeaderComponent_ul_7_Template, 2, 1, "ul", 5);
        i0.ɵɵelementStart(8, "div", 6);
        i0.ɵɵtemplate(9, CommunityHeaderComponent_button_9_Template, 1, 0, "button", 7);
        i0.ɵɵelementStart(10, "button", 8);
        i0.ɵɵlistener("click", function CommunityHeaderComponent_Template_button_click_10_listener() { return ctx.onJoin(); });
        i0.ɵɵelement(11, "i", 9);
        i0.ɵɵtext(12);
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(13, CommunityHeaderComponent_button_13_Template, 2, 3, "button", 10);
        i0.ɵɵelementStart(14, "button", 11);
        i0.ɵɵlistener("click", function CommunityHeaderComponent_Template_button_click_14_listener() { return ctx.onPost(); });
        i0.ɵɵelement(15, "i", 12);
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.showCommunityBreadcrumb || ctx.showTopicBreadcrumb);
        i0.ɵɵadvance(2);
        i0.ɵɵtextInterpolate(ctx.community == null ? null : ctx.community.name);
        i0.ɵɵadvance(2);
        i0.ɵɵattribute("href", (ctx.community == null ? null : ctx.community.assets == null ? null : ctx.community.assets.partners[0] == null ? null : ctx.community.assets.partners[0].url) || null, i0.ɵɵsanitizeUrl);
        i0.ɵɵadvance(1);
        i0.ɵɵtextInterpolate(ctx.communitySubtitle);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", !ctx.isMobile && (ctx.community == null ? null : ctx.community.cs_data == null ? null : ctx.community.cs_data.heading_links == null ? null : ctx.community.cs_data.heading_links.links == null ? null : ctx.community.cs_data.heading_links.links.length));
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", ctx.showBack);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(11, _c0, ctx.community == null ? null : ctx.community.assets == null ? null : ctx.community.assets.accent_color))("disabled", ctx.hasJoinedCommunity);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(13, _c1, !ctx.hasJoinedCommunity, ctx.hasJoinedCommunity));
        i0.ɵɵadvance(1);
        i0.ɵɵtextInterpolate1(" ", ctx.joinButtonText, " ");
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.isMobile && (ctx.communitySectionLinks == null ? null : ctx.communitySectionLinks.length));
    } }, directives: [i1.NgIf, i1.NgStyle, i1.NgClass, i1.NgForOf], styles: ["a[_ngcontent-%COMP%]{text-decoration:none}*[_ngcontent-%COMP%]{font-family:Lato,sans-serif;outline:0}@font-face{font-family:ins-icons;src:url(/assets/fonts/icons/ins-icons.ttf?nf14g1) format(\"truetype\"),url(/assets/fonts/icons/ins-icons.woff?nf14g1) format(\"woff\"),url(/assets/fonts/icons/ins-icons.svg?nf14g1#ins-icons) format(\"svg\");font-weight:400;font-style:normal;font-display:block}.ins-icon[_ngcontent-%COMP%], [class*=\" icn-\"][_ngcontent-%COMP%], [class^=icn-][_ngcontent-%COMP%]{font-family:ins-icons!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icn-minus-o[_ngcontent-%COMP%]:before{content:\"\\e93a\"}.icn-disclaimer[_ngcontent-%COMP%]:before{content:\"\\e934\"}.icn-leave-community[_ngcontent-%COMP%]:before{content:\"\\e935\"}.icn-stethoscope[_ngcontent-%COMP%]:before{content:\"\\e936\"}.icn-join-community[_ngcontent-%COMP%]:before{content:\"\\e937\"}.icn-resources[_ngcontent-%COMP%]:before{content:\"\\e938\"}.icn-help[_ngcontent-%COMP%]:before{content:\"\\e939\"}.icn-checked[_ngcontent-%COMP%]:before{content:\"\\e933\"}.icn-plus[_ngcontent-%COMP%]:before{content:\"\\e932\"}.icn-expand[_ngcontent-%COMP%]:before{content:\"\\e931\"}.icn-Invite[_ngcontent-%COMP%]:before{content:\"\\e930\"}.icn-report[_ngcontent-%COMP%]:before{content:\"\\e92f\"}.icn-unfollow[_ngcontent-%COMP%]:before{content:\"\\e92e\"}.icn-block[_ngcontent-%COMP%]:before{content:\"\\e92d\"}.icn-trash[_ngcontent-%COMP%]:before{content:\"\\e92b\"}.icn-follow[_ngcontent-%COMP%]:before{content:\"\\e92c\"}.icn-lock[_ngcontent-%COMP%]:before{content:\"\\e92a\"}.icn-bolt-left[_ngcontent-%COMP%]:before{content:\"\\e925\"}.icn-bolt-right[_ngcontent-%COMP%]:before{content:\"\\e926\"}.icn-bolt-down[_ngcontent-%COMP%]:before{content:\"\\e927\"}.icn-bolt-up[_ngcontent-%COMP%]:before{content:\"\\e928\"}.icn-img-o[_ngcontent-%COMP%]:before{content:\"\\e929\"}.icn-tick[_ngcontent-%COMP%]:before{content:\"\\e924\"}.icn-tick-o[_ngcontent-%COMP%]:before{content:\"\\e923\"}.icn-cross-o[_ngcontent-%COMP%]:before{content:\"\\e922\"}.icn-plus-o[_ngcontent-%COMP%]:before{content:\"\\e921\"}.icn-hide[_ngcontent-%COMP%]:before{content:\"\\e920\"}.icn-menu[_ngcontent-%COMP%]:before{content:\"\\e900\"}.icn-more[_ngcontent-%COMP%]:before{content:\"\\e901\"}.icn-msgs[_ngcontent-%COMP%]:before{content:\"\\e902\"}.icn-pin[_ngcontent-%COMP%]:before{content:\"\\e903\"}.icn-reply[_ngcontent-%COMP%]:before{content:\"\\e904\"}.icn-search[_ngcontent-%COMP%]:before{content:\"\\e905\"}.icn-settings[_ngcontent-%COMP%]:before{content:\"\\e906\"}.icn-treatment[_ngcontent-%COMP%]:before{content:\"\\e907\"}.icn-aid[_ngcontent-%COMP%]:before{content:\"\\e908\"}.icn-apple[_ngcontent-%COMP%]:before{content:\"\\e909\"}.icn-arrow-down[_ngcontent-%COMP%]:before{content:\"\\e90a\"}.icn-arrow-up[_ngcontent-%COMP%]:before{content:\"\\e91d\"}.icn-arrow-left[_ngcontent-%COMP%]:before{content:\"\\e91e\"}.icn-arrow-right[_ngcontent-%COMP%]:before{content:\"\\e91f\"}.icn-bell[_ngcontent-%COMP%]:before{content:\"\\e90b\"}.icn-bookmark-o[_ngcontent-%COMP%]:before{content:\"\\e90c\"}.icn-calendar[_ngcontent-%COMP%]:before{content:\"\\e90d\"}.icn-check[_ngcontent-%COMP%]:before{content:\"\\e90e\"}.icn-community[_ngcontent-%COMP%]:before{content:\"\\e90f\"}.icn-d-arrow-up[_ngcontent-%COMP%]:before{content:\"\\e910\"}.icn-discussion[_ngcontent-%COMP%]:before{content:\"\\e911\"}.icn-edit[_ngcontent-%COMP%]:before{content:\"\\e912\"}.icn-facebook[_ngcontent-%COMP%]:before{content:\"\\e913\"}.icn-filters[_ngcontent-%COMP%]:before{content:\"\\e914\"}.icn-friends[_ngcontent-%COMP%]:before{content:\"\\e915\"}.icn-google[_ngcontent-%COMP%]:before{content:\"\\e916\"}.icn-heart[_ngcontent-%COMP%]:before{content:\"\\e917\"}.icn-home[_ngcontent-%COMP%]:before{content:\"\\e918\"}.icn-img[_ngcontent-%COMP%]:before{content:\"\\e919\"}.icn-inspire[_ngcontent-%COMP%]:before{content:\"\\e91a\"}.icn-journal[_ngcontent-%COMP%]:before{content:\"\\e91b\"}.icn-like[_ngcontent-%COMP%]:before{content:\"\\e91c\"}.ch-action-btn[_ngcontent-%COMP%], .ch-create-btn[_ngcontent-%COMP%]{border:none;border-radius:.5rem;font-size:1rem;line-height:1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0 1rem;transition:.3s ease-in-out}.ch-action-btn[_ngcontent-%COMP%]:hover, .ch-create-btn[_ngcontent-%COMP%]:hover{background:#f8f9fb}.ch-action-btn[disabled][_ngcontent-%COMP%], .ch-create-btn[disabled][_ngcontent-%COMP%]{background:#c6cbc9;color:#6e6f70;cursor:default}.ch-action-btn[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{margin-right:.875rem;font-size:1rem}.ch-create-btn[_ngcontent-%COMP%]{background:#009dfc;color:#fff}.ch-create-btn[_ngcontent-%COMP%]:not([disabled]):hover{background:#008de3}.community-header[_ngcontent-%COMP%]{padding:20px 0 25px;border-bottom:1px solid #e2e5e4}.ch-breadcrumbs[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;color:#6e6f70;align-items:center;margin-bottom:15px}.ch-b-item[_ngcontent-%COMP%]{font-size:12px;color:#6e6f70}a.ch-b-item[_ngcontent-%COMP%]{cursor:pointer}a.ch-b-item[_ngcontent-%COMP%]:hover{text-decoration:underline}.ch-b-icon[_ngcontent-%COMP%]{margin:0 7px;font-size:10px}.ch-btn-group[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;margin-top:20px}.ch-back[_ngcontent-%COMP%]{font-size:1.5625rem;cursor:pointer;margin-right:auto;background:0 0;border:none}@media (max-width:1299px){.community-header[_ngcontent-%COMP%]{border:none}.ch-back[_ngcontent-%COMP%]{display:none}}.ch-title[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;font-family:Palanquin,sans-serif;color:#000;font-size:1.6875rem;font-weight:500;margin:0 0 10px;text-align:center}@media (max-width:767px){.ch-title[_ngcontent-%COMP%]{font-size:16px;margin:0 0 5px}}.ch-desc[_ngcontent-%COMP%]{font-size:14px;color:#6e6f70;margin:0;text-align:center}.ch-desc[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:#6e6f70}.ch-desc[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{text-decoration:underline}.ch-action-btn[_ngcontent-%COMP%]{height:3.75rem;background:#005cc9;color:#fff;flex:0 0 auto;min-width:11.25rem}.ch-action-btn[_ngcontent-%COMP%]:hover{background:#005cc9}.ch-action-btn[disabled][_ngcontent-%COMP%]{background:#005cc9;color:#fff}@media (max-width:767px){.ch-desc[_ngcontent-%COMP%]{margin:0 0 10px;font-size:10px}.ch-action-btn[_ngcontent-%COMP%]{flex:1 1 auto;height:30px;border-radius:6px;font-size:12px;font-weight:700;min-width:0;width:100%}}.ch-resource-btn[_ngcontent-%COMP%]{margin-left:.625rem}.ch-create-btn[_ngcontent-%COMP%]{width:3.75rem;height:3.75rem;margin-left:.625rem;flex:0 0 auto}.ch-links[_ngcontent-%COMP%]{list-style:none;margin:10px 0 0;padding:0;display:flex;align-items:center;color:#6e6f70;font-size:14px;justify-content:center;flex-wrap:wrap}@media (max-width:767px){.ch-create-btn[_ngcontent-%COMP%]{order:2;width:1.875rem;height:1.875rem;border-radius:6px}.ch-links[_ngcontent-%COMP%]{display:none}}.ch-l-item[_ngcontent-%COMP%]{margin-bottom:10px}.ch-l-item[_ngcontent-%COMP%]:not(:first-child){border-left:1px solid #c6cbc9}.ch-l-link[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:0 10px;color:#6e6f70}.ch-l-link[_ngcontent-%COMP%]:hover{text-decoration:underline}"] });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(CommunityHeaderComponent, [{
        type: Component,
        args: [{
                selector: 'ins-community-header',
                templateUrl: './community-header.component.html',
                styleUrls: ['./community-header.component.scss']
            }]
    }], function () { return []; }, { isLoggedIn: [{
            type: Input
        }], hasJoinedCommunity: [{
            type: Input
        }], community: [{
            type: Input
        }], communitySubtitle: [{
            type: Input
        }], isMobile: [{
            type: Input
        }], communitySectionLinks: [{
            type: Input
        }], showBack: [{
            type: Input
        }], showCommunityBreadcrumb: [{
            type: Input
        }], showTopicBreadcrumb: [{
            type: Input
        }], post: [{
            type: Output
        }], join: [{
            type: Output
        }], toggleMobileResourcesView: [{
            type: Output
        }], back: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 