').append(this.options.spinnerHtml), this.$body.append(this.spinner), this.spinner.show()) }, hideSpinner: function () { this.spinner && this.spinner.remove() }, _ctx: function () { return { elm: this.$elm, $blocker: this.$blocker, options: this.options } } }, dpQuery.dpModal.close = function (t) { if (dpQuery.dpModal.isActive()) { t && t.preventDefault(); var e = getCurrent(); return e.close(), e.$elm } }, dpQuery.dpModal.isActive = function () { return dpModals.length > 0 }, dpQuery.dpModal.defaults = { closeExisting: !0, escapeClose: 0, clickClose: 0, closeText: "Close", closeClass: "", dpModalClass: "dp-popup-dpModal", spinnerHtml: null, showSpinner: !0, showClose: !0, fadeDuration: null, fadeDelay: 1 }, dpQuery.dpModal.BEFORE_BLOCK = "dpModal:before-block", dpQuery.dpModal.BLOCK = "dpModal:block", dpQuery.dpModal.BEFORE_OPEN = "dpModal:before-open", dpQuery.dpModal.OPEN = "dpModal:open", dpQuery.dpModal.BEFORE_CLOSE = "dpModal:before-close", dpQuery.dpModal.CLOSE = "dpModal:close", dpQuery.dpModal.AFTER_CLOSE = "dpModal:after-close", dpQuery.dpModal.AJAX_SEND = "dpModal:ajax:send", dpQuery.dpModal.AJAX_SUCCESS = "dpModal:ajax:success", dpQuery.dpModal.AJAX_FAIL = "dpModal:ajax:fail", dpQuery.dpModal.AJAX_COMPLETE = "dpModal:ajax:complete", dpQuery.fn.dpModal = function (t) { return 1 === this.length && new dpQuery.dpModal(this, t), this }, dpQuery(document).on("click.dpModal", 'a[rel="dpModal:close"]', dpQuery.dpModal.close), dpQuery(document).on("click.dpModal", 'a[rel="dpModal:open"]', function (t) { t.preventDefault(), dpQuery(this).dpModal() }), $("span.Bold-theme-hook-DO-NOT-DELETE.bold_cart_total").remove(), $("span#bk-cart-subtotal-price").attr("id", ""); var boosterCookieCode = getCookie("appikon_discount_" + window.appikon.cart.token); boosterCookieCode && (window.appikon.discount_code = boosterCookieCode); var currentFunnel = null, mainFunnel = null, firstFunnel = !0, funnelRefusedTimes = 0, funnelRefusedLimit = window.appikonDiscount.settings.buyx.funnel_refuse_limit, funnelProductAdded = !1, upsellItemAdded = !1, allFunnelProducts = null, funnelProductStock = null; if ($(document).on("click", "#dpModal-container a.close-dpModal, .no-thanks a", function () { var t = $(this); if (hasFlag("enable_funnels")) if (funnelPresent(!1)) { if (!t.parents("#dpModal-container").hasClass("is_funnel_true")) hideUpsell(t.data("offer-id")); showFunnel(currentFunnel, !1) } else onNoThanksClick(t); else onNoThanksClick(t); return !1 }), hasFlag("disable_checkout_button")) var disabledCheckout = !1, checkoutBtn = $(window.appikonDiscount.settings.global.appikonCheckoutSelector), originalCheckoutContent = checkoutBtn.val() || checkoutBtn.html(), originalBorder = checkoutBtn.css("border-color"), originalBackground = checkoutBtn.css("background-color"), enableCheckoutButton = function () { checkoutBtn.html(originalCheckoutContent).val(originalCheckoutContent).removeAttr("disabled").removeAttr("border-color").removeAttr("background-color") }; if ("cart" == window.appikon.adp_page) { var skipIds = getCookie("adp-skip-ids"); skipIds && (window.appikon.skip_ids = skipIds) } var previewOfferToken = localStorage.getItem("bd_first_test_offer_token"); window.appikon.adp_test_offer_token = previewOfferToken || getUrlParam("adp_test_offer_token"); window.appikon.adp_test_offer_token && (window.adp_preview_mode = true); window.appikonMet && 1 !== window.adp_preview_mode && "1" !== window.appikonMet.isAdmin && (window.adp_can_apply = true); window.appikon.adp_can_post = !0; window.appikon.multicurrency = {}; if (window.theme && window.Shopify && window.Shopify.currency) { window.appikon.multicurrency.moneyFormat = window.theme.moneyFormat; window.appikon.multicurrency.currency = window.Shopify.currency.active; window.appikon.multicurrency.rate = window.Shopify.currency.rate; } window.appikon.adp_page.length > 0 && window.appikon.adp_can_post && (notifyCalculationsInProgress(), $.ajax({ cache: !1, type: "POST", url: window.appikonDiscount.settings.app_root_url, data: JSON.stringify(window.appikon), dataType: "json", contentType: "application/json; charset=utf-8", success: function (t) { if (hasFlag("notify_about_disocunt_calculations")) { try { appikonDelegate(t) } catch (e) { console.log(e) } hideCalculationsInProgressNote() } else appikonDelegate(t) } })), setTimeout(function () { "function" == typeof ga && ga(function (t) { window.gaclientId = t.get("clientId") }) }, 1e3), hasFlag("refresh_on_qty_plush_minus") && ($(document).on("click", window.appikonDiscount.settings.plus_minus_qty_selector, function () { var t = this; "cart" == window.appikon.adp_page && setTimeout(function () { $(t).parents('form[action*="/cart"]').submit() }, 500) }), hasFlag("refresh_on_qty_change_hard") && (window.appikon.cartSubmit = function () { "cart" == window.appikon.adp_page && setTimeout(function () { $('form[action*="/cart"]').submit() }, 500) }, $(document).ready(function () { setTimeout(function () { var t, e = document.querySelectorAll(window.appikonDiscount.settings.plus_minus_qty_selector); for (t = 0; t < e.length; t++) e[t].setAttribute("onclick", "window.appikon.cartSubmit();") }, 1200) }))); var debutEditBtnExists = $("div.cart__edit button.btn.cart__edit--active:visible").length > 0, qtyInputEvent = debutEditBtnExists ? "" : "input "; if ($(document).on(qtyInputEvent + "change", "input.appikon-quantity, input[name^='updates['], input[id^='updates_'], input[id^='Updates_']", function (t) { var e = this; t.preventDefault(), "" != $.trim($(this).val()) && (notifyCalculationsInProgress(), setTimeout(function () { hasFlag("quantities_refresh_over_submit") ? window.location.reload() : $(e).parents('form[action*="/cart"]').submit() }, getRefreshDelayValue())) }), "cart" == window.appikon.adp_page && ($(document).on("click", "td.cart-qty span.icon-plus, td.cart-qty span.icon-minus", function (t) { t.preventDefault(), $(this).parents('form[action*="/cart"]').submit() }), $(document).ajaxSuccess(function (t, e, n) { n && "/cart/change.js" == n.url && window.location.reload() }), 1 != hasFlag("avoid_default_qty_input_event_change") && (setTimeout(function () { $(".js-qty__adjust").off("click") }, 500), $(document).on("click", "div.js-qty .js-qty__adjust", function (t) { t.preventDefault(); var e = parseInt($(this).parents("div.js-qty").find("input").val()); if ($(this).hasClass("js-qty__adjust--plus")) var n = e + 1; else n = e - 1; $(this).parents("div.js-qty").find("input").val(n).change() }))), $(document).on("change", "select.adp-variants", function () { var t = $(this).find(":selected"), e = appikonDisplayCents(t.data("price")), n = t.parents(".adp-product-wrapper"), o = t.data("img"); if (hasFlag("discounted_price_for_bundles") && window.appikonDiscount.settings.bundle.bundles_with_discounted_price) { var i = t.data("disPrice"), a = ""; a = "" != i ? "" + e + "" + i + "" : "" + e + "", n.find("div.adp-price p.show-prices").html(a) } else n.find(".adp-price span.adp-sale").html(e); return n.data("variant-id", t.val()), n.find("img").attr("src", o), reloadCurrency(), !1 }), $(document).on("change", "#dpModal-container select.adp-variants", function () { var t = $(this).find(":selected"), e = t.parents(".adp-product-bundle"), n = t.parents(".product-container"), o = e.data("discount-method"), i = e.data("discount-value"), a = e.data("discount-applies"), r = t.data("compare-at-price"), s = appikonDiscountedPrice(t.data("price"), a, o, i), c = t.data("img"); return n.data("variant-id", t.val()), hasFlag("no_discount_compare_at_price") ? n.find("span.adp-sale").html(upsellDisplayPrice(o, s, r)) : n.find("span.adp-sale").html(s), n.find("img").attr("src", c), reloadCurrency(), !1 }), $(document).on("click", ".add-appikon-bundle", function (t) { t.preventDefault(), addAppikonBundle(t) }), $(document).on("click", ".add-upsells", function (t) { t.preventDefault(), hasFlag("enable_funnels") ? addFunnelAppikonUpsells(t.target) : addAppikonUpsells(t.target); $(this).data("offerId") }), hasFlag("upsell_popup_open_qty") && $(document).on("input", "input#upsell_popup_qty", function () { $(".product-container").attr("data-quantity", $(this).val()) }), $(document).on("click", "button#apply-appikon-discount", function (t) { t.preventDefault(), setCookie("appikon_discount_" + window.appikon.cart.token, $("input[id=appikon-discount-code]:visible").val().trim()), window.location.reload() }), $(document).on("click", "div#appikon-close-notification", function (t) { t.preventDefault(), setCookie("appikon_notifications_closed", 1, .01), $("#appikon-notification-bar").slideUp("slow") }), $(document).on("click", ".appikon-variants-container select.adp-variants", function () { $(this).children("option").length < 1 && alert("All item variants are out of stock") }), hasFlag("use_google_fonts")) { function insertGoogleFontStyle(t) { var e = document.head, n = document.createElement("link"); n.id = "adp_google_fonts_link", n.type = "text/css", n.rel = "stylesheet", n.href = "https://fonts.googleapis.com/css?family=" + t.join(","), e.appendChild(n) } } }) }(window, document);