"use strict";var core=require("@gem-sdk/core"),React=require("react"),common=require("../common/common.js");const useFeatureImageWithGallery=e=>{let{setting:t,styles:r}=e,u={...t,...r},c=core.useCurrentDevice(),s=React.useRef(null),i=React.useRef(null),[n,a]=React.useState(""),[o,l]=React.useState(100),[m,f]=React.useState(),R=core.getResponsiveValueByScreen(u?.position,c),g="slider"===common.getTypeWidthDevice(u?.type)[c]||["left","right","inside-left","inside-right"].includes(R),h=(e,t=200)=>{e&&(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>l(i?.current?.offsetHeight||200),t))};return React.useEffect(()=>{let e=i?.current;if(!e)return;let t=new ResizeObserver(()=>{l(e.offsetHeight||200)});return t.observe(e),()=>{t.disconnect()}}),{isShowCarousel:g,featureImageHeight:o,featureWrapperImage:i,onClickFeatureArrow:n,activeIndexFromFeatureImage:m,setOnClickFeatureArrow:a,onHandleLoadedFeatureImage:h,setActiveIndexFromFeatureImage:f}};exports.useFeatureImageWithGallery=useFeatureImageWithGallery;
