Liferay.Loader.define("commerce-organization-web@5.0.37/js/utils/HighlightHandler",["module","exports","require"],(function(h,i,e){window;{Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;class h{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 d=[];i.each((i=>{i.data.chartNodeId===h.data.chartNodeId&&d.push(i)}));const l=d.reduce(((h,i)=>{const e=i.ancestors().map((h=>h.data.chartNodeId));return h.concat(e)}),[]);this._highlightedNodes=e.selectAll(".chart-item").filter((h=>l.includes(h.data.chartNodeId))),this._highlightedLinks=t.selectAll(".chart-link").filter((h=>l.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=h}}));
//# sourceMappingURL=HighlightHandler.js.map