"use strict";var e=require("@gem-sdk/core");const t=(t,r)=>{let l=t?.[r];return e.getSingleColorVariable(l??t?.desktop)},r=(e,t)=>e?.[t]?.color,l=(e,t)=>e?.[t]?.width,o=(e,t)=>e?.[t]?.border,n=(e,t,r)=>s(l=>a({corner:e,cornerProps:t,device:l,shapeRadius:r})),a=e=>{let{cornerProps:t,device:r,corner:l,shapeRadius:o}=e,n=t?.[r]?.[l],a=t?.desktop?.[l],i=o?.[l];return n??a??i},i=t=>{let r={};for(let l of e.DEVICES){let o=t[l]||t.desktop;if(!o)continue;let{angle:n,distance:a,blur:i,color:s,enable:d}=o;if(!n||!a||!i||!s||!1===d)continue;let{unit:p}=e.parseValueWithUnit(`${a}`),u=`${Math.cos(parseFloat(`${n}`)*Math.PI/180)*parseFloat(`${a}`)}${p}`,$=`${Math.sin(parseFloat(`${n}`)*Math.PI/180)*parseFloat(`${a}`)}${p}`;r[l]=`drop-shadow(${u} ${$} ${i} ${e.getSingleColorVariable(s)})`}return r},s=t=>e.DEVICES.reduce((e,r)=>({...e,[r]:t(r)}),{}),d=t=>e.DEVICES.reduce((e,r)=>({...e,[r]:t(r)}),{});exports.generateShadowCSS=(e,t)=>{if(!t)return"";let r=i(t);return`
     ${e} {
      filter: ${r.desktop};
      transition: filter 0.3s ease;
    }

    @media only screen and (max-width: 1024px) and (min-width: 768px) {
      ${e} {
        filter: ${r.tablet||r.desktop};
      }
    }

    @media only screen and (max-width: 767px) {
      ${e} {
        filter: ${r.mobile||r.tablet||r.desktop};
      }
    }
  `},exports.getStyleBackground=(r,l)=>{if(!r)return{};let o=d(e=>t(l,e));return{...e.makeStyleResponsive("bg",o)}},exports.getStyleBorder=t=>{if(!t)return{};let n=s(e=>r(t,e)),a=s(e=>l(t,e)),i=s(e=>o(t,e)),d=e.removeNullUndefined({...e.makeStyleResponsive("bc",n),...e.makeStyleResponsive("bw",a),...e.makeStyleResponsive("bs",i)});return d},exports.getStyleCornerRadius=(t,r)=>{if(!t)return{};let l=["btlr","btrr","bblr","bbrr"].reduce((l,o)=>({...l,...e.removeNullUndefined(e.makeStyleResponsive(o,n(o,t,r)))}),{});return l};
