(()=>{const t={l10n:window.tribe_tickets_tpp_admin_strings||!1};!function(t,e){"use strict";e.checkmarkValidationMap=function(){return{email:t=>/^(([^<>()[\]\\.,;:\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(t),radio:t=>["yes","1",1,!0,"true","on","complete","completed"].includes(t.toLowerCase())}},e.castStatusToBool=function(t){return(0,e.checkmarkValidationMap().radio)(t)},e.castBoolToStatus=function(t){return!0===t?"complete":"incomplete"},e.updatePayPalIpnStatus=function(){const a=t("#paypal-ipn-config-status"),i=t(".ipn-required");if(!i)return;const n=_.reduce(i,(function(e,a){return e&&!t(a).hasClass("no-checkmark")}),!0),c=e.castBoolToStatus(n);a.text(e.l10n[c]).attr("data-status",c)},e.isOkInput=function(a){const i=t(a).closest(".checkmark");if(!i)return;let n=!1;const c=e.checkmarkValidationMap();if(i.hasClass("tribe-field-email"))n=c.email(a.value);else if(i.hasClass("tribe-field-radio")){const e=t(a).closest(".tribe-field-wrap").find("input:checked").val();n=c.radio(e)}else n=!0;return n},e.toggleCheckmark=function(){const a=e.isOkInput(this),i=t(this).closest(".checkmark");a?i.removeClass("no-checkmark"):i.addClass("no-checkmark"),e.updatePayPalIpnStatus()},e.setupValidationOnPanel=function(e,a){if(!(a.panel&&a.panel instanceof jQuery))return;const i=a.panel,n="Tribe__Tickets__Commerce__PayPal__Main"===i.data("default-provider"),c=!t("#ticket_id").val();n&&c&&t("#ticket_price, #ticket_sale_price").prop("data-required",!0).attr("data-validation-is-greater-than","0"),i.find(".tribe-validation").validation()},e.init=function(){t(".checkmark input").each((function(){t(this).on("change",e.toggleCheckmark).each(e.toggleCheckmark)})),t("#event_tickets").on("after_panel_swap.tickets",e.setupValidationOnPanel)},t((function(){e.l10n&&e.init()}))}(jQuery,t,tribe_tickets_tpp_admin_strings),window.tec=window.tec||{},window.tec.tickets=window.tec.tickets||{},window.tec.tickets.tppAdmin={}})();