System.register(["./index-legacy-69c33129.js"],(function(o,e){"use strict";var r,a,l,n,i,t,s,u,c,d,v,g,f,h,y,m,p,w,z,b,L;return{setters:[o=>{r=o.y,a=o.d,l=o.I,n=o.az,i=o.c,t=o.z,s=o.ah,u=o.j,c=o.$,d=o.a1,v=o.o,g=o.L,f=o.a,h=o.A,y=o.G,m=o.D,p=o.au,w=o.bd,z=o.H,b=o.V,L=o.w}],execute:function(){const[e,S]=r("image"),x={src:String,alt:String,fit:String,position:String,round:Boolean,block:Boolean,width:h,height:h,radius:h,lazyLoad:Boolean,iconSize:h,showError:y,errorIcon:m("photo-fail"),iconPrefix:String,showLoading:y,loadingIcon:m("photo")};var I=a({name:e,props:x,emits:["load","error"],setup(o,{emit:e,slots:r}){const a=l(!1),h=l(!0),y=l(),{$Lazyload:m}=n().proxy,L=i((()=>{const e={width:t(o.width),height:t(o.height)};return s(o.radius)&&(e.overflow="hidden",e.borderRadius=t(o.radius)),e}));u((()=>o.src),(()=>{a.value=!1,h.value=!0}));const x=o=>{h.value&&(h.value=!1,e("load",o))},I=()=>{const o=new Event("load");Object.defineProperty(o,"target",{value:y.value,enumerable:!0}),x(o)},$=o=>{a.value=!0,h.value=!1,e("error",o)},j=(e,r,a)=>a?a():f(b,{name:e,size:o.iconSize,"class":r,classPrefix:o.iconPrefix},null),P=()=>{if(a.value||!o.src)return;const e={alt:o.alt,"class":S("img"),style:{objectFit:o.fit,objectPosition:o.position}};return o.lazyLoad?p(f("img",z({ref:y},e),null),[[w("lazy"),o.src]]):f("img",z({ref:y,src:o.src,onLoad:x,onError:$},e),null)},E=({el:o})=>{const e=()=>{o===y.value&&h.value&&I()};y.value?e():g(e)},k=({el:o})=>{o!==y.value||a.value||$()};return m&&c&&(m.$on("loaded",E),m.$on("error",k),d((()=>{m.$off("loaded",E),m.$off("error",k)}))),v((()=>{g((()=>{var e;(null==(e=y.value)?void 0:e.complete)&&!o.lazyLoad&&I()}))})),()=>{var e;return f("div",{"class":S({round:o.round,block:o.block}),style:L.value},[P(),h.value&&o.showLoading?f("div",{"class":S("loading")},[j(o.loadingIcon,S("loading-icon"),r.loading)]):a.value&&o.showError?f("div",{"class":S("error")},[j(o.errorIcon,S("error-icon"),r.error)]):void 0,null==(e=r["default"])?void 0:e.call(r)])}}});o("I",L(I))}}}));
