import{j as e,r as f}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b.js";import{u as y,a as A,d as C}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b20.js";import{E as b,y as w,m as k,J as N,v as M,H as v,ah as j,n as z,C as I}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b23.js";import{_ as T,Q as S,aS as E,aT as D,aU as P,e as R,I as F,aV as K,aW as $}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b11.js";import{S as B}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b146.js";import{W as O}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b19.js";import{i as U}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b35.js";import{R as W}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b147.js";import{I as Z}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b108.js";import{u as _}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b47.js";import{m as H}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b9.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b8.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b7.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b4.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b3.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b2.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b10.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b6.js";const V=f.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b145.js")),[]));function Y(){return e.jsx(f.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(V,{})})}function J(){return(t,r=[])=>{f.useEffect(()=>(document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}),[...r])}}const h=({text:s,id:t})=>{const{textAssistente:r,assistente:o,setAssistente:i,reloadText:l}=b(),{open:m}=z(),{activePerfil:c,updateActivePerfil:x}=I(),{icons_cor_primaria:p}=C(_(a=>({icons_cor_primaria:a.icons_cor_primaria})));J()(a=>{a.altKey&&a.key==="y"&&o.active&&l(),a.altKey&&a.key==="1"&&i("model","tradutor"),a.altKey&&a.key==="2"&&i("model","corretor_ortografico"),a.altKey&&a.key==="3"&&i("model","otimizador_texto")},[o]);const d=e.jsx("div",{className:"flex items-center gap-1 border border-[var(--terciaria)] border-solid rounded-lg p-1 cursor-pointer pulse w-fit lg:tooltip "+(p?" hover:bg-[var(--terciaria)]":" hover:bg-[var(--menu-bar-item-background-active)]")+(o.model===t?" !bg-[var(--primaria)] !text-[var(--letra)]":"")+(r.split(`
`).length-1<=1&&t==="tradutor"?" before:!ml-4":"")+(r.split(`
`).length-1<=1&&t!=="tradutor"?" before:!w-28":"")+(r.split(`
`).length-1>1?" lg:tooltip-right":" lg:tooltip-top"),onClick:()=>i("model",t),"data-tip":s,children:e.jsxs("span",{children:[t==="tradutor"&&e.jsx(K,{size:20}),t==="otimizador_texto"&&e.jsx(U,{size:20}),t==="corretor_ortografico"&&e.jsx(H,{size:20})]})});return t==="tradutor"&&o.model==="tradutor"?e.jsxs("div",{className:"flex gap-2",children:[d,e.jsx("div",{className:"bg-[var(--search-input-background)] text-[var(--panel-header-icon)] border border-solid border-[var(--terciaria)] rounded-xl pulse",style:{zoom:"70%"},onClick:a=>m(e.jsx(B,{onSelect:g=>{x("idioma",g.label),setTimeout(()=>l(),1e3)}}),{placement:"left"},a.currentTarget,0),children:e.jsx($,{name:"",estado:c.idioma&&c.idioma.length!==0?c.idioma:"English"})})]}):d};function ge(){const{language:s}=y(),{textAssistente:t,reloadText:r,sendAssistenteMenssage:o}=b(),{assinatura:i}=w(),{open:l}=k(),{IA:m}=N(),c=A(n=>n.session),x=M(n=>n.activeChat?.id?.user),{icons_cor_primaria:p,iawascript:u}=C(_(n=>({icons_cor_primaria:n.icons_cor_primaria,iawascript:n.getUrl("principais","iawascript")}))),d=async()=>{await j("assistente_chat")||(R(t),F({type:"Success",message:s.mensagemCopiada,position:"top-right"}))},a=async()=>{await j("assistente_chat")||O.Chat("setInputText",{txt:t,id:x})},g=e.jsx("div",{className:"x1f6kntn x1fc57z9 x40yjcy",children:e.jsx("span",{dir:"auto",className:"_ao3e pr-8",children:s.digiteUmaMensagemIniciar})}),L=e.jsxs("div",{className:"x1f6kntn x1fc57z9 x40yjcy flex flex-col  gap-2",children:[e.jsx("span",{dir:"auto",className:"_ao3e font-bold",children:s.AtivarFuncionalidadesAssistenteChat}),e.jsx(S,{name:s.ativarIA,funcao:()=>l(e.jsx(v,{}))})]});return e.jsxs("div",{className:"flex justify-between pt-2 pb-[20px]",children:[e.jsxs("div",{className:(t.split(`
`).length-1>1?"w-[120px] flex-col":"w-[205px] flex-nowrap")+(p?" text-[var(--primaria)]":" text-[var(--panel-header-icon)]")+" flex gap-2 m-auto px-[10px]",children:[e.jsx(h,{text:s.tradutor,id:"tradutor"}),e.jsx(h,{text:s.corretorOrtografico,id:"corretor_ortografico"}),e.jsx(h,{text:s.aprimoramentoTexto,id:"otimizador_texto"}),u.active&&e.jsx("div",{className:"flex items-center gap-1 border border-[var(--terciaria)] border-solid rounded-lg p-1 cursor-pointer pulse w-fit lg:tooltip "+(p?" hover:bg-[var(--terciaria)]":" hover:bg-[var(--menu-bar-item-background-active)]"),"data-tip":"Agente IA",onClick:()=>window.open(`${u.link}${c.is_premium?"/?clientePremium":""}`,"_blanck"),children:e.jsx("span",{className:"size-5",children:e.jsx(Z,{color:"var(--primaria)"})})})]}),e.jsxs("div",{className:(p?"text-[var(--primaria)]":"text-[var(--panel-header-icon)]")+" w-full flex gap-3 mr-10 items-center",children:[e.jsx("div",{className:"w-full flex justify-center",children:m.activeIA?t.length===0?g:e.jsxs("div",{className:"chat chat-end items-center",children:[e.jsx("div",{className:"chat-bubble text-[var(--primary-strong)]  max-h-[250px] max-w-full bg-[var(--outgoing-background)]",style:{boxShadow:"7px 5px 4px #0000001c"},children:e.jsxs("div",{className:"overflow-y-auto overflow-x-hidden w-full h-full p-[2px] max-h-[140px]",children:[i.active&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:e.jsxs("strong",{className:"italic text-sm",children:[i.name,":"]})}),e.jsx("br",{})]}),e.jsx("span",{className:"text-sm",dangerouslySetInnerHTML:{__html:t.replace(/\*\_(.*?)\_\*/g,'<strong class="italic">$1</strong>').replace(/\_(.*?)\_/g,'<i class="italic">$1</i>').replace(/\*(.*?)\*/g,"<strong>$1</strong>").replace(/\n/g,"<br>")},style:{overflowWrap:"break-word"}})]})}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"cursor-pointer lg:tooltip pulse lg:tooltip-top","data-tip":s.copiarMensagem,onClick:d,children:e.jsx(E,{size:20})}),e.jsx("span",{className:"cursor-pointer lg:tooltip pulse lg:tooltip-top","data-tip":s.inserirMensagemEditor,onClick:a,children:e.jsx(W,{size:23})})]})]}):L}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"cursor-pointer lg:tooltip pulse lg:tooltip-left","data-tip":s.gerarMensagem,onClick:r,children:e.jsx(D,{size:24})}),e.jsx("span",{"data-icon":"send",className:"m-auto pulse cursor-pointer lg:tooltip","data-tip":s.enviar,onClick:o,children:e.jsx("svg",{viewBox:"0 0 24 24",height:"24",width:"24",preserveAspectRatio:"xMidYMid meet",version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 24 24",children:e.jsx("path",{fill:"currentColor",d:"M1.101,21.757L23.8,12.028L1.101,2.3l0.011,7.912l13.623,1.816L1.112,13.845 L1.101,21.757z"})})})]}),e.jsx("span",{className:"!absolute right-1 top-1 lg:tooltip lg:tooltip-left pulse cursor-pointer","data-tip":s.teclasDeAtalho,onClick:()=>l(e.jsx(Y,{})),children:e.jsx("svg",{viewBox:"0 0 24 24",height:"24",width:"24",preserveAspectRatio:"xMidYMid meet",version:"1.1",children:e.jsx("path",{fill:"currentColor",d:"M 10.851562 12.648438 L 13.148438 12.648438 L 12 9 Z M 20 8.691406 L 20 6 C 20 4.898438 19.101562 4 18 4 L 15.308594 4 L 13.410156 2.101562 C 12.628906 1.320312 11.359375 1.320312 10.582031 2.101562 L 8.691406 4 L 6 4 C 4.898438 4 4 4.898438 4 6 L 4 8.691406 L 2.101562 10.589844 C 1.320312 11.371094 1.320312 12.640625 2.101562 13.421875 L 4 15.320312 L 4 18 C 4 19.101562 4.898438 20 6 20 L 8.691406 20 L 10.589844 21.898438 C 11.371094 22.679688 12.640625 22.679688 13.421875 21.898438 L 15.320312 20 L 18 20 C 19.101562 20 20 19.101562 20 18 L 20 15.308594 L 21.898438 13.410156 C 22.679688 12.628906 22.679688 11.359375 21.898438 10.578125 Z M 14.089844 15.398438 L 13.601562 14 L 10.398438 14 L 9.910156 15.398438 C 9.78125 15.761719 9.449219 16 9.070312 16 C 8.449219 16 8.019531 15.390625 8.230469 14.808594 L 10.671875 7.949219 C 10.871094 7.378906 11.398438 7 12 7 C 12.601562 7 13.128906 7.378906 13.339844 7.941406 L 15.78125 14.800781 C 15.988281 15.378906 15.558594 15.988281 14.941406 15.988281 C 14.550781 16 14.21875 15.761719 14.089844 15.398438 Z M 14.089844 15.398438 "})})}),e.jsx("span",{className:"!absolute right-1 top-[30px] lg:tooltip lg:tooltip-left pulse cursor-pointer","data-tip":s.ia_config,onClick:()=>l(e.jsx(v,{})),children:e.jsx(P,{size:24})})]})]})}export{ge as default};
