/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../chunks/_rollupPluginBabelHelpers","../chunks/tslib.es6","../Color","../core/lang","../core/accessorSupport/decorators/aliasOf","../core/accessorSupport/ensureType","../core/accessorSupport/decorators/enumeration","../core/accessorSupport/decorators/property","../core/accessorSupport/decorators/subclass","../layers/support/fieldUtils","./Renderer","./mixins/VisualVariablesMixin","./support/AttributeColorInfo","./support/DotDensityLegendOptions","../symbols/SimpleFillSymbol","../symbols/SimpleLineSymbol"],(function(e,t,o,r,n,i,s,l,a,u,p,c,d,y,b,h){"use strict";var f;let g=f=function(t){function n(e){var r;return(r=t.call(this,e)||this).attributes=null,r.backgroundColor=new o([0,0,0,0]),r.blendDots=!0,r.dotBlendingEnabled=!0,r.dotShape="square",r.dotSize=1,r.legendOptions=null,r.outline=new h,r.dotValue=null,r.referenceDotValue=null,r.referenceScale=null,r.seed=1,r.type="dot-density",r}e._inheritsLoose(n,t);var i=n.prototype;return i.calculateDotValue=function(e){if(null==this.referenceScale)return this.dotValue;const t=e/this.referenceScale*this.dotValue;return t<1?1:t},i.getSymbol=function(){return new b({outline:this.outline})},i.getSymbolAsync=function(){var t=e._asyncToGenerator((function*(){return this.getSymbol()}));function o(){return t.apply(this,arguments)}return o}(),i.getSymbols=function(){return[this.getSymbol()]},i.getAttributeHash=function(){return this.attributes&&this.attributes.reduce(((e,t)=>e+t.getAttributeHash()),"")},i.getMeshHash=function(){return JSON.stringify(this.outline)},i.clone=function(){return new f({attributes:r.clone(this.attributes),backgroundColor:r.clone(this.backgroundColor),dotBlendingEnabled:r.clone(this.dotBlendingEnabled),dotShape:r.clone(this.dotShape),dotSize:r.clone(this.dotSize),dotValue:r.clone(this.dotValue),legendOptions:r.clone(this.legendOptions),outline:r.clone(this.outline),referenceScale:r.clone(this.referenceScale),visualVariables:r.clone(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})},i.getControllerHash=function(){return`${this.attributes.map((e=>e.field||e.valueExpression||""))}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`},i.collectRequiredFields=function(){var t=e._asyncToGenerator((function*(e,t){yield this.collectVVRequiredFields(e,t);for(const o of this.attributes)o.valueExpression&&(yield u.collectArcadeFieldNames(e,t,o.valueExpression)),o.field&&e.add(o.field)}));function o(e,o){return t.apply(this,arguments)}return o}(),n}(c.VisualVariablesMixin(p));t.__decorate([l.property({type:[d],json:{write:!0}})],g.prototype,"attributes",void 0),t.__decorate([l.property({type:o,json:{write:!0}})],g.prototype,"backgroundColor",void 0),t.__decorate([l.property({type:Boolean}),n.aliasOf("dotBlendingEnabled")],g.prototype,"blendDots",void 0),t.__decorate([l.property({type:Boolean,json:{write:!0}})],g.prototype,"dotBlendingEnabled",void 0),t.__decorate([l.property({type:String,json:{write:!1}})],g.prototype,"dotShape",void 0),t.__decorate([l.property({type:Number,json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1}}}})],g.prototype,"dotSize",void 0),t.__decorate([l.property({type:y,json:{write:!0}})],g.prototype,"legendOptions",void 0),t.__decorate([l.property({type:h,json:{default:null,write:!0}})],g.prototype,"outline",void 0),t.__decorate([l.property({type:Number,json:{write:!0}})],g.prototype,"dotValue",void 0),t.__decorate([l.property({type:Number}),n.aliasOf("dotValue")],g.prototype,"referenceDotValue",void 0),t.__decorate([l.property({type:Number,json:{write:!0}})],g.prototype,"referenceScale",void 0),t.__decorate([l.property({type:Number,json:{write:!0}})],g.prototype,"seed",void 0),t.__decorate([s.enumeration({dotDensity:"dot-density"})],g.prototype,"type",void 0),g=f=t.__decorate([a.subclass("esri.renderers.DotDensityRenderer")],g);return g}));
