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