import{r as f,c as n,o as i,b as o,u as e,a as c,j as x,t as r,B as h,F as m,T as k}from"./app-B4kV47qU.js";import{u as y}from"./chatStore-CTtmOQOw.js";import"./toastComposable-CvcyPmJb.js";import"./echoServiceComposable-n1MnmRL6.js";import"./modalStore-BgORG3Nn.js";const C={class:"flex items-center justify-between border-b border-b-slate-200 p-3 dark:border-b-dark-900"},S={class:"flex items-center justify-start gap-x-3"},w=["src"],B={class:"absolute -right-2 bottom-0 rounded-full bg-white p-1"},R={class:"whitespace-nowrap text-sm font-medium text-slate-700 dark:text-slate-100"},j={class:"truncate text-sm font-normal text-slate-500 dark:text-slate-400"},L={key:0},M={key:1},N={class:"flex flex-wrap items-center gap-1"},T={for:"toggle-unchecked-input",class:"toggle"},V=["checked"],E={__name:"Header",setup(z){const t=y(),v=()=>{var s;k({update_type:"auto_reply"}).put(`/user/conversations/${(s=t.activeConversation)==null?void 0:s.id}`)};return(_,s)=>{var d,g,p,u,b;const l=f("Icon");return i(),n("div",C,[o("div",S,[o("button",{onClick:s[0]||(s[0]=(...a)=>e(t).toggleLeftSidebar&&e(t).toggleLeftSidebar(...a)),type:"button",class:"text-slate-500 hover:text-slate-700 focus:text-slate-700 dark:text-slate-400 dark:hover:text-slate-300 dark:focus:text-slate-300 xl:hidden"},[c(l,{icon:"bx:menu",class:"text-2xl"})]),o("button",{type:"button",class:"avatar avatar-circle",onClick:s[1]||(s[1]=(...a)=>e(t).toggleRightSidebar&&e(t).toggleRightSidebar(...a))},[o("img",{class:"avatar-img relative",src:e(t).getConversationProfilePic(e(t).activeConversation)},null,8,w),o("div",B,[c(l,{icon:"ri:whatsapp-fill",class:"text-green-600"})])]),o("div",null,[o("h6",R,[x(r(e(t).activeConversation.name)+" ",1),o("span",{class:"rounded p-0 px-2 text-sm text-white",style:h({background:(g=e(t).getBadge((d=e(t).activeConversation)==null?void 0:d.badge_id))==null?void 0:g.color})},r((u=e(t).getBadge((p=e(t).activeConversation)==null?void 0:p.badge_id))==null?void 0:u.text),5)]),o("p",j,[e(t).getConversationType()==="group"?(i(),n(m,{key:0},[e(t).loading.groupMetadata?(i(),n("span",L,"Loading...")):(i(),n("span",M,r(((b=e(t).activeConversation.groupMetadata)==null?void 0:b.size)??0)+" Members ",1))],64)):(i(),n(m,{key:1},[x(r(e(t).activeConversation.id.split("@")[0].substring(2)),1)],64))])])]),o("div",N,[o("label",T,[o("input",{onChange:v,class:"toggle-input peer sr-only",id:"toggle-unchecked-input",type:"checkbox",checked:e(t).activeConversation.auto_reply_enabled},null,40,V),s[3]||(s[3]=o("div",{class:"toggle-body"},null,-1)),s[4]||(s[4]=o("span",{class:"label"},"Auto Reply",-1))]),o("button",{class:"btn",type:"button",onClick:s[2]||(s[2]=(...a)=>e(t).toggleRightSidebar&&e(t).toggleRightSidebar(...a))},[c(l,{icon:"bx:bxs-info-circle",class:"text-2xl text-primary-500"})])])])}}};export{E as default};
