import Graphic from"@arcgis/core/Graphic";import FeatureSet from"@arcgis/core/tasks/support/FeatureSet";import{isArcGisApiVersion3x}from"./ArcGisApiVersion.js";import{validation}from"../../Validation.js";class CreateFeatureSet{execute(e,r){var t,i=validation.array("geometry",e.geometries,[]).map(e=>{const r=new Graphic;return r.geometry=e,r}),e=validation.array("feature",e.features,[]);const o=new FeatureSet;o.features=[...i,...e];for(const a of o.features)if(null!==(t=null===a||void 0===a?void 0:a.geometry)&&void 0!==t&&t.type){o.geometryType=this.getGeometryType(a.geometry.type);break}return{featureSet:o}}getGeometryType(e){if(isArcGisApiVersion3x)switch(e){case"point":return"esriGeometryPoint";case"multipoint":return"esriGeometryMultipoint";case"polyline":return"esriGeometryPolyline";case"polygon":return"esriGeometryPolygon";case"extent":return"esriGeometryEnvelope";default:return"esriGeometryNull"}return e}}CreateFeatureSet.action="gcx:wf:arcgis::CreateFeatureSet",CreateFeatureSet.suite="gcx:wf:builtin";export{CreateFeatureSet};