"use strict";var core=require("@gem-sdk/core"),helpers$1=require("./helpers.js"),helpers=require("../../helpers.js"),translate=require("../settings/configs/translate.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t)=>{let r={...core.makeStyle({mr:e?.spacing,mb:e?.spacing}),...core.makeStyleResponsive("ta",e?.align),...t,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(r)},getContainerStyle=(e,t)=>{let{tagWidth:r}=t??{},o={...core.makeStyleResponsive("jc",e?.align),...r};return filterTruthyStyles(o)},getTextStyle=({styles:e,setting:t,builderProps:r,pageContext:o,type:l="React"})=>{let a=t?.background;"Liquid"===l&&(a=helpers.getBackgroundTranslated({background:a,uid:r?.uid,enableTranslate:!!translate.Text?.background?.id,pageContext:o,isTranslateVideo:!1}));let i=core.makeGlobalSize(t?.globalSize),s=[e?.lineThrough&&"line-through",e?.typo?.attrs?.underline&&"underline"].filter(Boolean),n={...i?.width?.["--w"]?i.width:{"--w":"100%"},...core.makeStyle({tdc:core.getSingleColorVariable(e?.lineColor?.normal),tdt:helpers$1.formatThickness(e?.thickness)}),...core.composeBorderResponsive(e?.shapeBorder),...core.composeRadiusResponsive(e?.shapeRounded),...core.getResponsiveStyleShadowWithoutState(e?.shapeBoxShadow,"box-shadow",e?.shapeBoxShadow),...core.getStyleShadow({value:e?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:e?.typo?.custom?.hasShadowText}),...core.makeStyleResponsive("ta",e?.textAlign),...core.makeStyleResponsive("line-clamp",core.makeLineClamp(e?.lineClamp,e?.hasLineClamp)),...e?.textColor?core.getGlobalColorStyle(e.textColor):core.getGlobalColorStateStyle("c",e?.color),...core.composeTypographyStyle(e?.typo,e?.typography),"word-break":"break-word",...core.getStyleBackgroundByDevice(a),...i.padding,...core.getGradientBgrStyleByDevice(a,{desktop:!0,tablet:!0,mobile:!0}),overflow:"hidden",...e?.opacityPrice&&{opacity:`${e?.opacityPrice}%`},...core.makeStyle({tdl:s.join(" ")})};return e?.enableHoverEffect?filterTruthyStyles(n):core.filterHoverVariables(n)},getTextStyleInline=e=>{let t={...core.composeTypographyStyle(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};exports.getContainerStyle=getContainerStyle,exports.getStyle=getStyle,exports.getTextStyle=getTextStyle,exports.getTextStyleInline=getTextStyleInline;
