1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8540],{94184:function(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var s=r.apply(null,n);s&&e.push(s)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var i in n)o.call(n,i)&&n[i]&&e.push(i);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},58808:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/proxy/login",function(){return n(70635)}])},3334:function(e,t,n){"use strict";var o=n(65571),r=n.n(o),a=n(80189),s=(0,a.logflarePinoVercel)({apiKey:"HoZLyZ1YKkOE",sourceToken:"cdb94089-fbd4-4157-b243-006c3318104f"}),i=s.stream,l=s.send,c=r()({browser:{transmit:{level:"info",send:l}}},i);t.Z=c},70635:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return f}});var o=n(91098),r=n(16364),a=n(85893),s=n(11163),i=n(9008),l=n.n(i),c=n(67294),u=n(32129),d=n(15503),m=(n(72211),n(11056)),g=n(94184),h=n.n(g),p=n(3334),f=!0;t.default=(0,m.Zh)("common")((function(e){(0,u.Z)();var t=(0,c.useState)(!1),n=t[0],i=t[1],g=(0,c.useState)(""),f=g[0],x=g[1],b=(0,c.useState)(""),v=b[0],y=b[1],w=(0,c.useState)(""),j=w[0],P=w[1],N=(0,c.useState)(""),k=N[0],L=N[1],A=(0,c.useState)(!1),C=A[0],S=A[1],_=(0,c.useState)(!1),E=_[0],I=_[1],Z=(0,c.useState)(!1),H=Z[0],O=Z[1],U=e.locale,q=e.primaryColor,F=(0,m.$G)(),R=F.t,W=F.i18n,z=(0,s.useRouter)();(0,c.useEffect)((function(){W.changeLanguage(U)}),[U]),(0,c.useEffect)((function(){z.query.alreadyHaveAnAccount&&i(!0)}),[z.query.alreadyHaveAnAccount]),(0,c.useEffect)((function(){var e,t=Object.keys(z.query).find((function(e){return"forgotpassword"===e.toLowerCase()}));t&&"true"===(null===(e=z.query[t])||void 0===e?void 0:e.toString().toLowerCase())&&(I(!0),i(!0))}),[z.query]);var T,Y=h()("flex","items-center",{hidden:!n},{hidden:E}),B=function(){var t=(0,o.Z)((function(t){var o,a,s,i,l,c,u,m;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(d.Z.auth().tenantId=null!==(o=e.tenantId)&&void 0!==o?o:null,S(!0),L(""),t.preventDefault(),!E)return[3,6];r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,d.Z.auth().sendPasswordResetEmail(v)];case 2:return r.sent(),O(!0),[3,5];case 3:return"auth/user-not-found"===(a=r.sent()).code?L(R("Portal.Login.thatAccountCouldNotBeFoundPleaseSignUp")):(p.Z.error("password reset error ".concat(a.code," ").concat(a.message)),L(R("Portal.Login.thereWasAProblemResettingYourPassword"))),[3,5];case 4:return S(!1),[7];case 5:return[3,16];case 6:if(!n)return[3,12];r.label=7;case 7:return r.trys.push([7,9,10,11]),[4,d.Z.auth().signInWithEmailAndPassword(v,f)];case 8:return s=r.sent(),console.log("firebase login result is",s),window.location.href="".concat(e.proxyPath,"/home"),[3,11];case 9:return"auth/wrong-password"===(i=r.sent()).code?L(R("Portal.Login.wrongPassword")):"auth/user-not-found"===i.code?L(R("Portal.Login.thatAccountCouldNotBeFoundPleaseSignUp")):(p.Z.error("logging in error ".concat(i.code," ").concat(i.message)),L(R("Portal.Login.sorryWeCouldNotLogYouIn"))),[3,11];case 10:return S(!1),[7];case 11:return[3,16];case 12:return r.trys.push([12,15,,16]),[4,d.Z.auth().createUserWithEmailAndPassword(v,f)];case 13:return u=r.sent(),[4,null===(l=u.user)||void 0===l?void 0:l.updateProfile({displayName:j})];case 14:return r.sent(),null===(c=d.Z.auth().currentUser)||void 0===c||c.getIdToken(!0),window.location.href="".concat(e.proxyPath,"/home"),[3,16];case 15:return m=r.sent(),S(!1),"auth/email-already-in-use"===m.code||"auth/email-already-exists"===m.code?L(R("Portal.Login.thereIsAlreadyAnAccountWithThatEmail")):"auth/weak-password"===m.code?L(R("Portal.Login.weakPassword")):(p.Z.error("error creating account ".concat(m.code," ").concat(m.message)),console.error("error creating account",JSON.stringify(m)),L(R("Portal.Login.errorCreatingAccount"))),[3,16];case 16:return[2]}}
1))}));return function(e){return t.apply(this,arguments)}}();return(0,a.jsxs)("div",{children:[(0,a.jsxs)(l(),{children:[(0,a.jsxs)("title",{children:[e.customHeadline?e.customHeadline:R("Portal.Login.becomeAnAmbassador")," -"," ",e.customSubheadline?e.customSubheadline:R("Portal.Login.giveOffAndGet",{discountPercentage:e.discountPercentage,commissionPercentage:e.commissionPercentage})]}),(0,a.jsx)("meta",{name:"viewport",content:"initial-scale=1.0, width=device-width"})]}),(0,a.jsxs)("div",{className:"relative min-h-screen overflow-hidden",children:[(0,a.jsx)("div",{className:"hidden lg:block absolute",style:{height:"100%",width:"50%",right:0,backgroundSize:"cover",backgroundPosition:"center center",backgroundRepeat:"no-repeat",backgroundImage:e.portalImageLink?"url(".concat(e.portalImageLink,")"):"url(".concat("https://app.convertout.com","/portalimage.jpg)")}}),(0,a.jsx)("div",{className:"lg:hidden absolute",style:{backgroundColor:null!==(T=null===e||void 0===e?void 0:e.backgroundColor)&&void 0!==T?T:"#F7FAFC",height:"100%",width:"50%",right:0,backgroundSize:"cover"}}),(0,a.jsx)("div",{className:"relative min-h-screen lg:min-w-3xl xl:min-w-4xl flex items-center justify-center w-full lg:w-3/5 py-8 px-8 bg-no-repeat bg-cover",style:{backgroundImage:"url(".concat(function(){if(!e.backgroundColor||e.backgroundColor.toUpperCase()==="#f7fafc".toUpperCase())return"".concat("https://app.convertout.com","/angled-background.svg");var t=e.backgroundColor.slice(1);return"".concat("https://app.convertout.com","/api/backgroundSvg?color=").concat(t)}(),")"),backgroundSize:"100% auto"},children:(0,a.jsxs)("div",{className:"lg:px-8 pb-24",children:[e.logoImageLink&&e.domain&&(0,a.jsx)("a",{href:"https://".concat(e.domain),children:(0,a.jsx)("img",{className:"max-h-16",src:"".concat(e.logoImageLink),alt:"Logo"})}),(0,a.jsx)("h1",{className:"mt-6 text-4xl lg:text-5xl font-semibold text-gray-900",children:e.customHeadline?e.customHeadline:R("Portal.Login.becomeAnAmbassador")}),(0,a.jsx)("h2",{"data-cy":"subtitle",className:"mt-2 text-2xl text-gray-600 max-w-lg",children:e.customSubheadline?e.customSubheadline:R("Portal.Login.giveOffAndGet",{discountPercentage:e.discountPercentage,commissionPercentage:e.commissionPercentage})}),(0,a.jsx)("div",{className:"mt-6 max-w-md",children:(0,a.jsxs)("form",{onSubmit:B,className:"space-y-6",children:[(0,a.jsxs)("div",{className:n||E?"hidden":"",children:[(0,a.jsx)("label",{htmlFor:"name",className:"block text-sm font-medium leading-5 text-gray-700",children:R("Portal.Login.name")}),(0,a.jsx)("div",{className:"mt-1 rounded-md shadow-sm",children:(0,a.jsx)("input",{"data-cy":"name",id:"name",value:j,onChange:function(e){return P(e.target.value)},type:"string",autoComplete:"name",required:!n,className:"appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md placeholder-gray-400 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 transition duration-150 ease-in-out sm:text-sm sm:leading-5"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium leading-5 text-gray-700",children:R("Portal.Login.emailAddress")}),(0,a.jsx)("div",{className:"mt-1 rounded-md shadow-sm",children:(0,a.jsx)("input",{"data-cy":"email",id:"email",type:"email",autoComplete:"email",value:v,onChange:function(e){return y(e.target.value)},required:!0,className:"appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md placeholder-gray-400 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 transition duration-150 ease-in-out sm:text-sm sm:leading-5"})})]}),(0,a.jsxs)("div",{className:E?"hidden":"",children:[(0,a.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium leading-5 text-gray-700",children:R("Portal.Login.password")}),(0,a.jsx)("div",{className:"mt-1 rounded-md shadow-sm",children:(0,a.jsx)("input",{"data-cy":"password",id:"password",type:"password",required:!E,value:f,onChange:function(e){return x(e.target.value)},autoComplete:"new-password",className:"appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md placeholder-gray-400 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 transition duration-150 ease-in-out sm:text-sm sm:leading-5"})})]}),!n&&e.termsLink&&(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsxs)("div",{className:" leading-5 text-xs font-medium text-gray-500 focus:outline-none focus:underline transition ease-in-out duration-150",children:[R("Portal.Login.bySigningUpYouAgree")," ",(0,a.jsx)("span",{className:"text-blue-600",children:(0,a.jsx)("a",{href:e.termsLink,target:"_blank",rel:"noreferrer",children:R("Portal.Login.terms")})})]})}),(0,a.jsx)("div",{className:Y,children:(0,a.jsx)("div",{className:"text-sm leading-5",children:(0,a.jsx)("button",{type:"button",onClick:function(e){e.preventDefault(),I(!0),L("")},style:{color:q},className:"cursor-pointer font-medium focus:outline-none focus:underline transition ease-in-out duration-150",children:R("Portal.Login.forgotPassword")})})}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-center",children:[H&&(0,a.jsxs)("span",{className:" text-green-600",children:[" ",R("Portal.Login.passwordResetEmailSent")]}),""!==k&&(0,a.jsx)("span",{className:" text-red-600",children:k})]}),(0,a.jsx)("div",{children:(0,a.jsx)("span",{className:"block w-full rounded-md shadow-sm",children:(0,a.jsx)("button",{style:{backgroundColor:q},"data-cy":"submit",type:"submit",disabled:C,className:"w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white focus:outline-none transition duration-150 ease-in-out",children:C?(0,a.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):R(E?"Portal.Login.sendPasswordReset":n?"Portal.Login.logIn":"Portal.Login.signUp")})})}),(0,a.jsx)("div",{children:(0,a.jsx)("button",{"data-cy":"alreadyHaveAnAccount",type:"button",style:{color:q},className:"cursor-pointer w-full border-none flex justify-center px-4 text-sm font-medium transition duration-150 ease-in-out focus:outline-none",onClick:function(e){e.preventDefault(),i(!n),I(!1),O(!1),L("")},children:R(n?"Portal.Login.dontHaveAnAccountSignUp":"Portal.Login.alreadyHaveAnAccountLogIn")})})]})})]})})]})]})}))},9008:function(e,t,n){e.exports=n(5443)},11163:function(e,t,n){e.exports=n(90387)},71156:function(){},52361:function(){},94616:function(){}},function(e){e.O(0,[3662,9675,9774,2888,179],(function(){return t=58808,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.