'use client';
import{jsxs as o,jsx as s}from"react/jsx-runtime";import{useProduct as t,useProductOfferDiscount as r}from"@gem-sdk/core";import m from"../../text/components/Text.js";import{useDynamicProduct as e}from"../hooks/useDynamicProduct.js";import{createClass as i,createAttr as c,createStyle as u}from"@gem-sdk/system";import{getContainerAttrs as a}from"../common/attrs.js";import{getContainerClasses as d}from"../common/classes.js";import{getContainerStyles as p}from"../common/styles.js";import{getTextSettings as n}from"../common/helpers.js";let PostPurchaseProductDiscountTag=({setting:f={},styles:l={},style:P,builderAttrs:j,builderProps:g,children:h})=>{let y=t(),x=y?.baseID?.replace("gid://shopify/Product/",""),D=r(),{isDynamicProduct:k,isEnableDynamicDiscount:T}=e(),{typo:b,direction:v,textAlign:I,align:N,width:q}=l,{message:w}=f,z=!!D||k&&T,A=i({...d({uid:g?.uid})}),B=c({...a({...j,currentProductId:x,uid:g?.uid})}),C=u({...p({style:P,hasDiscount:z})}),E=n({hasDiscount:z,message:w});return o("div",{...B,className:A,style:C,children:[s(m,{setting:E,styles:{typo:b,direction:v,textAlign:I,align:N,width:q}}),h]})};export{PostPurchaseProductDiscountTag as default};
