PageSourceSearch

https://codir.pro/assets/SignIn-BueYrEJ0.js

js codir.pro collected 2026-09-24 15:10:45 UTC 2,441 bytes, 1 lines download raw bytes

1import{u as k,w as N,a as S,r as o,j as e,N as C,v as f,L as E,b as w,k as A}from"./index-Dsd8GAzx.js";import{A as P,a as x}from"./AuthInput-vtaISNkD.js";import"./eye-off-Ce5pi8FB.js";function R(){const _=k(),{isAuthenticated:b,isLoadingAuth:y}=N(),{t}=S(),[n,v]=o.useState(""),[l,j]=o.useState(""),[r,c]=o.useState(!1),[u,d]=o.useState("");if(!y&&b)return e.jsx(C,{to:"/app",replace:!0});const L=async s=>{var h;s.preventDefault(),d(""),c(!0);try{await w.auth.loginViaEmailPassword(n.trim().toLowerCase(),l),A("LOGIN",{user_email:n.trim().toLowerCase()});const a=new URLSearchParams(window.location.search),p=a.get("checkout"),m=a.get("period");if(p&&m){const g=a.get("ref")||localStorage.getItem("affiliate_ref")||void 0;try{const i=await w.functions.invoke("createStripeCheckout",{serviceKey:p,billingPeriod:m,...g?{affiliateCode:g}:{}});if((h=i.data)!=null&&h.sessionUrl){window.location.href=i.data.sessionUrl;return}}catch(i){console.error("Post-login checkout failed:",i)}}_("/app",{replace:!0}),window.location.reload()}catch(a){d((a==null?void 0:a.message)||t("auth_signin_error"))}finally{c(!1)}};return e.jsx(P,{title:t("auth_signin_title"),subtitle:t("auth_signin_subtitle"),footer:e.jsxs(e.Fragment,{children:[t("auth_signin_no_account")," ",e.jsx(f,{to:`/signup${typeof window<"u"?window.location.search:""}`,className:"text-primary hover:text-primary/80 font-medium",children:t("auth_signin_create_link")})]}),children:e.jsxs("form",{onSubmit:L,className:"space-y-4",children:[e.jsx(x,{label:t("auth_email_label"),type:"email",value:n,onChange:s=>v(s.target.value),placeholder:t("auth_email_placeholder"),autoComplete:"email",required:!0,disabled:r}),e.jsx(x,{label:t("auth_password_label"),type:"password",value:l,onChange:s=>j(s.target.value),placeholder:t("auth_password_placeholder_current"),autoComplete:"current-password",required:!0,disabled:r}),e.jsx("div",{className:"flex justify-end -mt-2",children:e.jsx(f,{to:"/forgot-password",className:"text-xs text-white/60 hover:text-white/90 transition",children:t("auth_signin_forgot")})}),u&&e.jsx("p",{className:"text-sm text-red-400",children:u}),e.jsxs("button",{type:"submit",disabled:r,className:"w-full py-3 bg-primary hover:bg-primary/90 text-primary-foreground font-bold rounded-xl transition disabled:opacity-50 flex items-center justify-center gap-2",children:[r&&e.jsx(E,{className:"w-4 h-4 animate-spin"}),t("auth_signin_button")]})]})})}export{R 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.