'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),o=require("../../../../../carousel-v3/components/root/Carousel.js"),i=require("../../../../../carousel-v3/components/item/CarouselItem.js"),s=require("../../../../../image/components/NextImage.js");require("../../../../../modal/components/confirm.js");var l=require("../../../../../modal/components/Modal.js"),d=require("react"),r=require("../../common/productFeaturedImage.js"),n=require("../child/ProductFeatureVideo.js"),a=require("../child/MediaIcon.js");exports.default=({builderPropUID:u,productImages:p,open:c,imageRatio:m,onHandleClose:g})=>{let h=t.useFeaturedImageGlobal(),b=d.useMemo(()=>{let e=p?.findIndex(e=>e.id===h?.id);return e&&e>0?e:0},[p,h]),j={desktop:p&&p.length>1,mobile:p&&p?.length>1,tablet:p&&p?.length>1},f=t.useEditorMode(),x=e=>"edit"!==f&&["VIDEO","EXTERNAL_VIDEO"].includes(e?.contentType||"");return e.jsx(l.default,{setting:{open:c},styles:{width:"80%"},closeOnClickOutside:!0,onClose:()=>{g(),console.log("onHandleClose")},disableIframeClickEvent:!0,contentClass:"mobile:!gp-w-[100%] gp-px-2 gp-pb-10",children:e.jsx(o.default,{setting:{loop:{desktop:!1,mobile:!1,tablet:!1},slidesToShow:{desktop:1,tablet:1,mobile:1},defaultCurrentSlider:b,dot:{desktop:!0,mobile:!0,tablet:!0},dotStyle:{desktop:"outside",mobile:"outside",tablet:"outside"},dotColor:{desktop:"#E2E2E2",mobile:"#E2E2E2",tablet:"#E2E2E2"},dotActiveColor:{desktop:"#121212",mobile:"#121212",tablet:"#121212"},dotSize:{desktop:12},dotGapToCarousel:{desktop:12},navigationEnable:j,navigationStyle:{desktop:"outside"},arrowIconSize:{desktop:24},initialSlide:b},styles:{sizeSetting:{desktop:{height:"80vh"},tablet:{height:"80vh"},mobile:{height:"60vh"}},playSpeed:0},moveToIdx:b,hiddenDotWhenOnlyOne:!0,isHiddenArrowWhenDisabled:!0,isDisableResetSlide:!0,builderProps:{uid:u},fullHeight:!0,children:p?.map(o=>e.jsx(i.default,{className:`gem-slider-item gem-slider-item-${u} gp-flex gp-items-center gp-justify-center gp-px-4`,children:x(o)?e.jsx(n.default,{type:o?.contentType,url:o.src??"",aspectRatio:m}):e.jsxs(e.Fragment,{children:[e.jsx(s.default,{src:r.isFeatureMedia(o?.contentType)?o?.previewImage:o?.src,width:o?.width,height:o?.height,alt:o?.alt,"content-type":o?.contentType,setting:{aspectRatio:m},className:t.cls("gp-h-full gp-w-full gp-object-contain")},o?.id),e.jsx(a.default,{contentType:o?.contentType??""})]})},o?.id))})})};
