1"use strict";(self.webpackChunkdrugvlab_fe=self.webpackChunkdrugvlab_fe||[]).push([[3198],{53198:(e,t,n)=>{n.d(t,{d:()=>S});var s=n(1413),a=n(72791),i=n(39230),l=n(50025),o=n(49877),r=n(84314),c=n(84080),d=n(49905),u=n(31817),h=n(22592),p=n(25580),m=n(6652),g=n(96732),f=n(80184);const v=320,w=380,b=260,x=.58,j="drugvlab-assistant-callout-hide-date",y={small:{w:420,h:520},medium:{w:520,h:600},large:{w:680,h:720}};function N(e,t,n){return Math.min(n,Math.max(t,e))}const C={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",nw:"nw-resize",ne:"ne-resize",sw:"sw-resize",se:"se-resize"},k=["n","s","e","w","nw","ne","sw","se"];function I(){const e=new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(s)}function S(e){var t,n,S;let{open:Z,text:E,input:M,loading:D,error:H,messages:R,suggestions:P=[],locale:L="en",pageMode:X=!1,embedded:Y=!1,bodyRef:T,onToggle:z,onClose:F,onInputChange:W,onSuggestionSelect:A,onLocaleChange:B,onOpenFullPage:O,onShrink:_,onSubmit:U,decisionPanel:V,decisionTabLabel:G,helperTabLabel:$,decisionOnly:q=!1,hideFab:J=!1}=e;const K=(0,h.T)(),{i18n:Q}=(0,i.$G)(),[ee,te]=(0,a.useState)(null),[ne,se]=(0,a.useState)("medium"),[ae,ie]=(0,a.useState)(null),[le,oe]=(0,a.useState)("decision"),[re,ce]=(0,a.useState)(!1),de=(0,h.C)((e=>e.assistantDock.calloutHidden)),ue=(0,h.C)((e=>{var t;return null===(t=e.aiChatActiveCheck.response)||void 0===t?void 0:t.active_status})),he=!0===ue||"ON"===String(ue).toUpperCase(),pe=(0,a.useRef)(null),me=(0,a.useRef)(null),ge=(0,a.useRef)(null),fe=(0,a.useRef)(!1),ve=null!==G&&void 0!==G?G:"ko"===L?"\uacb0\uacfc \uac80\ud1a0":"Result Review",we=null!==$&&void 0!==$?$:"ko"===L?"\ub3c4\uc640\uc8fc\uc138\uc694":"Help me",be=Q.t("assistantDock.dontShowAgain",{defaultValue:"ko"===L?"\uc624\ub298 \ud558\ub8e8 \uc5f4\uc9c0 \uc54a\uae30":"Hide for today"});(0,a.useEffect)((()=>{const e=window.localStorage.getItem(j);e!==I()?e&&(window.localStorage.removeItem(j),K((0,p.H3)())):K((0,p.I8)())}),[K]),(0,a.useEffect)((()=>{K((0,m.Xx)())}),[K]);function xe(e){return t=>{0!==t.button||Y||X||!ee||(t.preventDefault(),t.stopPropagation(),pe.current={pointerId:t.pointerId,edge:e,startCX:t.clientX,startCY:t.clientY,startRect:(0,s.Z)({},ee)},document.body.style.cursor=C[e],document.body.style.userSelect="none",t.currentTarget.setPointerCapture(t.pointerId))}}(0,a.useLayoutEffect)((()=>{!Z||Y||ee||te(function(e,t){const n=y[e],s=window.innerWidth,a=window.innerHeight,i=Math.max(v,s-24),l=Math.max(w,a-32);if(t){const e=Math.min(900,i),t=Math.min(Math.max(480,Math.round(.76*a)),l);return{left:N((s-e)/2,8,s-e-8),top:N((a-t)/2,8,a-t-8),width:e,height:t}}const o=s-b,r=Math.round(a*x),c=Math.min(n.w,i),d=Math.min(n.h,l);return{left:N(o-c-14,8,s-c-8),top:N(r-d/2,8,a-d-8),width:c,height:d}}(ne,X))}),[Y,Z,X,ee,ne]),(0,a.useLayoutEffect)((()=>{Y||ae||ie(function(){const e=window.innerWidth,t=window.innerHeight;return{left:N(e-b,8,e-196-8),top:N(Math.round(t*x)-98,8,t-196-8),width:196,height:196}}())}),[Y,ae]),(0,a.useEffect)((()=>{V||"decision"!==le||oe("helper")}),[le,V]),(0,a.useEffect)((()=>{if(Y)return;const e=()=>{const e=window.innerWidth,t=window.innerHeight;ie((n=>n?(0,s.Z)((0,s.Z)({},n),{},{left:N(n.left,8,e-n.width-8),top:N(n.top,8,t-n.height-8)}):n)),te((n=>n?(0,s.Z)((0,s.Z)({},n),{},{left:N(n.left,8,e-n.width-8),top:N(n.top,8,t-n.height-8)}):n))};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[Y]),(0,a.useEffect)((()=>{if(!Z)return;const e=T.current;e&&(e.scrollTop=e.scrollHeight)}),[T,D,R,Z]),(0,a.useEffect)((()=>{if(!Z||!X)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}),[Z,X]),(0,a.useEffect)((()=>{(Y||X)&&(me.current=null,pe.current=null,ge.current=null,fe.current=!1,document.body.style.cursor="",document.body.style.userSelect="")}),[Y,X]),(0,a.useEffect)((()=>{if(!Y&&!X)return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)};function e(e){const t=me.current;if(t&&e.pointerId===t.pointerId){const n=e.clientX-t.startCX,a=e.clientY-t.startCY;te((e=>{if(!e)return e;const i=window.innerWidth,l=window.innerHeight;return(0,s.Z)((0,s.Z)({},e),{},{left:N(t.startRect.left+n,8,i-e.width-8),top:N(t.startRect.top+a,8,l-e.height-8)})}))}const n=ge.current;if(n&&e.pointerId===n.pointerId){const t=e.clientX-n.startCX,a=e.clientY-n.startCY;!n.moved&&Math.hypot(t,a)>4&&(n.moved=!0),ie((e=>{if(!e)return e;const i=window.innerWidth,l=window.innerHeight;return(0,s.Z)((0,s.Z)({},e),{},{left:N(n.startRect.left+t,8,i-e.width-8),top:N(n.startRect.top+a,8,l-e.height-8)})}))}const a=pe.current;if(a&&e.pointerId===a.pointerId){const t=e.clientX-a.startCX,n=e.clientY-a.startCY,s=a.startRect,
1i=window.innerWidth,l=window.innerHeight;let{left:o,top:r,width:c,height:d}=s;if(a.edge.includes("e")&&(c=N(s.width+t,v,i-s.left-8)),a.edge.includes("w")){const e=N(s.width-t,v,s.left+s.width-8);o=s.left+s.width-e,c=e}if(a.edge.includes("s")){const e=Math.max(w,l-16),t=N(s.height+n,w,e);d=t,t>l-s.top-8&&(r=Math.max(8,l-t-8))}if(a.edge.includes("n")){const e=N(s.height-n,w,s.top+s.height-8);r=s.top+s.height-e,d=e}te({left:o,top:r,width:c,height:d})}}function t(e){var t,n,s;(null===(t=me.current)||void 0===t?void 0:t.pointerId)===e.pointerId&&(me.current=null),(null===(n=pe.current)||void 0===n?void 0:n.pointerId)===e.pointerId&&(pe.current=null),(null===(s=ge.current)||void 0===s?void 0:s.pointerId)===e.pointerId&&(fe.current=ge.current.moved,ge.current=null,window.setTimeout((()=>{fe.current=!1}),0)),document.body.style.cursor="",document.body.style.userSelect=""}}),[Y,X]);const je=ee?{position:"fixed",left:ee.left,top:ee.top,width:ee.width,height:ee.height,maxHeight:"calc(100vh - 16px)"}:{display:"none"},ye=ae?{left:ae.left,top:ae.top,width:ae.width,height:ae.height}:{display:"none"},Ne=null!==(t=E.helperHint)&&void 0!==t?t:E.open,Ce=Boolean(V),ke="assistant-panel".concat(Ce&&!q?" assistant-panel-with-tabs":""),Ie="ko"===L?"AI \ucc44\ud305\uc774 \uc544\ub2c8\ub77c, \uc6cc\ud06c\ud50c\ub85c\uc6b0 \uacb0\uacfc\ub97c \ud574\uc11d\ud558\uae30 \uc704\ud55c \uc548\ub0b4 \ud654\uba74\uc785\ub2c8\ub2e4.":"This is not an AI chat. It is a guided result interpretation view.",Se=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{position:"relative",minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr) auto auto"},children:(0,f.jsxs)("div",{style:{minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr) auto auto"},children:[(0,f.jsxs)("div",{className:"assistant-panel-body",ref:T,children:[R.map(((e,t)=>(0,f.jsxs)("article",{className:"assistant-bubble ".concat("user"===e.role?"assistant-user":"assistant-ai"),children:[0===t&&"assistant"===e.role?(0,f.jsx)("div",{className:"assistant-non-ai-notice",children:Ie}):null,(0,f.jsx)("p",{children:e.content}),e.metrics&&e.metrics.length>0?(0,f.jsx)("div",{className:"assistant-metrics",children:e.metrics.map((t=>{var n;return(0,f.jsxs)("div",{className:"assistant-metric-card tone-".concat(null!==(n=t.tone)&&void 0!==n?n:"neutral"),children:[(0,f.jsx)("span",{children:t.label}),(0,f.jsx)("strong",{children:t.value})]},"".concat(e.id,"-").concat(t.label))}))}):null,e.chartBars&&e.chartBars.length>0?(0,f.jsx)("div",{className:"assistant-chart",children:e.chartBars.map((t=>{var n,s;const a=Math.max(0,Math.min(100,t.value));return(0,f.jsxs)("div",{className:"assistant-chart-row",children:[(0,f.jsxs)("div",{className:"assistant-chart-labels",children:[(0,f.jsx)("span",{children:t.label}),(0,f.jsx)("strong",{children:null!==(n=t.valueLabel)&&void 0!==n?n:"".concat(a.toFixed(1),"%")})]}),(0,f.jsx)("div",{className:"assistant-chart-track",children:(0,f.jsx)("div",{className:"assistant-chart-fill",style:{width:"".concat(a,"%"),background:null!==(s=t.color)&&void 0!==s?s:"linear-gradient(90deg,#6366f1,#8b5cf6)"}})})]},"".concat(e.id,"-").concat(t.label))}))}):null,e.insights&&e.insights.length>0?(0,f.jsx)("ul",{className:"assistant-insights",children:e.insights.map(((t,n)=>(0,f.jsx)("li",{children:t},"".concat(e.id,"-").concat(n))))}):null,e.meta?(0,f.jsx)("span",{className:"assistant-meta",children:e.meta}):null]},e.id))),D?(0,f.jsx)("p",{className:"assistant-loading",children:E.loading}):null]}),P.length>0?(0,f.jsx)("div",{className:"assistant-suggestions",children:P.map((e=>(0,f.jsx)("button",{type:"button",onClick:()=>{null===A||void 0===A||A(e)},children:e},e)))}):null,(0,f.jsxs)("form",{className:"assistant-panel-input",onSubmit:e=>{e.preventDefault(),U()},children:[(0,f.jsx)("input",{type:"text",value:M,onChange:e=>W(e.target.value),placeholder:E.placeholder}),(0,f.jsxs)("button",{type:"submit",disabled:D,"aria-label":E.send,children:[(0,f.jsx)(u.Z,{className:"assistant-send-icon","aria-hidden":"true"}),(0,f.jsx)("span",{children:E.send})]})]})]})}),H?(0,f.jsx)("p",{className:"assistant-error",children:H}):null]}),Ze=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("header",{className:"assistant-panel-head",children:[(0,f.jsxs)("div",{className:"assistant-panel-head-top",children:[(0,f.jsxs)("div",{className:"assistant-panel-head-drag",onPointerDown:function(e){0!==e.button||Y||X||!ee||(e.preventDefault(),me.current={pointerId:e.pointerId,startCX:e.clientX,startCY:e.clientY,startRect:(0,s.Z)({},ee)},document.body.style.userSelect="none",e.currentTarget.setPointerCapture(e.pointerId))},style:{cursor:Y||X?"default":"grab"},children:[(0,f.jsx)("strong",{children:E.title}),(0,f.jsx)("span",{children:E.subtitle})]}),(0,f.jsxs)("div",{className:"assistant-head-actions",children:[(0,f.jsx)("div",{className:"assistant-locale-switch",role:"group","aria-label":"language",children:["ko","en"].map((e=>(0,f.jsx)("button",{type:"button",className:L===e?"active":"",onClick:()=>{return t=e,null===B||void 0===B||B(t),void Q.changeLanguage("ko"===t?"kr":"en").catch(console.error);var t},children:e.toUpperCase()},e)))}),Y||X||!O?null:(0,f.jsx)("button",{type:"button",className:"assistant-icon-action",onClick:O,"aria-label":null!==(n=E.expand)&&void 0!==n?n:"Expand",title:null!==(S=E.expand)&&void 0!==S?S:"Expand",children:(0,f.jsx)(r.Z,{"aria-hidden":"true"})}),!Y&&X&&_?(0,f.jsx)("button",{type:"button",className:"assistant-icon-action",onClick:_,"aria-label":"Shrink",title:"ko"===L?"\uc
1d95\uc18c":"Shrink",children:(0,f.jsx)(c.Z,{"aria-hidden":"true"})}):null,Y?null:(0,f.jsx)("button",{type:"button",className:"assistant-icon-action",onClick:F,"aria-label":E.close,title:E.close,children:(0,f.jsx)(d.Z,{"aria-hidden":"true"})})]})]}),Ce&&!q?(0,f.jsx)("div",{className:"assistant-panel-tab-row",children:(0,f.jsxs)("div",{className:"assistant-panel-tabs",role:"tablist","aria-label":E.title,children:[(0,f.jsx)("button",{type:"button",role:"tab","aria-selected":"decision"===le,className:"decision"===le?"active":"",onClick:()=>oe("decision"),children:ve}),(0,f.jsx)("button",{type:"button",role:"tab","aria-selected":"helper"===le,className:"helper"===le?"active":"",onClick:()=>oe("helper"),children:we})]})}):null]}),(0,f.jsxs)("div",{className:Ce?"assistant-panel-main":"assistant-panel-main no-tabs",children:[Ce&&(0,f.jsx)("div",{className:"assistant-decision-panel",style:{display:q||"decision"===le?void 0:"none"},children:V}),q?null:(0,f.jsx)("div",{className:"assistant-helper-panel",style:{display:Ce&&"decision"===le?"none":void 0},children:Se})]})]}),Ee=Z&&X,Me=Z&&Y&&!X,De=Z&&!X&&!Y,He=Ee?"".concat(ke," assistant-panel-page"):Me?"".concat(ke," assistant-panel-embedded"):ke,Re=Ee?{position:"fixed",inset:0,zIndex:2147483001,width:"100vw",height:"100dvh",maxWidth:"none",maxHeight:"none",borderRadius:0,border:0,boxShadow:"none",background:"#f4f7fc"}:De?(0,s.Z)({},je):{},Pe=(0,f.jsxs)("section",{className:He,"aria-label":E.title,style:(0,s.Z)((0,s.Z)({},Re),{},{display:Z?void 0:"none"}),children:[De&&k.map((e=>(0,f.jsx)("div",{className:"assistant-rh assistant-rh-".concat(e),onPointerDown:xe(e)},e))),Ze]});return(0,f.jsxs)(f.Fragment,{children:[De?(0,f.jsx)(l.Z,{open:Z,onClose:F,className:"assistant-modal-root",slotProps:{backdrop:{className:"assistant-modal-backdrop"}},children:(0,f.jsx)("div",{className:"assistant-modal-layer",children:Pe})}):Pe,J||Y||X?null:(0,f.jsxs)("div",{className:"assistant-fab-wrap",style:ye,children:[!he||de||re?null:(0,f.jsxs)("div",{className:"assistant-fab-callout ".concat(Z?"is-open":""),onClick:()=>{Z||z()},children:[(0,f.jsx)("span",{children:E.title}),(0,f.jsxs)("strong",{children:[Ne,", Click Me!"]}),(0,f.jsx)("small",{children:Q.t("assistantDock.capsyHelperHint",{defaultValue:"ko"===L?"Capsy\uac00 \uacb0\uacfc \uc774\ud574\ub97c \ub3c4\uc640\ub4dc\ub9b4\uac8c\uc694!":"capsy wants to help you understand the results!"})}),(0,f.jsx)("div",{className:"assistant-fab-callout-actions",children:(0,f.jsx)("button",{type:"button",className:"assistant-fab-callout-dismiss",onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),window.localStorage.setItem(j,I()),K((0,p.I8)())},children:be})}),(0,f.jsx)("button",{type:"button",className:"assistant-fab-callout-close","aria-label":E.close,onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),ce(!0)},children:"\xd7"})]}),(0,f.jsx)(o.Z,{className:"assistant-fab-mui ".concat(Z?"is-open":""),"aria-label":Z?E.close:E.open,onPointerDown:function(e){0!==e.button||Y||X||!ae||(e.preventDefault(),ge.current={pointerId:e.pointerId,startCX:e.clientX,startCY:e.clientY,startRect:(0,s.Z)({},ae),moved:!1},document.body.style.cursor="grabbing",document.body.style.userSelect="none",e.currentTarget.setPointerCapture(e.pointerId))},onClick:function(e){if(!Y&&!X)return fe.current?(e.preventDefault(),void e.stopPropagation()):void z()},children:(0,f.jsx)(g.Z,{})})]})]})}}}]); 2//# sourceMappingURL=3198.6e5787f2.chunk.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.