/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../../../chunks/_rollupPluginBabelHelpers","../../../../../../core/maybe","../../../../../../core/screenUtils","../../../../../../renderers/support/heatmapUtils","../Technique","../../../../../webgl/enums"],(function(e,t,a,n,r,i,s){"use strict";let o=function(e){function i(){return e.apply(this,arguments)||this}return t._inheritsLoose(i,e),i.getStorageSpec=function({field:e,valueExpression:t}){return{visualVariables:!1,attributes:e||t?[{field:e,valueExpression:t}]:null}},i._createRendererSchema=function(){return{type:"heatmap",radius:-1,referenceScale:-1,isFieldActive:0,minDensity:-1,densityRange:-1,kernel:null,gradient:null,gradientHash:"invalid"}},i.createOrUpdateRendererSchema=function(e,t){const{radius:i,minDensity:s,maxDensity:o,referenceScale:l,field:c,valueExpression:u,colorStops:p}=t,d=o-s,m=c||u?1:0,h=p.map((({color:e,ratio:t})=>`${t}:${e.toString()}`)).join();let y,g=!0;return a.isSome(e)&&"heatmap"===e.type?(y=e,g=h!==e.gradientHash):y=this._createRendererSchema(),y.radius=n.pt2px(i),y.minDensity=s,y.densityRange=d,y.referenceScale=l,y.isFieldActive=m,g&&(y.gradient=r.generateGradient(p),y.gradientHash=h),y},i}(i.Technique);o.type="heatmap",o.programSpec={shader:"materials/icon/heatmapAccumulate",vertexLayout:{geometry:[{location:0,name:"a_pos",count:2,type:s.DataType.SHORT},{location:1,name:"a_vertexOffset",count:2,type:s.DataType.SHORT},{location:4,name:"a_id",count:4,type:s.DataType.UNSIGNED_BYTE}]}},e.HeatmapTechnique=o,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
