1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1815],{91025:function(e,i,s){s.d(i,{T:function(){return o}});var r,n,t=s(52322),l=s(5879),a=s(94199);(r=n||(n={})).invalid_signup_code="invalid_signup_code",r.invalid_reset_code="invalid_reset_code",r.invalid_user="invalid_user",r.other_workspace_member="other_workspace_member";let o={[n.invalid_signup_code]:{title:(0,t.jsx)(l.cC,{id:"F6yt1L",values:{GAMMA_PROPER_NOUN:a.N6}}),description:(0,t.jsx)(l.cC,{id:"hVNvhu"})},[n.invalid_reset_code]:{title:(0,t.jsx)(l.cC,{id:"SvShcH"}),description:(0,t.jsx)(l.cC,{id:"Vm3y4h"})},[n.invalid_user]:{title:(0,t.jsx)(l.cC,{id:"a2AYF6"}),description:(0,t.jsx)(l.cC,{id:"x9CdxW",values:{GAMMA_PROPER_NOUN:a.N6}})},[n.other_workspace_member]:{title:(0,t.jsx)(l.cC,{id:"J5F9Vo"}),description:(0,t.jsx)(l.cC,{id:"CTBeTd",values:{GAMMA_PROPER_NOUN:a.N6}})}}},89606:function(e,i,s){s.d(i,{p:function(){return v}});var r=s(52322),n=s(38035),t=s(10625),l=s(67046),a=s(62614),o=s(99058),c=s(44035),d=s(39237),u=s(77533),x=s(36474),j=s(82554),h=s(42946),p=s(49929),C=s(5879),m=s(42111),g=s(10649);let v=e=>{let{selectedLocale:i,onLocaleSelect:s}=e,v=(0,m.ye)("i18nEnabled");return(0,C.mV)(),(0,r.jsx)(n.k,{direction:"column",children:(0,r.jsxs)(t.v,{matchWidth:!0,children:[(0,r.jsx)(l.j,{as:a.z,rightIcon:(0,r.jsx)(p.G,{size:"xs",icon:h.ptq}),minW:"150px",textAlign:"left",w:"100%",children:i.displayName}),(0,r.jsx)(o.q,{minWidth:"240px",maxH:"290px",overflowY:"auto",overflowX:"hidden",children:(0,r.jsx)(c._,{value:i.key,type:"radio",onChange:e=>{s(e)},children:(0,g.DD)(v).map(e=>{let i=!v&&"private_beta"===g.kf[e.key],s=!i&&"public_beta"===g.kf[e.key];return(0,r.jsx)(d.i,{value:e.key,isDisabled:i,children:(0,r.jsxs)(n.k,{flex:1,alignItems:"center",children:[(0,r.jsxs)(n.k,{direction:"column",children:[(0,r.jsx)(u.x,{children:e.displayName}),(0,r.jsx)(u.x,{fontSize:"12px",color:"gray.500",children:e.displayNameLocalized()})]})," ",(0,r.jsx)(x.L,{}),i?(0,r.jsx)(j.C,{ml:2,fontSize:"0.75em",colorScheme:"blue",children:(0,r.jsx)(C.cC,{id:"VZeG/A"})}):s?(0,r.jsx)(j.C,{ml:2,fontSize:"0.75em",colorScheme:"green",children:(0,r.jsx)(C.cC,{id:"YBt9YP"})}):null]})},e.key)})})})]})})}},43102:function(e,i,s){s.d(i,{m:function(){return l}});var r=s(2784),n=s(91994),t=s(62573);let l=e=>{let i=(0,n.TL)();(0,r.useEffect)(()=>{i((0,t.ZT)({locale:e||null}))},[e]),(0,r.useEffect)(()=>()=>{i((0,t.ZT)({locale:null}))},[])}},82245:function(e,i,s){s.d(i,{A:function(){return r},i:function(){return n}});let r=e=>e.endsWith("gmail.com")||e.endsWith("hotmail.com")||e.endsWith(".edu"),n="gamma_logged_in"},51815:function(e,i,s){s.d(i,{gL:function(){return eS},oP:function(){return e9},OQ:function(){return e_},NV:function(){return E},qy:function(){return eI},tq:function(){return e8},cL:function(){return eu},Mo:function(){return eb},hn:function(){return e1},Fh:function(){return ef},zd:function(){return eR}});var r=s(52322),n=s(70065),t=s(74409),l=s(81540),a=s(77533),o=s(5879),c=s(89220),d=s(2784),u=s(98220),x=s(93202),j=s(89365),h=s(94199),p=s(36651),C=s(52610),m=s(90221),g=s(21805),v=s(89458),f=s(88640),w=s(93441),_=s(90383),k=s(34385);let b=e=>{let i=!(0,m.l6)()&&!(0,_.wg)();(0,w.GE)(i,"\n(function() {var gs = document.createElement('script');gs.src = 'https://try.gamma.app/pr/js';gs.type = 'text/javascript';gs.async = 'true';gs.onload = gs.onreadystatechange = function() {var rs = this.readyState;if (rs && rs != 'complete' && rs != 'loaded') return;try {growsumo._initialize('pk_ie2Y6ptIgL4W0XJY9AC7qKBmxHlLMwqZ'); if (typeof(growsumoInit) === 'function') {growsumoInit();}} catch (e) {}};var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(gs, s);})();\n"),(0,d.useEffect)(()=>{e&&(0,k.X)(25,100)(()=>{var e;return(null===(e=window.growsumo)||void 0===e?void 0:e.initialized)===!0}).then(e).catch(()=>{console.warn("Timed out waiting for growsumo")})},[e])},y=e=>{let[i,s]=(0,d.useState)(!1);b((0,d.useMemo)(()=>()=>s(!0),[]));let{partnerStackPartnerId:r,partnerStackClickId:n}=(0,d.useMemo)(()=>({partnerStackPartnerId:g.Z.get("ps_partner_key"),partnerStackClickId:g.Z.get("ps_xid")}
1),[i]),[t,l]=(0,v.I)(f.H.referredByUserId,e);return(0,d.useEffect)(()=>{e&&l(e)},[e,l]),{partnerStackPartnerId:r,partnerStackClickId:n,referredBy:t}},S=e=>{let{error:i}=e,s=(0,n.p)(),l=(0,C.r_)();return(0,d.useEffect)(()=>{i&&!s.isActive("api_error")&&s({id:"api_error",title:(0,r.jsx)(o.cC,{id:"udaO9j"}),description:(0,r.jsx)(o.cC,{id:"U0dCeS",values:{WORKSPACE_ADMIN_DISPLAY_NAME:l}}),status:"error",position:"top",isClosable:!1,duration:null})},[s,i,l]),(0,r.jsx)(t.X,{fontSize:"100px",children:(0,r.jsx)("span",{role:"img","aria-label":"see-no",children:"\uD83D\uDE48"})})},E=()=>{let{query:{orgId:e,code:i,r:s}}=(0,c.useRouter)(),{user:n,isUserLoading:t}=(0,p.SE)(),{referredBy:d,partnerStackClickId:C,partnerStackPartnerId:g}=y(s),{status:v,data:f,error:w}=(0,x.$rd)({id:e,code:i}),_=(0,m.Sp)();return"error"===v?(0,r.jsx)(S,{error:w}):(0,r.jsx)(u.H$,{scenario:j._M.JOIN_WITH_CODE,"data-testid":"join-workspace-wrapper",children:"loading"===v||t||!f?(0,r.jsx)(l.$,{}):(0,r.jsxs)(u.h3,{lede:(0,r.jsxs)(r.Fragment,{children:["\uD83C\uDF89 ",(0,r.jsx)(o.cC,{id:"5fucMx"})]}),title:n?(0,r.jsx)(o.cC,{id:"2wwLHe",values:{0:null==f?void 0:f.name}}):(0,r.jsx)(o.cC,{id:"L3SXbi",values:{0:null==f?void 0:f.name}}),showFooter:!0,showLogo:!0,children:[(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"s2FywE",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:h.aq,0:null==f?void 0:f.name}})}),_?(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"9iyJp1",values:{GAMMA_PROPER_NOUN:h.N6}})}):n?(0,r.jsx)(eI,{scenario:j._M.JOIN_WITH_CODE,inviteCode:i,workspaceId:e}):(0,r.jsx)(e_,{scenario:j._M.JOIN_WITH_CODE,redirectTo:"/",inviteCode:i,referredBy:d,workspaceId:e,partnerStackPartnerId:g,partnerStackClickId:C})]})})};var N=s(38035),I=s(43297),R=s(62614),A=s(29117),O=s(74008),P=s(35183),T=s(97166),D=s(85573),M=s(28535),U=s(11082),F=s(36474),L=s(97143),z=s(49929),G=s(39097),W=s.n(G),H=s(91025),B=s(19902),K=s(11050),q=s(5632);let J=e=>{let{when:i,method:s="push",path:r,enabled:n=!0}=e,{user:t,isUserLoading:l}=(0,p.SE)(),{push:a,replace:o}=(0,q.useRouter)(),c="push"===s?a:o,u=n&&!l&&r&&("user"===i?t:!t);(0,d.useEffect)(()=>{u&&x.g8p.getUser().then(()=>{"user"===i&&c(r)}).catch(e=>{e instanceof Response&&"anonymous"===i&&c(r)})},[r,c,i,u])};var V=s(55478),Y=s(27988),X=s(74105),Z=s(20816),Q=s(32899),$=s(99793),ee=s(87254),ei=s(52742);let es=e=>{let i=[];return e.length<8&&i.push(ee.ag._({id:"cUUVem"})),e.match(/[A-Z]/)||i.push(ee.ag._({id:"+6oZdK"})),e.match(/[a-z]/)||i.push(ee.ag._({id:"Cjay54"})),e.match(/[0-9]/)||i.push(ee.ag._({id:"XcEl4D"})),e.match(/[\^$*.[\]{}()?"!@#%&/\\,><':;|_~`=+-]/)||i.push(ee.ag._({id:"EodnCE"})),i},er=(0,d.forwardRef)((e,i)=>{let{isOpen:s,onToggle:n}=(0,V.q)(),t=(0,d.useRef)(null),l=(0,Y.q)(t,i),a=!!((null==e?void 0:e.error)&&e.error.length>1);return(0,r.jsxs)(P.NI,{isInvalid:a,children:[(0,r.jsx)(T.l,{htmlFor:"password",children:e.label||(0,r.jsx)(o.cC,{id:"8ZsakT"})}),(0,r.jsxs)(X.B,{children:[(0,r.jsx)(Z.x,{children:(0,r.jsx)(Q.h,{variant:"link","aria-label":s?ee.ag._({i
1d:"KJAyEq"}):ee.ag._({id:"B+wtoH"}),icon:s?(0,r.jsx)(ei.MBb,{}):(0,r.jsx)(ei.Rbo,{}),onClick:()=>{n(),t.current&&t.current.focus({preventScroll:!0})},tabIndex:1})}),(0,r.jsx)(D.I,{id:"password",ref:l,name:"password",type:s?"text":"password",autoComplete:"current-password",required:!0,...e})]}),e.showHelp&&(0,r.jsx)(P.Q6,{children:(0,r.jsx)(o.cC,{id:"v6cuzy"})}),e.error&&(0,r.jsx)($.J1,{children:e.error})]})});er.displayName="PasswordField";let en=e=>{let[i,s]=(0,d.useState)(!1),n=(0,d.useCallback)(()=>new Promise(s=>{if(!i){s(!0);return}setTimeout(()=>{throw Error(e)},1500)}),[e,i]),t=(0,r.jsx)("input",{type:"text",name:"email-input-0",autoComplete:"off",tabIndex:-1,onChange:()=>s(!0)});return{honeypotElement:t,honeypotTriggered:i,validateHoneypot:n}};var et=s(14274),el=s(79254),ea=s(42111);let eo=["high","unknown"],ec=(e,i)=>{let[s,r]=(0,d.useState)(!1),[n,t]=(0,d.useState)(!1),[l,a]=(0,d.useState)(null),[o,c]=(0,d.useState)(!1),[u,j]=(0,d.useState)(null),{enabled:h,checkboxRiskLevels:p}=(0,ea.ye)("recaptcha"),[C]=(0,x.U44)({nextFetchPolicy:"network-only"}),m=(0,d.useCallback)(async()=>new Promise(e=>{if(!i.current)throw Error("[useRecaptcha] Cannot find recaptcha checkbox");r(!0),o||grecaptcha.enterprise.render(i.current,{sitekey:et.v.RECAPTCHA_CHECKBOX_KEY,size:"normal",callback:i=>{e(i),r(!1),c(!0)}})}),[o,i]),g=(0,d.useCallback)(async function(){var i,s;let r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(o)return Promise.resolve();t(!0);let n=l;if(n||a(n=await (0,el.Uj)(e).catch(i=>{throw Error("[useRecaptcha] error for ".concat(e,": ").concat(i))})),!h)return t(!1),Promise.resolve();let c=u;if(!c){if(!(c=await C({variables:{token:n,action:e}})))throw Error("[useRecaptcha] No risk score");j(c),t(!1)}let d=null===(s=c.data)||void 0===s?void 0:null===(i=s.assessRisk)||void 0===i?void 0:i.risk;if(!d||eo.includes(d))throw Error("Oops, something went wrong.");(p.includes(d)||r)&&await m()},[e,C,p,o,m,h,l,u]);return{initiateRecaptchaAssessment:g,isAssessmentInProgress:n,isChallengeInProgress:s,hasVerifiedCaptcha:o}},ed=e=>{let{scenario:i,redirectTo:s,r:t,workspaceId:l,inviteCode:u}=e,h=(0,n.p)(),{push:C}=(0,c.useRouter)(),[m,g]=(0,d.useState)(""),[v,f]=(0,d.useState)(""),{honeypotElement:w,honeypotTriggered:_}=en("UNEXPECTED_SIGNIN_ERROR__HP_01"),k=m.length>0&&v.length>0,{user:b,refetch:S,setCurrentWorkspaceId:E}=(0,p.SE)(),[G,{loading:q,error:J,reset:V}]=(0,x.Asr)(),Y=(0,d.useRef)(null),{initiateRecaptchaAssessment:X,isChallengeInProgress:Z,isAssessmentInProgress:Q,hasVerifiedCaptcha:$}=ec(x.e8z.Signin,Y),ee=(0,B.K)(),ei=(0,d.useMemo)(()=>ee.get(),[ee]),{referredBy:es,partnerStackClickId:et,partnerStackPartnerId:el}=y(t),ea=(0,d.useCallback)(e=>{let{title:i,description:s}=H.T[e]||{title:(0,r.jsx)(o.cC,{id:"U7nnQt"}),description:e};h.isActive(e)||h({title:i,description:s,position:"top",id:e,status:"error",isClosable:!0,duration:null})},[h]),eo=(0,d.useCallback)(async()=>{await (null==S?void 0:S()),E(l)},[S,E,l]),ed=q||Q,eu=(0,d.useCallback)(async e=>{if(e.preventDefault(),ed)return;await X(_);let r=j.r9[i];G({variables:{input:{email:m,password:v,invite:{flow:r,workspaceId:l,inviteCode:u}}}}).then(async()=>{var e;K.co.identify(null==b?void 0:b.id,{user_org_id:null==b?void 0:null===(e=b.organizations)||void 0===e?void 0:e[0].id,anonymous_user:!1,gamma_user_id:null==b?void 0:b.id}),K.co.track(K.AA.LOGIN,{provider:"password"},{context:ei}),await (null==S?void 0:S()),l&&E(l),C(s||"/")}).catch(e=>{console.error("[Signin.onSigninClick] Error signing in",e.message)})},[ei,m,_,X,u,ed,v,C,s,S,i,E,G,null==b?void 0:b.id,null==b?void 0:b.organizations,l]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N.k,{as:"form",direction:"column",onSubmit:eu,children:(0,r.jsxs)(I.K,{spacing:5,children:[(0,r.jsxs)(I.K,{spacing:5,children:[(0,r.jsx)(R.z,{variant:"solid",leftIcon:(0,r.jsx)(z.G,{icon:L.xYR}),onClick:()=>{(0,j.DW)({type:i,errorCallback:ea,params:{workspaceId:l,inviteCode:u,partnerStackClickId:et,partnerStackPartnerId:el,referredByUserId:es},doneCallback:i===j._M.ACCEPT_WORKSPACE_INVITATION&&l?eo:void 0,redirectTo:s})},children:(0,r.jsx)(o.cC,{id:"oZyG4C"})}),(0,r.jsxs)(A.U,{children:[(0,r.jsx)(O.i,{}),(0,r.jsx)(a.x,{fontSize:"sm",whiteSpace:"nowrap",color:"muted",children:(0,r.jsx)(o.cC,{id:"BzEFor"})}),(0,r.jsx)(O.i,{})]})]}),w,(0,r.jsxs)(P.NI,{children:[(0,r.jsx)(T.l,{htmlFor:"email",children:(0,r.jsx)(o.cC,{id:"O3oNi5"})}),(0,r.jsx)(D.I,{id:"email",type:"email",value:m,onChange:e=>{g(e.currentTarget.value),J&&V()},isDisabled:Z||ed,autoFocus:!0})]}
1),(0,r.jsx)(er,{value:v,onChange:e=>{f(e.currentTarget.value),J&&V()},error:null==J?void 0:J.message,isDisabled:Z||ed}),(0,r.jsx)(M.xu,{className:"recaptcha-checkbox-signin",ref:Y,display:Z||$?"block":"none"}),(!Z||$)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(U.r,{fontWeight:"500",color:"trueblue.500",href:"/forgot",as:W(),children:(0,r.jsx)(o.cC,{id:"UNMVei"})}),(0,r.jsx)(I.K,{spacing:"6",children:(0,r.jsx)(R.z,{type:"submit",variant:"plain",w:"100%",onClick:eu,isLoading:ed,isDisabled:!k||Q,children:(0,r.jsx)(o.cC,{id:"5lWFkC"})})}),(0,r.jsxs)(a.x,{fontSize:"sm",textAlign:"center",children:[(0,r.jsx)(o.cC,{id:"ln9/n9"})," ",(0,r.jsx)(U.r,{color:"trueblue.500",href:"/signup",as:W(),children:(0,r.jsx)(o.cC,{id:"e+RpCP"})})]})]})]})}),(0,r.jsx)(F.L,{})]})},eu=()=>{let e=(0,n.p)(),{query:{logout_success:i,r:s,redirect_to:t,scenario:l,workspaceId:x,inviteCode:p},isReady:C}=(0,c.useRouter)(),g=l||j._M.DEFAULT_LOGIN;J({path:t||"/",when:"user",enabled:C}),(0,d.useEffect)(()=>{i&&!e.isActive("logout_success")&&e({id:"logout_success",title:(0,r.jsx)(o.cC,{id:"tG+Uw3"}),status:"success",position:"top",duration:5e3})},[i,e]);let v=(0,w.gF)(),f=(0,m.Sp)()&&v;return(0,r.jsx)(u.H$,{scenario:g,"data-testid":"signin-with-google-wrapper",children:(0,r.jsx)(u.h3,{title:(0,r.jsx)(o.cC,{id:"5lWFkC"}),showLogo:!0,showFooter:!0,children:f?(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"jO28tJ",values:{GAMMA_PROPER_NOUN:h.N6}})}):(0,r.jsx)(ed,{redirectTo:t,scenario:g,workspaceId:x,inviteCode:p,r:s})})})};var ex=s(87651),ej=s(42946),eh=s(82554),ep=s(54933);let eC=()=>{let e=(0,ea.ye)("ai-credits"),i=e.referralBonus;return e.enabled?(0,r.jsxs)(A.U,{borderRadius:"md",p:4,spacing:3,background:"teal.50",children:[(0,r.jsx)(M.Cd,{size:10,display:"flex",alignItems:"center",justifyContent:"center",color:"teal.600",background:"teal.100",fontSize:"xl",children:(0,r.jsx)(z.G,{fixedWidth:!0,icon:ep.LEp})}),(0,r.jsxs)(I.K,{spacing:1,children:[(0,r.jsxs)(a.x,{fontSize:"md",fontWeight:"semibold",children:[(0,r.jsx)(o.cC,{id:"URbt4b",values:{GAMMA_PROPER_NOUN:h.N6}}),(0,r.jsx)("span",{role:"img","aria-label":"celebration emoji",children:"\uD83C\uDF89"})]}),(0,r.jsx)(a.x,{fontSize:"sm",children:(0,r.jsx)(o.cC,{id:"B6we0c",values:{referralBonus:i},components:{0:(0,r.jsx)(eh.C,{colorScheme:"green"})}})})]})]}):null};var em=s(61233),eg=s(92092);let ev=()=>(0,r.jsx)(a.x,{fontSize:"xs",color:"gray.600",children:(0,r.jsx)(o.cC,{id:"9pewn9",values:{GAMMA_PROPER_NOUN:h.N6},components:{0:(0,r.jsx)(U.r,{target:"_blank",href:eg.B,textDecoration:"underline"}),1:(0,r.jsx)(U.r,{target:"_blank",href:eg.h,textDecoration:"underline"})}})}),ef=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ew={position:"relative",fontWeight:"500",fontFamily:"p22-mackinac-pro, sans-serif",lineHeight:"1.2em",letterSpacing:"-0.03em",backgroundImage:"linear-gradient(50deg, #2b0aff, #ff5b8a 49%, #ff5b8a 53%, #ff5b8a 55%, #fba64b 77%, #f99b52)",backgroundClip:"text",color:"transparent"},e_=e=>{let{scenario:i,redirectTo:s,inviteCode:t,referredBy:l,workspaceId:c,inviteeEmail:h,partnerStackClickId:p,partnerStackPartnerId:C}=e,m=(0,n.p)(),{push:g}=(0,d.useContext)(u.mU),[v,f]=(0,d.useState)(""),{honeypotElement:w,honeypotTriggered:_}=en("UNEXPECTED_SIGNUP_ERROR__HP_01"),[k,{loading:b,error:y}]=(0,x.QnR)(),S=(0,d.useRef)(null),{initiateRecaptchaAssessment:E,isChallengeInProgress:N,isAssessmentInProgress:F,hasVerifiedCaptcha:G}=ec(x.e8z.Signup,S),B=(0,ea.ye)("passwordSignup"),K="/signin";(i===j._M.ACCEPT_WORKSPACE_INVITATION||i===j._M.JOIN_WITH_CODE)&&(K="".concat(K,"?scenario=").concat(i,"&workspaceId=").concat(c,"&inviteCode=").concat(t));let q=e=>{let{title:i,description:s}=H.T[e]||{title:(0,r.jsx)(o.cC,{id:"U7nnQt"}),description:e};m.isActive(e)||m({title:i,description:s,position:"top",id:e,status:"error",isClosable:!0,duration:null})},J=!!v.match(ef),V=b||F,Y=N||G,X=(0,d.useCallback)(async e=>{if(e.preventDefault(),V)return;await E(_);let s=j.r9[i];(0,em.Fg)("PASSWORD"),k({variables:{input:{email:v,invite:{flow:s,workspaceId:c,inviteCode:t},scenario:x.nUC.Setup,referredByUserId:l,partnerStackClickId:p,partner
1StackPartnerId:C}}}).then(e=>{var i;let{link:s,provider:n}=(null===(i=e.data)||void 0===i?void 0:i.sendCode)||{};g((0,r.jsx)(ek,{email:v,link:s,provider:n}))}).catch(e=>{console.error("[Signup.onSubmitClick] Error signing up",e.message)})},[v,_,E,t,V,p,C,g,l,i,k,c]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M.xu,{as:"form",onSubmit:X,children:(0,r.jsxs)(I.K,{spacing:5,children:[(0,r.jsx)(ex.U,{in:!v,children:(0,r.jsxs)(I.K,{spacing:5,children:[(0,r.jsx)(R.z,{variant:"solid",leftIcon:(0,r.jsx)(z.G,{icon:L.xYR}),onClick:()=>{(0,j.DW)({type:i,params:{workspaceId:c,email:h,inviteCode:t,referredByUserId:l,partnerStackClickId:p,partnerStackPartnerId:C},errorCallback:q,redirectTo:s}),(0,em.Fg)("GOOGLE")},children:(0,r.jsx)(o.cC,{id:"oZyG4C"})}),B&&(0,r.jsxs)(A.U,{children:[(0,r.jsx)(O.i,{}),(0,r.jsx)(a.x,{fontSize:"sm",whiteSpace:"nowrap",color:"muted",children:(0,r.jsx)(o.cC,{id:"BzEFor"})}),(0,r.jsx)(O.i,{})]})]})}),w,B&&(0,r.jsxs)(P.NI,{children:[(0,r.jsx)(T.l,{htmlFor:"email",children:(0,r.jsx)(o.cC,{id:"O3oNi5"})}),(0,r.jsx)(D.I,{id:"email",type:"email",value:v,isDisabled:V||Y,textTransform:"lowercase",onChange:e=>f(e.currentTarget.value.toLowerCase()),autoFocus:!0}),y&&(0,r.jsx)($.J1,{children:y.message}),(0,r.jsx)(M.xu,{mt:4,className:"recaptcha-checkbox-signup",ref:S,display:Y?"block":"none"}),(0,r.jsx)(ex.U,{in:!v,children:(0,r.jsx)(a.x,{fontSize:"sm",textAlign:"left",mt:4,children:(0,r.jsx)(o.cC,{id:"0tPXOa",components:{0:(0,r.jsx)(U.r,{color:"trueblue.500",href:K,as:W()})}})})})]}),(0,r.jsx)(ev,{}),(0,r.jsx)(M.xu,{children:(0,r.jsx)(ex.U,{in:!!v&&!Y,children:(0,r.jsx)(R.z,{type:"submit",variant:"solid",w:"100%",onClick:X,isDisabled:!J||Y,isLoading:V,children:(0,r.jsx)(o.cC,{id:"3gCD+B"})})})})]})}),l&&(0,r.jsx)(eC,{})]})},ek=e=>{let{email:i,link:s,provider:n}=e;return(0,r.jsxs)(I.K,{spacing:"6",flex:1,children:[(0,r.jsx)(t.X,{sx:ew,fontSize:["4xl","4xl"],children:(0,r.jsx)(o.cC,{id:"U8N77O"})}),(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"pHlHvu",values:{email:i},components:{0:(0,r.jsx)("strong",{})}})}),(0,r.jsx)(I.K,{spacing:5}),(0,r.jsx)(I.K,{spacing:"6",children:(0,r.jsx)(ex.U,{in:!!i,children:s&&n&&(0,r.jsx)(R.z,{w:"100%",onClick:()=>window.open(s,"_blank"),variant:"plain",rightIcon:(0,r.jsx)(z.G,{icon:ej.wlW}),autoFocus:!0,children:(0,r.jsx)(o.cC,{id:"y1RN4W",values:{provider:n}})})})})]})},eb=()=>{let e=(0,n.p)(),{query:{redirect_to:i,code:s,r:t,error:l},push:x,isReady:C}=(0,c.useRouter)(),{user:g,isUserLoading:v}=(0,p.SE)(),{referredBy:f,partnerStackClickId:w,partnerStackPartnerId:_}=y(t);(0,d.useEffect)(()=>{var e;!v&&g&&(null===(e=g.workspaceMemberships)||void 0===e?void 0:e.length)&&x(i||"/")},[v,g,x,i]),(0,d.useEffect)(()=>{if(l&&l in H.T){let{title:i,description:s}=H.T[l]||{title:(0,r.jsx)(o.cC,{id:"U7nnQt"}),description:l};e.isActive("error")||e({id:"error",title:i,description:s,status:"error",position:"top",duration:null})}},[l,e]);let k=(0,m.Sp)();return C?(0,r.jsx)(u.H$,{scenario:j._M.SIGNUP,"data-testid":"signup-with-google-wrapper",children:(0,r.jsx)(u.h3,{title:(0,r.jsx)(o.cC,{id:"e+RpCP"}),showFooter:!0,showLogo:!0,children:k?(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"9iyJp1",values:{GAMMA_PROPER_NOUN:h.N6}})}):(0,r.jsx)(e_,{scenario:j._M.SIGNUP,redirectTo:i,inviteCode:s,referredBy:f,partnerStackPartnerId:_,partnerStackClickId:w})})}):null};var ey=s(92981);let eS=()=>{let{user:e,isUserLoading:i}
1=(0,p.SE)(),{query:{docId:s,email:n,code:t},push:u,isReady:j}=(0,c.useRouter)(),{data:h,loading:C}=(0,x.DjO)({variables:{docId:s,email:n,inviteCode:t},skip:!t||!n||!s}),[g]=(0,x.CF8)(),v="/docs/".concat(s),f=!j||i||C;return(0,d.useEffect)(()=>{!f&&s&&e&&h&&(h.docInvitation?g({variables:{docId:h.docInvitation.docId,email:h.docInvitation.email,inviteCode:t}}).then(()=>{u(v)}).catch(e=>{console.error(e)}):u(v))},[f,e,s,u,v,h,g,t]),(0,r.jsx)(ey.XJ,{showFooter:!0,"data-testid":"doc-invitation-wrapper",children:f?(0,r.jsx)(l.$,{}):h&&h.docInvitation&&!e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eE,{docId:s,docTitle:h.docInvitation.docTitle,invitedByDisplayName:h.docInvitation.invitedBy.displayName,email:n,inviteCode:t,redirectTo:v}),(0,r.jsx)(ey.ER,{children:(0,r.jsxs)(a.x,{children:[(0,r.jsx)(o.cC,{id:"8wYDMp"})," ",(0,r.jsx)(U.r,{textDecoration:"underline",href:"/signin",target:(0,m.Q5)()?"_self":"_blank",children:(0,r.jsx)(o.cC,{id:"RzFKOQ"})})]})})]}):h&&e?(0,r.jsx)(l.$,{}):(0,r.jsx)(eN,{email:n})})},eE=e=>{let{docId:i,docTitle:s,invitedByDisplayName:t,email:l,inviteCode:c,redirectTo:d}=e,u=(0,n.p)(),x=e=>{let{title:i,description:s}=H.T[e]||{title:(0,r.jsx)(o.cC,{id:"U7nnQt"}),description:e};u.isActive(e)||u({title:i,description:s,position:"top",id:e,status:"error",isClosable:!0,duration:null})};return(0,r.jsxs)(ey.qX,{lede:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{role:"img","aria-label":ee.ag._({id:"owjSLs"}),children:"\uD83D\uDC4B"})," ",(0,r.jsx)(o.cC,{id:"2wbD8h"})]}),title:(0,r.jsx)(o.cC,{id:"DbYuFS",values:{GAMMA_PROPER_NOUN:h.N6}}),children:[(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"p3SJdk",values:{GAMMA_ARTIFACT_PROPER_NOUN:h.Yc,docTitle:s,invitedByDisplayName:t}})}),(0,r.jsxs)(I.K,{spacing:4,align:"center",alignSelf:"center",children:[(0,r.jsx)(R.z,{variant:"solid",leftIcon:(0,r.jsx)(z.G,{icon:L.xYR}),size:"lg",mt:6,onClick:()=>{(0,j.DW)({type:j._M.ACCEPT_DOC_INVITATION,params:{docId:i,email:l,inviteCode:c},errorCallback:x,redirectTo:d})},children:(0,r.jsx)(o.cC,{id:"apxsZF"})}),(0,r.jsx)(ev,{})]})]})},eN=e=>{let{email:i}=e;return(0,r.jsx)(ey.qX,{lede:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{role:"img","aria-label":ee.ag._({id:"+6IPye"}),children:"\uD83D\uDE41"})," ",(0,r.jsx)(o.cC,{id:"uAjg3Y"})]}),title:(0,r.jsx)(o.cC,{id:"0dimUT"}),children:(0,r.jsx)(a.x,{children:i?(0,r.jsx)(o.cC,{id:"rpHTpL",values:{email:i}}):(0,r.jsx)(o.cC,{id:"VSc47y"})})})},eI=e=>{let{scenario:i,inviteCode:s,workspaceId:t}=e,l=(0,n.p)(),{push:a}=(0,c.useRouter)(),{refetch:u,user:h,isUserLoading:C,setCurrentWorkspaceId:m}=(0,p.SE)(),g=(0,d.useCallback)(async()=>{await (null==u?void 0:u()),m(t),a("/")},[a,u,m,t]),[v,{loading:f}]=(0,x.djM)(),w=e=>{let{title:i,description:s}=H.T[e]||{title:(0,r.jsx)(o.cC,{id:"U7nnQt"}),description:e};l.isActive(e)||l({title:i,description:s,position:"top",id:e,status:"error",isClosable:!0,duration:null})},_=(0,d.useCallback)(e=>{let r=j.r9[i];e.preventDefault(),v({variables:{input:{flow:r,workspaceId:t,inviteCode:s}}}).then(async e=>{var i;let{success:s}=(null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.joinWorkspace)||{};s&&(await (null==u?void 0:u()),m(t),a("/"))}).catch(e=>{console.error("[Workspaces.JoinWorkspace] Error joining workspace",e.message)})},[t,i,s,v,a,u,m]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(M.xu,{children:(0,r.jsx)(I.K,{spacing:5,children:(0,r.jsx)(M.xu,{children:(0,r.jsx)(R.z,{type:"submit",variant:"solid",w:"100%",onClick:(null==h?void 0:h.authProvider)==="GOOGLE"?()=>{(0,j.DW)({type:i,params:{workspaceId:t,email:h.email,inviteCode:s},errorCallback:w,doneCallback:g})}:_,isLoading:f||C,children:(0,r.jsx)(o.cC,{id:"c9AJhn"})})})})})})},eR=()=>{let{user:e,isUserLoading:i}
1=(0,p.SE)(),{query:{workspaceId:s,email:n,code:t,r:C},push:g,isReady:v}=(0,c.useRouter)(),{referredBy:f,partnerStackClickId:_,partnerStackPartnerId:k}=y(C),{data:b,loading:S}=(0,x.HM7)({variables:{email:n,inviteCode:t,workspaceId:s},skip:!t||!n}),E=!v||i||S,N=b&&s&&"new"===s;(0,d.useEffect)(()=>{v&&!i&&e&&b&&!b.workspaceInvitation&&g("/")},[v,e,i,g,"/",b]);let I=(0,m.Sp)();return(0,w.gF)()?(0,r.jsx)(u.H$,{scenario:j._M.ACCEPT_WORKSPACE_INVITATION,"data-testid":"workspace-invitation-wrapper",children:E?(0,r.jsx)(l.$,{}):b&&b.workspaceInvitation?(0,r.jsxs)(u.h3,{lede:N?(0,r.jsxs)(r.Fragment,{children:["\uD83D\uDC4B ",(0,r.jsx)(o.cC,{id:"uzTaYi"})]}):(0,r.jsxs)(r.Fragment,{children:["\uD83C\uDF89 ",(0,r.jsx)(o.cC,{id:"5fucMx"})]}),title:N?(0,r.jsx)(o.cC,{id:"DbYuFS",values:{GAMMA_PROPER_NOUN:h.N6}}):e?b.workspaceInvitation.workspaceName?(0,r.jsx)(o.cC,{id:"2wwLHe",values:{0:b.workspaceInvitation.workspaceName}}):(0,r.jsx)(o.cC,{id:"EsVYoc"}):b.workspaceInvitation.workspaceName?(0,r.jsx)(o.cC,{id:"L3SXbi",values:{0:b.workspaceInvitation.workspaceName}}):(0,r.jsx)(o.cC,{id:"VlXlD9"}),showFooter:!0,showLogo:!0,children:[N?(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"l+wpFJ"})}):(0,r.jsx)(a.x,{children:b.workspaceInvitation.workspaceName?(0,r.jsx)(o.cC,{id:"s2FywE",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:h.aq,0:b.workspaceInvitation.workspaceName}}):(0,r.jsx)(o.cC,{id:"H/y2ny",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:h.aq}})}),I?(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"9iyJp1",values:{GAMMA_PROPER_NOUN:h.N6}})}):e?(0,r.jsx)(eI,{scenario:j._M.ACCEPT_WORKSPACE_INVITATION,inviteCode:t,workspaceId:s}):(0,r.jsx)(e_,{scenario:j._M.ACCEPT_WORKSPACE_INVITATION,redirectTo:"/",inviteCode:t,referredBy:f,workspaceId:s,inviteeEmail:n,partnerStackPartnerId:k,partnerStackClickId:_})]}):(0,r.jsx)(eA,{email:n})}):(0,r.jsx)(r.Fragment,{})},eA=e=>{let{email:i}=e;return(0,r.jsx)(u.h3,{lede:(0,r.jsxs)(r.Fragment,{children:["\uD83D\uDE41 ",(0,r.jsx)(o.cC,{id:"uAjg3Y"})]}),title:(0,r.jsx)(o.cC,{id:"0dimUT"}),showFooter:!0,showLogo:!0,children:i?(0,r.jsx)(o.cC,{id:"rpHTpL",values:{email:i}}):(0,r.jsx)(o.cC,{id:"VSc47y"})})};var eO=s(97010),eP=s(36371),eT=s(73582),eD=s(2969),eM=s(3181),eU=s(13272),eF=s(82655),eL=s(76332),ez=s(88232),eG=s(34881),eW=s(89606),eH=s(10649),eB=s(49152),eK=s(43102),eq=s(17324),eJ=s(82245);let eV=()=>(0,r.jsx)(u.h3,{title:(0,r.jsx)(r.Fragment,{}),showLogo:!0,children:(0,r.jsx)(N.k,{w:"100%",h:"100%",align:"center",justify:"center",children:(0,r.jsx)(l.$,{})})}),eY=e=>{let{email:i,code:s,redirectTo:n,workspaceId:t,workspaceInviteCode:l,flow:c}=e,x=(0,eB.l)(),{user:j,isUserLoading:h,refetch:C}=(0,p.SE)(),{push:m}=(0,d.useContext)(u.mU),[g,v]=(0,d.useState)(x);(0,eK.m)(g);let[f,w]=(0,d.useState)(""),[_,k]=(0,d.useState)(""),[b,y]=(0,d.useState)(""),[S,E]=(0,d.useState)([]),[N,R]=(0,d.useState)(!1),A=f.length>0&&_.length>0&&b.length>0&&!S.length,O=(0,B.K)(),U=(0,d.useMemo)(()=>O.get(),[O]),[L,{loading:z,error:G}]=(0,eL.BlB)(),[W]=(0,eL.m9m)(),H=(0,d.useCallback)(()=>{m((0,r.jsx)(eQ,{redirectTo:n,flow:c}))},[m,n,c]),q=(0,d.useCallback)(e=>{e.preventDefault(),L({variables:{input:{email:i,password:b,firstName:f,lastName:_,code:s,invite:{flow:c,workspaceId:t,inviteCode:l}}}}).then(async e=>{var i,s,r,n,t;let l=null===(s=e.data)||void 0===s?void 0:null===(i=s.signup)||void 0===i?void 0:i.id,a=null===(t=e.data)||void 0===t?void 0:null===(n=t.signup)||void 0===n?void 0:null===(r=n.organizations)||void 0===r?void 0:r[0].id;if(!l){console.error("[Setup.onContinue] No userId for new user");return}await W({variables:{patch:(0,p.Yu)({set:{locale:g}})}}),await (null==C?void 0:C()),K.co.identify(l,{user_org_id:a,anonymous_user:!1,gamma_user_id:l}),K.co.track(K.AA.SIGNUP,{flow:c,provider:"password"},{context:U}),H()}).catch(e=>{console.error("[Setup.onContinue] Error signing up",e.message)})},[L,i,b,f,_,s,c,t,l,g,U,H,W,C]);return((0,d.useEffect)(()=>{h||(j?H():R(!0))},[h,j,H]),N)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(M.xu,{as:"form",onSubmit:q,children:[(0,r.jsxs)(I.K,{spacing:"5",children:[(0,r.jsxs)(P.NI,{children:[(0,r.jsx)(T.l,{htmlFor:"email",children:(0,r.jsx)(o.cC,{id:"O3oNi5"})}),(0,r.jsx)(D.I,{id:"email",type:"email",value:i,disabled:!0})]}),(0,r.jsxs)(P.NI,{children:[(0,r.jsx)(T.l,{htmlFor:"first name",children:(0,r.jsx)(o.cC,{id:"V1EGGU"})}),(0,r.jsx)(D.I,{id:"first name",type:"text",value:f,onChange:e=>w(e.currentTarget.value.slice(0,60)),autoFocus:!0})]}),(0,r.jsxs)(P.NI,{children:[(0,r.jsx)(T.l,{htmlFor:"last name",children:(0,r.jsx)(o.cC,{id:"1ZaQUH"})}
1),(0,r.jsx)(D.I,{id:"last name",type:"text",value:_,onChange:e=>k(e.currentTarget.value.slice(0,60))})]}),(0,r.jsxs)(P.NI,{children:[(0,r.jsxs)(T.l,{flexDir:"row",display:"flex",alignItems:"center",children:[(0,r.jsx)(o.cC,{id:"vXIe7J"}),(0,r.jsx)(F.L,{}),(0,r.jsx)(eh.C,{colorScheme:"green",children:(0,r.jsx)(o.cC,{id:"YBt9YP"})})]}),(0,r.jsx)(eW.p,{selectedLocale:eH.w$[g],onLocaleSelect:v})]}),(0,r.jsx)(er,{showHelp:!1,value:b,onChange:e=>{y(e.currentTarget.value),E(es(e.currentTarget.value))},error:null==G?void 0:G.message}),(0,r.jsx)(M.xu,{h:"6em",children:b.length>0&&S.length?(0,r.jsx)(a.x,{textColor:"red.500",fontSize:"sm",children:(0,r.jsx)(eO.QI,{listStyleType:"none",children:S.map((e,i)=>(0,r.jsx)(eO.HC,{children:e},i))})}):(0,r.jsx)(F.L,{})})]}),(0,r.jsx)(e0,{disabled:!A,onContinue:q,isLoading:z,showBack:!1})]}),(0,r.jsx)(F.L,{})]}):null},eX=e=>{let{hasError:i,onChange:s,name:n,placeholder:t,onBlur:l}=e;return(0,r.jsxs)(P.NI,{isInvalid:i,children:[(0,r.jsx)(T.l,{children:(0,r.jsx)(o.cC,{id:"CozWO1"})}),(0,r.jsx)(D.I,{size:"lg",type:"text",onChange:s,value:n,placeholder:t,onBlur:l}),i&&(0,r.jsx)($.J1,{children:(0,r.jsx)(o.cC,{id:"soNtuq",values:{WORKSPACE_NAME_MIN_LENGTH:C.My}})}),(0,r.jsxs)(P.Q6,{children:[(0,r.jsx)(o.cC,{id:"uCmOnS"})," ",(0,r.jsx)("span",{role:"img","aria-label":"thumbs up emoji",children:"\uD83D\uDC4D"})]})]})},eZ=(e,i)=>i?"team"===e?ee.ag._({id:"x8EWiU"}):ee.ag._({id:"dJdqM7",values:{0:i.displayName}}):ee.ag._({id:"CozWO1"}),eQ=e=>{let{redirectTo:i,flow:s}=e,{push:n}=(0,d.useContext)(u.mU),{user:t,isUserLoading:l,currentWorkspace:a,setSettings:c}=(0,p.SE)(),[x,j]=(0,d.useState)({team:"",personal:""}),[h,{loading:m}]=(0,eL.Mqp)(),[g,v]=(0,d.useState)({team:!1,personal:!1}),[f,w]=(0,d.useState)(0),_=0===f?"team":"personal",k=x[_],b=g[_],y=k.length<C.My||b,S=(0,d.useCallback)(()=>{n((0,r.jsx)(e$,{redirectTo:i}))},[n,i]),E=eZ(_,t);(0,d.useEffect)(()=>{t&&""===x.personal&&((0,eJ.A)(t.email)&&w(1),j(e=>({...e,personal:"".concat(t.displayName,"'s Workspace")})))},[t,x]),(0,d.useEffect)(()=>{!l&&t&&t.settings&&!t.settings.showWorkspaceSetup&&S()},[l,t,s,S]);let N=(0,d.useCallback)(()=>{h({variables:{input:{name:k,id:null==a?void 0:a.id}},fetchPolicy:"no-cache"}).then(async()=>{K.co.track(K.AA.WORKSPACE_CREATED,{workspace_type:_}),await (null==c?void 0:c({remove:["showWorkspaceSetup"]})),S()}).catch(e=>{console.error('[Welcome] Error updating workspace name for "'.concat(null==a?void 0:a.id,'"'),e.message)})},[h,k,null==a?void 0:a.id,_,c,S]),I=(0,d.useCallback)(e=>{e.length>=C.My?v(e=>({...e,[_]:!1})):v(e=>({...e,[_]:!0}))},[_]),R=(0,d.useCallback)(e=>{I(e.target.value),j(i=>({...i,[_]:e.target.value.slice(0,50)}))},[I,_]);return l||!t?(0,r.jsx)(eV,{}):(0,r.jsxs)(u.h3,{title:(0,r.jsx)(o.cC,{id:"9chYz/"}),showLogo:!0,children:[(0,r.jsx)(A.U,{children:(0,r.jsxs)(eP.m,{w:"100%",variant:"soft-rounded",size:"sm",index:f,onChange:e=>w(e),children:[(0,r.jsxs)(eT.t,{flexDirection:["column","row"],children:[(0,r.jsxs)(eD.O,{mx:1,children:[(0,r.jsx)(M.xu,{mr:2,children:(0,r.jsx)(z.G,{icon:eF.iOm})}),(0,r.jsx)(o.cC,{id:"0LZe9p"})]}),(0,r.jsxs)(eD.O,{mx:1,children:[(0,r.jsx)(M.xu,{mr:2,children:(0,r.jsx)(z.G,{icon:ej.V3X})}),(0,r.jsx)(o.cC,{id:"7MuXko"})]})]}),(0,r.jsxs)(eM.n,{children:[(0,r.jsx)(eU.x,{id:"team-or-company-tab-panel",p:0,pt:8,children:(0,r.jsx)(eX,{onChange:R,onBlur:e=>I(e.target.value),name:k,hasError:b,placeholder:E})}),(0,r.jsx)(eU.x,{id:"personal-tab-panel",p:0,pt:8,children:(0,r.jsx)(eX,{onChange:R,onBlur:e=>I(e.target.value),name:k,hasError:b,placeholder:E})})]})]})}),(0,r.jsx)(F.L,{}),(0,r.jsx)(e0,{disabled:y,onContinue:N,isLoading:m,showBack:!1})]})},e$=e=>{let{redirectTo:i}=e,{push:s}=(0,c.useRouter)(),{user:n,isUserLoading:t}=(0,p.SE)(),l=(0,d.useCallback)(()=>{s(i||(0,ez.wH)())},[s,i]);return((0,d.useEffect)(()=>{!t&&n&&n.jobFunction&&l()},[t,n,l]),t||!n)?(0,r.jsx)(eV,{}):(0,r.jsxs)(u.h3,{title:(0,r.jsx)(o.cC,{id:"H8aFPr"}),showLogo:!0,children:[(0,r.jsx)(eq.a,{context:"setup",onSuccess:l}),(0,r.jsx)(F.L,{})]})},e0=e=>{let{disabled:i,onContinue:s,isLoading:n,showBack:t}=e,{pop:l}=(0,d.useContext)(u.mU);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(A.U,{children:[t&&(0,r.jsx)(R.z,{variant:"ghost",onClick:()=>l(),children:(0,r.jsx)(o.cC,{id:"iH8pgl"})}),(0,r.jsx)(R.z,{type:"submit",variant:"solid",isDisabled:i,flex:1,onClick:s,isLoading:n,children:(0,r.jsx)(o.cC,{id:"xGVfLh"})})]}
1),(0,r.jsx)(M.xu,{h:6,children:"\xa0"})]})},e1=()=>{let{query:e,isReady:i,push:s}=(0,c.useRouter)(),n=(0,d.useRef)(e);n.current=e;let{user:t,isUserLoading:l}=(0,p.SE)(),{data:x,loading:j}=(0,eL.NmH)({variables:{input:{email:n.current.email,code:n.current.code}},skip:!n.current.email||!n.current.code}),C=!i||l||j,[g,v]=(0,d.useState)(!1);(0,d.useEffect)(()=>{if(C||g)return;t||(null==x?void 0:x.verifyCode.verified)||s("/signup?error=invalid_signup_code");let{searchParams:e}=new URL(window.location.href);e.delete("email"),e.delete("code"),(0,eG.lO)({query:Object.fromEntries(e.entries())}),v(!0),(0,em.j6)()},[C,g,s,t,n,x]);let f=(0,m.Sp)();return g?(0,r.jsx)(u.H$,{"data-testid":"signup-with-code",children:(0,r.jsx)(u.h3,{title:(0,r.jsx)(o.cC,{id:"cpE88+"}),showLogo:!0,children:f?(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"9iyJp1",values:{GAMMA_PROPER_NOUN:h.N6}})}):(0,r.jsx)(eY,{email:n.current.email,code:n.current.code,workspaceId:n.current.workspace,flow:n.current.flow,workspaceInviteCode:n.current.wcode,redirectTo:n.current.redirect_to})})}):null},e5=()=>{let e=(0,n.p)(),[i,s]=(0,d.useState)(""),{push:t}=(0,d.useContext)(u.mU),[l,{loading:c,error:j}]=(0,x.QnR)(),h=!!i.match(ef),p=(0,d.useCallback)(e=>{e.preventDefault(),l({variables:{input:{email:i,scenario:x.nUC.Reset}}}).then(e=>{var s;let{link:n,provider:l}=(null===(s=e.data)||void 0===s?void 0:s.sendCode)||{};t((0,r.jsx)(e3,{email:i,link:n,provider:l,resend:p}))}).catch(e=>{console.error("[Forgot.onSendClick] Error trying to send password reset link",e.message)})},[l,i,t]);return(0,d.useEffect)(()=>{j&&e({id:"reset_password_error",title:(0,r.jsx)(o.cC,{id:"Rh1Dte"}),status:"error",position:"top",duration:5e3})},[j,e]),(0,r.jsxs)(u.h3,{title:(0,r.jsx)(o.cC,{id:"RfwZxd"}),showLogo:!0,children:[(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"aj/hsq"})}),(0,r.jsx)(M.xu,{as:"form",onSubmit:p,children:(0,r.jsxs)(I.K,{spacing:5,children:[(0,r.jsxs)(P.NI,{children:[(0,r.jsx)(T.l,{htmlFor:"email",children:(0,r.jsx)(o.cC,{id:"O3oNi5"})}),(0,r.jsx)(D.I,{id:"email",type:"email",value:i,onChange:e=>s(e.currentTarget.value),autoFocus:!0})]}),(0,r.jsx)(R.z,{type:"submit",variant:"solid",isDisabled:!h,w:"100%",onClick:p,isLoading:c,children:(0,r.jsx)(o.cC,{id:"8+xXUn"})}),(0,r.jsxs)(a.x,{fontSize:"sm",textAlign:"center",mt:3,children:[(0,r.jsx)(o.cC,{id:"cVqf24"})," ",(0,r.jsx)(U.r,{color:"trueblue.500",href:"/signin",as:W(),children:(0,r.jsx)(o.cC,{id:"5lWFkC"})})]})]})}),(0,r.jsx)(F.L,{})]})},e3=e=>{let{email:i,link:s,provider:t,resend:l}=e,c=(0,n.p)();return(0,r.jsxs)(u.h3,{title:(0,r.jsx)(o.cC,{id:"XcX6up"}),children:[(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"P083h3",values:{email:i},components:{0:(0,r.jsx)("strong",{})}})}),(0,r.jsxs)(a.x,{fontSize:"sm",textAlign:"center",mt:3,children:[(0,r.jsx)(o.cC,{id:"rRHK5M"})," ",(0,r.jsx)(U.r,{color:"trueblue.500",onClick:e=>{c({id:"link_resent",title:(0,r.jsx)(o.cC,{id:"lDVEsi"}),status:"success",position:"top",duration:5e3}),l(e)},children:(0,r.jsx)(o.cC,{id:"J/jxKQ"})})]}),(0,r.jsx)(I.K,{spacing:"6",children:(0,r.jsx)(ex.U,{in:i,children:s&&t&&(0,r.jsx)(R.z,{w:"100%",onClick:()=>window.open(s,"_blank"),variant:"plain",rightIcon:(0,r.jsx)(z.G,{icon:ej.wlW}),autoFocus:!0,children:(0,r.jsx)(o.cC,{id:"y1RN4W",values:{provider:t}})})})}),(0,r.jsx)(F.L,{})]})},e9=()=>{let e=(0,n.p)(),{query:{error:i}}=(0,c.useRouter)(),s=(0,w.gF)(),t=(0,m.Sp)()&&s;return(0,d.useEffect)(()=>{if(i&&i in H.T){let{title:s,description:n}=H.T[i]||{title:(0,r.jsx)(o.cC,{id:"U7nnQt"}),description:i};e.isActive("error")||e({id:"error",title:s,description:n,status:"error",position:"top",duration:null})}},[i,e]),(0,r.jsx)(u.H$,{"data-testid":"reset-password",children:t?(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"jO28tJ",values:{GAMMA_PROPER_NOUN:h.N6}})}):(0,r.jsx)(e5,{})})},e2=e=>{let{email:i,code:s}=e,t=(0,n.p)(),[l,j]=(0,d.useState)(""),[h,C]=(0,d.useState)([]),m=l.length>0&&!h.length,{push:g}=(0,c.useRouter)(),{refetch:v}=(0,p.SE)(),[f,{loading:w}]=(0,x.gL8)(),_=(0,d.useCallback)(e=>{e.preventDefault(),f({variables:{input:{email:i,code:s,newPassword:l}}}).then(()=>{t({id:"password-changed",title:(0,r.jsx)(o.cC,{id:"a+l/oL"}),status:"success",position:"top",duration:5e3}),null==v||v(),g("/")}
1).catch(e=>{console.error("[Reset.onResetClick] Error trying to send password reset link",e.message)})},[f,i,s,l,t,v,g]);return(0,r.jsxs)(u.h3,{title:(0,r.jsx)(o.cC,{id:"slOprG"}),showLogo:!0,children:[(0,r.jsxs)(M.xu,{as:"form",onSubmit:_,children:[(0,r.jsxs)(I.K,{spacing:"5",mb:4,children:[(0,r.jsx)(er,{showHelp:!0,label:(0,r.jsx)(o.cC,{id:"VpwcSk"}),value:l,onChange:e=>{j(e.currentTarget.value),C(es(e.currentTarget.value))}}),(0,r.jsx)(M.xu,{minH:"4em",children:l.length>0&&h.length?(0,r.jsx)(a.x,{textColor:"red.500",fontSize:"sm",children:(0,r.jsx)(eO.QI,{listStyleType:"none",m:0,children:h.map((e,i)=>(0,r.jsx)(eO.HC,{children:e},i))})}):(0,r.jsx)(F.L,{})})]}),(0,r.jsx)(R.z,{type:"submit",variant:"solid",isDisabled:!m,onClick:_,isLoading:w,children:(0,r.jsx)(o.cC,{id:"RfwZxd"})})]}),(0,r.jsx)(F.L,{})]})},e8=()=>{let{query:{email:e,code:i},isReady:s,push:n}=(0,c.useRouter)(),t=(0,w.gF)(),l=(0,m.Sp)()&&t,{data:j,loading:p}=(0,x.NmH)({variables:{input:{email:e,code:i}},skip:!e||!i}),C=!s||p,[g,v]=(0,d.useState)(!1);return((0,d.useEffect)(()=>{if(C||g)return;j&&j.verifyCode.verified||n("/forgot?error=invalid_reset_code");let{searchParams:e}=new URL(window.location.href);e.delete("email"),e.delete("code"),(0,eG.lO)({query:Object.fromEntries(e.entries())}),v(!0)},[C,g,j,n]),g)?(0,r.jsx)(u.H$,{"data-testid":"reset-password",children:l?(0,r.jsx)(a.x,{children:(0,r.jsx)(o.cC,{id:"jO28tJ",values:{GAMMA_PROPER_NOUN:h.N6}})}):(0,r.jsx)(e2,{email:e,code:i})}):null}}}]); 2//# sourceMappingURL=1815-848deb9fca048d08.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.