import { Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ironsource/fusion-ui/components/icon/v1";
function MenuItemComponent_fusion_icon_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-icon", 3);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("name", ctx_r0.item.icon);
} }
const _c0 = () => ({ iconName: "arrow-right", iconVersion: "v1" });
function MenuItemComponent_i_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "i", 4);
    i0.ɵɵelement(1, "fusion-icon", 5);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    i0.ɵɵadvance();
    i0.ɵɵproperty("name", i0.ɵɵpureFunction0(1, _c0));
} }
export class MenuItemComponent {
    constructor() { }
    onMenuItemClicked($event) {
        if (!$event.metaKey) {
            $event.preventDefault();
        }
        else {
            $event.stopPropagation();
        }
    }
    static { this.ɵfac = function MenuItemComponent_Factory(t) { return new (t || MenuItemComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MenuItemComponent, selectors: [["fusion-menu-item"]], inputs: { item: "item" }, decls: 5, vars: 5, consts: [["class", "item-icon", 3, "name", 4, "ngIf"], [1, "fu-menu-item-link", 3, "href", "target", "click"], ["class", "icon-expand", 4, "ngIf"], [1, "item-icon", 3, "name"], [1, "icon-expand"], [3, "name"]], template: function MenuItemComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, MenuItemComponent_fusion_icon_0_Template, 1, 1, "fusion-icon", 0);
            i0.ɵɵelementStart(1, "a", 1);
            i0.ɵɵlistener("click", function MenuItemComponent_Template_a_click_1_listener($event) { return ctx.onMenuItemClicked($event); });
            i0.ɵɵelementStart(2, "label");
            i0.ɵɵtext(3);
            i0.ɵɵelementEnd()();
            i0.ɵɵtemplate(4, MenuItemComponent_i_4_Template, 2, 2, "i", 2);
        } if (rf & 2) {
            let tmp_2_0;
            i0.ɵɵproperty("ngIf", ctx.item.icon);
            i0.ɵɵadvance();
            i0.ɵɵproperty("href", ctx.item.route || ctx.item.redirect, i0.ɵɵsanitizeUrl)("target", (tmp_2_0 = ctx.item.target) !== null && tmp_2_0 !== undefined ? tmp_2_0 : "_self");
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate(ctx.item.name);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.item.children);
        } }, dependencies: [i1.NgIf, i2.IconComponent], styles: ["[_nghost-%COMP%]   .link-container[_ngcontent-%COMP%]{position:absolute;right:21px}[_nghost-%COMP%]   a.fu-menu-item-link[_ngcontent-%COMP%]{text-decoration:none;color:var(--layout-menu-item-color, var(--light-color-100, #F9FAFB));font-size:13px;font-weight:400}[_nghost-%COMP%]   a.fu-menu-item-link[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{cursor:pointer}.active[_nghost-%COMP%]   a.fu-menu-item-link[_ngcontent-%COMP%]{color:var(--layout-menu-item-active-color, var(--primary-color, #3091F6))}.active[_nghost-%COMP%]   a.fu-menu-item-link[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{cursor:default}[_nghost-%COMP%]   fusion-icon[_ngcontent-%COMP%]{left:20px;top:17px;position:absolute}[_nghost-%COMP%]   fusion-icon[_ngcontent-%COMP%]     svg{width:15px;height:15px}[_nghost-%COMP%]   fusion-icon[_ngcontent-%COMP%]     svg *{fill:currentColor}fusion-menu.collapsed[_nghost-%COMP%]   label[_ngcontent-%COMP%], fusion-menu.collapsed   [_nghost-%COMP%]   label[_ngcontent-%COMP%]{transition:opacity .3s ease;opacity:0}fusion-menu.collapsed.opened[_nghost-%COMP%]   label[_ngcontent-%COMP%], fusion-menu.collapsed.opened   [_nghost-%COMP%]   label[_ngcontent-%COMP%]{opacity:1}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MenuItemComponent, [{
        type: Component,
        args: [{ selector: 'fusion-menu-item', template: "<fusion-icon class=\"item-icon\" *ngIf=\"item.icon\" [name]=\"item.icon\"></fusion-icon>\n<a [href]=\"item.route || item.redirect\"\n   [target]=\"item.target ?? '_self'\"\n   (click)=\"onMenuItemClicked($event)\"\n   class=\"fu-menu-item-link\"\n>\n    <label>{{item.name}}</label>\n</a>\n<i class=\"icon-expand\" *ngIf=\"item.children\">\n    <fusion-icon [name]=\"{iconName: 'arrow-right', iconVersion: 'v1'}\"></fusion-icon>\n</i>\n", styles: [":host .link-container{position:absolute;right:21px}:host a.fu-menu-item-link{text-decoration:none;color:var(--layout-menu-item-color, var(--light-color-100, #F9FAFB));font-size:13px;font-weight:400}:host a.fu-menu-item-link label{cursor:pointer}:host.active a.fu-menu-item-link{color:var(--layout-menu-item-active-color, var(--primary-color, #3091F6))}:host.active a.fu-menu-item-link label{cursor:default}:host fusion-icon{left:20px;top:17px;position:absolute}:host fusion-icon ::ng-deep svg{width:15px;height:15px}:host fusion-icon ::ng-deep svg *{fill:currentColor}:host-context(fusion-menu.collapsed) label{transition:opacity .3s ease;opacity:0}:host-context(fusion-menu.collapsed.opened) label{opacity:1}\n"] }]
    }], () => [], { item: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MenuItemComponent, { className: "MenuItemComponent", filePath: "components/menu-item/menu-item.component.ts", lineNumber: 9 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVudS1pdGVtLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Z1c2lvbi11aS9jb21wb25lbnRzL21lbnUvdjEvY29tcG9uZW50cy9tZW51LWl0ZW0vbWVudS1pdGVtLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Z1c2lvbi11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