1import{r as a,j as e,L as u}from"./vendor-react-C4iIr9VY.js";import{v as i,q as h,s as b}from"./index-kHtHjOA-.js";import{u as m}from"./useTranslation-DR1iUt77.js";import{Y as k,a5 as j,A as g,a0 as F,bn as v,x as S,n as f,aO as w}from"./vendor-ui-BIa5-Y2I.js";import"./vite-helpers-DruY0qtP.js";import"./vendor-radix-CnhWmudt.js";import"./vendor-charts-aeXF43mk.js";import"./vendor-three-D9hZJzWX.js";function z(){a.useEffect(()=>{if(document.getElementById("kyour-hanken"))return;const n=document.createElement("link");n.id="kyour-hanken",n.rel="stylesheet",n.href="https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&display=swap",document.head.appendChild(n)},[])}const C=new Set(["www","app","platform","admin","staff","api","docs","status","blog","mail","help","support","auth","signin","login","signup","onboarding"]);function x(n,l){if(!n)return null;let r=n.trim().toLowerCase();return!r||(r=r.replace(/^https?:\/\//,"").replace(/\/.*$/,"").trim(),!r)?null:r.includes(".")?/^[a-z0-9-]+(\.[a-z0-9-]+)+$/.test(r)?{url:`https://${r}/`,display:r}:{error:l("publicPages.findClinic.errInvalidUrl",`That doesn't look like a valid URL. Try something like "clinic.kyour.ai" or your clinic's own domain.`)}:/^[a-z0-9](?:[a-z0-9-]{1,28}[a-z0-9])$/.test(r)?C.has(r)?{error:l("publicPages.findClinic.errReserved","That is a reserved name. Please enter your clinic's actual subdomain.")}:{url:`https://${r}.kyour.ai/`,display:`${r}.kyour.ai`}:{error:l("publicPages.findClinic.errInvalidName","That doesn't look like a valid clinic name. Use lowercase letters, numbers and dashes only.")}}function A(){const{t:n}=m();z();
1const[l,r]=a.useState(""),[t,o]=a.useState(""),[d,p]=a.useState(null);a.useEffect(()=>{const c=setTimeout(()=>{if(!l.trim()){p(null),o("");return}const s=x(l,n);s?.error?(o(s.error),p(null)):s?.url?(o(""),p(s)):(o(""),p(null))},180);return()=>clearTimeout(c)},[l,n]);const y=c=>{c?.preventDefault?.();const s=x(l,n);if(s?.error){o(s.error);return}if(s?.url){window.location.href=s.url;return}o(n("publicPages.findClinic.errTypeUrl","Type your clinic's portal URL or subdomain to continue."))};return e.jsxs("div",{style:{background:i.mist,color:i.ink,fontFamily:i.fontSans,minHeight:"100vh",display:"flex",flexDirection:"column"},children:[e.jsx("header",{style:{background:"rgba(255,255,255,0.85)",backdropFilter:"blur(14px)",borderBottom:`1px solid ${i.line}`,padding:"14px 28px"},children:e.jsxs("div",{style:{maxWidth:1100,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(u,{to:"/",style:{textDecoration:"none"},children:e.jsx(h,{tileSize:28,wordmarkSize:18,tone:"ink"})}),e.jsxs(u,{to:"/auth",style:{fontSize:13,fontWeight:600,color:i.tealD,textDecoration:"none"},children:[n("publicPages.findClinic.imClinicStaff","I'm a clinic / staff")," â"]})]})}),e.jsxs("section",{style:{position:"relative",overflow:"hidden",background:i.gradient,color:"#FFFFFF",padding:"56px 28px"},children:[e.jsx("div",{"aria-hidden":!0,style:{position:"absolute",top:"-20%",left:"-10%",width:380,height:380,borderRadius:"50%",background:"radial-gradient(circle, rgba(52,214,214,0.45), transparent 60%)",filter:"blur(24px)"}}),e.jsx("div",{"aria-hidden":!0,style:{position:"absolute",bottom:"-30%",right:"-10%",width:420,height:420,borderRadius:"50%",background:"radial-gradient(circle, rgba(52,211,153,0.4), transparent 60%)",filter:"blur(28px)"}}),e.jsxs("div",{style:{position:"relative",maxWidth:820,margin:"0 auto",textAlign:"center"},children:[e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,padding:"5px 12px",borderRadius:999,background:"rgba(255,255,255,0.18)",backdropFilter:"blur(8px)",fontSize:11.5,fontWeight:600,letterSpacing:.4,marginBottom:16},children:[e.jsx(k,{size:12})," ",n("publicPages.findClinic.patientAccess","Patient access")]}),e.jsx("h1",{style:{fontSize:"clamp(30px, 4.6vw, 44px)",lineHeight:1.1,fontWeight:800,letterSpacing:"-0.03em",margin:"0 0 12px"},children:n("publicPages.findClinic.heroTitle","Going to your clinic's portal.")}),e.jsx("p",{style:{fontSize:15.5,lineHeight:1.55,opacity:.92,maxWidth:620,margin:"0 auto"},children:n("publicPages.findClinic.heroSub","Your medical records, appointments and treatment plans live with the clinic that cares for you â not on Kyour itself. Enter your clinic's portal address and we'll take you straight there.")})]})]}),e.jsx("main",{style:{flex:1,padding:"48px 28px 64px"},children:e.jsxs("div",{style:{maxWidth:640,margin:"0 auto"},children:[e.jsxs("form",{onSubmit:y,style:{background:"#FFFFFF",border:`1px solid ${i.line}`,borderRadius:14,padding:26,boxShadow:i.shadowMd},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:14},children:[e.jsx("span",{style:{width:32,height:32,borderRadius:8,background:i.mist2,color:i.teal,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(j,{size:16})}),e.jsx("h2",{style:{fontSize:16,fontWeight:700,color:i.ink,margin:0,letterSpacing:"-0.005em"},children:n("publicPages.findClinic.knowAddress","I know my clinic's portal address")})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,background:i.mist,border:`1px solid ${i.line}`,borderRadius:10,padding:"4px 4px 4px 14px"},children:[e.jsx("input",{autoFocus:!0,value:l,onChange:c=>r(c.target.value),placeholder:n("publicPages.findClinic.inputPlaceholder","e.g. yourclinic.kyour.ai or yourclinic.com"),style:{flex:1,border:"none",outline:"none",fontSize:15,padding:"12px 0",color:i.ink,background:"transparent",fontFamily:"inherit"}}),e.jsxs("button",{type:"submit",style:{display:"inline-flex",alignItems:"center",gap:6,padding:"10px 16px",borderRadius:8,border:"none",background:i.gradient,color:"#FFFFFF",fontSize:13.5,fontWeight:700,cursor:"pointer",fontFamily:"inherit"},children:[n("publicPages.findClinic.go","Go")," ",e.jsx(g,{size:14})]})]}),d&&!t&&e.jsxs("div",{style:{marginTop:10,fontSize:12.5,color:i.slate},children:[n("publicPages.findClinic.goingTo","Going to")," ",e.jsx("strong",{style:{color:i.tealD},children:d.display})]}),t&&e.jsxs("div",{style:{marginTop:10,display:"flex",alignItems:"center",gap:6,fontSize:12.5,color:"#B91C1C"},children:[e.jsx(F,{size:13})," ",t]}),e.jsxs("p",{style:{marginTop:14,fontSize:12,color:i.slate,lineHeight:1.5},children:[n("publicPages.findClinic.tipBefore","Tip â your clinic's portal address usually ends in")," ",e.jsx("code",{style:{background:i.mist2,padding:"1px 6px",borderRadius:4,fontSize:11.5},children:".kyour.ai"})," ",n("publicPages.findClinic.tipAfter","or sits on the clinic's own domain. Front desk can give it to you if you're not sure.")]})]}),e.jsxs("div",{style:{marginTop:18,background:"#FFFFFF",border:`1px solid ${i.line}`,borderRadius:14,padding:22,display:"flex",alignItems:"center",gap:14,flexWrap:"wrap"},children:[e.jsx("span",{style:{width:38,height:38,borderRadius:10,background:i.mist2,color:i.teal,dis
1play:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(v,{size:18})}),e.jsxs("div",{style:{flex:1,minWidth:200},children:[e.jsx("div",{style:{fontSize:14.5,fontWeight:700,color:i.ink,letterSpacing:"-0.005em"},children:n("publicPages.findClinic.haveAccount","I have a Kyour account")}),e.jsx("div",{style:{fontSize:12.5,color:i.ink2,marginTop:2},children:n("publicPages.findClinic.haveAccountSub","Sign in with email, Google or Apple â we'll show you where your records live.")})]}),e.jsxs(u,{to:"/auth",style:{display:"inline-flex",alignItems:"center",gap:6,padding:"9px 16px",borderRadius:9,background:i.ink,color:"#FFFFFF",fontSize:13,fontWeight:700,textDecoration:"none",flexShrink:0},children:[n("publicPages.findClinic.signIn","Sign in")," ",e.jsx(g,{size:13})]})]}),e.jsx(I,{}),e.jsxs("div",{style:{marginTop:18,background:i.mist2,border:`1px dashed ${i.line}`,borderRadius:14,padding:22,display:"flex",alignItems:"flex-start",gap:14,flexWrap:"wrap"},children:[e.jsx("span",{style:{width:38,height:38,borderRadius:10,background:"#FFFFFF",color:i.teal,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(S,{size:18})}),e.jsxs("div",{style:{flex:1,minWidth:200},children:[e.jsx("div",{style:{fontSize:14,fontWeight:700,color:i.ink,letterSpacing:"-0.005em"},children:n("publicPages.findClinic.stillStuck","Still stuck?")}),e.jsx("div",{style:{fontSize:12.5,color:i.ink2,marginTop:4,lineHeight:1.55},children:n("publicPages.findClinic.stillStuckSub","Kyour only lists clinics that have opted in. If yours isn't here, ask them for their portal link, or drop us a note and we'll help you reach them.")}),e.jsx("a",{href:"mailto:[email protected]",style:{display:"inline-block",marginTop:8,fontSize:13,fontWeight:600,color:i.tealD,textDecoration:"none"},children:"[email protected] â"})]})]})]})}),e.jsx("footer",{style:{background:i.ink,color:"rgba(255,255,255,0.7)",padding:"20px 28px"},children:e.jsxs("div",{style:{maxWidth:1100,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[e.jsx(h,{tileSize:24,wordmarkSize:15,tone:"white"}),e.jsx("div",{style:{fontSize:11.5},children:n("publicPages.findClinic.copyright","© {{year}} Kyour â an aiHealth company.",{year:new Date().getFullYear()})})]})})]})}function I(){const{t:n}=m(),[l,r]=a.useState(null);return a.useEffect(()=>{let t=!1;return b.rpc("public_list_discoverable_clinics").then(({data:o,error:d})=>{if(!t){if(d){console.warn("[find-clinic] directory load failed",d),r([]);return}r(o||[])}}),()=>{t=!0}},[]),l==null||l.length===0?null:e.jsxs("div",{style:{marginTop:18,background:"#FFFFFF",border:`1px solid ${i.line}`,borderRadius:14,padding:22},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:14},children:[e.jsx("span",{style:{width:32,height:32,borderRadius:8,background:i.mist2,color:i.teal,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(f,{size:16})}),e.jsx("h2",{style:{fontSize:16,fontWeight:700,color:i.ink,margin:0,letterSpacing:"-0.005em"},children:n("publicPages.findClinic.directoryHeading","Or pick a clinic that opted in")})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:10},children:l.map(t=>{const o=t.custom_domain?"https://"+t.custom_domain:t.kyour_subdomain?"https://"+t.kyour_subdomain+".kyour.ai":"/";return e.jsxs("a",{href:o,style:{display:"flex",alignItems:"center",gap:10,padding:12,borderRadius:10,border:`1px solid ${i.line}`,background:i.mist,textDecoration:"none"},children:[e.jsx("div",{style:{width:38,height:38,borderRadius:9,background:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",flexShrink:0,border:`1px solid ${i.line}`},children:t.logo_url?e.jsx("img",{src:t.logo_url,alt:t.name,style:{maxWidth:"85%",maxHeight:"85%",objectFit:"contain"}}):e.jsx(f,{size:18,color:t.primary_color_hex||i.teal})}),e.jsxs("div",{style:{minWidth:0,flex:1},children:[e.jsx("div",{style:{fontSize:13,fontWeight:700,color:i.ink,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.name}),(t.city||t.country)&&e.jsxs("div",{style:{fontSize:11.5,color:i.slate,display:"flex",alignItems:"center",gap:3,marginTop:2},children:[e.jsx(w,{size:10}
1)," ",[t.city,t.country].filter(Boolean).join(", ")]})]}),e.jsx(g,{size:14,color:i.slate})]},t.clinic_id)})})]})}export{A 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.