(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[48185],{966224:(e,t,o)=>{o.d(t,{Z:()=>a});var n=o(898781),i=o(883119),l=o(785893);function a({accessibilityLabel:e,fixedPosition:t,rounding:o}){const a=(0,n.ZP)();return(0,l.jsxs)(i.xu,{children:[(0,l.jsx)(i.xu,{alignItems:"center",bottom:!0,display:"flex",justifyContent:"center",left:!0,opacity:1,position:t?"fixed":"absolute",right:!0,top:!0,zIndex:new i.Ry(101),children:(0,l.jsx)(i.$j,{accessibilityLabel:e||a.bt("Loading", "Loading", "Label for loading spinner", undefined, true),show:!0})}),(0,l.jsx)(i.xu,{bottom:!0,color:"default",left:!0,opacity:.7,position:t?"fixed":"absolute",right:!0,top:!0,zIndex:new i.Ry(100),rounding:o})]})}},45993:(e,t,o)=>{o.d(t,{Z:()=>a});var n=o(898781),i=o(883119),l=o(785893);function a({color:e,onClick:t,overrideText:o}){const a=(0,n.ZP)(),s=o||a.bt("Got it", "Got it", "Acknowledge protected account modal message", undefined, true);return(0,l.jsx)(i.zx,{fullWidth:!0,accessibilityLabel:s,color:e||"gray",onClick:t,text:s})}},593559:(e,t,o)=>{o.d(t,{Z:()=>c});var n=o(667294),i=o(124580),l=o(223815),a=o(662730),s=o(883119),r=o(785893);function c({children:e,headingNode:t,heading:o,onDismiss:c,size:d}){return(0,n.useEffect)((()=>(i.Z.pause(),function(){i.Z.resume()})),[]),(0,r.jsx)(s.mh,{zIndex:a.C,children:(0,r.jsx)(l.Z,{allowEsc:!0,children:(0,r.jsx)(s.u_,{accessibilityModalLabel:o,heading:t||o,onDismiss:()=>{i.Z.resume(),c()},role:"alertdialog",size:d||"md",padding:"none",children:e})})})}},576494:(e,t,o)=>{o.d(t,{Z:()=>_});var n=o(667294),i=o(45993),l=o(593559),a=o(898781),s=o(349700),r=o(333071),c=o(883119),d=o(785893);function _({onClose:e}){const t=(0,a.ZP)(),o=t.bt("Common reasons for account deactivation include:", "Common reasons for account deactivation include:", " - ", undefined, true),_=t.bt("{{ help_link }} if you have questions or would like to reactivate your account.", "{{ help_link }} if you have questions or would like to reactivate your account.", " - ", undefined, true),u=[t.bt("Violating Pinterest Community Guidelines.", "Violating Pinterest Community Guidelines.", "One example reason for account deactivation", undefined, true),t.bt("We noticed unusual activity on your account.", "We noticed unusual activity on your account.", "One example reason for account deactivation", undefined, true),t.bt("You requested an account closure.", "You requested an account closure.", "One example reason for account deactivation", undefined, true)];return(0,d.jsx)(l.Z,{heading:t.bt("Your account has been deactivated", "Your account has been deactivated", "Modal heading for user who have attempted to login with a deactivated account", undefined, true),onDismiss:e,size:"md",children:(0,d.jsxs)(c.xu,{paddingX:6,marginBottom:4,children:[(0,d.jsxs)(c.xu,{marginBottom:4,children:[(0,d.jsxs)(c.xv,{children:[" ",o," "]}),(0,d.jsx)(c.xu,{paddingY:2,children:(0,d.jsx)(n.Fragment,{children:u.map((e=>(0,d.jsx)(c.xv,{children:"• "+e},`reasons-${e}`)))})}),(0,d.jsx)(c.xv,{inline:!0,children:(0,s.nk)(_,{help_link:(0,d.jsx)(r.q,{},"suspended user help_link")})})]}),(0,d.jsx)(c.xu,{marginTop:4,children:(0,d.jsx)(i.Z,{color:"red",onClick:e,overrideText:t.bt("Got it", "Got it", "Acknowledge suspended account modal message", undefined, true)})})]})})}},333071:(e,t,o)=>{o.d(t,{q:()=>a});var n=o(898781),i=o(883119),l=o(785893);const a=()=>{const e=(0,n.ZP)();return(0,l.jsx)(i.rU,{display:"inlineBlock",href:"https://help.pinterest.com/login-request?what_do_you_need_help_with=Getting+into+my+account&tell_more_account_access=Appeal+account+suspension",onClick:({dangerouslyDisableOnNavigation:e})=>e(),underline:"hover",children:e.bt("Contact us", "Contact us", "link text shown to redirect to help.pinterest.com for appealing a suspension", undefined, true)})}},872349:(e,t,o)=>{o.d(t,{Z:()=>g});var n=o(667294),i=o(829407),l=o(898781),a=o(883119),s=o(785893);function r({handleSignup:e,handleLogin:t}){const o=(0,l.ZP)(),[r,c]=(0,n.useState)(!1),d=(0,n.useRef)(null);return(0,i.Z)((()=>{let t;return d.current=window.setTimeout((()=>{t=window.requestAnimationFrame((()=>{c(!0)})),e()}),2e3),()=>{d.current&&window.clearTimeout(d.current),t&&window.cancelAnimationFrame(t)}})),(0,s.jsxs)(a.kC,{alignItems:"center",direction:"column",flex:"grow",justifyContent:"center",children:[(0,s.jsx)(a.xu,{children:(0,s.jsx)(a.xv,{align:"center",weight:"bold",children:(0,s.jsx)("span",{className:"deprecatedTextSizeXL",children:r?o.bt("Finishing up...", "Finishing up...", "Title of a dialog telling the user that an account is almost done being created.", undefined, true):o.bt("Creating your account...", "Creating your account...", "Title of a dialog telling the user that an account is being created.", undefined, true)})})}),(0,s.jsx)(a.xu,{paddingY:4,children:(0,s.jsx)(a.$j,{accessibilityLabel:o.bt("Account is being created", "Account is being created", "Accessibility label for account creation loading dialog", undefined, true),show:!0})}),r?null:(0,s.jsx)(a.xu,{marginTop:2,children:(0,s.jsx)(a.xv,{inline:!0,align:"center",children:o.bt("Didn’t mean to create a new account?", "Didn’t mean to create a new account?", "Description text telling the user that they can log in if they did not intend to create a new account", undefined, true)})}),r?null:(0,s.jsx)(a.xu,{children:(0,s.jsx)(a.xv,{inline:!0,align:"center",children:(0,s.jsx)(a.rU,{display:"inlineBlock",href:"/login",onClick:({event:e,dangerouslyDisableOnNavigation:o})=>{o(),d.current&&window.clearTimeout(d.current),e&&(e.preventDefault(),e.stopPropagation()),t()},underline:"hover",children:o.bt("Click here to log in.", "Click here to log in.", "Login button which will show the login modal and enable the user to log in", undefined, true)})})})]})}var c=o(966224),d=o(563387),_=o(112690);const u=({children:e})=>(0,s.jsx)(a.xu,{bottom:!0,left:!0,opacity:1,position:"fixed",right:!0,top:!0,zIndex:new a.Ry(1e3),dangerouslySetInlineStyle:{__style:{backgroundColor:"rgba(0, 0, 0, 0.6)"}},children:(0,s.jsx)(a.xu,{color:"default",direction:"column",display:"flex",margin:6,padding:7,position:"fixed",right:!0,rounding:2,top:!0,width:376,children:e})});function g({handleCancelClick:e,handleConfirmSignup:t,handleShowLogin:o,step:g}){const h=(0,l.ZP)(),[p,m]=(0,n.useState)(!1),y=(0,_.Z)(),x={view_type:10,view_parameter:3202};(0,i.Z)((()=>(y({event_type:120,view_parameter:x.view_parameter}),document.body&&(document.body.style.overflow="hidden"),()=>{document.body&&(document.body.style.overflow="")})));const f=()=>{y({...x,event_type:101,element:30}),o()};return(0,s.jsx)(u,{children:"delayedSignupLoadingSpinner"===g?(0,s.jsx)(r,{handleLogin:f,handleSignup:()=>{y({...x,event_type:101,element:31}),t()}}):(0,s.jsxs)(a.xu,{children:[p?(0,s.jsx)(c.Z,{}):null,(0,s.jsx)(a.xu,{display:"inlineBlock",position:"absolute",top:!0,right:!0,marginTop:2,marginEnd:2,children:(0,s.jsx)(a.hU,{accessibilityLabel:h.bt("Cancel", "Cancel", "Button to close the signup/login modal", undefined, true),icon:"cancel",onClick:()=>{y({...x,event_type:101,element:73}),e()},size:"sm",iconColor:"gray"})}),(0,s.jsx)(a.xv,{align:"start",weight:"bold",children:(0,s.jsx)("span",{className:"deprecatedTextSizeXL",children:h.bt("Continue to Pinterest", "Continue to Pinterest", "Title of a dialog telling enabling the user to continue with sign up or log in", undefined, true)})}),(0,s.jsx)(a.xu,{marginTop:2,children:(0,s.jsx)(a.xv,{align:"start",children:h.bt("Hmm, it looks like you don't have an account yet. Let's get started!", "Hmm, it looks like you don't have an account yet. Let's get started!", "Description text of a dialog asking the user to sign up for a Pinterest account", undefined, true)})}),(0,s.jsx)(a.xu,{marginTop:5,children:(0,s.jsx)(a.zx,{fullWidth:!0,color:"red",onClick:()=>{y({...x,event_type:101,element:31}),m(!0),t()},text:h.bt("Sign up", "Sign up", "Text on a button which will create an account when clicked", undefined, true)})}),(0,s.jsx)(a.xu,{marginTop:2,children:(0,s.jsx)(a.zx,{fullWidth:!0,color:"gray",onClick:f,text:h.bt("Log in using a different method", "Log in using a different method", "Text on a button which will take the user to login when clicked.", undefined, true)})}),"staticSignupLoginWithTOS"===g?(0,s.jsx)(a.xu,{marginTop:4,marginStart:4,marginEnd:4,children:(0,s.jsx)(d.Z,{dark:!0})}):null]})})}},563387:(e,t,o)=>{o.d(t,{E:()=>r,Z:()=>c});var n=o(898781),i=o(349700),l=o(883119),a=o(966113),s=o(785893);const r="\n.TermsOfService__light a {\n  color: rgba(255,255,255,0.9);\n}\n";function c({dark:e}){const t=(0,n.ZP)();return(0,s.jsx)("div",{style:{marginTop:"12px"},children:(0,s.jsx)("span",{"data-test-id":"terms-of-service",className:e?"":"TermsOfService__light",style:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",fontSize:"11px",fontWeight:"normal",textAlign:"center",WebkitTransition:"opacity .2s linear",transition:"opacity .2s linear",...e?{color:"#767676",width:"224px"}:{color:"rgba(255,255,255,0.9)",lineHeight:"150%",margin:"10px auto",textShadow:"0 1px rgba(0,0,0,0.18)",width:"272px"}},children:(0,s.jsx)("span",{children:(0,i.nk)(t.bt("By continuing, you agree to Pinterest's {{ tos }} and acknowledge that you've read our {{ privacyPolicy }}. {{ noticeAtCollection }}.", "By continuing, you agree to Pinterest's {{ tos }} and acknowledge you've read our {{ privacyPolicy }}. {{ noticeAtCollection }}.", "termOfService.text", undefined, true),{tos:(0,s.jsx)(l.xu,{"data-test-id":"tos",display:"inlineBlock",dangerouslySetInlineStyle:{__style:{fontWeight:"bold",color:"#111"}},children:(0,s.jsx)(l.rU,{display:"inlineBlock",target:"blank",href:a.U5,underline:"hover",children:t.bt("Terms of Service", "Terms of Service", "termOfService.link.tos", undefined, true)},"tos")},"tos"),privacyPolicy:(0,s.jsx)(l.xu,{"data-test-id":"privacy",display:"inlineBlock",dangerouslySetInlineStyle:{__style:{fontWeight:"bold",color:"#111"}},children:(0,s.jsx)(l.rU,{display:"inlineBlock",target:"blank",href:"/_/_/policy/privacy-policy/",underline:"hover",children:t.bt("Privacy Policy", "Privacy Policy", "termOfService.link.privacyPolicy", undefined, true)},"privacy")},"privacy"),noticeAtCollection:(0,s.jsx)(l.xu,{"data-test-id":"noticeAtCollection",display:"inlineBlock",dangerouslySetInlineStyle:{__style:{fontWeight:"bold",color:"#111"}},children:(0,s.jsx)(l.rU,{display:"inlineBlock",target:"blank",href:a.cv,underline:"hover",children:t.bt("Notice at collection", "Notice at collection", "termOfService.link.noticeAtCollection", undefined, true)},"noticeAtCollection")},"noticeAtCollection")})})})})}},905171:(e,t,o)=>{o.d(t,{o:()=>s,x:()=>a});var n=o(667294),i=o(898781);const l=new Set,a=e=>{l.forEach((t=>t(e)))},s=e=>{const t=(0,i.ZP)();(0,n.useEffect)((()=>{const o=o=>{e(o||t.bt("Unknown error", "Unknown Error", "unauth.error.modal.unknown", undefined, true))};return l.add(o),()=>{l.delete(o)}}),[])}},85334:(e,t,o)=>{o.d(t,{Z:()=>w});var n=o(667294),i=o(231486),l=o(807998),a=o(383690),s=o(69642),r=o(584595),c=o(330102),d=o(290148),_=o(817656),u=o(532975),g=o(762752),h=o(407043),p=o(283943),m=o(214494),y=o(995146),x=o(867820),f=o(226198),v=o(529195);function w(){const e=(0,p.hq)(),t=(0,a.Z)(),{logContextEvent:o}=(0,h.v)(),w=(0,s.Z)();return(0,n.useCallback)((({creds:n,isAccountSwitch:a,loggingOptions:{loggingData:s=Object.freeze({}),loginAttemptContextEvent:h},recaptchaV2Token:p,recaptchaV3Token:k})=>{t();const b=!(!n.facebook_autologin&&!n.autologin),A=(0,d.eD)(n),P=e=>{const t=n.google_open_id_token?"google":"facebook";b&&(0,x.dy)({event:e,provider:t})};o({...h,event_type:7534}),w({action:b?"autologin":"login",event:"attempt",trigger:s.trigger,type:A});const T=e=>{let t="referrer_unknown";try{const e=document.referrer;t=e?e.indexOf("/t.co/")>-1?"twitter":e.indexOf("google.")>-1?"google":e.indexOf("bing.")>-1?"bing":e.indexOf("facebook.")>-1?"facebook":"other":"direct"}catch(r){}const i=s===Object(s)?s.container:"container_unknown";(0,x.My)("login.referrer."+t+"."+A),(0,x.My)("login.container."+String(i)+"."+A),(0,x.My)("login.type."+A);const l=A||"method_unknown",a=s.page||"page_unknown";n.facebook_autologin?((0,x.My)("web_autologin_facebook"),(0,x.My)("new_web_autologin_facebook",{page:a,referrer:t,container:i})):((0,x.My)(`web_login.${l}.success.${a}.${String(i)}.${t}.tier1`),(0,x.My)(`new_web_login.${l}.success`,{page:a,referrer:t,container:i})),(0,c.ko)({country:null==e?void 0:e.country,countryFromHostName:null==e?void 0:e.countryFromHostName,countryFromIp:null==e?void 0:e.countryFromIp,regionFromIp:null==e?void 0:e.regionFromIp,deviceType:"Desktop",eventCategory:"Logins"}),o({...h,event_type:7536}),w({action:b?"autologin":"login",event:"success",trigger:s&&s.trigger,type:A})},j=({error:e,isCrossDomain:t})=>{if(!e)return;const n=e.http_status===_.Ej?_.Ej:e.api_error_code;let i=n;n&&r.qF.has(n)&&(i=r.qF.get(n));const{container:l,trigger:a}=s;(0,x.My)(`${t?"unauth_web_client_cctld_login_api_error":"unauth_web_client_login_api_error"}.${String(i)}.${l||"unknow_container"}.${A}`),o({...h,event_type:7535}),w({action:b?"autologin":"login",event:"fail",trigger:a,type:A})};if(n.username_or_email&&!n.mfa_resend&&e&&-1!==l.Z.indexOf(e.origin)){const t=e=>(0,x.My)(`web_cross_domain_login.${e}.${(0,d.eD)(n)}`);t("attempt");const{referrer:o,facebookToken:i,unauthId:l}=e;return(0,y.pH)(n,{recaptchaV3Token:k,referrer:o,facebookToken:i,unauthId:l}).then((e=>{const o=e&&e.data;if(o)return t("success_with_token"),(0,y.kv)(o).then((e=>(t("success_token_exchanged"),T(),Promise.resolve())),(e=>{throw t("success_token_not_exchanged"),e}));throw t("success_without_token"),new Error}),(e=>{throw t("failure"),j({error:e,isCrossDomain:!0}),e}))}P("login_api_call_start");const z=(0,v.OJ)();return m.Z.create("UserSessionResource",{...n,...z?{referrer:z}:Object.freeze({}),get_user:n.get_user||n.switch_account&&a,app_type_from_client:7===e.appType?7:5,visited_pages_before_login:(0,v.t_)()||null,recaptchaV2Token:p,recaptchaV3Token:k}).callCreate({showError:!1,async:!0}).then((e=>{const{country:t,country_from_hostname:o,country_from_ip:n,region_from_ip:l}=(null==e?void 0:e.client_context)||Object.freeze({});return T({country:t,countryFromHostName:o,countryFromIp:n,regionFromIp:l}),P("login_api_call_success"),(0,u.B)(!1),i.zN(f.e7.name),i.zN(f.x3.name),(0,g.D)("login").then((()=>e))}),(e=>(j({error:e,isCrossDomain:!1}),P("login_api_call_failure"),Promise.reject(e))))}),[e,t,o,w])}},662730:(e,t,o)=>{o.d(t,{C:()=>l,P:()=>i});var n=o(883119);const i=new n.Ry(1e4),l=new n.H3([i])},532975:(e,t,o)=>{o.d(t,{B:()=>a,a:()=>l});var n=o(957161),i=o(696157);const l=()=>!!n.Z.getItem(i.WM),a=e=>{n.Z.setItem(i.WM,!!e)}},412544:(e,t,o)=>{o.d(t,{Z:()=>l});var n=o(276775);const i=Object.freeze({"/:username":"profile","/:username/:slug/:section_slug":"board","/:username/:slug":"board","/csrf_error":"csrfError","/email_verification_error":"emailVerificationError","/email/remove":"emailRemove","/email/subscription":"emailSubscription","/ideas":"ideasRoot","/ideas/:interest/:id":"ideasHub","/invited":"invited","/password/reset":"passwordReset","/pin/:id":"pin","/pin/:id/feedback":"pinFeedBack","/pin/:id/sent":"pinFeedBack","/pin/:id/visual-search":"flashlight","/pin/create/:method":"pinBookmarklet","/pw/:username":"resetPasswordUsername","/panic/":"panic","/search/:scope":"search","/today":"todayTab","/today/:term/:title/:articleId":"todayArticleFeed","/today/popular/:interest/:interestId":"todayArticleInterestFeed","/tv":"LiveSessionEvent","/tv/:pin_id":"liveSessionCloseup","/unlink":"unlinkAccount"}),l=()=>{const{path:e}=(0,n.useRouteMatch)();return i[e]||"unknown"}},848185:(e,t,o)=>{o.r(t),o.d(t,{default:()=>R});var n=o(667294),i=o(231486),l=o(711781),a=o(826067),s=o(53987);const r=({isDesktop:e,location:t,history:o})=>{var n,i;return o&&(null===(n=o.location.state)||void 0===n?void 0:n.isAppFactoryOAuth)||(null!==(i=(0,a.mB)(t.search).next)&&void 0!==i?i:"").startsWith("/app-factory-oauth/")||(0,s.re)(t)||(0,s.OK)(t)||(0,s.Ni)(t)||(0,s.dt)(t)||e&&((0,s.kY)(t)||"/invited"===t.pathname||t.pathname.startsWith("/about/"))};var c=o(121151),d=o(898781),_=o(112690),u=o(999023),g=o(867820),h=o(872349),p=o(883119),m=o(785893);function y({handleShowLogin:e,handleConfirmSignup:t,handleCancelClick:o}){const n=(0,d.ZP)(),i=(0,_.Z)();return(0,m.jsx)(u.Z,{viewType:10,viewParameter:3202,children:(0,m.jsx)(c.ZP,{accessibilityModalLabel:"",isOpen:!0,type:"google_one_tap",closeOnOutsideClick:!1,onDismiss:()=>{},children:(0,m.jsxs)(p.xu,{padding:6,children:[(0,m.jsx)(p.xu,{display:"inlineBlock",position:"absolute",top:!0,right:!0,marginTop:2,marginEnd:2,children:(0,m.jsx)(p.hU,{accessibilityLabel:n.bt("Cancel", "Cancel", "Button to close the signup/login modal", undefined, true),icon:"cancel",onClick:()=>{i({element:73,event_type:102,view_parameter:3202,view_type:10}),o()},size:"sm",iconColor:"gray"})}),(0,m.jsx)(p.xv,{align:"start",weight:"bold",children:(0,m.jsx)("span",{className:"deprecatedTextSizeXL",children:n.bt("Continue to Pinterest", "Continue to Pinterest", "Title of a dialog telling enabling the user to continue with sign up or log in", undefined, true)})}),(0,m.jsx)(p.xu,{marginTop:2,children:(0,m.jsx)(p.xv,{align:"start",children:n.bt("Hmm, it looks like you don't have an account yet. Let's get started!", "Hmm, it looks like you don't have an account yet. Let's get started!", "Description text of a dialog asking the user to sign up for a Pinterest account", undefined, true)})}),(0,m.jsx)(p.xu,{marginTop:5,children:(0,m.jsx)(p.zx,{fullWidth:!0,color:"red",onClick:()=>{(0,g.NC)("press_one_tap_modal_signup"),i({element:31,event_type:102,view_parameter:3202,view_type:10}),t()},text:n.bt("Sign up", "Sign up", "Text on a button which will create an account when clicked", undefined, true)})}),(0,m.jsx)(p.xu,{marginTop:2,children:(0,m.jsx)(p.zx,{fullWidth:!0,color:"gray",onClick:()=>{i({element:30,event_type:102,view_parameter:3202,view_type:10}),e()},text:n.bt("Log in using a different method", "Log in using a different method", "Text on a button which will take the user to login when clicked", undefined, true)})})]})})})}const x=({step:e,...t})=>"mobile"===e?(0,m.jsx)(y,{...t}):(0,m.jsx)(h.Z,{...t,step:e});var f=o(290148),v=o(830269),w=o(576494),k=o(499128),b=o(914772),A=o(85334),P=o(204324),T=o(412544),j=o(19121),z=o(155949),S=o(226198),O=o(529195),C=o(905171),L=o(780280),Z=o(343341),I=o(780679),D=o(50286),N=o(83969),E=o(584595),B=o(524172),G=o(275926),W=o(276775);function F(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}class M extends n.PureComponent{constructor(...e){var t;super(...e),t=this,F(this,"state",{isAttemptingSignup:!1,modal:null,showAccountSuspended:!1}),F(this,"prompt",(()=>{var e;null===(e=(0,N.Fm)())||void 0===e||e.prompt((e=>{(0,b.Z)({type:"promptNotification",notification:e})}))})),F(this,"deferredHandleOneTapResponse",(e=>{const{autologinIsDisabled:t}=this.props,o=(0,N.PL)(e.select_by);"SIGN_IN_WITH_GOOGLE_BUTTON"!==o?"AUTO_LOGIN"===o&&t||setTimeout((()=>{this.handleOneTapResponse(e)}),3e3):this.handleOneTapResponse(e)})),F(this,"attemptSignup",(async function({googleOpenId:e}){const{history:o,pageType:n,showDesktopGoogleOneTapTriggeredModal:i}=t.props,a=(0,l.Z)(e),s={type:"google",google_open_id_token:e,first_name:a.given_name,last_name:a.family_name,image_url:a.picture};(0,g.NC)("attempt_signup_with_one_tap"),i?i({type:"GDPR_REQUIRES_AGE",socialRegistrationCredentials:{type:"google_one_tap",context:{container:"google_one_tap_modal",page:n},signupOptions:s}}):(t.setState({isAttemptingSignup:!1,modal:null}),o.push({pathname:"/signup/thirdpartyage/",state:{signupOptions:s,progressBarAnimationDuration:4500}}))}))}async componentDidMount(){const{autologinIsDisabled:e,googleSignInApi:t}=this.props;await t.ensureInit("oneTap",this.deferredHandleOneTapResponse),e||this.prompt()}componentDidUpdate(e){e.autologinIsDisabled&&!this.props.autologinIsDisabled&&this.prompt()}componentWillUnmount(){var e,t;null===(e=window.smartlock)||void 0===e||null===(t=e.cancelLastOperation)||void 0===t||t.call(e)}async handleOneTapResponse(e){const{authenticationClient:t,deviceType:o,history:n,location:i,pageType:l,showError:a,showDesktopGoogleOneTapTriggeredModal:r}=this.props,{credential:c,select_by:d}=e,_=(0,N.PL)(d),u="auto"===d;u?(0,b.Z)({type:"autologin",status:"start"}):(0,b.Z)({type:"manualLoginAttempt",fromConnectButton:"SIGN_IN_WITH_GOOGLE_BUTTON"===_});try{const e={google_open_id_token:c,autologin:u},a=(0,N.mK)(_),s={event_type:7534,element:"SIGN_IN_WITH_GOOGLE_BUTTON"===_?12981:"ONE_TAP_PROMPT"===_?12982:null,view_type:10,view_parameter:3201,aux_data:{signup_login_method:v.Z.GOOGLE_ONE_TAP}};"desktop"===o?await t.desktopLogin({creds:e,loggingOptions:{loggingData:{container:"google_one_tap_modal",page:l,trigger:a},loginAttemptContextEvent:s}}):await t.mobileLogin(e,n,(0,O.Yy)(i)||i.pathname,{isAutologin:u,trigger:a},s),u&&(0,b.Z)({type:"autologin",status:"success"}),r&&f.ZP.handleRedirectWithFallbackWindowLocation()}catch(h){u&&(0,b.Z)({type:"autologin",status:"failure"}),r?(null==h?void 0:h.api_error_code)===E.xN?"SIGN_IN_WITH_GOOGLE_BUTTON"===_||!(0,s.C$)(i)&&!(0,s.Xn)(i)?this.attemptSignup({googleOpenId:c}):((0,g.NC)("show_one_tap_modal_static"),this.setState({modal:{step:(0,s.C$)(i)?"staticSignupLogin":(0,s.Xn)(i)?"staticSignupLoginWithTOS":u?"staticSignupLogin":"delayedSignupLoadingSpinner",handleConfirmSignup:()=>{this.attemptSignup({googleOpenId:c})}}})):(null==h?void 0:h.api_error_code)===E.Zn?r({type:"MFA",mfaGoogleOpenId:c}):(null==h?void 0:h.api_error_code)===E.an?this.setState({showAccountSuspended:!0}):(a({action:"login",ui:"modal"}),r({type:"LOGIN_ERROR"})):(null==h?void 0:h.api_error_code)===E.xN&&"tablet"!==o?(0,s.C$)(i)?((0,g.NC)("show_one_tap_modal_mobile"),this.setState({modal:{step:"mobile",handleConfirmSignup:()=>{this.attemptSignup({googleOpenId:c})}}})):this.attemptSignup({googleOpenId:c}):a({action:"login",ui:"toast",message:h.message})}}render(){const{showAccountSuspended:e,modal:t,isAttemptingSignup:o}=this.state,{history:n,location:i,showDesktopGoogleOneTapTriggeredModal:l}=this.props;return e?(0,m.jsx)(w.Z,{onClose:()=>this.setState({showAccountSuspended:!1})}):!l&&o?(0,m.jsx)(z.Z,{progressBarAnimationDuration:4500}):t?(0,m.jsx)(x,{step:t.step,handleCancelClick:()=>this.setState({modal:null}),handleConfirmSignup:t.handleConfirmSignup,handleShowLogin:l?()=>l({type:"CLICK_LOGIN_BUTTON"}):()=>{this.setState({modal:null}),n.push({pathname:"/login/",state:{next:i.pathname}})}}):null}}function R(){const e=(0,d.ZP)(),t=(0,D.ZP)(),o=(0,W.useLocation)(),n=(0,W.useHistory)(),{showToast:l}=(0,Z.F9)(),a=(0,T.Z)(),s=(0,P.Z)(),c=(0,B.M)(),_=(0,I.g)(),u=null==_?void 0:_.showGoogleOneTapTriggeredModal,g=(()=>{const{isAuth:e,isLimitedLogin:t}=(0,j.Z)(),o=e&&!t,{country:n,isBot:l}=(0,L.B)(),a=o||l,s=(0,D.ZP)(),c=(0,W.useLocation)(),d=(0,W.useHistory)(),_="desktop"===s;return a||"CH"===n||!!i.U2(S.e7)||r({isDesktop:_,location:c,history:d})})(),h=(0,A.Z)(),p=(0,G.f)();if(!c)return null;return(0,m.jsx)(M,{authenticationClient:{desktopLogin:h,mobileLogin:p},autologinIsDisabled:g,deviceType:t,googleSignInApi:c,history:n,i18n:e,location:o,navigateAfterLoginStatusChange:s,pageType:a,showDesktopGoogleOneTapTriggeredModal:u,showError:({action:t,ui:o,message:n})=>{const i="signup"===t?e.bt("We couldn’t sign you up with that account. Try the Google button.", "We couldn’t sign you up with that account. Try the Google button!", " - ", undefined, true):e.bt("We couldn’t log you in with that account. Try the Google button.", "We couldn’t log you in with that account. Try the Google button!", " - ", undefined, true),a=n||i;"toast"===o?l((({hideToast:e})=>(0,m.jsx)(k.ZP,{text:a,onHide:e}))):(0,C.x)(a)}})}}}]);
//# sourceMappingURL=https://sm.pinimg.com/webapp/48185.en_AU-8989e87f25563496.mjs.map