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