{"version":3,"file":"bloomreach-brie-tree.mjs","sources":["../../../../projects/brie/tree/models/tree.ts","../../../../projects/brie/tree/components/tree.component.ts","../../../../projects/brie/tree/components/tree.component.html","../../../../projects/brie/tree/tree.module.ts","../../../../projects/brie/tree/public-api.ts","../../../../projects/brie/tree/bloomreach-brie-tree.ts"],"sourcesContent":["/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface BrieTreeSubMenuItem {\n  id: string;\n  title: string;\n}\n\nexport interface BrieTreeDefaultConfig {\n  draggable?: boolean;\n  subMenu?: BrieTreeSubMenuItem[];\n  actions?: BrieTreeAction[];\n  expandAll?: boolean;\n  dragAboveRoot?: boolean\n}\n\nexport interface BrieTreeConfig {\n  defaults: BrieTreeDefaultConfig;\n}\n\nexport interface BrieTreeNode<T = any> extends BrieTreeDefaultConfig {\n  id?: string;\n  title: string;\n  subTitle?: string;\n  children?: BrieTreeNode<T>[];\n  data?: T; // holds extra data to pass along with the node\n}\n\nexport interface BrieTreeAction {\n  id: string;\n  icon: {\n    name: string;\n    fontSet?: string;\n  };\n  tooltip?: string;\n}\n\nexport interface BrieTreeNodeClick {\n  event: MouseEvent;\n  treeNode: BrieTreeNode;\n}\n\nexport interface BrieTreeSubMenuClick extends BrieTreeNodeClick {\n  subMenuItem: BrieTreeSubMenuItem;\n}\n\nexport interface BrieTreeActionClick extends BrieTreeNodeClick {\n  actionItem: BrieTreeAction;\n}\n\nexport interface BrieTreeFlatNode {\n  expandable: boolean;\n  title: string;\n  subTitle: string;\n  level: number;\n  subMenu: BrieTreeSubMenuItem[];\n  id: string;\n  draggable: boolean;\n  actions: BrieTreeAction[];\n}\n\nexport interface BrieTreeUpdated {\n  event: BrieTreeNodeEvent;\n  nodes: BrieTreeNode[];\n}\n\nexport enum BrieTreeNodeEvent {\n  MOVED = 'MOVED',\n  ADDED = 'ADDED',\n  EDITED = 'EDITED',\n  DELETED = 'DELETED',\n  PASTED = 'PASTED'\n}\n","/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  Component,\n  ElementRef,\n  EventEmitter,\n  Inject,\n  Input,\n  OnChanges,\n  OnDestroy,\n  OnInit,\n  Output,\n  ViewChild,\n  DOCUMENT,\n  ChangeDetectionStrategy,\n} from '@angular/core';\nimport { FlatTreeControl } from '@angular/cdk/tree';\nimport { MatTreeFlatDataSource, MatTreeFlattener, MatTreeModule } from '@angular/material/tree';\nimport { CdkDragDrop, CdkDragMove, CdkDragStart, DragDropModule } from '@angular/cdk/drag-drop';\nimport { SelectionModel } from '@angular/cdk/collections';\nimport { CommonModule } from '@angular/common';\nimport { Subject } from 'rxjs';\nimport { debounceTime, takeUntil } from 'rxjs/operators';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenuModule } from '@angular/material/menu';\nimport {\n  BrieTreeSubMenuClick,\n  BrieTreeSubMenuItem,\n  BrieTreeNode,\n  BrieTreeNodeClick,\n  BrieTreeConfig,\n  BrieTreeAction,\n  BrieTreeActionClick,\n  BrieTreeFlatNode,\n  BrieTreeNodeEvent,\n  BrieTreeUpdated,\n} from '../models/tree';\n\n@Component({\n  selector: 'brie-tree',\n  templateUrl: './tree.component.html',\n  styleUrls: ['./tree.component.scss'],\n  changeDetection: ChangeDetectionStrategy.Eager,\n  imports: [\n    CommonModule,\n    MatTreeModule,\n    MatIconModule,\n    MatButtonModule,\n    MatTooltipModule,\n    DragDropModule,\n    MatMenuModule,\n  ],\n\n})\nexport class BrieTreeComponent implements OnChanges, OnInit, OnDestroy {\n  @Input() dataSource: BrieTreeNode[];\n  @Input() config: BrieTreeConfig;\n  @Input() selectedNode: BrieTreeNode | null;\n\n  @Output() clickedSubMenu = new EventEmitter<BrieTreeSubMenuClick>();\n  @Output() clickedAction = new EventEmitter<BrieTreeActionClick>();\n  @Output() clickedNode = new EventEmitter<BrieTreeNodeClick>();\n  @Output() treeUpdated = new EventEmitter<BrieTreeUpdated>();\n\n  @ViewChild('treeNode', { static: false, read: ElementRef })\n  treeElRef: ElementRef<HTMLElement>;\n\n  dropActionTodo: { targetId: string | null; action?: string; } | null;\n  dragOverNode: BrieTreeFlatNode;\n  dragOverArea = '';\n  rootId: string | undefined;\n\n  flatNodeMap = new Map<string, BrieTreeNode>();\n  brieTreeNodeMap = new Map<string, BrieTreeFlatNode>();\n\n  draggedNodeExpanded = false;\n  processDragging = true;\n\n  treeControl: FlatTreeControl<BrieTreeFlatNode>;\n  treeFlattener: MatTreeFlattener<BrieTreeNode, BrieTreeFlatNode>;\n  flatDataSource: MatTreeFlatDataSource<BrieTreeNode, BrieTreeFlatNode>;\n\n  expansionModel = new SelectionModel<string>(true);\n\n  private subject: Subject<CdkDragMove> = new Subject();\n  private readonly unsubscribe = new Subject<void>();\n\n  constructor(\n    @Inject(DOCUMENT) private document: Document,\n  ) {\n    this.treeControl = new FlatTreeControl<BrieTreeFlatNode>(\n      (node) => node.level,\n      (node) => node.expandable,\n    );\n\n    this.treeFlattener = new MatTreeFlattener(\n      this._transformer,\n      (node) => node.level,\n      (node) => node.expandable,\n      (node) => node.children,\n    );\n\n    this.flatDataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);\n  }\n\n  generateId(node: BrieTreeNode): void {\n    if (!node.id) {\n      node.id = this.getUniqueId();\n    }\n\n    if (this.config.defaults.expandAll !== false && node.children?.length) {\n      this.expansionModel.select(node.id);\n    }\n\n    if (node.children) {\n      node.children.forEach((childNode: BrieTreeNode) => {\n        this.generateId(childNode);\n      });\n    }\n  }\n\n  ngOnInit(): void {\n    this.subject.pipe(\n      takeUntil(this.unsubscribe),\n      debounceTime(50),\n    ).subscribe((event) => {\n      this.dragMoved(event);\n    });\n  }\n\n  ngOnDestroy(): void {\n    this.unsubscribe.next();\n    this.unsubscribe.complete();\n  }\n\n  onDragMove(event: CdkDragMove): void {\n    this.subject.next(event);\n  }\n\n  ngOnChanges(): void {\n    this.dataSource.forEach((node: BrieTreeNode) => {\n      this.generateId(node);\n    });\n\n    this.rebuildTreeForData(this.dataSource);\n  }\n\n  isDraggable(overrideValue: boolean | undefined): boolean {\n    if (typeof overrideValue !== 'undefined') {\n      return overrideValue;\n    }\n\n    return !!this.config.defaults.draggable;\n  }\n\n  private _transformer = (node: BrieTreeNode, level: number): BrieTreeFlatNode => {\n    const flatNode = {\n      expandable: !!node.children && node.children.length > 0,\n      title: node.title,\n      subTitle: node.subTitle ? node.subTitle : '',\n      level,\n      subMenu: node.subMenu || this.config.defaults.subMenu || [],\n      id: node.id ? node.id : String(Math.random()),\n      draggable: this.isDraggable(node.draggable),\n      actions: node.actions || this.config.defaults.actions || [],\n    };\n\n    if (flatNode.id && node.id) {\n      this.flatNodeMap.set(flatNode.id, node);\n      this.brieTreeNodeMap.set(node.id, flatNode);\n    }\n\n    return flatNode;\n  };\n\n  onDragIconClick(event: MouseEvent): void {\n    event.stopPropagation();\n  }\n\n  onMenuIconClick(event: MouseEvent): void {\n    event.stopPropagation();\n  }\n\n  addNewNode(parent: BrieTreeNode, node: BrieTreeNode): void {\n    if (!parent.children) {\n      parent.children = [];\n    }\n\n    if (!node.id) {\n      node.id = this.getUniqueId();\n    }\n\n    parent.children.push(node);\n\n    this.rebuildTreeForData(this.flatDataSource.data);\n    this.treeUpdated.emit({ event: BrieTreeNodeEvent.ADDED, nodes: this.flatDataSource.data });\n  }\n\n  editNode(node: BrieTreeNode): void {\n    if (node.id) {\n      const nodeId = node.id;\n      const nodeToEdit = this.flatNodeMap.get(node.id);\n\n      if (nodeToEdit) {\n        Object.assign(nodeToEdit, node);\n        nodeToEdit.id = nodeId;\n        this.rebuildTreeForData(this.flatDataSource.data);\n        this.treeUpdated.emit({ event: BrieTreeNodeEvent.EDITED, nodes: this.flatDataSource.data });\n      }\n    }\n  }\n\n  deleteNode(node: BrieTreeNode): void {\n    if (node.id) {\n      const getParentId = this.getParentNodeId(node.id, this.dataSource, '0');\n      const parentNode = this.flatNodeMap.get(getParentId);\n\n      if (parentNode && parentNode.children) {\n        const nodeIndex = parentNode.children.findIndex((n) => n.id === node.id);\n        parentNode.children.splice(nodeIndex, 1);\n        this.rebuildTreeForData(this.flatDataSource.data);\n        this.treeUpdated.emit({ event: BrieTreeNodeEvent.DELETED, nodes: this.flatDataSource.data });\n      } else {\n        const nodeIndex = this.flatDataSource.data.findIndex((n) => n.id === node.id);\n\n        if (nodeIndex) {\n          this.flatDataSource.data.splice(nodeIndex, 1);\n          this.rebuildTreeForData(this.flatDataSource.data);\n          this.treeUpdated.emit({ event: BrieTreeNodeEvent.DELETED, nodes: this.flatDataSource.data });\n        }\n      }\n    }\n  }\n\n  pasteNode(parent: BrieTreeNode, node: BrieTreeNode): void {\n    if (node.id) {\n      let nodeToPaste = this.flatNodeMap.get(node.id);\n      nodeToPaste = JSON.parse(JSON.stringify(nodeToPaste));\n\n      if (!parent.children) {\n        parent.children = [];\n      }\n\n      if (nodeToPaste && parent.id) {\n        nodeToPaste.id = `${parent.id}/${parent.children.length}`;\n        parent.children.push(nodeToPaste);\n      }\n\n      this.rebuildTreeForData(this.flatDataSource.data);\n      this.treeUpdated.emit({ event: BrieTreeNodeEvent.PASTED, nodes: this.flatDataSource.data });\n    }\n  }\n\n  hasChild(_: number, node: BrieTreeFlatNode): boolean {\n    return node.expandable;\n  }\n\n  onNodeClick(event: MouseEvent, node: BrieTreeFlatNode): void {\n    const treeNode = this.flatNodeMap.get(node.id);\n    this.selectedNode = treeNode || null;\n\n    if (treeNode) {\n      this.clickedNode.emit({ event, treeNode });\n    }\n  }\n\n  onMenuItemClick(event: MouseEvent, node: BrieTreeFlatNode, subMenuItem: BrieTreeSubMenuItem): void {\n    event.stopPropagation();\n\n    const treeNode = this.flatNodeMap.get(node.id);\n\n    if (treeNode !== undefined) {\n      this.clickedSubMenu.emit({ event, treeNode, subMenuItem });\n    }\n  }\n\n  onActionItemClick(event: MouseEvent, node: BrieTreeFlatNode, actionItem: BrieTreeAction): void {\n    event.stopPropagation();\n\n    const treeNode = this.flatNodeMap.get(node.id);\n\n    if (treeNode !== undefined) {\n      this.clickedAction.emit({ event, treeNode, actionItem });\n    }\n  }\n\n  dragMoved(event: CdkDragMove): void {\n    if (!this.processDragging) {\n      return;\n    }\n\n    const elem = this.document.elementFromPoint(event.pointerPosition.x, event.pointerPosition.y);\n\n    if (!elem) {\n      return;\n    }\n\n    const matTreeNode = elem.classList.contains('mat-tree-node') ? elem : elem.closest('.mat-tree-node');\n\n    if (!matTreeNode) {\n      this.clearDragInfo(true);\n      return;\n    }\n\n    this.dropActionTodo = {\n      targetId: matTreeNode.getAttribute('data-id'),\n    };\n\n    const nodeContainer = matTreeNode.getElementsByClassName('brie-node-container');\n\n    if (nodeContainer.length === 0) {\n      return;\n    }\n\n    const targetRect = nodeContainer[0].getBoundingClientRect();\n\n    const oneThird = targetRect.height / 3;\n\n    const idTemp = matTreeNode.getAttribute('data-id') ? matTreeNode.getAttribute('data-id') : '';\n    const treeFlatNode = idTemp ? this.brieTreeNodeMap.get(idTemp) : undefined;\n    const isExpanded = treeFlatNode ? this.treeControl.isExpanded(treeFlatNode) : undefined;\n\n    if (event.pointerPosition.y - targetRect.top < oneThird) {\n      if (this.dropActionTodo?.targetId\n        && this.dropActionTodo?.targetId === this.rootId\n        && this.config.defaults.dragAboveRoot === false) {\n        this.dropActionTodo.targetId = null;\n      } else {\n        this.dropActionTodo.action = 'before';\n      }\n    } else if (event.pointerPosition.y - targetRect.top > 2 * oneThird && !isExpanded) {\n      this.dropActionTodo.action = 'after';\n    } else {\n      this.dropActionTodo.action = 'inside';\n    }\n\n    if (treeFlatNode) {\n      this.showDragInfo(event, treeFlatNode);\n    }\n  }\n\n  dragStarted(event: CdkDragStart): void {\n    this.processDragging = true;\n\n    const treeFlatNode = this.brieTreeNodeMap.get(event.source.data.id);\n\n    if (treeFlatNode && this.treeControl.isExpanded(treeFlatNode)) {\n      this.draggedNodeExpanded = true;\n      this.treeControl.collapse(treeFlatNode);\n    } else {\n      this.draggedNodeExpanded = false;\n    }\n  }\n\n  processDrop(draggedNodeId: string): void {\n    this.processDragging = false;\n\n    if (!draggedNodeId || !this.dropActionTodo || !this.dropActionTodo.targetId) {\n      return;\n    }\n\n    const draggedNode = this.flatNodeMap.get(draggedNodeId);\n    const getParentId = this.getParentNodeId(draggedNodeId, this.dataSource, '0');\n    const parentNode = this.flatNodeMap.get(getParentId);\n\n    if (draggedNode && parentNode) {\n      if (parentNode.children) {\n        const draggedNodeIndex = parentNode.children.findIndex((c) => c.id === draggedNodeId);\n        parentNode.children.splice(draggedNodeIndex, 1);\n      }\n\n      if (this.dropActionTodo.action === 'inside') {\n        const currentParentNode = this.flatNodeMap.get(this.dropActionTodo.targetId);\n        const flatNode = this.brieTreeNodeMap.get(this.dropActionTodo.targetId);\n\n        if (currentParentNode && flatNode) {\n          if (currentParentNode.children) {\n            currentParentNode.children.push(draggedNode);\n          } else {\n            currentParentNode.children = [draggedNode];\n          }\n          if (currentParentNode.id && !this.treeControl.isExpanded(flatNode)) {\n            this.expansionModel.toggle(currentParentNode.id);\n          }\n        }\n      } else {\n        const targetParentId = this.getParentNodeId(this.dropActionTodo.targetId, this.dataSource, '0');\n        const newParentNode = this.flatNodeMap.get(targetParentId || '');\n\n        if (newParentNode?.children) {\n          const { targetId } = this.dropActionTodo;\n          const targetIndex = newParentNode.children.findIndex((c) => c.id === targetId) || 0;\n\n          if (this.dropActionTodo.action === 'before') {\n            newParentNode.children.splice(targetIndex, 0, draggedNode);\n          } else {\n            newParentNode.children.splice(targetIndex + 1, 0, draggedNode);\n          }\n        }\n      }\n    }\n\n    this.clearDragInfo(true);\n    this.rebuildTreeForData(this.flatDataSource.data);\n    this.treeUpdated.emit({ event: BrieTreeNodeEvent.MOVED, nodes: this.flatDataSource.data });\n  }\n\n  getParentNodeId(id: string, nodes: BrieTreeNode[], parentId: string): string {\n    if (nodes) {\n      for (let i = 0; i < nodes.length; i++) {\n        if (nodes[i].id === id) {\n          return parentId;\n        }\n\n        const ret = this.getParentNodeId(id, nodes[i].children || [], nodes[i].id || '');\n\n        if (ret) {\n          return ret;\n        }\n      }\n    }\n\n    return '';\n  }\n\n  clearDragInfo(dropped = false): void {\n    if (dropped) {\n      this.dropActionTodo = null;\n    }\n\n    this.dragOverArea = '';\n  }\n\n  showDragInfo(event: CdkDragMove, draggedNode: BrieTreeFlatNode): void {\n    this.clearDragInfo();\n\n    if (this.dropActionTodo?.targetId) {\n      if (this.dropActionTodo?.action === 'before') {\n        this.dragOverNode = draggedNode;\n        this.dragOverArea = 'before';\n      } else if (this.dropActionTodo?.action === 'after') {\n        this.dragOverNode = draggedNode;\n        this.dragOverArea = 'after';\n      } else {\n        this.dragOverNode = draggedNode;\n        this.dragOverArea = 'inside';\n      }\n    }\n  }\n\n  drop(event: CdkDragDrop<BrieTreeNode[]>): void {\n    // TODO: restrict draggable area to tree container\n    if (!event.isPointerOverContainer) {\n      return;\n    }\n\n    this.processDrop(event.item.data.id);\n  }\n\n  rebuildTreeForData(data: BrieTreeNode[]): void {\n    if (data.length) {\n      this.rootId = data[0].id;\n      this.flatDataSource.data = data;\n\n      this.expansionModel.selected.forEach((id) => {\n        const node = this.treeControl.dataNodes.find((n) => n.id === id);\n\n        if (node) {\n          this.treeControl.expand(node);\n        }\n      });\n    }\n  }\n\n  getUniqueId(): string {\n    return Math.random().toString(36).substr(2, 9);\n  }\n}\n","<!--\nCopyright 2022-2023 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttps://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n\n<div class=\"brie-tree-container\">\n  <mat-tree cdkDropList\n    [dataSource]=\"flatDataSource\"\n    [treeControl]=\"treeControl\"\n    (cdkDropListDropped)=\"drop($event)\"\n    [cdkDropListSortingDisabled]=\"true\">\n\n    <mat-tree-node cdkDrag\n      [cdkDragDisabled]=\"!node.draggable\"\n      (cdkDragStarted)=\"dragStarted($event)\"\n      [cdkDragData]=\"node\"\n      (click)=\"onNodeClick($event, node)\"\n      *matTreeNodeDef=\"let node\"\n      matTreeNodePadding\n      matTreeNodeToggle\n      [attr.data-id]=\"node.id\"\n      (cdkDragMoved)=\"onDragMove($event)\">\n\n      <div class=\"top-slot\" [ngClass]=\"{'drop-slot-active': dragOverNode === node && dragOverArea === 'before'}\"></div>\n      <div [attr.id]=\"'node-'+node.id\"\n        [ngClass]=\"{'selected': this.selectedNode?.id === node.id,'highlight-drop-border': dragOverNode === node && dragOverArea === 'inside'}\"\n        class=\"brie-node-container single\">\n        <ng-container *ngTemplateOutlet=\"nodeDetailsTemplate;context:{$implicit: node}\"></ng-container>\n      </div>\n      <div class=\"bottom-slot\" [ngClass]=\"{'drop-slot-active': dragOverNode === node && dragOverArea === 'after'}\"></div>\n\n    </mat-tree-node>\n\n    <mat-tree-node cdkDrag\n      [cdkDragData]=\"node\"\n      [cdkDragDisabled]=\"!node.draggable\"\n      (cdkDragStarted)=\"dragStarted($event)\"\n      *matTreeNodeDef=\"let node;when: hasChild\"\n      matTreeNodePadding\n      [attr.data-id]=\"node.id\"\n      (cdkDragMoved)=\"onDragMove($event)\">\n\n      <div class=\"top-slot\" [ngClass]=\"{'drop-slot-active': dragOverNode === node && dragOverArea === 'before'}\"></div>\n      <div class=\"brie-node-container\"\n        [ngClass]=\"{'selected': this.selectedNode?.id === node.id,'highlight-drop-border': dragOverNode === node && dragOverArea === 'inside'}\"\n        (click)=\"onNodeClick($event, node)\"\n        [attr.id]=\"'node-'+node.id\">\n\n        <button mat-icon-button\n          matTreeNodeToggle\n          [attr.aria-label]=\"'Toggle ' + node.title\"\n          class=\"brie-node-toggle\">\n          <mat-icon class=\"mat-icon-rtl-mirror\" matTreeNodeToggle (click)=\"expansionModel.toggle(node.id)\">\n            {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\n          </mat-icon>\n        </button>\n\n        <ng-container *ngTemplateOutlet=\"nodeDetailsTemplate;context:{$implicit: node}\"></ng-container>\n      </div>\n      <div class=\"bottom-slot\"\n      [ngClass]=\"{'drop-slot-active': dragOverNode === node && dragOverArea === 'after'}\"></div>\n\n    </mat-tree-node>\n\n  </mat-tree>\n</div>\n\n<ng-template #nodeDetailsTemplate let-node>\n  <div class=\"brie-node-text\">\n    <div class=\"brie-node-title\">{{ node.title }}</div>\n    @if (node.subTitle) {\n      <div class=\"brie-node-subtitle\">{{ node.subTitle }}</div>\n    }\n  </div>\n\n  <ng-container *ngTemplateOutlet=\"actionsTemplate;context:{$implicit: node}\"></ng-container>\n</ng-template>\n\n<ng-template #actionsTemplate let-node>\n  <div class=\"brie-node-actions\">\n    @if (node.draggable) {\n      <button mat-icon-button\n        (click)=\"onDragIconClick($event)\"\n        class=\"brie-node-draggable\">\n        <mat-icon>reorder</mat-icon>\n      </button>\n    }\n\n    @for (action of node.actions; track action) {\n      <button mat-icon-button\n        (click)=\"onActionItemClick($event, node, action)\"\n        class=\"brie-node-action\">\n        <mat-icon matTooltip=\"{{ action.tooltip }}\" fontSet=\"{{ action.icon.fontSet }}\">{{ action.icon.name }}</mat-icon>\n      </button>\n    }\n\n    <button mat-icon-button\n      [disabled]=\"!node.subMenu.length\"\n      [matMenuTriggerFor]=\"menu\"\n      (click)=\"onMenuIconClick($event)\"\n      class=\"brie-node-menu\">\n      <mat-icon>more_vert</mat-icon>\n    </button>\n\n    <ng-template>\n      <button mat-icon-button>\n        <mat-icon></mat-icon>\n      </button>\n    </ng-template>\n\n    <mat-menu #menu=\"matMenu\"\n      xPosition=\"before\"\n      class=\"brie-node-menu-dropdown\">\n      @for (menuitem of node.subMenu; track menuitem) {\n        <button mat-menu-item\n          (click)=\"onMenuItemClick($event, node, menuitem)\"\n          [attr.id]=\"menuitem.id\"\n          class=\"brie-node-menu-item\">\n          {{ menuitem.title }}\n        </button>\n      }\n    </mat-menu>\n  </div>\n</ng-template>\n","/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatTreeModule } from '@angular/material/tree';\n\nimport { BrieTreeComponent } from './components/tree.component';\n\n@NgModule({\n  imports: [\n    BrieTreeComponent,\n    CommonModule,\n    DragDropModule,\n    MatButtonModule,\n    MatIconModule,\n    MatMenuModule,\n    MatTooltipModule,\n    MatTreeModule,\n  ],\n  exports: [\n    BrieTreeComponent,\n  ],\n})\nexport class BrieTreeModule { }\n","/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './tree.module';\nexport * from './components/tree.component';\nexport * from './models/tree';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;IAiES;AAAZ,CAAA,UAAY,iBAAiB,EAAA;AAC3B,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,iBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,iBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EANW,iBAAiB,KAAjB,iBAAiB,GAAA,EAAA,CAAA,CAAA;;AC/E7B;;;;;;;;;;;;;;AAcG;MAwDU,iBAAiB,CAAA;AAiC5B,IAAA,WAAA,CAC4B,QAAkB,EAAA;QAAlB,IAAA,CAAA,QAAQ,GAAR,QAAQ;AA7B1B,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,YAAY,EAAwB;AACzD,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,YAAY,EAAuB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