import{j as e,_ as f,$ as j,ao as A,b5 as v,Q as g,ai as b,a1 as N,h as w,I as y}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf10.js";import{aV as C,aW as _,aX as E,o as z}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf23.js";import{u as L}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf19.js";import{a as n}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf4.js";import{a as k}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf109.js";import{b as O}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf41.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf18.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf6.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf8.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf5.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf7.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf9.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf2.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf3.js";const M=n.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf165.js")),[]));function i(){return e.jsx(n.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(M,{})})}function H(){const{autoAtendimento:a,deleteAutoAtendimento:r,switchActive:l,duplicateAutoAtendimento:d}=C(),{setEditAutoAtt:c,setResetDefaultAutoAtt:m}=_(),{setAcao:p}=E(),{open:o}=z(),{language:s}=L(),x=async t=>{w({content:e.jsxs(e.Fragment,{children:[s.desejaRemoverAutoAtendimento," ",e.jsx("span",{className:"text-[var(--primaria)]",children:t.nome}),"?"]}),confirmText:s.confirm,submit:()=>{r(t.id),y({type:"Success",message:s.autoAtendimentoDeletado,position:"top-right"})}})},u=t=>{p(t.acao),c(t),o(e.jsx(i,{}))},h=e.jsx("div",{className:"flex flex-col gap-2 overflow-auto max-h-full",children:a.map(t=>e.jsxs("div",{className:"rounded-2xl cursor-pointer border border-[var(--conversation-header-border)] border-solid w-full px-2 py-1 hover:bg-[var(--background-default-active)] flex justify-between gap-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h2",{className:"text-lg font-bold",children:t.nome}),e.jsxs("div",{className:"flex justify-start gap-2 items-center h-9 px-1 pt-2",children:[e.jsx("span",{children:s.active}),e.jsx(j,{estado:t.active,switchUpdate:()=>l(t.id),id:t.id,zoom:{zoom:"60%"}})]})]}),e.jsxs("div",{className:"flex flex-col justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[e.jsx("span",{className:"pulse lg:tooltip lg:tooltip-bottom",onClick:()=>u(t),"data-tip":s.edit,children:e.jsx(A,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})}),e.jsx("span",{className:"pulse lg:tooltip lg:tooltip-bottom",onClick:()=>x(t),"data-tip":s.delete,children:e.jsx(k,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})}),e.jsx("span",{className:"pulse lg:tooltip lg:tooltip-left",onClick:()=>d(t.id),"data-tip":s.duplic,children:e.jsx(v,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})})]}),t.usedLenght!==0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-bold text-sm",children:s.atendimentosRealizados}),e.jsx("div",{className:"badge badge-sm bg-[var(--primaria)] text-[var(--letra)] font-bold pb-[2px]",children:t.usedLenght})]})]})]}))});return e.jsxs("div",{className:"w-[800px] max-h-[99.5vh] flex flex-col gap-4",children:[e.jsx(g,{children:s.autoAtendimento}),a.length===0?e.jsx(b,{title:s.nenhumAutoAtendimentoCriado_title,description:s.nenhumAutoAtendimentoCriado_desc,icon:e.jsx(O,{className:"w-7 h-7 text-[var(--primaria)]"})}):e.jsx("div",{className:"flex-1 overflow-y-auto",children:h}),e.jsx("div",{className:"m-auto",children:e.jsx(N,{name:s.create,funcao:()=>{m(),o(e.jsx(i,{}),!1)}})})]})}export{H as default};
