1!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.sbjs=e()}}(function(){return function e(t,r,n){function a(s,o){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!o&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[s]={exports:{}};t[s][0].call(p.exports,function(e){var r=t[s][1][e];return a(r||e)},p,p.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(e,t,r){"use strict";var n=e("./init"),a={init:function(e){this.get=n(e),e&&e.callback&&"function"==typeof e.callback&&e.callback(this.get)}};t.exports=a},{"./init":6}],2:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/utils"),i={containers:{current:"sbjs_current",current_extra:"sbjs_current_add",first:"sbjs_first",first_extra:"sbjs_first_add",session:"sbjs_session",udata:"sbjs_udata",promocode:"sbjs_promo"},service:{migrations:"sbjs_migrations"},delimiter:"|||",aliases:{main:{type:"typ",source:"src",medium:"mdm",campaign:"cmp",content:"cnt",term:"trm",id:"id",platform:"plt",format:"fmt",tactic:"tct"},extra:{fire_date:"fd",entrance_point:"ep",referer:"rf"},session:{pages_seen:"pgs",current_page:"cpg"},udata:{visits:"vst",ip:"uip",agent:"uag"},promo:"code"},pack:{main:function(e){return i.aliases.main.type+"="+e.type+i.delimiter+i.aliases.main.source+"="+e.source+i.delimiter+i.aliases.main.medium+"="+e.medium+i.delimiter+i.aliases.main.campaign+"="+e.campaign+i.delimiter+i.aliases.main.content+"="+e.content+i.delimiter+i.aliases.main.term+"="+e.term+i.delimiter+i.aliases.main.id+"="+e.id+i.delimiter+i.aliases.main.platform+"="+e.platform+i.delimiter+i.aliases.main.format+"="+e.format+i.delimiter+i.aliases.main.tactic+"="+e.tactic},extra:function(e){return i.aliases.extra.fire_date+"="+a.setDate(new Date,e)+i.delimiter+i.aliases.extra.entrance_point+"="+document.location.href+i.delimiter+i.aliases.extra.referer+"="+(document.referrer||n.none)},user:function(e,t){return i.aliases.udata.visits+"="+e+i.delimiter+i.aliases.udata.ip+"="+t+i.delimiter+i.aliases.udata.agent+"="+navigator.userAgent},session:function(e){return i.aliases.session.pages_seen+"="+e+i.delimiter+i.aliases.session.current_page+"="+document.location.href},promo:function(e){return i.aliases.promo+"="+a.setLeadingZeroToInt(a.randomInt(e.min,e.max),e.max.toString().length)}}};t.exports=i},{"./helpers/utils":5,"./terms":9}],3:[function(e,t,r){"use strict";var n=e("../data").delimiter;t.exports={useBase64:!1,setBase64Flag:function(e){this.useBase64=e},encodeData:function(e){return encodeURIComponent(e).replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")},decodeData:function(e){try{return decodeURIComponent(e).replace(/\%21/g,"!").replace(/\%7E/g,"~").replace(/\%2A/g,"*").replace(/\%27/g,"'").replace(/\%28/g,"(").replace(/\%29/g,")")}catch(t){try{return unescape(e)}catch(r){return""}}},set:function(e,t,r,n,a){var i,s;if(r){var o=new Date;o.setTime(o.getTime()+60*r*1e3),i="; expires="+o.toGMTString()}else i="";s=n&&!a?";domain=."+n:"";var c=this.encodeData(t);this.useBase64&&(c=btoa(c).replace(/=+$/,"")),document.cookie=this.encodeData(e)+"="+c+i+s+"; path=/"},get:function(e){for(var t=this.encodeData(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t)){var i=a.substring(t.length,a.length);if(/^[A-Za-z0-9+/]+$/.test(i))try{i=atob(i.padEnd(4*Math.ceil(i.length/4),"="))}catch(s){}return this.decodeData(i)}}return null},destroy:function(e,t,r){this.set(e,"",-1,t,r)},parse:function(e){var t=[],r={};if("string"==typeof e)t.push(e);else for(var a in e)e.hasOwnProperty(a)&&t.push(e[a]);for(var i=0;i<t.length;i++){var s;r[this.unsbjs(t[i])]={},s=this.get(t[i])?this.get(t[i]).split(n):[];for(var o=0;o<s.length;o++){var c=s[o].split("="),u=c.splice(0,1);u.push(c.join("=")),r[this.unsbjs(t[i])][u[0]]=this.decodeData(u[1])}}return r},unsbjs:function(e){return e.replace("sbjs_","")}}},{"../data":2}],4:[function(e,t,r){"use strict";
1t.exports={parse:function(e){for(var t=this.parseOptions,r=t.parser[t.strictMode?"strict":"loose"].exec(e),n={},a=14;a--;)n[t.key[a]]=r[a]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(e,r,a){r&&(n[t.q.name][r]=a)}),n},parseOptions:{strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},getParam:function(e){for(var t={},r=(e||window.location.search.substring(1)).split("&"),n=0;n<r.length;n++){var a=r[n].split("=");if("undefined"==typeof t[a[0]])t[a[0]]=a[1];else if("string"==typeof t[a[0]]){var i=[t[a[0]],a[1]];t[a[0]]=i}else t[a[0]].push(a[1])}return t},getHost:function(e){return this.parse(e).host.replace("www.","")}}},{}],5:[function(e,t,r){"use strict";t.exports={escapeRegexp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},setDate:function(e,t){var r=e.getTimezoneOffset()/60,n=e.getHours(),a=t||0===t?t:-r;return e.setHours(n+r+a),e.getFullYear()+"-"+this.setLeadingZeroToInt(e.getMonth()+1,2)+"-"+this.setLeadingZeroToInt(e.getDate(),2)+" "+this.setLeadingZeroToInt(e.getHours(),2)+":"+this.setLeadingZeroToInt(e.getMinutes(),2)+":"+this.setLeadingZeroToInt(e.getSeconds(),2)},setLeadingZeroToInt:function(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r},randomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}}},{}],6:[function(e,t,r){"use strict";var n=e("./data"),a=e("./terms"),i=e("./helpers/cookies"),s=e("./helpers/uri"),o=e("./helpers/utils"),c=e("./params"),u=e("./migrations");t.exports=function(e){var t,r,p,f,m,d,l,g,h,y,_,v,b,x=c.fetch(e),k=s.getParam(),w=x.domain.host,q=x.domain.isolate,I=x.lifetime;function j(e){switch(e){case a.traffic.utm:t=a.traffic.utm,r="undefined"!=typeof k.utm_source?k.utm_source:"undefined"!=typeof k.gclid?"google":"undefined"!=typeof k.yclid?"yandex":a.none,p="undefined"!=typeof k.utm_medium?k.utm_medium:"undefined"!=typeof k.gclid?"cpc":"undefined"!=typeof k.yclid?"cpc":a.none,f="undefined"!=typeof k.utm_campaign?k.utm_campaign:"undefined"!=typeof k[x.campaign_param]?k[x.campaign_param]:"undefined"!=typeof k.gclid?"google_cpc":"undefined"!=typeof k.yclid?"yandex_cpc":a.none,m="undefined"!=typeof k.utm_content?k.utm_content:"undefined"!=typeof k[x.content_param]?k[x.content_param]:a.none,l=k.utm_id||a.none,g=k.utm_source_platform||a.none,h=k.utm_creative_format||a.none,y=k.utm_marketing_tactic||a.none,d="undefined"!=typeof k.utm_term?k.utm_term:"undefined"!=typeof k[x.term_param]?k[x.term_param]:function(){var e=document.referrer;if(k.utm_term)return k.utm_term;if(!(e&&s.parse(e).host&&s.parse(e).host.match(/^(?:.*\.)?yandex\..{2,9}$/i)))return!1;try{return s.getParam(s.parse(document.referrer).query).text}catch(t){return!1}}()||a.none;break;case a.traffic.organic:t=a.traffic.organic,r=r||s.getHost(document.referrer),p=a.referer.organic,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.referral:t=a.traffic.referral,r=r||s.getHost(document.referrer),p=p||a.referer.referral,f=a.none,m=s.parse(document.referrer).path,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.typein:t=a.traffic.typein,r=x.typein_attributes.source,p=x.typein_attributes.medium,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;default:t=a.oops,r=a.oops,p=a.oops,f=a.oops,m=a.oops,d=a.oops,l=a.oops,g=a.oops,h=a.oops,y=a.oops}var i={type:t,source:r,medium:p,campaign:f,content:m,term:d,id:l,platform:g,format:h,tactic:y};return n.pack.main(i)}function R(e){var t=document.referrer;switch(e){case a.traffic.organic:return!!t&&H(t)&&function(e){var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp("yandex")+"\\..{2,9}$"),n=new RegExp(".*"+o.escapeRegexp("text")+"=.*"),a=new RegExp("^(?:www\\.)?"+o.escapeRegexp("google")+"\\..{2,9}$");if(s.parse(e).query&&s.parse(e).host.match(t)&&s.parse(e).query.match(n))return r="yandex",!0;if(s.parse(e).host.match(a))return r="google",!0;
vendor: 6,377 bytes, line 1
1if(!s.parse(e).query)return!1;for(var i=0;i<x.organics.length;i++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.organics[i].host)+"$","i"))&&s.parse(e).query.match(new RegExp(".*"+o.escapeRegexp(x.organics[i].param)+"=.*","i")))return r=x.organics[i].display||x.organics[i].host,!0;if(i+1===x.organics.length)return!1}}(t);case a.traffic.referral:return!!t&&H(t)&&function(e){if(!(x.referrals.length>0))return r=s.getHost(e),!0;for(var t=0;t<x.referrals.length;t++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.referrals[t].host)+"$","i")))return r=x.referrals[t].display||x.referrals[t].host,p=x.referrals[t].medium||a.referer.referral,!0;if(t+1===x.referrals.length)return r=s.getHost(e),!0}}(t);default:return!1}}function H(e){if(x.domain){if(q)return s.getHost(e)!==s.getHost(w);var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp(w)+"$","i");return!s.getHost(e).match(t)}return s.getHost(e)!==s.getHost(document.location.href)}function D(){i.set(n.containers.current_extra,n.pack.extra(x.timezone_offset),I,w,q),i.get(n.containers.first_extra)||i.set(n.containers.first_extra,n.pack.extra(x.timezone_offset),I,w,q)}return i.setBase64Flag(x.base64),u.go(I,w,q),i.set(n.containers.current,function(){var e;if("undefined"!=typeof k.utm_source||"undefined"!=typeof k.utm_medium||"undefined"!=typeof k.utm_campaign||"undefined"!=typeof k.utm_content||"undefined"!=typeof k.utm_term||"undefined"!=typeof k.utm_id||"undefined"!=typeof k.utm_source_platform||"undefined"!=typeof k.utm_creative_format||"undefined"!=typeof k.utm_marketing_tactic||"undefined"!=typeof k.gclid||"undefined"!=typeof k.yclid||"undefined"!=typeof k[x.campaign_param]||"undefined"!=typeof k[x.term_param]||"undefined"!=typeof k[x.content_param])D(),e=j(a.traffic.utm);else if(R(a.traffic.organic))D(),e=j(a.traffic.organic);else if(!i.get(n.containers.session)&&R(a.traffic.referral))D(),e=j(a.traffic.referral);else{if(i.get(n.containers.first)||i.get(n.containers.current))return i.get(n.containers.current);D(),e=j(a.traffic.typein)}return e}(),I,w,q),i.get(n.containers.first)||i.set(n.containers.first,i.get(n.containers.current),I,w,q),i.get(n.containers.udata)?(_=parseInt(i.parse(n.containers.udata)[i.unsbjs(n.containers.udata)][n.aliases.udata.visits])||1,_=i.get(n.containers.session)?_:_+1,v=n.pack.user(_,x.user_ip)):(_=1,v=n.pack.user(_,x.user_ip)),i.set(n.containers.udata,v,I,w,q),i.get(n.containers.session)?(b=parseInt(i.parse(n.containers.session)[i.unsbjs(n.containers.session)][n.aliases.session.pages_seen])||1,b+=1):b=1,i.set(n.containers.session,n.pack.session(b),x.session_length,w,q),x.promocode&&!i.get(n.containers.promocode)&&i.set(n.containers.promocode,n.pack.promo(x.promocode),I,w,q),i.parse(n.containers)}},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(e,t,r){"use strict";var n=e("./data"),a=e("./helpers/cookies");t.exports={go:function(e,t,r){var i,s=this.migrations,o={l:e,d:t,i:r};if(a.get(n.containers.first)||a.get(n.service.migrations)){if(!a.get(n.service.migrations))for(i=0;i<s.length;i++)s[i].go(s[i].id,o)}else{var c=[];for(i=0;i<s.length;i++)c.push(s[i].id);var u="";for(i=0;i<c.length;i++)u+=c[i]+"=1",i<c.length-1&&(u+=n.delimiter);a.set(n.service.migrations,u,o.l,o.d,o.i)}},migrations:[{id:"1418474375998",version:"1.0.0-beta",go:function(e,t){var r=e+"=1",i=e+"=0",s=function(e,t,r){return t||r?e:n.delimiter};try{var o=[];for(var c in n.containers)n.containers.hasOwnProperty(c)&&o.push(n.containers[c]);for(var u=0;u<o.length;u++)if(a.get(o[u])){var p=a.get(o[u]).replace(/(\|)?\|(\|)?/g,s);a.destroy(o[u],t.d,t.i),a.destroy(o[u],t.d,!t.i),a.set(o[u],p,t.l,t.d,t.i)}a.get(n.containers.session)&&a.set(n.containers.session,n.pack.session(0),t.l,t.d,t.i),a.set(n.service.migrations,r,t.l,t.d,t.i)}catch(f){a.set(n.service.migrations,i,t.l,t.d,t.i)}}}]}},{"./data":2,"./helpers/cookies":3}],8:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/uri");t.exports={fetch:function(e){var t=e||{},r={};if(r.lifetime=this.validate.checkFloat(t.lifetime)||6,r.lifetime=parseInt(30*r.lifetime*24*60),r.session_length=this.validate.checkInt(t.session_length)||30,r.timezone_offset=this.validate.checkInt(t.timezone_offset),r.base64=t.base64||!1,r.campaign_param=t.campaign_param||!1,r.term_param=t.term_param||!1,r.content_param=t.content_param||!1,r.user_ip=t.user_ip||n.none,t.promocode?(r.promocode={},r.promocode.min=parseInt(t.promocode.min)||1e5,r.promocode.max=parseInt(t.promocode.max)||999999):r.promocode=!1,t.typein_attributes&&t.typein_attributes.source&&t.typein_attributes.medium?(r.typein_attributes={},r.typein_attributes.source=t.typein_attributes.source,r.typein_attributes.medium=t.typein_attributes.medium):r.typein_attributes={source:"(direct)",medium:"(none)"},t.domain&&this.validate.isString(t.domain)?r.domain={host:t.domain,isolate:!1}:t.domain&&t.domain.host?r.domain=t.domain:r.domain={host:a.getHost(document.location.hostname),isolate:!1},r.referrals=[],t.referrals&&t.referrals.length>0)for(var i=0;i<t.referrals.length;i++)t.referrals[i].host&&r.referrals.push(t.referrals[i]);if(r.organics=[],t.organics&&t.organics.length>0)for(var s=0;s<t.organics.length;s++)t.organics[s].host&&t.organics[s].param&&r.organics.push(t.organics[s]);return r.organics.push({host:"bing.com",param:"q",display:"bing"}),r.organics.push({host:"yahoo.com",param:"p",display:"yahoo"}),r.organics.push({host:"about.com",param:"q",display:"about"}),r.organics.push({host:"aol.com",param:"q",display:"aol"}),r.organics.push({host:"ask.com",param:"q",display:"ask"}),r.organics.push({host:"globososo.com",param:"q",display:"globo"}),r.organics.push({host:"go.mail.ru",param:"q",display:"go.mail.ru"}),r.organics.push({host:"rambler.ru",param:"query",display:"rambler"}),r.organics.push({host:"tut.by",param:"query",display:"tut.by"}),r.referrals.push({host:"t.co",display:"twitter.com"}),r.referrals.push({host:"plus.url.google.com",display:"plus.google.com"}),r},validate:{checkFloat:function(e){return!(!e||!this.isNumeric(parseFloat(e)))&&parseFloat(e)},checkInt:function(e){return!(!e||!this.isNumeric(parseInt(e)))&&parseInt(e)},isNumeric:function(e){return!isNaN(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)}}}},{"./helpers/uri":4,"./terms":9}],9:[function(e,t,r){"use strict";
1t.exports={traffic:{utm:"utm",organic:"organic",referral:"referral",typein:"typein"},referer:{referral:"referral",organic:"organic",social:"social"},none:"(none)",oops:"(Houston, we have a problem)"}},{}]},{},[1])(1)});; 2!function(t){"use strict";const e=t.params,n=(document.querySelector.bind(document),(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t)),i=()=>null,s=t=>null===t||t===undefined?"":t,o="wc/store/checkout";function a(t){document.querySelectorAll("wc-order-attribution-inputs").forEach((t,e)=>{e>0&&t.remove()});for(const e of document.querySelectorAll("wc-order-attribution-inputs"))e.values=t}function r(t){window.wp&&window.wp.data&&window.wp.data.dispatch&&window.wc&&window.wc.wcBlocksData&&window.wp.data.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY).setExtensionData("woocommerce/order-attribution",t,!0)}function c(){return"undefined"!=typeof sbjs}function d(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const e=window.wp.data.subscribe(function(){e(),r(t.getAttributionData())},o)}}t.getAttributionData=function(){const s=e.allowTracking&&c()?n:i,o=c()?sbjs.get:{},a=Object.entries(t.fields).map(([t,e])=>[t,s(o,e)]);return Object.fromEntries(a)},t.setOrderTracking=function(n){if(e.allowTracking=n,n){if(!c())return;sbjs.init({lifetime:Number(e.lifetime),session_length:Number(e.session),base64:Boolean(e.base64),timezone_offset:"0"})}else!function(){const t=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(e=>{document.cookie=`${e}=; path=/; max-age=-999; domain=.${t};`})}();const i=t.getAttributionData();a(i),r(i)},t.setOrderTracking(e.allowTracking),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",d):d(),window.customElements.define("wc-order-attribution-inputs",class extends HTMLElement{constructor(){if(super(),this._fieldNames=Object.keys(t.fields),this.hasOwnProperty("_values")){let t=this.values;delete this.values,this.values=t||{}}}connectedCallback(){this.innerHTML="";const t=new DocumentFragment;for(const n of this._fieldNames){const i=document.createElement("input");i.type="hidden",i.name=`${e.prefix}${n}`,i.value=s(this.values&&this.values[n]||""),t.appendChild(i)}this.appendChild(t)}set values(t){if(this._values=t,this.isConnected)for(const t of this._fieldNames){const n=this.querySelector(`input[name="${e.prefix}${t}"]`);n?n.value=s(this.values[t]):console.warn(`Field "${t}" not found. `+"Most likely, the '<wc-order-attribution-inputs>' element was manipulated.")}}get values(){return this._values}})}(window.wc_order_attribution);; 3!function (e, r) { YayCurrency_Callback = r.YayCurrency_Callback || {}, yay_currency_data_args = { common_data_args: { yayCurrencySymbolWrapper: "span.woocommerce-Price-currencySymbol", yayCurrencySwitcher: ".yay-currency-single-page-switcher", yayCountryCurrency: ".yay-currency-country-currency-notice-wrapper", yayCurrencyLoading: "yay-currency-cache-loading", yayCurrencyHide: "yay-currency-force-payment-hide", yayCurrencyWidget: ".yay-currency-widget-switcher", yayCurrencyMenu: ".yay-currency-menu-shortcode-switcher", yayCurrencyShortcode: ".yay-currency-shortcode-switcher", yayCurrencyBlock: ".yay-currency-block-switcher", yayCurrencyShortcodePriceHtml: ".yay-currency-shortcode-price-html-wrapper", yayCurrencyShortcodeProductPriceHtml: ".yay-currency-shortcode-product-price-html-wrapper" }, converter_args: { converterWrapper: ".yay-currency-converter-container", converterAmount: ".yay-currency-converter-amount", converterFrom: ".yay-currency-converter-from-currency", converterTo: ".yay-currency-converter-to-currency", converterResultWrapper: ".yay-currency-converter-result-wrapper", converterResultAmount: ".yay-currency-converter-amount-value", converterResultFrom: ".yay-currency-converter-from-currency-code", converterResultValue: ".yay-currency-converter-result-value", converterResultTo: ".yay-currency-converter-to-currency-code" }, caching_data_args: { yayProductId: ".yay-currency-cache-product-id", yayVariationId: ".variations_form", yayDataProductId: "yay_currency-product-id", yayCurrencyMiniCartContents: yay_callback_data.minicart_contents_class, yayCurrencyProduct: ".yay-currency-single-product-switcher" }, switcher_data_args: { activeClass: "active", upwardsClass: "upwards", openClass: "open", selectedClass: "selected", currencySwitcher: ".yay-currency-switcher", currencyFlag: ".yay-currency-flag", currencySelectedFlag: ".yay-currency-flag.selected", customLoader: ".yay-currency-custom-loader", customOption: ".yay-currency-custom-options", customArrow: ".yay-currency-custom-arrow", customOptionArrow: ".yay-currency-custom-option-row", customOptionArrowSelected: ".yay-currency-custom-option-row.selected", selectTrigger: ".yay-currency-custom-select__trigger", selectWrapper: ".yay-currency-custom-select-wrapper", customSelect: ".yay-currency-custom-select", selectedOption: ".yay-currency-custom-select__trigger .yay-currency-selected-option" }, blocks_data_args: { checkout: ".wp-block-woocommerce-checkout[data-block-name='wo
3ocommerce/checkout']", totalCheckout: ".wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-totals-footer-item", cart: ".wp-block-woocommerce-cart[data-block-name='woocommerce/cart']", totalCart: ".wp-block-woocommerce-cart .wp-block-woocommerce-cart-order-summary-block .wc-block-components-totals-footer-item", payments: { container: ".wc-block-checkout__payment-method#payment-method", options: 'input.wc-block-components-radio-control__input[name="radio-control-wc-payment-method-options"]', localStorageName: "YayCurrencySelectedPaymentMethod", class: { parent: ".wc-block-components-radio-control-accordion-option", labelOption: "label.wc-block-components-radio-control__option" } }, filterPrice: { class: { wrapper: ".wp-block-woocommerce-price-filter", controls: ".wc-block-price-filter__controls", filterSlideInput: '.wp-block-woocommerce-filter-wrapper[data-filter-type="price-filter"] .wc-block-price-slider input', minPriceWrapper: ".wc-block-price-filter__range-input--min", maxPriceWrapper: ".wc-block-price-filter__range-input--max", minPriceInput: "input.wc-block-price-filter__amount--min", maxPriceInput: "input.wc-block-price-filter__amount--max", resetButton: ".wc-block-components-filter-reset-button", progressRange: ".wc-block-price-filter__range-input-progress" } } }, cookies_data_args: { cartBlocks: "yay_cart_blocks_page", checkoutBlocks: "yay_checkout_blocks_page", blocksForceNoticeHtml: "yay_blocks_force_notice", forcePaymentHtml: "yay_fore_payment_notice_html" } }, YayCurrency_Callback.yay_force_payment_data_args = Object.assign({}, yay_currency_data_args.common_data_args, { yayCurrencyForcePaymentNotice: ".yay-currency-checkout-force-payment-notice" }), YayCurrency_Callback.yay_caching_data_args = Object.assign({}, yay_currency_data_args.common_data_args, yay_currency_data_args.caching_data_args); var a = { actions: {}, filters: {} }; YayCurrency_Callback.Helper = { addHook: function (e, r, c) { a[e][r] || (a[e][r] = []), a[e][r].push(c) }, applyFilters: function (e, r) { return a.filters[e] && a.filters[e].forEach(function (e) { r = e(r) }), r }, doAction: function (e, r) { a.actions[e] && a.actions[e].forEach(function (e) { e.apply(null, r) }) }, setCookie: function (e, r, a) { var c = ""; if (a) { var t = new Date; t.setTime(t.getTime() + 24 * a * 60 * 60 * 1e3), c = "; expires=" + t.toUTCString() } document.cookie = e + "=" + (r || "") + c + "; path=/" }, getCookie: function (e) { let r = e + "=", a = decodeURIComponent(document.cookie).split(";"); for (let e = 0; e < a.length; e++) { let c = a[e]; for (; " " == c.charAt(0);)c = c.substring(1); if (0 == c.indexOf(r)) return c.substring(r.length, c.length) } return "" }, deleteCookie: function (e) { YayCurrency_Callback.Helper.setCookie(e, "", -1) }, getCurrentCurrency: function (e = !1) { e = e || YayCurrency_Callback.Helper.getCookie(r.yayCurrency.cookie_name); let a = !1; return r.yayCurrency.converted_currency && r.yayCurrency.converted_currency.forEach(r => { r.ID === +e && (a = r) }), yayCurrencyHooks.applyFilters("yayCurrencyGetCurrentCurrency", a) }, getCurrencyIDbyCurrencyName: function (e) { let a = !1; return r.yayCurrency.converted_currency && r.yayCurrency.converted_currency.forEach(r => { r.currency === e && (a = r) }), !!a && a.ID }, getRateFeeByCurrency: function (e = !1) { e = e || YayCurrency_Callback.Helper.getCurrentCurrency(); let r = parseFloat(e.rate); return r = "percentage" === e.fee.type ? parseFloat(e.rate) + parseFloat(e.rate) * (parseFloat(e.fee.value) / 100) : parseFloat(e.rate) + parseFloat(e.fee.value), yayCurrencyHooks.applyFilters("yayCurrencyGetRateFeeByCurrency", r) }, getBlockData: function () { let r = []; const a = e(yay_currency_data_args.common_data_args.yayCurrencyBlock); return a.length && a.each(function () { var a = { isBlockID: e(this).data("block-id"), isShowFlag: e(this).data("show-flag"), isShowCurrencyName: e(this).data("show-currency-name"), isShowCurrencySymbol: e(this).data("show-currency-symbol"), isShowCurrencyCode: e(this).data("show-currency-code"), widgetSize: e(this).data("switcher-size") }; r.push(a) }), yayCurrencyHooks.applyFilters("yayCurrencyGetBlockData", r) }
3, customResponseCommon: function (a) { let c = !1; a.data.widget_content && (c = !0, e(yay_currency_data_args.common_data_args.yayCurrencyWidget).html(a.data.widget_content)), a.data.menu_content && (c = !0, e(yay_currency_data_args.common_data_args.yayCurrencyMenu).html(a.data.menu_content)), a.data.shortcode_content && (c = !0, e(yay_currency_data_args.common_data_args.yayCurrencyShortcode).html(a.data.shortcode_content)), a.data.block_content && (c = !0, e(yay_currency_data_args.common_data_args.yayCurrencyBlock).each(function () { const r = e(this).data("block-id"); r && e(this).html(a.data.block_content[r]) })), a.data.country_notice && e(yay_currency_data_args.common_data_args.yayCountryCurrency).html(a.data.country_notice), a.data.shortcode_price_html && e(yay_currency_data_args.common_data_args.yayCurrencyShortcodePriceHtml).each(function (r, c) { a.data.shortcode_price_html[r] && e(c).html(a.data.shortcode_price_html[r]) }), a.data.shortcode_product_price_html && e(yay_currency_data_args.common_data_args.yayCurrencyShortcodeProductPriceHtml).each(function (r, c) { a.data.shortcode_product_price_html[r] && e(c).html(a.data.shortcode_product_price_html[r]) }), c && e(r).on("load resize scroll", YayCurrency_Callback.Helper.switcherUpwards()), yayCurrencyHooks.doAction("yayCurrencyResponseCommon", [{ response: a }]) }, blockLoading: function (r) { e(r).addClass("processing").block({ message: null, overlayCSS: { background: "#fff", opacity: .6 } }), yayCurrencyHooks.doAction("yayCurrencyCustomBlockLoading", [{ data: r }]) }, unBlockLoading: function (r) { e(r).removeClass("processing").unblock(), yayCurrencyHooks.doAction("yayCurrencyCustomUnBlockLoading", [{ data: r }]) }, switcherUpwards: function () { const a = e(yay_currency_data_args.common_data_args.yayCurrencySwitcher); a.each(function () { const a = e(this).offset().top + e(this).height() - e(r).scrollTop(); e(r).height() - e(this).height() - e(this).offset().top + e(r).scrollTop() < 250 && a > 250 ? (e(this).find(yay_currency_data_args.switcher_data_args.customOption).addClass(yay_currency_data_args.switcher_data_args.upwardsClass), e(this).find(yay_currency_data_args.switcher_data_args.customArrow).addClass(yay_currency_data_args.switcher_data_args.upwardsClass), e(this).find(yay_currency_data_args.switcher_data_args.selectTrigger).addClass(yay_currency_data_args.switcher_data_args.upwardsClass)) : (e(this).find(yay_currency_data_args.switcher_data_args.customOption).removeClass(yay_currency_data_args.switcher_data_args.upwardsClass), e(this).find(yay_currency_data_args.switcher_data_args.customArrow).removeClass(yay_currency_data_args.switcher_data_args.upwardsClass), e(this).find(yay_currency_data_args.switcher_data_args.selectTrigger).removeClass(yay_currency_data_args.switcher_data_args.upwardsClass)) }), yayCurrencyHooks.doAction("yayCurrencyCustomSwitcherDropdown", [{ data: a }]) }, switcherAction: function () { const a = yay_currency_data_args.switcher_data_args; e(document).on("click", a.selectWrapper, function () { e(a.customSelect, this).toggleClass(a.openClass), e("#slide-out-widget-area").find(a.customOption).toggleClass("overflow-fix"), e("[id^=footer]").toggleClass("z-index-fix"), e(a.customSelect, this).parents(".handheld-navigation").toggleClass("overflow-fix") }), e(document).on("click", a.customOptionArrow, function () { let r = e(this).data("value") ? e(this).data("value") : e(this).data("currency-id"); if (!r) { const a = e(this).attr("class").match(/yay-currency-id-(\d+)/); a && (r = a[1], YayCurrency_Callback.Helper.setCookie(yayCurrency.cookie_name ?? "yay_currency_widget", r, 1), location.reload()) } const c = e(this).children(a.currencyFlag).data("country_code"); if (!e(this).hasClass(a.selectedClass)) { const r = e(this).closest(a.customSelect); if (e(this).parent().find(a.customOptionArrowSelected).removeClass(a.selectedClass), e(this).addClass(a.selectedClass), c) { const e = yayCurrency.flag_fallbacks?.[c] || yayCurrency.flag_fallbacks?.default; r.find(a.currencySelectedFlag).css({ background: `url(${yayCurrency.yayCurrencyPluginURL}assets/flags/${c}.svg), url(${e})` }) } r.find(a.selectedOption).text(e(this).text()), r.find(a.customLoader).addClass(a.activeClass), r.find(a.customArrow).hide() } YayCurrency_Callback.Helper.refreshCartFragments(), e(a.currencySwitcher).val(r).change(), YayCurrency_Callback.Helper.setCookie(yayCurrency.cookie_switcher_name ?? "yay_currency_do_change_switcher", r, 1) }), r.addEventListener("click", function (e) { document.querySelectorAll(yay_currency_data_args.switcher_data_args.customSelect).forEach(r => { r.contains(e.target) || r.classList.remove(yay_currency_data_args.switcher_data_args.openClass) }) }), yayCurrencyHooks.doAction("yayCurrencyCustomSwitcherAction", [{ data: a }]) }, refreshCartFragments: function () { "undefined" != typeof wc_cart_fragments_params && null !== wc_cart_fragments_params && sessionStorage.removeItem(wc_cart_fragments_params.fragment_name), yayCurrencyHooks.doAction("yayCurrencyCustomRefreshCartFragments", []) }, getListDataForcePayment: function () { const r = YayCurrency_Callback.yay_force_payment_data_args; let a = { action: "yayCurrency_handle_force_payment_response", blocks: YayCurrency_Callback.Helper.getBlockData(), widget: e(r.yayCurrencyWidget).length, menu: e(r.yayCurrencyMenu).length, shortcode: e(r.yayCurrencyShortcode).length, country_notice: e(r.yayCountryCurrency).length, country_code: yayCurrency.country_code, foce_payment_notice: e(r.yayCurrencyForcePaymentNotice).length, is_cart_page: yayCurrency.cart_page, nonce: yayCurrency.nonce };
3 if (e(r.yayCurrencyShortcodePriceHtml).length) { let c = []; e(r.yayCurrencyShortcodePriceHtml).each(function (r, a) { c[r] = e(a).data("default-price") }), a.shortcode_default_price = c } if (e(r.yayCurrencyShortcodeProductPriceHtml).length) { let c = []; e(r.yayCurrencyShortcodeProductPriceHtml).each(function (r, a) { c[r] = e(a).data("shortcode-product-id") }), a.shortcode_product_ids = c } return yayCurrencyHooks.applyFilters("yayCurrencyGetDataForcePayment", a) }, customResponseForcePayment: function (r) { if (r.success) { if (YayCurrency_Callback.Helper.customResponseCommon(r), r.data.force_payment_is_dis_checkout_diff_currency ? e(".yay-currency-checkout-notice-force-payment-wrapper").length && e(".yay-currency-checkout-notice-force-payment-wrapper").html(r.data.force_payment_checkout_notice_html) : e(".yay-currency-checkout-notice-force-payment-wrapper").length && e(".yay-currency-checkout-notice-force-payment-wrapper").html(""), "undefined" != r.data.force_payment_notice_html) { const a = YayCurrency_Callback.yay_force_payment_data_args; if (e(a.yayCurrencyForcePaymentNotice).length) { const c = yay_currency_data_args.cookies_data_args.forcePaymentHtml; if ("" == r.data.force_payment_notice_html || r.data.force_payment_checkout_notice_html) { YayCurrency_Callback.Helper.getCookie(c) ? YayCurrency_Callback.Helper.deleteCookie(c) : e(a.yayCurrencyForcePaymentNotice).remove() } else { let t = r.data.force_payment_notice_html; e(a.yayCurrencyForcePaymentNotice).removeClass(a.yayCurrencyHide), e(a.yayCurrencyForcePaymentNotice).html(t), r.data.reload_page && YayCurrency_Callback.Helper.setCookie(c, t, +yayCurrency.cookie_lifetime_days) } } } YayCurrency_Callback.Helper.getCookie(yayCurrency.cookie_switcher_name) && YayCurrency_Callback.Helper.setCookie(yayCurrency.cookie_switcher_name, YayCurrency_Callback.Helper.getCookie(yayCurrency.cookie_name)), yayCurrencyHooks.doAction("yayCurrencyResponseForcePayment", [{ response: r }]), r.data.reload_page && location.reload() } }, customResponseForceCurrencyByPaymentMethod: function (r) { r.success && (YayCurrency_Callback.Helper.customResponseCommon(r), r.data.force_payment_is_dis_checkout_diff_currency ? e(".yay-currency-checkout-notice-force-payment-wrapper").length && e(".yay-currency-checkout-notice-force-payment-wrapper").html(r.data.force_payment_checkout_notice_html) : e(".yay-currency-checkout-notice-force-payment-wrapper").length && e(".yay-currency-checkout-notice-force-payment-wrapper").html(""), YayCurrency_Callback.Helper.getCookie(yayCurrency.cookie_switcher_name) && YayCurrency_Callback.Helper.setCookie(yayCurrency.cookie_switcher_name, YayCurrency_Callback.Helper.getCookie(yayCurrency.cookie_name)), yayCurrencyHooks.doAction("yayCurrencyResponseForceCurrencyByPaymentMethod", [{ response: r }]), r.data.reload_page && location.reload()) }, forcePaymentCountryCurrency: function (r, a = !1) { e.ajax({ url: yayCurrency.ajaxurl, type: "POST", data: r, beforeSend: function (e) { YayCurrency_Callback.Helper.blockLoading(yay_currency_data_args.common_data_args.yayCurrencySwitcher), YayCurrency_Callback.Helper.blockLoading(yay_currency_data_args.caching_data_args.yayCurrencyMiniCartContents) }, xhrFields: { withCredentials: !0 }, success: function (r) { YayCurrency_Callback.Helper.unBlockLoading(yay_currency_data_args.common_data_args.yayCurrencySwitcher), YayCurrency_Callback.Helper.unBlockLoading(yay_currency_data_args.caching_data_args.yayCurrencyMiniCartContents), YayCurrency_Callback.Helper.customResponseForcePayment(r), a && (r.data.force_payment_blocks_checkout_notice_html && "" != r.data.force_payment_blocks_checkout_notice_html && (e(yay_currency_data_args.blocks_data_args.checkout).before(r.data.force_payment_blocks_checkout_notice_html), e(".yay-currency-checkout-notice-current-currency").text(r.data.force_payment_blocks_current_currency)), e(document.body).trigger("wc_fragment_refresh")) }, error: function (e, r, a) { YayCurrency_Callback.Helper.unBlockLoading(yay_currency_data_args.common_data_args.yayCurrencySwitcher), YayCurrency_Callback.Helper.unBlockLoading(yay_currency_data_args.caching_data_args.yayCurrencyMiniCartContents), console.log("Error responseText: ", e.responseText) } }) }, forceCurrencyByPaymentMethodSelected: function (r, a = !1) { e.ajax({ url: yayCurrency.ajaxurl, type: "POST", data: r, beforeSend: function (e) { YayCurrency_Callback.Helper.blockLoading(yay_currency_data_args.blocks_data_args.checkout) }, xhrFields: { withCredentials: !0 }, success: function (e) { YayCurrency_Callback.Helper.unBlockLoading(yay_currency_data_args.blocks_data_args.checkout), YayCurrency_Callback.Helper.unBlockLoading(yay_currency_data_args.caching_data_args.yayCurrencyMiniCartContents), YayCurrency_Callback.Helper.customResponseForceCurrencyByPaymentMethod(e) }, error: function (e, r, a) { YayCurrency_Callback.Helper.unBlockLoading(yay_currency_data_args.common_data_args.yayCurrencySwitcher), YayCurrency_Callback.Helper.unBlockLoading(yay_currency_data_args.caching_data_args.yayCurrencyMiniCartContents), console.log("Error responseText: ", e.responseText) } }) }, forcePaymentOnCheckoutPage: function (r) { "undefined" != typeof wc_checkout_params && (yayCurrency.force_payment && e(document.body).on("updated_checkout", function (a) { e(document.body).trigger("wc_fragment_refresh"), YayCurrency_Callback.Helper.reRenderHTMLAfterForceCountryCode(r) }), yayCurrency.force_currency ? (e(document.body).on("payment_method_selected", function (r, a) { e(document.body).trigger("update_checkout") }), e(document.body).on("updated_checkout", function (a) { e(document.body).trigger("wc_fragment_refresh"), YayCurrency_Callback.Helper.reRenderHTMLAfterForceCurrencyByPaymentMethod(r) })) : localStorage.getItem(yay_currency_data_args.blocks_data_args.payments.localStorageName) && localStorage.removeItem(yay_currency_data_args.blocks_data_args.payments.localStorageName)) }, forcePaymentOnCartPage: function (r) { yayCurrency.force_payment && "1" === yayCurrency.cart_page && e(document.body).on("updated_cart_totals", function (e) { YayCurrency_Callback.Helper.getCookie(yayCurrency.cookie_name) !== r && YayCurrency_Callback.Helper.reRenderHTMLAfterForceCountryCode(r) }) }, reRenderHTMLAfterForceCountryCode: function (e, r = !1) { let a = YayCurrency_Callback.Helper.getListDataForcePayment(); a.yay_currency_old = e, r ? a.woocommerce_blocks = "yes" : a.yay_currency_new = YayCurrency_Callback.Helper.getCookie(yayCurrency.cookie_name), YayCurrency_Callback.Helper.forcePaymentCountryCurrency(a, r) }, reRenderHTMLAfterForceCurrencyByPaymentMethod: function (r, a = !1) { var c = e('input[name="payment_method"]:checked').val(); let t = YayCurrency_Callback.Helper.getListDataForcePayment(); t.action = "yayCurrency_handle_force_currency_by_payment_selected_response", t.yay_currency_old = r, t.yay_currency_new = YayCurrency_Callback.Helper.getCookie(yayCurrency.cookie_name), t.payment_method_id = c, YayCurrency_Callback.Helper.forceCurrencyByPaymentMethodSelected(t, a) }, detectAllowCaching: function (e) { return yayCurrencyHooks.applyFilters("yayCurrencyDetectAllowCaching", e) }, getListProductIdsAvailable: function () { let r = [], a = e(yay_currency_data_args.caching_data_args.yayProductId); a.length && a.each(function (a, c) { const t = e(c).data(yay_currency_data_args.caching_data_args.yayDataProductId); t && r.push(t) }); let c = e(yay_currency_data_args.caching_data_args.yayVariationId); return c.length && c.each(function (a, c) { let t = e(c).data("product_variations"); t.length && t.forEach(e => { r.push(e.variation_id) }) }), yayCurrencyHooks.applyFilters("yayCurrencyGetListProductIds", r) }, getListDataCaching: function (a = !1, c = []) { const t = YayCurrency_Callback.yay_caching_data_args; let n = { action: a ? "yay_caching_get_price_html" : "yay_caching_generate_currency_switcher_html", blocks: YayCurrency_Callback.Helper.getBlockData(), widget: e(t.yayCurrencyWidget).length, product: e(t.yayCurrencyProduct).length, menu: e(t.yayCurrencyMenu).length, shortcode: e(t.yayCurrencyShortcode).length, country_notice: e(t.yayCountryCurrency).length, ip_address: yay_currency_caching_data.ip_address, cache_compatible: yayCurrency.cache_compatible ?? "0", _nonce: yay_currency_caching_data.nonce }; const y = r.location.search, o = new URLSearchParams(y).get("currency"); if (o && (n.currency_code_param = o), e(t.yayCurrencyShortcodePriceHtml).length) { let r = []; e(t.yayCurrencyShortcodePriceHtml).each(function (a, c) { r[a] = e(c).data("default-price") }), n.shortcode_default_price = r } if (e(t.yayCurrencyShortcodeProductPriceHtml).length) { let r = []; e(t.yayCurrencyShortcodeProductPriceHtml).each(function (a, c) { r[a] = e(c).data("shortcode-product-id") }), n.shortcode_product_ids = r } return a && (n.productIds = c), yayCurrencyHooks.applyFilters("yayCurrencyGetListDataCaching", n) }, resetCachingLoading: function () { const r = [yay_currency_data_args.common_data_args.yayCurrencySwitcher, yay_currency_data_args.common_data_args.yayCountryCurrency, yay_currency_data_args.common_data_args.yayCurrencyShortcodePriceHtml, yay_currency_data_args.common_data_args.yayCurrencyShortcodeProductPriceHtml, yay_currency_data_args.caching_data_args.yayCurrencyMiniCartContents]; e.each(r, function (r, a) { e(a).length && e(a).hasClass(yay_currency_data_args.common_data_args.yayCurrencyLoading) ? e(a).removeClass(yay_currency_data_args.common_data_args.yayCurrencyLoading) : e(a).length && e(a).find("." + yay_currency_data_args.common_data_args.yayCurrencyLoading).length && e(a).find("." + yay_currency_data_args.common_data_args.yayCurrencyLoading).removeClass(yay_currency_data_args.common_data_args.yayCurrencyLoading) }), yayCurrencyHooks.doAction("yayCurrencyResetCachingLoading", [{ wrapper_args: r }]) }, getCurrentCurrencyByCode: function (e = !1, a = !1) { e = e || r.yayCurrency.default_currency_code, a = a || r.yayCurrency.converted_currency; let c = !1; return a && a.forEach(r => { r.currency === e && (c = r) }), c }, currencyConverter: function () { const r = yay_currency_data_args.converter_args.converterWrapper; e(r).length && e(r).each(function (r, a) { YayCurrency_Callback.Helper.doConverterCurrency(e(a)) }) }, doFormatNumber: function (e, r, a, c, t = !1) { if ("N/A" === e || "" === e) return e; e = (e + "").replace(/[^0-9+\-Ee.]/g, ""); let n = isFinite(+e) ? +e : 0, y = isFinite(+r) ? Math.abs(r) : 0, o = void 0 === c ? "," : c, u = void 0 === a ? "." : a, l = ""; return l = (y ? function (e, r) { let a = Math.pow(10, r); return "" + Math.round(e * a) / a }(n, y) : "" + Math.round(n)).split("."), l[0].length > 3 && (l[0] = l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, o)), (l[1] || "").length < y && (l[1] = l[1] || "", l[1] += new Array(y - l[1].length + 1).join("0")), t ? l.join(u) : l.join(u).replace(/([0-9]*\.0*[1-9]+)0+$/gm, "$1").replace(/.00+$/, "") }, roundedAmountByCurrency: function (e, r) { if (!r) return e; const { numberDecimal: a, decimalSeparator: c, thousandSeparator: t } = r; e = YayCurrency_Callback.Helper.handelRoundedPriceByCurrency(e, r); return YayCurrency_Callback.Helper.doFormatNumber(e, Number(a), c, t, !0) }, handelRoundedPriceByCurrency: function (e, r) { const { roundingType: a, roun
3dingValue: c, subtractAmount: t } = r; switch (a) { case "up": e = Math.ceil(e / c) * c - t; break; case "down": e = Math.floor(e / c) * c - t; break; case "nearest": e = Math.round(e / c) * c - t }return e }, handelConvertPrice: function (e = 0, r = !1) { if (!r) { const e = YayCurrency_Callback.Helper.getCookie(yayCurrency.cookie_name); r = YayCurrency_Callback.Helper.getCurrentCurrency(e) } const a = parseFloat(YayCurrency_Callback.Helper.getRateFeeByCurrency(r)); return a && 1 !== a ? YayCurrency_Callback.Helper.handelRoundedPriceByCurrency(e * a, r) : e }, handelRevertPrice: function (e = 0, r = !1) { if (!r) { const e = YayCurrency_Callback.Helper.getCookie(yayCurrency.cookie_name); r = YayCurrency_Callback.Helper.getCurrentCurrency(e) } const a = parseFloat(YayCurrency_Callback.Helper.getRateFeeByCurrency(r)); return a && 1 !== a ? e / a : e }, decodeHtmlEntity: function (e) { var r = document.createElement("textarea"); return r.innerHTML = e, r.value }, formatPricePosition: function (e = 0, r = "", a = "left") { let c = e; switch (a) { case "left": c = r + c; break; case "right": c += r; break; case "left_space": c = r + " " + c; break; case "right_space": c = c + " " + r }return c }, formatPriceByCurrency: function (e = 0, r = !1, a = !1) { if (!a) { const e = YayCurrency_Callback.Helper.getCookie(yayCurrency.cookie_name); a = YayCurrency_Callback.Helper.getCurrentCurrency(e) } if (r) { const r = parseFloat(YayCurrency_Callback.Helper.getRateFeeByCurrency(a)); e = YayCurrency_Callback.Helper.handelRoundedPriceByCurrency(e * r, a) } var c = e.toFixed(a.numberDecimal).split("."); c[0] = c[0].replace(/\B(?=(\d{3})+(?!\d))/g, a.thousandSeparator); var t = c.join(a.decimalSeparator), n = YayCurrency_Callback.Helper.decodeHtmlEntity(a.symbol); return t = YayCurrency_Callback.Helper.formatPricePosition(t, n, a.currencyPosition), a.currencyCodePosition && (t = YayCurrency_Callback.Helper.formatPricePosition(t, a.currency, a.currencyCodePosition)), t }, doApplyResultConverter: function (r, a) { const c = r.find(yay_currency_data_args.converter_args.converterFrom), t = r.find(yay_currency_data_args.converter_args.converterTo), n = a.from_currency_code ? a.from_currency_code : e(c).val(), y = a.to_currency_code ? a.to_currency_code : e(t).val(); let o = a.amount_value ? +a.amount_value : +e(r.find(yay_currency_data_args.converter_args.converterAmount)).val(); if (y === n) e(r.find(yay_currency_data_args.converter_args.converterResultValue)).text(o); else { const a = YayCurrency_Callback.Helper.getCurrentCurrencyByCode(n), c = YayCurrency_Callback.Helper.getCurrentCurrencyByCode(y), t = YayCurrency_Callback.Helper.getRateFeeByCurrency(c); if (a && n !== yayCurrency.default_currency_code) { const e = YayCurrency_Callback.Helper.getRateFeeByCurrency(a); o *= parseFloat(1 / e) } e(r.find(yay_currency_data_args.converter_args.converterResultValue)).text(YayCurrency_Callback.Helper.roundedAmountByCurrency(o * t, c)) } }, doConverterCurrency: function (r) { const a = r.find(yay_currency_data_args.converter_args.converterAmount), c = r.find(yay_currency_data_args.converter_args.converterFrom), t = r.find(yay_currency_data_args.converter_args.converterTo), n = r.find(yay_currency_data_args.converter_args.converterResultWrapper); e(c).change(function () { e(r.find(yay_currency_data_args.converter_args.converterResultFrom)).text(e(this).val()), YayCurrency_Callback.Helper.doApplyResultConverter(r, { from_currency_code: e(this).val() }) }), e(t).change(function () { e(r.find(yay_currency_data_args.converter_args.converterResultTo)).text(e(this).val()), YayCurrency_Callback.Helper.doApplyResultConverter(r, { to_currency_code: e(this).val() }) }), e(a).on("input", function () { const a = e(this).val(); e(this).val(a.replace(/\D/g, "")), a ? (e(n).show(), e(r.find(yay_currency_data_args.converter_args.converterResultAmount)).text(a), YayCurrency_Callback.Helper.doApplyResultConverter(r, { amount_value: a })) : e(n).hide() }), e(a).trigger("input"), e(c).trigger("change"), e(t).trigger("change") }, handleFilterByPrice: function (e) { r.addEventListener("load", function () { YayCurrency_Callback.Helper.handleFilterByPriceClassicEditor(e), YayCurrency_Callback.Helper.handleFilterByPriceBlock(e) }) }, handleFilterByPriceClassicEditor: function (a) { if (e(".widget_price_filter .price_slider").length) { const c = YayCurrency_Callback.Helper.getCurrentCurrency(a); if (c.currency === r.yayCurrency.default_currency_code) return; let t = e(".price_slider_amount #min_price").val(), n = e(".price_slider_amount #max_price").val(); if (!t || !n) return; e(document.body).on("price_slider_create price_slider_slide", function (r, a, t) { e(".price_slider_amount span.from").html(YayCurrency_Callback.Helper.formatPriceByCurrency(a, !0, c)), e(".price_slider_amount span.to").html(YayCurrency_Callback.Helper.formatPriceByCurrency(t, !0, c)) }), e(".price_slider_amount span.from").html(YayCurrency_Callback.Helper.formatPriceByCurrency(t, !0, c)), e(".price_slider_amount span.to").html(YayCurrency_Callback.Helper.formatPriceByCurrency(n, !0, c)), yayCurrencyHooks.doAction("yayCurrencyHandleFilterPriceClassicEditor", [{ current_currency_id: a }]) } }, handleFilterByPriceBlock: function (a) { if (!r.wc) return; const c = e(yay_currency_data_args.blocks_data_args.filterPrice.class.wrapper); if (c.length && c.find(yay_currency_data_args.blocks_data_args.filterPrice.class.controls).length) { let r = 1, a = !1, c = setInterval(function () { let t = e(yay_currency_data_args.blocks_data_args.filterPrice.class.minPriceWrapper), n = e(yay_currency_data_args.blocks_data_args.filterPrice.class.maxPriceWrapper); if (t.length && n.length) { const r = e(yay_currency_data_args.blocks_data_args.filterPrice.class.filterSlideInput).parents(yay_currency_data_args.blocks_data_args.filterPrice.class.controls), c = r.clone(); r.replaceWith(c); const y = !!t.attr("aria-valuetext") && +t.attr("aria-valuetext"); y && (e(yay_currency_data_args.blocks_data_args.filterPrice.class.minPriceInput).val(YayCurrency_Callback.Helper.formatPriceByCurrency(y, !0)), e(yay_currency_data_args.blocks_data_args.filterPrice.class.minPriceInput).css("pointer-events", "none")); const o = !!n.attr("aria-valuetext") && +n.attr("aria-valuetext"); o && (e(yay_currency_data_args.blocks_data_args.filterPrice.class.maxPriceInput).val(YayCurrency_Callback.Helper.formatPriceByCurrency(o, !0)), e(yay_currency_data_args.blocks_data_args.filterPrice.class.maxPriceInput).css("pointer-events", "none")), a = !0 } (5 === r || a) && clearInterval(c), ++r }, 500) } e(document).on("input", yay_currency_data_args.blocks_data_args.filterPrice.class.minPriceWrapper, function () { const r = !!e(this).attr("aria-valuetext") && +e(this).attr("aria-valuetext"); r && e(yay_currency_data_args.blocks_data_args.filterPrice.class.minPriceInput).val(YayCurrency_Callback.Helper.formatPriceByCurrency(r, !0)) }), e(document).on("input", yay_currency_data_args.blocks_data_args.filterPrice.class.maxPriceWrapper, function () { const r = !!e(this).attr("aria-valuetext") && +e(this).attr("aria-valuetext"); r && e(yay_currency_data_args.blocks_data_args.filterPrice.class.maxPriceInput).val(YayCurrency_Callback.Helper.formatPriceByCurrency(r, !0)) }), yayCurrencyHooks.doAction("yayCurrencyHandleFilterPriceBlock", [{ current_currency_id: a }]) } } }(jQuery, window);; 4!function (e, r) { YayCurrency_Blocks = r.YayCurrency_Blocks || {}, YayCurrency_Blocks.Helper = { detectCheckoutBlocks: function () { var r = !1; return e(yay_currency_data_args.blocks_data_args.checkout).length && (r = !0), yayCurrencyHooks.applyFilters("yayCurrencyDetectCheckoutBlocks", r) }, detectCartBlocks: function () { var r = !1; return e(yay_currency_data_args.blocks_data_args.cart).length && (r = !0), yayCurrencyHooks.applyFilters("yayCurrencyDetectCartBlocks", r) }, debounce: function (e, r) { let c; return function (...o) { clearTimeout(c), c = setTimeout(() => e.apply(this, o), r) } }, waitForElement: function (e, r, c = 1e4) { const o = document.querySelector(e); if (o) return void r(o); const a = Date.now(), t = () => { const o = document.querySelector(e); o ? r(o) : Date.now() - a < c && requestAnimationFrame(t) }; requestAnimationFrame(t) }
4, handleParsePrice: function (e) { let r = e.replace(/[^0-9\s_,.]/g, "").trim(); if (!r) return 0; let c = r.split(/[\s_,.]+/); if (c.length < 1) return parseFloat(r) || 0; let o = c.pop() || "0", a = c.join(""); return parseFloat(a + (o ? "." + o : "")) || 0 }, isTurnOffCheckout: function (e) { const r = YayCurrency_Callback.Helper.getCurrentCurrency(e); if (!("0" === yayCurrency.checkout_diff_currency && yayCurrency.default_currency_code !== r.currency || "1" === yayCurrency.checkout_diff_currency && "0" === r.status)) return !1; const { fallback_currency_code: c, default_currency_code: o } = yayCurrency; return !(c !== o) || r.currency !== c }, detectForcePaymentInitDomChanges: function (e) { r.onload = function () { const r = yayCurrency.total_block_class ?? (yayCurrency.cart_page ? yay_currency_data_args.blocks_data_args.totalCart : yay_currency_data_args.blocks_data_args.totalCheckout); var c = document.querySelector(r); if (c) { new MutationObserver(function (r, c) { for (var o of r) "characterData" === o.type && YayCurrency_Callback.Helper.reRenderHTMLAfterForceCountryCode(e, !0) }).observe(c, { characterData: !0, subtree: !0 }) } } }, detectApplyCurrencyForceCountryCode: function (c) { const o = YayCurrency_Callback.Helper.getCookie(yay_currency_data_args.cookies_data_args.blocksForceNoticeHtml); if (o && (e(yay_currency_data_args.blocks_data_args.checkout).before(o), YayCurrency_Callback.Helper.deleteCookie(yay_currency_data_args.cookies_data_args.blocksForceNoticeHtml)), yayCurrency.currency_code) { const o = yayCurrency.currency_code; let a = null; r.yayCurrency.converted_currency.forEach(e => { e.currency != o || (a = e) }), a && a.ID !== +c && e.ajax({ url: yayCurrency.ajaxurl, type: "POST", data: { action: "yayCurrency_recalculate_apply_currency_from_blocks", nonce: yayCurrency.nonce, currencyID: c, currentCurrency: a }, beforeSend: function (e) { YayCurrency_Callback.Helper.blockLoading(yay_currency_data_args.blocks_data_args.checkout) }, xhrFields: { withCredentials: !0 }, success: function (e) { e.success ? (e.data.force_payment_notice && YayCurrency_Callback.Helper.setCookie(yay_currency_data_args.cookies_data_args.blocksForceNoticeHtml, e.data.force_payment_notice, +yayCurrency.cookie_lifetime_days), location.reload()) : YayCurrency_Callback.Helper.unBlockLoading(yay_currency_data_args.blocks_data_args.checkout) }, error: function (e, r, c) { YayCurrency_Callback.Helper.unBlockLoading(yay_currency_data_args.blocks_data_args.checkout), console.log("Error responseText: ", e.responseText) } }) } }, forcePaymentOnCheckoutBlocksPage: function (e) { YayCurrency_Blocks.Helper.detectForcePaymentInitDomChanges(e), YayCurrency_Blocks.Helper.detectApplyCurrencyForceCountryCode(e), yayCurrencyHooks.doAction("yayCurrencyHandleForcePaymentBlocksCheckoutPage", [{ data_args: yay_currency_data_args, oldCurrencyID: e }]) }, reloadPageAfterForcePaymentCountryFound: function (c = 0) { "undefined" != typeof wp && wp.data && wp.data.subscribe && wp.data.subscribe(() => { const o = wp.data.select("wc/store/cart").getCartData(); if (o && o.reload && o.forcePaymentCountryFound) { const a = o.forceFoundApplyCurrency || !1; if (a) { const t = a.ID || !1, n = o.forcePaymentCountryFound || !1; if (t && n && yayCurrency.country_code !== n) { const y = YayCurrency_Blocks.Helper.isTurnOffCheckout(c), u = YayCurrency_Blocks.Helper.isTurnOffCheckout(t); if ("yes" === (o.forcePaymentCountryForAllPages || "no")) { YayCurrency_Callback.Helper.setCookie(yayCurrency.cookie_name, t); YayCurrency_Callback.Helper.getCookie(yayCurrency.cookie_switcher_name) && YayCurrency_Callback.Helper.setCookie(yayCurrency.cookie_switcher_name, t) } if (y || u || "yes" === o.reload) r.location.reload(); else { yayCurrency.country_code = n, yayCurrency.currency_code = a.currency; const r = o.forcePaymentNoticeHtml || !1, t = o.forcePaymentNoticeWrapper || !1; if (r && t) { const c = YayCurrency_Callback.yay_force_payment_data_args; e(c.yayCurrencyForcePaymentNotice).length ? e(c.yayCurrencyForcePaymentNotice).html(r) : e(yay_currency_data_args.blocks_data_args.checkout).before(t) } YayCurrency_Callback.Helper.reRenderHTMLAfterForceCountryCode(c), e(document.body).trigger("wc_fragment_refresh") } } } } }) }, reloadPageAfterForcePaymentMethodFound: function (c) { if ("undefined" != typeof wp && wp.data && wp.data.subscribe) { const o = r.fetch; r.fetch = async function (a, t) { const n = await o(a, t); if (a.includes("/wc/store/v1/checkout?__experimental_calc_totals=true")) try { const o = n.clone(), a = await o.json(); if ("payment" === (a.forceCurrencyType || "")) { const o = a.forceFoundApplyCurrency || !1; if (!o) return; const t = o.ID || !1, n = "yes" === a.reload; if (t) { const o = YayCurrency_Blocks.Helper.isTurnOffCheckout(c), y = YayCurrency_Blocks.Helper.isTurnOffCheckout(t);
4 if ("yes" === (a.forcePaymentCountryForAllPages || "no")) { YayCurrency_Callback.Helper.setCookie(yayCurrency.cookie_name, t); YayCurrency_Callback.Helper.getCookie(yayCurrency.cookie_switcher_name) && YayCurrency_Callback.Helper.setCookie(yayCurrency.cookie_switcher_name, t) } o || y || n ? r.location.reload() : (YayCurrency_Callback.Helper.reRenderHTMLAfterForceCountryCode(c), e(document.body).trigger("wc_fragment_refresh")) } } } catch (e) { console.error("Error parsing API response:", e) } return n } } }, forcePaymentOnCartBlocksPage: function (e) { YayCurrency_Blocks.Helper.detectForcePaymentInitDomChanges(e), yayCurrencyHooks.doAction("yayCurrencyHandleForcePaymentBlocksCartPage", [{ data_args: yay_currency_data_args, oldCurrencyID: e }]) }, wooCommerceBlocksForcePayment: function (r) { YayCurrency_Blocks.Helper.detectCheckoutBlocks() && (yayCurrency.force_payment && (YayCurrency_Blocks.Helper.forcePaymentOnCheckoutBlocksPage(r), YayCurrency_Blocks.Helper.reloadPageAfterForcePaymentCountryFound(r)), yayCurrency.force_currency && YayCurrency_Blocks.Helper.reloadPageAfterForcePaymentMethodFound(r), yayCurrency.checkout_notice_html && "" != yayCurrency.checkout_notice_html && e(yay_currency_data_args.blocks_data_args.checkout).before(yayCurrency.checkout_notice_html)), YayCurrency_Blocks.Helper.detectCartBlocks() && yayCurrency.force_payment && YayCurrency_Blocks.Helper.forcePaymentOnCartBlocksPage(r), yayCurrencyHooks.doAction("yayCurrencyHandleForcePaymentBlocks", [{ data_args: yay_currency_data_args, oldCurrencyID: r }]) }, handleFormatPriceCartCheckoutBlocks: function (e) { const r = new WeakSet; document.querySelectorAll(".wc-block-formatted-money-amount, .wc-block-components-product-price__regular, .wc-block-components-product-price__value.is-discounted").forEach(c => { if (r.has(c)) return; const o = c.textContent.trim(), a = YayCurrency_Blocks.Helper.handleParsePrice(o); if (isNaN(a)) return; const t = YayCurrency_Callback.Helper.formatPriceByCurrency(a, !1, e); o !== t && (c.textContent = t, r.add(c)) }) }, detectSpecialCurrencyNotAllowFormat: function (e) { return !!["SAR", "BHD", "AED", "KWD", "QAR", "OMR", "JOD", "TND"].includes(e.currency) && ("right" === e.currencyPosition || "right_space" === e.currencyPosition) }, formatPriceCartCheckoutBlocks: function (e) { if (!YayCurrency_Blocks.Helper.detectCartBlocks() && !YayCurrency_Blocks.Helper.detectCheckoutBlocks()) return; if (yayCurrency.force_payment || yayCurrency.force_currency) return; const c = YayCurrency_Callback.Helper.getCurrentCurrency(e); if (!c) return; if (YayCurrency_Blocks.Helper.detectSpecialCurrencyNotAllowFormat(c)) return; const o = r.yayCurrency.currency_symbol_position; if (!c || c.currencyPosition === o && "not_display" === c.currencyCodePosition) return; const a = YayCurrency_Blocks.Helper.isTurnOffCheckout(e); if (YayCurrency_Blocks.Helper.detectCheckoutBlocks() && a) return; const t = YayCurrency_Blocks.Helper.debounce(YayCurrency_Blocks.Helper.handleFormatPriceCartCheckoutBlocks.bind(this, c), 100); YayCurrency_Blocks.Helper.waitForElement(".wc-block-cart,.wc-block-checkout", e => { const c = new MutationObserver(t); c.observe(e, { childList: !0, subtree: !0, characterData: !0 }), t(), r.addEventListener("beforeunload", () => c.disconnect(), { once: !0 }) }) }, approximatePriceHTML: function (e, c) { const { default_currency_code: o, fallback_currency_code: a } = r.yayCurrency; if (o !== a) { const r = YayCurrency_Callback.Helper.getCurrentCurrencyByCode(a); e = YayCurrency_Callback.Helper.handelRevertPrice(e, r) } return " <span class='yay-currency-checkout-converted-approximately'>(~" + YayCurrency_Callback.Helper.formatPriceByCurrency(e, !0, c) + ")</span>" }, handleAddApproximatePrices: function (r) { e(".wc-block-formatted-money-amount, .wc-block-components-product-price__regular, .wc-block-components-product-price__value.is-discounted").each(function () { if (!e(this).find(".yay-currency-checkout-converted-approximately").length) { const c = e(this).text().trim(); let o = YayCurrency_Blocks.Helper.handleParsePrice(c); if (!isNaN(o)) { const c = YayCurrency_Blocks.Helper.approximatePriceHTML(o, r); e(this).append(c) } } }) }, approximatePriceCheckoutBlocks: function (c) { if (!YayCurrency_Blocks.Helper.detectCheckoutBlocks()) return; const o = YayCurrency_Callback.Helper.getCurrentCurrency(c), a = YayCurrency_Blocks.Helper.isTurnOffCheckout(c), t = r.yayCurrency.fixed_product_price_enable ?? "0"; if (a && "0" === t) { YayCurrency_Blocks.Helper.handleAddApproximatePrices(o); const c = new MutationObserver(function (e) { YayCurrency_Blocks.Helper.handleAddApproximatePrices(o) }); c.observe(document.querySelector(".wc-block-checkout"), { childList: !0, subtree: !0 }), e(r).on("unload", function () { c.disconnect() }) } }, setHeaderParamToDetectCartOrCheckoutBlocks: function () { const e = r.fetch; r.fetch = function (r, c) { const o = "string" == typeof r ? r : r?.url; if (!o || !o.includes("/wc/store/v1/")) return e(r, c); (c = c || {}).headers = c.headers || {}; let a = ""; return document.body.classList.contains("woocommerce-cart") && (a = "cart"), document.body.classList.contains("woocommerce-checkout") && (a = "checkout"), c.headers["YayCurrency-WC-Blocks-Context"] = a, e(r, c) } } } }(jQuery, window);;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.