Free javascript Hosting


hulkjs2.js

Uploaded on Apr 25 2022 07:34 by natebalewa

function start() {
var checkout_selectors = "input[name='checkout']:not(.hulkapps-ignore), input[value='Checkout']:not(.hulkapps-ignore), button[name='checkout']:not(.hulkapps-ignore), [href$='checkout']:not(.hulkapps-ignore), button[value='Checkout']:not(.hulkapps-ignore), input[name='goto_pp'], button[name='goto_pp'], input[name='goto_gc'], button[name='goto_gc'],.hulkapps_checkout";
window.loadScript = function (t, i) {
var e = document.createElement("script");
e.type = "text/javascript", e.readyState ? e.onreadystatechange = function () {
"loaded" != e.readyState && "complete" != e.readyState || (e.onreadystatechange = null, i())
} : e.onload = function () {
i()
}, e.src = t, document.getElementsByTagName("head")[0].appendChild(e)
}, window.checkAppInstalled = function (t) {
window.hulkapps.is_product_option = !0, loadScript(window.hulkapps.po_url + "/intl-tel-input.js", function () {
commonJS(t), cartPageJS(t), productPageJS(t)
})
}, window.commonJS = function (t) {
window.hulkappsDoActions = function (i) {
i.discounts.discount_show && t(".discount_code_box").css("display", "block"), i.discounts.plan && t(".edit_cart_option").css("display", "block"), "object" == typeof i.discounts && "object" == typeof i.discounts.cart && "object" == typeof i.discounts.cart.items && hulkappsShowCartDiscounts(i.discounts), i.discounts.is_draft_order && t(document).on("click", checkout_selectors, function (t) {
if (t.preventDefault(), "function" != typeof hulkappsCheckout && (window.location = "/checkout"), "undefined" == typeof hulkappsCheckoutClick) hulkappsCheckout();
else {
var i = hulkappsCheckoutClick();
1 == i ? hulkappsCheckout() : 0 != i && hulkappsCheckout()
}
})
}, window.hulkappsShowCartDiscounts = function (i) {
window.hulkapps.discounts = i, i.cart.items.forEach(function (i) {
t(".hulkapps-cart-item-price[data-key='" + i.key + "']").html("<span class='original_price'>" + i.original_price_format + "</span>"), t(".hulkapps-cart-item-line-price[data-key='" + i.key + "']").html("<span class='original_price'>" + i.original_line_price_format + "</span>")
}), i.discount_code && 1 == i.discount_error ? (t(".hulkapps-cart-original-total").html(i.original_price_total), jQuery(".hulkapps_summary").remove(), t(".hulkapps_discount_hide").after("<span class='hulkapps_summary'>Discount code does not match</span>"), localStorage.removeItem("discount_code")) : i.is_free_shipping ? (jQuery(".hulkapps_summary").remove(), jQuery(".hulkapps_discount_hide").after("<span class='hulkapps-summary-line-discount-code'><span class='discount-tag'>" + i.discount_code + "<span class='close-tag'></span></span>Free Shipping")) : i.discount_code && t(".discount_code_box").is(":visible") ? (jQuery(".hulkapps-summary-line-discount-code,.after_discount_price").remove(), jQuery(".hulkapps_discount_hide").after("<span class='hulkapps-summary-line-discount-code'><span class='discount-tag'>" + i.discount_code + "<span class='close-tag'></span></span><span class='hulkapps_with_discount'> -" + i.with_discount + "</span></span><span class='after_discount_price'><span class='final-total'>Total</span>" + i.final_with_discounted_price + "</span>"), jQuery(".hulkapps-cart-original-total").html(i.original_price_total), i.original_price_total != i.final_with_discounted_price && t(".hulkapps-cart-original-total").css("text-decoration", "line-through"), t(".hulkapps-cart-total").remove()) : t(".hulkapps-cart-original-total").html(i.original_price_total)
}, window.hulkappsCheckout = function () {
// showDiscount()
var i = localStorage.getItem("discount_code");
t.getJSON("/cart.js", function (e) {
window.hulkapps.cart = e, t.ajax({
type: "POST",
url: window.hulkapps.po_url + "/store/create_draft_order",
data: {
cart_json: window.hulkapps,
store_id: window.hulkapps.store_id,
discount_code: i,
cart_collections: JSON.stringify(window.hulkapps.cart_collections)
},
crossDomain: !0,
success: function (t) {
window.location.href = "string" == typeof t ? t : "/checkout", localStorage.removeItem("discount_code")
}
})
})
}, window.hulkappsStart = function (t) {

window.hulkappsc = {}, window.hulkappsc.$first_add_to_cart_el = null;
var i = 0;
if (["input[name='add']", "button[name='add']", "#add-to-cart", "#AddToCartText", "#AddToCart"].forEach(function (e) {
i += t(e).length, null == window.hulkappsc.$first_add_to_cart_el && i && (window.hulkappsc.$first_add_to_cart_el = t(e).first())
}), "product" == window.hulkapps.page_type && null != window.hulkappsc.$first_add_to_cart_el) {
var e = window.hulkappsc.$first_add_to_cart_el;
e.parent().is("div") && (e = e.parent()), 0 == t("#hulkapps_custom_options_" + window.hulkapps.product_id).length && e.before('<div id="hulkapps_custom_options_' + window.hulkapps.product_id + '"></div>')
}
if ("product" == window.hulkapps.page_type && t.ajax({
type: "GET",
url: window.hulkapps.po_url + "/api/v2/store/get_all_relationships",
data: {
pid: window.hulkapps.product_id,
store_id: window.hulkapps.store_id
},
sync: !1,
crossDomain: !0,
success: function (i) {
"string" != t.type(i) && setTimeout(function () {
var e = "";
null != i.condition && (e += "<div id='conditional_rules' style='display:none'>", t.each(i.condition, function (a, o) {
var n = o.id,
l = jQuery.parseJSON(o.conditions);
if ("OR" == l.apply_rule) var s = "0";
else s = "1";
e = e + "<div id='conditional_logic_" + n + "' name='conditional_logic_" + n + "' data-verify-all='" + s + "' style='display:none'>", t.each(l.rules, function (t, a) {
var o = parseInt(a.option);
if (i.option_id_array.indexOf(o) >= 0) {
if (1 == parseInt(a.rule_type)) var l = "==";
else l = "!=";
e = e + "<div name='conditional_logic_" + n + "' data-field-num='" + o + "' data-verify-all='" + s + "' class='step_1'>**value11**" + l + a.option_val + "</div>"
}
}), e += "</div>", t.each(l.actions, function (t, e) {
var a = parseInt(e.option);
if (i.option_id_array.indexOf(a) >= 0) {
if (1 == parseInt(e.action_type)) var o = "show";
else o = "hide";
var l = "condition_" + o + " conditional_logic_" + n + "_" + o + " conditional";
i.hide_show_array[a] = l
}
})
}), e += "</div>");
var a = 0 != i.options_title.title_text.length ? i.options_title.title_text : "Choose Your Product Options:",
o = ".hulkapps_option_title{";
o += 0 != i.options_title.title_padding.length ? "padding: " + i.options_title.title_padding + "px;" : "padding: 15px;", o += 0 != i.options_title.title_font_size.length ? "font-size: " + i.options_title.title_font_size + "px;" : "font-size: 16px;", o += 0 != i.options_title.title_text_align.length ? "text-align: " + i.options_title.title_text_align + ";" : "text-align: left;", o += 0 != i.options_title.title_background.length ? "background-color: " + i.options_title.title_background + ";" : "background-color: #ffffff;", o += 0 != i.options_title.title_border.length ? "border: 1px solid " + i.options_title.title_border + ";" : "border: 1px solid #000000;", o += 0 != i.options_title.title_font_color.length ? "color: " + i.options_title.title_font_color + ";" : "color:#000000;", o += 1 == parseInt(i.options_title.title_bold) ? "font-weight:bold;" : "font-weight:normal;", o += 1 == parseInt(i.options_title.title_display) ? "" : "display:none;", o += "border-bottom: none;", o += "}";
i.options_container_style.enable_tooltip;
var n = i.options_container_style.enable_helptext,
l = "#hulkapps_option_list_" + i.pid + "{";
l += 0 != i.options_container_style.background_color.length ? "background-color: " + i.options_container_style.background_color + ";" : "background-color: #fff;", l += 0 != i.options_container_style.border_color.length ? "border: 1px solid " + i.options_container_style.border_color + ";" : "border: 0 none;", l += 0 != i.options_container_style.padding.length ? "padding: " + i.options_container_style.padding + "px;" : "padding: 10px;", l += "}.hulkapps_option {width: 100%;display: block;", l += 0 != i.options_container_style.spacing_between_options.length ? "padding-bottom: #{@spacing_between_options}px;margin-bottom: " + i.options_container_style.spacing_between_options + "px;" : "padding-bottom: 6px;margin-bottom: 6px;", l += 0 != i.options_container_style.line_between_options.length ? "border-bottom: 1px solid " + i.options_container_style.line_between_options + ";" : "", l += "}";
var s = i.options_name_style.option_name_inline,
p = ".hulkapps_option_name {";
p += 0 != i.options_name_style.option_name_width.length ? "width: " + i.options_name_style.option_name_width + "px;" : "width: 180px;", p += 0 != i.options_name_style.option_name_font_size.length ? "font-size: " + i.options_name_style.option_name_font_size + "px;" : "font-size: 14px;", p += 0 != i.options_name_style.option_name_text_align.length ? "text-align: " + i.options_name_style.option_name_text_align + ";" : "text-align: left;", p += 0 != i.options_name_style.font_color.length ? "color: " + i.options_name_style.font_color + ";" : "color: #424242;", p = (p += 1 == parseInt(i.options_name_style.on_title_bold) ? "font-weight: bold;" : "font-weight: normal;") + "display: table-cell;min-width: " + i.options_name_style.option_name_width + "px;padding-right: 15px;box-sizing: border-box;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;-ms-box-sizing: border-box;vertical-align: top;}";
i.option_values_style.ov_padding, i.option_values_style.ov_width, i.option_values_style.spacing_left_of_values;
var r = i.option_values_style.single_line,
_ = ".hulkapps_option_value {";
_ += "width:100%;min-width: 100%;text-align: left;display: table-cell;vertical-align: top;}", _ += ".hulkapps_option .hulkapps_option_value, .pn_render .hulkapps_option_child, .et_render .hulkapps_option_child, .tb_render .hulkapps_option_child, .ta_render .hulkapps_option_child, .fu_render .hulkapps_option_child, .dd_render .hulkapps_option_child, .dd_multi_render .hulkapps_option_child, .nf_render .hulkapps_option_child, .dp_render .hulkapps_option_child{", _ += 0 != i.option_values_style.ov_font_size.length ? "font-size: " + i.option_values_style.ov_font_size + "px !important;" : "", _ += 0 != i.option_values_style.ov_font_color.length ? "color: " + i.option_values_style.ov_font_color + " !important;" : "", _ += null != i.option_values_style.ov_font_weight ? "font-weight:bold;" : "font-weight:normal;", _ += "}";
var d = i.advanced_users.custom_js,
c = i.advanced_users.custom_css,
u = parseInt(i.swatch_settings.swatch_width),
h = parseInt(i.swatch_settings.swatch_height),
v = i.swatch_settings.tooltip_position,
m = i.swatch_settings.tooltip_contains,
f = parseInt(i.swatch_settings.tooltip_display),
k = parseInt(i.swatch_settings.round_corners),
g = parseInt(i.swatch_settings.enable_swatch_images),
y = parseInt(i.swatch_settings.enable_swatch_with_text),
$ = (u = "" == u || u < 0 ? "width:35px;" : "width:" + u + "px;", h = "" == h || h < 0 ? "height:35px;" : "height:" + h + "px;", v = "top" == v ? "top" : "bottom", k = 1 == k ? "-webkit-border-radius: 50%;-moz-border-radius: 50%;border-radius: 50%;" : "", i.premium_option_settings.update_total_text),
b = null == i.premium_option_settings.amount_note_display ? 1 : i.premium_option_settings.amount_note_display,
w = i.premium_option_settings.post_total_text,
x = i.premium_option_settings.total_container_background_color,
C = i.premium_option_settings.total_container_border_color,
I = i.premium_option_settings.total_container_font_color,
S = i.premium_option_settings.total_container_price_color,
j = "#option_total {";
j += "" !== x ? "background: none repeat scroll 0 0 " + x + ";" : "background: none repeat scroll 0 0 #fff;", j += "" !== C ? "border:1px solid " + C + ";" : "border:1px solid #000000;", j += "" !== I ? "color: " + I + ";" : "color: #000;", j += "}#formatted_option_total {", j += "" !== S ? "color: " + S + ";" : "color: #000;", j += "}";
var P = 0 == parseInt(r) ? "0px" : "10px",
q = o + l + p + _ + j + ("#hulkapps_custom_options_" + i.pid + "{clear: both}#hulkapps_options_" + i.pid + "{margin:15px 0;margin-bottom: 0}#hulkapps_option_list_" + i.pid + " select{width:100%;padding-top: 12px;padding-bottom: 12px}#hulkapps_option_list_" + i.pid + " input[type='text']{width:100%;border-radius:0}#hulkapps_option_list_" + i.pid + " input,#hulkapps_option_list_" + i.pid + " textarea,#hulkapps_option_list_" + i.pid + " select{border:1px solid #ddd;box-shadow: none;-webkit-appearance: none;padding: 6px 10px;min-height: 36px;}#hulkapps_option_list_" + i.pid + " .validation_error{color:#FF0808;background-color:#FFF8F7;border-style:solid;border-width:1px;border-color:#FFCBC9;border-bottom: 1px solid #ffcbc9 !important;padding: 2px 6px;display: inline-block;margin-top: 2px;}#hulkapps_option_list_" + i.pid + " .validation_error .hulkapps_option_value{color:#FF0808}#hulkapps_option_list_" + i.pid + " .validation_error .hulkapps_option_name{color:#FF0808} .hulkapps_helptext{color: #000 !important;}.conditional{display:none !important}.hulkapps_full_width{width:100%;font-size:16px !important;padding:5px;display:block;}.hulkapps_check_option,.hulkapps_radio_option{display:block;margin-right:0;font-weight:normal !important;}.single_line .hulkapps_option_value .hulkapps_check_option,.single_line .hulkapps_option_value .hulkapps_radio_option{display:inline-flex !important;margin-right:20px;font-weight:normal; align-items: center; }#hulkapps_option_list_" + i.pid + " input[type='checkbox']{margin-right: 5px;vertical-align: baseline;min-height:auto; height: auto;display: inline-block !important;-webkit-appearance: checkbox;-moz-appearance: checkbox;appearance: checkbox;}.hulkapps_check_option input[type='checkbox']{margin-right:5px;}#hulkapps_option_list_" + i.pid + " input[type='radio']{margin-right:5px;vertical-align:baseline;display: none;}i.hulkapps_tooltip_identifier{color:rgb(255, 255, 255);border-radius:12px;font-size:10px;margin-right:6px;margin-left:4px;padding:0px 4px;background:#000000}span.hulkapps_option_name_additional_info{position:relative}span.hulkapps_option_name_additional_info .hulkapps_tool_tip{display:none}span.hulkapps_option_name_additional_info:hover .hulkapps_tool_tip{content:attr(data-additional-info);padding:4px 8px;color:#fff;position:absolute;left:0;bottom:160%;z-index:20px;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;display:block;background:#000000;width:150px}span.hulkapps_option_name_additional_info:hover:after{display:block}i.hulkapps_tooltip_identifier:before{content:'?';font-style:normal}#formatted_option_total{font-weight:bold;margin:0 7px}.td_render .hulkapps_option_name.full_name{float:none;width:auto}.hulkapps_option.full_width .hulkapps_option_name,.hulkapps_option.full_width .hulkapps_option_value{width:100%;display:block;}.hulkapps_option.full_width .hulkapps_option_name{padding-bottom:5px}.hulkapps_option:after{content:'';clear:both;display:block}.hulkapps_option_name a:link {color: grey;text-decoration: none;font-weight: normal;}.hulkapps_option_name a:hover {color: rgb(93, 156, 236);background: transparent;}.hulkapps_swatch_option .hulkapps_option_child{border: 2px solid #ccc;cursor: pointer;}.hulkapps_mswatch_option .hulkapps_option_child{border: 2px solid #ccc;cursor: pointer;}.hulkapps_swatch_option .swatch_selected{border: 2px solid #00a9a2;}.hulkapps_radio_option .radio_selected{border: 2px solid #0090FA;background:#0090FA;color:#fff;}.radio_div{border: 2px solid #eee;padding: 8px 20px;padding: 6px 12px;}.radio_div:hover{border: 2px solid #0090FA;cursor:pointer;}.tooltip.in{opacity:1 !important;}#option_display_total_format{padding-left:5px;}.hulkapps_swatch_option .tooltip-inner{padding: 0px 5px !important;}.hulkapps_check_option,.hulkapps_radio_option{margin-right:" + P + "}.hulkapps_swatch_option,.hulkapps_mswatch_option{ margin-right:10px !important; display: inline-block !important;vertical-align: middle;}.hulkapps-tooltip.tooltip-left-pos .hulkapps-tooltip-inner.swatch-tooltip{left: 0 !important;right: auto !important;}.hulkapps-tooltip.tooltip-left-pos .hulkapps-tooltip-inner.swatch-tooltip:after{right: auto !important;left: 10px !important;}.hulkapps-tooltip.tooltip-right-pos .hulkapps-tooltip-inner.swatch-tooltip{right: 0 !important;left: auto !important;}.hulkapps-tooltip.tooltip-right-pos .hulkapps-tooltip-inner.swatch-tooltip:after{left: auto !important;right: 10px !important;}.hulkapps-tooltip.tooltip-center-pos .hulkapps-tooltip-inner.swatch-tooltip{left: 50% !important;transform: translateX(-50%);}.hulkapps-tooltip.tooltip-center-pos .hulkapps-tooltip-inner.swatch-tooltip:after{left: 50% !important;transform: translateX(-50%);}.phone_number{padding: 6px 10px 6px 50px !important;}#option_total{padding:3px 6px;}.hulkapps_mswatch_option .swatch_selected{border: 2px solid #00a9a2;}.hulkapps-tooltip.tooltip-left-pos .hulkapps-tooltip-inner.multiswatch-tooltip{left: 0 !important;right: auto !important;}.hulkapps-tooltip.tooltip-left-pos .hulkapps-tooltip-inner.multiswatch-tooltip:after{right: auto !important;left: 10px !important;}.hulkapps-tooltip.tooltip-right-pos .hulkapps-tooltip-inner.multiswatch-tooltip{right: 0 !important;left: auto !important;}.hulkapps-tooltip.tooltip-right-pos .hulkapps-tooltip-inner.multiswatch-tooltip:after{left: auto !important;right: 10px !important;}.hulkapps-tooltip.tooltip-center-pos .hulkapps-tooltip-inner.multiswatch-tooltip{left: 50% !important;transform: translateX(-50%);}.hulkapps-tooltip.tooltip-center-pos .hulkapps-tooltip-inner.multiswatch-tooltip:after{left: 50% !important;transform: translateX(-50%);}.hulkapps_swatch_option, .hulkapps_mswatch_option{margin-bottom: 10px !important;}") + c,
T = (d = "<script>$('.hulkapps_swatch_option, .hulkapps_mswatch_option').mouseover(function() {var x = $(this).find('.hulkapps-tooltip ').position();var right = $(window).width() - x.left - $(this).find('.hulkapps-tooltip ').width();if(x.left < 205){$(this).find('.hulkapps-tooltip ').addClass('tooltip-left-pos');}if(right < 160){$(this).find('.hulkapps-tooltip ').addClass('tooltip-right-pos');}});$(window).width()<=768&&$('.hulkapps-tooltip').each(function(){var t=$(this).position(),i=$(window).width()-t.left-$(this).width(),o=t.left-i;o<50&&o>-50?$(this).addClass('tooltip-center-pos'):t.left<i?$(this).addClass('tooltip-left-pos'):i<t.left&&$(this).addClass('tooltip-right-pos')});" + i.advanced_users.custom_js + "<\/script>", "<div id='hulkapps_options_" + i.pid + "'>");
T = (T = (T = T + "" + e + "<style>" + q + "</style>" + d) + "<div class='hulkapps_option_title'>" + a + "</div>") + "<div id='hulkapps_option_list_" + i.pid + "'>", "" !== b || 1 == parseInt(b) ? T += "<input type='hidden' id='hulk_amount_dis' value='1'>" : T += "<input type='hidden' id='hulk_amount_dis' value='0'>";
i.relationship;
var z = "";
if (0 != i.relationship_option.length) {
T += "<div class='hulkapps_option_set'>", t.each(i.relationship_option, function (e, a) {
var o = parseInt(a[0]),
l = a[1];
if (i.option_id_array.indexOf(o) >= 0) {
var p = t.trim(i.option_associative_array[o].option_name),
_ = t.trim(i.option_associative_array[o].tooltip),
d = t.trim(i.option_associative_array[o].helptext),
c = _.length > 0 ? "<div class='hulkapps-tooltip'><span aria-describedby='tooltip_" + o + "'><img src='https://productoption.hulkapps.com/tooltip.svg' style='width:15px;'></span><div class='hulkapps-tooltip-inner' id='tooltip_" + o + "' role='tooltip'>" + _ + "</div></div>" : "",
$ = d.length > 0 ? "<span class='hulkapps_helptext'>" + d + "</span>" : "",
b = i.option_associative_array[o].extra_field,
w = i.option_associative_array[o].option_type,
x = o,
C = t.parseJSON(i.option_associative_array[o].values_json),
I = i.hide_show_array[x] ? i.hide_show_array[x] : "",
S = "required" == l ? "required" : "",
j = 0 == parseInt(s) ? "full_width" : "",
P = "required" == l ? "<span class='hulkapps-required'> * </span>" : "",
q = "1" == i.options_container_style.enable_tooltip ? c : "",
T = "1" == n ? "<div>" + $ + "</div>" : "";
if ("dropdown" == w) A = "<div class='hulkapps_option dd_render " + S + " " + j + " option_type_id_" + x + " " + I + "' data-parent-id= " + x + ">", A += "<div class='hulkapps_option_name'>" + p + " " + P + " " + q + "" + T + "</div>", A += "<div class='hulkapps_option_value'>", A += "<select class='hulkapps_option_child hulkapps_option_" + x + "_visible hulkapps_full_width hulkapps_dd' data-option-key='dd_" + x + "' id='" + x + "' name='properties[" + p + "]'><option value=''>Jetzt den Konfigurator starten?" + p + "</option>", t.each(C, function (t, e) {
var a = e[1],
o = null != a && "" != a ? " [ " + a + i.currency_symbol + " ]" : "",
n = null != a && "" != a ? "(+" + a + i.currency_symbol + ")" : "",
l = null != a && "" != a ? a : "0.00",
s = null != e[4] ? e[4] : e[2];
A = A + "<option class='" + ("" != l ? "price-change" : "") + "' " + (1 == s ? "selected" : "") + " data-price='" + l + "' data-conditional-value='" + e[0].toString().trim() + "' value='" + e[0].toString().trim() + o + "'>" + e[0].toString().trim() + n + "</option>"
}), A += "</select><script>$(document).on('change','#hulkapps_option_list_" + i.pid + " #" + x + "', function() {conditional_rules(" + i.pid + ");if($('#hulk_amount_dis').val() == '1'){calc_options_total(" + i.pid + ");}validate_single_option('option_type_id_" + x + "','dd_render');});<\/script></div></div>", z += A;
else if ("dropdown_multiple" == w) {
var O = null != b && "" != b && "" != b.minimum_selection && null != b.minimum_selection ? b.minimum_selection.toString() : "0",
D = null != b && "" != b && "" != b.maximum_selection && null != b.maximum_selection ? b.maximum_selection.toString() : "0",
M = "0" != O && "0" != D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? "[Choose from " + O + " to " + D + " values]" : "0" != O && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? "[Choose atleast " + O + " values]" : "0" != D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? "[Choose upto " + D + " values]" : "",
A = "<div class='hulkapps_option dd_multi_render " + S + " " + j + " option_type_id_" + x + " " + I + "' data-parent-id='" + x + "'>";
A += "<div class='hulkapps_option_name'><div>" + p + " " + P + " " + q + " : </div>" + M + T + "</div>", A += "<div class='hulkapps_option_value'>", A += "<select multiple class='hulkapps_option_child hulkapps_option_" + x + "_visible hulkapps_full_width hulkapps_dd' data-option-key='dd_" + x + "' id='" + x + "' name='hulkapps_multiple_dropdown' style='background:none;' data-min='" + O + "' data-max='" + D + "'>";
var F = [],
Q = 0;
t.each(C, function (t, e) {
var a = e[1],
o = null != a && "" != a ? " [ " + a + i.currency_symbol + " ]" : "",
n = null != a && "" != a ? "(+" + a + i.currency_symbol + ")" : "",
l = null != a && "" != a ? a : "0.00",
s = null != e[4] ? e[4] : e[2];
1 == s && (Q += 1, F.push(e[0].toString().trim() + o)), A = A + "<option class='" + ("" != l ? "price-change" : "") + "' " + (1 == s ? "selected" : "") + " data-price='" + l + "' data-conditional-value='" + e[0].toString().trim() + "' value='" + e[0].toString().trim() + o + "'>" + e[0].toString().trim() + n + "</option>"
}), Q > 0 && ("0" != O && "0" != D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? (parseInt(Q) < parseInt(O) || parseInt(Q) > parseInt(D)) && (A += '</select><span class="validation_error error_span">Choose from ' + O + " to " + D + " values</span>") : "0" != O && "0" == D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? parseInt(Q) < parseInt(O) && (A += '</select><span class="validation_error error_span">Choose atleast ' + O + " values</span>") : "0" == O && "0" != D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) && parseInt(Q) > parseInt(D) && (A += '</select><span class="validation_error error_span">Choose upto ' + D + " values</span>"));
var E = '<span class="validation_error error_span" >';
A += "<input class='hulkapps_option_child' type='hidden' value='" + F.join(", ") + "' id='hulkapps_option_" + x + "_hidden' name='properties[" + p + "]'><script>$(document).on('change','#hulkapps_option_list_" + i.pid + " #" + x + "', function() {if ((" + O + " != 0) && (" + D + " != 0) && (checkPlan('validation_for_min_max_option_selection','boolean'," + i.plan_id + "," + i.plans_features + "))) {if ($(this).find('option:selected').length < '" + O + "') {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).parents('.hulkapps_option').find('.hulkapps_option_value #" + x + "').after('" + E + "Choose from " + O + " to " + D + " values</span>');if ($(this).find('option:selected').length == 0) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();}} else if ($(this).find('option:selected').length > " + D + ") {$('#" + x + " option:selected:last').prop('selected',false);$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).parents('.hulkapps_option').find('.hulkapps_option_value #" + x + "').after('" + E + "Choose from " + O + " to " + D + " values</span>');if ($(this).find('option:selected').length == '" + D + "') {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();}} else {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();}} else if (checkPlan('validation_for_min_max_option_selection','boolean'," + i.plan_id + "," + i.plans_features + ") && " + O + " != 0) {if ($(this).find('option:selected').length < '" + O + "') {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).parents('.hulkapps_option').find('.hulkapps_option_value #" + x + "').after('" + E + "Choose atleast " + O + " values</span>');} else {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();}} else if (checkPlan('validation_for_min_max_option_selection','boolean'," + i.plan_id + "," + i.plans_features + ") && " + D + " != 0) {if ('" + D + "' >= $(this).find('option:selected').length) {if ('" + D + "' == $(this).find('option:selected').length) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();} else {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).parents('.hulkapps_option').find('.hulkapps_option_value #" + x + "').after('" + E + "Choose upto " + D + " values</span>');}} else {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$('#" + x + " option:selected:last').prop('selected',false);}} else {$(this).parents('.hulkapps_option').removeClass('validation_error');}var chkMulti = $.map($('.hulkapps_option_" + x + "_visible :selected'), function(el, i) {return $(el).val();});$('#hulkapps_option_" + x + "_hidden').val(chkMulti.join(', '));conditional_rules(" + i.pid + ");if($('#hulk_amount_dis').val() == '1'){calc_options_total(" + i.pid + ");}validate_single_option('option_type_id_" + x + "', 'dd_multi_render');});<\/script></div></div>", z += A
} else if ("swatch" == w) {
var N = 0;
A = "<div class='hulkapps_option swatch_render " + S + " " + j + " option_type_id_" + x + " " + I + "' data-parent-id='" + x + "' >";
A += "<div class='hulkapps_option_name'>" + p + " " + P + " " + q + " : " + T + "</div>", A += "<div class='hulkapps_option_value'>", t.each(C, function (t, e) {
var a = e[1],
o = "" != e[0] ? e[0] : "",
n = "" != e[2] ? e[2] : "",
l = "" != e[3] ? e[3] : "",
s = null != a && "" != a ? " [ " + a + i.currency_symbol + " ]" : "",
r = null != a && "" != a ? "(+" + a + i.currency_symbol + ")" : "",
_ = null != a && "" != a ? a : "0.00",
d = "" != _ ? "price-change" : "",
c = null != e[6] ? e[6] : e[4],
g = 1 == c ? "swatch_selected" : "",
$ = 1 == c ? "checked" : "",
b = "<p>" + e[0] + " <br> " + r + "</p>";
if ("image" == n) C = "background-image:url(" + l + "); background-size:cover;background-position: center center;" + k, I = "data-image='" + l + "'", l;
else {
try {
var w = l.split(",")
} catch (t) {
w = null
}
if (null != w)
if (null != w[1]) {
swatch_color_dual_ton = "background: linear-gradient(to bottom, " + w[0] + " 0%, " + w[0] + " 50%, " + w[1] + " 50%, " + w[1] + " 100%); " + k;
var C = swatch_color_dual_ton,
I = "data-image=''"
} else C = "background-color:" + w[0] + ";" + k, I = "data-image=''"
}
if (null != b)
if (null != l)
if ("both" == m) var S = "<div style='text-align:center;'><div class='swatch_tooltip_title'> " + b + "</div><div class='swatch_tooltip_data' style='width:100%;padding-top:100%;" + C + "'></div></div>";
else S = "image_only" == m ? "<div style='text-align:center;'><div class='swatch_tooltip_data' style='width:100%;padding-top:100%;" + C + "'></div></div>" : "<div style='text-align:center;'><div class='swatch_tooltip_title'> " + b + "</div></div>";
else S = "<div style='text-align:center;'><div class='swatch_tooltip_title'> " + b + "</div></div>";
else S = "<div style='text-align:center;'><div class='swatch_tooltip_title'></div></div>";
tooltip_val = "<div class='hulkapps-tooltip-inner swatch-tooltip' style='width:200px;'><div>" + S + "</div></div>", tooltip_display_html = 1 == parseInt(f) ? tooltip_val : "", swatch_with_text = 1 == parseInt(y) ? o : "", A += "<label class='hulkapps_swatch_option'><div class='hulkapps-tooltip " + v + "'>" + tooltip_display_html + "<div><div id='" + x + "_" + N + "' data-option-key='rb_" + x + "_" + N + "' class='hulkapps_option_child " + g + " hulkapps_option_" + x + " " + d + " ' data-price='" + _ + "' data-conditional-value='" + e[0].toString().trim() + "' value='" + e[0].toString().trim() + "' style='" + u + h + C + "' " + v + "><input type='radio' name='properties[" + p + "]' value='" + e[0].toString().trim() + s + "' class='swatch_radio' " + $ + " style='display:none;' " + I + " ></div></div></div><div style='display: inline-block;vertical-align: middle;margin-left: 5px;'>" + swatch_with_text + "</div></label>", N += 1
}), A += "<script>$('.hulkapps_option_" + x + "').on('touchend', function(event) {$(this).click();});$('.hulkapps_option_" + x + "').click(function (){", 1 == g && (A += "var swatch_image_url = " + t(this).find(".swatch_radio").attr("data-image") + "if (" + swatch_image_url + " != ''){$('.hulkapps_swatch_image_change img').attr('src'," + swatch_image_url + ");$('.hulkapps_swatch_image_change img').attr('srcset'," + swatch_image_url + ");$('.hulkapps_swatch_image_change img').attr('data-srcset'," + swatch_image_url + ");}"), A += "$(this).find('swatch_radio').prop('checked', true);$(this).parents('.swatch_render').find('.swatch_selected').removeClass('swatch_selected');$(this).addClass('swatch_selected');conditional_rules(" + i.pid + ");if($('#hulk_amount_dis').val() == '1'){calc_options_total(" + i.pid + ");}validate_single_option('option_type_id_" + x + "','swatch_render');});<\/script></div></div>", z += A
} else if ("swatch_multiple" == w) {
O = null != b && null != b.minimum_selection && "" != b && "" != b.minimum_selection ? b.minimum_selection.toString() : "0", D = null != b && null != b.maximum_selection && "" != b && "" != b.maximum_selection ? b.maximum_selection.toString() : "0", N = 0, M = "0" != O && "0" != D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? "[Choose from " + O + " to " + D + " values]" : "0" != O && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? "[Choose atleast " + O + " values]" : "0" != D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? "[Choose upto " + D + " values]" : "", A = "<div class='hulkapps_option multiswatch_render " + S + " " + j + " option_type_id_" + x + " " + I + "' data-parent-id='" + x + "' >";
A += "<div class='hulkapps_option_name'><div>" + p + " " + P + " " + q + " : </div> " + M + " " + T + "</div>", A += "<div class='hulkapps_option_value'>";
F = [], Q = 0;
t.each(C, function (t, e) {
var a = e[1],
o = "" != e[0] ? e[0] : "",
n = "" != e[2] ? e[2] : "",
l = "" != e[3] ? e[3] : "",
s = null != a && "" != a ? " [ " + a + i.currency_symbol + " ]" : "",
p = null != a && "" != a ? "(+" + a + i.currency_symbol + ")" : "",
r = null != a && "" != a ? a : "0.00",
_ = "" != r ? "price-change" : "",
d = null != e[6] ? e[6] : e[4];
1 == d && (Q += 1, F.push(e[0].toString().trim() + s));
var c = 1 == d ? "swatch_selected" : "",
g = 1 == d ? "checked" : "",
$ = "<p>" + e[0] + " <br> " + p + "</p>";
if ("image" == n) w = "background-image:url(" + l + ");background-size:cover;background-position: center center;" + k, C = "data-image='" + l + "'", l;
else {
try {
var b = l.split(",")
} catch (t) {
b = null
}
if (null != b)
if (null != b[1]) {
swatch_color_dual_ton = "background: linear-gradient(to bottom, " + b[0] + " 0%, " + b[0] + " 50%, " + b[1] + " 50%, " + b[1] + " 100%); " + k;
var w = swatch_color_dual_ton,
C = "data-image=''"
} else w = "background-color:" + b[0] + ";" + k, C = "data-image=''"
}
if (null != $)
if ("" != l)
if ("both" == m) var I = "<div style='text-align:center;'><div class='multiswatch_tooltip_title'> " + $ + "</div><div class='multiswatch_tooltip_data' style='width:100%;padding-top:100%;" + w + "'></div></div>";
else I = "image_only" == m ? "<div style='text-align:center;'><div class='multiswatch_tooltip_data' style='width:100%;padding-top:100%;" + w + "'></div></div>" : "<div style='text-align:center;'><div class='multiswatch_tooltip_title'> " + $ + "</div></div>";
else I = "<div style='text-align:center;'><div class='multiswatch_tooltip_title'> " + $ + "</div></div>";
else I = "<div style='text-align:center;'><div class='swatch_tooltip_title'></div></div>";
tooltip_val = "<div class='hulkapps-tooltip-inner multiswatch-tooltip' style='width:200px;'><div>" + I + "</div></div>", tooltip_display_html = 1 == parseInt(f) ? tooltip_val : "", swatch_with_text = 1 == parseInt(y) ? o : "", A += "<label class='hulkapps_mswatch_option'><div class='hulkapps-tooltip " + v + "'>" + tooltip_display_html + "<div><div id='" + x + "_" + N + "' data-option-key='rb_" + x + "_" + N + "' class='hulkapps_option_child " + c + " hulkapps_option_" + x + " " + _ + "' data-price=" + r + " data-conditional-value='" + e[0].toString().trim() + "' value='" + e[0].toString().trim() + "' style='" + u + h + w + "' " + v + "><input type='checkbox' data-conditional-value='" + e[0].toString().trim() + "' data-price=" + r + " id='" + x + "' value='" + e[0].toString().trim() + s + "' class='swatch_checkbox hulkapps_option_child hulkapps_option_" + x + "_visible " + _ + "' " + g + " style='display:none !important;' " + C + " ></div></div></div><div style='display: inline-block;vertical-align: middle;margin-left: 5px;'>" + swatch_with_text + "</div></label>", N += 1
}), 1 == g && (A += "var swatch_image_url = " + t(this).find(".swatch_radio").attr("data-image") + "if (" + swatch_image_url + " != ''){$('.hulkapps_swatch_image_change img').attr('src'," + swatch_image_url + ");$('.hulkapps_swatch_image_change img').attr('srcset'," + swatch_image_url + ");$('.hulkapps_swatch_image_change img').attr('data-srcset'," + swatch_image_url + ");}"), Q > 0 && ("0" != O && "0" != D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? (parseInt(Q) < parseInt(O) || parseInt(Q) > parseInt(D)) && (A += '<span class="validation_error error_span">Choose from ' + O + " to " + D + " values</span>") : "0" != O && "0" == D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? parseInt(Q) < parseInt(O) && (A += '<span class="validation_error error_span">Choose atleast ' + O + " values</span>") : "0" == O && "0" != D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) && parseInt(Q) > parseInt(D) && (A += '<span class="validation_error error_span">Choose upto ' + D + " values</span>"));
E = '<span class="validation_error error_span" >';
A += "<input class='hulkapps_option_child' value='" + F.join(", ") + "' type='hidden' id='hulkapps_option_" + x + "_hidden' name='properties[" + p + "]'><script>$(document).on('click','.hulkapps_option_" + x + "', function() {$(this).addClass('swatch_selected');if ((" + O + " != 0) && (" + D + " != 0) && (checkPlan('validation_for_min_max_option_selection','boolean'," + i.plan_id + "," + i.plans_features + "))) {if (($('.hulkapps_option_" + x + "_visible:checkbox:checked').length) < parseInt('" + O + "')) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).parents('.hulkapps_option').append('" + E + "Choose from " + O + " to " + D + " values</span>');if (($('.hulkapps_option_" + x + "_visible:checkbox:checked').length) == 0) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();}} else if (($('.hulkapps_option_" + x + "_visible:checkbox:checked').length) > parseInt('" + D + "')) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).parents('.hulkapps_option').append('" + E + "Choose from " + O + " to " + D + " values</span>');if (($('.hulkapps_option_" + x + "_visible:checkbox:checked').length) != parseInt('" + D + "')) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();}$(this).find(':checkbox').prop('checked', false);} else {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();}} else if (" + O + " != 0 && (checkPlan('validation_for_min_max_option_selection','boolean'," + i.plan_id + "," + i.plans_features + "))) {if (($('.hulkapps_option_" + x + "_visible:checkbox:checked').length) < parseInt('" + O + "')) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).parents('.hulkapps_option').append('" + E + "Choose atleast " + O + " values</span>');} else {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();}} else if (" + D + " != 0 && (checkPlan('validation_for_min_max_option_selection','boolean'," + i.plan_id + "," + i.plans_features + "))) {if (parseInt('" + D + "') >= ($('.hulkapps_option_" + x + "_visible:checkbox:checked').length)) {if (parseInt('" + D + "') == ($('.hulkapps_option_" + x + "_visible:checkbox:checked').length)) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();} else {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).parents('.hulkapps_option').append('" + E + "Choose upto " + D + " values</span>');}} else {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).find(':checkbox').prop('checked', false);}}conditional_rules(" + i.pid + ");var chkMulti = $.map($('.hulkapps_option_" + x + "_visible:checked'), function(el, i) {return $(el).val();});$('#hulkapps_option_" + x + "_hidden').val(chkMulti.join(', '));if($('#hulk_amount_dis').val() == '1'){calc_options_total(" + i.pid + ");}validate_single_option('option_type_id_" + x + "', 'multiswatch_render');});$(document).on('change','.hulkapps_option_" + x + "_visible',function(e){$(this).is(':checked')?$(this).parent().addClass('swatch_selected'):$(this).parent().removeClass('swatch_selected')});<\/script></div></div>", z += A
} else if ("checkbox" == w) {
O = null != b && "" != b && null != b.minimum_selection && "" != b.minimum_selection ? b.minimum_selection.toString() : "0", D = null != b && "" != b && null != b.maximum_selection && "" != b.maximum_selection ? b.maximum_selection.toString() : "0";
var J = 1 == parseInt(r) ? "single_line" : "";
M = "0" != O && "0" != D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? "[Choose from " + O + " to " + D + " values]" : "0" != O && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? "[Choose atleast " + O + " values]" : "0" != D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? "[Choose upto " + D + " values]" : "", A = "<div class='hulkapps_option cb_render " + S + " " + j + " " + J + " option_type_id_" + x + " " + I + "' data-parent-id='" + x + "' data-min='" + O + "' data-max='" + D + "'>";
A += "<div class='hulkapps_option_name'><div>" + p + " " + P + " " + q + " : </div> " + M + " " + T + "</div>", A += "<div class='hulkapps_option_value'>";
F = [], Q = 0;
t.each(C, function (t, e) {
var a = e[1],
o = null != a && "" != a ? " [ " + a + i.currency_symbol + " ]" : "",
n = null != a && "" != a ? "(+" + a + i.currency_symbol + ")" : "",
l = null != a && "" != a ? a : "0.00",
s = null != e[4] ? e[4] : e[2];
1 == s && (Q += 1, F.push(e[0].toString().trim() + o)), A += "<label class='hulkapps_check_option'><input type='checkbox' " + (1 == s ? "checked" : "") + " data-option-key='cbm_" + x + "' id='" + x + "' class='hulkapps_option_child hulkapps_option_" + x + "_visible " + ("" != l ? "price-change" : "") + "' data-price='" + l + "' data-conditional-value='" + e[0].toString().trim() + "' value='" + e[0].toString().trim() + o + "'>" + e[0].toString().trim() + n + "</label>"
}), Q > 0 && ("0" != O && "0" != D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? (parseInt(Q) < parseInt(O) || parseInt(Q) > parseInt(D)) && (A += '</select><span class="validation_error error_span">Choose from ' + O + " to " + D + " values</span>") : "0" != O && "0" == D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) ? parseInt(Q) < parseInt(O) && (A += '</select><span class="validation_error error_span">Choose atleast ' + O + " values</span>") : "0" == O && "0" != D && checkPlan("validation_for_min_max_option_selection", "boolean", i.plan_id, i.plans_features) && parseInt(Q) > parseInt(D) && (A += '</select><span class="validation_error error_span">Choose upto ' + D + " values</span>"));
E = '<span class="validation_error error_span" >';
A += "<input class='hulkapps_option_child' value='" + F.join(", ") + "' type='hidden' id='hulkapps_option_" + x + "_hidden' name='properties[" + p + "]'><script>$(document).on('click','.hulkapps_option_" + x + "_visible', function() {if ((" + O + " != 0) && (" + D + " != 0) && (checkPlan('validation_for_min_max_option_selection','boolean'," + i.plan_id + "," + i.plans_features + "))) {if (($('.hulkapps_option_" + x + "_visible:checkbox:checked').length) < parseInt('" + O + "')) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).parents('.hulkapps_option').append('" + E + "Choose from " + O + " to " + D + " values</span>');if (($('.hulkapps_option_" + x + "_visible:checkbox:checked').length) == 0) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();}} else if (($('.hulkapps_option_" + x + "_visible:checkbox:checked').length) > parseInt('" + D + "')) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).parents('.hulkapps_option').append('" + E + "Choose from " + O + " to " + D + " values</span>');if (($('.hulkapps_option_" + x + "_visible:checkbox:checked').length) != parseInt('" + D + "')) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();}this.checked = false;} else {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();}} else if (" + O + " != 0 && (checkPlan('validation_for_min_max_option_selection','boolean'," + i.plan_id + "," + i.plans_features + "))) {if (($('.hulkapps_option_" + x + "_visible:checkbox:checked').length) < parseInt('" + O + "')) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).parents('.hulkapps_option').append('" + E + "Choose atleast " + O + " values</span>');} else {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();}} else if (" + D + " != 0 && (checkPlan('validation_for_min_max_option_selection','boolean'," + i.plan_id + "," + i.plans_features + "))) {if (parseInt('" + D + "') >= ($('.hulkapps_option_" + x + "_visible:checkbox:checked').length)) {if (parseInt('" + D + "') == ($('.hulkapps_option_" + x + "_visible:checkbox:checked').length)) {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();} else {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();$(this).parents('.hulkapps_option').append('" + E + "Choose upto " + D + " values</span>');}} else {$(this).parents('.hulkapps_option').removeClass('validation_error').find('.error_span').remove();this.checked = false;}}conditional_rules(" + i.pid + ");var chkMulti = $.map($('.hulkapps_option_" + x + "_visible:checked'), function(el, i) {return $(el).val();});$('#hulkapps_option_" + x + "_hidden').val(chkMulti.join(', '));if($('#hulk_amount_dis').val() == '1'){calc_options_total(" + i.pid + ");}validate_single_option('option_type_id_" + x + "', 'cb_render');});<\/script></div></div>", z += A
} else if ("textbox" == w) {
var Y = "",
B = null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && null != b.character_limit ? "" : "";
A = "<div class='hulkapps_option tb_render " + S + " " + j + " option_type_id_" + x + " " + I + "' data-parent-id='" + x + "'>";
A += "<div class='hulkapps_option_name'><div>" + p + " " + P + " " + q + " : </div> " + B + " " + T + "</div>", A += "<div class='hulkapps_option_value'>", t.each(C, function (t, e) {
var a = e[1],
o = (null != a && "" != a && i.currency_symbol, null != a && "" != a ? a : "0.00"),
n = "",
l = "" != o ? "price-change" : "";
null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && null != b.character_limit && (n = "maxlength=" + b.character_limit), A += "<input type='password' data-option-key='tb_" + x + "' id='" + x + "' class='hulkapps_option_child hulkapps_full_width hulkapps_option_" + x + " " + l + "' data-price='" + o + "' " + n + "><input type='hidden' name='properties[" + p + "]' class='tb_property_val'>", null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && null != b.character_limit && (A += "<input type='hidden' value='" + b.character_limit + "' class='character_count'><div id='char_count_" + x + "'>" + b.character_limit + " " + i.display_settings.charcter_count_message + "</div>"), Y += "<script>$(document).on('change input','.hulkapps_option_" + x + "',function() { var price = $(this).data('price'); var tb_val = $(this).val(); if (tb_val != '') {if(price != '0.00'){var res = tb_val + ' [ " + i.currency_symbol + "' + price + ' ]';}else{var res = tb_val}$(this).parent().find('.tb_property_val').val(res);$(this).addClass('textbox_selected');}else{$(this).parent().find('.tb_property_val').val('');$(this).removeClass('textbox_selected');}conditional_rules(" + i.pid + ");if($('#hulk_amount_dis').val() == '1'){calc_options_total(" + i.pid + ");}validate_single_option('option_type_id_" + x + "', 'tb_render');});", null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && null != b.character_limit && (Y += "$(document).on('input', '.hulkapps_option_" + x + "', function() { check_character_limit(" + b.character_limit + ",'" + x + "','" + i.display_settings.charcter_count_message + "');});"), Y += "<\/script>"
}), z += A = A + Y + "</div></div>"
} else if ("textarea" == w) {
Y = "", B = null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && null != b.character_limit ? "" : "", A = "<div class='hulkapps_option ta_render " + S + " " + j + " option_type_id_" + x + " " + I + "' data-parent-id='" + x + "'>";
A += "<div class='hulkapps_option_name'><div>" + p + " " + P + " " + q + " : </div> " + B + " " + T + "</div>", A += "<div class='hulkapps_option_value'>", t.each(C, function (t, e) {
var a = e[1],
o = (null != a && "" != a && i.currency_symbol, null != a && "" != a ? a : "0.00"),
n = "",
l = "" != o ? "price-change" : "";
null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && null != b.character_limit && (n = "maxlength=" + b.character_limit), A += "<textarea data-option-key='ta_" + x + "' id='" + x + "' class='hulkapps_option_child hulkapps_full_width hulkapps_option_" + x + " " + l + "' data-price='" + o + "' " + n + "></textarea>", A += "<input type='hidden' name='properties[" + p + "]' class='ta_property_val'>", null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && null != b.character_limit && (A += "<input type='hidden' value='" + b.character_limit + "' class='character_count'><div id='char_count_" + x + "'>" + b.character_limit + " " + i.display_settings.charcter_count_message + "</div>"), Y += "<script>$(document).on('change input','.hulkapps_option_" + x + "',function() { var price = $(this).data('price'); var ta_val = $(this).val(); if (ta_val != '') {if(price != '0.00'){var res = ta_val + ' [ " + i.currency_symbol + "' + price + ' ]';}else{var res = ta_val}$(this).parent().find('.ta_property_val').val(res);$(this).addClass('textbox_selected');}else{$(this).parent().find('.ta_property_val').val('');$(this).removeClass('textbox_selected');}conditional_rules(" + i.pid + ");if($('#hulk_amount_dis').val() == '1'){calc_options_total(" + i.pid + ");}validate_single_option('option_type_id_" + x + "', 'ta_render');});", null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && null != b.character_limit && (Y += "$(document).on('input', '.hulkapps_option_" + x + "', function() { check_character_limit(" + b.character_limit + ",'" + x + "','" + i.display_settings.charcter_count_message + "');});"), Y += "<\/script>"
}), z += A = A + Y + "</div></div>"
} else if ("radiobutton" == w) {
var X = 0;
J = 1 == parseInt(r) ? "single_line" : "";
A = "<div class='hulkapps_option rb_render " + S + " " + j + " " + J + " option_type_id_" + x + " " + I + "' data-parent-id='" + x + "' >", A += "<div class='hulkapps_option_name'>" + p + " " + P + " " + q + " : " + T + "</div>", A += "<div class='hulkapps_option_value'>", t.each(C, function (t, e) {
var a = e[1],
o = null != a && "" != a ? " [ " + a + i.currency_symbol + " ]" : "",
n = null != a && "" != a ? "(+" + a + i.currency_symbol + ")" : "",
l = null != a && "" != a ? a : "0.00",
s = null != e[4] ? e[4] : e[2],
r = 1 == s ? "radio_selected" : "";
A += "<label class='hulkapps_radio_option'><input id='" + x + "_" + X + "' data-option-key='rb_" + x + "_" + X + "' type='radio' " + (1 == s ? "checked" : "") + " class='hulkapps_option_child hulkapps_option_" + x + " " + ("" != l ? "price-change" : "") + " ' data-price='" + l + "' data-conditional-value='" + e[0].toString().trim() + "' name='properties[" + p + "]' value='" + e[0].toString().trim() + o + "'><div class='radio_div " + r + "' for='" + x + "_" + X + "'>" + e[0].toString().trim() + n + "</div></label>", X += 1
}), A += "<script>$('.hulkapps_radio_option').on('touchend', function(event) {$(this).find('.hulkapps_option_" + x + "').click();});$('.hulkapps_option_" + x + "').click(function (){$(this).parent().siblings().find('.radio_div').removeClass('radio_selected');$(this).parent().find('.radio_div').addClass('radio_selected');conditional_rules(" + i.pid + ");if($('#hulk_amount_dis').val() == '1'){calc_options_total(" + i.pid + ");}validate_single_option('option_type_id_" + x + "','rb_render');});<\/script></div></div>", z += A
} else if ("file_upload" == w) A = "<div class='hulkapps_option fu_render " + S + " " + j + " option_type_id_" + x + " " + I + "' data-parent-id='" + x + "'>", A += "<div class='hulkapps_option_name'>" + p + " " + P + " " + q + " : " + T + "</div>", A += "<div class='hulkapps_option_value'><input type='file' data-option-key='fu_" + x + "' id='" + x + "' class='hulkapps_option_child hulkapps_full_width hulkapps_option_" + x + "' name='properties[" + p + "]'><script>$('#" + x + "').change(function (){conditional_rules(" + i.pid + ");validate_single_option('option_type_id_" + x + "','fu_render');})<\/script></div></div>", z += A;
else if ("email" == w) {
Y = "";
A = "<div class='hulkapps_option et_render " + S + " " + j + " option_type_id_" + x + " " + I + "' data-parent-id='" + x + "'>", A += "<div class='hulkapps_option_name'>" + p + " " + P + " " + q + " : " + T + " </div>", A += "<div class='hulkapps_option_value'>", t.each(C, function (t, e) {
var a = e[1],
o = (null != a && "" != a && i.currency_symbol, null != a && "" != a && i.currency_symbol, null != a && "" != a ? a : "0.00");
null != e[4] ? e[4] : e[2];
A += "<input type='email' data-option-key='et_" + x + "' id='" + x + "' class='hulkapps_option_child hulkapps_full_width hulkapps_option_" + x + " " + ("" != o ? "price-change" : "") + "' data-price='" + o + "'><input type='hidden' name='properties[" + p + "]' class='et_property_val'>", Y += "<script>$(document).on('change','.hulkapps_option_" + x + "',function() {var price = $(this).data('price');var et_val = $(this).val();if (et_val != '') {if(price != '0.00'){var res = et_val + ' [ " + i.currency_symbol + "' + price + ' ]';}else{var res = et_val}$(this).parent().find('.et_property_val').val(res);$(this).addClass('emailbox_selected');}else{ $(this).parent().find('.et_property_val').val('');$(this).removeClass('emailbox_selected');}conditional_rules(" + i.pid + ");if($('#hulk_amount_dis').val() == '1'){calc_options_total(" + i.pid + ");}validate_single_option('option_type_id_" + x + "', 'et_render');});<\/script>"
}), z += A = A + Y + "</div></div>"
} else if ("date_picker" == w) {
Y = "";
A = "<div class='hulkapps_option dp_render " + S + " " + j + " option_type_id_" + x + " " + I + "' data-parent-id='" + x + "'>", A += "<div class='hulkapps_option_name'>" + p + " " + P + " " + q + " : " + T + "</div>", A += "<div class='hulkapps_option_value'>", t.each(C, function (t, e) {
var a = e[1],
o = (null != a && "" != a && i.currency_symbol, null != a && "" != a && i.currency_symbol, null != a && "" != a ? a : "0.00");
null != e[4] ? e[4] : e[2];
A += "<input type='text' data-option-key='dp_" + x + "' id='" + x + "' name='input' placeholder='mm/dd/yyyy' class='hulkapps_option_child hulkapps_full_width hulkapps_option_" + x + " " + ("" != o ? "price-change" : "") + "' data-price='" + o + "'><input type='hidden' name='properties[" + p + "]' class='dp_property_val'>", Y = Y + "<script>$(document).on('change','.hulkapps_option_" + x + "',function() {var price = $(this).data('price');var dp_val = $(this).val();if (dp_val != '') {if(price != '0.00'){var res = dp_val + ' [ " + i.currency_symbol + "' + price + ' ]';}else{var res = dp_val}$(this).parent().find('.dp_property_val').val(res);$(this).addClass('datepicker_selected');}else{ $(this).parent().find('.dp_property_val').val('');$(this).removeClass('datepicker_selected');}conditional_rules(" + i.pid + ");if($('#hulk_amount_dis').val() == '1'){calc_options_total(" + i.pid + ");}validate_single_option('option_type_id_" + x + "', 'dp_render');});<\/script>"
}), z += A = A + Y + "</div></div>"
} else if ("number_field" == w) {
Y = "";
null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && b.character_limit, B = null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && null != b.character_limit ? "" : "", A = "<div class='hulkapps_option nf_render " + S + " " + j + " option_type_id_" + x + " " + I + "' data-parent-id='" + x + "'>";
A += "<div class='hulkapps_option_name'><div>" + p + " " + P + " " + q + " : </div> " + B + " " + T + "</div>", A += "<div class='hulkapps_option_value'>", t.each(C, function (t, e) {
var a = e[1],
o = (null != a && "" != a && i.currency_symbol, null != a && "" != a ? a : "0.00"),
n = "",
l = "",
s = "" != o ? "price-change" : "";
null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && null != b.character_limit && (n = "maxlength=" + b.character_limit, l = "onKeyPress='if(this.value.length==" + b.character_limit + ") return false;'"), A += "<input type='number' " + l + " pattern='d*' min=0 step='any' data-option-key='nf_" + x + "' id='" + x + "' class='hulkapps_option_child hulkapps_full_width hulkapps_option_" + x + " " + s + "' data-price='" + o + "' " + n + "><input type='hidden' name='properties[" + p + "]' class='nf_property_val'>", null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && null != b.character_limit && (A += "<input type='hidden' value='" + b.character_limit + "' class='character_count'><div id='char_count_" + x + "'>" + b.character_limit + " " + i.display_settings.charcter_count_message + "</div>"), Y += "<script>$(document).on('change input','.hulkapps_option_" + x + "',function() { var price = $(this).data('price'); var nf_val = $(this).val(); if (nf_val != '') {if(price != '0.00'){var res = nf_val + ' [ " + i.currency_symbol + "' + price + ' ]';}else{var res = nf_val}$(this).parent().find('.nf_property_val').val(res);$(this).addClass('numberfield_selected');}else{$(this).parent().find('.nf_property_val').val('');$(this).removeClass('numberfield_selected');}conditional_rules(" + i.pid + ");if($('#hulk_amount_dis').val() == '1'){calc_options_total(" + i.pid + ");}validate_single_option('option_type_id_" + x + "', 'nf_render');});", null != b && checkPlan("character_limit", "boolean", i.plan_id, i.plans_features) && "" != b.character_limit && null != b.character_limit && (Y += "$(document).on('input', '.hulkapps_option_" + x + "', function() { if(this.value.length > Number($(this).attr('maxlength'))){val=this.value.slice(0, $(this).attr('maxlength'));$(this).val(val);}check_character_limit(" + b.character_limit + ",'" + x + "','" + i.display_settings.charcter_count_message + "');});"), Y += "<\/script>"
}), z += A = A + Y + "</div></div>"
} else if ("phone_number" == w) {
Y = "", A = "<div class='hulkapps_option pn_render " + S + " " + j + " option_type_id_" + x + " " + I + "' data-parent-id='" + x + "'>";
A += "<div class='hulkapps_option_name'>" + p + " " + P + " " + q + " : " + T + "</div>", A += "<div class='hulkapps_option_value'>", t.each(C, function (t, e) {
var a = e[1],
o = (null != a && "" != a && i.currency_symbol, null != a && "" != a ? a : "0.00");
A += "<input type='textbox' data-option-key='tb_" + x + "' id='" + x + "' class='phone_number phone_number" + x + " hulkapps_option_child hulkapps_full_width hulkapps_option_" + x + " " + ("" != o ? "price-change" : "") + "' data-price='" + o + "'><input type='hidden' name='properties[" + p + "]' class='tb_property_val'><span id='valid-msg' class='hide'>✓ Valid</span><span id='error-msg' class='hide'>Invalid number</span>", Y += "<script>$(document).ready(function(){$('.phone_number" + x + "').keypress(function (e) {if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {return false;}});var telInput = $('.phone_number" + x + "');var errorMsg = $('.phone_number" + x + "').closest('.hulkapps_option_value').find('#error-msg');var validMsg = $('.phone_number" + x + "').closest('.hulkapps_option_value').find('#valid-msg');telInput.intlTelInput({initialCountry: 'auto',geoIpLookup: function(callback) {var countryCode = '" + i.country + "';callback(countryCode);},customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) {return 'e.g. ' + selectedCountryPlaceholder;}});var reset = function() {telInput.removeClass('error');errorMsg.innerHTML = '';errorMsg.addClass('hide');validMsg.addClass('hide');};telInput.blur(function() {reset();if ($.trim($('.phone_number" + x + "').val())) {if(telInput.intlTelInput('isValidNumber')){validMsg.removeClass('hide');$('.phone_number" + x + "').parents('.hulkapps_option_value').find('#error-msg').css('cssText', 'display: none !important');telInput.val(telInput.intlTelInput('getNumber', intlTelInputUtils.numberFormat.E164));var tb_val = $('.phone_number" + x + "').val();var price = $(this).data('price');if(price != '0.00'){var res = tb_val + ' [ " + i.currency_symbol + "' + price + ' ]';}else{var res = tb_val}$(this).parents('.hulkapps_option_value').find('.tb_property_val').val(res);$(this).addClass('textbox_selected');} else {telInput.addClass('error');$('.phone_number" + x + "').parents('.hulkapps_option_value').find('#error-msg').css('cssText', 'display: block !important');$(this).parents('.hulkapps_option_value').find('.tb_property_val').val(res);$(this).removeClass('textbox_selected');}}else{$('.phone_number').parents('.hulkapps_option_value').find('#error-msg').css('cssText', 'display: none !important');$(this).parents('.hulkapps_option_value').find('.tb_property_val').val(res);$(this).removeClass('textbox_selected');}conditional_rules(" + i.pid + ");if($('#hulk_amount_dis').val() == '1'){calc_options_total(" + i.pid + ");}validate_single_option('option_type_id_" + x + "', 'pn_render');});});<\/script>"
}), z += A = A + Y + "</div></div>"
}
}
});
var O = "<input type='hidden' name='currency_symbol' value='" + i.currency_symbol + "'>";




"" !== z && (T = T + z + O), T += "</div>", 1 != parseInt(b) && "" != b || (T += "<div id='option_total' style='display: none;'><input type='hidden' id='raw_option_total' value='0'><div id='option_display_total_format'>" + $ + "<span id='formatted_option_total'>" + "<span id='calculated_option_total'>0.00</span>" + i.currency_symbol + " </span>" + w + "</div></div>"), T += "<div id='error_text'></div><script>$('#hulkapps_options_" + i.pid + "').closest('form').unbind();<\/script>", T += "</div></div>"
//gang

}

t("#hulkapps_custom_options_" + window.hulkapps.product_id).html(T), conditional_rules(window.hulkapps.product_id), t("#hulkapps_options_" + window.hulkapps.product_id).closest("form").find(":submit").addClass("hulkapps_submit_cart")
}, 500)
}
}), "cart" == window.hulkapps.page_type && t("body").on("click", ".edit_cart_option", function (i) {
t("body").addClass("body_fixed"), i.preventDefault();

var e = t(this).data("key"),
a = window.hulkapps.cart,
o = window.hulkapps.store_id,
n = t(this).data("product_id"),
l = t(this).data("variant_id");
t("[name^='properties']").each(function () {
"" == t(this).val() && t(this).attr("disabled", !0)
}), t.ajax({
type: "POST",
url: window.hulkapps.po_url + "/api/v2/store/edit_cart",
data: {
cart_data: a,
item_key: e,
store_id: o,
variant_id: l
},
cache: !1,
crossDomain: !0,
success: function (i) {
"ok" == i ? location.reload() : (t("#edit_cart_popup").html(i), t(".edit_popup").show(), calc_options_total(n), conditional_rules(n))
}
})
}), t("body").on("change", 'input[name="updates[]"]', function (i) {
t('[name="update"]').click()
}), "cart" == window.hulkapps.page_type) {
var a = localStorage.getItem("discount_code");
if ("" != a) {
t(".hulkapps_discount_code").val(a);
var o = {
cart_data: window.hulkapps,
store_id: window.hulkapps.store_id,
discount_code: a,
cart_collections: JSON.stringify(window.hulkapps.cart_collections)
}
} else o = {
cart_data: window.hulkapps,
store_id: window.hulkapps.store_id
};
var n = 0;
window.hulkapps.cart.items.forEach(function (t) {
null != t.properties && t.properties != {} && n++
}), n > 1 ? t(checkout_selectors).attr("disabled", !0) : t(checkout_selectors).attr("disabled", !1), t(checkout_selectors).attr("disabled", !0), t.ajax({
type: "POST",
url: window.hulkapps.po_url + "/store/get_cart_details",
data: o,
crossDomain: !0,
success: function (i) {
setTimeout(function () {
t(checkout_selectors).attr("disabled", !1), hulkappsDoActions(i)
}, 1)
},
error: function (i, e) {
t(checkout_selectors).attr("disabled", !1)
}
})
}
}, hulkappsStart(t)
}, window.cartPageJS = function (t) {
t(document).on("keypress", ".hulkapps_discount_code", function (i) {
13 == i.which && t(".hulkapps_discount_button").click()
}), t(document).on("click", ".hulkapps_discount_button", function (i) {
i.preventDefault();
var e = t(".hulkapps_discount_code").val();
"" == e ? t(".hulkapps_discount_code").addClass("discount_error") : (localStorage.setItem("discount_code", e), t(".hulkapps_discount_code").removeClass("discount_error"), location.reload())
}), t(document).on("click", ".close-tag", function (t) {
localStorage.removeItem("discount_code"), location.reload()
}), t(document).on("click", ".hulkapp_save", function (i) {
if (i.preventDefault(), validate_options(t(this).data("product_id"))) {
t(checkout_selectors).attr("disabled", !0);
var e = parseInt(t(this).parents(".hulkapp_popupBox").find(".hulkapp_mainContent").find(".h_index").val()) + 1,
a = t(this).attr("data-quantity"),
o = t(this).parents(".hulkapp_popupBox").find(".hulkapp_mainContent").find(".h_variant_id").val(),
n = {};
if (t("#edit_cart_popup [name^='properties']").each(function (i, e) {
var a;
"" == t(this).val() && t(this).remove(), "radio" == this.type ? this.checked && (a = this.name.replace("properties[", "").replace("]", ""), t.trim(this.value).length > 0 && (n[a] = this.value)) : (this.type, a = this.name.replace("properties[", "").replace("]", ""), t.trim(this.value).length > 0 && (n[a] = this.value))
}), t.isEmptyObject(n)) t.ajax({
type: "POST",
url: "/cart/change.js",
data: {
quantity: 0,
line: e
},
dataType: "json",
success: function (i) {
"" != t(".upload_cls").val() ? t(".upload_h_cls").remove() : t(".upload_cls").remove(), t("#edit_cart_popup .conditional").each(function (i, e) {
t(this).find('.hulkapps_option_value input[type="hidden"]').val("")
}), t("[name^='properties']").each(function (i, e) {
"" == t(this).val() && t(this).remove()
}), t.ajax({
type: "POST",
url: "/cart/add.js",
data: {
quantity: a,
id: o
},
dataType: "json",
success: function (t) {
location.reload()
}
})
}
});
else {
var l = new FormData(t("#edit_cart_popup")[0]);
l.append("quantity", a), l.append("line", e), t.ajax({
type: "POST",
url: "/cart/change.js",
data: {
quantity: 0,
line: e
},
dataType: "json",
success: function (i) {
"" != t(".upload_cls").val() ? t(".upload_h_cls").remove() : t(".upload_cls").remove(), t("#edit_cart_popup .conditional").each(function (i, e) {
t(this).find('.hulkapps_option_value input[type="hidden"]').val("")
}), t("[name^='properties']").each(function (i, e) {
"" == t(this).val() && t(this).remove()
}), t.ajax({
type: "POST",
url: "/cart/add.js",
data: l,
dataType: "json",
contentType: !1,
processData: !1,
success: function (t) {
location.reload()
}
})
}
})
}
}
}), t(document).on("click touchstart", ".hulkapp_close", function (i) {
t(".edit_popup").hide(), t("body").removeClass("body_fixed")
})
}, window.productPageJS = function ($) {
window.conditional_rules = function (prod_id) {
pass = !1, verify_all = Array(), verify_any = Array(), verified_condition = Array(), pass_array = Array(), $("#hulkapps_option_list_" + prod_id + " .condition_hide").removeClass("conditional"), $("#hulkapps_option_list_" + prod_id + " .condition_show").addClass("conditional"), $("#hulkapps_custom_options_" + prod_id + " #conditional_rules").children().each(function () {
pass_array = Array(), pass = !1, $(this).children().each(function () {
pass = !1;
var condition_rule = $(this).text(),
field_value;
if (1 == $(".option_type_id_" + $(this).attr("data-field-num")).hasClass("dd_multi_render")) {
var aa = condition_rule;
aa.indexOf("!=") >= 0 && (pass = !0);
var count = $(".hulkapps_option_" + $(this).attr("data-field-num") + "_visible:visible :selected").length,
ct = 1,
selected_array = Array();
$(".hulkapps_option_" + $(this).attr("data-field-num") + "_visible:visible :selected").length > 0 ? $(".hulkapps_option_" + $(this).attr("data-field-num") + "_visible:visible :selected").each(function () {
var condition_rule = aa;
if (field_value = $(this).data("conditional-value"), condition_rule = condition_rule.replace("**value11**", field_value), condition_rule.indexOf("==") >= 0) {
var condition_rule = condition_rule.split("==");
condition_rule[0] == condition_rule[1] ? pass = !0 : pass = !1
} else {
var condition_rule = condition_rule.split("!=");
condition_rule[0] != condition_rule[1] ? pass = !0 : pass = !1
}
if (selected_array.push(pass), ct == count && count > 1) {
var result = selected_array.join(" || ");
result = eval(result), pass_array.push(result)
} else 1 == count && pass_array.push(pass);
ct += 1
}) : pass_array.push(!1)
} else if (1 == $(".option_type_id_" + $(this).attr("data-field-num")).hasClass("cb_render")) {
var aa = condition_rule;
aa.indexOf("!=") >= 0 && (pass = !0);
var ctt = 1,
checked_array = Array(),
countt = $(".hulkapps_option_" + $(this).attr("data-field-num") + "_visible:visible:checked").length;
$(".hulkapps_option_" + $(this).attr("data-field-num") + "_visible:visible:checked").each(function () {
var condition_rule = aa;
if (field_value = $(this).data("conditional-value"), condition_rule = condition_rule.replace("**value11**", field_value), condition_rule.indexOf("==") >= 0) {
var condition_rule = condition_rule.split("==");
condition_rule[0] == condition_rule[1] ? pass = !0 : pass = !1
} else {
var condition_rule = condition_rule.split("!=");
condition_rule[0] != condition_rule[1] ? pass = !0 : pass = !1
}
if (checked_array.push(pass), ctt == countt && countt > 1) {
var result = checked_array.join(" || ");
result = eval(result), pass_array.push(result)
} else 1 == countt && pass_array.push(pass);
ctt += 1
})
} else if (1 == $("#hulkapps_option_list_" + prod_id + " .option_type_id_" + $(this).attr("data-field-num")).hasClass("multiswatch_render")) {
var aa = condition_rule;
aa.indexOf("!=") >= 0 && (pass = !0);
var ctt = 1,
checked_array = Array(),
countt = $("#hulkapps_option_list_" + prod_id + " .hulkapps_option_" + $(this).attr("data-field-num") + "_visible:checked").length;
$("#hulkapps_option_list_" + prod_id + " .hulkapps_option_" + $(this).attr("data-field-num") + "_visible:checked").each(function () {
var condition_rule = aa;
if (field_value = $(this).data("conditional-value"), condition_rule = condition_rule.replace("**value11**", field_value), condition_rule.indexOf("==") >= 0) {
var condition_rule = condition_rule.split("==");
condition_rule[0] == condition_rule[1] ? pass = !0 : pass = !1
} else {
var condition_rule = condition_rule.split("!=");
condition_rule[0] != condition_rule[1] ? pass = !0 : pass = !1
}
if (checked_array.push(pass), ctt == countt && countt > 1) {
var result = checked_array.join(" || ");
result = eval(result), pass_array.push(result)
} else 1 == countt && pass_array.push(pass);
ctt += 1
})
} else {
if (pass = !1, field_value = 1 == $(".option_type_id_" + $(this).attr("data-field-num")).hasClass("dd_render") ? $("#" + $(this).attr("data-field-num") + " option:selected").attr("data-conditional-value") : 1 == $(".option_type_id_" + $(this).attr("data-field-num")).hasClass("rb_render") ? $(".hulkapps_option_" + $(this).attr("data-field-num") + ":checked").data("conditional-value") : 1 == $(".option_type_id_" + $(this).attr("data-field-num")).hasClass("swatch_render") ? $(".hulkapps_option_" + $(this).attr("data-field-num") + ".swatch_selected").data("conditional-value") : $("#" + $(this).attr("data-field-num")).val(), condition_rule = condition_rule.replace("**value11**", field_value), condition_rule.indexOf("==") >= 0) {
var condition_rule = condition_rule.split("==");
condition_rule[0] == condition_rule[1] ? pass = !0 : pass = !1
} else {
var condition_rule = condition_rule.split("!=");
condition_rule[0] != condition_rule[1] ? pass = !0 : pass = !1
}
pass_array.push(pass)
}
});

var type_rule = $(this).attr("data-verify-all"),
condition_id = $(this).attr("name");
if ("0" == type_rule) var res = pass_array.join(" || ");
else var res = pass_array.join(" && ");
res = eval(res), res ? ($("." + condition_id + "_show").removeClass("conditional"), $("." + condition_id + "_hide").addClass("conditional"), $("." + condition_id + "_hide.conditional").find(".hulkapps_option_child").each(function () {
conditional_change($(this))
})) : $("." + condition_id + "_show.conditional").find(".hulkapps_option_child").each(function () {
conditional_change($(this))
})
}), calc_options_total(prod_id)
}, window.conditional_change = function (t) {
"select-one" == t.prop("type") || "select-multiple" == t.prop("type") ? t.val() && (t.val(""), t.parent().removeClass("selected")) : "radio" == t.prop("type") ? t.prop("checked") && (t.prop("checked", !1), t.val(""), t.parent().find(".radio_selected").removeClass("radio_selected")) : "textarea" == t.prop("type") || "number" == t.prop("type") || "text" == t.prop("type") || "hidden" == t.prop("type") || "file" == t.prop("type") || "email" == t.prop("type") || "date_picker" == t.prop("type") ? t.val() && (t.val("").change(), t.parents(".hulkapps_option_value").find(".tb_property_val").val(""), t.parents(".hulkapps_option_value").find("#valid-msg").remove()) : "checkbox" == t.prop("type") ? t.prop("checked") && (t.prop("checked", !1), t.parent().removeClass("swatch_selected")) : "DIV" == t.prop("tagName") && t.find(".swatch_radio").prop("checked") && (t.find(".swatch_radio").prop("checked", !1), t.removeClass("swatch_selected"))
}, window.calc_options_total = function (t) {
var i, e = 0;
window.hulkapps.money_format;

for (checked_variant = $("#hulkapps_option_list_" + t + ":visible .price-change:checked, #hulkapps_option_list_" + t + ":visible .price-change:selected, .hulkapps_swatch_option .swatch_selected,.textarea_selected,.textbox_selected,.emailbox_selected,.datepicker_selected,.numberfield_selected"), i = 0; i < checked_variant.length; i++) $(checked_variant[i]).parents(".hulkapps_option").hasClass("conditional") || (e = Number($(checked_variant[i]).attr("data-price")) + Number(e));
$("#hulkapps_options_" + t + " #raw_option_total").val(e), $("#hulkapps_options_" + t + " #calculated_option_total").html(e.toFixed(2)), e > 0 ? $("#hulkapps_options_" + t + " #option_total").slideDown() : $("#hulkapps_options_" + t + " #option_total").slideUp() //TEST
}, window.check_character_limit = function (t, i, e) {
var a = t - $(".hulkapps_option_value .hulkapps_option_" + i).val().length;
$("#char_count_" + i).html(a + " " + e)
}, window.validate_options = function (t) {
var i = !0;
$(".hulkapps_option:visible").each(function () {
$(this).hasClass("validation_error") && (i = !1)
}), $("#hulkapps_options_" + t + " #error_text").html("");
var e, a = $("#hulkapps_option_list_" + t + ":visible .required:visible");
for (e = 0; e < a.length; e++) 1 != $(a[e]).find("select[name^='properties']").length || $(a[e]).find("select[name^='properties']").val() ? $(a[e]).find(".hulkapps_radio_option").length && !$(a[e]).find("input[name^='properties']:checked").length ? ($(a[e]).addClass("validation_error"), i = !1) : $(a[e]).find(".hulkapps_swatch_option").length && !$(a[e]).find("input[name^='properties']:checked").length ? ($(a[e]).addClass("validation_error"), i = !1) : $(a[e]).find("input[type='text']").length > 1 ? $(a[e]).find("input[type='text']").each(function () {
"" == $(this).val() && ($(a[e]).addClass("validation_error"), i = !1)
}) : $(a[e]).find("input[type='text']").length && !$(a[e]).find("input[name^='properties']").val() ? ($(a[e]).addClass("validation_error"), i = !1) : $(a[e]).find("input[type='email']").length && !$(a[e]).find("input[name^='properties']").val() ? ($(a[e]).addClass("validation_error"), i = !1) : $(a[e]).find(".hulkapps_check_option").length && !$(a[e]).find("input[name^='properties']").val() ? ($(a[e]).addClass("validation_error"), i = !1) : $(a[e]).find("input[type='file']").length && !$(a[e]).find("input[name^='properties']").val() ? ($(a[e]).addClass("validation_error"), i = !1) : $(a[e]).hasClass("cb_render") && $(a[e]).find("input[type='checkbox']:checked").length && !$(a[e]).find("input[name^='properties']").length ? ($(a[e]).addClass("validation_error"), i = !1) : $(a[e]).hasClass("multiswatch_render") && $(a[e]).find("input[type='checkbox']:checked").length && !$(a[e]).find("input[name^='properties']").length ? ($(a[e]).addClass("validation_error"), i = !1) : $(a[e]).find("textarea").length && !$(a[e]).find("input[name^='properties']").val() ? ($(a[e]).addClass("validation_error"), i = !1) : $(a[e]).find("select[multiple]").length && !$(a[e]).find("input[name^='properties']").val() ? ($(a[e]).addClass("validation_error"), i = !1) : $(a[e]).find("input[type='number']").length && !$(a[e]).find("input[name^='properties']").val() ? ($(a[e]).addClass("validation_error"), i = !1) : $(a[e]).hasClass("dp_render") && $(a[e]).find("input[type='text']").length && !$(a[e]).find("input[name^='properties']").val() ? ($(a[e]).addClass("validation_error"), i = !1) : $(a[e]).removeClass("validation_error") : ($(a[e]).addClass("validation_error"), i = !1);
return $("#hulkapps_option_list_" + t + " .cb_render:visible").each(function () {
$(this).hasClass("required") && $(this).find("input[type='checkbox']").length ? $(this).find("input[name^='properties']").val() ? $(this).find(".error_span").length > 0 ? ($(this).addClass("validation_error"), i = !1) : $(this).removeClass("validation_error") : ($(this).addClass("validation_error"), i = !1) : $(this).find(".error_span").length > 0 ? ($(this).addClass("validation_error"), i = !1) : $(this).removeClass("validation_error")
}), $("#hulkapps_option_list_" + t + " .multiswatch_render:visible").each(function () {
$(this).hasClass("required") && $(this).find("input[type='checkbox']").length ? $(this).find("input[name^='properties']").val() ? $(this).find(".error_span").length > 0 ? ($(this).addClass("validation_error"), i = !1) : $(this).removeClass("validation_error") : ($(this).addClass("validation_error"), i = !1) : $(this).find(".error_span").length > 0 ? ($(this).addClass("validation_error"), i = !1) : $(this).removeClass("validation_error")
}), $("#hulkapps_option_list_" + t + " .dd_multi_render:visible").each(function () {
$(this).hasClass("required") && $(this).find("select[multiple]").length ? $(this).find("input[name^='properties']").val() ? $(this).find(".error_span").length > 0 ? ($(this).addClass("validation_error"), i = !1) : $(this).removeClass("validation_error") : ($(this).addClass("validation_error"), i = !1) : $(this).find(".error_span").length > 0 ? ($(this).addClass("validation_error"), i = !1) : $(this).removeClass("validation_error")
}), $("#hulkapps_option_list_" + t + " .et_render.required:visible").each(function () {
if ($(this).find("input[type='email']").length && (!$(this).find("input[name^='properties']").val() && $(this).hasClass("required") || "" != $(this).find("input[type='email']").val())) {
var t = $(this).find("input[type='email']").val();
/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test(t) ? $(this).removeClass("validation_error") : ($(this).addClass("validation_error"), i = !1)
}
}), $("#hulkapps_option_list_" + t + " .pn_render.required:visible").each(function () {
$(this).find("input[type='textbox']").length && !$(this).find("input[name^='properties']").val() && $(this).hasClass("required") ? ($(this).addClass("validation_error"), i = !1) : $(this).find(".phone_number").hasClass("error") ? ($(this).addClass("validation_error"), i = !1) : $(this).removeClass("validation_error")
}), $("#hulkapps_option_list_" + t + " .dp_render:visible").each(function () {
$(this).find(".error_span").length > 0 ? ($(this).addClass("validation_error"), i = !1) : $(this).removeClass("validation_error")
}), $("#hulkapps_option_list_" + t + " .dp_render.required:visible").each(function () {
$(this).find("input[type='text']").length && !$(this).find("input[name^='properties']").val() && $(this).hasClass("required") ? ($(this).addClass("validation_error"), i = !1) : $(this).find(".error_span").length > 0 ? ($(this).addClass("validation_error"), i = !1) : $(this).removeClass("validation_error")
}), i
}, window.validate_single_option = function (t, i) {
if ("dd_render" == i) 1 == $("." + t).find("select[name^='properties']").length && !$("." + t).find("select[name^='properties']").val() && $("." + t).hasClass("required") ? $("." + t).addClass("validation_error") : $("." + t).removeClass("validation_error");
else if ("dd_multi_render" == i) $("." + t).find("select[multiple]").length && !$("." + t).find("input[name^='properties']").val() && $("." + t).hasClass("required") ? $("." + t).addClass("validation_error") : $("." + t).removeClass("validation_error");
else if ("swatch_render" == i) $("." + t).removeClass("validation_error");
else if ("multiswatch_render" == i) $("." + t).find(".hulkapps_swatch_option").length && !$("." + t).find("input[name^='properties']").val() && $("." + t).hasClass("required") ? $("." + t).addClass("validation_error") : $("." + t).removeClass("validation_error");
else if ("cb_render" == i) $("." + t).find(".hulkapps_check_option").length && !$("." + t).find("input[name^='properties']").val() && $("." + t).hasClass("required") ? $("." + t).addClass("validation_error") : $("." + t).removeClass("validation_error");
else if ("tb_render" == i) $("." + t).find("input[type='text']").length && !$("." + t).find("input[name^='properties']").val() && $("." + t).hasClass("required") ? $("." + t).addClass("validation_error") : $("." + t).removeClass("validation_error");
else if ("nf_render" == i) $("." + t).find("input[type='number']").length && !$("." + t).find("input[name^='properties']").val() && $("." + t).hasClass("required") ? $("." + t).addClass("validation_error") : $("." + t).removeClass("validation_error");
else if ("dp_render" == i)
if ($("." + t).find("input[type='text']").length && $("." + t).find("input[name^='properties']").val()) {
var e = $("." + t).find("input[type='text']").val().match(/^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/);
if (null == e) $("." + t).addClass("validation_error"), $("." + t).find(".validation_error").remove(), $("." + t).find("input[type='text']").after('<span class="validation_error error_span">Enter valid date format mm/dd/yyyy</span>');
else if (dtMonth = e[1], dtDay = e[3], dtYear = e[5], dtMonth < 1 || dtMonth > 12) $("." + t).addClass("validation_error"), $("." + t).find(".validation_error").remove(), $("." + t).find("input[type='text']").after('<span class="validation_error error_span">Enter valid date format mm/dd/yyyy</span>');
else if (dtDay < 1 || dtDay > 31) $("." + t).addClass("validation_error"), $("." + t).find(".validation_error").remove(), $("." + t).find("input[type='text']").after('<span class="validation_error error_span">Enter valid date format mm/dd/yyyy</span>');
else if (4 != dtMonth && 6 != dtMonth && 9 != dtMonth && 11 != dtMonth || 31 != dtDay)
if (2 == dtMonth) {
var a = dtYear % 4 == 0 && (dtYear % 100 != 0 || dtYear % 400 == 0);
dtDay > 29 || 29 == dtDay && !a ? ($("." + t).addClass("validation_error"), $("." + t).find(".validation_error").remove(), $("." + t).find("input[type='text']").after('<span class="validation_error error_span">Enter valid date format mm/dd/yyyy</span>')) : ($("." + t).removeClass("validation_error"), $("." + t).find(".validation_error").remove())
} else "/" !== e[2] || "/" !== e[4] ? ($("." + t).addClass("validation_error"), $("." + t).find(".validation_error").remove(), $("." + t).find("input[type='text']").after('<span class="validation_error error_span">Enter valid date format mm/dd/yyyy</span>')) : ($("." + t).removeClass("validation_error"), $("." + t).find(".validation_error").remove());
else $("." + t).addClass("validation_error"), $("." + t).find(".validation_error").remove(), $("." + t).find("input[type='text']").after('<span class="validation_error error_span">Enter valid date format mm/dd/yyyy</span>')
} else $("." + t).find("input[type='text']").length && !$("." + t).find("input[name^='properties']").val() && $("." + t).hasClass("required") ? ($("." + t).addClass("validation_error"), $("." + t).find(".validation_error").remove()) : ($("." + t).find(".validation_error").remove(), $("." + t).removeClass("validation_error"));
else if ("ta_render" == i) $("." + t).find("textarea").length && !$("." + t).find("input[name^='properties']").val() && $("." + t).hasClass("required") ? $("." + t).addClass("validation_error") : $("." + t).removeClass("validation_error");
else if ("rb_render" == i) $("." + t).removeClass("validation_error");
else if ("fu_render" == i) $("." + t).find("input[type='file']").length && !$("." + t).find("input[name^='properties']").val() && $("." + t).hasClass("required") ? $("." + t).addClass("validation_error") : $("." + t).removeClass("validation_error");
else if ("pn_render" == i) $("." + t).find("input[type='textbox']").length && !$("." + t).find("input[name^='properties']").val() && $("." + t).hasClass("required") ? ($("." + t).addClass("validation_error"), good = !1) : $("." + t).find(".phone_number").hasClass("error") ? ($("." + t).addClass("validation_error"), good = !1) : $("." + t).removeClass("validation_error");
else if ("et_render" == i)
if ($("." + t).find("input[type='email']").length && ($("." + t).find("input[name^='properties']").val() && $("." + t).hasClass("required") || "" != $("." + t).find("input[type='email']").val().length)) {
var o = $("." + t).find("input[type='email']").val();
/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test(o) ? $("." + t).removeClass("validation_error") : $("." + t).addClass("validation_error")
} else $("." + t).removeClass("validation_error")
};
var hulk_flag = 0;
$(document).on("click", ".hulkapps_submit_cart", function (t) {
if (0 == hulk_flag) {
t.preventDefault();
validate_options(window.hulkapps.product_id) && ($("[name^='properties']").each(function () {
"" == $(this).val() && $(this).attr("disabled", !0)
}), hulk_flag = 1, $(".hulkapps_submit_cart").click())
}
})
}
}


function checkPlan(t, i, e, a) {
return is_allowed = !0, t && i && a && e && a[e] ? ("string" == jQuery.type(a) && (a = JSON.parse(a)), 0 == a[e][t] && "boolean" == i && (is_allowed = !1)) : is_allowed = !1, is_allowed
}
start(), void 0 !== window.hulkapps && ("undefined" == typeof jQuery || 3 == parseInt(jQuery.fn.jquery) && parseFloat(jQuery.fn.jquery.replace(/^1\./, "")) < 2.1 ? loadScript("//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js", function () {
jQuery321 = jQuery.noConflict(!0), checkAppInstalled(jQuery321)
}) : checkAppInstalled(jQuery));



document.addEventListener("DOMContentLoaded", () => {
document.addEventListener("click", showSafety);

let allLabels = document.querySelectorAll("label");

allLabels.forEach((lbl) => {
lbl.addEventListener("click", showSafety)
})

function showSafety() {
if (document.querySelector("#calculated_option_total")) {
let calPrice = Number(document.querySelector("#calculated_option_total").innerHTML);
let outputEl = document.querySelector("#cryptedopinion");
let progress = document.getElementById("progressopinion");
progress.setAttribute("class", "red");
if (calPrice == 0) {
outputEl.innerHTML = "Ungeschützt";
outputEl.style.color = "red"
progress.setAttribute("value", "0");
progress.setAttribute("class", "");
} else if (calPrice < 200) {
outputEl.innerHTML = "Nicht sicher";
outputEl.style.color = "red"
progress.setAttribute("value", "25");
progress.setAttribute("class", "red");
} else if (calPrice > 200 && calPrice < 350) {
outputEl.innerHTML = "Relativ sicher";
outputEl.style.color = "orange"
progress.setAttribute("value", "50");
progress.setAttribute("class", "orange");
} else if (calPrice > 350 && calPrice < 500) {
outputEl.innerHTML = "Sicher";
outputEl.style.color = "yellow"
progress.setAttribute("value", "75");
progress.setAttribute("class", "yellow");
} else if (calPrice > 500) {
outputEl.innerHTML = "Sehr sicher";
outputEl.style.color = "green"
progress.setAttribute("value", "100");
progress.setAttribute("class", "green");
}
}
}

showSafety();
})

Back to list