PageSourceSearch

https://rubenlozano.me/assets/Contact-BoLmP_Ci.js

js rubenlozano.me collected 2026-10-04 20:46:51 UTC 13,939 bytes, 1 lines download raw bytes

1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{o as r}from"./router-compat-JKn2DVtK.js";import{t as i}from"./client-CfaTC9MX.js";import{t as a}from"./proxy-CoW8_bvx.js";import{o,t as s}from"./Footer-BSgwkgOY.js";import{t as c}from"./briefcase-BWseZYPx.js";import{t as l}from"./globe-CHf-DjlM.js";import{t as u}from"./mail-Bz7El1Ux.js";import{t as d}from"./message-circle-LtLFS4V0.js";import{t as f}from"./message-square-CEEHIHO3.js";import{t as p}from"./user-Chswbh4l.js";import{r as m}from"./I18nContext-CJ2mEzU6.js";import{C as h,E as g,Hn as _,Ht as v,O as y,Qn as b,Qt as x,Un as S,Vt as C,Wt as ee,_n as w,h as T,j as E,k as D,wn as O,y as k,zt as A}from"./index-D2smvkUg.js";import{t as te}from"./PageHero-CvS33VNh.js";import{n as ne,t as re}from"./zod-KclDw5qs.js";import{t as j}from"./label-CuNQHg9_.js";import{t as M}from"./checkbox-DNnzsyd6.js";import{t as N}from"./TrustedLogos-AOF3DI7t.js";var P=e(t(),1),F=n(),I=({icon:e,error:t,children:n})=>(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`input-focus-ring relative flex items-center rounded-md border bg-background ${t?`border-destructive ring-1 ring-destructive/30`:``}`,children:[(0,F.jsx)(e,{size:16,className:`absolute left-3 text-muted-foreground pointer-events-none`,"aria-hidden":`true`}),n]}),t&&(0,F.jsxs)(`p`,{className:`text-xs text-destructive mt-1 flex items-center gap-1`,role:`alert`,children:[(0,F.jsx)(S,{size:12,"aria-hidden":`true`}),` `,t]})]}),L=()=>{let{t:e,locale:t,localePath:n,altLocalePath:S}=m(),L=r(),R=e.contactPage,z=e.home,B=[{value:`6+`,label:z.statsYears},{value:`10+`,label:z.statsStartups},{value:`3`,label:z.statsCountries},{value:`6`,label:z.statsChannels}],V=e=>e.split(` `).map(e=>e[0]).slice(0,2).join(``).toUpperCase(),H=D({fullName:E().trim().min(1,`${R.fullName} ${R.required}`).max(100),email:E().trim().email(R.invalidEmail).max(255),jobTitle:E().trim().min(1,`${R.jobTitle} ${R.required}`).max(100),website:E().trim().max(255).or(y(``)).refine(e=>{if(!e)return!0;let t=/^https?:\/\//i.test(e)?e:`https://${e}`;try{let e=new URL(t);return!!e.hostname&&e.hostname.includes(`.`)}catch{return!1}},{message:R.invalidUrl}),message:E().trim().min(1,`${R.message} ${R.required}`).max(2e3),hearAbout:E().trim().min(1,`${R.hearAbout} ${R.required}`).max(500),services:g(E()).min(1,R.servicesRequired),terms:y(!0,{errorMap:()=>({message:R.acceptTerms})})}),{register:U,handleSubmit:W,setValue:G,watch:K,reset:q,formState:{errors:J,isSubmitting:Y}}=ne({resolver:re(H),mode:`onBlur`,reValidateMode:`onChange`,defaultValues:{terms:void 0,website:``,services:[]}}),[X,ie]=(0,P.useState)(!1),ae=K(`terms`),Z=K(`services`)??[],Q=(0,P.useRef)(null),$=(0,P.useRef)(Date.now());(0,P.useEffect)(()=>{$.current=Date.now()},[]);let oe=e=>{let t=Z.includes(e)?Z.filter(t=>t!==e):[...Z,e];G(`services`,t,{shouldValidate:!0})};return(0,F.jsxs)(`div`,{className:`min-h-screen bg-background`,children:[(0,F.jsx)(A,{title:R.seoTitle,description:R.seoDesc,canonical:n(`/${e.routes.contact}`),locale:t,altLocaleCanonical:S(`/${e.routes.contact}`),jsonLd:[C([{name:e.nav.home,url:n(``)},{name:e.nav.contact,url:n(`/${e.routes.contact}`)}]),v(t,n(`/${e.routes.contact}`),R.seoTitle,R.seoDesc),ee]}),(0,F.jsx)(o,{}),(0,F.jsxs)(`main`,{children:[(0,F.jsx)(te,{variant:`glossary`,label:e.nav.contact,icon:d,title:R.title,subtitle:R.subtitle,breadcrumbs:[{label:e.nav.home,to:n(``)},{label:e.nav.contact}]}),(0,F.jsx)(`section`,{className:`container mx-auto px-4 md:px-8 py-16 md:py-24`,children:(0,F.jsxs)(`div`,{className:`grid md:grid-cols-5 gap-12 items-start`,children:[(0,F.jsxs)(T,{className:`md:col-span-2 space-y-4`,variant:`slideRight`,children:[(0,F.jsx)(`p`,{className:`section-label`,children:R.meetLabel}),(0,F.jsx)(`h2`,{className:`section-title`,children:R.meetTitle}),(0,F.jsx)(`span`,{className:`section-title-accent`}),(0,F.jsx)(`p`,{className:`text-muted-foreground leading-relaxed pt-2`,children:R.meetDesc}),(0,F.jsx)(`address`,{className:`text-sm text-muted-foreground not-italic`,children:R.location})]}),(0,F.jsx)(T,{className:`md:col-span-3`,variant:`slideLeft`,delay:.1,children:(0,F.jsxs)(`div`,{className:`bg-card border border-border rounded-2xl p-8 shadow-xs`,children:[(0,F.jsx)(`h3`,{className:`text-2xl font-bold text-foreground mb-6`,children:R.formTitle}),(0,F.jsxs)(a.form,{onSubmit:W(async r=>{if(Q.current?.value){q(),L(n(`/${e.routes.contactThankYou}`));return}if(Date.now()-$.current<2500){b.error(`Please take a moment to review your details before submitting.`);return}let a=`${r.fullName} ${r.message} ${r.jobTitle} ${r.hearAbout}`,o=a.match(/https?:\/\/|www\.|\.[a-z]{2,}\//gi)??[],s=/[\u0400-\u04FF\u4E00-\u9FFF]/.test(a),c=/(.)\1{15,}/.test(a),l=r.message.length>40&&r.message===r.message.toUpperCase();if(o.length>=3||s||c||l){q(),L(n(`/${e.routes.contactThankYou}`));return}
1try{let e=`contact_form_rl_v1`,t=Date.now(),n=6e4,r=localStorage.getItem(e),i=r?JSON.parse(r).filter(e=>t-e<36e5):[],a=i[i.length-1];if(a&&t-a<n){let e=Math.ceil((n-(t-a))/1e3);b.error(`Please wait ${e}s before sending another message.`);return}if(i.length>=5){b.error(`You've sent several messages recently. Please try again later.`);return}i.push(t),localStorage.setItem(e,JSON.stringify(i))}catch{}try{let a=crypto.randomUUID(),o=r.website?/^https?:\/\//i.test(r.website)?r.website:`https://${r.website}`:null,{error:s}=await i.from(`contact_submissions`).insert({id:a,full_name:r.fullName,email:r.email,job_title:r.jobTitle,website:o,message:r.message,success_definition:null,hear_about:[r.hearAbout,r.services?.length?`Services: ${r.services.join(`, `)}`:null].filter(Boolean).join(` | `)||null});if(s)throw s;i.functions.invoke(`send-transactional-email`,{body:{templateName:`contact-confirmation`,recipientEmail:r.email,idempotencyKey:`contact-confirm-${a}`,templateData:{name:r.fullName,message:r.message}}}).catch(e=>console.error(`Confirmation email failed`,e)),i.functions.invoke(`send-transactional-email`,{body:{templateName:`contact-submission-owner`,idempotencyKey:`contact-owner-${a}`,templateData:{name:r.fullName,email:r.email,jobTitle:r.jobTitle,website:o??void 0,message:r.message,hearAbout:r.hearAbout,services:r.services?.join(`, `),locale:t}}}).catch(e=>console.error(`Owner notification email failed`,e)),b.success(R.successToast),ie(!0),setTimeout(()=>{q(),L(n(`/${e.routes.contactThankYou}`))},900)}catch(e){console.error(`Contact submission failed`,e),b.error(`Something went wrong. Please try again.`)}},e=>{let t=Object.keys(e).length;t>0&&b.error(t===1?`Please fix the highlighted field.`:`Please fix the ${t} highlighted fields.`)}),className:`space-y-5`,initial:{opacity:1},noValidate:!0,"aria-busy":Y,children:[(0,F.jsxs)(`div`,{"aria-hidden":`true`,className:`absolute left-[-10000px] top-auto h-px w-px overflow-hidden`,style:{position:`absolute`},children:[(0,F.jsx)(`label`,{htmlFor:`company_website`,children:`Company website`}),(0,F.jsx)(`input`,{ref:Q,id:`company_website`,name:`company_website`,type:`text`,tabIndex:-1,autoComplete:`off`,defaultValue:``})]}),(0,F.jsxs)(`div`,{className:`grid sm:grid-cols-2 gap-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(j,{htmlFor:`fullName`,children:[R.fullName,` `,(0,F.jsx)(`span`,{className:`text-destructive`,"aria-hidden":`true`,children:`*`})]}),(0,F.jsx)(I,{icon:p,error:J.fullName?.message,children:(0,F.jsx)(k,{id:`fullName`,...U(`fullName`),className:`border-0 pl-9 shadow-none focus-visible:ring-0`,autoComplete:`name`,"aria-required":`true`})})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(j,{htmlFor:`email`,children:[R.email,` `,(0,F.jsx)(`span`,{className:`text-destructive`,"aria-hidden":`true`,children:`*`})]}),(0,F.jsx)(I,{icon:u,error:J.email?.message,children:(0,F.jsx)(k,{id:`email`,type:`email`,...U(`email`),className:`border-0 pl-9 shadow-none focus-visible:ring-0`,autoComplete:`email`,"aria-required":`true`})})]})]}),(0,F.jsxs)(`div`,{className:`grid sm:grid-cols-2 gap-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(j,{htmlFor:`jobTitle`,children:[R.jobTitle,` `,(0,F.jsx)(`span`,{className:`text-destructive`,"aria-hidden":`true`,children:`*`})]}),(0,F.jsx)(I,{icon:c,error:J.jobTitle?.message,children:(0,F.jsx)(k,{id:`jobTitle`,...U(`jobTitle`),className:`border-0 pl-9 shadow-none focus-visible:ring-0`,autoComplete:`organization-title`,"aria-required":`true`})})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(j,{htmlFor:`website`,children:R.website}),(0,F.jsx)(I,{icon:l,error:J.website?.message,children:(0,F.jsx)(k,{id:`website`,...U(`website`),className:`border-0 pl-9 shadow-none focus-visible:ring-0`,placeholder:`https://`,autoComplete:`url`})})]})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(j,{htmlFor:`message`,children:[R.message,` `,(0,F.jsx)(`span`,{className:`text-destructive`,"aria-hidden":`true`,children:`*`})]}),(0,F.jsxs)(`div`,{className:`input-focus-ring relative flex items-start rounded-md border bg-background`,children:[(0,F.jsx)(f,{size:16,className:`absolute left-3 top-3 text-muted-foreground pointer-events-none`,"aria-hidden":`true`}),(0,F.jsx)(h,{id:`message`,...U(`message`),className:`border-0 pl-9 shadow-none focus-visible:ring-0 min-h-[120px]`,"aria-required":`true`})]}),J.message&&(0,F.jsx)(`p`,{className:`text-xs text-destructive mt-1`,role:`alert`,children:J.message.message})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(j,{htmlFor:`hearAbout`,children:[R.hearAbout,` `,(0,F.jsx)(`span`,{className:`text-destructive`,"aria-hidden":`true`,children:`*`})]}),(0,F.jsx)(k,{id:`hearAbout`,...U(`hearAbout`),className:`mt-1`,"aria-required":`true`}),J.hearAbout&&(0,F.jsx)(`p`,{className:`text-xs text-destructive mt-1`,role:`alert`,children:J.hearAbout.message})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(j,{className:`block mb-1`,children:[R.servicesInterested,` `,(0,F.jsx)(`span`,{className:`text-destructive`,"aria-hidden":`true`,children:`*`})]}),(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground mb-3`,children:R.servicesInterestedHelp}),(0,F.jsx)(`div`,{role:`group`,"aria-label":R.servicesInterested,className:`grid sm:grid-cols-2 gap-2`,children:e.siteData.services.map(e=>{let t=Z.includes(e.slug),n=e.icon;return(0,F.jsxs)(`label`,{className:`flex items-start gap-3 rounded-md border bg-background px-3 py-2.5 cursor-pointer transition-colors hover:bg-secondary/40 ${t?`border-primary ring-1 ring-primary/30`:`border-border`}`,children:[(0,F.jsx)(M,{checked:t,onCheckedChange:()=>oe(e.slug),"aria-label":e.title,className:`mt-0.5`}),(0,F.jsxs)(`span`,{className:`flex items-center gap-2 text-sm text-foreground leading-snug`,children:[(0,F.jsx)(n,{size:14,className:`text-primary shrink-0`,"aria-hidden":`true`}),e.title]})]},e.slug)})}),J.services&&(0,F.jsx)(`p`,{className:`text-xs text-destructive mt-1`,role:`alert`,children:J.services.message})]}),(0,F.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,F.jsx)(M,{id:`terms`,checked:ae===!0,onCheckedChange:e=>G(`terms`,e===!0||void 0,{shouldValidate:!0})}),(0,F.jsx)(j,{htmlFor:`terms`,className:`text-sm text-muted-foreground leading-snug cursor-pointer`,children:R.terms})]}),J.terms&&(0,F.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:J.terms.message}),(0,F.jsx)(x,{type:`submit`,size:`lg`,disabled:Y||X,className:`w-full sm:w-auto min-w-[160px]`,"aria-live":`polite`,children:X?(0,F.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,F.jsx)(_,{size:16,"aria-hidden":`true`}),` `,R.successToast]}):Y?(0,F.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,F.jsx)(O,{size:16,className:`animate-spin`,"aria-hidden":`true`}),` `,R.sending]}):R.send})]})]})})]})}),(0,F.jsx)(`section`,{className:`border-y border-border bg-secondary/30`,"aria-label":`Key statistics`,children:(0,F.jsx)(`div`,{className:`container mx-auto px-4 md:px-8 py-12`,children:(0,F.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-8 text-center`,children:B.map((e,t)=>(0,F.jsxs)(T,{delay:t*.08,children:[(0,F.jsx)(`p`,{className:`text-3xl md:text-4xl font-bold text-primary`,children:e.value}),(0,F.jsx)(`p`,{className:`text-xs md:text-sm text-muted-foreground uppercase tracking-wider mt-1`,children:e.label})]},e.label))})})}),(0,F.jsx)(`section`,{className:`container mx-auto px-4 md:px-8 py-14 md:py-20`,"aria-label":`Companies I've worked with`,children:(0,F.jsxs)(T,{children:[(0,F.jsx)(`p`,{className:`section-label text-center mb-6`,children:z.trustedBy}),(0,F.jsx)(N,{companies:z.trustCompanies,align:`center`})]})}),(0,F.jsxs)(`section`,{className:`container mx-auto px-4 md:px-8 pb-20 md:pb-28`,"aria-labelledby":`contact-testimonials-heading`,children:[(0,F.jsxs)(T,{children:[(0,F.jsx)(`p`,{className:`section-label mb-2 text-center`,children:z.testimonialsLabel}),(0,F.jsx)(`h2`,{id:`contact-testimonials-heading`,className:`section-title text-center mb-2`,children:z.testimonialsTitle}),(0,F.jsx)(`span`,{className:`section-title-accent mx-auto`})]}),(0,F.jsx)(`div`,{className:`mt-10 grid md:grid-cols-3 gap-6`,children:z.testimonials.slice(0,3).map((e,t)=>(0,F.jsx)(T,{delay:t*.1,children:(0,F.jsxs)(`blockquote`,{className:`relative bg-card border border-border rounded-xl p-6 h-full flex flex-col`,children:[(0,F.jsx)(w,{className:`w-6 h-6 text-primary/40 mb-3`,"aria-hidden":`true`}),(0,F.jsxs)(`p`,{className:`text-sm text-muted-foreground italic leading-relaxed mb-5 flex-1`,children:[`"`,e.text,`"`]}),(0,F.jsxs)(`footer`,{className:`flex items-center gap-3 pt-4 border-t border-border`,children:[(0,F.jsx)(`div`,{className:`w-10 h-10 rounded-full bg-primary/10 text-primary flex items-center justify-center text-sm font-bold`,"aria-hidden":`true`,children:V(e.author)}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`cite`,{className:`text-sm font-bold text-foreground not-italic`,children:e.author}),(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.role})]})]})]})},t))})]})]}),(0,F.jsx)(s,{})]})};export{L as t};

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.