!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require,exports):"function"==typeof define&&define.amd&&define(["require","exports","tslib","../../Validation","./MapProvider","../../Hooks","./tools","./ArcGisApiVersion"],e)}(function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e("tslib"),s=e("../../Validation"),a=e("./MapProvider"),t=e("../../Hooks"),u=e("./tools"),d=e("./ArcGisApiVersion"),a=(o.prototype.execute=function(e,r,i){var a=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=i.create();return u.inline(n.load(),function(){if(a){var e=n.findLayer(a);return u.inline(e&&e.load(),function(){return o&&e&&e.clearFeatures(),{features:(e||n).addFeatures(t,a)}})}if(d.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.__decorate([t.activate(a.MapProvider)],o));function o(){}r.AddGraphics=a});