1!function(e){"use strict";let t="subscribe";const a=`.${t}-cs`,o=document.querySelectorAll(`${a} form`);Array.from(o).forEach((o=>{o.addEventListener("submit",(async r=>{if(r.preventDefault(),r.stopPropagation(),o.checkValidity()){let s=new URL(o.getAttribute("action")),n=new FormData(o),c=await fetch(s,{body:n,method:"post"}),i=e.Html.createRandomIdWithPrefix(t),l=e.Modal.getOrCreate(i);let d,u=r.target.closest(a);l.setPlacementBottomToElement(u);try{d=(await c.json()).message}catch(e){}if(200!==c.status)l.setHeader("Error"),void 0===d&&(d="Sorry. The server seems to be down.");else{let e=o.getAttribute("data-success-header");null===e&&(e="Hurray!"),l.setHeader(e),d=o.getAttribute("data-success-content"),null===d&&(d="A validation email has been send. <br>Check your mailbox and click on the validation link.<br>If you don't find our email, check your spambox.")}l.addBody(d).show()}}),!1)}))}(combo);
2