"use strict";var e=require("./common.js");const t=({featureImageHoverDom:e})=>{e&&(e.style.opacity="1",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%")},o=({zoomLens:e,zoomSize:t,zoomValue:o,slideWidth:r,slideHeight:l,imageOffsetX:i,imageOffsetY:c})=>{if(!e)return;e.style.opacity="1";let s=e.offsetWidth/2,n=e.offsetHeight/2,f=l||1;i>r-s/o&&(i=r-s/o),i<s/o&&(i=s/o),c>f-n/o&&(c=f-n/o),c<n/o&&(c=n/o),e.style.top=c-n+"px",e.style.left=i-s+"px",e.style.backgroundSize=t+"px "+f*o+"px",e.style.backgroundPosition=`-${i*o-s}px -${c*o-n}px`},r=({featureImageDom:e,featureImageHoverDom:t,zoomSize:o,zoomSizeHeight:r,slideWidth:l,imageOffsetX:i,imageOffsetY:c,isEnableShowOtherImage:s=!1})=>{if(!t)return;t.style.width=`${o}px`,s||(t.style.height=`${r}px`),t.style.opacity="1";let n=i/e?.offsetWidth,f=c/e?.offsetHeight;t.style.top=(e?.offsetHeight-t.offsetHeight)*f+"px",t.style.left=(l-o)*n+"px"};exports.handleMouseMove=(l,i)=>{let c=i?.hoverEffect==="zoom"&&i?.zoomType==="default",s=i?.hoverEffect==="zoom"&&i?.zoomType==="glasses",n=i?.hoverEffect==="other",f=i?.hoverEffect!=="none";if(!f)return;let y=l.currentTarget.querySelector("img"),h=l.currentTarget.querySelector("img.hover-image"),p=l.currentTarget.querySelector(".room-len"),g=y?.getBoundingClientRect(),u=y?.clientWidth||0,a=y?.clientHeight||0,m=e.convertUnitToNumber(i?.zoom,0),x=!m||m<100?1:m/100||1,d=(u||1)*(i?.hoverEffect==="other"?1:x),v=(a||1)*(i?.hoverEffect==="other"?1:x),T=l.clientX-g?.x,q=l.clientY-g?.y;n&&t({featureImageHoverDom:h}),c&&l.clientX>=g?.x&&l.clientX<=g.right&&l.clientY>=g?.y&&l.clientY<=g.bottom&&r({featureImageDom:y,featureImageHoverDom:h,zoomSize:d,zoomSizeHeight:v,slideWidth:u,imageOffsetX:T,imageOffsetY:q,isEnableShowOtherImage:n}),s&&o({zoomLens:p,zoomSize:d,zoomValue:x,slideWidth:u,slideHeight:a,imageOffsetX:T,imageOffsetY:q})},exports.handleMouseOut=e=>{let t=e.currentTarget.querySelector("img.hover-image"),o=e.currentTarget.querySelector(".room-len");t&&(t.style.opacity="0"),o&&(o.style.opacity="0")};
