'use client';
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{makeStyleResponsive as s}from"@gem-sdk/core";import o from"../../../common/components/NoDataState.js";import i from"../../../common/components/TooltipHover.js";import l from"../../../text/components/Text.js";import{createStyle as r,createClass as d,If as m}from"@gem-sdk/system";import{getWrapperTextStyle as n,getContainerStyle as a}from"./common/styles.js";import{getWrapperTextClass as p,getContainerClass as c,getRootClass as u}from"./common/classes.js";import{useGpDiscountTag as x}from"./hooks/useGpDiscountTag.js";let ProductTag=({setting:f,styles:g,builderProps:y,...h})=>{let{customContent:b}=f??{},j=h["bundle-item"],{textAlign:N}=g??{},{mode:T,product:v,salePrice:k,priceSave:w,currentProductId:A,unitCustomDisplay:D,shouldPlaceholderNoDiscount:F}=x({setting:f,styles:g,builderProps:y,...h});if(F)return e(i,{enable:!0,text:"Not be displayed when published",position:"bottom",width:"205px",children:e(o,{builderAttrs:y?.builderData,elementType:"secondary",description:"No discount",rawMode:!0,customClass:"!gp-p-[5px]"})});let S=r(n(g)),$=r(a(g)),q=d(p(g)),C=d(c()),I=d(u({mode:T,salePrice:k,priceSave:w,bundleItem:j}));return e("div",{className:I,style:{...s("ta",N)},id:`shopify-text-element-${y?.uid}`,"data-id":y?.uid,"data-product-id":A,"gp-data-hidden":"false",children:m(!v," ",e("div",{className:C,style:$,children:e("div",{className:q,style:S,children:t("div",{className:"gp-flex gp-break-all",children:[e(l,{styles:g,setting:{...f,text:b?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${y?.uid}-prefix`},excludeFlex:!0}}),e(l,{styles:g,setting:{...f,text:D,options:{isCannotEditing:!0},excludeFlex:!0}}),e(l,{styles:g,setting:{...f,text:b?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${y?.uid}-suffix`}}})]})})}))})};export{ProductTag as default};
