1import{L as c}from"./module-DPAfMHe1.js";import{t as f}from"./events-BphRmePB.js";function m(e){return/captcha/i.test(e)?"captcha":/rate[\s_-]?limit|too many/i.test(e)?"rate_limit":"unknown"}async function y({supabase:e,turnstileToken:o,source:i}){var s,a;const{data:t}=await e.auth.getClaims(),n=t==null?void 0:t.claims;if(n!=null&&n.sub)return n.is_anonymous===!0?{ok:!0,userId:n.sub,created:!1}:{ok:!1,reason:"real_user_signed_in"};try{const r=o?await e.auth.signInAnonymously({options:{captchaToken:o}}):await e.auth.signInAnonymously();if(r.error)return{ok:!1,reason:m(r.error.message??""),message:r.error.message};const u=(a=(s=r.data)==null?void 0:s.user)==null?void 0:a.id;return u?(typeof window<"u"&&f(c,{source:i}),{ok:!0,userId:u,created:!0}):{ok:!1,reason:"unknown",message:"no_user_returned"}}catch(r){return{ok:!1,reason:"unknown",message:r instanceof Error?r.message:String(r)}}}export{y as e};
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.