!function(e){var t={};function r(p){if(t[p])return t[p].exports;var o=t[p]={i:p,l:!1,exports:{}};return e[p].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,p){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:p})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var p=Object.create(null);if(r.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(p,o,function(t){return e[t]}.bind(null,o));return p},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}({8:function(e,t,r){"use strict";r.r(t);r(9);!function(e){e(function(){e("#ppwp_protected_categories_selected").select2({width:"95%"}),e("#ppwp_is_protect_category").change(function(){e(this).prop("checked")?(e(".form__input-wrapper").show(),e("#ppwp_categories_password").trigger("change")):(e(".form__input-wrapper").hide(),e("#ppwp_error_categories_password").hide(),e("#ppwp_error_protected_categories_selected").hide())}),e("#ppwp_is_protect_category").trigger("change"),e("#ppwp_protect_category_form").submit(function(t){t.preventDefault();var r=e("#ppwp_categories_password").val(),p=e("#ppwp_protected_categories_selected").val(),o=e("#ppwp_is_protect_category").prop("checked");o&&""===r?e(this).find("#ppwp_error_categories_password").show():e(this).find("#ppwp_error_categories_password").hide(),o&&0===p.length?e(this).find("#ppwp_error_protected_categories_selected").show():e(this).find("#ppwp_error_protected_categories_selected").hide();var c={ppwp_is_protect_category:e("#ppwp_is_protect_category").prop("checked"),ppwp_categories_password:e("#ppwp_categories_password").val(),ppwp_protected_categories_selected:e("#ppwp_protected_categories_selected").val()};c.ppwp_categories_password=c.ppwp_categories_password.trim(),(!o||""!==r&&0!==p.length)&&(e("#ppwp-submit").prop("disabled",!0),function(t,r){!function(t,r){e.ajax({url:ppw_category_data.ajax_url,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}({action:"ppw_free_update_category_settings",settings:t,security_check:e("#ppw_category_form_nonce").val()},r)}(c,function(t,r){t&&(toastr.success("Great! Your settings have been updated successfully.","PPWP Lite"),setTimeout(function(){window.location.reload()},700)),r&&(400===r.status?toastr.error(r.responseJSON.message,"PPWP Lite"):toastr.error("Oops! Something went wrong. Please try again.","PPWP Lite")),e("#ppwp-submit").prop("disabled",!1)}))})})}(jQuery)},9:function(e,t,r){}});