/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import t from"../../request.js";import{parseUrl as e,encode as o,asValidOptions as s}from"../utils.js";import r from"./support/AssociationGeometriesResult.js";async function n(r,n,a){const c=e(r),f={...n.toJSON(),f:"json"},m=o({...c.query,...f});a?a.method="post":a={method:"post"};const p=s(m,a),u=`${c.path}/synthesizeAssociationGeometries`;return t(u,p).then(t=>i(t,n.outSpatialReference))}function i(t,e){const{data:o}=t;if(e)for(const s of o.associations)s.geometry.spatialReference||(s.geometry.spatialReference=e.clone());return r.fromJSON(o)}export{n as synthesizeAssociationGeometries};
