import{j as e,ax as E,ar as u,aL as d,an as v}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b710.js";import{a as i}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b74.js";import{A as b,q as g}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b723.js";import{u as L}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b719.js";import{W as w}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b718.js";import{c as y}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b7104.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b78.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b7.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b75.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b77.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b76.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b79.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b72.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b73.js";function H({onSelect:r,btnCancel:f=!1,labelsRM:x=[]}){const{variaveisWA:o}=b(),{close:l}=g(),{language:n}=L(),[c,h]=i.useState([]),[m,j]=i.useState([]);return i.useEffect(()=>{(async()=>{try{const a=(await w.Labels("getAllLabels")).filter(s=>x.includes(s.id)===!1);h(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(E,{filtragem:t=>{let a=[];c.forEach(s=>{var p;(p=s.name)!=null&&p.toUpperCase().includes(t.toUpperCase())&&a.push(s)}),j(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:[f&&e.jsx(u,{content:n.cancelSelection,icon:e.jsx(y,{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(u,{content:t.name,icon:e.jsx(d,{className:"w-5 h-5",style:{color:t.hexColor}}),setFunction:()=>{r(t.id),l()},stroke:"1"},a)),m.length===0&&e.jsx(v,{icon:e.jsx(d,{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{H as default};
