/*
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","../../../../../../Color","../../../../../../core/maybe","../../../../../../core/screenUtils","../../color","../../definitions","../Technique","../../../../../webgl/enums"],(function(e,t,o,r,n,a,l,i,u){"use strict";let c=function(e){function i(){return e.apply(this,arguments)||this}return t._inheritsLoose(i,e),i.getStorageSpec=function({attributes:e}){return{visualVariables:!0,attributes:null!=e?e:null}},i._createRendererSchema=function(){return{type:"pie-chart",colors:new Float32Array(4*l.CHART_MAX_FIELDS),defaultColor:new Float32Array(4),othersColor:new Float32Array(4),outlineColor:new Float32Array(4),holePercentage:0,sectorThreshold:0,outlineWidth:1,numberOfFields:10}},i.createOrUpdateRendererSchema=function(e,t){const{attributes:i,defaultColor:u,holePercentage:c,othersCategory:s,outline:p}=t,d=r.isSome(e)&&"pie-chart"===e.type?e:this._createRendererSchema();for(let r=0;r<l.CHART_MAX_FIELDS;r++){const e=r>=i.length?new o([0,0,0,0]):i[r].color;a.writeColor(d.colors,e,4*r)}return a.writeColor(d.defaultColor,u),a.writeColor(d.othersColor,null==s?void 0:s.color),a.writeColor(d.outlineColor,null==p?void 0:p.color),d.outlineWidth=n.pt2px((null==p?void 0:p.width)||0),d.holePercentage=c,d.sectorThreshold=(null==s?void 0:s.threshold)||0,d.numberOfFields=i.length,d},i.getVariation=function(e){return{numberOfFields:e.numberOfFields}},i.getVariationHash=function(e){return e.numberOfFields},i}(i.Technique);c.type="pie-chart",c.programSpec={shader:"materials/pie",vertexLayout:{geometry:[{location:0,name:"a_pos",count:2,type:u.DataType.SHORT},{location:1,name:"a_vertexOffset",count:2,type:u.DataType.SHORT},{location:2,name:"a_texCoords",count:2,type:u.DataType.UNSIGNED_SHORT},{location:3,name:"a_bitSetAndDistRatio",count:2,type:u.DataType.UNSIGNED_SHORT},{location:4,name:"a_id",count:4,type:u.DataType.UNSIGNED_BYTE},{location:5,name:"a_color",count:4,type:u.DataType.UNSIGNED_BYTE,normalized:!0},{location:6,name:"a_outlineColor",count:4,type:u.DataType.UNSIGNED_BYTE,normalized:!0},{location:7,name:"a_sizeAndOutlineWidth",count:4,type:u.DataType.UNSIGNED_BYTE},{location:8,name:"a_zoomRange",count:2,type:u.DataType.UNSIGNED_SHORT}]},hittestAttributes:["a_vertexOffset","a_texCoords"]},e.PieChartTechnique=c,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
