import{j as s,Q as A,J as g,I as b,ah as f,ai as v,aj as C,ak as M,v as _}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e10.js";import{a as o}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e4.js";import{u as c}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e19.js";import{a as p,B as D}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e22.js";import{U as S,a as U}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e123.js";import{a as k}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e107.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e18.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e8.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e5.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e7.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e6.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e2.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e3.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e9.js";const O=({setOpen:n})=>{const{setCreateUserTab:a}=p(),{language:i}=c(),[r,t]=o.useState(""),l=()=>{a(r),b({type:"Success",message:i.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(A,{errorMsg:i.newTab_error,action:l,children:s.jsxs("div",{className:"flex input-group input-group-sm justify-center gap-2",children:[s.jsx("input",{type:"text",placeholder:i.menuTabs_inputPlace,className:"input input-bordered input-sm w-80",value:r,onChange:m=>t(m.target.value),required:!0,minLength:3}),s.jsx(g,{name:i.create})]})})})},E=()=>{const{systemTabs:n,setVisibilitySystemTab:a}=p(),{language:i}=c();return s.jsx("div",{className:"p-3 grid gap-2",children:n.map(t=>t.id===1?null: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",onClick:()=>{a(t.id)},children:[s.jsx("span",{children:i[t.name]}),s.jsx("span",{children:t.visibility?s.jsx(f,{className:"w-5 h-5"}):s.jsx(v,{className:"w-5 h-5"})})]},t.id))})};function I(){const{variaveisWA:n}=D(),{language:a}=c(),{userTabs:i,setVisibilityUserTab:r}=p(),[t,l]=o.useState(""),d=S(),m=U(),[u,w]=o.useState([]),N=e=>{r(e.id),b({type:"Success",message:e.hide?`${e.tag} ${a.menuTab_DesocutarTab}`:`${e.tag} ${a.menuTab_OcutarTab}`,position:"top-right"})},y=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:()=>m(e),children:s.jsx(C,{className:"w-5 h-5"})}),s.jsx("span",{onClick:()=>d(e),children:s.jsx(k,{className:"w-5 h-5"})}),s.jsx("span",{onClick:()=>N(e),children:e.hide===!0?s.jsx(v,{className:"w-5 h-5"}):s.jsx(f,{className:"w-5 h-5"})})]})]},e.id))}),T=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 x=[];i.forEach(h=>{var j;(j=h.tag)!=null&&j.toUpperCase().includes(e.toUpperCase())&&x.push(h)}),w(x),l(e)},placeholder:a.pesquisarAbas,dependenciasADD:[i],btnClear:!0}),t.length>0&&u.length===0?T:y]})}function X(){const{language:n}=c(),[a,i]=o.useState(!1),r=()=>{i(!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:r})})]}),a&&s.jsx(O,{setOpen:i}),s.jsxs("div",{"data-id":"list-abas",className:"overflow-auto",style:a?{maxHeight:"calc(100vh - 235px)"}:{maxHeight:"calc(100vh - 155px)"},children:[s.jsx(E,{}),s.jsx("hr",{className:"h-[1px] mx-4 bg-[var(--border-list)]"}),s.jsx(I,{})]})]})}export{X as default};
