1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6233],{83999:function(e,s){"use strict";var a=/^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;s.validate=function(e){if(!e||e.length>254||!a.test(e))return!1;var s=e.split("@");return!(s[0].length>64||s[1].split(".").some(function(e){return e.length>63}))}},55278:function(e,s,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/join",function(){return a(22984)}])},10708:function(e,s,a){"use strict";var t=a(85893);a(67294);let r=e=>{let{error:s,showPasswordError:a=!1}=e;return!s||!a&&"code"in s&&("auth/user-not-found"===s.code||"auth/wrong-password"===s.code)?null:(0,t.jsx)("div",{className:"is-size-6 py-5",children:(0,t.jsx)("div",{className:"notification auth-message is-warning is-light",children:"code"in s&&("auth/user-not-found"===s.code||"auth/wrong-password"===s.code)?"Sorry, you entered an incorrect password.":s.message})})};s.Z=r},93039:function(e,s,a){"use strict";var t=a(85893),r=a(55317),i=a(8849),n=a.n(i),l=a(45697),c=a.n(l);let o=e=>{let{type:s="warning",message:a}=e;return(0,t.jsxs)("div",{className:"form-error",children:[(0,t.jsx)("span",{className:"warning"===s?"has-text-warning":"",children:(0,t.jsx)(n(),{path:r.jZI,size:1.25})}),(0,t.jsx)("p",{className:"help",children:a})]})};o.propTypes={message:c().string.isRequired,type:c().string},o.defaultProps={type:"warning"},s.Z=o},14847:function(e,s,a){"use strict";var t=a(85893),r=a(67294),i=a(55317),n=a(8849),l=a.n(n);let c=e=>
1{let{passwordInput:s,label:a=(0,t.jsxs)(t.Fragment,{children:["Enter your password ",(0,t.jsx)("span",{children:"*"})]}),bindField:n="bind",showHelp:c=!1}=e,[o,d]=(0,r.useState)("password"),u=()=>{"password"===o?d("text"):d("password")};return(0,t.jsxs)("div",{className:"field",children:[(0,t.jsx)("label",{id:"profile-email-password-label",className:"label",htmlFor:"profile-email-password",children:a}),c&&(0,t.jsx)("p",{className:"help",children:"Ensure your password has a minimum of nine characters and includes numbers, letters and symbols."}),(0,t.jsxs)("div",{className:"field has-addons",children:[(0,t.jsx)("div",{className:"control is-expanded",children:(0,t.jsx)("input",{id:"profile-email-password",className:"input is-medium mb-4",...s[n],type:o,"aria-labelledby":"profile-email-password-label",tabIndex:0,autoComplete:"new-password"})}),(0,t.jsx)("div",{className:"control",children:(0,t.jsx)("button",{type:"button",className:"showPassword button is-medium",onClick:u,children:(0,t.jsx)("span",{className:"icon",children:(0,t.jsx)(l(),{path:"password"===o?i.rgx:i.DqW,size:1})})})})]})]})};s.Z=c},90274:function(e,s,a){"use strict";var t=a(83999),r=a(67294);let i=e=>{let[s,a]=(0,r.useState)(e),[i,n]=(0,r.useState)(!1),[l,c]=(0,r.useState)(!1),[o,d]=(0,r.useState)(!1),u=e=>{t.validate(e)?n(!0):n(!1)},h=(0,r.useCallback)(e=>{""!==e?c(!0):c(!1),a(e),u(e)},[]),m=(0,r.useCallback)(()=>{a(""),n(!1),c(!1),d(!1)},[]);return{value:s,setValue:a,isValid:i,isDirty:l,setIsDirty:c,showError:o,setShowError:d,handleChange:h,setIsValid:n,reset:m,bind:{value:s,onChange:e=>h(e.target.value),onBlur:()=>{!i&&l?d(!0):d(!1)}}}};s.Z=i},31513:function(e,s,a){"use strict";var t=a(67294);let r=e=>{let s=e=>!(e.length<8),[a,r]=(0,t.useState)(e),[i,n]=(0,t.useState)(e),[l,c]=(0,t.useState)(s(e)),[o,d]=(0,t.useState)(!0),[u,h]=(0,t.useState)(!1),m=()=>{r(""),n(""),c(!1)},p={value:a,onChange:e=>{""!==e.target.value?h(!0):h(!1),r(e.target.value),c(s(e.target.value)),e.target.value===i?d(!0):d(!1)}};return{value1:a,setValue1:r,value2:i,setValue2:n,valid:l,setValid:c,isDirty:u,setIsDirty:h,matches:o,reset:m,bind1:p,bind2:{value:i,onChange:e=>{""!==e.target.value?h(!0):h(!1),n(e.target.value),e.target.value===a?d(!0):d(!1)}},bind:p}};s.Z=r},85007:function(e,s,a){"use strict";var t=a(39828),r=a(67294),i=a(74630);let n=e=>{let s=0,[a,n]=(0,r.useState)(e||""),[l,c]=(0,r.useState)(!1),[o,d]=(0,r.useState)(!!e),[u,h]=(0,r.useState)(!!e),[m,p]=(0,r.useState)(!1),[x,f]=(0,r.useState)(!1),[j,g]=(0,r.useState)(!1),w=e=>!(e.length<4)&&!(e.length>15)&&!!e.match(/^\d*[a-z\-_][a-z\-_\d]*$/i),b=async e=>{let s=await (0,t.PL)((0,t.IO)((0,t.hJ)(i.db,"users"),(0,t.ar)("usernameLowercase","==",e.toLowerCase()),(0,t.b9)(1))).then(e=>!e.empty).catch(()=>!1);return s};(0,r.useEffect)(()=>{o&&u?f(!1):f(!0)},[o,u]);let v=a=>{s&&clearTimeout(s),j||g(!0);let t=a.currentTarget.value,r=w(t);n(t),d(r),""!==t?p(!0):p(!1),e===t?h(!0):r&&(s=setTimeout(async()=>{c(!0),await b(t)?h(!1):h(!0),c(!1)},500))},N=e=>{n(e),d(w(e))};return{username:a,setUsername:n,presetUsername:N,validateUsername:w,isChecking:l,isAvailable:u,isValid:o,isDirty:m,setIsDirty:p,showError:x,reset:()=>n(""),touched:j,bind:{value:a,onChange:v}}};s.Z=n},22984:function(e,s,a){"use strict";a.r(s),a.d(s,{default:function(){return L}});var t=a(85893),r=a(55317),i=a(8849),n=a.n(i),l=a(5152),c=a.n(l),o=a(9008),d=a.n(o),u=a(41664),h=a.n(u),m=a(11163),p=a.n(m),x=a(67294),f=a(39828),j=a(91259),g=a(74630),w=a(69560),b=a(94454),v=a(18990);let N=async e=>(0,f.PL)((0,f.IO)((0,f.hJ)(g.db,"users"),(0,f.ar)("usernameLowercase","==",e.toLowerCase()),(0,f.b9)(1))).then(e=>!e.empty).catch(()=>!1),y=async(e,s,a)=>{if(!e)return new w.lD(new w.l4("shiftms/missing-email","Please enter an email address."));if(!s)return new w.lD(new w.l4("shiftms/missing-password","Please enter a password."));if(!a)return new w.lD(new w.l4("shiftms/missing-username","Please enter a username."));if(await N(a))return new w.lD(new w.l4("shiftms/existing-user","Sorry, a member with this username already exists."));let t=(0,j.v0)();return(0,j.Xb)(t,e,s).then(async s=>((0,v.Z)({uid:s.user.uid,eventType:"USER:REGISTER",eventSource:"USER",eventSourceId:s.user.uid,meta:{method:"email"},email:e,platform:"web"}),b.B({action:"user.register",params:{method:"email",uid:s.user.uid}}),(0,j.w$)(s.user),S(s,a))).catch(e=>(b.B({action:"user.register.error",params:{method:"email",errorCode:e.code,errorMessage:e.message}}),new w.lD(e)))},S=async(e,s)=>(0,f.pl)((0,f.JU)(g.db,"settings",e.user.uid),{emailOptIn:!0,setPassword:!0,needsOnboarding:!0,needsTour:!0},{merge:!0}).then(()=>(0,f.pl)((0,f.JU)(g.db,"users",e.user.uid),{isActivated:!0,isDeleted:!1,created:(0,f.Bt)(),username:s,usernameLowercase:s.toLowerCase()},{merge:!0})).then(()=>new w.iv).catch(e=>new w.lD(e));var Z=a(93039),E=a(44856),C=a(90274),I=a(31513),k=a(85007),z=a(83759),D=a(10708),_=a(14847);let P=c()(()=>a.e(9440).then(a.bind(a,24180)),{loadableGenerated:{webpack:()=>[24180]},ssr:!1}),A=()=>{let{isLoggedIn:e}=(0,z.a)(),[s,a]=(0,x.useState)(!1),[i,l]=(0,x.useState)(null),[c,o]=(0,x.useState)(!1),{value:u,bind:m,isDirty:f,setIsDirty:j,showError:g,isValid:b,setIsValid:v,setShowError:N}=(0,C.Z)(""),{username:S,isAvailable:A,isChecking:L,isValid:T,isDirty:O,setIsDirty:F,showError:J,bind:R}=(0,k.Z)(""),V=(0,I.Z)(""),[$,B]=(0,x.useState)(!1),[U,X]=(0,x.useState)(!1),[q,G]=(0,x.useState)(!1);(0,x.useEffect)(()=>
1{if(!$)return B(b&&T&&V.valid)},[b,$,V.valid,T]);let M=async e=>{if(e.preventDefault(),j(!0),V.setIsDirty(!0),F(!0),G(!U),T&&A&&b&&c&&U){a(!0);let e=await y(u,V.value1,S);e.success?p().push("/welcome"):(a(!1),v(!1),N(!0),l(e.error))}else l(new w.l4("shiftms/join-errors","Please correct the form errors"))},W=e=>{e>1?(o(!0),V.setValid(!0)):(o(!1),V.setValid(!1))},H=()=>{X(!U)};return(e&&!s&&p().push("/home"),s)?(0,t.jsx)(E.Z,{}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(d(),{children:[(0,t.jsx)("title",{children:"Join Shift.ms"}),(0,t.jsx)("link",{rel:"canonical",href:"".concat("https://shift.ms","/join")})]}),(0,t.jsx)("div",{className:"join-page",children:(0,t.jsx)("div",{className:"container is-narrow",children:(0,t.jsx)("div",{className:"join-box",children:(0,t.jsxs)("div",{className:"content",children:[(0,t.jsxs)("div",{className:"join-form is-clearfix",children:[(0,t.jsx)("h1",{className:"is-size-4",children:"Join Shift.ms to get support and advice from others living with MS. It's independent and it's free."}),(0,t.jsxs)("p",{className:"is-font-brand is-size-5",children:["Please read our"," ",(0,t.jsx)("a",{href:"https://shift.ms/terms-of-use",rel:"noreferrer",target:"_blank",children:"terms of use"})," ","and"," ",(0,t.jsx)("a",{href:"https://shift.ms/privacy-policy",children:"privacy policy"})," ","before joining."]}),(0,t.jsx)(D.Z,{error:i}),(0,t.jsxs)("form",{className:"auth-form",onSubmit:M,children:[(0,t.jsxs)("div",{className:"field",children:[(0,t.jsxs)("label",{className:"label",htmlFor:"signinEmail",children:["Enter your email address ",(0,t.jsx)("span",{children:"*"})]}),(0,t.jsxs)("div",{className:"control has-icons-right",children:[(0,t.jsx)("input",{className:"input is-medium".concat(f&&!b&&g?" is-warning":"").concat(f&&b?" is-success":""),type:"email",placeholder:"[email protected]",...m,tabIndex:0,id:"signinEmail"}),f&&!b&&g?(0,t.jsx)("span",{className:"icon is-small is-right has-text-warning",children:(0,t.jsx)(n(),{path:r.jZI,size:1})}):null,b?(0,t.jsx)("span",{className:"icon is-small is-right has-text-success ",children:(0,t.jsx)(n(),{path:r.OE9,size:1})}):null]}),!b&&g?(0,t.jsx)(Z.Z,{message:"Please check your email address is correct."}):""]}),(0,t.jsxs)("div",{className:"field",children:[(0,t.jsxs)("label",{htmlFor:"username",className:"label",children:["Choose a username ",(0,t.jsx)("span",{children:"*"})]}),(0,t.jsx)("p",{className:"help",children:"Your username will be visible to others."}),(0,t.jsxs)("div",{className:"control has-icons-left has-icons-right".concat(L?" is-loading":""),children:[(0,t.jsx)("input",{onKeyDown:e=>{"Space"===e.code&&e.preventDefault()},id:"username",className:"input is-medium".concat(O&&(!T||!A)&&J?" is-warning":"").concat(O&&A&&T?" is-success":""),type:"text",placeholder:"",tabIndex:0,...R}),(0,t.jsx)("span",{className:"icon is-small is-left",children:(0,t.jsx)(n(),{path:r.bn2,size:1})}),A&&T&&(0,t.jsx)("span",{className:"icon is-small is-right has-text-success",children:(0,t.jsx)(n(),{path:r.OE9,size:1})}),O&&(!T||!A)&&J&&(0,t.jsx)("span",{className:"icon is-small is-right has-text-warning",children:(0,t.jsx)(n(),{path:r.jZI,size:1})})]}),!L&&T&&!A&&J?(0,t.jsx)(Z.Z,{message:"Sorry, this username is not available."}):"",!T&&O&&J?(0,t.jsx)(Z.Z,{message:"Please choose a username has a minimum of four characters, a maximum of 15 characters and no symbols or spaces."}):null]}
1),(0,t.jsx)(_.Z,{passwordInput:V,bindField:"bind1",showHelp:!0}),(0,t.jsxs)("div",{className:"field",children:[V.isDirty?(0,t.jsx)("div",{className:"control",children:(0,t.jsx)(P,{onChangeScore:W,password:V.value1,minLength:6,className:"password-strength-bar",barColors:["#ddd","#ea5e62","#ffd235","#84cbf1","#7EC4A3"]})}):null,V.isDirty&&!c?(0,t.jsx)(Z.Z,{message:"We need you to have an âokayâ or better password strength to make an account."}):null]}),(0,t.jsxs)("div",{className:"auth-form-stage-two".concat($?"":" is-hidden"),children:[(0,t.jsxs)("div",{className:"control mb-4",children:[(0,t.jsxs)("div",{className:"field mb-0",children:[(0,t.jsx)("input",{className:"is-checkradio has-background-color is-white",id:"tosAgree",type:"checkbox",checked:U,"aria-labelledby":"tosAgree",name:"tosAgree",onChange:H,tabIndex:0}),(0,t.jsxs)("label",{htmlFor:"tosAgree",className:"label",children:["I have read the privacy policy and terms of use."," ",(0,t.jsx)("span",{children:"*"})]})]}),q?(0,t.jsx)(Z.Z,{message:"Please agree to the terms and use and privacy policy."}):null]}),(0,t.jsx)("div",{className:"form-buttons",children:(0,t.jsx)("div",{className:"field",children:(0,t.jsx)("div",{className:"control",children:(0,t.jsx)("button",{type:"submit",tabIndex:0,className:"button is-primary is-medium is-rounded is-fullwidth",children:"Next"})})})})]})]})]}),(0,t.jsx)("div",{className:"signin-other",children:(0,t.jsx)("div",{className:"signin-form-footer content is-medium",children:(0,t.jsxs)("p",{className:"is-font-brand has-text-centered",children:["Already a member? ",(0,t.jsx)(h(),{href:"/signin",children:"Login here"})]})})})]})})})})]})};var L=A}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=55278)}),_N_E=e.O()}]); 2//# sourceMappingURL=join-7c55be263137ebed.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.