"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("lodash"),l=require("../../commons/core/datasource/index.js"),p=e.defineComponent({name:"zv-media-image-dynamic"}),m=e.defineComponent({...p,props:{basicOption:{},sources:{},useEvents:{},uuid:{}},setup(c,{expose:u}){const t=c,i=()=>{const r=e.ref(""),n=()=>{l.SHJDatasourceV2.parse({tId:t.uuid,sources:t.sources,callback:({data:o})=>{try{window.SHJParseEvent(t.useEvents,"dataListener",o),r.value=o[0].data[0].src}catch{window.SHJParseEvent(t.useEvents,"dataListener",null)}}})};return e.onMounted(()=>e.nextTick(()=>n())),{init:n,src:r}},{init:s,src:d}=i();return e.watch(()=>a.cloneDeep(t.sources),(r,n)=>{a.isEqual(r,n)||s()},{deep:!0}),u({refresh:()=>s(),refreshView:()=>s(),refreshData:()=>s()}),(r,n)=>(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=m;
