1import{r as a,b as X,i as vt,d as H,k as ke,j as e,q as ne,l as re,m as ce,n as pt,g as ae,t as bt,e as wt,h as Nt,u as kt,f as Ct,v as Ce,T as St,a as F,E as Le,w as Ae,x as Rt,y as Lt,z as Ee,A as At,s as Et,G as Pt,B as Bt,C as Tt,D as It,F as Ot,H as qe,o as Mt}from"../app.js";import{s as we}from"./authActions.js";import{S as O}from"./sentry.js";import{c as de,i as Ze,u as Ve,s as ve,p as Ut,M as Ge,f as Xe,g as Pe}from"./profileHelpers.js";import{r as xt}from"./userRecord.js";import{p as Qe}from"./Lightbox.js";import{U as Wt,h as Dt}from"./UploadCard.js";import{P as K}from"./Pagination.js";import{M as _t}from"./MfaCodeModal.js";import{P as $t}from"./PasswordStrengthChecklist.js";import"./storyKeys.js";const Je="https://cdn.aznude.com/images/firebase/user-icon.png",Ft=["username","name","photoURL","dateOfBirth","bio","gender","socials","agego","onboardingDismissed"],zt={aznude:"AZNude",azmen:"AZMen",azfans:"AZFans"},qt=()=>e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#10b981",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),Vt=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#555",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("circle",{cx:"12",cy:"12",r:"10"})}),Ke=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),e.jsx("polyline",{points:"9 12 11 14 15 10"})]}),Gt=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),e.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"}),e.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"})]}),Ht=()=>e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),et={x:t=>e.jsx("svg",{...t,viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),instagram:t=>e.jsxs("svg",{...t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"5",ry:"5"}),e.jsx("path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"}),e.jsx("line",{x1:"17.5",y1:"6.5",x2:"17.51",y2:"6.5"})]}),tiktok:t=>e.jsx("svg",{...t,viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1 0-5.78 2.92 2.92 0 0 1 .88.13V9.4a6.84 6.84 0 0 0-1-.05A6.33 6.33 0 0 0 3 15.57 6.33 6.33 0 0 0 9.37 22a6.33 6.33 0 0 0 6.38-6.22V9.4a8.16 8.16 0 0 0 3.84.96V6.69z"})}),onlyfans:t=>
1e.jsxs("svg",{...t,viewBox:"-20.62 0.53 820.42 555.49",fill:"currentColor",children:[e.jsx("path",{d:"M266.82.53c35 0 69.65 6.91 101.98 20.34s61.71 33.11 86.45 57.93c24.75 24.81 44.37 54.27 57.77 86.7a267.9 267.9 0 0 1 20.29 102.27c0 108.09-64.93 205.53-164.51 246.89s-214.2 18.5-290.41-57.93-99.01-191.37-57.77-291.23C61.87 65.64 159.04.53 266.82.53m0 347.4c10.5.01 20.9-2.05 30.61-6.07s18.52-9.93 25.95-17.38 13.31-16.29 17.33-26.02a80.4 80.4 0 0 0 6.06-30.7c0-32.43-19.48-61.66-49.35-74.07s-64.26-5.55-87.12 17.38-29.7 57.41-17.33 87.37 41.53 49.49 73.86 49.49z"}),e.jsx("path",{d:"M566.35 200.96c67.71 19.54 147.63 0 147.63 0-23.19 101.55-96.75 165.15-202.81 172.89a266.8 266.8 0 0 1-40.48 65.86 266.2 266.2 0 0 1-57.62 51.43c-21.6 14.24-45.15 25.25-69.92 32.68s-50.48 11.19-76.33 11.18l79.95-254.81C428.95 18.28 471.08.54 665.98.54H799.8c-22.38 98.88-99.54 174.41-233.44 200.42z"})]}),reddit:t=>e.jsx("svg",{...t,viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 22c-5.523 0-10-3.582-10-8s4.477-8 10-8 10 3.582 10 8-4.477 8-10 8zm6.67-8a1.46 1.46 0 0 0-2.47-1 7.12 7.12 0 0 0-3.85-1.23L13.5 8.3l2.64.63a1 1 0 1 0 .12-.57l-2.95-.7a.17.17 0 0 0-.2.13L11.9 11.8a7.16 7.16 0 0 0-3.9 1.23 1.46 1.46 0 1 0-1.61 2.39A2.74 2.74 0 0 0 6.25 16c0 2.21 2.58 4 5.75 4s5.75-1.79 5.75-4a2.74 2.74 0 0 0-.14-.58A1.46 1.46 0 0 0 18.67 14zM9.5 15.5a1 1 0 1 1 1-1 1 1 0 0 1-1 1zm5 0a1 1 0 1 1 1-1 1 1 0 0 1-1 1zm-.28 1.83a3.43 3.43 0 0 1-4.44 0 .23.23 0 0 1 .32-.33 3 3 0 0 0 3.8 0 .23.23 0 0 1 .32.33z"})}),telegram:t=>e.jsx("svg",{...t,viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12.056 0h-.112zM17.9 8.18s-.18.63-.53 1.87l-1.83 7.25c-.13.55-.5.68-.83.68-.52 0-.74-.34-1.15-.67l-3.19-2.42-.03-.02-1.13.78c-.13.09-.24.17-.49.17l.17-2.38 4.32-3.9c.19-.17-.04-.26-.29-.1l-5.35 3.37-2.3-.72c-.5-.16-.51-.5.1-.74l8.99-3.47c.42-.15.78.1.65.74z"})}),justforfans:t=>e.jsx("svg",{...t,viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"})}),other:t=>e.jsxs("svg",{...t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),e.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})};function Yt({platform:t,...s}){const n=et[t]||et.other;return e.jsx(n,{width:"16",height:"16",...s})}const tt=()=>e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M3 10h18"})]});function Zt({user:t,showMessage:s,website:n,onEditProfile:m,onGoToUploads:c,profileVersion:b}){const[p,k]=a.useState(!0),[l,C]=a.useState(null),[S,g]=a.useState(!1),[R,A]=a.useState(!1),[w,E]=a.useState(null),[B,y]=a.useState(!0),f=t.uid,u=zt[n]||"AZNude";a.useEffect(()=>{let r=!1;async function T(){try{const I=await xt(H,f,Ft);r||(C({username:I.username||"",name:I.name||"",photoURL:I.photoURL||Je,dateOfBirth:I.dateOfBirth||"",bio:I.bio||"",gender:I.gender||"",socials:Array.isArray(I.socials)?I.socials.filter(M=>M.platform&&M.url):[]}),E(I.agego||null),A(!!I.agego?.verified),y(!!I.onboardingDismissed));const V=X(H,"uploads"),L=ne(V,re("createdBy"),ce(f),pt(1));ae(L).then(M=>{r||g(M.exists())}).catch(()=>{})}catch(I){try{O.captureException(I,{tags:{area:"realtime-db",op:"profile-view"},extra:{uid:f}})}catch{}s("An error occurred loading your profile.")}finally{r||k(!1)}}return T(),()=>{r=!0}},[f,s,b]),a.useEffect(()=>{const r=X(H,`users/${f}/agego`),T=vt(r,I=>{const V=I.val();V&&(E(V),A(!!V.verified))});return()=>T()},[f]);const j=a.useMemo(()=>l?[{id:"username",label:"Pick a username",done:!!l.username,action:m,actionLabel:"Set username"},{id:"name",label:"Fill in your full name",done:!!l.name,action:m,actionLabel:"Add name"},{id:"bio",label:"Write a short bio",done:!!l.bio,action:m,actionLabel:"Add b
1io"},{id:"social",label:"Add at least 1 social profile",done:l.socials.length>0,action:m,actionLabel:"Add socials"},{id:"upload",label:"Upload at least 1 content",done:S,action:()=>{window.location.href="/upload.html"},actionLabel:"Upload content"},{id:"agego",label:"Verify your age",done:R,action:()=>N(),actionLabel:"Verify now"}]:[],[l,S,R,m]),o=j.filter(r=>r.done).length,x=o===j.length,i=j.length?Math.round(o/j.length*100):0;function N(){h()}async function h(){try{window.AGEGO||await new Promise((r,T)=>{const I=document.createElement("script");I.src="https://verifycdn.agego.com/v1/verify.js",I.defer=!0,I.onload=r,I.onerror=T,document.head.appendChild(I)}),window.AGEGO=window.AGEGO||function(){(AGEGO.e=AGEGO.e||[]).push(arguments)},AGEGO("configure",{siteId:varValues.agegoid,verifyMode:"inline",requireAgeVerification:!0,allowDirectContinue:!1,underageRedirectTo:"#",overlay:{logo:`https://${varValues.cdn}/images/logo/v5/main-logo.svg`,theme:"dark"},events:{onVerifiedBefore(){try{localStorage.setItem("az_age_verified","1")}catch{}d(!0,{stage:"onVerifiedBefore"}),A(!0)},onVerificationFlowEnd(r){try{localStorage.setItem("az_age_verified","1")}catch{}d(!0,{stage:"onVerificationFlowEnd",payload:r||null}),A(!0)},onVerificationFlowFailed(r){d(!1,{stage:"onVerificationFlowFailed",error:String(r||"")})}}});try{const r=document.createEvent("Event");r.initEvent("DOMContentLoaded",!0,!0),document.dispatchEvent(r)}catch{}}catch(r){console.error("[agego] verification failed:",r);try{O.captureException(r,{tags:{area:"agego",op:"loadScript"}})}catch{}s("Could not load age verification. Please try again.")}}async function d(r,T){try{const I=X(H,`users/${f}/agego`),V={verified:!!r,method:"agego",ex_av:r?"1":"2",lastPath:location.pathname,updatedAt:Date.now()};T&&(V.payload=T),await ke(I,V)}catch(I){try{O.captureException(I,{tags:{area:"agego",op:"writeDB"}})}catch{}}}const v=a.useMemo(()=>{try{const r=t.metadata?.creationTime;return r?new Date(r).toLocaleDateString("en-US",{month:"long",year:"numeric"}):""}catch{return""}},[t]);return p?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"skel-card",children:[e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:220,marginBottom:10}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:300,maxWidth:"100%"}})]}),e.jsx("div",{className:"skel-card",children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:16},children:[e.jsx("div",{className:"skeleton-pulse",style:{width:72,height:72,borderRadius:2,flexShrink:0}}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:18,width:180,marginBottom:8}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:140,marginBottom:12}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:"100%",maxWidth:400,marginBottom:6}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:"80%",maxWidth:320}})]})]})}),e.jsxs("div",{className:"skel-card",children:[e.jsx("div",{className:"skeleton-pulse",style:{height:18,width:120,marginBottom:16}}),e.jsxs("div",{style:{display:"flex",gap:24,flexWrap:"wrap"},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:50,width:100}}),e.jsx("div",{className:"skeleton-pulse",style:{height:50,width:100}}),e.jsx("div",{className:"skeleton-pulse",style:{height:50,width:100}})]})]})]}):l?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"card-dark",children:[e.jsxs("h2",{className:"text-lg font-semibold mb-1",children:["Welcome",l.username?`, ${l.username}`:""]}),e.jsxs("p",{className:"text-[#888] text-sm",children:["Manage your ",u," account, uploads, and preferences."]})]}),e.jsx("div",{className:"card-dark",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("img",{src:l.photoURL,alt:"Profile",onError:r=>{r.target.src=Je},className:"w-[72px] h-[72px] rounded-sm object-cover border-2 border-[#333] shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-0.5",children:[e.jsx("h3",{className:"text-[17px] font-semibold mt-0 mb-2",children:l.username||"No username set"}),R&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-semibold text-green-400 bg-green-500/10 border border-green-500/20 rounded px-1.5 py-0.5 mb-2",children:[e.jsx(Ke,{})," Verified"]})]}),l.name&&e.jsx("p",{className:"text-[#aaa] text-sm mb-1.5",children:l.name}),l.bio&&e.jsx("p",{className:"text-[13px] text-[#999] mb-2",children:l.bio}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-[13px] text-[#777]",children:[v&&e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(tt,{})," Member since ",v]}),l.gender&&e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),l.gender.charAt(0).toUpperCase()+l.gender.slice(1)]}),l.dateOfBirth&&e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(tt,{})," Born ",(()=>{try{const r=new Date(l.dateOfBirth);return isNaN(r.getTime())?l.dateOfBirth:r.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}catch{return l.dateOfBirth}})()]})]}),l.socials.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mt-2.5",children:l.socials.map((r,T)=>e.jsx("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"w-8 h-8 flex items-center justify-center rounded border border-[#333] bg-[#1a1a1a] text-[#999] hover:text-primary hover:border-primary/50 transition-colors",title:r.platform,children:e.jsx(Yt,{platform:r.platform})},T))})]}),e.jsxs("button",{onClick:m,className:"btn-ghost text-sm shrink-0 flex items-center gap-1.5",children:[e.jsx(Ht,{})," Edit"]})]})}),!B&&e.jsxs("div",{className:"card-dark",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-[15px] font-semibold",children:x?"Account setup complete":"Complete your account"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[13px] text-[#888]",children:[o,"/",j.length]}),x&&e.jsx("button",{type:"button",onClick:()=>{y(!0),ke(X(H,`users/${f}`),{onboardingDismissed:!0}).catch(()=>{})},className:"text-[#888] hover:text-white bg-transparent border-none cursor-pointer text-lg leading-none p-0",title:"Dismiss",children:"Ã"})]})]}),e.jsx("div",{className:"bg-[#222] rounded-sm h-1.5 overflow-hidden mb-4",children:e.jsx("div",{className:"h-full bg-primary transition-[width] duration-500",style:{width:`${i}%`}})}),e.jsx("div",{className:"space-y-2.5",children:j.map(r=>e.jsxs("div",{className:"flex items-center gap-3",children:[r.done?e.jsx(qt,{}):e.jsx(Vt,{}),e.jsx("span",{className:`flex-1 text-sm ${r.done?"text-[#888] line-through":"text-[#ccc]"}`,children:r.label}),!r.done&&r.action&&e.jsx("button",{type:"button",onClick:r.action,className:"text-[12px] text-primary hover:underline bg-transparent border-none cursor-pointer p-0",children:r.actionLabel})]},r.id))})]}),e.jsxs("div",{className:"card-dark",children:[e.jsx("h3",{className:"text-[15px] font-semibold mb-3",children:"Age Verification"}),R?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-10 h-10 rounded-sm bg-green-500/10 border border-green-500/20 flex items-center justify-center text-green-400",children:e.jsx(Ke,{})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-green-400 font-semibold",children:"Verified"}),e.jsx("p",{className:"text-[12px] text-[#888]",children:w?.updatedAt?`Verified on ${de(w.updatedAt)}`:"Your age has been verified."})]})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-10 h-10 rounded-sm bg-red-500/10 border border-red-500/20 flex items-center justify-center text-red-400",children:e.jsx(Gt,{})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm text-[#ccc] font-semibold",children:"Not verified"}),e.jsx("p",{className:"text-[12px] text-[#888]",children:"Verify your age to confirm you're 18 or older."})]}),e.jsx("button",{type:"button",onClick:N,className:"btn-ghost text-sm shrink-0",children:"Verify n
1ow"})]})]})]}):null}const Xt=["ped","pedo","pedophilia","pedoporn","pedoporno","pedopornography","cp","c.p.","child porn","childporno","child pornography","children porn","kids porn","teen porn","young porn","baby porn","little girl","little boy","little girls","little boys","preteen","preteens","pre teen","pre teens","incest","father daughter","mother son","brother sister","sister brother","dad daughter","mom son","sleeping teen","sleeping child","rape","raped","raping","rapist","rapists","hidden cam","hidden camera","hidden cams","hidden cameras","loli","l.o.l.i","shota","underage","underaged"],Qt=["child","children","childish","childlike","toddler","toddlers","kid","kids","minor","minors","under 18","under18","under age","under-aged","schoolgirl","schoolgirls","school boy","school boys","highschool","high school","middle school","teen","teens","teenager","teenagers","young girl","young girls","young boy","young boys","young teen","young teens","barely legal","barelylegal","lolita","l.o.l.i.t.a","s.h.o.t.a"],Jt=[...Xt,...Qt];function Be(t){if(!t)return!1;const s=t.toLowerCase();for(const n of Jt)if(s.includes(n))return n;return!1}const Z=280,st=1,at=4,Kt=.01;function es({imageFile:t,onCrop:s,onCancel:n}){const m=a.useRef(null),c=a.useRef(null),[b,p]=a.useState(!1),[k,l]=a.useState(1),[C,S]=a.useState({x:0,y:0}),g=a.useRef({dragging:!1,startX:0,startY:0,origX:0,origY:0});a.useEffect(()=>{if(!t)return;const j=new Image;return j.onload=()=>{c.current=j,p(!0),l(1),S({x:0,y:0})},j.src=URL.createObjectURL(t),()=>URL.revokeObjectURL(j.src)},[t]);const R=a.useCallback(()=>{const j=c.current;if(!j)return null;const o=j.naturalWidth/j.naturalHeight;let x,i;o>=1?(i=Z*k,x=i*o):(x=Z*k,i=x/o);const N=(Z-x)/2+C.x,h=(Z-i)/2+C.y;return{drawW:x,drawH:i,x:N,y:h}},[k,C]);a.useEffect(()=>{if(!b)return;const j=m.current?.getContext("2d");if(!j)return;const o=R();o&&(j.clearRect(0,0,Z,Z),j.drawImage(c.current,o.x,o.y,o.drawW,o.drawH))},[b,k,C,R]);const A=a.useCallback((j,o,x)=>{const i=c.current;if(!i)return{x:j,y:o};const N=i.naturalWidth/i.naturalHeight;let h,d;N>=1?(d=Z*x,h=d*N):(h=Z*x,d=h/N);const v=Math.max(0,(h-Z)/2),r=Math.max(0,(d-Z)/2);return{x:Math.max(-v,Math.min(v,j)),y:Math.max(-r,Math.min(r,o))}},[]),w=j=>{j.preventDefault(),g.current={dragging:!0,startX:j.clientX,startY:j.clientY,origX:C.x,origY:C.y},j.currentTarget.setPointerCapture(j.pointerId)},E=j=>{if(!g.current.dragging)return;const o=j.clientX-g.current.startX,x=j.clientY-g.current.startY;S(A(g.current.origX+o,g.current.origY+x,k))},B=()=>{g.current.dragging=!1},y=j=>{j.preventDefault();const o=Math.max(st,Math.min(at,k-j.deltaY*Kt));l(o),S(x=>A(x.x,x.y,o))},f=j=>{const o=parseFloat(j.target.value);l(o),S(x=>A(x.x,x.y,o))},u=()=>{const o=document.createElement("canvas");o.width=512,o.height=512;const x=o.getContext("2d"),i=c.current,N=R();if(!i||!N)return;const h=512/Z;x.drawImage(i,N.x*h,N.y*h,N.drawW*h,N.drawH*h),o.toBlob(d=>{if(!d)return;const v=URL.createObjectURL(d);s(d,v)},"image/jpeg",.92)};return t?e.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/80",onClick:n,children:e.jsxs("div",{className:"bg-[#1a1a1a] border border-[#333] rounded-lg p-5 max-w-[340px] w-full",onClick:j=>j.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-[#eee]",children:"Crop Photo"}),e.jsx("button",{onClick:n,className:"text-[#888] hover:text-white bg-transparent border-none cursor-pointer text-lg leading-none p-0",children:"Ã"})]}),e.jsx("div",{className:"mx-auto rounded-sm overflow-hidden cursor-grab active:cursor-grabbing border-2 border-[#444] select-none touch-none",style:{width:Z,height:Z},onPointerDown:w,onPointerMove:E,onPointerUp:B,onWheel:y,children:e.jsx("canvas",{ref:m,width:Z,height:Z,className:"block"})}),e.jsxs("div",{className:"flex items-center gap-3 mt-4 px-1",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#888",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),e.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]}),e.jsx("input",{type:"range",min:st,max:at,step:.01,value:k,onChange:f,className:"flex-1 accent-primary h-1"}),e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#888",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),e.jsx("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),e.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})]}),e.jsx("p",{className:"text-[11px] text-[#666] text-center mt-2 mb-4",children:"Drag to reposition. Scroll or slide to zoom."}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{type:"button",onClick:n,className:"btn-ghost text-sm flex-1",children:"Cancel"}),e.jsx("button",{type:"button",onClick:u,className:"btn-primary-tw text-sm flex-1",children:"Use Photo"})]})]})}):null}const ts=["username","name","dateOfBirth","bio","gender","photoURL","socials"],oe="https://cdn.aznude.com/images/user-icon.png",Te=200,ss=[{value:"",label:"Prefer not to say"},{value:"male",label:"Male"},{value:"female",label:"Female"},{value:"nonbinary",label:"Non-binary"},{value:"other",label:"Other"}],Ie=[{value:"",label:"Select Platform",prefix:""},{value:"x",label:"X",prefix:"https://x.com/"},{value:"instagram",label:"Instagram",prefix:"https://www.instagram.com/"},{value:"tiktok",label:"TikTok",prefix:"https://www.tiktok.com/@"},{value:"justforfans",label:"JustForFans",prefix:"https://justfor.fans/"},{value:"onlyfans",label:"OnlyFans",prefix:"https://www.onlyfans.com/"},{value:"reddit",label:"Reddit",prefix:"https://www.reddit.com/"},{value:"telegram",label:"Telegram",prefix:"https://t.me/"},{value:"other",label:"Other",prefix:""}],as=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),ns=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"18",rx:"2"}),e.jsx("circle",{cx:"9",cy:"10",r:"2.5"}),e.jsx("path",{d:"M5 17c0-2 1.79-3 4-3s4 1 4 3"}),e.jsx("path",{d:"M15 8h4"}),e.jsx("path",{d:"M15 12h4"})]}
1),rs=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M3 10h18"})]});function nt(){const t=new Date;return t.setFullYear(t.getFullYear()-18),t.toISOString().split("T")[0]}function is(t){if(!t)return"";if(/^\d{4}-\d{2}-\d{2}$/.test(t))return t;const s=t.split("/");return s.length===3?`${s[2]}-${s[0].padStart(2,"0")}-${s[1].padStart(2,"0")}`:t}function ls({uid:t,idToken:s,showMessage:n,onBack:m,onProfileUpdated:c}){const[b,p]=a.useState(!0),[k,l]=a.useState(!1),[C,S]=a.useState(""),[g,R]=a.useState(""),[A,w]=a.useState(""),[E,B]=a.useState(""),[y,f]=a.useState(""),[u,j]=a.useState(""),[o,x]=a.useState([{platform:"",url:""}]),[i,N]=a.useState(oe),[h,d]=a.useState(null),[v,r]=a.useState(""),[T,I]=a.useState(-1),[V,L]=a.useState(!1),[M,$]=a.useState(!1),[W,_]=a.useState(null),D=a.useRef(null),G=a.useRef([]),[Q,ue]=a.useState(null);a.useEffect(()=>{Q!==null&&G.current[Q]&&(G.current[Q].focus(),ue(null))},[Q]),a.useEffect(()=>{let P=!1;async function q(){try{const U=await xt(H,t,ts);P||(S(U?.username||""),R(U?.username||""),w(U?.name||""),B(is(U?.dateOfBirth||"")),f(U?.bio||""),j(U?.gender||""),N(U?.photoURL||oe),Array.isArray(U?.socials)&&U.socials.length>0?x(U.socials.map(ee=>({platform:ee.platform||"",url:ee.url||""}))):x([{platform:"",url:""}]))}catch(U){try{O.captureException(U,{tags:{area:"realtime-db",op:"get-user"},extra:{uid:t}})}catch{}console.error(U),P||l(!0),n("Could not load your profile. Reload the page before saving â saving now would overwrite it.")}finally{P||p(!1)}}return q(),()=>{P=!0}},[t,n]);const Se=()=>{o.length<5&&x([...o,{platform:"",url:""}])},he=P=>{o.length>1&&x(o.filter((q,U)=>U!==P))},me=(P,q,U)=>{const ee=[...o];if(ee[P][q]=U,q==="platform"){const pe=Ie.find(J=>J.value===U);pe&&pe.prefix?(ee[P].url=pe.prefix,ue(P)):ee[P].url=""}x(ee)},Re=P=>{const q=P.target.files[0];if(!q){_(null);return}if(!Ze(q.name)){P.target.value="",_(null),n("Invalid image file. Only png and jpeg allowed.");return}_(q),$(!0)},ye=(P,q)=>{const U=new File([P],W?.name||"profile.jpg",{type:"image/jpeg"});d(U),r(U.name),N(q),$(!1),_(null),D.current&&(D.current.value="")},ie=()=>{$(!1),_(null),D.current&&(D.current.value="")},ft=()=>{N(oe),d(null),r(""),D.current&&(D.current.value="")},gt=async P=>{P.preventDefault();try{O.addBreadcrumb({category:"profile",message:"updateProfile submit",level:"info"})}catch{}if(k)return n("Your profile did not load. Reload the page before saving.");if(h&&!Ze(h.name))return n("Only png and jpeg image files allowed.");if(E&&E>nt())return n("You must be at least 18 years old.");if(L(!0),C!==g&&Be(C))return L(!1),n("Username contains a prohibited word.");if(Be(A))return L(!1),n("Name contains a prohibited word.");if(Be(y))return L(!1),n("Bio contains a prohibited word.");if(C&&C!==g)try{const Y=await window.grecaptcha?.execute("6LeGdvEZAAAAAEW8ZT6hkZWJykDD4bHc9EY9Odob",{action:"submit"}),z=await(await fetch(Ve.checkUsername,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:ve(C),idToken:s,response:Y})})).json();if(z.status==="taken")return L(!1),n("Username is already taken. Please choose another.");if(z.status==="error")return L(!1),n(z.errorMessage||"Error checking username. Please try again.")}catch(Y){try{O.captureException(Y,{tags:{area:"api",op:"checkUsername"}})}catch{}return console.error("[checkUsername] error:",Y),L(!1),n(Y.message||"Error checking username. Please try again.")}if(!C)return L(!1),n("Username cannot be empty.");const ee=[],pe=new Set;for(const Y of o){const se=(Y.platform||"").trim(),z=(Y.url||"").trim(),le=Ie.find(yt=>yt.value===se),jt=le&&le.prefix&&z===le.prefix;if(!(se&&(!z||jt))&&!(!se&&!z)){if(z&&pe.has(z))return L(!1),n("Duplicate social media URL entered.");z&&pe.add(z),ee.push({platform:se,url:z})}}const J={};C!==g&&(J.username=ve(C)),J.name=A?ve(A):"",J.dateOfBirth=E||"",J.bio=y?ve(y).slice(0,Te):"",J.gender=u||"",J.socials=ee;const Ye=X(H,`users/${bt().currentUser.uid}`);if(h){const Y=wt(Nt,`userdata/${t}/${h.name}`),se=kt(Y,h);I(0),se.on("state_changed",z=>{const le=z.bytesTransferred/z.totalBytes*100;I(le)},z=>{try{O.captureException(z,{tags:{area:"storage",op:"uploadTask",kind:"profilePic"}})}catch{}L(!1),I(-1),n("Unknown error occurred.")},async()=>{try{const z=await Ct(Y);J.photoURL=z,await ke(Ye,J),I(-1),L(!1),d(null),r(""),n("Profile Updated."),c&&c()}catch(z){try{O.captureException(z,{tags:{area:"realtime-db",op:"update-user"}})}catch{}L(!1)}})}else{if(i===oe&&(J.photoURL=oe),Object.keys(J).length>0)try{await ke(Ye,J),n("Profile Updated."),c&&c()}catch(Y){try{O.captureException(Y,{tags:{area:"realtime-db",op:"update-user"}})}catch{}}else n("No changes to update.");L(!1)}};if(b){const P=q=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:q,marginBottom:6}}),e.jsx("div",{className:"skeleton-pulse",style:{height:36,width:"100%",maxWidth:420,marginBottom:16}})]});return e.jsxs("div",{className:"skel-card",children:[e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:160,marginBottom:16}}),P(80),P(90),P(60),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:50,marginBottom:6}}),e.jsx("div",{className:"skeleton-pulse",style:{height:80,width:"100%",maxWidth:420,marginBottom:16}}),e.jsx("div",{className:"skeleton-pulse",style:{height:36,width:120,borderRadius:4}})]})}return e.jsxs("div",{className:"card-dark",children:[e.jsx("div",{className:"flex items-center gap-3 mb-4",children:e.jsxs("button",{onClick:m,className:"btn-ghost text-sm",type:"button",children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M19 12H5"}),e.jsx("polyline",{points:"12 19 5 12 12 5"})]}),"Back to Profile"]})}),e.jsx("h2",{className:"section-header",children:"Edit Profile"}),e.jsxs("form",{onSubmit:gt,onKeyDown:P=>P.key==="Enter"&&P.target.tagName!=="TEXTAREA"&&P.preventDefault(),className:"max-w-[460px]",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx("img",{src:i,alt:"Profile",onError:P=>{P.target.src=oe},className:"w-20 h-20 rounded-sm object-cover border-2 border-[#333]"}),i!==oe&&e.jsx("button",{type:"button",onClick:ft,className:"absolute -top-2 -right-2 w-5 h-5 flex items-center justify-center rounded-full bg-[#333] text-[#ccc] hover:bg-red-600 hover:text-white border border-[#555] curs
1or-pointer text-xs leading-none transition-colors",title:"Remove photo",children:"Ã"})]}),e.jsxs("div",{children:[e.jsx("input",{type:"file",ref:D,accept:"image/*",onChange:Re,className:"hidden"}),e.jsx("button",{type:"button",onClick:()=>D.current?.click(),className:"btn-ghost text-sm",children:"Change Photo"}),v&&e.jsx("p",{className:"text-xs text-[#aaa] mt-1.5",children:v})]})]}),M&&W&&e.jsx(es,{imageFile:W,onCrop:ye,onCancel:ie}),e.jsxs("div",{className:"mb-4.5",children:[e.jsx("label",{htmlFor:"edit-username",children:"Username"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"icon-input-left",children:e.jsx(as,{})}),e.jsx("input",{type:"text",id:"edit-username",className:"form-input-dark !pl-9",value:C,onChange:P=>S(P.target.value),placeholder:"Username"})]})]}),e.jsxs("div",{className:"mb-4.5",children:[e.jsx("label",{htmlFor:"edit-name",children:"Full Name"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"icon-input-left",children:e.jsx(ns,{})}),e.jsx("input",{type:"text",id:"edit-name",className:"form-input-dark !pl-9",value:A,onChange:P=>w(P.target.value),placeholder:"Full Name"})]})]}),e.jsxs("div",{className:"mb-4.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{htmlFor:"edit-bio",children:"Bio"}),e.jsxs("span",{className:"text-[11px] text-[#555]",children:[y.length,"/",Te]})]}),e.jsx("textarea",{id:"edit-bio",className:"form-input-dark resize-none",rows:"3",maxLength:Te,value:y,onChange:P=>f(P.target.value),placeholder:"Tell us a bit about yourself"})]}),e.jsxs("div",{className:"mb-4.5",children:[e.jsx("label",{htmlFor:"edit-dob",children:"Date of Birth"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"icon-input-left",children:e.jsx(rs,{})}),e.jsx("input",{type:"date",id:"edit-dob",className:"form-input-dark !pl-9",value:E,onChange:P=>B(P.target.value),max:nt()})]})]}),e.jsxs("div",{className:"mb-4.5",children:[e.jsx("label",{htmlFor:"edit-gender",children:"Gender"}),e.jsx("select",{id:"edit-gender",className:"form-input-dark",value:u,onChange:P=>j(P.target.value),children:ss.map(P=>e.jsx("option",{value:P.value,children:P.label},P.value))})]}),e.jsxs("div",{className:"mb-4.5",children:[e.jsx("label",{className:"mb-2",children:"Social Media Profiles"}),e.jsx("div",{className:"space-y-2",children:o.map((P,q)=>e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("select",{className:"form-input-dark !w-[145px] shrink-0 text-[13px] appearance-none",value:P.platform,onChange:U=>me(q,"platform",U.target.value),children:Ie.map(U=>e.jsx("option",{value:U.value,disabled:U.value==="",children:U.label},U.value))}),e.jsx("input",{type:"text",className:"form-input-dark flex-1 min-w-0 text-[13px]",placeholder:"Enter profile URL",value:P.url,onChange:U=>me(q,"url",U.target.value),ref:U=>G.current[q]=U}),e.jsx("button",{type:"button",className:"shrink-0 w-8 h-8 flex items-center justify-center rounded border border-[#333] text-[#888] hover:text-red-400 hover:border-red-500/50 transition-colors bg-transparent cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",disabled:o.length===1,onClick:()=>he(q),children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},q))}),o.length<5&&e.jsx("button",{type:"button",className:"btn-ghost text-[12px] mt-2 py-1 px-3",onClick:Se,children:"+ Add Another"})]}),T>=0&&e.jsx("div",{className:"mb-4.5 bg-[#222] rounded-sm h-1.5 overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary transition-[width] duration-300",style:{width:`${T}%`}})}),e.jsx("button",{type:"submit",className:"btn-primary-tw",disabled:V,children:V?"Saving...":"Save Changes"})]})]})}const Oe=10,rt=1e3;function os({uid:t,showMessage:s}){const[n,m]=a.useState(!0),[c,b]=a.useState([]),[p,k]=a.useState(1),[l,C]=a.useState(""),[S,g]=a.useState(!1),[R,A]=a.useState(rt),w=a.useRef(null);a.useEffect(()=>{let x=!1;return(async()=>{m(!0);try{const N=ne(X(H,"uploads"),re("createdBy"),ce(t),Ce(R)),d=(await ae(N)).val();if(!d){b([]),g(!1),m(!1);return}const v=Object.entries(d).sort((T,I)=>(I[1].createdOn||0)-(T[1].createdOn||0));g(v.length>=R),b(v.map(([T,I])=>Qe(T,I))),m(!1);const r=await Dt(v);if(x||!r.size)return;b(v.map(([T,I])=>Qe(T,I,r)))}catch(N){try{O.captureException(N,{tags:{area:"user-uploads",op:"fetch-all"},extra:{uid:t}})}catch{}s("An error occurred!")}finally{m(!1)}})(),()=>{x=!0}},[t,s,R]);const E=a.useCallback(()=>{A(x=>x+rt)},[]);a.useEffect(()=>()=>{clearTimeout(w.current)},[]);const B=a.useMemo(()=>
1{if(!l)return c;const x=l.toLowerCase();return c.filter(i=>[i.title,i.id].filter(Boolean).join(" ").toLowerCase().includes(x))},[c,l]),y=Math.max(1,Math.ceil(B.length/Oe)),f=B.slice((p-1)*Oe,p*Oe),u=a.useCallback(x=>{const i=x.target.value;clearTimeout(w.current),w.current=setTimeout(()=>{C(i),k(1)},300)},[]),j=a.useCallback(x=>{k(x),window.scrollTo({top:0,behavior:"smooth"})},[]);a.useEffect(()=>{!n&&f.length>0&&typeof window.setupVideoPreviews=="function"&&window.setupVideoPreviews(!0,"https://cdn2.aznude.com/sparkthumbs/")},[n,f]);const o=e.jsxs("div",{className:"skel-card",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10,flexWrap:"wrap"},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:16,width:"45%",maxWidth:280}}),e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:70,borderRadius:3}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:80,marginLeft:"auto"}})]}),e.jsxs("div",{style:{display:"flex",gap:16,marginBottom:10},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:60}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:50}})]}),e.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[e.jsx("div",{className:"skeleton-pulse",style:{width:"calc(20% - 7px)",aspectRatio:"16/9",borderRadius:4,minWidth:100}}),e.jsx("div",{className:"skeleton-pulse",style:{width:"calc(20% - 7px)",aspectRatio:"16/9",borderRadius:4,minWidth:100}}),e.jsx("div",{className:"skeleton-pulse",style:{width:"calc(20% - 7px)",aspectRatio:"16/9",borderRadius:4,minWidth:100}})]})]});return n&&c.length===0?e.jsxs("div",{children:[e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:16},children:e.jsx("div",{className:"skeleton-pulse",style:{height:36,width:300,maxWidth:"100%"}})}),o,o,o]}):e.jsxs("div",{children:[(c.length>0||l)&&e.jsx("div",{className:"flex justify-end mb-3",children:e.jsxs("div",{className:"relative w-full max-w-[300px]",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:"16",height:"16",className:"icon-input-left",children:e.jsx("path",{d:"m19.25 19.25-5.5-5.5m-10.75-4.5c0-3.45178 2.79822-6.25 6.25-6.25 3.4518 0 6.25 2.79822 6.25 6.25 0 3.4518-2.7982 6.25-6.25 6.25-3.45178 0-6.25-2.7982-6.25-6.25z",stroke:"#666",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})}),e.jsx("input",{type:"text",className:"form-input-dark !pl-9",placeholder:"Search uploads...",onChange:u})]})}),S&&e.jsxs("div",{className:"flex items-center gap-2 mb-3 flex-wrap",children:[e.jsxs("span",{className:"text-[13px] text-[#888]",children:["Showing your ",c.length.toLocaleString()," most recent uploads."]}),e.jsx("button",{type:"button",onClick:E,disabled:n,className:"text-[13px] text-[#ccc] underline underline-offset-2 hover:text-white transition-colors bg-transparent border-none cursor-pointer p-0 disabled:cursor-default disabled:text-[#666] disabled:no-underline",children:n?"Loadingâ¦":"Show older"})]}),e.jsx(K,{currentPage:p,totalPages:y,onPageChange:j}),n?e.jsxs(e.Fragment,{children:[o,o,o]}):f.length===0?e.jsx("div",{className:"card-dark",children:e.jsx("p",{className:"text-[#888]",children:c.length===0&&!l?"No content uploaded yet.":"No results found."})}):f.map(x=>e.jsx(Wt,{item:x},x.id)),e.jsx(K,{currentPage:p,totalPages:y,onPageChange:j})]})}const cs=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),ds=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),us=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"}),e.jsx("path",{d:"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"}),e.jsx("path",{d:"m1 1 22 22"}),e.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"})]});function Me({isOpen:t,title:s,description:n,confirmLabel:m,onConfirm:c,onClose:b}){const[p,k]=a.useState(""),[l,C]=a.useState(""),[S,g]=a.useState(!1),[R,A]=a.useState(!1),[w,E]=a.useState(null),[B,y]=a.useState(!1),f=a.useRef(null);if(a.useEffect(()=>{t&&(k(""),C(""),g(!1),A(!1),E(null),y(!1),setTimeout(()=>f.current?.focus(),100))},[t]),!t)return null;const u=async o=>{if(!p){C("Please enter your password.");return}g(!0),C("");try{const x=await c(p,C,o);x?.mfaRequired&&x.resolver&&(E(x.resolver),y(!0),g(!1))}catch{}finally{g(!1)}},j=async(o,x)=>
1{if(w)try{const i=St.assertionForSignIn(w.hints[0].uid,o);await w.resolveSignIn(i),y(!1),E(null),g(!0);try{await c(p,C,{alreadyReauthed:!0})}catch{}finally{g(!1)}}catch{x("Invalid or expired code. Please try again.")}};return e.jsxs(e.Fragment,{children:[B&&e.jsx(_t,{isOpen:B,onConfirm:j,onClose:()=>{y(!1),E(null)}}),e.jsx("div",{className:"modal-overlay",style:B?{display:"none"}:void 0,children:e.jsxs("div",{className:"modal-box",children:[e.jsxs("div",{className:"modal-box-header",children:[e.jsx("h3",{children:s}),e.jsx("button",{className:"bg-transparent border-none text-white opacity-80 cursor-pointer text-2xl leading-none p-0 hover:opacity-100",onClick:b,children:"Ã"})]}),e.jsxs("div",{className:"modal-box-body",children:[l&&e.jsx("div",{className:"px-3 py-2 mb-3.5 bg-red-500/10 border border-red-500/30 rounded text-red-500 text-[13px]",children:l}),n&&e.jsx("p",{className:"mb-3.5",children:n}),e.jsxs("div",{children:[e.jsx("label",{children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"icon-input-left",children:e.jsx(cs,{})}),e.jsx("input",{ref:f,type:R?"text":"password",className:"form-input-dark !pl-9 pr-10",value:p,onChange:o=>k(o.target.value),onKeyDown:o=>{o.key==="Enter"&&u()},placeholder:"Enter your password"}),e.jsx("button",{type:"button",className:"icon-input-right",onClick:()=>A(o=>!o),children:R?e.jsx(us,{}):e.jsx(ds,{})})]})]})]}),e.jsxs("div",{className:"modal-box-footer",children:[e.jsx("button",{className:"btn-ghost",onClick:b,disabled:S,children:"Cancel"}),e.jsx("button",{className:"btn-danger-tw",onClick:u,disabled:S,children:S?"Processing...":m||"Confirm"})]})]})})]})}const Ue=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),it=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]}),hs=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),ms=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#666",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"}),e.jsx("path",{d:"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"}),e.jsx("path",{d:"m1 1 22 22"}),e.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"})]});function ge({type:t="text",icon:s,value:n,onChange:m,placeholder:c,id:b,name:p,autoComplete:k}){const[l,C]=a.useState(!1),S=t==="password",g=S&&l?"text":t;return e.jsxs("div",{className:"relative mt-2",children:[e.jsx("div",{className:"icon-input-left",children:s}),e.jsx("input",{id:b,name:p,type:g,className:`form-input-dark !pl-9 ${S?"pr-10":""}`,value:n,onChange:m,placeholder:c,autoComplete:k}),S&&e.jsx("button",{type:"button",className:"icon-input-right",onClick:()=>C(R=>!R),children:l?e.jsx(ms,{}):e.jsx(hs,{})})]})}function ps({uid:t,idToken:s,showMessage:n,twoFactorLabel:m,website:c}){const[b,p]=a.useState(!0),[k,l]=a.useState(!1),[C,S]=a.useState(!0),[g,R]=a.useState(""),[A,w]=a.useState(""),[E,B]=a.useState(""),[y,f]=a.useState(""),[u,j]=a.useState(""),[o,x]=a.useState(!1),[i,N]=a.useState(!1),[h,d]=a.useState(!1);a.useEffect(()=>{let L=!1;async function M(){try{const $=X(H,"uploads"),W=ne($,re("createdBy"),ce(t),pt(1)),_=await ae(W);L||l(_.exists());const D=F.currentUser;if(D){const G=D.providerData.map(Q=>Q.providerId);L||S(G.includes("password"))}}catch($){try{O.captureException($,{tags:{area:"realtime-db",op:"get-settings"},extra:{uid:t}})}catch{}n("An error occurred.")}finally{L||p(!1)}}return M(),()=>{L=!0}},[t,n]);const v=async L=>{L.preventDefault();try{O.addBreadcrumb({category:"settings",message:"change_password_submit",level:"info"})}catch{}let M="";if(g===A&&(M+="Please choose a password different than your current one.<br>"),Ut(A)||(M+="Password must be at least 8 characters and meet 3 of 5 strength criteria.<br>"),A!==E&&(M+="New password and confirm new password fields do not match.<br>"),M)return n(M);const $=F.currentUser,W=Le.credential($.email,g);try{await Ae($,W),await Rt($,A),n("Your password has been successfully changed."),R(""),w(""),B("")}catch(_){try{O.captureException(_,{tags:{area:"auth",op:"change-password"}})}catch{}_.code==="auth/wrong-password"||_.code==="auth/invalid-credential"?n("The current password you entered is invali
1d."):n("An error occurred.")}},r=L=>{L.preventDefault();const{email:M}=F.currentUser;let $="";if((!y||!u)&&($+="Please fill up the fields before submitting.<br>"),M===y&&($+="Please choose an email different than your current one.<br>"),y!==u&&($+="New email and confirm new email fields do not match.<br>"),$)return n($);d(!0)},T=async(L,M,$)=>{if(!$?.alreadyReauthed)try{const{email:W}=F.currentUser;await Lt(F,W,L)}catch(W){if(W.code==="auth/multi-factor-auth-required")return{mfaRequired:!0,resolver:Ee(F,W)};try{O.captureException(W,{tags:{area:"auth",op:"change-email-reauth"}})}catch{}W.code==="auth/wrong-password"||W.code==="auth/invalid-credential"?M("Wrong password."):M(W.message);return}try{await At(F.currentUser,y),await Et(F.currentUser),localStorage.removeItem("azn_id"),await we(F)}catch(W){try{O.captureException(W,{tags:{area:"auth",op:"change-email"}})}catch{}W.code==="auth/email-already-in-use"?(d(!1),n("Email already in use.")):M(W.message)}},I=async(L,M,$)=>{const W=F.currentUser;if(!$?.alreadyReauthed){const _=Le.credential(W.email,L);try{await Ae(W,_)}catch(D){if(D.code==="auth/multi-factor-auth-required")return{mfaRequired:!0,resolver:Ee(F,D)};try{O.captureException(D,{tags:{area:"auth",op:"delete-account-reauth"}})}catch{}D.code==="auth/wrong-password"||D.code==="auth/invalid-credential"?M("Invalid password."):M(D.message||"An error occurred.");return}}try{const _=await W.getIdToken(!0),G=await(await fetch(Ve.deleteUser,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:_,website:c})})).json();G.status==="ok"?(M("Account deleted successfully."),setTimeout(async()=>{localStorage.removeItem("azn_id"),await we(F),window.location.href="/signin.html?accountDeleted=true"},1500)):M(G.message||G.errorMessage||"An error occurred.")}catch(_){try{O.captureException(_,{tags:{area:"auth",op:"delete-account"}})}catch{}M(_.message||"An error occurred.")}},V=async(L,M,$)=>{const W=F.currentUser;if(!$?.alreadyReauthed){const _=Le.credential(W.email,L);try{await Ae(W,_)}catch(D){if(D.code==="auth/multi-factor-auth-required")return{mfaRequired:!0,resolver:Ee(F,D)};try{O.captureException(D,{tags:{area:"auth",op:"disable-account-reauth"}})}catch{}D.code==="auth/wrong-password"||D.code==="auth/invalid-credential"?M("Invalid password."):M(D.message||"An error occurred.");return}}try{const _=await W.getIdToken(!0),G=await(await fetch(Ve.disableUser,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:_,website:c})})).json();G.status==="ok"?(M("Account disabled successfully."),setTimeout(async()=>{localStorage.removeItem("azn_id"),await we(F),window.location.href="/signin.html?accountDisabled=true"},1500)):M(G.message||G.errorMessage||"An error occurred.")}catch(_){try{O.captureException(_,{tags:{area:"auth",op:"disable-account"}})}catch{}M(_.message||"An error occurred.")}};if(b){const L=M=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:M,marginBottom:6}}),e.jsx("div",{className:"skeleton-pulse",style:{height:36,width:"100%",maxWidth:420,marginBottom:16}})]});return e.jsxs("div",{children:[e.jsxs("div",{className:"skel-card",style:{marginBottom:20},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:160,marginBottom:16}}),L(130),L(120),L(160),e.jsx("div",{className:"skeleton-pulse",style:{height:36,width:140,borderRadius:4}})]}),e.jsxs("div",{className:"skel-card",style:{marginBottom:20},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:130,marginBottom:16}}),L(90),L(140),e.jsx("div",{className:"skeleton-pulse",style:{height:36,width:120,borderRadius:4}})]}),e.jsxs("div",{className:"skel-card",children:[e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:220,marginBottom:12}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:"100%",maxWidth:500,marginBottom:6}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:"80%",maxWidth:400,marginBottom:16}}),e.jsx("div",{className:"skeleton-pulse",style:{height:36,width:220,borderRadius:4}})]})]})}return C?e.jsxs("div",{children:[e.jsxs("div",{className:"card-dark mb-5",children:[e.jsx("h2",{className:"section-header",children:"Change Password"}),e.jsxs("form",{onSubmit:v,className:"max-w-[420px]",children:[e.jsx("input",{type:"text",name:"username",autoComplete:"username",value:F.currentUser?.email||"",readOnly:!0,"aria-hidden":"true",tabIndex:-1,style:{display:"none"}}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"current-password",children:"Current Password"}),e.jsx(ge,{id:"current-password",name:"current-password",autoComplete:"current-password",type:"password",icon:e.jsx(Ue,{}),value:g,onChange:L=>R(L.target.value),placeholder:"Current password"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"new-password",children:"New Password"}),e.jsx(ge,{id:"new-password",name:"new-password",autoComplete:"new-password",type:"password",icon:e.jsx(Ue,{}),value:A,onChange:L=>w(L.target.value),placeholder:"Choose a new password"}),e.jsx($t,{password:A})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"confirm-new-password",children:"Confirm New Password"}),e.jsx(ge,{id:"confirm-new-password",name:"confirm-new-password",autoComplete:"new-password",type:"password",icon:e.jsx(Ue,{}),value:E,onChange:L=>B(L.target.value),placeholder:"Confirm new password"})]}),e.jsx("button",{type:"submit",className:"btn-primary-tw",children:"Change Password"})]})]}),e.jsxs("div",{className:"card-dark mb-5",children:[e.jsx("h2",{className:"section-header",children:"Change Email"}),e.jsxs("form",{onSubmit:r,className:"max-w-[420px]",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"new-email",children:"New Email"}),e.jsx(ge,{id:"new-email",name:"new-email",autoComplete:"email",type:"email",icon:e.jsx(it,{}),value:y,onChange:L=>
1f(L.target.value),placeholder:"New email"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"confirm-new-email",children:"Confirm New Email"}),e.jsx(ge,{id:"confirm-new-email",name:"confirm-new-email",autoComplete:"email",type:"email",icon:e.jsx(it,{}),value:u,onChange:L=>j(L.target.value),placeholder:"Confirm new email"})]}),e.jsx("button",{type:"submit",className:"btn-primary-tw",children:"Change Email"})]})]}),m&&e.jsxs("div",{className:"card-dark mb-5",children:[e.jsx("h2",{className:"section-header",children:"Two-Factor Authentication"}),e.jsx("p",{className:"mb-4 text-sm",children:"Adds an extra layer of security by requiring more than just a password to sign in."}),e.jsx("a",{href:"/two-factor-authentication.html",target:"_blank",className:"btn-primary-tw",children:m})]}),e.jsxs("div",{className:"card-dark border-red-500/20",children:[e.jsx("h2",{className:"text-base font-semibold text-red-500 mb-4",children:"Danger Zone"}),e.jsxs("div",{className:"flex justify-between items-center flex-wrap gap-3 pb-4 mb-4 border-b border-[#333]",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-white text-sm mb-0.5",children:"Disable Account"}),e.jsx("p",{className:"text-xs mb-0",children:"Temporarily deactivate. You can reactivate anytime."})]}),e.jsx("button",{className:"btn-primary-tw text-[13px]",onClick:()=>N(!0),children:"Disable Account"})]}),e.jsxs("div",{className:"flex justify-between items-center flex-wrap gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-white text-sm mb-0.5",children:"Delete Account"}),e.jsx("p",{className:"text-xs mb-0",children:k?"You have uploads. Contact support to delete.":"Permanent and irreversible."})]}),e.jsx("button",{className:"btn-danger-tw text-[13px]",disabled:k,onClick:()=>x(!0),children:"Delete Account"})]})]}),e.jsx(Me,{isOpen:h,title:"Confirm Email Change",description:"Enter your current password to confirm.",confirmLabel:"Change Email",onConfirm:T,onClose:()=>d(!1)}),e.jsx(Me,{isOpen:o,title:"Delete Account",description:"This action is permanent. Enter your password to confirm.",confirmLabel:"Delete Account",onConfirm:I,onClose:()=>x(!1)}),e.jsx(Me,{isOpen:i,title:"Disable Account",description:"Enter your password to disable.",confirmLabel:"Disable Account",onConfirm:V,onClose:()=>N(!1)})]}):e.jsxs("div",{className:"card-dark px-5 py-10",children:[e.jsx("p",{className:"mb-4",children:"You need to set a password to access settings."}),e.jsx("a",{href:"/forgetpassword.html",className:"btn-primary-tw",children:"Set Password"})]})}const xe=10;function xs({uid:t,isModerator:s,showMessage:n}){const[m,c]=a.useState(!0),[b,p]=a.useState([]),[k,l]=a.useState([]),[C,S]=a.useState(1),[g,R]=a.useState(1);a.useEffect(()=>{let u=!1;async function j(){try{let o;if(t===Ge){const h=X(H,"uploads"),d=ne(h,re("assignedModeratorId"),ce(t));o=await ae(d)}else{const h=X(H,"uploads"),d=ne(h,re("createdBy"),ce(t),Ce(1e3));o=await ae(d)}const x=[],i=[];o.forEach(h=>{const d=h.val();if(d.status!=="returned"&&d.status!=="declined")return;const{celebName:v,type:r,movieName:T,seriesName:I,storyName:V,compilationTitle:L,createdBy:M,decline_reason:$,moderationContent:W}=d,_=W?.moderator_chat||null,D=W?.status_message||null,G=_?Object.values(_).pop():null,Q=ie=>ie&&ie.includes("az-undetermined"),ue=ie=>(Q(ie)?"":ie)||"",Se=r==="series"?"Series":r==="story"?"Story":"Movie";let he=ue(T)||ue(I)||ue(L);!he&&(Q(T)||Q(I)||Q(L))&&(he="Unknown "+Se);let me;r==="story"?me=Q(V)?"Unknown Story":V||"":me=Q(v)?"Unknown Celebrity":(v||"").replace(/\|/g,", ");const Re=me+(he?" in "+he:""),ye={id:h.key,title:Re,status:d.status,createdBy:M,declineReason:$?.replace(/\\/g,"")||void 0,statusMessage:D,lastChatObj:G};d.status==="returned"?x.push(ye):i.push(ye)}),x.reverse(),i.reverse();const N=(h,d)=>{const v=h.lastChatObj?h.lastChatObj.senderId!==h.createdBy:!0,r=d.lastChatObj?d.lastChatObj.senderId!==d.createdBy:!0;return t===Ge?v-r:!v-!r};x.sort(N),u||(p(x),l(i))}catch(o){try{O.captureException(o,{tags:{area:"realtime-db",op:"get-content-moderation"},extra:{uid:t}})}catch{}n("An error occurred.")}finally{u||c(!1)}}return j(),()=>{u=!0}},[t,s,n]);const A=Math.ceil(b.length/xe),w=Math.ceil(k.length/xe),E=a.useMemo(()=>b.slice((C-1)*xe,C*xe),[b,C]),B=a.useMemo(()=>k.slice((g-1)*xe,g*xe),[k,g]),y=a.useCallback(u=>{S(u),window.scrollTo({top:0,behavior:"smooth"})},[]),f=a.useCallback(u=>{R(u),window.scrollTo({top:0,behavior:"smooth"})},[]);return m?e.jsxs("div",{children:[e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:180,marginBottom:12}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:"100%",maxWidth:480,marginBottom:20}}),[0,1,2].map(u=>e.jsxs("div",{className:"skel-card",style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap",marginBottom:12},children:[e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:"60%",maxWidth:280,marginBottom:6}}),e.jsx("div",{className:"skeleton-pulse",style:{height:12,width:"40%",maxWidth:180}})]}),e.jsx("div",{className:"skeleton-pulse",style:{height:30,width:140,borderRadius:4}})]},u))]}):b.length===0&&k.length===0?e.jsx("div",{className:"card-dark",children:e.jsx("p",{className:"text-[#888]",children:"No content to be moderated."})}):e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx("h2",{className:"section-header",children:"Returned Uploads"}),b.length>0?e.jsx("p",{className:"text-sm mb-3.5",children:s?"Pending cases from the moderation platform. Check uploader responses.":"The moderator needs more info before processing these uploads."}):e.jsx("p",{className:"text-sm mb-3.5 text-[#888]",children:"No uploads require further information."}),E.map(u=>{const o=typeof u.lastChatObj=="object"&&u.lastChatObj!==null?u.lastChatObj.senderId!==u.createdBy:!0,x=u.createdBy===t?o:!o,i=u.createdBy===t?o?"Reply to Moderator":"Awaiting Reply":o?"Awaiting User Reply":"Reply to User";return e.jsxs("div",{className:"card-dark flex justify-between items-center flex-wrap gap-2.5 mb-2.5","upload-id":u.id,children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("a",{href:`/manage-content.html?id=${u.id}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium",children:u.title}),u.lastChatObj?e.jsxs("p",{className:"text-xs text-[#888] mt-1 mb-0",children:[u.lastChatObj.chat,e.jsx("span",{className:"ml-2 text-[#666]",children:de(u.lastChatObj.date)})]}):u.statusMessage?e.jsx("p",{className:"text-xs text-[#888] mt-1 mb-0",children:u.statusMessage}):null]}),e.jsx("a",{href:`/manage-content.html?id=${u.id}`,target:"_blank",rel:"noopener noreferrer",className:`${x?"btn-primary-tw":"btn-ghost"}
1 text-xs px-3.5 py-1.5 shrink-0`,children:i})]},u.id)}),e.jsx(K,{currentPage:C,totalPages:A,onPageChange:y})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"section-header",children:"Declined Uploads"}),k.length>0?e.jsx("p",{className:"text-sm mb-3.5",children:s?"All uploads you have declined appear here.":"The moderator has rejected the below uploads."}):e.jsx("p",{className:"text-[#888]",children:"No rejected uploads."}),B.map(u=>e.jsxs("div",{className:"card-dark mb-2.5","upload-id":u.id,children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:"badge badge-declined",children:"Declined"}),e.jsx("span",{className:"text-sm font-medium",children:u.title})]}),u.declineReason&&e.jsxs("p",{className:"text-xs text-[#888] mt-1.5 mb-0",children:["Reason: ",u.declineReason]})]},u.id)),e.jsx(K,{currentPage:g,totalPages:w,onPageChange:f})]})]})}const lt=()=>e.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[e.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),e.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),e.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),e.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),ot=()=>e.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})});function fs({showMessage:t}){const[s,n]=a.useState(!0),[m,c]=a.useState([]),[b,p]=a.useState([]),[k,l]=a.useState(null),C=a.useCallback(()=>{const w=F.currentUser;if(!w)return;const E=w.providerData.map(B=>B.providerId);c(E),p(w.providerData.filter(B=>B.providerId!=="password").map(B=>({providerId:B.providerId,providerTitle:B.providerId==="google.com"?"Google":B.providerId==="twitter.com"?"X (Twitter)":B.providerId,linkDate:new Date(w.metadata.creationTime).toDateString()})))},[]);a.useEffect(()=>{try{C()}catch(w){try{O.captureException(w,{tags:{area:"ui",op:"renderSocialsSignin"}})}catch{}t("An error occurred!")}finally{n(!1)}},[C,t]);const S=async w=>{l(w);try{const E=w==="google"?new Pt:new Bt;await Tt(F.currentUser,E),C()}catch(E){try{O.captureException(E,{tags:{area:"auth",op:"linkWithPopup"}})}catch{}t(Xe[E.code]||"An unknown error occurred.")}finally{l(null)}},g=async w=>{try{F.currentUser.providerData.length>1?(await It(F.currentUser,w),C()):t("You must have at least one linked provider.")}catch(E){try{O.captureException(E,{tags:{area:"auth",op:"unlink"},extra:{providerId:w}})}catch{}t(Xe[E.code]||"An unknown error occurred.")}};if(s)return e.jsxs("div",{children:[e.jsxs("div",{className:"skel-card",style:{marginBottom:20},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:180,marginBottom:16}}),e.jsxs("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:36,width:120,borderRadius:4}}),e.jsx("div",{className:"skeleton-pulse",style:{height:36,width:130,borderRadius:4}})]})]}),e.jsxs("div",{className:"skel-card",children:[e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:150,marginBottom:16}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 0",borderBottom:"1px solid #333",gap:12,flexWrap:"wrap"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("div",{className:"skeleton-pulse",style:{width:32,height:32,borderRadius:"50%"}}),e.jsxs("div",{children:[e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:80,marginBottom:4}}),e.jsx("div",{className:"skeleton-pulse",style:{height:12,width:120}})]})]}),e.jsx("div",{className:"skeleton-pulse",style:{height:30,width:70,borderRadius:4}})]})]})]});const R=m.includes("google.com"),A=m.includes("twitter.com");return e.jsxs("div",{children:[!(R&&A)&&e.jsxs("div",{className:"card-dark mb-5",children:[e.jsx("h2",{className:"section-header",children:"Link a Social Account"}),e.jsxs("div",{className:"flex gap-3",children:[!R&&e.jsxs("button",{onClick:()=>S("google"),disabled:!!k,className:`btn-ghost inline-flex items-center gap-2 ${k?"opacity-40":""}`,children:[e.jsx(lt,{}),k==="google"?"Linking...":"Google"]}),!A&&e.jsxs("button",{onClick:()=>S("twitter"),disabled:!!k,className:`btn-ghost inline-flex items-center gap-2 ${k?"opacity-40":""}`,children:[e.jsx(ot,{}),k==="twitter"?"Linking...":"X (Twitter)"]})]})]}),e.jsxs("div",{className:"card-dark",children:[e.jsx("h2",{className:"section-header",children:"Linked A
1ccounts"}),b.length===0?e.jsx("p",{className:"text-[#888]",children:"No social accounts linked."}):b.map(w=>e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#333]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-white/[0.06] flex items-center justify-center",children:w.providerId==="google.com"?e.jsx(lt,{}):e.jsx(ot,{})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-sm my-0",children:w.providerTitle}),e.jsxs("p",{className:"text-xs text-[#888] mb-0",children:["Linked ",w.linkDate]})]})]}),e.jsx("button",{onClick:()=>g(w.providerId),className:"btn-ghost text-xs px-3.5 py-1.5",children:"Unlink"})]},w.providerId)),e.jsxs("p",{className:"text-xs text-[#888] mt-4 mb-0",children:["Your private information from Google and X, other than your email, is ",e.jsx("strong",{children:"not"})," saved."]})]})]})}const We=10,gs={minor:"Minor","child-abuse":"Child Abuse",copyright:"Copyright",consent:"Consent","ai-deepfake":"AI / Deepfake",stolen:"Stolen Content",spam:"Spam",duplicate:"Duplicate",name:"Wrong Name",picture:"Wrong Picture",content:"Content Issue",country:"Wrong Country",birthplace:"Wrong Birthplace",date:"Wrong Date",dateofbirth:"Wrong Date of Birth",photo:"Wrong Photo",other:"Other"},js={minor:"safety","child-abuse":"safety",copyright:"legal",consent:"legal","ai-deepfake":"legal",stolen:"legal",spam:"quality",duplicate:"quality",name:"accuracy",picture:"accuracy",content:"accuracy",country:"accuracy",birthplace:"accuracy",date:"accuracy",dateofbirth:"accuracy",photo:"accuracy",other:"other"},ct={safety:"#f87171",legal:"#60a5fa",quality:"#c084fc",accuracy:"#22d3ee",other:"#94a3b8"},dt={pending:{label:"Pending",cls:"badge-moderation"},reviewing:{label:"Reviewing",cls:"badge-processing"},in_progress:{label:"In Progress",cls:"badge-processing"},resolved:{label:"Resolved",cls:"badge-published"},fixed:{label:"Fixed",cls:"badge-published"},declined:{label:"Declined",cls:"badge-declined"},rejected:{label:"Rejected",cls:"badge-declined"},closed:{label:"Closed",cls:"badge-slate"}},ys={az:"AZNude",azmen:"AZMen",azfans:"AZFans"};function vs(t){return t?t.includes("men.aznude.com")?"azmen":t.includes("azfans.com")?"azfans":t.includes("aznude.com")?"az":null:null}function bs(t){return t?t<1e12?t*1e3:t:0}function ws(t,s){const n=s.entryData||{};if(s.type==="edit_request")return null;const m=n.name||n.title||n.videoTitle||null,c=n.link||n.url||n.videoUrl||null,b=s.problemType||n.reportType||"other",p=s.details||s.correction||null,k=n.website||s.website||vs(c),l=n.pageType||s.pageType||null,C=bs(s.createdOn||s.requestedOn),S={};s.name&&b==="name"&&(S.correctedName=s.name),s.country&&(S.correctedCountry=s.country),s.photoUrl&&(S.photoUrl=s.photoUrl),s.dateofbirth&&(S.correctedDate=s.dateofbirth),s.corrections&&(s.corrections.correctedCountry&&(S.correctedCountry=s.corrections.correctedCountry),s.corrections.photoUrl&&(S.photoUrl=s.corrections.photoUrl),s.corrections.correctedDate&&(S.correctedDate=s.corrections.correctedDate));const g=n.thumb||null;return{id:t,title:m,url:c,problemType:b,details:p,website:k,pageType:l,createdOn:C,corrections:S,thumb:g,duplicate:s.duplicate||!1,status:s.status||null,editRequest:s.editRequest||null}}function Ns({status:t}){const s=(t||"pending").toLowerCase(),n=dt[s]||dt.pending;return e.jsx("span",{className:`badge ${n.cls}`,children:n.label})}function ks({website:t}){if(!t)return null;const s=ys[t]||t;return e.jsx("span",{className:"text-[11px] text-[#666] bg-[#1a1a1a] px-1.5 py-0.5 rounded",children:s})}function Cs({problemType:t,corrections:s}){return!s||Object.keys(s).length===0?null:e.jsxs("div",{className:"mt-2 pt-2 border-t border-[#222]",children:[e.jsx("p",{className:"text-[11px] text-[#666] uppercase tracking-wide mb-1",children:"Correction"}),s.correctedName&&e.jsxs("p",{className:"text-[13px] text-[#ccc]",children:["Name: ",s.correctedName]}),s.correctedCountry&&e.jsxs("p",{className:"text-[13px] text-[#ccc]",children:["Country: ",s.correctedCountry]}),s.correctedDate&&e.jsxs("p",{className:"text-[13px] text-[#ccc]",children:["Date: ",s.correctedDate]}),s.photoUrl&&e.jsx("div",{className:"mt-1.5",children:e.jsx("img",{src:s.photoUrl,alt:"Correction",className:"w-[100px] rounded",loading:"lazy"})})]})}function Ss({report:t}){const s=t.pageType?t.pageType.charAt(0).toUpperCase()+t.pageType.slice(1):null,n=js[t.problemType]||"other",m=ct[n]||ct.other,c=gs[t.problemType]||t.problemType;return e.jsxs("div",{className:"upload-card",style:{borderLeft:`3px solid ${m}`},children:[e.jsxs("div",{className:"flex items-center flex-wrap gap-2 mb-1.5",children:[e.jsx("span",{className:"text-[11px] uppercase tracking-wide font-medium",style:{color:m},children:c}),e.jsx(ks,{website:t.website}),s&&e.jsx("span",{className:"text-[11px] text-[#555]",children:s}),e.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[t.editRequest&&t.editRequest.status==="pending"&&e.jsx("span",{className:"text-[11px] font-semibold uppercase px-1.5 py-0.5 rounded-sm border border-amber-500/30 bg-amber-500/10 text-amber-400",children:"Edit Pending"}),e.jsx(Ns,{status:t.status}),e.jsx("span",{className:"text-xs text-[#888]",children:t.createdOn?de(t.createdOn):"Unknown date"}),e.jsxs("a",{href:`/edit-report.html?id=${t.id}`,className:"inline-flex items-center gap-1 text-[12px] text-[#aaa] hover:text-primary transition-colors no-u
1nderline hover:!no-underline shrink-0",title:"Edit report",children:[e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Edit"]})]})]}),t.title&&e.jsx("div",{className:"mb-1",children:t.url?e.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium !text-[#ccc] hover:!text-primary hover:underline",children:t.title}):e.jsx("span",{className:"text-sm font-medium",children:t.title})}),t.details&&e.jsx("p",{className:"text-[13px] text-[#999] mb-0",children:t.details}),e.jsx(Cs,{problemType:t.problemType,corrections:t.corrections}),t.duplicate&&e.jsx("p",{className:"text-[11px] text-amber-500 mt-1.5",children:"Marked as duplicate"})]})}function Rs({uid:t,showMessage:s}){const[n,m]=a.useState(!0),[c,b]=a.useState([]),[p,k]=a.useState(1);a.useEffect(()=>{let g=!1;async function R(){try{const A=X(H,"reports"),w=ne(A,re("createdBy"),ce(t)),E=await ae(w),B=[];E.forEach(y=>{const f=ws(y.key,y.val());f&&B.push(f)}),B.sort((y,f)=>f.createdOn-y.createdOn),g||b(B)}catch(A){try{O.captureException(A,{tags:{area:"realtime-db",op:"get-reports"},extra:{id:t}})}catch{}s("An error occurred!")}finally{g||m(!1)}}return R(),()=>{g=!0}},[t,s]);const l=Math.ceil(c.length/We),C=a.useMemo(()=>{const g=(p-1)*We;return c.slice(g,g+We)},[c,p]),S=a.useCallback(g=>{k(g),window.scrollTo({top:0,behavior:"smooth"})},[]);return n?e.jsx("div",{children:[0,1].map(g=>e.jsxs("div",{className:"skel-card",style:{borderLeft:"3px solid rgba(255,255,255,0.1)",marginBottom:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10,flexWrap:"wrap"},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:16,width:"50%",maxWidth:300}}),e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:60,borderRadius:3}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:80,marginLeft:"auto"}})]}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:"100%",maxWidth:500,marginBottom:6}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:"70%",maxWidth:400}})]},g))}):c.length===0?e.jsx("div",{className:"card-dark",children:e.jsx("p",{className:"text-[#888]",children:"No reports submitted."})}):e.jsxs("div",{children:[e.jsx(K,{currentPage:p,totalPages:l,onPageChange:S}),C.map(g=>e.jsx(Ss,{report:g},g.id)),e.jsx(K,{currentPage:p,totalPages:l,onPageChange:S})]})}const De=10,ut={pending:{label:"Pending",cls:"badge-processing"},approved:{label:"Approved",cls:"badge-published"},declined:{label:"Declined",cls:"badge-declined"}};function Ls({status:t}){const s=ut[t]||ut.pending;return e.jsx("span",{className:`badge ${s.cls}`,children:s.label})}function As(t){if(!t)return[];const s=[];return t.filesRemoved?.length&&s.push(`${t.filesRemoved.length} file(s) removed`),t.filesAdded?.length&&s.push(`${t.filesAdded.length} file(s) added`),t.filesReplaced?.length&&s.push(`${t.filesReplaced.length} file(s) replaced`),t.celebsRemoved?.length&&s.push(`Removed: ${t.celebsRemoved.map(n=>n.name).join(", ")}`),t.celebsAdded?.length&&s.push(`Added: ${t.celebsAdded.map(n=>n.name).join(", ")}`),t.celebsModified?.length&&t.celebsModified.forEach(n=>{n.swapped?s.push(`Swapped ${n.originalName} â ${n.newName}`):n.detailsEdited?s.push(`Edited details for ${n.newName}`):n.appearanceChanged&&s.push(`Changed appearance for ${n.newName}`)}),t.entityRemoved&&s.push(`Removed ${t.entityRemoved.type}: ${t.entityRemoved.name}`),t.entityAdded&&s.push(`Added ${t.entityAdded.type}: ${t.entityAdded.name}`),t.categoriesAdded?.length&&s.push(`Categories added: ${t.categoriesAdded.join(", ")}`),t.categoriesRemoved?.length&&s.push(`Categories removed: ${t.categoriesRemoved.join(", ")}`),t.tagsAdded?.length&&s.push(`Tags added: ${t.tagsAdded.join(", ")}`),t.tagsRemoved?.length&&s.push(`Tags removed: ${t.tagsRemoved.join(", ")}`),s}
1function Es(t){const n=(t.celebName||"").split("|").filter(Boolean).map(b=>b==="az-undetermined"?"Unknown":b).join(", ")||"Unknown",m=t.type||"movie",c=m==="series"?t.seriesName:m==="story"?t.storyName:t.movieName;return c&&c!=="az-undetermined"?`${n} in ${c}`:n}function Ps({item:t,onCancel:s}){const[n,m]=a.useState(!1),[c,b]=a.useState(!1),p=t.editRequest,k=a.useMemo(()=>As(p.changes),[p.changes]);return e.jsxs("div",{className:"upload-card",children:[e.jsxs("div",{className:"flex items-center flex-wrap gap-2.5 mb-2",children:[e.jsx("span",{className:"upload-title text-sm",children:t.title}),e.jsx(Ls,{status:p.status}),e.jsx("span",{className:"text-xs text-[#888] ml-auto",children:t.createdOnFormatted})]}),e.jsxs("div",{className:"text-[13px] text-[#999] mb-2",children:[e.jsx("span",{className:"text-[#666]",children:"Upload:"})," ",e.jsx("a",{href:`/edit-upload.html?id=${t.uploadId}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.uploadId})]}),k.length>0&&e.jsxs("div",{className:"mb-1.5",children:[e.jsxs("button",{type:"button",className:"text-[13px] text-[#aaa] hover:text-white transition-colors bg-transparent border-none cursor-pointer p-0 flex items-center gap-1.5",onClick:()=>m(l=>!l),children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:`transition-transform ${n?"rotate-90":""}`,children:e.jsx("polyline",{points:"9 18 15 12 9 6"})}),k.length," change",k.length!==1?"s":""]}),n&&e.jsx("ul",{className:"mt-1.5 ml-5 space-y-0.5 text-[13px] text-[#bbb] list-disc",children:k.map((l,C)=>e.jsx("li",{children:l},C))})]}),p.status==="declined"&&p.declineReason&&e.jsxs("p",{className:"text-[13px] text-red-400 mt-1",children:[e.jsx("span",{className:"text-[#666]",children:"Reason:"})," ",p.declineReason]}),p.status==="pending"&&e.jsx("button",{type:"button",className:"text-[13px] text-red-400 hover:text-red-300 bg-transparent border-none cursor-pointer p-0 mt-2 transition-colors",disabled:c,onClick:async()=>{if(confirm("Cancel this edit request? This cannot be undone.")){b(!0);try{const l=X(H,`uploads/${t.uploadId}/editRequest`);await Ot(l),s(t.uploadId)}catch(l){O.captureException(l,{tags:{area:"edit-requests",op:"cancel"},extra:{uploadId:t.uploadId}}),b(!1)}}},children:c?"Cancelling...":"Cancel Request"})]})}function Bs({uid:t,showMessage:s}){const[n,m]=a.useState(!0),[c,b]=a.useState([]),[p,k]=a.useState(1);a.useEffect(()=>{let R=!1;async function A(){try{const w=X(H,"uploads"),E=ne(w,re("createdBy"),ce(t),Ce(1e3)),B=await ae(E),y=[];B.forEach(f=>{const u=f.val();u.editRequest&&y.push({uploadId:f.key,title:Es(u),editRequest:u.editRequest,createdOnFormatted:de(u.editRequest.createdOn)})}),y.sort((f,u)=>(u.editRequest.createdOn||0)-(f.editRequest.createdOn||0)),R||b(y)}catch(w){try{O.captureException(w,{tags:{area:"realtime-db",op:"get-edit-requests"},extra:{uid:t}})}catch{}s("An error occurred loading edit requests.")}finally{R||m(!1)}}return A(),()=>{R=!0}},[t,s]);const l=a.useCallback(R=>{b(A=>A.filter(w=>w.uploadId!==R))},[]),C=Math.ceil(c.length/De),S=a.useMemo(()=>{const R=(p-1)*De;return c.slice(R,R+De)},[c,p]),g=a.useCallback(R=>{k(R),window.scrollTo({top:0,behavior:"smooth"})},[]);return n?e.jsxs("div",{children:[e.jsxs("div",{className:"skel-card",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10,flexWrap:"wrap"},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:16,width:"45%",maxWidth:280}}),e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:70,borderRadius:3}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:80,marginLeft:"auto"}})]}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:200,marginBottom:12}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:100}})]}),e.jsxs("div",{className:"skel-card",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10,flexWrap:"wrap"},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:16,width:"50%",maxWidth:300}}),e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:70,borderRadius:3}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:80,marginLeft:"auto"}})]}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:220,marginBottom:12}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:130}})]})]}):e.jsxs("div",{children:[e.jsx(K,{currentPage:p,totalPages:C,onPageChange:g}),c.length===0?e.jsx("div",{className:"card-dark",children:e.jsx("p",{className:"text-[#888]",children:"No edit requests submitted yet."})}):S.map(R=>e.jsx(Ps,{item:R,onCancel:l},R.uploadId)),e.jsx(K,{currentPage:p,totalPages:C,onPageChange:g})]})}const _e=20,$e=500,ht={pending:{label:"Pending",cls:"badge-processing"},approved:{label:"Approved",cls:"badge-published"},declined:{label:"Declined",cls:"badge-declined"}},Ts=[{value:"all",label:"All Sites"},{value:"aznude",label:"AZNude"},{value:"azmen",label:"AZMen"},{value:"azfans",label:"AZFans"},{value:"aznudefeet",label:"AZNudeFeet"}],Is=[{value:"all",label:"All Statuses"},{value:"pending",label:"Pending"},{value:"approved",label:"Approved"},{value:"declined",label:"Declined"}];function Os({status:t}){const s=ht[t]||ht.pending;return e.jsx("span",{className:`badge ${s.cls}`,children:s.label})}function Ms(t){if(!t)return[];const s=[];return t.filesRemoved?.length&&s.push(`${t.filesRemoved.length} file(s) removed`),t.filesAdded?.length&&s.push(`${t.filesAdded.length} file(s) added`),t.filesReplaced?.length&&s.push(`${t.filesReplaced.length} file(s) replaced`),t.celebsRemoved?.length&&s.push(`Removed: ${t.celebsRemoved.map(n=>n.name).join(", ")}`),t.celebsAdded?.length&&s.push(`Added: ${t.celebsAdded.map(n=>n.name).join(", ")}`),t.celebsModified?.length&&t.celebsModified.forEach(n=>
1{n.swapped?s.push(`Swapped ${n.originalName} -> ${n.newName}`):n.detailsEdited?s.push(`Edited details for ${n.newName}`):n.appearanceChanged&&s.push(`Changed appearance for ${n.newName}`)}),t.entityRemoved&&s.push(`Removed ${t.entityRemoved.type}: ${t.entityRemoved.name}`),t.entityAdded&&s.push(`Added ${t.entityAdded.type}: ${t.entityAdded.name}`),t.categoriesAdded?.length&&s.push(`Categories added: ${t.categoriesAdded.join(", ")}`),t.categoriesRemoved?.length&&s.push(`Categories removed: ${t.categoriesRemoved.join(", ")}`),t.tagsAdded?.length&&s.push(`Tags added: ${t.tagsAdded.join(", ")}`),t.tagsRemoved?.length&&s.push(`Tags removed: ${t.tagsRemoved.join(", ")}`),t.genderChanged&&s.push(`Gender: ${t.genderChanged.from} -> ${t.genderChanged.to}`),t.typeChanged&&s.push(`Type: ${t.typeChanged.from} -> ${t.typeChanged.to}`),s}function Us(t){const n=(t.celebName||"").split("|").filter(Boolean).map(b=>b==="az-undetermined"?"Unknown":b).join(", ")||"Unknown",m=t.type||"movie",c=m==="series"?t.seriesName:m==="story"?t.storyName:t.movieName;return c&&c!=="az-undetermined"?`${n} in ${c}`:n}function Ws(t){return t.website||t.editRequest?.original?.website||"unknown"}function Ds({item:t}){const[s,n]=a.useState(!1),m=t.editRequest,c=a.useMemo(()=>Ms(m.changes),[m.changes]);return e.jsxs("div",{className:"upload-card",children:[e.jsxs("div",{className:"flex items-center flex-wrap gap-2.5 mb-2",children:[e.jsx("span",{className:"upload-title text-sm",children:t.title}),e.jsx(Os,{status:m.status}),e.jsx("span",{className:"text-xs text-[#888] ml-auto",children:t.createdOnFormatted})]}),e.jsxs("div",{className:"text-[13px] text-[#999] mb-2 flex flex-wrap gap-x-4 gap-y-1",children:[e.jsxs("span",{children:[e.jsx("span",{className:"text-[#666]",children:"Upload ID:"})," ",e.jsx("span",{className:"font-mono text-[#bbb]",children:t.uploadId})]}),e.jsxs("span",{children:[e.jsx("span",{className:"text-[#666]",children:"Site:"})," ",e.jsx("span",{className:"text-[#bbb]",children:t.site})]}),e.jsxs("span",{children:[e.jsx("span",{className:"text-[#666]",children:"Author:"})," ",e.jsx("span",{className:"font-mono text-[#bbb]",children:t.createdBy||"unknown"})]})]}),c.length>0&&e.jsxs("div",{className:"mb-1.5",children:[e.jsxs("button",{type:"button",className:"text-[13px] text-[#aaa] hover:text-white transition-colors bg-transparent border-none cursor-pointer p-0 flex items-center gap-1.5",onClick:()=>n(b=>!b),children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:`transition-transform ${s?"rotate-90":""}`,children:e.jsx("polyline",{points:"9 18 15 12 9 6"})}),c.length," change",c.length!==1?"s":""]}),s&&e.jsx("ul",{className:"mt-1.5 ml-5 space-y-0.5 text-[13px] text-[#bbb] list-disc",children:c.map((b,p)=>e.jsx("li",{children:b},p))})]}),m.status==="declined"&&m.declineReason&&e.jsxs("p",{className:"text-[13px] text-red-400 mt-1",children:[e.jsx("span",{className:"text-[#666]",children:"Reason:"})," ",m.declineReason]})]})}function _s({uid:t,showMessage:s}){const[n,m]=a.useState(!0),[c,b]=a.useState([]),[p,k]=a.useState(1),[l,C]=a.useState("pending"),[S,g]=a.useState("all"),[R,A]=a.useState(!1);a.useEffect(()=>{let f=!1;async function u(){try{const j=X(H,"uploads"),o=ne(j,re("editRequest/createdOn"),Ce($e)),x=await ae(o),i=[];x.forEach(N=>{const h=N.val();!h||!h.editRequest||i.push({uploadId:N.key,title:Us(h),createdBy:h.createdBy,site:Ws(h),editRequest:h.editRequest,createdOnFormatted:de(h.editRequest.createdOn)})}),i.sort((N,h)=>(h.editRequest.createdOn||0)-(N.editRequest.createdOn||0)),f||(b(i),A(i.length>=$e))}catch(j){try{O.captureException(j,{tags:{area:"realtime-db",op:"get-edit-moderation"},extra:{uid:t}})}catch{}s("An error occurred loading edit requests.")}finally{f||m(!1)}}return u(),()=>{f=!0}},[t,s]);const w=a.useMemo(()=>c.filter(f=>!(l!=="all"&&f.editRequest.status!==l||S!=="all"&&f.site!==S)),[c,l,S]);a.useEffect(()=>{k(1)},[l,S]);const E=Math.ceil(w.length/_e),B=a.useMemo(()=>{const f=(p-1)*_e;return w.slice(f,f+_e)},[w,p]),y=a.useCallback(f=>{k(f),window.scrollTo({top:0,behavior:"smooth"})},[]);return n?e.jsxs("div",{children:[e.jsxs("div",{className:"skel-card",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10,flexWrap:"wrap"},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:16,width:"45%",maxWidth:280}}),e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:70,borderRadius:3}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:80,marginLeft:"auto"}})]}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:220,marginBottom:12}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:130}})]}),e.jsxs("div",{className:"skel-card",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10,flexWrap:"wrap"},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:16,width:"50%",maxWidth:300}}),e.jsx("div",{className:"skeleton-pulse",style:{height:20,width:70,borderRadius:3}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:80,marginLeft:"auto"}})]}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:240,marginBottom:12}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:140}})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"card-dark",style:{display:"flex",flexWrap:"wrap",gap:12,alignItems:"center"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("label",{className:"text-[12px] text-[#888]",htmlFor:"edit-mod-status",children:"Status"}),e.jsx("select",{id:"edit-mod-status",className:"form-input-dark",value:l,onCh
1ange:f=>C(f.target.value),children:Is.map(f=>e.jsx("option",{value:f.value,children:f.label},f.value))})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("label",{className:"text-[12px] text-[#888]",htmlFor:"edit-mod-site",children:"Site"}),e.jsx("select",{id:"edit-mod-site",className:"form-input-dark",value:S,onChange:f=>g(f.target.value),children:Ts.map(f=>e.jsx("option",{value:f.value,children:f.label},f.value))})]}),e.jsxs("div",{className:"text-[12px] text-[#888]",style:{marginLeft:"auto"},children:["Showing ",w.length," of ",c.length,R&&e.jsxs("span",{className:"text-amber-400",children:[" (capped at ",$e,")"]})]})]}),e.jsx(K,{currentPage:p,totalPages:E,onPageChange:y}),w.length===0?e.jsx("div",{className:"card-dark",children:e.jsx("p",{className:"text-[#888]",children:"No edit requests match the current filters."})}):B.map(f=>e.jsx(Ds,{item:f},f.uploadId)),e.jsx(K,{currentPage:p,totalPages:E,onPageChange:y})]})}const Fe=12,Ne={minor:"Minor","child-abuse":"Child Abuse",copyright:"Copyright",consent:"Consent","ai-deepfake":"AI / Deepfake",stolen:"Stolen Content",spam:"Spam",duplicate:"Duplicate",name:"Wrong Name",picture:"Wrong Picture",content:"Content Issue",country:"Wrong Country",birthplace:"Wrong Birthplace",date:"Wrong Date",dateofbirth:"Wrong Date of Birth",photo:"Wrong Photo",other:"Other"},$s={minor:"safety","child-abuse":"safety",copyright:"legal",consent:"legal","ai-deepfake":"legal",stolen:"legal",spam:"quality",duplicate:"quality",name:"accuracy",picture:"accuracy",content:"accuracy",country:"accuracy",birthplace:"accuracy",date:"accuracy",dateofbirth:"accuracy",photo:"accuracy",other:"other"},mt={safety:"#f87171",legal:"#60a5fa",quality:"#c084fc",accuracy:"#22d3ee",other:"#94a3b8"},be={safety:0,legal:1,accuracy:2,other:3,quality:4},Fs={az:"AZNude",azmen:"AZMen",azfans:"AZFans",azfeet:"AZNudeFeet"},zs=["pending","resolved","dismissed","all"],qs={pending:"Pending",resolved:"Resolved",dismissed:"Dismissed",all:"All"};function fe(t){return $s[t]||"other"}function je({label:t,value:s,color:n}){return e.jsxs("div",{className:"card-dark",style:{flex:"1 1 110px",minWidth:110,padding:"10px 14px",margin:0},children:[e.jsx("div",{style:{fontSize:22,fontWeight:700,color:n||"#eee",lineHeight:1.1},children:s}),e.jsx("div",{style:{fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"#888",marginTop:2},children:t})]})}function Vs({corrections:t}){return!t||Object.keys(t).length===0?null:e.jsxs("div",{className:"mt-2 pt-2 border-t border-[#222]",children:[e.jsx("p",{className:"text-[11px] text-[#666] uppercase tracking-wide mb-1",children:"Suggested correction"}),t.correctedName&&e.jsxs("p",{className:"text-[13px] text-[#ccc]",children:["Name: ",t.correctedName]}),t.correctedCountry&&e.jsxs("p",{className:"text-[13px] text-[#ccc]",children:["Country: ",t.correctedCountry]}),t.correctedDate&&e.jsxs("p",{className:"text-[13px] text-[#ccc]",children:["Date: ",t.correctedDate]}),t.photoUrl&&e.jsx("div",{className:"mt-1.5",children:e.jsx("img",{src:t.photoUrl,alt:"Correction",className:"w-[100px] rounded",loading:"lazy"})})]})}function ze({onClick:t,disabled:s,busy:n,color:m,bg:c,border:b,children:p}){return e.jsx("button",{type:"button",onClick:t,disabled:s||n,style:{fontSize:12,fontWeight:600,padding:"5px 12px",borderRadius:4,border:`1px solid ${b}`,background:c,color:m,cursor:s||n?"default":"pointer",opacity:s?.4:1,transition:"opacity 0.15s"},children:n?"â¦":p})}function Gs({report:t,onSetStatus:s,busy:n}){const m=fe(t.problemType),c=mt[m]||mt.other,b=Ne[t.problemType]||t.problemType,p=t.pageType?t.pageType.charAt(0).toUpperCase()+t.pageType.slice(1):null,k=t.website?Fs[t.website]||t.website:null,l=t.status||"pending";return e.jsxs("div",{className:"upload-card",style:{borderLeft:`3px solid ${c}`},children:[e.jsxs("div",{className:"flex items-center flex-wrap gap-2 mb-1.5",children:[e.jsx("span",{className:"text-[11px] uppercase tracking-wide font-medium",style:{color:c},children:b}),k&&e.jsx("span",{className:"text-[11px] text-[#666] bg-[#1a1a1a] px-1.5 py-0.5 rounded",children:k}),p&&e.jsx("span",{className:"text-[11px] text-[#555]",children:p}),t.duplicate&&e.jsx("span",{className:"text-[11px] text-amber-500",children:"duplicate"}),e.jsx("span",{className:"ml-auto text-xs text-[#888]",children:t.createdOn?de(t.createdOn):"Unknown date"})]}),t.title&&e.jsx("div",{className:"mb-1",children:t.url?e.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium !text-[#ccc] hover:!text-primary hover:underline",children:t.title}):e.jsx("span",{className:"text-sm font-medium",children:t.title})}),!t.title&&t.url&&e.jsx("div",{className:"mb-1",children:e.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-[13px] !text-[#9ab] hover:underline break-all",children:t.url})}),t.details&&e.jsx("p",{className:"text-[13px] text-[#999] mb-0 whitespace-pre-wrap",children:t.details}),e.jsx(Vs,{corrections:t.corrections}),(t.email||t.reportedBy)&&e.jsxs("p",{className:"text-[11px] text-[#555] mt-2",children:["Reporter: ",t.email||"anonymous",t.reportedBy?` · ${t.reportedBy}`:""]}),e.jsxs("div",{className:"flex items-center flex-wrap gap-2 mt-3 pt-2.5 border-t border-[#222]",children:[e.jsxs("span",{className:"text-[11px] uppercase tracking-wide",style:{color:l==="resolved"?"#4ade80":l==="dismissed"?"#94a3b8":"#fbbf24"},children:[l,t.moderatedOn?` · ${de(t.moderatedOn)}`:""]}),e.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[e.jsx(ze,{onClick:()=>s(t.id,"resolved"),disabled:l==="resolved",busy:n,color:"#4ade80",bg:"rgba(74,222,128,0.10)",border:"rgba(74,222,128,0.35)",children:"Resolve"}),e.jsx(ze,{onClick:()=>s(t.id,"dismissed"),disabled:l==="dismissed",busy:n,color:"#cbd5e1",bg:"rgba(148,163,184,0.10)",border:"rgba(148,163,184,0.30
1)",children:"Dismiss"}),l!=="pending"&&e.jsx(ze,{onClick:()=>s(t.id,"pending"),disabled:!1,busy:n,color:"#fbbf24",bg:"transparent",border:"rgba(251,191,36,0.30)",children:"Reopen"})]})]})]})}function Hs(){return e.jsxs("div",{children:[e.jsx("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginBottom:16},children:[0,1,2,3].map(t=>e.jsx("div",{className:"skeleton-pulse",style:{height:64,flex:"1 1 110px",minWidth:110,borderRadius:6}},t))}),[0,1,2].map(t=>e.jsxs("div",{className:"skel-card",style:{borderLeft:"3px solid rgba(255,255,255,0.1)",marginBottom:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10,flexWrap:"wrap"},children:[e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:90}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:60}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:110,marginLeft:"auto"}})]}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:"55%",maxWidth:320,marginBottom:8}}),e.jsx("div",{className:"skeleton-pulse",style:{height:14,width:"90%",maxWidth:520,marginBottom:12}}),e.jsx("div",{className:"skeleton-pulse",style:{height:28,width:180,marginLeft:"auto"}})]},t))]})}function Ys({canModerate:t,showMessage:s}){const[n,m]=a.useState(!0),[c,b]=a.useState([]),[p,k]=a.useState("pending"),[l,C]=a.useState("all"),[S,g]=a.useState(""),[R,A]=a.useState(1),[w,E]=a.useState(null);a.useEffect(()=>{A(1)},[p,l,S]),a.useEffect(()=>{let i=!1;async function N(){if(!t){m(!1);return}try{const h=await qe(F.currentUser),v=await(await fetch(`${PRIMARY_BASE}/listReports`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:h})})).json();if(v.status!=="ok"||!Array.isArray(v.reports))throw new Error(v.message||"Failed to load reports.");i||b(v.reports)}catch(h){try{O.captureException(h,{tags:{area:"moderation",op:"list-reports"}})}catch{}i||s("Failed to load the report queue.")}finally{i||m(!1)}}return N(),()=>{i=!0}},[t,s]);const B=a.useCallback(async(i,N)=>{const h=c.find(v=>v.id===i);if(!h)return;const d=h.status;E(i),b(v=>v.map(r=>r.id===i?{...r,status:N,moderatedOn:Date.now()}:r));try{const v=await qe(F.currentUser),T=await(await fetch(`${PRIMARY_BASE}/updateReportStatus`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:v,reportId:i,status:N})})).json();if(T.status!=="ok")throw new Error(T.message||"Update rejected.")}catch(v){try{O.captureException(v,{tags:{area:"moderation",op:"update-report-status"},extra:{reportId:i,nextStatus:N}})}catch{}b(r=>r.map(T=>T.id===i?{...T,status:d}:T)),s("Could not update that report. Try again.")}finally{E(null)}},[c,s]),y=a.useMemo(()=>{const i={pending:0,resolved:0,dismissed:0,urgentPending:0};for(const N of c){const h=N.status||"pending";if(i[h]!==void 0&&(i[h]+=1),h==="pending"){const d=fe(N.problemType);(d==="safety"||d==="legal")&&(i.urgentPending+=1)}}return i},[c]),f=a.useMemo(()=>{const i=new Set(c.map(N=>N.problemType));return Array.from(i).sort((N,h)=>{const d=be[fe(N)]??9,v=be[fe(h)]??9;return d!==v?d-v:(Ne[N]||N).localeCompare(Ne[h]||h)})},[c]),u=a.useMemo(()=>{const i=S.trim().toLowerCase();let N=c.filter(h=>{const d=h.status||"pending";return!(p!=="all"&&d!==p||l!=="all"&&h.problemType!==l||i&&!`${h.title||""} ${h.url||""} ${h.details||""} ${h.email||""}`.toLowerCase().includes(i))});return N=N.slice().sort((h,d)=>{const v=be[fe(h.problemType)]??9,r=be[fe(d.problemType)]??9;return v!==r?v-r:(d.createdOn||0)-(h.createdOn||0)}),N},[c,p,l,S]),j=Math.ceil(u.length/Fe),o=a.useMemo(()=>{const i=(R-1)*Fe;return u.slice(i,i+Fe)},[u,R]),x=a.useCallback(i=>{A(i),window.scrollTo({top:0,behavior:"smooth"})},[]);return t?n?e.jsx(Hs,{}):e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginBottom:16},children:[e.jsx(je,{label:"Pending",value:y.pending,color:"#fbbf24"}),e.jsx(je,{label:"Urgent pending",value:y.urgentPending,color:"#f87171"}),e.jsx(je,{label:"Resolved",value:y.resolved,color:"#4ade80"}),e.jsx(je,{label:"Dismissed",value:y.dismissed,color:"#cbd5e1"}),e.jsx(je,{label:"Total",value:c.length})]}),e.jsxs("div",{className:"card-dark",style:{display:"flex",gap:12,flexWrap:"wrap",alignItems:"center",marginBottom:16},children:[e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:zs.map(i=>e.jsxs("button",{type:"button",onClick:()=>k(i),style:{fontSize:12,fontWeight:600,padding:"5px 12px",borderRadius:4,border:"1px solid #2a2a2a",background:p===i?"var(--primary-color, #e11d48)":"transparent",color:p===i?"#fff":"#aaa",cursor:"pointer"},children:[qs[i],i!=="all"&&y[i]!==void 0?` (${y[i]})`:""]},i))}
1),e.jsxs("select",{value:l,onChange:i=>C(i.target.value),className:"form-input-dark",style:{maxWidth:220},children:[e.jsx("option",{value:"all",children:"All problem types"}),f.map(i=>e.jsx("option",{value:i,children:Ne[i]||i},i))]}),e.jsx("input",{type:"text",value:S,onChange:i=>g(i.target.value),placeholder:"Search title, URL, details, emailâ¦",className:"form-input-dark",style:{flex:"1 1 220px",minWidth:200}})]}),u.length===0?e.jsx("div",{className:"card-dark",children:e.jsx("p",{className:"text-[#888]",children:"No reports match these filters."})}):e.jsxs(e.Fragment,{children:[e.jsx(K,{currentPage:R,totalPages:j,onPageChange:x}),o.map(i=>e.jsx(Gs,{report:i,onSetStatus:B,busy:w===i.id},i.id)),e.jsx(K,{currentPage:R,totalPages:j,onPageChange:x})]})]}):e.jsx("div",{className:"card-dark",children:e.jsx("p",{className:"text-[#888]",children:"You do not have access to the report queue."})})}const te={profile:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),uploads:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"17 8 12 3 7 8"}),e.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),settings:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),moderation:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),socials:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),reports:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"}),e.jsx("line",{x1:"4",y1:"22",x2:"4",y2:"15"})]}),editRequests:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),e.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),editModeration:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 20h9"}),e.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}),e.jsx("path",{d:"M3 21h6"})]}),viewUploads:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),reportQueue:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}
1),e.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),e.jsx("path",{d:"M9 14l2 2 4-4"})]})},He=[{id:"profile",label:"Profile",icon:te.profile},{id:"content-uploaded",label:"Uploads",icon:te.uploads},{id:"edit-requests",label:"Edit Requests",icon:te.editRequests},{id:"settings",label:"Settings",icon:te.settings},{id:"content-moderation",label:"Moderation",icon:te.moderation},{id:"manage-socials-signin",label:"Social Sign-in",icon:te.socials},{id:"reports",label:"Reports",icon:te.reports},{id:"reports-moderation",label:"Report Queue",icon:te.reportQueue,reportModerator:!0},{id:"edit-moderation",label:"Edit Moderation",icon:te.editModeration,editModeratorOnly:!0},{id:"view-uploads",label:"View Uploads",icon:te.viewUploads,moderatorOnly:!0}];function Zs({message:t,onDismiss:s,innerRef:n}){return t?e.jsxs("div",{ref:n,className:"alert-bar",children:[e.jsx("div",{className:"flex-1",dangerouslySetInnerHTML:{__html:t}}),s&&e.jsx("button",{onClick:s,className:"alert-bar-close","aria-label":"Dismiss",children:"Ã"})]}):null}function Xs({activeTab:t}){const s=t==="edit-profile"?"profile":t,n=He.filter(m=>!m.moderatorOnly&&!m.editModeratorOnly&&!m.reportModerator);return e.jsx("div",{className:"max-w-[1400px] mx-auto px-[15px]",children:e.jsx("div",{className:"profile-tabs",children:n.map(m=>e.jsxs("button",{type:"button",className:`profile-tab${m.id===s?" active":""}`,children:[m.icon,e.jsx("span",{children:m.label})]},m.id))})})}function Qs(){const[t,s]=a.useState(null),[n,m]=a.useState(""),[c,b]=a.useState(!0),[p,k]=a.useState(!1),[l,C]=a.useState(!1),[S,g]=a.useState(""),[R,A]=a.useState(""),[w,E]=a.useState(0),B=a.useRef(null),[y,f]=a.useState(()=>{const d=window.location.hash.substring(1),v=He.find(r=>r.id===d);return v?v.id:"profile"}),[u,j]=a.useState(()=>({[y]:!0})),o=a.useCallback(d=>{A(d),setTimeout(()=>{B.current?.scrollIntoView({behavior:"smooth",block:"center"})},50)},[]),x=a.useCallback(()=>A(""),[]);a.useEffect(()=>{const d=Mt(F,async v=>{if(!v){try{O.setUser(null)}catch{}window.location.href="/signin.html?next="+encodeURI(window.location.href);return}try{const r=await v.getIdTokenResult(!0);try{O.setUser({id:v.uid,email:v.email}),O.setContext("firebaseClaims",r?.claims||{})}catch{}if(r.claims.isBanned){localStorage.removeItem("azn_id");try{O.addBreadcrumb({category:"auth",message:"User is banned",level:"info"})}catch{}await we(F);return}r.claims.firebase?.sign_in_second_factor!=="totp"?g("Enable two-factor authentication"):g("Disable two-factor authentication"),k(v.uid===Ge)}catch(r){try{O.captureException(r,{tags:{area:"auth",op:"getIdTokenResult"}})}catch{}}try{const r=X(H,`users/${v.uid}/isEditModerator`),T=await ae(r);C(T.val()===!0)}catch(r){try{O.captureException(r,{tags:{area:"profile",op:"fetchEditModerator"}})}catch{}}try{const r=await qe(v);m(r)}catch(r){try{O.captureException(r,{tags:{area:"auth",op:"getIdToken"}})}catch{}}s(v),b(!1)});return()=>d()},[]),a.useEffect(()=>{Pe("verify")==="true"&&o("Your account has been successfully verified."),Pe("opted-out")==="true"&&o("You have successfully opted out of 2FA. Please don't forget to remove it from your preferred authentication app as well."),Pe("opted-in")==="true"&&o("You have successfully added 2FA to your account.")},[o]);const i=a.useCallback(()=>{E(d=>d+1)},[]),N=a.useCallback(d=>{f(d),j(v=>v[d]?v:{...v,[d]:!0}),window.location.hash=d,x();try{O.addBreadcrumb({category:"ui",message:`Tab clicked: ${d}`,level:"info"})}catch{}},[x]);if(c)return e.jsx(Xs,{activeTab:y});const h=document.querySelector('meta[name="website"]')?.getAttribute("content")||"aznude";return e.jsxs("div",{className:"max-w-[1400px] mx-auto px-[15px]",children:[e.jsx("div",{className:"profile-tabs",children:He.filter(d=>(!d.moderatorOnly||p)&&(!d.editModeratorOnly||l)&&(!d.reportModerator||p||l)).map(d=>e.jsxs("button",{onClick:()=>N(d.id),className:`profile-tab${y===d.id?" active":""}`,children:[d.icon,e.jsx("span",{children:d.label})]},d.id))}),e.jsx(Zs,{message:R,onDismiss:x,innerRef:B}),t&&e.jsxs("div",{className:"profile-content-container",children:[e.jsx("div",{className:y!=="profile"?"hidden":"",children:u.profile&&e.jsx(Zt,{user:t,showMessage:o,website:h,onEditProfile:()=>N("edit-profile"),onGoToUploads:()=>N("content-uploaded"),profileVersion:w})}),e.jsx("div",{className:y!=="edit-profile"?"hidden":"",children:u["edit-profile"]&&e.jsx(ls,{uid:t.uid,idToken:n,showMessage:o,onBack:()=>N("profile"),onProfileUpdated:i})}),e.jsx("div",{className:y!=="content-uploaded"?"hidden":"",children:u["content-uploaded"]&&e.jsx(os,{uid:t.uid,showMessage:o,website:h})}),e.jsx("div",{className:y!=="edit-requests"?"hidden":"",children:u["edit-requests"]&&e.jsx(Bs,{uid:t.uid,showMessage:o})}),e.jsx("div",{className:y!=="settings"?"hidden":"",children:u.settings&&e.jsx(ps,{uid:t.uid,idToken:n,showMessage:o,twoFactorLabel:S,website:h})}),e.jsx("div",{className:y!=="content-moderation"?"hidden":"",children:u["content-moderation"]&&e.jsx(xs,{uid:t.uid,isModerator:p,showMessage:o})}),e.jsx("div",{className:y!=="manage-socials-signin"?"hidden":"",children:u["manage-socials-signin"]&&e.jsx(fs,{showMessage:o})}),e.jsx("div",{className:y!=="reports"?"hidden":"",children:u.reports&&e.jsx(Rs,{uid:t.uid,showMessage:o})}),(p||l)&&e.jsx("div",{className:y!=="reports-moderation"?"hidden":"",children:u["reports-moderation"]&&e.jsx(Ys,{canModerate:p||l,showMessage:o})}),l&&e.jsx("div",{className:y!=="edit-moderation"?"hidden":"",children:u["edit-moderation"]&&e.jsx(_s,{uid:t.uid,showMessage:o})}),p&&e.jsx("div",{className:y!=="view-uploads"?"hidden":"",children:e.jsxs("div",{className:"card-dark",children:[e.jsx("h2",{className:"section-header",children:"View Uploads"}),e.jsx("p",{className:"text-sm text-[#888] mb-4",children:"Enter a user ID to view their uploads in a new tab."}),e.jsxs("div",{className:"flex gap-2 max-w-[420px]",children:[e.jsx("input",{type:"text",className:"form-input-dark flex-1",placeholder:"Insert user ID",id:"view-uploads-uid-input"}),e.jsx("button",{type:"button",className:"btn-primary-tw shrink-0",onClick:()=>{const d=document.getElementById("view-uploads-uid-input")?.value?.trim();d&&window.open(`/view-uploads.html?id=${encodeURIComponent(d)}`,"_blank")},children:"View"})]})]})})]})]})}function ca(){return e.jsx(Qs,{})}export{ca 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.