import{j as s,a2 as C,as as U,a5 as y}from"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e410.js";import{a as p}from"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e44.js";import{A as q,b as S,q as T,z as E}from"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e423.js";import{u as F}from"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e419.js";import{U as I}from"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e470.js";import"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e418.js";import"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e46.js";import"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e48.js";import"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e4.js";import"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e45.js";import"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e47.js";import"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e49.js";import"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e42.js";import"./v_7_4_2_14_b047d88c-9af4-4a49-a965-946ffe7780e43.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};
