!function(){"use strict";var e=window.ctFrontend;(0,e.registerDynamicChunk)("blocksy_ext_newsletter_subscribe",{mount:function(e,s){var r=s.event.target;"mailchimp"===r.dataset.provider&&function(e){if(e.querySelector('[type="email"]').value.trim()){if(document.getElementById("js-validate-robot")&&""!==document.getElementById("js-validate-robot").value)return!1;for(var s=e.action.replace("subscribe","subscribe/post-json"),r="",t="mailchimpCallback",c=e.querySelectorAll("input"),i=0;i<c.length;i++)r+="&"+c[i].name+"="+encodeURIComponent(c[i].value);r+="&c=".concat(t);var a=document.createElement("script");a.src=s+r,document.body.appendChild(a),e.classList.remove("subscribe-error","subscribe-success"),e.classList.add("subscribe-loading"),window[t]=function(s){delete window[t],document.body.removeChild(a),e.classList.remove("subscribe-loading"),s&&(e.classList.add("error"===s.result?"subscribe-error":"subscribe-success"),e.querySelector(".ct-newsletter-subscribe-message").innerHTML=s.msg.replace("0 - ",""))}}}(r),-1===r.dataset.provider.indexOf("mailchimp")&&function(e){var s=new FormData(e);s.append("action","blc_newsletter_subscribe_process_ajax_subscribe"),s.append("GROUP",e.dataset.provider.split(":")[1]),e.classList.remove("subscribe-error","subscribe-success"),e.classList.add("subscribe-loading"),fetch(ct_localizations.ajax_url,{method:"POST",body:s}).then((function(e){return e.json()})).then((function(s){s.success;var r=s.data;e.classList.remove("subscribe-loading"),e.classList.add("no"===r.result?"subscribe-error":"subscribe-success"),e.querySelector(".ct-newsletter-subscribe-message").innerHTML=r.message}))}(r)}})}();