PageSourceSearch

https://agencytitan.com/_astro/index.astro_astro_type_script_index_0_lang.DTe6QVFU.js

js agencytitan.com collected 2026-10-02 01:21:55 UTC 3,113 bytes, 1 lines download raw bytes

1import{g as x}from"./publicApiBase.D-5c1syQ.js";import{b as M}from"./phoneFormat.DpJdaBui.js";const v=document.getElementById("contact-form"),E=document.getElementById("contact-success"),b=document.getElementById("contact-success-message"),a=document.getElementById("contact-form-error"),o=document.getElementById("contact-submit");M(document.getElementById("contact-phone"));const q=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,R=10,f="Something went wrong. Please try again.";function t(e,l){const s=document.querySelector(`[data-error-for="${e}"]`),r=document.getElementById(e);s instanceof HTMLElement&&(l?(s.textContent=l,s.classList.remove("hidden"),r?.classList.add("border-red-400/70")):(s.textContent="",s.classList.add("hidden"),r?.classList.remove("border-red-400/70")))}function c(e){a&&(e?(a.textContent=e,a.classList.remove("hidden")):(a.textContent="",a.classList.add("hidden")))}function B(e){o&&(o.disabled=e,o.classList.toggle("opacity-70",e),o.querySelector("[data-label]").textContent=e?"Sending…":"Send Message",o.querySelector("[data-arrow]")?.classList.toggle("hidden",e),o.querySelector("[data-spinner]")?.classList.toggle("hidden",!e))}function A(e){e&&b&&(b.textContent=e),v?.classList.add("hidden"),E?.classList.remove("hidden"),E?.scrollIntoView({behavior:"smooth",block:"center"})}function D(e){return e.replace(/\D/g,"").length}v?.addEventListener("submit",async e=>{e.preventDefault(),c(null);const l=document.getElementById("contact-first-name"),s=document.getElementById("contact-last-name"),r=document.getElementById("contact-email"),L=document.getElementById("contact-phone"),P=document.getElementById("contact-company"),C=document.getElementById("contact-message"),S=document.getElementById("contact-sms-informational"),N=document.getElementById("contact-sms-marketing"),g=l?.value.trim()??"",y=s?.value.trim()??"",T=[g,y].filter(Boolean).join(" "),u=r?.value.trim()??"",d=L?.value.trim()??"",k=P?.value.trim()??"",p=C?.value.trim()??"",h=S?.checked===!0,I=N?.checked===!0,w=h||I;let n=!0;if(g?t("contact-first-name",null):(t("contact-first-name","Please enter your first name."),n=!1),y?t("contact-last-name",null):(t("contact-last-name","Please enter your last name."),n=!1),u?q.test(u)?t("contact-email",null):(t("contact-email","Please enter a valid email address."),n=!1):(t("contact-email","Please enter your email address."),n=!1),d?D(d)<R?(t("contact-phone","Please enter a valid U.S. mobile phone number."),n=!1):t("contact-phone",null):(t("contact-phone","Please enter your mobile phone number."),n=!1),p?t("contact-message",null):(t("contact-message","Please enter a message."),n=!1),!!n){B(!0);try{const i=await fetch(`${x()}/api/public/contact`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:T,email:u,phone:d,company:k||null,message:p,smsConsent:w,smsInformationalConsent:h,smsMarketingConsent:I})});if(i.status===429){c("Too many requests, please try again in a minute.");return}let m={};try{m=await i.json()}catch{}if(i.ok&&m.success===!0){A(m.message);return}if(i.status===400){c(m.message||f);return}c(f)}catch{c(f)}finally{B(!1)}}});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.