import{r as i,j as e}from"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f6.js";import{al as j,n as E}from"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f623.js";import{u as v}from"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f620.js";import{ax as b,ar as p,aL as u,ao as g}from"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f611.js";import{W as L}from"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f619.js";import{c as w}from"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f6105.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f68.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f67.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f64.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f63.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f62.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f610.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f66.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f69.js";function z({onSelect:r,btnCancel:d=!1,labelsRM:f=[]}){const{variaveisWA:o}=j(),{close:l}=E(),{language:n}=v(),[c,x]=i.useState([]),[m,h]=i.useState([]);return i.useEffect(()=>{(async()=>{try{const a=(await L.Labels("getAllLabels")).filter(s=>f.includes(s.id)===!1);x(a)}catch(t){console.error("Erro ao buscar labels:",t)}})()},[]),e.jsx("div",{style:{position:"initial"},children:e.jsx("ul",{className:"overflow-hidden flex "+o.modalOptions.content2,children:e.jsxs("div",{className:o.modalOptions.content3,children:[e.jsx(b,{filtragem:t=>{let a=[];c.forEach(s=>{s.name?.toUpperCase().includes(t.toUpperCase())&&a.push(s)}),h(a)},placeholder:n.pesquisarEtiquetas,dependenciasADD:[c],btnClear:!0}),e.jsxs("div",{className:"max-w-[300px] overflow-x-hidden overflow-y-auto "+o.listagem.content1,style:{maxHeight:"calc(100vh - 63px)"},children:[d&&e.jsx(p,{content:n.cancelSelection,icon:e.jsx(w,{className:"w-5 h-5 text-red-500"}),setFunction:()=>{r(""),l()},stroke:"1"}),m.slice().sort((t,a)=>t.name.localeCompare(a.name)).map((t,a)=>e.jsx(p,{content:t.name,icon:e.jsx(u,{className:"w-5 h-5",style:{color:t.hexColor}}),setFunction:()=>{r(t.id),l()},stroke:"1"},a)),m.length===0&&e.jsx(g,{icon:e.jsx(u,{className:"w-5 h-5 text-[var(--primaria)]"}),title:"Nenhuma Etiqueta foi Encontrada",description:"Nenhuma Etiqueta foi criada. Crie uma para começar a utilizár essa funcionalidade"})]})]})})})}export{z as default};
