import{r as i,j as e}from"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b764581.js";import{ak as j,n as E}from"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b76458123.js";import{u as v}from"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b76458120.js";import{aC as b,aw as p,aP as u,at as g}from"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b76458111.js";import{W as w}from"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b76458119.js";import{c as y}from"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b764581106.js";import"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b7645818.js";import"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b7645817.js";import"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b7645814.js";import"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b7645813.js";import"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b7645812.js";import"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b76458110.js";import"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b7645816.js";import"./v_7_4_3_14_49a76bb0-8cf2-4908-a016-18478b7645819.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 w.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(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(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};
