!function(e){"use strict";let n=()=>{e(".select-multiple").each(function(){e(this).hasClass(".select2-hidden-accessible")||e(this).selectWoo()})};e(document).ready(function(){let t=document.querySelector("#printus-refresh-printers");null!=t&&t.addEventListener("click",e=>{e.preventDefault(),wp.ajax.post("printus_refresh_printers").done(function(e){e?location.reload():console.log(e)}).fail(function(e){console.error(e.responseJSON.data),alert(e.responseJSON.data),console.log(e)})});let o=document.querySelector("#printus-clear-fonts-cache");null!=o&&o.addEventListener("click",e=>{e.preventDefault(),wp.ajax.post("printus_clear_fonts_cache",{_wpnonce:document.querySelector("#printus-clear-fonts-cache-nonce")?.value}).done(function(e){e?location.reload():console.log(e)}).fail(function(e){console.error(e.responseJSON.data),alert(e.responseJSON.data),console.log(e)})}),n();let r=document.querySelector("#printus-print-order-admin-btn");null!=r&&r.addEventListener("click",e=>{e.preventDefault();let n={postID:document.querySelector("#post_ID").value,nonce:document.querySelector("#print_order_admin_nonce").value,template:document.querySelector("#printus-template").value,paperSize:document.querySelector("#printus-paper-size").value,printerID:document.querySelector("#printus-printer").value};wp.ajax.post("printus_print_order_from_admin",{details:n}).done(function(e){e?location.reload():console.log(e)}).fail(function(e){console.log(e),console.error(e?.responseJSON?.data),alert(e?.responseJSON?.data)})}),e(document).on("wpsfGroupRowAdded",function(){n()})})}(jQuery);