/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{b as e,c as n,d as o}from"./J7TZPMJS.js";import b from"./GY3RSMKZ.js";import a from"./AD6GOUND.js";import{d,q as y}from"./IHRGRUHQ.js";import{a as l,y as S}from"./NKG4FLLR.js";export default $arcgis.t(([,,,,,,,{Ib:p,Rb:x,Wd:C,gd:B,u:m,yb:g},{a:h}])=>{var v=[e.EditChart,e.Legend,e.RotateChart,e.FilterBySelection,e.FilterByExtent,e.Zoom,e.Selection,e.ClearSelection,e.FullExtent,e.SwitchSelection,e.ExportAsCSV,e.ExportAsImage],D=[e.EditChart,e.Legend,e.RotateChart,e.FilterBySelection,e.FilterByExtent,e.Zoom,e.Selection,e.ClearSelection,e.FullExtent,e.SwitchSelection,e.ExportAsImage,e.ExportAsCSV],w=[e.EditChart,e.Legend,e.RotateChart,e.FilterBySelection,e.FilterByExtent,e.Zoom,e.Selection,e.ClearSelection,e.FullExtent,e.SwitchSelection,e.ExportAsImage,e.ExportAsCSV],L=[e.EditChart,e.Legend,e.FilterBySelection,e.FilterByExtent,e.Selection,e.ClearSelection,e.SwitchSelection,e.ExportAsImage,e.ExportAsCSV],T=[e.EditChart,e.Legend,e.FilterBySelection,e.Selection,e.ClearSelection,e.SwitchSelection,e.ExportAsImage],V=[e.EditChart,e.Legend,e.FilterBySelection,e.FilterByExtent,e.Zoom,e.Selection,e.ClearSelection,e.FullExtent,e.SwitchSelection,e.ExportAsImage,e.ExportAsCSV],Z=[e.EditChart,e.Legend,e.FilterBySelection,e.FilterByExtent,e.Zoom,e.Selection,e.ClearSelection,e.FullExtent,e.SwitchSelection,e.ExportAsImage,e.ExportAsCSV],M=[e.EditChart,e.Legend,e.RotateChart,e.FilterBySelection,e.FilterByExtent,e.Zoom,e.Selection,e.ClearSelection,e.FullExtent,e.SwitchSelection,e.ExportAsImage,e.ExportAsCSV],P=[e.EditChart,e.FilterByExtent,e.ExportAsImage,e.ExportAsCSV];function U(a){switch(a){case l.BarSeries:return v;case l.LineSeries:return D;case l.ComboLineAndBarSeries:return w;case l.PieSeries:return L;case l.HistogramSeries:return V;case l.ScatterSeries:return Z;case l.BoxPlotSeries:return M;case l.GaugeSeries:return P;case l.HeatSeries:return T;default:return[]}}var X=(a,i,t)=>{let r=a.target.assignedNodes().find(c=>"legendToggle"in c),s=S(t?.series);return r&&(r.chartType=s,R({actionBar:r,chartComponent:i,config:t})),r};function R(a){let{actionBar:i,chartComponent:t,config:r,isWarningDisplayed:s}=a,c=x(t.selectionData),f=r?.legend?r.legend.visible??!0:!1;if(i.chartType=S(r?.series),t.enableConfiguration){let F=i.hiddenActions??[];i.hiddenActions=F.filter(I=>I!==e.EditChart)}i.editChartState=t.enableConfiguration?o.Enabled:o.Disabled;let E=r&&p(r.series);i.legendState=E?o.Enabled:o.Disabled;let A=d(t?.model)&&y(t?.model)?t.model.legendVisibility:f;i.legendToggle=E&&A?n.Active:n.Inactive;let b=d(t?.model)&&h(t.model)?t.model.rotatedState:r?.rotated;i.rotateChartToggle=b?n.Active:n.Inactive;let u=B(r?.series??[])===g.PieFromFields;i.filterBySelectionState=!u&&(t.filterBySelection===!0||!c&&t.filterByExtent!==!0)?o.Enabled:o.Disabled,i.filterBySelectionToggle=t.filterBySelection===!0?n.Active:n.Inactive,i.filterByExtentState=t.filterByExtent===!0||t.filterBySelection!==!0?o.Enabled:o.Disabled,i.filterByExtentToggle=t.filterByExtent===!0?n.Active:n.Inactive,i.zoomState=t.filterBySelection?o.Disabled:o.Enabled,i.zoomToggle=t.actionMode===m.Zoom?n.Active:n.Inactive,i.selectionState=t.filterBySelection?o.Disabled:o.Enabled,i.selectionToggle=(t.actionMode??i.actionBarSelectionMode)===i.actionBarSelectionMode?n.Active:n.Inactive,i.clearSelectionState=c?o.Disabled:o.Enabled,i.fullExtentState=t.filterBySelection?o.Disabled:o.Enabled,i.switchSelectionState=t.filterBySelection?o.Disabled:o.Enabled,i.exportActionState=s||C(r)?o.Disabled:o.Enabled}return{a:U,b:X,c:R}},"geometry/support/jsonUtils","rest/support/AttributeBinsQuery","rest/support/StatisticDefinition","time/TimeExtent","core/promiseUtils","request","intl",a,b)