"use strict";var e=require("./constants.js");const t=/^\s*\{\{[\s\S]*\}\}\s*$/,r=e=>e.replace(/\s*\}\}\s*$/,"| escape  }}"),o=e=>{if(null==e)return e;let o=e.toString();return t.test(o)?r(o):o.replaceAll("'","&#39;").replaceAll("’","&#39;").replaceAll('"',"&quot;")},a=e=>(e?.attrs&&e?.attrs.color&&delete e.attrs.color,e);exports.checkIconVisibility=e=>e?.enableIcon===!0,exports.escapeSingleQuoteForAttr=o,exports.getGPProductButtonState=({styles:e,setting:t})=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:t?.errorType,actionEffect:t?.actionEffect,enableMessage:t?.enableMessage,label:o(t?.label),outOfStockLabel:o(t?.outOfStockLabel),customURL:{link:o(t?.customURL?.link),target:t?.customURL?.target}},variantID:"{{variant.id}}",disabled:"{{variant.available}}",totalVariant:"{{total_combinations}}"}),exports.getRenderComparePriceSettings=e=>({lineThrough:!0,typo:a(e?.compareAtPriceTypo),opacityPrice:e?.opacityPrice}),exports.getRenderRegularPriceSettings=e=>({lineThrough:!1,typo:a(e?.priceTypo)}),exports.renderSeparator=t=>({dot:e.SEPARATOR.DOT,"vertical-line":e.SEPARATOR.VERTICAL_LINE,"horizontal-line":e.SEPARATOR.HORIZONTAL_LINE})[t??"horizontal-line"]??e.SEPARATOR.HORIZONTAL_LINE;
