import{j as e}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67155.js";import{r as t}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b6715.js";import{u as d}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671546.js";import{u as E,g as C}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67154.js";import{am as M,u as I,z as L,m as P,n as k,ai as w}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671523.js";import{W as p}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67152.js";import{_ as o,$ as v,T as F,aw as R,ag as S,ax as O,ah as U,k as D,I as z}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67157.js";import{k as V}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671559.js";import{h as B}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671534.js";const W=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b6715138.js")),[]));function N(){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(W,{})})}const q=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b6715139.js")),[]));function H(){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(q,{})})}const $=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b6715140.js")),[]));function G({setUserLabels:s,userLabels:l}){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx($,{setUserLabels:s,userLabels:l})})}const J=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b6715141.js")),[]));function K(){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(J,{})})}const Q=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b6715142.js")),[]));function X({userId:s}){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(Q,{userId:s})})}const Y=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b6715143.js")),[]));function Z({userId:s}){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(Y,{userId:s})})}function ue(){const{language:s}=E(d(a=>({language:a.language}))),{pinChat:l,isPin:f}=M(d(a=>({pin:a.pin,pinChat:a.pinChat,isPin:a.isPin}))),{getUserAbasTam:h}=I(d(a=>({userTabs:a.userTabs,getUserAbasTam:a.getUserAbasTam}))),g=C(a=>a.isBusiness),u=L(a=>a.activeChat.id.user),x=L(a=>a.activeChat?.default_id?._serialized),A=P(a=>a.open),r=k(a=>a.open),y=async()=>{await w("clear_message")!==!0&&(await p.Msg("showClearMsg")?z({type:"Success",message:s.asMensagensApagasForamRecuperadas,position:"top-right"}):z({type:"Error",message:s.nenhumaMensagemApagadaFoiRecuperada,position:"top-right"}))},[i,_]=t.useState(null);return t.useEffect(()=>{g&&(async()=>{try{const n=await p.Labels("getAllLabels"),j=await p.Utils("getContato",x);if(j==="undefined")return;const T=j.labels.map(m=>n.find(c=>c.hexColor&&c.id===m)).filter(Boolean).map(({id:m,name:c,hexColor:b})=>({id:m,name:c,color:b,hexColor:b}));_(T)}catch(n){console.error(s.erroAoBuscarLabels,n)}})()},[x]),[{id:"init_fluxo",name:s.iniciarUmFluxoParaEsteContato,icon:e.jsx(v,{size:20}),function:a=>r(e.jsx(Z,{userId:u}),{placement:"bottom"},a.target,15)},{id:"fixar_chat",name:f()?s.desafixarChat:s.fixarChat,icon:e.jsx(F,{className:f()?"!text-[var(--wds-teal-500)]":"",size:20}),function:()=>l()},{id:"show_clean_messages",name:s.exibirMensagensApagadasRecente,icon:e.jsx(B,{size:20,strokeWidth:"1.8"}),function:()=>y()},{id:"traducao_com_IA",name:s.traducaoComIA,icon:e.jsx(R,{size:20}),function:()=>A(e.jsx(N,{}))},{id:"user_tabs",name:s.userTabs,icon:e.jsx(S,{size:20}),tam:h(u),function:a=>r(e.jsx(H,{}),{placement:"bottom"},a.target,15)},{id:"labels",name:s.tags,icon:i&&i.length>0?e.jsx("div",{className:"flex",children:i.map((a,n)=>e.jsx("span",{style:n!==0?{marginLeft:"-1rem"}:null,children:e.jsx(O,{size:24,style:{color:a.color}})},n))}):e.jsx(U,{size:20}),function:a=>r(e.jsx(G,{setUserLabels:_,userLabels:i}),{placement:"bottom"},a.target.parentNode.parentNode,15),disabled:!g},{id:"transferir_atendimento",name:s.transferirAtendimento,icon:e.jsx(D,{size:20}),function:a=>r(e.jsx(K,{}),{placement:"bottom"},a.target,15)},{id:"close_atendimento",name:s.fimAtendimento_encerrar,icon:e.jsx(V,{size:20}),function:a=>r(e.jsx(X,{userId:u}),{placement:"bottom"},a.target,15)}]}export{ue as R};
