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