import{DEVICES as e,makeStyleResponsive as a,makeWidth as s,getResponsiveValueByScreen as t}from"@gem-sdk/core";import{convertUnitToNumber as k}from"../../helpers.js";let getInitialWidthForCarouselItem=t=>{let k={};return e.forEach(e=>{if(!t?.vertical?.[e]){let e={...a("minw",s(getWidthForCarouselItem({spacing:t?.spacing,slidesToShow:t?.slidesToShow,sneakPeak:t?.sneakPeak,sneakPeakType:t?.sneakPeakType,sneakPeakOffsetCenter:t?.sneakPeakOffsetCenter,sneakPeakOffsetForward:t?.sneakPeakOffsetForward}))),...a("maxw",s(getWidthForCarouselItem({spacing:t?.spacing,slidesToShow:t?.slidesToShow,sneakPeak:t?.sneakPeak,sneakPeakType:t?.sneakPeakType,sneakPeakOffsetCenter:t?.sneakPeakOffsetCenter,sneakPeakOffsetForward:t?.sneakPeakOffsetForward})))};k={...k,...e}}}),k},getSlideToShow=a=>{let s={};return e.forEach(e=>{let k=t(a.sneakPeak,e),o=k?"center"===t(a.sneakPeakType,e)?t(a.sneakPeakOffsetCenter,e)??0:t(a.sneakPeakOffsetForward,e)??0:0,r=t(a.slidesToShow,e)||1,n="center"===t(a.sneakPeakType,e)?-2:-1;s[e]="auto"===r?r:r+o/100*n}),s},getWidthForCarouselItem=a=>{let s={};return e.forEach(e=>{let o=k(t(a.spacing,e),44),r=t(a.sneakPeak,e,!1),n=k(t(r?getSlideToShow({slidesToShow:a?.slidesToShow,sneakPeak:a?.sneakPeak,sneakPeakType:a?.sneakPeakType,sneakPeakOffsetCenter:a?.sneakPeakOffsetCenter,sneakPeakOffsetForward:a?.sneakPeakOffsetForward}):a.slidesToShow,e),4);s={...s,[e]:`calc(100% / ${n} - ${(n-1)*o/n}px)`}}),s},DOT_CONTAINER_SELECTOR="gp-carousel-dot-container";export{DOT_CONTAINER_SELECTOR,getInitialWidthForCarouselItem,getSlideToShow,getWidthForCarouselItem};
