import{j as e,ak as E,ae as u,aH as d,ab as b}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b10.js";import{a as i}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b4.js";import{D as v,p as g}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b23.js";import{u as w}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b19.js";import{W as y}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b18.js";import{d as L}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b74.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b8.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b5.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b7.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b6.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b9.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b2.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b3.js";function z({onSelect:r,btnCancel:f=!1,labelsRM:x=[]}){const{variaveisWA:o}=v(),{close:l}=g(),{language:n}=w(),[c,h]=i.useState([]),[m,j]=i.useState([]);return i.useEffect(()=>{(async()=>{try{const a=(await y.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(L,{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(b,{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{z as default};
