'use client';
import{jsxs as e,jsx as m}from"react/jsx-runtime";import{useProduct as s,useCurrentVariant as o,useMoneyFormat as t,useCurrentDevice as r,useProductBundleDiscount as l,useEditorMode as i,usePageType as a,filterToolbarPreview as c}from"@gem-sdk/core";import{getBadgeContent as n,getIsNoDiscountState as d}from"./utils/common.js";import"./constants.js";import p from"../../../common/components/NoDataState.js";import f from"../../../common/components/TooltipHover.js";import{createClass as h,createStyle as y,createAttr as N,If as j}from"@gem-sdk/system";import{getEditTooltipAttrs as u,getNoDataAttrs as v,getSubWrapperAttrs as g,getContainerAttrs as T,getTextContentAttrs as k,getImageAttr as x}from"./common/attrs.js";import{getContainerClasses as B,getWrapperClasses as C,getSubWrapperClass as P,getTextContainerClasses as S,getTextWrapperClasses as b,getTextContentClasses as A,getImageContainerClasses as D,getImageClasses as H}from"./common/classes.js";import{getContainerStyle as I,getSubWrapperStyle as q,getContentStyleInternal as w,getTextBadgeWrapperStyles as z,getTextContentStyle as E,getImageContainerStyles as F}from"./common/styles.js";let ProductBadge=G=>{let{setting:J,styles:K,children:L,...M}=G,O=s(),Q=o(),{moneyFormat:R}=t(),U=r(),{useProductCompareAtPrice:V}=l(),W=M?.["bundle-item"],X=i(),Y="STATIC"===a(),Z=n({detail:O,currentVariant:Q,bundleItem:W,useProductCompareAtPrice:V},J?.displayContent,R),$=d({props:G,product:O,currentVariant:Q,moneyFormat:R,useProductCompareAtPrice:V}),_=h({...B({mode:X,isInstant:Y,product:O,currentVariant:Q,props:G})}),ee=y({...I(G)}),em=N({...u(G)}),es=N({...v(G)}),eo=h({...C(G)}),et=h({...P(G,U)}),er=y({...q(G,O,Q,X)}),el=N({...g(G,O)}),ei=w(G),ea=h({...S()}),ec=N({...T(G)}),en=h({...b()}),ed=y({...z({setting:J,styles:K})}),ep=h({...A(K)}),ef=y({...E({setting:J,styles:K})}),eh=N({...k()}),ey=h({...D()}),eN=y({...F({setting:J,styles:K})}),ej=h({...H()}),eu=N({...x({setting:J})});return O?e("div",{...ec,style:ee,className:_,children:[j("edit"===X&&$,m(f,{...em,children:m(p,{...es})}),m("div",{className:eo,children:e("div",{...el,className:et,style:er,children:[m("style",{children:ei}),j(J?.shape!=="image",m("div",{className:ea,children:m("div",{className:en,style:ed,children:m("pre",{...eh,className:ep,style:ef,children:Z})})}),m("div",{className:ey,style:eN,children:m("img",{...eu,className:ej,alt:""})}))]})})),c(L,!0)]}):null};export{ProductBadge as default};
