import{j as s}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a53.js";import{a as o}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a52.js";import{u as p}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a54.js";import{a as h,ac as N}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a525.js";import{c as T,H as g,I as j,ax as A,ay as y,az as C,aA as M,D as _}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a58.js";import{U,a as D}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a5141.js";import{a as O}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a5125.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a55.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a56.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a59.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a510.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a57.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a5.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a520.js";const k=({setOpen:n})=>{const{setCreateUserTab:a}=h(),{language:t}=p(),[i,r]=o.useState(""),c=()=>{a(i),j({type:"Success",message:t.newTab_success,position:"top-right"}),n(!1)};return s.jsx("div",{className:"form-control my-3 p-3 animate__animated animate__fadeInDown",children:s.jsx(T,{errorMsg:t.newTab_error,action:c,children:s.jsxs("div",{className:"flex input-group input-group-sm justify-center gap-2",children:[s.jsx("input",{type:"text",placeholder:t.menuTabs_inputPlace,className:"input input-bordered input-sm w-80",value:i,onChange:l=>r(l.target.value),required:!0,minLength:3}),s.jsx(g,{name:t.create})]})})})};function E(){const{variaveisWA:n}=N(),{language:a}=p(),{userTabs:t,setVisibilityUserTab:i}=h(),[r,c]=o.useState(""),m=U(),l=D(),[u,b]=o.useState([]),f=e=>{i(e.id),j({type:"Success",message:e.hide?`${e.tag} ${a.menuTab_DesocutarTab}`:`${e.tag} ${a.menuTab_OcutarTab}`,position:"top-right"})},v=s.jsx("div",{className:"pb-3 px-3 grid gap-2",children:u.map(e=>s.jsxs("div",{className:"flex justify-between cursor-pointer items-center hover:bg-[var(--dropdown-background-hover)] h-9 px-1 py-2 rounded pulse",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]",children:e.tag}),s.jsx("span",{className:n.aba+"tam-aba",style:{backgroundColor:"var(--primaria)"},children:e.chats.length})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{onClick:()=>l(e),children:s.jsx(A,{className:"w-5 h-5"})}),s.jsx("span",{onClick:()=>m(e),children:s.jsx(O,{className:"w-5 h-5"})}),s.jsx("span",{onClick:()=>f(e),children:e.hide===!0?s.jsx(y,{className:"w-5 h-5"}):s.jsx(C,{className:"w-5 h-5"})})]})]},e.id))}),w=s.jsx("div",{className:"p-4 text-center",children:s.jsx("span",{children:a.notFound})});return s.jsxs("div",{className:"pt-2",children:[s.jsx(M,{filtragem:e=>{let d=[];t.forEach(x=>{x.tag?.toUpperCase().includes(e.toUpperCase())&&d.push(x)}),b(d),c(e)},placeholder:a.pesquisarAbas,dependenciasADD:[t],btnClear:!0}),r.length>0&&u.length===0?w:v]})}function J(){const{language:n}=p(),[a,t]=o.useState(!1),i=()=>{t(!a)};return s.jsxs("div",{className:"w-[25rem]",children:[s.jsxs("div",{className:"p-3 flex items-center justify-between",children:[s.jsx("span",{className:"w-full",children:s.jsx(_,{children:n.menuTabs_title})}),s.jsx("span",{className:"w-[125px]",children:s.jsx(g,{name:n.newTab,funcao:i})})]}),a&&s.jsx(k,{setOpen:t}),s.jsx("div",{"data-id":"list-abas",className:"overflow-auto",style:a?{maxHeight:"calc(100vh - 235px)"}:{maxHeight:"calc(100vh - 155px)"},children:s.jsx(E,{})})]})}export{J as default};
