jQuery(window).on("elementor/frontend/init",(()=>{elementorFrontend.hooks.addAction("frontend/element_ready/form.default",(function(e,t){!function(t){let a=[];document.querySelectorAll(".signature-pad").forEach(((e,n)=>{let r=t(e).parent(".elementskit-canvas-wrapper").width();t(e).attr("width",r);let o=t(e).attr("data-background-color"),i=t(e).attr("data-pen-color");a.push({canvasArea:e,signaturePad:new SignaturePad(e,{minWidth:2,maxWidth:2,penColor:i,backgroundColor:o})})})),a.forEach(((e,a)=>{t(e.canvasArea).closest(".elementskit-canvas-wrapper").find("button.clear").click((function(t){t.preventDefault(),e.signaturePad.clear()}));let n=t(e.canvasArea).attr("data-format");e.signaturePad.addEventListener("endStroke",(()=>{var a=e.signaturePad.toDataURL(n);t(e.canvasArea).siblings(".elementskit-signature-input-field").val(a)}))})),t(document).on("submit_success",(function(){a.forEach(((e,t)=>{e.signaturePad.clear()}))})),e.find(".elementskit-reset-button.elementor-button").on("click",(function(e){setTimeout((()=>{a.forEach(((e,t)=>{e.signaturePad.clear()}))}),0)}))}(jQuery)}))}));