(()=>{"use strict";var e={};function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 r="email",i="phone",l="name",o={[r]:["email","e-mail","mail","email address"],[i]:["phone","tel","mobile","cell","telephone","phone number"],[l]:["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 a(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function u(e){const t=a(e),n=t.lastIndexOf("@");if(-1===n)return t;const r=t.slice(n+1);if(["gmail.com","googlemail.com"].includes(r)){const e=t.slice(0,n).replace(/\./g,"");return"".concat(e,"@").concat(r)}return t}function c(e){const t=a(e),n=t.replace(/\D/g,"");return t.startsWith("+")?"+".concat(n):n}function s(e){const r=e.filter(e=>{let{type:t}=e;return t===l}).map(e=>{let{value:t}=e;return t});if(!r.length)return;const[i,...o]=1===r.length?r[0].split(" "):r;return function(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}({first_name:a(i)},(null==o?void 0:o.length)>0?{last_name:a(o.join(" "))}:{})}function f(e){var t;return null===(t=e.find(e=>{let{type:t}=e;return t===r}))||void 0===t?void 0:t.value}function m(e){var t;return null===(t=e.find(e=>{let{type:t}=e;return t===i}))||void 0===t?void 0:t.value}var v;(v=e.g.jQuery)&&v(e.g.document.body).on("wpformsAjaxSubmitSuccess",t=>{var n,v,d;const p=(null===(n=e.g._googlesitekit)||void 0===n?void 0:n.gtagUserData)?function(e){if(!(e&&e instanceof HTMLFormElement))return;const t=new FormData(e);return function(e){const t=[["address",s(e)],["email",f(e)],["phone_number",m(e)]].filter(e=>{let[,t]=e;return t});if(0!==t.length)return Object.fromEntries(t)}(Array.from(t.entries()).map(t=>{var n,s,f,m,v,d;let[p,y]=t,g=e.querySelector("[name='".concat(p,"']"));"hidden"===(null===(n=g)||void 0===n?void 0:n.type)&&"hidden"!==(null===(s=g)||void 0===s||null===(s=s.previousSibling)||void 0===s?void 0:s.type)&&(g=g.previousSibling);const b=null===(f=g)||void 0===f?void 0:f.type;return"hidden"===b||"submit"===b?null:function(e){let{type:t,name:n,value:s,label:f}=e||{};switch(t=a(t),n=a(n),s=a(s),f=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(f),t){case"email":return{type:r,value:u(s)};case"tel":return{type:i,value:c(s)}}return function(e){if(!e)return!1;const t=u(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(s)?{type:r,value:u(s)}: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=c(e);return/^\+?\d{7,}$/.test(t)}(s)?{type:i,value:c(s)}:o[r].includes(n)||o[r].includes(f)?{type:r,value:u(s)}:o[i].includes(n)||o[i].includes(f)?{type:i,value:c(s)}:o[l].includes(n)||o[l].includes(f)?{type:l,value:a(s)}:null}({type:b,label:null!==(m=g)&&void 0!==m&&m.id?null===(v=e.querySelector("label[for='".concat(null===(d=g)||void 0===d?void 0:d.id,"']")))||void 0===v?void 0:v.textContent:void 0,name:p,value:y})}).filter(Boolean))}(t.target):null;null===(v=e.g._googlesitekit)||void 0===v||null===(d=v.gtagEvent)||void 0===d||d.call(v,"submit_lead_form",p?{user_data:p}:void 0)})})();