import{j as e}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f775.js";import{r as i}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f77.js";import{ac as j,n as E}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7723.js";import{u as v}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f774.js";import{al as b,af as p,ax as u,ac as g}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f777.js";import{W as w}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f772.js";import{c as y}from"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f77107.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f773.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f779.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7710.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7720.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f778.js";import"./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f776.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 t=(await w.Labels("getAllLabels")).filter(s=>f.includes(s.id)===!1);x(t)}catch(a){console.error("Erro ao buscar labels:",a)}})()},[]),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:a=>{let t=[];c.forEach(s=>{s.name?.toUpperCase().includes(a.toUpperCase())&&t.push(s)}),h(t)},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((a,t)=>a.name.localeCompare(t.name)).map((a,t)=>e.jsx(p,{content:a.name,icon:e.jsx(u,{className:"w-5 h-5",style:{color:a.hexColor}}),setFunction:()=>{r(a.id),l()},stroke:"1"},t)),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};
