"use strict";var core=require("@gem-sdk/core"),useDynamicProduct=require("./useDynamicProduct.js");const useGetMoneyLines=(e,t)=>{let{isDynamicProduct:o,dynamicPrice:u,dynamicDiscount:i,isEnableDynamicDiscount:a}=useDynamicProduct.useDynamicProduct(),s=core.useProductOfferDiscount(),n=core.useCurrentVariant(),{quantity:l}=core.useQuantity(),r=s*(l||1),c=core.useFormatMoney(r,!1),p=n?.price??0,b=p*(l||1),d=core.useFormatMoney(b,!1),L=core.shopifyPriceRounding(r,2),h=core.useFormatMoney(b-parseFloat(L),!1),y=()=>{let n=[];return!1!==e.isShowSubTotalLabel&&n.push({title:t.subTotalLabel,money:o?u:d,uniqueId:"subTotalLabel"}),!1!==e.isShowDiscountLabel&&n.push({title:t.discountLabel,money:o&&i&&a?`${i.value}%`:s>0?c:"No discount",uniqueId:"discountLabel"}),!1!==e.isShowShippingLabel&&n.push({title:t.shippingLabel,uniqueId:"shippingLabel",tooltip:{content:"Shipping fee will be calculated on real offer page",width:"23em"}}),!1!==e.isShowTaxesLabel&&n.push({title:t.taxesLabel,uniqueId:"taxesLabel",tooltip:{content:"Taxes will be calculated on real offer page",width:"20em"}}),!1!==e.isShowTotalLabel&&n.push({title:t.totalLabel,money:o?u:h,uniqueId:"totalLabel"}),n};return{getMoneyLines:y}};exports.useGetMoneyLines=useGetMoneyLines;
