/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import t from"../../request.js";import{parseUrl as o,encode as e,asValidOptions as s}from"../utils.js";import r from"./support/TraverseAssociationsResult.js";async function n(n,m,a){const i=o(n),l=m.toJSON();if(m.elements){const t=JSON.stringify(m.elements.map(t=>({networkSourceId:t.networkSourceId,globalId:t.globalId,terminalId:t.terminalId})));l.elements=t}m.moment||(l.moment=Date.now());const c={...l,f:"json"},p=e({...i.query,...c}),u=s(p,{...a,method:"post"}),d=`${i.path}/associations/traverse`,{data:f}=await t(d,u);return r.fromJSON(f)}export{n as traverseAssociations};
