PageSourceSearch

https://xctvgo.pt/assets/dashboard.acessos-Boa7V7A3.js

js xctvgo.pt collected 2026-10-09 21:29:18 UTC 6,367 bytes, 1 lines download raw bytes

1import{r as p,u as o,s as c,j as e,B as t,L as r,aq as b,_ as N,a3 as v,t as y}from"./index-BwUIpd49.js";import{R as w}from"./refresh-cw-BY3vSwm9.js";import{E as C}from"./eye-off-BPuPMOeN.js";import{C as h}from"./circle-check-8UhdbbD2.js";import{C as f}from"./copy-BPsZBIqn.js";import{M as S}from"./message-square-Co4NGp6R.js";import{E as k}from"./external-link-B8YktaN9.js";function A(){const[x,m]=p.useState(null),[i,j]=p.useState(null),{data:d}=o({queryKey:["auth-user"],queryFn:async()=>{const{data:s}=await c.auth.getUser();return s.user}}),{data:n}=o({queryKey:["client-profile",d?.id],enabled:!!d?.id,queryFn:async()=>{const{data:s}=await c.from("clients").select("id").eq("user_id",d?.id||"").single();return s}}),{data:l,isLoading:g}=o({queryKey:["client-accesses",n?.id],enabled:!!n?.id,queryFn:async()=>{const{data:s,error:a}=await c.from("iptv_accesses").select("*").eq("client_id",n?.id||"");if(a)throw a;return s||[]}}),u=(s,a)=>{s&&(navigator.clipboard.writeText(s),m(a),y.success("Copiado!"),setTimeout(()=>m(null),2e3))};return g?e.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[e.jsx(w,{className:"animate-spin text-primary mb-4",size:32}),e.jsx("p",{className:"text-muted-foreground",children:"A carregar os seus acessos..."})]}):e.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Os Meus Acessos IPTV"}),e.jsx("p",{className:"text-muted-foreground",children:"Gerencie todas as suas listas e credenciais ativas."})]}),e.jsx(t,{className:"rounded-xl shadow-premium",asChild:!0,children:e.jsx(r,{to:"/dashboard/adicionar-acesso",children:"Adicionar Nova Lista"})})]}),!l||l.length===0?e.jsxs("div",{className:"glass-panel p-12 rounded-3xl border border-dashed border-border text-center space-y-6",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-surface flex items-center justify-center mx-auto text-muted-foreground",children:e.jsx(b,{size:32})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-xl font-bold",children:"Nenhum acesso encontrado"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:"Ainda não tem listas associadas à sua conta. Vincule um acesso existente para o gerir aqui."})]}),e.jsx(t,{variant:"outline",asChild:!0,children:e.jsx(r,{to:"/dashboard/adicionar-acesso",children:"Vincular Agora"})})]}):e.jsx("div",{className:"grid gap-6",children:l.map(s=>e.jsx("div",{className:"glass-panel p-6 md:p-8 rounded-3xl border border-border/50 bg-surface/20 hover:bg-surface/40 transition-all",children:(()=>{const a=typeof s.notes=="string"&&s.notes.startsWith("SSIPTV:")?s.notes.replace(/^SSIPTV:\s*/,"").trim():"";return e.jsxs("div",{className:"flex flex-col md:flex-row justify-between gap-6",children:[e.jsxs("div",{className:"space-y-6 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-sm",children:e.jsx(N,{size:24})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-lg",children:s.label||"Lista IPTV"}),e.jsx("p",{className:"text-xs text-muted-foreground font-mono truncate max-w-[200px] md:max-w-xs",children:s.host||"DNS Oculto"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 pt-4 border-t border-border/30",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[10px] uppercase font-bold text-muted-foreground tracking-widest",children:"Utilizador"}),e.jsx("p",{className:"text-sm font-mono font-bold",children:s.username})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[10px] uppercase font-bold text-muted-foreground tracking-widest",children:"Password"}),e.jsxs("p",{className:"text-sm font-mono font-bold flex items-center gap-2 group",children:[i===s.id?s.password_encrypted:"••••••••",e.jsx("button",{onClick:()=>j(i===s.id?null:s.id),className:"text-muted-foreground hover:text-primary",children:i===s.id?e.jsx(C,{size:14}):e.jsx(v,{size:14})})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[10px] uppercase font-bold text-muted-foreground tracking-widest",children:"Estado"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${s.status==="active"?"bg-green-500 animate-pulse":"bg-red-500"}`}),e.jsx("span",{className:`text-xs font-bold ${s.status==="active"?"text-green-500":"text-red-500"} uppercase`,children:s.status==="active"?"Ativo":"Inativo"})]})]}),a&&e.jsxs("div",{className:"space-y-1 sm:col-span-2 lg:col-span-3",children:[e.jsx("p",{className:"text-[10px] uppercase font-bold text-muted-foreground tracking-widest",children:"SSIPTV"}),e.jsx("p",{className:"text-xs font-mono break-all",children:a})]})]})]}),e.jsxs("div",{className:"flex flex-col justify-between items-stretch md:items-end gap-6 pt-6 md:pt-0",children:[e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-[10px] uppercase font-bold text-muted-foreground tracking-widest mb-1",children:"Validade"}),e.jsx("p",{className:"font-bold",children:s.expires_at?new Date(s.expires_at).toLocaleDateString():"Ilimitada"})]}),e.jsxs("div",{className:"grid grid-cols-2 md:flex gap-3",children:[e.jsxs(t,{variant:"outline",className:"rounded-xl gap-2 flex-1 md:flex-none",onClick:()=>u(s.m3u_url_generated||"",s.id),children:[x===s.id?e.jsx(h,{size:16}):e.jsx(f,{size:16}),"M3U"]}),a&&e.jsxs(t,{variant:"outline",className:"rounded-xl gap-2 flex-1 md:flex-none",onClick:()=>u(a,`${s.id}-ssiptv`),children:[x===`${s.id}-ssiptv`?e.jsx(h,{size:16}):e.jsx(f,{size:16}),"SSIPTV"]}),e.jsx(t,{variant:"outline",className:"rounded-xl gap-2 flex-1 md:flex-none",asChild:!0,children:e.jsxs(r,{to:"/dashboard/suporte",children:[e.jsx(S,{size:16})," Suporte"]})}),e.jsx(t,{variant:"default",className:"rounded-xl gap-2 col-span-2 md:col-span-1 shadow-premium",asChild:!0,children:e.jsxs(r,{to:"/dashboard/renovacoes",children:[e.jsx(k,{size:16})," Renovar"]})})]})]})]})})()},s.id))})]})}export{A 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.