// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/geoenrichment/ReportPlayer/core/charts/_ChartLegendSupport","dojo/_base/declare dojo/_base/lang dojo/dom-class dojo/dom-construct dojo/dom-style ./chartUtils/ChartTypes ./chartUtils/ChartStyleUtil esri/dijit/geoenrichment/SelectableLegend".split(" "),function(b,c,e,g,f,d,h,k){return b(null,{legend:null,_excludedSeriesHash:null,_createLegend:function(){this._excludedSeriesHash={};if("None"!==this._currentVisualProperties.legend.placement){var a=g.create("div",null,this.getLegendNode());
this.legend=new k(c.mixin({chart:this.chart,allowSelect:!!this.viewModel.dynamicReportInfo&&(d.isColumnBarLike(this._currentChartType)||this._currentChartType===d.LINE),isRtlPlacement:"Left"===this._currentVisualProperties.legend.placement,keepItemsTheSameWidth:!0,onSeriesExclusionChanged:c.hitch(this,this._onSeriesExclusionChanged)},this._getAdditionalLegendParams()),a);a=this.viewModel.getChartDefaultStyles(this.theme||this.themeContext);a=c.mixin({},a.legendStyle,this._currentVisualProperties.legend.style);
f.set(this.legend.domNode,h.getStyleObjWithUnits(a));this._currentVisualProperties.legend.hasBorder||f.set(this.legend.domNode,"border","none")}var b=this;this._placements.forEach(function(a){e.remove(b.domNode,"legendPlacement"+a)});e.add(this.domNode,"legendPlacement"+this._currentVisualProperties.legend.placement)},_getAdditionalLegendParams:function(){return null},_onSeriesExclusionChanged:function(a){this._excludedSeriesHash=a;this._updateSeries()},_updateLegend:function(){if(this.legend){this.legend.series=
this._currentSeries;this.legend.showSeriesData=1===this._currentSeriesItems.length||d.isRoundChart(this._currentChartType);var a=!!this.viewModel.dynamicReportInfo&&1<this._currentSeries.length;a!==this.legend.allowSelect&&(this.legend.allowSelect=a);this.legend.refresh()}},_updateSeries:function(){},_destroyLegend:function(){this.legend&&this.legend.destroy();this.legend=null}})});