PageSourceSearch

https://aiclubstudio.com/assets/ProfilePage-DzU6H_CR.js

js aiclubstudio.com collected 2026-09-24 14:38:12 UTC 52,593 bytes, 7 lines download raw bytes

1import{bt as jt,cP as U,cH as ge,c9 as o,bT as e,P as X,R as J,U as Q,V as Z,b6 as wt,am as V,bH as D,bf as M,cp as Le,S as qe,x as K,Y as vt,y as Ve,cv as H,b8 as ee,bl as O,ba as yt,aW as Nt,cI as kt,cw as St,aa as Ct,ai as Ge,s as _t,a6 as be,bg as Ke,$ as Pt}from"./index-CI6avYI6.js";import{L as Et}from"./LanguageSwitcher-Cr5a2Gri.js";import{U as $t}from"./UserMenu-BxMPUou1.js";import{F as Ye}from"./CreatorCard-ClCBY0z4.js";import{l as It,m as Tt,s as Xe,M as Lt,d as Rt,f as Mt,u as Ut,E as At,g as Dt,h as Re,A as Ft,o as Ht,v as Me,w as Ot,t as zt,r as Bt,p as Wt,N as qt,z as Vt,y as Gt,K as Kt}from"./socialStore-Bxm2RAqo.js";import{R as Yt,G as Xt}from"./CommunityGallery-CUcYzRTK.js";import{S as Ue}from"./share-2-D8Ka49Ir.js";import{P as Je}from"./pencil-BWcptimW.js";import{C as Jt}from"./copy-Drq--ImP.js";import{F as Qe}from"./AdminCreateManualPostDialog-ByAYxFoS.js";import{l as Qt}from"./logo-Dd8UVa9P.js";import{L as Ae}from"./label-BQlKK_f_.js";import{I as Zt}from"./input-c2KtIZde.js";import{F as z}from"./frame-CZ3Jjrzo.js";import{T as Ze}from"./trash-2-D5KzDcyR.js";import{P as xe,M as es}
1from"./plus-BBFzmmnQ.js";import{S as ts}from"./SocialClubLogo-DLChgcn1.js";import{P as ss}from"./ProfileCreationDialog-BI9SzH7j.js";import{S as et}from"./send-BrwBoPfv.js";import{C as as}from"./chevron-left-JMBTzHrp.js";import{C as rs,G as tt}from"./globe-DkHoVhqA.js";import{u as De}from"./privateMedia-CtsDdz0F.js";import{t as ls}from"./shareUrl-BNpwCCuc.js";import{U as os}from"./user-x-BVIoKKoR.js";import{C as is}from"./subDays-1ejqalbl.js";import{S as ns}from"./settings-QR8NFPa2.js";import{L as cs}from"./link-2-WfpJJVeO.js";import{L as pe}from"./lock-DUISuNvr.js";import{I as ds}from"./instagram-BhwS_HJ0.js";import{M as ms}from"./music-2-DFuRUYTg.js";import{Y as us}from"./youtube-0cq_Vl0t.js";import{C as hs}from"./clock-D3F-Mnix.js";import"./dropdown-menu-Bjjy4zf9.js";import"./index-BcJPsVME.js";import"./shield-DwxFSf8w.js";import"./spendableCredits-CX4QOaJk.js";import"./credit-card-BqY6ud1w.js";import"./coins-H2WIqHPe.js";import"./shopping-cart-CEwcEKk2.js";import"./wallet-zjUNLzfN.js";import"./use-mobile-BN24EY3X.js";import"./usePersistedNumber-DycJ-q9l.js";import"./badge-s7zqJApu.js";import"./tabs-BGQ9QXuD.js";import"./flowCategories-CYLRfGgL.js";import"./communityFlowsStore-DowbukZb.js";import"./ModelIcon-DZ7sxSJt.js";import"./GrokBrandIcon-BwdE94Pb.js";import"./googleCreditMode-bNxNPhoz.js";import"./Gpt25ModeSelector-BbkY0pg4.js";import"./gpt-image-models-B9mJr-5C.js";import"./validateFileSize-C7ikwWBe.js";import"./useSpeechToText-D1o2qGV5.js";import"./switch-D6zflKri.js";import"./index-B_KX8jQJ.js";import"./useUserLoras-FamGh9ax.js";import"./civitaiResolver-DL-GunhL.js";import"./PresetSelector-DNZwdfrT.js";import"./select-i2WPjJAf.js";import"./index-BdQq_4o_.js";import"./chevron-up-wPm2ohBk.js";import"./package-D4myghke.js";import"./popover-DB1-wPER.js";import"./save-BkC7D8kW.js";import"./PromptTemplatesButton-DND6xasD.js";import"./SavePromptTemplateDialog-C9Gh4u37.js";import"./textarea-IX93-vF_.js";import"./usePromptTemplates-96pHPzTm.js";import"./usePromptLibrary-C5CEaCAA.js";import"./useQuery-D5L_x_gu.js";import"./bookmark-8KyNiB-W.js";import"./search-Bhk1X3Qs.js";import"./EnhancePromptButton-DdVNcnp-.js";import"./GoogleAuthPicker-DNYaDylq.js";import"./useUserGoogleKeys-DYA_LwoN.js";import"./seedreamPricing-_VPL6COl.js";import"./qwen3Pricing-Cz2SNhkX.js";import"./grip-vertical-JCAMTWvw.js";import"./paperclip-BPFg0BL9.js";import"./sliders-horizontal-Co0fz36n.js";import"./ban-CFCXiXwL.js";import"./maximize-2-CP5SPdBE.js";import"./minus-DFCv2y7o.js";import"./external-link-Bbps5s9z.js";import"./eye-off-C3zH4o_Z.js";import"./calendar-C-gwidSb.js";import"./playgroundReuse--PCs5ani.js";import"./BeforeAfterComparator-BwJH9Td5.js";import"./chevrons-left-right-BL1orcUd.js";import"./modelLabels-BO7vGs15.js";import"./shield-alert-C5-HcLXp.js";import"./upload-Dk6Qf-Wu.js";import"./mountain-CGxNcyUB.js";import"./flame-ejCjciHA.js";import"./circle-x-Bi-tq8zD.js";import"./info-DXcYVG5D.js";import"./edgeFunctionError-tJ6Y4zvS.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const fs=jt("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),xs=({open:t,onClose:a,userId:r,mode:u})=>{const{t:s}=U(),c=ge(),[m,n]=o.useState(!0),[x,f]=o.useState([]);o.useEffect(()=>{if(!t)return;let d=!1;return n(!0),(u==="followers"?It(r):Tt(r)).then(g=>{d||(f(g),n(!1))}),()=>{d=!0}},[t,r,u]);const h=d=>{d.username&&(a(),c(`/social/@${d.username}`))};return e.jsx(X,{open:t,onOpenChange:d=>!d&&a(),children:e.jsxs(J,{className:"max-w-sm",children:[e.jsx(Q,{children:e.jsxs(Z,{className:"flex items-center gap-2 text-base",children:[e.jsx(wt,{className:"w-4 h-4 text-primary"}),u==="followers"?s("social.followers","Seguidores"):s("social.followingList","Seguindo")]})}),m?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(V,{className:"w-5 h-5 animate-spin text-primary"})}):x.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:s("social.emptyList","Ninguém por aqui ainda.")}):e.jsx("div",{className:"max-h-[60vh] overflow-y-auto -mx-2 px-2 space-y-1",children:x.map(d=>{var g,w;return e.jsxs("div",{className:"flex items-center gap-3 py-1.5",children:[e.jsxs("button",{onClick:()=>h(d),disabled:!d.username,title:d.username?void 0:s("social.noPageYet","Esse usuário ainda não tem página pública"),className:"flex items-center gap-3 flex-1 min-w-0 text-left disabled:cursor-default disabled:opacity-70",children:[e.jsx("div",{className:"w-9 h-9 rounded-full bg-secondary overflow-hidden flex items-center justify-center ring-1 ring-white/10 shrink-0",children:d.avatar_url?e.jsx("img",{src:M(d.avatar_url,48)||void 0,alt:"",className:"w-full h-full object-cover",onError:D}):e.jsx("span",{className:"text-xs text-muted-foreground",children:((w=(g=d.nickname)==null?void 0:g[0])==null?void 0:w.toUpperCase())||"?"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:d.nickname||s("community.member","membro")}),d.username&&e.jsxs("p",{className:"text-[11px] text-muted-foreground truncate",children:["@",d.username]})]})]}),e.jsx(Ye,{targetUserId:d.user_id,following:d.is_following,size:"sm"})]}
6,d.user_id)})})]})})};function Fe(t){return new Promise(a=>{if(!t)return a(null);const r=new Image;r.crossOrigin="anonymous",r.onload=()=>a(r),r.onerror=()=>a(null),r.src=t})}function He(t,a,r,u,s,c){const m=Math.max(0,Math.min(c,u/2,s/2));t.beginPath(),t.moveTo(a+m,r),t.arcTo(a+u,r,a+u,r+s,m),t.arcTo(a+u,r+s,a,r+s,m),t.arcTo(a,r+s,a,r,m),t.arcTo(a,r,a+u,r,m),t.closePath()}function Oe(t,a,r,u,s,c){const m=a.width/a.height,n=s/c;let x=a.width,f=a.height,h=0,d=0;m>n?(x=a.height*n,h=(a.width-x)/2):(f=a.width/n,d=(a.height-f)/2),t.drawImage(a,h,d,x,f,r,u,s,c)}function ze(t,a,r,u){const s=(a||"").trim().split(/\s+/).filter(Boolean),c=[];let m="";for(const n of s){const x=m?`${m} ${n}`:n;if(t.measureText(x).width>r&&m?(c.push(m),m=n):m=x,c.length===u)break}if(m&&c.length<u&&c.push(m),c.length===u&&(m||s.length>0)){let n=c[u-1];for(;t.measureText(n+"…").width>r&&n.length>1;)n=n.slice(0,-1);s.join(" ")!==c.join(" ")&&(c[u-1]=n+"…")}return c}async function ps(t){var p,l;const u=document.createElement("canvas");u.width=1080,u.height=1350;const s=u.getContext("2d");if(!s)return null;try{await((p=document.fonts)==null?void 0:p.ready)}catch{}const c=s.createLinearGradient(0,0,0,1350);c.addColorStop(0,"#0c0f0e"),c.addColorStop(.5,"#0a0a0c"),c.addColorStop(1,"#050706"),s.fillStyle=c,s.fillRect(0,0,1080,1350);const m=s.createRadialGradient(1080/2,1350*.32,60,1080/2,1350*.32,1080*.75);m.addColorStop(0,"rgba(16,185,129,0.28)"),m.addColorStop(1,"rgba(16,185,129,0)"),s.fillStyle=m,s.fillRect(0,0,1080,1350);const n=1080/2,x="system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",f=300,h=150,d=await Fe(M(t.avatarUrl||"",360,85));s.save(),s.beginPath(),s.arc(n,h+f/2,f/2+8,0,Math.PI*2),s.lineWidth=8,s.strokeStyle="rgba(52,211,153,0.9)",s.stroke(),s.beginPath(),s.arc(n,h+f/2,f/2,0,Math.PI*2),s.clip(),d?Oe(s,d,n-f/2,h,f,f):(s.fillStyle="#14201b",s.fillRect(n-f/2,h,f,f),s.fillStyle="#5eead4",s.font=`600 140px ${x}`,s.textAlign="center",s.textBaseline="middle",s.fillText(((l=(t.nickname||t.username||"?").trim()[0])==null?void 0:l.toUpperCase())||"?",n,h+f/2+6)),s.restore(),s.textAlign="center",s.textBaseline="alphabetic",s.fillStyle="#f5f7f6",s.font=`700 62px ${x}`;const g=(t.nickname||(t.username?`@${t.username}`:"")).trim();s.fillText(ze(s,g,920,1)[0]||"",n,560),t.username&&(s.fillStyle="rgba(180,190,186,0.85)",s.font=`400 36px ${x}`,s.fillText(`@${t.username}`,n,612)),s.fillStyle="#d7faec",s.font=`500 46px ${x}`,ze(s,t.tagline,880,3).forEach((_,N)=>s.fillText(_,n,712+N*60));const j=(t.thumbs||[]).filter(Boolean).slice(0,3);if(j.length){const N=(await Promise.all(j.map(k=>Fe(M(k,420,80))))).filter(Boolean);if(N.length){const P=N.length,L=(920-28*(P-1))/P,I=L,B=980;let R=(1080-(L*P+28*(P-1)))/2;for(const A of N)s.save(),He(s,R,B,L,I,28),s.clip(),Oe(s,A,R,B,L,I),s.restore(),s.lineWidth=2,s.strokeStyle="rgba(255,255,255,0.10)",He(s,R,B,L,I,28),s.stroke(),R+=L+28}}return t.footer&&(s.fillStyle="rgba(150,160,156,0.8)",s.font=`500 32px ${x}`,s.fillText(t.footer,n,1280)),await new Promise(_=>{try{u.toBlob(N=>_(N),"image/png",.92)}catch{_(null)}})}const gs=({open:t,onClose:a,profile:r,isOwner:u,shareUrl:s})=>{const{t:c}=U(),m=c("social.shareCta","Me siga e acompanhe minhas criações de IA 🎨"),[n,x]=o.useState(m),[f,h]=o.use
6State([]),[d,g]=o.useState(null),[w,j]=o.useState(null),[p,l]=o.useState(!0),[_,N]=o.useState(!1),[k,P]=o.useState(!1),[G,L]=o.useState(!1),I=o.useRef(null),B=r.nickname||(r.username?`@${r.username}`:""),R=(()=>{try{return new URL(s).host}catch{return"aiclubstudio.com"}})();o.useEffect(()=>{if(!t)return;let b=!0;return Xe(r.user_id,{tier:"community",limit:3}).then(y=>{b&&h(y.map(T=>T.thumbnail_url||T.media_url).filter(Boolean).slice(0,3))}),u&&Le.from("profiles").select("share_tagline").eq("user_id",r.user_id).maybeSingle().then(({data:y})=>{b&&(y!=null&&y.share_tagline)&&x(y.share_tagline)}),()=>{b=!1}},[t,r.user_id,u]),o.useEffect(()=>{if(!t)return;l(!0);const b=setTimeout(async()=>{const y=await ps({avatarUrl:r.avatar_url,nickname:r.nickname,username:r.username,tagline:n.trim()||m,thumbs:f,footer:R});if(I.current&&(URL.revokeObjectURL(I.current),I.current=null),y){const T=URL.createObjectURL(y);I.current=T,j(y),g(T)}else j(null),g(null);l(!1)},400);return()=>clearTimeout(b)},[t,n,f,r.avatar_url,r.nickname,r.username,R,m]),o.useEffect(()=>()=>{I.current&&URL.revokeObjectURL(I.current)},[]);const A=async()=>{if(!w){v();return}const b=new File([w],"aiclub-profile.png",{type:"image/png"}),y=navigator;if(y.canShare&&y.canShare({files:[b]}))try{await y.share({files:[b],title:`${B} · AI Club Studio`,text:`${n.trim()||m}
7${s}`});return}catch{}F()},F=()=>{if(!d)return;const b=document.createElement("a");b.href=d,b.download=`aiclub-${r.username||"profile"}.png`,document.body.appendChild(b),b.click(),b.remove()},v=async()=>{try{await navigator.clipboard.writeText(s),P(!0),setTimeout(()=>P(!1),1600)}catch{H.error(c("common.error","Algo deu errado"))}},C=async()=>{N(!0);const b=n.trim().slice(0,120)||null,{error:y}=await Le.from("profiles").update({share_tagline:b}).eq("user_id",r.user_id);if(N(!1),L(!1),y){H.error(c("common.error","Algo deu errado"));return}H.success(c("social.shareTaglineSaved","Frase de divulgação salva."))};return e.jsx(X,{open:t,onOpenChange:b=>{b||a()},children:e.jsxs(J,{className:"max-w-md",children:[e.jsxs(Q,{children:[e.jsxs(Z,{className:"flex items-center gap-2",children:[e.jsx(Ue,{className:"w-4 h-4 text-primary"})," ",c("social.shareTitle","Compartilhar perfil")]}),e.jsx(qe,{children:c("social.shareDesc","Gere uma imagem bonita do seu perfil para postar no WhatsApp, stories e onde quiser.")})]}),e.jsxs("div",{className:"relative rounded-xl overflow-hidden border border-white/10 bg-secondary/30 aspect-[4/5] flex items-center justify-center",children:[p&&e.jsx(V,{className:"w-7 h-7 animate-spin text-primary/60 absolute"}),d&&e.jsx("img",{src:d,alt:"",className:`w-full h-full object-contain transition-opacity ${p?"opacity-40":"opacity-100"}`})]}),u&&(G?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{value:n,onChange:b=>x(b.target.value),maxLength:120,placeholder:m,className:"flex-1 h-9 px-3 rounded-lg bg-secondary/60 border border-white/10 text-sm outline-none focus:border-primary/40"}),e.jsx(K,{size:"sm",onClick:C,disabled:_,children:_?e.jsx(V,{className:"w-3.5 h-3.5 animate-spin"}):c("social.shareTaglineSave","Salvar")})]}):e.jsxs("button",{onClick:()=>L(!0),className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground self-start",children:[e.jsx(Je,{className:"w-3.5 h-3.5"})," ",c("social.shareTaglineEdit","Personalizar a frase")]})),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(K,{onClick:A,disabled:p||!w,className:"flex-1 gap-1.5",children:[e.jsx(Ue,{className:"w-4 h-4"})," ",c("social.shareImageBtn","Compartilhar")]}),e.jsx(K,{variant:"secondary",onClick:F,disabled:p||!d,title:c("social.shareDownloadBtn","Baixar imagem"),className:"px-3",children:e.jsx(vt,{className:"w-4 h-4"})}),e.jsx(K,{variant:"secondary",onClick:v,title:c("social.copyLink","Copiar link"),
7className:"px-3",children:k?e.jsx(Ve,{className:"w-4 h-4 text-emerald-400"}):e.jsx(Jt,{className:"w-4 h-4"})})]})]})})},bs=({onReport:t})=>{const{t:a}=U();return e.jsxs("footer",{className:"mt-12 border-t border-white/[0.07] pt-6 pb-10 text-center",children:[e.jsxs("p",{className:"max-w-2xl mx-auto text-[11px] leading-relaxed text-muted-foreground/80",children:[a("social.disclaimer","Este perfil reúne conteúdos publicados pelo próprio usuário, que é o único responsável pelo que compartilha — incluindo conteúdo adulto ou sensível, quando permitido. As mídias podem ter sido geradas, editadas ou modificadas por inteligência artificial. Ao publicar, o usuário declara ter autorização para usar imagens, marcas, rostos, vozes, nomes, personagens, músicas, textos e demais elementos, e que o conteúdo NÃO retrata pessoas reais identificáveis sem consentimento, NÃO envolve menores de idade e NÃO viola leis, direitos de terceiros ou nossas políticas. Conteúdos que infrinjam isso podem ser denunciados e removidos após análise.")," ",t&&e.jsxs("button",{onClick:t,className:"inline-flex items-center gap-1 font-medium text-muted-foreground hover:text-destructive underline underline-offset-2",children:[e.jsx(Qe,{className:"w-3 h-3"})," ",a("social.report","Denunciar")]})]}),e.jsxs("div",{className:"mt-4 flex items-center justify-center gap-4 text-[11px] text-muted-foreground/70",children:[e.jsx("a",{href:"/termos",className:"hover:text-foreground",children:a("footer.terms","Termos")}),e.jsx("a",{href:"/privacidade",className:"hover:text-foreground",children:a("footer.privacy","Privacidade")}),e.jsx("a",{href:"/contato",className:"hover:text-foreground",children:a("footer.contact","Contato")})]}),e.jsxs("p",{className:"mt-3 text-[10px] text-muted-foreground/50",children:["© ",2026," AI Club Studio"]})]})},le=t=>`${t.kind}:${t.id}`,st=({open:t,onClose:a,onSaved:r,creations:u,existing:s,seed:c})=>{const{t:m}
7=U(),[n,x]=o.useState(""),[f,h]=o.useState([]),[d,g]=o.useState(!1);o.useEffect(()=>{t&&(x((s==null?void 0:s.title)||""),h(s?s.items.map(le):c?c.map(le):[]))},[t,s,c]);const w=p=>h(l=>l.includes(p)?l.filter(_=>_!==p):[...l,p]),j=async()=>{var N,k;if(!n.trim()){H.error(m("social.highlightTitleRequired","Dê um nome ao destaque"));return}if(f.length===0){H.error(m("social.highlightPickOne","Escolha ao menos uma criação"));return}const p=new Map(u.map(P=>[le(P),P])),l=f.map(P=>p.get(P)).filter(Boolean);g(!0);const _=s?await Lt(s.id,{title:n,items:l,cover_url:((N=l[0])==null?void 0:N.thumb)??null}):await Rt(n,l,((k=l[0])==null?void 0:k.thumb)??null);if(g(!1),!_){H.error(m("social.highlightSaveError","Não foi possível salvar"));return}r(),a()};return e.jsx(X,{open:t,onOpenChange:p=>!p&&a(),children:e.jsxs(J,{className:"max-w-lg",children:[e.jsx(Q,{children:e.jsx(Z,{children:s?m("social.editHighlight","Editar destaque"):m("social.newHighlight","Novo destaque")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Ae,{className:"text-xs",children:m("social.highlightName","Nome")}),e.jsx(Zt,{value:n,onChange:p=>x(p.target.value),maxLength:30,placeholder:m("social.highlightNamePlaceholder","Ex: Pets, Trabalhos…")})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(Ae,{className:"text-xs",children:[m("social.highlightPick","Escolha as criações")," ",e.jsxs("span",{className:"text-muted-foreground",children:["(",f.length,")"]})]}),u.length===0?e.jsx("p",{className:"text-xs text-muted-foreground py-6 text-center",children:m("social.noCreations","Nenhuma criação publicada ainda.")}):e.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-5 gap-2 max-h-[50vh] overflow-y-auto",children:u.map(p=>{const l=le(p),_=f.indexOf(l),N=_>=0;return e.jsxs("button",{onClick:()=>w(l),className:O("relative aspect-square rounded-lg overflow-hidden border-2 transition-colors",N?"border-primary":"border-transparent hover:border-white/20"),children:[p.thumb?p.media_type==="video"?e.jsx("video",{src:`${p.thumb}#t=0.1`,className:"w-full h-full object-cover",muted:!0,playsInline:!0,preload:"metadata"}):e.jsx("img",{src:M(p.thumb,240)||void 0,alt:"",loading:"lazy",className:"w-full h-full object-cover",onError:D}):e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-secondary",children:e.jsx(z,{className:"w-5 h-5 text-primary/40"})}),p.kind==="flow"&&e.jsx("span",{className:"absolute top-1 left-1",children:e.jsx(z,{className:"w-3 h-3 text-white drop-shadow"})}),p.media_type==="video"&&e.jsx("span",{className:"absolute top-1 left-1",children:e.jsx(ee,{className:"w-3 h-3 text-white drop-shadow"})}),N&&e.jsx("span",{className:"absolute top-1 right-1 w-5 h-5 rounded-full bg-primary text-primary-foreground text-[10px] font-bold flex items-center justify-center",children:_===0?"★":_+1})]},l)})}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:m("social.highlightCoverHint","A primeira escolhida (★) vira a capa.")})]}),e.jsxs(K,{onClick:j,disabled:d,className:"w-full gap-2",children:[d?e.jsx(V,{className:"w-4 h-4 animate-spin"}):e.jsx(Ve,{className:"w-4 h-4"}),m("common.save","Salvar")]})]})]})})},js=({open:t,onClose:a,highlight:r,isOwner:u,onEdit:s,onChanged:c})=>{const{t:m}=U(),n=ge(),x=h=>{a(),n(h.kind==="flow"?`/playground/community/flow/${h.id}`:`/playground/community/${h.id}`)},f=async()=>{window.confirm(m("social.highlightDeleteConfirm","Apagar este destaque?"))&&(await Mt(r.id),c(),a())};return e.jsx(X,{open:t,onOpenChange:h=>!h&&a(),children:e.jsxs(J,{className:"max-w-lg",children:[e.jsx(Q,{children:e.jsxs(Z,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate",children:r.title}),u&&e.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[e.jsx("button",{onClick:s,className:"w-7 h-7 rounded-md flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-secondary",title:m("social.editHighlight","Editar"),children:e.jsx(Je,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:f,className:"w-7 h-7 rounded-md flex items-center justify-center text-destructive/60 hover:text-destructive hover:bg-destructive/10",title:m("social.highlightDelete","Apagar"),children:e.jsx(Ze,{className:"w-3.5 h-3.5"})})]})]})}),e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 gap-2 max-h-[60vh] overflow-y-auto",children:r.items.map(h=>e.jsxs("button",{onClick:()=>x(h),className:"relative aspect-square rounded-lg overflow-hidden bg-secondary/40 border border-white/[0.06] hover:border-primary/40 transition-colors",children:[h.thumb?h.media_type==="video"?e.jsx("video",{src:`${h.thumb}#t=0.1`,className:"w-full h-full object-cover",muted:!0,playsInl
7ine:!0,preload:"metadata"}):e.jsx("img",{src:M(h.thumb,480)||void 0,alt:h.title||"",loading:"lazy",className:"w-full h-full object-cover",onError:D}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx(z,{className:"w-6 h-6 text-primary/40"})}),h.kind==="flow"&&e.jsx("span",{className:"absolute top-1 right-1",children:e.jsx(z,{className:"w-3 h-3 text-white drop-shadow"})}),h.media_type==="video"&&e.jsx("span",{className:"absolute top-1 right-1",children:e.jsx(ee,{className:"w-3 h-3 text-white drop-shadow"})})]},`${h.kind}-${h.id}`))})]})})},ws=({userId:t,isOwner:a,creations:r})=>{const{t:u}=U(),[s,c]=o.useState([]),[m,n]=o.useState(!1),[x,f]=o.useState(null),[h,d]=o.useState(null),g=o.useCallback(()=>{Ut(t).then(c)},[t]);if(o.useEffect(()=>{g()},[g]),!a&&s.length===0)return null;const w=()=>{f(null),n(!0)},j=p=>{d(null),f(p),n(!0)};return e.jsxs("div",{className:"flex items-start justify-start gap-5 mb-6 overflow-x-auto scrollbar-thin pb-1",children:[a&&e.jsxs("button",{onClick:w,className:"flex flex-col items-center gap-1.5 shrink-0 group",children:[e.jsx("div",{className:"w-16 h-16 rounded-full border-2 border-dashed border-white/20 group-hover:border-primary/60 flex items-center justify-center transition-colors",children:e.jsx(xe,{className:"w-5 h-5 text-muted-foreground group-hover:text-primary"})}),e.jsx("span",{className:"text-[11px] text-muted-foreground max-w-[64px] truncate",children:u("social.newHighlightShort","Novo")})]}),s.map(p=>e.jsxs("button",{onClick:()=>d(p),className:"flex flex-col items-center gap-1.5 shrink-0 group",children:[e.jsx("div",{className:"w-16 h-16 rounded-full p-[2px] ring-2 ring-white/15 group-hover:ring-primary/60 transition-all overflow-hidden",children:e.jsx("div",{className:"w-full h-full rounded-full overflow-hidden bg-secondary flex items-center justify-center",children:p.cover_url?e.jsx("img",{src:M(p.cover_url,96)||void 0,alt:p.title,loading:"lazy",className:"w-full h-full object-cover",onError:D}):e.jsx(z,{className:"w-5 h-5 text-primary/40"})})}),e.jsx("span",{className:"text-[11px] text-foreground/90 max-w-[64px] truncate",children:p.title})]},p.id)),e.jsx(st,{open:m,onClose:()=>n(!1),onSaved:g,creations:r,existing:x}),h&&e.jsx(js,{open:!!h,onClose:()=>d(null),highlight:h,isOwner:a,onEdit:()=>j(h),onChanged:g})]})},Be=t=>`${t.kind}:${t.id}`,vs=({open:t,onClose:a,onPosted:r,creations:u})=>{const{t:s}=U(),[c,m]=o.useState(new Set),[n,x]=o.useState(!1);o.useEffect(()=>{t&&m(new Set)},[t]);const f=d=>m(g=>{const w=new Set(g);return w.has(d)?w.delete(d):w.add(d),w}),h=async()=>{const d=u.filter(w=>c.has(Be(w)));if(d.length===0){H.error(s("social.storyPickOne","Escolha ao menos uma criação"));return}x(!0);const g=await At(d);if(x(!1),!g){H.error(s("social.storyError","Não foi possível postar o story"));return}H.success(s("social.storyPosted","Story publicado! Some em 24h.")),r(),a()};return e.jsx(X,{open:t,onOpenChange:d=>!d&&a(),children:e.jsxs(J,{className:"max-w-lg",children:[e.jsxs(Q,{children:[e.jsx(Z,{children:s("social.newStory","Novo story")}),e.jsx(qe,{children:s("social.storyDesc","Fica visível por 24h. Você pode salvar em um destaque depois.")})]}),u.length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:s("social.noCreations","Nenhuma criação publicada ainda.")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-5 gap-2 max-h-[55vh] overflow-y-auto",children:u.map(d=>{const g=Be(d),w=c.has(g);return e.jsxs("button",{onClick:()=>f(g),className:O("relative aspect-square rounded-lg overflow-hidden border-2 transition-colors",w?"border-primary":"border-transparent hover:border-white/20"),children:[d.thumb?d.media_type==="video"?e.jsx("video",{src:`${d.thumb}#t=0.1`,className:"w-full h-full object-cover",muted:!0,playsInline:!0,preload:"metadata"}):e.jsx("img",{src:M(d.thumb,240)||void 0,alt:"",loading:"lazy",className:"w-full h-full object-cover",onError:D}):e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-secondary",children:e.jsx(z,{className:"w-5 h-5 text-primary/40"})}),d.kind==="flow"&&e.jsx("span",{className:"absolute top-1 left-1",children:e.jsx(z,{className:"w-3 h-3 text-white drop-shadow"})}),d.media_type==="video"&&e.jsx("span",{className:"absolute top-1 left-1",children:e.jsx(ee,{className:"w-3 h-3 text-white drop-shadow"})}),w&&e.jsx("span",{className:"absolute inset-0 bg-primary/20"})]},g)})}),e.jsxs(K,{onClick:h,disabled:n,className:"w-full gap-2 mt-2",children:[n?e.jsx(V,{className:"w-4 h-4 animate-spin"}):e.jsx(et,{className:"w-4 h-4"}),s("social.postStory","Publicar story")]})]})]})})},ys=6e3,Ns=({open:t,onClose:a,stories:r,authorName:u,authorAvatar:s,isOwner:c,onChanged:m})=>{var N;const{t:n}
7=U(),[x,f]=o.useState(0),[h,d]=o.useState(!1);o.useEffect(()=>{t&&f(0)},[t]);const g=o.useCallback(()=>{f(k=>k+1>=r.length?(a(),k):k+1)},[r.length,a]),w=()=>f(k=>Math.max(0,k-1)),j=r[x],p=(j==null?void 0:j.media_type)==="video";if(o.useEffect(()=>{if(!t||!j||p||h)return;const k=setTimeout(g,ys);return()=>clearTimeout(k)},[t,j,p,x,g,h]),!t||!j)return null;const l=j.source_id&&j.source_kind?{kind:j.source_kind,id:j.source_id,thumb:j.thumbnail_url||j.media_url,media_url:j.media_url,media_type:j.media_type,title:null}:null,_=async()=>{window.confirm(n("social.storyDeleteConfirm","Apagar este story?"))&&(await Dt(j.id),m(),r.length<=1?a():f(k=>Math.min(k,r.length-2)))};return e.jsxs("div",{className:"fixed inset-0 z-[100] bg-black/95 flex items-center justify-center",onClick:a,children:[e.jsxs("div",{className:"relative w-full max-w-sm h-full sm:h-[90vh] sm:rounded-xl overflow-hidden bg-black flex flex-col",onClick:k=>k.stopPropagation(),children:[e.jsx("div",{className:"absolute top-2 left-2 right-2 z-20 flex gap-1",children:r.map((k,P)=>e.jsx("div",{className:"flex-1 h-0.5 rounded-full bg-white/30 overflow-hidden",children:e.jsx("div",{className:O("h-full bg-white transition-all",P<x||P===x?"w-full":"w-0")})},P))}),e.jsxs("div",{className:"absolute top-4 left-2 right-2 z-20 flex items-center gap-2 mt-1",children:[e.jsx("div",{className:"w-7 h-7 rounded-full overflow-hidden bg-secondary ring-1 ring-white/30 flex items-center justify-center",children:s?e.jsx("img",{src:M(s,48)||void 0,alt:"",className:"w-full h-full object-cover",onError:D}):e.jsx("span",{className:"text-[10px] text-white",children:(N=u[0])==null?void 0:N.toUpperCase()})}),e.jsx("span",{className:"text-xs font-medium text-white",children:u}),e.jsx("button",{onClick:a,className:"ml-auto text-white/80 hover:text-white",children:e.jsx(yt,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:p?e.jsx("video",{src:j.media_url,className:"max-w-full max-h-full",autoPlay:!0,playsInline:!0,controls:!1,onEnded:g}):e.jsx("img",{src:M(j.media_url,1080)||void 0,alt:"",className:"max-w-full max-h-full object-contain",onError:D})}),e.jsx("button",{onClick:w,className:"absolute left-0 top-12 bottom-16 w-1/3 z-10","aria-label":"prev"}),e.jsx("button",{onClick:g,className:"absolute right-0 top-12 bottom-16 w-1/3 z-10","aria-label":"next"}),e.jsx("button",{onClick:w,className:"absolute left-1 top-1/2 -translate-y-1/2 z-20 w-7 h-7 rounded-full bg-black/40 text-white/80 hover:text-white flex items-center justify-center",children:e.jsx(as,{className:"w-4 h-4"})}),e.jsx("button",{onClick:g,className:"absolute right-1 top-1/2 -translate-y-1/2 z-20 w-7 h-7 rounded-full bg-black/40 text-white/80 hover:text-white flex items-center justify-center",children:e.jsx(rs,{className:"w-4 h-4"})}),c&&e.jsxs("div",{className:"absolute bottom-3 left-0 right-0 z-20 flex items-center justify-center gap-2",children:[l&&e.jsxs("button",{onClick:()=>d(!0),className:"inline-flex items-center gap-1.5 h-8 px-3 rounded-full bg-white/10 text-white text-xs font-medium hover:bg-white/20",children:[e.jsx(Nt,{className:"w-3.5 h-3.5"})," ",n("social.addToHighlight","Destacar")]}),e.jsxs("button",{onClick:_,className:"inline-flex items-center gap-1.5 h-8 px-3 rounded-full bg-white/10 text-white text-xs font-medium hover:bg-destructive/40",children:[e.jsx(Ze,{className:"w-3.5 h-3.5"})," ",n("social.highlightDelete","Apagar")]})]})]}),l&&e.jsx("div",{onClick:k=>k.stopPropagation(),children:e.jsx(st,{open:h,onClose:()=>d(!1),onSaved:m,creations:[l],seed:[l]})})]})},at=["images","videos","flows","all"],ks={images:"image",videos:"video",flows:"flow",all:"all"},Ss={image:"images",video:"videos",flow:"flows",all:"all"},Sr=new Set(["public","unlisted",...at]);function Cs(t){const a=(t||"").split("/").filter(Boolean).map(m=>{try{return decodeURIComponent(m)}catch{return m}});let r="community",u=null,s,c=0;return a[0]==="unlisted"?(r="unlisted",a[1]&&at.includes(a[1])?(s=a[1],c=2):(u=a[1]||null,s=a[2],c=3)):a[0]==="public"?(s=a[1],c=2):(s=a[0],c=1),{tier:r,filter:s&&ks[s]||"image",keyword:u,detailId:a[c]||null}}function Y(t,a,r,u){const s=Ss[r];return a==="unlisted"?u?`/social/@${t}/unlisted/${encodeURIComponent(u)}/${s}`:`/social/@${t}/unlisted/${s}`:`/social/@${t}/public/${s}`}const Cr=()=>{var $e,Ie;const{t,i18n:a}=U(),r=ge(),u=kt(),s=u.handle,c=u["*"],m=o.useMemo(()=>Cs(c),[c]),n=m.tier,x=m.filter,f=m.keyword,h=m.detailId,d=(s||"").replace(/^@/,""),{user:g,isAdmin:w}
7=St(),[j,p]=o.useState(!0),[l,_]=o.useState(null),[N,k]=o.useState([]),[P,G]=o.useState([]),[L,I]=o.useState(!1),[B,R]=o.useState(0),[A,F]=o.useState(null),[v,C]=o.useState([]),[b,y]=o.useState({total:0,sample:[]}),[T,je]=o.useState([]),[W,ot]=o.useState({images:0,videos:0,flows:0}),[it,te]=o.useState(!1),[we,ve]=o.useState(!1),[oe,ie]=o.useState(null),[nt,se]=o.useState(null),[ye,ne]=o.useState(!1),[ce,ae]=o.useState(null),[Ne,ke]=o.useState(null),[ct,Se]=o.useState(null),de=o.useRef("none"),Ce=o.useCallback(async()=>{l&&C(await Re(l.user_id))},[l]),me=o.useCallback(async()=>{if(!d)return;p(!0),ke(null);const i=await Ft(d);if(!i){_(null),p(!1);return}_(i),R(i.follower_count),de.current=i.follow_status;const S=!!(g&&i.user_id===g.id),[$,q,he,Te]=await Promise.all([Re(i.user_id),Ht(i.user_id),Me(i.user_id),S?Promise.all([Ot(i.user_id),zt(i.user_id)]):Promise.resolve([[],[]])]);C($),y(q),je(he),k(Te[0]),G(Te[1]),p(!1)},[d,g]);o.useEffect(()=>{me()},[me]),o.useEffect(()=>{l&&Bt(l.user_id,n,f).then(ot)},[l==null?void 0:l.user_id,n,f]),o.useEffect(()=>{if(s&&!s.startsWith("@")){const i=c?`/${c}`:"";r(`/social/@${s}${i}`,{replace:!0})}},[s,c,r]);const E=!!(l&&g&&l.user_id===g.id);o.useEffect(()=>{if(!E){Se(null);return}let i=!0;return Wt().then(S=>{i&&Se(S)}),()=>{i=!1}},[E]),o.useEffect(()=>{if(!l||n!=="unlisted"){ae(null);return}if(E||w){ae(!0);return}let i=!0;return ae(null),qt(l.user_id,f).then(S=>{i&&(ae(S),S&&f&&ke(f))}),()=>{i=!1}},[l==null?void 0:l.user_id,n,f,E,w]),o.useEffect(()=>{if(!h){ie(null),se(null);return}if(oe||x!=="all"){se(null);return}let i=!0;return(async()=>{const S=await Vt(h);if(!i)return;if(S){se("post");return}const $=await Gt(h);i&&se($?"flow":"post")})(),()=>{i=!1}},[h,oe,x]);const _e=o.useMemo(()=>{const i=new Map;return T.forEach((S,$)=>i.set(`${S.kind}:${S.target_id}`,$)),i},[T]),dt=o.useMemo(()=>T.map(i=>i.target_id),[T]),mt=async i=>{if(!l)return;const S=i.kind==="flow"?"flow":i.media_type==="video"?"video":"image",$=_e.has(`${i.kind}:${i.id}`),q=await Kt(i.kind,i.id,S,!$);if(!q.ok){q.error==="limit"&&H.error(t("social.pinLimit","Máximo de 3 fixados por tipo"));return}je(await Me(l.user_id))},Pe=o.useMemo(()=>[...N.map(i=>({kind:"post",id:i.id,thumb:i.thumbnail_url||i.media_url,media_url:i.media_url,media_type:i.media_type,title:i.title})),...P.map(i=>({kind:"flow",id:i.id,thumb:i.thumbnail_url,media_url:i.thumbnail_url,media_type:"flow",title:i.title}))],[N,P]),ue=v.length>0,ut=()=>{ue?ve(!0):E&&te(!0)},re=f||Ne||(E?ct:null),ht=i=>r(Y(d,n,i,n==="unlisted"?re:null),{replace:!0}),ft=i=>r(Y(d,i,x,i==="unlisted"?re:null),{replace:!0}),xt=i=>{ie(i.kind),r(`${Y(d,n,x,n==="unlisted"?re:null)}/${i.id}`)},pt=()=>{ie(null),r(Y(d,n,x,n==="unlisted"?re:null),{replace:!0})},Ee=oe||(x==="flow"?"flow":x==="all"?nt:"post"),gt=o.useMemo(()=>l?{user_id:l.user_id,nickname:l.nickname,avatar_url:l.avatar_url,username:l.username}:null,[l==null?void 0:l.user_id,l==null?void 0:l.nickname,l==null?void 0:l.avatar_url,l==null?void 0:l.username]),bt=[{key:"image",label:t("social.filterImages","Imagens"),icon:Ct,count:W.images},{key:"video",label:t("social.filterVideos","Vídeos"),icon:ee,count:W.videos},{key:"flow",label:t("social.filterWorkflows","Workflows"),icon:z,count:W.flows},{key:"all",label:t("social.filterAll","Tudo"),icon:Ge,count:W.images+W.videos+W.flows}];return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("div",{className:"border-b border-border bg-background/80 backdrop-blur-sm sticky top-0 z-20",children:e.jsxs("div",{className:"relative max-w-6xl mx-auto px-3 md:px-4 h-14 flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>r(-1),className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors shrink-0",children:[e.jsx(_t,{className:"w-4 h-4"})," ",e.jsx("span",{className:"hidden sm:inline",children:t("common.back","Voltar")})]}),e.jsx("span",{className:"h-5 w-px bg-white/10 shrink-0","aria-hidden":!0}),e.jsxs("button",{onClick:()=>r("/playground/image"),title:"AI Club Studio",className:"flex items-center gap-2 group shrink-0",children:[e.jsx("img",{src:Qt,alt:"AI Club Studio",className:"w-7 h-7 rounded-lg ring-1 ring-white/10"}),e.jsxs("span",{className:"font-display text-sm font-semibold tracking-tight text-foreground hidden lg:block",children:["AI Club ",e.jsx("span",{className:"text-primary/80 italic font-light tracking-widest",children:"studio"})]})]}),e.jsx("button",{onClick:()=>r("/social"),title:"SocialClub",className:"absolute left-1/2 -translate-x-1/2 hidden sm:inline-flex",children:e.jsx(ts,{size:"md"})}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsx(Et,{}),g?e.jsx($t,{}):e.jsx("button",{onClick:()=>
7r("/auth"),className:"h-8 px-4 rounded-full bg-primary text-primary-foreground text-sm font-semibold",children:t("social.loginCta","Entrar")})]})]})}),j?e.jsx("div",{className:"flex justify-center py-32",children:e.jsx(V,{className:"w-7 h-7 animate-spin text-primary"})}):l?e.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-start gap-6 sm:gap-12",children:[e.jsxs("button",{onClick:ut,title:ue?t("social.viewStory","Ver story"):E?t("social.newStory","Novo story"):void 0,className:"shrink-0 relative",children:[e.jsx("div",{className:O("rounded-full p-[3px]",ue?"bg-gradient-to-tr from-amber-400 via-rose-500 to-fuchsia-600":"bg-white/10"),children:e.jsx("div",{className:"w-24 h-24 sm:w-36 sm:h-36 rounded-full overflow-hidden bg-secondary ring-2 ring-background flex items-center justify-center",children:l.avatar_url?e.jsx("img",{src:M(l.avatar_url,220)||void 0,alt:"",className:"w-full h-full object-cover",onError:D}):e.jsx("span",{className:"text-4xl font-display text-muted-foreground",children:((Ie=($e=l.nickname)==null?void 0:$e[0])==null?void 0:Ie.toUpperCase())||"?"})})}),E&&e.jsx("span",{onClick:i=>{i.stopPropagation(),te(!0)},title:t("social.newStory","Novo story"),className:"absolute bottom-1 right-1 w-7 h-7 rounded-full bg-primary text-primary-foreground flex items-center justify-center ring-2 ring-background hover:opacity-90",children:e.jsx(xe,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex-1 min-w-0 pt-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-display font-semibold text-foreground",children:l.nickname||`@${l.username}`}),l.follows_me&&!l.is_self&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-secondary text-muted-foreground",children:t("social.followsYou","Segue você")})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["@",l.username]}),e.jsxs("div",{className:"flex items-center gap-5 sm:gap-7 text-sm mt-3 flex-wrap",children:[e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:W.images+W.videos+W.flows})," ",e.jsx("span",{className:"text-muted-foreground",children:t("social.creations","criações")})]}),e.jsxs("button",{onClick:()=>F("followers"),className:"hover:text-primary transition-colors",children:[e.jsx("strong",{className:"text-foreground",children:B})," ",e.jsx("span",{className:"text-muted-foreground",children:t("social.followers","seguidores")})]}),e.jsxs("button",{onClick:()=>F("following"),className:"hover:text-primary transition-colors",children:[e.jsx("strong",{className:"text-foreground",children:l.following_count})," ",e.jsx("span",{className:"text-muted-foreground",children:t("social.followingList","seguindo")})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(be,{className:"w-3.5 h-3.5 text-rose-400"})," ",e.jsx("strong",{className:"text-foreground",children:l.total_likes})," ",e.jsx("span",{className:"text-muted-foreground",children:t("social.likes","curtidas")})]})]}),l.bio&&e.jsx("p",{className:"text-sm text-foreground/90 mt-3 max-w-xl whitespace-pre-line",children:l.bio}),e.jsx($s,{links:l.social_links}),!E&&b.total>0&&e.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[e.jsx("div",{className:"flex -space-x-2 shrink-0",children:b.sample.slice(0,3).map(i=>{var S,$;return e.jsx("div",{className:"w-6 h-6 rounded-full overflow-hidden bg-secondary ring-2 ring-background flex items-center justify-center",children:i.avatar_url?e.jsx("img",{src:M(i.avatar_url,48)||void 0,alt:"",className:"w-full h-full object-cover",onError:D}):e.jsx("span",{className:"text-[8px] text-muted-foreground",children:(($=(S=i.nickname)==null?void 0:S[0])==null?void 0:$.toUpperCase())||"?"})},i.user_id)})}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t("social.followedBy","Seguido por")," ",b.sample.slice(0,2).map((i,S,$)=>e.jsxs("span",{children:[e.jsx("span",{className:"text-foreground font-medium",children:i.nickname||`@${i.username}`}),S<$.length-1?", ":""]}
7,i.user_id)),b.total>Math.min(2,b.sample.length)&&e.jsxs(e.Fragment,{children:[" ",t("social.andOthers","e outras")," ",b.total-Math.min(2,b.sample.length)," ",t("social.people","pessoas")]})]})]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground mt-3 inline-flex items-center gap-1",children:[e.jsx(is,{className:"w-3 h-3"})," ",t("social.joined","Entrou em")," ",new Date(l.created_at).toLocaleDateString(a.language||"pt-BR",{month:"long",year:"numeric"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-5",children:[E?e.jsxs("button",{onClick:()=>r("/profile"),className:"inline-flex items-center justify-center gap-1.5 h-9 px-4 rounded-lg bg-secondary/70 border border-white/10 text-sm font-medium hover:bg-secondary",children:[e.jsx(ns,{className:"w-4 h-4"})," ",t("social.editProfile","Editar perfil")]}):e.jsx(Ye,{targetUserId:l.user_id,following:l.is_following,initialStatus:l.follow_status,isPrivateTarget:l.is_private,onChange:i=>{const S=de.current;de.current=i,R($=>$+((i==="accepted"?1:0)-(S==="accepted"?1:0)))}}),e.jsxs("button",{onClick:()=>I(!0),className:"inline-flex items-center justify-center gap-1.5 h-9 px-4 rounded-lg bg-secondary/70 border border-white/10 text-sm font-medium hover:bg-secondary",children:[e.jsx(cs,{className:"w-4 h-4"}),t("social.share","Compartilhar")]}),!E&&g&&e.jsx("button",{onClick:()=>ne(!0),title:t("social.report","Denunciar"),className:"inline-flex items-center justify-center h-9 w-9 rounded-lg bg-secondary/70 border border-white/10 text-muted-foreground hover:text-destructive hover:border-destructive/30",children:e.jsx(Qe,{className:"w-4 h-4"})}),E&&e.jsxs("button",{onClick:()=>te(!0),className:"inline-flex items-center justify-center gap-1.5 h-9 px-4 rounded-lg bg-secondary/70 border border-white/10 text-sm font-medium hover:bg-secondary",children:[e.jsx(xe,{className:"w-4 h-4"})," ",t("social.newStory","Story")]})]})]}),e.jsxs(e.Fragment,{children:[e.jsx(ws,{userId:l.user_id,isOwner:E,creations:Pe}),(()=>{const i=E||w||ce===!0||!!Ne,S=[{key:"community",label:t("social.tierPublic","Público"),Icon:tt},...i?[{key:"unlisted",label:t("social.tierOnlyMe","Não-listado"),Icon:pe}]:[]];return S.length<2?null:e.jsx("div",{className:"flex items-center justify-center gap-2 mb-4 flex-wrap",children:S.map(({key:$,label:q,Icon:he})=>e.jsxs("button",{onClick:()=>ft($),className:O("inline-flex items-center gap-1.5 h-8 px-3.5 rounded-full text-xs font-semibold border transition-colors",n===$?"bg-primary text-primary-foreground border-primary":"bg-secondary/50 text-muted-foreground border-white/10 hover:text-foreground"),children:[e.jsx(he,{className:"w-3.5 h-3.5"})," ",q]},$))})})(),e.jsx("div",{className:"flex items-center justify-center gap-10 sm:gap-16 mb-5 border-t border-white/[0.07]",children:bt.map(({key:i,label:S,icon:$,count:q})=>e.jsxs("button",{onClick:()=>ht(i),title:`${S} · ${q}`,"aria-label":S,className:O("relative flex items-center gap-1.5 pt-3 pb-2 -mt-px transition-colors",x===i?"text-foreground":"text-muted-foreground/70 hover:text-foreground"),children:[e.jsx($,{className:"w-5 h-5",strokeWidth:x===i?2.4:2}),e.jsx("span",{className:"text-xs tabular-nums",children:q}),x===i&&e.jsx("span",{className:"absolute -top-px left-0 right-0 h-0.5 bg-foreground rounded-full"})]},i))}),n==="unlisted"&&!E&&!w&&ce!==!0?ce===null?e.jsx("div",{className:"flex justify-center py-24",children:e.jsx(V,{className:"w-6 h-6 animate-spin text-primary/60"})}):e.jsxs("div",{className:"text-center py-16 px-4 border-t border-white/[0.07]",children:[e.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-secondary/60 border border-white/10 flex items-center justify-center mb-3",children:e.jsx(pe,{className:"w-5 h-5 text-muted-foreground"})}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:t("social.unlistedLocked","Conteúdo não-listado")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t("social.unlistedWrongKey","Esta coleção é privada. Você precisa do link com a palavra-chave correta para vê-la.")})]}):e.jsx(Ms,{userId:l.user_id,tier:n,keyword:f,filter:x,isOwner:E,pinnedKey:_e,pinnedIds:dt,onTogglePin:mt,onOpen:xt},`${n}:${f||""}:${x}:${l.user_id}`)]}),e.jsx(bs,{onReport:!E&&g?()=>ne(!0):void 0})]}):e.jsxs("div",{className:"max-w-md mx-auto text-center py-32 px-4",children:[e.jsx(os,{className:"w-12 h-12 mx-auto text-muted-foreground
7/40 mb-4"}),e.jsx("h2",{className:"text-lg font-semibold",children:t("social.notFoundTitle","Página não encontrada")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t("social.notFoundDesc","Esse usuário não existe ou ainda não escolheu um nome de usuário.")}),e.jsx("button",{onClick:()=>r("/playground/community"),className:"mt-6 h-9 px-4 rounded-full bg-primary text-primary-foreground text-sm font-semibold",children:t("social.backToCommunity","Ir para a comunidade")})]}),l&&A&&e.jsx(xs,{open:!!A,onClose:()=>F(null),userId:l.user_id,mode:A}),l&&ye&&e.jsx(Yt,{open:ye,onClose:()=>ne(!1),targetType:"profile",targetId:l.user_id,targetLabel:l.nickname||`@${l.username}`}),h&&Ee&&l&&e.jsx(ss,{open:!!h,onClose:pt,kind:Ee,id:h,author:gt,keyword:f,onChanged:me}),l&&E&&e.jsx(vs,{open:it,onClose:()=>te(!1),onPosted:Ce,creations:Pe}),l&&we&&v.length>0&&e.jsx(Ns,{open:we,onClose:()=>ve(!1),stories:v,authorName:l.nickname||`@${l.username}`,authorAvatar:l.avatar_url,isOwner:E,onChanged:Ce}),l&&L&&e.jsx(gs,{open:L,onClose:()=>I(!1),profile:l,isOwner:E,shareUrl:ls(Y(d,n,x,n==="unlisted"&&!E?f:null))})]})};function fe(t,a){return/^https?:\/\//.test(t)?t:`${a}${t.replace(/^@/,"")}`}function _s(t){if(/^https?:\/\//.test(t))return t;const a=t.replace(/\D/g,"");return a?`https://wa.me/${a}`:t}function Ps(t){return/^https?:\/\//.test(t)?t:`https://t.me/${t.replace(/^@/,"")}`}const Es=[{key:"instagram",Icon:ds,label:"Instagram",href:t=>fe(t,"https://instagram.com/")},{key:"tiktok",Icon:ms,label:"TikTok",href:t=>fe(t,"https://tiktok.com/@")},{key:"youtube",Icon:us,label:"YouTube",href:t=>fe(t,"https://youtube.com/@")},{key:"whatsapp",Icon:es,label:"WhatsApp",href:_s},{key:"telegram",Icon:et,label:"Telegram",href:Ps},{key:"website",Icon:tt,label:"Site",href:t=>/^https?:\/\//.test(t)?t:`https://${t}`}],$s=({links:t})=>{if(!t)return null;const a=Es.filter(r=>t[r.key]);return a.length===0?null:e.jsx("div",{className:"flex items-center gap-2 mt-3",children:a.map(({key:r,Icon:u,label:s,href:c})=>e.jsx("a",{href:c(t[r]),target:"_blank",rel:"noopener noreferrer",title:s,"aria-label":s,className:"w-8 h-8 rounded-full bg-secondary/70 border border-white/10 flex items-center justify-center text-muted-foreground hover:text-primary hover:border-primary/40 transition-colors",children:e.jsx(u,{className:"w-4 h-4"})},r))})},rt=({show:t,offset:a})=>{const{t:r}=U();return t?e.jsx("span",{title:r("social.unlistedHint","Só visível por link nesta página"),className:O("absolute top-1.5 z-10 inline-flex items-center gap-0.5 px-1.5 h-5 rounded-full bg-black/60 backdrop-blur text-[9px] font-medium text-white/90",a?"left-9":"left-1.5"),children:e.jsx(pe,{className:"w-2.5 h-2.5"})}):null},lt=({pinned:t,isOwner:a,onToggle:r})=>{const{t:u}=U();return!t&&!a?null:e.jsx("span",{role:a?"button":void 0,tabIndex:a?0:void 0,onClick:a?s=>{s.stopPropagation(),r==null||r()}:void 0,title:t?u("social.unpin","Desafixar"):u("social.pin","Fixar"),className:O("absolute top-1.5 left-1.5 z-10 w-6 h-6 rounded-full flex items-center justify-center transition-opacity",t?"bg-primary text-primary-foreground":"bg-black/55 text-white/85 opacity-0 group-hover:opacity-100",a&&"cursor-pointer hover:opacity-100"),children:e.jsx(fs,{className:"w-3 h-3",fill:t?"currentColor":"none"})})},Is=({post:t,isOwner:a,pinned:r,onTogglePin:u,onOpen:s,aspectClass:c="aspect-[4/5]"})=>{const{t:m}=U(),n=t.media_type==="video",x=t.thumbnail_url||t.media_url||"",f=De(x),h=De(t.media_url);return e.jsxs("button",{onClick:s,className:O("group relative w-full rounded-md overflow-hidden bg-secondary/30 hover:opacity-95 transition-opacity",c),children:[e.jsx(lt,{pinned:r,isOwner:a,onToggle:u}),e.jsx(rt,{show:a&&t.visibility==="unlisted",offset:r||a}),t.pending_public&&e.jsx("span",{title:m("social.publicRequestPendingShort","Aguardando aprovação para tornar público"),className:"absolute top-1.5 left-1/2 -translate-x-1/2 z-10 inline-flex items-center gap-0.5 px-1.5 h-5 rounded-full bg-amber-500/85 backdrop-blur text-[9px] font-semibold text-white",children:e.jsx(hs,{className:"w-2.5 h-2.5"})}),n?h?e.jsx("video",{src:`${h}#t=0.1`,poster:M(f,480)||void 0,className:"w-full h-full object-cover",muted:!0,playsInl
7ine:!0,preload:"metadata"}):null:f?e.jsx("img",{src:M(f,480)||void 0,srcSet:Ke(f,[240,384,480,640]),sizes:"(max-width: 640px) 50vw, 33vw",alt:t.title||"",loading:"lazy",className:"w-full h-full object-cover",onError:D}):null,n&&e.jsx("span",{className:"absolute top-1.5 right-1.5 px-1.5 h-5 rounded-full bg-black/60 text-[9px] font-medium text-white inline-flex items-center gap-0.5",children:e.jsx(ee,{className:"w-2.5 h-2.5"})}),e.jsx("div",{className:"absolute inset-x-0 bottom-0 p-2 bg-gradient-to-t from-black/80 to-transparent opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsxs("div",{className:"flex items-center gap-2.5 text-[10px] text-white/90",children:[e.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[e.jsx(be,{className:"w-3 h-3"})," ",t.like_count]}),e.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[e.jsx(Pt,{className:"w-3 h-3"})," ",t.view_count]})]})})]})},Ts=({flow:t,isOwner:a,pinned:r,onTogglePin:u,onOpen:s,aspectClass:c="aspect-video"})=>{const{t:m}=U();return e.jsxs("button",{onClick:s,className:O("group relative w-full rounded-md overflow-hidden bg-secondary/30 hover:opacity-95 transition-opacity text-left",c),children:[e.jsx(lt,{pinned:r,isOwner:a,onToggle:u}),e.jsx(rt,{show:a&&t.visibility==="unlisted",offset:r||a}),t.thumbnail_url?e.jsx("img",{src:M(t.thumbnail_url,640)||void 0,srcSet:Ke(t.thumbnail_url,[384,640,900]),sizes:"(max-width: 640px) 100vw, 50vw",alt:t.title,loading:"lazy",className:"w-full h-full object-cover",onError:D}):e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-primary/10 to-secondary/30",children:e.jsx(z,{className:"w-8 h-8 text-primary/40"})}),e.jsxs("span",{className:"absolute top-1.5 right-1.5 px-1.5 h-5 rounded-full bg-primary/80 text-[9px] font-semibold text-primary-foreground inline-flex items-center gap-0.5",children:[e.jsx(z,{className:"w-2.5 h-2.5"})," ",m("social.workflow","Workflow")]}),e.jsxs("div",{className:"absolute inset-x-0 bottom-0 p-2 bg-gradient-to-t from-black/85 to-transparent",children:[e.jsx("p",{className:"text-[11px] font-medium text-white line-clamp-1",children:t.title}),e.jsxs("div",{className:"flex items-center gap-2.5 text-[10px] text-white/80 mt-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[e.jsx(Xt,{className:"w-3 h-3"})," ",t.fork_count]}),e.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[e.jsx(be,{className:"w-3 h-3"})," ",t.like_count]})]})]})]})};function Ls(){const[t,a]=o.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 640px)").matches);return o.useEffect(()=>{const r=window.matchMedia("(min-width: 640px)"),u=()=>a(r.matches);return r.addEventListener("change",u),()=>r.removeEventListener("change",u)},[]),t?3:2}const We=18,Rs={all:{kind:null,media:null},image:{kind:"post",media:"image"},video:{kind:"post",media:"video"},flow:{kind:"flow",media:null}},Ms=({userId:t,filter:a,tier:r,keyword:u,isOwner:s,pinnedKey:c,pinnedIds:m,onTogglePin:n,onOpen:x})=>{const{t:f}=U(),[h,d]=o.useState([]),[g,w]=o.useState(0),[j,p]=o.useState(!0),[l,_]=o.useState(!0),N=o.useRef(!1),k=o.useRef(!1),P=o.useRef(null),G=Ls(),{kind:L,media:I}=Rs[a],B=o.useRef(m),R=o.useCallback(async v=>{if(N.current)return;N.current=!0,_(!0);const C=await Xe(t,{kind:L,media:I,tier:r,keyword:u,pinned:B.current,limit:We,offset:v});d(b=>{if(v===0)return C;const y=new Set(b.map(T=>`${T.kind}:${T.id}`));return[...b,...C.filter(T=>!y.has(`${T.kind}:${T.id}`))]}),w(v+C.length),p(C.length===We),_(!1),N.current=!1},[t,L,I,r,u]);o.useEffect(()=>{k.current||(k.current=!0,R(0))},[R]),o.useEffect(()=>{const v=P.current;if(!v)return;const C=new IntersectionObserver(b=>{var y;(y=b[0])!=null&&y.isIntersecting&&!N.current&&R(g)},{rootMargin:"800px"});return C.observe(v),()=>C.disconnect()},[j,g,R]);const A=o.useMemo(()=>{const v=C=>{const b=`${C.kind}:${C.id}`;return c.has(b)?c.get(b):1/0};return h.map((C,b)=>({it:C,i:b})).sort((C,b)=>{const y=v(C.it)-v(b.it);return y!==0?y:C.i-b.i}).map(C=>C.it)},[h,c]),F=v=>v.kind==="post"?e.jsx(Is,{post:v,isOwner:s,aspectClass:v.media_type==="video"?"aspect-[9/16]":"aspect-[4/5]",pinned:c.has(`post:${v.id}`),onTogglePin:()=>n(v),onOpen:()=>x(v)},`p-${v.id}`):e.jsx(Ts,{flow:v,isOwner:s,aspectClass:"aspect-video",pinned:c.has(`flow:${v.id}`),onTogglePin:()=>n(v),onOpen:()=>x(v)},`f-${v.id}`);return l&&h.length===0?e.jsx("div",{className:"flex justify-center py-24",children:e.jsx(V,{className:"w-6 h-6 animate-spin text-primary/60"})}):!l&&h.length===0?e.jsxs("div",{className:"text-center py-24 text-muted-foreground",children:[e.jsx(Ge,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),e.jsx("p",{className:"text-sm",children:f("social.noCreations","Nenhuma criação publicada ainda.")})]}):e.jsxs(e.Fragment,{children:[a==="flow"?e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3",children:A.map(F)}):a==="all"?e.jsx("div",{className:"flex gap-1 sm:gap-1.5 items-start",children:Array.from({length:G},(v,C)=>e.jsx("div",{className:"flex flex-col gap-1 sm:gap-1.5 flex-1 min-w-0",children:A.filter((b,y)=>y%G===C).map(F)},C))}):e.jsx("div",{className:"grid grid-cols-3 gap-1 sm:gap-1.5",children:A.map(F)}),j&&e.jsx("div",{ref:P,className:"flex justify-center py-8",children:e.jsx(V,{className:"w-5 h-5 animate-spin text-muted-foreground
7/40"})})]})};export{Sr as RESERVED_PROFILE_SLUGS,Cr 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.