!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e,a,n){return(a=function(e){var a=function(e){if("object"!=t(e)||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var n=a.call(e,"string");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(a)?a:a+""}(a))in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}$(function(){var t=$("#status-menu-btn"),a=t.data("menubtn");a&&a.setSettings({onOptionSelect:function(e){var a=$(e).data("id"),n=$(e).data("name"),o=$(e).data("color"),r=$("#status-menu-select");$("#statusId").val(a);var s="<span class='status "+o+"'></span>"+Craft.uppercaseFirst(n);t.html(s),r.find("li a.sel").removeClass("sel"),r.find("li a[data-id="+a+"]").addClass("sel")}});var n=$("form#asset_download");$("#content").on({click:function(){var t=$(this).data().assetId;$("input[name=assetId]",n).val(t),n.submit()}},"a[data-asset-id]"),$("canvas[data-image]").each(function(){var t=$(this)[0],e=new window.Image;e.addEventListener("load",function(){t.getContext("2d").drawImage(e,0,0)}),e.setAttribute("src",$(this).data("image"))});var o=$(".download-signature-links");$("a[data-type]",o).on("click",function(){var t=$(this).parents(".signature-wrapper").find("canvas:first")[0],e=$(this).data("type"),a=document.createElement("a");return a.download="signature.".concat(e),a.href=t.toDataURL("image/".concat(e)).replace("image/".concat(e),"image/octet-stream"),a.click(),!1}),$("#export-btn").remove(),$("#delete-button").on("click",function(){if(confirm(Craft.t("freeform","Are you sure you want to delete this?"))){$(this).attr("disabled",!0).addClass("disabled").text("Deleting...");var t=$(this).data("id");$.ajax({type:"post",url:Craft.getCpUrl("freeform/spam/delete"),dataType:"json",data:e({id:t},Craft.csrfTokenName,Craft.csrfTokenValue),success:function(t){t.success?window.location.href=Craft.getCpUrl("freeform/spam"):console.error("Could not delete spam submission")}})}}),window.isCraft5&&function(){var t=$("#action-buttons");if(t.length){var a="actions-menu-"+Craft.randomString(10),n=$("<button/>",{role:"button",type:"button",class:"btn menubtn action-btn hairline-dark btngroup-btn-last m",title:Craft.t("app","Actions"),"aria-label":Craft.t("app","Actions"),"data-disclosure-trigger":!0,"aria-controls":a}).appendTo(t),o=$("<div/>",{id:a,class:"menu menu--disclosure"}).appendTo(t),r=$("<ul/>").appendTo(o),s=$("<li/>").appendTo(r);$("<button/>",{tabIndex:0,role:"button",type:"button",class:"menu-item error",title:Craft.t("app","Delete"),"aria-label":Craft.t("app","Delete"),html:'<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" focusable="false" aria-hidden="true">\x3c!--! Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc. --\x3e<path d="M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"></path></svg></span><span class="menu-item-label inline-flex flex-col items-start gap-2xs">Delete</span>'}).appendTo(s).on("click",function(t){if(t.preventDefault(),t.stopPropagation(),!confirm(Craft.t("freeform","Are you sure you want to delete the submission?")))return n.data("trigger").hide(),!1;Craft.sendActionRequest("POST","freeform/submissions/delete",{data:e(e({},Craft.csrfTokenName,Craft.csrfTokenValue),"id",$('[data-freeform] input[name="submissionId"]').val())}).then(function(t){t.data.success?window.location.href=Craft.getCpUrl("freeform/submissions"):(Craft.cp.displayError(t.data.message),n.data("trigger").hide())})}),n.disclosureMenu()}}()})}();