1"use strict";(self.webpackChunkzerobees=self.webpackChunkzerobees||[]).push([[333],{28333:(e,t,r)=>{r.r(t),r.d(t,{default:()=>w});var a=r(57528),n=r(32542),s=r(84411),o=r(74725),i=r(91688),c=r(97939),l=r(89379),u=r(22531),d=r(65043),m=r(24858),h=r(40517),p=r(7270),f=r(60521),x=r(94647),g=r(70579);const v=e=>{let{track:t}=e;const{t:r}=(0,o.B)(),[a,n]=(0,d.useState)(null),[v,y]=(0,d.useState)(!1),j=(0,x.As)(),{register:C,setValue:b,getValues:w,handleSubmit:N,formState:{touchedFields:k,errors:P}}=(0,m.mN)(),[R,E]=(0,d.useState)(!1),{sendRequest:A}=(0,h.qs)(),L=(0,i.useHistory)(),S=e=>{b(e.target.name,e.target.value,{shouldTouch:!0})};return C("firstName",{setValueAs:e=>e.trim(),required:r("validation.enterName")}),C("lastName",{setValueAs:e=>e.trim(),required:r("validation.enterName")}),C("email",{setValueAs:e=>e.trim(),required:r("validation.enterEmail"),pattern:{value:f.Uo,message:r("validation.enterEmail","Please enter valid email")}}),C("orgName",{setValueAs:e=>e.trim(),required:r("validation.enterOrg","Please enter organisation name")}),C("password",{setValueAs:e=>e.trim(),minLength:{value:6,message:r("validation.passwordLength","Password has to have at least 6 characters")},validate:{notEmpty:e=>!!e||r("validation.passwordEmpty","Password cannot be empty"),passwordMatches:e=>e===w("password-confirm")||r("validation.passwordMatch","Passwords have to match")}}),C("password-confirm",{setValueAs:e=>e.trim()}),(0,g.jsx)(g.Fragment,{children:R?(0,g.jsx)(c.LoadingSpinner,{}):(0,g.jsxs)(s.CForm,{onSubmit:N(async e=>{if(!v)return;E(!0);const r=(0,l.A)((0,l.A)({},e),{},{track:t});try{const{email:t,password:a}=e;await A("/app/users/esg",{method:"POST",body:JSON.stringify(r),successMsg:"User created successfully"},!0),await(0,u.x9)(j,t,a),L.push("/survey/account/onboarding")}catch(a){n(null===a||void 0===a?void 0:a.message),console.log(a.status),console.log(a)}finally{E(!1)}}),children:[a&&(0,g.jsxs)("h5",{className:"text-danger",children:["* ",a]}),(0,g.jsxs)(s.CFormGroup,{children:[(0,g.jsx)(s.CLabel,{children:r("shared.organisation","Organisation")}),(0,g.jsx)(c.BasicInput,{type:"text",name:"orgName",placeholder:r("signup.enterOrg","Please enter the name of organisation..."),onChange:S}),(0,g.jsx)(c.ErrorText,{value:P.organisation})]}),(0,g.jsxs)(s.CFormGroup,{children:[(0,g.jsx)(s.CLabel,{children:r("shared.email")}),(0,g.jsx)(c.BasicInput,{type:"email",name:"email",placeholder:r("signup.adminEmail","Please enter admin's email..."),onChange:S}),(0,g.jsx)(c.ErrorText,{value:P.email})]}),(0,g.jsxs)(s.CFormGroup,{children:[(0,g.jsx)(s.CLabel,{children:r("shared.firstName")}),(0,g.jsx)(c.BasicInput,{type:"text",name:"firstName",placeholder:r("signup.adminFirstName","Please enter admin's first name..."),onChange:S}),(0,g.jsx)(c.ErrorText,{value:P.firstName})]}),(0,g.jsxs)(s.CFormGroup,{children:[(0,g.jsx)(s.CLabel,{children:r("shared.lastName")}),(0,g.jsx)(c.BasicInput,{type:"text",name:"lastName",placeholder:r("signup.adminLastName","Please enter admin's last name..."),onChange:S}),(0,g.jsx)(c.ErrorText,{value:P.lastName})]}),(0,g.jsxs)(s.CFormGroup,{children:[(0,g.jsx)(s.CLabel,{children:r("shared.password")}),(0,g.jsx)(c.BasicInput,{type:"password",name:"password",placeholder:r("shared.enterPassword","Please enter password"),onChange:S,autoComplete:"new-password"}),(0,g.jsx)(c.ErrorText,{value:P.password})]}),(0,g.jsxs)(s.CFormGroup,{children:[(0,g.jsx)(s.CLabel,{children:r("assign.repeatPassword","Repeat password")}),(0,g.jsx)(c.BasicInput,{type:"password",name:"password-confirm",placeholder:r("assign.repeatPasswordPlaceholder","Please repeat password"),autoComplete:"new-password",onChange:S})]}),(0,g.jsxs)(s.CFormGroup,{className:"mt-4 ",variant:"custom-checkbox",children:[(0,g.jsx)(s.CInputCheckbox,{custom:!0,id:"terms-checkbox",onChange:e=>y(e.target.checked),defaultChecked:!1,style:{borderRadius:0}}),(0,g.jsxs)(s.CLabel,{style:{fontSize:"16px"},variant:"custom-checkbox",htmlFor:"terms-checkbox",children:["I accept the",(0,g.jsxs)("a",{className:"text-info mx-auto",href:"https://www.zerobees.com/legal",target:"_blank",rel:"noreferrer",children:[" ","terms and conditions"]})," ",(0,g.jsx)("span",{className:"text-danger ",children:"*"})]})]}),(0,g.jsxs)(s.CFormGroup,{className:"mt-2 mb-2 ",variant:"custom-checkbox",children:[(0,g.jsx)(s.CInputCheckbox,{custom:!0,id:"marketing-checkbox",onChange:e=>b("acceptsMarketing",e.target.checked),defaultChecked:!1,style:{borderRadius:0}}),(0,g.jsx)(s.CLabel,{style:{fontSize:"16px"},variant:"custom-checkbox",htmlFor:"marketing-checkbox",children:"I want to re
1ceive marketing communications from ZeroBees"})]}),(0,g.jsx)("div",{className:"d-flex justify-content-center w-100",children:(0,g.jsx)(c.ButtonBasic,{size:"lg",className:"mt-3",type:"submit",bgcolor:"green",hovercolor:"darkgreen",disabled:!(0,p.checkIsFormTouched)(k)||!v,children:r("signup.title","Sign up")})})]})})};var y,j=r(30009),C=r(35323);const b=(0,j.default)(s.CContainer)(y||(y=(0,a.A)(["\n h4,\n h5 {\n line-height: 1.5 !important;\n }\n"]))),w=()=>{const{t:e}=(0,o.B)(),t=(0,i.useHistory)();let r=new URLSearchParams((0,i.useLocation)().search).get("track");return console.log("track",r),(0,g.jsx)("div",{className:"c-app c-default-layout flex-row align-items-center",children:(0,g.jsx)(b,{className:"my-3",children:(0,g.jsx)(s.CRow,{className:"justify-content-center",children:(0,g.jsx)(s.CCol,{md:"8",children:(0,g.jsx)(s.CCardGroup,{children:(0,g.jsxs)(s.CCard,{className:"p-4 position-relative",children:[(0,g.jsxs)(s.CCardHeader,{children:[(0,g.jsx)("h1",{className:"",children:e("signup.title","Sign up")}),(0,g.jsx)(C.N_,{className:"text-info ",to:"/survey",children:"Already have an account? Login here"})]}),(0,g.jsx)(s.CCardBody,{children:(0,g.jsx)(v,{track:r})}),(0,g.jsxs)(c.ButtonGhost,{className:"align-self-start d-flex align-items-center summary-btn coreData-intro-back-button",onClick:()=>{t.push("/")},children:[(0,g.jsx)(n.Ay,{name:"cil-arrow-left"}),(0,g.jsx)("span",{className:"ml-2",style:{fontSize:"14px"},children:"Back"})]})]})})})})})})}},35323:(e,t,r)=>{function a(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var n=r(91688),s=a(r(65043)),o=r(77321);r(65173),r(58620);var i=a(r(62213));function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}function l(e,t){e.prototype=Object.create(t.prototype),u(e.prototype.constructor=e,t)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){if(null==e)return{};var r,a,n={},s=Object.keys(e);for(a=0;a<s.length;a++)r=s[a],0<=t.indexOf(r)||(n[r]=e[r]);return n}var m=function(e){function t(){for(var t,r=arguments.length,a=new Array(r),n=0;n<r;n++)a[n]=arguments[n];return(t=e.call.apply(e,[this].concat(a))||this).history=o.createBrowserHistory(t.props),t}return l(t,e),t.prototype.render=function(){return s.createElement(n.Router,{history:this.history,children:this.props.children})},t}(s.Component),h=function(e){function t(){for(var t,r=arguments.length,a=new Array(r),n=0;n<r;n++)a[n]=arguments[n];return(t=e.call.apply(e,[this].concat(a))||this).history=o.createHashHistory(t.props),t}return l(t,e),t.prototype.render=function(){return s.createElement(n.Router,{history:this.history,children:this.props.children})},t}(s.Component),p=function(e,t){return"function"==typeof e?e(t):e},f=function(e,t){return"string"==typeof e?o.createLocation(e,null,null,t):e},x=function(e){return e},g=s.forwardRef;void 0===g&&(g=x);var v=g(function(e,t){var r=e.innerRef,a=e.navigate,n=e.onClick,o=d(e,["innerRef","navigate","onClick"]),i=o.target,l=c({},o,{onClick:function(t){try{n&&n(t)}catch(e){throw t.preventDefault(),e}t.defaultPrevented||0!==t.button||i&&"_self"!==i||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(t)||(t.preventDefault(),a())}});return l.ref=x!==g&&t||r,s.createElement("a",l)}),y=g(function(e,t){var r=e.component,a=void 0===r?v:r,l=e.replace,u=e.to,m=e.innerRef,h=d(e,["component","replace","to","innerRef"]);return s.createElement(n.__RouterContext.Consumer,null,function(e){e||i(!1);var r=e.history,n=f(p(u,e.location),e.location),d=n?r.createHref(n):"",v=c({},h,{href:d,navigate:function(){var t=p(u,e.location),a=o.createPath(e.location)===o.createPath(f(t));(l||a?r.replace:r.push)(t)}});return x!==g?v.ref=t||m:v.innerRef=m,s.createElement(a,v)})}),j=function(e){return e},C=s.forwardRef;void 0===C&&(C=j);var b=C(function(e,t){var r=e["aria-current"],a=void 0===r?"page":r,o=e.activeClassName,l=void 0===o?"active":o,u=e.activeStyle,m=e.className,h=e.exact,x=e.isActive,g=e.location,v=e.sensitive,b=e.strict,w=e.style,N=e.to,k=e.innerRef,P
1=d(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return s.createElement(n.__RouterContext.Consumer,null,function(e){e||i(!1);var r=g||e.location,o=f(p(N,r),r),d=o.pathname,R=d&&d.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),E=R?n.matchPath(r.pathname,{path:R,exact:h,sensitive:v,strict:b}):null,A=!!(x?x(E,r):E),L="function"==typeof m?m(A):m,S="function"==typeof w?w(A):w;A&&(L=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(function(e){return e}).join(" ")}(L,l),S=c({},S,u));var O=c({"aria-current":A&&a||null,className:L,style:S,to:o},P);return j!==C?O.ref=t||k:O.innerRef=k,s.createElement(y,O)})});Object.defineProperty(t,"W6",{enumerable:!0,get:function(){return n.useHistory}}),Object.defineProperty(t,"zy",{enumerable:!0,get:function(){return n.useLocation}}),Object.defineProperty(t,"g",{enumerable:!0,get:function(){return n.useParams}}),t.N_=y},58620:(e,t,r)=>{r.r(t),r.d(t,{default:()=>a});const a=function(e,t){}},62213:e=>{var t="Invariant failed";e.exports=function(e,r){if(!e)throw new Error(t)}}}]); 2//# sourceMappingURL=333.c3e4e581.chunk.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.