PageSourceSearch

https://gentlebirth-app-website.lovable.app/assets/ProviderIntroRequest-C5iIfFbQ.js

js gentlebirth-app-website.lovable.app collected 2026-10-03 03:29:10 UTC 28,956 bytes, 1 lines download raw bytes

1import{r as n,I as q,u as we,x as ve,y as ke,aC as Se,z as Ce,j as e,N as M,K as Y,B as x,L as D,F as le,C as b,a8 as Te,a9 as Ee,b as w,H as Ie,Z as G,an as Re,aR as We,c as ce,a as Pe,h as Le,k as de,av as F,$ as p,a0 as E,A as me,a2 as $e,g as ue,w as Fe}from"./index-CwRyDTkN.js";import{u as Be}from"./useUserProfile-CAXx-eMe.js";import{f as _e}from"./currency-sLg23ZO2.js";import{P as Ae}from"./ProviderAvatar-DXfuybox.js";import{H as De}from"./handshake-Cvl7tfie.js";import{L as qe}from"./list-checks-IloK0Bd1.js";import{C as He}from"./calendar-days-CYYc6-mY.js";import{U as Oe}from"./user-round-CQKhE_gz.js";const Ue=()=>{const[i,d]=n.useState(!1);return{submit:n.useCallback(async k=>{d(!0);try{const{data:o,error:I}=await q.functions.invoke("submit-provider-lead",{body:k});if(I){let m=I.message;try{const y=I.context;y!=null&&y.text&&(m=await y.text()||m)}catch{}return console.error("submit-provider-lead failed:",m),{ok:!1,error:"We could not send your request. Please try again in a moment."}}return{ok:!0,duplicate:!!(o!=null&&o.duplicate)}}catch(o){return console.error("submit-provider-lead threw:",o),{ok:!1,error:"We could not send your request. Please try again in a moment."}}finally{d(!1)}},[]),submitting:i}},Ke=["Birth doula","Postpartum doula","Lactation support","Childbirth education","Newborn care"],he=[{key:"asap",label:"As soon as possible",value:"As soon as possible"},{key:"weeks",label:"Next 2–4 weeks",value:"Within the next 2–4 weeks"},{key:"date",label:"Pick a date",value:""},{key:"exploring",label:"Just exploring",value:"Just exploring for now"}],Me=["In person","Remote","Either"],Ye=["email","phone","text"],L=[{n:1,caption:"Need",title:"Tell us what you need",why:"So we can brief them accurately and only move forward if it’s a real fit."},{n:2,caption:"Contact",title:"Share how to reach you",why:"So our team can reach you directly and confirm the introduction."},{n:3,caption:"Note",title:"Add anything personal",why:"So the first conversation starts warm instead of from scratch."}],Ge=["First baby — I’d love help with pain coping.","I need overnight postpartum support.","We’re expecting twins.","I had a hard birth last time and want gentle guidance."],Je=["Under $500","$500 – $1,000","$1,000 – $2,000","$2,000 – $3,500","$3,500+","Not sure yet"],ze={serviceType:"",timingKey:"",dueDate:"",budgetRange:"",format:"Either",contactName:"",contactEmail:"",phone:"",locationText:"",preferredContact:"email",message:""},$=({active:i,onClick:d,children:v})=>e.jsxs("button",{type:"button","aria-pressed":i,onClick:d,className:F("inline-flex min-h-11 items-center gap-2 rounded-full border px-4 text-sm font-semibold transition-colors",i?"border-primary bg-primary text-primary-foreground":"border-border bg-background text-foreground hover:border-primary/50 hover:bg-primary/5"),children:[i&&e.jsx(Fe,{className:"h-4 w-4","aria-hidden":"true"}),v]}),J=({step:i,title:d,description:v,icon:k,why:o})=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:k}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs font-bold uppercase tracking-wide text-primary",children:["Step ",i," of 3"]}),e.jsx("h2",{className:"text-xl font-bold text-foreground",children:d}),e.jsx("p",{className:"text-sm text-muted-foreground",children:v}),o&&e.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-semibold text-foreground",children:"Why we ask:"})," ",o]})]})]}),rt=()=>{var ne;const{profileId:i}=we(),[d]=ve(),v=ke(),k=Se(),{user:o,loading:I}=Ce(),{data:m}=Be(),{submit:y,submitting:H}=Ue(),[a,z]=n.useState(null),[xe,V]=n.useState(!0),[Z,pe]=n.useState(null),[s,O]=n.useState(ze),[f,R]=n.useState(1),[Q,X]=n.useState(!1),[B,j]=n.useState(null),[ee,te]=n.useState(!1),[_,fe]=n.useState(null),[ge,U]=n.useState(!1),S=`intro-draft:${i??"unknown"}`,W=`intro-pending:${i??"unknown"}`,se=n.useRef(!1),l=(t,c)=>O(A=>({...A,[t]:c}));n.useEffect(()=>{let t=!1;return(async()=>{var c,A;V(!0);try{if(i!=null&&i.startsWith("gb-")){const{data:h,error:oe}=await q.from("directory_applications").select("id, full_name, photo_url, city, state, base_rate, currency, skills, offers_remote, offers_in_person").eq("id",i.slice(3)).maybeSingle();if(t)return;if(oe)throw oe;if(!h)throw new Error("Provider not found");z({profileId:i,fullName:h.full_name,imageUrl:h.photo_url,city:h.city,state:h.state,baseRate:h.base_rate!=null?Number(h.base_rate):null,currency:h.currency,skills:h.skills??[],offersRemote:h.offers_remote,offersInPerson:h.offers_in_person});return}const{data:g,error:ie}
1=await q.functions.invoke("get-provider",{body:{profileId:i}});if(t)return;if(ie)throw ie;if(g!=null&&g.error)throw new Error(g.error);const r=g.provider;z({profileId:i??(r==null?void 0:r.profileId)??"",fullName:(r==null?void 0:r.fullName)??"this provider",imageUrl:r==null?void 0:r.imageUrl,city:(c=r==null?void 0:r.location)==null?void 0:c.city,state:(A=r==null?void 0:r.location)==null?void 0:A.state,baseRate:(r==null?void 0:r.baseRate)??null,currency:(r==null?void 0:r.currency)??null,skills:(r==null?void 0:r.skills)??[]})}catch(g){t||pe(g instanceof Error?g.message:"Failed to load provider")}finally{t||V(!1)}})(),()=>{t=!0}},[i]),n.useEffect(()=>{if(!se.current){se.current=!0;try{const t=sessionStorage.getItem(S);t&&O(c=>({...c,...JSON.parse(t)}))}catch{}}},[S]),n.useEffect(()=>{try{sessionStorage.setItem(S,JSON.stringify(s))}catch{}},[s,S]),n.useEffect(()=>{O(t=>({...t,contactName:t.contactName||(m==null?void 0:m.fullName)||"",contactEmail:t.contactEmail||(m==null?void 0:m.email)||(o==null?void 0:o.email)||"",serviceType:t.serviceType||d.get("service")||"",dueDate:t.dueDate||d.get("due")||"",locationText:t.locationText||d.get("area")||[a==null?void 0:a.city,a==null?void 0:a.state].filter(Boolean).join(", ")}))},[m,o,a,d]);const u=((ne=a==null?void 0:a.fullName)==null?void 0:ne.split(" ")[0])??"them",ye=n.useMemo(()=>{const t=((a==null?void 0:a.skills)??[]).filter(Boolean).slice(0,6);return Array.from(new Set([...t,...Ke])).slice(0,8)},[a]),P=n.useMemo(()=>{const t=he.find(c=>c.key===s.timingKey);return!t||t.key==="date"?s.dueDate:t.value},[s.timingKey,s.dueDate]),N=s.serviceType.trim().length>1,K=s.phone.replace(/\D/g,"").length>=7,C=s.contactName.trim().length>1&&/\S+@\S+\.\S+/.test(s.contactEmail.trim())&&K,je=()=>{const t=`${k.pathname}${k.search}`;v(`/login?returnTo=${encodeURIComponent(t)}&context=provider-intro`)},Ne=n.useCallback(async()=>{te(!0),j(null);try{const{data:t,error:c}=await q.functions.invoke("draft-intro-note",{body:{serviceType:s.serviceType,timing:P,format:s.format,locationText:s.locationText,providerName:a==null?void 0:a.fullName,notes:s.message}});if(c)throw c;t!=null&&t.note&&l("message",t.note)}catch(t){console.error("draft-intro-note failed:",t),j("We could not draft that just now — feel free to write it in your own words.")}finally{te(!1)}},[s.serviceType,s.format,s.locationText,s.message,P,a]),ae=n.useCallback(async()=>{if(j(null),!N||!C){j("Please add what you need, your email and a phone number we can reach you on.");return}const t=await y({providerProfileId:(a==null?void 0:a.profileId)||i||s.contactEmail,providerName:(a==null?void 0:a.fullName)||"Provider",contactName:s.contactName.trim(),contactEmail:s.contactEmail.trim(),phone:s.phone.trim(),preferredContact:s.preferredContact,serviceType:s.serviceType.trim()||void 0,dueDate:P||void 0,budgetRange:s.budgetRange||void 0,locationText:s.locationText.trim()||void 0,format:s.format,message:s.message.trim()||void 0,matchScore:Number(d.get("score"))||void 0,source:d.get("source")||"profile"});if(t.ok===!1){j(t.error);return}try{sessionStorage.removeItem(S),sessionStorage.removeItem(W)}catch{}fe(t.duplicate?"duplicate":"sent"),window.scrollTo({top:0,behavior:"smooth"})},[s,i,a,d,N,C,y,P,S,W]),be=async()=>{if(j(null),!N||!C){j("Please add what you need, your email and a phone number we can reach you on.");return}if(!o){try{sessionStorage.setItem(W,"1")}catch{}U(!0),window.scrollTo({top:0,behavior:"smooth"});return}await ae()};if(n.useEffect(()=>{if(!o||_||H||!a)return;let t=!1;try{t=sessionStorage.getItem(W)==="1"}catch{}if(t&&!(!N||!C)){try{sessionStorage.removeItem(W)}catch{}U(!1),ae()}},[o,a,N,C]),xe||I)return e.jsxs(e.Fragment,{children:[e.jsx(M,{}),e.jsx("main",{className:"flex min-h-screen items-center justify-center pt-20",children:e.jsx(Y,{className:"h-8 w-8 animate-spin text-primary","aria-label":"Loading"})})]});if(Z||!a)return e.jsxs(e.Fragment,{children:[e.jsx(M,{}),e.jsxs("main",{className:"mx-auto max-w-2xl px-4 pb-20 pt-28 text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"We could not open that provider"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:Z??"Please try again."}),e.jsx(x,{asChild:!0,className:"mt-6",children:e.jsx(D,{to:"/find-a-provider",children:"Browse providers"})})]}),e.jsx(le,{})]});
1const T=[a.city,a.state].filter(Boolean).join(", "),re=e.jsxs(b,{className:"border-primary/20 bg-primary/[0.04]",children:[e.jsx(Te,{className:"pb-3",children:e.jsx(Ee,{className:"text-base",children:"What we’ll send our team"})}),e.jsx(w,{className:"space-y-2 text-sm",children:[["Provider",a.fullName],["Support needed",s.serviceType||"—"],["Timing",P||"—"],["Format",s.format],["Your area",s.locationText||"—"],["Reach you by",s.preferredContact]].map(([t,c])=>e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-muted-foreground",children:t}),e.jsx("span",{className:"text-right font-medium text-foreground",children:c})]},t))})]});return e.jsxs(e.Fragment,{children:[e.jsxs(Ie,{children:[e.jsx("title",{children:`Let GentleBirth help you find the right support | ${a.fullName}`}),e.jsx("meta",{name:"description",content:`Tell GentleBirth what support you need and what budget you’re working with. We’ll handle availability, scope, and pricing with ${a.fullName} before arranging an introduction.`}),e.jsx("meta",{name:"robots",content:"noindex"})]}),e.jsx(M,{}),e.jsx("main",{className:"min-h-screen bg-muted/30 pb-24 pt-24",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4",children:[e.jsxs(D,{to:`/provider/${a.profileId}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-primary hover:underline",children:[e.jsx(G,{className:"h-4 w-4","aria-hidden":"true"})," Back to ",u,"’s profile"]}),e.jsxs("header",{className:"mt-4 flex flex-col gap-5 rounded-3xl border border-border/70 bg-card p-6 shadow-sm sm:flex-row sm:items-center",children:[e.jsx(Ae,{src:a.imageUrl,name:a.fullName,className:"h-20 w-20 shrink-0 overflow-hidden rounded-2xl",fallbackClassName:"bg-primary/10 text-2xl font-bold text-primary"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground sm:text-3xl",children:"Let us help you find the right support"}),e.jsxs("p",{className:"mt-1 text-muted-foreground",children:["Tell us what your family needs and what budget you’re working with. We’ll handle the initial conversations with ",u," — including availability, scope, and pricing — so you only meet once the important details are aligned."]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-sm text-muted-foreground",children:[T&&e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(Re,{className:"h-4 w-4 text-primary","aria-hidden":"true"})," ",T]}),a.baseRate!=null&&e.jsxs("span",{className:"rounded-full bg-primary/10 px-3 py-1 font-semibold text-primary",children:["Starting rate ",_e(a.baseRate,a.currency)]})]})]})]}),e.jsx("section",{className:"mt-10",children:e.jsxs("div",{className:"rounded-3xl bg-card p-6 ring-1 ring-border/60 sm:p-8",children:[e.jsx("p",{className:"text-sm font-bold uppercase tracking-[0.12em] text-primary",children:"How GentleBirth helps"}),e.jsx("p",{className:"mt-3 max-w-2xl text-lg font-semibold text-foreground sm:text-xl",children:"Less searching. Less repeating yourself. Better-fit conversations."}),e.jsxs("ol",{className:"mt-6 grid gap-5 sm:grid-cols-3",children:[e.jsxs("li",{className:"flex gap-4",children:[e.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:e.jsx(We,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsxs("div",{children:[e.jsx("span",{className:"block font-bold text-foreground",children:"Tell us what you need"}),e.jsx("span",{className:"mt-1 block text-sm leading-relaxed text-muted-foreground",children:"Share the support you’re looking for, your timing, and your approximate budget. If you’re unsure, we’ll help you shape a realistic request."})]})]}),e.jsxs("li",{className:"flex gap-4",children:[e.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-secondary/15 text-secondary",children:e.jsx(ce,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsxs("div",{children:[e.jsx("span",{className:"block font-bold text-foreground",children:"We handle the back-and-forth"}),e.jsxs("span",{className:"mt-1 block text-sm leading-relaxed text-muted-foreground",children:["We contact ",u,", confirm availability, clarify what services would be included, and help both sides work toward a scope and price that c
1ould make sense."]})]})]}),e.jsxs("li",{className:"flex gap-4",children:[e.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-accent/15 text-accent",children:e.jsx(De,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsxs("div",{children:[e.jsx("span",{className:"block font-bold text-foreground",children:"Meet when there’s a real possibility"}),e.jsxs("span",{className:"mt-1 block text-sm leading-relaxed text-muted-foreground",children:["We arrange an introduction only after the important details are clear — so your first conversation can focus on comfort, trust, and whether ",u," feels right for your family."]})]})]})]})]})}),e.jsxs("section",{className:"mt-6 grid gap-6 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-3xl bg-secondary/5 p-6 ring-1 ring-secondary/20 sm:p-8",children:[e.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-secondary/15 text-secondary",children:e.jsx(Pe,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsxs("h2",{className:"mt-4 text-lg font-bold text-foreground",children:["If ",u," isn’t the right fit"]}),e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:"Sometimes a provider is unavailable, outside your budget, or can’t offer exactly what you need. If that happens, we can keep searching on your behalf — with your permission — so you don’t have to start over."})]}),e.jsxs("div",{className:"rounded-3xl bg-primary/5 p-6 ring-1 ring-primary/20 sm:p-8",children:[e.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:e.jsx(qe,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsx("h2",{className:"mt-4 text-lg font-bold text-foreground",children:"What happens next"}),e.jsxs("ol",{className:"mt-3 space-y-2 text-sm leading-relaxed text-muted-foreground",children:[e.jsx("li",{children:"1. We review your needs, timing, and budget."}),e.jsxs("li",{children:["2. We contact ",u," and explain what you’re looking for."]}),e.jsx("li",{children:"3. We bring back a proposed option with the key details clarified."}),e.jsx("li",{children:"4. If it looks promising, we arrange the introduction."}),e.jsx("li",{children:"5. If it doesn’t work, we’ll ask if you’d like us to keep searching."})]}),e.jsx("p",{className:"mt-3 text-sm font-semibold text-foreground",children:"Nothing is agreed to without your approval."})]})]}),_?e.jsx(b,{className:"mt-8 border-primary/30",children:e.jsxs(w,{className:"space-y-4 p-8 text-center",children:[e.jsx(Le,{className:"mx-auto h-12 w-12 text-primary","aria-hidden":"true"}),e.jsx("h2",{className:"text-2xl font-bold text-foreground",children:_==="sent"?"We’ve got it":`You already asked about ${u}`}),e.jsx("p",{className:"mx-auto max-w-xl text-muted-foreground",children:_==="sent"?`Our team is reading your request now. We’ll reach out to ${a.fullName} and email you within one business day with next steps — you don’t need to do anything else.`:`Your earlier request is still with our team — we’ll be in touch about ${a.fullName} soon.`}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-3 pt-2",children:[e.jsx(x,{asChild:!0,children:e.jsxs(D,{to:`/provider/${a.profileId}`,children:["Back to ",u,"’s profile"]})}),e.jsx(x,{asChild:!0,variant:"outline",children:e.jsx(D,{to:"/find-a-provider",children:"Browse more providers"})})]})]})}):ge&&!o?e.jsx(b,{className:"mt-8 border-primary/30",children:e.jsxs(w,{className:"space-y-4 p-8 text-center",children:[e.jsx(de,{className:"mx-auto h-10 w-10 text-primary","aria-hidden":"true"}),e.jsx("h2",{className:"text-xl font-bold text-foreground",children:"Your request is ready — one last step"}),e.jsxs("p",{className:"mx-auto max-w-xl text-muted-foreground",children:["Everything you wrote is saved. Sign in or create an account and we’ll send it to our team straight away, so we can keep you updated about ",u,"."]}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-3 pt-2",children:[e.jsx(x,{onClick:je,children:"Sign in and send my request"}),e.jsx(x,{variant:"ghost",onClick:()=>U(!1),children:"Keep editing"})]})]})}):e.jsxs("div",{className:"mt-8 grid gap-8 lg:grid-cols-[minmax(0,1fr)_320px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{"aria-labelledby":"intro-process-heading",className:"rounded-2xl border border-border/70 bg-card p-5 shadow-sm",children:[e.jsx("h2",{id:"intro-process-heading",className:"text-sm font-bold uppercase tracking-wide text-primary",children:"How this works"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Three short steps. Here’s exactly what we ask and why."}),e.jsx("ol",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:L.map(t=>e.jsxs("li",{className:F("rounded-xl border p-4 transition-colors",f===t.n?"border-primary/50 bg-primary/5":"border-border/70 bg-background"),children:[e.jsxs("p",{className:"text-xs font-bold uppercase tracking-wide text-primary",children:["Step ",t.n]}),e.jsx("p",{className:"mt-1 text-sm font-semibold text-foreground",children:t.title}),e.jsx("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:t.why})]},t.n))}),e.jsxs("div",{className:"mt-4 space-y-1.5 border-t border-border/70 pt-4 text-xs text-muted-foreground",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-foreground",children:"The
1n we take over:"})," we contact ",u,", confirm availability, clarify scope and pricing, and only arrange the introduction once the details look promising."]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-foreground",children:"Timing:"})," same-day review, introduction email within one business day."]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-foreground",children:"Your privacy:"})," your details are shared only when we make the introduction — never sold, never used for marketing."]})]})]}),e.jsx("ol",{className:"flex items-start gap-2","aria-label":"Progress",children:L.map(({n:t,caption:c})=>e.jsxs("li",{className:"flex flex-1 items-start gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>R(t),className:"flex shrink-0 flex-col items-center gap-1","aria-label":`Go to step ${t}: ${c}`,"aria-current":f===t?"step":void 0,children:[e.jsx("span",{className:F("flex h-8 w-8 items-center justify-center rounded-full text-sm font-bold transition-colors",f>=t?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"),children:t}),e.jsx("span",{className:F("text-[11px] font-semibold",f>=t?"text-primary":"text-muted-foreground"),children:c})]}),t<3&&e.jsx("span",{className:F("mt-4 h-1 flex-1 rounded-full",f>t?"bg-primary":"bg-muted"),"aria-hidden":"true"})]},t))}),f===1&&e.jsx(b,{children:e.jsxs(w,{className:"space-y-6 p-6",children:[e.jsx(J,{step:1,title:"What kind of support do you need?",description:"Tap what fits — you can adjust the details after.",why:L[0].why,icon:e.jsx(de,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(p,{children:"Support you’re looking for"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:ye.map(t=>e.jsx($,{active:s.serviceType===t,onClick:()=>l("serviceType",t),children:t},t))}),e.jsx(E,{value:s.serviceType,maxLength:160,placeholder:"Or describe it in your own words",onChange:t=>l("serviceType",t.target.value)}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[u," lists"," ",a.skills.length?a.skills.slice(0,3).join(", "):"perinatal support"," ","— pick the closest fit and we’ll sort out the rest."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(p,{children:"When do you need it?"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:he.map(t=>e.jsx($,{active:s.timingKey===t.key,onClick:()=>{l("timingKey",t.key),t.key!=="date"&&l("dueDate","")},children:t.label},t.key))}),s.timingKey==="date"&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(p,{htmlFor:"intro-date",className:"flex items-center gap-2",children:[e.jsx(He,{className:"h-4 w-4 text-primary","aria-hidden":"true"}),"Due date or start date"]}),e.jsx(E,{id:"intro-date",type:"date",value:s.dueDate,onChange:t=>l("dueDate",t.target.value)})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(p,{children:"What budget are you working with?"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Je.map(t=>e.jsx($,{active:s.budgetRange===t,onClick:()=>l("budgetRange",s.budgetRange===t?"":t),children:t},t))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional, but it helps us negotiate scope and pricing on your behalf."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(p,{children:"How would you like to meet?"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Me.map(t=>e.jsx($,{active:s.format===t,onClick:()=>l("format",t),children:t},t))})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(x,{className:"min-h-11",onClick:()=>R(2),disabled:!N,children:["Continue ",e.jsx(me,{className:"ml-2 h-4 w-4","aria-hidden":"true"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Next: how we reach you (name, email, phone, area)."})]})}),f===2&&e.jsx(b,{children:e.jsxs(w,{className:"space-y-6 p-6",children:[e.jsx(J,{step:2,title:"How should we reach you?",description:"We filled in what we already know from your account.",why:L[1].why,icon:e.jsx(Oe,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(p,{htmlFor:"intro-name",children:"Your name"}),e.jsx(E,{id:"intro-name",value:s.contactName,maxLength:255,onChange:t=>l("contactName",t.target.value)}),(m==null?void 0:m.fullName)&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"From your account"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(p,{htmlFor:"intro-email",children:"Email"}),e.jsx(E,{id:"intro-email",type:"email",value:s.contactEmail,maxLength:255,onChange:t=>l("contactEmail",t.target.value)}),!/\S+@\S+\.\S+/.test(s.contactEmail.trim())&&e.jsx("p",{className:"text-xs text-destructive",children:"We need a valid email to send you the introduction."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(p,{htmlFor:"intro-phone",children:["Phone ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(E,{id:"intro-phone",type:"tel",value:s.phone,maxLength:40,placeholder:"(555) 123-4567",onChange:t=>l("phone",t.target.value),onBlur:()=>X(!0),"aria-required":"true","aria-invalid":Q&&!K}),Q&&!K?e.jsx("p",{className:"text-xs text-destructive",children:"Add a number we can reach you on."}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"A direct number means we can confirm the introduction quickly."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(p,{htmlFor:"intro-area",children:"Your area"}),e.jsx(E,{id:"intro-area",value:s.locationText,maxLength:255,placeholder:"City, state or ZIP",onChange:t=>l("locationText",t.target.value)}),T&&s.locationText!==T&&e.jsxs("button",{type:"button",className:"text-xs font-semibold text-primary hover:underline",onClick:()=>l("locationText",T),children:["Use ",T]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(p,{children:"Best way to reach you"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Ye.map(t=>e.jsx($,{active:s.preferredContact===t,onClick:()=>l("preferredContact",t),children:e.jsx("span",{className:"capitalize",children:t})},t))})]}),e.jsxs("div",{className:"flex flex-wrap justify-between gap-3",children:[e.jsxs(x,{variant:"ghost",className:"min-h-11",onClick:()=>R(1),children:[e.jsx(G,{className:"mr-2 h-4 w-4","aria-hidden":"true"})," Back"]}),e.jsxs(x,{className:"min-h-11",onClick:()=>{X(!0),C&&R(3)},children:["Continue ",e.jsx(me,{className:"ml-2 h-4 w-4","aria-hidden":"true"})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Next: an optional note for ",u,", then you’re done."]})]})}),f===3&&e.jsx(b,{children:e.jsxs(w,{className:"space-y-6 p-6",children:[e.jsx(J,{step:3,title:"Anything you’d like us to pass along?",description:"Optional — a sentence or tw
1o helps us make a better introduction.",why:L[2].why,icon:e.jsx(ce,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Ge.map(t=>e.jsxs("button",{type:"button",onClick:()=>l("message",s.message?`${s.message.trim()} ${t}`:t),className:"rounded-full border border-dashed border-primary/40 px-3 py-2 text-xs font-semibold text-primary transition-colors hover:bg-primary/5",children:["+ ",t]},t))}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"intro-note",children:"Your note"}),e.jsx($e,{id:"intro-note",value:s.message,maxLength:2e3,rows:6,placeholder:"What matters most to you about your support…",onChange:t=>l("message",t.target.value)}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx(x,{type:"button",variant:"outline",className:"min-h-11",onClick:Ne,disabled:ee||!N,children:ee?e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"mr-2 h-4 w-4 animate-spin","aria-hidden":"true"})," ","Wording it…"]}):e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"mr-2 h-4 w-4","aria-hidden":"true"})," Help me word this"]})}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.message.length,"/2000 — always yours to edit"]})]})]}),e.jsx("div",{className:"lg:hidden",children:re}),B&&e.jsx("p",{role:"alert",className:"text-sm font-medium text-destructive",children:B}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs(x,{variant:"ghost",className:"min-h-11",onClick:()=>R(2),children:[e.jsx(G,{className:"mr-2 h-4 w-4","aria-hidden":"true"})," Back"]}),e.jsx(x,{className:"min-h-12 w-full sm:w-auto",onClick:be,disabled:H,children:H?e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"mr-2 h-4 w-4 animate-spin","aria-hidden":"true"})," ","Sending…"]}):e.jsxs(e.Fragment,{children:["Start My Request ",e.jsx(ue,{className:"ml-2 h-4 w-4","aria-hidden":"true"})]})})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Next: we review your request, reach out to ",u,", and email you a proposed option within one business day. Nothing is agreed to without your approval."]})]})}),B&&f!==3&&e.jsx("p",{role:"alert",className:"text-sm font-medium text-destructive",children:B})]}),e.jsx("aside",{className:"hidden space-y-4 lg:block",children:e.jsxs("div",{className:"sticky top-24 space-y-4",children:[re,e.jsx(b,{children:e.jsxs(w,{className:"space-y-3 p-5 text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-semibold text-foreground",children:"What happens next"}),e.jsxs("ol",{className:"space-y-2",children:[e.jsx("li",{children:"1. We review your needs, timing, and budget."}),e.jsxs("li",{children:["2. We contact ",u," and explain what you’re looking for."]}),e.jsx("li",{children:"3. We bring back a proposed option with key details clarified."}),e.jsx("li",{children:"4. If it looks promising, we arrange the introduction."}),e.jsx("li",{children:"5. If it doesn’t work, we’ll ask if you’d like us to keep searching."})]}),e.jsx("p",{className:"text-xs",children:"Proposed option within one business day."}),e.jsx("p",{className:"text-xs",children:"Your details are only shared with the provider once we make the introduction. Nothing is agreed to without your approval."})]})})]})})]})]})}),e.jsx(le,{})]})};export{rt as default};

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.