import{jsx as o}from"react/jsx-runtime";import{i as e,e as i,j as r}from"./index-CQXsL1YZ.js";import{u as t}from"./usePreviewImage-DqIO3PcZ.js";import{useEffect as s}from"react";import"react-dom";import"@bbodek/hooks";import"@bbodek/utils";import"overlay-kit";const n=i((()=>import("./PreviewImage-D7sHp2Yb.js")),{ssr:!1}),a=({file:i,viewerSize:a,previewOptions:m})=>{const{status:{isLoading:d,isError:p},models:{imgSize:l},operations:{onLoadImage:h,onError:g,onReset:w}}=t(),{width:f,height:u}=a,{width:b,height:c}=l??{},v=!!c&&c<u&&null===m.fitMode;return(({file:o,onReset:e})=>{s((()=>{o&&e()}),[o])})({file:i,onReset:w}),o(e,{isLoading:d,loadingComponent:o(r,{}),children:o(n,{size:{width:v?b:f,height:v?c:u},downloadOptions:{url:i.blob,name:i.name},isError:p,previewOptions:m,src:i.blob,viewerSize:a,onError:g,onLoad:h})})};export{a as default};
//# sourceMappingURL=PreviewImageViewer-FX5Cyg4X.js.map
