/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../kernel","../../../request","../../../core/urlUtils","../../operations/urlUtils","../support/AttachmentInfo"],(function(e,t,o,n,r,s){"use strict";function a(e){const t=e.toJSON();return t.attachmentTypes&&(t.attachmentTypes=t.attachmentTypes.join(",")),t.keywords&&(t.keywords=t.keywords.join(",")),t.globalIds&&(t.globalIds=t.globalIds.join(",")),t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.size&&(t.size=t.size.join(",")),t}function c(e,o){const r={};for(const a of e){const{parentObjectId:e,parentGlobalId:c,attachmentInfos:u}=a;for(const a of u){const{id:u}=a,l=n.addProxy(t.addTokenParameter(`${o}/${e}/attachments/${u}`)),d=s.fromJSON(a);d.set({url:l,parentObjectId:e,parentGlobalId:c}),r[e]?r[e].push(d):r[e]=[d]}}return r}function u(e,t,n){let s={query:r.mapParameters({...e.query,f:"json",...a(t)})};return n&&(s={...n,...s,query:{...n.query,...s.query}}),o(e.path+"/queryAttachments",s)}e.executeAttachmentQuery=u,e.processAttachmentQueryResult=c,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
