@clerk/ui 1.0.0-snapshot.v20251216175437 → 1.0.0-snapshot.v20251217165918
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{207_ui_338113_1.0.0-snapshot.v20251216175437.js → 207_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{217_ui_338113_1.0.0-snapshot.v20251216175437.js → 217_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{360_ui_338113_1.0.0-snapshot.v20251216175437.js → 360_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{444_ui_338113_1.0.0-snapshot.v20251216175437.js → 444_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{573_ui_338113_1.0.0-snapshot.v20251216175437.js → 573_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{970_ui_338113_1.0.0-snapshot.v20251216175437.js → 970_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/ClerkUi.js +2 -2
- package/dist/{apiKeys_ui_338113_1.0.0-snapshot.v20251216175437.js → apiKeys_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{checkout_ui_338113_1.0.0-snapshot.v20251216175437.js → checkout_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +2 -2
- package/dist/components/OrganizationProfile/index.js +4 -3
- package/dist/components/OrganizationProfile/index.js.map +1 -1
- package/dist/components/SignIn/SignInFactorTwoAlternativeMethods.js +3 -1
- package/dist/components/SignIn/SignInFactorTwoAlternativeMethods.js.map +1 -1
- package/dist/components/SignIn/index.js +2 -1
- package/dist/components/SignIn/index.js.map +1 -1
- package/dist/components/SignUp/index.js +2 -1
- package/dist/components/SignUp/index.js.map +1 -1
- package/dist/components/UserProfile/index.js +3 -2
- package/dist/components/UserProfile/index.js.map +1 -1
- package/dist/components/UserVerification/UserVerificationFactorTwo.js +1 -1
- package/dist/components/UserVerification/UserVerificationFactorTwo.js.map +1 -1
- package/dist/components/UserVerification/index.js.map +1 -1
- package/dist/{createorganization_ui_338113_1.0.0-snapshot.v20251216175437.js → createorganization_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/customizables/parseAppearance.d.ts +2 -2
- package/dist/customizables/parseAppearance.d.ts.map +1 -1
- package/dist/customizables/parseAppearance.js.map +1 -1
- package/dist/{enableOrganizationsPrompt_ui_338113_1.0.0-snapshot.v20251216175437.js → enableOrganizationsPrompt_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{impersonationfab_ui_338113_1.0.0-snapshot.v20251216175437.js → impersonationfab_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/index.d.ts +2 -1
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/routing.d.ts +13 -0
- package/dist/internal/routing.d.ts.map +1 -0
- package/dist/{keylessPrompt_ui_338113_1.0.0-snapshot.v20251216175437.js → keylessPrompt_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/lazyModules/components.d.ts +4 -3
- package/dist/lazyModules/components.d.ts.map +1 -1
- package/dist/{oauthConsent_ui_338113_1.0.0-snapshot.v20251216175437.js → oauthConsent_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{onetap_ui_338113_1.0.0-snapshot.v20251216175437.js → onetap_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{op-api-keys-page_ui_338113_1.0.0-snapshot.v20251216175437.js → op-api-keys-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{organizationlist_ui_338113_1.0.0-snapshot.v20251216175437.js → organizationlist_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{organizationprofile_ui_338113_1.0.0-snapshot.v20251216175437.js → organizationprofile_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{organizationswitcher_ui_338113_1.0.0-snapshot.v20251216175437.js → organizationswitcher_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{payment-attempt-page_ui_338113_1.0.0-snapshot.v20251216175437.js → payment-attempt-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{planDetails_ui_338113_1.0.0-snapshot.v20251216175437.js → planDetails_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{prefetchorganizationlist_ui_338113_1.0.0-snapshot.v20251216175437.js → prefetchorganizationlist_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{pricingTable_ui_338113_1.0.0-snapshot.v20251216175437.js → pricingTable_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{revoke-api-key-modal_ui_338113_1.0.0-snapshot.v20251216175437.js → revoke-api-key-modal_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{sessionTasks_ui_338113_1.0.0-snapshot.v20251216175437.js → sessionTasks_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/signin_ui_7e9f20_1.0.0-snapshot.v20251217165918.js +1 -0
- package/dist/{signup_ui_338113_1.0.0-snapshot.v20251216175437.js → signup_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{statement-page_ui_338113_1.0.0-snapshot.v20251216175437.js → statement-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{subscriptionDetails_ui_338113_1.0.0-snapshot.v20251216175437.js → subscriptionDetails_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{taskChooseOrganization_ui_338113_1.0.0-snapshot.v20251216175437.js → taskChooseOrganization_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{taskResetPassword_ui_338113_1.0.0-snapshot.v20251216175437.js → taskResetPassword_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/{ui-common_ui_338113_1.0.0-snapshot.v20251216175437.js → ui-common_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +4 -4
- package/dist/ui.browser.js +1 -1
- package/dist/{up-api-keys-page_ui_338113_1.0.0-snapshot.v20251216175437.js → up-api-keys-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{useravatar_ui_338113_1.0.0-snapshot.v20251216175437.js → useravatar_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{userbutton_ui_338113_1.0.0-snapshot.v20251216175437.js → userbutton_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{userprofile_ui_338113_1.0.0-snapshot.v20251216175437.js → userprofile_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +2 -2
- package/dist/{userverification_ui_338113_1.0.0-snapshot.v20251216175437.js → userverification_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/dist/{waitlist_ui_338113_1.0.0-snapshot.v20251216175437.js → waitlist_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
- package/package.json +6 -6
- package/dist/signin_ui_338113_1.0.0-snapshot.v20251216175437.js +0 -1
- /package/dist/{blankcaptcha_ui_338113_1.0.0-snapshot.v20251216175437.js → blankcaptcha_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_338113_1.0.0-snapshot.v20251216175437.js → copy-api-key-modal_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
- /package/dist/{framework_ui_338113_1.0.0-snapshot.v20251216175437.js → framework_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
- /package/dist/{op-billing-page_ui_338113_1.0.0-snapshot.v20251216175437.js → op-billing-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
- /package/dist/{op-plans-page_ui_338113_1.0.0-snapshot.v20251216175437.js → op-plans-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
- /package/dist/{up-billing-page_ui_338113_1.0.0-snapshot.v20251216175437.js → up-billing-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
- /package/dist/{up-plans-page_ui_338113_1.0.0-snapshot.v20251216175437.js → up-plans-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
- /package/dist/{vendors_ui_338113_1.0.0-snapshot.v20251216175437.js → vendors_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["636"],{9090:function(e,t,r){r.d(t,{n:()=>a});var i=r(4518),o=r(5170),n=r(2861);let a=e=>{let{onBackLinkClick:t}=e;return(0,i.Y)(o.J,{cardTitle:(0,n.G)("signIn.alternativeMethods.getHelp.title"),cardSubtitle:(0,n.G)("signIn.alternativeMethods.getHelp.content"),onBackLinkClick:t})}},2690:function(e,t,r){r.d(t,{j:()=>a});var i=r(5074),o=r(5763);let n=e=>{if(!e)return"";let t=e.strategy;return"phoneNumberId"in e&&(t+=e.phoneNumberId),t};function a(e){let t=i.useRef(""),[r,a]=i.useState(()=>(0,o.R5)(e)),[l,c]=i.useState(!r),s=t.current===n(r);return{currentFactor:r,factorAlreadyPrepared:s,handleFactorPrepare:()=>{t.current=n(r)},selectFactor:e=>{a(e),c(!1)},showAllStrategies:l,toggleAllStrategies:()=>c(e=>!e)}}},5763:function(e,t,r){r.d(t,{Cm:()=>u,Kw:()=>p,R5:()=>h,UY:()=>v,iy:()=>m,oj:()=>k,xf:()=>s}),r(1044);var i=r(2620),o=r(7651),n=r(1959),a=r(8289);let l=e=>t=>"safeIdentifier"in t&&t.safeIdentifier===e;function c(e){if((0,i.Bz)()){let t=e.find(({strategy:e})=>"passkey"===e);if(t)return t}return null}function s(e,t,r){return e&&0!==e.length?r===n._o.Password?function(e,t){let r=c(e);if(r)return r;let i=e.sort(a.Kn)[0];return"password"===i.strategy?i:e.find(l(t))||i||null}(e,t):function(e,t){let r=c(e);if(r)return r;let i=e.sort(a.Ih),o=i.find(l(t));if(o)return o;let n=i[0];return"email_link"===n.strategy?n:e.find(l(t))||n||null}(e,t):null}let d=["passkey","email_code","password","phone_code","email_link"];function u(e){return!!e&&d.includes(e.strategy)}function h(e){if(!e||0===e.length)return null;let t=e.find(e=>"totp"===e.strategy);if(t)return t;let r=e.find(e=>"phone_code"===e.strategy);return r||e[0]}let f=["reset_password_phone_code","reset_password_email_code"],p=e=>!!e&&f.includes(e);function v(e){let t;return"tel"===e.type?"phoneNumber":(t=e.value,/^\S+@\S+\.\S+$/.test(t))?"emailAddress":"username"}let k=(e,t,r)=>{if(!t)return null;let i=e.find(e=>"strategy"===e.id)?.value;if(i&&"phone_code"!==i)return null;let n=e.find(e=>e.id===r)?.value;if(!n||!n?.startsWith("+"))return null;let a=(0,o.TV)(n,t);return"sms"===a?null:a},m=(e,t,r)=>{if(!e||!t||"phoneNumber"!==t||!r||!r?.startsWith("+"))return null;let i=(0,o.TV)(r,e);return"sms"===i?null:i}},9066:function(e,t,r){r.r(t),r.d(t,{UserVerification:()=>eh,UserVerificationModal:()=>ef});var i=r(4518),o=r(5074),n=r(5577),a=r(9078),l=r(4607),c=r(7831),s=r(2265),d=r(3269),u=r(5170),h=r(6980),f=r(7697),p=r(2861),v=r(4964),k=r(5763),m=r(8738),Y=r(29),y=r(6088),b=r(6153),g=r(9835),C=r(8272),w=r(8920),F=r(4421),M=r(1051),A=r(743),_=r(6889),S=r(9830),B=r(2620),G=r(8289);function D({filterOutFactor:e,supportedFirstFactors:t}){let r=t?t.filter(e=>!(0,k.Kw)(e.strategy)):[],i=r&&r.length>0,n=(0,o.useMemo)(()=>t?t.filter(e=>!e.strategy.startsWith("oauth_")).filter(e=>(0,k.Cm)(e)).filter(t=>!t||!e||("email_code"===t.strategy&&"email_code"===e.strategy?t.emailAddressId!==e.emailAddressId:"phone_code"===t.strategy&&"phone_code"===e.strategy?t.phoneNumberId!==e.phoneNumberId:t.strategy!==e.strategy)).filter(e=>"passkey"!==e.strategy||(0,B.Bz)()).sort(G.aR):[],[t,e]);return{hasAnyStrategy:i,hasFirstParty:n&&n.length>0,firstPartyFactors:n}}var L=r(5543),I=r(7896);let z=()=>{let{session:e}=(0,L.wV)(),t=(()=>{let{level:e}=(0,a.k)();return(0,o.useMemo)(()=>({level:e||"second_factor"}),[e])})();return{...(0,I.s)(e?e.startVerification:void 0,t,{throttleTime:300})}};function T(e){let t=t=>{let{isLoading:r,data:o}=z();return r||!o?(0,i.Y)(h.B,{}):(0,i.Y)(e,{...t})},r=e.displayName||e.name||"Component";return e.displayName=r,t.displayName=r,t}let Z=e=>{let{onBackLinkClick:t}=e;return(0,i.Y)(u.J,{cardTitle:(0,p.G)("reverification.alternativeMethods.getHelp.title"),cardSubtitle:(0,p.G)("reverification.alternativeMethods.getHelp.content"),onBackLinkClick:t})},P=e=>((e,t)=>{let[r,n]=o.useState(!1),a=o.useCallback(()=>n(e=>!e),[n]);return r?(0,i.Y)(Z,{onBackLinkClick:a}):(0,i.Y)(e,{...t,onHavingTroubleClick:a})})(V,{...e}),V=e=>{let{onBackLinkClick:t,onHavingTroubleClick:r,onFactorSelected:o}=e,n=(0,d.f0)(),{data:a}=z(),{firstPartyFactors:c,hasAnyStrategy:s}=D({filterOutFactor:e?.currentFactor,supportedFirstFactors:a?.supportedFirstFactors});return(0,i.Y)(l.n.Part,{part:"alternativeMethods",children:(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.alternativeMethods.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.alternativeMethods.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:n.error}),(0,i.Y)(C.so,{direction:"col",elementDescriptor:w.$z.main,gap:6,children:(0,i.FD)(C.fv,{gap:4,children:[s&&(0,i.Y)(C.so,{elementDescriptor:w.$z.alternativeMethods,direction:"col",gap:2,children:c.map((e,t)=>{var r;return(0,i.Y)(m.X,{leftIcon:(r=e,({email_code:F.A,phone_code:M.A,password:A.A,passkey:_.A,enterprise_sso:S.A})[r.strategy]),textLocalizationKey:function(e){switch(e.strategy){case"email_code":return(0,p.G)("reverification.alternativeMethods.blockButton__emailCode",{identifier:(0,g.u)(e.safeIdentifier)||""});case"phone_code":return(0,p.G)("reverification.alternativeMethods.blockButton__phoneCode",{identifier:(0,g.u)(e.safeIdentifier)||""});case"password":return(0,p.G)("reverification.alternativeMethods.blockButton__password");case"passkey":return(0,p.G)("reverification.alternativeMethods.blockButton__passkey");default:throw Error(`Invalid sign in strategy: "${e.strategy}"`)}}(e),elementDescriptor:w.$z.alternativeMethodsBlockButton,textElementDescriptor:w.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:w.$z.alternativeMethodsBlockButtonArrow,textVariant:"buttonLarge",isDisabled:n.isLoading,onClick:()=>{n.setError(void 0),o(e)}},t)})}),t&&(0,i.Y)(Y.E,{boxElementDescriptor:w.$z.backRow,linkElementDescriptor:w.$z.backLink,onClick:t})]})})]}),(0,i.Y)(y.Z.Footer,{children:(0,i.FD)(y.Z.Action,{elementId:"havingTrouble",children:[(0,i.Y)(y.Z.ActionText,{localizationKey:(0,p.G)("reverification.alternativeMethods.actionText")}),(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("reverification.alternativeMethods.actionLink"),onClick:r})]})})]})})};var R=r(2454),E=r(4468),K=r(8640),x=r(9090),$=r(2950),N=r(9426);let U=()=>{let{afterVerification:e}=(0,a.k)(),t=(0,N.p)(),{setActive:r}=(0,L.ho)(),{setCache:i}=z(),{navigate:n}=(0,v.r)();return{handleVerificationResponse:(0,o.useCallback)(async o=>{switch(i({data:o,isLoading:!1,isValidating:!1,error:null,cachedAt:Date.now()}),o.status){case"complete":return await r({session:o.session.id}),e?.();case"needs_second_factor":return n("./factor-two");default:return console.error((0,$.s)(o.status,t))}},[n,r,t])}};function H(e){let{onShowAlternativeMethodsClick:t}=e,{session:r}=(0,L.wV)(),{handleVerificationResponse:n}=U(),a=(0,d.f0)(),[c,s]=o.useState(!1),u=o.useCallback(()=>s(e=>!e),[s]),h=(0,K.tJ)("password","",{type:"password",label:(0,p.G)("formFieldLabel__password"),placeholder:(0,p.G)("formFieldInputPlaceholder__password")}),f=async e=>(e.preventDefault(),r?.attemptFirstFactorVerification({strategy:"password",password:h.value}).then(n).catch(e=>(0,E.H4)(e,[h],a.setError)));return c?(0,i.Y)(x.n,{onBackLinkClick:u}):(0,i.Y)(l.n.Part,{part:"password",children:(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{showLogo:!0,children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.password.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.password.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:a.error}),(0,i.FD)(C.fv,{elementDescriptor:w.$z.main,gap:4,children:[(0,i.FD)(R.l.Root,{onSubmit:f,gap:8,children:[(0,i.Y)(R.l.ControlRow,{elementId:h.id,children:(0,i.Y)(R.l.PasswordInput,{...h.props,autoFocus:!0})}),(0,i.Y)(R.l.SubmitButton,{hasArrow:!0})]}),(0,i.Y)(y.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)(t?"reverification.password.actionLink":"reverification.alternativeMethods.actionLink"),onClick:t||u})})]})]}),(0,i.Y)(y.Z.Footer,{})]})})}function j(e,t){return"primary"in e&&e.primary&&!("primary"in t&&t.primary)?-1:"primary"in t&&t.primary&&!("primary"in e&&e.primary)?1:0}var J=r(7912);let W=e=>{let{session:t}=(0,L.wV)(),r=(0,d.f0)(),{handleVerificationResponse:n}=U();o.useEffect(()=>{e.factorAlreadyPrepared||a()},[]);let a=()=>{t.prepareFirstFactorVerification(e.factor).then(()=>e.onFactorPrepare()).catch(e=>(0,E.H4)(e,[],r.setError))};return(0,i.Y)(J.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(r,i,o)=>{t.attemptFirstFactorVerification({strategy:e.factor.strategy,code:r}).then(async e=>(await i(),n(e))).catch(o)},onResendCodeClicked:a,safeIdentifier:e.factor.safeIdentifier,profileImageUrl:t?.user?.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,showAlternativeMethods:e.showAlternativeMethods,onBackLinkClicked:e.onBackLinkClicked})},q=e=>(0,i.Y)(l.n.Part,{part:"emailCode",children:(0,i.Y)(W,{...e,cardTitle:(0,p.G)("reverification.emailCode.title"),cardSubtitle:(0,p.G)("reverification.emailCode.subtitle"),inputLabel:(0,p.G)("reverification.emailCode.formTitle"),resendButton:(0,p.G)("reverification.emailCode.resendButton")})}),O=e=>{let{onShowAlternativeMethodsClicked:t}=e,{session:r}=(0,L.wV)(),{__internal_isWebAuthnSupported:o}=(0,L.ho)(),{handleVerificationResponse:n}=U(),a=(0,d.f0)();return(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{showLogo:!0,children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.passkey.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.passkey.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:a.error}),(0,i.Y)(C.fv,{elementDescriptor:w.$z.main,gap:8,children:(0,i.Y)(R.l.Root,{children:(0,i.FD)(C.fv,{gap:3,children:[(0,i.Y)(C.$n,{type:"button",onClick:e=>{e.preventDefault(),r?.verifyWithPasskey().then(e=>n(e)).catch(e=>(0,E.H4)(e,[],a.setError))},localizationKey:(0,p.G)("reverification.passkey.blockButton__passkey"),hasArrow:!0}),(0,i.Y)(y.Z.Action,{elementId:"alternativeMethods",children:t&&(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("footerActionLink__useAnotherMethod"),onClick:t})})]})})})]}),(0,i.Y)(y.Z.Footer,{})]})},X=e=>(0,i.Y)(l.n.Part,{part:"phoneCode",children:(0,i.Y)(W,{...e,cardTitle:(0,p.G)("reverification.phoneCode.title"),cardSubtitle:(0,p.G)("reverification.phoneCode.subtitle"),inputLabel:(0,p.G)("reverification.phoneCode.formTitle"),resendButton:(0,p.G)("reverification.phoneCode.resendButton"),showAlternativeMethods:e.showAlternativeMethods})}),Q=e=>{if(!e)return"";let t=e.strategy;return"emailAddressId"in e&&(t+=e.emailAddressId),"phoneNumberId"in e&&(t+=e.phoneNumberId),t},ee=["password","email_code","phone_code","passkey"],et=T((0,d.dm)(function(){let{data:e}=z(),t=(0,d.f0)(),{navigate:r}=(0,v.r)(),n=o.useRef(""),a=(0,o.useMemo)(()=>e.supportedFirstFactors?.filter(e=>ee.includes(e.strategy))?.sort(j)||null,[e.supportedFirstFactors]),{preferredSignInStrategy:l}=(0,f.O)().displayConfig,[{currentFactor:c},s]=o.useState(()=>({currentFactor:(0,k.xf)(a,null,l),prevCurrentFactor:void 0})),{hasAnyStrategy:m,hasFirstParty:Y}=D({filterOutFactor:c,supportedFirstFactors:a}),[y,b]=o.useState(()=>!c||!(0,k.Cm)(c)),g=m?()=>{t.setError(void 0),b(e=>!e)}:void 0,C=()=>{n.current=Q(c)};if((0,o.useEffect)(()=>{"needs_second_factor"===e.status&&r("factor-two")},[]),!c)return(0,i.Y)(u.J,{cardTitle:(0,p.G)("reverification.noAvailableMethods.title"),cardSubtitle:(0,p.G)("reverification.noAvailableMethods.subtitle"),message:(0,p.G)("reverification.noAvailableMethods.message"),shouldNavigateBack:!1});if(y){let e=(0,k.Cm)(c);return(0,i.Y)(P,{onBackLinkClick:e?()=>{t.setError(void 0),g?.()}:void 0,onFactorSelected:e=>{s(t=>({currentFactor:e,prevCurrentFactor:t.currentFactor})),g?.()},currentFactor:c})}switch(c?.strategy){case"password":return(0,i.Y)(H,{onShowAlternativeMethodsClick:g});case"email_code":return(0,i.Y)(q,{factorAlreadyPrepared:n.current===Q(c),onFactorPrepare:C,onShowAlternativeMethodsClicked:g,factor:c,showAlternativeMethods:Y});case"phone_code":return(0,i.Y)(X,{factorAlreadyPrepared:n.current===Q(c),onFactorPrepare:C,onShowAlternativeMethodsClicked:g,factor:c,showAlternativeMethods:Y});case"passkey":return(0,i.Y)(O,{onShowAlternativeMethodsClicked:g});default:return(0,i.Y)(h.B,{})}}));var er=r(2690);let ei=e=>{let t=(0,d.f0)(),{session:r}=(0,L.wV)(),{handleVerificationResponse:n}=U();o.useEffect(()=>{e.factorAlreadyPrepared||a?.()},[]);let a=e.prepare?()=>e.prepare?.().then(()=>e.onFactorPrepare()).catch(e=>(0,E.H4)(e,[],t.setError)):void 0;return(0,i.Y)(J.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,resendButton:e.resendButton,inputLabel:e.inputLabel,onCodeEntryFinishedAction:(t,i,o)=>{r.attemptSecondFactorVerification({strategy:e.factor.strategy,code:t}).then(async e=>(await i(),n(e))).catch(o)},onResendCodeClicked:a,safeIdentifier:"safeIdentifier"in e.factor?e.factor.safeIdentifier:void 0,profileImageUrl:r?.user?.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,showAlternativeMethods:e.showAlternativeMethods})};function eo(e){return(0,i.Y)(l.n.Part,{part:"totp2Fa",children:(0,i.Y)(ei,{...e,cardTitle:(0,p.G)("reverification.totpMfa.title"),cardSubtitle:(0,p.G)("reverification.totpMfa.subtitle"),inputLabel:(0,p.G)("reverification.totpMfa.formTitle"),showAlternativeMethods:e.showAlternativeMethods})})}let en=e=>{let[t,r]=o.useState(!1),n=o.useCallback(()=>r(e=>!e),[r]);return t?(0,i.Y)(Z,{onBackLinkClick:n}):(0,i.Y)(ea,{supportedSecondFactors:e.supportedSecondFactors,onBackLinkClick:e.onBackLinkClick,onFactorSelected:e.onFactorSelected,onHavingTroubleClick:n})},ea=e=>{let{supportedSecondFactors:t,onHavingTroubleClick:r,onFactorSelected:o,onBackLinkClick:n}=e,a=(0,d.f0)();return(0,i.Y)(l.n.Part,{part:"alternativeMethods",children:(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{showLogo:!0,children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.alternativeMethods.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.alternativeMethods.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:a.error}),(0,i.FD)(C.fv,{elementDescriptor:w.$z.main,gap:3,children:[(0,i.Y)(C.fv,{gap:2,children:t?.sort(G.Wy).map((e,t)=>(0,i.Y)(m.X,{textLocalizationKey:function(e){switch(e.strategy){case"phone_code":return(0,p.G)("reverification.alternativeMethods.blockButton__phoneCode",{identifier:(0,g.u)(e.safeIdentifier)||""});case"totp":return(0,p.G)("reverification.alternativeMethods.blockButton__totp");case"backup_code":return(0,p.G)("reverification.alternativeMethods.blockButton__backupCode");default:throw Error(`Invalid verification strategy: "${e.strategy}"`)}}(e),elementDescriptor:w.$z.alternativeMethodsBlockButton,textElementDescriptor:w.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:w.$z.alternativeMethodsBlockButtonArrow,isDisabled:a.isLoading,onClick:()=>o(e)},t))}),(0,i.Y)(y.Z.Action,{elementId:"alternativeMethods",children:n&&(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("backButton"),onClick:e.onBackLinkClick})})]})]}),(0,i.Y)(y.Z.Footer,{children:(0,i.FD)(y.Z.Action,{elementId:"havingTrouble",children:[(0,i.Y)(y.Z.ActionText,{localizationKey:(0,p.G)("reverification.alternativeMethods.actionText")}),(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("reverification.alternativeMethods.actionLink"),onClick:r})]})})]})})},el=e=>{let{onShowAlternativeMethodsClicked:t}=e,{session:r}=(0,L.wV)(),{handleVerificationResponse:o}=U(),n=(0,d.f0)(),a=(0,K.tJ)("code","",{type:"text",label:(0,p.G)("formFieldLabel__backupCode"),isRequired:!0});return(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{showLogo:!0,children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.backupCodeMfa.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.backupCodeMfa.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:n.error}),(0,i.Y)(C.fv,{elementDescriptor:w.$z.main,gap:8,children:(0,i.FD)(R.l.Root,{onSubmit:e=>(e.preventDefault(),r.attemptSecondFactorVerification({strategy:"backup_code",code:a.value}).then(o).catch(e=>(0,E.H4)(e,[a],n.setError))),children:[(0,i.Y)(R.l.ControlRow,{elementId:a.id,children:(0,i.Y)(R.l.PlainInput,{...a.props,autoFocus:!0,onActionClicked:t})}),(0,i.FD)(C.fv,{gap:3,children:[(0,i.Y)(R.l.SubmitButton,{hasArrow:!0}),(0,i.Y)(y.Z.Action,{elementId:"alternativeMethods",children:t&&(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("footerActionLink__useAnotherMethod"),onClick:t})})]})]})})]}),(0,i.Y)(y.Z.Footer,{})]})},ec=e=>{let{session:t}=(0,L.wV)();return(0,i.Y)(l.n.Part,{part:"phoneCode2Fa",children:(0,i.Y)(ei,{...e,cardTitle:(0,p.G)("reverification.phoneCodeMfa.title"),cardSubtitle:(0,p.G)("reverification.phoneCodeMfa.subtitle"),inputLabel:(0,p.G)("reverification.phoneCodeMfa.formTitle"),resendButton:(0,p.G)("reverification.phoneCodeMfa.resendButton"),prepare:()=>{let{phoneNumberId:r,strategy:i}=e.factor;return t.prepareSecondFactorVerification({phoneNumberId:r,strategy:i})}})})},es=["phone_code","totp","backup_code"],ed=T((0,d.dm)(function(){let{navigate:e}=(0,v.r)(),{data:t}=z(),r=(0,o.useMemo)(()=>t.supportedSecondFactors?.filter(e=>es.includes(e.strategy))?.sort(j)||null,[t.supportedSecondFactors]),{currentFactor:n,factorAlreadyPrepared:a,handleFactorPrepare:l,selectFactor:c,showAllStrategies:s,toggleAllStrategies:d}=(0,er.j)(r),u=(0,o.useMemo)(()=>r?.filter(e=>!e||!n||("phone_code"===e.strategy&&"phone_code"===n.strategy?e.phoneNumberId!==n.phoneNumberId:e.strategy!==n.strategy)),[r,n]),f=(0,o.useMemo)(()=>u&&u.length>0||!1,[u]);if((0,o.useEffect)(()=>{"needs_first_factor"===t.status&&e("../")},[]),!n)return(0,i.Y)(h.B,{});if(s&&f)return(0,i.Y)(en,{supportedSecondFactors:u||null,onBackLinkClick:d,onFactorSelected:c});switch(n?.strategy){case"phone_code":return(0,i.Y)(ec,{factorAlreadyPrepared:a,onFactorPrepare:l,factor:n,onShowAlternativeMethodsClicked:d,showAlternativeMethods:f});case"totp":return(0,i.Y)(eo,{factorAlreadyPrepared:a,onFactorPrepare:l,factor:n,onShowAlternativeMethodsClicked:d,showAlternativeMethods:f});case"backup_code":return(0,i.Y)(el,{onShowAlternativeMethodsClicked:d});default:return(0,i.Y)(h.B,{})}}));function eu(){let{invalidate:e}=z();return(0,o.useEffect)(()=>()=>{e()},[]),(0,i.Y)(l.n.Root,{flow:"userVerification",children:(0,i.FD)(c.d,{children:[(0,i.Y)(s.q,{path:"factor-two",children:(0,i.Y)(ed,{})}),(0,i.Y)(s.q,{index:!0,children:(0,i.Y)(et,{})})]})})}eu.displayName="UserVerification";let eh=(0,n.Z)(eu),ef=e=>(0,i.Y)(s.q,{path:"user-verification",children:(0,i.Y)(a._.Provider,{value:{componentName:"UserVerification",...e,routing:"virtual"},children:(0,i.Y)("div",{children:(0,i.Y)(eh,{...e,routing:"virtual"})})})})},9078:function(e,t,r){r.d(t,{_:()=>o,k:()=>n});var i=r(5074);let o=(0,i.createContext)(null),n=()=>{let e=(0,i.useContext)(o);if(!e||"UserVerification"!==e.componentName)throw Error("Clerk: useUserVerificationContext called outside of the mounted UserVerification component.");let{componentName:t,...r}=e;return{...r,componentName:t}}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["636"],{9090:function(e,t,r){r.d(t,{n:()=>a});var i=r(4518),o=r(5170),n=r(2861);let a=e=>{let{onBackLinkClick:t}=e;return(0,i.Y)(o.J,{cardTitle:(0,n.G)("signIn.alternativeMethods.getHelp.title"),cardSubtitle:(0,n.G)("signIn.alternativeMethods.getHelp.content"),onBackLinkClick:t})}},2690:function(e,t,r){r.d(t,{j:()=>a});var i=r(5074),o=r(5763);let n=e=>{if(!e)return"";let t=e.strategy;return"phoneNumberId"in e&&(t+=e.phoneNumberId),t};function a(e){let t=i.useRef(""),[r,a]=i.useState(()=>(0,o.R5)(e)),[l,c]=i.useState(!r),s=t.current===n(r);return{currentFactor:r,factorAlreadyPrepared:s,handleFactorPrepare:()=>{t.current=n(r)},selectFactor:e=>{a(e),c(!1)},showAllStrategies:l,toggleAllStrategies:()=>c(e=>!e)}}},5763:function(e,t,r){r.d(t,{Cm:()=>u,Kw:()=>p,R5:()=>h,UY:()=>v,iy:()=>m,oj:()=>k,xf:()=>s}),r(1044);var i=r(2620),o=r(7651),n=r(1959),a=r(8289);let l=e=>t=>"safeIdentifier"in t&&t.safeIdentifier===e;function c(e){if((0,i.Bz)()){let t=e.find(({strategy:e})=>"passkey"===e);if(t)return t}return null}function s(e,t,r){return e&&0!==e.length?r===n._o.Password?function(e,t){let r=c(e);if(r)return r;let i=e.sort(a.Kn)[0];return"password"===i.strategy?i:e.find(l(t))||i||null}(e,t):function(e,t){let r=c(e);if(r)return r;let i=e.sort(a.Ih),o=i.find(l(t));if(o)return o;let n=i[0];return"email_link"===n.strategy?n:e.find(l(t))||n||null}(e,t):null}let d=["passkey","email_code","password","phone_code","email_link"];function u(e){return!!e&&d.includes(e.strategy)}function h(e){if(!e||0===e.length)return null;let t=e.find(e=>"totp"===e.strategy);if(t)return t;let r=e.find(e=>"phone_code"===e.strategy);return r||e[0]}let f=["reset_password_phone_code","reset_password_email_code"],p=e=>!!e&&f.includes(e);function v(e){let t;return"tel"===e.type?"phoneNumber":(t=e.value,/^\S+@\S+\.\S+$/.test(t))?"emailAddress":"username"}let k=(e,t,r)=>{if(!t)return null;let i=e.find(e=>"strategy"===e.id)?.value;if(i&&"phone_code"!==i)return null;let n=e.find(e=>e.id===r)?.value;if(!n||!n?.startsWith("+"))return null;let a=(0,o.TV)(n,t);return"sms"===a?null:a},m=(e,t,r)=>{if(!e||!t||"phoneNumber"!==t||!r||!r?.startsWith("+"))return null;let i=(0,o.TV)(r,e);return"sms"===i?null:i}},9066:function(e,t,r){r.r(t),r.d(t,{UserVerification:()=>eh,UserVerificationModal:()=>ef});var i=r(4518),o=r(5074),n=r(5577),a=r(9078),l=r(4607),c=r(7831),s=r(2265),d=r(3269),u=r(5170),h=r(6980),f=r(7697),p=r(2861),v=r(4964),k=r(5763),m=r(8738),Y=r(29),y=r(6088),b=r(6153),g=r(9835),C=r(8272),w=r(8920),F=r(4421),M=r(1051),A=r(743),_=r(6889),S=r(9830),B=r(2620),G=r(8289);function D({filterOutFactor:e,supportedFirstFactors:t}){let r=t?t.filter(e=>!(0,k.Kw)(e.strategy)):[],i=r&&r.length>0,n=(0,o.useMemo)(()=>t?t.filter(e=>!e.strategy.startsWith("oauth_")).filter(e=>(0,k.Cm)(e)).filter(t=>!t||!e||("email_code"===t.strategy&&"email_code"===e.strategy?t.emailAddressId!==e.emailAddressId:"phone_code"===t.strategy&&"phone_code"===e.strategy?t.phoneNumberId!==e.phoneNumberId:t.strategy!==e.strategy)).filter(e=>"passkey"!==e.strategy||(0,B.Bz)()).sort(G.aR):[],[t,e]);return{hasAnyStrategy:i,hasFirstParty:n&&n.length>0,firstPartyFactors:n}}var L=r(1210),I=r(7896);let z=()=>{let{session:e}=(0,L.wV)(),t=(()=>{let{level:e}=(0,a.k)();return(0,o.useMemo)(()=>({level:e||"second_factor"}),[e])})();return{...(0,I.s)(e?e.startVerification:void 0,t,{throttleTime:300})}};function T(e){let t=t=>{let{isLoading:r,data:o}=z();return r||!o?(0,i.Y)(h.B,{}):(0,i.Y)(e,{...t})},r=e.displayName||e.name||"Component";return e.displayName=r,t.displayName=r,t}let Z=e=>{let{onBackLinkClick:t}=e;return(0,i.Y)(u.J,{cardTitle:(0,p.G)("reverification.alternativeMethods.getHelp.title"),cardSubtitle:(0,p.G)("reverification.alternativeMethods.getHelp.content"),onBackLinkClick:t})},P=e=>((e,t)=>{let[r,n]=o.useState(!1),a=o.useCallback(()=>n(e=>!e),[n]);return r?(0,i.Y)(Z,{onBackLinkClick:a}):(0,i.Y)(e,{...t,onHavingTroubleClick:a})})(V,{...e}),V=e=>{let{onBackLinkClick:t,onHavingTroubleClick:r,onFactorSelected:o}=e,n=(0,d.f0)(),{data:a}=z(),{firstPartyFactors:c,hasAnyStrategy:s}=D({filterOutFactor:e?.currentFactor,supportedFirstFactors:a?.supportedFirstFactors});return(0,i.Y)(l.n.Part,{part:"alternativeMethods",children:(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.alternativeMethods.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.alternativeMethods.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:n.error}),(0,i.Y)(C.so,{direction:"col",elementDescriptor:w.$z.main,gap:6,children:(0,i.FD)(C.fv,{gap:4,children:[s&&(0,i.Y)(C.so,{elementDescriptor:w.$z.alternativeMethods,direction:"col",gap:2,children:c.map((e,t)=>{var r;return(0,i.Y)(m.X,{leftIcon:(r=e,({email_code:F.A,phone_code:M.A,password:A.A,passkey:_.A,enterprise_sso:S.A})[r.strategy]),textLocalizationKey:function(e){switch(e.strategy){case"email_code":return(0,p.G)("reverification.alternativeMethods.blockButton__emailCode",{identifier:(0,g.u)(e.safeIdentifier)||""});case"phone_code":return(0,p.G)("reverification.alternativeMethods.blockButton__phoneCode",{identifier:(0,g.u)(e.safeIdentifier)||""});case"password":return(0,p.G)("reverification.alternativeMethods.blockButton__password");case"passkey":return(0,p.G)("reverification.alternativeMethods.blockButton__passkey");default:throw Error(`Invalid sign in strategy: "${e.strategy}"`)}}(e),elementDescriptor:w.$z.alternativeMethodsBlockButton,textElementDescriptor:w.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:w.$z.alternativeMethodsBlockButtonArrow,textVariant:"buttonLarge",isDisabled:n.isLoading,onClick:()=>{n.setError(void 0),o(e)}},t)})}),t&&(0,i.Y)(Y.E,{boxElementDescriptor:w.$z.backRow,linkElementDescriptor:w.$z.backLink,onClick:t})]})})]}),(0,i.Y)(y.Z.Footer,{children:(0,i.FD)(y.Z.Action,{elementId:"havingTrouble",children:[(0,i.Y)(y.Z.ActionText,{localizationKey:(0,p.G)("reverification.alternativeMethods.actionText")}),(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("reverification.alternativeMethods.actionLink"),onClick:r})]})})]})})};var R=r(2454),E=r(4468),K=r(8640),x=r(9090),$=r(2950),N=r(9426);let U=()=>{let{afterVerification:e}=(0,a.k)(),t=(0,N.p)(),{setActive:r}=(0,L.ho)(),{setCache:i}=z(),{navigate:n}=(0,v.r)();return{handleVerificationResponse:(0,o.useCallback)(async o=>{switch(i({data:o,isLoading:!1,isValidating:!1,error:null,cachedAt:Date.now()}),o.status){case"complete":return await r({session:o.session.id}),e?.();case"needs_second_factor":return n("./factor-two");default:return console.error((0,$.s)(o.status,t))}},[n,r,t])}};function H(e){let{onShowAlternativeMethodsClick:t}=e,{session:r}=(0,L.wV)(),{handleVerificationResponse:n}=U(),a=(0,d.f0)(),[c,s]=o.useState(!1),u=o.useCallback(()=>s(e=>!e),[s]),h=(0,K.tJ)("password","",{type:"password",label:(0,p.G)("formFieldLabel__password"),placeholder:(0,p.G)("formFieldInputPlaceholder__password")}),f=async e=>(e.preventDefault(),r?.attemptFirstFactorVerification({strategy:"password",password:h.value}).then(n).catch(e=>(0,E.H4)(e,[h],a.setError)));return c?(0,i.Y)(x.n,{onBackLinkClick:u}):(0,i.Y)(l.n.Part,{part:"password",children:(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{showLogo:!0,children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.password.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.password.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:a.error}),(0,i.FD)(C.fv,{elementDescriptor:w.$z.main,gap:4,children:[(0,i.FD)(R.l.Root,{onSubmit:f,gap:8,children:[(0,i.Y)(R.l.ControlRow,{elementId:h.id,children:(0,i.Y)(R.l.PasswordInput,{...h.props,autoFocus:!0})}),(0,i.Y)(R.l.SubmitButton,{hasArrow:!0})]}),(0,i.Y)(y.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)(t?"reverification.password.actionLink":"reverification.alternativeMethods.actionLink"),onClick:t||u})})]})]}),(0,i.Y)(y.Z.Footer,{})]})})}function j(e,t){return"primary"in e&&e.primary&&!("primary"in t&&t.primary)?-1:"primary"in t&&t.primary&&!("primary"in e&&e.primary)?1:0}var J=r(7912);let W=e=>{let{session:t}=(0,L.wV)(),r=(0,d.f0)(),{handleVerificationResponse:n}=U();o.useEffect(()=>{e.factorAlreadyPrepared||a()},[]);let a=()=>{t.prepareFirstFactorVerification(e.factor).then(()=>e.onFactorPrepare()).catch(e=>(0,E.H4)(e,[],r.setError))};return(0,i.Y)(J.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(r,i,o)=>{t.attemptFirstFactorVerification({strategy:e.factor.strategy,code:r}).then(async e=>(await i(),n(e))).catch(o)},onResendCodeClicked:a,safeIdentifier:e.factor.safeIdentifier,profileImageUrl:t?.user?.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,showAlternativeMethods:e.showAlternativeMethods,onBackLinkClicked:e.onBackLinkClicked})},q=e=>(0,i.Y)(l.n.Part,{part:"emailCode",children:(0,i.Y)(W,{...e,cardTitle:(0,p.G)("reverification.emailCode.title"),cardSubtitle:(0,p.G)("reverification.emailCode.subtitle"),inputLabel:(0,p.G)("reverification.emailCode.formTitle"),resendButton:(0,p.G)("reverification.emailCode.resendButton")})}),O=e=>{let{onShowAlternativeMethodsClicked:t}=e,{session:r}=(0,L.wV)(),{__internal_isWebAuthnSupported:o}=(0,L.ho)(),{handleVerificationResponse:n}=U(),a=(0,d.f0)();return(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{showLogo:!0,children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.passkey.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.passkey.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:a.error}),(0,i.Y)(C.fv,{elementDescriptor:w.$z.main,gap:8,children:(0,i.Y)(R.l.Root,{children:(0,i.FD)(C.fv,{gap:3,children:[(0,i.Y)(C.$n,{type:"button",onClick:e=>{e.preventDefault(),r?.verifyWithPasskey().then(e=>n(e)).catch(e=>(0,E.H4)(e,[],a.setError))},localizationKey:(0,p.G)("reverification.passkey.blockButton__passkey"),hasArrow:!0}),(0,i.Y)(y.Z.Action,{elementId:"alternativeMethods",children:t&&(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("footerActionLink__useAnotherMethod"),onClick:t})})]})})})]}),(0,i.Y)(y.Z.Footer,{})]})},X=e=>(0,i.Y)(l.n.Part,{part:"phoneCode",children:(0,i.Y)(W,{...e,cardTitle:(0,p.G)("reverification.phoneCode.title"),cardSubtitle:(0,p.G)("reverification.phoneCode.subtitle"),inputLabel:(0,p.G)("reverification.phoneCode.formTitle"),resendButton:(0,p.G)("reverification.phoneCode.resendButton"),showAlternativeMethods:e.showAlternativeMethods})}),Q=e=>{if(!e)return"";let t=e.strategy;return"emailAddressId"in e&&(t+=e.emailAddressId),"phoneNumberId"in e&&(t+=e.phoneNumberId),t},ee=["password","email_code","phone_code","passkey"],et=T((0,d.dm)(function(){let{data:e}=z(),t=(0,d.f0)(),{navigate:r}=(0,v.r)(),n=o.useRef(""),a=(0,o.useMemo)(()=>e.supportedFirstFactors?.filter(e=>ee.includes(e.strategy))?.sort(j)||null,[e.supportedFirstFactors]),{preferredSignInStrategy:l}=(0,f.O)().displayConfig,[{currentFactor:c},s]=o.useState(()=>({currentFactor:(0,k.xf)(a,null,l),prevCurrentFactor:void 0})),{hasAnyStrategy:m,hasFirstParty:Y}=D({filterOutFactor:c,supportedFirstFactors:a}),[y,b]=o.useState(()=>!c||!(0,k.Cm)(c)),g=m?()=>{t.setError(void 0),b(e=>!e)}:void 0,C=()=>{n.current=Q(c)};if((0,o.useEffect)(()=>{"needs_second_factor"===e.status&&r("factor-two")},[]),!c)return(0,i.Y)(u.J,{cardTitle:(0,p.G)("reverification.noAvailableMethods.title"),cardSubtitle:(0,p.G)("reverification.noAvailableMethods.subtitle"),message:(0,p.G)("reverification.noAvailableMethods.message"),shouldNavigateBack:!1});if(y){let e=(0,k.Cm)(c);return(0,i.Y)(P,{onBackLinkClick:e?()=>{t.setError(void 0),g?.()}:void 0,onFactorSelected:e=>{s(t=>({currentFactor:e,prevCurrentFactor:t.currentFactor})),g?.()},currentFactor:c})}switch(c?.strategy){case"password":return(0,i.Y)(H,{onShowAlternativeMethodsClick:g});case"email_code":return(0,i.Y)(q,{factorAlreadyPrepared:n.current===Q(c),onFactorPrepare:C,onShowAlternativeMethodsClicked:g,factor:c,showAlternativeMethods:Y});case"phone_code":return(0,i.Y)(X,{factorAlreadyPrepared:n.current===Q(c),onFactorPrepare:C,onShowAlternativeMethodsClicked:g,factor:c,showAlternativeMethods:Y});case"passkey":return(0,i.Y)(O,{onShowAlternativeMethodsClicked:g});default:return(0,i.Y)(h.B,{})}}));var er=r(2690);let ei=e=>{let t=(0,d.f0)(),{session:r}=(0,L.wV)(),{handleVerificationResponse:n}=U();o.useEffect(()=>{e.factorAlreadyPrepared||a?.()},[]);let a=e.prepare?()=>e.prepare?.().then(()=>e.onFactorPrepare()).catch(e=>(0,E.H4)(e,[],t.setError)):void 0;return(0,i.Y)(J.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,resendButton:e.resendButton,inputLabel:e.inputLabel,onCodeEntryFinishedAction:(t,i,o)=>{r.attemptSecondFactorVerification({strategy:e.factor.strategy,code:t}).then(async e=>(await i(),n(e))).catch(o)},onResendCodeClicked:a,safeIdentifier:"safeIdentifier"in e.factor?e.factor.safeIdentifier:void 0,profileImageUrl:r?.user?.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,showAlternativeMethods:e.showAlternativeMethods})};function eo(e){return(0,i.Y)(l.n.Part,{part:"totp2Fa",children:(0,i.Y)(ei,{...e,cardTitle:(0,p.G)("reverification.totpMfa.title"),cardSubtitle:(0,p.G)("reverification.totpMfa.subtitle"),inputLabel:(0,p.G)("reverification.totpMfa.formTitle"),showAlternativeMethods:e.showAlternativeMethods})})}let en=e=>{let[t,r]=o.useState(!1),n=o.useCallback(()=>r(e=>!e),[r]);return t?(0,i.Y)(Z,{onBackLinkClick:n}):(0,i.Y)(ea,{supportedSecondFactors:e.supportedSecondFactors,onBackLinkClick:e.onBackLinkClick,onFactorSelected:e.onFactorSelected,onHavingTroubleClick:n})},ea=e=>{let{supportedSecondFactors:t,onHavingTroubleClick:r,onFactorSelected:o,onBackLinkClick:n}=e,a=(0,d.f0)();return(0,i.Y)(l.n.Part,{part:"alternativeMethods",children:(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{showLogo:!0,children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.alternativeMethods.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.alternativeMethods.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:a.error}),(0,i.FD)(C.fv,{elementDescriptor:w.$z.main,gap:3,children:[(0,i.Y)(C.fv,{gap:2,children:t?.sort(G.Wy).map((e,t)=>(0,i.Y)(m.X,{textLocalizationKey:function(e){switch(e.strategy){case"phone_code":return(0,p.G)("reverification.alternativeMethods.blockButton__phoneCode",{identifier:(0,g.u)(e.safeIdentifier)||""});case"totp":return(0,p.G)("reverification.alternativeMethods.blockButton__totp");case"backup_code":return(0,p.G)("reverification.alternativeMethods.blockButton__backupCode");default:throw Error(`Invalid verification strategy: "${e.strategy}"`)}}(e),elementDescriptor:w.$z.alternativeMethodsBlockButton,textElementDescriptor:w.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:w.$z.alternativeMethodsBlockButtonArrow,isDisabled:a.isLoading,onClick:()=>o(e)},t))}),(0,i.Y)(y.Z.Action,{elementId:"alternativeMethods",children:n&&(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("backButton"),onClick:e.onBackLinkClick})})]})]}),(0,i.Y)(y.Z.Footer,{children:(0,i.FD)(y.Z.Action,{elementId:"havingTrouble",children:[(0,i.Y)(y.Z.ActionText,{localizationKey:(0,p.G)("reverification.alternativeMethods.actionText")}),(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("reverification.alternativeMethods.actionLink"),onClick:r})]})})]})})},el=e=>{let{onShowAlternativeMethodsClicked:t}=e,{session:r}=(0,L.wV)(),{handleVerificationResponse:o}=U(),n=(0,d.f0)(),a=(0,K.tJ)("code","",{type:"text",label:(0,p.G)("formFieldLabel__backupCode"),isRequired:!0});return(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{showLogo:!0,children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.backupCodeMfa.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.backupCodeMfa.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:n.error}),(0,i.Y)(C.fv,{elementDescriptor:w.$z.main,gap:8,children:(0,i.FD)(R.l.Root,{onSubmit:e=>(e.preventDefault(),r.attemptSecondFactorVerification({strategy:"backup_code",code:a.value}).then(o).catch(e=>(0,E.H4)(e,[a],n.setError))),children:[(0,i.Y)(R.l.ControlRow,{elementId:a.id,children:(0,i.Y)(R.l.PlainInput,{...a.props,autoFocus:!0,onActionClicked:t})}),(0,i.FD)(C.fv,{gap:3,children:[(0,i.Y)(R.l.SubmitButton,{hasArrow:!0}),(0,i.Y)(y.Z.Action,{elementId:"alternativeMethods",children:t&&(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("footerActionLink__useAnotherMethod"),onClick:t})})]})]})})]}),(0,i.Y)(y.Z.Footer,{})]})},ec=e=>{let{session:t}=(0,L.wV)();return(0,i.Y)(l.n.Part,{part:"phoneCode2Fa",children:(0,i.Y)(ei,{...e,cardTitle:(0,p.G)("reverification.phoneCodeMfa.title"),cardSubtitle:(0,p.G)("reverification.phoneCodeMfa.subtitle"),inputLabel:(0,p.G)("reverification.phoneCodeMfa.formTitle"),resendButton:(0,p.G)("reverification.phoneCodeMfa.resendButton"),prepare:()=>{let{phoneNumberId:r,strategy:i}=e.factor;return t.prepareSecondFactorVerification({phoneNumberId:r,strategy:i})}})})},es=["phone_code","totp","backup_code"],ed=T((0,d.dm)(function(){let{navigate:e}=(0,v.r)(),{data:t}=z(),r=(0,o.useMemo)(()=>t.supportedSecondFactors?.filter(e=>es.includes(e.strategy))?.sort(j)||null,[t.supportedSecondFactors]),{currentFactor:n,factorAlreadyPrepared:a,handleFactorPrepare:l,selectFactor:c,showAllStrategies:s,toggleAllStrategies:d}=(0,er.j)(r),u=(0,o.useMemo)(()=>r?.filter(e=>!e||!n||("phone_code"===e.strategy&&"phone_code"===n.strategy?e.phoneNumberId!==n.phoneNumberId:e.strategy!==n.strategy)),[r,n]),f=(0,o.useMemo)(()=>u&&u.length>0||!1,[u]);if((0,o.useEffect)(()=>{"needs_first_factor"===t.status&&e("../")},[]),!n)return(0,i.Y)(h.B,{});if(s&&f)return(0,i.Y)(en,{supportedSecondFactors:u||null,onBackLinkClick:d,onFactorSelected:c});switch(n?.strategy){case"phone_code":return(0,i.Y)(ec,{factorAlreadyPrepared:a,onFactorPrepare:l,factor:n,onShowAlternativeMethodsClicked:d,showAlternativeMethods:f});case"totp":return(0,i.Y)(eo,{factorAlreadyPrepared:a,onFactorPrepare:l,factor:n,onShowAlternativeMethodsClicked:d,showAlternativeMethods:f});case"backup_code":return(0,i.Y)(el,{onShowAlternativeMethodsClicked:d});default:return(0,i.Y)(h.B,{})}}));function eu(){let{invalidate:e}=z();return(0,o.useEffect)(()=>()=>{e()},[]),(0,i.Y)(l.n.Root,{flow:"userVerification",children:(0,i.FD)(c.d,{children:[(0,i.Y)(s.q,{path:"factor-two",children:(0,i.Y)(ed,{})}),(0,i.Y)(s.q,{index:!0,children:(0,i.Y)(et,{})})]})})}eu.displayName="UserVerification";let eh=(0,n.Z)(eu),ef=e=>(0,i.Y)(s.q,{path:"user-verification",children:(0,i.Y)(a._.Provider,{value:{componentName:"UserVerification",...e,routing:"virtual"},children:(0,i.Y)("div",{children:(0,i.Y)(eh,{...e,routing:"virtual"})})})})},9078:function(e,t,r){r.d(t,{_:()=>o,k:()=>n});var i=r(5074);let o=(0,i.createContext)(null),n=()=>{let e=(0,i.useContext)(o);if(!e||"UserVerification"!==e.componentName)throw Error("Clerk: useUserVerificationContext called outside of the mounted UserVerification component.");let{componentName:t,...r}=e;return{...r,componentName:t}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["265"],{1170:function(e,i,t){t.r(i),t.d(i,{WaitlistModal:()=>D,Waitlist:()=>z});var l=t(4518),r=t(
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["265"],{1170:function(e,i,t){t.r(i),t.d(i,{WaitlistModal:()=>D,Waitlist:()=>z});var l=t(4518),r=t(1210),n=t(6088),a=t(3269),o=t(8640),s=t(451),d=t(2861),c=t(4607),h=t(4132),u=t(2265),m=t(2454),Y=t(6153),p=t(4468),g=t(6245),f=t(8272),w=t(8920),A=t(4901),v=t(8388),b=t(4964),I=t(4374);let y=e=>{let i=(0,r.ho)(),t=(0,a.f0)(),o=(0,A.m)(),{navigate:c}=(0,b.r)(),h=(0,s.Y)(),{formState:u}=e,y=(0,g.X)({onNextStep:()=>t.setError(void 0)}),z=async e=>{e.preventDefault(),o.setLoading(),t.setLoading(),t.setError(void 0);let l={emailAddress:u.emailAddress.value};await i.joinWaitlist(l).then(()=>{y.nextStep(),setTimeout(()=>{h.afterJoinWaitlistUrl&&c(h.afterJoinWaitlistUrl)},2e3)}).catch(e=>{(0,p.H4)(e,[u.emailAddress],t.setError)}).finally(()=>{o.setIdle(),t.setIdle()})};return(0,l.FD)(g.s,{...y.props,children:[(0,l.FD)(f.fv,{gap:6,children:[(0,l.FD)(Y.Y.Root,{showLogo:!0,children:[(0,l.Y)(Y.Y.Title,{localizationKey:(0,d.G)("waitlist.start.title")}),(0,l.Y)(Y.Y.Subtitle,{localizationKey:(0,d.G)("waitlist.start.subtitle")})]}),(0,l.Y)(n.Z.Alert,{children:t.error}),(0,l.Y)(f.so,{direction:"col",elementDescriptor:w.$z.main,gap:6,children:(0,l.FD)(m.l.Root,{onSubmit:z,gap:8,children:[(0,l.Y)(f.fv,{gap:6,children:(0,l.Y)(m.l.ControlRow,{elementId:"emailAddress",children:(0,l.Y)(m.l.PlainInput,{...u.emailAddress.props,isRequired:!0})})}),(0,l.Y)(f.fv,{center:!0,children:(0,l.Y)(m.l.SubmitButton,{localizationKey:(0,d.G)("waitlist.start.formButton")})})]})})]}),(0,l.FD)(f.fv,{gap:6,children:[(0,l.FD)(Y.Y.Root,{showLogo:!0,children:[(0,l.Y)(Y.Y.Title,{localizationKey:(0,d.G)("waitlist.success.title")}),(0,l.Y)(Y.Y.Subtitle,{localizationKey:(0,d.G)("waitlist.success.subtitle")})]}),h.afterJoinWaitlistUrl&&(0,l.Y)(f.so,{direction:"col",elementDescriptor:w.$z.main,gap:6,children:(0,l.Y)(f.fv,{center:!0,children:(0,l.FD)(f.so,{gap:2,align:"center",children:[(0,l.Y)(f.In,{icon:v.A,sx:e=>({margin:"auto",width:e.sizes.$6,height:e.sizes.$6,animation:`${I.W.spinning} 1s linear infinite`})}),(0,l.Y)(f.EY,{colorScheme:"secondary",localizationKey:(0,d.G)("waitlist.success.message")})]})})})]})]})},z=(0,a.dm)(()=>{let e=(0,r.ho)(),i=(0,s.Y)(),{signInUrl:t}=i,a=i.initialValues||{},h={emailAddress:(0,o.tJ)("emailAddress",a.emailAddress||"",{type:"email",label:(0,d.G)("formFieldLabel__emailAddress"),placeholder:(0,d.G)("formFieldInputPlaceholder__emailAddress")})};return(0,l.Y)(c.n.Root,{flow:"waitlist",children:(0,l.FD)(n.Z.Root,{children:[(0,l.Y)(n.Z.Content,{children:(0,l.Y)(y,{formState:h})}),(0,l.Y)(n.Z.Footer,{children:(0,l.FD)(n.Z.Action,{elementId:"waitlist",children:[(0,l.Y)(n.Z.ActionText,{localizationKey:(0,d.G)("waitlist.start.actionText")}),(0,l.Y)(n.Z.ActionLink,{localizationKey:(0,d.G)("waitlist.start.actionLink"),to:e.buildUrlWithAuth(t)})]})})]})})}),D=e=>{let i={signInUrl:`/${h.I}/sign-in`,...e,routing:"virtual"};return(0,l.Y)(u.q,{path:"waitlist",children:(0,l.Y)(s.r.Provider,{value:{...i,componentName:"Waitlist",mode:"modal"},children:(0,l.Y)("div",{children:(0,l.Y)(z,{})})})})}},451:function(e,i,t){t.d(i,{Y:()=>h,r:()=>c});var l=t(4173),r=t(5074),n=t(7697),a=t(2366),o=t(4964),s=t(2117);let d=["email_address"],c=(0,r.createContext)(null),h=()=>{let e=(0,r.useContext)(c),{displayConfig:i}=(0,n.O)(),t=(0,a.II)(),{queryString:h}=(0,o.r)(),u=(0,r.useMemo)(()=>(0,s.tf)(h,d),[]);if(!e||"Waitlist"!==e.componentName)throw Error("Clerk: useWaitlistContext called outside Waitlist.");let{componentName:m,...Y}=e,p=Y.signInUrl||t.signInUrl||i.signInUrl;return p=(0,l.kZ)({base:p},{stringify:!0}),{...Y,componentName:m,signInUrl:p,initialValues:{...u}}}}}]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerk/ui",
|
|
3
|
-
"version": "1.0.0-snapshot.
|
|
3
|
+
"version": "1.0.0-snapshot.v20251217165918",
|
|
4
4
|
"description": "Internal package that contains the UI components for the Clerk frontend SDKs",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"dequal": "2.0.3",
|
|
55
55
|
"input-otp": "1.4.2",
|
|
56
56
|
"qrcode.react": "4.2.0",
|
|
57
|
-
"react": "^18.0.0 || ^19.0.
|
|
58
|
-
"react-dom": "^18.0.0 || ^19.0.
|
|
57
|
+
"react": "^18.0.0 || ^19.0.3 || ^19.1.4 || ^19.2.3 || ^19.3.0-0",
|
|
58
|
+
"react-dom": "^18.0.0 || ^19.0.3 || ^19.1.4 || ^19.2.3 || ^19.3.0-0",
|
|
59
59
|
"swr": "2.3.4",
|
|
60
|
-
"@clerk/localizations": "4.0.0-snapshot.
|
|
61
|
-
"@clerk/shared": "4.0.0-snapshot.
|
|
60
|
+
"@clerk/localizations": "4.0.0-snapshot.v20251217165918",
|
|
61
|
+
"@clerk/shared": "4.0.0-snapshot.v20251217165918"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@floating-ui/react-dom": "^2.1.6",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"bundlewatch": "FORCE_COLOR=1 bundlewatch --config bundlewatch.config.json",
|
|
88
88
|
"bundlewatch:fix": "node bundlewatch-fix.mjs",
|
|
89
89
|
"clean": "rimraf ./dist",
|
|
90
|
-
"dev": "
|
|
90
|
+
"dev": "rspack serve --config rspack.config.js",
|
|
91
91
|
"dev:origin": "rspack serve --config rspack.config.js --env devOrigin=http://localhost:${PORT:-4011}",
|
|
92
92
|
"dev:sandbox": "rspack serve --config rspack.config.js --env devOrigin=http://localhost:4011",
|
|
93
93
|
"format": "node ../../scripts/format-package.mjs",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["10"],{9090:function(e,t,r){r.d(t,{n:()=>o});var n=r(4518),i=r(5170),a=r(2861);let o=e=>{let{onBackLinkClick:t}=e;return(0,n.Y)(i.J,{cardTitle:(0,a.G)("signIn.alternativeMethods.getHelp.title"),cardSubtitle:(0,a.G)("signIn.alternativeMethods.getHelp.content"),onBackLinkClick:t})}},8319:function(e,t,r){let n,i;r.r(t),r.d(t,{SignIn:()=>t_,SignInModal:()=>tw});var a,o=r(4518),s=r(5543),l=r(5074),c=r(5873),d=r(4),u=r(5350),h=r(5577),p=r(4607),f=r(7896),g=r(7607),m=r(4096),I=r(7831),_=r(2265),w=r(4132),S=r(4692);let v=()=>Promise.all([r.e("545"),r.e("666"),r.e("472")]).then(r.bind(r,8480)),b=(0,l.lazy)(()=>v().then(e=>({default:e.SignUpVerifyPhone}))),Y=(0,l.lazy)(()=>v().then(e=>({default:e.SignUpVerifyEmail}))),k=(0,l.lazy)(()=>v().then(e=>({default:e.SignUpStart}))),C=(0,l.lazy)(()=>v().then(e=>({default:e.SignUpSSOCallback}))),A=(0,l.lazy)(()=>v().then(e=>({default:e.SignUpContinue})));var F=r(2950),y=r(6088),U=r(3269),P=r(2454),E=r(6153),M=r(4468),D=r(3990),L=r(8640),T=r(6324),G=r(7697),R=r(78),B=r(2861),z=r(8272),O=r(8920),$=r(8282),N=r(9426),Z=r(4964);let x=(0,U.dm)(()=>{let e=(0,T.n)(),t=(0,U.f0)(),{navigate:r}=(0,Z.r)(),n=(0,N.p)(),{userSettings:{passwordSettings:i}}=(0,G.O)(),{t:a,locale:s}=(0,R._)(),c="needs_new_password"===e.status&&"reset_password_email_code"!==e.firstFactorVerification.strategy&&"reset_password_phone_code"!==e.firstFactorVerification.strategy;l.useEffect(()=>{c&&t.setError(a((0,B.G)("signIn.resetPassword.requiredMessage")))},[]);let d=(0,L.tJ)("password","",{type:"password",label:(0,B.G)("formFieldLabel__newPassword"),isRequired:!0,validatePassword:!0,buildErrorMessage:e=>(0,D.C5)(e,{t:a,locale:s,passwordSettings:i})}),u=(0,L.tJ)("confirmPassword","",{type:"password",label:(0,B.G)("formFieldLabel__confirmPassword"),isRequired:!0}),h=(0,L.tJ)("signOutOfOtherSessions","",{type:"checkbox",label:(0,B.G)("formFieldLabel__signOutOfOtherSessions"),defaultChecked:!0}),{setConfirmPasswordFeedback:p,isPasswordMatch:f}=(0,$.Z)({passwordField:d,confirmPasswordField:u}),g=async()=>{if(f){d.clearFeedback(),u.clearFeedback();try{let{status:t,createdSessionId:i}=await e.resetPassword({password:d.value,signOutOfOtherSessions:h.checked});switch(t){case"complete":if(i){let e=new URLSearchParams;return e.set("createdSessionId",i),r(`../reset-password-success?${e.toString()}`)}return console.error((0,F.s)(t,n));case"needs_second_factor":return r("../factor-two");default:return console.error((0,F.s)(t,n))}}catch(e){return(0,M.H4)(e,[d,u],t.setError)}}};return(0,o.FD)(y.Z.Root,{children:[(0,o.FD)(y.Z.Content,{children:[(0,o.Y)(E.Y.Root,{showLogo:!0,children:(0,o.Y)(E.Y.Title,{localizationKey:(0,B.G)("signIn.resetPassword.title")})}),(0,o.Y)(y.Z.Alert,{children:t.error}),(0,o.Y)(z.fv,{elementDescriptor:O.$z.main,gap:8,children:(0,o.FD)(P.l.Root,{onSubmit:g,onBlur:()=>{d.value&&p(u.value)},gap:8,children:[(0,o.FD)(z.fv,{gap:6,children:[(0,o.Y)("input",{readOnly:!0,"data-testid":"hidden-identifier",id:"identifier-field",name:"identifier",value:e.identifier||"",style:{display:"none"}}),(0,o.Y)(P.l.ControlRow,{elementId:d.id,children:(0,o.Y)(P.l.PasswordInput,{...d.props,isRequired:!0,autoFocus:!0})}),(0,o.Y)(P.l.ControlRow,{elementId:u.id,children:(0,o.Y)(P.l.PasswordInput,{...u.props,onChange:e=>(e.target.value&&p(e.target.value),u.props.onChange(e))})}),!c&&(0,o.Y)(P.l.ControlRow,{elementId:h.id,children:(0,o.Y)(P.l.Checkbox,{...h.props})})]}),(0,o.FD)(z.fv,{gap:3,children:[(0,o.Y)(P.l.SubmitButton,{isDisabled:!f,localizationKey:(0,B.G)("signIn.resetPassword.formButtonPrimary")}),(0,o.Y)(y.Z.Action,{elementId:"alternativeMethods",children:(0,o.Y)(y.Z.ActionLink,{elementDescriptor:O.$z.backLink,localizationKey:(0,B.G)("backButton"),onClick:()=>r("../")})})]})]})})]}),(0,o.Y)(y.Z.Footer,{})]})});var K=r(9107),W=r(6488);let V=(0,U.dm)(()=>{let e=(0,U.f0)();return(0,K.h)(),(0,o.FD)(y.Z.Root,{children:[(0,o.FD)(y.Z.Content,{children:[(0,o.Y)(E.Y.Root,{showLogo:!0,children:(0,o.Y)(E.Y.Title,{localizationKey:(0,B.G)("signIn.resetPassword.title")})}),(0,o.Y)(y.Z.Alert,{children:e.error}),(0,o.FD)(z.fv,{elementDescriptor:O.$z.main,gap:8,children:[(0,o.Y)(z.EY,{localizationKey:(0,B.G)("signIn.resetPassword.successMessage")}),(0,o.Y)(W.s,{direction:"row",center:!0,children:(0,o.Y)(z.y$,{size:"xl",colorScheme:"primary",elementDescriptor:O.$z.spinner})})]})]}),(0,o.Y)(y.Z.Footer,{})]})});var q=r(2531),H=r(750),j=r(9345),J=r(656),X=r(9599),Q=r(9366),ee=r(6932),et=r(1052),er=r(2540);let en=(0,J.SY)((0,U.dm)(()=>{let e=(0,U.f0)(),{userProfileUrl:t}=(0,G.O)().displayConfig,{afterSignInUrl:r,path:n,signInUrl:i,taskUrl:a}=(0,d.r)(),{navigateAfterSignOut:s}=(0,X.g)(),{handleSignOutAllClicked:l,handleSessionClicked:c,signedInSessions:u,handleAddAccountClicked:h}=(0,er.u)({taskUrl:a,navigateAfterSignOut:s,afterSwitchSessionUrl:r,userProfileUrl:t,signInUrl:n??i,user:void 0});return(0,o.Y)(p.n.Part,{part:"accountSwitcher",children:(0,o.FD)(y.Z.Root,{children:[(0,o.FD)(y.Z.Content,{sx:e=>({padding:`${e.space.$8} ${e.space.$none} ${e.space.$none}`}),children:[(0,o.FD)(E.Y.Root,{children:[(0,o.Y)(E.Y.Title,{localizationKey:(0,B.G)("signIn.accountSwitcher.title")}),(0,o.Y)(E.Y.Subtitle,{localizationKey:(0,B.G)("signIn.accountSwitcher.subtitle")})]}),(0,o.Y)(y.Z.Alert,{children:e.error}),(0,o.Y)(z.fv,{elementDescriptor:O.$z.main,gap:8,sx:e=>({borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100}),children:(0,o.FD)(q.En,{role:"menu",children:[u.map(e=>(0,o.Y)(H.P,{onClick:c(e),sx:e=>({height:e.sizes.$16,justifyContent:"flex-start",borderRadius:0}),icon:Q.A,children:(0,o.Y)(j.c,{user:e.user,sx:{width:"100%"}})},e.id)),(0,o.Y)(q.rc,{elementDescriptor:O.$z.accountSwitcherActionButton,elementId:O.$z.accountSwitcherActionButton.setId("addAccount"),iconBoxElementDescriptor:O.$z.accountSwitcherActionButtonIconBox,iconBoxElementId:O.$z.accountSwitcherActionButtonIconBox.setId("addAccount"),iconElementDescriptor:O.$z.accountSwitcherActionButtonIcon,iconElementId:O.$z.accountSwitcherActionButtonIcon.setId("addAccount"),icon:ee.A,label:(0,B.G)("signIn.accountSwitcher.action__addAccount"),onClick:h,iconSx:e=>({width:e.sizes.$9,height:e.sizes.$6}),iconBoxSx:e=>({minHeight:e.sizes.$9,minWidth:e.sizes.$6,alignItems:"center"}),spinnerSize:"md"})]})})]}),(0,o.Y)(y.Z.Footer,{sx:e=>({">:first-of-type":{padding:`${e.space.$1}`,width:"100%"}}),children:(0,o.Y)(y.Z.Action,{sx:{width:"100%",">:first-of-type":{width:"100%",borderBottomWidth:0}},children:(0,o.Y)(et.ww,{handleSignOutAllClicked:l,elementDescriptor:O.$z.accountSwitcherActionButton,elementId:O.$z.accountSwitcherActionButton.setId("signOutAll"),iconBoxElementDescriptor:O.$z.accountSwitcherActionButtonIconBox,iconBoxElementId:O.$z.accountSwitcherActionButtonIconBox.setId("signOutAll"),iconElementDescriptor:O.$z.accountSwitcherActionButtonIcon,iconElementId:O.$z.accountSwitcherActionButtonIcon.setId("signOutAll"),label:(0,B.G)("signIn.accountSwitcher.action__signOutAll"),actionSx:e=>({padding:`${e.space.$2} ${e.space.$2}`})})})})]})})}));var ei=r(6980),ea=r(8738),eo=r(8289),es=r(9835),el=r(9090);let ec=e=>{let[t,r]=l.useState(!1),n=l.useCallback(()=>r(e=>!e),[r]);return t?(0,o.Y)(el.n,{onBackLinkClick:n}):(0,o.Y)(ed,{onBackLinkClick:e.onBackLinkClick,onFactorSelected:e.onFactorSelected,onHavingTroubleClick:n})},ed=e=>{let{onHavingTroubleClick:t,onFactorSelected:r,onBackLinkClick:n}=e,i=(0,U.f0)(),{supportedSecondFactors:a}=(0,T.n)();return(0,o.Y)(p.n.Part,{part:"alternativeMethods",children:(0,o.FD)(y.Z.Root,{children:[(0,o.FD)(y.Z.Content,{children:[(0,o.FD)(E.Y.Root,{showLogo:!0,children:[(0,o.Y)(E.Y.Title,{localizationKey:(0,B.G)("signIn.alternativeMethods.title")}),(0,o.Y)(E.Y.Subtitle,{localizationKey:(0,B.G)("signIn.alternativeMethods.subtitle")})]}),(0,o.Y)(y.Z.Alert,{children:i.error}),(0,o.FD)(z.fv,{elementDescriptor:O.$z.main,gap:3,children:[(0,o.Y)(z.fv,{gap:2,children:a&&a.sort(eo.Wy).map((e,t)=>(0,o.Y)(ea.X,{textLocalizationKey:function(e){switch(e.strategy){case"phone_code":return(0,B.G)("signIn.alternativeMethods.blockButton__phoneCode",{identifier:(0,es.u)(e.safeIdentifier)||""});case"totp":return(0,B.G)("signIn.alternativeMethods.blockButton__totp");case"backup_code":return(0,B.G)("signIn.alternativeMethods.blockButton__backupCode");case"email_code":return(0,B.G)("signIn.alternativeMethods.blockButton__emailCode",{identifier:(0,es.u)(e.safeIdentifier)||""});case"email_link":return(0,B.G)("signIn.alternativeMethods.blockButton__emailLink",{identifier:(0,es.u)(e.safeIdentifier)||""});default:throw Error(`Invalid sign in strategy: "${e.strategy}"`)}}(e),elementDescriptor:O.$z.alternativeMethodsBlockButton,textElementDescriptor:O.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:O.$z.alternativeMethodsBlockButtonArrow,isDisabled:i.isLoading,onClick:()=>r(e)},t))}),(0,o.Y)(y.Z.Action,{elementId:"alternativeMethods",children:n&&(0,o.Y)(y.Z.ActionLink,{localizationKey:(0,B.G)("backButton"),onClick:e.onBackLinkClick})})]})]}),(0,o.Y)(y.Z.Footer,{children:(0,o.FD)(y.Z.Action,{elementId:"havingTrouble",children:[(0,o.Y)(y.Z.ActionText,{localizationKey:(0,B.G)("signIn.alternativeMethods.actionText")}),(0,o.Y)(y.Z.ActionLink,{localizationKey:(0,B.G)("signIn.alternativeMethods.actionLink"),onClick:t})]})})]})})};var eu=r(3610),eh=r(7912),ep=r(5763);let ef=e=>(0,ep.Kw)(e.firstFactorVerification?.strategy)&&e.firstFactorVerification?.status==="verified",eg=e=>{let t=(0,G.O)(),r=(0,T.n)(),n=(0,U.f0)(),{afterSignInUrl:i,navigateOnSetActive:a}=(0,d.r)(),{setActive:c}=(0,s.ho)(),{navigate:u}=(0,Z.r)(),h=(0,N.p)(),p=(0,s.ho)(),f=(0,l.useMemo)(()=>{let e=Object.values(t.userSettings.attributes).some(e=>e.used_for_second_factor);return"new"===r.clientTrustState&&!e},[r.clientTrustState,t.userSettings.attributes]);l.useEffect(()=>{e.factorAlreadyPrepared||g?.()},[]);let g=e.prepare?()=>e.prepare?.().then(()=>e.onFactorPrepare()).catch(e=>{if((0,eu._d)(e))return p.__internal_navigateWithError("..",e.errors[0]);(0,M.H4)(e,[],n.setError)}):void 0;return(0,o.Y)(eh.j,{cardTitle:e.cardTitle,cardSubtitle:ef(r)?(0,B.G)("signIn.forgotPassword.subtitle"):e.cardSubtitle,cardNotice:e.showClientTrustNotice||f?(0,B.G)("signIn.newDeviceVerificationNotice"):void 0,resendButton:e.resendButton,inputLabel:e.inputLabel,onCodeEntryFinishedAction:(t,n,o)=>{r.attemptSecondFactor({strategy:e.factor.strategy,code:t}).then(async e=>{if(await n(),"complete"!==e.status)return console.error((0,F.s)(e.status,h));if(ef(e)&&e.createdSessionId){let t=new URLSearchParams;return t.set("createdSessionId",e.createdSessionId),u(`../reset-password-success?${t.toString()}`)}return c({session:e.createdSessionId,navigate:async({session:e})=>{await a({session:e,redirectUrl:i})}})}).catch(e=>(0,eu._d)(e)?p.__internal_navigateWithError("..",e.errors[0]):o(e))},onResendCodeClicked:g,safeIdentifier:"safeIdentifier"in e.factor?e.factor.safeIdentifier:void 0,profileImageUrl:r.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,children:ef(r)&&(0,o.Y)(z.EY,{localizationKey:(0,B.G)("signIn.resetPasswordMfa.detailsLabel"),colorScheme:"secondary"})})},em=e=>{let t=(0,T.n)();return(0,o.Y)(p.n.Part,{part:"emailCode2Fa",children:(0,o.Y)(eg,{...e,cardTitle:(0,B.G)("signIn.emailCodeMfa.title"),cardSubtitle:(0,B.G)("signIn.emailCodeMfa.subtitle"),inputLabel:(0,B.G)("signIn.emailCodeMfa.formTitle"),resendButton:(0,B.G)("signIn.emailCodeMfa.resendButton"),prepare:()=>{let{emailAddressId:r,strategy:n}=e.factor;return t.prepareSecondFactor({emailAddressId:r,strategy:n})}})})};var eI=r(2027),e_=r(4979),ew=r(8051),eS=r(2992);let ev=e=>{let{t}=(0,R._)(),r=(0,U.f0)(),n=(0,T.n)(),i=(0,d.r)(),{signInUrl:a}=i,{afterSignInUrl:c}=(0,d.r)(),{setActive:u}=(0,s.ho)(),{startEmailLinkFlow:h,cancelEmailLinkFlow:f}=(0,eS.u)(n),[g,m]=l.useState(!1),I=(0,s.ho)();l.useEffect(()=>{_()},[]);let _=()=>{h({emailAddressId:e.factor.emailAddressId,redirectUrl:(0,ew.lA)({ctx:i,baseUrl:a,intent:"sign-in"})}).then(e=>w(e)).catch(e=>{if((0,eu._d)(e))return I.__internal_navigateWithError("..",e.errors[0]);(0,M.H4)(e,[],r.setError)})},w=async e=>{let n=e.secondFactorVerification;"expired"===n.status?r.setError(t((0,B.G)("formFieldError__verificationLinkExpired"))):n.verifiedFromTheSameClient()?m(!0):await u({session:e.createdSessionId,redirectUrl:c})};return g?(0,o.Y)(e_.$,{title:(0,B.G)("signIn.emailLink.verifiedSwitchTab.titleNewTab"),subtitle:(0,B.G)("signIn.emailLink.verifiedSwitchTab.subtitleNewTab"),status:"verified_switch_tab"}):(0,o.Y)(p.n.Part,{part:"emailLink",children:(0,o.Y)(eI._,{cardTitle:(0,B.G)("signIn.emailLinkMfa.title"),cardSubtitle:(0,B.G)("signIn.emailLinkMfa.subtitle"),cardNotice:e.showClientTrustNotice||"new"===n.clientTrustState?(0,B.G)("signIn.newDeviceVerificationNotice"):void 0,formSubtitle:(0,B.G)("signIn.emailLinkMfa.formSubtitle"),resendButton:(0,B.G)("signIn.emailLinkMfa.resendButton"),onResendCodeClicked:()=>{f(),_()},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:n.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked})})},eb=e=>{let t=(0,T.n)();return(0,o.Y)(p.n.Part,{part:"phoneCode2Fa",children:(0,o.Y)(eg,{...e,cardTitle:(0,B.G)("signIn.phoneCodeMfa.title"),cardSubtitle:(0,B.G)("signIn.phoneCodeMfa.subtitle"),inputLabel:(0,B.G)("signIn.phoneCodeMfa.formTitle"),resendButton:(0,B.G)("signIn.phoneCodeMfa.resendButton"),prepare:()=>{let{phoneNumberId:r,strategy:n}=e.factor;return t.prepareSecondFactor({phoneNumberId:r,strategy:n})}})})};var eY=r(2690);let ek=(0,J.RL)((0,J.SY)((0,U.dm)(function(){let e=(0,T.n)(),{currentFactor:t,factorAlreadyPrepared:r,handleFactorPrepare:n,selectFactor:i,showAllStrategies:a,toggleAllStrategies:s}=(0,eY.j)(e.supportedSecondFactors);if(!t)return(0,o.Y)(ei.B,{});if(a)return(0,o.Y)(ec,{onBackLinkClick:s,onFactorSelected:i});switch(t?.strategy){case"phone_code":return(0,o.Y)(eb,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"email_code":return(0,o.Y)(em,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"email_link":return(0,o.Y)(ev,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});default:return(0,o.Y)(ei.B,{})}})));var eC=r(5170),eA=r(3474),eF=r(29),ey=r(6505),eU=r(8144),eP=r(4421),eE=r(1051),eM=r(2181),eD=r(743),eL=r(6889),eT=r(2166),eG=r(44),eR=r(9236),eB=r(5715);let ez=l.memo(e=>{let t=(0,s.ho)(),{navigate:r}=(0,Z.r)(),n=(0,U.f0)(),{displayConfig:i}=(0,G.O)(),a=(0,d.r)(),l=(0,T.n)(),c=(0,ew.uP)(a,i.signInUrl),u=a.afterSignInUrl||"/",h="popup"===a.oauthFlow||"auto"===a.oauthFlow&&(0,eG.C)(),{onAlternativePhoneCodeProviderClick:p,...f}=e,g=e=>(0,eu.$R)(e)&&e.errors.find(e=>e.code===eT.c.SESSION_EXISTS)?t.setActive({session:t.client.lastActiveSessionId,navigate:async({session:e})=>{await a.navigateOnSetActive({session:e,redirectUrl:a.afterSignInUrl})}}):(0,M.H4)(e,[],n.setError);return(0,o.Y)(eB.V,{...f,showLastAuthenticationStrategy:!0,idleAfterDelay:!h,oauthCallback:e=>{if(h){let t=window.open("about:blank","","width=600,height=800"),r=setInterval(()=>{(!t||t.closed)&&(clearInterval(r),n.setIdle())},500);return l.authenticateWithPopup({strategy:e,redirectUrl:c,redirectUrlComplete:u,popup:t,oidcPrompt:a.oidcPrompt}).catch(e=>g(e))}return l.authenticateWithRedirect({strategy:e,redirectUrl:c,redirectUrlComplete:u,oidcPrompt:a.oidcPrompt}).catch(e=>g(e))},web3Callback:e=>t.authenticateWithWeb3({customNavigate:r,redirectUrl:u,signUpContinueUrl:a.isCombinedFlow?"create/continue":a.signUpContinueUrl,strategy:e,secondFactorUrl:"factor-two"}).catch(e=>(0,eR.f)(e,n.setError)),alternativePhoneCodeCallback:e=>{p?.(e)}})});function eO(){let e=(0,T.n)();return e.supportedFirstFactors?.find(({strategy:e})=>(0,ep.Kw)(e))}let e$=e=>((e,t)=>{let[r,n]=l.useState(!1),i=l.useCallback(()=>n(e=>!e),[n]);return r?(0,o.Y)(el.n,{onBackLinkClick:i}):(0,o.Y)(e,{...t,onHavingTroubleClick:i})})(eN,{...e}),eN=e=>{let{onBackLinkClick:t,onHavingTroubleClick:r,onFactorSelected:n,mode:i="default"}=e,a=(0,U.f0)(),s=eO(),{supportedFirstFactors:l}=(0,T.n)(),{firstPartyFactors:c,hasAnyStrategy:d}=(0,eA.y)({filterOutFactor:e?.currentFactor,supportedFirstFactors:l}),u=function(e){switch(e){case"forgot":return"forgotPasswordMethods";case"pwned":return"passwordPwnedMethods";case"passwordCompromised":return"passwordCompromisedMethods";default:return"alternativeMethods"}}(i),h=function(e){switch(e){case"forgot":return(0,B.G)("signIn.forgotPasswordAlternativeMethods.title");case"pwned":return(0,B.G)("signIn.passwordPwned.title");case"passwordCompromised":return(0,B.G)("signIn.passwordCompromised.title");default:return(0,B.G)("signIn.alternativeMethods.title")}}(i),f=function(e){switch(e){case"forgot":case"pwned":return!0;default:return!1}}(i);return(0,o.Y)(p.n.Part,{part:u,children:(0,o.FD)(y.Z.Root,{children:[(0,o.FD)(y.Z.Content,{children:[(0,o.FD)(E.Y.Root,{showLogo:!0,children:[(0,o.Y)(E.Y.Title,{localizationKey:h}),!f&&"passwordCompromised"!==i&&(0,o.Y)(E.Y.Subtitle,{localizationKey:(0,B.G)("signIn.alternativeMethods.subtitle")})]}),(0,o.Y)(y.Z.Alert,{children:a.error}),(0,o.FD)(z.so,{direction:"col",elementDescriptor:O.$z.main,gap:6,children:[f&&s&&(0,o.Y)(z.$n,{localizationKey:eZ(s),elementDescriptor:O.$z.alternativeMethodsBlockButton,isDisabled:a.isLoading,onClick:()=>{a.setError(void 0),n(s)}}),f&&d&&(0,o.Y)(ey.c,{dividerText:(0,B.G)("signIn.forgotPasswordAlternativeMethods.label__alternativeMethods")}),(0,o.FD)(z.fv,{gap:4,children:[d&&(0,o.FD)(z.so,{elementDescriptor:O.$z.alternativeMethods,direction:"col",gap:2,children:[(0,o.Y)(ez,{enableWeb3Providers:!0,enableOAuthProviders:!0,enableAlternativePhoneCodeProviders:!1}),c&&c.map((e,t)=>{var r;return(0,o.Y)(ea.X,{leftIcon:(r=e,({email_link:eU.A,email_code:eP.A,phone_code:eE.A,reset_password_email_code:eM.A,reset_password_phone_code:eM.A,password:eD.A,passkey:eL.A})[r.strategy]),textLocalizationKey:eZ(e),elementDescriptor:O.$z.alternativeMethodsBlockButton,textElementDescriptor:O.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:O.$z.alternativeMethodsBlockButtonArrow,textVariant:"buttonLarge",isDisabled:a.isLoading,onClick:()=>{a.setError(void 0),n(e)}},t)})]}),t&&(0,o.Y)(eF.E,{boxElementDescriptor:O.$z.backRow,linkElementDescriptor:O.$z.backLink,onClick:t})]})]})]}),(0,o.Y)(y.Z.Footer,{children:(0,o.FD)(y.Z.Action,{elementId:"havingTrouble",children:[(0,o.Y)(y.Z.ActionText,{localizationKey:(0,B.G)("signIn.alternativeMethods.actionText")}),(0,o.Y)(y.Z.ActionLink,{localizationKey:(0,B.G)("signIn.alternativeMethods.actionLink"),onClick:r})]})})]})})};function eZ(e){switch(e.strategy){case"email_link":return(0,B.G)("signIn.alternativeMethods.blockButton__emailLink",{identifier:(0,es.u)(e.safeIdentifier)||""});case"email_code":return(0,B.G)("signIn.alternativeMethods.blockButton__emailCode",{identifier:(0,es.u)(e.safeIdentifier)||""});case"phone_code":return(0,B.G)("signIn.alternativeMethods.blockButton__phoneCode",{identifier:(0,es.u)(e.safeIdentifier)||""});case"password":return(0,B.G)("signIn.alternativeMethods.blockButton__password");case"passkey":return(0,B.G)("signIn.alternativeMethods.blockButton__passkey");case"reset_password_email_code":case"reset_password_phone_code":return(0,B.G)("signIn.forgotPasswordAlternativeMethods.blockButton__resetPassword");default:throw Error(`Invalid sign in strategy: "${e.strategy}"`)}}var ex=r(5653);function eK(e){let t=(0,U.f0)(),{setActive:r,__internal_navigateWithError:n}=(0,s.ho)(),i=(0,N.p)(),{afterSignInUrl:a,navigateOnSetActive:o}=(0,d.r)(),{authenticateWithPasskey:c}=(0,T.n)();return(0,l.useEffect)(()=>()=>{ex.sv.abort()},[]),(0,l.useCallback)(async(...s)=>{try{let t=await c(...s);switch(t.status){case"complete":return r({session:t.createdSessionId,navigate:async({session:e})=>{await o({session:e,redirectUrl:a})}});case"needs_second_factor":return e();default:return console.error((0,F.s)(t.status,i))}}catch(r){let{flow:e}=s[0]||{};if((0,eu.Cm)(r)&&("passkey_operation_aborted"===r.code||"autofill"===e&&"passkey_retrieval_cancelled"===r.code))return;if((0,eu._d)(r))return n("..",r.errors[0]);(0,M.H4)(r,[],t.setError)}},[])}function eW(e){return!!e?.length&&e.filter(e=>"enterprise_sso"===e.strategy&&"enterpriseConnectionId"in e&&"enterpriseConnectionName"in e).length>1}var eV=r(1652);let eq=e=>{let t=(0,T.n)(),r=(0,U.f0)(),{navigate:n}=(0,Z.r)(),{afterSignInUrl:i,navigateOnSetActive:a}=(0,d.r)(),{setActive:l}=(0,s.ho)(),c=(0,N.p)(),u=(0,s.ho)(),h=e.factor.channel,p="verified"===t.firstFactorVerification.status&&e.factorAlreadyPrepared;return(0,o.Y)(eh.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(r,o,s)=>{t.attemptFirstFactor({strategy:e.factor.strategy,code:r}).then(async e=>{switch(await o(),e.status){case"complete":return l({session:e.createdSessionId,navigate:async({session:e})=>{await a({session:e,redirectUrl:i})}});case"needs_second_factor":return n("../factor-two");case"needs_new_password":return n("../reset-password");default:return console.error((0,F.s)(e.status,c))}}).catch(e=>(0,eu._d)(e)?u.__internal_navigateWithError("..",e.errors[0]):s(e))},onResendCodeClicked:()=>{p||t.prepareFirstFactor({...e.factor,channel:h}).then(()=>e.onFactorPrepare()).catch(e=>(0,M.H4)(e,[],r.setError))},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:t.userData.imageUrl,alternativeMethodsLabel:(0,B.G)("footerActionLink__alternativePhoneCodeProvider"),onShowAlternativeMethodsClicked:()=>{r.setError(void 0),e.onChangePhoneCodeChannel({...e.factor,channel:void 0})},showAlternativeMethods:!0,onIdentityPreviewEditClicked:()=>n("../"),onBackLinkClicked:e.onBackLinkClicked})},eH=e=>(0,o.Y)(p.n.Part,{part:"phoneCode",children:(0,o.Y)(eq,{...e,cardTitle:(0,B.G)("signIn.alternativePhoneCodeProvider.title",{provider:(0,eV.y)(e.factor.channel)?.name||""}),cardSubtitle:(0,B.G)("signIn.alternativePhoneCodeProvider.subtitle"),inputLabel:(0,B.G)("signIn.alternativePhoneCodeProvider.formTitle"),resendButton:(0,B.G)("signIn.alternativePhoneCodeProvider.resendButton")})}),ej=e=>{let t=(0,T.n)(),r=(0,U.f0)(),{navigate:n}=(0,Z.r)(),{afterSignInUrl:i,navigateOnSetActive:a}=(0,d.r)(),{setActive:c}=(0,s.ho)(),u=(0,N.p)(),h=(0,s.ho)(),p="verified"===t.firstFactorVerification.status&&e.factorAlreadyPrepared,g=(0,l.useMemo)(()=>{let t=e.factor,r=t.strategy;return"emailAddressId"in t&&(r+=`_${t.emailAddressId}`),"phoneNumberId"in t&&(r+=`_${t.phoneNumberId}`),"channel"in t&&t.channel&&(r+=`_${t.channel}`),{name:"signIn.prepareFirstFactor",factorKey:r}},[e.factor.strategy,"emailAddressId"in e.factor?e.factor.emailAddressId:void 0,"phoneNumberId"in e.factor?e.factor.phoneNumberId:void 0,"channel"in e.factor?e.factor.channel:void 0]);return(0,f.s)(p?void 0:()=>t?.prepareFirstFactor(e.factor),g,{staleTime:100,onSuccess:()=>e.onFactorPrepare(),onError:e=>(0,M.H4)(e,[],r.setError)}),(0,o.Y)(eh.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(r,o,s)=>{t.attemptFirstFactor({strategy:e.factor.strategy,code:r}).then(async e=>{switch(await o(),e.status){case"complete":return c({session:e.createdSessionId,navigate:async({session:e})=>{await a({session:e,redirectUrl:i})}});case"needs_second_factor":return n("../factor-two");case"needs_new_password":return n("../reset-password");default:return console.error((0,F.s)(e.status,u))}}).catch(e=>(0,eu._d)(e)?h.__internal_navigateWithError("..",e.errors[0]):s(e))},onResendCodeClicked:()=>{p||t.prepareFirstFactor(e.factor).then(()=>e.onFactorPrepare()).catch(e=>(0,M.H4)(e,[],r.setError))},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:t.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,showAlternativeMethods:e.showAlternativeMethods,onIdentityPreviewEditClicked:()=>n("../"),onBackLinkClicked:e.onBackLinkClicked})},eJ=e=>(0,o.Y)(p.n.Part,{part:"emailCode",children:(0,o.Y)(ej,{...e,cardTitle:(0,B.G)("signIn.emailCode.title"),cardSubtitle:(0,B.G)("signIn.emailCode.subtitle"),inputLabel:(0,B.G)("signIn.emailCode.formTitle"),resendButton:(0,B.G)("signIn.emailCode.resendButton")})}),eX=e=>{let{t}=(0,R._)(),r=(0,U.f0)(),n=(0,T.n)(),i=(0,d.r)(),{signInUrl:a}=i,{navigate:c}=(0,Z.r)(),{afterSignInUrl:u}=(0,d.r)(),{setActive:h}=(0,s.ho)(),{startEmailLinkFlow:f,cancelEmailLinkFlow:g}=(0,eS.u)(n),[m,I]=l.useState(!1),_=(0,s.ho)();l.useEffect(()=>{w()},[]);let w=()=>{f({emailAddressId:e.factor.emailAddressId,redirectUrl:(0,ew.lA)({ctx:i,baseUrl:a,intent:"sign-in"})}).then(e=>S(e)).catch(e=>{if((0,eu._d)(e))return _.__internal_navigateWithError("..",e.errors[0]);(0,M.H4)(e,[],r.setError)})},S=async e=>{let n=e.firstFactorVerification;"expired"===n.status?r.setError(t((0,B.G)("formFieldError__verificationLinkExpired"))):n.verifiedFromTheSameClient()?I(!0):await v(e)},v=async e=>"complete"===e.status?h({session:e.createdSessionId,redirectUrl:u}):"needs_second_factor"===e.status?c("../factor-two"):void 0;return m?(0,o.Y)(e_.$,{title:(0,B.G)("signIn.emailLink.verifiedSwitchTab.titleNewTab"),subtitle:(0,B.G)("signIn.emailLink.verifiedSwitchTab.subtitleNewTab"),status:"verified_switch_tab"}):(0,o.Y)(p.n.Part,{part:"emailLink",children:(0,o.Y)(eI._,{cardTitle:(0,B.G)("signIn.emailLink.title"),cardSubtitle:(0,B.G)("signIn.emailLink.subtitle"),formTitle:(0,B.G)("signIn.emailLink.formTitle"),formSubtitle:(0,B.G)("signIn.emailLink.formSubtitle"),resendButton:(0,B.G)("signIn.emailLink.resendButton"),onResendCodeClicked:()=>{g(),w()},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:n.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked})})};var eQ=r(7420);let e0=(0,U.dm)((n=(a=()=>{let e=(0,d.r)(),{displayConfig:t}=(0,G.O)(),r=(0,s.ho)().client.signIn;if(!eW(r.supportedFirstFactors))return null;let n=r.supportedFirstFactors.map(e=>({id:e.enterpriseConnectionId,name:e.enterpriseConnectionName}));return(0,o.Y)(p.n.Part,{part:"enterpriseConnections",children:(0,o.Y)(eQ.l,{title:(0,B.G)("signIn.enterpriseConnections.title"),subtitle:(0,B.G)("signIn.enterpriseConnections.subtitle"),onClick:n=>{let i=(0,ew.uP)(e,t.signInUrl),a=e.afterSignInUrl||"/";return r.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:i,redirectUrlComplete:a,oidcPrompt:e.oidcPrompt,continueSignIn:!0,enterpriseConnectionId:n})},enterpriseConnections:n})})}).displayName||a.name||"Component",a.displayName=n,(i=e=>{let t=(0,T.n)(),r=(0,d.r)();return(0,J.RE)(a,()=>!eW(t.supportedFirstFactors),({clerk:e})=>r.signInUrl||e.buildSignInUrl(),"There are no enterprise connections available to sign-in. Clerk is redirecting to the `signInUrl` instead.")(e)}).displayName=`withEnterpriseConnectionsGuard(${n})`,i)),e1=e=>(0,o.Y)(p.n.Part,{part:"resetPassword",children:(0,o.Y)(ej,{...e,showAlternativeMethods:!1,cardTitle:(0,B.G)("signIn.forgotPassword.title"),inputLabel:(0,B.G)("signIn.forgotPassword.formTitle"),resendButton:(0,B.G)("signIn.forgotPassword.resendButton")})});var e6=r(196);let e4=e=>{let{onShowAlternativeMethodsClick:t}=e,r=(0,U.f0)(),n=(0,T.n)(),{navigate:i}=(0,Z.r)(),[a,s]=l.useState(!1),c=l.useCallback(()=>s(e=>!e),[s]),d=eK(()=>i("../factor-two"));return a?(0,o.Y)(el.n,{onBackLinkClick:c}):(0,o.Y)(p.n.Part,{part:"password",children:(0,o.FD)(y.Z.Root,{children:[(0,o.FD)(y.Z.Content,{children:[(0,o.FD)(E.Y.Root,{showLogo:!0,children:[(0,o.Y)(z.In,{elementDescriptor:O.$z.passkeyIcon,icon:eL.A,sx:e=>({color:e.colors.$neutralAlpha500,marginInline:"auto",paddingBottom:e.sizes.$1,width:e.sizes.$12,height:e.sizes.$12})}),(0,o.Y)(E.Y.Title,{localizationKey:(0,B.G)("signIn.passkey.title")}),(0,o.Y)(E.Y.Subtitle,{localizationKey:(0,B.G)("signIn.passkey.subtitle")}),(0,o.Y)(e6.$,{identifier:n.identifier,avatarUrl:n.userData.imageUrl,onClick:()=>i("../")})]}),(0,o.Y)(y.Z.Alert,{children:r.error}),(0,o.FD)(z.so,{direction:"col",elementDescriptor:O.$z.main,gap:4,children:[(0,o.Y)(P.l.Root,{onSubmit:e=>(e.preventDefault(),d()),gap:8,children:(0,o.Y)(P.l.SubmitButton,{hasArrow:!0})}),(0,o.Y)(y.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,o.Y)(y.Z.ActionLink,{localizationKey:(0,B.G)(t?"footerActionLink__useAnotherMethod":"signIn.alternativeMethods.actionLink"),onClick:t||c})})]})]}),(0,o.Y)(y.Z.Footer,{})]})})},e2=e=>{let{onShowAlternativeMethodsClick:t,onPasswordError:r}=e,n=l.useRef(null),i=(0,U.f0)(),{setActive:a}=(0,s.ho)(),c=(0,T.n)(),{afterSignInUrl:u,navigateOnSetActive:h}=(0,d.r)(),f=(0,N.p)(),g=(e=>{let{onForgotPasswordMethodClick:t,onShowAlternativeMethodsClick:r}=e,n=eO(),i=(0,L.tJ)("password","",{type:"password",label:(0,B.G)("formFieldLabel__password"),placeholder:(0,B.G)("formFieldInputPlaceholder__password")});return{...i,props:{...i.props,actionLabel:n||r?(0,B.G)("formFieldAction__forgotPassword"):"",onActionClicked:t||r||(()=>null)}}})(e),{navigate:m}=(0,Z.r)(),[I,_]=l.useState(!1),w=l.useCallback(()=>_(e=>!e),[_]),S=(0,s.ho)();return I?(0,o.Y)(el.n,{onBackLinkClick:w}):(0,o.Y)(p.n.Part,{part:"password",children:(0,o.FD)(y.Z.Root,{children:[(0,o.FD)(y.Z.Content,{children:[(0,o.FD)(E.Y.Root,{showLogo:!0,children:[(0,o.Y)(E.Y.Title,{localizationKey:(0,B.G)("signIn.password.title")}),(0,o.Y)(E.Y.Subtitle,{localizationKey:(0,B.G)("signIn.password.subtitle")}),(0,o.Y)(e6.$,{identifier:c.identifier,avatarUrl:c.userData.imageUrl,onClick:()=>{m("../")}})]}),(0,o.Y)(y.Z.Alert,{children:i.error}),(0,o.FD)(z.so,{direction:"col",elementDescriptor:O.$z.main,gap:4,children:[(0,o.FD)(P.l.Root,{onSubmit:e=>{e.preventDefault(),c.attemptFirstFactor({strategy:"password",password:g.value}).then(e=>{switch(e.status){case"complete":return a({session:e.createdSessionId,navigate:({session:e})=>h({session:e,redirectUrl:u})});case"needs_second_factor":return m("../factor-two");case"needs_client_trust":return m("../client-trust");default:return console.error((0,F.s)(e.status,f))}}).catch(e=>{if((0,eu._d)(e))return S.__internal_navigateWithError("..",e.errors[0]);if(r){if((0,eu.Au)(e)){i.setError({...e.errors[0],code:"form_password_pwned__sign_in"}),r("pwned");return}if((0,eu.qY)(e)){i.setError({...e.errors[0],code:"form_password_compromised__sign_in"}),r("compromised");return}}(0,M.H4)(e,[g],i.setError),setTimeout(()=>n.current?.focus(),0)})},gap:8,children:[(0,o.Y)("input",{readOnly:!0,id:"identifier-field",name:"identifier",value:c.identifier||"",style:{display:"none"}}),(0,o.Y)(P.l.ControlRow,{elementId:g.id,children:(0,o.Y)(P.l.PasswordInput,{...g.props,ref:n,autoFocus:!0})}),(0,o.Y)(P.l.SubmitButton,{hasArrow:!0})]}),(0,o.Y)(y.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,o.Y)(y.Z.ActionLink,{localizationKey:(0,B.G)(t?"signIn.password.actionLink":"signIn.alternativeMethods.actionLink"),onClick:t||w})})]})]}),(0,o.Y)(y.Z.Footer,{})]})})},e5=e=>(0,o.Y)(p.n.Part,{part:"phoneCode",children:(0,o.Y)(ej,{...e,cardTitle:(0,B.G)("signIn.phoneCode.title"),cardSubtitle:(0,B.G)("signIn.phoneCode.subtitle"),inputLabel:(0,B.G)("signIn.phoneCode.formTitle"),resendButton:(0,B.G)("signIn.phoneCode.resendButton")})}),e9=e=>{if(!e)return"";let t=e.strategy;return"emailAddressId"in e&&(t+=e.emailAddressId),"phoneNumberId"in e&&(t+=e.phoneNumberId),"channel"in e&&(t+=e.channel),t},e8=(0,J.RL)((0,J.SY)((0,U.dm)(function(){let{__internal_setActiveInProgress:e}=(0,s.ho)(),t=(0,T.n)(),{preferredSignInStrategy:r}=(0,G.O)().displayConfig,n=t.supportedFirstFactors,i=(0,Z.r)(),a=(0,U.f0)(),{supportedFirstFactors:c,firstFactorVerification:d}=(0,T.n)(),u=l.useRef(""),[{currentFactor:h},p]=l.useState(()=>{let e=(0,ep.xf)(n,t.identifier,r);return e?.strategy==="phone_code"&&d.channel&&"sms"!==d.channel&&(e.channel=d.channel),{currentFactor:e,prevCurrentFactor:void 0}}),{hasAnyStrategy:f}=(0,eA.y)({filterOutFactor:h,supportedFirstFactors:c}),[g,m]=l.useState(()=>!h||!(0,ep.Cm)(h)),I=eO(),[_,w]=l.useState(!1),[S,v]=l.useState(null);if(l.useEffect(()=>{e||("needs_identifier"===t.status||null===t.status)&&i.navigate("../")},[e]),!h)return t.status?(0,o.Y)(eC.J,{cardTitle:(0,B.G)("signIn.noAvailableMethods.title"),cardSubtitle:(0,B.G)("signIn.noAvailableMethods.subtitle"),message:(0,B.G)("signIn.noAvailableMethods.message")}):(0,o.Y)(ei.B,{});let b=f?()=>m(e=>!e):void 0,Y=()=>w(e=>!e),k=()=>{u.current=e9(h)},C=e=>{p(t=>({currentFactor:e,prevCurrentFactor:t.currentFactor}))};if(eW(t.supportedFirstFactors))return(0,o.Y)(e0,{});if(g||_){let e=(0,ep.Cm)(h),t=g?b:Y;return(0,o.Y)(e$,{mode:_?"pwned"===S?"pwned":"compromised"===S?"passwordCompromised":"forgot":"default",onBackLinkClick:e?()=>{a.setError(void 0),v(null),t?.()}:void 0,onFactorSelected:e=>{C(e),t?.()},currentFactor:h})}if(!h)return(0,o.Y)(ei.B,{});switch(h?.strategy){case"passkey":return(0,o.Y)(e4,{onFactorPrepare:k,onShowAlternativeMethodsClick:b});case"password":return(0,o.Y)(e2,{onForgotPasswordMethodClick:I?Y:b,onShowAlternativeMethodsClick:b,onPasswordError:e=>{v(e),Y()}});case"email_code":return(0,o.Y)(eJ,{factorAlreadyPrepared:u.current===e9(h),onFactorPrepare:k,factor:h,onShowAlternativeMethodsClicked:b});case"phone_code":if(h.channel&&"sms"!==h.channel)return(0,o.Y)(eH,{factorAlreadyPrepared:u.current===e9(h),onFactorPrepare:k,factor:h,onChangePhoneCodeChannel:C});return(0,o.Y)(e5,{factorAlreadyPrepared:u.current===e9(h),onFactorPrepare:k,factor:h,onShowAlternativeMethodsClicked:b});case"email_link":return(0,o.Y)(eX,{factorAlreadyPrepared:u.current===e9(h),onFactorPrepare:k,factor:h,onShowAlternativeMethodsClicked:b});case"reset_password_phone_code":return(0,o.Y)(e1,{factorAlreadyPrepared:u.current===e9(h),onFactorPrepare:k,factor:h,onShowAlternativeMethodsClicked:b,onBackLinkClicked:()=>{p(e=>({currentFactor:e.prevCurrentFactor,prevCurrentFactor:e.currentFactor})),Y()},cardSubtitle:(0,B.G)("signIn.forgotPassword.subtitle_phone")});case"reset_password_email_code":return(0,o.Y)(e1,{factorAlreadyPrepared:u.current===e9(h),onFactorPrepare:k,factor:h,onShowAlternativeMethodsClicked:b,onBackLinkClicked:()=>{p(e=>({currentFactor:e.prevCurrentFactor,prevCurrentFactor:e.currentFactor})),Y()},cardSubtitle:(0,B.G)("signIn.forgotPassword.subtitle_email")});default:return(0,o.Y)(ei.B,{})}}))),e7=e=>{let{onShowAlternativeMethodsClicked:t}=e,r=(0,T.n)(),{afterSignInUrl:n,navigateOnSetActive:i}=(0,d.r)(),{setActive:a}=(0,s.ho)(),{navigate:l}=(0,Z.r)(),c=(0,N.p)(),u=(0,U.f0)(),h=(0,L.tJ)("code","",{type:"text",label:(0,B.G)("formFieldLabel__backupCode"),isRequired:!0}),p=(0,s.ho)(),f=e=>(0,ep.Kw)(e.firstFactorVerification?.strategy)&&e.firstFactorVerification?.status==="verified";return(0,o.FD)(y.Z.Root,{children:[(0,o.FD)(y.Z.Content,{children:[(0,o.FD)(E.Y.Root,{showLogo:!0,children:[(0,o.Y)(E.Y.Title,{localizationKey:(0,B.G)("signIn.backupCodeMfa.title")}),(0,o.Y)(E.Y.Subtitle,{localizationKey:f(r)?(0,B.G)("signIn.forgotPassword.subtitle"):(0,B.G)("signIn.backupCodeMfa.subtitle")})]}),(0,o.Y)(y.Z.Alert,{children:u.error}),(0,o.Y)(z.fv,{elementDescriptor:O.$z.main,gap:8,children:(0,o.FD)(P.l.Root,{onSubmit:e=>(e.preventDefault(),r.attemptSecondFactor({strategy:"backup_code",code:h.value}).then(e=>{if("complete"!==e.status)return console.error((0,F.s)(e.status,c));if(f(e)&&e.createdSessionId){let t=new URLSearchParams;return t.set("createdSessionId",e.createdSessionId),l(`../reset-password-success?${t.toString()}`)}return a({session:e.createdSessionId,navigate:async({session:e})=>{await i({session:e,redirectUrl:n})}})}).catch(e=>{if((0,eu._d)(e))return p.__internal_navigateWithError("..",e.errors[0]);(0,M.H4)(e,[h],u.setError)})),children:[(0,o.Y)(P.l.ControlRow,{elementId:h.id,children:(0,o.Y)(P.l.PlainInput,{...h.props,autoFocus:!0,onActionClicked:t})}),(0,o.FD)(z.fv,{gap:3,children:[(0,o.Y)(P.l.SubmitButton,{hasArrow:!0}),(0,o.Y)(y.Z.Action,{elementId:"alternativeMethods",children:t&&(0,o.Y)(y.Z.ActionLink,{localizationKey:(0,B.G)("footerActionLink__useAnotherMethod"),onClick:t})})]})]})})]}),(0,o.Y)(y.Z.Footer,{})]})},e3=e=>(0,o.Y)(p.n.Part,{part:"totp2Fa",children:(0,o.Y)(eg,{...e,cardTitle:(0,B.G)("signIn.totpMfa.title"),cardSubtitle:(0,B.G)("signIn.totpMfa.subtitle"),inputLabel:(0,B.G)("signIn.totpMfa.formTitle")})}),te=(0,J.RL)((0,J.SY)((0,U.dm)(function(){let e=(0,T.n)(),{currentFactor:t,factorAlreadyPrepared:r,handleFactorPrepare:n,selectFactor:i,showAllStrategies:a,toggleAllStrategies:s}=(0,eY.j)(e.supportedSecondFactors);if(!t)return(0,o.Y)(ei.B,{});if(a)return(0,o.Y)(ec,{onBackLinkClick:s,onFactorSelected:i});switch(t?.strategy){case"phone_code":return(0,o.Y)(eb,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"totp":return(0,o.Y)(e3,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"backup_code":return(0,o.Y)(e7,{onShowAlternativeMethodsClicked:s});case"email_code":return(0,o.Y)(em,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"email_link":return(0,o.Y)(ev,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});default:return(0,o.Y)(ei.B,{})}})));var tt=r(6126);let tr=(0,J.RL)((0,J.SY)(tt.F));var tn=r(4670),ti=r(2620),ta=r(6760),to=r(958),ts=r(1959),tl=r(6142),tc=r(4901),td=r(2229),tu=r(2216);let th=e=>{let{handleSubmit:t,phoneNumberFormState:r,onUseAnotherMethod:n,phoneCodeProvider:i}=e,{providerToDisplayData:a,strategyToDisplayData:s}=(0,tu.k)(),l=i.name,c=i.channel,d=(0,U.f0)();return(0,o.Y)(y.Z.Root,{children:(0,o.FD)(y.Z.Content,{children:[(0,o.FD)(E.Y.Root,{showLogo:!0,showDivider:!0,children:[(0,o.Y)(z.fv,{center:!0,children:(0,o.Y)(z._V,{src:a[c]?.iconUrl,alt:`${s[c].name} logo`,sx:e=>({width:e.sizes.$7,height:e.sizes.$7,maxWidth:"100%",marginBottom:e.sizes.$6})})}),(0,o.Y)(E.Y.Title,{localizationKey:(0,B.G)("signIn.start.alternativePhoneCodeProvider.title",{provider:l})}),(0,o.Y)(E.Y.Subtitle,{localizationKey:(0,B.G)("signIn.start.alternativePhoneCodeProvider.subtitle",{provider:l})})]}),(0,o.Y)(y.Z.Alert,{children:d.error}),(0,o.Y)(z.so,{direction:"col",elementDescriptor:O.$z.main,gap:6,children:(0,o.FD)(P.l.Root,{onSubmit:t,gap:8,children:[(0,o.Y)(z.fv,{gap:6,children:(0,o.Y)(P.l.ControlRow,{elementId:"phoneNumber",children:(0,o.Y)(P.l.PhoneInput,{...r.props,label:(0,B.G)("signIn.start.alternativePhoneCodeProvider.label",{provider:l}),isRequired:!0,isOptional:!1,actionLabel:void 0,onActionClicked:void 0})})}),(0,o.FD)(z.fv,{center:!0,children:[(0,o.Y)(tl.j,{}),(0,o.Y)(z.fv,{gap:6,sx:{width:"100%"},children:(0,o.Y)(P.l.SubmitButton,{hasArrow:!0,localizationKey:(0,B.G)("formButtonPrimary")})})]}),(0,o.Y)(z.fv,{center:!0,children:(0,o.Y)(z.$n,{variant:"link",colorScheme:"neutral",onClick:n,localizationKey:(0,B.G)("signIn.start.alternativePhoneCodeProvider.actionLink")})})]})})]})})},tp=e=>!!e.supportedFirstFactors?.length&&e.supportedFirstFactors.every(e=>"enterprise_sso"===e.strategy),tf=({field:e})=>{let[t,r]=(0,l.useState)(!1),n=(0,l.useRef)(null),i=!!(t||e?.value);return((0,l.useLayoutEffect)(()=>{let e=setInterval(()=>{if(n?.current){let t="onAutoFillStart"===window.getComputedStyle(n.current,":autofill").animationName||!!n.current?.matches("*:-webkit-autofill");t&&(r(t),clearInterval(e))}},500);return()=>{clearInterval(e)}},[]),(0,l.useEffect)(()=>{e?.value&&""!==e.value&&r(!1)},[e?.value]),e)?(0,o.Y)(P.l.ControlRow,{elementId:e.id,sx:i?void 0:{position:"absolute",opacity:0,height:0,pointerEvents:"none",marginTop:"-1rem"},children:(0,o.Y)(P.l.PasswordInput,{...e.props,ref:n,tabIndex:i?void 0:-1})}):null},tg=(0,J.RL)((0,J.SY)((0,U.dm)(function(){let e=(0,U.f0)(),t=(0,s.ho)(),n=(0,tc.m)(),{displayConfig:i,userSettings:a,authConfig:c}=(0,G.O)(),u=(0,T.n)(),{navigate:h}=(0,Z.r)(),f=(0,d.r)(),{afterSignInUrl:g,signUpUrl:m,waitlistUrl:I,isCombinedFlow:_,navigateOnSetActive:w}=f,S=(0,N.p)(),v=(0,td.F)(),b=(0,l.useMemo)(()=>(0,ts.E9)(a.enabledFirstFactorIdentifiers),[a.enabledFirstFactorIdentifiers]),Y=a.alternativePhoneCodeChannels,{isWebAuthnAutofillSupported:k}=(()=>{let[e,t]=(0,l.useState)(!1),{navigate:r}=(0,Z.r)(),n=eK(()=>r("factor-two")),{userSettings:i}=(0,G.O)(),{passkeySettings:a,attributes:o}=i;return(0,l.useEffect)(()=>{async function e(){let e=await (0,ti.nn)();t(e),e&&await n({flow:"autofill"})}a.allow_autofill&&o.passkey?.enabled&&e()},[]),{isWebAuthnAutofillSupported:e}})(),C=eK(()=>h("factor-two")),A=(0,ti.Bz)(),D=!!f.initialValues?.phoneNumber&&!(f.initialValues.emailAddress||f.initialValues.username)&&b.includes("phone_number"),[R,$]=(0,l.useState)(D?"phone_number":b[0]||""),[x,K]=(0,l.useState)(!1),W=(0,tn.n)("__clerk_ticket")||"",V=(0,tn.n)("__clerk_status")||"",q=a.enabledFirstFactorIdentifiers,H=a.web3FirstFactors,j=a.authenticatableSocialStrategies,J=a.instanceIsPasswordBased,{currentIdentifier:X,nextIdentifier:Q}=(0,ts.ZN)(b,R),ee=(0,L.tJ)("password","",{type:"password",label:(0,B.G)("formFieldLabel__password"),placeholder:(0,B.G)("formFieldInputPlaceholder__password")}),[et,er]=(0,l.useState)(null),en=a.alternativePhoneCodeChannels.length>0,ea=f.initialValues||{},eo=(0,l.useMemo)(()=>({email_address:ea.emailAddress,email_address_username:ea.emailAddress||ea.username,username:ea.username,phone_number:ea.phoneNumber}),[f.initialValues]),es=!!j.length||!!H.length||!!Y.length,[el,ec]=(0,l.useState)(!(0,to.X)()&&!es),ed=(0,L.tJ)("identifier",eo[R]||"",{...X,isRequired:!0,transformer:e=>e.trim()}),eu=(0,L.tJ)("identifier",eo.phone_number||"",{...X,isRequired:!0}),eh="phone_number"===R?eu:ed;(0,l.useLayoutEffect)(()=>{if(eh.value.startsWith("+")&&b.includes("phone_number")&&"phone_number"!==R&&!x){var e;e=eh.value,ed.setValue(eo[R]||""),eu.setValue(e),$("phone_number"),ec(!0),K(!0)}},[eh.value,b]),(0,l.useEffect)(()=>{if(W){if("sign_up"===V){let e=new URLSearchParams;W&&e.set("__clerk_ticket",W),h(_?"create":m,{searchParams:e});return}n.setLoading(),e.setLoading(),u.create({strategy:"ticket",ticket:W}).then(e=>{switch(e.status){case"needs_first_factor":if(!tp(e)||eW(e.supportedFirstFactors))return h("factor-one");return eg();case"needs_second_factor":return h("factor-two");case"needs_client_trust":return h("client-trust");case"complete":return(0,tn.r)("__clerk_ticket"),t.setActive({session:e.createdSessionId,navigate:async({session:e})=>{await w({session:e,redirectUrl:g})}});default:return void console.error((0,F.s)(e.status,S))}}).catch(e=>em(e)).finally(()=>{tp(u)||(n.setIdle(),e.setIdle())})}},[]),(0,l.useEffect)(()=>{!async function(){let t=u?.firstFactorVerification?.error;if(t){switch(t.code){case eT.c.NOT_ALLOWED_TO_SIGN_UP:case eT.c.OAUTH_ACCESS_DENIED:case eT.c.NOT_ALLOWED_ACCESS:case eT.c.SAML_USER_ATTRIBUTE_MISSING:case eT.c.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:case eT.c.USER_LOCKED:case eT.c.EXTERNAL_ACCOUNT_NOT_FOUND:case eT.c.SIGN_UP_MODE_RESTRICTED:case eT.c.SIGN_UP_MODE_RESTRICTED_WAITLIST:case eT.c.ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:case eT.c.ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:case eT.c.ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:case eT.c.SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:case eT.c.ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:case eT.c.CAPTCHA_INVALID:case eT.c.FRAUD_DEVICE_BLOCKED:case eT.c.FRAUD_ACTION_BLOCKED:case eT.c.SIGNUP_RATE_LIMIT_EXCEEDED:case eT.c.USER_BANNED:e.setError(t);break;default:e.setError("Unable to complete action at this time. If the problem persists please contact support.")}await u.create({})}}()},[]);let ef=async(...e)=>{let r=et?.channel||(0,ep.oj)(e,c.preferredChannels,"identifier");if(r){let t=()=>{};e.push({id:"strategy",value:"phone_code",clearFeedback:t,setValue:t,onChange:t,setError:t}),e.push({id:"channel",value:r,clearFeedback:t,setValue:t,onChange:t,setError:t})}try{var n;let r,i,o=await (i=u.create(((!(r=(n=e).some(e=>"password"===e.name&&!!e.value))||a.enterpriseSSO.enabled)&&(n=n.filter(e=>"password"!==e.name)),{...(0,L.mK)(n),...r&&!a.enterpriseSSO.enabled&&{strategy:"password"}})),i.then(t=>{if(!a.enterpriseSSO.enabled)return t;let r=e.find(e=>"password"===e.name)?.value;return!r||t.supportedFirstFactors?.some(e=>"enterprise_sso"===e.strategy)?t:t.attemptFirstFactor({strategy:"password",password:r})}));switch(o.status){case"needs_identifier":o.supportedFirstFactors?.some(e=>"enterprise_sso"===e.strategy)&&await eg();break;case"needs_first_factor":if(!tp(o)||eW(o.supportedFirstFactors))return h("factor-one");return eg();case"needs_second_factor":return h("factor-two");case"needs_client_trust":return h("client-trust");case"complete":return t.setActive({session:o.createdSessionId,navigate:async({session:e})=>{await w({session:e,redirectUrl:g})}});default:return void console.error((0,F.s)(o.status,S))}}catch(e){return em(e)}},eg=async()=>{let e=(0,ew.uP)(f,i.signInUrl),t=f.afterSignInUrl||"/";return u.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:e,redirectUrlComplete:t,oidcPrompt:f.oidcPrompt,continueSignIn:!0})},em=async n=>{if(!n.errors)return;let o=n.errors.find(e=>e.code===eT.c.INVALID_STRATEGY_FOR_USER||e.code===eT.c.FORM_PASSWORD_INCORRECT||e.code===eT.c.FORM_PASSWORD_PWNED),s=n.errors.find(e=>e.code===eT.c.SESSION_EXISTS),l=n.errors.find(e=>"identifier_already_signed_in"===e.code),d=n.errors.find(e=>e.code===eT.c.INVITATION_ACCOUNT_NOT_EXISTS||e.code===eT.c.FORM_IDENTIFIER_NOT_FOUND);if(o)await ef(eh);else if(s)await t.setActive({session:t.client.lastActiveSessionId,navigate:async({session:e})=>{await w({session:e,redirectUrl:g})}});else if(l){let e=l.meta.sessionId;await t.setActive({session:e,navigate:async({session:e})=>{await w({session:e,redirectUrl:g})}})}else if(_&&d){let n=(0,ep.UY)(eh);if(a.signUp.mode===eT.f.WAITLIST)return h(t.buildWaitlistUrl("emailAddress"===n?{initialValues:{[n]:eh.value}}:{}));t.client.signUp[n]=eh.value;let o=(0,ew.uP)(f,i.signUpUrl),s=f.afterSignUpUrl||"/";return function({identifierAttribute:e,identifierValue:t,signUpMode:n,navigate:i,organizationTicket:a,afterSignUpUrl:o,clerk:s,handleError:l,redirectUrl:c,redirectUrlComplete:d,passwordEnabled:u,navigateOnSetActive:h,alternativePhoneCodeChannel:p}){var f,g;if(n===eT.f.WAITLIST)return i(s.buildWaitlistUrl("emailAddress"===e?{initialValues:{[e]:t}}:{}));s.client.signUp[e]=t;let m=new URLSearchParams;return(a&&m.set("__clerk_ticket",a),u||(f=s.client.signUp,g=e,f.optionalFields.filter(e=>!(e.startsWith("oauth_")||e.startsWith("web3_"))&&"enterprise_sso"!==e&&"password"!==e&&("phoneNumber"!==g||"phone_number"!==e)).length>0)||"emailAddress"!==e&&"phoneNumber"!==e)?i("create",{searchParams:m}):s.client.signUp.create({[e]:t,...p?{strategy:"phone_code",channel:p}:{}}).then(async e=>(await Promise.all([r.e("545"),r.e("666"),r.e("472")]).then(r.bind(r,8722)).then(e=>e.completeSignUpFlow))({signUp:e,verifyEmailPath:"create/verify-email-address",verifyPhonePath:"create/verify-phone-number",handleComplete:()=>s.setActive({session:e.createdSessionId,navigate:async({session:e})=>{await h({session:e,redirectUrl:o})}}),navigate:i,redirectUrl:c,redirectUrlComplete:d})).catch(e=>l(e))}({afterSignUpUrl:f.afterSignUpUrl||"/",clerk:t,handleError:t=>(0,M.H4)(t,[eh,ee],e.setError),identifierAttribute:n,identifierValue:eh.value,navigate:h,organizationTicket:W,signUpMode:a.signUp.mode,redirectUrl:o,redirectUrlComplete:s,navigateOnSetActive:w,passwordEnabled:a.attributes.password?.required??!1,alternativePhoneCodeChannel:et?.channel||(0,ep.iy)(c.preferredChannels,n,eh.value)})}else(0,M.H4)(n,[eh,ee],e.setError)},eI=async e=>(e.preventDefault(),ef(eh,ee)),e_=(0,l.useMemo)(()=>({tel:P.l.PhoneInput,password:P.l.PasswordInput,text:P.l.PlainInput,email:P.l.PlainInput})[eh.type],[eh.type]);if(n.isLoading||"sign_up"===V)return(0,o.Y)(ei.B,{});let{action:eS,validLastAuthenticationStrategies:ev,...eb}=eh.props,eY=t.client?.lastAuthenticationStrategy,ek=!!eY&&v>1&&ev?.has(eY);return(0,o.Y)(p.n.Part,{part:"start",children:et?(0,o.Y)(th,{handleSubmit:eI,phoneNumberFormState:eu,onUseAnotherMethod:()=>{er(null)},phoneCodeProvider:et}):(0,o.FD)(y.Z.Root,{children:[(0,o.FD)(y.Z.Content,{children:[(0,o.FD)(E.Y.Root,{showLogo:!0,children:[(0,o.Y)(E.Y.Title,{localizationKey:_?(0,B.G)("signIn.start.titleCombined"):(0,B.G)("signIn.start.title")}),(0,o.Y)(E.Y.Subtitle,{localizationKey:_?(0,B.G)("signIn.start.subtitleCombined"):(0,B.G)("signIn.start.subtitle"),sx:{"&:empty":{display:"none"}}})]}),(0,o.Y)(y.Z.Alert,{children:e.error}),(0,o.FD)(z.fv,{elementDescriptor:O.$z.main,gap:6,children:[(0,o.FD)(ta.U,{children:[es&&(0,o.Y)(ez,{enableWeb3Providers:!0,enableOAuthProviders:!0,enableAlternativePhoneCodeProviders:en,onAlternativePhoneCodeProviderClick:e=>{er((0,eV.y)(e)||null)}}),q.length?(0,o.FD)(P.l.Root,{onSubmit:eI,gap:8,children:[(0,o.FD)(z.fv,{gap:6,children:[(0,o.Y)(P.l.ControlRow,{elementId:eh.id,children:(0,o.Y)(e_,{actionLabel:Q?.action,onActionClicked:()=>{$(e=>b[(b.indexOf(e)+1)%b.length]),ec(!0),K(!1)},...eb,autoFocus:el,autoComplete:k?"webauthn":void 0,isLastAuthenticationStrategy:ek})}),(0,o.Y)(tf,{field:J?ee:void 0})]}),(0,o.FD)(z.fv,{center:!0,children:[(0,o.Y)(tl.j,{}),(0,o.Y)(P.l.SubmitButton,{hasArrow:!0})]})]}):null]}),!q.length&&(0,o.Y)(tl.j,{}),a.attributes.passkey?.enabled&&a.passkeySettings.show_sign_in_button&&A&&(0,o.Y)(y.Z.Action,{elementId:"usePasskey",children:(0,o.Y)(y.Z.ActionLink,{localizationKey:(0,B.G)("signIn.start.actionLink__use_passkey"),onClick:()=>C({flow:"discoverable"})})})]})]}),(0,o.FD)(y.Z.Footer,{children:[a.signUp.mode===eT.f.PUBLIC&&!_&&(0,o.FD)(y.Z.Action,{elementId:"signIn",children:[(0,o.Y)(y.Z.ActionText,{localizationKey:(0,B.G)("signIn.start.actionText")}),(0,o.Y)(y.Z.ActionLink,{localizationKey:(0,B.G)("signIn.start.actionLink"),to:t.buildUrlWithAuth(m)})]}),a.signUp.mode===eT.f.WAITLIST&&(0,o.FD)(y.Z.Action,{elementId:"signIn",children:[(0,o.Y)(y.Z.ActionText,{localizationKey:(0,B.G)("signIn.start.actionText__join_waitlist")}),(0,o.Y)(y.Z.ActionLink,{localizationKey:(0,B.G)("signIn.start.actionLink__join_waitlist"),to:t.buildUrlWithAuth(I)})]})]})]})})})));function tm(){let e=(0,s.ho)();return l.useEffect(()=>{e.redirectToSignIn()},[]),null}function tI(){let e=(0,d.r)(),t=(0,u.X)();return(0,o.Y)(p.n.Root,{flow:"signIn",children:(0,o.FD)(I.d,{children:[(0,o.Y)(_.q,{path:"factor-one",children:(0,o.Y)(e8,{})}),(0,o.Y)(_.q,{path:"factor-two",children:(0,o.Y)(te,{})}),(0,o.Y)(_.q,{path:"client-trust",children:(0,o.Y)(ek,{})}),(0,o.Y)(_.q,{path:"reset-password",children:(0,o.Y)(x,{})}),(0,o.Y)(_.q,{path:"reset-password-success",children:(0,o.Y)(V,{})}),(0,o.Y)(_.q,{path:"sso-callback",children:(0,o.Y)(tr,{signUpUrl:e.signUpUrl,signInUrl:e.signInUrl,signInForceRedirectUrl:e.afterSignInUrl,signUpForceRedirectUrl:e.afterSignUpUrl,continueSignUpUrl:e.signUpContinueUrl,transferable:e.transferable,firstFactorUrl:"../factor-one",secondFactorUrl:"../factor-two",resetPasswordUrl:"../reset-password"})}),(0,o.Y)(_.q,{path:"choose",children:(0,o.Y)(en,{})}),(0,o.Y)(_.q,{path:"verify",children:(0,o.Y)(c.Y,{redirectUrlComplete:e.afterSignInUrl,redirectUrl:"../factor-two"})}),e.isCombinedFlow&&(0,o.FD)(_.q,{path:"create",children:[(0,o.Y)(_.q,{path:"verify-email-address",canActivate:e=>!!e.client.signUp.emailAddress,children:(0,o.Y)(Y,{})}),(0,o.Y)(_.q,{path:"verify-phone-number",canActivate:e=>!!e.client.signUp.phoneNumber,children:(0,o.Y)(b,{})}),(0,o.Y)(_.q,{path:"sso-callback",children:(0,o.Y)(C,{signUpUrl:t.signUpUrl,signInUrl:t.signInUrl,signUpForceRedirectUrl:t.afterSignUpUrl,signInForceRedirectUrl:t.afterSignInUrl,secondFactorUrl:t.secondFactorUrl,continueSignUpUrl:"../continue",verifyEmailAddressUrl:"../verify-email-address",verifyPhoneNumberUrl:"../verify-phone-number"})}),(0,o.Y)(_.q,{path:"verify",children:(0,o.Y)(c.M,{redirectUrlComplete:t.afterSignUpUrl,verifyEmailPath:"../verify-email-address",verifyPhonePath:"../verify-phone-number",continuePath:"../continue"})}),(0,o.FD)(_.q,{path:"continue",children:[(0,o.Y)(_.q,{path:"verify-email-address",canActivate:e=>!!e.client.signUp.emailAddress,children:(0,o.Y)(Y,{})}),(0,o.Y)(_.q,{path:"verify-phone-number",canActivate:e=>!!e.client.signUp.phoneNumber,children:(0,o.Y)(b,{})}),(0,o.Y)(_.q,{index:!0,children:(0,o.Y)(A,{})})]}),(0,o.Y)(_.q,{path:"tasks",children:(0,o.Y)(m.JJ,{redirectUrlComplete:e.afterSignUpUrl})}),(0,o.Y)(_.q,{index:!0,children:(0,o.Y)(k,{})})]}),(0,o.Y)(_.q,{path:"tasks",children:(0,o.Y)(m.JJ,{redirectUrlComplete:e.afterSignInUrl})}),(0,o.Y)(_.q,{index:!0,children:(0,o.Y)(tg,{})}),(0,o.Y)(_.q,{children:(0,o.Y)(tm,{})})]})})}tI.displayName="SignIn";let t_=(0,h.Z)(function(){let e=(0,d.r)(),t={componentName:"SignUp",emailLinkRedirectUrl:e.emailLinkRedirectUrl,ssoCallbackUrl:e.ssoCallbackUrl,forceRedirectUrl:e.signUpForceRedirectUrl,fallbackRedirectUrl:e.signUpFallbackRedirectUrl,signInUrl:e.signInUrl,unsafeMetadata:e.unsafeMetadata,...(0,S.C)({routing:e?.routing,path:e?.path})};return((e=!1)=>(0,f.s)(e?v:void 0,"preloadComponent",{staleTime:1/0}))(e.isCombinedFlow),(0,g.Z)(),(0,o.Y)(u.g.Provider,{value:t,children:(0,o.Y)(tI,{})})}),tw=e=>{let t={signUpUrl:`/${w.I}/sign-up`,waitlistUrl:`/${w.I}/waitlist`,...e};return(0,o.Y)(_.q,{path:"sign-in",children:(0,o.Y)(d.Q.Provider,{value:{componentName:"SignIn",...t,routing:"virtual",mode:"modal"},children:(0,o.Y)("div",{children:(0,o.Y)(t_,{...t,routing:"virtual"})})})})}},2690:function(e,t,r){r.d(t,{j:()=>o});var n=r(5074),i=r(5763);let a=e=>{if(!e)return"";let t=e.strategy;return"phoneNumberId"in e&&(t+=e.phoneNumberId),t};function o(e){let t=n.useRef(""),[r,o]=n.useState(()=>(0,i.R5)(e)),[s,l]=n.useState(!r),c=t.current===a(r);return{currentFactor:r,factorAlreadyPrepared:c,handleFactorPrepare:()=>{t.current=a(r)},selectFactor:e=>{o(e),l(!1)},showAllStrategies:s,toggleAllStrategies:()=>l(e=>!e)}}},5763:function(e,t,r){r.d(t,{Cm:()=>u,Kw:()=>f,R5:()=>h,UY:()=>g,iy:()=>I,oj:()=>m,xf:()=>c}),r(1044);var n=r(2620),i=r(7651),a=r(1959),o=r(8289);let s=e=>t=>"safeIdentifier"in t&&t.safeIdentifier===e;function l(e){if((0,n.Bz)()){let t=e.find(({strategy:e})=>"passkey"===e);if(t)return t}return null}function c(e,t,r){return e&&0!==e.length?r===a._o.Password?function(e,t){let r=l(e);if(r)return r;let n=e.sort(o.Kn)[0];return"password"===n.strategy?n:e.find(s(t))||n||null}(e,t):function(e,t){let r=l(e);if(r)return r;let n=e.sort(o.Ih),i=n.find(s(t));if(i)return i;let a=n[0];return"email_link"===a.strategy?a:e.find(s(t))||a||null}(e,t):null}let d=["passkey","email_code","password","phone_code","email_link"];function u(e){return!!e&&d.includes(e.strategy)}function h(e){if(!e||0===e.length)return null;let t=e.find(e=>"totp"===e.strategy);if(t)return t;let r=e.find(e=>"phone_code"===e.strategy);return r||e[0]}let p=["reset_password_phone_code","reset_password_email_code"],f=e=>!!e&&p.includes(e);function g(e){let t;return"tel"===e.type?"phoneNumber":(t=e.value,/^\S+@\S+\.\S+$/.test(t))?"emailAddress":"username"}let m=(e,t,r)=>{if(!t)return null;let n=e.find(e=>"strategy"===e.id)?.value;if(n&&"phone_code"!==n)return null;let a=e.find(e=>e.id===r)?.value;if(!a||!a?.startsWith("+"))return null;let o=(0,i.TV)(a,t);return"sms"===o?null:o},I=(e,t,r)=>{if(!e||!t||"phoneNumber"!==t||!r||!r?.startsWith("+"))return null;let n=(0,i.TV)(r,e);return"sms"===n?null:n}},4:function(e,t,r){r.d(t,{Q:()=>g,r:()=>m});var n=r(2166),i=r(8380),a=r(5580),o=r(4173),s=r(5543),l=r(5993),c=r(5074),d=r(8051),u=r(7697),h=r(2366),p=r(4964),f=r(2117);let g=(0,c.createContext)(null),m=()=>{let e=(0,c.useContext)(g),{navigate:t,basePath:r,startPath:m}=(0,p.r)(),{displayConfig:I,userSettings:_}=(0,u.O)(),{queryParams:w,queryString:S}=(0,p.r)(),v=_.signUp.mode,b=(0,h.II)(),Y=(0,s.ho)();if(null===e||"SignIn"!==e.componentName)throw Error("Clerk: useSignInContext called outside of the mounted SignIn component.");let k="restricted"!==v&&!!(!b.signUpUrl&&b.signInUrl&&!(0,l.s)(b.signInUrl))&&!1!==e.withSignUp||e.withSignUp||!1,{componentName:C,mode:A,...F}=e,y=(0,c.useMemo)(()=>(0,f.tf)(S,n.u),[]),U=new i.n(b,{...F,signInFallbackRedirectUrl:F.signInFallbackRedirectUrl||F.fallbackRedirectUrl,signInForceRedirectUrl:F.signInForceRedirectUrl||F.forceRedirectUrl},w,A);delete F.fallbackRedirectUrl,delete F.forceRedirectUrl;let P=Y.buildUrlWithAuth(U.getAfterSignInUrl()),E=Y.buildUrlWithAuth(U.getAfterSignUpUrl()),M="path"===F.routing&&F.path||b.signInUrl||I.signInUrl,D=k?"path"===F.routing&&F.path||b.signUpUrl||I.signUpUrl:F.signUpUrl||b.signUpUrl||I.signUpUrl,L=F.waitlistUrl||b.waitlistUrl||I.waitlistUrl,T=U.getPreservedSearchParams();M=(0,o.kZ)({base:M,hashSearchParams:[w,T]},{stringify:!0}),D=(0,o.kZ)({base:D,hashSearchParams:[w,T]},{stringify:!0}),L=(0,o.kZ)({base:L,hashSearchParams:[w,T]},{stringify:!0});let G=U.toSearchParams().toString(),R=(0,d.aQ)({routing:F.routing,baseUrl:D,authQueryString:G,path:F.path,endpoint:k?"/create"+d.Vu:d.Vu}),B=(0,d.aQ)({routing:F.routing,baseUrl:D,authQueryString:G,path:F.path,endpoint:k?"/create"+d.aB:d.aB});k&&(D=(0,o.kZ)({base:M,hashPath:"/create",hashSearchParams:[w,T]},{stringify:!0}));let z=(0,o.kZ)({base:D,hashPath:"/continue"},{stringify:!0}),O=async({session:e,redirectUrl:n})=>{let i=e.currentTask;if(!i)return t(n);let o=(0,a.ru)(i);return t(`/${r+m+(k?"/create"+o:o)}`)},$=Y.session?.currentTask?Y.__internal_getOption("taskUrls")?.[Y.session?.currentTask.key]??(0,d.aQ)({routing:F.routing,baseUrl:M,authQueryString:G,path:F.path,endpoint:k?"/create"+(0,a.ru)(Y.session?.currentTask):(0,a.ru)(Y.session?.currentTask)}):null;return{...F,transferable:F.transferable??!0,oauthFlow:F.oauthFlow||"auto",componentName:C,signUpUrl:D,signInUrl:M,waitlistUrl:L,afterSignInUrl:P,afterSignUpUrl:E,emailLinkRedirectUrl:R,ssoCallbackUrl:B,navigateAfterSignIn:()=>t(P),signUpContinueUrl:z,queryParams:w,initialValues:{...F.initialValues,...y},authQueryString:G,isCombinedFlow:k,navigateOnSetActive:O,taskUrl:$}}},9599:function(e,t,r){r.d(t,{g:()=>a});var n=r(5543),i=r(4964);let a=()=>{let{navigate:e}=(0,i.r)(),t=(0,n.ho)();return{navigateAfterSignOut:()=>e(t.buildAfterSignOutUrl()),navigateAfterMultiSessionSingleSignOutUrl:()=>e(t.buildAfterMultiSessionSingleSignOutUrl()),afterSignOutUrl:t.buildAfterSignOutUrl(),afterMultiSessionSingleSignOutUrl:t.buildAfterMultiSessionSingleSignOutUrl()}}}}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|