1import{u as h,r as c,j as e,I as o,F as q,b7 as v,B as w}from"./elements-DVh2jUIM.js";import{R as A}from"./recaptcha-wrapper-Cufgftbz.js";import{u as X,C as y}from"./index.esm-BsOhZrKM.js";import{C}from"./CustomContent-qUKl3gpM.js";import{x as b,R,k as E,ab as F,ac as p,L as I}from"./index-DeQvL4I7.js";import{u as L}from"./useAuthorization-D7B2eQha.js";import{u as k}from"./useBanner-CJNHVgHN.js";import{u as H}from"./useCustomContent-BqBLnYCa.js";import{u as P}from"./useRedesign-DVyq07A4.js";import"./index-DWdRGcKw.js";import"./grids-DXrfAsUA.js";import"./startOfDay-AazlW55I.js";const M={title:"Welcome, Neighbor!",showPropertySelector:!1};function O(){const{t:a}=h(),{isLoggedIn:l}=L(),n=k(),i=H("SignUp","Home_v2"),t=P(),r=b();return c.useEffect(()=>{t&&r("/public?modal=requestAccount")},[t,r]),l?e.jsx(R,{to:"/dashboard"}):e.jsxs("div",{className:"px-horizontal-layout flex flex-wrap-reverse xl:flex-nowrap justify-center gap-10 py-8 bg-base-fill rounded-xl",children:[e.jsxs("div",{className:"flex flex-col w-full xl:max-w-[50%]",children:[i&&e.jsx("div",{className:"lg:mb-[2vw] mb-12 w-full",children:e.jsx(C,{content:i})}),e.jsx("h1",{className:"font-bold text-2xl lg:mb-[1vw] mb-6",children:a("auth.login.requestAccount")}),e.jsx(T,{})]}),e.jsx("div",{className:"hidden flex-col md:flex",children:n?e.jsx("img",{src:n,width:548,className:"rounded-xl max-w-full max-h-[548px]",alt:"banner"}):e.jsx("div",{className:"min-h-[548px] max-h-[548px] bg-gray-100 w-[30vw] max-w-[600px] mb-20 rounded-xl"})})]})}function T(){var u,d,g,x;const{t:a}=h(),l=b(),{handleSubmit:n,control:i,formState:t,register:r}=X(),[f,m]=c.useState(!1),[N,j]=c.useState(!1),S=n(async s=>{j(!0),m(!0),await E.registerAccount({propertyAddress:s.address,name:s.name,emailAddress:s.email,phone:s.phoneNumber,account:s.accountNumber,associationName:s.associationName}),m(!1),l("/login")});return e.jsxs("form",{id:"request-account-form",noValidate:!0,onSubmit:S,className:"space-y-16",children:[e.jsxs("div",{className:"flex flex-col gap-7",children:[e.jsx(o,{...r("email",{required:!0,pattern:/^[^@ ]+@[^@ ]+\.[^@ .]{2,}$/}),errorSpacing:!1,type:"text",label:a("auth.login.email").toString(),className:"lg:w-11/12",placeholder:"[email protected]",error:t.errors.email&&a("auth.login.invalidEmail").toString(),qaAttribute:"email"}),e.jsx(o,{...r("name",{required:!0}),errorSpacing:!1,type:"text",label:a("auth.login.name").toString(),className:"lg:w-11/12",placeholder:"Neil Armstrong",error:t.errors.name&&a("auth.login.nameRequired").toString(),qaAttribute:"name"}),e.jsx(o,{...r("phoneNumber",{required:a("auth.login.phoneRequired").toString(),pattern:{value:/^\d{3}-?\d{3}-?\d{4}$/,message:a("auth.login.invalidPhone").toString()}}),errorSpacing:!1,type:"tel",label:a("auth.login.phone").toString(),className:"lg:w-11/12",placeholder:"XXX-XXX-XXXX",error:(d=(u=t.errors.phoneNumber)==null?void 0:u.message)==null?void 0:d.toString(),qaAttribute:"phone-number"}),e.jsx(o,{...r("address",{required:!0}),errorSpacing:!1,type:"text",label:a("auth.login.address").toString(),className:"lg:w-11/12",error:t.errors.address&&a("auth.login.addressRequired").toString(),qaAttribute:"address"}),e.jsx(o,{...r("associationName",{required:!0}),errorSpacing:!1,type:"text",label:a("auth.login.associationName").toString(),className:"lg:w-11/12",error:t.errors.associationName&&a("auth.login.associationNameRequired").toString(),qaAttribute:"association-name"}),e.jsx(o,{...r("accountNumber",{minLength:{value:6,message:"Account Number must be at least 6 characters"}}),errorSpacing:!1,type:"text",label:a("auth.requestAccount.accountNumber").toString(),className:"lg:w-11/12",placeholder:"XXXXXXXXX",error:t.errors.accountNumber&&((x=(g=t.errors.accountNumber)==null?void 0:g.message)==null?void 0:x.toString()),qaAttribute:"account-number"}),F&&p&&e.jsx(y,{name:"captcha",control:i,defaultValue:"",render:({field:s})=>e.jsxs("div",{children:[e.jsx(A,{...s,sitekey:p,className:"transform scale-2 origin-top-left","data-qa":"captcha"}),!s.value&&N&&e.jsxs("div",{className:"text-error",children:[e.jsx(q,{icon:v,className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"absolute mt-[.4rem] text-xs inline-flex items-center",children:a("auth.login.captcha")})]})]}),rules:{required:!0}})]}),e.jsxs("div",{className:"flex flex-col justify-center items-center",children:[e.jsx(w,{type:"submit",className:"mb-5 w-48","data-qa":"request-account-btn",disabled:f,children:a("auth.login.request")}),e.jsxs("p",{children:[a("auth.login.alreadyHave")," ",e.jsx(I,{to:"/login",className:"text-base-link hover:underline","data-qa":"log-in-link",children:a("auth.login.logIn")})]})]})]})}export{O as Component,M as handle};
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.