PageSourceSearch

https://zengora.ai/assets/auth-CrQbDaS1.js

js zengora.ai collected 2026-10-02 01:13:59 UTC 9,002 bytes, 1 lines download raw bytes

1import{o as e}from"./chunk-CMxvf4Kt.js";import{n as t,t as n}from"./jsx-runtime-CWteFE1C.js";import{n as r,t as i}from"./createServerFn-BS4t1TZ1.js";import{t as a}from"./link-CC2PctoZ.js";import{t as o}from"./button-DCsxREno.js";import{Ot as s,St as c,bn as l,gn as u,n as d,pt as f}from"./index-CqQOwD_c.js";import{t as p}from"./input-Dne7DTi8.js";import{t as m}from"./label-B84AZjUr.js";import{a as h,i as g,n as _,r as v,t as y}from"./kayit-dogrulama-CVZN3Gbb.js";var b=e(t()),x=i({method:`POST`}).handler(r(`1f5273bed0501de3ed4513cf57eb327c88bb98a84c1d502c8a2da0682fde6709`)),S=n(),C=s().trim().email({message:`Geçerli bir e-posta giriniz`}).max(255),w=s().min(8,{message:`Şifre en az 8 karakter olmalı`}).max(72,{message:`Şifre en fazla 72 karakter olabilir`}),T=s().trim().min(2).max(120).optional().or(c(``)),E=3e4;function D(){l();let e=f.useSearch(),[t,n]=(0,b.useState)(`signin`),[r,i]=(0,b.useState)(``),[s,c]=(0,b.useState)(``),[D,O]=(0,b.useState)(``),[k,A]=(0,b.useState)(``),[j,M]=(0,b.useState)(``),[N,P]=(0,b.useState)(!1),[F,I]=(0,b.useState)(null),[L,R]=(0,b.useState)(null),z=(0,b.useRef)(!1);function B(){I(null),R(null)}function V(){let t=e.redirect;if(!t||!t.startsWith(`/`)||t.startsWith(`//`))return`/sohbet`;try{let e=new URL(t,window.location.origin);return e.origin===window.location.origin?`${e.pathname}${e.search}${e.hash}`:`/sohbet`}catch{return`/sohbet`}}function H(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.status==`number`?t.status:null,r=[t.name,t.message,t.code].filter(e=>typeof e==`string`).join(` `).toLowerCase();return n===500||n===503||n===504||r.includes(`authretryablefetcherror`)||r.includes(`failed to fetch`)||r.includes(`timeout`)||r.includes(`504`)||r.includes(`503`)||r.includes(`500`)||r.includes(`database error`)||r.includes(`request_timeout`)||r.includes(`unexpected_failure`)||r.includes(`context deadline`)||r.includes(`schema cache`)||r===`{}`}async function U(e,t){let n;try{let r=await Promise.race([u.auth.signInWithPassword({email:e,password:t}),new Promise((e,t)=>{n=window.setTimeout(()=>t(Error(`AUTH_TIMEOUT`)),E)})]);if(r.error)throw r.error;if(!r.data.session)throw Error(`Giriş yanıtında oturum oluşturulamadı.`)}finally{n!==void 0&&window.clearTimeout(n)}}async function W(e){if(e.preventDefault(),!z.current){z.current=!0,B();try{let e=C.safeParse(r);if(!e.success||!y(r))return I(e.success?`Geçerli bir e-posta giriniz`:e.error.issues[0]?.message??`E-posta geçersiz`);if(t===`forgot`){P(!0);let{error:t}=await u.auth.resetPasswordForEmail(e.data,{redirectTo:`${window.location.origin}/reset-password`});if(t)throw t;R(`Şifre sıfırlama bağlantısı e-postanıza gönderildi.`);return}let i=w.safeParse(s);if(!i.success)return I(i.error.issues[0]?.message??`Şifre geçersiz`);if(P(!0),t===`signup`){if(!T.safeParse(D).success||!D.trim())return I(`Ad-Soyad 2-120 karakter olmalı`);if(!_(k))return I(`Geçerli bir T.C. kimlik numarası giriniz (11 hane).`);let t=v(j);if(!t)return I(`Geçerli bir cep telefonu giriniz (örn. 0532 123 45 67).`);let r=await x({data:{email:e.data}});if(!r.ok)return I(r.error);let{error:a}=await u.auth.signUp({email:e.data,password:i.data,options:{emailRedirectTo:`${window.location.origin}/`,data:{full_name:D.trim(),phone:t,tc_no:g(k),signup_ticket:r.ticket}}});if(a)throw Error(h(a));R(`Kaydınız oluşturuldu. Hesabınızı aktifleştirmek için e-postanıza gelen onay bağlantısına tıklayın.`),n(`signin`)}else{try{await U(e.data,i.data)}catch(e){let t=e instanceof Error?e.message.toLowerCase():String(e).toLowerCase();throw t.includes(`auth_timeout`)?Error(`Giriş servisi şu anda yavaş yanıt veriyor. Birkaç deneme yapıldı ancak sonuç alınamadı. Lütfen kısa süre sonra tekrar deneyin.`):t.includes(`giriş servisi`)||t.includes(`yanıt vermiyor`)?e:t.includes(`email not confirmed`)?Error(`E-posta adresiniz henüz doğrulanmamış. Lütfen e-postanıza gelen onay bağlantısına tıklayın.`):H(e)?Error(`Giriş servisi geçici olarak yanıt vermiyor. Lütfen birkaç dakika sonra tekrar deneyin.`):Error(`E-posta veya şifre hatalı.`)}window.location.replace(V())}}catch(e){I(e.message)}finally{z.current=!1,P(!1)}}}return(0,S.jsx)(`div`,{className:`min-h-screen flex flex-col items-center justify-center bg-auth px-4 py-12`,children:(0,S.jsxs)(`div`,{className:`w-full max-w-md`,children:[(0,S.jsxs)(`div`,{className:`flex flex-col items-center gap-3 mb-8`,children:[(0,S.jsx)(`div`,{className:`rounded-2xl bg-white p-4 shadow-lg`,children:(0,S.jsx)(`img`,{src:d,alt:`Zengora`,className:`h-12 w-auto`})}),(0,S.jsx)(`p`,{className:`text-sm text-black/70 text-center`,children:`Profesyonel kullanım için yapay zeka destekli hukuk asistanı`})]}),(0,S.jsxs)(`div`,{className:`rounded-2xl bg-card shadow-2xl p-6 sm:p-8 text-foreground`,children:[(0,S.jsxs)(`div`,{className:`flex gap-2 mb-6 text-sm font-medium`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>{B(),n(`signin`)},className:`flex-1 py-2 rounded-lg transition ${t===`signin`?`bg-[#8b5a2b] text-white`:`text-black hover:bg-black/5`}`,children:`Giriş Yap`}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>{B(),n(`signup`)},className:`flex-1 py-2 rounded-lg transition ${t===`signup`?`bg-[#8b5a2b] text-white`:`text-black hover:bg-black/5`}`,children:`Kayıt Ol`})]}),(0,S.jsxs)(`form`,{onSubmit:W,className:`space-y-4`,children:[t===`signup`&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(m,{htmlFor:`name`,className:`text-black`,children:`Ad Soyad`}),(0,S.jsx)(p,{id:`name`,type:`text`,required:!0,value:D,onChange:e=>O(e.target.value),placeholder:`Av. Adınız Soyadınız`,maxLength:120,className:`bg-white text-black placeholder:text-black/40`})]}),(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(m,{htmlFor:`tcno`,className:`text-black`,children:`T.C. Kimlik No`}),(0,S.jsx)(p,{id:`tcno`,type:`text`,inputMode:`numeric`,required:!0,value:k,onChange:e=>A(g(e.target.value)),placeholder:`11 haneli kimlik numaranız`,maxLength:11,className:`bg-white text-black placeholder:text-black/40`})]}),(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(m,{htmlFor:`phone`,className:`text-black`,children:`Cep Telefonu`}),(0,S.jsx)(p,{id:`phone`,type:`tel`,inputMode:`tel`,required:!0,autoComplete:`tel`,value:j,onChange:e=>M(e.target.value),placeholder:`05XX XXX XX XX`,maxLength:20,className:`bg-white text-black placeholder:text-black/40`})]})]}),(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(m,{htmlFor:`email`,className:`text-black`,children:`E-p
1osta`}),(0,S.jsx)(p,{id:`email`,type:`email`,required:!0,autoComplete:`email`,value:r,onChange:e=>i(e.target.value),placeholder:`[email protected]`,maxLength:255,className:`bg-white text-black placeholder:text-black/40`})]}),t!==`forgot`&&(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsx)(m,{htmlFor:`password`,className:`text-black`,children:`Şifre`}),t===`signin`&&(0,S.jsx)(`button`,{type:`button`,onClick:()=>{B(),n(`forgot`)},className:`text-xs text-black hover:underline`,children:`Şifremi unuttum`})]}),(0,S.jsx)(p,{id:`password`,type:`password`,required:!0,autoComplete:t===`signup`?`new-password`:`current-password`,value:s,onChange:e=>c(e.target.value),placeholder:`En az 8 karakter`,minLength:8,maxLength:72,className:`bg-white text-black placeholder:text-black/40`})]}),F&&(0,S.jsx)(`div`,{className:`text-sm text-red-700 bg-red-50 border border-red-200 rounded-md px-3 py-2`,children:F}),L&&(0,S.jsx)(`div`,{className:`text-sm text-green-800 bg-green-50 border border-green-200 rounded-md px-3 py-2`,children:L}),(0,S.jsx)(o,{type:`submit`,disabled:N,className:`w-full text-white`,style:{background:`#8b5a2b`},children:N?`Lütfen bekleyin…`:t===`signin`?`Giriş Yap`:t===`signup`?`Hesap Oluştur`:`Sıfırlama Bağlantısı Gönder`}),t===`forgot`&&(0,S.jsx)(`button`,{type:`button`,onClick:()=>{B(),n(`signin`)},className:`block w-full text-center text-xs text-black hover:underline pt-1`,children:`← Girişe dön`})]}),t===`signup`&&(0,S.jsx)(`p`,{className:`mt-6 text-xs text-black/60 leading-relaxed`,children:`Kayıt olduktan sonra e-postanıza gelen onay bağlantısına tıklamadan hesabınız aktifleşmez. Yapay zeka çıktıları bilgilendirme niteliğindedir; mesleki sorumluluk avukata aittir.`})]}),(0,S.jsx)(`p`,{className:`mt-6 text-center text-xs font-medium text-black/70`,children:`Yapay zekâ yanıtları bilgilendirme amaçlıdır, hukuki danışmanlık yerine geçmez.`}),(0,S.jsxs)(`p`,{className:`mt-2 text-center text-xs text-black/50`,children:[(0,S.jsx)(a,{to:`/gizlilik`,className:`hover:underline`,children:`Gizlilik Politikası`}),` · `,(0,S.jsx)(a,{to:`/hesap-silme`,className:`hover:underline`,children:`Hesap Silme`})]}),(0,S.jsxs)(`p`,{className:`text-center text-xs text-black/50 mt-3`,children:[`© `,new Date().getFullYear(),` Zengora — Tüm hakları saklıdır.`]})]})})}export{D as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.