import{j as e,V as n,bc as c,I as i}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab710.js";import{a as p}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab76.js";import{p as l,y as m}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab723.js";import{b as d}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab719.js";import{b as u,c as g}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7108.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab718.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab78.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab74.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab75.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab77.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab79.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab72.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab73.js";const h=async o=>{const{activeChat:a}=m.getState(),{whatsappID:t}=d.getState(),s={status:o.status,phone:a.id.user,whatsappID:t};try{const r=await p.post("https://n8n.etivi.com/webhook/etivi-start-stop-ia",s,{headers:{"Content-Type":"application/json",accept:"application/json"}});i({type:"Success",message:`Sucesso ao realizar a ação de ${o.nome} para esse chat`,position:"top-right"})}catch(r){console.error(r),i({type:"Error",message:`Erro ao realizar a ação de ${o.nome} para esse chat `,position:"top-right"})}},x=[{nome:"Iniciar Agente",status:"opened",colorIcon:"text-green-500",icon:e.jsx(u,{size:22})},{nome:"Parar Agente",status:"closed",colorIcon:"text-red-500",icon:e.jsx(g,{size:22})}];function T(){const{close:o}=l();return e.jsxs("div",{className:"px-2 w-fit",children:[e.jsxs("div",{className:"flex gap-1 items-center justify-center",children:[e.jsx(n,{style:{fontSize:"18px",textAlign:"center"},children:"Agente IA"}),e.jsx("span",{className:"group cursor-pointer lg:tooltip lg:tooltip-right","data-tip":"Determine uma ação que o agente deverá executar neste chat",children:e.jsx(c,{className:"h-4 w-4 group-hover:pulse"})})]}),e.jsx("div",{className:"flex flex-col gap-1 mt-2",children:x.map((t,s)=>e.jsxs("div",{className:"flex gap-1 pulse cursor-pointer items-center p-1 rounded-lg hover:bg-[var(--dropdown-background-hover)]",onClick:()=>{h(t),o()},children:[e.jsx("span",{className:t.colorIcon,children:t.icon}),e.jsx("span",{children:t.nome})]},s))})]})}export{T as default};
