/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getFeatureUniforms as i,getSelectionDefines as s,getFeatureStorageTextures as r,resolveDynamicUniforms as a,getFeaturePipelineState as h}from"../featureTechniqueUtils.js";import{PieChartShader as u}from"./PieChartShader.js";class o extends e{constructor(){super(...arguments),this.type=30,this.shaders={geometry:new u},this.symbologyPlane=2}render(e,u){const{painter:o}=e,{instance:n,target:l}=u,m=this.shaders.geometry,f=n.getInput(),S=f.uniforms.numberOfFields,V=t(e),d=i(e,l),g=s(e);m.setNumberOfFields(S),o.setShader({shader:m,uniforms:{...a(e,u.target,f.uniforms.shader),...d.storage,...d.view,...d.highlight,highlightUniforms:d.highlight,hittestUniforms:d.hittestRequest?{hittestDist:d.hittestRequest?.distance,hittestPos:d.hittestRequest?.position}:null},textures:r(e),defines:{VV_SIZE_MIN_MAX_VALUE:!!f.uniforms.shader.visualVariableSizeMinMaxValue,VV_SIZE_SCALE_STOPS:!!f.uniforms.shader.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!f.uniforms.shader.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!f.uniforms.shader.visualVariableSizeUnitValue,VV_OPACITY:!!f.uniforms.shader.visualVariableOpacity,HITTEST:V,highlight:d.highlight?1:0,...g,numberOfFields:S},optionalAttributes:{},useComputeBuffer:V}),o.setPipelineState(h(e)),o.submitDraw(e,u)}}export{o as PieChartTechnique};
