PageSourceSearch

https://www.paziresh24.com/_next/static/chunks/pages/chat-15952bf8c453f18e.js

js paziresh24.com collected 2026-09-24 11:54:44 UTC 7,545 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8180],{99937:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/chat",function(){return n(58422)}])},4096:function(e,t,n){"use strict";n.d(t,{Gl:function(){return p},Lc:function(){return _},YE:function(){return g},cc:function(){return f},kJ:function(){return b},pX:function(){return m},rK:function(){return y},u:function(){return h}});var r,i,o,s=n(54723),a=n.n(s),l=n(1503),c=n(38396);let u=String(null!==(o=null===(i=a()())||void 0===i?void 0:null===(r=i.publicRuntimeConfig)||void 0===r?void 0:r.CHAT_API_BASE)&&void 0!==o?o:"")||"https://j-n-khesht.p24cloud.ir";function d(){let e=(0,l.getCookie)("token");return"string"==typeof e&&e?{authorization:"Bearer ".concat(e)}:{}}let x="include";async function h(e){try{var t,n,r;let i=await fetch("".concat(u,"/api/khesht/chat/turn"),{method:"POST",credentials:x,headers:{"content-type":"application/json",...d()},body:JSON.stringify({text:e.text,explicit:e.explicit,...e.conversationId?{conversation_id:e.conversationId}:{},context:{city:null!==(n=e.city)&&void 0!==n?n:"ir",terminal_id:null!==(r=e.terminalId)&&void 0!==r?r:"",...(null===(t=e.bookings)||void 0===t?void 0:t.length)?{bookings:e.bookings}:{}}})});if(!i.ok)return null;return await i.json()}catch(e){return null}}async function p(){try{var e,t;let n=await fetch("".concat(u,"/api/khesht/chat/conversations?limit=30"),{headers:d(),credentials:x});if(!n.ok)return[];return null!==(t=null===(e=await n.json())||void 0===e?void 0:e.conversations)&&void 0!==t?t:[]}catch(e){return[]}}async function f(e){try{let t=await fetch("".concat(u,"/api/khesht/chat/conversations/").concat(encodeURIComponent(e)),{headers:d(),credentials:x});if(!t.ok)return null;return await t.json()}catch(e){return null}}function v(e,t){try{(0,c.d)("search").sendEvent({group:"search_metrics",type:e,event:t})}catch(e){}}function m(e){v("conversational_invite",{action:e,entry_point:"homepage",is_conversational:!0,has_token:!!(0,l.getCookie)("token")})}function _(e,t){var n,r;v("search_view",{has_token:!!(0,l.getCookie)("token"),filters:{text:null!==(n=e.search_query)&&void 0!==n?n:""},result_count:null!==(r=e.result_count)&&void 0!==r?r:0,query_id:e.query_id,location:"ir",conversation_id:e.conversation_id,turn_index:e.turn_index,is_conversational:!0,entry_point:t})}function y(e,t,n){var r,i;v("search_click_position",{card_data:{_id:e.id,position:e.position,title:e.title,type:e.type,url:e.url},query_id:t.queryId,result_count:null!==(r=t.resultCount)&&void 0!==r?r:0,filters:{text:null!==(i=t.searchQuery)&&void 0!==i?i:""},conversation_id:t.conversationId,turn_index:t.turnIndex,is_conversational:!0,entry_point:n})}function g(e,t,n){v("conversational_exit",{conversation_id:e,exit_reason:t,entry_point:n})}function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{fetch("".concat(u,"/api/khesht/chat/events"),{method:"POST",credentials:x,keepalive:!0,headers:{"content-type":"application/json",...d()},body:JSON.stringify({events:[{group:"yara",action:e,props:t}]})}).catch(()=>void 0)}catch(e){}}},58422:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return x},default:function(){return h}});var r=n(15436),i=n(39641),o=n.n(i),s=n(64162),a=n(1503),l=n(4096);let c="chat_route";function u(e,t,n){(0,l.YE)(n,t,c),window.location.assign("/s/?text=".concat(encodeURIComponent(e)))}var d=()=>{let[e,t]=(0,s.useState)(""),[n,i]=(0,s.useState)([]),[o,d]=(0,s.useState)(!1),x=(0,s.useRef)(""),h=(0,s.useRef)(""),p=(0,s.useMemo)(()=>{var e;return String(null!==(e=(0,a.getCookie)("terminal_id"))&&void 0!==e?e:"")},[]),f=(0,s.useCallback)((e,t)=>{(0,l.rK)(e,{queryId:t.queryId,turnIndex:t.turnIndex,resultCount:t.resultCount,searchQuery:t.searchQuery,conversationId:x.current},c)},[]),v=(0,s.useCallback)(async e=>{let n=e.trim();if(!n||o)return;h.current=n,i(e=>[...e,{role:"user",text:n}]),t(""),d(!0);let r=await (0,l.u)({text:n,explicit:!0,conversationId:x.current||void 0,terminalId:p});if(d(!1),!r){u(n,"network_error",x.current);return}if(x.current=r.conversation_id,"classic"===r.mode){var s,a;u(null!==(s=r.fallback_query)&&void 0!==s?s:n,null!==(a=r.fallback_reason)&&void 0!==a?a:"unknown",r.conversation_id);return}(0,l.Lc)(r,c),i(e=>{var t,n;return[...e,{role:"assistant",text:null!==(n=null!==(t=r.message)&&void 0!==t?t:r.clarifying_question)&&void 0!==n?n:"",emergency:r.emergency,disclaimer:r.disclaimer,results:r.results,queryId:r.query_id,turnIndex:r.turn_index,resultCount:r.result_count,searchQuery:r.search_query}]})},[o,p]);return(0,r.jsxs)("div",{dir:"rtl",className:"mx-auto flex min-h-screen max-w-2xl flex-col gap-4 p-4",children:[(0,r.jsxs)("header",{className:"flex items-center justify-between border-b pb-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-lg font-bold",children:"راهنمای انتخاب پزشک"}),(0,r.jsx)("p",{className:"text-xs text-slate-500",children:"مشکل‌تان را به زبان خودتان بنویسید (نسخهٔ آزمایشی)"})]}),(0,r.jsx)("button",{type:"button",className:"rounded-lg border px-3 py-2 text-sm",onClick:()=>u(h.current||"","user_choice",x.current),children:"جستجوی معمولی"})]}),(0,r.jsxs)("div",{className:"flex flex-1 flex-col gap-3",children:[0===n.length&&(0,r.jsx)("p",{className:"rounded-xl bg-slate-50 p-4 text-sm leading-7 text-slate-600",children:"مثلاً: \xabچند روزه که سرم را که می‌چرخانم گردن و شانه‌ام تیر می‌کشد و دستم بی‌حس می‌شود، به چه دکتری مراجعه کنم؟\xbb"}),n.map((e,t)=>{var n;return"user"===e.role?(0,r.jsx)("p",{className:"self-end rounded-2xl bg-primary/10 px-4 py-2 text-sm",children:e.text},t):(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[e.emergency&&(0,r.jsx)("p",{className:"rounded-xl border border-red-300 bg-red-50 p-3 text-sm font-bold leading-7 text-red-700",children:e.emergency}),e.text&&(0,r.jsx)("p",{className:"rounded-2xl bg-slate-100 px-4 py-3 text-sm leading-7",children:e.text}),null===(n=e.results)||void 0===n?void 0:n.map(t=>(0,r.jsxs)("a",{href:t.url,onClick:()=>f(t,e),className:"flex flex-col gap-1 rounded-xl border p-3 text-sm hover:bg-slate-50",children:[(0,r.jsx)("span",{className:"font-bold",children:t.title}),t.expertise&&(0,r.jsx)("span",{className:"text-xs text-slate-500",children:t.expertise})]},t.id)),e.disclaimer&&(0,r.jsx)("p",{className:"text-xs leading-6 text-slate-400",children:e.disclaimer})]},t)}),o&&(0,r.jsx)("p",{className:"text-sm text-slate-400",children:"در حال بررسی…"})]}),(0,r.jsxs)("form",{className:"sticky bottom-0 flex gap-2 bg-white py-3",onSubmit:t=>{t.preventDefault(),v(e)},children:[(0,r.jsx)("input",{className:"flex-1 rounded-xl border px-4 py-3 text-sm",placeholder:"مشکل‌تان را بنویسید…",value:e,onCh
1ange:e=>t(e.target.value),maxLength:600,disabled:o}),(0,r.jsx)("button",{type:"submit",className:"rounded-xl bg-primary px-5 py-3 text-sm text-white",disabled:o||!e.trim(),children:"ارسال"})]})]})},x=!0,h=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o(),{children:[(0,r.jsx)("title",{children:"راهنمای انتخاب پزشک | پذیرش۲۴"}),(0,r.jsx)("meta",{name:"robots",content:"noindex,nofollow"})]}),(0,r.jsx)(d,{})]})}},function(e){e.O(0,[1258,7991,9492,9791,6251,7326,6842,6221,3093,3015,5954,5755,1199,4671,6886,6733,2361,3540,1582,2447,4629,265,396,2888,170,179],function(){return e(e.s=99937)}),_N_E=e.O()}]);
2//# sourceMappingURL=chat-15952bf8c453f18e.js.map

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.