import{r as t,c as i,h as s,g as e}from"./p-21516f8c.js";const h=":host{display:block;object-fit:contain}img{width:100%;height:100%;object-fit:inherit;object-position:inherit}";const n=class{constructor(s){t(this,s);this.luImgDidLoad=i(this,"luImgDidLoad",7)}srcChanged(){this.addIO()}componentDidLoad(){this.addIO()}addIO(){if(this.src===undefined){return}if("IntersectionObserver"in window){this.removeIO();this.io=new IntersectionObserver((t=>{if(t[0].isIntersecting){this.load();this.removeIO()}}));this.io.observe(this.el)}else{setTimeout((()=>this.load()),200)}}load(){this.loadSrc=this.src;this.luImgDidLoad.emit()}removeIO(){if(this.io){this.io.disconnect();this.io=undefined}}render(){return s("img",{src:this.loadSrc,alt:this.alt,decoding:"async"})}get el(){return e(this)}static get watchers(){return{src:["srcChanged"]}}};n.style=h;export{n as lu_img};
//# sourceMappingURL=p-37cfe630.entry.js.map