@clerk/ui 1.0.0-snapshot.v20251208202852 → 1.0.0-snapshot.v20251215203425

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.
Files changed (234) hide show
  1. package/dist/{207_ui_03abd0_1.0.0-snapshot.v20251208202852.js → 207_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  2. package/dist/{217_ui_03abd0_1.0.0-snapshot.v20251208202852.js → 217_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  3. package/dist/{360_ui_03abd0_1.0.0-snapshot.v20251208202852.js → 360_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  4. package/dist/{444_ui_03abd0_1.0.0-snapshot.v20251208202852.js → 444_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  5. package/dist/{573_ui_03abd0_1.0.0-snapshot.v20251208202852.js → 573_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  6. package/dist/{970_ui_03abd0_1.0.0-snapshot.v20251208202852.js → 970_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  7. package/dist/ClerkUi.js +2 -2
  8. package/dist/Components.js +7 -0
  9. package/dist/Components.js.map +1 -1
  10. package/dist/{apiKeys_ui_03abd0_1.0.0-snapshot.v20251208202852.js → apiKeys_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  11. package/dist/{checkout_ui_03abd0_1.0.0-snapshot.v20251208202852.js → checkout_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +2 -2
  12. package/dist/common/EmailLinkVerify.js +1 -1
  13. package/dist/common/Gate.js +1 -1
  14. package/dist/common/RemoveResourceForm.js +1 -1
  15. package/dist/common/SSOCallback.js +1 -1
  16. package/dist/common/withRedirect.js +1 -1
  17. package/dist/components/APIKeys/APIKeys.js +1 -1
  18. package/dist/components/APIKeys/RevokeAPIKeyConfirmationModal.js +1 -1
  19. package/dist/components/Checkout/CheckoutComplete.js +1 -1
  20. package/dist/components/Checkout/CheckoutForm.js +1 -1
  21. package/dist/components/Checkout/CheckoutPage.js +1 -1
  22. package/dist/components/Checkout/parts.js +1 -1
  23. package/dist/components/CreateOrganization/CreateOrganizationForm.js +1 -1
  24. package/dist/components/CreateOrganization/CreateOrganizationPage.js +1 -1
  25. package/dist/components/ImpersonationFab/index.js +1 -1
  26. package/dist/components/OAuthConsent/OAuthConsent.js +1 -1
  27. package/dist/components/OrganizationList/UserInvitationList.js +1 -1
  28. package/dist/components/OrganizationList/UserMembershipList.js +1 -1
  29. package/dist/components/OrganizationList/UserSuggestionList.js +1 -1
  30. package/dist/components/OrganizationProfile/ActionConfirmationPage.js +1 -1
  31. package/dist/components/OrganizationProfile/ActiveMembersList.js +1 -1
  32. package/dist/components/OrganizationProfile/AddDomainForm.js +1 -1
  33. package/dist/components/OrganizationProfile/DomainList.js +1 -1
  34. package/dist/components/OrganizationProfile/InviteMembersForm.js +3 -3
  35. package/dist/components/OrganizationProfile/InviteMembersForm.js.map +1 -1
  36. package/dist/components/OrganizationProfile/InviteMembersScreen.js +1 -1
  37. package/dist/components/OrganizationProfile/InvitedMembersList.js +1 -1
  38. package/dist/components/OrganizationProfile/MembersSearch.js.map +1 -1
  39. package/dist/components/OrganizationProfile/OrganizationAPIKeysPage.js +1 -1
  40. package/dist/components/OrganizationProfile/OrganizationGeneralPage.js +1 -1
  41. package/dist/components/OrganizationProfile/OrganizationMembers.js +1 -1
  42. package/dist/components/OrganizationProfile/OrganizationProfileNavbar.js +1 -1
  43. package/dist/components/OrganizationProfile/ProfileForm.js +1 -1
  44. package/dist/components/OrganizationProfile/RemoveDomainForm.js +1 -1
  45. package/dist/components/OrganizationProfile/RequestToJoinList.js +1 -1
  46. package/dist/components/OrganizationProfile/VerifiedDomainForm.js +1 -1
  47. package/dist/components/OrganizationProfile/VerifyDomainForm.js +1 -1
  48. package/dist/components/OrganizationProfile/index.js +1 -1
  49. package/dist/components/OrganizationSwitcher/OrganizationSwitcherPopover.js +6 -3
  50. package/dist/components/OrganizationSwitcher/OrganizationSwitcherPopover.js.map +1 -1
  51. package/dist/components/OrganizationSwitcher/OrganizationSwitcherTrigger.js +1 -1
  52. package/dist/components/OrganizationSwitcher/UserInvitationSuggestionList.js +1 -1
  53. package/dist/components/OrganizationSwitcher/UserMembershipList.js +1 -1
  54. package/dist/components/PaymentMethods/AddPaymentMethod.js +1 -1
  55. package/dist/components/PaymentMethods/PaymentMethods.js +1 -1
  56. package/dist/components/PricingTable/PricingTable.js +3 -2
  57. package/dist/components/PricingTable/PricingTable.js.map +1 -1
  58. package/dist/components/PricingTable/PricingTableDefault.js +1 -1
  59. package/dist/components/SessionTasks/index.js +1 -1
  60. package/dist/components/SessionTasks/tasks/TaskChooseOrganization/ChooseOrganizationScreen.js +1 -1
  61. package/dist/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.js +1 -1
  62. package/dist/components/SessionTasks/tasks/TaskChooseOrganization/index.js +1 -1
  63. package/dist/components/SessionTasks/tasks/TaskResetPassword/index.js +2 -2
  64. package/dist/components/SessionTasks/tasks/TaskResetPassword/index.js.map +1 -1
  65. package/dist/components/SignIn/ResetPassword.js +1 -0
  66. package/dist/components/SignIn/ResetPassword.js.map +1 -1
  67. package/dist/components/SignIn/SignInClientTrust.js +49 -0
  68. package/dist/components/SignIn/SignInClientTrust.js.map +1 -0
  69. package/dist/components/SignIn/SignInFactorOne.js +1 -1
  70. package/dist/components/SignIn/SignInFactorOneAlternativeChannelCodeForm.js +1 -1
  71. package/dist/components/SignIn/SignInFactorOneCodeForm.js +1 -1
  72. package/dist/components/SignIn/SignInFactorOneEmailLinkCard.js +1 -1
  73. package/dist/components/SignIn/SignInFactorOnePasswordCard.js +4 -3
  74. package/dist/components/SignIn/SignInFactorOnePasswordCard.js.map +1 -1
  75. package/dist/components/SignIn/SignInFactorTwo.js +3 -22
  76. package/dist/components/SignIn/SignInFactorTwo.js.map +1 -1
  77. package/dist/components/SignIn/SignInFactorTwoBackupCodeCard.js +1 -1
  78. package/dist/components/SignIn/SignInFactorTwoCodeForm.js +3 -3
  79. package/dist/components/SignIn/SignInFactorTwoCodeForm.js.map +1 -1
  80. package/dist/components/SignIn/SignInFactorTwoEmailLinkCard.js +2 -2
  81. package/dist/components/SignIn/SignInFactorTwoEmailLinkCard.js.map +1 -1
  82. package/dist/components/SignIn/SignInSocialButtons.js +1 -1
  83. package/dist/components/SignIn/SignInStart.js +3 -1
  84. package/dist/components/SignIn/SignInStart.js.map +1 -1
  85. package/dist/components/SignIn/index.js +6 -1
  86. package/dist/components/SignIn/index.js.map +1 -1
  87. package/dist/components/SignIn/shared.js +1 -1
  88. package/dist/components/SignIn/useSecondFactorSelection.js +35 -0
  89. package/dist/components/SignIn/useSecondFactorSelection.js.map +1 -0
  90. package/dist/components/SignUp/SignUpContinue.js +1 -1
  91. package/dist/components/SignUp/SignUpEmailLinkCard.js +1 -1
  92. package/dist/components/SignUp/SignUpRestrictedAccess.js +1 -1
  93. package/dist/components/SignUp/SignUpSocialButtons.js +1 -1
  94. package/dist/components/SignUp/SignUpStart.js +1 -1
  95. package/dist/components/SignUp/SignUpVerificationCodeForm.js +1 -1
  96. package/dist/components/SignUp/index.js +1 -1
  97. package/dist/components/SubscriptionDetails/index.js +1 -1
  98. package/dist/components/UserButton/UserButtonPopover.js +1 -1
  99. package/dist/components/UserButton/UserButtonTopLevelIdentifier.js +1 -1
  100. package/dist/components/UserButton/UserButtonTrigger.js +1 -1
  101. package/dist/components/UserButton/useMultisessionActions.js +7 -2
  102. package/dist/components/UserButton/useMultisessionActions.js.map +1 -1
  103. package/dist/components/UserProfile/APIKeysPage.js +1 -1
  104. package/dist/components/UserProfile/AccountPage.js +1 -1
  105. package/dist/components/UserProfile/ActiveDevicesSection.js +1 -1
  106. package/dist/components/UserProfile/AddAuthenticatorApp.js +1 -1
  107. package/dist/components/UserProfile/ConnectedAccountsMenu.js +1 -1
  108. package/dist/components/UserProfile/ConnectedAccountsSection.js +1 -1
  109. package/dist/components/UserProfile/DeleteUserForm.js +1 -1
  110. package/dist/components/UserProfile/EmailForm.js +1 -1
  111. package/dist/components/UserProfile/EmailsSection.js +1 -1
  112. package/dist/components/UserProfile/EnterpriseAccountsSection.js +1 -1
  113. package/dist/components/UserProfile/MfaBackupCodeCreateForm.js +1 -1
  114. package/dist/components/UserProfile/MfaBackupCodeList.js +1 -1
  115. package/dist/components/UserProfile/MfaForm.js +1 -1
  116. package/dist/components/UserProfile/MfaPhoneCodeScreen.js +1 -1
  117. package/dist/components/UserProfile/MfaSection.js +1 -1
  118. package/dist/components/UserProfile/PasskeySection.js +1 -1
  119. package/dist/components/UserProfile/PasswordForm.js +2 -1
  120. package/dist/components/UserProfile/PasswordForm.js.map +1 -1
  121. package/dist/components/UserProfile/PasswordSection.js +1 -1
  122. package/dist/components/UserProfile/PhoneForm.js +1 -1
  123. package/dist/components/UserProfile/PhoneSection.js +1 -1
  124. package/dist/components/UserProfile/ProfileForm.js +1 -1
  125. package/dist/components/UserProfile/RemoveResourceForm.js +1 -1
  126. package/dist/components/UserProfile/SecurityPage.js +1 -1
  127. package/dist/components/UserProfile/UserProfileSection.js +1 -1
  128. package/dist/components/UserProfile/UsernameForm.js +1 -1
  129. package/dist/components/UserProfile/UsernameSection.js +1 -1
  130. package/dist/components/UserProfile/VerifyTOTP.js +1 -1
  131. package/dist/components/UserProfile/Web3Form.js +1 -1
  132. package/dist/components/UserProfile/Web3Section.js +1 -1
  133. package/dist/components/UserVerification/UVFactorOneCodeForm.js +1 -1
  134. package/dist/components/UserVerification/UVFactorOnePasskeysCard.js +1 -1
  135. package/dist/components/UserVerification/UVFactorTwoBackupCodeCard.js +1 -1
  136. package/dist/components/UserVerification/UVFactorTwoCodeForm.js +1 -1
  137. package/dist/components/UserVerification/UVFactorTwoPhoneCodeCard.js +1 -1
  138. package/dist/components/UserVerification/UserVerificationFactorOnePassword.js +1 -1
  139. package/dist/components/UserVerification/UserVerificationFactorTwo.js +4 -20
  140. package/dist/components/UserVerification/UserVerificationFactorTwo.js.map +1 -1
  141. package/dist/components/UserVerification/useUserVerificationSession.js +1 -1
  142. package/dist/components/Waitlist/WaitlistForm.js +1 -1
  143. package/dist/components/Waitlist/index.js +1 -1
  144. package/dist/components/devPrompts/EnableOrganizationsPrompt/index.js +1 -1
  145. package/dist/components/devPrompts/KeylessPrompt/index.js +1 -1
  146. package/dist/contexts/CoreClerkContextWrapper.js +1 -1
  147. package/dist/contexts/CoreSessionContext.js +1 -1
  148. package/dist/contexts/CoreUserContext.js +1 -1
  149. package/dist/{createorganization_ui_03abd0_1.0.0-snapshot.v20251208202852.js → createorganization_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  150. package/dist/customizables/AppearanceContext.js +1 -1
  151. package/dist/elements/Action/ActionRoot.js +1 -1
  152. package/dist/elements/AvatarUploader.js +14 -4
  153. package/dist/elements/AvatarUploader.js.map +1 -1
  154. package/dist/elements/CodeControl.js +1 -1
  155. package/dist/elements/Drawer.js +8 -2
  156. package/dist/elements/Drawer.js.map +1 -1
  157. package/dist/elements/Form.js +1 -1
  158. package/dist/elements/Menu.js +1 -1
  159. package/dist/elements/Modal.js +3 -2
  160. package/dist/elements/Modal.js.map +1 -1
  161. package/dist/elements/Navbar.js +1 -1
  162. package/dist/elements/PhoneInput/countryCodeData.js +34 -9
  163. package/dist/elements/PhoneInput/countryCodeData.js.map +1 -1
  164. package/dist/elements/PhoneInput/index.js +1 -1
  165. package/dist/elements/Popover.js +4 -1
  166. package/dist/elements/Popover.js.map +1 -1
  167. package/dist/elements/Select.js +1 -1
  168. package/dist/elements/SocialButtons.js +1 -1
  169. package/dist/elements/Tabs.js +1 -1
  170. package/dist/elements/TimerButton.js +1 -1
  171. package/dist/elements/Tooltip.js +29 -24
  172. package/dist/elements/Tooltip.js.map +1 -1
  173. package/dist/elements/contexts/index.js +1 -1
  174. package/dist/{enableOrganizationsPrompt_ui_03abd0_1.0.0-snapshot.v20251208202852.js → enableOrganizationsPrompt_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  175. package/dist/foundations/defaultFoundations.d.ts +153 -153
  176. package/dist/hooks/useFetchRoles.js.map +1 -1
  177. package/dist/{impersonationfab_ui_03abd0_1.0.0-snapshot.v20251208202852.js → impersonationfab_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  178. package/dist/index.js +1 -1
  179. package/dist/internal/index.js +2 -2
  180. package/dist/internal/index.js.map +1 -1
  181. package/dist/{keylessPrompt_ui_03abd0_1.0.0-snapshot.v20251208202852.js → keylessPrompt_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  182. package/dist/lazyModules/MountedCheckoutDrawer.js +1 -1
  183. package/dist/lazyModules/MountedPlanDetailDrawer.js +1 -1
  184. package/dist/lazyModules/MountedSubscriptionDetailDrawer.js +1 -1
  185. package/dist/lazyModules/components.d.ts +20 -20
  186. package/dist/lazyModules/providers.js +24 -17
  187. package/dist/lazyModules/providers.js.map +1 -1
  188. package/dist/{oauthConsent_ui_03abd0_1.0.0-snapshot.v20251208202852.js → oauthConsent_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  189. package/dist/{onetap_ui_03abd0_1.0.0-snapshot.v20251208202852.js → onetap_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  190. package/dist/{op-api-keys-page_ui_03abd0_1.0.0-snapshot.v20251208202852.js → op-api-keys-page_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  191. package/dist/{organizationlist_ui_03abd0_1.0.0-snapshot.v20251208202852.js → organizationlist_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  192. package/dist/organizationprofile_ui_e1841e_1.0.0-snapshot.v20251215203425.js +1 -0
  193. package/dist/organizationswitcher_ui_e1841e_1.0.0-snapshot.v20251215203425.js +1 -0
  194. package/dist/{payment-attempt-page_ui_03abd0_1.0.0-snapshot.v20251208202852.js → payment-attempt-page_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  195. package/dist/{planDetails_ui_03abd0_1.0.0-snapshot.v20251208202852.js → planDetails_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  196. package/dist/{prefetchorganizationlist_ui_03abd0_1.0.0-snapshot.v20251208202852.js → prefetchorganizationlist_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  197. package/dist/{pricingTable_ui_03abd0_1.0.0-snapshot.v20251208202852.js → pricingTable_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  198. package/dist/primitives/hooks/useFormField.js +1 -1
  199. package/dist/{revoke-api-key-modal_ui_03abd0_1.0.0-snapshot.v20251208202852.js → revoke-api-key-modal_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  200. package/dist/router/BaseRouter.js +1 -1
  201. package/dist/router/PathRouter.js +1 -1
  202. package/dist/router/Route.js +1 -1
  203. package/dist/router/VirtualRouter.js +1 -1
  204. package/dist/{sessionTasks_ui_03abd0_1.0.0-snapshot.v20251208202852.js → sessionTasks_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  205. package/dist/signin_ui_e1841e_1.0.0-snapshot.v20251215203425.js +1 -0
  206. package/dist/{signup_ui_03abd0_1.0.0-snapshot.v20251208202852.js → signup_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  207. package/dist/{statement-page_ui_03abd0_1.0.0-snapshot.v20251208202852.js → statement-page_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  208. package/dist/{subscriptionDetails_ui_03abd0_1.0.0-snapshot.v20251208202852.js → subscriptionDetails_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  209. package/dist/{taskChooseOrganization_ui_03abd0_1.0.0-snapshot.v20251208202852.js → taskChooseOrganization_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  210. package/dist/taskResetPassword_ui_e1841e_1.0.0-snapshot.v20251215203425.js +1 -0
  211. package/dist/ui-common_ui_e1841e_1.0.0-snapshot.v20251215203425.js +122 -0
  212. package/dist/ui.browser.js +20 -3
  213. package/dist/{up-api-keys-page_ui_03abd0_1.0.0-snapshot.v20251208202852.js → up-api-keys-page_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  214. package/dist/{useravatar_ui_03abd0_1.0.0-snapshot.v20251208202852.js → useravatar_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  215. package/dist/{userbutton_ui_03abd0_1.0.0-snapshot.v20251208202852.js → userbutton_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  216. package/dist/{userprofile_ui_03abd0_1.0.0-snapshot.v20251208202852.js → userprofile_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +2 -2
  217. package/dist/userverification_ui_e1841e_1.0.0-snapshot.v20251215203425.js +1 -0
  218. package/dist/vendors_ui_e1841e_1.0.0-snapshot.v20251215203425.js +20 -0
  219. package/dist/{waitlist_ui_03abd0_1.0.0-snapshot.v20251208202852.js → waitlist_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +1 -1
  220. package/package.json +5 -4
  221. package/dist/organizationprofile_ui_03abd0_1.0.0-snapshot.v20251208202852.js +0 -1
  222. package/dist/organizationswitcher_ui_03abd0_1.0.0-snapshot.v20251208202852.js +0 -1
  223. package/dist/signin_ui_03abd0_1.0.0-snapshot.v20251208202852.js +0 -1
  224. package/dist/taskResetPassword_ui_03abd0_1.0.0-snapshot.v20251208202852.js +0 -1
  225. package/dist/ui-common_ui_03abd0_1.0.0-snapshot.v20251208202852.js +0 -139
  226. package/dist/userverification_ui_03abd0_1.0.0-snapshot.v20251208202852.js +0 -1
  227. package/dist/vendors_ui_03abd0_1.0.0-snapshot.v20251208202852.js +0 -20
  228. /package/dist/{blankcaptcha_ui_03abd0_1.0.0-snapshot.v20251208202852.js → blankcaptcha_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +0 -0
  229. /package/dist/{copy-api-key-modal_ui_03abd0_1.0.0-snapshot.v20251208202852.js → copy-api-key-modal_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +0 -0
  230. /package/dist/{framework_ui_03abd0_1.0.0-snapshot.v20251208202852.js → framework_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +0 -0
  231. /package/dist/{op-billing-page_ui_03abd0_1.0.0-snapshot.v20251208202852.js → op-billing-page_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +0 -0
  232. /package/dist/{op-plans-page_ui_03abd0_1.0.0-snapshot.v20251208202852.js → op-plans-page_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +0 -0
  233. /package/dist/{up-billing-page_ui_03abd0_1.0.0-snapshot.v20251208202852.js → up-billing-page_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +0 -0
  234. /package/dist/{up-plans-page_ui_03abd0_1.0.0-snapshot.v20251208202852.js → up-plans-page_ui_e1841e_1.0.0-snapshot.v20251215203425.js} +0 -0
@@ -11,8 +11,8 @@ import { VerifyWithCode } from "./VerifyWithCode.js";
11
11
  import { VerifyWithEnterpriseConnection } from "./VerifyWithEnterpriseConnection.js";
12
12
  import { VerifyWithLink } from "./VerifyWithLink.js";
13
13
  import React from "react";
14
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
15
14
  import { useReverification, useUser } from "@clerk/shared/react";
15
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
16
16
 
17
17
  //#region src/components/UserProfile/EmailForm.tsx
18
18
  const EmailForm = withCardStateProvider((props) => {
@@ -10,8 +10,8 @@ import { ProfileSection } from "../../elements/Section.js";
10
10
  import { RemoveEmailForm } from "./RemoveResourceForm.js";
11
11
  import { sortIdentificationBasedOnVerification } from "./utils.js";
12
12
  import { Fragment } from "react";
13
- import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
14
13
  import { useReverification, useUser } from "@clerk/shared/react";
14
+ import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
15
15
 
16
16
  //#region src/components/UserProfile/EmailsSection.tsx
17
17
  const RemoveEmailScreen = (props) => {
@@ -3,8 +3,8 @@ import { descriptors } from "../../customizables/elementDescriptors.js";
3
3
  import { Badge, Box, Flex, Image, Text } from "../../customizables/index.js";
4
4
  import { ProviderInitialIcon } from "../../common/ProviderInitialIcon.js";
5
5
  import { ProfileSection } from "../../elements/Section.js";
6
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
7
6
  import { useUser } from "@clerk/shared/react";
7
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
8
8
 
9
9
  //#region src/components/UserProfile/EnterpriseAccountsSection.tsx
10
10
  const EnterpriseAccountsSection = () => {
@@ -8,9 +8,9 @@ import { FormContainer } from "../../elements/FormContainer.js";
8
8
  import { FullHeightLoader } from "../../elements/FullHeightLoader.js";
9
9
  import { MfaBackupCodeList } from "./MfaBackupCodeList.js";
10
10
  import React from "react";
11
+ import { useReverification, useUser } from "@clerk/shared/react";
11
12
  import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
12
13
  import { isReverificationCancelledError } from "@clerk/shared/error";
13
- import { useReverification, useUser } from "@clerk/shared/react";
14
14
 
15
15
  //#region src/components/UserProfile/MfaBackupCodeCreateForm.tsx
16
16
  const MfaBackupCodeCreateForm = withCardStateProvider((props) => {
@@ -8,8 +8,8 @@ import print_default from "../../icons/print.js";
8
8
  import { Box, Button, Col, Grid, Heading, Icon, Text } from "../../customizables/index.js";
9
9
  import { PrintableComponent, usePrintable } from "../../common/PrintableComponent.js";
10
10
  import { MfaBackupCodeTile } from "./MfaBackupCodeTile.js";
11
- import { Fragment, jsx, jsxs } from "@emotion/react/jsx-runtime";
12
11
  import { useUser } from "@clerk/shared/react";
12
+ import { Fragment, jsx, jsxs } from "@emotion/react/jsx-runtime";
13
13
  import { getIdentifier } from "@clerk/shared/internal/clerk-js/user";
14
14
 
15
15
  //#region src/components/UserProfile/MfaBackupCodeList.tsx
@@ -7,8 +7,8 @@ import { MfaBackupCodeScreen } from "./MfaBackupCodeScreen.js";
7
7
  import { MfaPhoneCodeScreen } from "./MfaPhoneCodeScreen.js";
8
8
  import { MfaTOTPScreen } from "./MfaTOTPScreen.js";
9
9
  import React from "react";
10
- import { jsx } from "@emotion/react/jsx-runtime";
11
10
  import { useUser } from "@clerk/shared/react";
11
+ import { jsx } from "@emotion/react/jsx-runtime";
12
12
 
13
13
  //#region src/components/UserProfile/MfaForm.tsx
14
14
  const MfaForm = withCardStateProvider((props) => {
@@ -14,8 +14,8 @@ import { SuccessPage } from "../../elements/SuccessPage.js";
14
14
  import { AddPhone } from "./PhoneForm.js";
15
15
  import { MfaBackupCodeList } from "./MfaBackupCodeList.js";
16
16
  import React from "react";
17
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
18
17
  import { useReverification, useUser } from "@clerk/shared/react";
18
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
19
19
 
20
20
  //#region src/components/UserProfile/MfaPhoneCodeScreen.tsx
21
21
  const MfaPhoneCodeScreen = withCardStateProvider((props) => {
@@ -14,8 +14,8 @@ import { defaultFirst, getSecondFactors, getSecondFactorsAvailableToAdd } from "
14
14
  import { FormattedPhoneNumberText } from "../../elements/FormattedPhoneNumber.js";
15
15
  import { MfaBackupCodeCreateScreen, MfaScreen, RemoveMfaPhoneCodeScreen, RemoveMfaTOTPScreen } from "./MfaScreens.js";
16
16
  import React, { Fragment, useState } from "react";
17
- import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
18
17
  import { useUser } from "@clerk/shared/react";
18
+ import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
19
19
 
20
20
  //#region src/components/UserProfile/MfaSection.tsx
21
21
  const MfaSection = () => {
@@ -15,8 +15,8 @@ import { ProfileSection } from "../../elements/Section.js";
15
15
  import { RemovePasskeyForm } from "./RemoveResourceForm.js";
16
16
  import { getRelativeToNowDateKey } from "../../utils/getRelativeToNowDateKey.js";
17
17
  import React, { Fragment, useState } from "react";
18
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
19
18
  import { useClerk, useReverification, useUser } from "@clerk/shared/react";
19
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
20
20
 
21
21
  //#region src/components/UserProfile/PasskeySection.tsx
22
22
  const RemovePasskeyScreen = (props) => {
@@ -11,8 +11,8 @@ import { FormButtonContainer, FormButtons } from "../../elements/FormButtons.js"
11
11
  import { FormContainer } from "../../elements/FormContainer.js";
12
12
  import { InformationBox } from "../../elements/InformationBox.js";
13
13
  import { useRef } from "react";
14
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
15
14
  import { useReverification, useSession, useUser } from "@clerk/shared/react";
15
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
16
16
 
17
17
  //#region src/components/UserProfile/PasswordForm.tsx
18
18
  const generateSuccessPageText = (userHasPassword, sessionSignOut) => {
@@ -70,6 +70,7 @@ const PasswordForm = withCardStateProvider((props) => {
70
70
  if (passwordField.value) setConfirmPasswordFeedback(confirmField.value);
71
71
  };
72
72
  const updatePassword = async () => {
73
+ if (!canSubmit) return;
73
74
  try {
74
75
  successPagePropsRef.current = {
75
76
  title: user.passwordEnabled ? localizationKeys("userProfile.passwordPage.title__update") : localizationKeys("userProfile.passwordPage.title__set"),
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordForm.js","names":["user","e: any"],"sources":["../../../src/components/UserProfile/PasswordForm.tsx"],"sourcesContent":["import { useReverification, useSession, useUser } from '@clerk/shared/react';\nimport type { UserResource } from '@clerk/shared/types';\nimport { useRef } from 'react';\n\nimport { useCardState, withCardStateProvider } from '@/ui/elements/contexts';\nimport { Form } from '@/ui/elements/Form';\nimport { FormButtonContainer, FormButtons } from '@/ui/elements/FormButtons';\nimport type { FormProps } from '@/ui/elements/FormContainer';\nimport { FormContainer } from '@/ui/elements/FormContainer';\nimport { InformationBox } from '@/ui/elements/InformationBox';\nimport type { SuccessPage } from '@/ui/elements/SuccessPage';\nimport { handleError } from '@/ui/utils/errorHandler';\nimport { createPasswordError } from '@/ui/utils/passwordUtils';\nimport { useFormControl } from '@/ui/utils/useFormControl';\n\nimport { useEnvironment } from '../../contexts';\nimport { localizationKeys, useLocalizations } from '../../customizables';\nimport { useConfirmPassword } from '../../hooks';\n\nconst generateSuccessPageText = (userHasPassword: boolean, sessionSignOut: boolean) => {\n const localizedTexts = [];\n\n if (userHasPassword) {\n localizedTexts.push(localizationKeys('userProfile.passwordPage.successMessage__update'));\n } else {\n localizedTexts.push(localizationKeys('userProfile.passwordPage.successMessage__set'));\n }\n\n if (sessionSignOut) {\n localizedTexts.push(localizationKeys('userProfile.passwordPage.successMessage__signOutOfOtherSessions'));\n }\n\n return localizedTexts;\n};\n\ntype PasswordFormProps = FormProps;\nexport const PasswordForm = withCardStateProvider((props: PasswordFormProps) => {\n const { t, locale } = useLocalizations();\n const { onSuccess, onReset } = props;\n const { user } = useUser();\n const updatePasswordWithReverification = useReverification(\n (user: UserResource, opts: Parameters<UserResource['updatePassword']>) => user.updatePassword(...opts),\n );\n\n if (!user) {\n return null;\n }\n\n const {\n userSettings: { passwordSettings },\n authConfig: { reverification },\n } = useEnvironment();\n\n const { session } = useSession();\n const title = user.passwordEnabled\n ? localizationKeys('userProfile.passwordPage.title__update')\n : localizationKeys('userProfile.passwordPage.title__set');\n const card = useCardState();\n\n const passwordEditDisabled = user.enterpriseAccounts.some(ea => ea.active);\n const currentPasswordRequired = user.passwordEnabled && !reverification;\n\n // Ensure that messages will not use the updated state of User after a password has been set or changed\n const successPagePropsRef = useRef<Parameters<typeof SuccessPage>[0]>({\n title: localizationKeys('userProfile.passwordPage.title__set'),\n });\n\n const currentPasswordField = useFormControl('currentPassword', '', {\n type: 'password',\n label: localizationKeys('formFieldLabel__currentPassword'),\n isRequired: true,\n });\n\n const passwordField = useFormControl('newPassword', '', {\n type: 'password',\n label: localizationKeys('formFieldLabel__newPassword'),\n isRequired: true,\n validatePassword: true,\n buildErrorMessage: errors => createPasswordError(errors, { t, locale, passwordSettings }),\n });\n\n const confirmField = useFormControl('confirmPassword', '', {\n type: 'password',\n label: localizationKeys('formFieldLabel__confirmPassword'),\n isRequired: true,\n });\n\n const sessionsField = useFormControl('signOutOfOtherSessions', '', {\n type: 'checkbox',\n label: localizationKeys('formFieldLabel__signOutOfOtherSessions'),\n defaultChecked: true,\n });\n\n const { setConfirmPasswordFeedback, isPasswordMatch } = useConfirmPassword({\n passwordField,\n confirmPasswordField: confirmField,\n });\n\n const canSubmit =\n (currentPasswordRequired ? currentPasswordField.value && isPasswordMatch : isPasswordMatch) &&\n passwordField.value &&\n confirmField.value;\n\n const validateForm = () => {\n if (passwordField.value) {\n setConfirmPasswordFeedback(confirmField.value);\n }\n };\n\n const updatePassword = async () => {\n try {\n successPagePropsRef.current = {\n title: user.passwordEnabled\n ? localizationKeys('userProfile.passwordPage.title__update')\n : localizationKeys('userProfile.passwordPage.title__set'),\n text: generateSuccessPageText(user.passwordEnabled, !!sessionsField.checked),\n };\n\n const opts = {\n newPassword: passwordField.value,\n signOutOfOtherSessions: sessionsField.checked,\n currentPassword: currentPasswordRequired ? currentPasswordField.value : undefined,\n } satisfies Parameters<typeof user.updatePassword>[0];\n\n await updatePasswordWithReverification(user, [opts]);\n onSuccess();\n } catch (e: any) {\n handleError(e, [currentPasswordField, passwordField, confirmField], card.setError);\n }\n };\n\n return (\n <FormContainer headerTitle={title}>\n {passwordEditDisabled && <InformationBox message={localizationKeys('userProfile.passwordPage.readonly')} />}\n\n <Form.Root\n onSubmit={updatePassword}\n onBlur={validateForm}\n >\n {/* For password managers */}\n <input\n readOnly\n data-testid='hidden-identifier'\n id='identifier-field'\n name='identifier'\n value={session?.publicUserData.identifier || ''}\n style={{ display: 'none' }}\n />\n {currentPasswordRequired && (\n <Form.ControlRow elementId={currentPasswordField.id}>\n <Form.PasswordInput\n {...currentPasswordField.props}\n minLength={6}\n isRequired\n autoFocus\n isDisabled={passwordEditDisabled}\n />\n </Form.ControlRow>\n )}\n <Form.ControlRow elementId={passwordField.id}>\n <Form.PasswordInput\n {...passwordField.props}\n minLength={6}\n isRequired\n autoFocus={!user.passwordEnabled}\n isDisabled={passwordEditDisabled}\n />\n </Form.ControlRow>\n <Form.ControlRow elementId={confirmField.id}>\n <Form.PasswordInput\n {...confirmField.props}\n onChange={e => {\n if (e.target.value) {\n setConfirmPasswordFeedback(e.target.value);\n }\n return confirmField.props.onChange(e);\n }}\n isRequired\n isDisabled={passwordEditDisabled}\n />\n </Form.ControlRow>\n <Form.ControlRow elementId={sessionsField.id}>\n <Form.Checkbox\n {...sessionsField.props}\n description={localizationKeys('userProfile.passwordPage.checkboxInfoText__signOutOfOtherSessions')}\n isDisabled={passwordEditDisabled}\n />\n </Form.ControlRow>\n {passwordEditDisabled ? (\n <FormButtonContainer>\n <Form.ResetButton\n localizationKey={localizationKeys('userProfile.formButtonReset')}\n block={false}\n onClick={onReset}\n />\n </FormButtonContainer>\n ) : (\n <FormButtons\n isDisabled={!canSubmit}\n onReset={onReset}\n />\n )}\n </Form.Root>\n </FormContainer>\n );\n});\n"],"mappings":"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"}
1
+ {"version":3,"file":"PasswordForm.js","names":["user","e: any"],"sources":["../../../src/components/UserProfile/PasswordForm.tsx"],"sourcesContent":["import { useReverification, useSession, useUser } from '@clerk/shared/react';\nimport type { UserResource } from '@clerk/shared/types';\nimport { useRef } from 'react';\n\nimport { useCardState, withCardStateProvider } from '@/ui/elements/contexts';\nimport { Form } from '@/ui/elements/Form';\nimport { FormButtonContainer, FormButtons } from '@/ui/elements/FormButtons';\nimport type { FormProps } from '@/ui/elements/FormContainer';\nimport { FormContainer } from '@/ui/elements/FormContainer';\nimport { InformationBox } from '@/ui/elements/InformationBox';\nimport type { SuccessPage } from '@/ui/elements/SuccessPage';\nimport { handleError } from '@/ui/utils/errorHandler';\nimport { createPasswordError } from '@/ui/utils/passwordUtils';\nimport { useFormControl } from '@/ui/utils/useFormControl';\n\nimport { useEnvironment } from '../../contexts';\nimport { localizationKeys, useLocalizations } from '../../customizables';\nimport { useConfirmPassword } from '../../hooks';\n\nconst generateSuccessPageText = (userHasPassword: boolean, sessionSignOut: boolean) => {\n const localizedTexts = [];\n\n if (userHasPassword) {\n localizedTexts.push(localizationKeys('userProfile.passwordPage.successMessage__update'));\n } else {\n localizedTexts.push(localizationKeys('userProfile.passwordPage.successMessage__set'));\n }\n\n if (sessionSignOut) {\n localizedTexts.push(localizationKeys('userProfile.passwordPage.successMessage__signOutOfOtherSessions'));\n }\n\n return localizedTexts;\n};\n\ntype PasswordFormProps = FormProps;\nexport const PasswordForm = withCardStateProvider((props: PasswordFormProps) => {\n const { t, locale } = useLocalizations();\n const { onSuccess, onReset } = props;\n const { user } = useUser();\n const updatePasswordWithReverification = useReverification(\n (user: UserResource, opts: Parameters<UserResource['updatePassword']>) => user.updatePassword(...opts),\n );\n\n if (!user) {\n return null;\n }\n\n const {\n userSettings: { passwordSettings },\n authConfig: { reverification },\n } = useEnvironment();\n\n const { session } = useSession();\n const title = user.passwordEnabled\n ? localizationKeys('userProfile.passwordPage.title__update')\n : localizationKeys('userProfile.passwordPage.title__set');\n const card = useCardState();\n\n const passwordEditDisabled = user.enterpriseAccounts.some(ea => ea.active);\n const currentPasswordRequired = user.passwordEnabled && !reverification;\n\n // Ensure that messages will not use the updated state of User after a password has been set or changed\n const successPagePropsRef = useRef<Parameters<typeof SuccessPage>[0]>({\n title: localizationKeys('userProfile.passwordPage.title__set'),\n });\n\n const currentPasswordField = useFormControl('currentPassword', '', {\n type: 'password',\n label: localizationKeys('formFieldLabel__currentPassword'),\n isRequired: true,\n });\n\n const passwordField = useFormControl('newPassword', '', {\n type: 'password',\n label: localizationKeys('formFieldLabel__newPassword'),\n isRequired: true,\n validatePassword: true,\n buildErrorMessage: errors => createPasswordError(errors, { t, locale, passwordSettings }),\n });\n\n const confirmField = useFormControl('confirmPassword', '', {\n type: 'password',\n label: localizationKeys('formFieldLabel__confirmPassword'),\n isRequired: true,\n });\n\n const sessionsField = useFormControl('signOutOfOtherSessions', '', {\n type: 'checkbox',\n label: localizationKeys('formFieldLabel__signOutOfOtherSessions'),\n defaultChecked: true,\n });\n\n const { setConfirmPasswordFeedback, isPasswordMatch } = useConfirmPassword({\n passwordField,\n confirmPasswordField: confirmField,\n });\n\n const canSubmit =\n (currentPasswordRequired ? currentPasswordField.value && isPasswordMatch : isPasswordMatch) &&\n passwordField.value &&\n confirmField.value;\n\n const validateForm = () => {\n if (passwordField.value) {\n setConfirmPasswordFeedback(confirmField.value);\n }\n };\n\n const updatePassword = async () => {\n if (!canSubmit) {\n return;\n }\n\n try {\n successPagePropsRef.current = {\n title: user.passwordEnabled\n ? localizationKeys('userProfile.passwordPage.title__update')\n : localizationKeys('userProfile.passwordPage.title__set'),\n text: generateSuccessPageText(user.passwordEnabled, !!sessionsField.checked),\n };\n\n const opts = {\n newPassword: passwordField.value,\n signOutOfOtherSessions: sessionsField.checked,\n currentPassword: currentPasswordRequired ? currentPasswordField.value : undefined,\n } satisfies Parameters<typeof user.updatePassword>[0];\n\n await updatePasswordWithReverification(user, [opts]);\n onSuccess();\n } catch (e: any) {\n handleError(e, [currentPasswordField, passwordField, confirmField], card.setError);\n }\n };\n\n return (\n <FormContainer headerTitle={title}>\n {passwordEditDisabled && <InformationBox message={localizationKeys('userProfile.passwordPage.readonly')} />}\n\n <Form.Root\n onSubmit={updatePassword}\n onBlur={validateForm}\n >\n {/* For password managers */}\n <input\n readOnly\n data-testid='hidden-identifier'\n id='identifier-field'\n name='identifier'\n value={session?.publicUserData.identifier || ''}\n style={{ display: 'none' }}\n />\n {currentPasswordRequired && (\n <Form.ControlRow elementId={currentPasswordField.id}>\n <Form.PasswordInput\n {...currentPasswordField.props}\n minLength={6}\n isRequired\n autoFocus\n isDisabled={passwordEditDisabled}\n />\n </Form.ControlRow>\n )}\n <Form.ControlRow elementId={passwordField.id}>\n <Form.PasswordInput\n {...passwordField.props}\n minLength={6}\n isRequired\n autoFocus={!user.passwordEnabled}\n isDisabled={passwordEditDisabled}\n />\n </Form.ControlRow>\n <Form.ControlRow elementId={confirmField.id}>\n <Form.PasswordInput\n {...confirmField.props}\n onChange={e => {\n if (e.target.value) {\n setConfirmPasswordFeedback(e.target.value);\n }\n return confirmField.props.onChange(e);\n }}\n isRequired\n isDisabled={passwordEditDisabled}\n />\n </Form.ControlRow>\n <Form.ControlRow elementId={sessionsField.id}>\n <Form.Checkbox\n {...sessionsField.props}\n description={localizationKeys('userProfile.passwordPage.checkboxInfoText__signOutOfOtherSessions')}\n isDisabled={passwordEditDisabled}\n />\n </Form.ControlRow>\n {passwordEditDisabled ? (\n <FormButtonContainer>\n <Form.ResetButton\n localizationKey={localizationKeys('userProfile.formButtonReset')}\n block={false}\n onClick={onReset}\n />\n </FormButtonContainer>\n ) : (\n <FormButtons\n isDisabled={!canSubmit}\n onReset={onReset}\n />\n )}\n </Form.Root>\n </FormContainer>\n );\n});\n"],"mappings":"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"}
@@ -4,8 +4,8 @@ import { useActionContext } from "../../elements/Action/ActionRoot.js";
4
4
  import { Action } from "../../elements/Action/index.js";
5
5
  import { ProfileSection } from "../../elements/Section.js";
6
6
  import { PasswordForm } from "./PasswordForm.js";
7
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
8
7
  import { useUser } from "@clerk/shared/react";
8
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
9
9
 
10
10
  //#region src/components/UserProfile/PasswordSection.tsx
11
11
  const PasswordScreen = () => {
@@ -9,8 +9,8 @@ import { FormContainer } from "../../elements/FormContainer.js";
9
9
  import { Wizard, useWizard } from "../../common/Wizard.js";
10
10
  import { VerifyWithCode } from "./VerifyWithCode.js";
11
11
  import React from "react";
12
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
13
12
  import { useReverification, useUser } from "@clerk/shared/react";
13
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
14
14
 
15
15
  //#region src/components/UserProfile/PhoneForm.tsx
16
16
  const PhoneForm = withCardStateProvider((props) => {
@@ -11,8 +11,8 @@ import { RemovePhoneForm } from "./RemoveResourceForm.js";
11
11
  import { sortIdentificationBasedOnVerification } from "./utils.js";
12
12
  import { PhoneForm } from "./PhoneForm.js";
13
13
  import { Fragment } from "react";
14
- import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
15
14
  import { useReverification, useUser } from "@clerk/shared/react";
15
+ import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
16
16
 
17
17
  //#region src/components/UserProfile/PhoneSection.tsx
18
18
  const RemovePhoneScreen = (props) => {
@@ -10,8 +10,8 @@ import { isDefaultImage } from "../../utils/image.js";
10
10
  import { InformationBox } from "../../elements/InformationBox.js";
11
11
  import { UserProfileAvatarUploader } from "./UserProfileAvatarUploader.js";
12
12
  import React from "react";
13
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
14
13
  import { useUser } from "@clerk/shared/react";
14
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
15
15
 
16
16
  //#region src/components/UserProfile/ProfileForm.tsx
17
17
  const ProfileForm = withCardStateProvider((props) => {
@@ -2,8 +2,8 @@ import { useEnabledThirdPartyProviders } from "../../hooks/useEnabledThirdPartyP
2
2
  import { localizationKeys } from "../../localization/localizationKeys.js";
3
3
  import { RemoveResourceForm } from "../../common/RemoveResourceForm.js";
4
4
  import React from "react";
5
- import { jsx } from "@emotion/react/jsx-runtime";
6
5
  import { useUser } from "@clerk/shared/react";
6
+ import { jsx } from "@emotion/react/jsx-runtime";
7
7
 
8
8
  //#region src/components/UserProfile/RemoveResourceForm.tsx
9
9
  const RemoveEmailForm = (props) => {
@@ -12,8 +12,8 @@ import { DeleteSection } from "./DeleteSection.js";
12
12
  import { MfaSection } from "./MfaSection.js";
13
13
  import { PasskeySection } from "./PasskeySection.js";
14
14
  import { PasswordSection } from "./PasswordSection.js";
15
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
16
15
  import { useUser } from "@clerk/shared/react";
16
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
17
17
 
18
18
  //#region src/components/UserProfile/SecurityPage.tsx
19
19
  const SecurityPage = withCardStateProvider(() => {
@@ -5,8 +5,8 @@ import { Action } from "../../elements/Action/index.js";
5
5
  import { UserPreview } from "../../elements/UserPreview.js";
6
6
  import { ProfileSection } from "../../elements/Section.js";
7
7
  import { ProfileForm } from "./ProfileForm.js";
8
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
9
8
  import { useUser } from "@clerk/shared/react";
9
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
10
10
 
11
11
  //#region src/components/UserProfile/UserProfileSection.tsx
12
12
  const ProfileScreen = () => {
@@ -8,8 +8,8 @@ import { Form } from "../../elements/Form.js";
8
8
  import { FormButtons } from "../../elements/FormButtons.js";
9
9
  import { FormContainer } from "../../elements/FormContainer.js";
10
10
  import { createUsernameError } from "../../utils/usernameUtils.js";
11
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
12
11
  import { useReverification, useUser } from "@clerk/shared/react";
12
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
13
13
 
14
14
  //#region src/components/UserProfile/UsernameForm.tsx
15
15
  const UsernameForm = withCardStateProvider((props) => {
@@ -5,8 +5,8 @@ import { useActionContext } from "../../elements/Action/ActionRoot.js";
5
5
  import { Action } from "../../elements/Action/index.js";
6
6
  import { ProfileSection } from "../../elements/Section.js";
7
7
  import { UsernameForm } from "./UsernameForm.js";
8
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
9
8
  import { useUser } from "@clerk/shared/react";
9
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
10
10
 
11
11
  //#region src/components/UserProfile/UsernameSection.tsx
12
12
  const UsernameScreen = () => {
@@ -7,8 +7,8 @@ import { Form } from "../../elements/Form.js";
7
7
  import { FormButtonContainer } from "../../elements/FormButtons.js";
8
8
  import { FormContainer } from "../../elements/FormContainer.js";
9
9
  import React from "react";
10
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
11
10
  import { useUser } from "@clerk/shared/react";
11
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
12
12
 
13
13
  //#region src/components/UserProfile/VerifyTOTP.tsx
14
14
  const VerifyTOTP = withCardStateProvider((props) => {
@@ -6,8 +6,8 @@ import { useCardState, withCardStateProvider } from "../../elements/contexts/ind
6
6
  import { Image, Text } from "../../customizables/index.js";
7
7
  import { getFieldError, handleError } from "../../utils/errorHandler.js";
8
8
  import { ProfileSection } from "../../elements/Section.js";
9
- import { Fragment, jsx, jsxs } from "@emotion/react/jsx-runtime";
10
9
  import { useReverification, useUser } from "@clerk/shared/react";
10
+ import { Fragment, jsx, jsxs } from "@emotion/react/jsx-runtime";
11
11
  import { createWeb3 } from "@clerk/shared/internal/clerk-js/web3";
12
12
 
13
13
  //#region src/components/UserProfile/Web3Form.tsx
@@ -12,8 +12,8 @@ import { RemoveWeb3WalletForm } from "./RemoveResourceForm.js";
12
12
  import { sortIdentificationBasedOnVerification } from "./utils.js";
13
13
  import { AddWeb3WalletActionMenu } from "./Web3Form.js";
14
14
  import { Fragment, useState } from "react";
15
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
16
15
  import { useReverification, useUser } from "@clerk/shared/react";
16
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
17
17
 
18
18
  //#region src/components/UserProfile/Web3Section.tsx
19
19
  const RemoveWeb3WalletScreen = (props) => {
@@ -3,8 +3,8 @@ import { handleError } from "../../utils/errorHandler.js";
3
3
  import { VerificationCodeCard } from "../../elements/VerificationCodeCard.js";
4
4
  import { useAfterVerification } from "./use-after-verification.js";
5
5
  import React from "react";
6
- import { jsx } from "@emotion/react/jsx-runtime";
7
6
  import { useSession } from "@clerk/shared/react";
7
+ import { jsx } from "@emotion/react/jsx-runtime";
8
8
 
9
9
  //#region src/components/UserVerification/UVFactorOneCodeForm.tsx
10
10
  const UVFactorOneCodeForm = (props) => {
@@ -8,8 +8,8 @@ import { handleError } from "../../utils/errorHandler.js";
8
8
  import { Form } from "../../elements/Form.js";
9
9
  import { useAfterVerification } from "./use-after-verification.js";
10
10
  import React from "react";
11
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
12
11
  import { useClerk, useSession } from "@clerk/shared/react";
12
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
13
13
 
14
14
  //#region src/components/UserVerification/UVFactorOnePasskeysCard.tsx
15
15
  const UVFactorOnePasskeysCard = (props) => {
@@ -9,8 +9,8 @@ import { handleError } from "../../utils/errorHandler.js";
9
9
  import { Form } from "../../elements/Form.js";
10
10
  import { useAfterVerification } from "./use-after-verification.js";
11
11
  import React from "react";
12
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
13
12
  import { useSession } from "@clerk/shared/react";
13
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
14
14
 
15
15
  //#region src/components/UserVerification/UVFactorTwoBackupCodeCard.tsx
16
16
  const UVFactorTwoBackupCodeCard = (props) => {
@@ -3,8 +3,8 @@ import { handleError } from "../../utils/errorHandler.js";
3
3
  import { VerificationCodeCard } from "../../elements/VerificationCodeCard.js";
4
4
  import { useAfterVerification } from "./use-after-verification.js";
5
5
  import React from "react";
6
- import { jsx } from "@emotion/react/jsx-runtime";
7
6
  import { useSession } from "@clerk/shared/react";
7
+ import { jsx } from "@emotion/react/jsx-runtime";
8
8
 
9
9
  //#region src/components/UserVerification/UVFactorTwoCodeForm.tsx
10
10
  const UVFactorTwoCodeForm = (props) => {
@@ -1,8 +1,8 @@
1
1
  import { localizationKeys } from "../../localization/localizationKeys.js";
2
2
  import { Flow } from "../../customizables/Flow.js";
3
3
  import { UVFactorTwoCodeForm } from "./UVFactorTwoCodeForm.js";
4
- import { jsx } from "@emotion/react/jsx-runtime";
5
4
  import { useSession } from "@clerk/shared/react";
5
+ import { jsx } from "@emotion/react/jsx-runtime";
6
6
 
7
7
  //#region src/components/UserVerification/UVFactorTwoPhoneCodeCard.tsx
8
8
  const UVFactorTwoPhoneCodeCard = (props) => {
@@ -11,8 +11,8 @@ import { Form } from "../../elements/Form.js";
11
11
  import { HavingTrouble } from "../SignIn/HavingTrouble.js";
12
12
  import { useAfterVerification } from "./use-after-verification.js";
13
13
  import React from "react";
14
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
15
14
  import { useSession } from "@clerk/shared/react";
15
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
16
16
 
17
17
  //#region src/components/UserVerification/UserVerificationFactorOnePassword.tsx
18
18
  function UserVerificationFactorOnePasswordCard(props) {
@@ -1,7 +1,7 @@
1
1
  import { useRouter } from "../../router/RouteContext.js";
2
2
  import { withCardStateProvider } from "../../elements/contexts/index.js";
3
3
  import { LoadingCard } from "../../elements/LoadingCard.js";
4
- import { determineStartingSignInSecondFactor } from "../SignIn/utils.js";
4
+ import { useSecondFactorSelection } from "../SignIn/useSecondFactorSelection.js";
5
5
  import { secondFactorsAreEqual } from "./useReverificationAlternativeStrategies.js";
6
6
  import { useUserVerificationSession, withUserVerificationSessionGuard } from "./useUserVerificationSession.js";
7
7
  import { sortByPrimaryFactor } from "./utils.js";
@@ -13,12 +13,6 @@ import React, { useEffect, useMemo } from "react";
13
13
  import { jsx } from "@emotion/react/jsx-runtime";
14
14
 
15
15
  //#region src/components/UserVerification/UserVerificationFactorTwo.tsx
16
- const factorKey = (factor) => {
17
- if (!factor) return "";
18
- let key = factor.strategy;
19
- if ("phoneNumberId" in factor) key += factor.phoneNumberId;
20
- return key;
21
- };
22
16
  const SUPPORTED_STRATEGIES = [
23
17
  "phone_code",
24
18
  "totp",
@@ -31,18 +25,8 @@ function UserVerificationFactorTwoComponent() {
31
25
  const availableFactors = useMemo(() => {
32
26
  return sessionVerification.supportedSecondFactors?.filter((factor) => SUPPORTED_STRATEGIES.includes(factor.strategy))?.sort(sortByPrimaryFactor) || null;
33
27
  }, [sessionVerification.supportedSecondFactors]);
34
- const lastPreparedFactorKeyRef = React.useRef("");
35
- const [currentFactor, setCurrentFactor] = React.useState(() => determineStartingSignInSecondFactor(availableFactors));
36
- const [showAllStrategies, setShowAllStrategies] = React.useState(!currentFactor);
37
- const toggleAllStrategies = () => setShowAllStrategies((s) => !s);
28
+ const { currentFactor, factorAlreadyPrepared, handleFactorPrepare, selectFactor, showAllStrategies, toggleAllStrategies } = useSecondFactorSelection(availableFactors);
38
29
  const secondFactorsExcludingCurrent = useMemo(() => availableFactors?.filter((factor) => !secondFactorsAreEqual(factor, currentFactor)), [availableFactors, currentFactor]);
39
- const handleFactorPrepare = () => {
40
- lastPreparedFactorKeyRef.current = factorKey(currentFactor);
41
- };
42
- const selectFactor = (factor) => {
43
- setCurrentFactor(factor);
44
- toggleAllStrategies();
45
- };
46
30
  const hasAlternativeStrategies = useMemo(() => secondFactorsExcludingCurrent && secondFactorsExcludingCurrent.length > 0 || false, [secondFactorsExcludingCurrent]);
47
31
  useEffect(() => {
48
32
  if (sessionVerification.status === "needs_first_factor") navigate("../");
@@ -55,14 +39,14 @@ function UserVerificationFactorTwoComponent() {
55
39
  });
56
40
  switch (currentFactor?.strategy) {
57
41
  case "phone_code": return /* @__PURE__ */ jsx(UVFactorTwoPhoneCodeCard, {
58
- factorAlreadyPrepared: lastPreparedFactorKeyRef.current === factorKey(currentFactor),
42
+ factorAlreadyPrepared,
59
43
  onFactorPrepare: handleFactorPrepare,
60
44
  factor: currentFactor,
61
45
  onShowAlternativeMethodsClicked: toggleAllStrategies,
62
46
  showAlternativeMethods: hasAlternativeStrategies
63
47
  });
64
48
  case "totp": return /* @__PURE__ */ jsx(UserVerificationFactorTwoTOTP, {
65
- factorAlreadyPrepared: lastPreparedFactorKeyRef.current === factorKey(currentFactor),
49
+ factorAlreadyPrepared,
66
50
  onFactorPrepare: handleFactorPrepare,
67
51
  factor: currentFactor,
68
52
  onShowAlternativeMethodsClicked: toggleAllStrategies,
@@ -1 +1 @@
1
- {"version":3,"file":"UserVerificationFactorTwo.js","names":["SUPPORTED_STRATEGIES: SessionVerificationSecondFactor['strategy'][]"],"sources":["../../../src/components/UserVerification/UserVerificationFactorTwo.tsx"],"sourcesContent":["import type { SessionVerificationResource, SessionVerificationSecondFactor, SignInFactor } from '@clerk/shared/types';\nimport React, { useEffect, useMemo } from 'react';\n\nimport { withCardStateProvider } from '@/ui/elements/contexts';\nimport { LoadingCard } from '@/ui/elements/LoadingCard';\n\nimport { useRouter } from '../../router';\nimport { determineStartingSignInSecondFactor } from '../SignIn/utils';\nimport { secondFactorsAreEqual } from './useReverificationAlternativeStrategies';\nimport { UserVerificationFactorTwoTOTP } from './UserVerificationFactorTwoTOTP';\nimport { useUserVerificationSession, withUserVerificationSessionGuard } from './useUserVerificationSession';\nimport { sortByPrimaryFactor } from './utils';\nimport { UVFactorTwoAlternativeMethods } from './UVFactorTwoAlternativeMethods';\nimport { UVFactorTwoBackupCodeCard } from './UVFactorTwoBackupCodeCard';\nimport { UVFactorTwoPhoneCodeCard } from './UVFactorTwoPhoneCodeCard';\n\nconst factorKey = (factor: SignInFactor | null | undefined) => {\n if (!factor) {\n return '';\n }\n let key = factor.strategy;\n if ('phoneNumberId' in factor) {\n key += factor.phoneNumberId;\n }\n return key;\n};\n\nconst SUPPORTED_STRATEGIES: SessionVerificationSecondFactor['strategy'][] = [\n 'phone_code',\n 'totp',\n 'backup_code',\n] as const;\n\nexport function UserVerificationFactorTwoComponent(): JSX.Element {\n const { navigate } = useRouter();\n const { data } = useUserVerificationSession();\n const sessionVerification = data as SessionVerificationResource;\n\n const availableFactors = useMemo(() => {\n return (\n sessionVerification.supportedSecondFactors\n ?.filter(factor => SUPPORTED_STRATEGIES.includes(factor.strategy))\n ?.sort(sortByPrimaryFactor) || null\n );\n }, [sessionVerification.supportedSecondFactors]);\n\n const lastPreparedFactorKeyRef = React.useRef('');\n const [currentFactor, setCurrentFactor] = React.useState<SessionVerificationSecondFactor | null>(\n () => determineStartingSignInSecondFactor(availableFactors) as SessionVerificationSecondFactor,\n );\n const [showAllStrategies, setShowAllStrategies] = React.useState<boolean>(!currentFactor);\n const toggleAllStrategies = () => setShowAllStrategies(s => !s);\n\n const secondFactorsExcludingCurrent = useMemo(\n () => availableFactors?.filter(factor => !secondFactorsAreEqual(factor, currentFactor)),\n [availableFactors, currentFactor],\n );\n\n const handleFactorPrepare = () => {\n lastPreparedFactorKeyRef.current = factorKey(currentFactor);\n };\n\n const selectFactor = (factor: SessionVerificationSecondFactor) => {\n setCurrentFactor(factor);\n toggleAllStrategies();\n };\n\n const hasAlternativeStrategies = useMemo(\n () => (secondFactorsExcludingCurrent && secondFactorsExcludingCurrent.length > 0) || false,\n [secondFactorsExcludingCurrent],\n );\n\n useEffect(() => {\n if (sessionVerification.status === 'needs_first_factor') {\n void navigate('../');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (!currentFactor) {\n return <LoadingCard />;\n }\n\n if (showAllStrategies && hasAlternativeStrategies) {\n return (\n <UVFactorTwoAlternativeMethods\n supportedSecondFactors={secondFactorsExcludingCurrent || null}\n onBackLinkClick={toggleAllStrategies}\n onFactorSelected={selectFactor}\n />\n );\n }\n\n switch (currentFactor?.strategy) {\n case 'phone_code':\n return (\n <UVFactorTwoPhoneCodeCard\n factorAlreadyPrepared={lastPreparedFactorKeyRef.current === factorKey(currentFactor)}\n onFactorPrepare={handleFactorPrepare}\n factor={currentFactor}\n onShowAlternativeMethodsClicked={toggleAllStrategies}\n showAlternativeMethods={hasAlternativeStrategies}\n />\n );\n case 'totp':\n return (\n <UserVerificationFactorTwoTOTP\n factorAlreadyPrepared={lastPreparedFactorKeyRef.current === factorKey(currentFactor)}\n onFactorPrepare={handleFactorPrepare}\n factor={currentFactor}\n onShowAlternativeMethodsClicked={toggleAllStrategies}\n showAlternativeMethods={hasAlternativeStrategies}\n />\n );\n case 'backup_code':\n return <UVFactorTwoBackupCodeCard onShowAlternativeMethodsClicked={toggleAllStrategies} />;\n default:\n return <LoadingCard />;\n }\n}\n\nexport const UserVerificationFactorTwo = withUserVerificationSessionGuard(\n withCardStateProvider(UserVerificationFactorTwoComponent),\n);\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,aAAa,WAA4C;AAC7D,KAAI,CAAC,OACH,QAAO;CAET,IAAI,MAAM,OAAO;AACjB,KAAI,mBAAmB,OACrB,QAAO,OAAO;AAEhB,QAAO;;AAGT,MAAMA,uBAAsE;CAC1E;CACA;CACA;CACD;AAED,SAAgB,qCAAkD;CAChE,MAAM,EAAE,aAAa,WAAW;CAChC,MAAM,EAAE,SAAS,4BAA4B;CAC7C,MAAM,sBAAsB;CAE5B,MAAM,mBAAmB,cAAc;AACrC,SACE,oBAAoB,wBAChB,QAAO,WAAU,qBAAqB,SAAS,OAAO,SAAS,CAAC,EAChE,KAAK,oBAAoB,IAAI;IAElC,CAAC,oBAAoB,uBAAuB,CAAC;CAEhD,MAAM,2BAA2B,MAAM,OAAO,GAAG;CACjD,MAAM,CAAC,eAAe,oBAAoB,MAAM,eACxC,oCAAoC,iBAAiB,CAC5D;CACD,MAAM,CAAC,mBAAmB,wBAAwB,MAAM,SAAkB,CAAC,cAAc;CACzF,MAAM,4BAA4B,sBAAqB,MAAK,CAAC,EAAE;CAE/D,MAAM,gCAAgC,cAC9B,kBAAkB,QAAO,WAAU,CAAC,sBAAsB,QAAQ,cAAc,CAAC,EACvF,CAAC,kBAAkB,cAAc,CAClC;CAED,MAAM,4BAA4B;AAChC,2BAAyB,UAAU,UAAU,cAAc;;CAG7D,MAAM,gBAAgB,WAA4C;AAChE,mBAAiB,OAAO;AACxB,uBAAqB;;CAGvB,MAAM,2BAA2B,cACxB,iCAAiC,8BAA8B,SAAS,KAAM,OACrF,CAAC,8BAA8B,CAChC;AAED,iBAAgB;AACd,MAAI,oBAAoB,WAAW,qBACjC,CAAK,SAAS,MAAM;IAGrB,EAAE,CAAC;AAEN,KAAI,CAAC,cACH,QAAO,oBAAC,gBAAc;AAGxB,KAAI,qBAAqB,yBACvB,QACE,oBAAC;EACC,wBAAwB,iCAAiC;EACzD,iBAAiB;EACjB,kBAAkB;GAClB;AAIN,SAAQ,eAAe,UAAvB;EACE,KAAK,aACH,QACE,oBAAC;GACC,uBAAuB,yBAAyB,YAAY,UAAU,cAAc;GACpF,iBAAiB;GACjB,QAAQ;GACR,iCAAiC;GACjC,wBAAwB;IACxB;EAEN,KAAK,OACH,QACE,oBAAC;GACC,uBAAuB,yBAAyB,YAAY,UAAU,cAAc;GACpF,iBAAiB;GACjB,QAAQ;GACR,iCAAiC;GACjC,wBAAwB;IACxB;EAEN,KAAK,cACH,QAAO,oBAAC,6BAA0B,iCAAiC,sBAAuB;EAC5F,QACE,QAAO,oBAAC,gBAAc;;;AAI5B,MAAa,4BAA4B,iCACvC,sBAAsB,mCAAmC,CAC1D"}
1
+ {"version":3,"file":"UserVerificationFactorTwo.js","names":["SUPPORTED_STRATEGIES: SessionVerificationSecondFactor['strategy'][]"],"sources":["../../../src/components/UserVerification/UserVerificationFactorTwo.tsx"],"sourcesContent":["import type { SessionVerificationResource, SessionVerificationSecondFactor } from '@clerk/shared/types';\nimport React, { useEffect, useMemo } from 'react';\n\nimport { withCardStateProvider } from '@/ui/elements/contexts';\nimport { LoadingCard } from '@/ui/elements/LoadingCard';\n\nimport { useRouter } from '../../router';\nimport { useSecondFactorSelection } from '../SignIn/useSecondFactorSelection';\nimport { secondFactorsAreEqual } from './useReverificationAlternativeStrategies';\nimport { UserVerificationFactorTwoTOTP } from './UserVerificationFactorTwoTOTP';\nimport { useUserVerificationSession, withUserVerificationSessionGuard } from './useUserVerificationSession';\nimport { sortByPrimaryFactor } from './utils';\nimport { UVFactorTwoAlternativeMethods } from './UVFactorTwoAlternativeMethods';\nimport { UVFactorTwoBackupCodeCard } from './UVFactorTwoBackupCodeCard';\nimport { UVFactorTwoPhoneCodeCard } from './UVFactorTwoPhoneCodeCard';\n\nconst SUPPORTED_STRATEGIES: SessionVerificationSecondFactor['strategy'][] = [\n 'phone_code',\n 'totp',\n 'backup_code',\n] as const;\n\nexport function UserVerificationFactorTwoComponent(): JSX.Element {\n const { navigate } = useRouter();\n const { data } = useUserVerificationSession();\n const sessionVerification = data as SessionVerificationResource;\n\n const availableFactors = useMemo(() => {\n return (\n sessionVerification.supportedSecondFactors\n ?.filter(factor => SUPPORTED_STRATEGIES.includes(factor.strategy))\n ?.sort(sortByPrimaryFactor) || null\n );\n }, [sessionVerification.supportedSecondFactors]);\n\n const {\n currentFactor,\n factorAlreadyPrepared,\n handleFactorPrepare,\n selectFactor,\n showAllStrategies,\n toggleAllStrategies,\n } = useSecondFactorSelection<SessionVerificationSecondFactor>(availableFactors);\n\n const secondFactorsExcludingCurrent = useMemo(\n () => availableFactors?.filter(factor => !secondFactorsAreEqual(factor, currentFactor)),\n [availableFactors, currentFactor],\n );\n\n const hasAlternativeStrategies = useMemo(\n () => (secondFactorsExcludingCurrent && secondFactorsExcludingCurrent.length > 0) || false,\n [secondFactorsExcludingCurrent],\n );\n\n useEffect(() => {\n if (sessionVerification.status === 'needs_first_factor') {\n void navigate('../');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (!currentFactor) {\n return <LoadingCard />;\n }\n\n if (showAllStrategies && hasAlternativeStrategies) {\n return (\n <UVFactorTwoAlternativeMethods\n supportedSecondFactors={secondFactorsExcludingCurrent || null}\n onBackLinkClick={toggleAllStrategies}\n onFactorSelected={selectFactor}\n />\n );\n }\n\n switch (currentFactor?.strategy) {\n case 'phone_code':\n return (\n <UVFactorTwoPhoneCodeCard\n factorAlreadyPrepared={factorAlreadyPrepared}\n onFactorPrepare={handleFactorPrepare}\n factor={currentFactor}\n onShowAlternativeMethodsClicked={toggleAllStrategies}\n showAlternativeMethods={hasAlternativeStrategies}\n />\n );\n case 'totp':\n return (\n <UserVerificationFactorTwoTOTP\n factorAlreadyPrepared={factorAlreadyPrepared}\n onFactorPrepare={handleFactorPrepare}\n factor={currentFactor}\n onShowAlternativeMethodsClicked={toggleAllStrategies}\n showAlternativeMethods={hasAlternativeStrategies}\n />\n );\n case 'backup_code':\n return <UVFactorTwoBackupCodeCard onShowAlternativeMethodsClicked={toggleAllStrategies} />;\n default:\n return <LoadingCard />;\n }\n}\n\nexport const UserVerificationFactorTwo = withUserVerificationSessionGuard(\n withCardStateProvider(UserVerificationFactorTwoComponent),\n);\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAMA,uBAAsE;CAC1E;CACA;CACA;CACD;AAED,SAAgB,qCAAkD;CAChE,MAAM,EAAE,aAAa,WAAW;CAChC,MAAM,EAAE,SAAS,4BAA4B;CAC7C,MAAM,sBAAsB;CAE5B,MAAM,mBAAmB,cAAc;AACrC,SACE,oBAAoB,wBAChB,QAAO,WAAU,qBAAqB,SAAS,OAAO,SAAS,CAAC,EAChE,KAAK,oBAAoB,IAAI;IAElC,CAAC,oBAAoB,uBAAuB,CAAC;CAEhD,MAAM,EACJ,eACA,uBACA,qBACA,cACA,mBACA,wBACE,yBAA0D,iBAAiB;CAE/E,MAAM,gCAAgC,cAC9B,kBAAkB,QAAO,WAAU,CAAC,sBAAsB,QAAQ,cAAc,CAAC,EACvF,CAAC,kBAAkB,cAAc,CAClC;CAED,MAAM,2BAA2B,cACxB,iCAAiC,8BAA8B,SAAS,KAAM,OACrF,CAAC,8BAA8B,CAChC;AAED,iBAAgB;AACd,MAAI,oBAAoB,WAAW,qBACjC,CAAK,SAAS,MAAM;IAGrB,EAAE,CAAC;AAEN,KAAI,CAAC,cACH,QAAO,oBAAC,gBAAc;AAGxB,KAAI,qBAAqB,yBACvB,QACE,oBAAC;EACC,wBAAwB,iCAAiC;EACzD,iBAAiB;EACjB,kBAAkB;GAClB;AAIN,SAAQ,eAAe,UAAvB;EACE,KAAK,aACH,QACE,oBAAC;GACwB;GACvB,iBAAiB;GACjB,QAAQ;GACR,iCAAiC;GACjC,wBAAwB;IACxB;EAEN,KAAK,OACH,QACE,oBAAC;GACwB;GACvB,iBAAiB;GACjB,QAAQ;GACR,iCAAiC;GACjC,wBAAwB;IACxB;EAEN,KAAK,cACH,QAAO,oBAAC,6BAA0B,iCAAiC,sBAAuB;EAC5F,QACE,QAAO,oBAAC,gBAAc;;;AAI5B,MAAa,4BAA4B,iCACvC,sBAAsB,mCAAmC,CAC1D"}
@@ -2,8 +2,8 @@ import { useFetch } from "../../hooks/useFetch.js";
2
2
  import { useUserVerification } from "../../contexts/components/UserVerification.js";
3
3
  import { LoadingCard } from "../../elements/LoadingCard.js";
4
4
  import { useMemo } from "react";
5
- import { jsx } from "@emotion/react/jsx-runtime";
6
5
  import { useSession } from "@clerk/shared/react";
6
+ import { jsx } from "@emotion/react/jsx-runtime";
7
7
 
8
8
  //#region src/components/UserVerification/useUserVerificationSession.tsx
9
9
  const useUserVerificationSessionKey = () => {
@@ -12,8 +12,8 @@ import { Header } from "../../elements/Header.js";
12
12
  import { handleError } from "../../utils/errorHandler.js";
13
13
  import { Form } from "../../elements/Form.js";
14
14
  import { Wizard, useWizard } from "../../common/Wizard.js";
15
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
16
15
  import { useClerk } from "@clerk/shared/react";
16
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
17
17
 
18
18
  //#region src/components/Waitlist/WaitlistForm.tsx
19
19
  const WaitlistForm = (props) => {
@@ -7,8 +7,8 @@ import { withCardStateProvider } from "../../elements/contexts/index.js";
7
7
  import { Flow } from "../../customizables/Flow.js";
8
8
  import { Card } from "../../elements/Card/index.js";
9
9
  import { WaitlistForm } from "./WaitlistForm.js";
10
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
11
10
  import { useClerk } from "@clerk/shared/react";
11
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
12
12
 
13
13
  //#region src/components/Waitlist/index.tsx
14
14
  const _Waitlist = () => {
@@ -6,8 +6,8 @@ import { Modal } from "../../../elements/Modal.js";
6
6
  import { Portal } from "../../../elements/Portal.js";
7
7
  import { ClerkLogoIcon, PromptContainer, PromptSuccessIcon, basePromptElementStyles } from "../shared.js";
8
8
  import { forwardRef, useId, useLayoutEffect, useRef, useState } from "react";
9
- import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
10
9
  import { useClerk } from "@clerk/shared/react";
10
+ import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
11
11
  import { css } from "@emotion/react";
12
12
 
13
13
  //#region src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
@@ -5,8 +5,8 @@ import { ClerkLogoIcon, PromptContainer, PromptSuccessIcon, basePromptElementSty
5
5
  import { KeySlashIcon } from "./KeySlashIcon.js";
6
6
  import { useRevalidateEnvironment } from "./use-revalidate-environment.js";
7
7
  import { useEffect, useMemo, useState } from "react";
8
- import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
9
8
  import { useUser } from "@clerk/shared/react";
9
+ import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
10
10
  import { css } from "@emotion/react";
11
11
  import { createPortal } from "react-dom";
12
12
 
@@ -1,7 +1,7 @@
1
1
  import { assertClerkSingletonExists } from "./utils.js";
2
2
  import React from "react";
3
- import { jsx } from "@emotion/react/jsx-runtime";
4
3
  import { ClerkInstanceContext, ClientContext, OrganizationProvider, SessionContext, UserContext, __experimental_CheckoutProvider } from "@clerk/shared/react";
4
+ import { jsx } from "@emotion/react/jsx-runtime";
5
5
 
6
6
  //#region src/contexts/CoreClerkContextWrapper.tsx
7
7
  function CoreClerkContextWrapper(props) {
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { jsx } from "@emotion/react/jsx-runtime";
3
2
  import { useSessionContext } from "@clerk/shared/react";
3
+ import { jsx } from "@emotion/react/jsx-runtime";
4
4
 
5
5
  //#region src/contexts/CoreSessionContext.tsx
6
6
  function withCoreSessionSwitchGuard(Component) {
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { jsx } from "@emotion/react/jsx-runtime";
3
2
  import { useUserContext } from "@clerk/shared/react";
3
+ import { jsx } from "@emotion/react/jsx-runtime";
4
4
 
5
5
  //#region src/contexts/CoreUserContext.tsx
6
6
  function withCoreUserGuard(Component) {
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["243"],{9302:function(e,t,a){a.d(t,{A:()=>P});var r=a(4518),i=a(8909),n=a(5074),o=a(7697),l=a(3269),s=a(2454),d=a(1475),c=a(3549),u=a(6153),g=a(155),h=a(6370),p=a(5485),m=a(4468),f=a(8640),z=a(6245),v=a(8272),b=a(7068),C=a(2861),Y=a(3934),$=a(3100),x=a(5377),O=a(3689);let P=(0,l.dm)(e=>{let t=(0,l.f0)(),a=(0,z.X)({onNextStep:()=>t.setError(void 0)}),P=n.useRef(null),{createOrganization:S,isLoaded:w,setActive:k,userMemberships:A}=(0,i.D_)({userMemberships:O.mu.userMemberships}),{organization:R}=(0,i.Z5)(),{organizationSettings:F}=(0,o.O)(),[T,_]=n.useState(),y=(0,f.tJ)("name","",{type:"text",label:(0,C.G)("formFieldLabel__organizationName"),placeholder:(0,C.G)("formFieldInputPlaceholder__organizationName")}),I=(0,f.tJ)("slug","",{type:"text",label:(0,C.G)("formFieldLabel__organizationSlug"),placeholder:(0,C.G)("formFieldInputPlaceholder__organizationSlug")}),D=!!y.value,G=!F.slug.disabled,M=async r=>{if((r.preventDefault(),D)&&w)try{let t={name:y.value};G&&(t.slug=I.value);let r=await S(t);if(T&&await r.setLogo({file:T}),P.current=r,await k({organization:r}),A.revalidate?.(),e.skipInvitationScreen??1===r.maxAllowedMemberships)return B();a.nextStep()}catch(e){(0,m.H4)(e,[y,I],t.setError)}},B=()=>{e.navigateAfterCreateOrganization?.(P.current),e.onComplete?.()},U=e=>{I.setValue(e)},V="organizationList"===e.flow?"subtitle":void 0;return(0,r.FD)(z.s,{...a.props,children:[(0,r.Y)(c.M,{headerTitle:e?.startPage?.headerTitle,headerSubtitle:e?.startPage?.headerSubtitle,headerTitleTextVariant:"h2",headerSubtitleTextVariant:V,sx:e=>({minHeight:e.sizes.$60,gap:e.space.$6,textAlign:"left"}),children:(0,r.FD)(s.l.Root,{onSubmit:M,sx:e=>({gap:e.space.$6}),children:[(0,r.Y)(v.fv,{children:(0,r.Y)(x.i,{organization:{name:y.value},onAvatarChange:async e=>await _(e),onAvatarRemove:T?()=>(t.setIdle(),_(null)):null,avatarPreviewPlaceholder:(0,r.Y)(g.K,{variant:"ghost","aria-label":"Upload organization logo",icon:(0,r.Y)(v.In,{size:"md",icon:b.A,sx:e=>({color:e.colors.$colorMutedForeground,transitionDuration:e.transitionDuration.$controls})}),sx:e=>({width:e.sizes.$16,height:e.sizes.$16,borderRadius:e.radii.$md,borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$dashed,borderColor:e.colors.$borderAlpha200,backgroundColor:e.colors.$neutralAlpha50,":hover":{backgroundColor:e.colors.$neutralAlpha50,svg:{transform:"scale(1.2)"}}})})})}),(0,r.Y)(s.l.ControlRow,{elementId:y.id,children:(0,r.Y)(s.l.PlainInput,{...y.props,onChange:e=>{y.setValue(e.target.value),U((0,p.e)(e.target.value))},isRequired:!0,autoFocus:!0,ignorePasswordManager:!0})}),G&&(0,r.Y)(s.l.ControlRow,{elementId:I.id,children:(0,r.Y)(s.l.PlainInput,{...I.props,onChange:e=>{U(e.target.value)},isRequired:!0,pattern:"^(?=.*[a-z0-9])[a-z0-9\\-]+$",ignorePasswordManager:!0})}),(0,r.FD)(d.c,{sx:e=>({marginTop:e.space.$none}),children:[(0,r.Y)(s.l.SubmitButton,{block:!1,isDisabled:!D,localizationKey:(0,C.G)("createOrganization.formButtonSubmit")}),e.onCancel&&(0,r.Y)(s.l.ResetButton,{localizationKey:(0,C.G)("userProfile.formButtonReset"),block:!1,onClick:e.onCancel})]})]})}),(0,r.Y)(c.M,{headerTitle:(0,C.G)("organizationProfile.invitePage.title"),headerTitleTextVariant:"h2",headerSubtitleTextVariant:V,sx:e=>({minHeight:e.sizes.$60,textAlign:"left"}),children:R&&(0,r.Y)(Y.B,{resetButtonLabel:(0,C.G)("createOrganization.invitePage.formButtonReset"),onSuccess:a.nextStep,onReset:B})}),(0,r.FD)(v.fv,{children:[(0,r.Y)(u.Y.Root,{children:(0,r.Y)(u.Y.Title,{localizationKey:(0,C.G)("organizationProfile.invitePage.title"),sx:{textAlign:"left"}})}),(0,r.Y)(h.B,{contents:(0,r.Y)($.k,{}),sx:e=>({minHeight:e.sizes.$60}),onFinish:B})]})]})})},4472:function(e,t,a){a.r(t),a.d(t,{CreateOrganization:()=>z,CreateOrganizationModal:()=>v});var r=a(4518),i=a(3269),n=a(3264),o=a(1),l=a(4607),s=a(7831),d=a(2265),c=a(8909),u=a(6088),g=a(2861),h=a(180),p=a(9302);let m=(0,i.dm)(()=>{let{closeCreateOrganization:e}=(0,c.ho)(),{mode:t,navigateAfterCreateOrganization:a,skipInvitationScreen:n}=(0,o.W)(),l=(0,i.f0)(),{showDevModeNotice:s}=(0,h.Q)();return(0,r.FD)(u.Z.Root,{sx:e=>({width:e.sizes.$108}),children:[(0,r.FD)(u.Z.Content,{sx:e=>({padding:`${e.space.$4} ${e.space.$5} ${s?e.space.$12:e.space.$6}`}),children:[(0,r.Y)(u.Z.Alert,{children:l.error}),(0,r.Y)(p.A,{skipInvitationScreen:n,startPage:{headerTitle:(0,g.G)("createOrganization.title")},navigateAfterCreateOrganization:a,flow:"default",onComplete:()=>{"modal"===t&&e()}})]}),(0,r.Y)(u.Z.Footer,{})]})}),f=(0,n.G)(()=>(0,r.Y)(m,{})),z=(0,i.dm)(()=>(0,r.Y)(l.n.Root,{flow:"createOrganization",children:(0,r.Y)(l.n.Part,{children:(0,r.Y)(s.d,{children:(0,r.Y)(d.q,{children:(0,r.Y)(f,{})})})})})),v=e=>{let t={...e,routing:"virtual",componentName:"CreateOrganization",mode:"modal"};return(0,r.Y)(d.q,{path:"createOrganization",children:(0,r.Y)(o.$.Provider,{value:t,children:(0,r.Y)("div",{children:(0,r.Y)(z,{})})})})}},1:function(e,t,a){a.d(t,{$:()=>l,W:()=>s});var r=a(5074),i=a(7697),n=a(4964),o=a(2117);let l=(0,r.createContext)(null),s=()=>{let e=(0,r.useContext)(l),{navigate:t}=(0,n.r)(),{displayConfig:a}=(0,i.O)();if(!e||"CreateOrganization"!==e.componentName)throw Error("Clerk: useCreateOrganizationContext called outside CreateOrganization.");let{componentName:s,...d}=e;return{...d,skipInvitationScreen:d.skipInvitationScreen||!1,navigateAfterCreateOrganization:e=>"function"==typeof d.afterCreateOrganizationUrl?t(d.afterCreateOrganizationUrl(e)):d.afterCreateOrganizationUrl?t((0,o.tR)({urlWithParam:d.afterCreateOrganizationUrl,entity:e})):t(a.afterCreateOrganizationUrl),componentName:s}}}}]);
1
+ "use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["243"],{9302:function(e,t,a){a.d(t,{A:()=>P});var r=a(4518),i=a(9361),n=a(5074),o=a(7697),l=a(3269),s=a(2454),d=a(1475),c=a(3549),u=a(6153),g=a(155),h=a(6370),p=a(5485),m=a(4468),f=a(8640),z=a(6245),v=a(8272),b=a(7068),C=a(2861),Y=a(3934),$=a(3100),x=a(5377),O=a(3689);let P=(0,l.dm)(e=>{let t=(0,l.f0)(),a=(0,z.X)({onNextStep:()=>t.setError(void 0)}),P=n.useRef(null),{createOrganization:S,isLoaded:w,setActive:k,userMemberships:A}=(0,i.D_)({userMemberships:O.mu.userMemberships}),{organization:R}=(0,i.Z5)(),{organizationSettings:F}=(0,o.O)(),[T,_]=n.useState(),y=(0,f.tJ)("name","",{type:"text",label:(0,C.G)("formFieldLabel__organizationName"),placeholder:(0,C.G)("formFieldInputPlaceholder__organizationName")}),I=(0,f.tJ)("slug","",{type:"text",label:(0,C.G)("formFieldLabel__organizationSlug"),placeholder:(0,C.G)("formFieldInputPlaceholder__organizationSlug")}),D=!!y.value,G=!F.slug.disabled,M=async r=>{if((r.preventDefault(),D)&&w)try{let t={name:y.value};G&&(t.slug=I.value);let r=await S(t);if(T&&await r.setLogo({file:T}),P.current=r,await k({organization:r}),A.revalidate?.(),e.skipInvitationScreen??1===r.maxAllowedMemberships)return B();a.nextStep()}catch(e){(0,m.H4)(e,[y,I],t.setError)}},B=()=>{e.navigateAfterCreateOrganization?.(P.current),e.onComplete?.()},U=e=>{I.setValue(e)},V="organizationList"===e.flow?"subtitle":void 0;return(0,r.FD)(z.s,{...a.props,children:[(0,r.Y)(c.M,{headerTitle:e?.startPage?.headerTitle,headerSubtitle:e?.startPage?.headerSubtitle,headerTitleTextVariant:"h2",headerSubtitleTextVariant:V,sx:e=>({minHeight:e.sizes.$60,gap:e.space.$6,textAlign:"left"}),children:(0,r.FD)(s.l.Root,{onSubmit:M,sx:e=>({gap:e.space.$6}),children:[(0,r.Y)(v.fv,{children:(0,r.Y)(x.i,{organization:{name:y.value},onAvatarChange:async e=>await _(e),onAvatarRemove:T?()=>(t.setIdle(),_(null)):null,avatarPreviewPlaceholder:(0,r.Y)(g.K,{variant:"ghost","aria-label":"Upload organization logo",icon:(0,r.Y)(v.In,{size:"md",icon:b.A,sx:e=>({color:e.colors.$colorMutedForeground,transitionDuration:e.transitionDuration.$controls})}),sx:e=>({width:e.sizes.$16,height:e.sizes.$16,borderRadius:e.radii.$md,borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$dashed,borderColor:e.colors.$borderAlpha200,backgroundColor:e.colors.$neutralAlpha50,":hover":{backgroundColor:e.colors.$neutralAlpha50,svg:{transform:"scale(1.2)"}}})})})}),(0,r.Y)(s.l.ControlRow,{elementId:y.id,children:(0,r.Y)(s.l.PlainInput,{...y.props,onChange:e=>{y.setValue(e.target.value),U((0,p.e)(e.target.value))},isRequired:!0,autoFocus:!0,ignorePasswordManager:!0})}),G&&(0,r.Y)(s.l.ControlRow,{elementId:I.id,children:(0,r.Y)(s.l.PlainInput,{...I.props,onChange:e=>{U(e.target.value)},isRequired:!0,pattern:"^(?=.*[a-z0-9])[a-z0-9\\-]+$",ignorePasswordManager:!0})}),(0,r.FD)(d.c,{sx:e=>({marginTop:e.space.$none}),children:[(0,r.Y)(s.l.SubmitButton,{block:!1,isDisabled:!D,localizationKey:(0,C.G)("createOrganization.formButtonSubmit")}),e.onCancel&&(0,r.Y)(s.l.ResetButton,{localizationKey:(0,C.G)("userProfile.formButtonReset"),block:!1,onClick:e.onCancel})]})]})}),(0,r.Y)(c.M,{headerTitle:(0,C.G)("organizationProfile.invitePage.title"),headerTitleTextVariant:"h2",headerSubtitleTextVariant:V,sx:e=>({minHeight:e.sizes.$60,textAlign:"left"}),children:R&&(0,r.Y)(Y.B,{resetButtonLabel:(0,C.G)("createOrganization.invitePage.formButtonReset"),onSuccess:a.nextStep,onReset:B})}),(0,r.FD)(v.fv,{children:[(0,r.Y)(u.Y.Root,{children:(0,r.Y)(u.Y.Title,{localizationKey:(0,C.G)("organizationProfile.invitePage.title"),sx:{textAlign:"left"}})}),(0,r.Y)(h.B,{contents:(0,r.Y)($.k,{}),sx:e=>({minHeight:e.sizes.$60}),onFinish:B})]})]})})},4472:function(e,t,a){a.r(t),a.d(t,{CreateOrganization:()=>z,CreateOrganizationModal:()=>v});var r=a(4518),i=a(3269),n=a(3264),o=a(1),l=a(4607),s=a(7831),d=a(2265),c=a(9361),u=a(6088),g=a(2861),h=a(180),p=a(9302);let m=(0,i.dm)(()=>{let{closeCreateOrganization:e}=(0,c.ho)(),{mode:t,navigateAfterCreateOrganization:a,skipInvitationScreen:n}=(0,o.W)(),l=(0,i.f0)(),{showDevModeNotice:s}=(0,h.Q)();return(0,r.FD)(u.Z.Root,{sx:e=>({width:e.sizes.$108}),children:[(0,r.FD)(u.Z.Content,{sx:e=>({padding:`${e.space.$4} ${e.space.$5} ${s?e.space.$12:e.space.$6}`}),children:[(0,r.Y)(u.Z.Alert,{children:l.error}),(0,r.Y)(p.A,{skipInvitationScreen:n,startPage:{headerTitle:(0,g.G)("createOrganization.title")},navigateAfterCreateOrganization:a,flow:"default",onComplete:()=>{"modal"===t&&e()}})]}),(0,r.Y)(u.Z.Footer,{})]})}),f=(0,n.G)(()=>(0,r.Y)(m,{})),z=(0,i.dm)(()=>(0,r.Y)(l.n.Root,{flow:"createOrganization",children:(0,r.Y)(l.n.Part,{children:(0,r.Y)(s.d,{children:(0,r.Y)(d.q,{children:(0,r.Y)(f,{})})})})})),v=e=>{let t={...e,routing:"virtual",componentName:"CreateOrganization",mode:"modal"};return(0,r.Y)(d.q,{path:"createOrganization",children:(0,r.Y)(o.$.Provider,{value:t,children:(0,r.Y)("div",{children:(0,r.Y)(z,{})})})})}},1:function(e,t,a){a.d(t,{$:()=>l,W:()=>s});var r=a(5074),i=a(7697),n=a(4964),o=a(2117);let l=(0,r.createContext)(null),s=()=>{let e=(0,r.useContext)(l),{navigate:t}=(0,n.r)(),{displayConfig:a}=(0,i.O)();if(!e||"CreateOrganization"!==e.componentName)throw Error("Clerk: useCreateOrganizationContext called outside CreateOrganization.");let{componentName:s,...d}=e;return{...d,skipInvitationScreen:d.skipInvitationScreen||!1,navigateAfterCreateOrganization:e=>"function"==typeof d.afterCreateOrganizationUrl?t(d.afterCreateOrganizationUrl(e)):d.afterCreateOrganizationUrl?t((0,o.tR)({urlWithParam:d.afterCreateOrganizationUrl,entity:e})):t(a.afterCreateOrganizationUrl),componentName:s}}}}]);
@@ -1,7 +1,7 @@
1
1
  import { parseAppearance } from "./parseAppearance.js";
2
2
  import React from "react";
3
- import { jsx } from "@emotion/react/jsx-runtime";
4
3
  import { createContextAndHook, useDeepEqualMemo } from "@clerk/shared/react";
4
+ import { jsx } from "@emotion/react/jsx-runtime";
5
5
 
6
6
  //#region src/customizables/AppearanceContext.tsx
7
7
  const [AppearanceContext, useAppearance] = createContextAndHook("AppearanceContext");