PageSourceSearch

https://capta.gushagenciabr.workers.dev/assets/admin-rL-UK2uy.js

js capta.gushagenciabr.workers.dev collected 2026-10-03 08:06:37 UTC 27,428 bytes, 1 lines download raw bytes

1import{c as h,r as o,j as e,a as S,L as E,s as L,N as _e,O as Pe}from"./index-Cc2yGvLd.js";import{u as z,a as ne,A as $e,P as Ae}from"./permissions-BWXaKyKO.js";import{u as ae}from"./useLocation-zzpp4RPD.js";import{B as Le,H as Re}from"./history-DsVmwO5M.js";import{U as ie}from"./users-BfXT2B55.js";import{G as Ee}from"./globe-lk7QJIYU.js";import{R as le,C as De}from"./rectangle-ellipsis-DZlqtzIe.js";import{W as Ie}from"./wallet-Dm6ZeGko.js";import{T as Te}from"./trending-up-KZbe6fV3.js";import{B as Ve}from"./briefcase-DLwM66C0.js";import{S as He}from"./square-kanban-Dkje7Qki.js";import{C as qe}from"./chart-column-B5KfZiMI.js";import{S as Fe,P as ze,a as Oe,R as Be}from"./settings-Cg24b_oG.js";import{S as Ge}from"./square-pen-Da6jbYyw.js";import{C as ce,a as Ke}from"./chevron-right-Bd8A-qT1.js";import{G as We}from"./grip-vertical-DUINXYhK.js";import{X as Ye}from"./x-GcQKRorW.js";const Je=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],Ue=h("coffee",Je);const Xe=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Ze=h("layout-dashboard",Xe);const Qe=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],et=h("list-todo",Qe);const tt=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],st=h("log-out",tt);const ot=[["path",{d:"M5 12h14",key:"1ays0h"}]],rt=h("minus",ot);const nt=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],at=h("plug",nt);const it=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],lt=h("settings-2",it);const ct=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],dt=h("shield-alert",ct);const ut=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],de=h("timer",ut);const mt=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],oe=h("volume-2",mt);const xt=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],ft=h("volume-x",xt);const pt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ht=h("zap",pt),gt=[{label:"Principal",items:[{to:"/admin/dashboard",label:"Painel",icon:Ze,section:"dashboard"},{to:"/admin/clients",label:"Clientes",icon:Le,section:"clients"},{to:"/admin/leads",label:"Leads",icon:ie,section:"leads"}]},{label:"Ferramentas",items:[{to:"/admin/agency-builder",label:"Site Principal",icon:Ee,section:"links"},{to:"/admin/form-builder",label:"Formulário",icon:le,section:"links"},{to:"/admin/gestao",label:"Gestão",icon:Ie,section:"gestao"},{to:"/admin/vendas",label:"Vendas",icon:Te,section:"vendas"},{to:"/admin/portal",label:"Portal",icon:Ve,section:"portal"},{to:"/admin/tarefas",label:"Tarefas",icon:He,section:"tarefas"},{to:"/admin/pixels",label:"Pixels",icon:De,section:"pixels"},{to:"/admin/analytics",label:"Visitas",icon:qe,section:"dashboard"},{to:"/admin/integrations",label:"Integrações",icon:at,section:null}]},{label:"Sistema",items:[{to:"/admin/settings",label:"Configurações",icon:Fe,section:"settings"}]}];
1function bt(){const[s,d]=o.useState(!1),{signOut:n}=z(),{can:u,isAdmin:l,isEditor:x,editorClientId:c}=ne(),a=ae(),r=c?[{label:"Meu cliente",items:[{to:`/admin/clients/${c}`,label:"Landing Page",icon:Ge,section:null},{to:`/admin/clients/${c}/form-builder`,label:"Formulário",icon:le,section:null},{to:`/admin/clients/${c}/leads`,label:"Leads",icon:ie,section:null}]}]:[],f=x?r:gt.map(m=>({...m,items:m.items.filter(p=>p.section===null?l:u(p.section,"view"))})).filter(m=>m.items.length>0);return e.jsxs("aside",{className:S("flex flex-col bg-sidebar text-sidebar-foreground border-r border-sidebar-border transition-all duration-300 min-h-screen relative",s?"w-[68px]":"w-64"),children:[e.jsxs("div",{className:S("flex items-center gap-3 px-4 h-16 border-b border-sidebar-border",s&&"justify-center"),children:[e.jsx("div",{className:"h-8 w-8 rounded-lg bg-primary flex items-center justify-center shrink-0",children:e.jsx(ht,{className:"h-4 w-4 text-primary-foreground"})}),!s&&e.jsxs("div",{className:"overflow-hidden",children:[e.jsx("span",{className:"font-heading text-base font-bold text-sidebar-foreground leading-none",children:"LeadAdmin"}),e.jsx("span",{className:"block text-[10px] text-sidebar-foreground/50 leading-tight",children:"Gestão de Leads"})]})]}),e.jsx("nav",{className:"flex-1 overflow-y-auto py-4 px-3 space-y-6",children:f.map(m=>e.jsxs("div",{children:[!s&&e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-sidebar-foreground/40 px-3 mb-2",children:m.label}),e.jsx("div",{className:"space-y-0.5",children:m.items.map(p=>{const v=x?a.pathname.replace(/\/$/,"")===p.to:a.pathname===p.to||a.pathname.startsWith(p.to+"/");return e.jsxs(E,{to:p.to,className:S("flex items-center gap-3 px-3 py-2 rounded-lg text-[13px] font-medium transition-all group relative",v?"bg-sidebar-primary text-sidebar-primary-foreground shadow-sm shadow-primary/20":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",s&&"justify-center px-2"),children:[e.jsx(p.icon,{className:S("h-[18px] w-[18px] shrink-0",v&&"drop-shadow-sm")}),!s&&e.jsx("span",{children:p.label}),s&&e.jsx("div",{className:"absolute left-full ml-2 px-2.5 py-1 rounded-md bg-popover text-popover-foreground text-xs font-medium shadow-lg border border-border opacity-0 group-hover:opacity-100 pointer-events-none transition-opacity whitespace-nowrap z-50",children:p.label})]},p.to)})})]},m.label))}),e.jsx("div",{className:"p-3 border-t border-sidebar-border space-y-1",children:e.jsxs("button",{onClick:()=>n(),className:S("flex items-center gap-3 px-3 py-2 rounded-lg text-[13px] font-medium text-sidebar-foreground/60 hover:bg-destructive/10 hover:text-destructive transition-all w-full",s&&"justify-center px-2"),children:[e.jsx(st,{className:"h-[18px] w-[18px] shrink-0"}),!s&&e.jsx("span",{children:"Sair"})]})}),e.jsx("button",{onClick:()=>d(!s),className:"absolute -right-3 top-20 h-6 w-6 rounded-full border border-sidebar-border bg-sidebar flex items-center justify-center hover:bg-sidebar-accent transition-colors shadow-sm z-10",children:s?e.jsx(ce,{className:"h-3 w-3"}):e.jsx(Ke,{className:"h-3 w-3"})})]})}const ue="pomodoro-settings-v2",R="pomodoro-visible",me="pomodoro-task",xe=o.createContext(null);function yt(){const s=o.useContext(xe);if(!s)throw new Error("usePomodoro must be used inside PomodoroProvider");return s}function jt(){if(typeof window>"u")return{focusMin:25,breakMin:5};try{const s=localStorage.getItem(ue);if(s)return JSON.parse(s)}catch{}return{focusMin:25,breakMin:5}}function vt(){if(typeof window>"u")return!1;try{return localStorage.getItem(R)==="1"}catch{return!1}}function wt(){if(typeof window>"u")return{id:null,title:""};try{const s=localStorage.getItem(me);if(s)return JSON.parse(s)}catch{}return{id:null,title:""}}function re(s){const d=typeof s=="string"?new Date(s):s;return`${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,"0")}-${String(d.getDate()).padStart(2,"0")}`}function Nt(){if(typeof window>"u")return{stop:()=>{}};let s=null,d=null,n=!1;try{s=new(window.AudioContext||window.webkitAudioContext);const u=s,l=()=>{if(n||!u)return;const x=u.currentTime;
1[880,660,880,990].forEach((c,a)=>{const r=u.createOscillator(),f=u.createGain();r.type="square",r.frequency.value=c;const m=x+a*.4;f.gain.setValueAtTime(1e-4,m),f.gain.exponentialRampToValueAtTime(.7,m+.04),f.gain.exponentialRampToValueAtTime(1e-4,m+.35),r.connect(f).connect(u.destination),r.start(m),r.stop(m+.36)}),d=setTimeout(l,2400)};l()}catch{}return{stop:()=>{if(n=!0,d&&clearTimeout(d),s)try{s.close()}catch{}}}}function kt({children:s}){const[d,n]=o.useState(()=>vt()),[u,l]=o.useState("bottom-right");o.useEffect(()=>{(async()=>{const{data:r}=await L.from("settings").select("pomodoro_position").limit(1).single();if(r&&r.pomodoro_position){const f=r.pomodoro_position;(f==="bottom-left"||f==="bottom-right")&&l(f)}})()},[]);const x=o.useCallback(()=>{n(!0);try{localStorage.setItem(R,"1")}catch{}},[]),c=o.useCallback(()=>{n(!1);try{localStorage.setItem(R,"0")}catch{}},[]),a=o.useCallback(()=>{n(r=>{const f=!r;try{localStorage.setItem(R,f?"1":"0")}catch{}return f})},[]);return e.jsxs(xe.Provider,{value:{visible:d,show:x,hide:c,toggle:a,position:u},children:[s,d&&e.jsx(St,{position:u,onClose:c})]})}function St({position:s,onClose:d}){const[n,u]=o.useState(jt),[l,x]=o.useState("focus"),[c,a]=o.useState(n.focusMin*60),[r,f]=o.useState(!1),[m,p]=o.useState(0),[v,O]=o.useState(!1),[B,G]=o.useState(!1),[fe,K]=o.useState(!1),[w,pe]=o.useState(()=>wt()),[W,he]=o.useState([]),[ge,be]=o.useState([]),[N,Y]=o.useState(!1),M=o.useRef(null),b=o.useRef(null),y=o.useRef(null),C=o.useRef(l),D=o.useRef(n),J=o.useRef(w),j=o.useRef(null);o.useEffect(()=>{C.current=l},[l]),o.useEffect(()=>{D.current=n},[n]),o.useEffect(()=>{J.current=w;try{localStorage.setItem(me,JSON.stringify(w))}catch{}},[w]),o.useEffect(()=>{try{localStorage.setItem(ue,JSON.stringify(n))}catch{}},[n]);const I=o.useCallback(async()=>{const[t,i]=await Promise.all([L.from("tasks").select("id, title, status").neq("status","done").order("task_order").limit(50),L.from("pomodoro_sessions").select("id, task_title, mode, duration_seconds, completed_at").gte("completed_at",new Date(Date.now()-2592e6).toISOString()).order("completed_at",{ascending:!1}).limit(100)]);he(t.data||[]),be(i.data||[])},[]);o.useEffect(()=>{I()},[I]);async function ye(t){const i=J.current,g=y.current?new Date(y.current).toISOString():new Date(Date.now()-t*1e3).toISOString();try{await L.from("pomodoro_sessions").insert({task_id:i.id,task_title:i.title||null,mode:C.current,duration_seconds:t,started_at:g,completed_at:new Date().toISOString()}),I()}catch(k){console.warn("Falha ao registrar sessão pomodoro",k)}}const _=o.useCallback(()=>{if(!b.current)return;const t=Math.max(0,Math.round((b.current-Date.now())/1e3));if(t<=0){const i=C.current,g=D.current,k=(i==="focus"?g.focusMin:g.breakMin)*60;i==="focus"&&(ye(k),p(Ce=>Ce+1)),f(!1),b.current=null,y.current=null,M.current?.stop(),M.current=Nt(),Y(!0);const se=i==="focus"?"break":"focus";x(se),a((se==="focus"?g.focusMin:g.breakMin)*60);try{"Notification"in window&&Notification.permission==="granted"&&new Notification(i==="focus"?"⏰ Foco concluído!":"☕ Pausa terminada!",{body:i==="focus"?"Hora de uma pausa.":"Hora de voltar ao foco."})}catch{}return}a(t)},[]);o.useEffect(()=>{if(!r){j.current&&(clearInterval(j.current),j.current=null);return}b.current==null&&(b.current=Date.now()+c*1e3),y.current==null&&(y.current=Date.now()-(D.current[l==="focus"?"focusMin":"breakMin"]*60-c)*1e3),j.current=setInterval(_,500);const t=()=>{document.hidden||_()},i=()=>_();return document.addEventListener("visibilitychange",t),window.addEventListener("focus",i),()=>{j.current&&clearInterval(j.current),document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",i)}},[r,_]),o.useEffect(()=>{r||a((l==="focus"?n.focusMin:n.breakMin)*60)},[n.focusMin,n.breakMin]),o.useEffect(()=>{try{"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission().catch(()=>{})}catch{}},[]);function P(){M.current?.stop(),M.current=null,Y(!1)}function je(){P(),f(!1),b.current=null,y.current=null,a((l==="focus"?n.focusMin:n.breakMin)*60)}function U(t){r||(P(),x(t),b.current=null,y.current=null,a((t==="focus"?n.focusMin:n.breakMin)*60))}function ve(){P(),f(t=>{const i=!t;return i&&(b.current=Date.now()+c*1e3,y.current=Date.now()-(n[l==="focus"?"focusMin":"breakMin"]*60-c)*1e3),i})}const T=(l==="focus"?n.focusMin:n.breakMin)*60,we=T>0?(T-c)/T*100:0,X=String(Math.floor(c/60)).padStart(2,"0"),Z=String(c%60).padStart(2,"0"),Ne=l==="focus"?"stroke-primary":"stroke-emerald-500",Q=l==="focus"?"from-primary to-primary/60":"from-emerald-500 to-emerald-400",V=38,H=2*Math.PI*V,ee=s==="bottom-left"?"left-4":"right-4",$=new Date,ke=re($),q=ne
1w Date($);q.setDate($.getDate()-$.getDay()),q.setHours(0,0,0,0);const te=ge.filter(t=>t.mode==="focus"),A=te.filter(t=>re(t.completed_at)===ke),Se=A.reduce((t,i)=>t+i.duration_seconds,0),Me=te.filter(t=>new Date(t.completed_at)>=q).reduce((t,i)=>t+i.duration_seconds,0),F=t=>{const i=Math.floor(t/3600),g=Math.floor(t%3600/60);return i>0?`${i}h ${g}m`:`${g}m`};return fe?e.jsxs("button",{onClick:()=>K(!1),className:`fixed bottom-4 ${ee} z-50 flex items-center gap-2 rounded-full bg-card border border-border shadow-2xl shadow-black/40 px-4 py-2.5 text-sm font-medium hover:scale-105 transition-transform ${N?"animate-pulse ring-4 ring-rose-500/50":""}`,title:"Abrir pomodoro",children:[l==="focus"?e.jsx(de,{className:"h-4 w-4 text-primary"}):e.jsx(Ue,{className:"h-4 w-4 text-emerald-500"}),e.jsxs("span",{className:`tabular-nums font-bold bg-gradient-to-r ${Q} bg-clip-text text-transparent`,children:[X,":",Z]}),N&&e.jsx(oe,{className:"h-3.5 w-3.5 text-rose-500 animate-pulse"}),r&&!N&&e.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"})]}):e.jsxs("div",{className:`fixed bottom-4 ${ee} z-50 w-[300px] rounded-2xl bg-card border border-border shadow-2xl shadow-black/50 overflow-hidden animate-in slide-in-from-bottom-4 duration-200 ${N?"ring-4 ring-rose-500/50":""}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border/60 bg-muted/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(We,{className:"h-3.5 w-3.5 text-muted-foreground/50"}),e.jsx("span",{className:"text-xs font-semibold text-foreground",children:"Pomodoro"}),r&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("button",{onClick:()=>{G(t=>!t),O(!1)},className:`p-1 rounded hover:bg-muted ${B?"text-primary":"text-muted-foreground hover:text-foreground"}`,title:"Histórico",children:e.jsx(Re,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>{O(t=>!t),G(!1)},className:`p-1 rounded hover:bg-muted ${v?"text-primary":"text-muted-foreground hover:text-foreground"}`,title:"Configurar",children:e.jsx(lt,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>K(!0),className:"text-muted-foreground hover:text-foreground p-1 rounded hover:bg-muted",title:"Minimizar",children:e.jsx(rt,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:d,className:"text-muted-foreground hover:text-foreground p-1 rounded hover:bg-muted",title:"Fechar",children:e.jsx(Ye,{className:"h-3.5 w-3.5"})})]})]}),e.jsxs("div",{className:"p-4",children:[N&&e.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded-lg bg-rose-500/15 border border-rose-500/30 px-3 py-2",children:[e.jsx(oe,{className:"h-4 w-4 text-rose-500 animate-pulse shrink-0"}),e.jsx("p",{className:"text-xs font-medium text-rose-500 flex-1",children:C.current==="break"?"Foco concluído!":"Pausa terminada!"}),e.jsx("button",{onClick:P,className:"rounded-md bg-rose-500 text-white p-1 hover:bg-rose-600",title:"Silenciar",children:e.jsx(ft,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"mb-3",children:[e.jsxs("label",{className:"text-[10px] text-muted-foreground uppercase flex items-center gap-1",children:[e.jsx(et,{className:"h-3 w-3"})," Tarefa vinculada"]}),e.jsxs("select",{value:w.id||"",onChange:t=>{const i=t.target.value||null,g=W.find(k=>k.id===i);pe({id:i,title:g?.title||""})},disabled:r,className:"mt-1 w-full rounded border border-input bg-background px-2 py-1 text-xs disabled:opacity-50",children:[e.jsx("option",{value:"",children:"— Sem tarefa —"}),W.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))]})]}),e.jsxs("div",{className:"flex rounded-lg bg-muted p-1 mb-3 text-[11px]",children:[e.jsx("button",{onClick:()=>U("focus"),className:`flex-1 py-1 rounded-md font-medium transition-all ${l==="focus"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"Foco"}),e.jsx("button",{onClick:()=>U("break"),className:`flex-1 py-1 rounded-md font-medium transition-all ${l==="break"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"Pausa"})]}),e.jsx("div",{className:"flex items-center justify-center mb-3",children:e.jsxs("div",{className:"relative h-24 w-24",children:[e.jsxs("svg",{className:"h-full w-full -rotate-90",viewBox:"0 0 90 90",children:[e.jsx("circle",{cx:"45",cy:"45",r:V,fill:"none",className:"stroke-muted",strokeWidth:"6"}),e.jsx("circle",{cx:"45",cy:"45",r:V,fill:"none",className:`${Ne} transition-all duration-500`,strokeWidth:"6",strokeLinecap:"round",strokeDasharray:H,strokeDashoffset:H-H*we/100})]}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsxs("div",{className:`text-xl font-bold tabular-nums bg-gradient-to-br ${Q} bg-clip-text text-transparent`,children:[X,":",Z]}),e.jsxs("p",{className:"text-[9px] text-muted-foreground",children:[m," ciclo",m===1?"":"s"]})]})]})}),e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx("button",{onClick:ve,className:"flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:r?e.jsxs(e.Fragment,{children:[e.jsx(ze,{className:"h-3 w-3"})," Pausar"]}):e.jsxs(e.Fragment,{children:[e.jsx(Oe,{className:"h-3 w-3"})," Iniciar"]})}),e.jsx("button",{onClick:je,className:"flex items-center gap-1.5 rounded-lg border border-input bg-background px-2.5 py-1.5 text-xs font-medium hover:bg-muted transition-colors",title:"Resetar",children:e.jsx(Be,{className:"h-3 w-3"})})]}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"rounded-lg bg-muted/50 px-2.5 py-1.5",children:[e.jsx("p",{className:"text-[9px] text-muted-foreground uppercase",children:"Hoje"}),e.jsx("p",{className:"text-sm font-bold text-foreground",children:F(Se)})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 px-2.5 py-1.5",children:[e.jsx("p",{className:"text-[9px] text-muted-foreground uppercase",children:"Semana"}),e.jsx("p",{className:"text-sm font-bold text-foreground",children:F(Me)})]})]}),B&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-border/60",children:[e.jsxs("p",{className:"text-[10px] text-muted-foreground uppercase mb-2",children:["Sessões de hoje (",A.length,")"]}),A.length===0?e.jsx("p",{className:"text-xs text-muted-foreground italic py-2",children:"Nenhuma sessão concluída hoje."}):e.jsx("div",{className:"space-y-1.5 max-h-40 overflow-y-auto",children:A.map(t=>e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded bg-muted/40 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-[11px] font-medium text-foreground truncate",children:t.task_title||e.jsx("span",{className:"italic text-muted-foreground",children:"Sem tarefa"})}),e.jsx("p",{className:"text-[9px] text-muted-foreground",children:new Date(t.completed_at).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})})]}),e.jsx("span",{className:"text-[10px] font-bold text-primary tabular-nums shrink-0",children:F(t.duration_seconds)})]},t.id))})]}),v&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-border/60 space-y-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-muted-foreground uppercase",children:"Foco (min)"}),e.jsx("input",{type:"number",min:1,max:120,value:n.focusMin,onChange:t=>u(i=>({...i,focusMin:Math.max(1,Number(t.target.value)||1)})),className:"mt-0.5 w-full rounded border border-input bg-background px-2 py-1 text-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-muted-foreground uppercase",children:"Pausa (min)"}),e.jsx("input",{type:"number",min:1,max:60,value:n.breakMin,onChange:t=>u(i=>({...i,breakMin:Math.max(1,Number(t.target.value)||1)})),className:"mt-0.5 w-full rounded border border-input bg-background px-2 py-1 text-xs"})]}),e.jsx("button",{onClick:()=>p(0),className:"w-full text-[10px] text-muted-foreground hover:text-foreground py-1",children:"Zerar ciclos"})]})]})]})}function Mt(){const{visible:s,toggle:d}=yt();return e.jsxs("button",{onClick:d,className:`flex items-center gap-2 rounded-lg px-3 py-1.5 text-xs font-medium transition-colors ${s?"bg-primary/15 text-primary border border-primary/30":"bg-muted text-muted-foreground hover:text-foreground border border-transparent"}`,title:s?"Esconder Pomodoro":"Abrir Pomodoro",children:[e.jsx(de,{className:"h-3.5 w-3.5"}),"Pomodoro"]})}const Ct={"/admin/dashboard":"Painel","/admin/clients":"Clientes","/admin/leads":"Leads","/admin/form-builder":"Construtor de Formulário","/admin/landing-editor":"Landing Pages","/admin/settings":"Configurações","/admin/pixels":"Pixels & Rastreamento","/admin/integrations":"Integrações","/admin/gestao":"Gestão","/admin/tarefas":"Tarefas","/admin/portal":"Portal do Cliente"};function _t(){const s=ae(),{loading:d,isEditor:n,editorClientId:u}=ne();if(d)return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})});let l=!1;if(n){const a=s.pathname.replace(/\/$/,""),r=u?`/admin/clients/${u}`:null;if(r&&(a==="/admin"||a==="/admin/dashboard"))return e.jsx(_e,{to:r});l=!(r?[r,`${r}/form-builder`,`${r}/leads`]:[]).includes(a)}
1const x=s.pathname.split("/").filter(Boolean),c=[];if(x.length>=2){const a=`/${x[0]}/${x[1]}`,r=Ct[a]||x[1];c.push({label:r,to:a})}if(x.length>2){const a=x[x.length-1],r={dashboard:"Dashboard","form-builder":"Formulário",leads:"Leads",pixels:"Pixels"};r[a]&&c.push({label:r[a]})}return e.jsx(kt,{children:e.jsxs("div",{className:"flex min-h-screen w-full bg-background",children:[e.jsx(bt,{}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs("header",{className:"h-14 border-b border-border bg-card/50 backdrop-blur-sm flex items-center justify-between gap-4 px-6 shrink-0",children:[e.jsxs("nav",{className:"flex items-center gap-1.5 text-sm",children:[e.jsx(E,{to:n&&u?`/admin/clients/${u}`:"/admin/dashboard",className:"text-muted-foreground hover:text-foreground transition-colors",children:"Admin"}),c.map((a,r)=>e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(ce,{className:"h-3.5 w-3.5 text-muted-foreground/50"}),a.to?e.jsx(E,{to:a.to,className:"text-muted-foreground hover:text-foreground transition-colors",children:a.label}):e.jsx("span",{className:"text-foreground font-medium",children:a.label})]},r))]}),e.jsx(Mt,{})]}),e.jsx("main",{className:"flex-1 overflow-auto",children:e.jsx("div",{className:"p-6 lg:p-8 max-w-[1400px] mx-auto w-full",children:l?e.jsx(Pt,{home:u?`/admin/clients/${u}`:null}):e.jsx(Pe,{})})})]})]})})}function Pt({home:s}){return e.jsxs("div",{className:"flex flex-col items-center justify-center py-24 text-center",children:[e.jsx("div",{className:"h-14 w-14 rounded-2xl bg-destructive/10 flex items-center justify-center mb-4",children:e.jsx(dt,{className:"h-7 w-7 text-destructive"})}),e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Acesso negado"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2 max-w-md",children:"Você não tem permissão para acessar esta área do sistema."}),s&&e.jsx(E,{to:s,className:"mt-6 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",children:"Voltar para minha landing page"})]})}function Jt(){return e.jsx($e,{children:e.jsx($t,{})})}function $t(){const{isAuthenticated:s,isLoading:d}=z();return d?e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):s?e.jsx(Ae,{children:e.jsx(_t,{})}):e.jsx(At,{})}function At(){const{signIn:s}=z(),[d,n]=o.useState(""),[u,l]=o.useState(""),[x,c]=o.useState(""),[a,r]=o.useState(!1),f=async m=>{m.preventDefault(),r(!0),c("");const{error:p}=await s(d,u);p&&c(p.message),r(!1)};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:e.jsx("div",{className:"w-full max-w-sm animate-scale-in",children:e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-8 shadow-lg",children:[e.jsx("h1",{className:"text-2xl font-bold text-card-foreground mb-1",children:"Login Admin"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Entre para gerenciar seus leads"}),x&&e.jsx("div",{className:"mb-4 rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:x}),e.jsxs("form",{onSubmit:f,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-card-foreground",children:"Email"}),e.jsx("input",{type:"email",value:d,onChange:m=>n(m.target.value),className:"mt-1 w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",placeholder:"[email protected]",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-card-foreground",children:"Senha"}),e.jsx("input",{type:"password",value:u,onChange:m=>l(m.target.value),className:"mt-1 w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",placeholder:"••••••••",required:!0})]}),e.jsx("button",{type:"submit",disabled:a,className:"w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors",children:a?"Entrando...":"Entrar"})]})]})})})}export{Jt as component};

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.