import{r as i,j as e}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a2777.js";import{al as j,n as E}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277723.js";import{u as v}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277720.js";import{ax as b,ar as p,aL as u,ao as g}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277711.js";import{W as L}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277719.js";import{c as w}from"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a2777105.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27778.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27777.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27774.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27773.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27772.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a277710.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27776.js";import"./v_7_4_3_5_5680d44b-ceb1-449a-bec3-8cbef70a27779.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 L.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(w,{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};
