PageSourceSearch

https://photobucket.com/assets/js/Login-rwDd2DFo.js

js photobucket.com collected 2026-10-01 07:22:41 UTC 18,386 bytes, 1 lines download raw bytes

1var Ke=Object.defineProperty;var we=Object.getOwnPropertySymbols;var et=Object.prototype.hasOwnProperty,tt=Object.prototype.propertyIsEnumerable;var ye=(o,l,d)=>l in o?Ke(o,l,{enumerable:!0,configurable:!0,writable:!0,value:d}):o[l]=d,re=(o,l)=>{for(var d in l||(l={}))et.call(l,d)&&ye(o,d,l[d]);if(we)for(var d of we(l))tt.call(l,d)&&ye(o,d,l[d]);return o};import{a as f,_ as s,b as rt}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-B177jzqY.js";import{iZ as at,bZ as ve,j3 as st,cJ as nt,cv as ot,co as it,ci as $,j as b,c$ as T,l as m,cj as Ee,v as F,d6 as ae,j4 as Ie,cR as Y,d1 as lt,j5 as ct,c_ as Pe,d0 as dt,hG as ke,j6 as Se,j7 as Le,j8 as ut,r as gt,n as mt,D as pt,e as ft,f as ht,g as bt,a2 as wt,X as yt,h as vt,S as Et}from"./index-B9O2cfno.js";import{_ as It,k as Pt}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_router_mf_2_dom__loadShare__.js-CK4j7iSY.js";import{e as S,a as v,b as _e}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js-ClGO9exV.js";import{L as kt}from"./LoadingIcon-DAFCQ8iI.js";import{S as B}from"./types-BY9I4-Vb.js";import{V as Ae}from"./ViewTitle-DJBm7y23.js";import{F as q,T as St,P as Lt,A as _t,a as At,L as xt,b as xe}from"./AuthForm-CR8C_1hj.js";import{A as Tt,S as Nt}from"./SSOButton-CFLFNDvh.js";import{d as se}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare___mf_0_unleash_mf_1_proxy_mf_2_client_mf_2_react__loadShare__.js-BdtqsXmB.js";import{g as Rt,h as ne}from"./index.esm-CuP3mDAg.js";import{R as oe}from"./RequiredParameter-sNXTeMLJ.js";import{u as Ct}from"./useAppleLogin-BB9Uc64T.js";import{u as Ft}from"./useFirebaseTracing-D9RDzHnw.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js_commonjs-proxy-D_fXcg40.js";import"./virtualExposes-_ivNhQLP.js";import"./remoteEntry-uboCqDRT.js";import"./preload-helper-s0Msbe4-.js";import"./index-DM2295YJ.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_fD68H2V.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js_commonjs-proxy-BYnSnx8j.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js-ckyQG2Wp.js";import"./index-CwMG8eoe.js";import"./input-Chbnfqnc.js";import"./useControlled-DMkbsAxB.js";import"./useRegisterFieldControl-8-icw_H_.js";import"./GradientOutlineButton-CQz8rFt9.js";const L="redirect_idp",Dt=/\S+@\S+\.\S+/,Ot=o=>Dt.test(o),Ut="Please check the accuracy of your email/username and password. If you haven't accessed your account lately, use the reset password link to reset your password as we may have locked your account for security purposes.";function Mt(){var he,be;const o=It(),l=S(o.search),_=(he=new URLSearchParams(o.search).get("returnUrl"))!=null?he:"",I=_.startsWith("/auth/email-action")&&_.includes("mode=emailChange"),[w,E]=v({}),[N,i]=v({}),[R,k]=v(!1),{attemptCustomTokenLogin:G,attemptSubscriptionTokenLogin:J,attemptRedirect:H,results:C,subscriptionTokenLoginState:W}=at(),Q=S(H),[X]=ve(st),[Z]=ve(nt),D=S(localStorage.getItem(L)||""),O=S(!1),[z,U]=v(!1),[A,j]=v([]),[Te,ie]=v(!1),[Ne,Re]=v(!1),Ce=S(""),Fe=S(""),[le,P]=v(!1),[De,ce]=v(!!localStorage.getItem(L)),Oe=W==="loading"||W==="success",[de,K]=v(!1),[Ue,ue]=v(B.FORM),ee=Rt(ot()),{init:Me}=Ct(),$e=S(Me),{mark:u,startTracing:te,stopTracing:ge}=Ft("LOGIN_TRACE"),{trackEvent:y}=it(),me={isFirebaseFacebookIdpEnabled:se("isFirebaseFacebookIdpEnabled"),isFirebaseMicrosoftIdpEnabled:se("isFirebaseMicrosoftIdpEnabled"),isFirebasePaypalIdpEnabled:se("isFirebasePaypalIdpEnabled")},qe=new URLSearchParams(o.search).get("logout")==="true",Be=()=>Re(!1),He=()=>U(!1),We=async()=>{if(!de)try{const{username:e}=w;if(!e)throw new oe("Email is required","username");K(!0);const t=ne(ee,"firebaseEmail"),{data:a}=await t({identifier:e,action:"login",url:window.location.href});K(!1),i({}),k(!1);const{error:r}=a;if(r)throw r;Ot(e)?localStorage.setItem("_pb_linkSignInEmail",e):localStorage.removeItem("_pb_linkSignInEmail"),ue(B.EMAIL_SENT)}catch(e){K(!1);const t=e,a="magic link";switch(t.code){case"RequiredParameterException":i({[t.parameterName]:t.message});break;case"auth/too-many-requests":case"auth/invalid-email":case"auth/invalid-identifier":case"auth/user-not-found":case"auth/import-failed":ue(B.EMAIL_SENT);break;default:i({general:"There was an error sending the ".concat(a," email. Please resubmit your username or email address.")})}}},ze=()=>{U(!0),O.current=!0},pe=async(e,t,a="general",r=!1)=>{const n=F.intersection(e,Pe).filter(p=>{const{featureFlagName:h}=T(p);return h?me[h]:!0}),g=F.difference(n,A).length>0;return n.length>0&&(g&&j(n),!O.current)?(ze(),!0):(i({[a]:t}),k(r),!1)},V=S(async(e,t=!1)=>{var g,p,h;const{code:a}=e;let{message:r}=e;const c=(g=T(D.current))==null?void 0:g.getProvider(),n=c?(p=T(c.providerId))==null?void 0:p.name:void 0;if(r.toLowerCase().includes("user is not active, please contact support")){
1i({general:"User is not active, please contact support."});return}if(r.includes("account-exists-with-different-credential")){const x=(h=e.customData)==null?void 0:h.email;if(x&&(r=n?"An account with this email already exists. You can enable ".concat(n," sign-in in your account settings."):"An account with this email already exists with a different sign-in method.",t)){let M=[];try{M=await dt(b(),String(x))}catch(Ze){m.error(Ze)}await pe(M,r)}}else{if(r==="The user with the provided uid already exists."&&(r="This email is registered with a different sign-in method. Try resetting your password or linking accounts in settings."),a==="auth/user-cancelled"&&(r="We need your permission to continue. Please try again and allow access."),a==="auth/popup-closed-by-user"||a==="auth/cancelled-popup-request")return;i({general:r})}m.error({code:a,error:e,userFacingErrorMessage:r})}),je=async()=>{try{if(!w.enterEmail)throw new ke("auth/missing-email","You must enter your email to continue");ie(!0);const e=ne(ee,"firebaseAddEmail"),{data:t}=await e({email:w.enterEmail,idToken:Fe.current}),{error:a,firebaseToken:r}=t;if(a)throw a;Se(b(),r),y("custom_token_created_event",{metric:"custom_token_created_event",email:w.enterEmail,platform:"WEB"})}catch(e){ie(!1);const t=e;let a;switch(t.code){case"auth/email-taken":a="An account with this email already exists.";break;case"auth/email-format":a="Please enter a valid email address.";break;default:a="An error occurred while saving your email. Please refresh the page and try again."}i({enterEmail:a}),y("custom_token_created_error",{metric:"custom_token_created_error",platform:"WEB",clientErrors:t.cause,name:t.name,message:a})}},fe=async e=>{var t,a;if(te(),u("handleProvider"),P(!0),k(!1),D.current=e.providerId,u("handleProvider#".concat(e.providerId)),e.providerId===ae.PROVIDER_ID){u("handleProvider#apple");try{if(!((a=(t=window.AppleID)==null?void 0:t.auth)!=null&&a.signIn)){m.error("Apple sign-in is not available"),P(!1),i({general:"Apple sign-in is not available. Please try again later."}),y("login_failure",{provider:e.providerId,error:"Apple sign-in not available"});return}const r=await window.AppleID.auth.signIn().catch(n=>{m.error(n),P(!1),i({general:"There was an error retrieving your Apple authorization"}),y("login_failure",{provider:e.providerId,error:JSON.stringify(n)})});if(!(r!=null&&r.authorization)){m.error("Failed to retrieve apple auth");return}const c=new ae().credential({idToken:r.authorization.id_token});Ie(b(),c).catch(n=>{m.error(n),P(!1),i({general:"There was an error retrieving your credentials."}),y("login_failure",{provider:e.providerId,error:JSON.stringify(n)})})}catch(r){m.error(r)}return}if(Y.isMobile){window.localStorage.setItem(L,e.providerId),Le(b(),e).catch(r=>{m.error(r),P(!1),i({general:"There was an error signing into your ".concat(e.providerId," account.")}),y("login_failure",{provider:e.providerId,error:JSON.stringify(r)})});return}D.current=e.providerId,ut(b(),e).catch(r=>{if(r.code==="auth/popup-blocked"){window.localStorage.setItem(L,e.providerId),Le(b(),e);return}P(!1),m.error(r),i({general:"There was an error signing into your ".concat(e.providerId," account.")}),y("login_failure",{provider:e.providerId,error:JSON.stringify(r)})})},Ve=async e=>{var r,c;e==null||e.preventDefault(),te(),u("handleFirebaseLogin"),k(!1);const{username:t,password:a}=w;try{if(!t)throw new oe("Username is required","username");if(!a)throw new oe("Password is required","password");u("handleFirebaseLogin#attempting"),P(!0),u("handleFirebaseLogin#addMessage");const n=ne(ee,"firebaseAuth"),{data:g}=await n({identifier:t,password:a}),{error:p,firebaseToken:h}=g;if(p)throw p;y("login_success",{username:t}),y("login"),u("handleFirebaseLogin#signInWithCustomToken"),Se(b(),h)}catch(n){y("login_failure",{username:t,error:JSON.stringify(n)}),u("handleFirebaseLogin#catch",n),ge(),P(!1);const g=n,p=n,h=(r=p.message)!=null?r:"Login attempt failed",x=((c=p.customData)==null?void 0:c.userProviderIds)||[];switch(g.code){case"auth/too-many-requests":i({general:'Too many failed login attempts. Use "Forgot Password?" or try again later.'});break;case"auth/login":pe(x,Ut,"general",!0);break;case"RequiredParameterException":i({[g.parameterName]:g.message});break;default:i({general:h||"There was an error signing in"})}m.error(n)}},Ye=async()=>{var n,g,p,h,x,M;const{uid:e}=(n=b().currentUser)!=null?n:{};if(!e)throw new ke("auth/unauthenticated","Failed to fetch buckets. Unauthenticated.");const t=await((g=b().currentUser)==null?void 0:g.getIdTokenResult()),a=(h=(p=t==null?void 0:t.claims)==null?void 0:p.isPUCUser)!=null?h:!1,c=await Z({variables:{userId:e}});!a&&((M=(x=c.data)==null?void 0:x.userProfile)==null?void 0:M.latestTermsAccepted)!==!0?(m.info("Terms and conditions not accepted"),gt("termsAndConditionsLogin")):await Q.current()};$(()=>{const e=b().onAuthStateChanged(async t=>{var r;if(!t||C.loading||C.data)return;const a=T(t.providerId);try{if(u("useEffect#userStatusCheck"),a&&t.email){const n=(r=(await X()).data)==null?void 0:r.userStateStatus;
1if(!(n!=null&&n.kafka)&&(n!=null&&n.firebase)){window.location.href="/auth/no-account-idp/";return}}u("useEffect#attemptRedirect"),await Ye(),u("useEffect#success")}catch(c){if(u("useEffect#catch",c),ge(),m.error(c),localStorage.setItem(L,""),ce(!1),P(!1),Ee.is(c)){const g=F.merge(c.errors[0],{code:"apollo-error"});V.current(g,!0)}const n=c;V.current(n,!0),C.reset()}});return()=>e()}),$(()=>{y("login_view")}),$(()=>{J(),G()}),$(()=>{const e=new URLSearchParams(l.current),t=e.get("provider")==="apple",a=e.get("id_token");if(a&&t){te(),u("useEffect#appleAuthCredential");const r=new ae().credential({idToken:a});u("useEffect#appleSignInWithCredential"),Ie(b(),r).then(()=>{u("useEffect#appleResults")}).catch(c=>{u("useEffect#appleError",c),m.error(c)})}}),$(()=>{if(!Y.isMobile)return;const e=window.navigator.userAgent.toLowerCase();e.includes("photobucketapp")||(Y.isIOS&&!e.includes("safari")&&i({general:"You are not accessing Photobucket through a secure browser. Please copy the link you were sent and paste it into your Safari or Chrome browser."}),Y.isAndroid&&e.includes("wv")&&i({general:"You are not accessing Photobucket through a secure browser. Please copy the link you were sent and paste it into your Safari or Chrome browser."}))}),_e(()=>{$e.current("login")},[]),_e(()=>{localStorage.getItem(L)&&lt(b()).then(async t=>{if(m.info({result:t}),!t){let a="An error occurred while completing sign-in. Please try again.";throw ct()&&(a="Safari may be blocking sign-in. Try again or use your email and password instead."),new Error(a)}}).catch(t=>{if(m.error(t),localStorage.setItem(L,""),ce(!1),Ee.is(t)){const r=F.merge(t.errors[0],{code:"apollo-error"});V.current(r,!0);return}const a=t;V.current(a,!0)}).finally(()=>localStorage.setItem(L,""))},[]);const Ge=e=>{const t=re({},w),a=e.target.name;t[a]=e.target.value,E(t);const r=re({},N);delete r[a],delete r.general,i(r),k(!1)},Je=De||Oe,Qe=le||C.loading,Xe=Pe.map(e=>{const{featureFlagName:t,getProvider:a,name:r}=T(e);return t&&!me[t]?null:{providerId:e,name:r,onClick:()=>fe(a())}}).filter(e=>e!==null);return{search:o.search,fields:w,errors:N,isLoginError:R,handleChange:Ge,handleFirebaseLogin:Ve,isAttemptingLogin:le,isLoginButtonDisabled:Qe,sendMagicLink:We,isAttemptingToSend:de,screenPhase:Ue,isEmailChangeReturn:I,hasLogoutParam:qe,enabledSsoProviders:Xe,handleProvider:fe,isAttemptingRedirectOrTokenLogin:Je,isHelpDialogOpen:z,closeHelpDialog:He,userRecentLoginProviderIds:A,isEnterEmailDialogOpen:Ne,closeEnterEmailDialog:Be,isEnterEmailLoading:Te,attemptEmailChange:je,enterEmailProviderName:((be=T(Ce.current))==null?void 0:be.name)||""}}const $t="https://support.photobucket.com/hc/en-us/categories/4404271347732-Account-Recovery";function qt({isOpen:o,userLoginProviderIds:l,handleClose:d,handleProvider:_}){return s(pt,{open:o,onOpenChange:I=>!I&&d(),children:f(ft,{children:[s(ht,{}),f(bt,{className:"rounded-24 bg-background w-[420px] max-w-[calc(100vw-32px)] p-24",children:[s(wt,{"aria-label":"Close",className:"text-muted-foreground absolute top-16 right-16",children:s(yt,{size:"small"})}),s(vt,{className:"font-display text-foreground text-xl font-bold",children:"Having trouble signing in?"}),s(Et,{className:"text-muted-foreground mt-8 text-base",children:"You've recently signed in using the following methods, press any below to sign in instantly."}),s("div",{className:"mt-16 flex flex-col gap-8",children:l.map(I=>{const{LogoSvg:w,name:E,getProvider:N}=T(I);return f("button",{type:"button",onClick:()=>_(N()),className:"border-border hover:bg-muted flex items-center gap-12 rounded-12 border p-12 text-left transition-colors",children:[s("span",{className:"bg-muted flex size-40 items-center justify-center rounded-full",children:s(w,{width:24,height:24})}),s("span",{className:"font-text text-foreground text-base font-semibold",children:F.capitalize(E)})]},"recent-login-".concat(I))})})]})]})})}function hr(){var z;const{search:o,fields:l,errors:d,isLoginError:_,handleChange:I,handleFirebaseLogin:w,isAttemptingLogin:E,isLoginButtonDisabled:N,sendMagicLink:i,isAttemptingToSend:R,screenPhase:k,isEmailChangeReturn:G,hasLogoutParam:J,enabledSsoProvi
1ders:H,handleProvider:C,isAttemptingRedirectOrTokenLogin:W,isHelpDialogOpen:Q,closeHelpDialog:X,userRecentLoginProviderIds:Z}=Mt();if(W)return f("div",{className:"flex flex-col items-center gap-16 text-center",children:[s(Ae,{title:"Login"}),s("h1",{className:"font-display text-foreground text-4xl font-bold",children:"Attempting to Login"}),s(kt,{size:"large",className:"text-brand-600 animate-spin"})]});const D=s(xe,{to:"/auth/forgot-password".concat(o),"data-testid":"forgot-password-button",className:"text-sm font-bold",children:"Forgot Password?"}),O=E||R;return f("form",{onSubmit:w,"aria-busy":O,className:mt("flex flex-col gap-24 transition-opacity duration-300",O&&"pointer-events-none opacity-50"),children:[s(Ae,{title:"Login"}),s(qt,{isOpen:Q,handleProvider:C,handleClose:X,userLoginProviderIds:Z}),s(Tt,{active:"signin",search:o}),J&&s(q,{variant:"success",children:"You have successfully logged out."}),G&&f(q,{variant:"info",children:[s("p",{className:"font-semibold",children:"Finish changing your email"}),s("p",{className:"mt-4",children:"Sign in with your existing Photobucket account to continue. Your sign-in details won't change until you complete the verification steps."})]}),H.length>0&&s("div",{className:"mt-8 flex flex-col gap-16",children:H.map(({providerId:U,name:A,onClick:j})=>A==="apple"||A==="google"?s(Nt,{provider:A,action:"Sign In",disabled:E,onClick:j},"sso-login-".concat(U)):s("button",{type:"button",disabled:E,onClick:j,className:"border-foreground text-foreground font-display flex h-48 w-full items-center justify-center gap-8 rounded-full border px-24 text-base font-semibold transition-colors hover:bg-muted disabled:pointer-events-none disabled:opacity-60",children:"Sign In with ".concat(F.capitalize(A))},"sso-login-".concat(U)))}),d.general&&!_&&f(q,{variant:"error",children:[s("p",{className:"font-semibold",children:"Error logging in"}),s("p",{className:"mt-4",children:d.general})]}),_&&f(q,{variant:"error",children:[s("p",{className:"font-semibold",children:"Error logging in"}),s("p",{className:"mt-4",children:d.general}),s(Pt,{to:"/auth/forgot-password".concat(o),"data-testid":"forgot-password-button",className:"text-destructive mt-8 block font-semibold underline",children:"Reset Password"}),s("button",{type:"button","data-testid":"send-link",disabled:R,onClick:i,className:"text-destructive mt-8 block text-left font-semibold underline disabled:opacity-60",children:"Send me a one time login link (no password required)"})]}),k===B.EMAIL_SENT&&f(q,{variant:"info",children:[s("p",{className:"font-semibold",children:"Email Sent"}),s("p",{className:"mt-4 break-words",children:(z=l.username)!=null&&z.includes("@")?"We've sent an email to ".concat(l.username,"."):"We've sent an email to the address associated with ".concat(l.username,".")}),f("p",{className:"mt-4",children:["Having trouble?"," ",s("a",{href:$t,target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Visit help center"})]})]}),k===B.FORM&&f(rt,{children:[f("div",{className:"flex flex-col gap-12",children:[s(St,{autoFocus:!0,id:"username","data-testid":"username",name:"username",label:"Email / Username",type:"text",autoCapitalize:"off",autoComplete:"username",placeholder:"Enter a username",required:!0,disabled:E,value:l.username||"",onChange:I,error:d.username}),s(Lt,{id:"password","data-testid":"password",name:"password",label:"Password",labelAction:D,autoCapitalize:"off",autoComplete:"current-password","data-sr-redact":!0,required:!0,disabled:E,value:l.password||"",onChange:I,error:d.password})]}),s(_t,{type:"submit","data-testid":"submit",disabled:N,loading:E,children:"Sign In"}),s(At,{type:"button","data-testid":R?"send-link":"magic-link",disabled:R,onClick:i,className:"self-center",children:"Send me a one time login link (no password required)"})]}),s(xt,{}),f("p",{className:"text-foreground mt-8 text-center text-base",children:["Don't have an account?"," ",s(xe,{to:"/auth/register".concat(o),"data-testid":"create-account-button",children:"Sign Up"})]})]})}export{L as REDIRECT_LOCAL_STORAGE_VAR,hr as default};

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.