import{__decorate as t}from"tslib";import{EntityBase as e}from"../Entity.js";import{ItemType as i}from"../ItemType.js";import{serializable as r}from"../support/Serializable.js";let n=class extends e{contentType;size;title;url;_itemType=i.ATTACHMENT;_getSerializableProperties(){return{...super._getSerializableProperties(),url:"initial",contentType:"initial",size:"initial",title:"initial"}}};n=t([r],n);export{n as Attachment};export function toAttachment(t,e){const{attachmentInfoUrl:i,gdbVersion:r}=e??{},o=new URL(t.url??`${i}/${t.id}`);return r&&o.searchParams.append("gdbVersion",r),new n({id:t.id.toString(),contentType:t.contentType,size:t.size,title:t.name,url:o.toString()})}