/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import e from"../../../../geometry/SpatialReference.js";import{fromJSON as t}from"../../../../geometry/support/jsonUtils.js";import r from"../../../../rest/support/FeatureSet.js";import{createMesh as o}from"./meshUtils.js";function n(n,s){const a=new Array,f=e.fromJSON(s.spatialReference);for(const e of s.features){const r=e.metadata,s=t(e.geometry);if(!r||!s){a.push(null);continue}s.spatialReference=f;const m=s.extent,i=o({layerView:n,nodeIndex:r.meta.node.index,featureIndex:r.index,extent:m,spatialReference:f});a.push(i),e.geometry=null}const m=r.fromJSON(s);for(let e=0;e<m.features.length;e++){const t=m.features[e],r=a[e];t.geometry=r}return m}export{n as processQueryGeometries};
