1import{r as l,o as A,j as t,d as k,H as z,a as L}from"../app.js";import{a as E}from"./userRecord.js";import{S as i}from"./sentry.js";import{u as y,g as n}from"./profileHelpers.js";import{S as Z}from"./AuthLayout.js";function m(){const d=n("site"),p=n("p"),r=n("sourceId"),o=n("userId");return!!(d&&p&&r&&o)}function T(){const d=n("site"),p=n("p"),r=n("sourceId"),o=n("userId");return`https://aznudelive.com/${d}?targetDomain=aznudelive.com&p=${p}&sourceId=${r}&userId=${o}`}function f(){return{site:n("site"),p:n("p"),sourceId:n("sourceId"),userId:n("userId")}}const _=[{icon:"chat.svg",label:"Chat with models"},{icon:"bookmark.svg",label:"Save favorite models & content"},{icon:"gift.svg",label:"Take part in giveaways"},{icon:"heart.svg",label:"Have fun in private shows"},{icon:"plug.svg",label:"Play with interactive toys"}];function P(){const[d,p]=l.useState(!0),[r,o]=l.useState(!1),[h,x]=l.useState(""),[b,w]=l.useState(!1),[v,N]=l.useState(""),g=varValues.cdn||"cdn.aznude.com",I=varValues.gender||"f",c=l.useCallback(a=>x(a),[]);l.useEffect(()=>{const a=A(L,async s=>{if(!m()){window.location.href="/";return}if(!s&&m()){try{i.setUser(null)}catch{}window.location.href="/";return}if(!s&&!m()){try{i.setUser(null)}catch{}window.location.href=T();return}try{const e=await s.getIdTokenResult(!0);try{i.setUser({id:s.uid||void 0,email:s.email||void 0}),i.setContext("firebaseClaims",e?.claims||{})}catch{}}catch(e){try{i.captureException(e,{tags:{area:"auth",op:"getIdTokenResult"}})}catch{}}try{w(!!await E(k,s.uid,"hasStripchatAccount"))}catch(e){try{i.captureException(e,{tags:{area:"database",op:"getUser"}})}catch{}}try{const e=await z(s);N(e)}catch(e){try{i.captureException(e,{tags:{area:"auth",op:"getIdToken"}})}catch{}}p(!1)});return()=>a()},[]);const S=async()=>{o(!0),c("");const a=f();try{const e=await(await fetch(y.signupOnAZNudeLive,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:v,site:a.site,p:a.p,sourceId:a.sourceId,userId:a.userId})})).json();if(e.status==="ok")window.location.href=e.loginUrl;else{try{i.captureException(new Error("AZNudeLive signup failed"),{tags:{area:"aznudelive",op:"signup"},extra:{data:e}})}catch{}c("Problem signing you up in AZNudeLive.")}}catch(s){try{i.captureException(s,{tags:{area:"aznudelive",op:"signup"}})}catch{}c("Problem signing you up in AZNudeLive.")}finally{o(!1)}},j=async()=>{o(!0),c("");const a=f();try{const e=await(await fetch(y.signinToAZNudeLive,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:v,site:a.site,p:a.p,sourceId:a.sourceId,userId:a.userId})})).json();if(e.status==="ok")window.location.href=e.loginUrl;else if(e.error)if(e.loginUrl)window.location.href=e.loginUrl;else{try{i.captureException(new Error("AZNudeLive signin failed with error flag"),{tags:{area:"aznudelive",op:"signin"},extra:{data:e}})}catch{}c("Problem signing you in to AZNudeLive.")}else{try{i.captureException(new Error("AZNudeLive signin unknown failure"),{tags:{area:"aznudelive",op:"signin"},extra:{data:e}})}catch{}c("Problem signing you in to AZNudeLive.")}}catch(s){try{i.captureException(s,{tags:{area:"aznudelive",op:"signin"}})}catch{}c("Problem signing you in to AZNudeLive.")}finally{o(!1)}};return d?t.jsx("div",{className:"max-w-[1400px] mx-auto px-[15px] py-10",children:t.jsx(Z,{})}):t.jsxs("div",{className:"max-w-[1100px] mx-auto px-[15px] py-6",children:[h&&t.jsxs("div",{className:"alert-bar mb-4",children:[t.jsx("div",{className:"flex-1",children:h}),t.jsx("button",{onClick:()=>c(""),className:"alert-bar-close","aria-label":"Dismiss",children:"Ã"})]}),t.jsxs("div",{className:"azlive-hero",children:[t.jsxs("div",{className:"azlive-details",children:[t.jsx("img",{src:`https://${g}/images/aznudelive/aznudelive_logo.png`,className:"azlive-logo",alt:"AZNudeLive Logo"}),t.jsx("ul",{className:"azlive-list",children:_.map((a,s)=>t.jsxs("li",{className:"azlive-list-item",children:[t.jsx("img",{src:`https://${g}/images/aznudelive/${a.icon}`,alt:""}),t.jsx("span",{children:a.label})]},s))}),b?t.jsx("button",{type:"button",className:"btn-primary-tw btn-primary-live",onClick:j,disabled:r,children:r?"Signing in...":"Sign in to AZNudeLive"}):t.jsx("button",{type:"button",className:"btn-primary-tw btn-primary-live",onClick:S,disabled:r,children:r?"Signing up...":"Sign up on AZNudeLive"})]}),t.jsx("div",{className:"azlive-hero-img",style:{backgroundImage:`url(https://${g}/images/aznudelive/aznudelive-${I}.jpg)`},children:t.jsx("div",{className:"azlive-img-overlay"})})]})]})}function V(){return t.jsx(P,{})}export{V 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.