"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),o=require("react"),s=require("../../common/common.js"),a=require("../../../../../image/components/NextImage.js"),r=require("../lightbox/ButtonOpenLightBox.js"),i=require("./MediaIcon.js"),l=require("../../common/productFeaturedImage.js"),c=require("../../common/hoverAction.js"),d=require("../../composables/getProductImagesClassName.js"),n=require("../../composables/getProductImagesStyles.js"),u=require("../../hooks/useProductGalleryGrid.js"),m=o.memo(o=>{let{builderPropUID:m,productImages:g,onHandleClick:y,activeIndexFromFeatureImage:h,children:p,isHiddenInteraction:v,...j}=o,{isDisplay:x,shapeByLayout:f,imageActiveIndex:q,enableOpenLightBox:M,isEnableBorderActive:I,filteredProductImages:w}=u.useProductGalleryGrid(o),T=t.useCurrentDevice(),{galleryGridWrapperClasses:b,galleryItemClasses:N}=d.getProductImagesClassName(j),{galleryGridStyles:P,galleryGridItemStyles:C}=n.getProductImagesStyles(j);return e.jsx(e.Fragment,{children:x&&e.jsxs("div",{"data-slot":"children","data-id":m,className:b,style:P,"gp-data-hidden":`${v}`,children:[w?.map((o,d)=>{let n=d===q,u=l.isFeatureMedia(o.contentType)?o.previewImage:o.src;return e.jsxs("div",{"aria-hidden":!0,className:N(`gp-gallery-image-item gem-slider-item-${m}
                  ${n&&I?"gem-slider-item-active":""}`),onClick:()=>y(o?.id||"",M),style:C,onMouseMove:e=>c.handleMouseMove(e,{hoverEffect:j.galleryHoverEffect,zoom:j.galleryZoom,zoomType:j.galleryZoomType}),onMouseOut:e=>c.handleMouseOut(e),"data-border":n&&j?.borderActive?"active":"deactive",children:[e.jsx(a.default,{src:u,width:o?.width,height:o?.height,alt:o?.alt,setting:{aspectRatio:s.getAspectRatio(f),layout:j?.layout},style:{width:"100%",height:"100%"}},o?.id),e.jsx(i.default,{contentType:o?.contentType||""}),j?.galleryHoverEffect!=="none"&&!l.isFeatureMedia(o?.contentType)&&e.jsx(a.default,{src:u,width:o?.width,height:o?.height,alt:o?.alt,setting:{layout:j.layout,aspectRatio:s.getAspectRatio(f)},className:t.cls("hover-image !gp-max-w-none",l.getZoomImageClass())}),j?.galleryHoverEffect=="zoom"&&j?.galleryZoomType=="glasses"&&["one-col","two-col"].includes(t.getResponsiveValueByScreen(j.position,T)||"")&&!l.isFeatureMedia(o?.contentType)&&e.jsx("div",{className:t.cls(l.getZoomLenClass(),"room-len"),style:{...t.makeStyle({bgi:`url("${o?.src}")`})}}),t.getResponsiveValueByScreen(j?.clickOpenLightBox,T)&&e.jsx(r.default,{})]},o?.id)}),p]})})});exports.default=m;
