1import{r as o,j as e,aj as R,ai as S,C as F,a as O,b as L,e as V,a0 as c,a5 as W,k as Y}from"./index-fhlGM1Ef.js";import{M as C}from"./marketing-layout-C2B-FOem.js";import{L as i}from"./label-GNjZqvZW.js";import{S as p,a as x,b as g,c as b,d as j}from"./select-BlJzISDp.js";import{u as _}from"./useMutation-C7N-S5w3.js";import{g as U,d as w}from"./dental-service-catalog-BK57Lno0.js";import{C as H}from"./checkbox-BwcYWkzi.js";import{u as K}from"./use-seo-meta-6iVTFF48.js";import{C as B}from"./circle-check-LXSURgfD.js";import{C as q}from"./circle-alert-Be8qtrtJ.js";import"./just_logo_1770330927218-Cgfl6W6S.js";import"./index-DOACJyAm.js";import"./chevron-up-BeKy9RNb.js";const J=["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"],z=["Under $500","$500â$1,000","$1,000â$2,500","$2,500â$5,000","$5,000â$10,000","$10,000+","Not sure / Want quotes"],G="mi-referral-v1",X="I agree that Dental Shield may share my request and contact details with up to three participating Michigan dental practices so they can contact me about this request. Availability is not guaranteed.";function me(){const r=U(new URLSearchParams(window.location.search).get("service")??""),y=r?`Service requested: ${r.name}`:"",[s,f]=o.useState(r?.urgent||r?.categorySlug==="emergency"?"emergency":"cosmetic"),[k,T]=o.useState(!1),[m,D]=o.useState(r?.slug??""),[u,$]=o.useState(!1),[a,M]=o.useState({name:"",email:"",phone:"",description:y?`${y} 2`:"",city:"",stateCode:"",zipCode:"",insuranceCarrier:"",budgetRange:"",preferredDate:""}),[v,N]=o.useState(null),h=_({mutationFn:async t=>{const l=await fetch("/api/public/patient-request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!l.ok){const d=await l.json().catch(()=>({}));throw new Error(d.error||"Something went wrong. Please try again.")}return l.json()},onSuccess:()=>{N(null),T(!0)},onError:t=>N(t.message)}),n=(t,l)=>{M(d=>({...d,[t]:l}))},I=t=>{t.preventDefault();const l=w.find(E=>E.slug===m),d=l?`Service requested: ${l.name}`:"",P=d&&!a.description.includes(d)?`${d} 3${a.description}`:a.description,A=r?`/dental-services/${r.slug}`:window.location.pathname;h.mutate({...a,description:P,requestType:s,seoSource:A,...a.stateCode==="MI"&&u?{pilotServiceSlug:m,pilotSharingConsent:!0,pilotConsentVersion:G}:{}})};return K({title:r?`Request ${r.name} | Dental Shield`:"Request Dental Care | Dental Shield",description:r?`Send a care request for ${r.name} to participating dental practices. Service and appointment availability are confirmed by each practice.`:"Tell Dental Shield what dental care you need and send a request to participating practices in your area.",canonicalPath:"/request-care",robots:"noindex, follow"}),k?e.jsx(C,{children:e.jsx("section",{className:"py-24","data-testid":"section-submitted",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-lg text-center",children:[e.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full bg-amber-100 mx-auto mb-6",children:e.jsx(B,{className:"h-10 w-10 text-amber-600"})}),e.jsx("h1",{className:"text-3xl font-bold mb-4",children:"One more step â confirm your email"}),e.jsxs("p",{className:"text-muted-foreground text-lg mb-4",children:["We've sent a confirmation email to ",e.jsx("strong",{children:a.email}),"."]}),e.jsxs("p",{className:"text-muted-foreground mb-6",children:["Click the ",e.jsx("strong",{children:"Confirm My Request"})," button in that email to verify your request.",u?" Your request will then await administrator-reviewed matching with eligible Michigan pilot practices; no practice is notified automatically.":" Confirmation does not guarantee that a practice has been notified or will respond."]}),e.jsxs("div",{className:"p-4 rounded-lg bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 text-sm text-amber-800 dark:text-amber-400",children:["Didn't get the email? Check your spam folder. The email comes from ",e.jsx("strong",{children:"[email protected]"}),"."]})]})})}):e.jsx(C,{children:e.jsx("section",{className:"py-16 lg:py-20","data-testid":"section-request-care",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-2xl",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h1",{className:"text-4xl font-bold mb-4","data-testid":"text-request-title",children:r?`Request ${r.name}`:"Find a Dentist Near You â Fast"}),e.jsx("p",{className:"text-xl text-muted-foreground",children:"Tell us what you need. Submitting a request does not immediately route it to a practice, and service and appointment availability vary."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-8",children:[e.jsxs("button",{type:"button",onClick:()=>f("emergency"),className:`p-4 rounded-xl border-2 text-left transition-all ${s==="emergency"?"border-red-500 bg-red-50 dark:bg-red-950/20":"border-border hover:border-primary/50"}`,"data-testid":"button-emergency-type",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(R,{className:`h-5 w-5 ${s==="emergency"?"text-red-600":"text-muted-foreground"}`}),e.jsx("span",{className:"font-semibold",children:"Emergency"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tooth pain, broken tooth, swelling â need care today"})]}),e.jsxs("button",{type:"button",onClick:()=>f("cosmetic"),className:`p-4 rounded-xl border-2 text-left transition-all ${s==="cosmetic"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,"data-testid":"button-cosmetic-type",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(S,{className:`h-5 w-5 ${s==="cosmetic"?"text-primary":"text-muted-foreground"}`}),e.jsx("span",{className:"font-semibold",children:"Planned / Non-emergency"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Preventive, restorative, cosmetic, specialty, and other planned care"})]})]}),s==="emergency"&&e.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800 mb
3-6","data-testid":"banner-emergency",children:[e.jsx(q,{className:"h-5 w-5 text-red-600 mt-0.5 flex-shrink-0"}),e.jsxs("p",{className:"text-sm text-red-700 dark:text-red-400",children:[e.jsx("strong",{children:"This form does not dispatch emergency care or immediately alert a dental practice."})," Response and same-day availability are not guaranteed. Contact a dentist directly for urgent help. Call 911 for trouble breathing or swallowing, rapidly spreading swelling, uncontrolled bleeding, or serious head or jaw injury."]})]}),s==="cosmetic"&&e.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 mb-6","data-testid":"banner-cosmetic",children:[e.jsx(S,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),e.jsxs("p",{className:"text-sm text-blue-700 dark:text-blue-400",children:[e.jsx("strong",{children:"Planned-care requests"})," are reviewed before any applicable routing or matching. Practices independently confirm whether they offer the service, clinical fit, estimates, and availability."]})]}),e.jsxs(F,{"data-testid":"card-request-form",children:[e.jsx(O,{children:e.jsx(L,{children:"Tell us about your dental need"})}),e.jsx(V,{children:e.jsxs("form",{onSubmit:I,className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i,{htmlFor:"name",children:"Full Name *"}),e.jsx(c,{id:"name",value:a.name,onChange:t=>n("name",t.target.value),placeholder:"Jane Smith",required:!0,"data-testid":"input-name"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i,{htmlFor:"phone",children:"Phone Number *"}),e.jsx(c,{id:"phone",value:a.phone,onChange:t=>n("phone",t.target.value),placeholder:"(555) 000-0000",required:!0,"data-testid":"input-phone"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i,{htmlFor:"email",children:"Email Address *"}),e.jsx(c,{id:"email",type:"email",value:a.email,onChange:t=>n("email",t.target.value),placeholder:"[email protected]",required:!0,"data-testid":"input-email"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i,{htmlFor:"description",children:s==="emergency"?"Describe your dental emergency *":"Describe what you're looking for *"}),e.jsx(W,{id:"description",value:a.description,onChange:t=>n("description",t.target.value),placeholder:s==="emergency"?"e.g. Severe tooth pain upper right, started yesterday, possible abscess...":"e.g. I want full dental implants for 3 missing teeth, also interested in whitening...",rows:3,required:!0,"data-testid":"input-description"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"col-span-2 space-y-1.5",children:[e.jsx(i,{htmlFor:"city",children:"City *"}),e.jsx(c,{id:"city",value:a.city,onChange:t=>n("city",t.target.value),placeholder:"Ann Arbor",required:!0,"data-testid":"input-city"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i,{htmlFor:"state",children:"State *"}),e.jsxs(p,{value:a.stateCode,onValueChange:t=>n("stateCode",t),children:[e.jsx(x,{id:"state","data-testid":"select-state",children:e.jsx(g,{placeholder:"State"})}),e.jsx(b,{children:J.map(t=>e.jsx(j,{value:t,children:t},t))})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i,{htmlFor:"service",children:"Dental service *"}),e.jsxs(p,{value:m,onValueChange:D,children:[e.jsx(x,{id:"service","data-testid":"select-pilot-service",children:e.jsx(g,{placeholder:"Select the service you need"})}),e.jsx(b,{children:w.map(t=>e.jsx(j,{value:t.slug,children:t.name},t.slug))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This helps us understand your request. Selecting a service does not enroll you in the free referral pilot."})]}),a.stateCode==="MI"&&e.jsxs("div",{className:"rounded-lg border border-blue-200 bg-blue-50/70 p-4 dark:border-blue-800 dark:bg-blue-950/20","data-testid":"section-michigan-pilot-consent",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsx("p",{className:"font-semibold text-blue-950 dar
3k:text-blue-100",children:"Optional: Michigan free referral pilot"}),e.jsx("span",{className:"rounded-full bg-background px-2 py-0.5 text-xs font-medium",children:"No fee"})]}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-3 text-sm",children:[e.jsx(H,{checked:u,onCheckedChange:t=>$(t===!0),"data-testid":"checkbox-pilot-sharing-consent"}),e.jsx("span",{children:X})]}),e.jsx("p",{className:"mt-2 pl-7 text-xs text-muted-foreground",children:"Optional and unchecked by default. You can submit your normal care request without agreeing."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i,{htmlFor:"insurance",children:"Insurance Carrier (optional)"}),e.jsx(c,{id:"insurance",value:a.insuranceCarrier,onChange:t=>n("insuranceCarrier",t.target.value),placeholder:"e.g. Delta Dental","data-testid":"input-insurance"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i,{htmlFor:"preferredDate",children:"Preferred Date (optional)"}),e.jsx(c,{id:"preferredDate",type:"date",value:a.preferredDate,onChange:t=>n("preferredDate",t.target.value),"data-testid":"input-preferred-date"})]})]}),s==="cosmetic"&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i,{htmlFor:"budget",children:"Budget Range (optional)"}),e.jsxs(p,{value:a.budgetRange,onValueChange:t=>n("budgetRange",t),children:[e.jsx(x,{id:"budget","data-testid":"select-budget",children:e.jsx(g,{placeholder:"Select your budget range"})}),e.jsx(b,{children:z.map(t=>e.jsx(j,{value:t,children:t},t))})]})]}),v&&e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-destructive/10 border border-destructive/30","data-testid":"text-submit-error",children:[e.jsx(q,{className:"h-4 w-4 text-destructive mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-sm text-destructive",children:v})]}),e.jsx(Y,{type:"submit",size:"lg",className:"w-full",disabled:h.isPending||!a.name||!a.email||!a.phone||!a.description||!a.city||!a.stateCode||!m,"data-testid":"button-submit-request",children:h.isPending?"Sending your request...":s==="emergency"?"Find Me an Emergency Dentist Now":"Request Quotes from Dental Practices"}),e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"Without the optional Michigan pilot consent, your request follows our normal request process. We do not guarantee a response or appointment."})]})})]})]})})})}export{me 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.