1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4490],{697:(n,e,t)=>{t.d(e,{A:()=>i});function i(n){try{return new URL(n),!0}catch(n){return!1}}},34490:(n,e,t)=>{t.d(e,{A:()=>Y});var i=t(28888),r=t(18153),o=t(64177),s=t(79350),a=t(38993),l=t(93295),c=t(2189),u=t(48230),d=t.n(u),p=t(89099),g=t(14232),h=t(454),x=t(71321),m=t.n(x),f=t(16679),b=t(76312),w=t(97939),v=t(38950),_=t(76466),k=t(24227),j=t(22887);async function y(n){try{let e=await new Promise(e=>{window.grecaptcha.ready(()=>{window.grecaptcha.execute(j.ko,n).then(n=>{e(n)})})});await fetch("/api/recaptcha",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,...n})})}catch(n){}}var C=t(697),S=t(14e3),A=t(35366),P=t(6226);function R(){let n=(0,i._)(["\n mutation web_registerWithApple($input: AppleAuthInput!) {\n registerWithApple(input: $input)\n }\n "]);return R=function(){return n},n}function L(){let n=(0,i._)(["\n mutation web_loginWithApple($input: AppleAuthInput!) {\n loginWithApple(input: $input)\n }\n "]);return L=function(){return n},n}function T(){let n=(0,i._)(["\n background: transparent;\n width: 100%;\n height: 48px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n border: 1px solid ",";\n box-shadow: ",";\n border-radius: ",";\n cursor: pointer;\n "]);return T=function(){return n},n}let I=j.tA,O={register:(0,s.J1)(R()),login:(0,s.J1)(L())};function E(n){let{type:e,onSubmit:t,onSuccess:i,onError:s}=n,l=(0,v.A)(),u=(0,S.useSearchParams)(),d=u.get("surface")||void 0,p=u.get("referrer_path")||void 0,[h]=(0,o.n)(O[e],{onError:s,onCompleted:i}),x={button:(0,a.css)(T(),f.Colors.variables.borderPrimary,f.Shadows.xs,f.Radius.md)},m=(0,g.useCallback)(async n=>{var i,r;let{authorization:o}=n,{id_token:s}=o;null==t||t(s),l.track(b.w.AUTH,{action:"submit",method:"apple",type:e,reason:c.Ru._({id:"a31JHu"})});let a=await h({variables:{input:{appleToken:s}}}),u=(null==(i=a.data)?void 0:i.loginWithApple)||(null==(r=a.data)?void 0:r.registerWithApple);u&&l.track(b.w.AUTH_LOGIN,{userId:u,surface:d,referrerPath:p&&decodeURIComponent(p||""),reason:c.Ru._({id:"o7DZ+y"})})},[l,h,t,e,p,d]),w=(0,g.useCallback)(n=>{y({action:"apple_login"}),n.onClick()},[]),_=(0,g.useMemo)(()=>{let n=window.location.href;return n.includes("development.pie-staging.org")?"https://development.pie-staging.org:8080/":n.includes("pie-staging.org")?n.includes("www")?"https://www.pie-staging.org/":"https://pie-staging.org/":n.includes("www")?"https://www.pie.org/":"https://pie.org/"},[]);return(0,r.jsx)(A.Ay,{authOptions:{clientId:I,scope:"name email",redirectURI:_,nonce:"nonce",usePopup:!0},onSuccess:m,onError:s,uiType:"light",render:n=>(0,r.jsx)("button",{css:x.button,type:"button",onClick:()=>w(n),"aria-label":"Login with Apple",children:(0,r.jsx)(P.D7X,{size:24,color:f.Colors.variables.textPrimary})})})}var G=t(57776),H=t(18552);function W(){let n=(0,i._)(["\n mutation web_loginWithGoogle($input: GoogleAuthInput!) {\n loginWithGoogle(input: $input)\n }\n "]);return W=function(){return n},n}function B(){let n=(0,i._)(["\n mutation web_registerWithGoogle($input: GoogleAuthInput!) {\n registerWithGoogle(input: $input)\n }\n "]);return B=function(){return n},n}function J(){let n=(0,i._)(["\n background: ",";\n width: 100%;\n height: 48px;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n border: 1px solid ",";\n box-shadow: ",";\n border-radius: ",";\n cursor: pointer;\n "]);return J=function(){return n},n}let U={login:(0,s.J1)(W()),register:(0,s.J1)(B())};function D(n){let{type:e,onSubmit:t,onError:i,onSuccess:s}=n,l=(0,v.A)(),u=(0,S.useSearchParams)(),d=u.get("surface")||void 0,p=u.get("referrer_path")||void 0,[h]=(0,o.n)(U[e],{onError:i,onCompleted:s}),x={button:(0,a.css)(J(),f.Colors.variables.bgPrimary,f.Colors.variables.borderPrimary,f.Shadows.xs,f.Radius.md)},m=(0,G.mg)({flow:"auth-code",onSuccess:async n=>{var i,r;let{code:o}=n;null==t||t(o),l.track(b.w.AUTH,{action:"submit",method:"google",type:e,reason:c.Ru._({id:"a31JHu"})});let s=await h({variables:{input:{googleToken:o}}}),a=(null==(i=s.data)?void 0:i.loginWithGoogle)||(null==(r=s.data)?void 0:r.registerWithGoogle);a&&l.track(b.w.AUTH_LOGIN,{userId:a,surface:d,referrerPath:p&&decodeURIComponent(p||""),reason:c.Ru._({id:"o7DZ+y"})})}}),w=(0,g.useCallback)(async()=>{y({action:"google_login"}),l.track(b.w.AUTH,{action:"click",method:"google",type:e,reason:c.Ru._({id:"a31JHu"})}),m()},[m,l,e]);return(0,r.jsx)("button",{css:x.button,type:"button",onClick:w,"aria-label":"Login with Google",children:(0,r.jsx)("img",{src:H.A.google,alt:"Google Logo",style:{width:"24px",height:"24px"}})})}function $(){let n=(0,i._)(["\n mutation web_generateOneTimePassword($input: GenerateOneTimePasswordInput!) {\n generateOneTimePassword(input: $input)\n }\n "]);return $=function(){return n},n}function z(){let n=(0,i._)(["\n color: ",";\n font-size: ",";\n font-weight: 400;\n line-height: ",";\n margin-top: ",";\n width: 100%;\n "]);return z=function(){return n},n}function F(){let n=(0,i._)(["\n ",";\n font-weight: 600;\n "]);return F=function(){return n},n}function N(){let n=(0,i._)(["\n display: flex;\n align-items: center;\n flex-direction: column;\n width: 100%;\n "]);return N=function(){return n},n}function Q(){let n=(0,i._)(["\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: ",";
1\n margin-bottom: calc("," + 10px);\n "]);return Q=function(){return n},n}function q(){let n=(0,i._)(["\n width: 100%;\n text-align: center;\n border-bottom: 1px solid ",";\n line-height: 0.1em;\n margin-bottom: calc("," + 10px);\n "]);return q=function(){return n},n}function M(){let n=(0,i._)(["\n color: ",";\n font-size: ",";\n font-weight: 500;\n line-height: 0px;\n padding: 0 ",";\n background: ",";\n "]);return M=function(){return n},n}function Z(){let n=(0,i._)(["\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: ",";\n margin-bottom: ",";\n "]);return Z=function(){return n},n}function K(){let n=(0,i._)(["\n ",";\n color: ",";\n margin-bottom: ",";\n "]);return K=function(){return n},n}function V(){let n=(0,i._)(["\n width: 100%;\n "]);return V=function(){return n},n}function X(){let n=(0,i._)(["\n ",";\n color: ",";\n margin-top: ",";\n "]);return X=function(){return n},n}function Y(n){let{type:e,onTypeToggle:t,redirectTo:i,onOtpSubmit:u,hideTypeToggle:x,showOnboardingTypeToggle:S}=n,A=(0,p.useRouter)(),P=(0,v.A)(),[,R]=(0,h.lT)(),[L]=(0,_.A)(),[T,I]=(0,g.useState)(""),[O,G]=(0,g.useState)(""),[H,W]=(0,g.useState)(""),[B,J]=(0,g.useState)(!1),{_:U}=(0,l.uB)(),{refetch:Y}=(0,k.A)(),[nn,{loading:ne}]=(0,o.n)((0,s.J1)($())),[nt]=(0,o.n)(w.Ph),ni=m().isEmail(T),nr={disclaimer:(0,a.css)(z(),f.Colors.variables.textQuaternary,f.FontSizes.xs,f.LineHeights.sm,f.Spacing.lg),disclaimerLink:(0,a.css)(F(),f.Fonts.xs)};(0,g.useEffect)(()=>{(null==L?void 0:L.country)==="US"&&J(!0)},[L]);let no=(0,g.useCallback)(async n=>{let t;if(null==n||n.preventDefault(),G(""),!m().isEmail(T))return void G(c.Ru._({id:"Wq6Wcm"}));P.track(b.w.AUTH,{action:"click",method:"otp",type:e,reason:c.Ru._({id:"a31JHu"})},{email:T}),y({action:"request_otp"}),"error"in(t=await nn({variables:{input:{destination:T.trim().toLowerCase()}}}))&&t.error?G(c.Ru._({id:"gcVPIA"})):("register"===e&&R("emails-marketing",B,{path:"/",domain:j.w9,expires:new Date(Date.now()+3e5)}),u(T))},[P,T,B,u,nn,R,e]),ns=(0,g.useCallback)(()=>{W("")},[]),na=(0,g.useCallback)(n=>{W(c.Ru._({id:"gcVPIA"}))},[]),nl=(0,g.useCallback)(async()=>{Y(),"register"===e&&await nt({variables:{name:"EMAILS_MARKETING",value:JSON.stringify(B)}}),i&&(0,C.A)(i)?window.location.href=i:A.push(i||"/")},[B,i,Y,A,e,nt]),nc=(0,g.useCallback)(()=>{t("login"===e?"register":"login")},[t,e]),nu="register"===e?c.Ru._({id:"6+Ld8T"}):c.Ru._({id:"sQia9P"});return(0,r.jsxs)("div",{css:(0,a.css)(N()),children:[(0,r.jsxs)("div",{css:(0,a.css)(Q(),f.Spacing.lg,S?f.Spacing.xl:f.Spacing.xl2),children:[(0,r.jsx)(D,{onSuccess:nl,onError:na,onSubmit:ns,type:e}),(0,r.jsx)(E,{onSuccess:nl,onError:na,onSubmit:ns,type:e})]}),H&&(0,r.jsx)(f.Banner,{variant:"error",copy:H}),(0,r.jsx)("div",{css:(0,a.css)(q(),f.Colors.variables.borderSecondary,S?f.Spacing.xl:f.Spacing.xl2),children:(0,r.jsx)("span",{css:(0,a.css)(M(),f.Colors.variables.textTertiary,f.FontSizes.sm,f.Spacing.md,f.Colors.variables.bgPrimary),children:(0,r.jsx)(l.x6,{id:"BzEFor"})})}),(0,r.jsxs)("form",{onSubmit:no,css:(0,a.css)(Z(),f.Spacing.lg,f.Spacing.xl),children:[(0,r.jsx)(f.Input,{type:"text",placeholder:U(c.Ru._({id:"O3oNi5"})),onChange:n=>I(n.target.value),value:T}),(0,r.jsx)(f.Button,{onClick:no,disabled:!ni,loading:ne,children:nu})]}),S&&(0,r.jsxs)("span",{css:(0,a.css)(K(),f.Fonts.sm,f.Colors.variables.textPrimary,f.Spacing.xl3),children:["register"===e?(0,r.jsx)(l.x6,{id:"db5CDd"}):(0,r.jsx)(l.x6,{id:"vrnLPD"}),(0,r.jsxs)(f.Button,{variant:"link",color:"brand",onClick:nc,element:"span",inline:!0,children:["\xa0","register"===e?c.Ru._({id:"sQia9P"}):c.Ru._({id:"6+Ld8T"})]})]}),O&&(0,r.jsx)(f.Banner,{variant:"error",copy:O}),"register"===e&&(0,r.jsx)("div",{css:(0,a.css)(V()),children:(0,r.jsx)(f.Checkbox,{id:"emails",type:"checkbox",label:c.Ru._({id:"tzxSuh"}),size:"sm",checked:B,onChange:n=>{J(n.currentTarget.checked)}})}),(0,r.jsxs)("div",{css:nr.disclaimer,children:[(0,r.jsxs)("span",{children:[(0,r.jsx)(l.x6,{id:"91rv9P"}),"\xa0"]}),(0,r.jsx)(d(),{href:"/terms",target:"_blank",children:(0,r.jsx)(f.Button,{variant:"link",element:"span",inline:!0,cssOverrides:nr.disclaimerLink,children:(0,r.jsx)(l.x6,{id:"4Y5H+g"})})}),"\xa0&\xa0",(0,r.jsx)(d(),{href:"/privacy",target:"_blank",children:(0,r.jsx)(f.Button,{variant:"link",element:"span",inline:!0,cssOverrides:nr.disclaimerLink,children:(0,r.jsx)(l.x6,{id:"LcET2C"})})}),"."]}),(0,r.jsxs)("div",{css:nr.disclaimer,children:[(0,r.jsx)(l.x6,{id:"lyKqyS"}),"\xa0",(0,r.jsx)(d(),{href:"https://policies.google.com/privacy",target:"_blank",children:(0,r.jsx)(f.Button,{variant:"link",element:"span",inline:!0,cssOverrides:nr.disclaimerLink,children:(0,r.jsx)(l.x6,{id:"LcET2C"})})}),"\xa0",(0,r.jsx)(l.x6,{id:"HZFm5R"}),"\xa0",(0,r.jsx)(d(),{href:"https://policies.google.com/terms",target:"_blank",children:(0,r.jsx)(f.Button,{variant:"link",element:"span",inline:!0,cssOverrides:nr.disclaimerLink,children:(0,r.jsx)(l.x6,{id:"xowcRf"})})}),"\xa0",(0,r.jsx)(l.x6,{id:"EOoUHF"}),"."]}),!x&&(0,r.jsxs)("span",{css:(0,a.css)(X(),f.Fonts.sm,f.Colors.variables.textPrimary,f.Spacing.xl2),children:["register"===e?(0,r.jsx)(l.x6,{id:"db5CDd"}):(0,r.jsx)(l.x6,{id:"vrnLPD"}),(0,r.jsxs)(f.Button,{variant:"link",color:"brand",onClick:nc,element:"span",inline:!0,children:["\xa0","register"===e?c.Ru._({id:"sQia9P"}):c.Ru._({id:"6+Ld8T"})]})]})]})}}}]);
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.