{"ast":null,"code":"import * as i0 from \"@angular/core\";\nimport * as i1 from \"src/app/shared/services/nav.service\";\nimport * as i2 from \"@angular/router\";\nconst _c0 = a0 => ({\n  \"mat-toolbar mat-primary activeMenu\": a0\n});\nfunction AppNavItemComponent_div_0_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\", 4);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const ctx_r0 = i0.ɵɵnextContext();\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate1(\" \", ctx_r0.item.navCap, \"\\n\");\n  }\n}\nfunction AppNavItemComponent_a_1_Template(rf, ctx) {\n  if (rf & 1) {\n    const _r2 = i0.ɵɵgetCurrentView();\n    i0.ɵɵelementStart(0, \"a\", 5);\n    i0.ɵɵlistener(\"click\", function AppNavItemComponent_a_1_Template_a_click_0_listener() {\n      i0.ɵɵrestoreView(_r2);\n      const ctx_r0 = i0.ɵɵnextContext();\n      return i0.ɵɵresetView(ctx_r0.onItemSelected(ctx_r0.item));\n    });\n    i0.ɵɵelement(1, \"i-tabler\", 6);\n    i0.ɵɵelementStart(2, \"span\", 7);\n    i0.ɵɵtext(3);\n    i0.ɵɵelementEnd()();\n  }\n  if (rf & 2) {\n    const ctx_r0 = i0.ɵɵnextContext();\n    i0.ɵɵproperty(\"ngClass\", i0.ɵɵpureFunction1(3, _c0, ctx_r0.item.route ? ctx_r0.router.isActive(ctx_r0.item.route, true) : false));\n    i0.ɵɵadvance();\n    i0.ɵɵpropertyInterpolate(\"name\", ctx_r0.item.iconName);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(ctx_r0.item.displayName);\n  }\n}\nfunction AppNavItemComponent_a_2_Template(rf, ctx) {\n  if (rf & 1) {\n    const _r3 = i0.ɵɵgetCurrentView();\n    i0.ɵɵelementStart(0, \"a\", 8);\n    i0.ɵɵlistener(\"click\", function AppNavItemComponent_a_2_Template_a_click_0_listener() {\n      i0.ɵɵrestoreView(_r3);\n      const ctx_r0 = i0.ɵɵnextContext();\n      return i0.ɵɵresetView(ctx_r0.toggleChildren(ctx_r0.item));\n    });\n    i0.ɵɵelement(1, \"i-tabler\", 6);\n    i0.ɵɵelementStart(2, \"span\", 7);\n    i0.ɵɵtext(3);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(4, \"mat-icon\", 9);\n    i0.ɵɵtext(5);\n    i0.ɵɵelementEnd()();\n  }\n  if (rf & 2) {\n    const ctx_r0 = i0.ɵɵnextContext();\n    i0.ɵɵadvance();\n    i0.ɵɵpropertyInterpolate(\"name\", ctx_r0.item.iconName);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(ctx_r0.item.displayName);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(ctx_r0.item.expanded ? \"expand_less\" : \"expand_more\");\n  }\n}\nfunction AppNavItemComponent_div_3_app_nav_item_1_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelement(0, \"app-nav-item\", 12);\n  }\n  if (rf & 2) {\n    const child_r4 = ctx.$implicit;\n    const ctx_r0 = i0.ɵɵnextContext(2);\n    i0.ɵɵproperty(\"item\", child_r4)(\"depth\", ctx_r0.depth + 1);\n  }\n}\nfunction AppNavItemComponent_div_3_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\", 10);\n    i0.ɵɵtemplate(1, AppNavItemComponent_div_3_app_nav_item_1_Template, 1, 2, \"app-nav-item\", 11);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const ctx_r0 = i0.ɵɵnextContext();\n    i0.ɵɵadvance();\n    i0.ɵɵproperty(\"ngForOf\", ctx_r0.item.children);\n  }\n}\nexport class AppNavItemComponent {\n  constructor(navService, router) {\n    this.navService = navService;\n    this.router = router;\n    if (this.depth === undefined) {\n      this.depth = 0;\n    }\n  }\n  ngOnChanges() {\n    this.navService.currentUrl.subscribe(url => {\n      if (this.item.route && url) {\n        // some logic to highlight the current route\n      }\n    });\n  }\n  onItemSelected(item) {\n    if (!item.children || !item.children.length) {\n      this.router.navigate([item.route]);\n    }\n    // scroll\n    document.querySelector('.page-wrapper')?.scroll({\n      top: 0,\n      left: 0\n    });\n  }\n  toggleChildren(item) {\n    item.expanded = !item.expanded;\n  }\n  static #_ = this.ɵfac = function AppNavItemComponent_Factory(t) {\n    return new (t || AppNavItemComponent)(i0.ɵɵdirectiveInject(i1.NavService), i0.ɵɵdirectiveInject(i2.Router));\n  };\n  static #_2 = this.ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n    type: AppNavItemComponent,\n    selectors: [[\"app-nav-item\"]],\n    inputs: {\n      item: \"item\",\n      depth: \"depth\"\n    },\n    features: [i0.ɵɵNgOnChangesFeature],\n    decls: 4,\n    vars: 4,\n    consts: [[\"class\", \"nav-caption\", 4, \"ngIf\"], [\"mat-list-item\", \"\", \"class\", \"menu-list-item\", 3, \"ngClass\", \"click\", 4, \"ngIf\"], [\"mat-list-item\", \"\", \"class\", \"menu-list-item\", 3, \"click\", 4, \"ngIf\"], [\"class\", \"nested-menu\", 4, \"ngIf\"], [1, \"nav-caption\"], [\"mat-list-item\", \"\", 1, \"menu-list-item\", 3, \"click\", \"ngClass\"], [\"matListItemIcon\", \"\", 1, \"routeIcon\", 3, \"name\"], [1, \"hide-menu\"], [\"mat-list-item\", \"\", 1, \"menu-list-item\", 3, \"click\"], [1, \"expand-icon\"], [1, \"nested-menu\"], [3, \"item\", \"depth\", 4, \"ngFor\", \"ngForOf\"], [3, \"item\", \"depth\"]],\n    template: function AppNavItemComponent_Template(rf, ctx) {\n      if (rf & 1) {\n        i0.ɵɵtemplate(0, AppNavItemComponent_div_0_Template, 2, 1, \"div\", 0)(1, AppNavItemComponent_a_1_Template, 4, 5, \"a\", 1)(2, AppNavItemComponent_a_2_Template, 6, 3, \"a\", 2)(3, AppNavItemComponent_div_3_Template, 2, 1, \"div\", 3);\n      }\n      if (rf & 2) {\n        i0.ɵɵproperty(\"ngIf\", ctx.item.navCap);\n        i0.ɵɵadvance();\n        i0.ɵɵproperty(\"ngIf\", !ctx.item.navCap && (!ctx.item.children || !ctx.item.children.length));\n        i0.ɵɵadvance();\n        i0.ɵɵproperty(\"ngIf\", ctx.item.children && ctx.item.children.length);\n        i0.ɵɵadvance();\n        i0.ɵɵproperty(\"ngIf\", ctx.item.children && ctx.item.children.length && ctx.item.expanded);\n      }\n    },\n    encapsulation: 2\n  });\n}","map":{"version":3,"names":["i0","ɵɵelementStart","ɵɵtext","ɵɵelementEnd","ɵɵadvance","ɵɵtextInterpolate1","ctx_r0","item","navCap","ɵɵlistener","AppNavItemComponent_a_1_Template_a_click_0_listener","ɵɵrestoreView","_r2","ɵɵnextContext","ɵɵresetView","onItemSelected","ɵɵelement","ɵɵproperty","ɵɵpureFunction1","_c0","route","router","isActive","ɵɵpropertyInterpolate","iconName","ɵɵtextInterpolate","displayName","AppNavItemComponent_a_2_Template_a_click_0_listener","_r3","toggleChildren","expanded","child_r4","depth","ɵɵtemplate","AppNavItemComponent_div_3_app_nav_item_1_Template","children","AppNavItemComponent","constructor","navService","undefined","ngOnChanges","currentUrl","subscribe","url","length","navigate","document","querySelector","scroll","top","left","_","ɵɵdirectiveInject","i1","NavService","i2","Router","_2","selectors","inputs","features","ɵɵNgOnChangesFeature","decls","vars","consts","template","AppNavItemComponent_Template","rf","ctx","AppNavItemComponent_div_0_Template","AppNavItemComponent_a_1_Template","AppNavItemComponent_a_2_Template","AppNavItemComponent_div_3_Template"],"sources":["C:\\Users\\Cem\\Desktop\\InventryUI-Client\\src\\app\\layouts\\full\\sidebar\\nav-item\\nav-item.component.ts","C:\\Users\\Cem\\Desktop\\InventryUI-Client\\src\\app\\layouts\\full\\sidebar\\nav-item\\nav-item.component.html"],"sourcesContent":["import { Component, Input, OnChanges } from '@angular/core';\nimport { NavItem } from './nav-item';\nimport { Router } from '@angular/router';\nimport { NavService } from 'src/app/shared/services/nav.service';\n\n@Component({\n  selector: 'app-nav-item',\n  templateUrl: './nav-item.component.html',\n  styleUrls: [],\n})\nexport class AppNavItemComponent implements OnChanges {\n  @Input() item: NavItem | any;\n  @Input() depth: any;\n\n  constructor(public navService: NavService, public router: Router) {\n    if (this.depth === undefined) {\n      this.depth = 0;\n    }\n  }\n\n  ngOnChanges() {\n    this.navService.currentUrl.subscribe((url: string) => {\n      if (this.item.route && url) {\n        // some logic to highlight the current route\n      }\n    });\n  }\n\n  onItemSelected(item: NavItem) {\n    if (!item.children || !item.children.length) {\n      this.router.navigate([item.route]);\n    }\n\n    // scroll\n    document.querySelector('.page-wrapper')?.scroll({\n      top: 0,\n      left: 0,\n    });\n  }\n\n  toggleChildren(item: NavItem) {\n    item.expanded = !item.expanded;\n  }\n}\n","<div *ngIf=\"item.navCap\" class=\"nav-caption\">\n  {{ item.navCap }}\n</div>\n<a\n  mat-list-item\n  (click)=\"onItemSelected(item)\"\n  [ngClass]=\"{\n    'mat-toolbar mat-primary activeMenu': item.route\n      ? router.isActive(item.route, true)\n      : false\n  }\"\n  class=\"menu-list-item\"\n  *ngIf=\"!item.navCap && (!item.children || !item.children.length)\"\n>\n  <i-tabler\n    class=\"routeIcon\"\n    name=\"{{ item.iconName }}\"\n    matListItemIcon\n  ></i-tabler>\n  <span class=\"hide-menu\">{{ item.displayName }}</span>\n</a>\n\n<a\n  mat-list-item\n  (click)=\"toggleChildren(item)\"\n  class=\"menu-list-item\"\n  *ngIf=\"item.children && item.children.length\"\n>\n  <i-tabler\n    class=\"routeIcon\"\n    name=\"{{ item.iconName }}\"\n    matListItemIcon\n  ></i-tabler>\n  <span class=\"hide-menu\">{{ item.displayName }}</span>\n  <mat-icon class=\"expand-icon\">{{ item.expanded ? 'expand_less' : 'expand_more' }}</mat-icon>\n</a>\n\n<div *ngIf=\"item.children && item.children.length && item.expanded\" class=\"nested-menu\">\n  <app-nav-item\n    *ngFor=\"let child of item.children\"\n    [item]=\"child\"\n    [depth]=\"depth + 1\"\n  ></app-nav-item>\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