/*
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","../symbols","../core/Clonable","../core/screenUtils","../core/accessorSupport/decorators/property","../core/arrayUtils","../core/has","../core/accessorSupport/ensureType","../core/accessorSupport/decorators/enumeration","../core/accessorSupport/decorators/subclass","../layers/support/fieldUtils","./Renderer","./mixins/VisualVariablesMixin","./support/AttributeColorInfo","./support/OthersCategory","./support/PieChartLegendOptions","../symbols/SimpleMarkerSymbol","../symbols/SimpleFillSymbol","../symbols/SimpleLineSymbol"],(function(e,t,r,o,i,s,n,l,a,p,u,c,y,d,b,h,f,g,m,_,S){"use strict";let v=function(t){function o(e){var o;return(o=t.call(this,e)||this).attributes=null,o.backgroundFillSymbol=null,o.defaultColor=new r([0,0,0,0]),o.defaultLabel=null,o.holePercentage=0,o.othersCategory=new f.OthersCategory,o.legendOptions=null,o.outline=null,o.size=12,o.type="pie-chart",o}e._inheritsLoose(o,t);var i=o.prototype;return i.getSymbol=function(){var e;return new m({size:this.size?this.size/2+((null==(e=this.outline)?void 0:e.width)||0):0})},i.getSymbolAsync=function(){var t=e._asyncToGenerator((function*(){return this.getSymbol()}));function r(){return t.apply(this,arguments)}return r}(),i.getSymbols=function(){return[this.getSymbol(),this.backgroundFillSymbol]},i.getAttributeHash=function(){return this.visualVariables&&this.visualVariables.reduce(((e,t)=>e+t.getAttributeHash()),"")},i.getMeshHash=function(){return this.getSymbols().reduce(((e,t)=>e+JSON.stringify(t)),"")},i.collectRequiredFields=function(){var t=e._asyncToGenerator((function*(e,t){yield this.collectVVRequiredFields(e,t);for(const r of this.attributes)r.valueExpression&&(yield y.collectArcadeFieldNames(e,t,r.valueExpression)),r.field&&e.add(r.field)}));function r(e,r){return t.apply(this,arguments)}return r}(),o}(b.VisualVariablesMixin(i.ClonableMixin(d)));t.__decorate([n.property({type:[h],json:{write:!0}})],v.prototype,"attributes",void 0),t.__decorate([n.property({type:_,json:{default:null,write:!0}})],v.prototype,"backgroundFillSymbol",void 0),t.__decorate([n.property({type:r,json:{write:!0}})],v.prototype,"defaultColor",void 0),t.__decorate([n.property({type:String,json:{write:!0}})],v.prototype,"defaultLabel",void 0),t.__decorate([n.property({type:Number,range:{min:0,max:1},json:{write:!0}})],v.prototype,"holePercentage",void 0),t.__decorate([n.property({type:f.OthersCategory,json:{write:!0}})],v.prototype,"othersCategory",void 0),t.__decorate([n.property({type:g.PieChartLegendOptions,json:{write:!0}})],v.prototype,"legendOptions",void 0),t.__decorate([n.property({type:S,json:{default:null,write:!0}})],v.prototype,"outline",void 0),t.__decorate([n.property({type:Number,cast:s.toPt,json:{write:!0}})],v.prototype,"size",void 0),t.__decorate([u.enumeration({pieChart:"pie-chart"})],v.prototype,"type",void 0),v=t.__decorate([c.subclass("esri.renderers.PieChartRenderer")],v);return v}));
