PageSourceSearch

https://novo.gruposvip.com/assets/AuthenticatedShell-Jmtc6CtD.js

js gruposvip.com collected 2026-09-26 08:43:50 UTC 18,798 bytes, 1 lines download raw bytes

1import{j as e,u as ee,b as se}from"./query-Q_ThwKGI.js";import{u as v,A as te}from"./AuthProvider-BSQZ2YtM.js";import{h as K,N as L,r as l,i as Y,j as re,O as ae}from"./react-vendor-wefok28f.js";import{U as ie}from"./UserPreferencesContext-CmtdahHI.js";import{u as Q,a as V,U as ne}from"./useSubscription-svlizlcK.js";import{S as oe,a as le,b as de}from"./sheet-BNa5OgBl.js";import{B as f}from"./button-DrepnwkX.js";import{T as C,a as k,c as g,b as O,d as ce}from"./index-C4Kq7kkR.js";import{s as M}from"./client-DjLwxtrO.js";import{u as w}from"./useTranslation-DNoH3foE.js";import{C as ue,S as pe,M as me,R as xe,U as he,P as fe,D as ge,F as be,a as je,b as ve,c as F,d as we,e as ye,f as Z,g as Ne,X as D,h as Se,Z as Ce,A as ke}from"./icons-By8asZST.js";import{l as Oe}from"./leads-flow-logo--Xdc6-jT.js";import{A as R,a as q,b as U}from"./avatar-B9bTBpJ8.js";import{S as Ee}from"./SubscriptionBanner-C8Wswn3W.js";import{D as Te,a as Pe,b as Ae,c as _e,d as Ie,e as Ke}from"./badge-u_30_p7s.js";import{P as De}from"./PlanFeatureChecklist-BdN1LsxW.js";import{P as Le}from"./progress-DCO54Zpc.js";import"./index-DC33WZD-.js";import"./index-DviHZN-M.js";import"./supabase-COHOFxoQ.js";const Me=({children:s,requireAdmin:t=!1})=>{const{user:r,isAdmin:a,isLoading:o}=v(),n=K();return o?null:r?t&&!a?e.jsx(L,{to:"/app",replace:!0}):e.jsx(e.Fragment,{children:s}):e.jsx(L,{to:"/login",state:{from:n},replace:!0})},G=l.createContext(void 0),j=()=>{const s=l.useContext(G);if(!s)throw new Error("useSidebarContext must be used within a SidebarProvider");return s},Fe=({children:s})=>{const[t,r]=l.useState(()=>localStorage.getItem("sidebar-collapsed")==="true");l.useEffect(()=>{localStorage.setItem("sidebar-collapsed",String(t))},[t]);const a=()=>r(n=>!n),o=n=>r(n);return e.jsx(G.Provider,{value:{isCollapsed:t,toggleSidebar:a,setCollapsed:o},children:s})},X=l.createContext(null),N={0:"/app",1:"/app/settings",2:"/app/whatsapp",3:"/app/groups",4:"/app/forms",5:"/app/leads",6:"/app/crm",7:"/app",8:"/app/webinars",9:"/app/sales-pages"},Re=[1,2,3,4,5,6,8,9],qe=6,P=8,S=10,Ue=({children:s})=>{const{user:t}=v(),r=Y(),a=K(),o=ee(),[n,x]=l.useState(0),[c,m]=l.useState(!1),{data:i}=se({queryKey:["profile-onboarding",t==null?void 0:t.id],queryFn:async()=>{if(!(t!=null&&t.id))return null;const{data:d}=await M.from("profiles").select("onboarding_step, onboarding_completed").eq("id",t.id).single();return d},enabled:!!(t!=null&&t.id)});l.useEffect(()=>{if(i){const d=i.onboarding_completed,p=i.onboarding_step??0;d?m(!1):(m(!0),x(p))}},[i]);const u=l.useCallback(async(d,p=!1)=>{t!=null&&t.id&&(await M.from("profiles").update({onboarding_step:d,onboarding_completed:p}).eq("id",t.id),o.invalidateQueries({queryKey:["profile-onboarding"]}))},[t==null?void 0:t.id,o]),h=l.useCallback(()=>{m(!1),u(n,!1)},[u,n]),b=l.useCallback(()=>{m(!1),u(S,!0),r("/app")},[u,r]),y=l.useCallback(()=>{const d=n+1;if(d>S){b();return}const p=d===8&&n===7?S:d;x(p),u(p,!1),N[p]&&a.pathname!==N[p]&&(p===0||p===7)&&r(N[p])},[n,r,u,b,a.pathname]);l.useEffect(()=>{if(c&&Re.includes(n)&&a.pathname===N[n]){const d=n+1;if(d>S)return;x(d),u(d,!1),d===7&&r("/app")}},[a.pathname,n,c,u,r]);const E=l.useCallback(()=>{m(!0),x(P),u(P,!1)},[u]),T=n>=P;return e.jsx(X.Provider,{value:{currentStep:n,isActive:c,totalSteps:qe,isOptional:T,nextStep:y,skipOnboarding:h,completeOnboarding:b,startOptionalFlow:E},children:s})},J=()=>{const s=l.useContext(X);if(!s)throw new Error("useOnboarding must be used within OnboardingProvider");return s},z={1:"/app/settings",2:"/app/whatsapp",3:"/app/groups",4:"/app/forms",5:"/app/leads",6:"/app/crm",8:"/app/webinars",9:"/app/sales-pages"},H=[{titleKey:"sidebar:dashboard.title",descriptionKey:"sidebar:dashboard.description",href:"/app",icon:ue},{titleKey:"sidebar:whatsapp.title",descriptionKey:"sidebar:whatsapp.description",href:"/app/whatsapp",icon:pe},{titleKey:"sidebar:groups.title",descriptionKey:"sidebar:groups.description",href:"/app/groups",icon:me},{titleKey:"sidebar:forms.title",descriptionKey:"sidebar:forms.description",href:"/app/forms",icon:xe},{titleKey:"sidebar:leads.title",descriptionKey:"sidebar:leads.description",href:"/app/leads",icon:he},{titleKey:"sidebar:webinars.title",descriptionKey:"sidebar:webinars.description",href:"/app/webinars",icon:fe},{titleKey:"sidebar:crm.title",descriptionKey:"sidebar:crm.description",href:"/app/crm",icon:ge},{titleKey:"sidebar:salesPages.title",descriptionKey:"sidebar:salesPages.description",href:"/app/sales-pages",icon:be},{titleKey:"sidebar:settings.title",descriptionKey:"sidebar:settings.description",href:"/app/sett
1ings",icon:je}],ze=[{titleKey:"sidebar:userAdmin.title",descriptionKey:"sidebar:userAdmin.description",href:"/app/admin/users",icon:ve}],He=()=>{const{isAdmin:s}=v(),{isCollapsed:t}=j(),{t:r}=w();let a={isActive:!1,currentStep:0};try{a=J()}catch{}const o=a.isActive&&!!z[a.currentStep],n=o?z[a.currentStep]:void 0,x=s?[...H,...ze]:H;return e.jsx("nav",{className:"px-2 py-3 space-y-0.5",children:x.map((c,m)=>{const i=n===c.href,u=i?{backgroundColor:"hsl(var(--primary) / 0.1)",borderColor:"hsl(var(--primary) / 0.6)"}:{backgroundColor:"transparent",borderColor:"transparent",boxShadow:"none"};return e.jsxs(C,{delayDuration:0,children:[e.jsx(k,{asChild:!0,children:e.jsx(re,{to:c.href,end:c.href==="/app",style:u,className:({isActive:h})=>g("sidebar-nav-link group relative flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-sm transition-colors duration-150 border border-transparent bg-transparent",t&&"justify-center px-2",!i&&!h&&"text-muted-foreground hover:text-foreground",!i&&h&&"text-foreground font-medium",i&&"sidebar-nav-link--onboarding onboarding-pulse-ring border-primary/60 bg-primary/10 text-foreground font-medium",o&&!i&&"opacity-50"),children:({isActive:h})=>e.jsxs(e.Fragment,{children:[e.jsx(c.icon,{className:g("h-4 w-4 flex-shrink-0",i?"text-primary":h?"text-foreground":"text-muted-foreground group-hover:text-foreground")}),!t&&e.jsx("span",{children:r(c.titleKey)})]})})}),t&&e.jsx(O,{side:"right",children:e.jsx("p",{children:r(c.titleKey)})})]},m)})})},Be=()=>{const{isCollapsed:s}=j();return e.jsx("div",{className:g("flex items-center",s?"justify-center":""),children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:Oe,alt:"Leads Flow",className:"w-8 h-8 object-contain flex-shrink-0"}),!s&&e.jsx("h1",{className:"text-lg font-bold text-foreground tracking-tight",children:"Leads Flow"})]})})},$e=()=>{const s=Y(),{signOut:t}=v(),{isCollapsed:r}=j(),{t:a}=w("sidebar"),o=async()=>{await t(),s("/lp")};return r?e.jsxs(C,{delayDuration:0,children:[e.jsx(k,{asChild:!0,children:e.jsx(f,{variant:"ghost",size:"icon",onClick:o,className:"w-full h-10 text-muted-foreground hover:text-destructive hover:bg-destructive/10",children:e.jsx(F,{className:"h-4 w-4"})})}),e.jsx(O,{side:"right",children:a("signOut")})]}):e.jsxs(f,{variant:"ghost",className:"w-full justify-start text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:o,children:[e.jsx(F,{className:"mr-2 h-4 w-4"}),a("signOut")]})},We=()=>{var a;const{user:s}=v(),{isCollapsed:t}=j();if(!(s!=null&&s.email))return null;const r=(a=s.email)==null?void 0:a.substring(0,2).toUpperCase();return t?e.jsxs(C,{delayDuration:0,children:[e.jsx(k,{asChild:!0,children:e.jsx("div",{className:"flex justify-center",children:e.jsxs(R,{className:"h-8 w-8",children:[e.jsx(q,{src:s.user_metadata.avatar_url}),e.jsx(U,{children:r})]})})}),e.jsx(O,{side:"right",children:e.jsx("p",{className:"text-xs text-muted-foreground",children:s.email})})]}):e.jsxs("div",{className:"flex items-center gap-3 px-2 py-2",children:[e.jsxs(R,{className:"h-8 w-8",children:[e.jsx(q,{src:s.user_metadata.avatar_url}),e.jsx(U,{children:r})]}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.email})})]})},B=()=>{const{isCollapsed:s,toggleSidebar:t}=j(),{t:r}=w("sidebar");return e.jsxs(C,{delayDuration:0,children:[e.jsx(k,{asChild:!0,children:e.jsx(f,{variant:"ghost",size:"icon",onClick:t,className:"h-8 w-8 text-muted-foreground hover:text-foreground",children:s?e.jsx(we,{className:"h-4 w-4"}):e.jsx(ye,{className:"h-4 w-4"})})}),e.jsx(O,{side:"right",children:r(s?"expandMenu":"collapseMenu")})]})},Ye=()=>{const[s,t]=l.useState(!1),{isCollapsed:r}=j(),a=({isMobile:o=!1})=>e.jsx(ce,{children:e.jsxs("div",{className:"flex flex-col h-full bg-background",children:[e.jsxs("div",{className:g("flex items-center justify-between h-14 border-b border-border/50",!o&&r?"justify-center px-2":"px-4"),children:[e.jsx(Be,{}),(o||!r)&&e.jsx(B,{})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(He,{})}),e.jsxs("div",{className:g("p-2 border-t border-border/50 space-y-2",!o&&r?"px-2":"p-4"),children:[e.jsx(We,{}),e.jsx($e,{})]})]})});return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"lg:hidden fixed top-4 left-4 z-50",children:e.jsxs(oe,{open:s,onOpenChange:t,children:[e.jsx(le,{asChild:!0,children:e.jsx(f,{variant:"outline",size:"icon",className:"bg-background/80 backdrop-blur-sm shadow-sm border-border/50",children:e.jsx(Z,{className:"h-4 w-4"})})}),e.jsx(de,{side:"left",className:"w-72 p-0 border-r border-border/50",children:e.jsx(a,{isMobile:!0})})]})}),e.jsxs("div",{className:g("hidden lg:flex h-screen fixed left-0 top-0 border-r border-border/50 bg-background transition-[width] duration-300 z-40",r?"w-16":"w-72"),children:[e.jsx(a,{}),r&&e.jsx("div",{className:"absolute top-3 right-[-14px] z-50 rounded-full bg-background border border-border/60 shadow-sm",children:e.jsx(B,{})})]}),e.jsx("div",{className:g("hidden lg:block flex-shrink-0 transition-[width] duration-300",r?"w-16":"w-72")})]})},$="trial_ending_reminder_shown",Qe=()=>{const{data:s}=Q(),{openUpgrade:t}=V(),[r,a]=l.useState(!1);l.useEffect(()=>{s&&s.isTestDriveEnding&&sessionStorage.getItem($)!=="true"&&(a(!0),sessionStorage.setItem($,"true"))},[s==null?void 0:s.isTestDriveEnding]);const o=Math.max((s==null?void 0:s.trialDaysRemaining)??0,0),n=o===1?"1 dia":`${o} dias`;return e.jsx(Te,{open:r,onOpenChange:a,children:e.jsxs(Pe,{className:"sm:max-w-md",children:[e.jsxs(Ae,{children:[e.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-amber-100 dar
1k:bg-amber-500/15 flex items-center justify-center mb-2",children:e.jsx(Ne,{className:"h-6 w-6 text-amber-600"})}),e.jsxs(_e,{className:"text-center text-xl",children:["Faltam ",n," do seu test drive completo"]}),e.jsx(Ie,{className:"text-center",children:"Garanta continuidade sem interrupção — sem cartão na ativação do trial e cancele quando quiser. Ao terminar o test drive, WhatsApp, CRM e Lead Score ficam bloqueados até a assinatura."})]}),e.jsxs(Ke,{className:"flex-col sm:flex-col gap-2",children:[e.jsx(f,{className:"w-full",onClick:()=>{a(!1),t("Ative agora e mantenha tudo funcionando após o test drive.")},children:"Ativar assinatura agora"}),e.jsx(f,{variant:"ghost",className:"w-full",onClick:()=>a(!1),children:"Continuar testando"})]})]})})},A="trial_overlay_dismissed_session",Ve=()=>{const{data:s}=Q(),{openUpgrade:t}=V(),[r,a]=l.useState(!1);l.useEffect(()=>{const n=sessionStorage.getItem(A);a(n==="true")},[]);const o=()=>{sessionStorage.setItem(A,"true"),a(!0)};return l.useEffect(()=>{s&&!s.isTrialExpired&&sessionStorage.removeItem(A)},[s==null?void 0:s.isTrialExpired]),!(s!=null&&s.isTrialExpired)||r?null:e.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-start justify-center p-4 overflow-y-auto",children:e.jsxs("div",{className:"max-w-3xl w-full my-8 rounded-2xl border border-border/60 bg-card shadow-2xl relative",children:[e.jsx("button",{onClick:o,className:"absolute top-4 right-4 text-muted-foreground hover:text-foreground transition-colors z-10","aria-label":"Fechar",children:e.jsx(D,{className:"h-5 w-5"})}),e.jsxs("div",{className:"px-8 pt-10 pb-6 text-center",children:[e.jsx("div",{className:"mx-auto w-14 h-14 rounded-2xl bg-orange-100 flex items-center justify-center mb-4",children:e.jsx(Se,{className:"w-7 h-7 text-orange-600"})}),e.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-2",children:"Seu test drive de 7 dias acabou"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-lg mx-auto",children:"Você já experimentou tudo. Ative a assinatura para reativar WhatsApp, CRM completo, Lead Score e integração Hotmart — seus dados continuam salvos."})]}),e.jsx("div",{className:"px-6 pb-6",children:e.jsx(De,{compact:!0})}),e.jsxs("div",{className:"px-8 pb-8",children:[e.jsxs(f,{size:"lg",className:"w-full py-6 text-base",onClick:()=>t("Ative para reativar todas as funcionalidades Pro."),children:[e.jsx(Ce,{className:"w-5 h-5 mr-2"}),"Ativar assinatura agora"]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground mt-3",children:"Cancele quando quiser · sem cartão na ativação do trial"})]})]})})},_=768;function Ze(){const[s,t]=l.useState(void 0);return l.useEffect(()=>{const r=window.matchMedia(`(max-width: ${_-1}px)`),a=()=>{t(window.innerWidth<_)};return r.addEventListener("change",a),t(window.innerWidth<_),()=>r.removeEventListener("change",a)},[]),!!s}const I=({title:s,description:t,primaryButton:r,secondaryButton:a,onSkip:o,step:n,totalSteps:x=5,position:c="content",className:m})=>{const{t:i}=w("onboarding");return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-sm animate-in fade-in duration-300",children:e.jsxs("div",{className:g("relative w-full max-w-md mx-4 rounded-2xl border border-border bg-card p-6 shadow-xl animate-in zoom-in-95 duration-300",c==="center"&&"max-w-lg",m),children:[e.jsx("button",{onClick:o,className:"absolute top-3 right-3 text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(D,{className:"h-4 w-4"})}),n!=null&&n>0&&e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"flex items-center justify-between mb-1.5",children:e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:i("stepOf",{current:n,total:x})})}),e.jsx(Le,{value:n/x*100,className:"h-1.5"})]}),s&&e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:s}),e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line leading-relaxed",children:t}),e.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[r&&e.jsx(f,{onClick:r.onClick,size:"sm",className:"rounded-lg",children:r.label}),a&&e.jsx(f,{onClick:a.onClick,variant:"outline",size:"sm",className:"rounded-lg",children:a.label})]}),e.jsx("button",{onClick:o,className:"mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors underline-offset-2 hover:underline",children:i("skipTutorial")})]})})},Ge={1:"sidebar:settings.title",2:"sidebar:whatsapp.title",3:"sidebar:groups.title",4:"sidebar:forms.title",5:"sidebar:leads.title",6:"sidebar:crm.title",8:"sidebar:webinars.title",9:"sidebar:salesPages.title"},Xe=()=>{const{currentStep:s,isActive:t,skipOnboarding:r,nextStep:a,startOptionalFlow:o,completeOnboarding:n,totalSteps:x,isOptional:c}=J(),m=K(),{t:i}=w(["onboarding"]),u=Ze();if(!t)return null;if(s===0)return m.pathname!=="/app"?null:e.jsx(I,{title:i("welcome.title"),description:i("welcome.description"),primaryButton:{label:i("start"),onClick:a},onSkip:r,position:"center"});if(s===7)return m.pathname!=="/app"?null:e.jsx(I,{title:i("final.coreTitle"),description:i("final.coreDescription"),primaryButton:{label:i("exploreE
1xtras"),onClick:o},secondaryButton:{label:i("finish"),onClick:a},onSkip:r,position:"center"});if(s===10)return e.jsx(I,{title:i("final.doneTitle"),description:i("final.doneDescription"),primaryButton:{label:i("final.doneCta"),onClick:n},onSkip:n,position:"center"});const h=Ge[s];if(!h)return null;const b=i(h),y=`step${s}`,E=i(`${y}.title`),T=i(`${y}.description`),d=c?s-7:s,p=c?2:x;return e.jsx("div",{className:"fixed z-40 animate-in slide-in-from-left-4 duration-300 bottom-4 left-4 right-4 sm:bottom-auto sm:right-auto sm:left-[17rem] sm:top-24 sm:max-w-xs",children:e.jsxs("div",{className:"relative rounded-2xl border border-primary/40 bg-card p-4 shadow-xl",children:[e.jsx("div",{className:"hidden sm:block absolute -left-2 top-6 w-3 h-3 rotate-45 bg-card border-l border-b border-primary/40"}),e.jsx("button",{onClick:r,className:"absolute top-2 right-2 text-muted-foreground hover:text-foreground transition-colors","aria-label":i("skipTutorial"),children:e.jsx(D,{className:"h-4 w-4"})}),e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground mb-2",children:c?i("optionalStepOf",{current:d,total:p}):i("stepOf",{current:d,total:p})}),e.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:E}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed mb-3 whitespace-pre-line",children:T}),e.jsx("div",{className:"flex items-center gap-2 rounded-lg bg-primary/10 border border-primary/20 px-3 py-2 text-xs text-foreground",children:u?e.jsxs(e.Fragment,{children:[e.jsx(Z,{className:"h-3.5 w-3.5 text-primary flex-shrink-0"}),e.jsx("span",{dangerouslySetInnerHTML:{__html:i("mobileHint",{label:b})}})]}):e.jsxs(e.Fragment,{children:[e.jsx(ke,{className:"h-3.5 w-3.5 text-primary flex-shrink-0"}),e.jsx("span",{dangerouslySetInnerHTML:{__html:i("desktopHint",{label:b})}})]})}),e.jsx("button",{onClick:r,className:"mt-3 text-[11px] text-muted-foreground hover:text-foreground transition-colors underline-offset-2 hover:underline",children:i("skipTutorial")})]})})};let W=!1;function Je(){if(W||typeof document>"u")return;W=!0;const s="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Poppins:wght@400;600;700&family=Playfair+Display:wght@400;700&family=Open+Sans:wght@400;600;700&family=Lato:wght@400;700&family=Oswald:wght@400;600;700&family=Source+Sans+Pro:wght@400;600;700&family=Raleway:wght@400;600;700&family=PT+Sans:wght@400;700&family=Merriweather:wght@400;700&family=Nunito:wght@400;600;700&family=Ubuntu:wght@400;500;700&family=Mukta:wght@400;600;700&display=swap",t=document.createElement("link");t.rel="stylesheet",t.href=s,document.head.appendChild(t)}const es=({children:s})=>(l.useEffect(()=>{const t=window,r=()=>Je();typeof t.requestIdleCallback=="function"?t.requestIdleCallback(r,{timeout:2e3}):setTimeout(r,600)},[]),e.jsx(Fe,{children:e.jsxs(Ue,{children:[e.jsxs("div",{className:"flex min-h-screen w-full bg-background",children:[e.jsx(Ye,{}),e.jsxs("main",{className:"flex-1 p-6 pt-20 lg:p-10",children:[e.jsx(Ee,{}),e.jsx("div",{className:"max-w-5xl mx-auto mt-6",children:s||e.jsx(ae,{})})]})]}),e.jsx(Xe,{}),e.jsx(Qe,{}),e.jsx(Ve,{})]})})),ws=()=>e.jsx(te,{children:e.jsx(ie,{children:e.jsx(ne,{children:e.jsx(Me,{children:e.jsx(es,{})})})})});export{ws 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.