import{getHumanDiscount}from"../../../../functions/price";import{__}from"@wordpress/i18n";export const replaceAmount=(e,t,r="amount")=>e.replaceAll("{{"+r+"}}",t).replaceAll("{{ "+r+" }}",t);export const replaceAmountFromString=(e,t)=>(null==t?void 0:t.preservation_coupon)?replaceAmount(e,getHumanDiscount(null==t?void 0:t.preservation_coupon)):e;export const getCurrentBehaviourContent=(e,t)=>{const{preserve_title:r,preserve_description:o,preserve_button:n,cancel_link:i}=(null==e?void 0:e.preservation_locales)||{};return t?{title:replaceAmountFromString(__("Your {{ amount }} discount is still active.","surecart"),e),description:replaceAmountFromString(__("You have a {{ amount }} discount active. Cancelling now will forfeit this discount forever. Are you sure you wish to cancel?","surecart"),e),button:__("Keep My Discount","surecart"),cancel_link:__("Cancel Anyway","surecart")}:{title:replaceAmountFromString(r,e),description:replaceAmountFromString(o,e),button:n,cancel_link:i}};