'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),system=require("@gem-sdk/system"),Link=require("../../link/components/Link.js"),attrs=require("../common/attrs.js"),classes=require("../common/classes.js"),styles=require("../common/styles.js");const Icon=({styles:e,builderAttrs:s,builderProps:t,setting:l={},style:r,children:a,advanced:n})=>{let{iconSvg:i,iconLink:c,iconLinkEnable:m}=l,y=c?.link&&m?Link.default:React.Fragment,o=c?.link?{setting:{type:"custom",href:c?.link,target:c?.target,label:c?.title,noFollow:c?.noFollow}}:{},u=system.createAttr({...attrs.getAttr({uid:t?.uid??"",builderAttrs:s})}),d=system.createAttr({...t?.uid&&{"data-id":t?.uid}}),j=system.createClass({"gp-leading-[0]":!0,...t?.uid&&{[t.uid]:!0},...n?.cssClass&&{[n.cssClass]:!0}}),g=system.createClass({...classes.getContainerClasses({styles:e,builderProps:t})}),x=system.createClass({...classes.getIconClasses({styles:e})}),p=system.createStyle({...styles.getWrapperStyle(r,e)}),C=system.createStyle({...styles.getContainerStyle(e)}),k=system.createStyle({...styles.getIconStyle(e)});return jsxRuntime.jsxs("div",{...u,style:p,className:j,children:[jsxRuntime.jsx("div",{...d,className:g,style:C,children:system.If(!!i,jsxRuntime.jsx(y,{...o,children:jsxRuntime.jsx("span",{style:k,className:x,dangerouslySetInnerHTML:{__html:i||""}})}))}),a]})};exports.default=Icon;
