PageSourceSearch

https://app.babele.co/assets/_unauth.signup-oJSKpaWB.js

js babele.co collected 2026-09-25 14:55:43 UTC 8,914 bytes, 2 lines download raw bytes

1import{r as N,j as e}from"./vendor-react-DRS4EotE.js";import{L as T}from"./link-jiSxkEX1.js";import{b as C,f as y,h as A,i as m,j as F,T as g,B as L,m as I,q as P,x as E,v as M,s as q,w as R,y as V}from"./index-CGngwFja.js";import{u as z}from"./useAuth-B6fH9ZHX.js";import{u as G,z as Q}from"./validator-DbwaMwSQ.js";import{u as $}from"./useMutation-DaKmpcwJ.js";import{R as O}from"./recaptcha-wrapper-5Tzhr1aN.js";import{g as U}from"./errors-CKm5LOK0.js";import{I as j}from"./index-DLmq_F2n.js";import{C as W}from"./index-BJqUCNEU.js";import{I as H}from"./index-BWX2cggE.js";import{F as J,E as K}from"./index-DMUZCHfS.js";import{S as X}from"./index-Brv-uVBa.js";import{u as Y}from"./authValidators-DrDjC0gD.js";import{g as Z}from"./timezone-Wnu7SVUe.js";import{G as D,M as ee,S as ae}from"./SamlSsoLoginButton-CBU-aKAB.js";import"./vendor-recharts-BsPIiKg0.js";import"./vendor-doc-viewer-BGof5Md4.js";import"./common-DQN8W4b_.js";import"./input-DKOmVZW5.js";import"./label-Dx7hDX3B.js";import"./use-default-value--cNry5lx.js";import"./use-resolve-button-type-B-_pf3C9.js";import"./popover-Coe3P1Fj.js";import"./floating-ui.react-dom-B37uq3Ad.js";import"./utils-CFR6EyPO.js";import"./file-Dp286Jhe.js";import"./file-5ZbxfUnk.js";import"./listbox-CXBWRO7z.js";import"./use-text-value-BpHgl6Qh.js";import"./Microsoft-kuuxEITI.js";const se=({termsAndConditionLink:n,communityId:t,redirectAfterFirstLogin:c=null,circleId:x,tags:h})=>{const[o,b]=N.useState(!1),[_,v]=N.useState(!1),f=N.useRef(null),S=C(),B=n??"https://babele.co/terms-of-use/",p=$({mutationFn:y,onSuccess:a=>{a!=null&&a.isActive?S({to:"/login",search:{redirect:null}}):b(!0)},onError:()=>{var a;(a=f.current)==null||a.reset(),i.setFieldValue("recaptchaToken","")},onSettled:()=>{v(!0)}}),i=G({defaultValues:{email:"",firstName:"",lastName:"",password:"",confirmPassword:"",language:A(),acceptTerms:!1,recaptchaToken:""},validatorAdapter:Q(),onSubmit:a=>{p.mutate({mail:a.value.email,firstName:a.value.firstName,lastName:a.value.lastName,password:a.value.password,recaptchaResponse:a.value.recaptchaToken,acceptedTermsAndConditions:a.value.acceptTerms,primaryCommunityId:t,redirectAfterFirstLogin:c,language:a.value.language,circleId:x??void 0,tags:h??void 0,timezone:Z()})}}),u=Y(),k=p.error?U(p.error,m._({id:"error_account_creation"})):"",w=F(),d={email:u.email(),firstName:u.firstName(),lastName:u.lastName(),password:u.signupPassword(),confirmPassword:u.confirmPassword(()=>i.state.values.password),language:u.language(),acceptTerms:u.acceptTerms(),recaptchaToken:u.recaptcha()};return o?e.jsx("div",{className:"text-center",children:e.jsx("h3",{className:"mb-2 text-lg font-semibold",children:e.jsx(g,{id:"signup_success_message"})})}):e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:a=>{a.preventDefault(),a.stopPropagation(),i.handleSubmit()},children:[e.jsx(i.Field,{name:"email",validators:d.email,children:a=>{var s,r;return e.jsx(j,{name:"email",label:m._({id:"email_label"}),value:a.state.value,inputClassName:"w-full",onChange:l=>a.handleChange(l),onBlur:a.handleBlur,error:(r=(s=a.state.meta.errors)==null?void 0:s[0])==null?void 0:r.toString(),required:!0})}}),e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row",children:[e.jsx(i.Field,{name:"firstName",validators:d.firstName,children:a=>{var s,r;return e.jsx(j,{name:"firstName",label:m._({id:"first_name_label"}),value:a.state.value,onChange:l=>a.handleChange(l),onBlur:a.handleBlur,error:(r=(s=a.state.meta.errors)==null?void 0:s[0])==null?void 0:r.toString(),required:!0,className:"flex-1",inputClassName:"w-full"})}}),e.jsx(i.Field,{name:"lastName",validators:d.lastName,children:a=>{var s,r;return e.jsx(j,{name:"lastName",label:m._({id:"last_name_label"}),value:a.state.value,onChange:l=>a.handleChange(l),onBlur:a.handleBlur,error:(r=(s=a.state.meta.errors)==null?void 0:s[0])==null?void 0:r.toString(),required:!0,className:"flex-1",inputClassName:"w-full"})}})]}),e.jsx(i.Field,{name:"language",validators:d.language,children:a=>{var s,r;return e.jsx(X,{label:m._({id:"preferred_language"}),placeholder:m._({id:"select_language_placeholder"}),options:w,value:w.find(({id:l})=>l===a.state.value)||null,onSelect:l=>a.handleChange(l.id),onBlur:a.handleBlur,error:(r=(s=a.state.meta.errors)==null?void 0:s[0])==null?void 0:r.toString(),required:!0})}}),e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row",children:[e.jsx(i.Field,{name:"password",validators:d.password,children:a=>{var s,r;return e.jsx(j,{name:"password",label:m._({id:"password_label"}),value:a.state.value,onChange:l=>{a.handleChange(l)},onBlur:a.handleBlur,error:(r=(s=a.state.meta.errors)==null?void 0:s[0])==null?void 0:r.toString(),required:!0,type:"password",className:"flex-1",inputClassName:"w-full"})}}),e.jsx(i.Field,{name:"confirmPassword",validators:d.confirmPassword,children:a=>{var s,r;return e.jsx(j,{name:"confirmPassword",label:m._({id:"confirm_password_label"}),value:a.state.value,onChange:l=>a.handleChange(l),onBlur:a.handleBlur,error:(r=(s=a.state.meta.errors)==null?void 0:s[0])==null?void 0:r.toString(),required:!0,type:"password",className:"flex-1",inputClassName:"w-full"})}})]}),e.jsx(i.Field,{name:"acceptTerms",validators:d.acceptTerms,children:a=>{var s,r;return e.jsx(W,{checked:a.state.value,onChange:l=>a.handleChange(l),onBlur:a.handleBlur,error:(r=(s=a.state.meta.errors)==null?void 0:s[0])==null?void 0:r.toString(),label:e.jsxs(e.Fragment,{children:[m._({id:"accept_terms_prefix"})," ",e.jsx("a",{href:B,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",onClick:l=>l.stopPropagation(),children:m._({id:"terms_conditions_link"})})]}),className:"mt-4"})}}),e.jsx(i.Field,{name:"recaptchaToken",validators:d.recaptchaToken,children:a=>e.jsxs(J,{className:"flex-col",children:[e.jsx(O,{ref:f,sitekey:"6Lf9yNIaAAAAAGhTx9B4poszFpwcPApmQrT_ngxU",onChange:s=>a.handleChange(s||""),style:{display:"flex",justifyContent:"center"},onBlur:a.handleBlur}),e.jsx(K,{children:a.state.meta.errors.join(", ")})]})}),_&&p.isError&&e.jsx(H,{type:"error",icon:"warning",onClose:()=>v(!1),text:k}),e.jsx(L,{small:!0,type:"submit",disabled:p.isPending||p.isSuccess,children:e.jsx(g,{id:"sign_up"})})]})},re=({communityId:n,circleId:t,tags:c})=>{const{isAuthenticated:x}=z(),h=C(),{data:o}=I({...P(n||void 0),enabled:!!n});if(N.useEffect(()=>{if(!x)return;if(!n){h({to:"/"});return}const f=()=>h({to:"/community/$communityId",params:{communityId:String(n)}});t?E({communityId:n,circleId:t,tags:c}).catch(()=>{}).finally(f):f()},[x,h,n,t,c]),!n)return x?null:e.jsx("div",{className:"flex min-h-screen w-full flex-col items-center justify-center p-8",children:e.jsx("p",{className:"text-center text-sm text-gray",children:e.jsx(g,{id:"invite_link_required"})})});const b=(o==null?void 0:o.logoImage)||"/babele-logo.webp",_=(o==null?void 0:o.signupImage)||(o==null?void 0:o.mainImage)||"/login.webp",v=(o==null?void 0:o.termsAndConditionLink)||"https://babele.co/terms-of-use/";return e.jsxs("div",{className:"flex min-h-screen w-full",children:[e.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center p-8 lg:w-1/2",children:[e.jsx(M,{src:b,alt:"Logo",className:"mb-3 h-8"}),e.jsxs("div",{className:"w-full max-w-md",children:[e.jsx("h1",{className:"mb-8 text-center text-3xl font-semibold",children:e.jsx(g,{id:"create_your_account"})}),e.jsx("p",{className:"mb-6 text-center text-sm text-gray",children:e.jsx(g,{id:"corporate_email_recommendation"})}),e.jsxs("div",{className:"mb-6 flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:justify-center",children:[e.jsx(D,{targetCommunityId:n,targetCircleId:t,targetTags:c}),e.jsx(ee,{targetCommunityId:n,targetCircleId:t,targetTags:c})]}),q&&e.jsx(ae,{targetCommunityId:n??void 0,targetCircleId:t,targetTags:c})]}),e.jsxs("div",{className:"relative mb-6",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-light"})}),e.jsx("div",{className:"relative flex justify-center text-sm",children:e.jsx("span",{className:"bg-white px-2 text-gray",children:e.jsx(g,{id:"or_do_via_email"})})})]}),e.jsx(se,{termsAndConditionLink:v,communityId:n,circleId:t,tags:c}),e.jsxs("p",{className:"mt-6 text-center text-sm text-pearl-dark",children:[e.jsx(g,{id:"signup_already_have_account"})," ",e.jsx(T,{to:"/login",search:{redirect:`/community/${n}`,targetCommunityId:n,targetCircleId:t??null,targetTags:c??null},className:"text-blue hover:underline",children:e.jsx(g,{id:"signup_log_in_to_join"})})]})]})]}),e.jsx("div",{className:"hidden bg-cover bg-center bg-no-repeat lg:block lg:w-1/2",style:{backgroundImage:`url(${R(_)})`}})]})},Ee=function(){const t=V.useSearch();return e.jsx(re,{communityId:t.to??null,circleId:t==null?void 0:t.circleId,tags:t==null?void 0:t.tags})};export{Ee as component};
2//# sourceMappingURL=_unauth.signup-oJSKpaWB.js.map

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.