define(["require","exports","tslib","../../Validation","./MapProvider","../../Hooks","./tools","./ArcGisApiVersion"],function(e,r,a,s,i,t,u,c){"use strict";Object.defineProperty(r,"__esModule",{value:!0});o.prototype.execute=function(e,r,a){var i=s.validation.id("layerId",e.layerId,void 0),t=u.featuresToArray(s.validation.exists("features",e.features)),o=s.validation.boolean("removeAllFeatures",e.removeAllFeatures,!1),n=a.create();return u.inline(n.load(),function(){if(i){var e=n.findLayer(i);return u.inline(e&&e.load(),function(){return o&&e&&e.clearFeatures(),{features:(e||n).addFeatures(t,i)}})}if(c.isArcGisApiVersion3x){o&&n.map.graphics.clear();var r=[];return t.forEach(function(e){r.push(n.map.graphics.add(e))}),{features:r}}return o&&n.view.graphics.removeAll(),n.view.graphics.addMany(t),{features:t}})},o.action="gcx:wf:arcgis::AddGraphicsLayerFeatures",o.suite="gcx:wf:builtin",i=a.__decorate([t.activate(i.MapProvider)],o);function o(){}r.AddGraphics=i});