!function(i){const e=i("#woocommerce-product-data");e.length&&e.find(".pricing").addClass("show_if_product_pack").end().find(".inventory_tab").addClass("hide_if_product_pack").end().find(".shipping_tab").addClass("hide_if_product_pack").end().find(".linked_product_tab").addClass("hide_if_product_pack").end().find(".attributes_tab").addClass("hide_if_product_pack").end().find("._no_of_product_field").hide().end().find("._pack_validity_field").hide().end().find("#_tax_status").parent().parent().addClass("show_if_product_pack").end(),"product_pack"===i("#product-type").val()&&setTimeout(function(){i(".inventory_tab").hide()},500),i("body").on("woocommerce-product-type-change",function(e,n){i("._no_of_product_field").hide(),i("._pack_validity_field").hide(),i("._enable_recurring_payment_field").hide(),i(".dokan_subscription_pricing").hide(),i("._sale_price_field").show(),i(".dokan_subscription_trial_period").hide(),"product_pack"==n&&(i("._no_of_product_field").show(),i("._pack_validity_field").show(),i("._enable_recurring_payment_field").show(),i("._sale_price_field").hide(),i("#dokan_subscription_enable_trial").is(":checked")&&i(".dokan_subscription_trial_period").show(),i("#_enable_recurring_payment").is(":checked")&&(i(".dokan_subscription_pricing").show(),i("._pack_validity_field").hide(),i("._exclusive_for_admin_only_field").prop("checked",!1)))}),i(".woocommerce_options_panel").on("change","#dokan_subscription_enable_trial",function(){i(".dokan_subscription_trial_period").hide(),i(this).is(":checked")&&i(".dokan_subscription_trial_period").fadeIn()}),i(".woocommerce_options_panel").on("change","#_enable_recurring_payment",function(){i(".dokan_subscription_pricing").hide(),i("._pack_validity_field").show(),i(this).is(":checked")&&(i(".dokan_subscription_pricing").fadeIn(),i("._pack_validity_field").hide(),i("#_exclusive_for_admin_only").prop("checked",!1))}),i(".woocommerce_options_panel").on("change","#_exclusive_for_admin_only",function(){const e=i("#_enable_recurring_payment");i(this).is(":checked")&&e.is(":checked")&&(i(this).prop("checked",!1),alert(dokanSubscription.exclusiveForAdminOnly))}),i("#woocommerce-product-data").on("change",'[name^="_dokan_subscription_period"], [name^="_dokan_subscription_period_interval"]',function(){i('[name^="_dokan_subscription_length"]').each(function(){let e,n=i(this),_=n.val(),o=!1;e="#_dokan_subscription_period",billingInterval=parseInt(i("#_dokan_subscription_period_interval").val()),n.empty(),i.each(dokanSubscription.subscriptionLengths[i("#_dokan_subscription_period").val()],function(e,_){0!=parseInt(e)&&0!=parseInt(e)%billingInterval||n.append(i("<option></option>").attr("value",e).text(_))}),n.children("option").each(function(){if(this.value==_)return o=!0,!1}),o?n.val(_):n.val(0)})})}(jQuery);