import { Component } from '@angular/core';
import { LibConstants } from '../../models/LibConstants';
import { MyNotificationsPage } from '../../pages/popovers/my-notifications/my-notifications.page';
import { MyProfilePage } from '../../pages/popovers/my-profile/my-profile.page';
import { BasePage } from '../../pages/BasePage';
import * as i0 from "@angular/core";
import * as i1 from "@ionic/angular";
import * as i2 from "../../services/login/login.service";
import * as i3 from "../../services/notification/notification.service";
import * as i4 from "@angular/router";
import * as i5 from "../../services/util/util.service";
import * as i6 from "@angular/common";
import * as i7 from "primeng/tooltip";
import * as i8 from "primeng/accordion";
import * as i9 from "primeng/divider";
import * as i10 from "../profile/profile.component";
function MenuComponent_ion_menu_0_ion_menu_button_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ion-menu-button", 6);
    i0.ɵɵelement(1, "ion-icon", 7);
    i0.ɵɵelementEnd();
} }
function MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_ion_icon_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ion-icon", 16);
} }
function MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_ion_icon_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ion-icon", 17);
} if (rf & 2) {
    const item_r9 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵproperty("name", item_r9.icon);
} }
function MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_ion_button_5_ion_icon_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ion-icon", 21);
} }
function MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_ion_button_5_ion_icon_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ion-icon", 22);
} }
function MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_ion_button_5_Template(rf, ctx) { if (rf & 1) {
    const _r18 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "ion-button", 18);
    i0.ɵɵlistener("click", function MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_ion_button_5_Template_ion_button_click_0_listener($event) { i0.ɵɵrestoreView(_r18); const item_r9 = i0.ɵɵnextContext().$implicit; const ctx_r16 = i0.ɵɵnextContext(4); ctx_r16.markFavourite(item_r9); return i0.ɵɵresetView($event.stopPropagation()); });
    i0.ɵɵtemplate(1, MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_ion_button_5_ion_icon_1_Template, 1, 0, "ion-icon", 19)(2, MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_ion_button_5_ion_icon_2_Template, 1, 0, "ion-icon", 20);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const item_r9 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !item_r9.state.isFav);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", item_r9.state.isFav);
} }
function MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_Template(rf, ctx) { if (rf & 1) {
    const _r21 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "ion-item", 11);
    i0.ɵɵlistener("click", function MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_Template_ion_item_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r21); const item_r9 = restoredCtx.$implicit; const ctx_r20 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r20.openPage(item_r9)); });
    i0.ɵɵtemplate(1, MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_ion_icon_1_Template, 1, 0, "ion-icon", 12)(2, MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_ion_icon_2_Template, 1, 1, "ion-icon", 13);
    i0.ɵɵelementStart(3, "ion-label", 14);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(5, MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_ion_button_5_Template, 3, 2, "ion-button", 15);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const item_r9 = ctx.$implicit;
    const ctx_r8 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !item_r9.icon);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", item_r9.icon);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(item_r9.label);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r8.showFavButton);
} }
function MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p-accordionTab", 9)(1, "ion-list");
    i0.ɵɵtemplate(2, MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_ion_item_2_Template, 6, 4, "ion-item", 10);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const menu_r6 = ctx.$implicit;
    i0.ɵɵproperty("header", menu_r6.label);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngForOf", menu_r6.items);
} }
function MenuComponent_ion_menu_0_p_accordion_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p-accordion");
    i0.ɵɵtemplate(1, MenuComponent_ion_menu_0_p_accordion_6_p_accordionTab_1_Template, 3, 2, "p-accordionTab", 8);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(2, 1, ctx_r3.ls.getMenuBs()));
} }
function MenuComponent_ion_menu_0_div_7_div_1_ion_item_2_Template(rf, ctx) { if (rf & 1) {
    const _r30 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "ion-item", 11);
    i0.ɵɵlistener("click", function MenuComponent_ion_menu_0_div_7_div_1_ion_item_2_Template_ion_item_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r30); const item_r28 = restoredCtx.$implicit; const ctx_r29 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r29.openPage(item_r28)); });
    i0.ɵɵelementStart(1, "ion-label", 30);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const item_r28 = ctx.$implicit;
    const ctx_r27 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngClass", ctx_r27.showIcon(item_r28) ? "selected-menu" : "selected-menu-unselect");
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(item_r28.label);
} }
function MenuComponent_ion_menu_0_div_7_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div")(1, "ion-list");
    i0.ɵɵtemplate(2, MenuComponent_ion_menu_0_div_7_div_1_ion_item_2_Template, 3, 2, "ion-item", 10);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const menu_r24 = ctx.$implicit;
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngForOf", menu_r24.items);
} }
function MenuComponent_ion_menu_0_div_7_ion_badge_17_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ion-badge", 31)(1, "ion-label");
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r23 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r23.ns.notificationCount.getValue());
} }
function MenuComponent_ion_menu_0_div_7_Template(rf, ctx) { if (rf & 1) {
    const _r32 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div");
    i0.ɵɵtemplate(1, MenuComponent_ion_menu_0_div_7_div_1_Template, 3, 1, "div", 23);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵelement(3, "p-divider");
    i0.ɵɵelementStart(4, "ion-list")(5, "ion-item", 11);
    i0.ɵɵlistener("click", function MenuComponent_ion_menu_0_div_7_Template_ion_item_click_5_listener($event) { i0.ɵɵrestoreView(_r32); const ctx_r31 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r31.presentMyProfilePopover($event)); });
    i0.ɵɵelement(6, "ion-icon", 24);
    i0.ɵɵelementStart(7, "ion-label", 25);
    i0.ɵɵtext(8, "User Profile");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(9, "ion-item", 11);
    i0.ɵɵlistener("click", function MenuComponent_ion_menu_0_div_7_Template_ion_item_click_9_listener() { i0.ɵɵrestoreView(_r32); const ctx_r33 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r33.navigate("cp", "documents")); });
    i0.ɵɵelement(10, "i", 26);
    i0.ɵɵelementStart(11, "ion-label", 25);
    i0.ɵɵtext(12, "Documents");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(13, "ion-item", 11);
    i0.ɵɵlistener("click", function MenuComponent_ion_menu_0_div_7_Template_ion_item_click_13_listener($event) { i0.ɵɵrestoreView(_r32); const ctx_r34 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r34.presentMyNotificationPopover($event)); });
    i0.ɵɵelement(14, "ion-icon", 27);
    i0.ɵɵelementStart(15, "ion-label", 25);
    i0.ɵɵtext(16, "Notifications");
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(17, MenuComponent_ion_menu_0_div_7_ion_badge_17_Template, 3, 1, "ion-badge", 28);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(18, "ion-item", 11);
    i0.ɵɵlistener("click", function MenuComponent_ion_menu_0_div_7_Template_ion_item_click_18_listener() { i0.ɵɵrestoreView(_r32); const ctx_r35 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r35.logout()); });
    i0.ɵɵelement(19, "ion-icon", 29);
    i0.ɵɵelementStart(20, "ion-label", 25);
    i0.ɵɵtext(21, "Logout");
    i0.ɵɵelementEnd()()()();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(2, 2, ctx_r4.ls.getMenuBs()));
    i0.ɵɵadvance(16);
    i0.ɵɵproperty("ngIf", ctx_r4.ns.notificationCount.getValue() > 0);
} }
function MenuComponent_ion_menu_0_Template(rf, ctx) { if (rf & 1) {
    const _r37 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "ion-menu", 2);
    i0.ɵɵlistener("ionDidOpen", function MenuComponent_ion_menu_0_Template_ion_menu_ionDidOpen_0_listener() { i0.ɵɵrestoreView(_r37); const ctx_r36 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r36.menuOpened()); });
    i0.ɵɵelementStart(1, "ion-header")(2, "ion-toolbar")(3, "ion-buttons", 3);
    i0.ɵɵtemplate(4, MenuComponent_ion_menu_0_ion_menu_button_4_Template, 2, 0, "ion-menu-button", 4);
    i0.ɵɵelementEnd()()();
    i0.ɵɵelementStart(5, "ion-content");
    i0.ɵɵtemplate(6, MenuComponent_ion_menu_0_p_accordion_6_Template, 3, 3, "p-accordion", 5)(7, MenuComponent_ion_menu_0_div_7_Template, 22, 4, "div", 5);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(4);
    i0.ɵɵproperty("ngIf", ctx_r0.ls.isLoggedIn());
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r0.menus && ctx_r0.menus.length > 0 && (!ctx_r0.ls.isClaimant() || ctx_r0.legacyMenu == "true"));
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.menus && ctx_r0.menus.length > 0 && (ctx_r0.ls.isClaimant() && ctx_r0.legacyMenu == "false"));
} }
function MenuComponent_app_profile_1_Template(rf, ctx) { if (rf & 1) {
    const _r39 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "app-profile", 32);
    i0.ɵɵlistener("onCancel", function MenuComponent_app_profile_1_Template_app_profile_onCancel_0_listener() { i0.ɵɵrestoreView(_r39); const ctx_r38 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r38.showProfilePopup = !ctx_r38.showProfilePopup); });
    i0.ɵɵelementEnd();
} }
export class MenuComponent extends BasePage {
    constructor(nav, popup, ls, ns, r, menu, util, ar) {
        super();
        this.nav = nav;
        this.popup = popup;
        this.ls = ls;
        this.ns = ns;
        this.r = r;
        this.menu = menu;
        this.util = util;
        this.ar = ar;
        this.appVersion = LibConstants.appVersion;
        this.showFavButton = false;
        this.reRenderMenu = true;
        this.legacyMenu = LibConstants.legacyMenu;
        this.showProfilePopup = false;
    }
    ngOnInit() {
        this.setupUserMenu();
        this.showFavButton = this.ls.isCsr();
    }
    setMenu(user) {
        if (user) {
            this.ns.setupNotificationTimer();
            if (!this.ls.isClaimant() || this.legacyMenu == 'true') {
                this.loadMenu();
            }
            else {
                this.setClaimantMenu();
            }
        }
        else {
            this.menus = [];
            this.ns.removeNotificationTimer();
        }
        this.showFavButton = this.ls.isCsr();
    }
    setClaimantMenu() {
        console.log("STATE CHECK", this.isME());
        this.menus = [
            {
                label: "Menus",
                items: [
                    {
                        "label": "Home",
                        "state": {
                            "consortiumState": ["ms"],
                            "roles": ["claimant"],
                            "routerLink": "welcome",
                            "context": "cp",
                            "id": "menu-18"
                        }
                    },
                    ...(!this.isMS() ? [{
                            label: "Claims",
                            state: {
                                consortiumState: ["ms"],
                                roles: ["claimant"],
                                routerLink: "claimant-induction",
                                context: "cp",
                                id: "menu-19"
                            }
                        }] : []),
                    {
                        "label": "Weekly",
                        "state": {
                            "consortiumState": ["ms"],
                            "roles": ["claimant"],
                            "routerLink": "v3/weeklies",
                            "context": "cp",
                            "id": "menu-16"
                        }
                    },
                    {
                        "label": "History",
                        "state": {
                            "consortiumState": ["ms"],
                            "roles": ["claimant"],
                            "routerLink": "history",
                            "context": "cp",
                            "id": "menu-17"
                        }
                    }
                ]
            }
        ];
        this.ls.getMenuBs().next(this.menus);
    }
    loadMenu() {
        this.ls
            .getUserMenus()
            .subscribe(res => {
            this.menus = res;
            this.ls.getMenuBs().next(this.menus);
            this.fetchNotifications();
        }, err => {
            this.menus = [];
            this.ls.getMenuBs().next(null);
        });
    }
    fetchNotifications() {
        this.ns
            .getNotifications()
            .subscribe(res => {
            this.ns.notifications.next(res);
            this.ns.getUnreadNotificationCount();
        }, err => {
            this.ns.notificationCount.next(0);
            this.ns.notifications.next([]);
        });
    }
    setupUserMenu() {
        this.ls
            .getUserBs()
            .subscribe(user => {
            if (user && !user.is2FARequired) {
                this.setMenu(user);
            }
            else {
                this.menus = [];
                this.ns.removeNotificationTimer();
            }
        });
    }
    openPage(menu) {
        if (!menu) {
            return;
        }
        let appName = menu.state.app;
        let menuContextRoot = `/${menu.state.context}`;
        let pageToNavigate = menu.state.routerLink;
        if (appName == 'ben') {
            this.util.showLoader().then(() => {
                window.open(`${LibConstants.benefitsUrlExternal}${menuContextRoot}/${pageToNavigate}?a=${this.ls.getUser().access_token}&r=${this.ls.getUser().refresh_token}&v=2299`, '_self');
            });
        }
        else if (appName == 'tax') {
            this.util.showLoader().then(() => {
                window.open(`${LibConstants.taxUrlExternal}${menuContextRoot}/${pageToNavigate}?a=${this.ls.getUser().access_token}&r=${this.ls.getUser().refresh_token}&v=2299`, '_self');
            });
        }
        let currentContextRoot = this.util.getContextRoot();
        if (currentContextRoot == menuContextRoot) {
            this.r.navigateByUrl(`/${pageToNavigate}`);
        }
        else {
            this.util.openPageByContextRoot(menuContextRoot, menu.state.routerLink);
        }
        this.menu.close();
    }
    markFavourite(item) {
        if (item.state.isFav) {
            item.state.isFav = !item.state.isFav;
            this.ls
                .removeFav(item.state.id)
                .subscribe(res => {
                this.ls.getMenuBs().next(res);
                this.util.toast("Removed Favourite.");
            });
        }
        else {
            item.state.isFav = !item.state.isFav;
            this.ls
                .markFav(item.state.id)
                .subscribe(res => {
                this.ls.getMenuBs().next(res);
                this.util.toast("Marked Favourite.");
            });
        }
    }
    openHome() {
        this.nav.navigateRoot('/welcome');
    }
    menuOpened() {
        this.reRenderMenu = false;
        this.reRenderMenu = true;
    }
    showIcon(item) {
        let currentRoute = this.r.url.replace('/', '');
        return currentRoute.includes(item.state.routerLink);
    }
    navigate(contextRoot, uri) {
        let currentContextRoot = this.util.getContextRoot();
        let target = `/${contextRoot}`;
        if (currentContextRoot == target) {
            this.nav.navigateForward(`/${uri}`);
        }
        else {
            this.util.openPageByContextRoot(target, uri);
        }
        this.menu.close();
    }
    async presentMyNotificationPopover(event) {
        const popover = await this.popup.create({
            component: MyNotificationsPage,
            translucent: true,
            backdropDismiss: true,
            cssClass: 'header-popover'
        });
        popover.onDidDismiss().then(() => {
            this.ns.updateReadFlag();
        });
        this.menu.close();
        return await popover.present();
    }
    async presentMyProfilePopover(event) {
        if (this.ls.isClaimant()) {
            this.showProfilePopup = true;
            this.menu.close();
            return;
        }
        const popover = await this.popup.create({
            component: MyProfilePage,
            translucent: true,
            backdropDismiss: true,
            cssClass: 'header-popover'
        });
        return await popover.present();
    }
    logout() {
        this.nav.navigateRoot('/landing');
        this.ls.logout();
    }
    static { this.ɵfac = function MenuComponent_Factory(t) { return new (t || MenuComponent)(i0.ɵɵdirectiveInject(i1.NavController), i0.ɵɵdirectiveInject(i1.PopoverController), i0.ɵɵdirectiveInject(i2.LoginService), i0.ɵɵdirectiveInject(i3.NotificationService), i0.ɵɵdirectiveInject(i4.Router), i0.ɵɵdirectiveInject(i1.MenuController), i0.ɵɵdirectiveInject(i5.UtilService), i0.ɵɵdirectiveInject(i4.ActivatedRoute)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MenuComponent, selectors: [["app-menu"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [["side", "start", "menuId", "first", "contentId", "main-content", 3, "ionDidOpen", 4, "ngIf"], [3, "onCancel", 4, "ngIf"], ["side", "start", "menuId", "first", "contentId", "main-content", 3, "ionDidOpen"], ["slot", "start"], ["autoHide", "false", "pTooltip", "Close menu", "tooltipPosition", "bottom", 4, "ngIf"], [4, "ngIf"], ["autoHide", "false", "pTooltip", "Close menu", "tooltipPosition", "bottom"], ["color", "success", "name", "close"], [3, "header", 4, "ngFor", "ngForOf"], [3, "header"], ["button", "", "lines", "none", 3, "click", 4, "ngFor", "ngForOf"], ["button", "", "lines", "none", 3, "click"], ["name", "link", "color", "primary", "slot", "start", "style", "margin-inline-end: 15px !important;", 4, "ngIf"], ["color", "primary", "slot", "start", "style", "margin-inline-end: 15px !important;", 3, "name", 4, "ngIf"], ["color", "primary", 2, "font-size", "small"], ["slot", "end", "color", "warning", 3, "click", 4, "ngIf"], ["name", "link", "color", "primary", "slot", "start", 2, "margin-inline-end", "15px !important"], ["color", "primary", "slot", "start", 2, "margin-inline-end", "15px !important", 3, "name"], ["slot", "end", "color", "warning", 3, "click"], ["name", "star-outline", 4, "ngIf"], ["name", "star-sharp", 4, "ngIf"], ["name", "star-outline"], ["name", "star-sharp"], [4, "ngFor", "ngForOf"], ["name", "person-circle-outline", "slot", "start", "color", "primary", 1, "menu-icon"], ["color", "primary", 2, "font-size", "31px"], [1, "pi", "pi-file", 2, "color", "rgba(68, 120, 170, 1)", "padding-right", "15px"], ["name", "notifications-outline", "slot", "start", "color", "primary", 1, "menu-icon"], ["color", "dark", 4, "ngIf"], ["name", "log-out-outline", "slot", "start", "color", "primary", 1, "menu-icon"], ["color", "primary", 2, "font-size", "31px", 3, "ngClass"], ["color", "dark"], [3, "onCancel"]], template: function MenuComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, MenuComponent_ion_menu_0_Template, 8, 3, "ion-menu", 0)(1, MenuComponent_app_profile_1_Template, 1, 0, "app-profile", 1);
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.ls.isLoggedIn() && ctx.menus && ctx.menus.length > 0);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.showProfilePopup);
        } }, dependencies: [i1.IonBadge, i1.IonButton, i1.IonButtons, i1.IonContent, i1.IonHeader, i1.IonIcon, i1.IonItem, i1.IonLabel, i1.IonList, i1.IonMenu, i1.IonMenuButton, i1.IonToolbar, i6.NgClass, i6.NgForOf, i6.NgIf, i7.Tooltip, i8.Accordion, i8.AccordionTab, i9.Divider, i10.ProfileComponent, i6.AsyncPipe], styles: ["ion-menu[_ngcontent-%COMP%]   ion-content[_ngcontent-%COMP%]{--background: var(--ion-item-background, var(--ion-background-color, #fff))}ion-note[_ngcontent-%COMP%]{display:inline-block;font-size:16px;color:var(--ion-color-medium-shade)}ion-item.selected[_ngcontent-%COMP%]{--color: var(--ion-color-primary)}mat-expansion-panel-header[_ngcontent-%COMP%]{background:var(--ion-color-light)}.link[_ngcontent-%COMP%]{margin-right:25px;cursor:pointer;text-decoration:none;pointer-events:auto!important}.link[_ngcontent-%COMP%]:hover{color:var(--ion-color-yellow)!important}.footer-links[_ngcontent-%COMP%]{color:var(--ion-color-grey)!important}.header-links[_ngcontent-%COMP%]{color:var(--ion-color-primary)!important}.ios[_ngcontent-%COMP%]   ion-menu[_ngcontent-%COMP%]::part(container){padding-top:25px!important}.selected-menu[_ngcontent-%COMP%]{-webkit-text-decoration:underline 2px;text-decoration:underline 2px;text-underline-offset:3px;text-decoration-color:var(--ion-color-secondary)}.selected-menu-unselect[_ngcontent-%COMP%]{text-decoration:none}.menu-icon[_ngcontent-%COMP%]{margin-inline-end:15px!important;font-size:20px}[_nghost-%COMP%]     .p-accordion .p-accordion-content{padding:0!important}[_nghost-%COMP%]     .p-accordion .p-accordion-header .p-accordion-header-link{padding:1.25rem .5rem!important}[_nghost-%COMP%]     .p-accordion-header{background:var(--ion-color-light)!important}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MenuComponent, [{
        type: Component,
        args: [{ selector: 'app-menu', template: "<ion-menu side=\"start\" menuId=\"first\" contentId=\"main-content\" *ngIf=\"ls.isLoggedIn() && menus && menus.length > 0\" (ionDidOpen)=\"menuOpened()\">\r\n  <ion-header>\r\n    <ion-toolbar>\r\n      <ion-buttons slot=\"start\">\r\n        <ion-menu-button autoHide=\"false\" pTooltip=\"Close menu\" tooltipPosition=\"bottom\"\r\n              *ngIf=\"ls.isLoggedIn()\">    \r\n              <ion-icon color=\"success\" name=\"close\"></ion-icon>\r\n        </ion-menu-button>\r\n      </ion-buttons>\r\n    </ion-toolbar>\r\n  </ion-header>\r\n  <ion-content>\r\n    <p-accordion *ngIf=\"menus && menus.length > 0 && (!ls.isClaimant() || legacyMenu == 'true')\">\r\n      <p-accordionTab *ngFor=\"let menu of ls.getMenuBs() | async; let i = index\" [header]=\"menu.label\">\r\n        <ion-list>\r\n          <ion-item button *ngFor=\"let item of menu.items\" (click)=\"openPage(item)\" lines=\"none\">\r\n            <ion-icon name=\"link\" color=\"primary\" slot=\"start\" *ngIf=\"!item.icon\" style=\"margin-inline-end: 15px !important;\"></ion-icon>\r\n            <ion-icon [name]=\"item.icon\" color=\"primary\" slot=\"start\" *ngIf=\"item.icon\" style=\"margin-inline-end: 15px !important;\"></ion-icon>\r\n            <ion-label color=\"primary\" style=\"font-size: small;\">{{item.label}}</ion-label>\r\n            <ion-button slot=\"end\" (click)=\"markFavourite(item); $event.stopPropagation();\" color=\"warning\" *ngIf=\"showFavButton\">\r\n              <ion-icon name=\"star-outline\" *ngIf=\"!item.state.isFav\"></ion-icon>\r\n              <ion-icon name=\"star-sharp\" *ngIf=\"item.state.isFav\"></ion-icon>\r\n            </ion-button>\r\n          </ion-item>\r\n        </ion-list>\r\n      </p-accordionTab>\r\n    </p-accordion>\r\n\r\n    <div *ngIf=\"menus && menus.length > 0 && (ls.isClaimant() && legacyMenu == 'false')\">\r\n      <div *ngFor=\"let menu of ls.getMenuBs() | async; let i = index; let isLast = last\">\r\n        <ion-list>\r\n          <ion-item button *ngFor=\"let item of menu.items\" (click)=\"openPage(item)\" lines=\"none\">\r\n            <ion-label color=\"primary\" style=\"font-size: 31px;\" [ngClass]=\"showIcon(item) ? 'selected-menu' : 'selected-menu-unselect'\">{{item.label}}</ion-label>\r\n          </ion-item>\r\n        </ion-list>\r\n      </div>\r\n      <p-divider></p-divider>\r\n\r\n      <ion-list>\r\n        <ion-item button lines=\"none\" (click)=\"presentMyProfilePopover($event)\">\r\n          <ion-icon name=\"person-circle-outline\" slot=\"start\" class=\"menu-icon\" color=\"primary\"></ion-icon>\r\n          <ion-label color=\"primary\" style=\"font-size: 31px;\">User Profile</ion-label>\r\n        </ion-item>\r\n        <ion-item button lines=\"none\" (click)=\"navigate('cp', 'documents')\">\r\n          <i class='pi pi-file' style=\"color: rgba(68, 120, 170, 1); padding-right: 15px;\"></i>\r\n          <ion-label color=\"primary\" style=\"font-size: 31px;\">Documents</ion-label>\r\n        </ion-item>\r\n        <ion-item button lines=\"none\" (click)=\"presentMyNotificationPopover($event)\">\r\n          <ion-icon name=\"notifications-outline\" slot=\"start\" class=\"menu-icon\" color=\"primary\"></ion-icon>\r\n          <ion-label color=\"primary\" style=\"font-size: 31px;\">Notifications</ion-label>\r\n          <ion-badge color=\"dark\" *ngIf=\"ns.notificationCount.getValue() > 0\">\r\n            <ion-label>{{ns.notificationCount.getValue()}}</ion-label>\r\n          </ion-badge>\r\n        </ion-item>\r\n        <ion-item button lines=\"none\" (click)=\"logout()\">\r\n          <ion-icon name=\"log-out-outline\" slot=\"start\" class=\"menu-icon\" color=\"primary\"></ion-icon>\r\n          <ion-label color=\"primary\" style=\"font-size: 31px;\">Logout</ion-label>\r\n        </ion-item>\r\n      </ion-list>\r\n\r\n    </div>\r\n  </ion-content>\r\n</ion-menu>\r\n<app-profile *ngIf=\"showProfilePopup\" (onCancel)=\"showProfilePopup = !showProfilePopup\"></app-profile>", styles: ["ion-menu ion-content{--background: var(--ion-item-background, var(--ion-background-color, #fff))}ion-note{display:inline-block;font-size:16px;color:var(--ion-color-medium-shade)}ion-item.selected{--color: var(--ion-color-primary)}mat-expansion-panel-header{background:var(--ion-color-light)}.link{margin-right:25px;cursor:pointer;text-decoration:none;pointer-events:auto!important}.link:hover{color:var(--ion-color-yellow)!important}.footer-links{color:var(--ion-color-grey)!important}.header-links{color:var(--ion-color-primary)!important}.ios ion-menu::part(container){padding-top:25px!important}.selected-menu{-webkit-text-decoration:underline 2px;text-decoration:underline 2px;text-underline-offset:3px;text-decoration-color:var(--ion-color-secondary)}.selected-menu-unselect{text-decoration:none}.menu-icon{margin-inline-end:15px!important;font-size:20px}:host ::ng-deep .p-accordion .p-accordion-content{padding:0!important}:host ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{padding:1.25rem .5rem!important}:host ::ng-deep .p-accordion-header{background:var(--ion-color-light)!important}\n"] }]
    }], () => [{ type: i1.NavController }, { type: i1.PopoverController }, { type: i2.LoginService }, { type: i3.NotificationService }, { type: i4.Router }, { type: i1.MenuController }, { type: i5.UtilService }, { type: i4.ActivatedRoute }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MenuComponent, { className: "MenuComponent", filePath: "lib\\components\\menu\\menu.component.ts", lineNumber: 19 }); })();
//# sourceMappingURL=data:application/json;base64, 