import{j as e}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c195.js";import{r as i}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c19.js";import{ac as j,n as E}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c1923.js";import{u as v}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c194.js";import{al as b,af as p,ax as u,ac as g}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c197.js";import{W as w}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c192.js";import{c as y}from"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c19107.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c193.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c199.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c1910.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c1920.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c198.js";import"./v_7_4_3_20_36aa665d-161a-48bb-8a6b-20d06cac9c196.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};
