var z=Object.defineProperty,L=Object.defineProperties;var B=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var h=(a,o,e)=>o in a?z(a,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[o]=e,n=(a,o)=>{for(var e in o||(o={}))I.call(o,e)&&h(a,e,o[e]);if(m)for(var e of m(o))j.call(o,e)&&h(a,e,o[e]);return a},i=(a,o)=>L(a,B(o));import{b as q,c as t,a8 as c,m as p,d as E,e as g,al as d,am as u,a4 as M,r as N,f as T,o as V,g as D,h as F,k as f,J as v,l as G,n as y,a2 as w,j as H,bu as J,q as U}from"./index-C8qz7c0N.js";const A=i(n({},q),{customImage:p(""),src:String,previewSrc:String,round:t(!1),mode:p("scaleToFill"),lazyLoad:t(!1),width:c,height:c,radius:c,enablePreview:t(!1),showMenuByLongpress:t(!1)}),K={name:"wd-img",options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"}},O=E(i(n({},K),{props:A,emits:["error","click","load"],setup(a,{emit:o}){const e=a,l=o,_=g(()=>{const s={};return d(e.height)&&(s.height=u(e.height)),d(e.width)&&(s.width=u(e.width)),d(e.radius)&&(s["border-radius"]=u(e.radius),s.overflow="hidden"),`${M(s)}${e.customStyle}`}),b=g(()=>`wd-img  ${e.round?"is-round":""} ${e.customClass}`),r=N("loading");function k(s){r.value="error",l("error",s)}function S(s){e.enablePreview&&e.src&&r.value=="success"&&J({urls:[e.previewSrc||e.src]}),l("click",s)}function C(s){r.value="success",l("load",s)}return(s,Q)=>{const $=G,P=H;return V(),T(P,{class:w(b.value),onClick:S,style:y(_.value)},{default:D(()=>[F($,{class:w(`wd-img__image ${s.customImage}`),style:y(r.value!=="success"?"width: 0;height: 0;":""),src:s.src,mode:s.mode,"show-menu-by-longpress":s.showMenuByLongpress,"lazy-load":s.lazyLoad,onLoad:C,onError:k},null,8,["class","style","src","mode","show-menu-by-longpress","lazy-load"]),r.value==="loading"?f(s.$slots,"loading",{key:0},void 0,!0):v("",!0),r.value==="error"?f(s.$slots,"error",{key:1},void 0,!0):v("",!0)]),_:3},8,["class","style"])}}})),X=U(O,[["__scopeId","data-v-aca9eb20"]]);export{X as _};
