PageSourceSearch

https://naturomedica.com/assets/navigator-D7CZGrBL.js

js naturomedica.com collected 2026-10-08 17:06:06 UTC 18,395 bytes, 1 lines download raw bytes

1import{r as s,T as k,av as T,bv as v,Y as w,W as z,s as P,e as C,w as D,b as A,j as e,c9 as O,S as E,A as M,C as $,F as G,f as N,at as Q,L as W}from"./index-Btyzx7UT.js";import{S as Y}from"./sun-DRShrT-9.js";const y=[{text:"Why am I always tired?",icon:k,category:"energy"},{text:"How can I reduce inflammation?",icon:T,category:"inflammation"},{text:"What supplements actually work?",icon:v,category:"supplements"},{text:"How do I improve my gut health?",icon:w,category:"gut"},{text:"Can I boost my brain performance?",icon:z,category:"brain"},{text:"What's causing my brain fog?",icon:z,category:"brain"},{text:"How do I balance my hormones?",icon:Y,category:"hormones"},{text:"Is my immune system strong enough?",icon:P,category:"immune"},{text:"How can I sleep better naturally?",icon:k,category:"sleep"},{text:"What foods fight disease?",icon:v,category:"nutrition"},{text:"How do I manage stress naturally?",icon:C,category:"stress"},{text:"Why does my stomach hurt after eating?",icon:w,category:"gut"}],q=["Fatigue / Low Energy","Brain Fog","Poor Sleep","Digestive Issues","Joint Pain","Stress / Anxiety","Weight Management","Hormonal Imbalance","Immune Support","Inflammation","Skin Health","Heart Health"],_=["More energy throughout the day","Better sleep quality","Sharper mental clarity","Reduced inflammation","Stronger immune system","Better digestion","Hormone balance","Stress resilience","Healthy weight","Longevity & vitality"];function J(){const[h,x]=s.useState("search"),[d,u]=s.useState(""),[m,R]=s.useState(0),[i,r]=s.useState({topConcerns:[],specificDescription:"",age:"",sex:"",energyLevel:"",sleepQuality:"",digestiveHealth:"",stressLevel:"",currentSupplements:"",goals:[]}),[c,b]=s.useState(null),[p,l]=s.useState(0),I=s.useRef(null);s.useEffect(()=>{const t=setInterval(()=>{R(o=>(o+1)%y.length)},3500);return()=>clearInterval(t)},[]);const g=D({mutationFn:async t=>(await A("POST","/api/naturologie/navigator/analyze",t)).json(),onSuccess:t=>{b(t),x("results")}}),j=t=>{u(t),r(o=>({...o,specificDescription:t})),x("intake")},S=()=>{d.trim()&&(r(t=>({...t,specificDescription:t.specificDescription||d.trim()})),x("intake"))},B=()=>{g.mutate({query:d||i.specificDescription,intake:i})},F=t=>{r(o=>({...o,topConcerns:o.topConcerns.includes(t)?o.topConcerns.filter(n=>n!==t):o.topConcerns.length<5?[...o.topConcerns,t]:o.topConcerns}))},H=t=>{r(o=>({...o,goals:o.goals.includes(t)?o.goals.filter(n=>n!==t):o.goals.length<4?[...o.goals,t]:o.goals}))},f=i.specificDescription.trim().length>0;return e.jsxs("div",{style:{minHeight:"100vh",background:"linear-gradient(180deg, #faf8f2 0%, #fff 40%)"},children:[e.jsxs("section",{style:{textAlign:"center",padding:"60px 20px 20px"},"data-testid":"navigator-hero",children:[e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,background:"#f5f0e4",borderRadius:20,padding:"6px 16px",marginBottom:20},children:[e.jsx(O,{size:16,style:{color:"#b08c30"}}),e.jsx("span",{style:{fontSize:"0.8rem",fontWeight:600,color:"#b08c30",letterSpacing:"0.05em",textTransform:"uppercase"},children:"Wellness Navigator"})]}),e.jsx("h1",{style:{fontFamily:"var(--nat-font-display, 'Playfair Display', serif)",fontSize:"clamp(2rem, 5vw, 3.2rem)",fontWeight:700,color:"#1a1a1a",marginBottom:12,lineHeight:1.15},children:"Sick of Being Sick?"}),e.jsx("p",{style:{fontSize:"1.1rem",color:"#666",maxWidth:560,margin:"0 auto 32px",lineHeight:1.6},children:"Tell us what's going on and get personalized guidance backed by clinical expertise."})]}),h==="search"&&e.jsxs("section",{style:{maxWidth:640,margin:"0 auto",padding:"0 20px 40px"},"data-testid":"navigator-search",children:[e.jsxs("div",{style:{position:"relative",marginBottom:28},children:[e.jsx(E,{size:20,style:{position:"absolute",left:16,top:"50%",transform:"translateY(-50%)",color:"#b08c30"}}),e.jsx("input",{ref:I,type:"text",value:d,onChange:t=>u(t.target.value),onKeyDown:t=>t.key==="Enter"&&S(),placeholder:"What's on your mind? Ask any health question...",style:{width:"100%",padding:"16px 56px 16px 48px",fontSize:"1.05rem",border:"2px solid #e8e0d0",borderRadius:14,outline:"none",fontFamily:"inherit",background:"#fff",boxShadow:"0 4px 16px rgba(176,140,48,0.08)"},"data-testid":"input-health-search"}),d&&e.jsxs("button",{onClick:S,style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",background:"#b08c30",color:"#fff",border:"none",borderRadius:10,padding:"10px 16px",cursor:"pointer",display:"flex",alignItems:"center",gap:6,fontWeight:600,fontSize:"0.9rem"},"data-testid":"button-search-go",children:[e.jsx(M,{size:16})," Go"]})]}),e.jsx("div",{style:{textAlign:"center",marginBottom:20},children:e.jsx("p",{style:{fontSize:"0.82rem",color:"#999",marginBottom:12},children:"Or explore a topic:"})}),e.jsx("div",{style:{position:"relative",overflow:"hidden",height:56,marginBottom:24},children:y.map((t,o)=>{const n=t.icon;return e.jsxs("button",{onClick:()=>j(t.text),style:{position:"absolute",width:"100%",left:0,display:"flex",alignItems:"center",gap:12,padding:"14px 18px",border:"1px solid #e8e0d0",borderRadius:12,background:"#fff",cursor:"pointer",fontSize:"0.95rem",color:"#333",fontFamily:"inherit",transition:"all 0.5s ease",opacity:o===m?1:0,transform:o===m?"translateY(0)":"translateY(20px)",pointerEvents:o===m?"auto":"none"},"data-testid":`button-topic-${o}`,children:[e.jsx(n,{size:18,style:{color:"#b08c30",flexShrink:0}}),e.jsx("span",{style:{flex:1,textAlign:"left"},children:t.text}),e.jsx($,{size:16,style:{color:"#ccc"}})]},t.text)})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,justifyContent:"center"},children:y.slice(0,6).map((t,o)=>e.jsx("button",{onClick:()=>j(t.text),style:{padding:"8px 14px",border:"1px solid #e8e0d0",borderRadius:20,background:"#faf8f2",cursor:"pointer",fontSize:"0.78rem",color:"#666",fontFamily:"inherit"},"data-testid":`chip-topic-${o}`,children:t.text},o))})]}),h==="intake"&&e.jsx("section",{style:{maxWidth:640,margin:"0 auto",padding:"0 20px 60px"},"data-testid":"navigator-intake",children:e.jsxs("div",{style:{background:"#fff",borderRadius:16,border:"1px solid #e8e0d0",padding:"28px",boxShadow:"0 4px 20px rgba(0,0,0,0.04)"},children:[e.jsx("div",{style:{display:"flex",gap:4,marginBottom:24},children:[0,1,2,3].map(t=>e.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:t<=p?"#b08c30":"#e8e0d0",transition:"background 0.3s"}},t))}),p===0&&e.jsxs("div",{children:[e.jsx("h3",{style:{fontSize:"1.1rem",fontWeight:600,color:"#1a1a1a",marginBottom:6},children:"Tell us what's going on"}),e.jsx("p",{style:{fontSize:"0.82rem",color:"#999",marginBottom:16},children:"Describe your symptoms, concerns, or questions in your own words. The more specific you are, the better we can help."}),e.jsx("textarea",{value:i.specificDescription,onChange:t=>r(o=>({...o,specificDescription:t.target.value})),placeholder:"e.g., I have sores on my back and scalp that won't go away. My knees ache every morning and I can't get through the afternoon without coffee...",rows:4,autoF
1ocus:!0,style:{width:"100%",padding:"12px 14px",border:"2px solid #e8e0d0",borderRadius:10,fontSize:"0.95rem",fontFamily:"inherit",resize:"vertical",boxSizing:"border-box",lineHeight:1.6},"data-testid":"textarea-specific-description"}),e.jsx("p",{style:{fontSize:"0.75rem",color:"#b08c30",marginTop:6,fontWeight:500},children:"Your exact words are what the AI uses to build your plan — don't hold back."}),e.jsxs("div",{style:{marginTop:20,padding:"14px",background:"#f8f6f0",borderRadius:10,border:"1px solid #e8e0d0"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx(G,{size:16,style:{color:"#b08c30"}}),e.jsx("span",{style:{fontSize:"0.82rem",fontWeight:600,color:"#555"},children:"Have medical records?"})]}),e.jsx("p",{style:{fontSize:"0.78rem",color:"#888",marginBottom:6},children:"Upload your EHR for even more personalized recommendations."}),e.jsx("a",{href:"https://liteehr.com",target:"_blank",rel:"noopener noreferrer",style:{fontSize:"0.82rem",color:"#b08c30",fontWeight:600,textDecoration:"none"},"data-testid":"link-ehr-upload",children:"Upload via LiteEHR.com →"})]}),e.jsx("button",{onClick:()=>f&&l(1),disabled:!f,style:{marginTop:16,width:"100%",padding:"12px",background:f?"#b08c30":"#ddd",color:"#fff",border:"none",borderRadius:10,fontWeight:600,fontSize:"0.95rem",cursor:f?"pointer":"default",fontFamily:"inherit"},"data-testid":"button-intake-next-0",children:"Continue"})]}),p===1&&e.jsxs("div",{children:[e.jsx("h3",{style:{fontSize:"1.1rem",fontWeight:600,color:"#1a1a1a",marginBottom:16},children:"Tell us about yourself"}),e.jsxs("div",{style:{display:"grid",gap:14},children:[e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:"0.82rem",fontWeight:600,color:"#555",display:"block",marginBottom:4},children:"Age Range"}),e.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:["18-29","30-39","40-49","50-59","60+"].map(t=>e.jsx("button",{onClick:()=>r(o=>({...o,age:t})),style:{padding:"8px 16px",borderRadius:8,border:i.age===t?"2px solid #b08c30":"1px solid #ddd",background:i.age===t?"#faf5e8":"#fff",color:i.age===t?"#b08c30":"#555",cursor:"pointer",fontSize:"0.85rem",fontWeight:i.age===t?600:400,fontFamily:"inherit"},"data-testid":`button-age-${t}`,children:t},t))})]}),e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:"0.82rem",fontWeight:600,color:"#555",display:"block",marginBottom:4},children:"Biological Sex"}),e.jsx("div",{style:{display:"flex",gap:8},children:["Female","Male","Prefer not to say"].map(t=>e.jsx("button",{onClick:()=>r(o=>({...o,sex:t})),style:{padding:"8px 16px",borderRadius:8,border:i.sex===t?"2px solid #b08c30":"1px solid #ddd",background:i.sex===t?"#faf5e8":"#fff",color:i.sex===t?"#b08c30":"#555",cursor:"pointer",fontSize:"0.85rem",fontWeight:i.sex===t?600:400,fontFamily:"inherit"},"data-testid":`button-sex-${t.toLowerCase().replace(/\s+/g,"-")}`,children:t},t))})]})]}),e.jsxs("div",{style:{display:"flex",gap:10,marginTop:20},children:[e.jsx("button",{onClick:()=>l(0),style:{flex:1,padding:"12px",background:"#f5f5f5",color:"#555",border:"none",borderRadius:10,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},"data-testid":"button-intake-back-1",children:"Back"}),e.jsx("button",{onClick:()=>i.age&&i.sex&&l(2),disabled:!i.age||!i.sex,style:{flex:2,padding:"12px",background:i.age&&i.sex?"#b08c30":"#ddd",color:"#fff",border:"none",borderRadius:10,fontWeight:600,cursor:i.age&&i.sex?"pointer":"default",fontFamily:"inherit"},"data-testid":"button-intake-next-1",children:"Continue"})]})]}),p===2&&e.jsxs("div",{children:[e.jsx("h3",{style:{fontSize:"1.1rem",fontWeight:600,color:"#1a1a1a",marginBottom:16},children:"Quick health snapshot"}),e.jsxs("div",{style:{display:"grid",gap:16},children:[[{label:"Energy Level",key:"energyLevel",options:["Very Low","Low","Moderate","Good","Great"]},{label:"Sleep Quality",key:"sleepQuality",options:["Poor","Fair","Okay","Good","Excellent"]},{label:"Digestive Health",key:"digestiveHealth",options:["Struggling","Not great","Okay","Good","Great"]},{label:"Stress Level",key:"stressLevel",options:["Overwhelming","High","Moderate","Manageable","Low"]}].map(({label:t,key:o,options:n})=>e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:"0.82rem",fontWeight:600,color:"#555",display:"block",marginBottom:6},children:t}),e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:n.map(a=>e.jsx("button",{onClick:()=>r(L=>({...L,[o]:a})),style:{padding:"6px 12px",borderRadius:8,border:i[o]===a?"2px solid #b08c30":"1px solid #ddd",background:i[o]===a?"#faf5e8":"#fff",color:i[o]===a?"#b08c30":"#555",cursor:"pointer",fontSize:"0.8rem",fontWeight:i[o]===a?600:400,fontFamily:"inherit"},"data-testid":`button-${o}-${a.toLowerCase().replace(/\s+/g,"-")}`,children:a},a))})]},o)),e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:"0.82rem",fontWeight:600,color:"#555",display:"block",marginBottom:4},children:"Current supplements (optional)"}),e.jsx("input",{type:"text",value:i.currentSupplements,onChange:t=>r(o=>({...o,currentSupplements:t.target.value})),placeholder:"e.g., Vitamin D, Magnesium, Fish Oil...",style:{width:"100%",padding:"10px 14px",border:"1px solid #ddd",borderRadius:8,fontSize:"0.9rem",fontFamily:"inherit",boxSizing:"border-box"},"data-testid":"input-supplements"})]})]}),e.jsxs("div",{style:{marginTop:20},children:[e.jsx("label",{style:{fontSize:"0.82rem",fontWeight:600,color:"#555",display:"block",marginBottom:8},children:"Any specific health areas? (optional)"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:q.map(t=>e.jsx("button",{onClick:()=>F(t),style:{padding:"6px 12px",borderRadius:16,fontSize:"0.78rem",border:i.topConcerns.includes(t)?"2px solid #b08c30":"1px solid #ddd",background:i.topConcerns.includes(t)?"#faf5e8":"#fff",color:i.topConcerns.includes(t)?"#b08c30":"#666",cursor:"pointer",fontWeight:i.topConcerns.includes(t)?600:400,fontFamily:"inherit"},"data-testid":`chip-concern-${t.toLowerCase().replace(/\s+/g,"-")}`,children:t},t))})]}),e.jsxs("div",{style:{display:"flex",gap:10,marginTop:20},children:[e.jsx("button",{onClick:()=>l(1),style:{flex:1,padding:"12px",background:"#f5f5f5",color:"#555",border:"none",borderRadius:10,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},"data-testid":"button-intake-back-2",children:"Back"}),e.jsx("button",{onClick:()=>l(3),style:{flex:2,padding:"12px",background:"#b08c30",color:"#fff",border:"none",borderRadius:10,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},"data-testid":"button-intake-next-2",children:"Continue"})]})]}),p===3&&e.jsxs("div",{children:[e.jsx("h3",{style:{fontSize:"1.1rem",fontWeight:600,color:"#1a1a1a",marginBottom:6},children:"What are your wellness goals?"}),e.jsx("p",{style:{fontSize:"0.82rem",color:"#999",marginBottom:16},children:"Select up to 4 (optional — skip if you just want help with your symptoms)"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:_.map(t=>e.jsx("button",{onClick:()=>H(t),style:{padding:"8px 14px",borderRadius:20,fontSize:"0.85rem",border:i.goals.includes(t)?"2px solid #b08c30":"1px solid #ddd",background:i.goals.includes(t)?"#faf5e8":"#fff",color:i.goals.includes(t)?"#b08c30":"#555",cursor:"pointer",fontWeight:i.goals.includes(t)?600:400,fontFamily:"inherit"},"data-testid":`chip-goal-${t.toLowerCase().replace(/\s+/g,"-")}`,children:t},t))}),e.jsxs("div",{style:{display:"flex",gap:10,marginTop:20},children:[e.jsx("button",{onClick:()=>l(2),style:{flex:1,padding:"12px",background:"#f5f5f5",color:"#555",border:"none",borderRadius:10,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},"data-testid":"button-intake-back-3",children:"Back"}),e.jsx("button",{onClick:B,disabled:g.isPending,style:{flex:2,padding:"12px",background:"#b08c30",color:"#fff",border:"none",borderRadius:10,fontWeight:600,cursor:g.isPending?"wait":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:8,fontFamily:"inherit"},"data-testid":"button-get-results",children:g.isPending?e.jsxs(e.Fragment,{children:[e.jsx(N,{size:16,className:"animate-spin"})," Analyzing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(C,{size:16})," Get My Wellness Plan"]})})]}),g.isError&&e.jsx("p",{style:{marginTop:10,fontSize:"0.82rem",color:"#dc2626",textAlign:"center"},"data-testid":"text-analysis-error",children:"Something went wrong generating your plan. Please try again."})]})]})}),h==="results"&&c&&e.jsx("section",{style:{maxWidth:720,margin:"0 auto",padding:"0 20px 60px"},"data-testid":"navigator-results",children:e.jsxs("div",{style:{background:"#fff",borderRadius:16,border:"1px solid #e8e0d0",overflow:"hidden",boxShadow:"0 4px 20px rgba(0,0,0,0.04)"},children:[e.jsxs("div",{style:{background:"linear-gradient(135deg, #b08c30 0%, #d4a843 100%)",padding:"24px 28px",color:"#fff"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[e.jsx(Q,{size:22}),e.jsx("h2",{style:{fontSize:"1.2rem",fontWeight:700,margin:0},children:"Your Personalized Wellness Plan"})]}),e.jsx("p",{style:{fontSize:"0.88rem",opacity:.9,margin:0},children:"Based on your health profile and concerns"})]}),c.summary&&e.jsx("div",{style:{padding:"20px 28px",borderBottom:"1px solid #f0ece0"},children:e.jsx("p",{style:{fontSize:"0.95rem",color:"#444",lineHeight:1.7},children:c.summary})}),c.recommendations?.map((t,o)=>e.jsx("div",{style:{padding:"18px 28px",borderBottom:o<c.recommendations.length-1?"1px solid #f0ece0":"none"},"data-testid":`recommendation-${o}`,children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",ga
1p:12},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:8,background:"#faf5e8",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:2},children:e.jsx("span",{style:{fontSize:"0.85rem",fontWeight:700,color:"#b08c30"},children:o+1})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("h4",{style:{fontSize:"0.95rem",fontWeight:600,color:"#1a1a1a",marginBottom:4},children:t.title}),e.jsx("p",{style:{fontSize:"0.85rem",color:"#666",lineHeight:1.6,margin:0},children:t.description}),t.products&&t.products.length>0&&e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:10},children:t.products.map((n,a)=>e.jsxs(W,{href:`/product/${n.handle}`,style:{padding:"6px 12px",background:"#f8f6f0",border:"1px solid #e8e0d0",borderRadius:8,fontSize:"0.78rem",color:"#b08c30",fontWeight:600,textDecoration:"none"},"data-testid":`link-product-${n.handle}`,children:[n.title," →"]},a))})]})]})},o)),e.jsxs("div",{style:{padding:"20px 28px",background:"#f8f6f0",display:"flex",gap:12,flexWrap:"wrap"},children:[e.jsx("button",{onClick:()=>{x("search"),b(null),l(0),r({topConcerns:[],specificDescription:"",age:"",sex:"",energyLevel:"",sleepQuality:"",digestiveHealth:"",stressLevel:"",currentSupplements:"",goals:[]}),u("")},style:{padding:"10px 20px",background:"#fff",border:"1px solid #e8e0d0",borderRadius:10,cursor:"pointer",fontSize:"0.85rem",fontWeight:600,color:"#555",fontFamily:"inherit"},"data-testid":"button-start-over",children:"Start Over"}),e.jsx(W,{href:"/shop",style:{padding:"10px 20px",background:"#b08c30",border:"none",borderRadius:10,fontSize:"0.85rem",fontWeight:600,color:"#fff",textDecoration:"none",display:"inline-flex",alignItems:"center",gap:6},"data-testid":"link-shop-now",children:"Shop Recommended Products →"})]})]})})]})}export{J 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.