import{u as z,M as c,C as y,d as N,b as A,c as U,e as V,f as D,g as H,h as j,i as J,j as K,k as L}from"./BGlfPyXw.js";import{s as O}from"./C6entnFp.js";import{d as B,r as x,v as s,x as i,y as m,z as h,a5 as e,a4 as l,a6 as R,c as $,A as P,a9 as C,a1 as w,a2 as W,a8 as u,ai as X}from"./D3l4Cb4m.js";const Y={"text-3.5":"","mb-2":""},Z=B({__name:"queue",props:{content:{}},setup(b){const{CCSDKSend:f,onCcSubscribe:t}=z();t(c.GQueueSize,M),t(c.GAgentId,n);const{content:k}=b,d=x(""),{text:o}=JSON.parse(k),r=x(!1),p=x(!1);d.value=o;const g=O(E,2e3);function n(){p.value=!0,clearInterval(g)}function T(){clearInterval(g)}function E(){f({msgType:c.GQueueSize})}function M(_,v){const{code:I}=v;I==="0"&&(d.value=_)}function S(){r.value||(f({msgType:c.GQuequeCancel}),r.value=!0,T())}return(_,v)=>(s(),i("div",null,[m("p",Y,h(e(d)),1),m("div",null,[m("p",{"cv-btn-sm":"","cv-btn-primary":"",class:l({"cv-btn-disabled":e(r)||e(p)}),onClick:S},h(_.$t(e(r)?"已取消":e(p)?"已分配人工服务":"取消排队")),3)])]))}}),ee={key:0,"mb-2.5":""},ne={key:1,"mb-2.5":"",flex:""},te={key:0,"mr-2":""},se={key:0,"w-10":"","h-10":"",src:A},oe={key:1,"w-10":"","h-10":"",src:U},ae={key:0,text:"#666"},ie={key:1},re=B({__name:"item",props:{chat:{}},emits:["reset"],setup(b,{emit:f}){const{chat:t}=b,k=f,{userId:d}=X();R();const o=$(()=>t.sendUser===d.value),r=$(()=>t.msgBody.some(n=>n.contentType===y.System)),p=$(()=>t.msgBody.length===1&&t.msgBody.some(n=>n.contentType===y.Text)&&t.businessType!==c.GQueueSizeTip);function g(n){k("reset",n)}return(n,T)=>{var Q;const E=V,M=D,S=Z,_=H,v=j,I=J,G=K,F=L;return e(r)?(s(),i("div",ee,[P(E,{content:(Q=t.msgBody.at(0))==null?void 0:Q.msgContent},null,8,["content"])])):(s(),i("div",ne,[e(o)?C("",!0):(s(),i("div",te,[t.sendUser==="0"?(s(),i("img",se)):(s(),i("img",oe))])),m("div",{"flex-1":"","overflow-hidden":"",flex:"","flex-col":"",class:l({"pl-6":e(o),"pr-6":!e(o)})},[m("div",{flex:"","items-end":"",class:l({"flex-row-reverse":e(o)}),"text-3.25":"","leading-4":"","mb-1":""},[e(o)?C("",!0):(s(),i("span",ae,h(t.sendNickName),1)),m("span",{text:"#999",class:l({"mx-2":!e(o)})},h(("dateFormat"in n?n.dateFormat:e(N))(t.sendTime||t.timestamp,"MM-dd HH:mm:ss")),3)],2),m("div",{relative:"","max-w-full":"","w-full":"",bg:"#ebedf9","py-4":"","px-5":"","rounded-5":"","self-start":"",class:l({"bg-primary text-white self-end rounded-ee-0":e(o),"rounded-es-0":!e(o),"!w-fit":e(p)})},[t.undelivered?(s(),i("span",{key:0,absolute:"","bottom-0":"",class:l({"right--6":!e(o),"left--6":e(o)})},[m("i",{"i-carbon:warning-filled":"","cursor-pointer":"","text-4":"","text-red-6":"",onClick:T[0]||(T[0]=a=>g(t))})],2)):C("",!0),(s(!0),i(w,null,W(t.msgBody,(a,q)=>(s(),i("div",{key:q,relative:"","mb-4":"","last:mb-0":""},[a.contentType===("ContentTypeEnum"in n?n.ContentTypeEnum:e(y)).Image?(s(),u(M,{key:0,content:a.msgContent,loadedFun:a.loadedFun},null,8,["content","loadedFun"])):a.contentType===("ContentTypeEnum"in n?n.ContentTypeEnum:e(y)).Text?(s(),i("div",ie,[t.businessType===("MsgTypeEnum"in n?n.MsgTypeEnum:e(c)).GQueueSizeTip?(s(),u(S,{key:0,content:a.msgContent},null,8,["content"])):(s(),u(_,{key:1,content:a.msgContent},null,8,["content"]))])):a.contentType===("ContentTypeEnum"in n?n.ContentTypeEnum:e(y)).Custom?(s(),i(w,{key:2},[t.businessType===("MsgTypeEnum"in n?n.MsgTypeEnum:e(c)).GEvaluateMessage?(s(),u(v,{key:0,content:a.msgContent,sendTime:+t.sendTime,sessionId:t.sessionId},null,8,["content","sendTime","sessionId"])):t.businessType===("MsgTypeEnum"in n?n.MsgTypeEnum:e(c)).AiTextQa?(s(),u(I,{key:1,content:a.msgContent},null,8,["content"])):t.businessType===("MsgTypeEnum"in n?n.MsgTypeEnum:e(c)).AiEnquiryGet?(s(),u(G,{key:2,content:a.msgContent},null,8,["content"])):C("",!0)],64)):(s(),u(F,{key:3,content:a.msgContent},null,8,["content"]))]))),128))],2)],2)]))}}});export{re as _};
