PageSourceSearch

https://naturomedica.com/assets/companion-Ds0EetwB.js

js naturomedica.com collected 2026-10-08 17:07:54 UTC 20,002 bytes, 1 lines download raw bytes

1import{u as Ce,r as i,d as te,w as B,b as K,x as ee,j as e}from"./index-Btyzx7UT.js";/* empty css              */const ke={Grace:"/vigil/persona-grace.png",Samuel:"/vigil/persona-samuel.png",Eleanor:"/vigil/persona-eleanor.png",James:"/vigil/persona-james.png",Ruth:"/vigil/persona-ruth.png",David:"/vigil/persona-david.png",Margaret:"/vigil/persona-margaret.png",Thomas:"/vigil/persona-thomas.png",Sarah:"/vigil/persona-sarah.png",Joseph:"/vigil/persona-joseph.png",Miriam:"/vigil/persona-miriam.png",Michael:"/vigil/persona-michael.png",Abigail:"/vigil/persona-abigail.png",William:"/vigil/persona-william.png",Catherine:"/vigil/persona-catherine.png",Daniel:"/vigil/persona-daniel.png"},ue={"warm-elder-f":"#d4956b","wise-elder-m":"#7b8fb5","literary-elder-f":"#9b8ec4","doctor-elder-m":"#6ba38a","grandmother-f":"#c4917e","musician-elder-m":"#b89b5e","professional-elder-f":"#8aa3b5","philosopher-elder-m":"#a39478","caregiver-f":"#d4a06b","storyteller-m":"#8b7e6b","spiritual-elder-f":"#b5a0c4","chaplain-m":"#6b82a3","volunteer-f":"#c4b06b","pastor-elder-m":"#7b6b5e","therapist-f":"#9bb5a3","contemplative-m":"#8b9b8e"};function Re(){return window.location.hostname.toLowerCase().includes("vigil")?"":"/vigil"}function Te({persona:r,size:a=48}){const d=r?ke[r.name]:null;if(!r)return e.jsx("div",{className:"vigil-persona-avatar",style:{width:a,height:a,background:"radial-gradient(circle at 38% 35%, #f0c07a, #c8853a 55%, #7a4a18)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a*.4,color:"rgba(255,255,255,0.9)"},children:"✦"});if(d)return e.jsx("img",{src:d,alt:r.name,className:"vigil-persona-avatar",style:{width:a,height:a,borderRadius:"50%",objectFit:"cover",border:`2px solid ${ue[r.avatarStyle]||"#c8853a"}66`},title:r.name});const s=ue[r.avatarStyle]||"#c8853a";return e.jsx("div",{className:"vigil-persona-avatar",style:{width:a,height:a,background:`radial-gradient(circle at 38% 35%, ${s}cc, ${s} 55%, ${s}88)`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a*.4,fontFamily:"'Cormorant Garamond', serif",fontWeight:700,color:"rgba(255,255,255,0.95)",letterSpacing:"0.02em"},title:r.name,children:r.name[0]})}function Ie(r){const a=window.speechSynthesis?.getVoices()||[];if(!a.length)return null;const s=(r?.gender||"F").toUpperCase().startsWith("F"),g=a.filter(f=>f.lang.startsWith("en"));return g.length?g.filter(f=>{const o=f.name.toLowerCase();return s?o.includes("samantha")||o.includes("karen")||o.includes("female")||o.includes("zira")||o.includes("victoria"):o.includes("daniel")||o.includes("david")||o.includes("male")||o.includes("james")||o.includes("tom")})[0]||g[0]:a[0]}function Ee(r,a){return new Promise(d=>{if(!window.speechSynthesis){d();return}window.speechSynthesis.cancel();const s=new SpeechSynthesisUtterance(r);s.rate=.88,s.pitch=a?.gender?.toUpperCase().startsWith("F")?1.05:.9;const g=Ie(a);g&&(s.voice=g),s.onend=()=>d(),s.onerror=()=>d(),window.speechSynthesis.speak(s)})}function Me({patientId:r,patientName:a}){const[d,s]=i.useState(!1),[g,m]=i.useState(null),{data:f}=te({queryKey:["/api/vigil/patients",r,"documents"],queryFn:async()=>{if(!r)return[];const c=await fetch(`/api/vigil/patients/${r}/documents`,{credentials:"include"});return c.ok?c.json():[]},enabled:!!r}),o=async c=>{try{const R=await fetch(`/api/vigil/documents/${c.id}/url`,{credentials:"include"});if(R.ok){const O=await R.json();O.url&&(m(O.url),s(!0))}}catch{}},S=f||[],D={ehr:"📋",lab:"🧪",imaging:"📷",care_plan:"📝",insurance:"📄",other:"📎"},N={ehr:"Health Record",lab:"Lab Result",imaging:"Imaging",care_plan:"Care Plan",insurance:"Insurance",other:"Document"};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"vigil-companion-docs-panel","data-testid":"companion-docs-panel",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8},children:[e.jsx("div",{style:{fontSize:"0.8rem",fontWeight:600,color:"var(--vigil-midnight)",letterSpacing:"0.04em",textTransform:"uppercase"},children:"Shared Context"}),S.length>0&&e.jsx("span",{style:{fontSize:"0.7rem",color:"var(--vigil-amber)",fontWeight:600},children:S.length})]}),a&&e.jsx("div",{style:{fontSize:"0.8rem",color:"#666",marginBottom:8},"data-testid":"text-patient-context-name",children:a}),S.length===0?e.jsx("div",{style:{fontSize:"0.78rem",color:"#999",fontStyle:"italic",padding:"8px 0"},"data-testid":"text-no-documents",children:"No documents shared yet. Upload files from the Caregiver Hub."}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:S.map(c=>e.jsxs("button",{onClick:()=>o(c),className:"vigil-doc-item","data-testid":`button-doc-${c.id}`,title:c.notes||c.fileName,children:[e.jsx("span",{style:{fontSize:"0.85rem"},children:D[c.category]||"📎"}),e.jsxs("div",{style:{flex:1,minWidth:0,textAlign:"left"},children:[e.jsx("div",{style:{fontSize:"0.78rem",fontWeight:500,color:"var(--vigil-midnight)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.fileName}),e.jsxs("div",{style:{fontSize:"0.68rem",color:"#999"},children:[N[c.category]||c.category,c.fileSize?` · ${(c.fileSize/1024).toFixed(0)}KB`:""]})]})]},c.id))})]}),d&&g&&e.jsx("div",{className:"vigil-doc-drawer-overlay",onClick:()=>{s(!1),m(null)},"data-testid":"doc-drawer-overlay",children:e.jsxs("div",{className:"vigil-doc-drawer",onClick:c=>c.stopPropagation(),"data-testid":"doc-drawer",children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid #e5e1d8"},children:[e.jsx("span",{style:{fontWeight:600,fontSize:"0.9rem",color:"var(--vigil-midnight)"},children:"Document Viewer"}),e.jsx("button",{onClick:()=>{s(!1),m(null)},style:{background:"none",border:"none",cursor:"pointer",fontSize:"1.2rem",color:"#888",padding:4},"data-testid":"button-close-drawer",children:"✕"})]}),e.jsx("div",{style:{flex:1,padding:0,overflow:"hidden"},children:e.jsx("iframe",{src:g,style:{width:"100%",height:"100%",border:"none"},title:"Document Viewer","data-testid":"doc-viewer-iframe"})})]})})]})}function me(r){const a=[/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/,/\[YOUTUBE:([a-zA-Z0-9_-]{11})\]/];for(const d of a){const s=r.match(d);if(s)return s[1]}return null}function Pe({videoId:r,onStop:a}){return e.jsxs("div",{className:"vigil-youtube-embed","data-testid":"youtube-embed",children:[e.jsx("iframe",{src:`https://www.youtube.com/embed/${r}?autoplay=1&rel=0`,allow:"autoplay; encrypted-media",allowFullScreen:!0,style:{width:"100%",aspectRatio:"16/9",border:"none",borderRadius:8},title:"YouTube video","data-testid":"youtube-iframe"}),e.jsx("button",{className:"vigil-btn vigil-btn-small vigil-btn-muted","data-testid":"button-stop-video",onClick:a,style:{marginTop:8},children:"Stop Video"})]})}function Ve(){const[,r]=Ce(),a=Re(),d=new URLSearchParams(window.location.search).get("patient"),[s,g]=i.useState(d?Number(d):null),[m,f]=i.useState(null),[o,S]=i.useState(""),[D,N]=i.useState([]),[c,R]=i.useState(!1),[O,_]=i.useState(null),[b,V]=i.useState("unknown"),[T,ie]=i.useState(!1),[ge,H]=i.useState(""),[I,pe]=i.useState(!0),[he,ne]=i.useState(!1),[U,F]=i.useState(null),[ve,ae]=i.useState(Date.now()),[Y,se]=i.useState(!1),E=i.useRef(null),y=i.useRef(null),re=i.useRef(null),L=i.useRef(null),$=i.useRef(null),p=i.useRef(null),G=i.useRef(null),ce=i.useRef(null),fe=i.useRef(null),h=i.useRef(null),Q=i.useRef(null),x=i.useRef(null);i.useEffect(()=>{p.current=m},[m]),i.useEffect(()=>{ce.current=U},[U]);const v=te({queryKey:["/api/vigil/my-patients"],queryFn:async()=>{const t=await fetch("/api/vigil/my-patients");if(!t.ok){const n=new Error(t.status===401?"Unauthorized":"Failed to fetch patients");throw n.status=t.status,n}return t.json()}}),C=te({queryKey:["/api/vigil/messages",{sessionId:m}],queryFn:async()=>
1{if(!m)return[];const t=await fetch(`/api/vigil/messages?sessionId=${m}`);if(!t.ok)throw new Error("Failed to fetch messages");return t.json()},enabled:!!m}),W=B({mutationFn:async t=>(await K("POST","/api/vigil/sessions",{patientId:t})).json(),onSuccess:t=>{f(t.id),N([]),se(!1)}}),k=v.data?.find(t=>t.id===s),z=k?.persona||null,M=z?.name||"Vigil",j=B({mutationFn:async t=>(await K("POST","/api/vigil/chat",{patientId:s,sessionId:p.current,message:t})).json(),onSuccess:async t=>{N(l=>[...l,{role:"assistant",content:t.content}]),ee.invalidateQueries({queryKey:["/api/vigil/messages",{sessionId:p.current}]}),ee.invalidateQueries({queryKey:["/api/vigil/memories"]}),ee.invalidateQueries({queryKey:["/api/vigil/alerts"]});const n=me(t.content);if(n&&F(n),I&&t.content){ne(!0);const l=t.content.replace(/\[YOUTUBE:[^\]]+\]/g,"").replace(/https?:\/\/\S+/g,"").trim();l&&await Ee(l,z),ne(!1)}}});G.current=t=>j.mutate(t);const be=B({mutationFn:async()=>(await K("PATCH",`/api/vigil/sessions/${p.current}`,{status:"ended"})).json(),onSuccess:()=>{f(null),N([]),le(),J(),F(null),r(`${a}/hub`)}}),ye=B({mutationFn:async t=>(await K("POST","/api/vigil/memories",{patientId:s,sessionId:p.current,type:"manual",title:t.title,content:t.content,capturedBy:"companion"})).json()}),xe=i.useCallback(async()=>{try{_(null);const t=await navigator.mediaDevices.getUserMedia({video:{width:320,height:240},audio:!1});y.current=t,R(!0),V("present"),ae(Date.now())}catch(t){_(t.message||"Camera access denied"),R(!1),V("unknown")}},[]),le=i.useCallback(()=>{y.current&&(y.current.getTracks().forEach(t=>t.stop()),y.current=null),R(!1),V("away"),h.current&&(clearInterval(h.current),h.current=null)},[]),je=i.useCallback(()=>{const t=window.SpeechRecognition||window.webkitSpeechRecognition;if(!t){_("Voice not supported in this browser. Try Chrome or Edge.");return}const n=new t;n.continuous=!0,n.interimResults=!0,n.lang="en-US";let l="";n.onresult=u=>{let q="";for(let w=u.resultIndex;w<u.results.length;w++){const Z=u.results[w][0].transcript;u.results[w].isFinal?(l+=Z+" ",$.current&&clearTimeout($.current),$.current=setTimeout(()=>{const A=l.trim();if(A&&p.current){const P=["stop","pause","stop video","stop the video","pause video"];ce.current&&P.some(X=>A.toLowerCase().includes(X))&&F(null),N(X=>[...X,{role:"user",content:A}]),G.current&&G.current(A)}l="",H("")},2e3)):q=Z}H(l+q)},n.onend=()=>{if(L.current===n)try{n.start()}catch{}},n.onerror=u=>{u.error==="no-speech"||u.error==="aborted"||console.error("[Vigil] Speech recognition error:",u.error)},n.start(),L.current=n,ie(!0)},[]),J=i.useCallback(()=>{if(L.current){const t=L.current;L.current=null;try{t.stop()}catch{}}$.current&&clearTimeout($.current),ie(!1),H("")},[]);i.useEffect(()=>{if(!c||!E.current||!y.current)return;E.current.srcObject=y.current;const t=document.createElement("canvas");t.width=80,t.height=60,fe.current=t;const n=t.getContext("2d",{willReadFrequently:!0});if(n)return h.current=setInterval(()=>{if(!E.current||E.current.readyState<2)return;n.drawImage(E.current,0,0,80,60);const l=n.getImageData(0,0,80,60);if(Q.current){let u=0;const q=Q.current.data,w=l.data;for(let P=0;P<w.length;P+=16)u+=Math.abs(w[P]-q[P]);u/(w.length/16)>8?(V("present"),ae(Date.now()),x.current&&(clearTimeout(x.current),x.current=null)):x.current||(x.current=setTimeout(()=>{V("away"),x.current=null},3e4))}Q.current=l},2e3),()=>{h.current&&(clearInterval(h.current),h.current=null)}},[c]),i.useEffect(()=>{b==="present"&&!Y&&p.current&&Date.now()-ve<5e3},[b]),i.useEffect(()=>{if(b==="present"&&p.current&&!Y){const t=[...(C.data||[]).map(l=>({role:l.role})),...D];if(t.length===0)return;if(t[t.length-1].role==="assistant"){const l=C.data?.length?new Date(C.data[C.data.length-1].createdAt).getTime():Date.now();(Date.now()-l)/6e4>5&&(se(!0),j.mutate("[PRESENCE_RETURNED] The patient has returned after being away. Gently check in and welcome them back."))}}},[b,Y]),i.useEffect(()=>()=>{y.current&&y.current.getTracks().forEach(t=>t.stop()),J(),window.speechSynthesis?.cancel(),h.current&&clearInterval(h.current),x.current&&clearTimeout(x.current)},[]),i.useEffect(()=>{re.current?.scrollIntoView({behavior:"smooth"})},[D,C.data]),i.useEffect(()=>
1{d&&s&&!m&&!W.isPending&&W.mutate(s)},[s]),i.useEffect(()=>{window.speechSynthesis?.getVoices()},[]);const we=t=>{g(t),W.mutate(t)},oe=()=>{const t=o.trim();if(!t||!p.current||j.isPending)return;U&&["stop","pause","stop video","stop the video","pause video"].some(l=>t.toLowerCase().includes(l))&&F(null),N(l=>[...l,{role:"user",content:t}]),S(""),j.mutate(t)},Se=()=>{const t=prompt("Memory title:");if(!t)return;const n=prompt("What happened or what was said?");n&&ye.mutate({title:t,content:n})},de=[...(C.data||[]).map(t=>({role:t.role,content:t.content})),...D.filter(t=>!(C.data||[]).some(n=>n.content===t.content&&n.role===t.role))],Ne=v.error&&(v.error.status===401||v.error.message?.includes("Unauthorized"));return v.error?e.jsx("div",{className:"vigil-page","data-testid":"companion-auth-error",children:e.jsx("div",{className:"vigil-companion-setup",children:e.jsxs("div",{className:"vigil-companion-setup-inner",children:[e.jsx("div",{className:"vigil-companion-icon",children:"✦"}),e.jsx("h1",{"data-testid":"text-companion-title",children:"Vigil Companion"}),Ne?e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{color:"var(--vigil-slate)",marginBottom:"1.5rem"},children:"You need to be signed in to access the companion."}),e.jsx("a",{href:`${a}/login?returnTo=${a}/companion`,className:"vigil-btn vigil-btn-amber","data-testid":"link-admin-login",style:{textDecoration:"none",display:"inline-block"},children:"Sign In"})]}):e.jsx("p",{style:{color:"var(--vigil-slate)",marginBottom:"1.5rem"},"data-testid":"text-error",children:"Something went wrong loading patient data. Please try again."})]})})}):!s||!m?e.jsx("div",{className:"vigil-page","data-testid":"companion-select",children:e.jsx("div",{className:"vigil-companion-setup",children:e.jsxs("div",{className:"vigil-companion-setup-inner",children:[e.jsx("div",{className:"vigil-companion-icon",children:"✦"}),e.jsx("h1",{"data-testid":"text-companion-title",children:"Vigil Companion"}),e.jsx("p",{style:{color:"var(--vigil-slate)"},children:"Select a patient to begin a companion session."}),v.isLoading&&e.jsx("p",{style:{color:"var(--vigil-mist)"},children:"Loading patients..."}),v.data&&v.data.length===0&&e.jsxs("div",{children:[e.jsx("p",{style:{color:"var(--vigil-mist)",marginBottom:"1rem"},children:"No patients registered yet."}),e.jsx("a",{href:`${a}/hub`,className:"vigil-btn vigil-btn-amber","data-testid":"link-go-hub",style:{textDecoration:"none"},children:"Go to Care Circle"})]}),e.jsx("div",{className:"vigil-patient-list","data-testid":"patient-list",children:v.data?.map(t=>e.jsxs("button",{className:"vigil-patient-card","data-testid":`button-select-patient-${t.id}`,onClick:()=>we(t.id),disabled:W.isPending,children:[e.jsx("div",{className:"vigil-patient-card-name",children:t.preferredName||t.name}),e.jsx("div",{className:"vigil-patient-card-detail",children:t.diagnosis||"No diagnosis recorded"}),t.persona&&e.jsxs("div",{className:"vigil-patient-card-detail",style:{color:"var(--vigil-amber)"},children:["Companion: ",t.persona.name]}),e.jsx("div",{className:"vigil-patient-card-status","data-status":t.status,children:t.status})]},t.id))})]})})}):e.jsxs("div",{className:"vigil-page vigil-companion-page","data-testid":"companion-active",children:[e.jsxs("div",{className:"vigil-companion-header","data-testid":"companion-header",children:[e.jsxs("div",{className:"vigil-companion-header-left",children:[e.jsx("div",{className:"vigil-patient-avatar",style:{width:40,height:40,borderRadius:"50%",background:"#1c2340",color:"#c8853a",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:"1rem",flexShrink:0},"data-testid":"patient-avatar",children:(k?.preferredName||k?.name||"?").charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("h2",{"data-testid":"text-patient-name",children:k?.preferredName||k?.name}),e.jsxs("span",{className:"vigil-session-badge","data-status":b,"data-testid":"text-presence-status",children:[b==="present"?"Present":b==="away"?"Away":"Camera Off",z&&e.jsxs("span",{style:{marginLeft:8,opacity:.7},children:["with ",M]})]})]})]}),e.jsxs("div",{className:"vigil-companion-header-actions",children:[e.jsx("button",{className:"vigil-btn vigil-btn-small","data-testid":"button-toggle-camera",onClick:c?le:xe,children:c?"Stop Camera":"Start Camera"}),e.jsx("button",{className:`vigil-btn vigil-btn-small ${T?"vigil-btn-mic-active":""}`,"data-testid":"button-toggle-mic",onClick:T?J:je,children:T?"Mute Mic":"Voice Mode"}),e.jsx("button",{className:`vigil-btn vigil-btn-small ${I?"":"vigil-btn-muted"}`,"data-testid":"button-toggle-tts",onClick:()=>{pe(!I),I&&window.speechSynthesis?.cancel()},title:I?"Voice responses on":"Voice responses off",children:I?"Speaker On":"Speaker Off"}),e.jsx("button",{className:"vigil-btn vigil-btn-small","data-testid":"button-save-memory",onClick:Se,children:"Save Memory"}),e.jsx("button",{className:"vigil-btn vigil-btn-small vigil-btn-muted","data-testid":"button-end-session",onClick:()=>be.mutate(),children:"End Session"})]})]}),e.jsxs("div",{className:"vigil-companion-body",children:[e.jsxs("div",{className:"vigil-companion-sidebar",children:[e.jsxs("div",{className:"vigil-camera-container","data-testid":"camera-container",children:[c?e.jsx("video",{ref:E,autoPlay:!0,muted:!0,playsInl
1ine:!0,className:"vigil-camera-feed","data-testid":"video-camera"}):e.jsx("div",{className:"vigil-camera-placeholder","data-testid":"camera-placeholder",children:O?e.jsx("span",{className:"vigil-camera-error",children:O}):e.jsx("span",{children:"Camera Off"})}),e.jsx("div",{className:"vigil-presence-indicator","data-status":b,"data-testid":"presence-indicator"})]}),e.jsx(Me,{patientId:k?.id,patientName:k?.name})]}),e.jsxs("div",{className:"vigil-chat-area",children:[e.jsxs("div",{className:"vigil-chat-messages","data-testid":"chat-messages",children:[de.length===0&&e.jsxs("div",{className:"vigil-chat-empty","data-testid":"chat-empty",children:[e.jsx(Te,{persona:z,size:64}),e.jsxs("p",{children:[M," is here. Say hello when you're ready."]}),T&&e.jsx("p",{style:{fontSize:"0.8rem",color:"var(--vigil-amber)"},children:"Voice mode active -- just speak naturally"})]}),de.map((t,n)=>{const l=t.role==="assistant"?me(t.content):null,u=t.content.replace(/\[YOUTUBE:[^\]]+\]/g,"").trim();return e.jsxs("div",{className:`vigil-chat-bubble vigil-chat-${t.role}`,"data-testid":`chat-message-${n}`,children:[e.jsx("div",{className:"vigil-chat-role",children:t.role==="user"?"You":M}),e.jsx("div",{className:"vigil-chat-text",children:u}),l&&U===l&&e.jsx(Pe,{videoId:l,onStop:()=>F(null)})]},n)}),j.isPending&&e.jsxs("div",{className:"vigil-chat-bubble vigil-chat-assistant vigil-chat-thinking","data-testid":"chat-thinking",children:[e.jsx("div",{className:"vigil-chat-role",children:M}),e.jsx("div",{className:"vigil-chat-text",children:e.jsxs("span",{className:"vigil-typing-dots",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})})]}),he&&e.jsxs("div",{className:"vigil-speaking-indicator","data-testid":"speaking-indicator",children:[M," is speaking..."]}),e.jsx("div",{ref:re})]}),T&&e.jsxs("div",{className:"vigil-mic-transcript","data-testid":"mic-transcript",style:{minHeight:32},children:[e.jsx("span",{className:"vigil-mic-dot"}),ge||(j.isPending?"Sending to companion...":"Listening... speak naturally")]}),e.jsxs("div",{className:"vigil-chat-input-area","data-testid":"chat-input-area",children:[e.jsx("input",{type:"text",className:"vigil-chat-input","data-testid":"input-chat-message",placeholder:T?"Voice mode active -- or type here...":`Speak with ${M}...`,value:o,onChange:t=>S(t.target.value),onKeyDown:t=>t.key==="Enter"&&!t.shiftKey&&oe(),disabled:j.isPending}),e.jsx("button",{className:"vigil-btn vigil-btn-amber vigil-send-btn","data-testid":"button-send-message",onClick:oe,disabled:j.isPending||!o.trim(),children:"Send"})]})]})]})]})}export{Ve 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.