(()=>{"use strict";var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();const t="email",n="phone",r="name",l={[t]:["email","e-mail","mail","email address"],[n]:["phone","tel","mobile","cell","telephone","phone number"],[r]:["name","full-name","full name","full_name","fullname","first-name","first name","first_name","firstname","last-name","last name","last_name","lastname","given-name","given name","given_name","givenname","family-name","family name","family_name","familyname","fname","lname","first","last","your-name","your name"]};function i(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function a(e){const t=i(e),n=t.lastIndexOf("@");if(-1===n)return t;const r=t.slice(n+1);return["gmail.com","googlemail.com"].includes(r)?`${t.slice(0,n).replace(/\./g,"")}@${r}`:t}function u(e){const t=i(e),n=t.replace(/\D/g,"");return t.startsWith("+")?`+${n}`:n}function s(e){const t=e.filter(e=>{let{type:t}=e;return t===r}).map(e=>{let{value:t}=e;return i(t)}).filter(Boolean);if(!t.length)return;const[n,...l]=1===t.length?t[0].split(" "):t;return{first_name:n,...l?.length>0?{last_name:l.join(" ")}:{}}}function o(e){return e.find(e=>{let{type:n}=e;return n===t})?.value}function m(e){return e.find(e=>{let{type:t}=e;return t===n})?.value}var c;(c=e.g.mc4wp)&&c.forms.on("subscribed",(c,f)=>{const g=e.g._googlesitekit?.gtagUserData,p=g?function(e,c){if(!(e&&e instanceof HTMLFormElement))return;return function(e){const t=[["address",s(e)],["email",o(e)],["phone_number",m(e)]].filter(e=>{let[,t]=e;return t});if(0!==t.length)return Object.fromEntries(t)}(Object.entries(c).map(s=>{let[o,m]=s;if("NAME"===o&&("FNAME"in c||"LNAME"in c))return null;const f=e.querySelector(`[name='${o}']`),g=f?.type;return function(e){let{type:s,name:o,value:m,label:c}=e||{};switch(s=i(s),o=i(o),m=i(m),c=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(c),s){case"email":return{type:t,value:a(m)};case"tel":return{type:n,value:u(m)}}return function(e){if(!e)return!1;const t=a(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(m)||l[t].includes(o)||l[t].includes(c)?{type:t,value:a(m)}:l[n].includes(o)||l[n].includes(c)?{type:n,value:u(m)}:l[r].includes(o)||l[r].includes(c)?{type:r,value:i(m)}:function(e){if(!e)return!1;if(!function(e){const t=e.replace(/\D/g,"");return!(t.length<7||t.length<e.length/2)&&/^[\s\-()+.\d]*$/.test(e)}(e))return!1;const t=u(e);if(!/^\+?\d{7,}$/.test(t))return!1;const n=/[\s\-()+.]/.test(e),r=e.trim().startsWith("+");return!(!n&&!r)}(m)?{type:n,value:u(m)}:null}({type:g,label:f?.id?e.querySelector(`label[for='${f?.id}']`)?.textContent:void 0,name:o,value:m})}).filter(Boolean))}(c.element,f):null;e.g._googlesitekit?.gtagEvent?.("submit_lead_form",{event_category:"mailchimp",...p?{user_data:p}:{}})})})();