import{j as e,ag as m,V as b,y as g,Z as v,J as y,aK as T}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9910.js";import{a as n}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c994.js";import{aM as l,a as N,p as S,a1 as z}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9923.js";import{u as C,b as M}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9919.js";import{U as F}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9972.js";import{W as P}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9918.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c998.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c99.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c995.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c997.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c996.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c999.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c992.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c993.js";const c=({id:i,name:r,estado:t,fn:o,icon:a})=>e.jsx("div",{className:"w-full",children:e.jsx("label",{htmlFor:i,children:e.jsxs("div",{className:"flex gap-1 items-center cursor-pointer",children:[e.jsx(v,{id:i,estado:t,checkedUpdade:o}),e.jsx(y,{children:r}),a]})})}),k=()=>{const{getSelecionado:i,onChangeSelecionado:r}=l(),[t,o]=n.useState([]);return n.useEffect(()=>{(async()=>o(await P.Labels("getAllLabels")))()},[]),t.map(a=>e.jsx(c,{id:a.id,name:a.name,estado:i(a.id),fn:()=>r(a.id,"labels"),icon:e.jsx(T,{size:20,style:{color:a.hexColor}})}))};function q(){const{active:i,setActive:r,getSelecionado:t,onChangeSelecionado:o}=l(),{language:a}=C(),{isBusiness:u}=M(),{activeTab:p,userTabs:d}=N(),{close:x}=S(),f=["default","labels","userTabs"],h=F();n.useEffect(()=>{p.type!=="custom"&&l.setState({selecionados:[]})},[]);const j={default:[...z,{id:6,name:"transferidos",visibility:!0}].map(s=>s.id!==1&&e.jsx(c,{id:s.name,name:a[s.name],estado:t(s.name),fn:()=>o(s.name,"default"),icon:e.jsx(m,{size:20,className:"text-[var(--primaria)]"})})),labels:e.jsx(k,{}),userTabs:d.length!==0?d.map(s=>e.jsx(c,{id:s.id,name:s.tag,estado:t(s.id),fn:()=>o(s.id,"userTabs",s.chats),icon:e.jsx(m,{size:20,className:"text-[var(--primaria)]"})})):e.jsx("div",{className:"m-auto",children:e.jsx(b,{name:a.create,funcao:()=>{x(),h()}})})};return e.jsxs("div",{className:"w-[350px] p-3",children:[e.jsx(g,{children:a.customFilter}),e.jsx("div",{className:"tabs tabs-bordered mt-4",children:f.map(s=>{if(!(!u&&s==="labels"))return e.jsxs("label",{className:"tab "+(s===i?"tab-active !border-[var(--primaria)]":""),htmlFor:s,children:[e.jsx("span",{children:a["filter_"+s]}),e.jsx("input",{id:s,type:"checkbox",checked:s===i,onChange:()=>r(s),className:"hidden"})]})})}),e.jsx("div",{className:"flex gap-1 flex-col mt-4 overflow-y-auto",style:{maxHeight:"30vh"},children:j[i]})]})}export{q as default};
