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