"use strict";var e=require("@gem-sdk/core");require("react/jsx-runtime"),require("react");var t=require("../../common/const.js"),l=require("../../helpers.js"),r=require("../settings/configs/translate.js");const a=e=>"top"==e?"sticky":"fixed",o=(e,t,l)=>{let r={[`--top${e}`]:"auto",[`--${l+e}`]:"0",[`--pos${e}`]:a(l)};switch(t){case"after-first-cart-button":r[`--d${e}`]="none";break;case"always":r[`--d${e}`]="block"}return r},p=(e,t)=>({...o("",e?.desktop,t?.desktop),...o("-tablet",e?.tablet??e?.desktop,t?.tablet??t?.desktop),...o("-mobile",e?.mobile??e?.tablet??e?.desktop,t?.mobile??t?.tablet??t?.desktop)}),s=(e,t)=>({[`--left${t}`]:"top"==e?"0":"50%",[`--t${t}`]:"top"==e?"unset":"translateX(-50%)"}),i=e=>({...s(e?.desktop,""),...s(e?.tablet??e?.desktop,"-tablet"),...s(e?.mobile??e?.tablet??e?.desktop,"-mobile")}),b=e=>{let t={};return["--pt","--pb","--pr","--pl","--pt-mobile","--pb-mobile","--pr-mobile","--pl-mobile","--pt-tablet","--pb-tablet","--pr-tablet","--pl-tablet"].forEach(l=>{e?.[l]&&(t[l]=e[l])}),t},n=e=>{let t={...e};return["--pt","--pb","--pr","--pl","--pt-mobile","--pb-mobile","--pr-mobile","--pl-mobile","--pt-tablet","--pb-tablet","--pr-tablet","--pl-tablet"].forEach(e=>{delete t?.[e]}),t};exports.displayConditionStyle=p,exports.filterStyles=n,exports.getContainerStyles=e=>{let{position:l,display:r}=e;return{margin:"0 auto",...i(l),...p(r,l),"z-index":t.ELEMENT_Z_INDEX.STICKY}},exports.getContentStyles=({setting:t,style:a,uid:o,pageContext:p,type:s="React"})=>{let{background:i}=t||{},d="Liquid"===s?l.getBackgroundTranslated({background:i,uid:o,enableTranslate:!!r.Sticky?.background?.id,pageContext:p,isTranslateVideo:!1}):i;return{...e.makeStyle({m:"0 auto"}),...b(a),...n(a),...e.getStyleBackgroundByDevice(d||i),...e.getGradientImageBgrStyleByDevice(d||i)}},exports.getDisplayStyle=o,exports.getStylePadding=b;
