'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Text=require("../../text/components/Text.js"),useDynamicProduct=require("../hooks/useDynamicProduct.js"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),helpers=require("../common/helpers.js");const PostPurchaseProductDiscountTag=({setting:e={},styles:s={},style:t,builderAttrs:r,builderProps:u,children:c})=>{let o=core.useProduct(),i=o?.baseID?.replace("gid://shopify/Product/",""),a=core.useProductOfferDiscount(),{isDynamicProduct:n,isEnableDynamicDiscount:m}=useDynamicProduct.useDynamicProduct(),{typo:l,direction:d,textAlign:y,align:P,width:j}=s,{message:x}=e,g=!!a||n&&m,p=system.createClass({...classes.getContainerClasses({uid:u?.uid})}),q=system.createAttr({...attrs.getContainerAttrs({...r,currentProductId:i,uid:u?.uid})}),h=system.createStyle({...styles.getContainerStyles({style:t,hasDiscount:g})}),D=helpers.getTextSettings({hasDiscount:g,message:x});return jsxRuntime.jsxs("div",{...q,className:p,style:h,children:[jsxRuntime.jsx(Text.default,{setting:D,styles:{typo:l,direction:d,textAlign:y,align:P,width:j}}),c]})};exports.default=PostPurchaseProductDiscountTag;
