import{jsx as e,jsxs as o}from"react/jsx-runtime";import{memo as t}from"react";import{useCurrentDevice as r,getResponsiveValueByScreen as a,makeStyleResponsive as s}from"@gem-sdk/core";import{handleMouseMove as m,handleMouseOut as i}from"../../common/hoverAction.js";import{getProductImagesStyles as l}from"../../composables/getProductImagesStyles.js";import{getProductImagesClassName as n}from"../../composables/getProductImagesClassName.js";import{getProductImagesAttr as d}from"../../composables/getProductImagesAttr.js";import{createStyle as u}from"@gem-sdk/system";import{getFeaturedImageOnlyOneImageStyle as c}from"../../common/styles.js";import g from"../../../../../carousel/components/root/Carousel.js";import p from"../../../../../carousel/components/item/CarouselItem.js";import f from"./ProductFeaturedImageOnly.js";import{useProductFeaturedImageCarousel as h}from"../../hooks/useProductFeaturedImageCarousel.js";let ProductFeaturedImageCarousel=t=>{let{productImages:C,imgRef:I,onHandleClick:v,onClickArrow:j,onHandleLoaded:y,onHandleUpdateActiveIndex:P,builderPropUID:b,builderPropsClass:k,children:w,parentUid:M,...x}=t,{ref:A,imageActive:F,imageActiveIndex:H,imageShowWhenHover:N,enableOpenLightBox:O,filteredProductImages:R,isRenderFeatureCarousel:S,genRandomKey:B,getAspectRatioFinal:W,emitUpdateActiveIndex:L}=h(t),T=r(),{galleryItemClasses:$,featureImageOnlyOneImageClasses:D}=n(x),{featuredImageCarouselStyle:q,featureImageCarouselItemStyle:z}=l(x),E=u({...c({setting:x,options:{enableRadius:!0,enableHeight:!0}})}),{featuredImageCarouselSettingAttrs:G}=d(x);return e("div",{ref:A,"data-slot":"children",className:"product-feature-image",children:S?o(g,{parentClass:k,elmRef:I,setting:G,styles:q,builderProps:{uid:b},isHiddenArrowWhenDisabled:!0,onLoaded:e=>y&&y(e),onChangeActive:e=>L(e),onClickArrow:()=>j&&j(B()),moveToIdx:H,disableMarginAuto:!0,onHandleChangeSlideByInteraction:e=>{let o=R?.length??0,t=e>=o?0:e;v(R?.[t]?.id??"",O)},children:[w,R?.map(o=>e(p,{contentType:"productImage",className:$("gp-ft-image-item !gp-min-w-full !gp-max-w-full"),onClickItem:()=>{let e=a(x?.ftClickOpenLightBox,T);"none"!==e&&v(o?.id??"",O)},style:z,onMouseMove:e=>m(e,x),onMouseOut:e=>i(e),children:e(f,{image:o,imageShowWhenHover:N,setting:x,aspectRatio:W()})},o?.id))]}):e("div",{ref:I,className:"gp-flex gp-w-full",style:{...s("jc",x?.align)},"data-id":b,children:e("div",{"aria-hidden":"true",className:D,style:E,onMouseMove:e=>m(e,x),onMouseOut:e=>i(e),onBlur:()=>void 0,onClick:()=>{v(F?.id??"",O)},children:e(f,{image:F,imageShowWhenHover:N,setting:x,aspectRatio:W(F)})})})})};var ProductFeaturedImageCarousel$1=t(ProductFeaturedImageCarousel);export{ProductFeaturedImageCarousel$1 as default};
