function norm(e){return(null==e?"":String(e)).trim().toLowerCase()}async function sha256Hex(e){e=await crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e));return Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join("")}window.dataLayer=window.dataLayer||[];const HS_FORM_CONFIG={"9530ff76-4b0f-4f60-8769-4debaa27427d":{form_type:"New business",fields:{first:"0-1/firstname",last:"0-1/lastname",email:"0-1/email",help:"0-1/how_can_we_help_you_",hear:"0-1/how_did_you_hear_about_us_",budget:"0-1/estimated_budget___"}},"1d9bed60-efaf-41eb-8a69-e1f33d21f515":{form_type:"Media inquiry",fields:{first:"0-1/firstname",last:"0-1/lastname",email:"0-1/email",hear:"0-1/how_did_you_hear_about_us_"}}};function getVal(e,t){return t&&(e=e.querySelector(`[name="${CSS.escape(t)}"]`))?e.value:""}function readPayload(e,t){var a=t.fields;return{form_type:t.form_type||"",first_name:norm(getVal(e,a.first)),last_name:norm(getVal(e,a.last)),email:norm(getVal(e,a.email)),help:norm(getVal(e,a.help)),hear:norm(getVal(e,a.hear)),budget:norm(getVal(e,a.budget))}}function pushDataLayer(e){window.dataLayer.push({event:"hubspot_form_submission",form_type:e.form_type||"",first_name:e.first_name||"",last_name:e.last_name||"",email:e.email||"",email_hash:e.email_hash||"",help:e.help||"",hear:e.hear||"",budget:e.budget||"",page_url:window.location.href})}function bindHubSpotForms(){document.querySelectorAll(".hsfc-FormWrapper form.hsfc-Form").forEach(t=>{if(!t.__hsDlBound){t.__hsDlBound=!0;const a=t.closest(".hsfc-FormWrapper");if(a){a.__hsPending=null,a.__hsPushed=!1,t.addEventListener("submit",async function(){var e=t.getAttribute("data-form-id"),e=HS_FORM_CONFIG[e];e&&((e=readPayload(t,e)).email_hash=e.email?await sha256Hex(e.email):"",a.__hsPending=e)},!0);const n=new MutationObserver(function(){var e;a.__hsPushed||a.querySelector(".hsfc-PostSubmit")&&((e=a.__hsPending)&&(e.email||e.first_name||e.last_name)&&pushDataLayer(e),a.__hsPushed=!0,n.disconnect())});n.observe(a,{childList:!0,subtree:!0})}}})}function initHsDl(){bindHubSpotForms(),setTimeout(bindHubSpotForms,250),setTimeout(bindHubSpotForms,1e3),setTimeout(bindHubSpotForms,2500),setTimeout(bindHubSpotForms,5e3)}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",initHsDl):initHsDl();