"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("lodash"),l=e.defineComponent({name:"zv-media-image-dynamic"}),p=e.defineComponent({...l,props:{basicOption:{},sources:{},useEvents:{},uuid:{}},setup(c,{expose:u}){const t=c,i=()=>{const n=e.ref(""),r=()=>{window.SHJDatasourceV2({tId:t.uuid,sources:t.sources,callback:({data:o})=>{try{window.SHJParseEvent(t.useEvents,"dataListener",o),n.value=o[0].data[0].src}catch{window.SHJParseEvent(t.useEvents,"dataListener",null)}}})};return e.onMounted(()=>e.nextTick(()=>r())),{init:r,src:n}},{init:s,src:d}=i();return e.watch(()=>a.cloneDeep(t.sources),(n,r)=>{a.isEqual(n,r)||s()},{deep:!0}),u({refresh:()=>s(),refreshView:()=>s(),refreshData:()=>s()}),(n,r)=>(e.openBlock(),e.createElementBlock("div",{class:"zerov-image",style:e.normalizeStyle({backgroundImage:`url('${e.unref(d)}')`,...t.basicOption.mode==="repeat"?{backgroundRepeat:"repeat",backgroundSize:"auto"}:{backgroundSize:t.basicOption.mode,backgroundRepeat:"no-repeat"}})},null,4))}});exports.default=p;
