(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n *",this.handleBoxItemClickEvent.bind(this)),this.mode="boxed")),this.selectDefaultQty()}},{key:"handleTdClickEvent",value:function(t){t.preventDefault();var e=jQuery(t.target);this.selectRightInfo(e)}},{key:"handleBoxItemClickEvent",value:function(t){t.preventDefault(),t.stopImmediatePropagation();var e=jQuery(t.target);e.hasClass("ywdpd-boxed-item")||(e=e.parents(".ywdpd-boxed-item")),this.selectRightInfo(e)}},{key:"selectDefaultQty",value:function(){"yes"===ywdpd_qty_args.is_default_qty_enabled&&("classic"===this.mode?("yes"===ywdpd_qty_args.show_minimum_price?this.table.find("td.qty-price-info").last():this.table.find("td.qty-price-info").first()).trigger("click"):("yes"===ywdpd_qty_args.show_minimum_price?this.table.find(".ywdpd-boxed-item").last():this.table.find(".ywdpd-boxed-item").first()).trigger("click"))}},{key:"selectRightInfo",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("classic"===this.mode)if(this.table.hasClass("vertical")){var i=t.parents("tr");this.toggleRow(i,e)}else{var n=t.index();this.toggleColumn(n,e)}else this.toggleItem(t,e)}},{key:"toggleRow",value:function(t,e){this.table.find("td").removeClass("ywdpd_active"),t.find("td").addClass("ywdpd_active");var i=t.find("td.qty-info");e&&this.updateQuantityField(i),this.updatePriceField(i)}},{key:"toggleItem",value:function(t,e){this.table.find(".ywdpd-boxed-item").removeClass("ywdpd_active"),t.addClass("ywdpd_active"),e&&this.updateQuantityField(t),this.updatePriceField(t)}},{key:"toggleColumn",value:function(t,e){this.table.find("td").removeClass("ywdpd_active"),this.table.find("tr td:nth-of-type("+t+")").addClass("ywdpd_active");var i=this.table.find("tr td.qty-info:nth-of-type("+t+")");e&&this.updateQuantityField(i),this.updatePriceField(i)}},{key:"handleChangeQuantity",value:function(t){t.stopImmediatePropagation();var e=parseInt(t.target.value);if("yes"===ywdpd_qty_args.is_change_qty_enabled&&e>0){var i="classic"===this.mode?"td.qty-info":".ywdpd-boxed-item",n=this.table.find(i).filter((function(){return"*"!==jQuery(this).data("qtymax")?jQuery(this).data("qtymin")<=e&&jQuery(this).data("qtymax")>=e:jQuery(this).data("qtymin")<=e}));n&&this.selectRightInfo(n,!1)}}},{key:"updateQuantityField",value:function(t){var e="*"===t.data("qtymax")||ywdpd_qty_args.select_minimum_quantity?t.data("qtymin"):t.data("qtymax");this.qtyDOM.val(e)}},{key:"updatePriceField",value:function(t){if("variable"!==this.table.data("product_type")){var e="";t.length?e=t.data("formatted_price"):(jQuery(document).trigger("ywdpd_pre_update_price_html",[this.table,this.mode,t]),e=this.table.data("price_html"));var i=t.data("unformatted_price");this.updatePriceHtml(e,i,t)}}},{key:"updatePriceHtml",value:function(t,e,i){var n="";if(""!==t){this.productDOM.parents(".yith-quick-view-content").length&&(n=".yith-quick-view-content ");var a=jQuery(n+ywdpd_qty_args.column_product_info_class);a.find(".woocommerce-variation-price").length?a.find(".woocommerce-variation-price .price").html(t):a.find(ywdpd_qty_args.product_price_classes).html(t),jQuery(document).trigger("ywdpd_price_html_updated",[t,e,i])}}},{key:"showVariationTable",value:function(t,e){if(e.table_price){var i=jQuery(e.table_price),n="classic"===this.mode?"#ywdpd-quantity-table":"#ywdpd-quantity-boxed";i.find(n).length?(this.elementDOM.html(i.html()),this.elementDOM.show(),"yes"!==ywdpd_qty_args.is_default_qty_enabled&&this.updatePriceHtml(e.price_html,"")):(this.elementDOM.html("").hide(),this.updatePriceHtml(e.price_html,"")),this.initTable()}}},{key:"resetVariationTable",value:function(){"yes"===ywdpd_qty_args.show_variable_table?(this.elementDOM.html(this.defaultTable),this.initTable()):this.elementDOM.hide()}}],i&&e(t.prototype,i),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,i,n}();function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function r(t,e){for(var i=0;i0){var a=n.parents("table").data("product_type"),r="";if((r="variation"===a?jQuery(document).find(ywdpd_qty_args.column_product_info_class).find(".yith-par-message-variation"):this.pointMessageDiv).length)if(void 0===i)r.html(this.defaultMessage);else{var o={action:ywdpd_qty_args.integrations.actions.update_product_points_message,security:ywdpd_qty_args.integrations.nonces.update_product_points_message,product_id:n.parents("table").data("product_id"),dynamic_price:i,qty:jQuery("form.cart .qty").val()};jQuery.ajax({type:"POST",url:ywdpd_qty_args.ajax_url,data:o,dataType:"json",beforeSend:function(){},success:function(t){null!=t&&t.data&&(t.data.show?r.show():r.hide(),r.html(t.data.message))},complete:function(){}})}}}}])&&l(t.prototype,e),i&&l(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}();function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function p(t,e){for(var i=0;i