'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),common=require("./utils/common.js");require("./constants.js");var NoDataState=require("../../../common/components/NoDataState.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),system=require("@gem-sdk/system"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js");const ProductBadge=e=>{let{setting:s,styles:t,children:r,...a}=e,l=core.useProduct(),c=core.useCurrentVariant(),{moneyFormat:o}=core.useMoneyFormat(),n=core.useCurrentDevice(),{useProductCompareAtPrice:m}=core.useProductBundleDiscount(),i=a?.["bundle-item"],y=core.useEditorMode(),{isEditMode:u}=core.useRenderMode(),d="STATIC"===core.usePageType(),g=common.getBadgeContent({detail:l,currentVariant:c,bundleItem:i,useProductCompareAtPrice:m},s?.displayContent,o),j=common.getIsNoDiscountState({props:e,product:l,currentVariant:c,moneyFormat:o,useProductCompareAtPrice:m}),x=system.createClass({...classes.getContainerClasses({mode:y,isInstant:d,product:l,currentVariant:c,props:e})}),C=system.createStyle({...styles.getContainerStyle(e)}),p=system.createAttr({...attrs.getEditTooltipAttrs(e)}),S=system.createAttr({...attrs.getNoDataAttrs(e)}),v=system.createClass({...classes.getWrapperClasses(e)}),T=system.createClass({...classes.getSubWrapperClass(e,n)}),A=system.createStyle({...styles.getSubWrapperStyle({props:e,product:l,currentVariant:c,isEditMode:u})}),N=system.createAttr({...attrs.getSubWrapperAttrs(e,l)}),R=styles.getContentStyleInternal(e),h=system.createClass({...classes.getTextContainerClasses()}),q=system.createAttr({...attrs.getContainerAttrs(e)}),I=system.createClass({...classes.getTextWrapperClasses()}),f=system.createStyle({...styles.getTextBadgeWrapperStyles({setting:s,styles:t})}),D=system.createClass({...classes.getTextContentClasses(t)}),P=system.createStyle({...styles.getTextContentStyle({setting:s,styles:t})}),b=system.createAttr({...attrs.getTextContentAttrs()}),W=system.createClass({...classes.getImageContainerClasses()}),B=system.createStyle({...styles.getImageContainerStyles({setting:s,styles:t})}),M=system.createClass({...classes.getImageClasses()}),H=system.createAttr({...attrs.getImageAttr({setting:s})});return l?jsxRuntime.jsxs("div",{...q,style:C,className:x,children:[system.If(u&&j,jsxRuntime.jsx(TooltipHover.default,{...p,children:jsxRuntime.jsx(NoDataState.default,{...S})}),jsxRuntime.jsx("div",{className:v,children:jsxRuntime.jsxs("div",{...N,className:T,style:A,children:[jsxRuntime.jsx("style",{children:R}),system.If(s?.shape!=="image",jsxRuntime.jsx("div",{className:h,children:jsxRuntime.jsx("div",{className:I,style:f,children:jsxRuntime.jsx("pre",{...b,className:D,style:P,children:g})})}),jsxRuntime.jsx("div",{className:W,style:B,children:jsxRuntime.jsx("img",{...H,className:M,alt:""})}))]})})),core.filterToolbarPreview(r,!0)]}):null};exports.default=ProductBadge;
