PageSourceSearch

https://damsdelhi.com/assets/CaseSolution-CWbZ8wFv.js

js damsdelhi.com collected 2026-09-25 18:34:17 UTC 10,724 bytes, 1 lines download raw bytes

1import{a as o,j as t}from"./vendor-react-CIe7BBPp.js";import{u as w,f as k}from"./vendor-redux-LH1zpDpA.js";import{a as C,A as I,h as M}from"./index-B3dWxf7F.js";import{u as P,S as B}from"./vendor-react-speech-recognition-Bc2DnzVc.js";import{P as g}from"./vendor-prop-types-DNxwfY3H.js";import{M as O}from"./vendor-react-markdown-qGQcIl0U.js";import{d as R}from"./vendor-router-MF_ECADz.js";import"./vendor-use-sync-external-store-f1cvjnMh.js";import"./vendor-immer-Bp5DpiZ6.js";import"./vendor-redux-thunk-ClJT1hhx.js";import"./vendor-react-dom-t5F7FhZR.js";import"./vendor-react-toastify-DyH3b-7G.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-axios-D2K41pGA.js";import"./vendor-js-cookie-Cz0CWeBA.js";import"./vendor-react-helmet-async-CO3viEpT.js";import"./vendor-react-fast-compare-Dxl0Zvcn.js";import"./vendor-invariant-CCbxWKZF.js";import"./vendor-shallowequal-Ck_j7EqP.js";import"./vendor-antd-CjcCcqh_.js";import"./vendor-helpers-Bu0hh0lh.js";import"./vendor-resize-observer-polyfill-pFR5zza0.js";import"./vendor-stylis-BmaM3nay.js";import"./vendor-scroll-into-view-if-needed-D5b_oRbX.js";import"./vendor-compute-scroll-into-view-Bl8rNFhg.js";import"./vendor-throttle-debounce-CUWDS_la.js";import"./vendor-json2mq-CN42t7xi.js";import"./vendor-string-convert-Bhuo--sE.js";import"./vendor-copy-to-clipboard-DxQUb0mb.js";import"./vendor-toggle-selection-DGa8lynz.js";import"./vendor-remix-run-router-D1FRce34.js";import"./vendor-lodashdebounce-D8y9irsx.js";import"./vendor-devlop-Cl3hj7Sz.js";import"./vendor-unified-bPg2snWc.js";import"./vendor-bail-FqpXQuLt.js";import"./vendor-extend-Mn8xpFaG.js";import"./vendor-is-plain-obj-C1gvLhAf.js";import"./vendor-trough-B_b8ryxu.js";import"./vendor-vfile-BCWrK60u.js";import"./vendor-vfile-message-DqhD22jI.js";import"./vendor-unist-util-stringify-position-Ch_qCilz.js";import"./vendor-remark-parse-BAB0k8Ea.js";import"./vendor-mdast-util-from-markdown-C2o0SrPm.js";import"./vendor-micromark-util-decode-numeric-character-reference-CNs1qBpV.js";import"./vendor-micromark-util-decode-string-fHsnqYdj.js";import"./vendor-decode-named-character-reference-C3-224fz.js";import"./vendor-micromark-util-normalize-identifier-C9ANKk3v.js";import"./vendor-micromark-AWM-NZXP.js";import"./vendor-micromark-util-combine-extensions-d8XJZrgA.js";import"./vendor-micromark-util-chunked-DrRIdSP-.js";import"./vendor-micromark-factory-space-PzSHLgmq.js";import"./vendor-micromark-util-character-CW3Cu1MS.js";import"./vendor-micromark-core-commonmark-kzTLNXAm.js";import"./vendor-micromark-util-classify-character-tcLuZZwM.js";import"./vendor-micromark-util-resolve-all-PQCKh0dx.js";import"./vendor-micromark-util-subtokenize-BF1Jf29a.js";import"./vendor-micromark-factory-destination-Sj0xfi0V.js";import"./vendor-micromark-factory-label-amyP0HdC.js";import"./vendor-micromark-factory-title-khnLkZK6.js";import"./vendor-micromark-factory-whitespace-eIB00uTl.js";import"./vendor-micromark-util-html-tag-name-DbKNfynz.js";import"./vendor-mdast-util-to-string-C_aolqmU.js";import"./vendor-remark-rehype-RR96F7SH.js";import"./vendor-mdast-util-to-hast-X4CjkqUe.js";import"./vendor-ungap-structured-clone--gfxRhYI.js";import"./vendor-micromark-util-sanitize-uri-BbwQ7CLk.js";import"./vendor-unist-util-position-60F3QETU.js";import"./vendor-trim-lines-D8znQY54.js";import"./vendor-unist-util-visit-CmPqJB5K.js";import"./vendor-unist-util-visit-parents-CPpM1TLD.js";import"./vendor-unist-util-is-BPZGFiMU.js";import"./vendor-hast-util-to-jsx-runtime-BHjuGclF.js";import"./vendor-comma-separated-tokens-xMQ5YY98.js";import"./vendor-property-information-Bx45xMUt.js";import"./vendor-space-separated-tokens-DD3iYX1K.js";import"./vendor-style-to-js-CapSyTmY.js";import"./vendor-style-to-object-BAv4SQXc.js";import"./vendor-inline-style-parser-BlqBsVO4.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-estree-util-is-identifier-name-BgBfM8ME.js";import"./vendor-html-url-attributes-D46m5wfe.js";const G=(i="en-US")=>{const{transcript:s,listening:r,browserSupportsSpeechRecognition:n,isMicrophoneAvailable:l}=P(),[m,a]=o.useState(!1);return{transcript:s,isListening:m,engineListening:r,startListening:async()=>
1{if(n)try{a(!0),await B.startListening({continuous:!0,language:i})}catch(d){a(!1),globalThis.__APP_LOGGER__.log(d)}},stopListening:()=>{a(!1)},isSupported:n,isMicAvailable:l}},E=({input:i,setInput:s,sendMessage:r,loading:n})=>{const{transcript:l,startListening:m,stopListening:a,isSupported:f}=G(),[c,d]=o.useState(!1);o.useEffect(()=>{c&&s(l)},[l,c,s]);const p=()=>{if(!f){alert("Your browser does not support Speech Recognition.");return}c?(a(),d(!1)):(s(""),m(),d(!0))},x=h=>{d(!1),a(),s(h)};return t.jsxs("div",{className:"ai-chat-input glass-input",children:[t.jsx("input",{type:"text",placeholder:c?"Listening… speak now":"Ask about findings, diagnosis, anatomy…",value:i,disabled:n,onChange:h=>x(h.target.value),onKeyDown:h=>h.key==="Enter"&&r()}),t.jsxs("button",{className:`mic-icon ${c?"active listening":""}`,onClick:p,disabled:n,"aria-label":"Voice input",children:[t.jsx("img",{src:"../mic.svg",alt:"Microphone Icon"}),c&&t.jsx("span",{className:"mic-pulse"})]}),t.jsx("button",{className:"send-btn",onClick:r,disabled:n||!i.trim(),children:n?"Thinking…":t.jsx("img",{src:"../share.svg",alt:"Send Icon"})})]})};E.propTypes={input:g.string.isRequired,setInput:g.func.isRequired,sendMessage:g.func.isRequired,loading:g.bool.isRequired};function L({text:i}){return t.jsx("div",{className:"prose max-w-none",children:t.jsx(O,{children:i})})}L.propTypes={text:g.string.isRequired};const N=({text:i,speed:s=20,onTyping:r})=>{const[n,l]=o.useState("");return o.useEffect(()=>{let m=0;l("");const a=setInterval(()=>{l(f=>f+i.charAt(m)),m++,m>=i.length&&clearInterval(a)},s);return()=>clearInterval(a)},[i,s]),o.useEffect(()=>{r==null||r()},[n,r]),t.jsx(L,{text:n})};N.propTypes={text:g.string.isRequired,speed:g.number,onTyping:g.func};const T=({onClose:i})=>{const s=w(e=>e.caseStudy.caseDetails),[r,n]=o.useState([]),[l,m]=o.useState(""),[a,f]=o.useState(!1),c=o.useRef(null),[d,p]=o.useState(!0),[x,h]=o.useState(!1);o.useEffect(()=>{const e=c.current;if(!e)return;const u=()=>{const j=e.scrollHeight-e.scrollTop-e.clientHeight<40;p(j),h(!j)};return e.addEventListener("scroll",u),()=>e.removeEventListener("scroll",u)},[]),o.useEffect(()=>{const e=c.current;e&&d&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[r,d]);const S=async e=>{var u,j;try{f(!0);const b=await C.post(I.MY_STUDY.PARALLEL_AI,{queries:e,user_id:sessionStorage.getItem("id"),key_findings:(s==null?void 0:s.clinical_history)||""}),v=(j=(u=b==null?void 0:b.data)==null?void 0:u.data)==null?void 0:j.aiResponse;v&&v.length>0&&n(A=>{const _=[...A];return _[_.length-1]={role:"ai",content:v},_})}catch(b){globalThis.__APP_LOGGER__.log("AI fetch error:",b),n(v=>{const A=[...v];return A.length>0&&(A[A.length-1]={role:"ai",content:"Oops! Something went wrong while analyzing the case."}),A})}finally{f(!1)}},D=()=>{if(!l.trim()||a)return;const e=l;n(u=>[...u,{role:"user",content:e},{role:"ai",content:"Analyzing the case…"}]),m(""),p(!0),S(e)},y=o.useCallback((e=!1)=>{if(!d&&!e)return;const u=c.current;u&&u.scrollTo({top:u.scrollHeight,behavior:"smooth"})},[d]);return t.jsxs("div",{className:"ai-chat",children:[t.jsxs("div",{className:"ai-chat-header",children:[t.jsx("div",{className:"header-left",children:t.jsx("span",{className:"header-title",children:"AI Study Assistant"})}),i&&t.jsx("button",{className:"ai-chat-close-btn",onClick:i,"aria-label":"Close AI panel",title:"Close",children:"✕"})]}),t.jsxs("div",{className:"ai-chat-body",ref:c,children:[t.jsx("div",{className:"ai-history-card",children:t.jsxs("div",{className:"ai-history-section",children:[t.jsx("h4",{children:"Clinical History"}),(s==null?void 0:s.clinical_history)&&t.jsx(N,{text:s.clinical_history,onTyping:()=>y()})]})}),r.map(e=>t.jsx("div",{className:`chat-message ${e.role}`,children:t.jsxs("div",{className:"bubble",children:[e.role==="ai"&&e.content!=="Analyzing the case…"?t.jsx(N,{text:e.content,onTyping:()=>y()}):e.content,a&&e.content==="Analyzing the case…"&&t.jsxs("span",{className:"typing-dots",children:[t.jsx("span",{}),t.jsx("span",{}),t.jsx("span",{})]})]})},e.id)),x&&t.jsx("button",{className:"scroll-bottom-btn",onClick:()=>{p(!0),y(!0)},children:"↓"})]}),t.jsx(E,{input:l,setInput:m,sendMessage:D,loading:a})]})};T.propTypes={onClose:g.func.isRequired};const q=()=>{const{id:i}=R();globalThis.__APP_LOGGER__.log("Case ID:",i);
1const s=o.useRef(null),r=k(),[n,l]=o.useState(""),[m,a]=o.useState(!1),f=async()=>{var x,h,S;a(!0);const p=await C.post(I.EVENT.GET_CASE_STUDY_BY_ID,{case_id:i});l((h=(x=p.data)==null?void 0:x.data)==null?void 0:h.pacsbin_url),r(M((S=p==null?void 0:p.data)==null?void 0:S.data)),a(!1)};o.useEffect(()=>{f()},[]);const c=o.useRef(null),d=()=>{const p=c.current;if(p){if(document.fullscreenElement){document.exitFullscreen();return}p.requestFullscreen()}};return t.jsxs("section",{"aria-label":"DICOM Viewer Container",style:{position:"relative",width:"100%",height:"116%"},ref:c,children:[t.jsx("button",{onClick:d,style:{position:"absolute",top:"10px",left:"10px",zIndex:20,padding:"6px 12px",cursor:"pointer",color:"white"},children:"⛶ Fullscreen"}),t.jsx("div",{className:"hide",children:"DAMS"}),m?t.jsx("div",{children:"Loading..."}):t.jsx("iframe",{ref:s,src:`${n}?webviewer=1&ww=1406&wc=672&an=false&header=false&notes=false`,title:"DICOM Viewer",style:{width:"100%",height:"100%",border:"none"}}),t.jsx("img",{src:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",alt:"gif","aria-hidden":"true",style:{position:"absolute",top:0,right:0,width:"120px",height:"60px",zIndex:10,pointerEvents:"auto"}})]})},z=()=>{const[i,s]=o.useState(!1);return t.jsxs("div",{className:"case-page",children:[!i&&t.jsxs("button",{className:"ai-floating-btn",onClick:()=>s(!0),"aria-label":"Open AI Chat",title:"Open AI Chat",children:[t.jsx("img",{src:"/ai-assist.png",alt:"AI Assist"}),t.jsx("p",{className:"ai",children:"Solve with AI "})]}),t.jsxs("div",{className:`case-content ${i?"ai-open":""}`,children:[t.jsx("div",{className:"dicom-container",children:t.jsx(q,{})}),i&&t.jsxs("div",{className:"chat-container",children:[t.jsx("button",{className:"chat-close-btn",onClick:()=>s(!1),"aria-label":"Close AI Chat",children:"✕"}),t.jsx(T,{})]})]})]})},fe=()=>{const{id:i}=R();globalThis.__APP_LOGGER__.log("Case ID:",i);const s=w(r=>r.caseStudy.caseDetails);return t.jsx("div",{className:"container",children:t.jsxs("div",{className:"case-solution-page",children:[t.jsx("h4",{className:"case-id",children:s==null?void 0:s.case_title}),t.jsx("div",{className:"case-solution-glass",children:t.jsx(z,{})})]})})};export{fe 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.