import{_ as m,o as y,w as p,a as h,j as n,c as o,D as g,Q as v,b as _,a1 as b,n as w,S,r as d,an as k}from"./index-CIAVq8iD-1776148658686.js";const B=["src"],z={key:1,class:"placeholder",style:{width:"100%",height:"100%",backgroundColor:"transparent"}},I={__name:"itemCenter",props:{imgUrl:{type:String,default:"",required:!0},contentStyle:{type:String,default:""},rootMargin:{type:String,default:"100px"},flip:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},immediate:{type:Boolean,default:!1},show:{type:Boolean,default:!0}},setup(s){const e=s,i=d(null),l=d(!1);let t=null;const u=S(()=>e.immediate||!e.lazy?!0:l.value),c=()=>{!e.lazy||e.immediate||i.value&&(t&&t.disconnect(),t=new IntersectionObserver(a=>{a.forEach(r=>{r.isIntersecting&&(l.value=!0,t.unobserve(r.target))})},{rootMargin:e.rootMargin,threshold:0}),t.observe(i.value))};return y(()=>{c()}),p(()=>e.show,a=>{a&&e.lazy&&!e.immediate&&setTimeout(()=>{c()},100)}),h(()=>{t&&t.disconnect()}),(a,r)=>{const f=k("smart-img");return n(),o("div",{style:{position:"relative",width:"100%"},ref_key:"containerRef",ref:i},[u.value?g((n(),o("img",{key:0,src:s.imgUrl,class:v(s.flip?"flipImg":""),alt:"",style:{width:"100%",height:"100%",display:"block"}},null,10,B)),[[f]]):(n(),o("div",z)),_("div",{class:"scrollY",style:w([{position:"absolute",inset:"0",display:"flex","justify-content":"center","align-items":"center"},s.contentStyle])},[b(a.$slots,"default",{},void 0,!0)],4)],512)}}},C=m(I,[["__scopeId","data-v-5f334255"]]);export{C as i};
