1var C_EU=["AUT","BEL","BGR","HRV","CYP","CZE","DNK","EST","FIN","FRA","DEU","GRC","HUN","IRL","ITA","LVA","LTU","LUX","MLT","NLD","POL","PRT","ROU","SVK","SVN","ESP","SWE","GBR"];var C_2CO_VAT_COUNTRY=["AUT","BEL","BGR","HRV","CYP","CZE","DNK","EST","FIN","FRA","DEU","GRC","HUN","IRL","ITA","LVA","LTU","LUX","MLT","NLD","POL","PRT","ROU","SVK","SVN","ESP","SWE","GBR","ISL","MDA","NOR","RUS","SRB","CHE","TUR","UKR","AUS","BHR","BLR","CHL","COL","IND","JPN","KEN","MYS","NZL","OMN","SAU","SGP","ZAF","KOR","TWN","THA","ARE","VNM"];var C_PADDLE_VAT_COUNTRY=["AUT","BEL","BGR","HRV","CYP","CZE","DNK","EST","FIN","FRA","DEU","GRC","HUN","IRL","ITA","LVA","LTU","LUX","MLT","NLD","POL","PRT","ROU","SVK","SVN","ESP","SWE","GBR","ARM","BHR","BHS","CHL","IDN","KEN","NGA","MEX","OMN","SAU","ZAF","KOR","TWN","THA","TUR","ARE","UZB","CHE","GBR","MDA"];var C_PADDLE_GST_COUNTRY=["AUS","NZL","SGP","CAN","IND"];var C_PADDLE_COUNTRY_POSTAL_CODE_REQUITED=["AUS","CAN","FRA","DEU","IND","ITA","NLD","ESP","GBR","USA"];var C_USA="USA";var C_Brazil="BRA";var C_India="IND";var C_Canada="CAN";var C_Turkey="TUR";var BT_Personal="personal";var BT_Company="company";var USA_States=USA_States||{};var CAN_States=CAN_States||{};var IND_Districts=IND_Districts||[];var BRA_States=BRA_States||[];var CHECKOUT_AJAX_TIMEOUT=typeof CHECKOUT_AJAX_TIMEOUT!=="undefined"?CHECKOUT_AJAX_TIMEOUT:6e4;var storage={data:{},doNotSave:["_token","checkout_token","id","user_id","cart","upsell","product","card_number","card_expiry","card_cvc","cardholder"],doSave:[],init:function(){var t=typeof window.defaults!="undefined"?window.defaults:{};if($("input#order_id").length){t.order={id:$("input#order_id").val()}}else{["country","city","state","postal_code"].forEach(function(e){if(window.hasOwnProperty("ip_"+e)){t[e]=window["ip_"+e]}})}if($("input#set_inventory_to_order_country").length){t.set_inventory_to_order_country=$("input#set_inventory_to_order_country").val()}this.data=$.extend({},this.filterEmpty(t));if(typeof window.product!="undefined"){this.data.product=window.product}return this},filterEmpty:function(t){for(var e in t){if(!t[e]||t[e]==""){delete t[e]}}return t},setItem:function(t,e){e=typeof e==="string"?e.trim():e;this.data[t]=e},getItem:function(t){return this.data[t]},getAll:function(){return this.data}};var checkout_pane={inputTimers:[],previousId:null,nextId:null,skipped:false,requestTaxEstimateOnSubmit:null,requestTaxEstimateOnCartChange:true,init:function(t){this.checkout=t;this.storage=t.storage;this.$el=$("#step_"+this.id,$("#checkout"));this.$=function(t){return this.$el.find(t)};if(!this.$el.length){this.skipped=true;return}this.initFields()},isSkipped:function(){return this.skipped},isReady:function(){return false},getPreviousStepId:function(){var t=this.previousId;if(checkout.steps[t].isSkipped()){t=checkout.steps[t].getPreviousStepId()}return t},getNextStepId:function(){var t=this.nextId;if(t==="pay"){return"pay"}if(checkout.steps[t].isSkipped()){t=checkout.steps[t].getNextStepId()}return t},initFields:function(){if(this.skipped){return}for(var t in this.storage.getAll()){if(t==="password"){continue}var e=this.$("#"+t);if(e.length){var i=e.val();i=typeof i==="string"?i.trim():i;if(i===undefined||i===null||i===""){e.val(this.storage.getItem(t))}e.trigger("blur",[null,true])}}this.hideInputIds()},showInputIds:function(){this.$(".form-control").each(function(){if($(this).attr("visible-id")){$(this).attr("id",$(this).attr("visible-id"));$(this).removeAttr("visible-id")}})},hideInputIds:function(){this.$(".form-control").each(function(){if($(this).attr("id")){$(this).attr("visible-id",$(this).attr("id"));$(this).removeAttr("id")}})},focus:function(){if(this.skipped){return}if(this.checkout.isiOS()){return}if(this.$(".first-focus").length){this.$(".first-focus").focus()}else if(this.$(".btn-payment-method").length){this.$(".btn-payment-method:first").focus()}else if(this.$(".form-control").length){this.$(".form-control:first").focus()}},show:function(t,e,i){if(this.skipped){return}this.refresh();var s=this.$el;var a=$("#checkout");this.showInputIds();if(e){var r;for(r=0;r<checkout.showAnimationTimers.length;r++){clearTimeout(checkout.showAnimationTimers[r])}checkout.showAnimationTimers=[];for(r=0;r<checkout.hideAnimationTimers.length;r++){clearTimeout(checkout.hideAnimationTimers[r])}checkout.hideAnimationTimers=[];s.removeClass("enable-pane-flip-show-back-transitions").removeClass("prepare-pane-flip-show-back-transitions").removeClass("enable-pane-flip-show-next-transitions").removeClass("prepare-pane-flip-show-next-transitions").removeClass("enable-pane-flip-hide-back-transitions").removeClass("prepare-pane-flip-hide-back-transitions").removeClass("enable-pane-flip-hide-next-transitions").removeClass("prepare-pane-flip-hide-next-transitions");a.removeClass("enable-pane-flip-show-back-transitions").removeClass("prepare-pane-flip-show-back-transitions").removeClass("enable-pane-flip-show-next-transitions").removeClass("prepare-pane-flip-show-next-transitions").removeClass("enable-pane-flip-hide-back-transitions").removeClass("prepare-pane-flip-hide-back-transitions").removeClass("enable-pane-flip-hide-next-transitions").removeClass("prepare-pane-flip-hide-next-transitions");s.removeClass("flip-back").removeClass("flip-next");if(typeof i=="function"){i()}return}a.addClass(t?"prepare-pane-flip-show-next-transitions":"prepare-pane-flip-show-back-transitions");s.addClass(t?"prepare-pane-flip-show-next-transitions":"prepare-pane-flip-show-back-transitions");var o=setTimeout(()=>{a.addClass(t?"enable-pane-flip-show-next-transitions":"enable-pane-flip-show-back-transitions");s.addClass(t?"enable-pane-flip-show-next-transitions":"enable-pane-flip-show-back-transitions");var e=setTimeout(()=>{s.removeClass("flip-back").removeClass("flip-next");this.focus();a.removeClass("enable-pane-flip-show-back-transitions").removeClass("prepare-pane-flip-show-back-transitions").removeClass("enable-pane-flip-show-next-transitions").removeClass("prepare-pane-flip-show-next-transitions");s.removeClass("enable-pane-flip-show-back-transitions").removeClass("prepare-pane-flip-show-back-transitions").removeClass("enable-pane-flip-show-next-transitions").removeClass("prepare-pane-flip-show-next-transitions");setTimeout(()=>{window.scroll({top:0,behavior:"smooth"})},100);if(typeof i=="function"){i()}},checkout.paneAnimationSpeed);checkout.showAnimationTimers.push(e)},checkout.cssUpdateDelay);checkout.showAnimationTimers.push(o)}
1,hide:function(t,e,i){if(this.skipped){return}var s=this.$el;var a=$("#checkout");this.hideInputIds();if(e){var r;for(r=0;r<checkout.showAnimationTimers.length;r++){clearTimeout(checkout.showAnimationTimers[r])}checkout.showAnimationTimers=[];for(r=0;r<checkout.hideAnimationTimers.length;r++){clearTimeout(checkout.hideAnimationTimers[r])}checkout.hideAnimationTimers=[];s.removeClass("enable-pane-flip-show-back-transitions").removeClass("prepare-pane-flip-show-back-transitions").removeClass("enable-pane-flip-show-next-transitions").removeClass("prepare-pane-flip-show-next-transitions").removeClass("enable-pane-flip-hide-back-transitions").removeClass("prepare-pane-flip-hide-back-transitions").removeClass("enable-pane-flip-hide-next-transitions").removeClass("prepare-pane-flip-hide-next-transitions");a.removeClass("enable-pane-flip-show-back-transitions").removeClass("prepare-pane-flip-show-back-transitions").removeClass("enable-pane-flip-show-next-transitions").removeClass("prepare-pane-flip-show-next-transitions").removeClass("enable-pane-flip-hide-back-transitions").removeClass("prepare-pane-flip-hide-back-transitions").removeClass("enable-pane-flip-hide-next-transitions").removeClass("prepare-pane-flip-hide-next-transitions");s.addClass(t?"flip-next":"flip-back").removeClass(t?"flip-back":"flip-next");if(typeof i=="function"){i()}return}a.addClass(t?"prepare-pane-flip-hide-next-transitions":"prepare-pane-flip-hide-back-transitions");s.addClass(t?"prepare-pane-flip-hide-next-transitions":"prepare-pane-flip-hide-back-transitions");var o=setTimeout(()=>{a.addClass(t?"enable-pane-flip-hide-next-transitions":"enable-pane-flip-hide-back-transitions");s.addClass(t?"enable-pane-flip-hide-back-transitions":"enable-pane-flip-hide-next-transitions");s.addClass(t?"flip-next":"flip-back").removeClass(t?"flip-back":"flip-next");var e=setTimeout(()=>{a[0].scrollTop=0;if(typeof i=="function"){i()}a.removeClass("enable-pane-flip-hide-back-transitions").removeClass("prepare-pane-flip-hide-back-transitions").removeClass("enable-pane-flip-hide-next-transitions").removeClass("prepare-pane-flip-hide-next-transitions");s.removeClass("enable-pane-flip-hide-back-transitions").removeClass("prepare-pane-flip-hide-back-transitions").removeClass("enable-pane-flip-hide-next-transitions").removeClass("prepare-pane-flip-hide-next-transitions");setTimeout(()=>{window.scroll({top:0,behavior:"smooth"})},100)},checkout.paneAnimationSpeed);checkout.hideAnimationTimers.push(e)},checkout.cssUpdateDelay);checkout.hideAnimationTimers.push(o)},render:function(){if(this.skipped){return}var t=this;this.$(".btn-back").click(this.back.bind(this));this.$(".btn-next").click(this.next.bind(this));this.$(".form-group-check").each(function(){$(this).append('<span class="field-check hidden"><svg class="field-check-success" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg></span>')});
1this.$(".form-control").each(function(){var e=$(this);e.keydown(function(e){if(e.which===10||e.which===13){t.next(e)}}.bind(this));e.blur(function(i,s,a){var r=e.val();r=typeof r==="string"?r.trim():r;if(e.data("changed")||r){t.validate(e.closest(".form-group"),a)}});e.trigger("blur",[null,true]);e.change(function(){e=$(this);var i=e.closest(".form-group");e.data("changed",true);if(e.timer){clearTimeout(e.timer);delete e.timer}e.timer=setTimeout(function(){t.validate(i)},500);t.inputTimers.push(e.timer)})})},refresh:function(){},back:function(t){t.preventDefault();if(checkout.disabled)return;checkout.back()},next:function(t){t.preventDefault();if(checkout.disabled)return;this.resetValidationErrors();if(this.validate()){this.save();if(typeof this.doNext=="function"){this.doNext()}else{checkout.next()}}else{this.shake()}},doNext:function(){checkout.disabled=true;this.$(".btn-next").addClass("btn-progress");checkout.createOrder(this.requestTaxEstimateOnSubmit).always(function(){this.$(".btn-next").removeClass("btn-progress");checkout.disabled=false}.bind(this)).done(function(){if(typeof this.cleanup=="function"){this.cleanup()}checkout.next()}.bind(this))},resetValidationErrors:function(){for(var t=0;t<this.inputTimers.length;t++){clearTimeout(this.inputTimers[t])}this.inputTimers=[];this.$(".messages .text").empty();this.$(".messages").hide();this.$(".modal-content").removeClass("shake");this.$(".form-group").removeClass("is-invalid")},isRequired:function(t){var e=t.attr("required");return typeof e!=="undefined"&&e!==false},validations:{text:function(t,e){return!this.isRequired(t)||this.isRequired(t)&&e.length>0},email:function(t,e){return!this.isRequired(t)&&!e||/^([a-zA-Z0-9_.+-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e)},phone:function(t,e){return!this.isRequired(t)&&!e||/^[\+\(\)\-0-9]+$/.test(e)},password:function(t,e){return!this.isRequired(t)&&!e||e.length>=6},card_number:function(t,e){return $.payment.validateCardNumber(e)},card_expiry:function(t,e){return $.payment.validateCardExpiry($.payment.cardExpiryVal(e))},card_cvc:function(t,e){var i;if(this.$(".card_type .form-control").is(".manually-set")){i=this.$(".card_type .form-control").val()}i=i||$.payment.cardType(this.$(".card_number .form-control").val().trim());return $.payment.validateCardCVC(e,i)}},validate:function(t,e){var i=this;t=t||this.$(".form-group");e=e||false;var s=true;t.each(function(){var t=$(this);var a=$(this).find(".form-control:not(.hidden)");a.each(function(){var t=$(this);var a=t.val()||"";a=typeof a==="string"?a.trim():a;var r=t.data("validation")||t.attr("type")||"text";var o=i.validations[r].call(i,t,a);if(!e){t.toggleClass("is-invalid",!o);t.toggleClass("is-valid",Boolean(a)&&o)}s=o?s:false;var n=t.closest(".form-group").children(".field-check");if(s){n.removeClass("hidden")}else{n.addClass("hidden")}})});return s},save:function(){var t=this;
1this.$(".form-group").each(function(){var e=$(this).find(".form-control:not(.hidden):not(.madeHidden)");e.each(function(){var e=$(this);var i=e.val()||"";i=typeof i==="string"?i.trim():i;t.storage.setItem(e.attr("real_id")||e.attr("id"),i)})});this.$('input[type="radio"]:checked').each(function(){var e=$(this);var i=e.attr("name");var s=e.val();t.storage.setItem(i,s)})},showErrorMessage:function(t,e,i){var s="";if($.isPlainObject(t)){$.each(t,function(t,e){if(t==="email"&&$("#email2").attr("required")){t="email2"}s+=e instanceof Array?e.join("\n"):e;if(this.$("#"+t).length){this.$("#"+t).removeClass("is-valid");this.$("#"+t).addClass("is-invalid")}}.bind(this))}else{s=t}if(e){this.$(".messages .text").append("<li>"+s+"</li>")}else{this.$(".messages .text").html("<li>"+s+"</li>")}this.$(".messages").show();if(i){if(typeof i=="string"){i=this.$(i)}i.toggleClass("is-invalid",true);i.toggleClass("is-valid",false)}$(document).trigger("checkout.error_message",{message:s})},shake:function(){this.$(".modal-content").addClass("shake");setTimeout(function(){this.$(".modal-content").removeClass("shake")}.bind(this),500);$(document).trigger("checkout.shake",{pane_id:this.id,error_fields:$(".is-invalid").map((t,e)=>$(e).attr("id")).get().sort().join(",")})}};var step_login=$.extend({},checkout_pane,{id:"login",previousId:null,nextId:"purchase_type",requestTaxEstimateOnCartChange:false,isReady:function(){return this.storage.getItem("user_id")&&this.storage.getItem("email")},render:function(){checkout_pane.render.call(this);this.$("a.register").click(function(t){this.$("a.register").addClass("active");this.$("a.sign-in").removeClass("active");this.$(".sign-in-box").fadeOut(100,function(){this.$(".sign-in-box .form-group-sign-in").hide();this.$(".sign-in-box .form-group-register").show();this.$(".sign-in-box").fadeIn(100)}.bind(this));t.preventDefault()}.bind(this));this.$("a.sign-in").click(function(t){this.$("a.sign-in").addClass("active");this.$("a.register").removeClass("active");this.$(".sign-in-box").fadeOut(100,function(){this.$(".sign-in-box .form-group-sign-in").show();this.$(".sign-in-box .form-group-register").hide();this.$(".sign-in-box").fadeIn(100)}.bind(this));t.preventDefault()}.bind(this));this.$(".link-next").click(function(t){this.$(".form-login #email").removeAttr("required");this.$(".form-login #password").removeAttr("required");checkout.next();t.preventDefault()}.bind(this));this.refreshFields();if(this.isReady()&&checkout.preRenderHash!=="#checkout/"+this.id){checkout.next()}},refresh:function(){this.refreshFields();$(".social-login a").each(function(){var t=$(this).attr("href");var e=window.location.href.replace(/#.*$/,"");t=t.replace(/destination=([^&=]*)/,"destination="+encodeURIComponent(e));$(this).attr("href",t)})},refreshFields:function(){var t=this.storage.getItem("type")||0;this.$(".form-buyer-account").toggle(t!=0);if(!this.storage.getItem("user_id")){this.$(".form-different-account").hide();this.$(".form-login").show();this.$(".form-email").hide();this.$(".form-login #email").attr("required","required").removeClass("hidden");this.$(".form-login #password").attr("required","required").removeClass("hidden");this.$(".form-email #email2").removeAttr("required").addClass("hidden")}else if(!this.storage.getItem("email")){this.$(".form-different-account").hide();this.$(".form-login").hide();this.$(".form-email").show();this.$(".form-login #email").addClass("hidden");this.$(".form-login #password").addClass("hidden");this.$(".form-email #email2").attr("required","required").removeClass("hidden")}else{this.$(".form-different-account").show();this.$(".form-login").show();this.$(".form-email").hide();$("a.sign-in").click();this.$(".form-login #email").attr("required","required").removeClass("hidden");this.$(".form-login #password").attr("required","required").removeClass("hidden");this.$(".form-email #email2").removeAttr("required").addClass("hidden")}},cleanup:function(){setTimeout(function(){this.$(".form-login #password").val("")}.bind(this),checkout.paneAnimationSpeed*2)}});var step_purchase_type=$.extend({},checkout_pane,{id:"purchase_type",previousId:"login",nextId:"customer_details",render:function(){if(this.skipped){return}checkout_pane.render.call(this);this.$(".form-check-radio-panel").each(function(){$(this).click(function(){$(this).children("input[type=radio]").prop("checked",true).trigger("change")});$(this).children("input[type=radio]").change(function(){$(this).parents(".form-check-radio-panel-group").children(".form-check-radio-panel.checked").removeClass("checked");$(this).parents(".form-check-radio-panel-group").children(".form-check-radio-panel.first-focus").removeClass("first-focus");$(this).parents(".form-check-radio-panel").addClass("checked first-focus")});$(this).children("input[type=radio]").focus(function(){$(this).parents(".form-check-radio-panel").focus()})})},back:function(t){this.save();checkout.allSteps[this.previousId].refresh();checkout_pane.back.call(this,t)},initFields:function(){if(this.skipped){return}checkout_pane.initFields.call(this);var t=this.storage.getItem("type");if(t!==undefined){var e=this.$("input[name=type][value="+t+"]");e.prop("checked",true);e.parent("button").click();this.$("button").removeClass("first-focus");e.parent("button").addClass("first-focus")}}});var __billing_details_step=$.extend({},checkout_pane,{allFields:["country","street","city","state_i","state_s","postal_code","phone","company","fiscal_code","tax_office"],visibleFields:["country"],toggleRequired:function(t,e){var i=t.attr("required");if(i&&!e){t.removeAttr("required")}else if(!i&&e){t.attr("required",true)}if(!t.val()){t.closest(".form-group").children(".field-check").addClass("hidden")}}
1,toggleVisibility:function(t,e,i){var s=!t.is(".madeHidden");if(s&&!e){if(i){t.hide().addClass("madeHidden")}else{t.slideUp(checkout.revealAnimationSpeed).addClass("madeHidden")}}else if(!s&&e){if(i){t.show().removeClass("madeHidden")}else{t.slideDown(checkout.revealAnimationSpeed).removeClass("madeHidden")}}},makeRequired:function(t){this.toggleRequired(this.$(".country .form-control"),true);this.toggleRequired(this.$("input.state"),t.indexOf("state_i")!==-1);this.toggleRequired(this.$("select.state"),t.indexOf("state_s")!==-1);["street","city","postal_code","phone","company","fiscal_code","tax_office"].forEach(function(e){this.toggleRequired(this.$("."+e+" .form-control"),t.indexOf(e)!==-1)}.bind(this))},makeVisible:function(t){t=t||[];t.push("country");this.visibleFields=t;this.toggleVisibility(this.$("input.state"),t.indexOf("state_i")!==-1,true);this.toggleVisibility(this.$("select.state"),t.indexOf("state_s")!==-1,true);this.toggleVisibility(this.$("input.state").parent(),t.indexOf("state_i")!==-1||t.indexOf("state_s")!==-1);["street","city","postal_code","phone","company","fiscal_code","tax_office"].forEach(function(e){this.toggleVisibility(this.$("."+e+" .form-control").parent(),t.indexOf(e)!==-1)}.bind(this))},populateStatesList:function(t){var e=this.$("input.state");var i=this.$("select.state");i.empty();var s='<option value="" selected></option>';if(Array.isArray(t)){t.forEach(function(t){s+='<option value="'+t+'">'+t+"</option>"})}else if(typeof t==="object"&&t!==null){for(var a in t){s+='<option value="'+a+'">'+t[a]+"</option>"}}i.html(s);i.val("");var r=e.val().trim();if($('option[value="'+r+'"]',i).length){i.val(r);i.addClass("is-valid");i.parent().children(".field-check").removeClass("hidden")}else{i.val("");i.removeClass("is-valid");i.parent().children(".field-check").addClass("hidden")}},isReady:function(){return this.validate(null,true)&&checkout.getCurrentStep()===this},render:function(t,e){checkout_pane.render.call(this);var t=t||this.$("#billing_type_company");var i=this.$(".country .form-control");var s=this.$(".street .form-control");var a=this.$(".city .form-control");var r=this.$("input.state");var o=this.$("select.state");var n=this.$(".form-group.state label");var c=this.$(".postal_code .form-control");var l=this.$(".postal_code label");var d=this.$(".company .form-control");var u=this.$(".fiscal_code .form-control");var h=this.$(".fiscal_code label");var p=function(){var s=i.val();var a=i.data("previous");var c=s!==a;var d=t.is(":checked")?"company":"personal";$(this).toggleClass("no-value",!s);if(s===C_USA){this.$(".country.form-group").removeClass("col-12").addClass("col-6");if(c){l.html(l.attr("text_zip_code"));n.html(n.attr("text_state"));r.removeAttr("id").removeAttr("visible-id");o.attr("id","state");this.populateStatesList(USA_States)}if(d===BT_Company){this.makeRequired(["street","city","postal_code","state_s","company"]);this.makeVisible(["street","city","postal_code","state_s","company","phone"])}else if(e){this.makeRequired(["city","postal_code","state_s"]);this.makeVisible(["city","postal_code","state_s"])}else{this.makeRequired(["state_s"]);this.makeVisible(["state_s"])}}else if(s===C_Brazil){if(c){l.html(l.attr("text_postal_code"));n.html(n.attr("text_state"));r.removeAttr("id").removeAttr("visible-id");o.attr("id","state");this.populateStatesList(BRA_States)}if(d===BT_Company){this.$(".country.form-group").removeClass("col-12").addClass("col-6");h.html(h.attr("text_tax_cnpj"));this.makeRequired(["street","city","postal_code","state_s","fiscal_code","company"]);this.makeVisible(["street","city","postal_code","state_s","company","fiscal_code","phone"])}else if(e){this.$(".country.form-group").removeClass("col-6").addClass("col-12");h.html(h.attr("text_tax_cpf"));this.makeRequired(["city","postal_code","state_s","fiscal_code","phone"]);this.makeVisible(["city","postal_code","state_s","fiscal_code","phone"])}else{this.$(".country.form-group").removeClass("col-6").addClass("col-12");this.makeRequired([]);this.makeVisible([])}}else if(s===C_India){if(c){l.html(l.attr("text_postal_code"));n.html(n.attr("text_district"));r.removeAttr("id").removeAttr("visible-id");o.attr("id","state");this.populateStatesList(IND_Districts)}if(d===BT_Company){this.$(".country.form-group").removeClass("col-12").addClass("col-6");h.html(h.attr("text_tax_gst"));this.makeRequired(["street","city","postal_code","company"]);this.makeVisible(["street","city","postal_code","state_s","company","fiscal_code","phone"])}else if(e){this.$(".country.form-group").removeClass("col-6").addClass("col-12");this.makeRequired(["city","postal_code"]);this.makeVisible(["city","postal_code","state_s"])}else{this.$(".country.form-group").removeClass("col-6").addClass("col-12");this.makeRequired([]);this.makeVisible([])}}else if(s===C_Canada){this.$(".country.form-group").removeClass("col-12").addClass("col-6");if(c){l.html(l.attr("text_postal_code"));n.html(n.attr("text_state"));r.removeAttr("id").removeAttr("visible-id");o.attr("id","state");this.populateStatesList(CAN_States)}if(d===BT_Company){h.html(h.attr("text_tax_vat_id"));this.makeRequired(["street","city","postal_code","state_s","company"]);this.makeVisible(["street","city","postal_code","state_s","company","fiscal_code","phone"])}else if(e){this.makeRequired(["city","postal_code","state_s"]);this.makeVisible(["city","postal_code","state_s"])}else{this.makeRequired(["state_s"]);this.makeVisible(["state_s"])}}else{this.$(".country.form-group").removeClass("col-6").addClass("col-12");if(c){l.html(l.attr("text_postal_code"));n.html(n.attr("text_state_province"));o.removeAttr("id").removeAttr("visible-id");r.attr("id","state");var u=o.val();if(u){r.val(u);o.val("")}}if(s===C_Turkey){if(c){n.html(n.attr("text_district"))}if(d===BT_Company){h.html(h.attr("text_tax_number"));this.makeRequired(["street","city","postal_code","company"]);this.makeVisible(["street","city","postal_code","state_i","company","fiscal_code","tax_office","phone"])}else if(e){this.makeRequired(["city","postal_code"]);this.makeVisible(["city","postal_code","state_i"])}else{this.makeRequired([]);this.makeVisible([])}}else if(C_2CO_VAT_COUNTRY.indexOf(s)!==-1){if(d===BT_Company){h.html(h.attr("text_tax_vat_id"));this.makeRequired(["street","company"]);this.makeVisible(["street","city","postal_code","company","fiscal_code","phone"])}else{this.makeRequired([]);this.makeVisible([])}}else{if(d===BT_Company){this.makeRequired(["street","company"]);this.makeVisible(["street","city","postal_code","company","phone"])}else{this.makeRequired([]);this.makeVisible([])}}}i.data("previous",s)}.bind(this);this.$(".country .form-control").change(p);p.call(this.$(".country .form-control"));t.change(p.bind(this))},rerender:function(){this.$(".country .form-control").trigger("change")},validate:function(t,e){this.$(".messages .text").html("");this.$(".messages").hide();var i=checkout_pane.validate.call(this,t,e);return i},save:function(){checkout_pane.save.call(this);this.allFields.forEach(function(t){if(this.visibleFields.indexOf(t)===-1){var e=this.$("."+t+" .form-control");this.storage.setItem(e.attr("real_id")||e.attr("id"),"")}}.bind(this));var t=CURRENCY_BY_COUNTRY[this.storage.getItem("country")];var e=this.storage.getItem("currency");if(t!==e){this.storage.setItem("currency",t);this.checkout.renderCart()}}});var step_2co_customer_details=$.extend({},__billing_details_step,{id:"customer_details",previousId:"purchase_type",nextId:"paysystems",requestTaxEstimateOnSubmit:true,requestTaxEstimateOnCartChange:false,save:function(){__billing_details_step.save.call(this);this.allFields.forEach(function(t){if(this.visibleFields.indexOf(t)!==-1){var e=this.$("."+t+" .form-control");var i=$(".card-billing-box ."+t+" .form-control");i.val(e.val());if(t==="state_i"){$(".card-billing-box input.state").val(this.$("input.state").val())}if(t==="state_s"){$(".card-billing-box select.state").val(this.$("select.state").val())}}}.bind(this));step_2co_card_details.rerender();$(".card-billing-box input.state").val(this.$("input.state").val());$(".card-billing-box select.state").val(this.$("select.state").val())},validate:function(t,e){var i=__billing_details_step.validate.call(this,t,e);if(i){i&=this.nameValidateFunc("name",e)}if(e){if(this.$("#name").data("needs-confirm")){i=false}}return i},nameValidateFunc:function(t,e){var i=true;var s=this.$("."+t+" input");if(!s.length){return}var a=s.val().trim().replace(/^[ \,\.\-_:;](.*?)[ \,\.\-_:;]$/,"$1");if(!a){return}return i}});var step_paddle_customer_details=$.extend({},checkout_pane,{subtype:"paddle",id:"customer_details",previousId:"purchase_type",nextId:"paysystems",allFields:["country","street","city","state_i","state_s","postal_code","phone","company","fiscal_code","tax_office"],visibleFields:["country"],requestTaxEstimateOnSubmit:true,requestTaxEstimateOnCartChange:false,toggleRequired:function(t,e){var i=t.attr("required");if(i&&!e){t.removeAttr("required")}else if(!i&&e){t.attr("required",true)}if(!t.val()){t.closest(".form-group").children(".field-check").addClass("hidden")}}
1,toggleVisibility:function(t,e,i){var s=!t.is(".madeHidden");if(s&&!e){if(i){t.hide().addClass("madeHidden")}else{t.slideUp(checkout.revealAnimationSpeed).addClass("madeHidden")}}else if(!s&&e){if(i){t.show().removeClass("madeHidden")}else{t.slideDown(checkout.revealAnimationSpeed).removeClass("madeHidden")}}},makeRequired:function(t){this.toggleRequired(this.$(".country .form-control"),true);this.toggleRequired(this.$("input.state"),t.indexOf("state_i")!==-1);this.toggleRequired(this.$("select.state"),t.indexOf("state_s")!==-1);["street","city","postal_code","phone","company","fiscal_code","tax_office"].forEach(function(e){this.toggleRequired(this.$("."+e+" .form-control"),t.indexOf(e)!==-1)}.bind(this))},makeVisible:function(t){t=t||[];t.push("country");this.visibleFields=t;this.toggleVisibility(this.$("input.state"),t.indexOf("state_i")!==-1,true);this.toggleVisibility(this.$("select.state"),t.indexOf("state_s")!==-1,true);this.toggleVisibility(this.$("input.state").parent(),t.indexOf("state_i")!==-1||t.indexOf("state_s")!==-1);["street","city","postal_code","phone","company","fiscal_code","tax_office"].forEach(function(e){this.toggleVisibility(this.$("."+e+" .form-control").parent(),t.indexOf(e)!==-1)}.bind(this))},populateStatesList:function(t){var e=this.$("input.state");var i=this.$("select.state");i.empty();var s='<option value="" selected></option>';if(Array.isArray(t)){t.forEach(function(t){s+='<option value="'+t+'">'+t+"</option>"})}else if(typeof t==="object"&&t!==null){for(var a in t){s+='<option value="'+a+'">'+t[a]+"</option>"}}i.html(s);i.val("");var r=e.val().trim();if($('option[value="'+r+'"]',i).length){i.val(r);i.addClass("is-valid");i.parent().children(".field-check").removeClass("hidden")}else{i.val("");i.removeClass("is-valid");i.parent().children(".field-check").addClass("hidden")}},isReady:function(){return this.validate(null,true)&&checkout.getCurrentStep()===this},render:function(){checkout_pane.render.call(this);var t=this.$("#billing_type_company");var e=this.$(".country .form-control");var i=this.$(".street .form-control");var s=this.$(".city .form-control");var a=this.$("input.state");var r=this.$("select.state");var o=this.$(".form-group.state label");var n=this.$(".postal_code .form-control");var c=this.$(".postal_code label");var l=this.$(".company .form-control");var d=this.$(".fiscal_code .form-control");var u=this.$(".fiscal_code label");var h=function(){var i=e.val();var s=e.data("previous");var n=i!==s;var l=t.is(":checked")?"company":"personal";$(this).toggleClass("no-value",!i);u.html(u.attr("text_tax_number"));if(i===C_USA){this.$(".country.form-group").removeClass("col-12").addClass("col-6");if(n){c.html(c.attr("text_zip_code"));o.html(o.attr("text_state"));a.removeAttr("id").removeAttr("visible-id");r.attr("id","state");this.populateStatesList(USA_States)}if(l===BT_Company){this.makeRequired(["street","city","postal_code","state_s","company"]);this.makeVisible(["street","city","postal_code","state_s","company"])}else{this.makeRequired(["postal_code"]);this.makeVisible(["postal_code"])}}else if(i===C_Brazil){if(n){c.html(c.attr("text_postal_code"));o.html(o.attr("text_state"));a.removeAttr("id").removeAttr("visible-id");r.attr("id","state");this.populateStatesList(BRA_States)}if(l===BT_Company){this.$(".country.form-group").removeClass("col-12").addClass("col-6");u.html(u.attr("text_tax_cnpj"));this.makeRequired(["street","city","postal_code","state_s","company"]);this.makeVisible(["street","city","postal_code","state_s","company","fiscal_code"])}else{this.$(".country.form-group").removeClass("col-6").addClass("col-12");this.makeRequired([]);this.makeVisible([])}}else if(i===C_India){this.$(".country.form-group").removeClass("col-12").addClass("col-6");if(n){c.html(c.attr("text_postal_code"));o.html(o.attr("text_district"));a.removeAttr("id").removeAttr("visible-id");r.attr("id","state");this.populateStatesList(IND_Districts)}if(l===BT_Company){u.html(u.attr("text_tax_gst"));this.makeRequired(["street","city","postal_code","state_s","company","fiscal_code"]);this.makeVisible(["street","city","postal_code","state_s","company","fiscal_code"])}else{this.makeRequired(["postal_code"]);this.makeVisible(["postal_code"])}}else if(i===C_Canada){this.$(".country.form-group").removeClass("col-12").addClass("col-6");if(n){c.html(c.attr("text_postal_code"));o.html(o.attr("text_state"));a.removeAttr("id").removeAttr("visible-id");r.attr("id","state");this.populateStatesList(CAN_States)}if(l===BT_Company){u.html(u.attr("text_tax_gst"));this.makeRequired(["street","city","postal_code","state_s","company","fiscal_code"]);this.makeVisible(["street","city","postal_code","state_s","company","fiscal_code"])}else{this.makeRequired(["postal_code"]);this.makeVisible(["postal_code"])}}else{if(n){c.html(c.attr("text_postal_code"));o.html(o.attr("text_state_province"));r.removeAttr("id").removeAttr("visible-id");a.attr("id","state");var d=r.val();if(d){a.val(d);r.val("")}}if(i===C_Turkey){if(n){o.html(o.attr("text_district"))}if(l===BT_Company){u.html(u.attr("text_tax_number"))}}if(C_PADDLE_VAT_COUNTRY.includes(i)){u.html(u.attr("text_tax_vat_id"))}if(C_PADDLE_GST_COUNTRY.includes(i)){u.html(u.attr("text_tax_gst"))}if(l===BT_Company){this.$(".country.form-group").removeClass("col-12").addClass("col-6");this.makeRequired(["street","city","postal_code","state_i","company"]);this.makeVisible(["street","city","postal_code","state_i","company","fiscal_code"])}else{if(C_PADDLE_COUNTRY_POSTAL_CODE_REQUITED.includes(i)){this.$(".country.form-group").removeClass("col-12").addClass("col-6");this.makeRequired(["postal_code"]);this.makeVisible(["postal_code"])}else{this.$(".country.form-group").removeClass("col-6").addClass("col-12");this.makeRequired([]);this.makeVisible([])}}}e.data("previous",i)}.bind(this);this.$(".country .form-control").change(h);h.call(this.$(".country .form-control"));t.change(h.bind(this))},rerender:function(){this.$(".country .form-control").trigger("change")},validate:function(t,e){this.$(".messages .text").html("");this.$(".messages").hide();var i=checkout_pane.validate.call(this,t,e);return i},save:function(){checkout_pane.save.call(this);this.allFields.forEach(function(t){if(this.visibleFields.indexOf(t)===-1){var e=this.$("."+t+" .form-control");this.storage.setItem(e.attr("real_id")||e.attr("id"),"")}}.bind(this));var t=CURRENCY_BY_COUNTRY[this.storage.getItem("country")];var e=this.storage.getItem("currency");if(t!==e){this.storage.setItem("currency",t);this.checkout.renderCart()}}});var step_paysystems=$.extend({},checkout_pane,{id:"paysystems",previousId:"customer_details",nextId:null,inProgress:false,inProgressTimer:null,isReady:function(){return true},initFields:function(){checkout_pane.initFields.call(this);let t,e;var i=parseFloat(storage.getItem("discount_amount"));if(isNaN(i)){i=0}var s=parseFloat(storage.getItem("subtotal_pre_discount"));if(isNaN(s)){s=parseFloat(storage.getItem("price_no_tax"))}if(isNaN(s)){s=parseFloat(storage.getItem("subtotal"))}if(isNaN(s)){s=0}var a=parseFloat(storage.getItem("subtotal_pre_tax"));if(isNaN(a)){a=Math.max(0,s-i)}
1var r=parseFloat(storage.getItem("discount_amount_overall"));if(isNaN(r)){r=i}var o=parseFloat(storage.getItem("total"));if(isNaN(o)){o=a}if(isNaN(o)){o=s}if(isNaN(o)){o=0}var n=Math.max(o,o+r);var c=checkout.format_price(s,storage.getItem("currency"),true);var l=checkout.format_price(a,storage.getItem("currency"),true);var d=checkout.format_price(o,storage.getItem("currency"),true);var u=checkout.format_price(n,storage.getItem("currency"),true);if(t=c.match(/^(.+?)[ Â ]*([^0-9]+)$/)){this.$(".price-value").html(t[1]);this.$(".price-currency").html(t[2])}else{this.$(".price-value").html(c);this.$(".price-currency").html("")}e=(storage.getItem("tax_display")||"").toString();if(t=e.match(/^(.+?)[ Â ]*([^0-9]+)$/)){this.$(".tax-value").html(t[1]);this.$(".tax-currency").html(t[2])}else{this.$(".tax-value").html(e);this.$(".tax-currency").html("")}e=d.toString();if(t=e.match(/^(.+?)[ Â ]*([^0-9]+)$/)){this.$(".total-value").html(t[1]);this.$(".total-currency").html(t[2]).show()}else{this.$(".total-value").html(e);this.$(".total-currency").html("").hide()}this.$(".tax-brief-title span").html(storage.getItem("tax_name"));var h=storage.getItem("tax")||storage.getItem("fiscal_code");var p=storage.getItem("coupon_details");var m=(storage.getItem("coupon")||p&&p.code||"").toString().trim();var f=i>0||r>0;var _=!!m;if(!h){this.$(".final-totals").removeClass("no-tax-with-discount").addClass("no-tax")}else{this.$(".final-totals").removeClass("no-tax no-tax-with-discount")}if(storage.getItem("tax")){this.$(".hidden-paysystems-message").hide()}else{this.$(".hidden-paysystems-message").show()}if(f){var g=l.match(/^(.+?)[ Â ]*([^0-9]+)$/);if(g){this.$(".price-value").html(g[1]);this.$(".price-currency").html(g[2])}else{this.$(".price-value").html(l);this.$(".price-currency").html("")}var v=u.match(/^(.+?)[ Â ]*([^0-9]+)$/);var y=d.match(/^(.+?)[ Â ]*([^0-9]+)$/);if(v&&y){this.$(".total-value").html('<span class="discount-price-wrapper"><span class="discount-old-price">'+v[1]+'</span> <span class="discount-new-price">'+y[1]+"</span></span>");this.$(".total-currency").html(y[2]).show()}else{this.$(".total-value").html('<span class="discount-price-wrapper"><span class="discount-old-price">'+u+'</span> <span class="discount-new-price">'+d+"</span></span>");this.$(".total-currency").html("").hide()}}else{this.$(".price-value").html(c);this.$(".price-currency").html("");if(t=d.match(/^(.+?)[ Â ]*([^0-9]+)$/)){this.$(".total-value").html(t[1]);this.$(".total-currency").html(t[2]).show()}else{this.$(".total-value").html(d);this.$(".total-currency").html("").hide()}}if(_){var k=m;if(p&&p.title){k+=" ("+p.title+")"}this.$(".coupon-info-code").text(k);if(p&&p.description){this.$(".coupon-info-description").text(p.description)}else{this.$(".coupon-info-description").text("")}this.$(".coupon-info").show();this.$(".coupon-controls").hide();this.$(".coupon-controls").closest("tr").hide()}else{this.$(".coupon-info").hide();this.$(".coupon-controls").closest("tr").show();this.$(".coupon-controls").show();this.$(".coupon-toggle-link").show();this.$(".coupon-input-group").hide()}this.$(".coupon-message").hide()},render:function(){checkout_pane.render.call(this);this.unlockPaymentButtons();var t=this;this.$(".paysystems-show-hidden-payment-methods").click(function(e){t.$(".hidden-payment-methods").slideDown();$(this).slideUp();e.preventDefault()});this.$(".btn-payment-method").click(this.paymentMethodClick.bind(this));this.$(".coupon-toggle-link").click(function(e){e.preventDefault();$(this).hide();t.$(".coupon-input-group").show();t.$(".coupon-code-input").focus()});this.$(".coupon-apply-btn").click(this.applyCoupon.bind(this));this.$(".coupon-remove-btn").click(this.removeCoupon.bind(this));this.$(".coupon-code-input").keydown(function(e){if(e.which===13){e.preventDefault();t.applyCoupon()}})},applyCoupon:function(){var t=this.$(".coupon-code-input").val().trim();if(!t)return;this.$(".coupon-message").hide().removeClass("text-danger");this.$(".coupon-apply-btn").addClass("btn-progress");this.storage.setItem("coupon",t);checkout.createOrder(false).fail(function(t){if(t.responseJSON&&t.responseJSON.errors&&t.responseJSON.errors.coupon){this.resetValidationErrors();var e=t.responseJSON.errors.coupon;e=e instanceof Array?e.join(", "):e;this.$(".coupon-message").addClass("text-danger").text(e).show()}this.storage.setItem("coupon","")}.bind(this)).always(function(){this.$(".coupon-apply-btn").removeClass("btn-progress")}.bind(this))},removeCoupon:function(){this.$(".coupon-message").hide();this.$(".coupon-remove-btn").addClass("btn-progress");this.storage.setItem("coupon","");checkout.createOrder(false).fail(function(t){checkout.error(t)}.bind(this)).always(function(){this.$(".coupon-remove-btn").removeClass("btn-progress")}.bind(this))},lockPaymentButtons(){this.$(".btn-payment-method").removeClass("btn-progress");this.inProgress=true;this.inProgressTimer=setTimeout(function(){this.unlockPaymentButtons()}.bind(this),3e4)},unlockPaymentButtons(){clearTimeout(this.inProgressTimer);this.inProgress=false;this.inProgressTimer=null;this.$(".btn-payment-method").removeClass("btn-progress")},paymentMethodClick(t){if(this.inProgress){return}this.resetValidationErrors();
1var e=$(t.target).closest(".btn-payment-method");if(this.checkout.disabled){t.preventDefault();return}var i=parseFloat(this.storage.getItem("subtotal_pre_tax"));if(isNaN(i)){i=parseFloat(this.storage.getItem("subtotal")||0)||0}if(i===0){this.checkout.shakeCart();$(document).trigger("checkout.shake_cart",{message:"Shake cart on payment method step (total === 0)"});t.preventDefault();return}$(document).trigger("checkout.payment_method_selected",{method:e.attr("id")});var s=e.data("url");var a=e.attr("id");if(s==="#checkout/card_details"){t.preventDefault();checkout.changeStepTo("card_details");return}if(s==="#checkout/ideal"){t.preventDefault();checkout.changeStepTo("ideal");return}if(s==="#checkout/uah_confirmation"){s=e.data("pay-url");if(this.storage.getItem("currency")!=="UAH"){t.preventDefault();step_fondy_uah_confirmation.setPaymentUrl(s);step_fondy_uah_confirmation.setMethodId(a);checkout.changeStepTo("uah_confirmation");return}}$(document).trigger("checkout.payment_submitted",{method:e.attr("id")});this.lockPaymentButtons(e);e.addClass("btn-progress");this.requestPaymentMethodDetails(s,a);t.preventDefault()},requestPaymentMethodDetails:function(t,e){$(document).trigger("checkout.step",{products:checkout.getGACartProductsPayload(),step:"submit_payment",option:e});$.ajax({method:"GET",url:t,data:{set_inventory_to_order_country:this.storage.getItem("set_inventory_to_order_country"),currency:this.storage.getItem("currency"),coupon:this.storage.getItem("coupon")||"",line_items:checkout.getCartContents()},contentType:"application/json",crossDomain:true,xhrFields:{withCredentials:true},timeout:CHECKOUT_AJAX_TIMEOUT}).done(this.doPaymentMethod.bind(this)).fail(this.errorPaymentMethod.bind(this))},doPaymentMethod:function(t,e,i){window.onpageshow=function(t){this.unlockPaymentButtons();window.onpageshow=null}.bind(this);if(t.method==="PADDLE_JS"){if(typeof Paddle!=="undefined"&&typeof Paddle.Checkout!=="undefined"){var s=setTimeout(function(){this.$(".paddle_iframe_target_loading_problem").slideDown()},1e4);var a=setInterval(function(){if(this.$(".paddle-frame").length){clearTimeout(s);clearInterval(a);this.$(".paddle_iframe_target_placeholder").hide()}},100);try{Paddle.Checkout.open(t.payload);checkout.changeStepTo("paddle")}catch(e){this.showErrorMessage(ERROR_DEFAULT);$.ajax({method:"POST",url:"/ajax/error",data:{error:"Error triggered with Paddle checkout.",data:{source:"Paddle.Checkout",error:e.error,payload:t.payload}},dataType:"json",crossDomain:true,xhrFields:{withCredentials:true},timeout:CHECKOUT_AJAX_TIMEOUT})}window.onpageshow()}else{this.showErrorMessage(ERROR_PADDLE_JS_NOT_LOADED);window.onpageshow()}return}if(!t.action){this.errorPaymentMethod(i);return}var r=$('<form method="'+(t.method||"get")+'" action="'+t.action+'"></form>');var o=function(t,e,i){for(var s in i){var a;if(!e){a=s}else{a=e+"["+s+"]"}var r=i[s];if(typeof r==="object"&&r!==null){o(t,a,r)}else{t.append('<input type="hidden" name="'+a+'" value="'+r+'">')}}};if(t.data){o(r,"",t.data)}r.appendTo("body").submit()},errorPaymentMethod:function(t,e,i){this.unlockPaymentButtons();checkout.error(t)},back:function(t){checkout_pane.back.call(this,t);this.$(".messages .text").html("");this.$(".messages").hide()}});var step_paddle=$.extend({},checkout_pane,{id:"paddle",previousId:"paysystems",nextId:null,isReady:function(){return true},show:function(t,e,i){checkout_pane.show.call(this,t,e,i);$(".cart-upsell").addClass("cart-upsell-hidden");setTimeout(function(){$(".cart-upsell").css("visibility","hidden")},500);$(".cart-buttons-mobile").fadeOut()},hide:function(t,e,i){checkout_pane.hide.call(this,t,e,i);$(".cart-upsell").removeClass("cart-upsell-hidden");$(".cart-upsell").removeAttr("style");$(".cart-buttons-mobile").removeAttr("style")}});var step_2co_card_details=$.extend({},__billing_details_step,{id:"card_details",previousId:"paysystems",nextId:"pay",render:function(){__billing_details_step.render.call(this,$("#billing_type_company"),true);var t=this;this.$(".card_number .form-control").payment("formatCardNumber");this.$(".card_expiry .form-control").payment("formatCardExpiry");this.$(".card_cvc .form-control").payment("formatCardCVC");var e=function(t){if(this.$(".card_type .form-control").is(".manually-set")){return}var e=$.payment.cardType(this.$(".card_number .form-control").val().trim());if(e){this.$(".card-type").attr("class","card-type "+e+" identified");this.$(".card_type .form-control").val(e);this.$(".card_type .form-control").trigger("change")}else{this.$(".card-type").attr("class","card-type");this.$(".card_type .form-control").val("")}if(t){this.$(".card_type .form-control").trigger("change")}}.bind(this);e(false);this.$(".card_number .form-control").on("input",e);var i=function(t){if(t){this.$(".card_type .form-control").addClass("manually-set")}var e=this.$(".card_type .form-control").val();this.$(".card-type").attr("class","card-type "+e);if(e){this.$(".card-type").attr("class","card-type "+e+" identified")}else{this.$(".card-type").attr("class","card-type");this.$(".card_type .form-control").removeClass("manually-set")}this.$(".visa-secure").hide();this.$(".mastercard-id-check").hide();if(e==="visa"||e==="visaelectron"){this.$(".visa-secure").show()}else if(e==="mastercard"||e==="maestro"){this.$(".mastercard-id-check").show()}}.bind(this);i(false);
1this.$(".card_type .form-control").on("change",i)},save:function(){__billing_details_step.save.call(this);$(document).trigger("checkout.payment_submitted",{method:"tco_card"})},doNext:null});var step_2co_ideal=$.extend({},checkout_pane,{id:"ideal",previousId:"paysystems",nextId:"pay",doNext:function(){$(document).trigger("checkout.payment_submitted",{method:"tco_ideal"});this.$(".btn-next").addClass("btn-progress");var t=$("#tco_ideal").data("pay-url");$.ajax({method:"GET",url:t,data:{ideal_bank:this.storage.getItem("ideal_bank"),currency:this.storage.getItem("currency"),line_items:checkout.getCartContents()},crossDomain:true,xhrFields:{withCredentials:true},timeout:CHECKOUT_AJAX_TIMEOUT}).done(function(t){this.$(".btn-next").removeClass("btn-progress");step_paysystems.doPaymentMethod(t)}.bind(this)).fail(function(t){this.$(".btn-next").removeClass("btn-progress");step_paysystems.errorPaymentMethod(t)}.bind(this))},validate:function(t,e){this.$(".messages .text").html("");this.$(".messages").hide();var i=checkout_pane.validate.call(this,t,e);return i}});var step_fondy_uah_confirmation=$.extend({},checkout_pane,{id:"uah_confirmation",previousId:"paysystems",nextId:null,paymentUrl:null,methodId:null,setPaymentUrl:function(t){this.paymentUrl=t},setMethodId:function(t){this.methodId=t;if(this.methodId==="wfp_card"){this.$(".uah-confirmation-other-methods").hide();this.$(".uah-confirmation-card").show()}else{this.$(".uah-confirmation-other-methods").show();this.$(".uah-confirmation-card").hide()}},doNext:function(){$(document).trigger("checkout.payment_submitted",{method:this.methodId});this.$(".btn-next").addClass("btn-progress");step_paysystems.requestPaymentMethodDetails(this.paymentUrl,this.methodId)}});if(typeof volume_discounts==="undefined"){var volume_discounts=false}var checkout={disabled:false,open:false,currentStepId:null,previousStepId:null,cssUpdateDelay:50,paneAnimationSpeed:250,revealAnimationSpeed:250,modalAnimationSpeed:300,steps:{},allSteps:{login:step_login,purchase_type:step_purchase_type,customer_details:$("#step_paddle").length?step_paddle_customer_details:step_2co_customer_details,paysystems:step_paysystems,paddle:step_paddle,card_details:step_2co_card_details,ideal:step_2co_ideal,uah_confirmation:step_fondy_uah_confirmation},TCOAttached:false,TCOLoaded:false,TCOTokenLoaded:false,TCOLoadInterval:null,cartCaption:null,preRenderHash:null,showAnimationTimers:[],hideAnimationTimers:[],bodyHideAnimationTimer:null,oldScrollTop:0,createOrderRequest:null,updateCartTimers:{},siteThemeColor:null,isiOS:function(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){return true}return false},init:function(){bindGAEcommerceListeners();if(!$("#step_card_details").length){delete this.allSteps["card_details"]}if(!$("#step_ideal").length){delete this.allSteps["ideal"]}this.allSteps.customer_details=$("#step_paddle").length?step_paddle_customer_details:step_2co_customer_details;this.$el=$("#checkout");this.$=function(t){return this.$el.find(t)};this.storage=storage.init();$(document).trigger("checkout.init");if(window.history&&window.history.replaceState){var t=new URL(window.location.href);if(t.searchParams.has("coupon")){var e=t.searchParams.get("coupon");if(e&&!this.storage.getItem("coupon")){this.storage.setItem("coupon",e.trim())}t.searchParams.delete("coupon");window.history.replaceState({},"",t.toString())}}this.forEachStep(function(t,e){if(this.currentStepId===null){this.currentStepId=t}this.steps[t]=e;e.init(this)}.bind(this),this.allSteps);this.render()},start:function(t,e,i){if($("meta[name=theme-color]").length){this.siteThemeColor=$("meta[name=theme-color]").attr("content");$("meta[name=theme-color]").attr("content","#ecf0f1")}else{$("head").append('<meta name="theme-color" content="#ecf0f1">')}this.changeStepTo(this.currentStepId,i,true);if(t){this.addItemToCart(e,1)}this.forEachStep(function(t,e){e.refresh(this)}.bind(this));this.oldScrollTop=$(window).scrollTop();this.$el.addClass("fade");this.$el.modal();this.$el.removeClass("fade");this.$el.addClass("prepare-reveal-transitions");$(".body-holder").fadeOut(checkout.revealAnimationSpeed);this.bodyHideAnimationTimer=setTimeout(()=>{$("body").css("margin-bottom","0");$(".body-holder").addClass("hiding");$(".body-holder").hide();this.$el.addClass("enable-reveal-transitions");setTimeout(()=>{this.$el.addClass("ready").removeClass("enable-reveal-transitions").removeClass("prepare-reveal-transitions");this.open=true;this.getCurrentStep().focus()},checkout.revealAnimationSpeed)},checkout.revealAnimationSpeed);$(document).trigger("checkout.step",{products:this.getGACartProductsPayload(),step:this.steps[this.currentStepId].id,option:"start"})}
1,forEachStep:function(t,e){if(e===undefined){e=this.steps}for(const[i,s]of Object.entries(e)){t(i,s)}},sendRequestToUpdateTaxIfNeeded:function(){if(this.steps[this.currentStepId].requestTaxEstimateOnCartChange&&this.storage.getItem("id")&&this.storage.getItem("country")){if(this.createOrderRequest){this.createOrderRequest.abort();this.createOrderRequest=null}this.createOrderRequest=this.createOrder(true)}},updateItemInCart:function(t,e){t=t||this.storage.getItem("product");var i=this.storage.getItem("upsell")||{};if(i!==undefined&&i[t.sku]!==undefined){delete i[t.sku]}this.storage.setItem("upsell",i);var s=this.storage.getItem("cart")||{};s[t.sku]=$.extend({},t);s[t.sku].quantity=e;if(this.updateCartTimers[t.sku]){clearTimeout(this.updateCartTimers[t.sku]);this.updateCartTimers[t.sku]=null}this.updateCartTimers[t.sku]=setTimeout(()=>{$.ajax({method:"POST",url:(window.localized_url_prefix_m||"/")+"ajax/cart",data:{_token:this.storage.getItem("_token"),sku:t.sku,quantity:e},dataType:"json",crossDomain:true,xhrFields:{withCredentials:true},timeout:CHECKOUT_AJAX_TIMEOUT});this.sendRequestToUpdateTaxIfNeeded()},750);this.renderCart()},addItemToCart:function(t,e){t=t||this.storage.getItem("product");var i=this.storage.getItem("upsell")||{};var s=this.storage.getItem("cart")||{};if(typeof t=="string"){t=s[t]||i[t]}if(t===undefined)return;if(i[t.sku]!==undefined){delete i[t.sku]}this.storage.setItem("upsell",i);s[t.sku]=$.extend({},t);s[t.sku].quantity=1;this.storage.setItem("cart",s);this.$(".cart .cart-empty").remove();this.$(".cart .cart-items").append($('<div class="cart-progress"><svg class="spin-animation" fill="currentColor" style="margin-bottom:5px;width: 16px; height: 16px; color: #fff;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--\x3e<path d="M256 0c17 0 33.6 1.7 49.8 4.8c7.9 1.5 21.8 6.1 29.4 20.1c2 3.7 3.6 7.6 4.6 11.8l9.3 38.5C350.5 81 360.3 86.7 366 85l38-11.2c4-1.2 8.1-1.8 12.2-1.9c16.1-.5 27 9.4 32.3 15.4c22.1 25.1 39.1 54.6 49.9 86.3c2.6 7.6 5.6 21.8-2.7 35.4c-2.2 3.6-4.9 7-8 10L459 246.3c-4.2 4-4.2 15.5 0 19.5l28.7 27.3c3.1 3 5.8 6.4 8 10c8.2 13.6 5.2 27.8 2.7 35.4c-10.8 31.7-27.8 61.1-49.9 86.3c-5.3 6-16.3 15.9-32.3 15.4c-4.1-.1-8.2-.8-12.2-1.9L366 427c-5.7-1.7-15.5 4-16.9 9.8l-9.3 38.5c-1 4.2-2.6 8.2-4.6 11.8c-7.7 14-21.6 18.5-29.4 20.1C289.6 510.3 273 512 256 512s-33.6-1.7-49.8-4.8c-7.9-1.5-21.8-6.1-29.4-20.1c-2-3.7-3.6-7.6-4.6-11.8l-9.3-38.5c-1.4-5.8-11.2-11.5-16.9-9.8l-38 11.2c-4 1.2-8.1 1.8-12.2 1.9c-16.1 .5-27-9.4-32.3-15.4c-22-25.1-39.1-54.6-49.9-86.3c-2.6-7.6-5.6-21.8 2.7-35.4c2.2-3.6 4.9-7 8-10L53 265.7c4.2-4 4.2-15.5 0-19.5L24.2 218.9c-3.1-3-5.8-6.4-8-10C8 195.3 11 181.1 13.6 173.6c10.8-31.7 27.8-61.1 49.9-86.3c5.3-6 16.3-15.9 32.3-15.4c4.1 .1 8.2 .8 12.2 1.9L146 85c5.7 1.7 15.5-4 16.9-9.8l9.3-38.5c1-4.2 2.6-8.2 4.6-11.8c7.7-14 21.6-18.5 29.4-20.1C222.4 1.7 239 0 256 0zM218.1 51.4l-8.5 35.1c-7.8 32.3-45.3 53.9-77.2 44.6L97.9 120.9c-16.5 19.3-29.5 41.7-38 65.7l26.2 24.9c24 22.8 24 66.2 0 89L59.9 325.4c8.5 24 21.5 46.4 38 65.7l34.6-10.2c31.8-9.4 69.4 12.3 77.2 44.6l8.5 35.1c24.6 4.5 51.3 4.5 75.9 0l8.5-35.1c7.8-32.3 45.3-53.9 77.2
1-44.6l34.6 10.2c16.5-19.3 29.5-41.7 38-65.7l-26.2-24.9c-24-22.8-24-66.2 0-89l26.2-24.9c-8.5-24-21.5-46.4-38-65.7l-34.6 10.2c-31.8 9.4-69.4-12.3-77.2-44.6l-8.5-35.1c-24.6-4.5-51.3-4.5-75.9 0zM208 256a48 48 0 1 0 96 0 48 48 0 1 0 -96 0zm48 96a96 96 0 1 1 0-192 96 96 0 1 1 0 192z"/></svg></div>'));if(this.updateCartTimers[t.sku]){clearTimeout(this.updateCartTimers[t.sku]);this.updateCartTimers[t.sku]=null}this.updateCartTimers[t.sku]=setTimeout(()=>{$.ajax({method:"POST",url:(window.localized_url_prefix_m||"/")+"ajax/cart",data:{_token:this.storage.getItem("_token"),sku:t.sku,quantity:s[t.sku].quantity},dataType:"json",crossDomain:true,xhrFields:{withCredentials:true},timeout:CHECKOUT_AJAX_TIMEOUT});this.sendRequestToUpdateTaxIfNeeded()},750);this.renderCart()},removeItemFromCart:function(t){t=t||this.storage.getItem("product");var e=this.storage.getItem("upsell")||{};var i={};i[t.sku]=t;e=$.extend(i,e);this.storage.setItem("upsell",e);var s=this.storage.getItem("cart")||{};var a=0;if(s[t.sku]!=undefined){a=s[t.sku].quantity;delete s[t.sku]}this.storage.setItem("cart",s);if(this.updateCartTimers[t.sku]){clearTimeout(this.updateCartTimers[t.sku]);this.updateCartTimers[t.sku]=null}this.updateCartTimers[t.sku]=setTimeout(()=>{$.ajax({method:"POST",url:(window.localized_url_prefix_m||"/")+"ajax/cart",data:{_token:this.storage.getItem("_token"),sku:t.sku,quantity:0},dataType:"json",crossDomain:true,xhrFields:{withCredentials:true},timeout:CHECKOUT_AJAX_TIMEOUT});this.sendRequestToUpdateTaxIfNeeded()},750);this.renderCart()},setCartItems:function(t){var e=checkout.storage.getItem("cart")||{};var i=checkout.storage.getItem("upsell")||{};for(var s in e){var a=e[s];delete a.quantity;i[s]=a;delete e[s]}for(var r in t){var o=t[r]||1;if(typeof r=="string"){r=e[r]||i[r]}if(r===undefined)return;if(i[r.sku]!==undefined){delete i[r.sku]}if(e[r.sku]===undefined){e[r.sku]=$.extend({},r)}e[r.sku].quantity=o}this.storage.setItem("upsell",i);this.storage.setItem("cart",e);var n={};for(var c in e){n[c]=e[c].quantity}$.ajax({method:"POST",url:(window.localized_url_prefix_m||"/")+"ajax/cart/set",data:{cart:n},dataType:"json",crossDomain:true,xhrFields:{withCredentials:true},timeout:CHECKOUT_AJAX_TIMEOUT});this.renderCart()},getVolumeDiscountPercent:function(t,e){var i=0;var s=Object.keys(e).reverse();for(var a=0;a<s.length;a++){var r=s[a];var o=e[r];if(t>=r){i=o;break}}return i},renderCart:function(){var t=this;this.$(".cart .cart-items").empty();var e=this.storage.getItem("cart")||{};var i=(this.storage.getItem("coupon")||"").toString().trim();var s=function(t){return Math.round((t+Number.EPSILON)*100)/100};var a={};for(var r in this.storage.getItem("currencies")){a[r]=0}var o=0;$.each(e,function(e,i){o+=i.quantity;var s=$('<div class="cart-item"></div>');var r='<svg class="" x-description="Heroicon name: outline/x-mark" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">\n'+' <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path>\n'+"</svg>";s.append('<a href="#" class="cart-item-action cart-item-action-remove btn btn-sm btn-danger" title="'+$(".cart .cart-items").data("remove-text")+'">'+r+"</a>");var n=$('<div class="cart-item-info"></div>');if(i.limit_cart_quantity){n.addClass("cart-item-info-limit-quantity")}s.append(n);n.append('<div class="cart-item-image"><img src="'+(i.image||i.info[window.locale].image)+'"/></div>');n.append('<div class="cart-item-title">'+(i.title||i.info[window.locale].title)+"</div>");if(typeof i.url!="undefined"){$(".cart-item-image",n).wrapInner('<a href="'+i.url+'" target="_blank"></a>');$(".cart-item-title",n).wrapInner('<a href="'+i.url+'" target="_blank"></a>')}var c=0;var l=0;var d=i.prices[storage.getItem("currency")].price_display;var u={};var h={};if(volume_discounts){c=this.getVolumeDiscountPercent(i.quantity,volume_discounts);if(c){for(var p in i.prices){h[p]=Math.round(i.prices[p].price*c/100*100)/100;u[p]=this.format_price(i.prices[p].price-h[p],p)}}}if(c){if(typeof i.prices[storage.getItem("currency")].list_price_display!="undefined"&&i.prices[storage.getItem("currency")].list_price_display!=i.prices[storage.getItem("currency")].price_display){n.append('<div class="cart-item-old_price font-money">'+i.prices[storage.getItem("currency")].list_price_display+"</div>");n.append('<div class="cart-item-discount">'+i.prices[storage.getItem("currency")].discount_display+"</div>")}n.append('<div class="cart-item-price font-money" style="color: red; text-decoration: line-through; position: absolute;\n'+" left: 90px;\n"+" bottom: 22px;\n"+" color: #d12345;\n"+" text-decoration: line-through;\n"+" transform: rotate(-11deg) translateX(40px) translatey(5px);\n"+" font-size: 12px;\n"+'">'+i.prices[storage.getItem("currency")].price_display+"</div>");n.append('<div class="cart-item-price font-money" style="background: rgba(255,255,255,0.7); padding-right: 3px;">'+u[storage.getItem("currency")]+"</div>");s.append('<div class="cart-item-bulk_discount font-money" style="background: #d12345; color:white; padding: 5px; font-weight: bold; letter-spacing: -0.2px;">+ '+VOLUME_DISCOUNT+" "+c+"%</div>")}else{if(typeof i.prices[storage.getItem("currency")].list_price_display!="undefined"&&i.prices[storage.getItem("currency")].list_price_display!=i.prices[storage.getItem("currency")].price_display){n.append('<div class="cart-item-old_price font-money">'+i.prices[storage.getItem("currency")].list_price_display+"</div>");n.append('<div class="cart-item-discount">'+i.prices[storage.getItem("currency")].discount_display+"</div>")}n.append('<div class="cart-item-price font-money">'+i.prices[storage.getItem("currency")].price_display+"</div>")}var m='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="">\n'+' <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 12h-15" />\n'+"</svg>";var f='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="">\n'+' <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />\n'+"</svg>";if(!i.limit_cart_quantity){s.append('<div class="cart-quantity-controls form-inline">
1\n'+'<a href="#" class="cart-quantity-action cart-quantity-action-remove btn btn-sm btn-danger" title="Less items">'+m+"</a>\n"+'<input type="number" min="1" max="3000" class="quantity-input form-control" value="'+i.quantity+'">\n'+'<a href="#" class="cart-quantity-action cart-quantity-action-add btn btn-sm btn-success" title="More items">'+f+"</a>\n"+"</div><style>"+"input.quantity-input[type='number'] {\n"+" -moz-appearance:textfield;\n"+"}\n"+"\n"+"input.quantity-input::-webkit-outer-spin-button,\n"+"input.quantity-input::-webkit-inner-spin-button {\n"+" -webkit-appearance: none;\n"+"}"+"</style>")}s.data("item",i);$(".cart-item-action",s).click(function(e){var i=$(this).parents(".cart-item").data("item");t.removeItemFromCart(i);$(document).trigger("checkout.cart_remove",{product:i,quantity:i.quantity});e.preventDefault()});$(".cart-quantity-action-add",s).click(function(e){var i=$(this).parents(".cart-item").data("item");if(i.quantity<3e3){t.updateItemInCart(i,i.quantity+1);$(document).trigger("checkout.cart_add",{product:i,quantity:1})}e.preventDefault()});$(".cart-quantity-action-remove",s).click(function(e){var i=$(this).parents(".cart-item").data("item");if(i.quantity>1){t.updateItemInCart(i,i.quantity-1);$(document).trigger("checkout.cart_remove",{product:i,quantity:1})}e.preventDefault()});$(".quantity-input",s).change(function(e){var i=$(this).val();if(!i||i==="0"||isNaN(i)){i=1;$(this).val(1)}else{i=parseInt(i)}var s=$(this).parents(".cart-item").data("item");i=Math.max(Math.min(i,3e3),1);t.updateItemInCart(s,i);let a=i-s.quantity;if(a>0){$(document).trigger("checkout.cart_add",{product:s,quantity:a})}else if(a<0){$(document).trigger("checkout.cart_remove",{product:s,quantity:a})}e.preventDefault()});this.$(".cart .cart-items").append(s);var _;for(var p in i.prices){a[p]=a[p]||0;if(c){_=(i.prices[p].price-h[p])*i.quantity}else{_=i.prices[p].price*i.quantity}a[p]+=_}}.bind(this));if(this.$(".cart .cart-items").is(":empty")){var n=this.$(".cart .cart-items").data("empty-text");this.$(".cart .cart-items").append($('<div class="cart-empty"><svg fill="currentColor" style="display:inline-block;margin-bottom:5px;width: 48px; height: 48px; color: #000; background: #fff; border-radius: 100%;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path class="fa-secondary" opacity=".4" d="M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zm80.3-83c.2-.9 .4-1.9 .8-2.8c.7-1.8 1.7-3.4 2.9-4.8c2.5-2.8 6-4.8 10-5.3c3.8-.5 7.7-1 11.5-1.4c25.5-3.2 46.6-21.3 53.6-45.9c.5-1.7 1-3.4 1.5-5.2c2.4-8.5 11.3-13.4 19.8-11s13.4 11.3 11 19.8l-1.5 5.2c-4.2 14.8-11.8 28-21.9 38.8c40.4 4 72 38.1 72 79.6c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18 6-34.6 16-48c-8 0-14.9-5.9-15.9-14c-.1-.7-.1-1.4-.1-2c0-1 0-1.2 .1-1.5c0-.5 .1-.9 .2-1.4zM208.1 405.3c9.2-10.2 25.2-21.3 47.9-21.3s38.7 11.1 47.9 21.3c5.9 6.6 5.4 16.7-1.2 22.6s-16.7 5.4-22.6-1.2c-4.7-5.3-12.7-10.7-24.1-10.7s-19.4 5.4-24.1 10.7c-5.9 6.6-16 7.1-22.6 1.2s-7.1-16-1.2-22.6zM272 240c0-41.4 31.4-75.4 72-79.6c-10-10.8-17.6-24.1-21.9-38.8c-.5-1.7-1-3.4-1.5-5.2c-2.4-8.5 2.5-17.4 11-19.8s17.4 2.5 19.8 11l1.5 5.2c7 24.7 28.1 42.7 53.6 45.9c3.8 .5 7.7 1 11.5 1.4c8.1 1 14 7.9 14 15.9c0 .7 0 1.3-.1 2c-1 8.1-7.9 14-15.9 14c10 13.4 16 30 16 48c0 44.2-35.8 80-80 80s-80-35.8-80-80z"/><path class="fa-primary" d="M191.4 116.4c2.4-8.5-2.5-17.4-11-19.8s-17.4 2.5-19.8 11l-1.5 5.2c-7 24.7-28.1 42.7-53.6 45.9L94 160.1c-8.8 1.1-15 9.1-13.9 17.9s9.1 15 17.9 13.9l11.5-1.4c38.2-4.8 69.8-31.9 80.4-68.9l1.5-5.2zm129.2 0l1.5 5.2c10.6 37 42.2 64.1 80.4 68.9l11.5 1.4c8.8 1.1 16.8-5.1 17.9-13.9s-5.1-16.8-13.9-17.9l-11.5-1.4c-25.5-3.2-46.6-21.3-53.6-45.9l-1.5-5.2c-2.4-8.5-11.3-13.4-19.8-11s-13.4 11.3-11 19.8zM128 232c-8.3 0-15.9-3.2-21.6-8.4c-1.6 5.2-2.4 10.7-2.4 16.4c0 30.9 25.1 56 56 56s56-25.1 56-56s-25.1-56-56-56c-1.4 0-2.8 .1-4.2 .2c2.7 4.7 4.2 10.1 4.2 15.8c0 17.7-14.3 32-32 32zm224-32c0 17.7-14.3 32-32 32c-8.3 0-15.9-3.2-21.6-8.4c-1.6 5.2-2.4 10.7-2.4 16.4c0 30.9 25.1 56 56 56s56-25.1 56-56s-25.1-56-56-56c-1.4 0-2.8 .1-4.2 .2c2.7 4.7 4.2 10.1 4.2 15.8z"/></svg><div> '+n+"</div></div>"))}else{if(volume_discounts){this.$(".cart .cart-items").append($('<div class="bulk-info">'+VOLUME_DISCOUNT_TIP+"</div>"))}}var c={};for(var l in a){a[l]=s(a[l]||0);c[l]=this.format_price(a[l],l,true)}var d=this.storage.getItem("currency");var u=s(a[d]||0);var h=c[d];var p=s(parseFloat(this.storage.getItem("discount_amount")||0)||0);
1var m=s(Math.min(u,Math.max(0,p)));var f=s(Math.max(0,u-m));var _=this.format_price(f,d,true);this.storage.setItem("subtotals",a);this.storage.setItem("subtotals_display",c);this.storage.setItem("subtotal",u);this.storage.setItem("subtotal_display",h);this.storage.setItem("subtotal_pre_discount",u);this.storage.setItem("subtotal_pre_tax",f);this.storage.setItem("price_no_tax",u);this.storage.setItem("price_no_tax_display",h);this.storage.setItem("discount_amount",m);this.storage.setItem("discount_amount_display",m>0?this.format_price(m,d,true):"");this.$(".cart-total-value").html(h);if(m>0&&i){var g=_.match(/^(.+?)[ Â ]*([^0-9]+)$/);if(g){this.$(".price-value").html(g[1]);this.$(".price-currency").html(g[2])}else{this.$(".price-value").html(_);this.$(".price-currency").html("")}}else{this.$(".price-value").html(h);this.$(".price-currency").html("")}this.$(".tax-value").css("min-width",this.$(".tax-value").width());this.$(".total-value").css("min-width",this.$(".total-value").width());this.$(".tax-value").html('<span class="ellipsis-loading"></span>');this.$(".total-value").html('<span class="ellipsis-loading"></span>');if(this.$(".cart-block-container").length){var v=this.$(".cart .cart-item").length;if(v){if(v===1){this.$(".cart-block-container .cart-text").text($(".cart .cart-item-title").text())}else{var y=checkout_trans_choice(this.cartCaption,v,{count:v});this.$(".cart-block-container .cart-text").text(y)}this.$(".cart-block-container .cart-total").text("("+h+")");this.$(".cart-block-container").fadeIn();$(document).trigger("cart-block.show")}else{this.$(".cart-block-container").fadeOut();$(document).trigger("cart-block.hide")}}this.$(".upsell .cart-items").empty();var k=this.storage.getItem("upsell");if($.isEmptyObject(k)){this.$(".upsell").hide()}else{$.each(k,function(e,i){var s=$('<div class="cart-item"></div>');var a=$('<div class="cart-item-info"></div>');s.append(a);a.append('<div class="cart-item-image"><img src="'+(i.image||i.info[window.locale].image)+'"/></div>');a.append('<div class="cart-item-title">'+(i.title||i.info[window.locale].title)+"</div>");if(typeof i.url!="undefined"){$(".cart-item-image",a).wrapInner('<a href="'+i.url+'" target="_blank"></a>');$(".cart-item-title",a).wrapInner('<a href="'+i.url+'" target="_blank"></a>')}if(typeof i.prices[storage.getItem("currency")].list_price_display!="undefined"){a.append('<div class="cart-item-old_price font-money">'+i.prices[storage.getItem("currency")].list_price_display+"</div>");a.append('<div class="cart-item-discount">'+i.prices[storage.getItem("currency")].discount_display+"</div>")}a.append('<div class="cart-item-price font-money">'+i.prices[storage.getItem("currency")].price_display+"</div>");var r='<svg style="width: 1.2rem; height: 1.2rem;" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="">\n'+' <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />\n'+"</svg>";s.append('<a href="#" class="cart-item-action cart-item-action-add btn btn-sm btn-success" title="'+$(".cart .cart-items").data("add-text")+'">'+r+' <span class="cart-item-action-add-text">'+$(".cart .cart-items").data("add-text")+"</span></a>");s.data("item",i);$(".cart-item-action",s).click(function(e){var i=$(this).parents(".cart-item").data("item");t.addItemToCart(i);$(document).trigger("checkout.cart_add",{product:i,quantity:1});e.preventDefault()});this.$(".upsell .cart-items").append(s)}.bind(this));this.$(".upsell").show()}this.$(".cart-upsell").addClass("cart-upsell-ready");this.$(".cart-count-indicator").text(o);this.$(".cart-count-indicator").toggleClass("danger",!o);this.$(".cart-button-show").click(function(t){this.$el.addClass("cart-open");this.$(".modals input,select,button:not(.cart-button-hide)").prop("disabled",true);t.preventDefault()}.bind(this));this.$(".cart-button-hide").click(function(t){this.$(".modals input,select,button:not(.cart-button-hide)").prop("disabled",false);this.$el.removeClass("cart-open");t.preventDefault()}.bind(this))},getCurrentStep:function(){return this.steps[this.currentStepId]},isStepAfterAnother:function(t,e){if(t===e){return false}for(const[i,s]of Object.entries(this.steps)){if(i===e){return true}if(i===t){return false}}},isStepAfterCurrent:function(t){return this.isStepAfterAnother(t,this.currentStepId)},isStepBeforeAnother:function(t,e){if(t===this.currentStepId){return false}return!this.isStepAfterAnother(t,e)},isStepBeforeCurrent:function(t){return this.isStepBeforeAnother(t,this.currentStepId)},isStepEqualsAnother:function(t,e){return t===e},isStepEqualsCurrent:function(t){return t===this.currentStepId},render:function(){this.preRenderHash=window.location.hash;this.forEachStep(function(t,e){e.hide(this.isStepAfterCurrent(t),true)}.bind(this));this.forEachStep(function(t,e){e.render()}.bind(this));changeHash("checkout/"+this.getCurrentStep().id,this.getCurrentStep().$("h2").text().trim());this.rendered=true;this.renderCart()},disable:function(){this.disabled=true;this.$el.addClass("progress");$("body").append('<div class="modal-backdrop modal-backdrop-progress"><div class="text-wrapper"><div class="text"></div></div></div>');if(window.progress_texts!==undefined&&window.progress_texts.length){var t=0;$("body > .modal-backdrop-progress .text").text(progress_texts[t]);this.progressInterval=setInterval(function(){if(t<progress_texts.length-1){t++;var e=progress_texts[t];$("body > .modal-backdrop-progress .text").text(e)}else{clearInterval(this.progressInterval)}}.bind(this),2e3)}else{$("body > .modal-backdrop-progress .text").text("One moment, please...")}},enable:function(){this.disabled=false;this.$el.removeClass("progress");clearInterval(this.progressInterval);$("body > .modal-backdrop-progress").remove()},back:function(){this.changeStepTo(this.getCurrentStep().getPreviousStepId())},next:function(){this.changeStepTo(this.getCurrentStep().getNextStepId())}
1,getGACartProductsPayload:function(){var t=[];var e=this.storage.getItem("cart");if(typeof e=="object"){$.each(e,function(e,i){t.push({id:i.sku,name:i.title,prices:i.prices,quantity:i.quantity})})}return t},getCartContents:function(){var t={};var e=this.storage.getItem("cart");var i=0;if(typeof e=="object"){$.each(e,function(e,s){var a=storage.getItem("currency");t[e]={sku:s.sku,currency:a,price:s.prices[a].price,quantity:s.quantity};i++})}if(i===0){return""}return t},getStepOption:function(){if(typeof this.getCurrentStep().getStepOption=="function"){return this.getCurrentStep().getStepOption()}},changeStepTo:function(t,e,i){if(t==="pay"){this.pay();return}if(t===null){return}this.previousStepId=this.currentStepId;this.currentStepId=t;this.renderStep(i);if(this.open){$(document).trigger("checkout.step",{products:this.getGACartProductsPayload(),step:this.steps[this.currentStepId].id,option:this.steps[this.previousStepId].id})}if(e){return}changeHash("checkout/"+this.getCurrentStep().id,this.getCurrentStep().$("h2").text().trim(),this.rendered)},renderStep:function(t){if(this.rendered){this.forEachStep(function(t,e){if(t===this.previousStepId||t===this.currentStepId){return}e.hide(this.isStepAfterCurrent(t),true)}.bind(this));var e=this.steps[this.previousStepId];var i=this.steps[this.currentStepId];if(e.$el.is(".flip-back")||e.$el.is(".flip-next")||e.$el.is(".prepare-pane-flip-hide-back-transitions")||e.$el.is(".prepare-pane-flip-hide-next-transitions")||e.$el.is(".enable-pane-flip-hide-back-transitions")||e.$el.is(".enable-pane-flip-hide-next-transitions")){e.hide(this.isStepAfterAnother(this.previousStepId,this.currentStepId),true);i.show(this.isStepBeforeAnother(this.previousStepId,this.currentStepId),t)}else{e.hide(this.isStepAfterAnother(this.previousStepId,this.currentStepId),t,function(){i.show(this.isStepBeforeAnother(this.previousStepId,this.currentStepId),t)}.bind(this))}}},createOrder:function(t){var e=["_token","set_inventory_to_order_country","type","email","password","id","user_id","currency","name","company","street","country","state","city","postal_code","phone","fiscal_code","tax_office"];var i={};for(var s=0;s<e.length;s++){i[e[s]]=this.storage.getItem(e[s])}var a=this.storage.getItem("coupon");i.coupon=a!==undefined&&a!==null?a:"";i.requestTaxEstimateOnSubmit=t;i.line_items=this.getCartContents();var r=$.Deferred();var o=null;var n=r.promise();n.abort=function(){if(o&&o.abort){o.abort()}return n};applyCampaignParamsToPayload(i);applyGaParamsToPayload(i);o=$.ajax({method:"POST",url:(window.localized_url_prefix_m||"/")+"ajax/order",data:i,dataType:"json",crossDomain:true,xhrFields:{withCredentials:true},timeout:CHECKOUT_AJAX_TIMEOUT}).done(function(t){if(typeof t==="string"||t instanceof String){this.error.bind(this)}this.createOrder_success(t)}.bind(this)).fail(this.error.bind(this));o.done(function(t){r.resolve(t)}).fail(function(t){r.reject(t)});return n},createOrder_success:function(t){console.log("ORDER CREATED/UPDATED: "+t.id);console.log("USER: "+t.user_id);let e=null;if(t.authEvent){e=t.authEvent;delete t.authEvent}this.storage.setItem("order",t);var i=["id","user_id","currency","name","company","street","country","state","city","postal_code","fiscal_code","tax_office","phone","tax_estimate"];i.forEach(function(e){if(typeof t[e]!==undefined){this.storage.setItem(e,t[e])}}.bind(this));var s=this.storage.getItem("currency");var a=function(t,e){var i=parseFloat(t);return isNaN(i)?e:i};var r=t.tax_estimate||{};var o=a(r.discount_amount_pre_tax,a(t.discount_amount,0));var n=a(r.discount_amount_overall,o);var c=a(r.subtotal_pre_discount,a(this.storage.getItem("subtotal"),0));var l=a(r.subtotal_pre_tax,Math.max(0,c-o));var d=a(r.tax,0);var u=a(r.total,l+d);this.storage.setItem("subtotal_pre_discount",c);this.storage.setItem("subtotal_pre_tax",l);this.storage.setItem("subtotal",c);this.storage.setItem("subtotal_display",this.format_price(c,s,true));var h=this.storage.getItem("subtotals")||{};h[s]=c;this.storage.setItem("subtotals",h);var p=this.storage.getItem("subtotals_display")||{};p[s]=this.format_price(c,s,true);this.storage.setItem("subtotals_display",p);this.storage.setItem("price_no_tax",c);this.storage.setItem("price_no_tax_display",this.format_price(c,s,true));this.storage.setItem("tax",d);this.storage.setItem("tax_display",this.format_price(d,s,true));this.storage.setItem("tax_name",r.tax_name||"");this.storage.setItem("total",u);this.storage.setItem("total_display",this.format_price(u,s,true));this.storage.setItem("discount_amount",o);this.storage.setItem("discount_amount_overall",n);if(o){this.storage.setItem("discount_amount_display",this.format_price(o,s,true))}else{this.storage.setItem("discount_amount_display","")}var m=t.coupon_details||null;var f=((t.coupon||m&&m.code||"")+"").trim();if(f){this.storage.setItem("coupon",f);this.storage.setItem("coupon_details",m||{code:f})}else{this.storage.setItem("coupon","");this.storage.setItem("coupon_details",null)}this.forEachStep(function(t,e){e.initFields()}.bind(this));$(document).trigger("checkout.change_user",{user_id:this.storage.getItem("user_id"),type:e})},pay:function(){var t=parseFloat(this.storage.getItem("subtotal_pre_tax"));if(isNaN(t)){t=parseFloat(this.storage.getItem("subtotal")||0)||0}if(t===0){this.shakeCart();$(document).trigger("checkout.shake_cart",{message:"Shake cart on pay (total === 0)"});return}if(this.disabled)return;this.disable();$(document).trigger("checkout.step",{products:this.getGACartProductsPayload(),step:"submit_payment",option:"tco_card"});var e=["_token","set_inventory_to_order_country","type","email","password","id","user_id","currency","name","company","street","country","state","city","postal_code","phone","fiscal_code","tax_office","card_number","card_type","card_expiry","card_cvc","cardholder"];var i={};for(var s=0;s<e.length;s++){i[e[s]]=this.storage.getItem(e[s])}var a=this.storage.getItem("coupon");i.coupon=a!==undefined&&a!==null?a:"";i.line_items=this.getCartContents();applyCampaignParamsToPayload(i);applyGaParamsToPayload(i);$.ajax({method:"POST",url:(window.localized_url_prefix_m||"/")+"ajax/order/2co/"+(this.storage.getItem("tco_api_version")||6)+"/charge",data:i,crossDomain:true,xhrFields:{withCredentials:true},timeout:CHECKOUT_AJAX_TIMEOUT}).done(this.pay_checkout_success.bind(this)).fail(this.error.bind(this))},pay_checkout_success:function(t){console.log("ORDER COMPLETED");if(typeof t.redirect!=="undefined"){window.location=t.redirect}else{this.enable()}},error:function(t){this.enable();if((t.status!==undefined&&t.status===0||t.readyState!==undefined&&t.readyState===0)&&t.statusText!==undefined&&t.statusText!=="timeout"){return}var e;
1if(t.status!==undefined&&t.status===419){e=ERROR_RELOGIN}else if(t.responseJSON){e=t.responseJSON;if(e.errors!==undefined){e=e.errors}else if(e.message!==undefined){e=e.message}}else{e=t.errorMsg||t.message;if(!e&&t.status===503){e=ERROR_MAINTENANCE}}if(!e){e=ERROR_DEFAULT}let i=true;if(t?.responseText){if(t.responseText.includes("/password/reset")||t.responseText.includes("\\/password\\/reset")){i=false}}if(i){$.ajax({method:"POST",url:"/ajax/error",data:{error:"Error triggered with checkout.",data:{source:"Generic checkout error",error:e,xhr:t?{status:t.status,statusText:t.statusText,response:t.response,responseText:t.responseText,responseType:t.responseType,responseUrl:t.responseUrl,readyState:t.readyState,errorMsg:t.errorMsg}:""}},dataType:"json",crossDomain:true,xhrFields:{withCredentials:true},timeout:CHECKOUT_AJAX_TIMEOUT})}this.getCurrentStep().showErrorMessage(e)},shakeCart:function(){this.$(".cart").addClass("shake");this.$(".cart-button-show").addClass("shake");setTimeout(function(){this.$(".cart").removeClass("shake");this.$(".cart-button-show").removeClass("shake")}.bind(this),500);setTimeout(function(){this.$(".cart-count-indicator").addClass("shake");setTimeout(function(){this.$(".cart-count-indicator").removeClass("shake")}.bind(this),500)}.bind(this),10)},format_price:function(t,e,i=false){var s=this.storage.getItem("currencies")[e];var a=function(t,e,i,s){var a=3;var r="\\d(?=(\\d{"+(a||3)+"})+"+(e>0?"\\D":"$")+")",o=t.toFixed(Math.max(0,~~e));return(i?o.replace(".",i):o).replace(new RegExp(r,"g"),"$&"+(s||""))};if(!i&&s.hide_decimals_unless_fraction===true&&Math.abs(t%1)>1e-5){s.decimals=0}t=a(t,s.decimals,s.decimal_point,s.thousands_separator);return s.format.replace("%s",t)},close:function(t){if(checkout.temporaryChangeHash!==false){changeHash()}delete checkout.temporaryChangeHash;if(this.siteThemeColor){$("meta[name=theme-color]").attr("content",this.siteThemeColor)}else if($("meta[name=theme-color]").length){$("meta[name=theme-color]").remove()}this.open=false;this.$el.removeClass("ready");setTimeout(function(){if(typeof stickyFooterRecalculate=="function"){stickyFooterRecalculate()}},50);clearTimeout(this.bodyHideAnimationTimer);$(".body-holder").removeClass("hiding");$(".body-holder").show();setTimeout(function(){$(".body-holder").removeClass("hiding");$(".body-holder").show()},this.revealAnimationSpeed);$(window).scrollTop(this.oldScrollTop)}};var sendPageView=function(){var t=window.location;var e=t.hash?t.hash.substring(1):t.pathname+t.search;$(document).trigger("checkout.url_change",e)};function getGaClientIdFromCookie(){var t=document.cookie.match(/(?:^|; )_ga=([^;]+)/);if(!t){return null}var e=decodeURIComponent(t[1]);var i=e.split(".");if(i.length>=4){return i[i.length-2]+"."+i[i.length-1]}return null}function collectGaParams(t){var e={client_id:null,session_id:null,session_number:null,measurement_id:window.ga_measurement_id||null,captured_at:(new Date).toISOString(),capture_status:null,capture_reason:null};var i=typeof window.gtag==="function"&&e.measurement_id;if(!i){var s=getGaClientIdFromCookie();if(s){e.client_id=s;e.capture_status="collected_from_cookie"}if(!e.capture_status){e.capture_status="not_collected"}e.capture_reason=e.measurement_id?"GA script blocked or failed to load":"GA config missing on page";t(e);return}var a={client_id:true,session_id:true,session_number:true};var r=false;var o=function(){if(r){return}r=true;if(hasNonEmptyValue(e.client_id)||hasNonEmptyValue(e.session_id)||hasNonEmptyValue(e.session_number)){e.capture_status="collected_from_gtag"}else{e.capture_status="not_collected";e.capture_reason="GA script loaded but did not return client or session IDs"}t(e)};var n=function(t,i){if(i!==undefined&&i!==null&&i!==""){e[t]=i}a[t]=false;if(!a.client_id&&!a.session_id&&!a.session_number){o()}};window.gtag("get",e.measurement_id,"client_id",function(t){n("client_id",t)});window.gtag("get",e.measurement_id,"session_id",function(t){n("session_id",t)});window.gtag("get",e.measurement_id,"session_number",function(t){n("session_number",t)});setTimeout(o,200)}function storeGaParams(t){checkout.storage.setItem("ga_client_id",t.client_id);checkout.storage.setItem("ga_session_id",t.session_id);checkout.storage.setItem("ga_session_number",t.session_number);checkout.storage.setItem("ga_measurement_id",t.measurement_id);checkout.storage.setItem("ga_captured_at",t.captured_at);checkout.storage.setItem("ga_capture_status",t.capture_status);checkout.storage.setItem("ga_capture_reason",t.capture_reason)}function storeCampaignParams(t){var e=pickNonEmptyFields(t,["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","fbclid","msclkid","landing_url","referrer"]);for(var i in e){checkout.storage.setItem(i,e[i])}}function applyGaParamsToPayload(t){var e={client_id:checkout.storage.getItem("ga_client_id"),session_id:checkout.storage.getItem("ga_session_id"),session_number:checkout.storage.getItem("ga_session_number"),measurement_id:checkout.storage.getItem("ga_measurement_id"),captured_at:checkout.storage.getItem("ga_captured_at"),capture_status:checkout.storage.getItem("ga_capture_status"),capture_reason:checkout.storage.getItem("ga_capture_reason")};var i=pickNonEmptyFields({ga_client_id:e.client_id,ga_session_id:e.session_id,ga_session_number:e.session_number,ga_measurement_id:e.measurement_id,ga_captured_at:e.captured_at,ga_capture_status:e.capture_status,ga_capture_reason:e.capture_reason},["ga_client_id","ga_session_id","ga_session_number","ga_measurement_id","ga_captured_at","ga_capture_status","ga_capture_reason"]);if(Object.keys(i).length){$.extend(t,i)}}function applyCampaignParamsToPayload(t){var e=pickNonEmptyFields({utm_source:c
1heckout.storage.getItem("utm_source"),utm_medium:checkout.storage.getItem("utm_medium"),utm_campaign:checkout.storage.getItem("utm_campaign"),utm_term:checkout.storage.getItem("utm_term"),utm_content:checkout.storage.getItem("utm_content"),gclid:checkout.storage.getItem("gclid"),fbclid:checkout.storage.getItem("fbclid"),msclkid:checkout.storage.getItem("msclkid"),landing_url:checkout.storage.getItem("landing_url"),referrer:checkout.storage.getItem("referrer")},["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","fbclid","msclkid","landing_url","referrer"]);if(Object.keys(e).length){$.extend(t,e)}}function getStoredCampaignData(){try{var t=window.localStorage.getItem("last_attribution");if(!t){return null}var e=JSON.parse(t);if(!e||typeof e!=="object"){return null}if(e.captured_at){var i=Date.parse(e.captured_at);if(!isNaN(i)){var s=7*24*60*60*1e3;if(Date.now()-i>s){return null}}}return e}catch(t){return null}}function hasNonEmptyValue(t){return t!==undefined&&t!==null&&t!==""}function pickNonEmptyFields(t,e){var i={};for(var s=0;s<e.length;s++){var a=e[s];if(hasNonEmptyValue(t[a])){i[a]=t[a]}}return i}function _gtag(){if(typeof window.gtag!=="function"){return}window.gtag.apply(window,arguments)}window.addEventListener("popstate",sendPageView);var makeGAProduct=function(t){var e=$.extend({},t);if(t.prices!==undefined){e.price=t.prices[checkout.storage.getItem("currency")].price;delete e.prices}return e};var bindGAEcommerceListeners=function(){$(document).off("checkout.error_message").on("checkout.error_message",function(t,e){_gtag("event","ecommerce_error_message",{error_message:e.message})});$(document).off("checkout.shake").on("checkout.shake",function(t,e){_gtag("event","ecommerce_shake",{pane_id:e.pane_id,error_fields:e.error_fields})});$(document).off("checkout.shake_cart").on("checkout.shake_cart",function(t,e){_gtag("event","ecommerce_shake_cart",{error_message:e.message})});$(document).off("checkout.init").on("checkout.init",function(){var t=checkout.storage.getItem("product");var e=getStoredCampaignData();if(e){storeCampaignParams(e)}collectGaParams(function(t){storeGaParams(t)});_gtag("set",{currency:checkout.storage.getItem("currency")});let i=[];if(t){i.push({item_id:t.sku,item_name:t.sku,item_variant:t.price_group,price:t.prices[checkout.storage.getItem("currency")].price})}_gtag("event","begin_checkout",{currency:checkout.storage.getItem("currency"),value:checkout.storage.getItem("subtotal_pre_tax")||checkout.storage.getItem("subtotal"),items:i})});$(document).off("checkout.change_user").on("checkout.change_user",function(t,e){_gtag("set",{user_id:e.user_id});if(e.type==="login"){_gtag("event","login",{method:"password"})}else if(e.type==="signup"){_gtag("event","sign_up",{method:"password"})}});$(document).off("checkout.cart_add").on("checkout.cart_add",function(t,e){var i=e.product;var s=e.quantity;_gtag("event","add_to_cart",{currency:checkout.storage.getItem("currency"),value:i.prices[checkout.storage.getItem("currency")].price,items:[{item_id:i.sku,item_name:i.title,item_variant:i.price_group,price:i.prices[checkout.storage.getItem("currency")].price,quantity:s}]})});$(document).off("checkout.cart_remove").on("checkout.cart_remove",function(t,e){var i=e.product;var s=e.quantity;_gtag("event","remove_from_cart",{currency:checkout.storage.getItem("currency"),value:i.prices[checkout.storage.getItem("currency")].price,items:[{item_id:i.sku,item_name:i.title,item_variant:i.price_group,price:i.prices[checkout.storage.getItem("currency")].price,quantity:s}]})});$(document).off("checkout.payment_method_selected").on("checkout.payment_method_selected",function(t,e){_gtag("event","ecommerce_payment_method_selected",{payment_method:e.method})});$(document).off("checkout.payment_submitted").on("checkout.payment_submitted",function(t,e){_gtag("event","ecommerce_payment_submitted",{payment_method:e.method})})};var bindGAPromotionsListeners=function(){$(document).off("checkout.promo_click").on("checkout.promo_click",function(t,e){sendGAPromotionClick(e)});$(document).off("checkout.view_item").on("checkout.view_item",function(t,e){_gtag("event","view_item",{currency:e.currency,value:e.price,items:[{item_id:e.id,item_name:e.name,price:e.price,quantity:1}]})});$("body").off("pageview").on("pageview",".prom:not(.ga-triggered)",function(){$(this).each(function(){if(!$(this).is(":visible")){return}var t=new IntersectionObserver(function(e){if(e[0].isIntersecting===true){const i=e[0].target;$(document).trigger("checkout.promo_view",{id:$(i).data("id"),creative_id:$(i).data("creative-id"),position:$(i).data("position")});t.disconnect()}},{threshold:[1]});t.observe(this);
1$(this).find("a").off("click").on("click",function(t){var e=$(this).parents(".prom").first();var i={id:e.data("id"),creative_id:e.data("creative-id"),position:e.data("position")};if(shouldDelayGAPromotionClickNavigation(t,this)){delayGAPromotionClickNavigation(t,this,i);return}$(document).trigger("checkout.promo_click",i)});$(this).addClass("ga-triggered")})});if(typeof window.product!="undefined"){$(document).trigger("checkout.view_item",{product:window.product,id:window.product_id,name:window.product_name,price:window.product_price,currency:window.product_currency})}$(".prom").trigger("pageview")};function sendGAPromotionClick(t){var e={promotion_id:t.id,promotion_name:t.id,creative_name:t.creative_id,creative_slot:t.position,items:[{item_id:t.id,item_name:t.id}]};if(typeof t.event_callback==="function"){e.event_callback=t.event_callback;e.event_timeout=t.event_timeout}_gtag("event","select_promotion",e)}function shouldDelayGAPromotionClickNavigation(t,e){if(t.isDefaultPrevented()||t.which>1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||typeof window.gtag!=="function"){return false}var i=e.getAttribute("target");if(i&&i.toLowerCase()!=="_self"){return false}if(e.hasAttribute("download")){return false}var s=e.getAttribute("href");if(!s){return false}var a=s.trim();if(!a||a.charAt(0)==="#"){return false}var r=a.toLowerCase();if(r.indexOf("javascript:")===0||r.indexOf("mailto:")===0||r.indexOf("tel:")===0){return false}var o=new URL(e.href,window.location.href);return!(o.hash&&o.origin===window.location.origin&&o.pathname===window.location.pathname&&o.search===window.location.search)}function delayGAPromotionClickNavigation(t,e,i){var s=500;var a=false;var r=false;var o=function(t){if(a){return}a=true;console.log("GA promo click: resuming navigation after "+t,{id:i.id,href:e.href});window.location.href=e.href};t.preventDefault();console.log("GA promo click: delaying navigation",{id:i.id,href:e.href,timeout:s});var n=window.setTimeout(function(){o(r?"event_callback delay":"timeout")},s);i.event_callback=function(){r=true;console.log("GA promo click: event_callback received, keeping navigation delayed",{id:i.id,href:e.href})};i.event_timeout=s;$(document).trigger("checkout.promo_click",i)}var loadedForm=null;var doCheckout=function(){if(loadedForm||$("#checkout").length){var t=false;var e=function(){if(!$("#checkout").length){$("body").append('<div class="bootstrap" style="display: contents">'+loadedForm+"</div>")}checkout.init();if(window.innerWidth<1200){$(".fa.fa-question-circle.billing-help").attr("data-placement","left")}if(window.innerWidth<544){$("#card_cvc").attr("data-placement","bottom")}$('[data-toggle="tooltip"]').tooltip();if($(".modal-backdrop-checkout").length){$(".modal-backdrop-checkout").remove();$("#checkout").modal()}$("#checkout").on("hidden.bs.modal",function(){checkout.close()});t=true};var i=function(i){if(!t){e()}var s=i!==undefined&&i!==false;if(!s){sendPageView()}if($(this).is("[data-purchase-type]")){var a=$(this).data("purchase-type");checkout.storage.setItem("type",a);checkout.allSteps.purchase_type.initFields()}if($(this).data("clear-cart")){var r=checkout.storage.getItem("cart",{});for(var o in r){checkout.removeItemFromCart(o)}}checkout.start(false);if(i)i.preventDefault()};var s=function(i){if(!t){e()}if($(this).is("[data-purchase-type]")){var s=$(this).data("purchase-type");checkout.storage.setItem("type",s);checkout.allSteps.purchase_type.initFields()}var a=$(this).data("products");if(a){checkout.setCartItems(a);checkout.start()}else{var r=$(this).data("product");if(typeof r==="undefined"){r=checkout.storage.getItem("product")}checkout.start(typeof r!=="undefined",r)}if(i)i.preventDefault()};try{if($("body").hasClass("open-checkout")||window.location.hash.match(/#checkout/)){i.call(document.body)}if($("body").hasClass("do-checkout")||window.location.hash.match(/#buy-now/)){s.call(document.body)}}catch(t){console.error(t)}$("body").on("click",".open-checkout",i);$("body").on("click",".do-checkout",s);$(".open-checkout,.do-checkout").addClass("checkout-listening")}else{var a=function(t){if(loadedForm)return;if(!t){console.error("Checkout form can not be loaded.");return}loadedForm=t;doCheckout()};var r=function(){$.ajax({url:(window.localized_url_prefix_m||"/")+"ajax/checkout-form.js",crossDomain:true,dataType:"html",xhrFields:{withCredentials:true},timeout:CHECKOUT_AJAX_TIMEOUT}).done(a)};if(window.loader){window.loader.request("ajax/checkout-form.js").then(a).catch(r)}else{r()}}};var successFunc=function(t){$(document).trigger("cart",t);console.log("Cart received.");
1if(t){window.defaults=window.defaults||{};window.defaults.tco_api_version=t.tco_api_version||"6";console.log("TCOAPI"+t.tco_api_version);window.defaults=window.defaults||{};window.defaults.currency=t.currency;window.defaults.cart=t.items;window.defaults.subtotals=t.totals;window.defaults.subtotals_display=t.totals_display;window.ip_country=t.ip_country;window.ip_city=t.ip_city;window.ip_state=t.ip_state;window.ip_postal_code=t.ip_postal_code;if(Object.keys(t.items).length){$(".cart-block-container .cart-text").html(t.caption);$(".cart-block-container .cart-total").html("("+t.totals_display[t.currency]+")");$(".cart-block-container .btn-text-span").html(t.checkout_text);$(document).trigger("cart-block.show");$(".cart-block-container").fadeIn(checkout.revealAnimationSpeed);for(var e in t.items){if(t.items.hasOwnProperty(e)){var i=t.items[e];if(window.defaults&&window.defaults.upsell&&window.defaults.upsell[i.sku]){delete window.defaults.upsell[i.sku]}}}}console.log("Cart defaults updated.")}document.dispatchEvent(new Event("cartLoaded"));doCheckout()};var normalRequest=function(){$.ajax({url:(window.localized_url_prefix_m||"/")+"ajax/cart?q="+(new Date).getTime(),crossDomain:true,dataType:"json",xhrFields:{withCredentials:true},timeout:CHECKOUT_AJAX_TIMEOUT}).done(successFunc)};function checkout_trans_choice(t,e,i){e=e===undefined?1:e;i=i===undefined?{}:i;let s=t.split("|");s=s.length>1&&e>1?s[1]:s[0];for(var a in i){s=s.replace(":"+a,i[a])}return s}if(window.loadCart){console.log("Cart loading request sent.");if(window.loader){window.loader.request("ajax/cart").then(successFunc).catch(normalRequest)}else{normalRequest()}}else if(window.checkoutFormLoaded){$(doCheckout)}window.onPageLoad=window.onPageLoad||[];window.onPageLoad.push({func:function(){bindGAPromotionsListeners()},afterAll:true});var originalTitle="";var changeHash=function(t,e){if(!checkout.rendered){return}if(!originalTitle){originalTitle=document.title}var i=originalTitle+(e?" / "+e:"");history.pushState("",i,window.location.pathname+window.location.search+(t?"#"+t:""));document.title=i;sendPageView()};$(window).on("popstate",function(t){var e={"#checkout/login":"login","#checkout/purchase_type":"purchase_type","#checkout/customer_details":"customer_details","#checkout/paysystems":"paysystems","#checkout/card_details":"card_details","#checkout/ideal":"ideal","#checkout/uah_confirmation":"uah_confirmation"};if(!window.location.hash.match(/#checkout/)){return}var i=window.location.hash;var s=e[i];if(i===""){checkout.temporaryChangeHash=false;$("#checkout").modal("hide");return}if(!checkout.open||!s){checkout.start(false,null,true);return}if(checkout.isStepBeforeCurrent(s)||checkout.isStepAfterCurrent(s)&&checkout.getCurrentStep().isReady()){checkout.changeStepTo(s,true)}});
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.