Advertisement
vapvarun

woofunnels-aero-checkout-assets-js

Jun 4th, 2020
1,161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. "use strict";
  2. function _createSuper(e) {
  3.     return function () {
  4.         var a,
  5.             t = _getPrototypeOf(e);
  6.         if (_isNativeReflectConstruct()) {
  7.             var o = _getPrototypeOf(this).constructor;
  8.             a = Reflect.construct(t, arguments, o);
  9.         } else a = t.apply(this, arguments);
  10.         return _possibleConstructorReturn(this, a);
  11.     };
  12. }
  13. function _possibleConstructorReturn(e, a) {
  14.     return !a || ("object" !== _typeof(a) && "function" != typeof a) ? _assertThisInitialized(e) : a;
  15. }
  16. function _assertThisInitialized(e) {
  17.     if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  18.     return e;
  19. }
  20. function _isNativeReflectConstruct() {
  21.     if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  22.     if (Reflect.construct.sham) return !1;
  23.     if ("function" == typeof Proxy) return !0;
  24.     try {
  25.         return Date.prototype.toString.call(Reflect.construct(Date, [], function () {})), !0;
  26.     } catch (e) {
  27.         return !1;
  28.     }
  29. }
  30. function _getPrototypeOf(e) {
  31.     return (_getPrototypeOf = Object.setPrototypeOf
  32.         ? Object.getPrototypeOf
  33.         : function (e) {
  34.               return e.__proto__ || Object.getPrototypeOf(e);
  35.           })(e);
  36. }
  37. function _inherits(e, a) {
  38.     if ("function" != typeof a && null !== a) throw new TypeError("Super expression must either be null or a function");
  39.     (e.prototype = Object.create(a && a.prototype, { constructor: { value: e, writable: !0, configurable: !0 } })), a && _setPrototypeOf(e, a);
  40. }
  41. function _setPrototypeOf(e, a) {
  42.     return (_setPrototypeOf =
  43.         Object.setPrototypeOf ||
  44.         function (e, a) {
  45.             return (e.__proto__ = a), e;
  46.         })(e, a);
  47. }
  48. function _classCallCheck(e, a) {
  49.     if (!(e instanceof a)) throw new TypeError("Cannot call a class as a function");
  50. }
  51. function _defineProperties(e, a) {
  52.     for (var t = 0; t < a.length; t++) {
  53.         var o = a[t];
  54.         (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
  55.     }
  56. }
  57. function _createClass(e, a, t) {
  58.     return a && _defineProperties(e.prototype, a), t && _defineProperties(e, t), e;
  59. }
  60. function _typeof(e) {
  61.     "@babel/helpers - typeof";
  62.     return (_typeof =
  63.         "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
  64.             ? function (e) {
  65.                   return typeof e;
  66.               }
  67.             : function (e) {
  68.                   return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  69.               })(e);
  70. }
  71. !(function (e) {
  72.     (wfacp_frontend.hooks = {
  73.         hooks: { action: {}, filter: {} },
  74.         addAction: function (e, a, t, o) {
  75.             this.addHook("action", e, a, t, o);
  76.         },
  77.         addFilter: function (e, a, t, o) {
  78.             this.addHook("filter", e, a, t, o);
  79.         },
  80.         doAction: function (e) {
  81.             this.doHook("action", e, arguments);
  82.         },
  83.         applyFilters: function (e) {
  84.             return this.doHook("filter", e, arguments);
  85.         },
  86.         removeAction: function (e, a) {
  87.             this.removeHook("action", e, a);
  88.         },
  89.         removeFilter: function (e, a, t) {
  90.             this.removeHook("filter", e, a, t);
  91.         },
  92.         addHook: function (e, a, t, o, n) {
  93.             void 0 == this.hooks[e][a] && (this.hooks[e][a] = []);
  94.             var r = this.hooks[e][a];
  95.             void 0 == n && (n = a + "_" + r.length), void 0 == o && (o = 10), this.hooks[e][a].push({ tag: n, callable: t, priority: o });
  96.         },
  97.         doHook: function (e, a, t) {
  98.             if (((t = Array.prototype.slice.call(t, 1)), void 0 != this.hooks[e][a])) {
  99.                 var o,
  100.                     n = this.hooks[e][a];
  101.                 n.sort(function (e, a) {
  102.                     return e.priority - a.priority;
  103.                 });
  104.                 for (var r = 0; r < n.length; r++) "function" != typeof (o = n[r].callable) && (o = window[o]), "action" == e ? o.apply(null, t) : (t[0] = o.apply(null, t));
  105.             }
  106.             if ("filter" == e) return t[0];
  107.         },
  108.         removeHook: function (e, a, t, o) {
  109.             if (void 0 != this.hooks[e][a]) for (var n = this.hooks[e][a], r = n.length - 1; r >= 0; r--) (void 0 != o && o != n[r].tag) || (void 0 != t && t != n[r].priority) || n.splice(r, 1);
  110.         },
  111.     }),
  112.         (e.wfacp_step_scrolling = function (a) {
  113.             a.length && e("html, body").animate({ scrollTop: a.offset().top - 100 }, 700);
  114.         }),
  115.         void 0 === e.fn.block && ((e.fn.block = function (e) {}), (e.fn.unblock = function (e) {}), (e.scroll_to_notices = function () {}));
  116. })(jQuery),
  117.     (function (e) {
  118.         var a,
  119.             t = { message: wfacp_frontend.hooks.applyFilters("wfacp_block_message", null), overlayCSS: { background: "#fff", opacity: 0.6 } },
  120.             o = window.innerWidth,
  121.             n = !1,
  122.             r = 0 === parseFloat(wfacp_frontend.cart_total),
  123.             i = "1" == wfacp_frontend.cart_is_virtual,
  124.             c = !1,
  125.             s = e(".wfacp_err_message"),
  126.             _ = e("form.checkout"),
  127.             p = Object.create(wfacp_frontend.settings),
  128.             l = !1,
  129.             d = null,
  130.             f = null,
  131.             u = null,
  132.             w = !1,
  133.             h = {
  134.                 init: function () {
  135.                     e(document.body).off("click", ".woocommerce-remove-coupon").on("click", ".woocommerce-remove-coupon", this.remove_coupon),
  136.                         e(document.body).on("click", ".wfacp_main_showcoupon", h.show_coupon_form),
  137.                         e("form.checkout_coupon").off("submit").on("submit", this.submit);
  138.                 },
  139.                 submit: function (a) {
  140.                     if ((a.preventDefault(), "undefined" != typeof wc_checkout_params)) {
  141.                         var o = e(this);
  142.                         return "" === o.find('input[name="coupon_code"]').val()
  143.                             ? (o.find('input[name="coupon_code"]').addClass("wfacp_coupon_failed_error"), !1)
  144.                             : (o.find('input[name="coupon_code"]').removeClass("wfacp_coupon_failed_error"),
  145.                               !o.is(".processing") &&
  146.                                   (o.hasClass("wfacp_layout_shopcheckout") ? o.addClass("processing").children(".wfacp_coupon_row").block(t) : o.addClass("processing").block(t),
  147.                                   e(".wfacp_coupon_msg").html("").show(),
  148.                                   wfacp_send_ajax({ action: "apply_coupon", type: "post", data: { coupon_code: o.find('input[name="coupon_code"]').val(), wfacp_id: e("._wfacp_post_id").val() } }, function (a) {
  149.                                       var t = e(".wfacp_coupon_msg");
  150.                                       if (
  151.                                           (t.html("").show(),
  152.                                           o.hasClass("wfacp_layout_shopcheckout") ? o.removeClass("processing").children(".wfacp_coupon_row").unblock() : o.removeClass("processing").unblock(),
  153.                                           e(".woocommerce-error, .woocommerce-message").remove(),
  154.                                           e(document.body).trigger("wfacp_coupon_apply", [a]),
  155.                                           a.hasOwnProperty("message"))
  156.                                       ) {
  157.                                           var n = a.message;
  158.                                           if (n.hasOwnProperty("error")) {
  159.                                               var r = n.error;
  160.                                               if (r.length > 0)
  161.                                                   for (var i = 0; i < r.length > 0; i++) {
  162.                                                       var c = r[i],
  163.                                                           s = r[i];
  164.                                                       "object" == _typeof(c) && c.hasOwnProperty("notice") && (s = c.notice), t.prepend('<div class="woocommerce-error wfacp_error" role="alert">' + s + "</div>");
  165.                                                   }
  166.                                           }
  167.                                           if (n.hasOwnProperty("success")) {
  168.                                               var _ = n.success;
  169.                                               if (_.length > 0)
  170.                                                   for (var p = 0; p < _.length > 0; p++) {
  171.                                                       var l = _[p],
  172.                                                           d = _[p];
  173.                                                       "object" == _typeof(l) && l.hasOwnProperty("notice") && (d = l.notice), t.prepend('<div class="woocommerce-message wfacp_sucuss" role="alert">' + d + "</div>");
  174.                                                   }
  175.                                           }
  176.                                           update_fragments(a);
  177.                                       }
  178.                                   }),
  179.                                   !1));
  180.                     }
  181.                     console.log("Coupon functionality not working in preview mode");
  182.                 },
  183.                 show_coupon_form: function (a) {
  184.                     a.preventDefault();
  185.                     var t = e(this).parents(".wfacp_woocommerce_form_coupon").find("form.woocommerce-form-coupon");
  186.                     if (t.hasClass("wfacp_display_block")) {
  187.                         t.removeClass("wfacp_display_block");
  188.                         var o = ["wfacp_desktop_view", "wfacp_tablet_view", "wfacp_mobile_view"];
  189.                         for (var n in o) t.parent(".wfacp_mini_cart_classes").hasClass(o[n]) && t.parent(".wfacp_mini_cart_classes").removeClass(o[n]);
  190.                     }
  191.                     return (
  192.                         t.slideToggle(400, function () {
  193.                             t.find(".wfacp-form-control").focus();
  194.                         }),
  195.                         !1
  196.                     );
  197.                 },
  198.                 remove_coupon: function (a) {
  199.                     if ((a.preventDefault(), "undefined" != typeof wc_checkout_params)) {
  200.                         var o = e(this).parents(".woocommerce-checkout-review-order"),
  201.                             n = e(this).data("coupon");
  202.                         o.addClass("processing").block(t);
  203.                         var r = { security: wc_checkout_params.remove_coupon_nonce, coupon: n },
  204.                             i = e(".wfacp_coupon_msg");
  205.                         e.ajax({
  206.                             type: "POST",
  207.                             url: wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%", "remove_coupon"),
  208.                             data: r,
  209.                             success: function (a) {
  210.                                 if ((e(".woocommerce-error, .woocommerce-message").remove(), o.removeClass("processing").unblock(), a)) {
  211.                                     v(n), i.length > 0 ? i.html(a) : e(".wfacp_layout_9_coupon_error_msg").html(a), e(document.body).trigger("update_checkout", { update_shipping_method: !1 });
  212.                                     var t = e("form.checkout_coupon").find('input[name="coupon_code"]');
  213.                                     t.val(""), t.parent(".wfacp-input-form").removeClass("wfacp-anim-wrap");
  214.                                 }
  215.                                 e("form.woocommerce-form-coupon:visible").length > 0 && e.scroll_to_notices(e(".wfacp_main_form")), e(document.body).trigger("wfacp_coupon_form_removed", [a]);
  216.                             },
  217.                             error: function () {
  218.                                 wc_checkout_params.debug_mode;
  219.                             },
  220.                             dataType: "html",
  221.                         });
  222.                     } else console.log("Coupon functionality not working in preview mode");
  223.                 },
  224.             },
  225.             m = {
  226.                 init: function () {
  227.                     e(".wfacp_woocommerce_form_coupon");
  228.                     e(document.body).on("keyup focus", ".wfacp_coupon_code", m.onenter),
  229.                         e(document.body).on("change focusout", ".wfacp_coupon_code", m.remove_class),
  230.                         e(document.body).on("click", ".wfacp_showcoupon", m.show_coupon_form),
  231.                         e(document.body).on("click", ".wfacp-coupon-field-btn", m.apply_coupon),
  232.                         e(document.body).on("click", ".wfacp_remove_coupon", m.remove_coupon);
  233.                 },
  234.                 onenter: function (e) {
  235.                     _.addClass("processing");
  236.                 },
  237.                 remove_class: function () {
  238.                     _.removeClass("processing");
  239.                 },
  240.                 show_coupon_form: function (a) {
  241.                     a.preventDefault();
  242.                     var t = e(this).parents(".wfacp_woocommerce_form_coupon");
  243.                     return (
  244.                         t.find(".wfacp_coupon_field_box").slideToggle(400, function () {
  245.                             t.find(".wfacp_coupon_field_box").addClass("wfacp_coupon_collapsed"), t.find(".wfacp_coupon_field_box").find(":input:eq(0)").focus();
  246.                         }),
  247.                         !1
  248.                     );
  249.                 },
  250.                 apply_coupon: function () {
  251.                     if ("undefined" != typeof wc_checkout_params) {
  252.                         m.remove_class();
  253.                         var a = e(this).parents(".wfacp_woocommerce_form_coupon");
  254.                         if (a.is(".processing")) return !1;
  255.                         var o = a.find(".wfacp_coupon_error_msg"),
  256.                             n = a.find(".wfacp_coupon_code").val();
  257.                         return "" === n
  258.                             ? (a.removeClass("wfacp_coupon_success"), void a.addClass("wfacp_coupon_failed"))
  259.                             : (a.removeClass("wfacp_coupon_success"),
  260.                               a.removeClass("wfacp_coupon_failed"),
  261.                               a.addClass("processing").find(".wfacp_coupon_field_box").block(t),
  262.                               wfacp_send_ajax({ action: "apply_coupon", type: "post", data: { coupon_code: n, wfacp_id: e("._wfacp_post_id").val() } }, function (t) {
  263.                                   if (
  264.                                       (e(".woocommerce-error, .woocommerce-message").remove(),
  265.                                       a.removeClass("processing").find(".wfacp_coupon_field_box").unblock(),
  266.                                       a.find(".wfacp-anim-wrap").removeClass("wfacp-anim-wrap"),
  267.                                       e(document.body).trigger("wfacp_coupon_apply", [t]),
  268.                                       t.hasOwnProperty("message"))
  269.                                   ) {
  270.                                       var n = t.message;
  271.                                       if (n.hasOwnProperty("error")) {
  272.                                           var r = n.error;
  273.                                           if (r.length > 0)
  274.                                               for (var i = 0; i < r.length > 0; i++) {
  275.                                                   var c = r[i],
  276.                                                       s = r[i];
  277.                                                   "object" == _typeof(c) && c.hasOwnProperty("notice") && (s = c.notice), o.html('<div class="woocommerce_single_error_message" role="alert">' + s + "</div>");
  278.                                               }
  279.                                           a.addClass("wfacp_coupon_failed"),
  280.                                               setTimeout(
  281.                                                   function (e) {
  282.                                                       e.html("");
  283.                                                   },
  284.                                                   4e3,
  285.                                                   o
  286.                                               );
  287.                                       } else a.addClass("wfacp_coupon_success"), a.find(".wfacp_coupon_code").val("");
  288.                                   }
  289.                                   update_fragments(t);
  290.                               }),
  291.                               !1);
  292.                     }
  293.                     console.log("Coupon functionality not working in preview mode");
  294.                 },
  295.                 remove_coupon: function (a) {
  296.                     if ((a.preventDefault(), "undefined" != typeof wc_checkout_params)) {
  297.                         m.remove_class();
  298.                         var o = e(this).parents(".wfacp_woocommerce_form_coupon"),
  299.                             n = e(this).parent(".wfacp_single_coupon_msg");
  300.                         o.addClass("processing").find(".wfacp_coupon_field_box").block(t);
  301.                         var r = e(this).data("coupon"),
  302.                             i = { security: wc_checkout_params.remove_coupon_nonce, coupon: r };
  303.                         o.removeClass("wfacp_coupon_success"),
  304.                             o.removeClass("wfacp_coupon_failed"),
  305.                             e.ajax({
  306.                                 type: "POST",
  307.                                 url: wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%", "remove_coupon"),
  308.                                 data: i,
  309.                                 success: function (a) {
  310.                                     if ((e(".woocommerce-error, .woocommerce-message").remove(), n.remove(), o.removeClass("processing").find(".wfacp_coupon_field_box").unblock(), a)) {
  311.                                         v(r);
  312.                                         var t = e("<div>" + a + "</div>");
  313.                                         o.find(".wfacp_coupon_remove_msg").html(t.text()),
  314.                                             e(document.body).trigger("update_checkout", { update_shipping_method: !1 }),
  315.                                             e("form.checkout_coupon").find('input[name="coupon_code"]').val(""),
  316.                                             setTimeout(
  317.                                                 function () {
  318.                                                     o.find(".wfacp_coupon_remove_msg").html("");
  319.                                                 },
  320.                                                 4e3,
  321.                                                 o
  322.                                             );
  323.                                     }
  324.                                     e(document.body).trigger("wfacp_coupon_form_removed", [a]);
  325.                                 },
  326.                                 error: function (e) {},
  327.                                 dataType: "html",
  328.                             });
  329.                     } else console.log("Coupon functionality not working in preview mode");
  330.                 },
  331.             },
  332.             v = function (a) {
  333.                 var t = e('[data-coupon="' + a + '"]');
  334.                 console.log("dat_coupon", t), t.length > 0 && (t.parents("tr").remove(), t.parents(".woocommerce-message1.wfacp_coupon_success").remove(), t.parents(".wfacp_single_coupon_msg").remove());
  335.             },
  336.             g = function (a) {
  337.                 if (a.hasOwnProperty("cart_is_virtual") && i !== a.cart_is_virtual) {
  338.                     var t = e("#shipping_same_as_billing_field");
  339.                     t.length > 0 && (1 == t.is(":visible") && 1 == a.cart_is_virtual ? (t.hide(), e("#shipping_same_as_billing").prop("checked", !1).trigger("change")) : t.show());
  340.                     var o = { previous: i, current: a.cart_is_virtual };
  341.                     wfacp_frontend.hooks.doAction("wfacp_cart_behaviour_changed", o), (i = a.cart_is_virtual);
  342.                 }
  343.             };
  344.         function y() {
  345.             if (e(".wfacp_qv-main table.variations").length > 0) {
  346.                 var a = e(".wfacp_qv-main .wfacp_qv-images").innerHeight();
  347.                 e(".wfacp_qv-main").animate({ scrollTop: a });
  348.             }
  349.             e("form.variations_form.cart .variations").removeClass("wfacp_animate_shake"),
  350.                 setTimeout(function () {
  351.                     e("form.variations_form.cart .variations").addClass("wfacp_animate_shake");
  352.                 }, 500);
  353.         }
  354.         function b() {
  355.             var a = e(".variations_form");
  356.             a.on("hide_variation", function (a) {
  357.                 e(".wfacp_qv-summary .quantity").hide(), e(".wfacp_option_btn").show();
  358.                 e(this).find(".wfacp_single_add_to_cart_button").text();
  359.                 var t = wfacp_frontend.select_options_text;
  360.                 "" != wfacp_frontend.select_options_text && (t = wfacp_frontend.select_options_text),
  361.                     e(this).find(".wfacp_single_add_to_cart_button").text(t),
  362.                     e("#wfacp_qr_model_wrap .wfacp_option_btn").click(function () {
  363.                         y();
  364.                     });
  365.             }),
  366.                 a.on("show_variation", function (a, t) {
  367.                     var o = t.variation_id,
  368.                         n = JSON.stringify(t);
  369.                     (wfacp_storage.variation_data[o] = JSON.parse(n)), j(o);
  370.                     e(this).find(".wfacp_single_add_to_cart_button").text();
  371.                     e(this).find(".wfacp_single_add_to_cart_button").text(), e(".wfacp_qv-summary .quantity").show();
  372.                     var r = "";
  373.                     (r = "" == e("#wfacp_qr_model_wrap").data("cart-key") ? wfacp_frontend.add_to_cart_text : wfacp_frontend.update_button_text), e(this).find(".wfacp_single_add_to_cart_button").text(r), e(".wfacp_option_btn").hide();
  374.                 });
  375.         }
  376.         function k() {
  377.             var a = e(".wfacp_incomplete_variation");
  378.             return (
  379.                 !(a.length > 0) ||
  380.                 (e.scroll_to_notices(a.eq(0)),
  381.                 setTimeout(function () {
  382.                     a.addClass("wfacp_animate_shake"),
  383.                         setTimeout(function () {
  384.                             a.removeClass("wfacp_animate_shake");
  385.                         }, 500);
  386.                 }, 1e3),
  387.                 !1)
  388.             );
  389.         }
  390.         function C() {
  391.             if (o > 767 && e("body").hasClass("wfacp_cls_layout_9") && e(".wfacp_outside_header").length > 0) {
  392.                 var a,
  393.                     t = e(window).height(),
  394.                     n = e(".wfacp-form").innerHeight() + (a = e(".wfacp-form .wfacp_inner_footer_m").innerHeight()),
  395.                     r = t - e(".wfacp-form").innerHeight();
  396.                 if (t > n) {
  397.                     e(".wfacp-left-wrapper").css("padding-bottom", r), e(".wfacp_footer_n").hasClass() || (e(".wfacp-form").css("padding-bottom", a), e(".wfacp_inner_footer_m").addClass("wfacp_change_position"));
  398.                 } else e(".wfacp-left-wrapper").css("padding-bottom", 0), e(".wfacp-form").css("padding-bottom", 0), e(".wfacp_inner_footer_m").removeClass("wfacp_change_position");
  399.             }
  400.         }
  401.         function x(a) {
  402.             var t = a.data("current-step"),
  403.                 o = a.data("next-step"),
  404.                 n = e(".wfacp_page." + t),
  405.                 r = e(".wfacp_page." + o),
  406.                 i = n.data("step"),
  407.                 c = r.data("step");
  408.             !(function (a, t) {
  409.                 e("body").hasClass(a) && (e("body").removeClass(a), e("body").addClass(t));
  410.             })(i, c);
  411.             var s = !1;
  412.             if ((r.hasClass("wfacp_last_page") && (s = !0), e(".wfacp_steps_sec ul").length > 0)) {
  413.                 e(".wfacp_bred." + t).removeClass("wfacp_bred_active ");
  414.                 var _ = e(".wfacp_bred." + o);
  415.                 _.addClass("wfacp_bred_active wfacp_bred_visited"), _.children(".wfacp_step_text_have").length > 0 && z(_.children(".wfacp_step_text_have"));
  416.                 var p = _.find("a").data("text");
  417.                 "" === p && (p = o), "yes" === wfacp_frontend.enable_hashtag_for_multistep_checkout && window.location.assign("#" + p);
  418.             }
  419.             var d = e(".wfacp_payment");
  420.             e.wfacp_step_scrolling(e(".wfacp_main_form"));
  421.             var f = { hide_parent: t, next_shown: o, previous_step: i, current_step: c, last_step: s };
  422.             if (!1 === l) {
  423.                 var u = r.find("#shipping_country");
  424.                 u.length > 0 && (u.parents(".wfacp-form-control-wrapper").is(":visible") && (e("#ship-to-different-address-checkbox").prop("checked", !0), (l = !0)), u.trigger("change"));
  425.             }
  426.             n.fadeOut(300, function () {
  427.                 s ? (d.removeClass("wfacp_hide_payment_part"), d.addClass("wfacp_show_payment_part")) : (d.addClass("wfacp_hide_payment_part"), d.removeClass("wfacp_show_payment_part")),
  428.                     r.fadeIn(600, function () {
  429.                         0 === r.find("#shipping_method li").length && update_checkout(),
  430.                             e(".country_to_state").length > 0 && e(document.body).trigger("country_to_state_changed"),
  431.                             e("." + c + " .wfacp-row .form-row").each(function () {
  432.                                 var a = e(this);
  433.                                 (a.hasClass("wfacp_drop_list") || a.hasClass("wfacp_add_select_2")) &&
  434.                                     a.length > 0 &&
  435.                                     a.find("select").hasClass("select2-hidden-accessible") &&
  436.                                     (a.hasClass("wfacp_custom_field_multiselect") ? a.find("select").select2() : a.find("select").select2("destroy"));
  437.                             }),
  438.                             C(),
  439.                             e("." + c).find(".wfacp_divider_billing").length > 0 &&
  440.                                 e("." + c)
  441.                                     .find(".wfacp_divider_billing .form-row")
  442.                                     .each(function () {
  443.                                         var a = e(this).attr("id");
  444.                                         if ("" != a) {
  445.                                             var t = a.replace("_field", ""),
  446.                                                 o = e("#" + t).val();
  447.                                             "" == o || null == o || e(this).hasClass("wfacp-anim-wrap") || e(this).addClass("wfacp-anim-wrap");
  448.                                         }
  449.                                     }),
  450.                             e("." + c).find(".wfacp_divider_shipping").length > 0 &&
  451.                                 e("." + c)
  452.                                     .find(".wfacp_divider_shipping .form-row")
  453.                                     .each(function () {
  454.                                         var a = e(this).attr("id");
  455.                                         if ("" != a) {
  456.                                             var t = a.replace("_field", ""),
  457.                                                 o = e("#" + t).val();
  458.                                             "" == o || null == o || e(this).hasClass("wfacp-anim-wrap") || e(this).addClass("wfacp-anim-wrap");
  459.                                         }
  460.                                     });
  461.                     });
  462.             }),
  463.                 B(),
  464.                 e(document.body).trigger("wfacp_step_switching", f);
  465.         }
  466.         function q() {
  467.             e(document.body).trigger("country_to_state_changed"), update_checkout();
  468.         }
  469.         function O(a, t) {
  470.             e(".wfacp_qv-inner-modal").css("opacity", "0").addClass(t);
  471.         }
  472.         function F(a, t) {
  473.             !(function (a, t, n, r) {
  474.                 wfacp_send_ajax({ action: "quick_view_ajax", type: "post", data: a }, function (i) {
  475.                     if (1 == i.status) {
  476.                         e(".wfacp_qv-modal").html(i.html),
  477.                             t(n, r),
  478.                             (wc_single_product_params.flexslider_enabled = !0),
  479.                             (wc_single_product_params.photoswipe_enabled = !0),
  480.                             (wc_single_product_params.zoom_enabled = !0),
  481.                             e(".woocommerce-product-gallery").each(function () {
  482.                                 e(this).wc_product_gallery();
  483.                             }),
  484.                             e(".wfacp_qv-panel").find(".variations_form").wc_variation_form(),
  485.                             e(".wfacp_qv-panel .variations_form select").change(),
  486.                             a.hasOwnProperty("variation_id") &&
  487.                                 (function (a) {
  488.                                     if (!window.wfacp_storage.variation_data.hasOwnProperty(a)) return !1;
  489.                                     var t = window.wfacp_storage.variation_data[a];
  490.                                     if (0 === Object.keys(t).length) return !1;
  491.                                     var o = t.attributes;
  492.                                     if (0 === Object.keys(o).length) return !1;
  493.                                     for (var n in o) {
  494.                                         var r = e("#" + n);
  495.                                         if (r.length > 0) {
  496.                                             var i = o[n];
  497.                                             r.val(i);
  498.                                         }
  499.                                     }
  500.                                 })(a.variation_id),
  501.                             b(),
  502.                             o < 600 &&
  503.                                 setTimeout(function () {
  504.                                     y();
  505.                                 }, 600);
  506.                         var c = e('.wfacp_product_row[data-item-key="' + a.item_key + '"]');
  507.                         if (0 === c.length) return;
  508.                         var s = e(".wfacp_qv-summary .product_title");
  509.                         if (s.length > 0) {
  510.                             var _ = c.find(".wfacp_product_choosen_label").html();
  511.                             s.html(_);
  512.                         }
  513.                         var p = e(".wfacp_qv-summary .price");
  514.                         if (p.length > 0) {
  515.                             var l = c.find(".product-price").html();
  516.                             p.html(l);
  517.                         }
  518.                         var d = e(".wfacp_qv-summary [name=quantity]");
  519.                         if (d.length > 0) {
  520.                             var f = c.find(".wfacp_product_switcher_quantity");
  521.                             f.length > 0 && d.val(f.val());
  522.                         }
  523.                         var u,
  524.                             w = e(".wfacp_qv-images"),
  525.                             h = w.find(".woocommerce-product-gallery__image");
  526.                         if (
  527.                             (h.length > 0 ? ((h = w.find(".woocommerce-product-gallery__image").eq(0)), (u = h.find("img").data("large_image"))) : ((h = w.find(".woocommerce-product-gallery__wrapper")), (u = h.find("img").attr("src"))),
  528.                             void 0 !== u)
  529.                         ) {
  530.                             var m = new Image();
  531.                             (m.src = u),
  532.                                 (m.onload = function () {
  533.                                     e(".wfacp_qv-pl-active").removeClass("wfacp_qv-pl-active");
  534.                                 });
  535.                         } else e(".wfacp_qv-pl-active").removeClass("wfacp_qv-pl-active");
  536.                     } else e(".wfacp_qv-close").trigger("click");
  537.                 });
  538.             })(a, O, null, "wfacp_qv-animation-fadein");
  539.         }
  540.         function P(a) {
  541.             a.preventDefault(),
  542.                 e.each(a.target.classList, function (a, t) {
  543.                     ("wfacp_qv-close" !== t && "wfacp_qv-inner-modal" !== t) || (e(".wfacp_qv-opac").hide(), e(".wfacp_qv-panel").removeClass("wfacp_qv-panel-active"), e(".wfacp_qv-modal").html(""));
  544.                 });
  545.         }
  546.         function j(a) {
  547.             if (!window.wfacp_storage.variation_data.hasOwnProperty(a)) return {};
  548.             var t = window.wfacp_storage.variation_data[a];
  549.             if (0 === Object.keys(t).length) return {};
  550.             var o = t.attributes;
  551.             if (0 === Object.keys(o).length) return {};
  552.             var n = {};
  553.             for (var r in o) {
  554.                 var i = e('[data-attribute_name="' + r + '"]');
  555.                 i.length > 0 && ((n[r] = i.val()), (window.wfacp_storage.variation_data[a].attributes[r] = i.val()));
  556.             }
  557.             return n;
  558.         }
  559.         function S(a, t) {
  560.             var o = e(".wfacp_qv-summary .variation_id").val();
  561.             o > 0 && a.attr("variation_id", o);
  562.             var n = j(o),
  563.                 r = a.find("[name=wfacp_product_choosen]").attr("type"),
  564.                 i = a.attr("cart_key"),
  565.                 c = { variation_id: o, quantity: 1, attributes: n };
  566.             if ("hidden" === r || "checkbox" === r) {
  567.                 var s = {};
  568.                 (s.wfacp_id = e("._wfacp_post_id").val()), (s.new_item = a.data("item-key")), (s.remove_item_key = i), (s.quantity = 1), (s.variation_id = 0), (s.field_type = r), (s = set_variation_data(s, c)), wfacp_product_switch(s);
  569.             } else a.find("[name=wfacp_product_choosen]").prop("checked", !0).trigger("change", c);
  570.         }
  571.         function T(a, t) {
  572.             "1" !== wfacp_frontend.is_customizer &&
  573.                 (("object" == _typeof(t) && t.hasOwnProperty("aero_do_not_state_service")) ||
  574.                     (clearTimeout(f),
  575.                     (f = setTimeout(function () {
  576.                         var a = e("#shipping_postcode").val(),
  577.                             t = e("#shipping_country").val();
  578.                         0 !== e("#shipping_state").length &&
  579.                             void 0 !== a &&
  580.                             "" !== a &&
  581.                             void 0 !== t &&
  582.                             "" !== t &&
  583.                             e.get("//api.zippopotam.us/" + t + "/" + a, function (a) {
  584.                                 if (Object.keys(a).length > 0 && a.hasOwnProperty("places") && a.places.length > 0) {
  585.                                     var t = a.places[0];
  586.                                     if (Object.keys(t).length > 0 && t.hasOwnProperty("state abbreviation")) {
  587.                                         var o = t["state abbreviation"];
  588.                                         if ("" == o) return;
  589.                                         var n = e("#shipping_state option[value=" + o + "]");
  590.                                         if (n.length > 0) {
  591.                                             e("#shipping_state").val(o), e("#shipping_state").parents(".form-row").addClass("wfacp-anim-wrap");
  592.                                             var r = n.text();
  593.                                             e("#select2-shipping_state-container").text(r), update_checkout();
  594.                                         }
  595.                                     }
  596.                                 }
  597.                             });
  598.                     }, 100))));
  599.         }
  600.         function D(a, t) {
  601.             "1" !== wfacp_frontend.is_customizer &&
  602.                 (("object" == _typeof(t) && t.hasOwnProperty("aero_do_not_state_service")) ||
  603.                     (clearTimeout(u),
  604.                     (u = setTimeout(function () {
  605.                         var a = e("#billing_postcode").val(),
  606.                             t = e("#billing_country").val();
  607.                         0 !== e("#billing_state").length &&
  608.                             void 0 !== a &&
  609.                             "" !== a &&
  610.                             void 0 !== t &&
  611.                             "" !== t &&
  612.                             e.get("//api.zippopotam.us/" + t + "/" + a, function (a) {
  613.                                 if (Object.keys(a).length > 0 && a.hasOwnProperty("places") && a.places.length > 0) {
  614.                                     var t = a.places[0];
  615.                                     if (Object.keys(t).length > 0 && t.hasOwnProperty("state abbreviation")) {
  616.                                         var o = t["state abbreviation"];
  617.                                         if ("" == o) return;
  618.                                         var n = e("#billing_state option[value=" + o + "]");
  619.                                         if (n.length > 0) {
  620.                                             e("#billing_state").val(o), e("#billing_state").parents(".form-row").addClass("wfacp-anim-wrap");
  621.                                             var r = n.text();
  622.                                             e("#select2-billing_state-container").text(r), update_checkout();
  623.                                         }
  624.                                     }
  625.                                 }
  626.                             });
  627.                     }, 100))));
  628.         }
  629.         function A() {
  630.             "undefined" != typeof wfacp_variation_attributes_data && null !== wfacp_variation_attributes_data && (wfacp_storage.variation_data = wfacp_variation_attributes_data),
  631.                 (function () {
  632.                     var a = 0;
  633.                     if (o > 480) {
  634.                         var t = e(".div_wrap_sec .wfacp-three-cols"),
  635.                             n = e(".div_wrap_sec .wfacp-two-cols");
  636.                         t.length > 0
  637.                             ? (t.each(function () {
  638.                                   e(this).height() > a && (a = e(this).height());
  639.                               }),
  640.                               t.height(a))
  641.                             : n.length > 0 &&
  642.                               (n.each(function () {
  643.                                   e(this).height() > a && (a = e(this).height());
  644.                               }),
  645.                               n.height(a));
  646.                     }
  647.                 })(),
  648.                 (function () {
  649.                     if (o > 991) {
  650.                         var a = e(".wfacp_cls_layout_1 .wfacp_header .wfacp-container.wfacp-inner-header");
  651.                         if (a.length > 0) {
  652.                             var t = a.height() - e(".wfacp-header").height();
  653.                             e(".wfacp-panel-wrapper").css("margin-top", t);
  654.                         }
  655.                     }
  656.                 })(),
  657.                 e("body").addClass("wfacp_page_loaded");
  658.             var a = e("#billing_country"),
  659.                 t = e("#billing_country_field");
  660.             a.length > 0 && "" !== a.val() && t.addClass("wfacp-anim-wrap");
  661.             var n = e("#billing_state");
  662.             n.length > 0 &&
  663.                 (n.parents(".wfacp-form-control-wrapper").removeClass("woocommerce-invalid-required-field"),
  664.                 "" !== n.val() && n.parents(".wfacp-form-control-wrapper").addClass("wfacp-anim-wrap"),
  665.                 N(e("#billing_state_field"), e("#billing_state").val()));
  666.             var r = e("#shipping_country"),
  667.                 i = e("#shipping_country_field");
  668.             r.length > 0 && (i.removeClass("woocommerce-invalid-required-field"), i.is(":visible") && e("#ship-to-different-address-checkbox").prop("checked", !0), "" !== r.val() && i.addClass("wfacp-anim-wrap"));
  669.             var c = e("#shipping_state");
  670.             c.length > 0 &&
  671.                 (c.parents(".wfacp-form-control-wrapper").removeClass("woocommerce-invalid-required-field"),
  672.                 c.parents(".wfacp-form-control-wrapper").is(":visible") &&
  673.                     (c.parents(".wfacp-form-control-wrapper").removeClass("woocommerce-invalid-required-field"), "" !== c.val() && c.parents(".wfacp-form-control-wrapper").addClass("wfacp-anim-wrap")),
  674.                 setTimeout(function () {
  675.                     N(e("#shipping_state_field"), e("#shipping_state").val());
  676.                 }, 600));
  677.             var s,
  678.                 _,
  679.                 p = e("#billing_shipping_index").val();
  680.             if (
  681.                 ("billing" === p ? e(".wfacp_billing_fields").removeClass("validate-required") : "shipping" === p && e(".wfacp_shipping_fields").removeClass("validate-required"),
  682.                 h.init(),
  683.                 m.init(),
  684.                 (s = e(".wfacp-form-control")),
  685.                 (_ = ["account_password", "password", "username", "user_email", "wfacp_coupon_code_field", "coupon_code"]),
  686.                 (_ = wfacp_frontend.hooks.applyFilters("wfacp_skip_keys_before_localize", _)),
  687.                 s.length > 0 &&
  688.                     wfacp_frontend.hasOwnProperty("autopopulate") &&
  689.                     "yes" === wfacp_frontend.autopopulate &&
  690.                     e(document.body).on("focusout change", ".wfacp-form-control", function () {
  691.                         var a = {};
  692.                         if (
  693.                             (e(document.body)
  694.                                 .find(".wfacp-form-control")
  695.                                 .each(function () {
  696.                                     var t = e(this).attr("id"),
  697.                                         o = e(this).val();
  698.                                     void 0 !== _typeof(t) && null !== o && -1 === e.inArray(t, _) && "" !== o && (a[t] = e(this).val());
  699.                                 }),
  700.                             "undefined" != typeof Storage)
  701.                         )
  702.                             try {
  703.                                 window.localStorage.setItem("wfacp_form_values", JSON.stringify(a));
  704.                             } catch (e) {}
  705.                     }),
  706.                 update_checkout(),
  707.                 "undefined" != typeof wc_address_i18n_params && r.length > 0)
  708.             ) {
  709.                 var l = r.val(),
  710.                     d = wc_address_i18n_params.locale.replace(/&quot;/g, '"');
  711.                 e.parseJSON(d).hasOwnProperty(l) || r.trigger("change");
  712.             }
  713.             e("form.woocommerce-checkout").on("checkout_place_order", function () {
  714.                 if ((e(".woocommerce-NoticeGroup").remove(), !k())) return !1;
  715.                 wfacp_frontend.hooks.doAction("wfacp_checkout_place_order");
  716.             }),
  717.                 B();
  718.         }
  719.         function G() {
  720.             var a = e(".wfacp_select2_country_state");
  721.             a.length > 0 && a.removeClass("wfacp_select2_country_state");
  722.         }
  723.         function N(e, a) {
  724.             (void 0 !== a && "" != a && null != a) || e.removeClass("wfacp-anim-wrap");
  725.         }
  726.         function z(e) {
  727.             e.parent().prev().hasClass("wfacp_active_prev") || e.parent().prev().addClass("wfacp_active_prev"), e.parent().next().hasClass("wfacp_active_prev") && e.parent().next().removeClass("wfacp_active_prev");
  728.         }
  729.         function B() {
  730.             if ("function" == typeof e.fn.select2) {
  731.                 var a = e(".wfacp_select2_custom_field");
  732.                 a.length > 0 && a.select2();
  733.                 var t = e(".wfacp_custom_field_multiselect select");
  734.                 t.length > 0 &&
  735.                     t.each(function () {
  736.                         var a = e(this).data("max-selection"),
  737.                             t = e(this).data("max-error");
  738.                         void 0 == t && (t = "");
  739.                         var o = e(this);
  740.                         void 0 != a && a > 1
  741.                             ? e(this).select2({
  742.                                   maximumSelectionLength: a,
  743.                                   language: {
  744.                                       maximumSelected: function (e) {
  745.                                           return (t = t.replace("{maximum_number}", e.maximum)), (t = wfacp_frontend.hooks.applyFilters("wfacp_multiselect_error_message", t, e, o));
  746.                                       },
  747.                                   },
  748.                               })
  749.                             : e(this).select2();
  750.                     });
  751.             }
  752.         }
  753.         (window.wfacp_haschanges = "no"),
  754.             (window.wfacp_storage = { add_to_cart: {}, analytics_data: wfacp_analytics_data, variation_data: {} }),
  755.             (window.increaseItmQty = function (a) {
  756.                 var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "",
  757.                     o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "",
  758.                     n = e(a),
  759.                     r = n.siblings(".wfacp_product_quantity_number_field"),
  760.                     i = parseInt(r.val(), 10);
  761.                 if (((i = isNaN(i) ? 0 : i), "" !== t)) {
  762.                     show_blocked_mini_cart();
  763.                     var c = e(".wfacp_increase_item[data-item-key=" + t + "]");
  764.                     if (c.length > 0)
  765.                         return void increaseItmQty(c[0], "", function (e) {
  766.                             if (e.hasOwnProperty("error")) {
  767.                                 var a = n.parents(".product-name-area");
  768.                                 wfacp_show_error(a, e);
  769.                             } else;
  770.                         });
  771.                 }
  772.                 i++, r.val(i);
  773.                 var s = n.parents("fieldset.wfacp_product_row");
  774.                 s.find(".wfacp_product_switch").length > 0 && 0 == s.find(".wfacp_product_switch:checked").length ? s.find(".wfacp_product_switch").trigger("click") : r.trigger("change", [o]);
  775.             }),
  776.             (window.decreaseItmQty = function (a) {
  777.                 var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "",
  778.                     o = e(a).siblings(".wfacp_product_quantity_number_field"),
  779.                     n = parseInt(o.val(), 10);
  780.                 if (((n = isNaN(n) ? 0 : n) < 1 && (n = 1), "" !== t && n > 1)) {
  781.                     var r = e(".wfacp_decrease_item[data-item-key=" + t + "]");
  782.                     if (r.length > 0) return show_blocked_mini_cart(), void r.click();
  783.                 }
  784.                 n--, o.val(n), o.trigger("change");
  785.             }),
  786.             (window.show_blocked_mini_cart = function () {
  787.                 e(".wfacp_mini_cart_items").block(t);
  788.             }),
  789.             (window.show_unblocked_mini_cart = function () {
  790.                 e(".wfacp_mini_cart_items").unblock();
  791.             }),
  792.             (window.wfacp_send_ajax = function (a, t) {
  793.                 arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
  794.                 if ("1" !== wfacp_frontend.is_customizer) {
  795.                     var o = wfacp_frontend.admin_ajax;
  796.                     a.hasOwnProperty("url") && (o = a.url),
  797.                         (a.action = "wfacp_" + a.action),
  798.                         wfacp_frontend.hasOwnProperty("wc_endpoints") && wfacp_frontend.wc_endpoints.hasOwnProperty(a.action) && (o = wfacp_frontend.wc_endpoints[a.action]),
  799.                         e("#product_switcher_need_refresh").val(1),
  800.                         e(document.body).trigger(a.action, a);
  801.                     var n = { action: a.action, wfacp_nonce: wfacp_frontend.wfacp_nonce, data: a.data, post_data: e("#wfacp_checkout_form").serialize() };
  802.                     (n = wfacp_frontend.hooks.applyFilters("wfacp_send_ajax_data", n, a.action)),
  803.                         e.ajax({
  804.                             url: o,
  805.                             type: a.type,
  806.                             data: n,
  807.                             success: function (o) {
  808.                                 if (o.hasOwnProperty("force_redirect")) window.location.href = o.force_redirect;
  809.                                 else if (1 != wfacp_frontend.hooks.applyFilters("wfacp_stop_updating_fragments", !1, o, n)) {
  810.                                     if (o.hasOwnProperty("cart_contains_subscription") && 1 == o.cart_contains_subscription) {
  811.                                         var r = e("#createaccount");
  812.                                         r.length > 0 && (r.is(":checked") || r.trigger("click")), e("#wfacp_cart_contains_subscription").val(1);
  813.                                     } else e("#wfacp_cart_contains_subscription").val(0);
  814.                                     g(o),
  815.                                         "function" == typeof t && ((o.action = a.action), t(o)),
  816.                                         "object" == _typeof(o) && o.hasOwnProperty("nonce") && (wfacp_frontend.wfacp_nonce = o.nonce),
  817.                                         o.hasOwnProperty("analytics_data") && e(document.body).trigger("wfacp_checkout_data", { checkout: o.analytics_data });
  818.                                 } else wfacp_frontend.hooks.doAction("wfacp_stop_updating_fragments", o, n);
  819.                             },
  820.                             error: function (e) {
  821.                                 e.hasOwnProperty("status") &&
  822.                                     (403 == e.status
  823.                                         ? console.log("Aero: Page is cached")
  824.                                         : 500 == e.status
  825.                                         ? console.log("Aero: Site Contain fatal error")
  826.                                         : 502 == e.status
  827.                                         ? console.log("Aero: Bad gateway")
  828.                                         : console.log("Aero: Error", e.status));
  829.                             },
  830.                         });
  831.                 } else console.log("stop execution of ajax in customizer for aero checkout");
  832.             }),
  833.             (window.wfacp_submit_error = function (a) {
  834.                 var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
  835.                 console.log(a);
  836.                 var o = e(".checkout.woocommerce-checkout");
  837.                 e(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),
  838.                     o.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">' + a + "</div>"),
  839.                     o.removeClass("processing").unblock(),
  840.                     !0 === t && o.find(".input-text, select, input:checkbox").trigger("validate").blur(),
  841.                     e.scroll_to_notices(e(".woocommerce-NoticeGroup.woocommerce-NoticeGroup-checkout"));
  842.             }),
  843.             (window.wfacp_show_error = function (e, a) {
  844.                 if (0 !== e.length) {
  845.                     e.find(".wfacp_product_switcher_error").remove();
  846.                     var t = e.parents("tr"),
  847.                         o = e.parents("tbody");
  848.                     if ((o.find(".wfacp_ps_error_state").remove(), e.hasClass("product-name-area"))) {
  849.                         t.addClass("wfacp_noborder");
  850.                         var n = "";
  851.                         e.find(".product-name").hasClass("wfacp_summary_img_true") && (n = " wfacp_enable_image "),
  852.                             t.after('<tr class="wfacp_ps_error_state' + n + '" ><td colspan="2"><div class="wfacp_product_switcher_error"style="clear:both">' + a.error + "</div></td></tr>");
  853.                     } else e.append('<div class="wfacp_product_switcher_error"style="clear:both">' + a.error + "</div>");
  854.                     if (a.hasOwnProperty("qty")) {
  855.                         var r = e.find(".wfacp_product_switcher_quantity").data("value"),
  856.                             i = a.qty;
  857.                         parseInt(r) > 0 && (i = r), e.find(".wfacp_product_switcher_quantity").val(i);
  858.                     }
  859.                     setTimeout(
  860.                         function (e) {
  861.                             e.hasClass("product-name-area") ? (o.find(".wfacp_ps_error_state").remove(), t.removeClass("wfacp_noborder")) : e.find(".wfacp_product_switcher_error").remove();
  862.                         },
  863.                         1e5,
  864.                         e
  865.                     );
  866.                 }
  867.             }),
  868.             (window.set_variation_data = function (e, a) {
  869.                 return void 0 !== a && (a.hasOwnProperty("variation_id") && (e.variation_id = a.variation_id), a.hasOwnProperty("quantity") && (e.quantity = a.quantity), a.hasOwnProperty("attributes") && (e.attributes = a.attributes)), e;
  870.             }),
  871.             (window.populate_fields_value = function () {
  872.                 var a = e(".wfacp-form-control");
  873.                 if ("undefined" != typeof Storage && 0 !== a.length && wfacp_frontend.hasOwnProperty("autopopulate") && "yes" === wfacp_frontend.autopopulate) {
  874.                     var t = window.localStorage.getItem("wfacp_form_values");
  875.                     if (null != t && "object" === _typeof((t = JSON.parse(t))) && 0 !== Object.keys(t).length)
  876.                         for (var o in t) {
  877.                             var n = e("#" + o);
  878.                             t.hasOwnProperty(o) && "" !== t[o]
  879.                                 ? (n.val(t[o]), n.parents(".form-row").hasClass("wfacp-anim-wrap") || n.parents(".form-row").addClass("wfacp-anim-wrap"))
  880.                                 : n.parents(".form-row").removeClass("wfacp-anim-wrap");
  881.                         }
  882.                 }
  883.             }),
  884.             (window.wfacp_product_switch = function (a, o) {
  885.                 var n = e(".wfacp-product-switch-panel");
  886.                 n.block(t),
  887.                     (a.you_save = n.data("you-save-text")),
  888.                     (a.is_hide = n.data("is-hide")),
  889.                     e("#product_switcher_need_refresh").val(0),
  890.                     show_blocked_mini_cart(),
  891.                     wfacp_send_ajax({ action: "switch_product_addon", type: "post", data: a }, function (a) {
  892.                         "function" == typeof o && o(a),
  893.                             !1 !== a.status
  894.                                 ? (!0 === a.status &&
  895.                                       void 0 != a.new_cart_key &&
  896.                                       "" != a.new_cart_key &&
  897.                                       setTimeout(function () {
  898.                                           e(document.body).trigger("wfacp_product_added", { item: a.cart_item, item_key: a.item_key, cart_key: a.new_cart_key });
  899.                                       }, 300),
  900.                                   e("#product_switcher_need_refresh").val(1),
  901.                                   update_checkout())
  902.                                 : n.unblock();
  903.                     });
  904.             }),
  905.             (window.update_fragments = function (a) {
  906.                 if (
  907.                     (e(document.body).trigger("wfacp_update_fragments", a),
  908.                     g(a),
  909.                     a.hasOwnProperty("cart_total") && 0 === parseInt(a.cart_total) ? ((r = !0), e(document.body).trigger("wfacp_cart_goes_empty", { cart_total: parseInt(a.cart_total) })) : (r = !1),
  910.                     r)
  911.                 )
  912.                     return (
  913.                         (r = !1),
  914.                         a.hasOwnProperty("fragments") &&
  915.                             e.each(a.fragments, function (a, t) {
  916.                                 e(a).replaceWith(t), e(a).unblock();
  917.                             }),
  918.                         void update_checkout()
  919.                     );
  920.                 a.hasOwnProperty("fragments") &&
  921.                     a.fragments.hasOwnProperty(".cart_total") &&
  922.                     0 === parseFloat(a.fragments[".cart_total"]) &&
  923.                     (e(document.body).trigger("wfacp_cart_goes_empty", { cart_total: parseFloat(a.cart_total) }), update_checkout()),
  924.                     a.hasOwnProperty("fragments") &&
  925.                         e.each(a.fragments, function (a, t) {
  926.                             e(a).replaceWith(t), e(a).unblock();
  927.                         }),
  928.                     e(document.body).trigger("wfacp_after_fragment_received", { response: a });
  929.             }),
  930.             (window.update_checkout = function (a) {
  931.                 /*
  932.                 Commented code for multipal time call update checkbox function
  933.                 (a = void 0 !== a ? parseInt(a) : 1e3),
  934.                     !1 === c &&
  935.                         (clearTimeout(d),
  936.                         (d = setTimeout(function () {
  937.                             e(document.body).trigger("update_checkout");
  938.                         }, a)));
  939.                 */
  940.             }),
  941.             (window.validate_fields = function (a) {
  942.                 0 !== a.length &&
  943.                     a.each(function (a) {
  944.                         var t = e(this),
  945.                             o = t.closest(".form-row"),
  946.                             n = !0,
  947.                             r = o.is(".validate-required"),
  948.                             i = o.is(".validate-email"),
  949.                             c = t.val();
  950.                         r &&
  951.                             ("checkbox" !== t.attr("type") || t.is(":checked")
  952.                                 ? "select-multiple" === t[0].type
  953.                                     ? (null != t.val() && void 0 != t.val() && "" !== t.val() && 0 !== t.val().length) || (o.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field"), (n = !1))
  954.                                     : t.parents(".wfacp_custom_field_radio_wrap").length > 0
  955.                                     ? 0 == t.parents(".wfacp_custom_field_radio_wrap").find("input:checked").length
  956.                                         ? ((n = !1), o.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field"))
  957.                                         : (n = !0)
  958.                                     : (null != c && "" !== c.trim()) || (o.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field"), (n = !1))
  959.                                 : (o.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field"), (n = !1))),
  960.                             (i = wfacp_frontend.hooks.applyFilters("wfacp_field_validate_email", i, t, o)) &&
  961.                                 t.val() &&
  962.                                 (new RegExp(
  963.                                     /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i
  964.                                 ).test(t.val()) ||
  965.                                     (o.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-email"), (n = !1))),
  966.                             (n = wfacp_frontend.hooks.applyFilters("wfacp_field_validated", n, t, o)) && o.removeClass("woocommerce-invalid woocommerce-invalid-required-field woocommerce-invalid-email").addClass("woocommerce-validated");
  967.                     });
  968.             }),
  969.             (window.wfacp_validate_email = function (e) {
  970.                 return /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase());
  971.             }),
  972.             (window.refresh_page_data = function (a) {
  973.                 if ("" !== wfacp_frontend.is_global) return update_checkout(), void (window.wfacp_haschanges = "no");
  974.                 var o = { products: {}, coupon: "", wfacp_id: a },
  975.                     n = e("fieldset.wfacp-selected-product"),
  976.                     r = e("fieldset.wfacp_product_row");
  977.                 if (n.length > 0)
  978.                     n.each(function () {
  979.                         if (!("hidden" !== e(this).find(".wfacp_switcher_checkbox").attr("type") && e(this).find(".wfacp_switcher_checkbox:checked") > 0) && "" !== e(this).attr("cart_key")) {
  980.                             var a = e(this).data("item-key"),
  981.                                 t = 1;
  982.                             e(this).find("input.wfacp_product_switcher_quantity").length > 0 && (t = e(this).find("input.wfacp_product_switcher_quantity").val()), (o.products[a] = t);
  983.                         }
  984.                     });
  985.                 else if (r.length > 0) {
  986.                     var i = r.find("input.wfacp_switcher_checkbox");
  987.                     if (i.length > 0) {
  988.                         var c = i.eq(0);
  989.                         if ("checkbox" == c.attr("type") || "radio" == c.attr("type")) return void c.trigger("click");
  990.                         o.products = wfacp_frontend.products_in_cart;
  991.                     } else o.products = wfacp_frontend.products_in_cart;
  992.                 } else o.products = wfacp_frontend.products_in_cart;
  993.                 var s = e(".woocommerce-remove-coupon");
  994.                 s.length > 0 && (o.coupon = s.eq(0).data("coupon")),
  995.                     0 !== Object.keys(o.products).length &&
  996.                         (_.block(t),
  997.                         wfacp_send_ajax({ action: "update_cart_multiple_page", type: "post", data: o }, function (a) {
  998.                             (window.wfacp_haschanges = "no"),
  999.                                 window.localStorage.setItem("wfacp_checkout_page_id", wfacp_frontend.id),
  1000.                                 _.unblock(),
  1001.                                 !0 === a.status && (e("#wfacp_has_active_multi_checkout").val(wfacp_frontend.id), update_fragments(a));
  1002.                         }));
  1003.             }),
  1004.             (window.is_document_visible = function () {
  1005.                 return !document.hidden;
  1006.             }),
  1007.             e(document).keydown(function (e) {
  1008.                 9 === e.which && (n = !0);
  1009.             }),
  1010.             e(document).on("focus", ".select2", function () {
  1011.                 n && ((n = !1), e(this).siblings("select").select2("open"));
  1012.             }),
  1013.             e(document).keyup(function (a) {
  1014.                 27 === a.keyCode && e(".wfacp_qv-close").trigger("click");
  1015.             }),
  1016.             e(document.body).on("click", ".wfacp_next_page_button", function () {
  1017.                 var a = e(this),
  1018.                     t = e(this).data("current-step"),
  1019.                     o = e(".wfacp_page." + t);
  1020.                 if (!(o.find("#product_switching_field").length > 0) || k()) {
  1021.                     if ((G(), (w = !0), e(".woocommerce-error").remove(), validate_fields(o.find(".wfacp-form-control:visible")), o.find(".woocommerce-invalid:visible").length > 0))
  1022.                         return e(".wfacp_payment").removeClass("wfacp_show_payment_part"), void e(document.body).trigger("checkout_error");
  1023.                     var n = new Promise(function (e, a) {
  1024.                         setTimeout(function () {
  1025.                             e();
  1026.                         }, 10);
  1027.                     });
  1028.                     "object" == _typeof((n = wfacp_frontend.hooks.applyFilters("wfacp_next_button_trigger", n, a, o)))
  1029.                         ? (n.catch(function (e) {
  1030.                               o.unblock(), wfacp_frontend.hooks.doAction("wfacp_next_button_trigger_validation_error", a, o);
  1031.                           }),
  1032.                           n.then(function (e) {
  1033.                               o.unblock(),
  1034.                                   x(a),
  1035.                                   setTimeout(function () {
  1036.                                       w = !1;
  1037.                                   }, 450),
  1038.                                   setTimeout(function () {
  1039.                                       w = !1;
  1040.                                   }, 450);
  1041.                           }))
  1042.                         : (o.unblock(), wfacp_frontend.hooks.doAction("wfacp_next_button_trigger_validation_error", a, o));
  1043.                 }
  1044.             }),
  1045.             e(document.body).on("click", ".wfacp_back_page_button", function () {
  1046.                 x(e(this));
  1047.             }),
  1048.             e(document.body).on(
  1049.                 "click",
  1050.                 ".wfacp_product_choosen_label_wrap .wfacp_product_choosen_label,.wfacp_product_switcher_col.wfacp_product_switcher_col_2 .product_name > span,.wfacp_product_row .product-price .wfacp_product_price_sec, #product_switching_field.wfacp_not_force_all.wfacp_setting_not_image_hide .wfacp_product_switcher_col_1 .product-image",
  1051.                 function () {
  1052.                     var a = e(this).parents(".wfacp_product_row").find("input[name='wfacp_product_choosen']").attr("type");
  1053.                     (e(this).parents(".wfacp_product_row").hasClass("wfacp-selected-product") && "checkbox" != a) || e(this).parents(".wfacp_product_row").find("input[name='wfacp_product_choosen']").trigger("click");
  1054.                 }
  1055.             ),
  1056.             e(document.body).on("focus", ".wfacp-form-control", function () {
  1057.                 e(this).parents(".wfacp-form-control-wrapper").addClass("wfacp-anim-wrap");
  1058.             }),
  1059.             e(document.body).on("keyup", ".wfacp-form-control", function () {
  1060.                 var a = e(this).parents(".wfacp-form-control-wrapper");
  1061.                 a.addClass("wfacp-anim-wrap"), "" === e(this).val() && a.hasClass("validate-required") && a.addClass("woocommerce-invalid woocommerce-invalid-required-field");
  1062.             }),
  1063.             e(document.body).on("change", ".wfacp-form-control", function () {
  1064.                 var a = e(this).find(".input-radio");
  1065.                 a.length > 0
  1066.                     ? a.is(":checked").length > 0
  1067.                         ? e(this).parents(".wfacp-form-control-wrapper").addClass("wfacp-anim-wrap")
  1068.                         : e(this).parents(".wfacp-form-control-wrapper").removeClass("wfacp-anim-wrap")
  1069.                     : null != e(this).val() && "" != e(this).val()
  1070.                     ? "" !== e(this).val() && (e(this).parent().siblings(".wfacp_input_error_msg").hide(), e(this).parents(".wfacp-form-control-wrapper").addClass("wfacp-anim-wrap"))
  1071.                     : e(this).parents(".wfacp-form-control-wrapper").removeClass("wfacp-anim-wrap");
  1072.             }),
  1073.             e(document.body).on("focusout", ".wfacp-form-control", function () {
  1074.                 var a = e(this).find(".input-radio");
  1075.                 if (a.length > 0) a.is(":checked").length > 0 ? e(this).parents(".wfacp-form-control-wrapper").addClass("wfacp-anim-wrap") : e(this).parents(".wfacp-form-control-wrapper").removeClass("wfacp-anim-wrap");
  1076.                 else if ("" === e(this).val()) {
  1077.                     var t = e(this).parents(".wfacp-form-control-wrapper");
  1078.                     t.removeClass("wfacp-anim-wrap"), t.hasClass("validate-required") && t.addClass("woocommerce-invalid woocommerce-invalid-required-field");
  1079.                 }
  1080.             }),
  1081.             e(document.body).on("change", "#shipping_same_as_billing,.shipping_same_as_billing", function () {
  1082.                 var a = wfacp_frontend.wc_customizer_validation_status,
  1083.                     t = e(this).prop("type");
  1084.                 !0 === (("radio" == t && "option_2" == e(this).val()) || !("checkbox" != t || !e(this).is(":checked")))
  1085.                     ? (e(".ship_to_different_address").val(1).prop("checked", !0),
  1086.                       e(".wfacp_shipping_fields").each(function () {
  1087.                           e(this).removeClass("wfacp_shipping_field_hide"), e(this).addClass("wfacp_shipping_field_show");
  1088.                           var t = e(this).attr("id");
  1089.                           e(this).addClass("validate-required"), e(this).hasClass("validate-required") && void 0 !== a[t] && "wfacp_required_optional" === a[t] && e(this).removeClass("validate-required");
  1090.                       }),
  1091.                       e("#shipping_first_name").val(""),
  1092.                       e("#shipping_last_name").val(""),
  1093.                       e("#shipping_address_1").val(""),
  1094.                       e("#shipping_city").val(""),
  1095.                       e("#shipping_first_name_field").removeClass("wfacp-anim-wrap"),
  1096.                       e("#shipping_last_name_field").removeClass("wfacp-anim-wrap"),
  1097.                       e("#shipping_address_1_field").removeClass("wfacp-anim-wrap"),
  1098.                       e("#shipping_city_field").removeClass("wfacp-anim-wrap"))
  1099.                     : (e(".ship_to_different_address").prop("checked", !1),
  1100.                       e(".wfacp_shipping_fields").each(function () {
  1101.                           e(this).addClass("wfacp_shipping_field_hide"), e(this).removeClass("wfacp_shipping_field_show"), e(this).removeClass("validate-required");
  1102.                       }),
  1103.                       e("#shipping_first_name").val(e("#billing_first_name").val()),
  1104.                       e("#shipping_last_name").val(e("#billing_last_name").val()),
  1105.                       e("#shipping_address_1").val(e("#billing_address_1").val()),
  1106.                       e("#shipping_city").val(e("#billing_city").val()),
  1107.                       e("#shipping_state").val(e("#billing_state").val()),
  1108.                       e("#shipping_country").val(e("#billing_country").val()).trigger("change")),
  1109.                     q();
  1110.             }),
  1111.             e(document.body).on("change", "#billing_same_as_shipping,.billing_same_as_shipping", function () {
  1112.                 var a = wfacp_frontend.wc_customizer_validation_status,
  1113.                     t = e(this).prop("type");
  1114.                 if (!0 === (("radio" == t && "option_2" == e(this).val()) || !("checkbox" != t || !e(this).is(":checked")))) {
  1115.                     e("#wfacp_billing_same_as_shipping").val(1),
  1116.                         e(".wfacp_billing_fields").each(function () {
  1117.                             e(this).removeClass("wfacp_billing_field_hide"), e(this).addClass("wfacp_billing_field_show");
  1118.                         }),
  1119.                         e("#billing_address_1").val(""),
  1120.                         e("#billing_city").val(""),
  1121.                         e("#billing_postcode").val(""),
  1122.                         e("#billing_first_name_field").parents(".wfacp_divider_billing").length > 0 && (e("#billing_first_name").val(""), e("#billing_first_name_field").removeClass("wfacp-anim-wrap")),
  1123.                         e("#billing_last_name_field").parents(".wfacp_divider_billing").length > 0 && (e("#billing_last_name").val(""), e("#billing_last_name_field").removeClass("wfacp-anim-wrap")),
  1124.                         e("#billing_address_1_field").removeClass("wfacp-anim-wrap"),
  1125.                         e("#billing_city_field").removeClass("wfacp-anim-wrap"),
  1126.                         e("#billing_postcode_field").removeClass("wfacp-anim-wrap");
  1127.                     var o = e(".wfacp_billing_field_show");
  1128.                     o.addClass("validate-required"),
  1129.                         o.each(function () {
  1130.                             var t = e(this),
  1131.                                 o = t.attr("id");
  1132.                             t.hasClass("validate-required") && void 0 !== a[o] && "wfacp_required_optional" === a[o] && t.removeClass("validate-required");
  1133.                         });
  1134.                 } else {
  1135.                     e("#wfacp_billing_same_as_shipping").val(0),
  1136.                         e(".wfacp_billing_fields").each(function () {
  1137.                             e(this).addClass("wfacp_billing_field_hide"), e(this).removeClass("wfacp_shipping_field_show");
  1138.                         }),
  1139.                         e("#billing_first_name").val(e("#shipping_first_name").val()),
  1140.                         e("#billing_last_name").val(e("#shipping_last_name").val()),
  1141.                         e("#billing_address_1").val(e("#shipping_address_1").val()),
  1142.                         e("#billing_city").val(e("#shipping_city").val()),
  1143.                         e("#billing_state").val(e("#shipping_state").val()),
  1144.                         e("#billing_country").val(e("#shipping_country").val()).trigger("change"),
  1145.                         e("#billing_postcode").val(e("#shipping_postcode").val()),
  1146.                         e(".wfacp_billing_field_show").removeClass("woocommerce-invalid woocommerce-invalid-required-field validate-required");
  1147.                 }
  1148.                 q();
  1149.             }),
  1150.             e(document.body).on("checkout_error", function () {
  1151.                 if (!0 === wfacp_frontend.hooks.applyFilters("disable_error_messages", !1)) return !0;
  1152.                 if (!(e(".wfacp_amazon_checkout").length > 0 || e(".wfacp_paypal_express").length > 0))
  1153.                     if ((e("#account_password_field").removeClass("wfacp-create-account-label"), e(".wfacp_payment.wfacp_show_payment_part").length > 0 || 1 === e(".wfacp_page").length)) {
  1154.                         var a = e(".wfacp_custom_field_radio_wrap.validate-required");
  1155.                         a.length > 0 &&
  1156.                             a.each(function () {
  1157.                                 0 == e(this).find("input[type=radio]:checked").length && e(this).removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field");
  1158.                             });
  1159.                     } else {
  1160.                         e(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(), e(".wfacp_input_error_msg").remove();
  1161.                         var t = e(".woocommerce-invalid:visible"),
  1162.                             o = [];
  1163.                         0 !== t.length &&
  1164.                             (t.each(function () {
  1165.                                 var a = e(this),
  1166.                                     t = e(this).find("input"),
  1167.                                     n = a.children("label");
  1168.                                 0 === n.length && (n = a.find("label").eq(0));
  1169.                                 var r = n.clone().children().remove().end().text();
  1170.                                 "" === (r = r.trim()) && (n.find(".required").remove(), (r = n.text().trim()));
  1171.                                 var i = "",
  1172.                                     c = "<strong>" + r.trim() + "</strong> ";
  1173.                                 (i = e(this).hasClass("woocommerce-invalid-email") ? p.invalid_email_field.replace("%s", c) : p.error_required_msg.replace("%s", c)),
  1174.                                     (i = wfacp_frontend.hooks.applyFilters("wfacp_field_error_message", i, a, t)),
  1175.                                     o.push("<li>" + i + "</li>");
  1176.                             }),
  1177.                             o.length > 0 && wfacp_submit_error('<ul class="woocommerce-error" role="alert">' + o.join(" ") + "</ul>", !1));
  1178.                     }
  1179.             }),
  1180.             e(".wfacp_qv-panel").on("click", ".wfacp_qv-close", P),
  1181.             e(document.body).on("click", ".wfacp_qv-inner-modal", P),
  1182.             e(document.body).on("click", ".wfacp_qv-button", function (a) {
  1183.                 a.preventDefault();
  1184.                 var t = e(this).parents(".wfacp_product_row");
  1185.                 e(".wfacp_qv-opac").show();
  1186.                 var o = e(".wfacp_qv-panel");
  1187.                 o.addClass("wfacp_qv-panel-active"), o.find(".wfacp_qv-opl").addClass("wfacp_qv-pl-active");
  1188.                 var n = e(this).attr("qv-id"),
  1189.                     r = {};
  1190.                 t.length > 0 && ((r.item_key = t.attr("data-item-key")), (r.cart_key = t.attr("cart_key"))), (r.wfacp_id = e("._wfacp_post_id").val()), (r.product_id = n);
  1191.                 var i = e(this).attr("qv-var-id");
  1192.                 void 0 !== i && (r.variation_id = i), F(r);
  1193.             }),
  1194.             e(document.body).on("click", ".wfacp_single_add_to_cart_button", function () {
  1195.                 var a = e(this).siblings(".quantity").children("[name=quantity]").val(),
  1196.                     t = e(".wfacp_qv-inner-modal"),
  1197.                     o = t.data("item-key"),
  1198.                     n = t.data("cart-key"),
  1199.                     r = !1;
  1200.                 if ((e(".wfacp_qv-summary .variations_form").length > 0 && (r = !0), void 0 !== n && "" !== n)) {
  1201.                     var i = e('fieldset.wfacp_product_row[cart_key="' + n + '"]');
  1202.                     if (i.length > 0) {
  1203.                         var c = i.find(".wfacp_product_switcher_quantity");
  1204.                         c.length > 0 && c.val(a), !0 === r ? S(i) : c.trigger("change"), e(".wfacp_qv-close").trigger("click");
  1205.                     }
  1206.                 } else if (void 0 !== o && "" !== o) {
  1207.                     var s = e('fieldset.wfacp_product_row[data-item-key="' + o + '"]');
  1208.                     if (s.length > 0) {
  1209.                         var _ = s.find(".wfacp_product_switcher_quantity");
  1210.                         _.length > 0 && _.val(a), !0 === r ? S(s) : s.find("[name=wfacp_product_choosen]").prop("checked", !0).trigger("change"), e(".wfacp_qv-close").trigger("click");
  1211.                     }
  1212.                 }
  1213.             }),
  1214.             e(document.body).on("click", ".wfacp_edit_address", function (a) {
  1215.                 a.preventDefault(),
  1216.                     e(".wfacp-form-control-wrapper").removeClass("hidden"),
  1217.                     "billing" === e(this).data("type") && e(".wfacp_express_billing_address").slideToggle(),
  1218.                     "shipping" === e(this).data("type") && e(".wfacp_express_shipping_address").slideToggle();
  1219.             }),
  1220.             e(document.body).on("click", "#place_order", function () {
  1221.                 G(), e(".woocommerce-error").remove();
  1222.             }),
  1223.             e(document.body).on("click", ".wfacp_remove_item_from_cart", function (a) {
  1224.                 a.preventDefault();
  1225.                 var o = e(this),
  1226.                     n = e(this).parents(".cart_item"),
  1227.                     r = (e(this).parent(".wfacp_delete_item"), e(this).data("cart_key")),
  1228.                     i = e(this).data("item_key"),
  1229.                     c = e(".wfacp-product-switch-panel");
  1230.                 c.block(t),
  1231.                     show_blocked_mini_cart(),
  1232.                     wfacp_send_ajax({ action: "remove_cart_item", type: "post", data: { cart_key: r, item_key: i, by: "product_switcher", wfacp_id: e("._wfacp_post_id").val() } }, function (a) {
  1233.                         if ((c.unblock(), a.hasOwnProperty("error") && a.hasOwnProperty("cart_key"))) {
  1234.                             var t = o.parents(".wfacp_min_cart_widget");
  1235.                             if (((n = e('.wfacp_product_row[cart_key="' + a.cart_key + '"]')), t.length > 0 && (n = o.parents("td")), n.length > 0)) return show_unblocked_mini_cart(), void wfacp_show_error(n, a);
  1236.                         }
  1237.                         e("#product_switcher_need_refresh").val(0), update_fragments(a), update_checkout();
  1238.                     });
  1239.             }),
  1240.             e(document.body).on("click", ".wfacp_restore_cart_item", function (a) {
  1241.                 a.preventDefault();
  1242.                 var o = e(this).data("cart_key");
  1243.                 e(".wfacp-product-switch-panel").block(t);
  1244.                 var n = "product_switcher";
  1245.                 e(this).parents(".wfacp_min_cart_widget").length > 0 && (n = "mini_cart"),
  1246.                     show_blocked_mini_cart(),
  1247.                     wfacp_send_ajax({ action: "undo_cart_item", type: "post", data: { cart_key: o, wfacp_id: e("._wfacp_post_id").val(), by: n } }, function (a) {
  1248.                         e("#product_switcher_need_refresh").val(1), update_fragments(a), update_checkout();
  1249.                     });
  1250.             }),
  1251.             e(document.body).on("click", "span.wfacp_attr_value_not_available", function () {
  1252.                 e(this).parents(".wfacp_product_sec").find("a.wfacp_qv-button").trigger("click");
  1253.             }),
  1254.             e(document).ready(function () {
  1255.                 e(".wfacp_dummy_preview_heading").length > 0 &&
  1256.                     e(".wfacp_dummy_preview_heading").click(function (e) {
  1257.                         e.preventDefault();
  1258.                         var a = jQuery(".wfacp_notice_dismise_link").attr("data-notice-id"),
  1259.                             t = jQuery(".wfacp_notice_dismise_link").attr("page-id");
  1260.                         "undefined" != a &&
  1261.                             "" != a &&
  1262.                             jQuery.ajax({
  1263.                                 url: wfacp_frontend.admin_ajax,
  1264.                                 type: "POST",
  1265.                                 data: { action: "notice_dismise_link", notice_dismise_link: a, page_id: t },
  1266.                                 success: function (e) {
  1267.                                     "success" === e.status && jQuery("[data-notice-id=" + e.key + "]").slideUp();
  1268.                                 },
  1269.                             });
  1270.                     }),
  1271.                     e(document.body).trigger("wfacp_front_ready", [_]);
  1272.                 var a = e("body");
  1273.                 if (
  1274.                     (a.hasClass("wfacp_main_wrapper") &&
  1275.                         "undefined" != typeof wfacp_elementor_data &&
  1276.                         "undefined" !== wfacp_elementor_data.wfacp_make_button_sticky_on_mobile &&
  1277.                         "" !== wfacp_elementor_data.wfacp_make_button_sticky_on_mobile &&
  1278.                         a.addClass("yes_sticky"),
  1279.                     o < 768 && "undefined" != typeof wfacp_elementor_data && (e("body").removeClass("yes_sticky"), "yes" == wfacp_elementor_data.wfacp_make_button_sticky_on_mobile))
  1280.                 ) {
  1281.                     wfacp_elementor_data.wfacp_make_button_sticky_on_mobile;
  1282.                     e("body").addClass("yes_sticky");
  1283.                 }
  1284.                 if ("undefined" != typeof angelleye_in_content_param) {
  1285.                     if (((angelleye_in_content_param.set_express_checkout += "&wfacp_id=" + wfacp_frontend.id + "&wfacp_is_checkout_override=" + wfacp_frontend.wfacp_is_checkout_override), e("#wfacp_embed_form_page_id").length > 0)) {
  1286.                         var t = e("#wfacp_embed_form_page_id").val();
  1287.                         angelleye_in_content_param.set_express_checkout += "&wfacp_embed_form_page_id=" + t;
  1288.                     }
  1289.                     angelleye_in_content_param.cancel_page = wfacp_frontend.cancel_page_url;
  1290.                 }
  1291.                 e("#wfacp_exchange_keys").val(JSON.stringify(wfacp_frontend.exchange_keys)),
  1292.                     e(".wfacp_custom_field_radio_wrap input[type=radio]").click(function () {
  1293.                         e(this).is(":checked")
  1294.                             ? e(this).parents(".wfacp_custom_field_radio_wrap").removeClass("woocommerce-invalid woocommerce-invalid-required-field").addClass("woocommerce-validated")
  1295.                             : e(this).parents(".wfacp_custom_field_radio_wrap").removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field");
  1296.                     });
  1297.                 var n,
  1298.                     r = e(".wfacp_drop_list");
  1299.                 r.length > 0 && r.find("select").hasClass("select2-hidden-accessible") && "object" === _typeof((n = r)) && (n.removeClass("wfacp_drop_list"), n.addClass("wfacp_add_select_2")),
  1300.                     _.on("input validate change", ".input-text, select, input:checkbox", function () {
  1301.                         s.html(""), e(".wfacp_input_error_msg").length > 0 && e(".wfacp_error_message").hide();
  1302.                         var a = e("#billing_state"),
  1303.                             t = e("#shipping_state");
  1304.                         a.length > 0 && a.addClass("wfacp-form-control"), t.length > 0 && t.addClass("wfacp-form-control");
  1305.                     }),
  1306.                     e(document.body).on("change", "#createaccount", function () {
  1307.                         e(this).is(":checked") ? e("#account_password_field").addClass("wfacp-create-account-label") : e("#account_password_field").removeClass("wfacp-create-account-label");
  1308.                     }),
  1309.                     e("#shipping_same_as_billing").trigger("change"),
  1310.                     e(document.body)
  1311.                         .off("click", ".wfacp_steps_wrap a")
  1312.                         .on("click", ".wfacp_steps_wrap a", function (a) {
  1313.                             if (!e(this).parent().hasClass("df_cart_link") && (a.preventDefault(), !e(this).parent().hasClass("ppec_express_checkout_m"))) {
  1314.                                 for (var t = e(this).parent().attr("step"), o = ["single_step", "two_step", "third_step"], n = 0; n < o.length; n++) t == o[n] ? e("body").hasClass(t) || e("body").addClass(t) : e("body").removeClass(o[n]);
  1315.                                 if (!e(".wfacp_page:visible").hasClass(t) && e(this).parent().hasClass("wfacp_bred_visited")) {
  1316.                                     e(".woocommerce-error").remove(),
  1317.                                         e(".wfacp_steps_sec ul li").removeClass("wfacp_bred_active"),
  1318.                                         e(this).parent().addClass("wfacp_bred_active"),
  1319.                                         z(e(this)),
  1320.                                         e(".wfacp_page:visible").fadeOut(300, function () {
  1321.                                             e(".wfacp_page." + t).fadeIn(600), q();
  1322.                                         }),
  1323.                                         e(".wfacp_page." + t).hasClass("wfacp_last_page") && e(".wfacp_payment").removeClass("wfacp_hide_payment_part");
  1324.                                     var r = e(this).data("text");
  1325.                                     "" === r && (r = t),
  1326.                                         setTimeout(function () {
  1327.                                             window.location.assign("#" + r);
  1328.                                         }, 700);
  1329.                                 }
  1330.                             }
  1331.                         }),
  1332.                     e("#billing_country, #shipping_country, .country_to_state,#shipping_state,#billing_state").on("change", function (a, t) {
  1333.                         setTimeout(function () {
  1334.                             var a = e("#shipping_state"),
  1335.                                 t = a.val(),
  1336.                                 o = a.parents(".form-row");
  1337.                             a.hasClass("input-text") && a.addClass("wfacp-form-control");
  1338.                             var n = e("#billing_state"),
  1339.                                 r = n.val(),
  1340.                                 i = n.parents(".form-row");
  1341.                             N(o, t), N(i, r), n.hasClass("input-text") && n.addClass("wfacp-form-control");
  1342.                         }, 700);
  1343.                     }),
  1344.                     e("#billing_same_as_shipping").length > 0 &&
  1345.                         (e(document).on("change", "#shipping_country", function () {
  1346.                             e("#billing_same_as_shipping").is(":checked") || e("#billing_country").val(e(this).val()).trigger("change");
  1347.                         }),
  1348.                         e(document).on("change", "#shipping_state", function () {
  1349.                             e("#billing_same_as_shipping").is(":checked") || e("#billing_state").val(e(this).val()).trigger("change");
  1350.                         }));
  1351.             }),
  1352.             e(window).on("load", function () {
  1353.                 A(),
  1354.                     -1 != navigator.userAgent.indexOf("Mac OS X") ? e("body").addClass("wfacp_mac") : e("body").addClass("wfacp_pc"),
  1355.                     setTimeout(function () {
  1356.                         C();
  1357.                     }, 700);
  1358.             }),
  1359.             e(document.body).on("wfacp_init", function () {
  1360.                 A();
  1361.             }),
  1362.             e(document.body).on("change", ".shipping_method", function () {
  1363.                 e(".wfacp_shipping_options").block(t);
  1364.             }),
  1365.             e(document.body).on("update_checkout", function () {
  1366.                 var a;
  1367.                 (a = e(".wfacp_order_total_field")).length > 0 && a.block(t);
  1368.                 var o = e(".wfacp_shipping_options");
  1369.                 o.length > 0 && o.block(t);
  1370.                 var n = e(".foo_event_wrap");
  1371.                 n.length > 0 && n.block(t), (c = !0), 0;
  1372.             }),
  1373.             e(document.body).on("updated_checkout", function (a, t) {
  1374.                 e("#product_switcher_need_refresh").val(1), void 0 !== t && (c = !1);
  1375.                 var o = e("#payment ul.wc_payment_methods");
  1376.                 e("#payment ul.wc_payment_methods > li").length > 1 ? o.removeClass("wfacp_method_length_count_one") : o.addClass("wfacp_method_length_count_one"),
  1377.                     setTimeout(function () {
  1378.                         0 === e(".wfacp-selected-product").length && "yes" === window.wfacp_haschanges && refresh_page_data(wfacp_frontend.id), 0 !== e(".foo_event_wrap").length && populate_fields_value();
  1379.                     }, 600),
  1380.                     (function () {
  1381.                         if (0 != e(".shipmondo-shipping-field-wrap").length) {
  1382.                             var a = e(".wfacp_single_shipping_method");
  1383.                             a.each(function () {
  1384.                                 a.each(function () {
  1385.                                     if (e(this).find(".shipmondo-shipping-field-wrap").length > 0) {
  1386.                                         var a = e(this).find(".wfacp_shipping_radio"),
  1387.                                             t = e(this).children(".wfacp_single_shipping_desc").html();
  1388.                                         e(this).children(".wfacp_single_shipping_desc").html(""), a.append(t);
  1389.                                     }
  1390.                                 });
  1391.                             });
  1392.                         }
  1393.                     })();
  1394.             }),
  1395.             e(document.body).on("click", ".wfacp_preview_step_change", function () {
  1396.                 x(e(this));
  1397.             }),
  1398.             e(document.body).on("wfacp_undo_cart_item", function (a, t) {
  1399.                 t.data.hasOwnProperty("by") && "mini_cart" == t.data.by ? e("#product_switcher_need_refresh").val(1) : e("#product_switcher_need_refresh").val(0);
  1400.             }),
  1401.             e(document.body).on("change", ".wfacp_mini_cart_update_qty", function () {
  1402.                 var a = this,
  1403.                     o = e(this),
  1404.                     n = o.val(),
  1405.                     r = o.parents(".wfacp_min_cart_widget").data("delete-enabled"),
  1406.                     i = o.parent(".cart_item"),
  1407.                     c = o.attr("cart_key"),
  1408.                     s = o.data("value");
  1409.                 if ((void 0 != n && "" != n && 0 != n) || "1" == r) {
  1410.                     var _ = e(".wfacp-product-switch-panel");
  1411.                     _.block(t),
  1412.                         show_blocked_mini_cart(),
  1413.                         wfacp_send_ajax({ action: "update_cart_item_quantity", type: "post", data: { cart_key: c, quantity: n, old_qty: s, by: "mini_cart", wfacp_id: e("._wfacp_post_id").val() } }, function (t) {
  1414.                             if ((show_unblocked_mini_cart(), _.unblock(), t.hasOwnProperty("error") && t.hasOwnProperty("cart_key")))
  1415.                                 return e(a).val(s), (i = e('.wfacp_min_cart_widget .cart_item[cart_key="' + t.cart_key + '"] .product-name-area')), void wfacp_show_error(i, t);
  1416.                             update_fragments(t);
  1417.                         });
  1418.                 } else o.val(s);
  1419.             }),
  1420.             e(document.body).on("click", ".wfacp_mini_cart_remove_item_from_cart", function (a) {
  1421.                 a.preventDefault();
  1422.                 var o = e(this),
  1423.                     n = e(this).parents(".cart_item"),
  1424.                     r = e(this).data("cart_key"),
  1425.                     i = e(this).data("item_key");
  1426.                 show_blocked_mini_cart();
  1427.                 var c = e(".wfacp-product-switch-panel");
  1428.                 c.block(t),
  1429.                     wfacp_send_ajax({ action: "remove_cart_item", type: "post", data: { cart_key: r, item_key: i, by: "mini_cart", wfacp_id: e("._wfacp_post_id").val() } }, function (a) {
  1430.                         if ((show_unblocked_mini_cart(), c.unblock(), a.hasOwnProperty("error") && a.hasOwnProperty("cart_key"))) {
  1431.                             var t = o.parents(".wfacp_elementor_mini_cart_widget");
  1432.                             return (
  1433.                                 (n = e('.wfacp_min_cart_widget .cart_item[cart_key="' + a.cart_key + '"] .product-name')),
  1434.                                 t.length > 0 && (n = e('.wfacp_min_cart_widget .cart_item[cart_key="' + a.cart_key + '"] .product-name-area')),
  1435.                                 void wfacp_show_error(n, a)
  1436.                             );
  1437.                         }
  1438.                         e("#product_switcher_need_refresh").val(0), update_fragments(a), update_checkout();
  1439.                     });
  1440.             }),
  1441.             e(document.body).on("click", ".wfacp_force_last_delete", function (a) {
  1442.                 a.preventDefault();
  1443.                 var o = e(this).parents(".cart_item");
  1444.                 if (0 != o.length) {
  1445.                     var n = o.attr("cart_key");
  1446.                     e("#product_switching_field").block(t),
  1447.                         ("" == n && void 0 == n) ||
  1448.                             wfacp_send_ajax({ action: "delete_last_item", type: "post", data: { cart_key: n } }, function (a) {
  1449.                                 1 == a.status ? (window.location.href = a.redirect) : e("#product_switching_field").unblock(t);
  1450.                             });
  1451.                 }
  1452.             }),
  1453.             e(window).bind("popstate", function () {
  1454.                 if (!0 !== w) {
  1455.                     var a = location.hash;
  1456.                     if ("#" !== a && 1 != wfacp_frontend.hooks.applyFilters("disable_pop_state", !1, a)) {
  1457.                         var t = "",
  1458.                             o = e(".wfacp_step_text_have");
  1459.                         if (0 !== o.length) {
  1460.                             var n = !1,
  1461.                                 r = null;
  1462.                             if (("" === a ? (n = !0) : ((t = a.replace("#", "")), 0 === (r = e('.wfacp_step_text_have[data-text="' + t + '"]')).length && (n = !0)), !0 === n && (r = o.eq(0)), null != r)) {
  1463.                                 var i = r.parent(),
  1464.                                     c = i.attr("step"),
  1465.                                     s = e(".wfacp_page:visible");
  1466.                                 if (!s.hasClass(c) && i.hasClass("wfacp_bred_visited")) {
  1467.                                     if ((e(".woocommerce-error").remove(), validate_fields(s.find(".wfacp-form-control:visible")), s.find(".woocommerce-invalid:visible").length > 0))
  1468.                                         return void e(".wfacp_payment").removeClass("wfacp_show_payment_part");
  1469.                                     e(".wfacp_page").hide(), e(".wfacp_steps_sec ul li").removeClass("wfacp_bred_active"), i.addClass("wfacp_bred_active");
  1470.                                     var _ = e(".wfacp_page." + c);
  1471.                                     e(_).fadeIn(600), _.hasClass("wfacp_last_page") && e(".wfacp_payment").removeClass("wfacp_hide_payment_part"), q();
  1472.                                 }
  1473.                             }
  1474.                         }
  1475.                     }
  1476.                 }
  1477.             }),
  1478.             (function () {
  1479.                 var a = e(".mailchimp-newsletter");
  1480.                 a.length > 0 && a.addClass("wfacp-form-control-wrapper wfacp-col-full wfacp_checkbox_field");
  1481.                 var t = e(".mc4wp-checkbox");
  1482.                 t.length > 0 && t.addClass("wfacp-form-control-wrapper wfacp-col-full wfacp_checkbox_field");
  1483.                 var o = e("#ss_wc_mailchimp_opt_in");
  1484.                 o.length > 0 && o.parents(".woocommerce-mailchimp-opt-in").addClass("wfacp-form-control-wrapper wfacp-col-full wfacp_checkbox_field"),
  1485.                     e(".address-field input,.address-field select").on("input", function () {
  1486.                         e(this).parents(".form-row").hasClass("wfacp-anim-wrap") || e(this).parents(".form-row").addClass("wfacp-anim-wrap");
  1487.                     }),
  1488.                     e(document.body).on("wfacp_sustain_multi_checkout_page_run", function () {
  1489.                         "undefined" == typeof b4_checkout_updating ? (window.b4_checkout_updating = !0) : (b4_checkout_updating = !0);
  1490.                     }),
  1491.                     e(document).on("wfacp_sustain_multi_checkout_page_finish", function () {
  1492.                         "undefined" != typeof b4_checkout_updating && update_checkout();
  1493.                     });
  1494.                 var n = !1;
  1495.                 e(document.body).on("wfacp_checkout_data", function () {
  1496.                     var a = e("#payment_method_woo-mercado-pago-custom");
  1497.                     a.length > 0 && "woo-mercado-pago-custom" === a.val() && ((n = !0), update_checkout());
  1498.                 }),
  1499.                     _.on("click", 'input[name="payment_method"]', function () {
  1500.                         "woo-mercado-pago-custom" === e(this).val() && "object" == ("undefined" == typeof MPv1 ? "undefined" : _typeof(MPv1)) && 1 == n && (MPv1.guessingPaymentMethod({ event: "keyup" }), (n = !1));
  1501.                     }),
  1502.                     e(document.body).on("wfacp_coupon_apply", function () {
  1503.                         var a = e("#payment_method_woo-mercado-pago-custom");
  1504.                         a.length > 0 && "woo-mercado-pago-custom" === a.val() && ((n = !0), update_checkout());
  1505.                     }),
  1506.                     e(document.body).on("wfacp_coupon_form_removed", function () {
  1507.                         var a = e("#payment_method_woo-mercado-pago-custom");
  1508.                         a.length > 0 && "woo-mercado-pago-custom" === a.val() && ((n = !0), update_checkout());
  1509.                     });
  1510.                 var r = "";
  1511.                 e(document.body).on("change", ".iw_tcs_variable", function () {
  1512.                     var a = e(this).find("option:selected").text();
  1513.                     r = a.trim();
  1514.                 }),
  1515.                     e(document.body).on("wfacp_after_fragment_received", function (a, t) {
  1516.                         !(function () {
  1517.                             if ("" !== r) {
  1518.                                 var a = e(".iw_tcs_variable");
  1519.                                 a.children("option").each(function () {
  1520.                                     var t = e(this).text();
  1521.                                     if ((t = t.trim()) == r) {
  1522.                                         var o = e(this).attr("value");
  1523.                                         a.val(o), a.trigger("change");
  1524.                                     }
  1525.                                 });
  1526.                             }
  1527.                         })();
  1528.                     });
  1529.             })(),
  1530.             (function () {
  1531.                 if (0 !== _.length) {
  1532.                     e(document.body).trigger("wfacp_sustain_multi_checkout_page_run", [_]);
  1533.                     var a = wfacp_frontend.id,
  1534.                         t = wfacp_frontend.id;
  1535.                     try {
  1536.                         if (!("sessionStorage" in window && null !== window.sessionStorage)) return;
  1537.                         window.localStorage.setItem("wfacp_checkout_page_id", wfacp_frontend.id),
  1538.                             window.addEventListener("storage", function (e) {
  1539.                                 "wfacp_checkout_page_id" === e.key && ((t = e.newValue), (window.wfacp_haschanges = "yes"));
  1540.                             }),
  1541.                             window.addEventListener("focus", function (e) {
  1542.                                 a !== t && t > 0 && "yes" === window.wfacp_haschanges && refresh_page_data(a);
  1543.                             });
  1544.                     } catch (e) {}
  1545.                 }
  1546.             })(),
  1547.             (function () {
  1548.                 var a = wfacp_frontend.show_on_next_step_fields,
  1549.                     t = e(".wfacp_step_preview");
  1550.                 function o(e) {
  1551.                     var a = e.clone().children().remove().end().text();
  1552.                     return "" === (a = a.trim()) && (e.find(".required").remove(), (a = e.text().trim())), a;
  1553.                 }
  1554.                 function n(a) {
  1555.                     if ("select" === a[0].tagName || "SELECT" === a[0].tagName) {
  1556.                         if ("" != a.val()) return a.find("option:selected").text();
  1557.                     } else if ("INPUT" == a[0].tagName) {
  1558.                         if ("hidden" != a[0].getAttribute("type")) return a.val();
  1559.                         var t = e(a[0]).siblings("strong");
  1560.                         if (t.length > 0) return t.text();
  1561.                     }
  1562.                 }
  1563.                 function r(a, o, r) {
  1564.                     var i = "billing";
  1565.                     "shipping-address" === a && (i = "shipping");
  1566.                     var c,
  1567.                         s = "",
  1568.                         _ = e(".wfacp_divider_" + i).find("#" + i + "_first_name"),
  1569.                         p = e(".wfacp_divider_" + i).find("#" + i + "_last_name"),
  1570.                         l = e("#" + i + "_address_1"),
  1571.                         d = e("#" + i + "_address_2"),
  1572.                         f = e("#" + i + "_city"),
  1573.                         u = e("#" + i + "_postcode"),
  1574.                         w = e("#" + i + "_country"),
  1575.                         h = e("#" + i + "_state");
  1576.                     if (
  1577.                         (console.log(h),
  1578.                         _.length > 0 && "" !== _.val() && (s += " " + _.val()),
  1579.                         p.length > 0 && "" !== p.val() && (s += " " + p.val()),
  1580.                         l.length > 0 && "" !== l.val() && ("" != s.trim() ? (s += ", " + l.val()) : (s += l.val())),
  1581.                         d.length > 0 && "" !== d.val() && ("" != s.trim() ? (s += ", " + d.val()) : (s += d.val())),
  1582.                         f.length > 0 && "" !== f.val() && ("" != s.trim() ? (s += ", " + f.val()) : (s += f.val())),
  1583.                         h.length > 0 && "" !== h.val())
  1584.                     ) {
  1585.                         var m = n(h);
  1586.                         void 0 !== m && (s += " " + m), "" == s && (s += " " + h.val());
  1587.                     }
  1588.                     if ((u.length > 0 && "" !== u.val() && (s += " " + u.val()), w.length > 0 && "" !== w.val())) {
  1589.                         var v = "";
  1590.                         "" == (v = n(w)) && (v += w.val()), "" != s.trim() ? (s += ", " + v) : (s += v);
  1591.                     }
  1592.                     if ("" == (c = s)) return !1;
  1593.                     var g = e(".wfacp_divider_" + i)
  1594.                             .parents(".wfacp_page")
  1595.                             .data("step"),
  1596.                         y = "<div class='single_preview'><div class='single_preview_contents "
  1597.                             .concat(a, '\'>\n                                          <div class="single_preview_inner">')
  1598.                             .concat(wfacp_frontend.fields_label[a], '</div>\n                                          <div class="single_preview_inner">')
  1599.                             .concat(c, '</div></div>\n                                          <div class="single_preview_change"><a href="javascript:void(0);" data-next-step="')
  1600.                             .concat(g, '" data-current-step="')
  1601.                             .concat(r.current_step, '" class="wfacp_preview_step_change">')
  1602.                             .concat(wfacp_frontend.change_text_preview_fields, "</a></div>                                          \n                                       </div>");
  1603.                     return t.append(y), !0;
  1604.                 }
  1605.                 function i(a, o, n) {
  1606.                     var r = "",
  1607.                         i = e(".wfacp_shipping_calculator");
  1608.                     if (0 === i.length) return !1;
  1609.                     var c = i.find(".wfacp_shipping_table");
  1610.                     if (c.length > 0) {
  1611.                         var s = (c = c.eq(0)).find(".shipping_method:checked");
  1612.                         s.length > 0 && (r = s.siblings("label").text());
  1613.                     }
  1614.                     if ("" === r) return !1;
  1615.                     var _ = i.parents(".wfacp_page").data("step"),
  1616.                         p = "<div class='single_preview'><div class='single_preview_contents "
  1617.                             .concat(a, '\'>\n                                          <div class="single_preview_inner wfacp_label">')
  1618.                             .concat(wfacp_frontend.fields_label.shipping_calculator, '</div>\n                                          <div class="single_preview_inner wfacp_val">')
  1619.                             .concat(r, '</div></div>\n                                          <div class="single_preview_change">\n                                          <a href="javascript:void(0);" data-next-step="')
  1620.                             .concat(_, '" data-current-step="')
  1621.                             .concat(n.current_step, '" class="wfacp_preview_step_change">')
  1622.                             .concat(wfacp_frontend.change_text_preview_fields, "</a></div>\n                                       </div>");
  1623.                     return t.append(p), !0;
  1624.                 }
  1625.                 function c(a, n, r) {
  1626.                     var i = e("#" + a),
  1627.                         c = "",
  1628.                         s = "";
  1629.                     if (0 === i.length) {
  1630.                         var _ = e("#" + a + "_field");
  1631.                         if (0 === _.length) return !1;
  1632.                         if (_.hasClass("wfacp_custom_field_radio_wrap")) {
  1633.                             var p = _.find("input:checked");
  1634.                             if (0 === p.length) return !1;
  1635.                             var l = p.attr("id");
  1636.                             (c = e('label[for="' + l + '"]').text()), (s = o(e('label[for="' + a + '"]')));
  1637.                         }
  1638.                     } else {
  1639.                         if ("select" === i[0].tagName || "SELECT" === i[0].tagName) c = i.find("option:selected").text();
  1640.                         else if ("checkbox" === i.attr("type")) {
  1641.                             if (!0 !== i.is(":checked")) return !1;
  1642.                             c = "On";
  1643.                         } else {
  1644.                             var d = e(".single_preview_contents.billing_first_name");
  1645.                             if (d.length > 0 && "billing_last_name" === a && "" != i.val()) return d.find(".wfacp_val").append(" " + i.val()), !1;
  1646.                             c = i.val();
  1647.                         }
  1648.                         (s = o(i.parents(".form-row").find("label"))), "billing_first_name" === a && (s = wfacp_frontend.fields_label[a]);
  1649.                     }
  1650.                     if ("" !== c) {
  1651.                         var f = i.parents(".wfacp_page").data("step"),
  1652.                             u = "<div class='single_preview'><div class='single_preview_contents "
  1653.                                 .concat(a, '\'>\n                                          <div class="single_preview_inner wfacp_label">')
  1654.                                 .concat(s, '</div>\n                                          <div class="single_preview_inner wfacp_val">')
  1655.                                 .concat(c, '</div></div>\n                                          <div class="single_preview_change">\n                                          <a href="javascript:void(0);" data-next-step="')
  1656.                                 .concat(f, '" data-current-step="')
  1657.                                 .concat(r.current_step, '" class="wfacp_preview_step_change">')
  1658.                                 .concat(wfacp_frontend.change_text_preview_fields, "</a></div>\n                                       </div>");
  1659.                         return t.append(u), !0;
  1660.                     }
  1661.                     return !1;
  1662.                 }
  1663.                 function s(o) {
  1664.                     var n = "single_step";
  1665.                     "two_step" === o.current_step ? (n = "single_step") : "third_step" === o.current_step && (n = "two_step");
  1666.                     var s = "{}";
  1667.                     if (!0 === o.last_step) {
  1668.                         var _ = Object.assign({}, a.single_step, a.two_step, a.third_step);
  1669.                         s = JSON.stringify(_);
  1670.                     } else {
  1671.                         if (!a.hasOwnProperty(n)) return void e(".wfacp_preview_content_box").hide();
  1672.                         s = JSON.stringify(a[n]);
  1673.                     }
  1674.                     if (void 0 != s) {
  1675.                         var p = JSON.parse(s);
  1676.                         e(".wfacp_preview_content_box").hide(), t.html("");
  1677.                         var l = !1;
  1678.                         for (var d in p)
  1679.                             if ("true" === p[d])
  1680.                                 if ("address" === d || "shipping-address" === d) {
  1681.                                     var f = e("#billing_same_as_shipping"),
  1682.                                         u = e("#shipping_same_as_billing");
  1683.                                     if ("address" === d && f.length > 0 && !1 === f.prop("checked")) continue;
  1684.                                     if ("shipping-address" === d && u.length > 0 && !1 === u.prop("checked")) continue;
  1685.                                     1 == r(d, 0, o) && (l = !0);
  1686.                                 } else "shipping_calculator" === d ? 1 == i(d, 0, o) && (l = !0) : 1 == c(d, 0, o) && (l = !0);
  1687.                         !0 === l && e(".wfacp_preview_content_box[data-step='" + o.current_step + "']").show();
  1688.                     }
  1689.                 }
  1690.                 e(document.body).on("wfacp_step_switching", function (e, a) {
  1691.                     s(a);
  1692.                 }),
  1693.                     e(document.body).on("click", ".wfacp_step_text_have", function (a, t) {
  1694.                         if ((a.preventDefault(), e(this).parent("li").hasClass("wfacp_bred_visited"))) {
  1695.                             var o = e(this).parent("li").attr("step");
  1696.                             if ("" !== o) {
  1697.                                 var n = { current_step: o, last_step: !1 },
  1698.                                     r = e(".wfacp_step_text_have");
  1699.                                 "two_step" === o && 2 == r.length ? (n.last_step = !0) : "third_step" === o && 4 == r.length && (n.last_step = !0), B(), s(n);
  1700.                             }
  1701.                         }
  1702.                     });
  1703.             })(),
  1704.             e(document).on("change", ".wfacp_product_choosen", function (a, o) {
  1705.                 var n = e(".wfacp-product-switch-panel"),
  1706.                     r = e(this),
  1707.                     i = e(this).is(":checked"),
  1708.                     s = e(this).attr("type"),
  1709.                     _ = e(this).parents(".wfacp_product_row");
  1710.                 "radio" === s && e(".wfacp-product-switch-panel .wfacp_product_row").removeClass("wfacp-selected-product");
  1711.                 var p = "addon_product",
  1712.                     l = {};
  1713.                 i || (p = "remove_addon_product"),
  1714.                     (l.type = s),
  1715.                     (l.wfacp_id = e("._wfacp_post_id").val()),
  1716.                     _.find(".wfacp_product_switcher_quantity"),
  1717.                     void 0 !== o && ("add" === o.action && ((p = "addon_product"), (l.quantity = o.qty)), "remove" === o.action && ((p = "remove_addon_product"), o.hasOwnProperty("old_qty") && (l.old_qty = o.old_qty))),
  1718.                     n.block(t);
  1719.                 var d = e(this).data("item-key"),
  1720.                     f = e(this).attr("cart_key");
  1721.                 (l.item_key = d),
  1722.                     void 0 !== f && "" !== f && (l.item_key = f),
  1723.                     (l = set_variation_data(l, o)),
  1724.                     e("#product_switcher_need_refresh").val(0),
  1725.                     show_blocked_mini_cart(),
  1726.                     wfacp_send_ajax({ action: p, type: "post", data: l }, function (a) {
  1727.                         if (a.hasOwnProperty("error")) return "addon_product" === p ? r.prop("checked", !1) : r.prop("checked", !0), wfacp_show_error(_, a), show_unblocked_mini_cart(), void n.unblock();
  1728.                         1 == a.status &&
  1729.                             (e("#product_switcher_need_refresh").val(1),
  1730.                             "addon_product" === p && e(document.body).trigger("wfacp_product_added", { item: a.cart_item, item_key: a.item_key, cart_key: a.new_cart_key }),
  1731.                             (c = !1),
  1732.                             update_checkout());
  1733.                     });
  1734.             }),
  1735.             e(document).on("change", ".wfacp_product_switcher_quantity", function (a, o) {
  1736.                 if (!e(this).hasClass("wfacp_product_global_quantity_bump")) {
  1737.                     if (e(this).is(":disabled")) return !1;
  1738.                     var n = e(this).parents(".wfacp_product_row"),
  1739.                         r = n.find(".wfacp_product_choosen");
  1740.                     0 === r.length && (r = n.find(".wfacp_product_switch"));
  1741.                     var i = r.data("item-key"),
  1742.                         c = r.attr("cart_key"),
  1743.                         s = e("._wfacp_post_id").val(),
  1744.                         _ = e(this).val();
  1745.                     if ("" !== c)
  1746.                         if (0 !== parseInt(_) && "" !== _) {
  1747.                             var p = e(".wfacp-product-switch-panel");
  1748.                             p.block(t), show_blocked_mini_cart();
  1749.                             var l = { action: "update_product_qty", type: "post", data: { item_key: i, cart_key: c, qty: _, wfacp_id: s, is_hide: p.data("is-hide") } };
  1750.                             wfacp_send_ajax(l, function (a) {
  1751.                                 if (("function" == typeof o && o(a), a.hasOwnProperty("error")))
  1752.                                     return (
  1753.                                         a.hasOwnProperty("item_key") ? (n = e('.wfacp_product_row[data-item-key="' + a.item_key + '"]')) : a.hasOwnProperty("cart_key") && (n = e('.wfacp_product_row[cart_key="' + a.cart_key + '"]')),
  1754.                                         wfacp_show_error(n, a),
  1755.                                         show_unblocked_mini_cart(),
  1756.                                         void p.unblock()
  1757.                                     );
  1758.                                 e("#product_switcher_need_refresh").val(0), update_fragments(a), update_checkout();
  1759.                             });
  1760.                         } else {
  1761.                             var d = e(this).data("value");
  1762.                             if (wfacp_frontend.switcher_settings.hasOwnProperty("enable_delete_item") && "true" === wfacp_frontend.switcher_settings.enable_delete_item) r.trigger("change", { action: "remove", qty: 0, old_qty: d });
  1763.                             else {
  1764.                                 var f = e(this).data("value");
  1765.                                 e(this).val(f);
  1766.                             }
  1767.                         }
  1768.                     else {
  1769.                         if (0 === parseInt(_) || "" === _) return;
  1770.                         r.trigger("change", { action: "add", qty: _ });
  1771.                     }
  1772.                 }
  1773.             }),
  1774.             e(document).on("change", ".wfacp_product_switch", function (a, t) {
  1775.                 if (!e(this).is(":checked")) return !1;
  1776.                 var o = e(this),
  1777.                     n = {},
  1778.                     r = o.data("item-key"),
  1779.                     i = e(".wfacp-selected-product");
  1780.                 i.removeClass("wfacp-selected-product");
  1781.                 var c = o.parents(".wfacp_product_row");
  1782.                 if (
  1783.                     (c.addClass("wfacp-selected-product"),
  1784.                     (n.wfacp_id = e("._wfacp_post_id").val()),
  1785.                     (n.new_item = r),
  1786.                     (n.remove_item_key = i.attr("cart_key")),
  1787.                     (n.quantity = 1),
  1788.                     (n.variation_id = 0),
  1789.                     (n = set_variation_data(n, t)),
  1790.                     c.find("input.wfacp_product_switcher_quantity").length > 0)
  1791.                 ) {
  1792.                     var s = c.find("input.wfacp_product_switcher_quantity").val();
  1793.                     s > 0 && (n.quantity = s);
  1794.                 }
  1795.                 "object" == _typeof(t) && (t.hasOwnProperty("old_qty") && (n.old_qty = t.old_qty), t.hasOwnProperty("variation_id") && t.hasOwnProperty("quantity") ? (n.quantity = t.quantity) : (n.quantity = t.qty)),
  1796.                     wfacp_product_switch(n, function (e) {
  1797.                         !1 === e.status && (wfacp_show_error(c, e), c.removeClass("wfacp-selected-product"), i.addClass("wfacp-selected-product"), i.find(".wfacp_product_switch").prop("checked", !0));
  1798.                     });
  1799.             }),
  1800.             e(document).on("change", ".wfacp_product_global_quantity_bump", function () {
  1801.                 var a = e(this).val(),
  1802.                     o = e(this).parents(".cart_item"),
  1803.                     n = o.attr("cart_key"),
  1804.                     r = e(this).data("value");
  1805.                 if ((void 0 != a && "" != a && 0 != a) || (wfacp_frontend.switcher_settings.hasOwnProperty("enable_delete_item") && "true" === wfacp_frontend.switcher_settings.enable_delete_item)) {
  1806.                     var i = e(".wfacp-product-switch-panel");
  1807.                     i.block(t),
  1808.                         show_blocked_mini_cart(),
  1809.                         wfacp_send_ajax({ action: "update_cart_item_quantity", type: "post", data: { cart_key: n, quantity: a, old_qty: r, by: "product_switcher", wfacp_id: e("._wfacp_post_id").val() } }, function (a) {
  1810.                             if ((i.unblock(), a.hasOwnProperty("error") && a.hasOwnProperty("cart_key"))) return (o = e('.wfacp_product_row[cart_key="' + a.cart_key + '"]')), void wfacp_show_error(o, a);
  1811.                             update_fragments(a);
  1812.                         });
  1813.                 } else e(this).val(r);
  1814.             }),
  1815.             e(document).on("click", ".wfacp_mb_mini_cart_wrap .wfacp_mb_cart_accordian", function (a) {
  1816.                 a.preventDefault();
  1817.                 var t = e(".wfacp_mb_mini_cart_wrap .wfacp_mb_cart_accordian"),
  1818.                     o = e(t).siblings(".wfacp_mb_mini_cart_sec_accordion_content");
  1819.                 o.hasClass("wfacp_display_none")
  1820.                     ? (o.slideDown("slow"), o.removeClass("wfacp_display_none"), e(t).find(".wfacp_show_icon_wrap img").addClass("wfacp_up_arrow"), e(t).find(".wfacp_show_icon_wrap a span").text(t.attr("attr-expend")))
  1821.                     : (o.slideUp("slow"), o.addClass("wfacp_display_none"), e(t).find(".wfacp_show_icon_wrap img").removeClass("wfacp_up_arrow"), e(t).find(".wfacp_show_icon_wrap a span").text(t.attr("attr-collaps")));
  1822.             }),
  1823.             (function () {
  1824.                 var a = e(".wfacp-form-control");
  1825.                 if ("undefined" != typeof Storage && a.length > 0 && wfacp_frontend.hasOwnProperty("autopopulate") && "yes" === wfacp_frontend.autopopulate) return populate_fields_value(), "";
  1826.                 setTimeout(
  1827.                     function (a) {
  1828.                         a.each(function () {
  1829.                             var a = e(this);
  1830.                             !a.hasClass("address-field") || a.hasClass("wfacp-anim-wrap")
  1831.                                 ? "" !== a.val() && null != a.val()
  1832.                                     ? a.parents(".wfacp-form-control-wrapper").hasClass("wfacp-anim-wrap") || a.parents(".wfacp-form-control-wrapper").addClass("wfacp-anim-wrap")
  1833.                                     : a.parents(".wfacp-form-control-wrapper").removeClass("wfacp-anim-wrap")
  1834.                                 : a.addClass("wfacp-anim-wrap");
  1835.                         });
  1836.                     },
  1837.                     1e3,
  1838.                     a
  1839.                 );
  1840.             })(),
  1841.             wfacp_frontend.hasOwnProperty("autopopulatestate") &&
  1842.                 "yes" === wfacp_frontend.autopopulatestate &&
  1843.                 (e(document.body).on("change", "#shipping_postcode", T), e(document.body).on("change", "#shipping_country", T), e(document.body).on("change", "#billing_country", D), e(document.body).on("change", "#billing_postcode", D)),
  1844.             e(window).on("load", function () {
  1845.                 e(".wfacp_smart_buttons").removeClass("wfacp-dynamic-checkout-loading");
  1846.                 var a = function () {
  1847.                     var a = e("#wc-stripe-payment-request-button");
  1848.                     a.length > 0 && a.children().length > 0 && (e("#wfacp_smart_buttons").block(t), update_checkout());
  1849.                 };
  1850.                 e(document.body).on("wfacp_coupon_apply", function () {
  1851.                     a();
  1852.                 }),
  1853.                     e(document.body).on("wfacp_coupon_form_removed", function () {
  1854.                         a();
  1855.                     }),
  1856.                     e(document.body).on("updated_checkout", function () {
  1857.                         e("#wfacp_smart_buttons").unblock();
  1858.                     });
  1859.                 var o = e("#wc-stripe-payment-request-button"),
  1860.                     n = e(".wfacp_smart_button_container");
  1861.                 "yes" == wfacp_frontend.is_desktop && "yes" == wfacp_frontend.stripe_smart_show_on_desktop
  1862.                     ? setTimeout(function () {
  1863.                           0 != e("#wfacp_smart_button_stripe_gpay_apay").length && 1 == n.length && 0 == o.children().length && e("#wfacp_smart_buttons").hide();
  1864.                       }, wfacp_frontend.smart_button_hide_timeout)
  1865.                     : "no" == wfacp_frontend.is_desktop &&
  1866.                       setTimeout(function () {
  1867.                           0 != e("#wfacp_smart_button_stripe_gpay_apay").length && 1 == n.length && 0 == o.children().length && e("#wfacp_smart_buttons").hide();
  1868.                       }, wfacp_frontend.smart_button_hide_timeout_m);
  1869.             }),
  1870.             (a = !1),
  1871.             e(document).ajaxSend(function (e, t, o) {
  1872.                 (o.url.indexOf("wc-ajax=wfacp_switch_product_addon") > -1 || o.url.indexOf("wc-ajax=wfacp_addon_product") > -1 || o.url.indexOf("wc-ajax=wfacp_remove_addon_product") > -1) && (a = !0);
  1873.             }),
  1874.             e(document).ajaxComplete(function (t, o, n) {
  1875.                 n.url.indexOf("wc-ajax=update_order_review") > -1 &&
  1876.                     1 == a &&
  1877.                     (setTimeout(function () {
  1878.                         e("fieldset.wfacp_product_row").each(function () {
  1879.                             var a = e(this);
  1880.                             a.hasClass("wfacp-selected-product") || (a.find(".wfacp_best_value").length > 0 && a.find(".wfacp_best_value").addClass("shake_top"));
  1881.                         });
  1882.                     }, 300),
  1883.                     (a = !1));
  1884.             }),
  1885.             window.addEventListener("load", function () {
  1886.                 try {
  1887.                     if (!("sessionStorage" in window && null !== window.sessionStorage)) return;
  1888.                     window.localStorage.setItem("wfacp_page_is_loaded", wfacp_frontend.id);
  1889.                 } catch (e) {
  1890.                     console.log(e);
  1891.                 }
  1892.             }),
  1893.             window.addEventListener("storage", function (e) {
  1894.                 "wfacp_page_is_loaded" === e.key &&
  1895.                     e.newValue > 0 &&
  1896.                     wfacp_frontend.id !== e.newValue &&
  1897.                     1 == is_document_visible() &&
  1898.                     setTimeout(function () {
  1899.                         console.log("Run Trigger refresh page data."), refresh_page_data(wfacp_frontend.id);
  1900.                     }, 1e3);
  1901.             });
  1902.     })(jQuery),
  1903.     (function (e) {
  1904.         e(document.body).on("wfacp_step_switching", function (a, t) {
  1905.             if (void 0 !== t) {
  1906.                 var o = t.next_shown,
  1907.                     n = t.hide_parent,
  1908.                     r = e(".wfacp-payment-tab-list");
  1909.                 r.removeClass("wfacp-active");
  1910.                 var i = e(".wfacp-payment-tab-list." + o);
  1911.                 i.length > 0 && i.addClass("wfacp-active"), r.hasClass(n) && (e(".wfacp-payment-tab-list." + n).addClass("visited_cls"), i.addClass("visited_cls")), e(".wfacp_modal_container").scroll().animate({ scrollTop: 0 }, 1e3);
  1912.             }
  1913.         }),
  1914.             e(document.body).on("checkout_error", function () {
  1915.                 e(".wfacp_modal_container").scroll().animate({ scrollTop: 0 }, 1e3);
  1916.                 var a = e("ul.woocommerce_error.woocommerce-error.wc-stripe-error:visible");
  1917.                 a.length > 0 && e.scroll_to_notices(a);
  1918.             }),
  1919.             e(document).ready(function (a) {
  1920.                 e(document.body).on("click", ".wfacp-payment-tab-list", function (a) {
  1921.                     if ((a.preventDefault(), e(this).hasClass("visited_cls"))) {
  1922.                         var t = e(this).attr("step");
  1923.                         if (e(".wfacp_page:visible").hasClass(t)) return;
  1924.                         var o = e(".wfacp-payment-tab-list");
  1925.                         o.removeClass("wfacp-active"), e(this).addClass("wfacp-active"), e(".wfacp_page").fadeOut(300);
  1926.                         var n = e(".wfacp-payment-tab-list:last");
  1927.                         return (
  1928.                             e(this)[0] == n[0] && e(".wfacp_payment").removeClass("wfacp_hide_payment_part").addClass("wfacp_show_payment_part"),
  1929.                             void e(".wfacp_page." + t).fadeIn(600, function () {
  1930.                                 var a = { next_shown: t, current_step: t, last_step: !1 };
  1931.                                 "two_step" === t && 2 === o.length ? ((a.hide_step = "two_step"), (a.last_step = !0), (a.last_step = !0)) : "third_step" === t && 3 == o.length && ((a.hide_step = "two_step"), (a.last_step = !0)),
  1932.                                     e(document.body).trigger("wfacp_step_switching", a),
  1933.                                     e(".country_to_state").length > 0 && e(document.body).trigger("country_to_state_changed");
  1934.                             })
  1935.                         );
  1936.                     }
  1937.                 }),
  1938.                     e(".wfacp_modal_open").on("click", function (a) {
  1939.                         a.preventDefault(), e(".wfacp_modal_overlay").removeClass("wfacp_display_none"), e(".wfacp_modal_outerwrap").fadeIn(300), e("body").addClass("wfacp_overflow_hide");
  1940.                     }),
  1941.                     e(".wfacp_modal_close").on("click", function (a) {
  1942.                         a.preventDefault(), e(".wfacp_modal_overlay").addClass("wfacp_display_none"), e(".wfacp_modal_outerwrap").fadeOut(300), e("body").removeClass("wfacp_overflow_hide");
  1943.                     }),
  1944.                     (function () {
  1945.                         var a = e(".woocommerce-form-login"),
  1946.                             t = e(".wfacp_modal_open");
  1947.                         if (t.length > 0) {
  1948.                             var o = localStorage.getItem("wfacp_embed_form_login");
  1949.                             null !== o && "yes" === o && (localStorage.removeItem("wfacp_embed_form_login"), t.trigger("click"));
  1950.                         }
  1951.                         a.on("submit", function () {
  1952.                             localStorage.setItem("wfacp_embed_form_login", "yes");
  1953.                         });
  1954.                     })();
  1955.             }),
  1956.             e(document.body).on("keyup", ".wfacp_dob", function () {
  1957.                 var a = new Date(),
  1958.                     t = e(this).data("label");
  1959.                 e(this).css("border", "1px solid #bfbfbf");
  1960.                 var o = e(this).val(),
  1961.                     n = e(this).data("min"),
  1962.                     r = e(this).data("max");
  1963.                 "" != o && ("day" == t || "month" == t) && n > o ? e(this).val(n) : "" != o && ("day" == t || "month" == t) && r < o && e(this).val(r);
  1964.                 var i = new Date(o + "-1-1");
  1965.                 (("year" == t && "Invalid Date" == i) || n > o || a < i) && e(this).css("border", "2px solid #d50000");
  1966.             });
  1967.     })(jQuery),
  1968.     (function (e) {
  1969.         var a = (function () {
  1970.                 function a(e) {
  1971.                     _classCallCheck(this, a),
  1972.                         void 0 != e &&
  1973.                             ((this.track_name = ""),
  1974.                             (this.track_id = e.id),
  1975.                             (this.settings = e.settings),
  1976.                             (this.positions = e.positions),
  1977.                             (this.data = { add_to_cart: e.add_to_cart, checkout: e.checkout, payment_info: {}, last_checkout_data: null }),
  1978.                             (this.add_to_cart_run = !1),
  1979.                             (this.checkout_event_run = !1),
  1980.                             this.init(),
  1981.                             this.attach_triggers());
  1982.                 }
  1983.                 return (
  1984.                     _createClass(a, [
  1985.                         { key: "init", value: function () {} },
  1986.                         {
  1987.                             key: "fire_events",
  1988.                             value: function (e) {
  1989.                                 this.positions.add_to_cart === e && 0 == this.add_to_cart_run && (this.add_to_cart(), (this.add_to_cart_run = !0)), this.positions.checkout === e && this.checkout();
  1990.                             },
  1991.                         },
  1992.                         {
  1993.                             key: "attach_triggers",
  1994.                             value: function () {
  1995.                                 var a = this,
  1996.                                     t = this,
  1997.                                     o = !1,
  1998.                                     n = !1;
  1999.                                 e("#billing_email").on("change", function () {
  2000.                                     wfacp_validate_email(e(this).val()) && t.fire_events("email");
  2001.                                 }),
  2002.                                     e(window).on("load", function () {
  2003.                                         t.fire_events("load"), t.load();
  2004.                                     });
  2005.                                 var r = e(".wfacp_next_page_button");
  2006.                                 r.length > 0 &&
  2007.                                     e(document.body).on("wfacp_step_switching", function () {
  2008.                                         !1 === o && (t.fire_events("button"), (o = !0));
  2009.                                     }),
  2010.                                     wfacp_frontend.hooks.addAction("wfacp_checkout_place_order", function () {
  2011.                                         0 === r.length && 0 === e(".woocommerce-invalid-required-field:visible").length && t.fire_events("button"),
  2012.                                             !1 === n && (a.payment_info(), (n = !0)),
  2013.                                             0 == r.length && !1 === a.checkout_event_run && a.checkout();
  2014.                                     }),
  2015.                                     e(document.body).on("wfacp_product_added", function (e, a) {
  2016.                                         if (a.hasOwnProperty("item_key") && a.hasOwnProperty("item") && a.item.hasOwnProperty(a.item_key)) {
  2017.                                             var o = a.item_key;
  2018.                                             if (void 0 == t.data.add_to_cart) return;
  2019.                                             if (t.data.add_to_cart.hasOwnProperty(o)) return;
  2020.                                             a.item[o].hasOwnProperty(t.track_name) && t.single_add_to_cart(a.item[o][t.track_name], a.item.cart_key), (t.checkout_event_run = !1);
  2021.                                         }
  2022.                                     }),
  2023.                                     e(document.body).on("wfacp_checkout_data", function (e, a) {
  2024.                                         if (a.hasOwnProperty("checkout") && a.hasOwnProperty("checkout")) {
  2025.                                             if (void 0 === a.checkout) return;
  2026.                                             if (!a.checkout.hasOwnProperty(t.track_name)) return;
  2027.                                             (t.data.checkout = a.checkout[t.track_name]), (o = !1), (t.checkout_event_run = !1);
  2028.                                         }
  2029.                                     });
  2030.                             },
  2031.                         },
  2032.                         {
  2033.                             key: "single_add_to_cart",
  2034.                             value: function (e) {
  2035.                                 "true" === this.settings.add_to_cart && this.event_single_add_to_cart(e);
  2036.                             },
  2037.                         },
  2038.                         { key: "event_single_add_to_cart", value: function (e) {} },
  2039.                         {
  2040.                             key: "add_to_cart",
  2041.                             value: function () {
  2042.                                 "true" === this.settings.add_to_cart && this.event_add_to_cart();
  2043.                             },
  2044.                         },
  2045.                         { key: "event_add_to_cart", value: function () {} },
  2046.                         {
  2047.                             key: "checkout",
  2048.                             value: function () {
  2049.                                 var e = JSON.stringify(this.data.checkout);
  2050.                                 "true" === this.settings.checkout && e !== this.data.last_checkout_data && 0 == this.checkout_event_run && (this.event_checkout(e), (this.data.last_checkout_data = e), (this.checkout_event_run = !0));
  2051.                             },
  2052.                         },
  2053.                         { key: "event_checkout", value: function (e) {} },
  2054.                         {
  2055.                             key: "payment_info",
  2056.                             value: function () {
  2057.                                 "true" === this.settings.payment && this.event_payment_info();
  2058.                             },
  2059.                         },
  2060.                         { key: "event_payment_info", value: function () {} },
  2061.                         { key: "load", value: function () {} },
  2062.                     ]),
  2063.                     a
  2064.                 );
  2065.             })(),
  2066.             t = (function (e) {
  2067.                 _inherits(o, a);
  2068.                 var t = _createSuper(o);
  2069.                 function o(e) {
  2070.                     var a;
  2071.                     return _classCallCheck(this, o), ((a = t.call(this, e)).track_name = "pixel"), a;
  2072.                 }
  2073.                 return (
  2074.                     _createClass(
  2075.                         o,
  2076.                         [
  2077.                             {
  2078.                                 key: "init",
  2079.                                 value: function () {
  2080.                                     fbq("init", this.track_id);
  2081.                                 },
  2082.                             },
  2083.                             {
  2084.                                 key: "event_add_to_cart",
  2085.                                 value: function () {
  2086.                                     var e = this.data.add_to_cart;
  2087.                                     for (var a in e) this.event_single_add_to_cart(e[a], a);
  2088.                                 },
  2089.                             },
  2090.                             {
  2091.                                 key: "event_single_add_to_cart",
  2092.                                 value: function (e, a) {
  2093.                                     "function" == typeof fbq && fbq("trackSingle", this.track_id, "AddToCart", e);
  2094.                                 },
  2095.                             },
  2096.                             {
  2097.                                 key: "event_checkout",
  2098.                                 value: function (e) {
  2099.                                     "function" == typeof fbq && fbq("trackSingle", this.track_id, "InitiateCheckout", JSON.parse(e));
  2100.                                 },
  2101.                             },
  2102.                             {
  2103.                                 key: "event_payment_info",
  2104.                                 value: function () {
  2105.                                     "function" == typeof fbq && fbq("trackSingle", this.track_id, "AddPaymentInfo", this.data.checkout);
  2106.                                 },
  2107.                             },
  2108.                             {
  2109.                                 key: "load",
  2110.                                 value: function () {
  2111.                                     "function" == typeof fbq && "true" === this.settings.page_view && fbq("trackSingle", this.track_id, "PageView", { plugin: "AeroCheckout" });
  2112.                                 },
  2113.                             },
  2114.                         ],
  2115.                         [
  2116.                             {
  2117.                                 key: "enqueue_js",
  2118.                                 value: function () {
  2119.                                     var e, a, t, o, n, r;
  2120.                                     (e = window),
  2121.                                         (a = document),
  2122.                                         (t = "script"),
  2123.                                         e.fbq ||
  2124.                                             ((o = e.fbq = function () {
  2125.                                                 o.callMethod ? o.callMethod.apply(o, arguments) : o.queue.push(arguments);
  2126.                                             }),
  2127.                                             e._fbq || (e._fbq = o),
  2128.                                             (o.push = o),
  2129.                                             (o.loaded = !0),
  2130.                                             (o.version = "2.0"),
  2131.                                             (o.queue = []),
  2132.                                             ((n = a.createElement(t)).async = !0),
  2133.                                             (n.src = "https://connect.facebook.net/en_US/fbevents.js"),
  2134.                                             (r = a.getElementsByTagName(t)[0]).parentNode.insertBefore(n, r));
  2135.                                 },
  2136.                             },
  2137.                         ]
  2138.                     ),
  2139.                     o
  2140.                 );
  2141.             })(),
  2142.             o = (function (e) {
  2143.                 _inherits(o, a);
  2144.                 var t = _createSuper(o);
  2145.                 function o(e) {
  2146.                     var a;
  2147.                     return _classCallCheck(this, o), ((a = t.call(this, e)).track_name = "google_ua"), a;
  2148.                 }
  2149.                 return (
  2150.                     _createClass(o, [
  2151.                         { key: "init", value: function () {} },
  2152.                         {
  2153.                             key: "event_checkout",
  2154.                             value: function (e) {
  2155.                                 var a = { send_to: this.track_id, event_category: "ecommerce", items: JSON.parse(e), non_interaction: !0 };
  2156.                                 gtag("event", "begin_checkout", a);
  2157.                             },
  2158.                         },
  2159.                         {
  2160.                             key: "event_single_add_to_cart",
  2161.                             value: function (e) {
  2162.                                 var a = { send_to: this.track_id, event_category: "ecommerce", items: e, non_interaction: !0 };
  2163.                                 gtag("event", "add_to_cart", a);
  2164.                             },
  2165.                         },
  2166.                         {
  2167.                             key: "event_add_to_cart",
  2168.                             value: function () {
  2169.                                 var e = { send_to: this.track_id, event_category: "ecommerce", items: this.data.add_to_cart, non_interaction: !0 };
  2170.                                 gtag("event", "add_to_cart", e);
  2171.                             },
  2172.                         },
  2173.                         {
  2174.                             key: "event_payment_info",
  2175.                             value: function () {
  2176.                                 gtag("event", "add_payment_info", { send_to: this.track_id, non_interaction: !0 });
  2177.                             },
  2178.                         },
  2179.                     ]),
  2180.                     o
  2181.                 );
  2182.             })();
  2183.         if (((wfacp_frontend.tracks = {}), wfacp_analytics_data.pixel.hasOwnProperty("id"))) {
  2184.             t.enqueue_js();
  2185.             var n = wfacp_analytics_data.pixel.id.split(",");
  2186.             if (n.length > 0) {
  2187.                 wfacp_frontend.tracks.facebook = {};
  2188.                 for (var r = 0; r < n.length; r++) {
  2189.                     var i = n[r],
  2190.                         c = JSON.stringify(wfacp_analytics_data.pixel);
  2191.                     ((c = JSON.parse(c)).id = i.trim()), (wfacp_frontend.tracks.facebook[i] = new t(c));
  2192.                 }
  2193.             }
  2194.         }
  2195.         wfacp_analytics_data.google_ua.hasOwnProperty("id") && (wfacp_frontend.tracks.google = new o(wfacp_analytics_data.google_ua));
  2196.     })(jQuery),
  2197.     (function (e) {
  2198.         var a = (function () {
  2199.                 function a() {
  2200.                     var e = this;
  2201.                     _classCallCheck(this, a),
  2202.                         wfacp_frontend.hooks.addFilter("wfacp_google_map_address_data", function (a, t) {
  2203.                             return e.map_data(a, t);
  2204.                         }),
  2205.                         wfacp_frontend.hooks.addFilter(
  2206.                             "wfacp_autocomplete_element",
  2207.                             function (a, t) {
  2208.                                 return e.enable_on_street_name(a, t);
  2209.                             },
  2210.                             10,
  2211.                             "wfacp_change_element_for_netherland"
  2212.                         );
  2213.                 }
  2214.                 return (
  2215.                     _createClass(a, [
  2216.                         {
  2217.                             key: "state_not_matched_code_country",
  2218.                             value: function () {
  2219.                                 return ["NZ", "ES", "BG", "HK", "MX"];
  2220.                             },
  2221.                         },
  2222.                         { key: "temp", value: function () {} },
  2223.                         {
  2224.                             key: "get_states",
  2225.                             value: function (e) {
  2226.                                 var a = {};
  2227.                                 return (
  2228.                                     (e = e.toLowerCase()),
  2229.                                     (a.nz = {
  2230.                                         auckland: "AK",
  2231.                                         northland: "NL",
  2232.                                         waikato: "WA",
  2233.                                         "bay-of-plenty": "BP",
  2234.                                         taranaki: "TK",
  2235.                                         "hawkes-bay": "HB",
  2236.                                         "manawatu-wanganui": "MW",
  2237.                                         wellington: "WE",
  2238.                                         nelson: "NS",
  2239.                                         marlborough: "MB",
  2240.                                         tasman: "TM",
  2241.                                         "west-coast": "WC",
  2242.                                         canterbury: "CT",
  2243.                                         ota: "OT",
  2244.                                         southland: "SL",
  2245.                                     }),
  2246.                                     (a.es = {
  2247.                                         "a-coruΓ±a": "C",
  2248.                                         araba: "VI",
  2249.                                         albacete: "AB",
  2250.                                         alicante: "A",
  2251.                                         almerΓ­a: "AL",
  2252.                                         asturias: "O",
  2253.                                         Γ‘vila: "AV",
  2254.                                         badajoz: "BA",
  2255.                                         baleares: "PM",
  2256.                                         barcelona: "B",
  2257.                                         burgos: "BU",
  2258.                                         cΓ‘ceres: "CC",
  2259.                                         cΓ‘diz: "CA",
  2260.                                         cantabria: "S",
  2261.                                         castellΓ³n: "CS",
  2262.                                         ceuta: "CE",
  2263.                                         "ciudad-real": "CR",
  2264.                                         cΓ³rdoba: "CO",
  2265.                                         cuenca: "CU",
  2266.                                         girona: "GI",
  2267.                                         granada: "GR",
  2268.                                         guadalajara: "GU",
  2269.                                         gipuzkoa: "SS",
  2270.                                         huelva: "H",
  2271.                                         huesca: "HU",
  2272.                                         jaΓ©n: "J",
  2273.                                         "la-rioja": "LO",
  2274.                                         "las-palmas": "GC",
  2275.                                         leΓ³n: "LE",
  2276.                                         lleida: "L",
  2277.                                         lugo: "LU",
  2278.                                         madrid: "M",
  2279.                                         mΓ‘laga: "MA",
  2280.                                         melilla: "ML",
  2281.                                         murcia: "MU",
  2282.                                         navarra: "NA",
  2283.                                         ourense: "OR",
  2284.                                         palencia: "P",
  2285.                                         pontevedra: "PO",
  2286.                                         salamanca: "SA",
  2287.                                         "santa-cruz-de-tenerife": "TF",
  2288.                                         segovia: "SG",
  2289.                                         sevilla: "SE",
  2290.                                         soria: "SO",
  2291.                                         tarragona: "T",
  2292.                                         teruel: "TE",
  2293.                                         toledo: "TO",
  2294.                                         valencia: "V",
  2295.                                         valladolid: "VA",
  2296.                                         bizkaia: "BI",
  2297.                                         zamora: "ZA",
  2298.                                         zaragoza: "Z",
  2299.                                     }),
  2300.                                     (a.bg = {
  2301.                                         blagoevgrad: "BG-01",
  2302.                                         burgas: "BG-02",
  2303.                                         dobrich: "BG-08",
  2304.                                         gabrovo: "BG-07",
  2305.                                         haskovo: "BG-26",
  2306.                                         kardzhali: "BG-09",
  2307.                                         kyustendil: "BG-10",
  2308.                                         lovech: "BG-11",
  2309.                                         montana: "BG-12",
  2310.                                         pazardzhik: "BG-13",
  2311.                                         pernik: "BG-14",
  2312.                                         pleven: "BG-15",
  2313.                                         plovdiv: "BG-16",
  2314.                                         razgrad: "BG-17",
  2315.                                         ruse: "BG-18",
  2316.                                         shumen: "BG-27",
  2317.                                         silistra: "BG-19",
  2318.                                         sliven: "BG-20",
  2319.                                         smolyan: "BG-21",
  2320.                                         "sofia-city-province": "BG-23",
  2321.                                         "sofia-grad": "BG-22",
  2322.                                         "stara-zagora": "BG-24",
  2323.                                         targovishte: "BG-25",
  2324.                                         varna: "BG-03",
  2325.                                         "veliko-tarnovo": "BG-04",
  2326.                                         vidin: "BG-05",
  2327.                                         vratsa: "BG-06",
  2328.                                         yambol: "BG-28",
  2329.                                     }),
  2330.                                     (a.hk = { kowloon: "KOWLOON", "hong-kong-island": "HONG KONG", "new-territories": "NEW TERRITORIES" }),
  2331.                                     (a.mx = {
  2332.                                         "ags.": "AG",
  2333.                                         "b.c.": "BC",
  2334.                                         "b.c.s.": "BS",
  2335.                                         "camp.": "CM",
  2336.                                         "chis.": "CS",
  2337.                                         "chih.": "CH",
  2338.                                         "coah.": "CO",
  2339.                                         "col.": "CL",
  2340.                                         cdmx: "DF",
  2341.                                         "dgo.": "DG",
  2342.                                         "gto.": "GT",
  2343.                                         "gro.": "GR",
  2344.                                         "hgo.": "HG",
  2345.                                         "jal.": "JA",
  2346.                                         "mΓ©x.": "MX",
  2347.                                         "mich.": "MI",
  2348.                                         "mor.": "MO",
  2349.                                         "nay.": "NA",
  2350.                                         "n.l.": "NL",
  2351.                                         "oax.": "OA",
  2352.                                         "pue.": "PU",
  2353.                                         "qro.": "QT",
  2354.                                         "q.r.": "QR",
  2355.                                         "s.l.p.": "SL",
  2356.                                         "sin.": "SI",
  2357.                                         "son.": "SO",
  2358.                                         "tab.": "TB",
  2359.                                         "tamps.": "TM",
  2360.                                         "tlax.": "TL",
  2361.                                         "ver.": "VE",
  2362.                                         "yuc.": "YU",
  2363.                                         "zac.": "ZA",
  2364.                                     }),
  2365.                                     a.hasOwnProperty(e) ? a[e] : null
  2366.                                 );
  2367.                             },
  2368.                         },
  2369.                         {
  2370.                             key: "map_data",
  2371.                             value: function (e, a) {
  2372.                                 var t = a.get_country();
  2373.                                 if (("RO" === t && "Municipiul BucureΘ™ti" == e._state && (e._state = "B"), this.state_not_matched_code_country().indexOf(t) > -1 && "" !== e._state)) {
  2374.                                     var o = this.get_states(t),
  2375.                                         n = e._state.replace(/ /g, "-").replace(/'/g, "").toLowerCase();
  2376.                                     if (null == o || !1 === o.hasOwnProperty(n)) return e;
  2377.                                     e._state = o[n];
  2378.                                 }
  2379.                                 return e;
  2380.                             },
  2381.                         },
  2382.                         {
  2383.                             key: "enable_on_street_name",
  2384.                             value: function (a, t) {
  2385.                                 if ("NL" === t.get_country()) {
  2386.                                     var o = e("#" + t.type + "_street_name");
  2387.                                     o.length > 0 && (a = o);
  2388.                                 }
  2389.                                 return a;
  2390.                             },
  2391.                         },
  2392.                     ]),
  2393.                     a
  2394.                 );
  2395.             })(),
  2396.             t = (function () {
  2397.                 function a() {
  2398.                     var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "billing",
  2399.                         o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "";
  2400.                     _classCallCheck(this, a),
  2401.                         (this.type = t),
  2402.                         (this.country_key = "#" + t + "_country"),
  2403.                         (this.search_key = "#" + t + "_address_1"),
  2404.                         (this.postcode_key = "#" + t + "_postcode"),
  2405.                         (this.state_key = "#" + t + "_state"),
  2406.                         "" !== o && e(o).length > 0 && (this.search_key = o),
  2407.                         (this.search_key_placeholder = e(this.search_key).attr("placeholder")),
  2408.                         (this.address = null),
  2409.                         this.init();
  2410.                 }
  2411.                 return (
  2412.                     _createClass(a, [
  2413.                         {
  2414.                             key: "init",
  2415.                             value: function () {
  2416.                                 this.change_events(),
  2417.                                     this.enable_autocomplete(),
  2418.                                     this.geoCode(),
  2419.                                     e(this.search_key).keydown(function (e) {
  2420.                                         if (13 == e.keyCode) return e.preventDefault(), !1;
  2421.                                     });
  2422.                             },
  2423.                         },
  2424.                         {
  2425.                             key: "excluded_countries",
  2426.                             value: function () {
  2427.                                 return wfacp_frontend.gmaps.disallow_countries;
  2428.                             },
  2429.                         },
  2430.                         {
  2431.                             key: "clearListener",
  2432.                             value: function () {
  2433.                                 if (null != this.address) {
  2434.                                     var a = e(this.search_key);
  2435.                                     google.maps.event.clearInstanceListeners(a[0]), (this.address = null);
  2436.                                 }
  2437.                                 e(this.search_key).removeAttr("placeholder"), e(this.search_key).removeAttr("disabled"), e(this.search_key).removeAttr("style");
  2438.                             },
  2439.                         },
  2440.                         {
  2441.                             key: "reset_event",
  2442.                             value: function () {
  2443.                                 var e = this;
  2444.                                 this.clearListener(),
  2445.                                     setTimeout(function () {
  2446.                                         e.enable_autocomplete();
  2447.                                     }, 200);
  2448.                             },
  2449.                         },
  2450.                         {
  2451.                             key: "change_events",
  2452.                             value: function () {
  2453.                                 var a = this;
  2454.                                 e(this.country_key).on("change", function () {
  2455.                                     a.reset_event();
  2456.                                 });
  2457.                             },
  2458.                         },
  2459.                         {
  2460.                             key: "get_country",
  2461.                             value: function () {
  2462.                                 return e(this.country_key).val();
  2463.                             },
  2464.                         },
  2465.                         {
  2466.                             key: "update_country",
  2467.                             value: function () {
  2468.                                 var a = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "us";
  2469.                                 e(this.country_key).val(a), e(this.country_key).trigger("change");
  2470.                             },
  2471.                         },
  2472.                         {
  2473.                             key: "google_options",
  2474.                             value: function () {
  2475.                                 var e = this.get_country(),
  2476.                                     a = { types: ["geocode"] };
  2477.                                 return void 0 !== e && "" !== e && null !== e && (a.componentRestrictions = { country: e }), wfacp_frontend.hooks.applyFilters("wfacp_google_address_options", a, e);
  2478.                             },
  2479.                         },
  2480.                         {
  2481.                             key: "get_address_format",
  2482.                             value: function () {
  2483.                                 var e = this.get_country();
  2484.                                 e = null == e ? "" : e.toLowerCase();
  2485.                                 var a = {
  2486.                                     us: {
  2487.                                         _address_1: { keys: { street_number: "long_name", route: "long_name" }, separator: " " },
  2488.                                         _address_2: { keys: { neighborhood: "long_name" }, separator: " " },
  2489.                                         _city: { keys: { locality: "long_name" }, separator: " " },
  2490.                                         _state: { keys: { administrative_area_level_1: "short_name" }, separator: " " },
  2491.                                         _postcode: { keys: { postal_code: "long_name" }, separator: "-" },
  2492.                                     },
  2493.                                     gb: {
  2494.                                         _address_1: { keys: { street_number: "long_name", route: "long_name" }, separator: " " },
  2495.                                         _address_2: { keys: { neighborhood: "long_name" }, separator: " " },
  2496.                                         _city: { keys: { postal_town: "long_name" }, separator: " " },
  2497.                                         _postcode: { keys: { postal_code_prefix: "long_name", postal_code: "long_name" }, separator: " " },
  2498.                                     },
  2499.                                     de: {
  2500.                                         _address_1: { keys: { route: "long_name", street_number: "long_name" }, separator: " " },
  2501.                                         _address_2: { keys: { sublocality_level_3: "long_name", sublocality_level_2: "long_name", sublocality_level_1: "long_name" }, separator: " " },
  2502.                                         _city: { keys: { locality: "long_name" }, separator: " " },
  2503.                                     },
  2504.                                     fr: {
  2505.                                         _address_1: { keys: { street_number: "long_name", route: "long_name" }, separator: " " },
  2506.                                         _address_2: { keys: { sublocality_level_3: "long_name", sublocality_level_2: "long_name", sublocality_level_1: "long_name" }, separator: " " },
  2507.                                         _city: { keys: { locality: "long_name" }, separator: " " },
  2508.                                     },
  2509.                                     ca: {
  2510.                                         _address_1: { keys: { street_number: "long_name", route: "long_name" }, separator: " " },
  2511.                                         _address_2: { keys: { sublocality_level_3: "long_name", sublocality_level_2: "long_name", sublocality_level_1: "long_name" }, separator: " " },
  2512.                                         _city: { keys: { locality: "long_name" }, separator: " " },
  2513.                                         _state: { keys: { administrative_area_level_1: "short_name" }, separator: " " },
  2514.                                     },
  2515.                                     nl: {
  2516.                                         _address_1: { keys: { route: "long_name", street_number: "long_name" }, separator: " " },
  2517.                                         _street_name: { keys: { street_number: "long_name" }, separator: " " },
  2518.                                         _city: { keys: { locality: "long_name" }, separator: " " },
  2519.                                     },
  2520.                                     si: { _address_1: { keys: { route: "long_name", street_number: "long_name" }, separator: " " }, _city: { keys: { postal_town: "long_name" }, separator: " " } },
  2521.                                     vn: {
  2522.                                         _address_1: { keys: { premise: "long_name", route: "long_name", street_number: "long_name", neighborhood: "long_name" }, separator: " " },
  2523.                                         _city: { keys: { administrative_area_level_1: "long_name" }, separator: " " },
  2524.                                     },
  2525.                                     it: {
  2526.                                         _address_1: { keys: { premise: "long_name", route: "long_name", street_number: "long_name", neighborhood: "long_name" }, separator: " " },
  2527.                                         _city: { keys: { locality: "long_name" }, separator: " " },
  2528.                                         _state: { keys: { administrative_area_level_2: "short_name" }, separator: " " },
  2529.                                     },
  2530.                                 };
  2531.                                 (a.es = this.jsp(a.it)),
  2532.                                     (a.ro = this.jsp(a.it)),
  2533.                                     (a.ro._state = { keys: { administrative_area_level_1: "short_name" }, separator: " " }),
  2534.                                     (a.bg = this.jsp(a.ro)),
  2535.                                     (a.il = {
  2536.                                         _address_1: { keys: { premise: "long_name", route: "long_name", street_number: "long_name", neighborhood: "long_name" }, separator: " " },
  2537.                                         _city: { keys: { locality: "long_name" }, separator: " " },
  2538.                                     }),
  2539.                                     (a.in = {
  2540.                                         _address_1: { keys: { street_number: "long_name", route: "long_name", sublocality_level_3: "long_name", sublocality_level_2: "long_name", sublocality_level_1: "long_name" }, separator: " " },
  2541.                                         _city: { keys: { administrative_area_level_2: "long_name" }, separator: " " },
  2542.                                         _state: { keys: { administrative_area_level_1: "short_name" }, separator: " " },
  2543.                                     }),
  2544.                                     (a.br = {
  2545.                                         _address_1: { keys: { route: "long_name", street_number: "long_name", sublocality_level_3: "short_name", sublocality_level_2: "short_name", sublocality_level_1: "short_name" }, separator: ", " },
  2546.                                         _city: { keys: { administrative_area_level_2: "long_name" }, separator: " " },
  2547.                                         _state: { keys: { administrative_area_level_1: "short_name" }, separator: " " },
  2548.                                     }),
  2549.                                     (a.hk = {
  2550.                                         _address_1: { keys: { route: "long_name", street_number: "long_name", sublocality_level_3: "short_name", sublocality_level_2: "short_name", sublocality_level_1: "short_name" }, separator: ", " },
  2551.                                         _city: { keys: { neighborhood: "long_name" }, separator: " " },
  2552.                                         _state: { keys: { administrative_area_level_1: "short_name" }, separator: " " },
  2553.                                     }),
  2554.                                     (a.mx = {
  2555.                                         _address_1: { keys: { route: "long_name", street_number: "long_name", sublocality_level_3: "long_name", sublocality_level_2: "long_name" }, separator: " " },
  2556.                                         _city: { keys: { locality: "long_name" }, separator: " " },
  2557.                                         _state: { keys: { administrative_area_level_1: "short_name" }, separator: " " },
  2558.                                     }),
  2559.                                     (a.at = { _address_1: { keys: { route: "long_name", street_number: "long_name" }, separator: ", " }, _city: { keys: { locality: "long_name" }, separator: " " } }),
  2560.                                     (a.au = {
  2561.                                         _address_1: { keys: { street_number: "long_name", route: "long_name" }, separator: " " },
  2562.                                         _address_2: { keys: { neighborhood: "long_name" }, separator: " " },
  2563.                                         _city: { keys: { locality: "long_name" }, separator: " " },
  2564.                                         _state: { keys: { administrative_area_level_1: "short_name" }, separator: " " },
  2565.                                         _postcode: { keys: { postal_code: "long_name" }, separator: "-" },
  2566.                                     });
  2567.                                 var t = {};
  2568.                                 return (
  2569.                                     ((t =
  2570.                                         !1 === (a = wfacp_frontend.hooks.applyFilters("wfacp_countries_address_format", a, this)).hasOwnProperty(e)
  2571.                                             ? {
  2572.                                                   _address_1: { keys: { route: "long_name", street_number: "long_name" }, separator: " " },
  2573.                                                   _address_2: { keys: { neighborhood: "long_name" }, separator: " " },
  2574.                                                   _city: { keys: { locality: "long_name" }, separator: " " },
  2575.                                                   _state: { keys: { administrative_area_level_1: "short_name" }, separator: " " },
  2576.                                                   _postcode: { keys: { postal_code: "long_name" }, separator: "-" },
  2577.                                               }
  2578.                                             : a[e])._country = { keys: { country: "short_name" }, separator: " " }),
  2579.                                     !1 === t.hasOwnProperty("_state") && (t._state = { keys: { administrative_area_level_2: "short_name" }, separator: " " }),
  2580.                                     !1 === t.hasOwnProperty("_postcode") && (t._postcode = { keys: { postal_code: "long_name" }, separator: "-" }),
  2581.                                     wfacp_frontend.hooks.applyFilters("wfacp_country_address_google_format", t, a)
  2582.                                 );
  2583.                             },
  2584.                         },
  2585.                         {
  2586.                             key: "normalize_place_address_keys",
  2587.                             value: function (e) {
  2588.                                 for (var a = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], t = {}, o = 0; o < e.length; o++) {
  2589.                                     var n = e[o].short_name,
  2590.                                         r = e[o].long_name;
  2591.                                     t[(0 === e[o].types.length && "" !== r ? "neighborhood" : e[o].types[0]).toLowerCase()] = { short_name: n, long_name: r };
  2592.                                 }
  2593.                                 return 1 == a && this.update_country(t.country.short_name), t;
  2594.                             },
  2595.                         },
  2596.                         {
  2597.                             key: "map_address_keys",
  2598.                             value: function (e) {
  2599.                                 var a = this.get_address_format();
  2600.                                 if ("object" != _typeof(a)) return {};
  2601.                                 var t = {};
  2602.                                 for (var o in a) {
  2603.                                     var n = a[o].keys,
  2604.                                         r = a[o].separator;
  2605.                                     if (0 !== Object.keys(n).length) {
  2606.                                         var i = [];
  2607.                                         for (var c in n) {
  2608.                                             var s = n[c];
  2609.                                             !1 !== e.hasOwnProperty(c) && i.push(e[c][s]);
  2610.                                         }
  2611.                                         i.length > 0 ? (t[o] = i.join(r)) : (t[o] = "");
  2612.                                     }
  2613.                                 }
  2614.                                 return wfacp_frontend.hooks.applyFilters("wfacp_google_map_address_data", t, this);
  2615.                             },
  2616.                         },
  2617.                         {
  2618.                             key: "generate_address_data",
  2619.                             value: function () {
  2620.                                 var e = this,
  2621.                                     a = this.address.getPlace();
  2622.                                 if (void 0 === a.address_components || 0 !== a.address_components.length) {
  2623.                                     console.log(a.address_components);
  2624.                                     var t = this.normalize_place_address_keys(a.address_components),
  2625.                                         o = this.map_address_keys(t);
  2626.                                     setTimeout(
  2627.                                         function (a) {
  2628.                                             e.fill_address(a);
  2629.                                         },
  2630.                                         600,
  2631.                                         o
  2632.                                     );
  2633.                                 }
  2634.                             },
  2635.                         },
  2636.                         {
  2637.                             key: "fill_address",
  2638.                             value: function (a) {
  2639.                                 var t = !1;
  2640.                                 for (var o in a) {
  2641.                                     this.type + "_state" === this.type + o && (t = !0);
  2642.                                     var n = e("#" + this.type + o);
  2643.                                     n.length > 0 && n.val(a[o]);
  2644.                                 }
  2645.                                 this.add_animation_css(),
  2646.                                     t &&
  2647.                                         e("#" + this.type + "_state")
  2648.                                             .trigger("liszt:updated")
  2649.                                             .trigger("chosen:updated")
  2650.                                             .trigger("change"),
  2651.                                     e(this.search_key).attr("placeholder", this.search_key_placeholder);
  2652.                             },
  2653.                         },
  2654.                         {
  2655.                             key: "add_animation_css",
  2656.                             value: function () {
  2657.                                 e(".wfacp-form-control").each(function () {
  2658.                                     "" !== e(this).val() && e(this).parents(".form-row").addClass("wfacp-anim-wrap");
  2659.                                 });
  2660.                             },
  2661.                         },
  2662.                         {
  2663.                             key: "enable_autocomplete",
  2664.                             value: function () {
  2665.                                 var a = this,
  2666.                                     t = e(this.search_key);
  2667.                                 if (0 !== t.length && void 0 !== (t = wfacp_frontend.hooks.applyFilters("wfacp_autocomplete_element", t, this)) && void 0 != t) {
  2668.                                     var o = this.excluded_countries(),
  2669.                                         n = this.get_country();
  2670.                                     if (!(o.indexOf(n) > -1))
  2671.                                         try {
  2672.                                             (this.address = new google.maps.places.Autocomplete(t[0], this.google_options())),
  2673.                                                 this.address.setFields(["address_component"]),
  2674.                                                 google.maps.event.addListener(this.address, "place_changed", function () {
  2675.                                                     a.generate_address_data();
  2676.                                                 });
  2677.                                         } catch (e) {}
  2678.                                 }
  2679.                             },
  2680.                         },
  2681.                         {
  2682.                             key: "geoCodeComponents",
  2683.                             value: function (e, a) {
  2684.                                 var t = this;
  2685.                                 return new Promise(function (o, n) {
  2686.                                     t.geocoder.geocode({ componentRestrictions: { country: e, postalCode: a } }, function (e, a) {
  2687.                                         if ("OK" == a) {
  2688.                                             var r = t.normalize_place_address_keys(e[0].address_components, !1),
  2689.                                                 i = t.map_address_keys(r);
  2690.                                             o(i);
  2691.                                         } else n(a);
  2692.                                     });
  2693.                                 });
  2694.                             },
  2695.                         },
  2696.                         {
  2697.                             key: "prepareGeocode",
  2698.                             value: function () {
  2699.                                 var a = e(this.state_key);
  2700.                                 if (0 != a.length) {
  2701.                                     var t = e(this.postcode_key),
  2702.                                         o = e(this.country_key);
  2703.                                     if (o.length > 0 && t.length > 0 && "" !== o.val() && "" !== t.val())
  2704.                                         this.geoCodeComponents(o.val(), t.val())
  2705.                                             .then(function (e) {
  2706.                                                 null !== e._state &&
  2707.                                                     "" !== e._state &&
  2708.                                                     void 0 !== e._state &&
  2709.                                                     ("select" === a[0].tagName || "SELECT" === a[0].tagName
  2710.                                                         ? a.children('option[value="' + e._state + '"]').length > 0 && (a.val(e._state), a.trigger("liszt:updated").trigger("chosen:updated").trigger("change"))
  2711.                                                         : (a.val(e._state), a.parents(".wfacp-form-control-wrapper").addClass("wfacp-anim-wrap")));
  2712.                                             })
  2713.                                             .catch(function (e) {});
  2714.                                 }
  2715.                             },
  2716.                         },
  2717.                         {
  2718.                             key: "geoCode",
  2719.                             value: function () {
  2720.                                 if (((this.geocode_interval = null), (this.geocoder = new google.maps.Geocoder()), null != this.geocoder)) {
  2721.                                     var a = this;
  2722.                                     e(this.postcode_key + "," + this.country_key).on("change", function () {
  2723.                                         clearTimeout(a.geocode_interval),
  2724.                                             (a.geocode_interval = setTimeout(function () {
  2725.                                                 a.prepareGeocode();
  2726.                                             }, 500));
  2727.                                     }),
  2728.                                         setTimeout(function () {
  2729.                                             a.prepareGeocode();
  2730.                                         }, 500);
  2731.                                 }
  2732.                             },
  2733.                         },
  2734.                         {
  2735.                             key: "jsp",
  2736.                             value: function (e) {
  2737.                                 if ("object" === _typeof(e)) {
  2738.                                     var a = JSON.stringify(e);
  2739.                                     return (a = JSON.parse(a));
  2740.                                 }
  2741.                                 return e;
  2742.                             },
  2743.                         },
  2744.                     ]),
  2745.                     a
  2746.                 );
  2747.             })();
  2748.         e(window).on("load", function () {
  2749.             "object" == ("undefined" == typeof google ? "undefined" : _typeof(google)) &&
  2750.                 ((wfacp_frontend.google_billing_address = new t()), (wfacp_frontend.google_shipping_address = new t("shipping")), (wfacp_frontend.google_compatibility = new a()));
  2751.         }),
  2752.             (window.gm_authFailure = function () {
  2753.                 void 0 != wfacp_frontend.google_billing_address && wfacp_frontend.google_billing_address.clearListener(), void 0 != wfacp_frontend.google_shipping_address && wfacp_frontend.google_shipping_address.clearListener();
  2754.             });
  2755.     })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement