import{getResponsiveValueByScreen as t,makeStyleResponsive as e,makeWidth as l,makeAspectRatio as o}from"@gem-sdk/core";import{convertUnitToNumber as i,getDisplayStyle as r}from"./helpers.js";let a=t=>({desktop:t?.desktop?.width,tablet:t?.tablet?.width,mobile:t?.mobile?.width}),p=t=>({desktop:t?.desktop?.height,tablet:t?.tablet?.height,mobile:t?.mobile?.height}),s=(t,e)=>o(e,a(t),p(t)),b=e=>{let l={};return["desktop","mobile","tablet"].forEach(o=>{let i=t(e,o);l="right"==i||"left"==i?{...l,[o]:!0}:{...l,[o]:!1}}),l},d=e=>r(l=>!t(e,l),"flex"),g=e=>{let l={};return["desktop","mobile","tablet"].forEach(o=>{let i=t(e,o);l={...l,[`${"desktop"===o?"":`${o}:`}!gp-flex-nowrap`]:"left"===i||"right"===i,[`${"desktop"===o?"":`${o}:`}gp-overflow-y-auto `]:"left"===i||"right"===i,[`${"desktop"===o?"":`${o}:`}!gp-items-end`]:"left"===i,[`${"desktop"===o?"":`${o}:`}!gp-items-start`]:"right"===i}}),l},m=()=>({desktop:!1,tablet:!1,mobile:!1}),h=e=>{let l={};return["desktop","mobile","tablet"].forEach(o=>{let i=t(e,o);l={...l,[`${"desktop"===o?"":`${o}:`}!gp-justify-center`]:"bottom-center"===i}}),l},f=(l,o,r)=>{let a={desktop:`${100/(l?.desktop||1)}%`,tablet:`${100/(l?.tablet||1)}%`,mobile:`${100/(l?.mobile||1)}%`};return["desktop","mobile","tablet"].forEach(e=>{let p=t(r,e);a={...a,[e]:`${"bottom-left"!==p&&"bottom-center"!==p&&p?"100%":`calc(${100/(l?.[e]||5)}% - ${i(o?.[e],5)*((l?.[e]||5)-1)/(l?.[e]||5)}px)`}`}}),e("w",a)},k=o=>{let i=o?.width;return["desktop","mobile","tablet"].forEach(e=>{let l=t(o?.galleryVisible,e),r=t(o?.featureImageVisible,e),a=t(o?.position,e);i={...i,[e]:("left"===a||"right"===a)&&l&&r?t(o?.widthHorizontalLayout,e):t(o?.width,e)}}),{...e("w",l(i,{desktop:!1,tablet:!1,mobile:!1}))}},n=(t,e)=>`--${t}${"desktop"===e?"":`-${e}`}`,$=(e,l)=>{let o={};return["desktop","mobile","tablet"].forEach(i=>{let r=t(e,i),a=n("mt",i),p=n("mr",i),s=n("ml",i);o="left"==r?{...o,[p]:t(l,i),[a]:"0px",[s]:"0px"}:"right"==r?{...o,[s]:t(l,i),[p]:"0px",[a]:"0px"}:{...o,[a]:t(l,i),[p]:"0px",[s]:"0px"}}),o},c=(e,l)=>{let o={};return["desktop","mobile","tablet"].forEach(i=>{let r=t(e,i),a=t(l,i);o={...o,[i]:"left"===a||"right"===a?"auto":r}}),o};export{m as getAllowDotConfig,b as getCarouselVerticalConfigByPosition,h as getClassJustifyByPosition,g as getClassOverflowAndFlexWrapForGrid,s as getGalleryImageAspectRatio,c as getSliderPerShowConfig,$ as getStyleGallerySpacing,k as getStyleWidthForGallery,f as getStyleWidthForGridItem,d as getZoomDisplay};
