/*
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","../../color","../../definitions","../Technique","../../../../../webgl/enums"],(function(e,t,o,n,r,a,i){"use strict";let l=function(e){function a(){return e.apply(this,arguments)||this}return t._inheritsLoose(a,e),a.getStorageSpec=function({attributes:e}){return{visualVariables:!1,attributes:null!=e?e:null}},a._createRendererSchema=function(){return{type:"dot-density",colors:new Float32Array(32),dotValue:-1,dotSize:-1,dotScale:-1,dotBlending:!1,backgroundColor:new Float32Array(4),activeDots:new Float32Array(8),seed:-1}},a.createOrUpdateRendererSchema=function(e,t){const{attributes:a,dotValue:i,referenceScale:l,dotSize:c,dotBlendingEnabled:u,seed:d,backgroundColor:s}=t,y=o.isSome(e)&&"dot-density"===e.type?e:this._createRendererSchema();y.dotValue=i,y.dotSize=c,y.dotScale=l,y.dotBlending=u,y.seed=d;const{colors:p,activeDots:g,backgroundColor:S}=y;for(let o=0;o<r.DOT_DENSITY_MAX_FIELDS;o++){const e=o>=a.length?null:a[o].color;n.writeColor(p,e,4*o)}for(let o=0;o<8;o++)g[o]=o<t.attributes.length?1:0;return n.writeColor(S,s),y},a.getVariation=function(e){return{ddDotBlending:e.dotBlending}},a.getVariationHash=function(e){return e.dotBlending?1:0},a}(a.Technique);l.type="dot-density",l.programSpec={shader:"materials/fill",vertexLayout:{geometry:[{location:0,name:"a_pos",count:2,type:i.DataType.SHORT},{location:1,name:"a_id",count:3,type:i.DataType.UNSIGNED_BYTE},{location:2,name:"a_bitset",count:1,type:i.DataType.UNSIGNED_BYTE},{location:3,name:"a_inverseArea",count:1,type:i.DataType.FLOAT}]}},e.DotDensityTechnique=l,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
