import{j as s,a1 as C,ar as U,a4 as S}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf10.js";import{a as h}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf4.js";import{A as T,b as _,p as q,y as E}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf23.js";import{u as F}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf19.js";import{U as I}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf72.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf18.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf6.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf8.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf5.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf7.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf9.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf2.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf3.js";function Q(){var m;const{variaveisWA:t}=T(),{userTabs:o,setNewUser:u,setRemoveUser:x}=_(),{language:r}=F(),{close:f}=q(),c=(m=E().activeChat)==null?void 0:m.id,n=c.server==="@lid"?c._serialized:c.user,v=I(),[g,j]=h.useState(""),[l,b]=h.useState([]),A=async e=>{e.chats.find(i=>i.id===n)?x(n,!1,e.id):u(n,e.id)},N=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:()=>{f(),v()}})]}),w=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 p;(p=i.tag)!=null&&p.toUpperCase().includes(e.toUpperCase())&&a.push(i)}),b(a),j(e)},placeholder:r.pesquisarAbas,dependenciasADD:[o],btnClear:!0}),y=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(S,{id:"user_tab&"+a,estado:!!e.chats.find(i=>i.id===n),checkedUpdade:()=>{A(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 g.length>0&&l.length===0?s.jsxs("div",{children:[d,w]}):o.length>0?s.jsxs("div",{children:[d,y]}):N}export{Q as default};
