UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

1 lines 3.3 kB
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9239],{9239(t,e,o){o.r(e),o.d(e,{executeAttachmentQuery:()=>m,fetchAttachments:()=>I,processAttachmentQueryResult:()=>f});var n,r=o(70333),i=o(11254),a=o(84952),s=o(10536),l=o(5482),d=o(25482),p=o(91429),c=o(56507);const u={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let h=n=class extends d.o{constructor(t){super(t),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:t}=this,e=function(t){const{exifInfo:e,exifName:o,tagName:n}=t;if(!e||!o||!n)return null;const r=e.find(t=>t.name===o);return r?function(t){const{tagName:e,tags:o}=t;if(!o||!e)return null;const n=o.find(t=>t.name===e);return n?.value||null}({tagName:n,tags:r.tags}):null}({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:t});return u[e]||null}clone(){return new n({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};function y(t){const e=t.toJSON();return e.attachmentTypes&&(e.attachmentTypes=e.attachmentTypes.join(",")),e.keywords&&(e.keywords=e.keywords.join(",")),e.globalIds&&(e.globalIds=e.globalIds.join(",")),e.objectIds&&(e.objectIds=e.objectIds.join(",")),e.size&&(e.size=e.size.join(",")),e.orderByFields&&(e.orderByFields=e.orderByFields.join(",")),e}function f(t,e){const o={};for(const n of e){const{parentObjectId:e,parentGlobalId:i,attachmentInfos:s}=n;for(const n of s){const{id:s}=n,l=(0,a.yM)((0,r.Y3)(`${t.path}/${e}/attachments/${s}`)),d=h.fromJSON(n);d.set({url:l,parentObjectId:e,parentGlobalId:i}),o[e]?o[e].push(d):o[e]=[d]}}return o}function m(t,e,o){let n={query:(0,s.z)({...t.query,f:"json",...y(e)})};return o&&(n={...o,...n,query:{...o.query,...n.query}}),(0,i.A)(t.path+"/queryAttachments",n).then(t=>t.data.attachmentGroups)}async function I(t,e,o){const{objectIds:n}=e,r=[];for(const e of n)r.push((0,i.A)(t.path+"/"+e+"/attachments",o));return Promise.all(r).then(t=>n.map((e,o)=>({parentObjectId:e,attachmentInfos:t[o].data.attachmentInfos})))}(0,l.Cg)([(0,p.MZ)({type:String})],h.prototype,"contentType",void 0),(0,l.Cg)([(0,p.MZ)()],h.prototype,"exifInfo",void 0),(0,l.Cg)([(0,p.MZ)({readOnly:!0})],h.prototype,"orientationInfo",null),(0,l.Cg)([(0,p.MZ)({type:c.jz})],h.prototype,"id",void 0),(0,l.Cg)([(0,p.MZ)({type:String})],h.prototype,"globalId",void 0),(0,l.Cg)([(0,p.MZ)({type:String})],h.prototype,"keywords",void 0),(0,l.Cg)([(0,p.MZ)({type:String})],h.prototype,"name",void 0),(0,l.Cg)([(0,p.MZ)({json:{read:!1}})],h.prototype,"parentGlobalId",void 0),(0,l.Cg)([(0,p.MZ)({json:{read:!1}})],h.prototype,"parentObjectId",void 0),(0,l.Cg)([(0,p.MZ)({type:c.jz})],h.prototype,"size",void 0),(0,l.Cg)([(0,p.MZ)({json:{read:!1}})],h.prototype,"url",void 0),h=n=(0,l.Cg)([(0,p.$K)("esri.rest.query.support.AttachmentInfo")],h)}}]);