PageSourceSearch

https://novo.gruposvip.com/assets/WhatsApp-BXoF8Tke.js

js gruposvip.com collected 2026-09-26 08:44:12 UTC 21,731 bytes, 1 lines download raw bytes

1import{j as e,b as O,u as le,c as me}from"./query-Q_ThwKGI.js";import{s as f}from"./client-DjLwxtrO.js";import{u as F}from"./AuthProvider-BSQZ2YtM.js";import{C as ie,b as pe,c as ue,d as xe,a as he}from"./card-DYyqUxY6.js";import{r as j,i as ge}from"./react-vendor-wefok28f.js";import{B as D}from"./button-DrepnwkX.js";import{B as T}from"./badge-u_30_p7s.js";import{A as K,b as $}from"./alert-CxLwTMWl.js";import{A as fe,a as je,b as ve,c as we,d as be,e as ye,f as Ne,g as _e}from"./alert-dialog-BzFKdENb.js";import{u as re}from"./index-C4Kq7kkR.js";import{u as Y}from"./useTranslation-DNoH3foE.js";import{S as L,L as E,B as Ce,a2 as ke,aA as J,aB as Z,aC as Se,Y as De,a1 as Ae,q as oe,M as H,aD as Pe,a0 as Re,H as Ee,O as qe,j as Be,an as We,ap as Le,o as Oe,a3 as Fe,aE as Me,r as Te}from"./icons-By8asZST.js";import{S as Ke}from"./switch-CnLyyNmH.js";import{i as $e,a as Ie}from"./isYesterday-CGiRJIKk.js";import{p as ze}from"./pt-BR-9-TZCPQM.js";import{e as Ge,f as Ue}from"./format-NnwPU_mP.js";import{f as Qe}from"./formatDistanceToNow-g8DDsg0V.js";import{R as Ye,z as He,B as Ve,X as Xe,Y as Je,E as Ze,I as es,F as I}from"./LineChart-CjBOByky.js";import{u as ss}from"./useSubscription-svlizlcK.js";import{P as as}from"./ProFeatureGate-CXf1Td84.js";import"./supabase-COHOFxoQ.js";import"./index-DC33WZD-.js";import"./index-DviHZN-M.js";import"./index-CSO0Tzy2.js";import"./subDays-rNULONAo.js";import"./tiny-invariant-BaFNuDhB.js";import"./PlanFeatureChecklist-BdN1LsxW.js";const ee=async a=>{var c,r;const{data:s}=await f.auth.getSession();let o=(c=s.session)==null?void 0:c.access_token;if(!o){const{data:l}=await f.auth.refreshSession();o=(r=l.session)==null?void 0:r.access_token}if(!o)throw new Error("No active session. Please sign in again.");return f.functions.invoke(a,{headers:{Authorization:`Bearer ${o}`}})},se=!0,ts=({onInstanceChange:a})=>{const{t:s}=Y("groups"),{toast:o}=re(),[c,r]=j.useState(null),[l,x]=j.useState(!0),[d,t]=j.useState(!1),[m,h]=j.useState(!1);j.useState(!1);const[g,p]=j.useState(!1),[C,A]=j.useState(null),k=j.useRef(null),y=j.useCallback(()=>{k.current&&(window.clearInterval(k.current),k.current=null)},[]),N=j.useCallback(async()=>{const{data:i,error:b}=await ee("uazapi-instance-status");return b?(console.error(b),null):i!=null&&i.exists&&i.instance?(r(i.instance),a==null||a(i.instance),i.instance.status==="connected"&&(A(null),y()),i.instance):(r(null),a==null||a(null),null)},[y,a]);j.useEffect(()=>((async()=>(x(!0),await N(),x(!1)))(),()=>y()),[N,y]);const n=async()=>{{o({title:s("common:info","Info"),description:s("whatsapp.newConnectionsDisabled")});return}},u=async()=>{{o({title:s("common:info","Info"),description:s("whatsapp.newConnectionsDisabled")});return}},_=async()=>{p(!1);try{const{error:i}=await ee("uazapi-disconnect-instance");if(i)throw i;A(null),y(),await N(),o({title:s("whatsapp.disconnected_toast")})}catch(i){o({title:s("common:error","Error"),description:i.message,variant:"destructive"})}},P=i=>i==="connected"?e.jsxs(T,{className:"bg-success/10 text-success border-none",children:[e.jsx(De,{className:"h-3 w-3 mr-1"})," ",s("whatsapp.connected")]}):i==="connecting"?e.jsxs(T,{className:"bg-amber-500/10 text-amber-600 border-none",children:[e.jsx(E,{className:"h-3 w-3 mr-1 animate-spin"})," ",s("whatsapp.connecting")]}):e.jsxs(T,{variant:"outline",className:"text-muted-foreground",children:[e.jsx(Ae,{className:"h-3 w-3 mr-1"})," ",s("whatsapp.disconnected")]});return e.jsxs(e.Fragment,{children:[e.jsxs(ie,{className:"rounded-2xl border-border/50",children:[e.jsxs(pe,{children:[e.jsxs(ue,{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-5 w-5"}),s("whatsapp.connectionTitle"),c&&P(c.status)]}),e.jsx(xe,{children:s("whatsapp.connectionDescription")})]}),e.jsxs(he,{className:"space-y-4",children:[e.jsx(K,{children:e.jsx($,{children:s("whatsapp.newConnectionsDisabled")})}),l?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(E,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):c?c.status==="connected"?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border/50 bg-muted/30 p-4 space-y-2",children:[c.connected_phone&&e.jsxs("p",{className:"text-sm flex items-center gap-2",children:[e.jsx(Ce,{className:"h-4 w-4 text-muted-foreground"})," ",c.connected_phone]}
1),c.profile_name&&e.jsxs("p",{className:"text-sm flex items-center gap-2",children:[e.jsx(ke,{className:"h-4 w-4 text-muted-foreground"})," ",c.profile_name]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("whatsapp.instanceLabel"),": ",c.instance_name]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(D,{variant:"outline",size:"sm",onClick:N,children:[e.jsx(J,{className:"h-4 w-4 mr-2"})," ",s("whatsapp.checkStatus")]}),e.jsxs(D,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[e.jsx(Z,{className:"h-4 w-4 mr-2"})," ",s("whatsapp.disconnect")]})]})]}):e.jsxs("div",{className:"space-y-4",children:[C?e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"rounded-xl border border-border/50 bg-white p-3",children:e.jsx("img",{src:C,alt:"WhatsApp QR Code",className:"w-64 h-64"})}),e.jsx("p",{className:"text-sm text-muted-foreground text-center max-w-xs",children:s("whatsapp.qrInstructions")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:c.status==="connecting"?s("whatsapp.qrWaiting"):s("whatsapp.qrExpired")})]}):e.jsx(K,{children:e.jsx($,{children:s("whatsapp.notConnectedYet")})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(D,{onClick:u,disabled:m||se,children:m?e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"h-4 w-4 mr-2 animate-spin"})," ",s("whatsapp.generating")]}):e.jsxs(e.Fragment,{children:[e.jsx(Se,{className:"h-4 w-4 mr-2"})," ",s(C?"whatsapp.generateNewQr":"whatsapp.connectInstance")]})}),e.jsxs(D,{variant:"outline",onClick:N,children:[e.jsx(J,{className:"h-4 w-4 mr-2"})," ",s("whatsapp.checkStatus")]}),e.jsxs(D,{variant:"outline",onClick:()=>p(!0),children:[e.jsx(Z,{className:"h-4 w-4 mr-2"})," ",s("whatsapp.disconnect")]})]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(K,{children:e.jsx($,{children:s("whatsapp.noInstance")})}),e.jsx(D,{onClick:n,disabled:d||se,children:d?e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"h-4 w-4 mr-2 animate-spin"})," ",s("whatsapp.creating")]}):s("whatsapp.createInstance")})]})]})]}),e.jsx(fe,{open:g,onOpenChange:p,children:e.jsxs(je,{children:[e.jsxs(ve,{children:[e.jsx(we,{children:s("whatsapp.disconnectConfirmTitle")}),e.jsx(be,{children:s("whatsapp.disconnectConfirmDescription")})]}),e.jsxs(ye,{children:[e.jsx(Ne,{children:s("whatsapp.disconnectCancel")}),e.jsx(_e,{onClick:_,children:s("whatsapp.disconnectConfirm")})]})]})})]})},ae=()=>{const{user:a}=F(),{data:s}=O({queryKey:["whatsapp-kpis",a==null?void 0:a.id],queryFn:async()=>{if(!(a!=null&&a.id))return{sent:0,campaigns:0,groups:0};const{data:o}=await f.from("campaigns").select("id, whatsapp_enabled").eq("user_id",a.id),c=(o||[]).filter(x=>x.whatsapp_enabled).map(x=>x.id);let r=0,l=0;if(c.length){const{count:x}=await f.from("message_logs").select("*",{count:"exact",head:!0}).in("campaign_id",c).eq("delivery_status","sent");r=x||0;const{count:d}=await f.from("campaign_groups").select("*",{count:"exact",head:!0}).in("campaign_id",c);l=d||0}return{sent:r,campaigns:c.length,groups:l}},enabled:!!(a!=null&&a.id)});return e.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsx(ts,{})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(z,{icon:oe,label:"Mensagens enviadas",value:(s==null?void 0:s.sent)??0}),e.jsx(z,{icon:H,label:"Campanhas com WhatsApp",value:(s==null?void 0:s.campaigns)??0}),e.jsx(z,{icon:Pe,label:"Grupos ativos",value:(s==null?void 0:s.groups)??0})]})]})},z=({icon:a,label:s,value:o})=>e.jsxs(ie,{className:"rounded-2xl border-border/50 shadow-sm p-4 flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(a,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s}),e.jsx("p",{className:"text-xl font-semibold",children:o.toLocaleString()})]})]}),ns=()=>{const{user:a}=F(),s=ge(),{toast:o}=re(),{t:c}=Y("groups"),r=le(),{data:l}=O({queryKey:["whatsapp-connected-campaigns",a==null?void 0:a.id],queryFn:async()=>{const{data:t}=await f.from("campaigns").select("id, name, whatsapp_enabled, campaign_groups(id)").eq("user_id",a.id).neq("status","archived").order("created_at",{ascending:!1});return t||[]},enabled:!!(a!=null&&a.id)}),x=me({mutationFn:async({id:t,enabled:m})=>{const{error:h}=await f.from("campaigns").update({whatsapp_enabled:m}).eq("id",t);if(h)throw h},onSuccess:()=>{r.invalidateQueries({queryKey:["whatsapp-connected-campaigns"]}),r.invalidateQueries({queryKey:["whatsapp-kpis"]}),o({title:c("whatsappPage.connectedCampaigns.updated")})}}),d=t=>s(`/app/groups?edit=${t}`);return l!=null&&l.length?e.jsx("div",{className:"divide-y divide-border/50",children:l.map(t=>e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>d(t.id),onKeyDown:m=>{m.key==="Enter"&&d(t.id)},className:"flex items-center gap-3 py-3 cursor-pointer hover:bg-muted/40 -mx-2 px-2 rounded-lg transition-colors",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(H,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold truncate",children:t.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:c("whatsappPage.connectedCampaigns.groupCount",{count:(t.campaign_groups||[]).length})})]}),e.jsx("div",{onClick:m=>m.stopPropagation(),children:e.jsx(Ke,{checked:!!t.whatsapp_enabled,onCheckedChange:m=>x.mutate({id:t.id,enabled:m})})}),e.jsx(Re,{className:"h-4 w-4 text-muted-foreground"})]},t.id))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:c("whatsappPage.connectedCampaigns.empty")})},is=()=>{const{user:a}=F(),{t:s,i18n:o}=Y("groups"),c=o.language==="pt-BR"?ze:Ge,{data:r,isLoading:l}=O({queryKey:["whatsapp-recent-activity-timeline",a==null?void 0:a.id],queryFn:async()=>{const{data:d}=await f.from("campaigns").select("id, name").eq("user_id",a.id),t=(d||[]).map(n=>n.id),m=Object.fromEntries((d||[]).map(n=>[n.id,n.name])),{data:h}=await f.from("whatsapp_groups").select("id, name").eq("user_id",a.id),g=Object.fromEntries((h||[]).map(n=>[n.id,n.name])),[p,C]=await Promise.all([t.length?f.from("message_logs").select("id, message_type, delivery_status, created_at, campaign_id, group_id, message_content").in("campaign_id",t).order("created_at",{ascending:!1}).limit(20):Promise.resolve({data:[]}),t.length?f.from("lead_group_activities").select("id, activity_type, phone, 
1created_at, campaign_id, group_id, activity_data, lead_id").in("campaign_id",t).order("created_at",{ascending:!1}).limit(20):Promise.resolve({data:[]})]),A=Array.from(new Set((C.data||[]).map(n=>n.lead_id).filter(Boolean)));let k={};if(A.length){const{data:n}=await f.from("leads").select("id, name, email, phone, whatsapp_phone").in("id",A);k=Object.fromEntries((n||[]).map(u=>[u.id,u]))}const y=(p.data||[]).map(n=>{var R;const u=n.delivery_status==="sent",_=g[n.group_id],P=m[n.campaign_id],i=n.message_type==="welcome"?"whatsappPage.activity.actions.welcomeSent":"whatsappPage.activity.actions.messageSent",b=[_?s("whatsappPage.activity.inGroup",{group:_}):null,P].filter(Boolean).join(" · ");return{id:`m-${n.id}`,when:n.created_at,icon:u?Ee:qe,iconClass:u?"text-emerald-600 bg-emerald-500/10":"text-amber-600 bg-amber-500/10",title:s(i),subtitle:b,details:((R=n.message_content)==null?void 0:R.slice(0,140))||void 0}}),N=(C.data||[]).map(n=>{const u=n.activity_data||{},_=g[n.group_id]||u.group_name,P=m[n.campaign_id],i=n.lead_id?k[n.lead_id]:void 0,b=(i==null?void 0:i.name)||u.lead_name,R=n.phone||(i==null?void 0:i.whatsapp_phone)||(i==null?void 0:i.phone),ce=i!=null&&i.email&&!i.email.startsWith("whatsapp-")?i.email:void 0;let M;if(b){const X=[R,ce].filter(Boolean).join("-");M=X?`${b} (${X})`:b}else M=R||s("whatsappPage.activity.unknownContact");let v=Be,w="text-muted-foreground bg-muted",V=`whatsappPage.activity.actions.${n.activity_type}`,S;switch(n.activity_type){case"joined_group":v=Te,w="text-emerald-600 bg-emerald-500/10";break;case"left_group":v=Me,w="text-orange-600 bg-orange-500/10";break;case"sent_message":case"message":v=H,w="text-sky-600 bg-sky-500/10",V="whatsappPage.activity.actions.sent_message",S=u.message_preview;break;case"message_received":v=Fe,w="text-emerald-600 bg-emerald-500/10",S=u.message_preview;break;case"message_sent":v=oe,w="text-primary bg-primary/10",S=u.message_preview;break;case"reacted":v=Oe,w="text-amber-600 bg-amber-500/10",S=u.reaction;break;case"poll_answered":v=Le,w="text-violet-600 bg-violet-500/10",S=u.poll_vote?`${s("whatsappPage.activity.vote")}: ${u.poll_vote}`:void 0;break;case"promoted":v=We,w="text-indigo-600 bg-indigo-500/10";break}const de=[M,_?s("whatsappPage.activity.inGroup",{group:_}):null,P].filter(Boolean).join(" · ");return{id:`a-${n.id}`,when:n.created_at,icon:v,iconClass:w,title:s(V,{defaultValue:n.activity_type}),subtitle:de,details:S}});return[...y,...N].sort((n,u)=>new Date(u.when).getTime()-new Date(n.when).getTime()).slice(0,25)},enabled:!!(a!=null&&a.id)});if(l)return e.jsx("p",{className:"text-sm text-muted-foreground",children:s("whatsappPage.activity.loading")});if(!(r!=null&&r.length))return e.jsx("p",{className:"text-sm text-muted-foreground",children:s("whatsappPage.activity.empty")});const x=[];return r.forEach(d=>{const t=new Date(d.when),m=$e(t)?s("whatsappPage.activity.today"):Ie(t)?s("whatsappPage.activity.yesterday"):Ue(t,o.language==="pt-BR"?"d 'de' MMMM":"MMMM d",{locale:c}),h=x[x.length-1];h&&h.label===m?h.items.push(d):x.push({label:m,items:[d]})}),e.jsx("div",{className:"space-y-6",children:x.map(d=>e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-3",children:d.label}),e.jsxs("div",{className:"relative pl-6",children:[e.jsx("div",{className:"absolute left-[11px] top-1 bottom-1 w-px bg-border"}),e.jsx("div",{className:"space-y-4",children:d.items.map(t=>{const m=t.icon;return e.jsxs("div",{className:"relative flex items-start gap-3",children:[e.jsx("div",{className:`absolute -left-6 top-0 w-6 h-6 rounded-full flex items-center justify-center ring-4 ring-card ${t.iconClass}`,children:e.jsx(m,{className:"h-3 w-3"})}),e.jsxs("div",{className:"flex-1 min-w-0 ml-1",children:[e.jsx("p",{className:"text-sm font-medium leading-tight",children:t.title}),t.subtitle&&e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.subtitle}),t.details&&e.jsxs("p",{className:"text-xs text-foreground/80 truncate mt-0.5 italic",children:['"',t.details,'"']}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:Qe(new Date(t.when),{addSuffix:!0,locale:c})})]})]},t.id)})})]})]},d.label))})},G=90,q="hsl(217 91% 60%)",B="hsl(142 71% 45%)",W="hsl(25 95% 53%)";function U(a){const s=a.getFullYear(),o=String(a.getMonth()+1).padStart(2,"0"),c=String(a.getDate()).padStart(2,"0");return`${s}-${o}-${c}`}const te=()=>{const{user:a}=F(),{data:s}=O({queryKey:["whatsapp-activity-90d",a==null?void 0:a.id],queryFn:async()=>{const r=new Date;r.setDate(r.getDate()-(G-1)),r.setHours(0,0,0,0);const l=r.toISOString(),{data:x}=await f.from("campaigns").select("id").eq("user_id",a.id),d=(x||[]).map(g=>g.id),[t,m]=await Promise.all([d.length?f.from("lead_group_activities").select("created_at").in("campaign_id",d).gte("created_at",l):Prom
1ise.resolve({data:[]}),f.from("lead_events").select("created_at,event_type").eq("user_id",a.id).in("event_type",["message_received","message_sent","whatsapp_manual_sent"]).gte("created_at",l)]),h={};for(let g=0;g<G;g++){const p=new Date(r);p.setDate(r.getDate()+g),h[U(p)]={sent:0,received:0,group:0}}return(t.data||[]).forEach(g=>{const p=U(new Date(g.created_at));h[p]&&(h[p].group+=1)}),(m.data||[]).forEach(g=>{const p=U(new Date(g.created_at));h[p]&&(g.event_type==="message_received"?h[p].received+=1:h[p].sent+=1)}),Object.entries(h).map(([g,p])=>({date:new Date(`${g}T00:00:00`).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"}),Enviadas:p.sent,Recebidas:p.received,Grupos:p.group}))},enabled:!!(a!=null&&a.id)}),o=(s||[]).reduce((r,l)=>({sent:r.sent+l.Enviadas,received:r.received+l.Recebidas,group:r.group+l.Grupos}),{sent:0,received:0,group:0}),c=(s||[]).some(r=>r.Enviadas||r.Recebidas||r.Grupos);return e.jsxs("div",{className:"rounded-2xl border border-border/50 bg-card shadow-sm animate-fade-in",children:[e.jsxs("div",{className:"p-6 pb-4 flex items-start justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Atividade dos últimos 90 dias"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Mensagens enviadas, recebidas e atividade em grupos via WhatsApp."})]}),e.jsxs("div",{className:"flex gap-6 text-xs",children:[e.jsx(Q,{label:"Enviadas",value:o.sent,color:q}),e.jsx(Q,{label:"Recebidas",value:o.received,color:B}),e.jsx(Q,{label:"Grupos",value:o.group,color:W})]})]}),e.jsx("div",{className:"px-6 pb-6",children:e.jsx("div",{className:"h-[400px]",children:c?e.jsx(Ye,{width:"100%",height:"100%",children:e.jsxs(He,{data:s||[],margin:{top:20,right:30,left:20,bottom:20},children:[e.jsx(Ve,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),e.jsx(Xe,{dataKey:"date",tick:{fill:"hsl(var(--muted-foreground))",fontSize:11},axisLine:!1,tickLine:!1,interval:Math.floor(G/10)}),e.jsx(Je,{tick:{fill:"hsl(var(--muted-foreground))",fontSize:11},axisLine:!1,tickLine:!1,allowDecimals:!1}),e.jsx(Ze,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"12px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",fontSize:12}}),e.jsx(es,{wrapperStyle:{fontSize:11},iconType:"circle"}),e.jsx(I,{type:"monotone",dataKey:"Enviadas",stroke:q,strokeWidth:2,dot:{r:3,fill:q},activeDot:{r:5,stroke:q,strokeWidth:2}}),e.jsx(I,{type:"monotone",dataKey:"Recebidas",stroke:B,strokeWidth:2,dot:{r:3,fill:B},activeDot:{r:5,stroke:B,strokeWidth:2}}),e.jsx(I,{type:"monotone",dataKey:"Grupos",stroke:W,strokeWidth:2,dot:{r:3,fill:W},activeDot:{r:5,stroke:W,strokeWidth:2}})]})}):e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx("p",{className:"text-xs text-muted-foreground",children:"Sem atividade registrada nos últimos 90 dias."})})})})]})},Q=({label:a,value:s,color:o})=>e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"flex items-center gap-1.5 justify-end",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:o}}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:a})]}),e.jsx("p",{className:"text-lg font-semibold text-foreground mt-0.5",children:s.toLocaleString()})]}),ne=({title:a,description:s,children:o})=>e.jsxs("section",{className:"rounded-2xl border border-border/50 bg-card shadow-sm p-6",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:a}),s&&e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:s})]}),o]}),qs=()=>{const{data:a,isLoading:s}=ss(),o=(a==null?void 0:a.canUseProFeature)??!1;return!s&&!o?e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(L,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"WhatsApp"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Conexão, campanhas e atividade do seu WhatsApp em um só lugar."})]})]}),e.jsx(as,{icon:e.jsx(L,{className:"h-6 w-6 text-primary"}),title:"Conexão com WhatsApp é um recurso PRO",description:"Seu test drive acabou. Ative a assinatura para reconectar seu número, distribuir leads entre grupos e disparar mensagens automáticas."}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"pointer-events-none select-none opacity-40 blur-[1px] space-y-6",children:[e.jsx(ae,{}),e.jsx(te,{})]}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent via-background/40 to-background pointer-events-none"}),e.jsx("div",{className:"absolute top-4 right-4 rounded-full bg-primary text-primary-foreground text-xs font-semibold px-3 py-1 shadow-md",children:"Preview PRO"})]})]}):e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(L,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"WhatsApp"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Conexão, campanhas e atividade do seu WhatsApp em um só lugar."})]})]}),e.jsx(ae,{}),e.jsx(te,{}),e.jsx(ne,{title:"Campanhas conectadas",description:"Ative ou desative o WhatsApp por campanha. As automações são editadas de
1ntro de cada campanha.",children:e.jsx(ns,{})}),e.jsx(ne,{title:"Últimas ações e mensagens",description:"Eventos recentes recebidos e mensagens enviadas pelo WhatsApp.",children:e.jsx(is,{})})]})};export{qs as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.