PageSourceSearch

https://www.gasenginemagazine.com/wp-content/plugins/opi-storefront/js/storefront.min.js

js gasenginemagazine.com collected 2026-10-02 03:01:53 UTC 14,381 bytes, 1 lines download raw bytes

1$(document).ready((function () { var t, e = Cookies.get("opi_membership_pubcode") ? Cookies.get("opi_membership_pubcode").toLowerCase() : "", a = Cookies.get("opi_" + e + "_subscription_all_access") ?? "false", r = Cookies.get("opi_" + e + "_subscription_gate_access") ?? "false"; function o() { var e = JSON.parse(localStorage.getItem("opi_cart")) ?? [], a = [], r = 0, o = 0, s = 0, i = 0, n = !1; e.length > 0 ? e.forEach((function (e) { var c = e.product_price.replace("$", ""); if (t) var p = e.product_membership_price.replace("$", ""); a.push('<li data-product-variant-id="' + e.product_variant + '" class="flex items-center justify-between py-4 transition duration-300 ease-in-out"><div class="flex items-start"><div class="flex items-start justify-center flex-shrink-0"><img src="' + e.product_image + '" alt="' + e.product_title + '" class="w-16 object-cover rounded shrink-0" /></div><div class="ml-4"><h3 class="text-sm font-medium">' + e.product_title + '</h3><div class="text-sm text-gray-500">' + (e.product_variant_name ?? "") + '</div><div class="text-sm text-gray-800">' + (1 == e.product_is_clearance && "0.00" != e.product_markup_price ? '<div class="flex gap-2"><span class="line-through" style="text-decoration-color: red;">$' + (e.product_quantity * e.product_markup_price).toFixed(2) + '</span><span class="font-semibold">$' + (e.product_quantity * c).toFixed(2) + "</span></div>" : t ? '<div class="flex gap-2"><span class="line-through" style="text-decoration-color: red;">$' + (e.product_quantity * c).toFixed(2) + '</span><span class="font-semibold">$' + (e.product_quantity * p).toFixed(2) + '</span></div><span class="text-xs">You\'re saving $' + ((parseFloat(c) - parseFloat(p)) * parseInt(e.product_quantity)).toFixed(2) + " (" + ((parseFloat(c) - parseFloat(p)) / parseFloat(c) * 100).toFixed(0) + "%) by being a member!</span>" : '<span class="">$' + (e.product_quantity * c).toFixed(2) + "</span>") + '</div><div class="flex items-center my-1"><button type="button" class="cart_quantity_decrease_btn bg-gray-50 hover:bg-gray-200 py-1 px-4 rounded-l-lg text-sm text-gray-500 hover:text-gray-800">-</button><div class="text-sm text-gray-800 py-1 px-4 bg-gray-50">' + e.product_quantity + '</div><button type="button" class="cart_quantity_increase_btn bg-gray-50 hover:bg-gray-200 py-1 px-4 rounded-r-lg text-sm text-gray-500 hover:text-gray-800">+</button></div><div class="text-sm text-gray-600"><button type="button" data-variant-id="' + e.product_variant + '" class="remove_from_cart_btn text-red-600 hover:text-red-700">Remove</button></div></div></div></li>'), n = 1 == e.product_is_clearance && "0.00" != e.product_markup_price, "0.00" != e.product_membership_price, i += n ? parseFloat(e.product_markup_price) * parseInt(e.product_quantity) : parseFloat(c) * parseInt(e.product_quantity), r += parseFloat(c) * parseInt(e.product_quantity), o += parseFloat(p) * parseInt(e.product_quantity), s += 1 == e.product_is_clearance && "0.00" != e.product_markup_price ? parseFloat(e.product_markup_price) * parseInt(e.product_quantity) - parseFloat(c) * parseInt(e.product_quantity) : t ? parseFloat(c) * parseInt(e.product_quantity) - parseFloat(p) * parseInt(e.product_quantity) : parseFloat(c) * parseInt(e.product_quantity), parseInt(e.product_quantity) })) : a.push('<li class="flex flex-col items-center justify-center my-32"><svg class="w-24 h-24 text-gray-300" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z" /></svg><span class="text-base text-center font-medium text-gray-500">Cart is empty</span></li>'), t ? ($("#cart_total_price").text("$" + (n ? i.toFixed(2) : r.toFixed(2))), $("#cart_membership_subtotal").text("$" + o.toFixed(2)), $("#cart_total_savings").text("$" + s.toFixed(2))) : ($("#cart_total_price").text("$" + r.toFixed(2)), $("#cart_membership_subtotal").text("$" + r.toFixed(2)), $("#cart_total_savings").text("$" + s.toFixed(2))), $("#cart_slideover_product_list").html(a), function () { var t = JSON.parse(localStorage.getItem("opi_cart")) ?? []; t.length > 0 ? $("#checkout_link").prop("disabled", !1) : $("#checkout_link").prop("disabled", !0) }() } function s() { var t = JSON.parse(localStorage.getItem("opi_cart")) ?? [], e = 0; $.each(t, (function (t, a) { e += parseInt(a.product_quantity) })), $(".opiCartCount").text(e) } t = 1 == sso_installed && ("false" != a || "false" != r), 1 == sso_installed ? t && ($(".opi_display_membership_pricing").each((function () { var t = $(this).data("price"), e = $(this).data("membership-price"), a = $(this).data("percent-saved"); $(this).empty(), parseFloat(t) !== parseFloat(e) ? $(this).append('<span class="text-left text-sm text-gray-700">List Price: <strong class="product_price update_price_on_change line-through" style="text-decoration-color: red;">$' + t + '</strong></span><span class="text-left text-sm text-gray-500">You save: $' + (parseFloat(t) - parseFloat(e)).toFixed(2) + " (" + a + '%)</span><span class="text-left w-full flex items-center justify-left gap-1"><span class="text-sm font-normal text-gray-700">
1Member Price: </span><span class="text-lg font-semibold text-gray-800 product_membership_price">$' + e + '</span></span><span class="text-left text-xs text-gray-500">You\'re saving an extra ' + a + "% by being a member!</span>") : $(this).append('<span class="text-left text-lg text-gray-700 font-normal product_price update_price_on_change">$' + t + "</span>") })), $(".cart_savings").removeClass("hidden").addClass("flex"), $(".cart_total_price").removeClass("font-semibold").addClass("font-normal"), $(".cart_total_price").removeClass("text-gray-900").addClass("text-gray-500"), $("#cart_total_price").addClass("line-through").css("text-decoration-color", "red"), $(".cart_membership_subtotal").removeClass("hidden").addClass("flex")) : $(".opi_display_membership_pricing").each((function () { var t = $(this).data("price"); $(this).empty(), $(this).append('<span class="text-left text-lg text-gray-700 font-normal product_price update_price_on_change product_price update_price_on_change">$' + t + "</span>") })), $(".opi_modal").click((function () { var e = $(this).attr("data-opishop-title"), a = $(this).attr("data-opishop-image"), r = $(this).attr("data-opishop-price"), o = $(this).attr("data-markup-price"), s = $(this).attr("data-is-clearance"), i = $(this).attr("data-opishop-membership-price"), n = $(this).attr("data-opishop-description"), c = ($(this).attr("data-opishop-link"), $(this).attr("data-opishop-addtocart")), p = '<div class="opi_modal_wrap relative z-50" aria-labelledby="modal-title" role="dialog" aria-modal="true"><div class="fixed inset-0 bg-black/75 transition-opacity backdrop-blur-sm"></div><div class="fixed inset-0 z-50 overflow-y-auto"><div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"><div class="relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-3xl sm:p-6"><div class="mb-4 sm:hidden"><img src="' + $(this).attr("data-opishop-store-logo") + '" class="w-36 md:w-52" /></div><div class="absolute top-0 right-0 hidden pt-4 pr-4 sm:block"><button type="button" class="close_opi_modal rounded-lg bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2"><span class="sr-only">Close</span><svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" /></svg></button></div><div class="sm:flex sm:items-start"><div class="grid grid-cols-1 md:grid-cols-3 gap-6"><div class="col-span-1"><img class="w-full shrink-0 rounded" src="' + a + '" alt="' + e + '" /></div><div class="col-span-1 md:col-span-2"><h3 class="text-2xl font-semibold leading-tight">' + e + "</h3>" + (1 == s ? '<div class="flex gap-2"><div class="text-xl text-gray-500 modal_price line-through" style="text-decoration-color: red;">$' + o + '</div><div><span class="text-lg font-semibold text-gray-800 product_price update_price_on_change">$' + r + "</span></div></div>" : 1 == sso_installed && t && parseFloat(r) !== parseFloat(i) ? '<div class="flex gap-2"><div class="text-xl text-gray-500 product_price modal_price update_price_on_change line-through" style="text-decoration-color: red;">$' + r + '</div><div><span class="text-sm font-normal text-gray-700">Member Price: </span><span class="text-lg font-semibold text-gray-800 product_membership_price">$' + i + '</span></div></div><span class="text-sm text-gray-500">You\'re saving an extra <strong>' + ((parseFloat(r) - parseFloat(i)) / parseFloat(r) * 100).toFixed(0) + "%</strong> ($" + (parseFloat(r) - parseFloat(i)).toFixed(2) + ") by being a member!</span>" : '<div class="text-xl text-gray-600 product_price modal_price update_price_on_change">$' + r + "</div>") + '<div class="mt-2 text-gray-800 max-h-96 overflow-y-scroll prose prose-base">' + n + '</div></div></div></div><div class="mt-5 sm:mt-4 sm:flex sm:flex-row-reverse sm:space-x-4 sm:space-x-reverse">' + c + '<button type="button" class="close_opi_modal mt-2 h-full inline-flex w-full items-center justify-center rounded-lg border border-gray-300 bg-white hover:bg-gray-50 px-4 py-2 text-base font-medium text-gray-700 shadow-sm hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 sm:mt-0 sm:w-auto">Close</button></div></div></div></div></div>'; $("body").append(p) })), $(document).on("click", ".close_opi_modal", (function (t) { $(".opi_modal_wrap").fadeOut(300, (function () { $(this).remove() })) })).on("keyup", (function (t) { 27 === t.keyCode && $(".opi_modal_wrap").fadeOut(300, (function () { $(this).remove() })) })), $(document).on("click", ".add_to_cart_btn", (function (t) { t.preventDefault(); var e = $(this).closest("form"), a = e.find('input[name="product_variant"]').val() ?? e.find('select[name="product_variant"]').val(); if (2 == a.split("^").length) var r = a.split("^")[1], i = a.split("^")[0]; else r = a, i = ""; var n = { product_id: e.find('input[name="product_id"]').val(), product_variant: r, product_variant_name: i, product_title: e.find('input[name="product_title"]').val(), product_image: e.find('input[name="product_image"]').val(), product_price: e.find('input[name="variant_prices[' + r + ']"]').val(), product_markup_price: e.find('input[name="product_markup_price"]').val(), product_is_clearance: e.find('input[name="product_is_clearance"]').val(), product_membership_price: e.find('input[name="product_membership_price"]').val(), product_quantity: e.find('input[name="product_quantity"]').val(), store_domain: e.find('input[name="store_domain"]').val() }; if ("" == n.product_variant || null == n.product_variant || null == n.product_variant) alert("Please select an option"); else { $(".opi_modal_wrap").remove(); for (var c = JSON.parse(localStorage.getItem("opi_cart")) ?? [], p = !1, l = 0; l < c.length; l++)if (c[l].product_id == n.product_id && c[l].product_variant == n.product_variant) { p = !0, c[l].product_quantity = parseInt(c[l].product_quantity) + parseInt(n.product_quantity); break } p || c.push(n), localStorage.setItem("opi_cart", JSON.stringify(c)), o(), s(), $("#cart_slideover").removeClass("hidden") } }
1)), $(document).on("change", 'select[name="product_variant"]', (function () { var t = $(this).closest("form"); if ("" == $(this).val() || null == $(this).val() || null == $(this).val()) t.find('button[type="submit"].add_to_cart_btn').prop("disabled", !0); else { t.find('button[type="submit"].add_to_cart_btn').prop("disabled", !1); var e = $(this).val().split("^")[1], a = t.find('input[name="variant_prices[' + e + ']"]').val(); t.find(".product_price.update_price_on_change").text("$" + a), $(".modal_price.update_price_on_change").text("$" + a) } })), $(document).on("click", ".cart_toggle", (function (t) { t.preventDefault(), $("#cart_slideover").toggleClass("hidden") })).on("keyup", (function (t) { 27 === t.keyCode && $("#cart_slideover").addClass("hidden") })), o(), $(document).on("click", ".cart_quantity_decrease_btn", (function () { var t = JSON.parse(localStorage.getItem("opi_cart")) ?? [], e = $(this).closest("li").data("product-variant-id"), a = $(this).next().text(), r = parseInt(a) - 1; r > 0 && ($.each(t, (function (t, a) { a.product_variant == e && (a.product_quantity = r) })), localStorage.setItem("opi_cart", JSON.stringify(t)), o()) })), $(document).on("click", ".cart_quantity_increase_btn", (function () { var t = JSON.parse(localStorage.getItem("opi_cart")) ?? [], e = $(this).closest("li").data("product-variant-id"), a = $(this).prev().text(), r = parseInt(a) + 1; $.each(t, (function (t, a) { a.product_variant == e && (a.product_quantity = r) })), localStorage.setItem("opi_cart", JSON.stringify(t)), o() })), $(document).on("click", ".remove_from_cart_btn", (function (t) { t.preventDefault(); var e = $(this).data("variant-id"), a = JSON.parse(localStorage.getItem("opi_cart")) ?? [], r = []; $.each(a, (function (t, a) { a.product_variant != e && r.push(a) })), localStorage.setItem("opi_cart", JSON.stringify(r)), o(), s() })), $(document).on("click", "#checkout_link", (function (t) { t.preventDefault(); var e = JSON.parse(localStorage.getItem("opi_cart")) ?? [], a = $(this).data("myshopifylink"); console.log(a); var r = [], o = Cookies.get("opi_user") ? JSON.parse(Cookies.get("opi_user")) : []; if (Cookies.get("opi_user")) { o && o.addresses; r.push("checkout[email]=" + encodeURIComponent(o.email)), r.push("checkout[shipping_address][first_name]=" + encodeURIComponent(o.first_name)), r.push("checkout[shipping_address][last_name]=" + encodeURIComponent(o.last_name)) } var s = "https://" + a + "/cart"; $.each(e, (function (t, e) { 0 == t && (s += "/" + e.product_variant + ":" + e.product_quantity), t > 0 && (s += "," + e.product_variant + ":" + e.product_quantity) })), r && (s += "?" + r.join("&")), window.open(s, "_blank") })), s(), $(document).on("click", "#clear_cart", (function (t) { t.preventDefault(), localStorage.removeItem("opi_cart"), o(), s() })) }));

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.