(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5405],{87314:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return r(64796)}])},64796:function(e,t,r){"use strict";r.r(t);var n=r(98788),s=r(5163),i=r(52322);r(2784);var a=r(96577),o=r.n(a),c=r(82400),l=r(99205),u=r(47892),d=r(88218),h=r(96892),m=r(49498),g=r(86225),p=function(){var e,t,r,a,p=(0,u.Z)("sign-in"),x=p.isLoading,f=p.mutateUser,w=(0,d.Z)().setToastAlert,j=(e=(0,n.Z)(function(e){var t,r,n,i,a;return(0,s.__generator)(this,function(s){switch(s.label){case 0:t=e.clientId,r=e.credential,s.label=1;case 1:if(s.trys.push([1,5,,6]),!(t&&r))return[3,3];return n={medium:"google",credential:r,clientId:t},[4,l.Z.socialAuth(n)];case 2:return(i=s.sent())&&(null==i?void 0:i.user)&&f(),[3,4];case 3:throw Error("Cant find credentials");case 4:return[3,6];case 5:return w({title:"Error signing in!",type:"error",message:(null==(a=s.sent())?void 0:a.error)||"Something went wrong. Please try again later or contact the support team."}),[3,6];case 6:return[2]}})}),function(t){return e.apply(this,arguments)}),v=(t=(0,n.Z)(function(e){var t,r,n;return(0,s.__generator)(this,function(s){switch(s.label){case 0:if(s.trys.push([0,4,,5]),!e)return[3,2];return t={medium:"github",credential:e,clientId:"51aa9b1b3ae8d3100da6"},[4,l.Z.socialAuth(t)];case 1:return(r=s.sent())&&(null==r?void 0:r.user)&&f(),[3,3];case 2:throw Error("Cant find credentials");case 3:return[3,5];case 4:return w({title:"Error signing in!",type:"error",message:(null==(n=s.sent())?void 0:n.error)||"Something went wrong. Please try again later or contact the support team."}),[3,5];case 5:return[2]}})}),function(e){return t.apply(this,arguments)}),y=(r=(0,n.Z)(function(e){return(0,s.__generator)(this,function(t){switch(t.label){case 0:return[4,l.Z.emailLogin(e).then(function(e){try{e&&f()}catch(t){w({type:"error",title:"Error!",message:(null==t?void 0:t.error)||"Something went wrong. Please try again later or contact the support team."})}}).catch(function(e){return w({type:"error",title:"Error!",message:(null==e?void 0:e.error)||"Something went wrong. Please try again later or contact the support team."})})];case 1:return t.sent(),[2]}})}),function(e){return r.apply(this,arguments)}),b=(a=(0,n.Z)(function(e){return(0,s.__generator)(this,function(t){try{e&&f()}catch(r){w({type:"error",title:"Error!",message:(null==r?void 0:r.error)||"Something went wrong. Please try again later or contact the support team."})}return[2]})}),function(e){return a.apply(this,arguments)});return(0,i.jsx)(c.Z,{children:x?(0,i.jsx)("div",{className:"grid place-items-center h-screen",children:(0,i.jsx)(m.$j,{})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"hidden sm:block sm:fixed border-r-[0.5px] border-custom-border-200 h-screen w-[0.5px] top-0 left-20 lg:left-32"}),(0,i.jsx)("div",{className:"fixed grid place-items-center bg-custom-background-100 sm:py-5 top-11 sm:top-12 left-7 sm:left-16 lg:left-28",children:(0,i.jsx)("div",{className:"grid place-items-center bg-custom-background-100",children:(0,i.jsx)("div",{className:"h-[30px] w-[30px]",children:(0,i.jsx)(o(),{src:g.Z,alt:"Plane Logo"})})})})]}),(0,i.jsx)("div",{className:"grid place-items-center h-full overflow-y-auto py-5 px-7",children:(0,i.jsxs)("div",{children:[parseInt("1")?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h1",{className:"text-center text-2xl sm:text-2.5xl font-semibold text-custom-text-100",children:"Sign in to Plane"}),(0,i.jsxs)("div",{className:"flex flex-col divide-y divide-custom-border-200",children:[(0,i.jsx)("div",{className:"pb-7",children:(0,i.jsx)(h.J3,{handleSignIn:b})}),(0,i.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4 pt-7 sm:w-[360px] mx-auto overflow-hidden",children:[(0,i.jsx)(h.tw,{handleSignIn:j}),(0,i.jsx)(h.Hp,{handleSignIn:v})]})]})]}):(0,i.jsx)(h.jJ,{onSubmit:y}),parseInt("1")?(0,i.jsxs)("p",{className:"pt-16 text-custom-text-200 text-sm text-center",children:["By signing up, you agree to the"," ",(0,i.jsx)("a",{href:"https://plane.so/terms-and-conditions",target:"_blank",rel:"noopener noreferrer",className:"font-medium underline",children:"Terms & Conditions"})]}):null]})})]})})};t.default=p}},function(e){e.O(0,[9410,3955,9498,9444,9774,2888,179],function(){return e(e.s=87314)}),_N_E=e.O()}]);