import{j as s,a4 as C,ax as U,a7 as y}from"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f10.js";import{a as p}from"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f4.js";import{A as q,b as S,q as T,z as E}from"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f23.js";import{u as F}from"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f19.js";import{U as I}from"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f69.js";import"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f18.js";import"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f6.js";import"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f8.js";import"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f.js";import"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f5.js";import"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f7.js";import"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f9.js";import"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f2.js";import"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f3.js";function K(){const{variaveisWA:t}=q(),{userTabs:o,setNewUser:h,setRemoveUser:u}=S(),{language:r}=F(),{close:x}=T(),c=E(e=>{var a;return(a=e.activeChat)==null?void 0:a.id}),n=c.server==="@lid"?c._serialized:c.user,f=I(),[v,g]=p.useState(""),[l,j]=p.useState([]),b=async e=>{e.chats.find(i=>i.id===n)?u(n,!1,e.id):h(n,e.id)},A=s.jsxs("div",{className:"p-4 flex flex-col gap-2",children:[s.jsx("span",{children:r.emptyAba}),s.jsx(C,{name:r.create,funcao:()=>{x(),f()}})]}),N=s.jsx("div",{className:"p-4 text-center",children:s.jsx("span",{children:r.notFound})}),d=s.jsx(U,{filtragem:e=>{let a=[];o.forEach(i=>{var m;(m=i.tag)!=null&&m.toUpperCase().includes(e.toUpperCase())&&a.push(i)}),j(a),g(e)},placeholder:r.pesquisarAbas,dependenciasADD:[o],btnClear:!0}),w=s.jsx("div",{className:t.modalOptions.content3+"overflow-auto max-w-[350px]",style:{maxHeight:"calc(100vh - 200px)"},children:l.slice().sort((e,a)=>e.tag.localeCompare(a.tag)).map((e,a)=>s.jsx("div",{className:t.listagem.content1+"hoverShadown",children:s.jsx("li",{tabIndex:1,className:t.listagem.content2,"data-animate-dropdown-item":"true",style:{opacity:1},children:s.jsx("label",{htmlFor:"user_tab&"+a,children:s.jsxs("div",{className:t.listagem.content3,children:[s.jsx("div",{className:t.listagem.content4,children:s.jsx(y,{id:"user_tab&"+a,estado:!!e.chats.find(i=>i.id===n),checkedUpdade:()=>{b(e)}})}),s.jsxs("span",{className:t.listagem.content5+" flex",children:[s.jsx("span",{className:"pr-1 overflow-hidden text-ellipsis whitespace-nowrap",children:e.tag}),s.jsx("span",{className:t.aba+"tam-aba bg-[var(--primaria)] !text-[var(--letra)]",children:e.chats.length})]})]})})})},a))});return v.length>0&&l.length===0?s.jsxs("div",{children:[d,N]}):o.length>0?s.jsxs("div",{children:[d,w]}):A}export{K as default};
