import{aX as g,j as I,ak as T,d8 as s,d3 as i,dc as y,am as n,al as R}from"./app-BgLa5dit.js";import{U as p}from"./B0KtsevF.chunk.js";const _="_imageStyle_9s5en_1",b="_imageTypeResource_9s5en_6",U="_fallBackImage_9s5en_12",u={imageStyle:_,imageTypeResource:b,fallBackImage:U},h={width:200,resizeType:y.Cover};function k(a,e,l){var c,o,f;const t=l??h,m=d(e);if("thumbnail"in e&&((c=e.thumbnail)!=null&&c.url))return i.createUrl((o=e.thumbnail)==null?void 0:o.url,{...t});const r=p.safeUrlConcat(a,"/v1/previews");return g.isResource(e)?m===n.Pdf?e.metadata.type===s.Pdf?i.createResourceImage(r,e.url,{...t}):i.createResourceImage(r,(f=e.pdf)==null?void 0:f.url,{...t}):e.metadata.type!==s.Zip?i.createUrl(e.url,l??{size:R.Medium,resizeType:y.Cover}):"/images/zip-resource.png":i.createResourceImage(r,e.url,{...t})}function d(a){var e;return g.isResource(a)?a.metadata.type===s.Pdf||(e=a.pdf)!=null&&e.url?n.Pdf:n.Thumbnails:n.Link}function v(a){var m,r;let e=null,l=0;g.isResource(a.resource)&&(e=a.resource.metadata,l=((r=(m=a.resource.thumbnail)==null?void 0:m.metadata)==null?void 0:r.rotation)??0);const t=k(a.imageCdnUrl,a.resource,a.dynamicRatioImageOptions);return I.jsx(T,{data:t,imageType:d(a.resource),imageStyle:{transform:`rotate(${l}deg)`},alt:a.resource.name,errorFallbackImageSrc:a.imageErrorFallbackUrl,errorFallbackImageClassName:u.fallBackImage,imageClassName:(e==null?void 0:e.type)===s.Image?`${u.imageTypeResource} ${u.imageStyle}`:"",preload:a.preloadImage,preventLoad:!a.preloadImage})}export{v as R};
//# sourceMappingURL=t8cVFCZO.chunk.js.map
