import{r as i,j as e}from"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a71.js";import{A as j,q as E}from"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7124.js";import{u as v}from"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7120.js";import{au as b,ao as p,aI as u,al as g}from"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7111.js";import{W as w}from"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7119.js";import{c as y}from"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a71105.js";import"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a717.js";import"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a719.js";import"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a716.js";import"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a718.js";import"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a714.js";import"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a713.js";import"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a712.js";import"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7110.js";function U({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{U as default};
