!function(n){"use strict";const s={data:{deactivationUrl:null,$feedback:null},fn:{show:a=>{s.globals=vision_feedback_globals,s.data.deactivationUrl=a,s.data.$feedback=n("#vision-feedback"),s.data.$feedback.addClass("vision-active").css("display",""),s.data.$feedback.find(".vision-fields").off().on("click","input[type=radio]",s.fn.select),s.data.$feedback.find(".vision-close").off().on("click",s.fn.close),s.data.$feedback.find(".vision-btn.vision-submit").off().on("click",s.fn.submit),s.data.$feedback.find(".vision-btn.vision-skip").off().on("click",s.fn.skip)},select:a=>{const e=n(a.target);s.data.$feedback.find(".vision-fields input[type=text]").removeClass("vision-active"),e.closest(".vision-field").find("input[type=text]").addClass("vision-active")},close:()=>{s.data.$feedback.removeClass("vision-active")},deactivate:()=>{s.fn.close(),window.location.href=s.data.deactivationUrl,n(document).off("click","tr[data-slug='vision']")},skip:()=>{s.fn.deactivate()},submit:()=>{const a=s.data.$feedback.find(".vision-fields input[type=radio]:checked");if(a.length){const t=a.closest(".vision-field").find("input[type=text]");var e=t.length?t.val():"",i=a.val(),e=JSON.stringify({token:s.globals.token,reason:i,description:e});n.ajax({url:s.globals.ajax.url,type:"POST",dataType:"json",contentType:"application/json",data:e}).always(()=>{s.fn.deactivate()})}else s.fn.deactivate()}}};n(document).on("click","tr[data-slug='vision']",a=>{n(a.target).parent().hasClass("deactivate")&&(a.preventDefault(),s.fn.show(a.target.href))})}(jQuery);