/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{d as o}from"./DPJE33GY.js";import{g as p}from"./UG7LOBJE.js";import b from"./AD6GOUND.js";import{n as m}from"./4B3QBH5T.js";import"./FUPYXGG6.js";import"./NKG4FLLR.js";import{F as h,g as n,h as a,z as l}from"./RPU6VCJ4.js";import"./OR4HXHSY.js";export default $arcgis.t(([,,,,,,,,,,,,,,,{Kc:c,Mc:d}])=>{var g=n`:host{margin-bottom:var(--arcgis-charts-intra-section-margin);margin-top:var(--arcgis-charts-intra-section-margin);height:100%}`,s=class extends l{static{this.properties={layerFieldsInfo:16,model:0,page:1,layer:0,usePopupTemplateFieldsInfo:5}}static{this.styles=g}async load(){await this.updateFetchLayerFieldsInfo(this.model?.config),this.modelChange(this.model)}willUpdate(t){let e=!1;t.has("model")&&this.modelChange(this.model,t.get("model")),t.has("layer")&&this.layer!==void 0&&!m(t.get("layer"),this.layer)&&(e=!0),t.has("usePopupTemplateFieldsInfo")&&this.usePopupTemplateFieldsInfo!==t.get("usePopupTemplateFieldsInfo")&&(e=!0),this.layerFieldsInfo===void 0&&(e=!0),e&&this.updateFetchLayerFieldsInfo()}disconnectedCallback(){super.disconnectedCallback(),this.model.removeEventListener("arcgisChartsModelConfigChange",this.onModelConfigChange)}modelChange(t,e){e?.removeEventListener("arcgisChartsModelConfigChange",this.onModelConfigChange),t?.addEventListener("arcgisChartsModelConfigChange",this.onModelConfigChange)}async updateFetchLayerFieldsInfo(t){let e=t??this.model.config,i=this.layer;if(!i){let r=p(e)?e.iLayer:void 0;r&&(i=await c(r))}i&&(this.layerFieldsInfo=await d(i,this.usePopupTemplateFieldsInfo))}async onModelConfigChange(t){let e=t?.detail.config??this.model.config;this.layer===void 0&&await this.updateFetchLayerFieldsInfo(e)}render(){let t;switch(this.page){case o.Data:t=a`<arcgis-charts-config-heat-chart-data .model=${this.model} .layerFieldsInfo=${this.layerFieldsInfo}></arcgis-charts-config-heat-chart-data>`;break;case o.Format:t=a`<arcgis-charts-config-format .model=${this.model}></arcgis-charts-config-format>`;break;case o.General:t=a`<arcgis-charts-config-general .model=${this.model}></arcgis-charts-config-general>`;break;default:t="";break}return t}};h("arcgis-charts-config-heat-chart",s);return s},"Graphic","renderers/support/jsonUtils","symbols/support/symbolUtils","intl","layers/support/FeatureFilter","smartMapping/statistics/histogram","smartMapping/statistics/summaryStatistics","request","core/sql","AttributeBinsGraphic","geometry/support/jsonUtils","rest/support/AttributeBinsQuery","rest/support/StatisticDefinition","time/TimeExtent","core/promiseUtils",b)