(()=>{var e;e=jQuery,window.wp.data.subscribe(()=>{const r=window.wp.data.select("wc/store/cart").getCartData(),t=yaydp_frontend_data.discount_based_on;let a="",c="",n="",i="";if(r){let e=0;r.items.forEach(r=>{a=r.prices.currency_symbol,c=r.prices.currency_minor_unit,n=r.prices.currency_decimal_separator,i=r.prices.currency_thousand_separator;const s=r.quantity,o=r.prices.price;let u="";u="regular_price"===t||r.prices.sale_price===o?r.prices.regular_price:r.prices.sale_price,e+=function(e,r){return e*r}(u,s)-function(e,r){return e*r}(o,s)}),savedAmountDecimal=function(e,r,t="."){let a=e.toString(),c=a.length-parseInt(r);return c<=0?"0"+t+"0".repeat(Math.abs(c))+a:a.slice(0,c)+t+a.slice(c)}(e,c,n),formatedSavedAmount=accounting.formatMoney(savedAmountDecimal,{symbol:a,precision:c,decimal:n,thousand:i})}e("#saved-amount-value").html(formatedSavedAmount)})})();