import{template as s}from"@gem-sdk/core";import{createAttr as t,createClass as e,createStyle as r,Liquid as o,If as m}from"@gem-sdk/system";import{getLink as i}from"../common/helpers.js";import{getAttr as l}from"../common/attrs.js";import{getContainerClasses as a,getIconClasses as d}from"../common/classes.js";import{getWrapperStyle as c,getContainerStyle as $,getIconStyle as p}from"../common/styles.js";let Icon=({style:n,builderAttrs:f,builderProps:u,setting:g={},styles:y,advanced:j})=>{let{iconSvg:v,iconLinkEnable:h}=g,{Wrap:k,urlData:C,iconLink:I}=i(g,!0),x=I?.link&&h?{href:C.href,target:C?.target,title:I?.title,rel:C?.rel}:{},W=t({...l({uid:u?.uid??"",builderAttrs:f})}),b=t({...u?.uid&&{"data-id":u?.uid}}),q=e({"gp-leading-[0]":!0,...u?.uid&&{[u.uid]:!0},...j?.cssClass&&{[j.cssClass]:!0}}),w=e({...a({styles:y,builderProps:u})}),z=e({...d({styles:y})}),A=r({...c(n,y)}),B=r({...$(y)}),D=r({...p(y)});return o(s`
    <div ${W} class="${q}" style="${A}">
      <div ${b} class="${w}" style="${B}">
      ${m(!!v,s`
        <${k} ${x}>
          <span style="${D}" class="${z}">${v}</span>
        </${k}>`)}
      </div>
    </div>
    `)};export{Icon as default};
