Liferay.Loader.define("commerce-organization-web@5.0.50/js/utils/HighlightHandler",["module","exports","require"],(function(h,i,e){window;{Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;class HighlightHandler{constructor(){this._highlightedLinks=null,this._highlightedNodes=null,this._enabled=!0}disableHighlight(){this._enabled=!1}enableHighlight(){this._enabled=!0}highlight(h,i,e,t){if(!this._enabled)return;const l=[];i.each((i=>{i.data.chartNodeId===h.data.chartNodeId&&l.push(i)}));const d=l.reduce(((h,i)=>{const e=i.ancestors().map((h=>h.data.chartNodeId));return h.concat(e)}),[]);this._highlightedNodes=e.selectAll(".chart-item").filter((h=>d.includes(h.data.chartNodeId))),this._highlightedLinks=t.selectAll(".chart-link").filter((h=>d.includes(h.target.data.chartNodeId))),this._highlightedLinks.raise(),this._highlightedLinks.classed("highlighted",!0),this._highlightedNodes.classed("highlighted",!0)}removeHighlight(){this._highlightedLinks&&this._highlightedNodes&&(this._highlightedLinks.classed("highlighted",!1),this._highlightedNodes.classed("highlighted",!1),this._highlightedLinks=null,this._highlightedNodes=null)}}i.default=HighlightHandler}}));
//# sourceMappingURL=HighlightHandler.js.map