@clerk/ui 1.29.1 → 1.29.2-canary.v20260807220933
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/ClerkUI.js +2 -2
- package/dist/components/OAuthConsent/OAuthConsent.js +5 -1
- package/dist/components/OAuthConsent/OAuthConsent.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/no-rhc/ClerkUI.js +2 -2
- package/dist/no-rhc/components/OAuthConsent/OAuthConsent.js +5 -1
- package/dist/no-rhc/components/OAuthConsent/OAuthConsent.js.map +1 -1
- package/dist/no-rhc/index.js +1 -1
- package/dist/{oauthConsent_ui_b473dc_1.29.1.js → oauthConsent_ui_196a23_1.29.2-canary.v20260807220933.js} +1 -1
- package/dist/{oauthConsent_ui_65794d_1.29.1.js → oauthConsent_ui_4d20c6_1.29.2-canary.v20260807220933.js} +1 -1
- package/dist/{oauthConsent_ui_126569_1.29.1.js → oauthConsent_ui_79b595_1.29.2-canary.v20260807220933.js} +1 -1
- package/dist/server.js +1 -1
- package/dist/{ui-common_ui_b473dc_1.29.1.js → ui-common_ui_196a23_1.29.2-canary.v20260807220933.js} +1 -1
- package/dist/{ui-common_ui_65794d_1.29.1.js → ui-common_ui_4d20c6_1.29.2-canary.v20260807220933.js} +1 -1
- package/dist/{ui-common_ui_126569_1.29.1.js → ui-common_ui_79b595_1.29.2-canary.v20260807220933.js} +1 -1
- package/dist/ui.browser.js +2 -2
- package/dist/ui.legacy.browser.js +1 -1
- package/dist/ui.shared.browser.js +3 -3
- package/package.json +4 -4
- /package/dist/{4424_ui_b473dc_1.29.1.js → 4424_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{4424_ui_65794d_1.29.1.js → 4424_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{4424_ui_126569_1.29.1.js → 4424_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{4718_ui_b473dc_1.29.1.js → 4718_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{4718_ui_65794d_1.29.1.js → 4718_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{4718_ui_126569_1.29.1.js → 4718_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{6678_ui_b473dc_1.29.1.js → 6678_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{6678_ui_65794d_1.29.1.js → 6678_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{6678_ui_126569_1.29.1.js → 6678_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{7574_ui_b473dc_1.29.1.js → 7574_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{7574_ui_65794d_1.29.1.js → 7574_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{7574_ui_126569_1.29.1.js → 7574_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{8316_ui_b473dc_1.29.1.js → 8316_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{8316_ui_65794d_1.29.1.js → 8316_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{8316_ui_126569_1.29.1.js → 8316_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{8746_ui_b473dc_1.29.1.js → 8746_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{8746_ui_65794d_1.29.1.js → 8746_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{8746_ui_126569_1.29.1.js → 8746_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{9419_ui_b473dc_1.29.1.js → 9419_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{9419_ui_65794d_1.29.1.js → 9419_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{9419_ui_126569_1.29.1.js → 9419_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{980_ui_b473dc_1.29.1.js → 980_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{980_ui_65794d_1.29.1.js → 980_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{980_ui_126569_1.29.1.js → 980_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{apiKeys_ui_b473dc_1.29.1.js → apiKeys_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{apiKeys_ui_65794d_1.29.1.js → apiKeys_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{apiKeys_ui_126569_1.29.1.js → apiKeys_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{blankcaptcha_ui_65794d_1.29.1.js → blankcaptcha_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{blankcaptcha_ui_b473dc_1.29.1.js → blankcaptcha_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{blankcaptcha_ui_126569_1.29.1.js → blankcaptcha_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{checkout_ui_b473dc_1.29.1.js → checkout_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{checkout_ui_65794d_1.29.1.js → checkout_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{checkout_ui_126569_1.29.1.js → checkout_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{configureSSO_ui_b473dc_1.29.1.js → configureSSO_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{configureSSO_ui_65794d_1.29.1.js → configureSSO_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{configureSSO_ui_126569_1.29.1.js → configureSSO_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_b473dc_1.29.1.js → copy-api-key-modal_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_65794d_1.29.1.js → copy-api-key-modal_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_126569_1.29.1.js → copy-api-key-modal_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{createorganization_ui_b473dc_1.29.1.js → createorganization_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{createorganization_ui_65794d_1.29.1.js → createorganization_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{createorganization_ui_126569_1.29.1.js → createorganization_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{credit-history-page_ui_65794d_1.29.1.js → credit-history-page_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{credit-history-page_ui_b473dc_1.29.1.js → credit-history-page_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{credit-history-page_ui_126569_1.29.1.js → credit-history-page_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_b473dc_1.29.1.js → enableOrganizationsPrompt_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_65794d_1.29.1.js → enableOrganizationsPrompt_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_126569_1.29.1.js → enableOrganizationsPrompt_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{framework_ui_b473dc_1.29.1.js → framework_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{framework_ui_126569_1.29.1.js → framework_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{impersonationfab_ui_b473dc_1.29.1.js → impersonationfab_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{impersonationfab_ui_65794d_1.29.1.js → impersonationfab_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{impersonationfab_ui_126569_1.29.1.js → impersonationfab_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{invitemembers_ui_65794d_1.29.1.js → invitemembers_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{invitemembers_ui_b473dc_1.29.1.js → invitemembers_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{invitemembers_ui_126569_1.29.1.js → invitemembers_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{keylessPrompt_ui_b473dc_1.29.1.js → keylessPrompt_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{keylessPrompt_ui_65794d_1.29.1.js → keylessPrompt_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{keylessPrompt_ui_126569_1.29.1.js → keylessPrompt_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{onetap_ui_b473dc_1.29.1.js → onetap_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{onetap_ui_65794d_1.29.1.js → onetap_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{onetap_ui_126569_1.29.1.js → onetap_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{op-api-keys-page_ui_65794d_1.29.1.js → op-api-keys-page_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{op-api-keys-page_ui_b473dc_1.29.1.js → op-api-keys-page_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{op-api-keys-page_ui_126569_1.29.1.js → op-api-keys-page_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{op-billing-page_ui_65794d_1.29.1.js → op-billing-page_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{op-billing-page_ui_b473dc_1.29.1.js → op-billing-page_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{op-billing-page_ui_126569_1.29.1.js → op-billing-page_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{op-plans-page_ui_65794d_1.29.1.js → op-plans-page_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{op-plans-page_ui_b473dc_1.29.1.js → op-plans-page_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{op-plans-page_ui_126569_1.29.1.js → op-plans-page_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{op-security-page_ui_b473dc_1.29.1.js → op-security-page_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{op-security-page_ui_65794d_1.29.1.js → op-security-page_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{op-security-page_ui_126569_1.29.1.js → op-security-page_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{organizationlist_ui_b473dc_1.29.1.js → organizationlist_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{organizationlist_ui_65794d_1.29.1.js → organizationlist_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{organizationlist_ui_126569_1.29.1.js → organizationlist_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{organizationprofile_ui_b473dc_1.29.1.js → organizationprofile_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{organizationprofile_ui_65794d_1.29.1.js → organizationprofile_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{organizationprofile_ui_126569_1.29.1.js → organizationprofile_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{organizationswitcher_ui_b473dc_1.29.1.js → organizationswitcher_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{organizationswitcher_ui_65794d_1.29.1.js → organizationswitcher_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{organizationswitcher_ui_126569_1.29.1.js → organizationswitcher_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{payment-attempt-page_ui_65794d_1.29.1.js → payment-attempt-page_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{payment-attempt-page_ui_b473dc_1.29.1.js → payment-attempt-page_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{payment-attempt-page_ui_126569_1.29.1.js → payment-attempt-page_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{planDetails_ui_b473dc_1.29.1.js → planDetails_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{planDetails_ui_65794d_1.29.1.js → planDetails_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{planDetails_ui_126569_1.29.1.js → planDetails_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_65794d_1.29.1.js → prefetchorganizationlist_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_b473dc_1.29.1.js → prefetchorganizationlist_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_126569_1.29.1.js → prefetchorganizationlist_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{pricingTable_ui_b473dc_1.29.1.js → pricingTable_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{pricingTable_ui_65794d_1.29.1.js → pricingTable_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{pricingTable_ui_126569_1.29.1.js → pricingTable_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_b473dc_1.29.1.js → revoke-api-key-modal_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_65794d_1.29.1.js → revoke-api-key-modal_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_126569_1.29.1.js → revoke-api-key-modal_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{sessionTasks_ui_b473dc_1.29.1.js → sessionTasks_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{sessionTasks_ui_65794d_1.29.1.js → sessionTasks_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{sessionTasks_ui_126569_1.29.1.js → sessionTasks_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{signin_ui_b473dc_1.29.1.js → signin_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{signin_ui_65794d_1.29.1.js → signin_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{signin_ui_126569_1.29.1.js → signin_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{signup_ui_b473dc_1.29.1.js → signup_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{signup_ui_65794d_1.29.1.js → signup_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{signup_ui_126569_1.29.1.js → signup_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{statement-page_ui_b473dc_1.29.1.js → statement-page_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{statement-page_ui_65794d_1.29.1.js → statement-page_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{statement-page_ui_126569_1.29.1.js → statement-page_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{subscriptionDetails_ui_b473dc_1.29.1.js → subscriptionDetails_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{subscriptionDetails_ui_65794d_1.29.1.js → subscriptionDetails_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{subscriptionDetails_ui_126569_1.29.1.js → subscriptionDetails_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_b473dc_1.29.1.js → taskChooseOrganization_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_65794d_1.29.1.js → taskChooseOrganization_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_126569_1.29.1.js → taskChooseOrganization_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{taskResetPassword_ui_b473dc_1.29.1.js → taskResetPassword_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{taskResetPassword_ui_65794d_1.29.1.js → taskResetPassword_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{taskResetPassword_ui_126569_1.29.1.js → taskResetPassword_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{taskSetupMFA_ui_b473dc_1.29.1.js → taskSetupMFA_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{taskSetupMFA_ui_65794d_1.29.1.js → taskSetupMFA_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{taskSetupMFA_ui_126569_1.29.1.js → taskSetupMFA_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{up-api-keys-page_ui_65794d_1.29.1.js → up-api-keys-page_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{up-api-keys-page_ui_b473dc_1.29.1.js → up-api-keys-page_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{up-api-keys-page_ui_126569_1.29.1.js → up-api-keys-page_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{up-billing-page_ui_65794d_1.29.1.js → up-billing-page_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{up-billing-page_ui_b473dc_1.29.1.js → up-billing-page_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{up-billing-page_ui_126569_1.29.1.js → up-billing-page_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{up-plans-page_ui_65794d_1.29.1.js → up-plans-page_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{up-plans-page_ui_b473dc_1.29.1.js → up-plans-page_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{up-plans-page_ui_126569_1.29.1.js → up-plans-page_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{useravatar_ui_b473dc_1.29.1.js → useravatar_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{useravatar_ui_65794d_1.29.1.js → useravatar_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{useravatar_ui_126569_1.29.1.js → useravatar_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{userbutton_ui_b473dc_1.29.1.js → userbutton_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{userbutton_ui_65794d_1.29.1.js → userbutton_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{userbutton_ui_126569_1.29.1.js → userbutton_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{userprofile_ui_b473dc_1.29.1.js → userprofile_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{userprofile_ui_65794d_1.29.1.js → userprofile_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{userprofile_ui_126569_1.29.1.js → userprofile_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{userverification_ui_b473dc_1.29.1.js → userverification_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{userverification_ui_65794d_1.29.1.js → userverification_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{userverification_ui_126569_1.29.1.js → userverification_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{vendors_ui_b473dc_1.29.1.js → vendors_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{vendors_ui_65794d_1.29.1.js → vendors_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{vendors_ui_126569_1.29.1.js → vendors_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{waitlist_ui_b473dc_1.29.1.js → waitlist_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{waitlist_ui_65794d_1.29.1.js → waitlist_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{waitlist_ui_126569_1.29.1.js → waitlist_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_b473dc_1.29.1.js → web3-solana-wallet-buttons_ui_196a23_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_65794d_1.29.1.js → web3-solana-wallet-buttons_ui_4d20c6_1.29.2-canary.v20260807220933.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_126569_1.29.1.js → web3-solana-wallet-buttons_ui_79b595_1.29.2-canary.v20260807220933.js} +0 -0
package/dist/ClerkUI.js
CHANGED
|
@@ -22,8 +22,8 @@ import { isVersionAtLeast, parseVersion } from "@clerk/shared/versionCheck";
|
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
24
|
var ClerkUI = class ClerkUI {
|
|
25
|
-
static version = "1.29.
|
|
26
|
-
version = "1.29.
|
|
25
|
+
static version = "1.29.2-canary.v20260807220933";
|
|
26
|
+
version = "1.29.2-canary.v20260807220933";
|
|
27
27
|
#componentRenderer;
|
|
28
28
|
/**
|
|
29
29
|
* Creates a new `ClerkUI` instance and mounts the internal component renderer.
|
|
@@ -27,6 +27,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
|
27
27
|
|
|
28
28
|
//#region src/components/OAuthConsent/OAuthConsent.tsx
|
|
29
29
|
const OFFLINE_ACCESS_SCOPE = "offline_access";
|
|
30
|
+
const PRIVATE_METADATA_SCOPE = "private_metadata";
|
|
30
31
|
const USER_ORG_READ_SCOPE = "user:org:read";
|
|
31
32
|
function _OAuthConsent() {
|
|
32
33
|
const ctx = useOAuthConsentContext();
|
|
@@ -83,7 +84,10 @@ function _OAuthConsent() {
|
|
|
83
84
|
else ctx.onDeny?.();
|
|
84
85
|
};
|
|
85
86
|
const primaryIdentifier = user?.primaryEmailAddress?.emailAddress || user?.primaryPhoneNumber?.phoneNumber;
|
|
86
|
-
const displayedScopes = scopes.filter((item) => item.scope !== OFFLINE_ACCESS_SCOPE)
|
|
87
|
+
const displayedScopes = scopes.filter((item) => item.scope !== OFFLINE_ACCESS_SCOPE).map((item) => ({
|
|
88
|
+
...item,
|
|
89
|
+
description: item.scope === PRIVATE_METADATA_SCOPE ? t(localizationKeys("oauthConsent.scopeList.privateMetadata", { applicationName })) : item.description
|
|
90
|
+
}));
|
|
87
91
|
const hasOfflineAccess = scopes.some((item) => item.scope === OFFLINE_ACCESS_SCOPE);
|
|
88
92
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("form", {
|
|
89
93
|
method: "POST",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuthConsent.js","names":[],"sources":["../../../src/components/OAuthConsent/OAuthConsent.tsx"],"sourcesContent":["import { useClerk, useOAuthConsent, useUser } from '@clerk/shared/react';\nimport { useState } from 'react';\n\nimport { useEnvironment, useOAuthConsentContext, withCoreUserGuard } from '@/ui/contexts';\nimport { Box, Button, Flow, Grid, localizationKeys, Text, useLocalizations } from '@/ui/customizables';\nimport { ApplicationLogo } from '@/ui/elements/ApplicationLogo';\nimport { Card } from '@/ui/elements/Card';\nimport { withCardStateProvider } from '@/ui/elements/contexts';\nimport { Header } from '@/ui/elements/Header';\nimport { LoadingCardContainer } from '@/ui/elements/LoadingCard';\nimport { Modal } from '@/ui/elements/Modal';\nimport { Alert, Textarea } from '@/ui/primitives';\nimport { Route, Switch } from '@/ui/router';\n\nimport { InlineAction } from './InlineAction';\nimport { getKnownOAuthClient } from './knownClients';\nimport {\n ListGroup,\n ListGroupContent,\n ListGroupHeader,\n ListGroupHeaderTitle,\n ListGroupItem,\n ListGroupItemLabel,\n} from './ListGroup';\nimport { LogoGroup, LogoGroupIcon, LogoGroupItem, LogoGroupItemContainer, LogoGroupSeparator } from './LogoGroup';\nimport { OrgSelect } from './OrgSelect';\nimport { getForwardedParams, getOAuthConsentFromSearch, getRedirectDisplay, getRedirectUriFromSearch } from './utils';\n\nconst OFFLINE_ACCESS_SCOPE = 'offline_access';\nconst USER_ORG_READ_SCOPE = 'user:org:read';\n\nfunction _OAuthConsent() {\n const ctx = useOAuthConsentContext();\n const clerk = useClerk();\n const { user } = useUser();\n const {\n displayConfig: { applicationName, logoImageUrl },\n organizationSettings,\n } = useEnvironment();\n const [isUriModalOpen, setIsUriModalOpen] = useState(false);\n\n const [selectedOrg, setSelectedOrg] = useState<string | null>(null);\n\n // onAllow and onDeny are always provided as a pair by the accounts portal.\n const hasContextCallbacks = Boolean(ctx.onAllow || ctx.onDeny);\n\n // Resolve oauthClientId and scope once: context overrides URL fallback.\n const fromUrl = getOAuthConsentFromSearch();\n const oauthClientId = ctx.oauthClientId ?? fromUrl.oauthClientId;\n const scope = ctx.scope ?? fromUrl.scope;\n\n // Public path: fetch via hook. Disabled on the accounts portal path\n // (which already has all data via context) to avoid a wasted FAPI request.\n const redirectUri = ctx.redirectUrl ?? getRedirectUriFromSearch();\n const { data, isLoading, error } = useOAuthConsent({\n oauthClientId,\n scope,\n redirectUri: redirectUri || undefined,\n // TODO: Remove this once account portal is refactored to use this component\n enabled: !hasContextCallbacks,\n });\n\n // Hook returns camelCase `requiresConsent`; the render logic uses snake_case.\n const mappedHookScopes = data?.scopes?.map(s => ({\n scope: s.scope,\n description: s.description,\n requires_consent: s.requiresConsent,\n }));\n\n // Context (accounts portal path) wins over hook data (public path).\n const scopes = ctx.scopes ?? mappedHookScopes ?? [];\n const oauthApplicationName = ctx.oauthApplicationName ?? data?.oauthApplicationName ?? '';\n const oauthApplicationLogoUrl = ctx.oauthApplicationLogoUrl ?? data?.oauthApplicationLogoUrl;\n const oauthApplicationUrl = ctx.oauthApplicationUrl ?? data?.oauthApplicationUrl;\n const redirectUrl = ctx.redirectUrl ?? redirectUri;\n\n const hasOrgReadScope = scopes.some(s => s.scope === USER_ORG_READ_SCOPE);\n const orgSelectionEnabled = !!(hasOrgReadScope && organizationSettings.enabled);\n const orgOptions = orgSelectionEnabled\n ? (user?.organizationMemberships ?? []).map(m => ({\n value: m.organization.id,\n label: m.organization.name,\n logoUrl: m.organization.imageUrl,\n }))\n : [];\n const lastActiveOrgId = clerk.session?.lastActiveOrganizationId;\n const defaultOrg = orgOptions.find(o => o.value === lastActiveOrgId)?.value ?? orgOptions[0]?.value ?? null;\n const effectiveOrg = selectedOrg ?? defaultOrg;\n\n const { t } = useLocalizations();\n const domainAction = data?.redirectDomain ?? getRedirectDisplay(redirectUrl);\n const viewFullUrlText = t(localizationKeys('oauthConsent.viewFullUrl'));\n\n // When the OAuth app has no uploaded logo, fall back to a recognized client's\n // brand mark (Claude, ChatGPT, ...). Keyed on the trusted redirect domain, not\n // the app-owner-set name, so a look-alike name cannot borrow the branding.\n const knownClient = oauthApplicationLogoUrl ? undefined : getKnownOAuthClient(domainAction);\n\n // Error states only apply to the public flow.\n if (!hasContextCallbacks) {\n const errorMessage = !oauthClientId\n ? 'The client ID is missing.'\n : !redirectUrl\n ? 'The redirect URI is missing.'\n : error\n ? (error.message ?? 'Failed to load consent information.')\n : undefined;\n\n if (errorMessage) {\n return (\n <Card.Root>\n <Card.Content>\n <Card.Alert>{errorMessage}</Card.Alert>\n </Card.Content>\n <Card.Footer />\n </Card.Root>\n );\n }\n\n if (isLoading) {\n return (\n <Card.Root>\n <Card.Content>\n <LoadingCardContainer />\n </Card.Content>\n <Card.Footer />\n </Card.Root>\n );\n }\n }\n\n const actionUrl = clerk.oauthApplication.buildConsentActionUrl({ clientId: oauthClientId });\n const forwardedParams = getForwardedParams();\n\n // Accounts portal path delegates to context callbacks; public path lets the form submit natively.\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n if (!hasContextCallbacks) {\n return;\n }\n e.preventDefault();\n const submitter = (e.nativeEvent as SubmitEvent).submitter as HTMLButtonElement | null;\n if (submitter?.value === 'true') {\n ctx.onAllow?.();\n } else {\n ctx.onDeny?.();\n }\n };\n\n const primaryIdentifier = user?.primaryEmailAddress?.emailAddress || user?.primaryPhoneNumber?.phoneNumber;\n\n const displayedScopes = scopes.filter(item => item.scope !== OFFLINE_ACCESS_SCOPE);\n const hasOfflineAccess = scopes.some(item => item.scope === OFFLINE_ACCESS_SCOPE);\n\n return (\n <>\n <form\n method='POST'\n action={actionUrl}\n onSubmit={handleSubmit}\n >\n <Card.Root>\n <Card.Content>\n <Header.Root>\n {/* both have avatars */}\n {oauthApplicationLogoUrl && logoImageUrl && (\n <LogoGroup>\n <LogoGroupItem justify='end'>\n <LogoGroupItemContainer>\n <ApplicationLogo\n src={oauthApplicationLogoUrl}\n alt={oauthApplicationName}\n href={oauthApplicationUrl}\n isExternal\n />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n <LogoGroupSeparator />\n <LogoGroupItem justify='start'>\n <LogoGroupItemContainer>\n <ApplicationLogo />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n </LogoGroup>\n )}\n {/* only OAuth app has an avatar */}\n {oauthApplicationLogoUrl && !logoImageUrl && (\n <LogoGroup>\n <Box sx={{ position: 'relative' }}>\n <LogoGroupItemContainer>\n <ApplicationLogo\n src={oauthApplicationLogoUrl}\n alt={oauthApplicationName}\n href={oauthApplicationUrl}\n isExternal\n />\n </LogoGroupItemContainer>\n <LogoGroupItemContainer\n size='sm'\n sx={t => ({\n position: 'absolute',\n bottom: `calc(${t.space.$2x5} * -1)`,\n insetInlineEnd: `calc(${t.space.$2x5} * -1)`,\n })}\n >\n <LogoGroupIcon />\n </LogoGroupItemContainer>\n </Box>\n </LogoGroup>\n )}\n {/* only Clerk application has an avatar */}\n {!oauthApplicationLogoUrl && logoImageUrl && (\n <LogoGroup>\n <LogoGroupItem justify='end'>\n <LogoGroupItemContainer>\n <LogoGroupIcon\n icon={knownClient?.icon}\n iconSx={knownClient?.iconSx}\n label={knownClient?.name}\n />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n <LogoGroupSeparator />\n <LogoGroupItem justify='start'>\n <LogoGroupItemContainer>\n <ApplicationLogo />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n </LogoGroup>\n )}\n {/* no avatars */}\n {!oauthApplicationLogoUrl && !logoImageUrl && (\n <LogoGroup>\n <LogoGroupItemContainer>\n <LogoGroupIcon\n icon={knownClient?.icon}\n iconSx={knownClient?.iconSx}\n label={knownClient?.name}\n />\n </LogoGroupItemContainer>\n </LogoGroup>\n )}\n <Header.Title localizationKey={oauthApplicationName} />\n <Header.Subtitle\n localizationKey={localizationKeys('oauthConsent.subtitle', {\n applicationName,\n identifier: primaryIdentifier || '',\n })}\n />\n </Header.Root>\n {orgSelectionEnabled && orgOptions.length > 0 && effectiveOrg && (\n <OrgSelect\n options={orgOptions}\n value={effectiveOrg}\n onChange={setSelectedOrg}\n />\n )}\n <ListGroup>\n <ListGroupHeader>\n <ListGroupHeaderTitle\n localizationKey={localizationKeys('oauthConsent.scopeList.title', {\n applicationName: oauthApplicationName,\n })}\n />\n </ListGroupHeader>\n <ListGroupContent>\n {displayedScopes.map(item => (\n <ListGroupItem key={item.scope}>\n <ListGroupItemLabel>{item.description || item.scope || ''}</ListGroupItemLabel>\n </ListGroupItem>\n ))}\n </ListGroupContent>\n </ListGroup>\n <Alert colorScheme='warning'>\n <Text\n colorScheme='warning'\n variant='caption'\n >\n <InlineAction\n text={t(\n localizationKeys('oauthConsent.warning', {\n applicationName: oauthApplicationName || applicationName,\n domainAction,\n }),\n )}\n actionText={domainAction}\n onClick={() => setIsUriModalOpen(true)}\n tooltipText={viewFullUrlText}\n />\n </Text>\n </Alert>\n <Grid\n columns={2}\n gap={3}\n >\n <Button\n type='submit'\n name='consented'\n value='false'\n colorScheme='secondary'\n variant='outline'\n localizationKey={localizationKeys('oauthConsent.action__deny')}\n />\n <Button\n type='submit'\n name='consented'\n value='true'\n localizationKey={localizationKeys('oauthConsent.action__allow')}\n />\n <Text\n sx={{ gridColumn: 'span 2' }}\n colorScheme='secondary'\n variant='caption'\n >\n <InlineAction\n text={t(localizationKeys('oauthConsent.redirectNotice', { domainAction }))}\n actionText={domainAction}\n onClick={() => setIsUriModalOpen(true)}\n tooltipText={viewFullUrlText}\n />\n {hasOfflineAccess && t(localizationKeys('oauthConsent.offlineAccessNotice'))}\n </Text>\n </Grid>\n </Card.Content>\n <Card.Footer />\n </Card.Root>\n {!hasContextCallbacks &&\n forwardedParams.map(([key, value]) => (\n <input\n key={key}\n type='hidden'\n name={key}\n value={value}\n />\n ))}\n {!hasContextCallbacks && orgSelectionEnabled && effectiveOrg && (\n <input\n type='hidden'\n name='organization_id'\n value={effectiveOrg}\n />\n )}\n </form>\n <RedirectUriModal\n isOpen={isUriModalOpen}\n onOpen={() => setIsUriModalOpen(true)}\n onClose={() => setIsUriModalOpen(false)}\n redirectUri={redirectUrl}\n oauthApplicationName={oauthApplicationName}\n />\n </>\n );\n}\n\ntype RedirectUriModalProps = {\n onOpen: () => void;\n onClose: () => void;\n isOpen: boolean;\n redirectUri: string;\n oauthApplicationName: string;\n};\n\nfunction RedirectUriModal({ onOpen, onClose, isOpen, redirectUri, oauthApplicationName }: RedirectUriModalProps) {\n if (!isOpen) {\n return null;\n }\n\n return (\n <Modal\n handleOpen={onOpen}\n handleClose={onClose}\n >\n <Card.Root>\n <Card.Content>\n <Header.Root>\n <Header.Title localizationKey={localizationKeys('oauthConsent.redirectUriModal.title')} />\n <Header.Subtitle\n localizationKey={localizationKeys('oauthConsent.redirectUriModal.subtitle', {\n applicationName: oauthApplicationName,\n })}\n />\n </Header.Root>\n <Textarea\n style={{ maxHeight: 'none' }}\n cols={50}\n rows={6}\n defaultValue={redirectUri}\n readOnly\n />\n </Card.Content>\n </Card.Root>\n </Modal>\n );\n}\n\nconst AuthenticatedRoutes = withCoreUserGuard(withCardStateProvider(_OAuthConsent));\n\nconst OAuthConsentInternal = () => {\n return (\n <Flow.Root flow='oauthConsent'>\n <Flow.Part>\n <Switch>\n <Route>\n <AuthenticatedRoutes />\n </Route>\n </Switch>\n </Flow.Part>\n </Flow.Root>\n );\n};\n\nexport const OAuthConsent = OAuthConsentInternal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,uBAAuB;AAC7B,MAAM,sBAAsB;AAE5B,SAAS,gBAAgB;CACvB,MAAM,MAAM,uBAAuB;CACnC,MAAM,QAAQ,SAAS;CACvB,MAAM,EAAE,SAAS,QAAQ;CACzB,MAAM,EACJ,eAAe,EAAE,iBAAiB,gBAClC,yBACE,eAAe;CACnB,MAAM,CAAC,gBAAgB,qBAAqB,SAAS,KAAK;CAE1D,MAAM,CAAC,aAAa,kBAAkB,SAAwB,IAAI;CAGlE,MAAM,sBAAsB,QAAQ,IAAI,WAAW,IAAI,MAAM;CAG7D,MAAM,UAAU,0BAA0B;CAC1C,MAAM,gBAAgB,IAAI,iBAAiB,QAAQ;CACnD,MAAM,QAAQ,IAAI,SAAS,QAAQ;CAInC,MAAM,cAAc,IAAI,eAAe,yBAAyB;CAChE,MAAM,EAAE,MAAM,WAAW,UAAU,gBAAgB;EACjD;EACA;EACA,aAAa,eAAe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oBAAC,OAAO,UAAR,EACE,iBAAiB,iBAAiB,0CAA0C,EAC1E,iBAAiB,qBACnB,CAAC,EACF,EACU,MACb,oBAAC,UAAD;GACE,OAAO,EAAE,WAAW,OAAO;GAC3B,MAAM;GACN,MAAM;GACN,cAAc;GACd;EACD,EACW,KACL;CACN;AAEX;AAEA,MAAM,sBAAsB,kBAAkB,sBAAsB,aAAa,CAAC;AAElF,MAAM,6BAA6B;CACjC,OACE,oBAAC,KAAK,MAAN;EAAW,MAAK;YACd,oBAAC,KAAK,MAAN,YACE,oBAAC,QAAD,YACE,oBAAC,OAAD,YACE,oBAAC,qBAAD,CAAsB,GACjB,GACD,GACC;CACF;AAEf;AAEA,MAAa,eAAe"}
|
|
1
|
+
{"version":3,"file":"OAuthConsent.js","names":[],"sources":["../../../src/components/OAuthConsent/OAuthConsent.tsx"],"sourcesContent":["import { useClerk, useOAuthConsent, useUser } from '@clerk/shared/react';\nimport { useState } from 'react';\n\nimport { useEnvironment, useOAuthConsentContext, withCoreUserGuard } from '@/ui/contexts';\nimport { Box, Button, Flow, Grid, localizationKeys, Text, useLocalizations } from '@/ui/customizables';\nimport { ApplicationLogo } from '@/ui/elements/ApplicationLogo';\nimport { Card } from '@/ui/elements/Card';\nimport { withCardStateProvider } from '@/ui/elements/contexts';\nimport { Header } from '@/ui/elements/Header';\nimport { LoadingCardContainer } from '@/ui/elements/LoadingCard';\nimport { Modal } from '@/ui/elements/Modal';\nimport { Alert, Textarea } from '@/ui/primitives';\nimport { Route, Switch } from '@/ui/router';\n\nimport { InlineAction } from './InlineAction';\nimport { getKnownOAuthClient } from './knownClients';\nimport {\n ListGroup,\n ListGroupContent,\n ListGroupHeader,\n ListGroupHeaderTitle,\n ListGroupItem,\n ListGroupItemLabel,\n} from './ListGroup';\nimport { LogoGroup, LogoGroupIcon, LogoGroupItem, LogoGroupItemContainer, LogoGroupSeparator } from './LogoGroup';\nimport { OrgSelect } from './OrgSelect';\nimport { getForwardedParams, getOAuthConsentFromSearch, getRedirectDisplay, getRedirectUriFromSearch } from './utils';\n\nconst OFFLINE_ACCESS_SCOPE = 'offline_access';\nconst PRIVATE_METADATA_SCOPE = 'private_metadata';\nconst USER_ORG_READ_SCOPE = 'user:org:read';\n\nfunction _OAuthConsent() {\n const ctx = useOAuthConsentContext();\n const clerk = useClerk();\n const { user } = useUser();\n const {\n displayConfig: { applicationName, logoImageUrl },\n organizationSettings,\n } = useEnvironment();\n const [isUriModalOpen, setIsUriModalOpen] = useState(false);\n\n const [selectedOrg, setSelectedOrg] = useState<string | null>(null);\n\n // onAllow and onDeny are always provided as a pair by the accounts portal.\n const hasContextCallbacks = Boolean(ctx.onAllow || ctx.onDeny);\n\n // Resolve oauthClientId and scope once: context overrides URL fallback.\n const fromUrl = getOAuthConsentFromSearch();\n const oauthClientId = ctx.oauthClientId ?? fromUrl.oauthClientId;\n const scope = ctx.scope ?? fromUrl.scope;\n\n // Public path: fetch via hook. Disabled on the accounts portal path\n // (which already has all data via context) to avoid a wasted FAPI request.\n const redirectUri = ctx.redirectUrl ?? getRedirectUriFromSearch();\n const { data, isLoading, error } = useOAuthConsent({\n oauthClientId,\n scope,\n redirectUri: redirectUri || undefined,\n // TODO: Remove this once account portal is refactored to use this component\n enabled: !hasContextCallbacks,\n });\n\n // Hook returns camelCase `requiresConsent`; the render logic uses snake_case.\n const mappedHookScopes = data?.scopes?.map(s => ({\n scope: s.scope,\n description: s.description,\n requires_consent: s.requiresConsent,\n }));\n\n // Context (accounts portal path) wins over hook data (public path).\n const scopes = ctx.scopes ?? mappedHookScopes ?? [];\n const oauthApplicationName = ctx.oauthApplicationName ?? data?.oauthApplicationName ?? '';\n const oauthApplicationLogoUrl = ctx.oauthApplicationLogoUrl ?? data?.oauthApplicationLogoUrl;\n const oauthApplicationUrl = ctx.oauthApplicationUrl ?? data?.oauthApplicationUrl;\n const redirectUrl = ctx.redirectUrl ?? redirectUri;\n\n const hasOrgReadScope = scopes.some(s => s.scope === USER_ORG_READ_SCOPE);\n const orgSelectionEnabled = !!(hasOrgReadScope && organizationSettings.enabled);\n const orgOptions = orgSelectionEnabled\n ? (user?.organizationMemberships ?? []).map(m => ({\n value: m.organization.id,\n label: m.organization.name,\n logoUrl: m.organization.imageUrl,\n }))\n : [];\n const lastActiveOrgId = clerk.session?.lastActiveOrganizationId;\n const defaultOrg = orgOptions.find(o => o.value === lastActiveOrgId)?.value ?? orgOptions[0]?.value ?? null;\n const effectiveOrg = selectedOrg ?? defaultOrg;\n\n const { t } = useLocalizations();\n const domainAction = data?.redirectDomain ?? getRedirectDisplay(redirectUrl);\n const viewFullUrlText = t(localizationKeys('oauthConsent.viewFullUrl'));\n\n // When the OAuth app has no uploaded logo, fall back to a recognized client's\n // brand mark (Claude, ChatGPT, ...). Keyed on the trusted redirect domain, not\n // the app-owner-set name, so a look-alike name cannot borrow the branding.\n const knownClient = oauthApplicationLogoUrl ? undefined : getKnownOAuthClient(domainAction);\n\n // Error states only apply to the public flow.\n if (!hasContextCallbacks) {\n const errorMessage = !oauthClientId\n ? 'The client ID is missing.'\n : !redirectUrl\n ? 'The redirect URI is missing.'\n : error\n ? (error.message ?? 'Failed to load consent information.')\n : undefined;\n\n if (errorMessage) {\n return (\n <Card.Root>\n <Card.Content>\n <Card.Alert>{errorMessage}</Card.Alert>\n </Card.Content>\n <Card.Footer />\n </Card.Root>\n );\n }\n\n if (isLoading) {\n return (\n <Card.Root>\n <Card.Content>\n <LoadingCardContainer />\n </Card.Content>\n <Card.Footer />\n </Card.Root>\n );\n }\n }\n\n const actionUrl = clerk.oauthApplication.buildConsentActionUrl({ clientId: oauthClientId });\n const forwardedParams = getForwardedParams();\n\n // Accounts portal path delegates to context callbacks; public path lets the form submit natively.\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n if (!hasContextCallbacks) {\n return;\n }\n e.preventDefault();\n const submitter = (e.nativeEvent as SubmitEvent).submitter as HTMLButtonElement | null;\n if (submitter?.value === 'true') {\n ctx.onAllow?.();\n } else {\n ctx.onDeny?.();\n }\n };\n\n const primaryIdentifier = user?.primaryEmailAddress?.emailAddress || user?.primaryPhoneNumber?.phoneNumber;\n\n const displayedScopes = scopes\n .filter(item => item.scope !== OFFLINE_ACCESS_SCOPE)\n .map(item => ({\n ...item,\n description:\n item.scope === PRIVATE_METADATA_SCOPE\n ? t(localizationKeys('oauthConsent.scopeList.privateMetadata', { applicationName }))\n : item.description,\n }));\n const hasOfflineAccess = scopes.some(item => item.scope === OFFLINE_ACCESS_SCOPE);\n\n return (\n <>\n <form\n method='POST'\n action={actionUrl}\n onSubmit={handleSubmit}\n >\n <Card.Root>\n <Card.Content>\n <Header.Root>\n {/* both have avatars */}\n {oauthApplicationLogoUrl && logoImageUrl && (\n <LogoGroup>\n <LogoGroupItem justify='end'>\n <LogoGroupItemContainer>\n <ApplicationLogo\n src={oauthApplicationLogoUrl}\n alt={oauthApplicationName}\n href={oauthApplicationUrl}\n isExternal\n />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n <LogoGroupSeparator />\n <LogoGroupItem justify='start'>\n <LogoGroupItemContainer>\n <ApplicationLogo />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n </LogoGroup>\n )}\n {/* only OAuth app has an avatar */}\n {oauthApplicationLogoUrl && !logoImageUrl && (\n <LogoGroup>\n <Box sx={{ position: 'relative' }}>\n <LogoGroupItemContainer>\n <ApplicationLogo\n src={oauthApplicationLogoUrl}\n alt={oauthApplicationName}\n href={oauthApplicationUrl}\n isExternal\n />\n </LogoGroupItemContainer>\n <LogoGroupItemContainer\n size='sm'\n sx={t => ({\n position: 'absolute',\n bottom: `calc(${t.space.$2x5} * -1)`,\n insetInlineEnd: `calc(${t.space.$2x5} * -1)`,\n })}\n >\n <LogoGroupIcon />\n </LogoGroupItemContainer>\n </Box>\n </LogoGroup>\n )}\n {/* only Clerk application has an avatar */}\n {!oauthApplicationLogoUrl && logoImageUrl && (\n <LogoGroup>\n <LogoGroupItem justify='end'>\n <LogoGroupItemContainer>\n <LogoGroupIcon\n icon={knownClient?.icon}\n iconSx={knownClient?.iconSx}\n label={knownClient?.name}\n />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n <LogoGroupSeparator />\n <LogoGroupItem justify='start'>\n <LogoGroupItemContainer>\n <ApplicationLogo />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n </LogoGroup>\n )}\n {/* no avatars */}\n {!oauthApplicationLogoUrl && !logoImageUrl && (\n <LogoGroup>\n <LogoGroupItemContainer>\n <LogoGroupIcon\n icon={knownClient?.icon}\n iconSx={knownClient?.iconSx}\n label={knownClient?.name}\n />\n </LogoGroupItemContainer>\n </LogoGroup>\n )}\n <Header.Title localizationKey={oauthApplicationName} />\n <Header.Subtitle\n localizationKey={localizationKeys('oauthConsent.subtitle', {\n applicationName,\n identifier: primaryIdentifier || '',\n })}\n />\n </Header.Root>\n {orgSelectionEnabled && orgOptions.length > 0 && effectiveOrg && (\n <OrgSelect\n options={orgOptions}\n value={effectiveOrg}\n onChange={setSelectedOrg}\n />\n )}\n <ListGroup>\n <ListGroupHeader>\n <ListGroupHeaderTitle\n localizationKey={localizationKeys('oauthConsent.scopeList.title', {\n applicationName: oauthApplicationName,\n })}\n />\n </ListGroupHeader>\n <ListGroupContent>\n {displayedScopes.map(item => (\n <ListGroupItem key={item.scope}>\n <ListGroupItemLabel>{item.description || item.scope || ''}</ListGroupItemLabel>\n </ListGroupItem>\n ))}\n </ListGroupContent>\n </ListGroup>\n <Alert colorScheme='warning'>\n <Text\n colorScheme='warning'\n variant='caption'\n >\n <InlineAction\n text={t(\n localizationKeys('oauthConsent.warning', {\n applicationName: oauthApplicationName || applicationName,\n domainAction,\n }),\n )}\n actionText={domainAction}\n onClick={() => setIsUriModalOpen(true)}\n tooltipText={viewFullUrlText}\n />\n </Text>\n </Alert>\n <Grid\n columns={2}\n gap={3}\n >\n <Button\n type='submit'\n name='consented'\n value='false'\n colorScheme='secondary'\n variant='outline'\n localizationKey={localizationKeys('oauthConsent.action__deny')}\n />\n <Button\n type='submit'\n name='consented'\n value='true'\n localizationKey={localizationKeys('oauthConsent.action__allow')}\n />\n <Text\n sx={{ gridColumn: 'span 2' }}\n colorScheme='secondary'\n variant='caption'\n >\n <InlineAction\n text={t(localizationKeys('oauthConsent.redirectNotice', { domainAction }))}\n actionText={domainAction}\n onClick={() => setIsUriModalOpen(true)}\n tooltipText={viewFullUrlText}\n />\n {hasOfflineAccess && t(localizationKeys('oauthConsent.offlineAccessNotice'))}\n </Text>\n </Grid>\n </Card.Content>\n <Card.Footer />\n </Card.Root>\n {!hasContextCallbacks &&\n forwardedParams.map(([key, value]) => (\n <input\n key={key}\n type='hidden'\n name={key}\n value={value}\n />\n ))}\n {!hasContextCallbacks && orgSelectionEnabled && effectiveOrg && (\n <input\n type='hidden'\n name='organization_id'\n value={effectiveOrg}\n />\n )}\n </form>\n <RedirectUriModal\n isOpen={isUriModalOpen}\n onOpen={() => setIsUriModalOpen(true)}\n onClose={() => setIsUriModalOpen(false)}\n redirectUri={redirectUrl}\n oauthApplicationName={oauthApplicationName}\n />\n </>\n );\n}\n\ntype RedirectUriModalProps = {\n onOpen: () => void;\n onClose: () => void;\n isOpen: boolean;\n redirectUri: string;\n oauthApplicationName: string;\n};\n\nfunction RedirectUriModal({ onOpen, onClose, isOpen, redirectUri, oauthApplicationName }: RedirectUriModalProps) {\n if (!isOpen) {\n return null;\n }\n\n return (\n <Modal\n handleOpen={onOpen}\n handleClose={onClose}\n >\n <Card.Root>\n <Card.Content>\n <Header.Root>\n <Header.Title localizationKey={localizationKeys('oauthConsent.redirectUriModal.title')} />\n <Header.Subtitle\n localizationKey={localizationKeys('oauthConsent.redirectUriModal.subtitle', {\n applicationName: oauthApplicationName,\n })}\n />\n </Header.Root>\n <Textarea\n style={{ maxHeight: 'none' }}\n cols={50}\n rows={6}\n defaultValue={redirectUri}\n readOnly\n />\n </Card.Content>\n </Card.Root>\n </Modal>\n );\n}\n\nconst AuthenticatedRoutes = withCoreUserGuard(withCardStateProvider(_OAuthConsent));\n\nconst OAuthConsentInternal = () => {\n return (\n <Flow.Root flow='oauthConsent'>\n <Flow.Part>\n <Switch>\n <Route>\n <AuthenticatedRoutes />\n </Route>\n </Switch>\n </Flow.Part>\n </Flow.Root>\n );\n};\n\nexport const OAuthConsent = OAuthConsentInternal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,uBAAuB;AAC7B,MAAM,yBAAyB;AAC/B,MAAM,sBAAsB;AAE5B,SAAS,gBAAgB;CACvB,MAAM,MAAM,uBAAuB;CACnC,MAAM,QAAQ,SAAS;CACvB,MAAM,EAAE,SAAS,QAAQ;CACzB,MAAM,EACJ,eAAe,EAAE,iBAAiB,gBAClC,yBACE,eAAe;CACnB,MAAM,CAAC,gBAAgB,qBAAqB,SAAS,KAAK;CAE1D,MAAM,CAAC,aAAa,kBAAkB,SAAwB,IAAI;CAGlE,MAAM,sBAAsB,QAAQ,IAAI,WAAW,IAAI,MAAM;CAG7D,MAAM,UAAU,0BAA0B;CAC1C,MAAM,gBAAgB,IAAI,iBAAiB,QAAQ;CACnD,MAAM,QAAQ,IAAI,SAAS,QAAQ;CAInC,MAAM,cAAc,IAAI,eAAe,yBAAyB;CAChE,MAAM,EAAE,MAAM,WAAW,UAAU,gBAAgB;EACjD;EACA;EACA,aAAa,eAAe;EAE5B,SAAS,CAAC;CACZ,CAAC;CAGD,MAAM,mBAAmB,MAAM,QAAQ,KAAI,OAAM;EAC/C,OAAO,EAAE;EACT,aAAa,EAAE;EACf,kBAAkB,EAAE;CACtB,EAAE;CAGF,MAAM,SAAS,IAAI,UAAU,oBAAoB,CAAC;CAClD,MAAM,uBAAuB,IAAI,wBAAwB,MAAM,wBAAwB;CACvF,MAAM,0BAA0B,IAAI,2BAA2B,MAAM;CACrE,MAAM,sBAAsB,IAAI,uBAAuB,MAAM;CAC7D,MAAM,cAAc,IAAI,eAAe;CAGvC,MAAM,sBAAsB,CAAC,EADL,OAAO,MAAK,MAAK,EAAE,UAAU,mB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BAAC,KAAK,MAAN;EAAW,MAAK;YACd,oBAAC,KAAK,MAAN,YACE,oBAAC,QAAD,YACE,oBAAC,OAAD,YACE,oBAAC,qBAAD,CAAsB,GACjB,GACD,GACC;CACF;AAEf;AAEA,MAAa,eAAe"}
|
package/dist/index.js
CHANGED
package/dist/no-rhc/ClerkUI.js
CHANGED
|
@@ -22,8 +22,8 @@ import { isVersionAtLeast, parseVersion } from "@clerk/shared/versionCheck";
|
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
24
|
var ClerkUI = class ClerkUI {
|
|
25
|
-
static version = "1.29.
|
|
26
|
-
version = "1.29.
|
|
25
|
+
static version = "1.29.2-canary.v20260807220933";
|
|
26
|
+
version = "1.29.2-canary.v20260807220933";
|
|
27
27
|
#componentRenderer;
|
|
28
28
|
/**
|
|
29
29
|
* Creates a new `ClerkUI` instance and mounts the internal component renderer.
|
|
@@ -27,6 +27,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
|
27
27
|
|
|
28
28
|
//#region src/components/OAuthConsent/OAuthConsent.tsx
|
|
29
29
|
const OFFLINE_ACCESS_SCOPE = "offline_access";
|
|
30
|
+
const PRIVATE_METADATA_SCOPE = "private_metadata";
|
|
30
31
|
const USER_ORG_READ_SCOPE = "user:org:read";
|
|
31
32
|
function _OAuthConsent() {
|
|
32
33
|
const ctx = useOAuthConsentContext();
|
|
@@ -83,7 +84,10 @@ function _OAuthConsent() {
|
|
|
83
84
|
else ctx.onDeny?.();
|
|
84
85
|
};
|
|
85
86
|
const primaryIdentifier = user?.primaryEmailAddress?.emailAddress || user?.primaryPhoneNumber?.phoneNumber;
|
|
86
|
-
const displayedScopes = scopes.filter((item) => item.scope !== OFFLINE_ACCESS_SCOPE)
|
|
87
|
+
const displayedScopes = scopes.filter((item) => item.scope !== OFFLINE_ACCESS_SCOPE).map((item) => ({
|
|
88
|
+
...item,
|
|
89
|
+
description: item.scope === PRIVATE_METADATA_SCOPE ? t(localizationKeys("oauthConsent.scopeList.privateMetadata", { applicationName })) : item.description
|
|
90
|
+
}));
|
|
87
91
|
const hasOfflineAccess = scopes.some((item) => item.scope === OFFLINE_ACCESS_SCOPE);
|
|
88
92
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("form", {
|
|
89
93
|
method: "POST",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuthConsent.js","names":[],"sources":["../../../../src/components/OAuthConsent/OAuthConsent.tsx"],"sourcesContent":["import { useClerk, useOAuthConsent, useUser } from '@clerk/shared/react';\nimport { useState } from 'react';\n\nimport { useEnvironment, useOAuthConsentContext, withCoreUserGuard } from '@/ui/contexts';\nimport { Box, Button, Flow, Grid, localizationKeys, Text, useLocalizations } from '@/ui/customizables';\nimport { ApplicationLogo } from '@/ui/elements/ApplicationLogo';\nimport { Card } from '@/ui/elements/Card';\nimport { withCardStateProvider } from '@/ui/elements/contexts';\nimport { Header } from '@/ui/elements/Header';\nimport { LoadingCardContainer } from '@/ui/elements/LoadingCard';\nimport { Modal } from '@/ui/elements/Modal';\nimport { Alert, Textarea } from '@/ui/primitives';\nimport { Route, Switch } from '@/ui/router';\n\nimport { InlineAction } from './InlineAction';\nimport { getKnownOAuthClient } from './knownClients';\nimport {\n ListGroup,\n ListGroupContent,\n ListGroupHeader,\n ListGroupHeaderTitle,\n ListGroupItem,\n ListGroupItemLabel,\n} from './ListGroup';\nimport { LogoGroup, LogoGroupIcon, LogoGroupItem, LogoGroupItemContainer, LogoGroupSeparator } from './LogoGroup';\nimport { OrgSelect } from './OrgSelect';\nimport { getForwardedParams, getOAuthConsentFromSearch, getRedirectDisplay, getRedirectUriFromSearch } from './utils';\n\nconst OFFLINE_ACCESS_SCOPE = 'offline_access';\nconst USER_ORG_READ_SCOPE = 'user:org:read';\n\nfunction _OAuthConsent() {\n const ctx = useOAuthConsentContext();\n const clerk = useClerk();\n const { user } = useUser();\n const {\n displayConfig: { applicationName, logoImageUrl },\n organizationSettings,\n } = useEnvironment();\n const [isUriModalOpen, setIsUriModalOpen] = useState(false);\n\n const [selectedOrg, setSelectedOrg] = useState<string | null>(null);\n\n // onAllow and onDeny are always provided as a pair by the accounts portal.\n const hasContextCallbacks = Boolean(ctx.onAllow || ctx.onDeny);\n\n // Resolve oauthClientId and scope once: context overrides URL fallback.\n const fromUrl = getOAuthConsentFromSearch();\n const oauthClientId = ctx.oauthClientId ?? fromUrl.oauthClientId;\n const scope = ctx.scope ?? fromUrl.scope;\n\n // Public path: fetch via hook. Disabled on the accounts portal path\n // (which already has all data via context) to avoid a wasted FAPI request.\n const redirectUri = ctx.redirectUrl ?? getRedirectUriFromSearch();\n const { data, isLoading, error } = useOAuthConsent({\n oauthClientId,\n scope,\n redirectUri: redirectUri || undefined,\n // TODO: Remove this once account portal is refactored to use this component\n enabled: !hasContextCallbacks,\n });\n\n // Hook returns camelCase `requiresConsent`; the render logic uses snake_case.\n const mappedHookScopes = data?.scopes?.map(s => ({\n scope: s.scope,\n description: s.description,\n requires_consent: s.requiresConsent,\n }));\n\n // Context (accounts portal path) wins over hook data (public path).\n const scopes = ctx.scopes ?? mappedHookScopes ?? [];\n const oauthApplicationName = ctx.oauthApplicationName ?? data?.oauthApplicationName ?? '';\n const oauthApplicationLogoUrl = ctx.oauthApplicationLogoUrl ?? data?.oauthApplicationLogoUrl;\n const oauthApplicationUrl = ctx.oauthApplicationUrl ?? data?.oauthApplicationUrl;\n const redirectUrl = ctx.redirectUrl ?? redirectUri;\n\n const hasOrgReadScope = scopes.some(s => s.scope === USER_ORG_READ_SCOPE);\n const orgSelectionEnabled = !!(hasOrgReadScope && organizationSettings.enabled);\n const orgOptions = orgSelectionEnabled\n ? (user?.organizationMemberships ?? []).map(m => ({\n value: m.organization.id,\n label: m.organization.name,\n logoUrl: m.organization.imageUrl,\n }))\n : [];\n const lastActiveOrgId = clerk.session?.lastActiveOrganizationId;\n const defaultOrg = orgOptions.find(o => o.value === lastActiveOrgId)?.value ?? orgOptions[0]?.value ?? null;\n const effectiveOrg = selectedOrg ?? defaultOrg;\n\n const { t } = useLocalizations();\n const domainAction = data?.redirectDomain ?? getRedirectDisplay(redirectUrl);\n const viewFullUrlText = t(localizationKeys('oauthConsent.viewFullUrl'));\n\n // When the OAuth app has no uploaded logo, fall back to a recognized client's\n // brand mark (Claude, ChatGPT, ...). Keyed on the trusted redirect domain, not\n // the app-owner-set name, so a look-alike name cannot borrow the branding.\n const knownClient = oauthApplicationLogoUrl ? undefined : getKnownOAuthClient(domainAction);\n\n // Error states only apply to the public flow.\n if (!hasContextCallbacks) {\n const errorMessage = !oauthClientId\n ? 'The client ID is missing.'\n : !redirectUrl\n ? 'The redirect URI is missing.'\n : error\n ? (error.message ?? 'Failed to load consent information.')\n : undefined;\n\n if (errorMessage) {\n return (\n <Card.Root>\n <Card.Content>\n <Card.Alert>{errorMessage}</Card.Alert>\n </Card.Content>\n <Card.Footer />\n </Card.Root>\n );\n }\n\n if (isLoading) {\n return (\n <Card.Root>\n <Card.Content>\n <LoadingCardContainer />\n </Card.Content>\n <Card.Footer />\n </Card.Root>\n );\n }\n }\n\n const actionUrl = clerk.oauthApplication.buildConsentActionUrl({ clientId: oauthClientId });\n const forwardedParams = getForwardedParams();\n\n // Accounts portal path delegates to context callbacks; public path lets the form submit natively.\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n if (!hasContextCallbacks) {\n return;\n }\n e.preventDefault();\n const submitter = (e.nativeEvent as SubmitEvent).submitter as HTMLButtonElement | null;\n if (submitter?.value === 'true') {\n ctx.onAllow?.();\n } else {\n ctx.onDeny?.();\n }\n };\n\n const primaryIdentifier = user?.primaryEmailAddress?.emailAddress || user?.primaryPhoneNumber?.phoneNumber;\n\n const displayedScopes = scopes.filter(item => item.scope !== OFFLINE_ACCESS_SCOPE);\n const hasOfflineAccess = scopes.some(item => item.scope === OFFLINE_ACCESS_SCOPE);\n\n return (\n <>\n <form\n method='POST'\n action={actionUrl}\n onSubmit={handleSubmit}\n >\n <Card.Root>\n <Card.Content>\n <Header.Root>\n {/* both have avatars */}\n {oauthApplicationLogoUrl && logoImageUrl && (\n <LogoGroup>\n <LogoGroupItem justify='end'>\n <LogoGroupItemContainer>\n <ApplicationLogo\n src={oauthApplicationLogoUrl}\n alt={oauthApplicationName}\n href={oauthApplicationUrl}\n isExternal\n />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n <LogoGroupSeparator />\n <LogoGroupItem justify='start'>\n <LogoGroupItemContainer>\n <ApplicationLogo />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n </LogoGroup>\n )}\n {/* only OAuth app has an avatar */}\n {oauthApplicationLogoUrl && !logoImageUrl && (\n <LogoGroup>\n <Box sx={{ position: 'relative' }}>\n <LogoGroupItemContainer>\n <ApplicationLogo\n src={oauthApplicationLogoUrl}\n alt={oauthApplicationName}\n href={oauthApplicationUrl}\n isExternal\n />\n </LogoGroupItemContainer>\n <LogoGroupItemContainer\n size='sm'\n sx={t => ({\n position: 'absolute',\n bottom: `calc(${t.space.$2x5} * -1)`,\n insetInlineEnd: `calc(${t.space.$2x5} * -1)`,\n })}\n >\n <LogoGroupIcon />\n </LogoGroupItemContainer>\n </Box>\n </LogoGroup>\n )}\n {/* only Clerk application has an avatar */}\n {!oauthApplicationLogoUrl && logoImageUrl && (\n <LogoGroup>\n <LogoGroupItem justify='end'>\n <LogoGroupItemContainer>\n <LogoGroupIcon\n icon={knownClient?.icon}\n iconSx={knownClient?.iconSx}\n label={knownClient?.name}\n />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n <LogoGroupSeparator />\n <LogoGroupItem justify='start'>\n <LogoGroupItemContainer>\n <ApplicationLogo />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n </LogoGroup>\n )}\n {/* no avatars */}\n {!oauthApplicationLogoUrl && !logoImageUrl && (\n <LogoGroup>\n <LogoGroupItemContainer>\n <LogoGroupIcon\n icon={knownClient?.icon}\n iconSx={knownClient?.iconSx}\n label={knownClient?.name}\n />\n </LogoGroupItemContainer>\n </LogoGroup>\n )}\n <Header.Title localizationKey={oauthApplicationName} />\n <Header.Subtitle\n localizationKey={localizationKeys('oauthConsent.subtitle', {\n applicationName,\n identifier: primaryIdentifier || '',\n })}\n />\n </Header.Root>\n {orgSelectionEnabled && orgOptions.length > 0 && effectiveOrg && (\n <OrgSelect\n options={orgOptions}\n value={effectiveOrg}\n onChange={setSelectedOrg}\n />\n )}\n <ListGroup>\n <ListGroupHeader>\n <ListGroupHeaderTitle\n localizationKey={localizationKeys('oauthConsent.scopeList.title', {\n applicationName: oauthApplicationName,\n })}\n />\n </ListGroupHeader>\n <ListGroupContent>\n {displayedScopes.map(item => (\n <ListGroupItem key={item.scope}>\n <ListGroupItemLabel>{item.description || item.scope || ''}</ListGroupItemLabel>\n </ListGroupItem>\n ))}\n </ListGroupContent>\n </ListGroup>\n <Alert colorScheme='warning'>\n <Text\n colorScheme='warning'\n variant='caption'\n >\n <InlineAction\n text={t(\n localizationKeys('oauthConsent.warning', {\n applicationName: oauthApplicationName || applicationName,\n domainAction,\n }),\n )}\n actionText={domainAction}\n onClick={() => setIsUriModalOpen(true)}\n tooltipText={viewFullUrlText}\n />\n </Text>\n </Alert>\n <Grid\n columns={2}\n gap={3}\n >\n <Button\n type='submit'\n name='consented'\n value='false'\n colorScheme='secondary'\n variant='outline'\n localizationKey={localizationKeys('oauthConsent.action__deny')}\n />\n <Button\n type='submit'\n name='consented'\n value='true'\n localizationKey={localizationKeys('oauthConsent.action__allow')}\n />\n <Text\n sx={{ gridColumn: 'span 2' }}\n colorScheme='secondary'\n variant='caption'\n >\n <InlineAction\n text={t(localizationKeys('oauthConsent.redirectNotice', { domainAction }))}\n actionText={domainAction}\n onClick={() => setIsUriModalOpen(true)}\n tooltipText={viewFullUrlText}\n />\n {hasOfflineAccess && t(localizationKeys('oauthConsent.offlineAccessNotice'))}\n </Text>\n </Grid>\n </Card.Content>\n <Card.Footer />\n </Card.Root>\n {!hasContextCallbacks &&\n forwardedParams.map(([key, value]) => (\n <input\n key={key}\n type='hidden'\n name={key}\n value={value}\n />\n ))}\n {!hasContextCallbacks && orgSelectionEnabled && effectiveOrg && (\n <input\n type='hidden'\n name='organization_id'\n value={effectiveOrg}\n />\n )}\n </form>\n <RedirectUriModal\n isOpen={isUriModalOpen}\n onOpen={() => setIsUriModalOpen(true)}\n onClose={() => setIsUriModalOpen(false)}\n redirectUri={redirectUrl}\n oauthApplicationName={oauthApplicationName}\n />\n </>\n );\n}\n\ntype RedirectUriModalProps = {\n onOpen: () => void;\n onClose: () => void;\n isOpen: boolean;\n redirectUri: string;\n oauthApplicationName: string;\n};\n\nfunction RedirectUriModal({ onOpen, onClose, isOpen, redirectUri, oauthApplicationName }: RedirectUriModalProps) {\n if (!isOpen) {\n return null;\n }\n\n return (\n <Modal\n handleOpen={onOpen}\n handleClose={onClose}\n >\n <Card.Root>\n <Card.Content>\n <Header.Root>\n <Header.Title localizationKey={localizationKeys('oauthConsent.redirectUriModal.title')} />\n <Header.Subtitle\n localizationKey={localizationKeys('oauthConsent.redirectUriModal.subtitle', {\n applicationName: oauthApplicationName,\n })}\n />\n </Header.Root>\n <Textarea\n style={{ maxHeight: 'none' }}\n cols={50}\n rows={6}\n defaultValue={redirectUri}\n readOnly\n />\n </Card.Content>\n </Card.Root>\n </Modal>\n );\n}\n\nconst AuthenticatedRoutes = withCoreUserGuard(withCardStateProvider(_OAuthConsent));\n\nconst OAuthConsentInternal = () => {\n return (\n <Flow.Root flow='oauthConsent'>\n <Flow.Part>\n <Switch>\n <Route>\n <AuthenticatedRoutes />\n </Route>\n </Switch>\n </Flow.Part>\n </Flow.Root>\n );\n};\n\nexport const OAuthConsent = OAuthConsentInternal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,uBAAuB;AAC7B,MAAM,sBAAsB;AAE5B,SAAS,gBAAgB;CACvB,MAAM,MAAM,uBAAuB;CACnC,MAAM,QAAQ,SAAS;CACvB,MAAM,EAAE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ACE,MAAK;IACL,MAAK;IACL,OAAO;GACR;EAEC;KACN,oBAAC,kBAAD;EACE,QAAQ;EACR,cAAc,kBAAkB,IAAI;EACpC,eAAe,kBAAkB,KAAK;EACtC,aAAa;EACS;CACvB,EACD;AAEN;AAUA,SAAS,iBAAiB,EAAE,QAAQ,SAAS,QAAQ,aAAa,wBAA+C;CAC/G,IAAI,CAAC,QACH,OAAO;CAGT,OACE,oBAAC,OAAD;EACE,YAAY;EACZ,aAAa;YAEb,oBAAC,KAAK,MAAN,YACE,qBAAC,KAAK,SAAN,aACE,qBAAC,OAAO,MAAR,aACE,oBAAC,OAAO,OAAR,EAAc,iBAAiB,iBAAiB,qCAAqC,EAAI,IACzF,oBAAC,OAAO,UAAR,EACE,iBAAiB,iBAAiB,0CAA0C,EAC1E,iBAAiB,qBACnB,CAAC,EACF,EACU,MACb,oBAAC,UAAD;GACE,OAAO,EAAE,WAAW,OAAO;GAC3B,MAAM;GACN,MAAM;GACN,cAAc;GACd;EACD,EACW,KACL;CACN;AAEX;AAEA,MAAM,sBAAsB,kBAAkB,sBAAsB,aAAa,CAAC;AAElF,MAAM,6BAA6B;CACjC,OACE,oBAAC,KAAK,MAAN;EAAW,MAAK;YACd,oBAAC,KAAK,MAAN,YACE,oBAAC,QAAD,YACE,oBAAC,OAAD,YACE,oBAAC,qBAAD,CAAsB,GACjB,GACD,GACC;CACF;AAEf;AAEA,MAAa,eAAe"}
|
|
1
|
+
{"version":3,"file":"OAuthConsent.js","names":[],"sources":["../../../../src/components/OAuthConsent/OAuthConsent.tsx"],"sourcesContent":["import { useClerk, useOAuthConsent, useUser } from '@clerk/shared/react';\nimport { useState } from 'react';\n\nimport { useEnvironment, useOAuthConsentContext, withCoreUserGuard } from '@/ui/contexts';\nimport { Box, Button, Flow, Grid, localizationKeys, Text, useLocalizations } from '@/ui/customizables';\nimport { ApplicationLogo } from '@/ui/elements/ApplicationLogo';\nimport { Card } from '@/ui/elements/Card';\nimport { withCardStateProvider } from '@/ui/elements/contexts';\nimport { Header } from '@/ui/elements/Header';\nimport { LoadingCardContainer } from '@/ui/elements/LoadingCard';\nimport { Modal } from '@/ui/elements/Modal';\nimport { Alert, Textarea } from '@/ui/primitives';\nimport { Route, Switch } from '@/ui/router';\n\nimport { InlineAction } from './InlineAction';\nimport { getKnownOAuthClient } from './knownClients';\nimport {\n ListGroup,\n ListGroupContent,\n ListGroupHeader,\n ListGroupHeaderTitle,\n ListGroupItem,\n ListGroupItemLabel,\n} from './ListGroup';\nimport { LogoGroup, LogoGroupIcon, LogoGroupItem, LogoGroupItemContainer, LogoGroupSeparator } from './LogoGroup';\nimport { OrgSelect } from './OrgSelect';\nimport { getForwardedParams, getOAuthConsentFromSearch, getRedirectDisplay, getRedirectUriFromSearch } from './utils';\n\nconst OFFLINE_ACCESS_SCOPE = 'offline_access';\nconst PRIVATE_METADATA_SCOPE = 'private_metadata';\nconst USER_ORG_READ_SCOPE = 'user:org:read';\n\nfunction _OAuthConsent() {\n const ctx = useOAuthConsentContext();\n const clerk = useClerk();\n const { user } = useUser();\n const {\n displayConfig: { applicationName, logoImageUrl },\n organizationSettings,\n } = useEnvironment();\n const [isUriModalOpen, setIsUriModalOpen] = useState(false);\n\n const [selectedOrg, setSelectedOrg] = useState<string | null>(null);\n\n // onAllow and onDeny are always provided as a pair by the accounts portal.\n const hasContextCallbacks = Boolean(ctx.onAllow || ctx.onDeny);\n\n // Resolve oauthClientId and scope once: context overrides URL fallback.\n const fromUrl = getOAuthConsentFromSearch();\n const oauthClientId = ctx.oauthClientId ?? fromUrl.oauthClientId;\n const scope = ctx.scope ?? fromUrl.scope;\n\n // Public path: fetch via hook. Disabled on the accounts portal path\n // (which already has all data via context) to avoid a wasted FAPI request.\n const redirectUri = ctx.redirectUrl ?? getRedirectUriFromSearch();\n const { data, isLoading, error } = useOAuthConsent({\n oauthClientId,\n scope,\n redirectUri: redirectUri || undefined,\n // TODO: Remove this once account portal is refactored to use this component\n enabled: !hasContextCallbacks,\n });\n\n // Hook returns camelCase `requiresConsent`; the render logic uses snake_case.\n const mappedHookScopes = data?.scopes?.map(s => ({\n scope: s.scope,\n description: s.description,\n requires_consent: s.requiresConsent,\n }));\n\n // Context (accounts portal path) wins over hook data (public path).\n const scopes = ctx.scopes ?? mappedHookScopes ?? [];\n const oauthApplicationName = ctx.oauthApplicationName ?? data?.oauthApplicationName ?? '';\n const oauthApplicationLogoUrl = ctx.oauthApplicationLogoUrl ?? data?.oauthApplicationLogoUrl;\n const oauthApplicationUrl = ctx.oauthApplicationUrl ?? data?.oauthApplicationUrl;\n const redirectUrl = ctx.redirectUrl ?? redirectUri;\n\n const hasOrgReadScope = scopes.some(s => s.scope === USER_ORG_READ_SCOPE);\n const orgSelectionEnabled = !!(hasOrgReadScope && organizationSettings.enabled);\n const orgOptions = orgSelectionEnabled\n ? (user?.organizationMemberships ?? []).map(m => ({\n value: m.organization.id,\n label: m.organization.name,\n logoUrl: m.organization.imageUrl,\n }))\n : [];\n const lastActiveOrgId = clerk.session?.lastActiveOrganizationId;\n const defaultOrg = orgOptions.find(o => o.value === lastActiveOrgId)?.value ?? orgOptions[0]?.value ?? null;\n const effectiveOrg = selectedOrg ?? defaultOrg;\n\n const { t } = useLocalizations();\n const domainAction = data?.redirectDomain ?? getRedirectDisplay(redirectUrl);\n const viewFullUrlText = t(localizationKeys('oauthConsent.viewFullUrl'));\n\n // When the OAuth app has no uploaded logo, fall back to a recognized client's\n // brand mark (Claude, ChatGPT, ...). Keyed on the trusted redirect domain, not\n // the app-owner-set name, so a look-alike name cannot borrow the branding.\n const knownClient = oauthApplicationLogoUrl ? undefined : getKnownOAuthClient(domainAction);\n\n // Error states only apply to the public flow.\n if (!hasContextCallbacks) {\n const errorMessage = !oauthClientId\n ? 'The client ID is missing.'\n : !redirectUrl\n ? 'The redirect URI is missing.'\n : error\n ? (error.message ?? 'Failed to load consent information.')\n : undefined;\n\n if (errorMessage) {\n return (\n <Card.Root>\n <Card.Content>\n <Card.Alert>{errorMessage}</Card.Alert>\n </Card.Content>\n <Card.Footer />\n </Card.Root>\n );\n }\n\n if (isLoading) {\n return (\n <Card.Root>\n <Card.Content>\n <LoadingCardContainer />\n </Card.Content>\n <Card.Footer />\n </Card.Root>\n );\n }\n }\n\n const actionUrl = clerk.oauthApplication.buildConsentActionUrl({ clientId: oauthClientId });\n const forwardedParams = getForwardedParams();\n\n // Accounts portal path delegates to context callbacks; public path lets the form submit natively.\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n if (!hasContextCallbacks) {\n return;\n }\n e.preventDefault();\n const submitter = (e.nativeEvent as SubmitEvent).submitter as HTMLButtonElement | null;\n if (submitter?.value === 'true') {\n ctx.onAllow?.();\n } else {\n ctx.onDeny?.();\n }\n };\n\n const primaryIdentifier = user?.primaryEmailAddress?.emailAddress || user?.primaryPhoneNumber?.phoneNumber;\n\n const displayedScopes = scopes\n .filter(item => item.scope !== OFFLINE_ACCESS_SCOPE)\n .map(item => ({\n ...item,\n description:\n item.scope === PRIVATE_METADATA_SCOPE\n ? t(localizationKeys('oauthConsent.scopeList.privateMetadata', { applicationName }))\n : item.description,\n }));\n const hasOfflineAccess = scopes.some(item => item.scope === OFFLINE_ACCESS_SCOPE);\n\n return (\n <>\n <form\n method='POST'\n action={actionUrl}\n onSubmit={handleSubmit}\n >\n <Card.Root>\n <Card.Content>\n <Header.Root>\n {/* both have avatars */}\n {oauthApplicationLogoUrl && logoImageUrl && (\n <LogoGroup>\n <LogoGroupItem justify='end'>\n <LogoGroupItemContainer>\n <ApplicationLogo\n src={oauthApplicationLogoUrl}\n alt={oauthApplicationName}\n href={oauthApplicationUrl}\n isExternal\n />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n <LogoGroupSeparator />\n <LogoGroupItem justify='start'>\n <LogoGroupItemContainer>\n <ApplicationLogo />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n </LogoGroup>\n )}\n {/* only OAuth app has an avatar */}\n {oauthApplicationLogoUrl && !logoImageUrl && (\n <LogoGroup>\n <Box sx={{ position: 'relative' }}>\n <LogoGroupItemContainer>\n <ApplicationLogo\n src={oauthApplicationLogoUrl}\n alt={oauthApplicationName}\n href={oauthApplicationUrl}\n isExternal\n />\n </LogoGroupItemContainer>\n <LogoGroupItemContainer\n size='sm'\n sx={t => ({\n position: 'absolute',\n bottom: `calc(${t.space.$2x5} * -1)`,\n insetInlineEnd: `calc(${t.space.$2x5} * -1)`,\n })}\n >\n <LogoGroupIcon />\n </LogoGroupItemContainer>\n </Box>\n </LogoGroup>\n )}\n {/* only Clerk application has an avatar */}\n {!oauthApplicationLogoUrl && logoImageUrl && (\n <LogoGroup>\n <LogoGroupItem justify='end'>\n <LogoGroupItemContainer>\n <LogoGroupIcon\n icon={knownClient?.icon}\n iconSx={knownClient?.iconSx}\n label={knownClient?.name}\n />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n <LogoGroupSeparator />\n <LogoGroupItem justify='start'>\n <LogoGroupItemContainer>\n <ApplicationLogo />\n </LogoGroupItemContainer>\n </LogoGroupItem>\n </LogoGroup>\n )}\n {/* no avatars */}\n {!oauthApplicationLogoUrl && !logoImageUrl && (\n <LogoGroup>\n <LogoGroupItemContainer>\n <LogoGroupIcon\n icon={knownClient?.icon}\n iconSx={knownClient?.iconSx}\n label={knownClient?.name}\n />\n </LogoGroupItemContainer>\n </LogoGroup>\n )}\n <Header.Title localizationKey={oauthApplicationName} />\n <Header.Subtitle\n localizationKey={localizationKeys('oauthConsent.subtitle', {\n applicationName,\n identifier: primaryIdentifier || '',\n })}\n />\n </Header.Root>\n {orgSelectionEnabled && orgOptions.length > 0 && effectiveOrg && (\n <OrgSelect\n options={orgOptions}\n value={effectiveOrg}\n onChange={setSelectedOrg}\n />\n )}\n <ListGroup>\n <ListGroupHeader>\n <ListGroupHeaderTitle\n localizationKey={localizationKeys('oauthConsent.scopeList.title', {\n applicationName: oauthApplicationName,\n })}\n />\n </ListGroupHeader>\n <ListGroupContent>\n {displayedScopes.map(item => (\n <ListGroupItem key={item.scope}>\n <ListGroupItemLabel>{item.description || item.scope || ''}</ListGroupItemLabel>\n </ListGroupItem>\n ))}\n </ListGroupContent>\n </ListGroup>\n <Alert colorScheme='warning'>\n <Text\n colorScheme='warning'\n variant='caption'\n >\n <InlineAction\n text={t(\n localizationKeys('oauthConsent.warning', {\n applicationName: oauthApplicationName || applicationName,\n domainAction,\n }),\n )}\n actionText={domainAction}\n onClick={() => setIsUriModalOpen(true)}\n tooltipText={viewFullUrlText}\n />\n </Text>\n </Alert>\n <Grid\n columns={2}\n gap={3}\n >\n <Button\n type='submit'\n name='consented'\n value='false'\n colorScheme='secondary'\n variant='outline'\n localizationKey={localizationKeys('oauthConsent.action__deny')}\n />\n <Button\n type='submit'\n name='consented'\n value='true'\n localizationKey={localizationKeys('oauthConsent.action__allow')}\n />\n <Text\n sx={{ gridColumn: 'span 2' }}\n colorScheme='secondary'\n variant='caption'\n >\n <InlineAction\n text={t(localizationKeys('oauthConsent.redirectNotice', { domainAction }))}\n actionText={domainAction}\n onClick={() => setIsUriModalOpen(true)}\n tooltipText={viewFullUrlText}\n />\n {hasOfflineAccess && t(localizationKeys('oauthConsent.offlineAccessNotice'))}\n </Text>\n </Grid>\n </Card.Content>\n <Card.Footer />\n </Card.Root>\n {!hasContextCallbacks &&\n forwardedParams.map(([key, value]) => (\n <input\n key={key}\n type='hidden'\n name={key}\n value={value}\n />\n ))}\n {!hasContextCallbacks && orgSelectionEnabled && effectiveOrg && (\n <input\n type='hidden'\n name='organization_id'\n value={effectiveOrg}\n />\n )}\n </form>\n <RedirectUriModal\n isOpen={isUriModalOpen}\n onOpen={() => setIsUriModalOpen(true)}\n onClose={() => setIsUriModalOpen(false)}\n redirectUri={redirectUrl}\n oauthApplicationName={oauthApplicationName}\n />\n </>\n );\n}\n\ntype RedirectUriModalProps = {\n onOpen: () => void;\n onClose: () => void;\n isOpen: boolean;\n redirectUri: string;\n oauthApplicationName: string;\n};\n\nfunction RedirectUriModal({ onOpen, onClose, isOpen, redirectUri, oauthApplicationName }: RedirectUriModalProps) {\n if (!isOpen) {\n return null;\n }\n\n return (\n <Modal\n handleOpen={onOpen}\n handleClose={onClose}\n >\n <Card.Root>\n <Card.Content>\n <Header.Root>\n <Header.Title localizationKey={localizationKeys('oauthConsent.redirectUriModal.title')} />\n <Header.Subtitle\n localizationKey={localizationKeys('oauthConsent.redirectUriModal.subtitle', {\n applicationName: oauthApplicationName,\n })}\n />\n </Header.Root>\n <Textarea\n style={{ maxHeight: 'none' }}\n cols={50}\n rows={6}\n defaultValue={redirectUri}\n readOnly\n />\n </Card.Content>\n </Card.Root>\n </Modal>\n );\n}\n\nconst AuthenticatedRoutes = withCoreUserGuard(withCardStateProvider(_OAuthConsent));\n\nconst OAuthConsentInternal = () => {\n return (\n <Flow.Root flow='oauthConsent'>\n <Flow.Part>\n <Switch>\n <Route>\n <AuthenticatedRoutes />\n </Route>\n </Switch>\n </Flow.Part>\n </Flow.Root>\n );\n};\n\nexport const OAuthConsent = OAuthConsentInternal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,uBAAuB;AAC7B,MAAM,yBAAyB;AAC/B,MAAM,sBAAsB;AAE5B,SAAS,gBAAgB;CACvB,MAAM,MAAM,uBAAuB;CACnC,MAAM,QAAQ,SAAS;CACvB,MAAM,EAAE,SAAS,QAAQ;CACzB,MAAM,EACJ,eAAe,EAAE,iBAAiB,gBAClC,yBACE,eAAe;CACnB,MAAM,CAAC,gBAAgB,qBAAqB,SAAS,KAAK;CAE1D,MAAM,CAAC,aAAa,kBAAkB,SAAwB,IAAI;CAGlE,MAAM,sBAAsB,QAAQ,IAAI,WAAW,IAAI,MAAM;CAG7D,MAAM,UAAU,0BAA0B;CAC1C,MAAM,gBAAgB,IAAI,iBAAiB,QAAQ;CACnD,MAAM,QAAQ,IAAI,SAAS,QAAQ;CAInC,MAAM,cAAc,IAAI,eAAe,yBAAyB;CAChE,MAAM,EAAE,MAAM,WAAW,UAAU,gBAAgB;EACjD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AAY;EACZ,aAAa;YAEb,oBAAC,KAAK,MAAN,YACE,qBAAC,KAAK,SAAN,aACE,qBAAC,OAAO,MAAR,aACE,oBAAC,OAAO,OAAR,EAAc,iBAAiB,iBAAiB,qCAAqC,EAAI,IACzF,oBAAC,OAAO,UAAR,EACE,iBAAiB,iBAAiB,0CAA0C,EAC1E,iBAAiB,qBACnB,CAAC,EACF,EACU,MACb,oBAAC,UAAD;GACE,OAAO,EAAE,WAAW,OAAO;GAC3B,MAAM;GACN,MAAM;GACN,cAAc;GACd;EACD,EACW,KACL;CACN;AAEX;AAEA,MAAM,sBAAsB,kBAAkB,sBAAsB,aAAa,CAAC;AAElF,MAAM,6BAA6B;CACjC,OACE,oBAAC,KAAK,MAAN;EAAW,MAAK;YACd,oBAAC,KAAK,MAAN,YACE,oBAAC,QAAD,YACE,oBAAC,OAAD,YACE,oBAAC,qBAAD,CAAsB,GACjB,GACD,GACC;CACF;AAEf;AAEA,MAAa,eAAe"}
|
package/dist/no-rhc/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.rspackChunk_clerk_ui=globalThis.rspackChunk_clerk_ui||[]).push([[5591],{8051(e,n,o){o.r(n),o.d(n,{OAuthConsent:()=>X});var t,i,r=o(9763),l=o(6262),a=o(9701),c=o(4480),s=o(1868),d=o(9203),u=o(6887),h=o(8342),p=o(9230),m=o(4641),g=o(914),f=o(5402),Y=o(7308),b=o(9642),$=o(9095),v=o(2574),x=o(6674),y=o(9684),C=o(6661),k=o(9922),w=o(5880);function z({text:e,actionText:n,onClick:o,tooltipText:t}){let i=e.indexOf(n);if(-1===i)return(0,r.Y)(r.FK,{children:e});let l=e.slice(0,i),a=e.slice(i+n.length),c="",s="";l.endsWith("(")&&(l=l.slice(0,-1),c="("),a.startsWith(")")&&(a=a.slice(1),s=")");let d=(0,r.FD)(w.m_.Root,{children:[(0,r.Y)(w.m_.Trigger,{children:(0,r.Y)(p.EY,{as:"span",role:"button",tabIndex:0,"aria-label":t,variant:"caption",onClick:o,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),o())},sx:e=>({textDecoration:"underline",textDecorationStyle:"dotted",cursor:"pointer",outline:"none",display:"inline-block","&:focus-visible":{outline:"2px solid",outlineColor:e.colors.$colorRing}}),children:n})}),(0,r.Y)(w.m_.Content,{text:t})]});return(0,r.FD)(r.FK,{children:[l,c||s?(0,r.FD)(p.EY,{as:"span",sx:{whiteSpace:"nowrap"},children:[c,d,s]}):d,a]})}function D(){return(D=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(null,arguments)}function F(){return(F=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(null,arguments)}let S=[{name:"Claude",icon:function(e){return a.createElement("svg",D({fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),t||(t=a.createElement("path",{fill:"#D97757",d:"m4.714 15.956 4.718-2.648.079-.23-.08-.128h-.23l-.79-.048-2.695-.073-2.337-.097-2.265-.122-.57-.121-.535-.704.055-.353.48-.321.685.06 1.518.104 2.277.157 1.651.098 2.447.255h.389l.054-.158-.133-.097-.103-.098-2.356-1.596-2.55-1.688-1.336-.972-.722-.491L2 6.223l-.158-1.008.655-.722.88.06.225.061.893.686 1.906 1.476 2.49 1.833.364.304.146-.104.018-.072-.164-.274-1.354-2.446-1.445-2.49-.644-1.032-.17-.619a2.972 2.972 0 0 1-.103-.729L6.287.133 6.7 0l.995.134.42.364.619 1.415L9.735 4.14l1.555 3.03.455.898.243.832.09.255h.159V9.01l.127-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.583.28.48.685-.067.444-.286 1.851-.558 2.903-.365 1.942h.213l.243-.242.983-1.306 1.652-2.064.728-.82.85-.904.547-.431h1.032l.759 1.129-.34 1.166-1.063 1.347-.88 1.142-1.263 1.7-.79 1.36.074.11.188-.02 2.853-.606 1.542-.28 1.84-.315.832.388.09.395-.327.807-1.967.486-2.307.462-3.436.813-.043.03.049.061 1.548.146.662.036h1.62l3.018.225.79.522.473.638-.08.485-1.213.62-1.64-.389-3.825-.91-1.31-.329h-.183v.11l1.093 1.068 2.003 1.81 2.508 2.33.127.578-.321.455-.34-.049-2.204-1.657-.85-.747-1.925-1.62h-.127v.17l.443.649 2.343 3.521.122 1.08-.17.353-.607.213-.668-.122-1.372-1.924-1.415-2.168-1.141-1.943-.14.08-.674 7.254-.316.37-.728.28-.607-.461-.322-.747.322-1.476.388-1.924.316-1.53.285-1.9.17-.632-.012-.042-.14.018-1.432 1.967-2.18 2.945-1.724 1.845-.413.164-.716-.37.066-.662.401-.589 2.386-3.036 1.439-1.882.929-1.086-.006-.158h-.055L4.138 18.56l-1.13.146-.485-.456.06-.746.231-.243 1.907-1.312Z"})))},domains:["claude.ai","claude.com","anthropic.com"]},{name:"ChatGPT",icon:function(e){return a.createElement("svg",F({viewBox:"180 180 356 356",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i||(i=a.createElement("path",{fill:"currentColor",d:"M508.749 317.399c8.028-30.085.242-63.515-23.36-87.117-23.601-23.601-57.029-31.387-87.116-23.359-22.042-21.995-54.883-31.967-87.125-23.327-32.242 8.638-55.698 33.696-63.788 63.765-30.069 8.09-55.127 31.549-63.765 63.788-8.638 32.242 1.332 65.083 23.329 87.125-8.028 30.085-.241 63.515 23.36 87.117 23.601 23.601 57.029 31.388 87.117 23.359 22.041 21.995 54.885 31.967 87.124 23.329 32.242-8.638 55.698-33.695 63.788-63.764 30.07-8.091 55.127-31.549 63.765-63.789 8.638-32.241-1.331-65.083-23.329-87.124v-.003Zm-37.85-72.623c15.993 15.994 22.589 37.825 19.788 58.636l-75.11-43.366a10.23 10.23 0 0 0-10.232 0l-87.944 50.774v-33.294a6.586 6.586 0 0 1 3.275-5.689l66.968-38.663c26.534-14.821 60.702-10.951 83.257 11.602h-.002Zm-113.062 66.368 40.438 23.347v46.694l-40.438 23.347-40.439-23.347v-46.694l40.439-23.347Zm-93.061-41.451c.431-30.388 20.868-58.044 51.677-66.3 21.847-5.853 44.052-.649 60.674 12.18l-75.113 43.364a10.232 10.232 0 0 0-5.116 8.861v101.548l-28.833-16.647a6.59 6.59 0 0 1-3.289-5.682v-77.326.002Zm-61.385 46.761c5.853-21.846 21.463-38.476 40.885-46.455v86.731c0 3.654 1.95 7.033 5.116 8.861l87.945 50.774-28.834 16.648a6.586 6.586 0 0 1-6.564.007l-66.968-38.663c-26.103-15.568-39.833-47.096-31.58-77.903ZM244.775 470.9c-15.994-15.994-22.589-37.825-19.789-58.636l75.11 43.366a10.236 10.236 0 0 0 10.232 0l87.945-50.774v33.293a6.585 6.585 0 0 1-3.276 5.69l-66.968 38.663c-26.534 14.82-60.702 10.95-83.257-11.602h.003Zm206.122-24.918c-.431 30.389-20.868 58.045-51.677 66.301-21.847 5.853-44.052.649-60.673-12.181l75.112-43.364a10.229 10.229 0 0 0 5.116-8.861V346.329l28.834 16.648a6.59 6.59 0 0 1 3.288 5.682v77.326-.003Zm61.385-46.761c-5.853 21.847-21.463 38.476-40.885 46.455v-86.73a10.23 10.23 0 0 0-5.116-8.861l-87.945-50.774 28.834-16.648a6.586 6.586 0 0 1 6.564-.008l66.968 38.663c26.103 15.569 39.834 47.097 31.58 77.903Z"})))},iconSx:e=>({color:e.colors.$colorForeground}),domains:["chatgpt.com","openai.com"]}];var A=o(1046),G=o(8343),I=o(9793);function E({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,sx:[e=>({textAlign:"start",borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg,overflow:"hidden"}),n],elementDescriptor:A.$z.listGroup,children:e})}function T({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,sx:[e=>({padding:e.space.$3,background:G.s.mergedColorsBackground(I.T.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50)}),n],elementDescriptor:A.$z.listGroupHeader,children:e})}function R(e){return(0,r.Y)(p.EY,{...e,variant:"subtitle",elementDescriptor:A.$z.listGroupHeaderTitle})}function U({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,as:"ul",sx:[e=>({margin:e.sizes.$none,padding:e.sizes.$none,maxBlockSize:"10.9375rem",backgroundColor:e.colors.$colorBackground,overflowY:"auto",...G.s.unstyledScrollbar(e),"--fade-distance":"2.5rem","&::before, &::after":{content:'""',display:"block",position:"sticky",insetInline:0,blockSize:"var(--fade-distance)",pointerEvents:"none",zIndex:1,opacity:0},"&::before":{insetBlockStart:0,marginBlockEnd:"calc(var(--fade-distance) * -1)",background:`linear-gradient(to bottom, ${e.colors.$colorBackground}, transparent)`},"&::after":{insetBlockEnd:0,marginBlockStart:"calc(var(--fade-distance) * -1)",background:`linear-gradient(to top, ${e.colors.$colorBackground}, transparent)`},"@keyframes list-fade-top":{from:{opacity:0},to:{opacity:1}},"@keyframes list-fade-bottom":{from:{opacity:1},to:{opacity:0}},"@supports (animation-timeline: scroll())":{"&::before":{animationName:"list-fade-top",animationDuration:"auto",animationTimingFunction:"linear",animationFillMode:"both",animationTimeline:"scroll(y)",animationRange:"0 var(--fade-distance)"},"&::after":{animationName:"list-fade-bottom",animationDuration:"auto",animationTimingFunction:"linear",animationFillMode:"both",animationTimeline:"scroll(y)",animationRange:"calc(100% - var(--fade-distance)) 100%"}}}),n],elementDescriptor:A.$z.listGroupContent,children:e})}function Z({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,as:"li",sx:[e=>({display:"flex",alignItems:"baseline",paddingInline:e.space.$3,paddingBlock:e.space.$2,borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100,"&::before":{content:'""',display:"inline-block",width:e.space.$1,height:e.space.$1,background:e.colors.$colorMutedForeground,borderRadius:e.radii.$circle,transform:"translateY(-0.1875rem)",marginInlineEnd:e.space.$2,flexShrink:0}}),n],elementDescriptor:A.$z.listGroupItem,children:e})}function B(e){return(0,r.Y)(p.EY,{...e,variant:"subtitle",elementDescriptor:A.$z.listGroupItemLabel})}var _=o(5033);function O({children:e}){return(0,r.Y)(p.so,{justify:"center",align:"center",gap:4,sx:e=>({marginBlockEnd:e.space.$6}),elementDescriptor:A.$z.logoGroup,children:e})}function W({children:e,sx:n,...o}){return(0,r.Y)(p.so,{...o,sx:[{flex:1},n],elementDescriptor:A.$z.logoGroupItem,children:e})}function L({size:e="md",sx:n,children:o}){let t=n=>{let o="sm"===e?n.space.$6:n.space.$12,t="sm"===e?n.space.$3:n.space.$5;return{width:o,height:o,"&& > *":{width:t,height:t}}};return(0,r.Y)(p.az,{sx:e=>[{background:G.s.mergedColorsBackground(I.T.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50),borderRadius:e.radii.$circle,borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,display:"flex",alignItems:"center",justifyContent:"center"},t,n],elementDescriptor:A.$z.logoGroupItemContainer,children:o})}function j({icon:e=_.A,iconSx:n=e=>({color:e.colors.$primary500}),label:o}){return(0,r.Y)(p.In,{icon:e,sx:n,elementDescriptor:A.$z.logoGroupIcon,role:o?"img":void 0,"aria-label":o,"aria-hidden":!o||void 0})}function M(){return(0,r.Y)(p.az,{as:"svg",fill:"none",viewBox:"0 0 16 2",height:2,"aria-hidden":!0,sx:e=>({color:e.colors.$colorMutedForeground}),elementDescriptor:A.$z.logoGroupSeparator,children:(0,r.Y)("path",{stroke:"currentColor",strokeDasharray:"0.1 4",strokeLinecap:"round",strokeWidth:"2",d:"M1 1h14"})})}var N=o(3919),K=o(3693);function P({options:e,value:n,onChange:o}){let t=(0,a.useRef)(null),i=e.find(e=>e.value===n);return(0,r.FD)(N.l6,{options:e,value:n,onChange:e=>o(e.value),referenceElement:t,renderOption:(e,n,o)=>(0,r.FD)(p.az,{as:"span",sx:e=>({width:"100%",display:"grid",gridTemplateColumns:`${e.sizes.$5} 1fr ${e.sizes.$3}`,columnGap:e.space.$2,paddingInlineStart:e.space.$1,paddingInlineEnd:e.space.$1x5,paddingBlock:e.space.$1,alignItems:"center",borderRadius:e.radii.$md,'&:hover, &[data-focused="true"]':{background:G.s.mutedBackground(e)}}),children:[(0,r.Y)(p._V,{src:e.logoUrl,alt:e.label,sx:e=>({width:e.sizes.$5,height:e.sizes.$5,objectFit:"contain",flexShrink:0,borderRadius:e.radii.$md})}),(0,r.Y)(p.EY,{sx:{flex:1,textAlign:"start",minWidth:0,maxInlineSize:"200px"},truncate:!0,as:"span",variant:"subtitle",children:e.label}),o&&(0,r.Y)(p.In,{icon:K.A,sx:e=>({color:e.colors.$primary500})})]}),children:[(0,r.FD)(N.JC,{ref:t,"aria-haspopup":"listbox",sx:e=>({paddingInline:e.space.$3}),children:[(0,r.Y)(p._V,{src:i?.logoUrl||"",alt:i?.label||"",sx:e=>({width:e.sizes.$5,height:e.sizes.$5,borderRadius:e.radii.$md,objectFit:"contain",flexShrink:0})}),(0,r.Y)(p.EY,{colorScheme:"body",as:"span",truncate:!0,sx:{flex:1,minWidth:0,textAlign:"start"},children:i?.label||"Select an option"})]}),(0,r.Y)(N.UL,{})]})}let V=()=>"u">typeof window&&!!window.location,q=/^(\d{1,3}\.){3}\d{1,3}$/,H="offline_access";function J({onOpen:e,onClose:n,isOpen:o,redirectUri:t,oauthApplicationName:i}){return o?(0,r.Y)(v.Modal,{handleOpen:e,handleClose:n,children:(0,r.Y)(f.Z.Root,{children:(0,r.FD)(f.Z.Content,{children:[(0,r.FD)(b.Y.Root,{children:[(0,r.Y)(b.Y.Title,{localizationKey:(0,h.G)("oauthConsent.redirectUriModal.title")}),(0,r.Y)(b.Y.Subtitle,{localizationKey:(0,h.G)("oauthConsent.redirectUriModal.subtitle",{applicationName:i})})]}),(0,r.Y)(y.TM,{style:{maxHeight:"none"},cols:50,rows:6,defaultValue:t,readOnly:!0})]})})}):null}let Q=(0,d.G)((0,Y.dm)(function(){let e=(0,c.W)(),n=(0,l.ho)(),{user:o}=(0,l.Jd)(),{displayConfig:{applicationName:t,logoImageUrl:i},organizationSettings:d}=(0,s.O)(),[m,Y]=(0,a.useState)(!1),[v,y]=(0,a.useState)(null),C=!!(e.onAllow||e.onDeny),k=function(){if(!V())return{oauthClientId:""};let e=new URLSearchParams(window.location.search),n=e.get("client_id")??"",o=e.get("scope")??void 0;return void 0!==o?{oauthClientId:n,scope:o}:{oauthClientId:n}}(),w=e.oauthClientId??k.oauthClientId,D=e.scope??k.scope,F=e.redirectUrl??(V()?new URL(window.location.href).searchParams.get("redirect_uri")??"":""),{data:A,isLoading:G,error:I}=(0,l.$U)({oauthClientId:w,scope:D,redirectUri:F||void 0,enabled:!C}),_=A?.scopes?.map(e=>({scope:e.scope,description:e.description,requires_consent:e.requiresConsent})),N=e.scopes??_??[],K=e.oauthApplicationName??A?.oauthApplicationName??"",Q=e.oauthApplicationLogoUrl??A?.oauthApplicationLogoUrl,X=e.oauthApplicationUrl??A?.oauthApplicationUrl,ee=e.redirectUrl??F,en=!!(N.some(e=>"user:org:read"===e.scope)&&d.enabled),eo=en?(o?.organizationMemberships??[]).map(e=>({value:e.organization.id,label:e.organization.name,logoUrl:e.organization.imageUrl})):[],et=n.session?.lastActiveOrganizationId,ei=eo.find(e=>e.value===et)?.value??eo[0]?.value??null,er=v??ei,{t:el}=(0,u._)(),ea=A?.redirectDomain??function(e){let n;try{n=new URL(e).hostname}catch{return""}if(!n)return"";let o=n.startsWith("[")&&n.endsWith("]")?n.slice(1,-1):n;return q.test(o)?o:o.includes(":")?`[${o}]`:o.split(".").slice(-2).join(".")}(ee),ec=el((0,h.G)("oauthConsent.viewFullUrl")),es=Q?void 0:function(e){if(!e)return;let n=e.trim().toLowerCase();return S.find(e=>e.domains.includes(n))}(ea);if(!C){let e=w?ee?I?I.message??"Failed to load consent information.":void 0:"The redirect URI is missing.":"The client ID is missing.";if(e)return(0,r.FD)(f.Z.Root,{children:[(0,r.Y)(f.Z.Content,{children:(0,r.Y)(f.Z.Alert,{children:e})}),(0,r.Y)(f.Z.Footer,{})]});if(G)return(0,r.FD)(f.Z.Root,{children:[(0,r.Y)(f.Z.Content,{children:(0,r.Y)($.W,{})}),(0,r.Y)(f.Z.Footer,{})]})}let ed=n.oauthApplication.buildConsentActionUrl({clientId:w}),eu=V()?Array.from(new URLSearchParams(window.location.search).entries()):[],eh=o?.primaryEmailAddress?.emailAddress||o?.primaryPhoneNumber?.phoneNumber,ep=N.filter(e=>e.scope!==H),em=N.some(e=>e.scope===H);return(0,r.FD)(r.FK,{children:[(0,r.FD)("form",{method:"POST",action:ed,onSubmit:n=>{if(!C)return;n.preventDefault();let o=n.nativeEvent.submitter;o?.value==="true"?e.onAllow?.():e.onDeny?.()},children:[(0,r.FD)(f.Z.Root,{children:[(0,r.FD)(f.Z.Content,{children:[(0,r.FD)(b.Y.Root,{children:[Q&&i&&(0,r.FD)(O,{children:[(0,r.Y)(W,{justify:"end",children:(0,r.Y)(L,{children:(0,r.Y)(g.G,{src:Q,alt:K,href:X,isExternal:!0})})}),(0,r.Y)(M,{}),(0,r.Y)(W,{justify:"start",children:(0,r.Y)(L,{children:(0,r.Y)(g.G,{})})})]}),Q&&!i&&(0,r.Y)(O,{children:(0,r.FD)(p.az,{sx:{position:"relative"},children:[(0,r.Y)(L,{children:(0,r.Y)(g.G,{src:Q,alt:K,href:X,isExternal:!0})}),(0,r.Y)(L,{size:"sm",sx:e=>({position:"absolute",bottom:`calc(${e.space.$2x5} * -1)`,insetInlineEnd:`calc(${e.space.$2x5} * -1)`}),children:(0,r.Y)(j,{})})]})}),!Q&&i&&(0,r.FD)(O,{children:[(0,r.Y)(W,{justify:"end",children:(0,r.Y)(L,{children:(0,r.Y)(j,{icon:es?.icon,iconSx:es?.iconSx,label:es?.name})})}),(0,r.Y)(M,{}),(0,r.Y)(W,{justify:"start",children:(0,r.Y)(L,{children:(0,r.Y)(g.G,{})})})]}),!Q&&!i&&(0,r.Y)(O,{children:(0,r.Y)(L,{children:(0,r.Y)(j,{icon:es?.icon,iconSx:es?.iconSx,label:es?.name})})}),(0,r.Y)(b.Y.Title,{localizationKey:K}),(0,r.Y)(b.Y.Subtitle,{localizationKey:(0,h.G)("oauthConsent.subtitle",{applicationName:t,identifier:eh||""})})]}),en&&eo.length>0&&er&&(0,r.Y)(P,{options:eo,value:er,onChange:y}),(0,r.FD)(E,{children:[(0,r.Y)(T,{children:(0,r.Y)(R,{localizationKey:(0,h.G)("oauthConsent.scopeList.title",{applicationName:K})})}),(0,r.Y)(U,{children:ep.map(e=>(0,r.Y)(Z,{children:(0,r.Y)(B,{children:e.description||e.scope||""})},e.scope))})]}),(0,r.Y)(x.F,{colorScheme:"warning",children:(0,r.Y)(p.EY,{colorScheme:"warning",variant:"caption",children:(0,r.Y)(z,{text:el((0,h.G)("oauthConsent.warning",{applicationName:K||t,domainAction:ea})),actionText:ea,onClick:()=>Y(!0),tooltipText:ec})})}),(0,r.FD)(p.xA,{columns:2,gap:3,children:[(0,r.Y)(p.$n,{type:"submit",name:"consented",value:"false",colorScheme:"secondary",variant:"outline",localizationKey:(0,h.G)("oauthConsent.action__deny")}),(0,r.Y)(p.$n,{type:"submit",name:"consented",value:"true",localizationKey:(0,h.G)("oauthConsent.action__allow")}),(0,r.FD)(p.EY,{sx:{gridColumn:"span 2"},colorScheme:"secondary",variant:"caption",children:[(0,r.Y)(z,{text:el((0,h.G)("oauthConsent.redirectNotice",{domainAction:ea})),actionText:ea,onClick:()=>Y(!0),tooltipText:ec}),em&&el((0,h.G)("oauthConsent.offlineAccessNotice"))]})]})]}),(0,r.Y)(f.Z.Footer,{})]}),!C&&eu.map(([e,n])=>(0,r.Y)("input",{type:"hidden",name:e,value:n},e)),!C&&en&&er&&(0,r.Y)("input",{type:"hidden",name:"organization_id",value:er})]}),(0,r.Y)(J,{isOpen:m,onOpen:()=>Y(!0),onClose:()=>Y(!1),redirectUri:ee,oauthApplicationName:K})]})})),X=()=>(0,r.Y)(m.n.Root,{flow:"oauthConsent",children:(0,r.Y)(m.n.Part,{children:(0,r.Y)(C.d,{children:(0,r.Y)(k.q,{children:(0,r.Y)(Q,{})})})})})},4480(e,n,o){var t=o(9701);let i=(0,t.createContext)(null);o.d(n,{},{W:()=>{let e=(0,t.useContext)(i);if(null===e)throw Error("Clerk: useOAuthConsentContext called outside of the mounted OAuthConsent component.");return e},n:i})}}]);
|
|
1
|
+
"use strict";(globalThis.rspackChunk_clerk_ui=globalThis.rspackChunk_clerk_ui||[]).push([[5591],{8051(e,n,o){o.r(n),o.d(n,{OAuthConsent:()=>X});var t,i,r=o(9763),l=o(6262),a=o(9701),c=o(4480),s=o(1868),d=o(9203),u=o(6887),h=o(8342),p=o(9230),m=o(4641),g=o(914),f=o(5402),Y=o(7308),b=o(9642),v=o(9095),$=o(2574),x=o(6674),y=o(9684),C=o(6661),k=o(9922),w=o(5880);function z({text:e,actionText:n,onClick:o,tooltipText:t}){let i=e.indexOf(n);if(-1===i)return(0,r.Y)(r.FK,{children:e});let l=e.slice(0,i),a=e.slice(i+n.length),c="",s="";l.endsWith("(")&&(l=l.slice(0,-1),c="("),a.startsWith(")")&&(a=a.slice(1),s=")");let d=(0,r.FD)(w.m_.Root,{children:[(0,r.Y)(w.m_.Trigger,{children:(0,r.Y)(p.EY,{as:"span",role:"button",tabIndex:0,"aria-label":t,variant:"caption",onClick:o,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),o())},sx:e=>({textDecoration:"underline",textDecorationStyle:"dotted",cursor:"pointer",outline:"none",display:"inline-block","&:focus-visible":{outline:"2px solid",outlineColor:e.colors.$colorRing}}),children:n})}),(0,r.Y)(w.m_.Content,{text:t})]});return(0,r.FD)(r.FK,{children:[l,c||s?(0,r.FD)(p.EY,{as:"span",sx:{whiteSpace:"nowrap"},children:[c,d,s]}):d,a]})}function D(){return(D=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(null,arguments)}function F(){return(F=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(null,arguments)}let S=[{name:"Claude",icon:function(e){return a.createElement("svg",D({fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),t||(t=a.createElement("path",{fill:"#D97757",d:"m4.714 15.956 4.718-2.648.079-.23-.08-.128h-.23l-.79-.048-2.695-.073-2.337-.097-2.265-.122-.57-.121-.535-.704.055-.353.48-.321.685.06 1.518.104 2.277.157 1.651.098 2.447.255h.389l.054-.158-.133-.097-.103-.098-2.356-1.596-2.55-1.688-1.336-.972-.722-.491L2 6.223l-.158-1.008.655-.722.88.06.225.061.893.686 1.906 1.476 2.49 1.833.364.304.146-.104.018-.072-.164-.274-1.354-2.446-1.445-2.49-.644-1.032-.17-.619a2.972 2.972 0 0 1-.103-.729L6.287.133 6.7 0l.995.134.42.364.619 1.415L9.735 4.14l1.555 3.03.455.898.243.832.09.255h.159V9.01l.127-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.583.28.48.685-.067.444-.286 1.851-.558 2.903-.365 1.942h.213l.243-.242.983-1.306 1.652-2.064.728-.82.85-.904.547-.431h1.032l.759 1.129-.34 1.166-1.063 1.347-.88 1.142-1.263 1.7-.79 1.36.074.11.188-.02 2.853-.606 1.542-.28 1.84-.315.832.388.09.395-.327.807-1.967.486-2.307.462-3.436.813-.043.03.049.061 1.548.146.662.036h1.62l3.018.225.79.522.473.638-.08.485-1.213.62-1.64-.389-3.825-.91-1.31-.329h-.183v.11l1.093 1.068 2.003 1.81 2.508 2.33.127.578-.321.455-.34-.049-2.204-1.657-.85-.747-1.925-1.62h-.127v.17l.443.649 2.343 3.521.122 1.08-.17.353-.607.213-.668-.122-1.372-1.924-1.415-2.168-1.141-1.943-.14.08-.674 7.254-.316.37-.728.28-.607-.461-.322-.747.322-1.476.388-1.924.316-1.53.285-1.9.17-.632-.012-.042-.14.018-1.432 1.967-2.18 2.945-1.724 1.845-.413.164-.716-.37.066-.662.401-.589 2.386-3.036 1.439-1.882.929-1.086-.006-.158h-.055L4.138 18.56l-1.13.146-.485-.456.06-.746.231-.243 1.907-1.312Z"})))},domains:["claude.ai","claude.com","anthropic.com"]},{name:"ChatGPT",icon:function(e){return a.createElement("svg",F({viewBox:"180 180 356 356",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i||(i=a.createElement("path",{fill:"currentColor",d:"M508.749 317.399c8.028-30.085.242-63.515-23.36-87.117-23.601-23.601-57.029-31.387-87.116-23.359-22.042-21.995-54.883-31.967-87.125-23.327-32.242 8.638-55.698 33.696-63.788 63.765-30.069 8.09-55.127 31.549-63.765 63.788-8.638 32.242 1.332 65.083 23.329 87.125-8.028 30.085-.241 63.515 23.36 87.117 23.601 23.601 57.029 31.388 87.117 23.359 22.041 21.995 54.885 31.967 87.124 23.329 32.242-8.638 55.698-33.695 63.788-63.764 30.07-8.091 55.127-31.549 63.765-63.789 8.638-32.241-1.331-65.083-23.329-87.124v-.003Zm-37.85-72.623c15.993 15.994 22.589 37.825 19.788 58.636l-75.11-43.366a10.23 10.23 0 0 0-10.232 0l-87.944 50.774v-33.294a6.586 6.586 0 0 1 3.275-5.689l66.968-38.663c26.534-14.821 60.702-10.951 83.257 11.602h-.002Zm-113.062 66.368 40.438 23.347v46.694l-40.438 23.347-40.439-23.347v-46.694l40.439-23.347Zm-93.061-41.451c.431-30.388 20.868-58.044 51.677-66.3 21.847-5.853 44.052-.649 60.674 12.18l-75.113 43.364a10.232 10.232 0 0 0-5.116 8.861v101.548l-28.833-16.647a6.59 6.59 0 0 1-3.289-5.682v-77.326.002Zm-61.385 46.761c5.853-21.846 21.463-38.476 40.885-46.455v86.731c0 3.654 1.95 7.033 5.116 8.861l87.945 50.774-28.834 16.648a6.586 6.586 0 0 1-6.564.007l-66.968-38.663c-26.103-15.568-39.833-47.096-31.58-77.903ZM244.775 470.9c-15.994-15.994-22.589-37.825-19.789-58.636l75.11 43.366a10.236 10.236 0 0 0 10.232 0l87.945-50.774v33.293a6.585 6.585 0 0 1-3.276 5.69l-66.968 38.663c-26.534 14.82-60.702 10.95-83.257-11.602h.003Zm206.122-24.918c-.431 30.389-20.868 58.045-51.677 66.301-21.847 5.853-44.052.649-60.673-12.181l75.112-43.364a10.229 10.229 0 0 0 5.116-8.861V346.329l28.834 16.648a6.59 6.59 0 0 1 3.288 5.682v77.326-.003Zm61.385-46.761c-5.853 21.847-21.463 38.476-40.885 46.455v-86.73a10.23 10.23 0 0 0-5.116-8.861l-87.945-50.774 28.834-16.648a6.586 6.586 0 0 1 6.564-.008l66.968 38.663c26.103 15.569 39.834 47.097 31.58 77.903Z"})))},iconSx:e=>({color:e.colors.$colorForeground}),domains:["chatgpt.com","openai.com"]}];var A=o(1046),G=o(8343),I=o(9793);function E({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,sx:[e=>({textAlign:"start",borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg,overflow:"hidden"}),n],elementDescriptor:A.$z.listGroup,children:e})}function T({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,sx:[e=>({padding:e.space.$3,background:G.s.mergedColorsBackground(I.T.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50)}),n],elementDescriptor:A.$z.listGroupHeader,children:e})}function R(e){return(0,r.Y)(p.EY,{...e,variant:"subtitle",elementDescriptor:A.$z.listGroupHeaderTitle})}function U({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,as:"ul",sx:[e=>({margin:e.sizes.$none,padding:e.sizes.$none,maxBlockSize:"10.9375rem",backgroundColor:e.colors.$colorBackground,overflowY:"auto",...G.s.unstyledScrollbar(e),"--fade-distance":"2.5rem","&::before, &::after":{content:'""',display:"block",position:"sticky",insetInline:0,blockSize:"var(--fade-distance)",pointerEvents:"none",zIndex:1,opacity:0},"&::before":{insetBlockStart:0,marginBlockEnd:"calc(var(--fade-distance) * -1)",background:`linear-gradient(to bottom, ${e.colors.$colorBackground}, transparent)`},"&::after":{insetBlockEnd:0,marginBlockStart:"calc(var(--fade-distance) * -1)",background:`linear-gradient(to top, ${e.colors.$colorBackground}, transparent)`},"@keyframes list-fade-top":{from:{opacity:0},to:{opacity:1}},"@keyframes list-fade-bottom":{from:{opacity:1},to:{opacity:0}},"@supports (animation-timeline: scroll())":{"&::before":{animationName:"list-fade-top",animationDuration:"auto",animationTimingFunction:"linear",animationFillMode:"both",animationTimeline:"scroll(y)",animationRange:"0 var(--fade-distance)"},"&::after":{animationName:"list-fade-bottom",animationDuration:"auto",animationTimingFunction:"linear",animationFillMode:"both",animationTimeline:"scroll(y)",animationRange:"calc(100% - var(--fade-distance)) 100%"}}}),n],elementDescriptor:A.$z.listGroupContent,children:e})}function Z({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,as:"li",sx:[e=>({display:"flex",alignItems:"baseline",paddingInline:e.space.$3,paddingBlock:e.space.$2,borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100,"&::before":{content:'""',display:"inline-block",width:e.space.$1,height:e.space.$1,background:e.colors.$colorMutedForeground,borderRadius:e.radii.$circle,transform:"translateY(-0.1875rem)",marginInlineEnd:e.space.$2,flexShrink:0}}),n],elementDescriptor:A.$z.listGroupItem,children:e})}function _(e){return(0,r.Y)(p.EY,{...e,variant:"subtitle",elementDescriptor:A.$z.listGroupItemLabel})}var B=o(5033);function O({children:e}){return(0,r.Y)(p.so,{justify:"center",align:"center",gap:4,sx:e=>({marginBlockEnd:e.space.$6}),elementDescriptor:A.$z.logoGroup,children:e})}function L({children:e,sx:n,...o}){return(0,r.Y)(p.so,{...o,sx:[{flex:1},n],elementDescriptor:A.$z.logoGroupItem,children:e})}function W({size:e="md",sx:n,children:o}){let t=n=>{let o="sm"===e?n.space.$6:n.space.$12,t="sm"===e?n.space.$3:n.space.$5;return{width:o,height:o,"&& > *":{width:t,height:t}}};return(0,r.Y)(p.az,{sx:e=>[{background:G.s.mergedColorsBackground(I.T.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50),borderRadius:e.radii.$circle,borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,display:"flex",alignItems:"center",justifyContent:"center"},t,n],elementDescriptor:A.$z.logoGroupItemContainer,children:o})}function j({icon:e=B.A,iconSx:n=e=>({color:e.colors.$primary500}),label:o}){return(0,r.Y)(p.In,{icon:e,sx:n,elementDescriptor:A.$z.logoGroupIcon,role:o?"img":void 0,"aria-label":o,"aria-hidden":!o||void 0})}function M(){return(0,r.Y)(p.az,{as:"svg",fill:"none",viewBox:"0 0 16 2",height:2,"aria-hidden":!0,sx:e=>({color:e.colors.$colorMutedForeground}),elementDescriptor:A.$z.logoGroupSeparator,children:(0,r.Y)("path",{stroke:"currentColor",strokeDasharray:"0.1 4",strokeLinecap:"round",strokeWidth:"2",d:"M1 1h14"})})}var N=o(3919),K=o(3693);function P({options:e,value:n,onChange:o}){let t=(0,a.useRef)(null),i=e.find(e=>e.value===n);return(0,r.FD)(N.l6,{options:e,value:n,onChange:e=>o(e.value),referenceElement:t,renderOption:(e,n,o)=>(0,r.FD)(p.az,{as:"span",sx:e=>({width:"100%",display:"grid",gridTemplateColumns:`${e.sizes.$5} 1fr ${e.sizes.$3}`,columnGap:e.space.$2,paddingInlineStart:e.space.$1,paddingInlineEnd:e.space.$1x5,paddingBlock:e.space.$1,alignItems:"center",borderRadius:e.radii.$md,'&:hover, &[data-focused="true"]':{background:G.s.mutedBackground(e)}}),children:[(0,r.Y)(p._V,{src:e.logoUrl,alt:e.label,sx:e=>({width:e.sizes.$5,height:e.sizes.$5,objectFit:"contain",flexShrink:0,borderRadius:e.radii.$md})}),(0,r.Y)(p.EY,{sx:{flex:1,textAlign:"start",minWidth:0,maxInlineSize:"200px"},truncate:!0,as:"span",variant:"subtitle",children:e.label}),o&&(0,r.Y)(p.In,{icon:K.A,sx:e=>({color:e.colors.$primary500})})]}),children:[(0,r.FD)(N.JC,{ref:t,"aria-haspopup":"listbox",sx:e=>({paddingInline:e.space.$3}),children:[(0,r.Y)(p._V,{src:i?.logoUrl||"",alt:i?.label||"",sx:e=>({width:e.sizes.$5,height:e.sizes.$5,borderRadius:e.radii.$md,objectFit:"contain",flexShrink:0})}),(0,r.Y)(p.EY,{colorScheme:"body",as:"span",truncate:!0,sx:{flex:1,minWidth:0,textAlign:"start"},children:i?.label||"Select an option"})]}),(0,r.Y)(N.UL,{})]})}let V=()=>"u">typeof window&&!!window.location,q=/^(\d{1,3}\.){3}\d{1,3}$/,H="offline_access";function J({onOpen:e,onClose:n,isOpen:o,redirectUri:t,oauthApplicationName:i}){return o?(0,r.Y)($.Modal,{handleOpen:e,handleClose:n,children:(0,r.Y)(f.Z.Root,{children:(0,r.FD)(f.Z.Content,{children:[(0,r.FD)(b.Y.Root,{children:[(0,r.Y)(b.Y.Title,{localizationKey:(0,h.G)("oauthConsent.redirectUriModal.title")}),(0,r.Y)(b.Y.Subtitle,{localizationKey:(0,h.G)("oauthConsent.redirectUriModal.subtitle",{applicationName:i})})]}),(0,r.Y)(y.TM,{style:{maxHeight:"none"},cols:50,rows:6,defaultValue:t,readOnly:!0})]})})}):null}let Q=(0,d.G)((0,Y.dm)(function(){let e=(0,c.W)(),n=(0,l.ho)(),{user:o}=(0,l.Jd)(),{displayConfig:{applicationName:t,logoImageUrl:i},organizationSettings:d}=(0,s.O)(),[m,Y]=(0,a.useState)(!1),[$,y]=(0,a.useState)(null),C=!!(e.onAllow||e.onDeny),k=function(){if(!V())return{oauthClientId:""};let e=new URLSearchParams(window.location.search),n=e.get("client_id")??"",o=e.get("scope")??void 0;return void 0!==o?{oauthClientId:n,scope:o}:{oauthClientId:n}}(),w=e.oauthClientId??k.oauthClientId,D=e.scope??k.scope,F=e.redirectUrl??(V()?new URL(window.location.href).searchParams.get("redirect_uri")??"":""),{data:A,isLoading:G,error:I}=(0,l.$U)({oauthClientId:w,scope:D,redirectUri:F||void 0,enabled:!C}),B=A?.scopes?.map(e=>({scope:e.scope,description:e.description,requires_consent:e.requiresConsent})),N=e.scopes??B??[],K=e.oauthApplicationName??A?.oauthApplicationName??"",Q=e.oauthApplicationLogoUrl??A?.oauthApplicationLogoUrl,X=e.oauthApplicationUrl??A?.oauthApplicationUrl,ee=e.redirectUrl??F,en=!!(N.some(e=>"user:org:read"===e.scope)&&d.enabled),eo=en?(o?.organizationMemberships??[]).map(e=>({value:e.organization.id,label:e.organization.name,logoUrl:e.organization.imageUrl})):[],et=n.session?.lastActiveOrganizationId,ei=eo.find(e=>e.value===et)?.value??eo[0]?.value??null,er=$??ei,{t:el}=(0,u._)(),ea=A?.redirectDomain??function(e){let n;try{n=new URL(e).hostname}catch{return""}if(!n)return"";let o=n.startsWith("[")&&n.endsWith("]")?n.slice(1,-1):n;return q.test(o)?o:o.includes(":")?`[${o}]`:o.split(".").slice(-2).join(".")}(ee),ec=el((0,h.G)("oauthConsent.viewFullUrl")),es=Q?void 0:function(e){if(!e)return;let n=e.trim().toLowerCase();return S.find(e=>e.domains.includes(n))}(ea);if(!C){let e=w?ee?I?I.message??"Failed to load consent information.":void 0:"The redirect URI is missing.":"The client ID is missing.";if(e)return(0,r.FD)(f.Z.Root,{children:[(0,r.Y)(f.Z.Content,{children:(0,r.Y)(f.Z.Alert,{children:e})}),(0,r.Y)(f.Z.Footer,{})]});if(G)return(0,r.FD)(f.Z.Root,{children:[(0,r.Y)(f.Z.Content,{children:(0,r.Y)(v.W,{})}),(0,r.Y)(f.Z.Footer,{})]})}let ed=n.oauthApplication.buildConsentActionUrl({clientId:w}),eu=V()?Array.from(new URLSearchParams(window.location.search).entries()):[],eh=o?.primaryEmailAddress?.emailAddress||o?.primaryPhoneNumber?.phoneNumber,ep=N.filter(e=>e.scope!==H).map(e=>({...e,description:"private_metadata"===e.scope?el((0,h.G)("oauthConsent.scopeList.privateMetadata",{applicationName:t})):e.description})),em=N.some(e=>e.scope===H);return(0,r.FD)(r.FK,{children:[(0,r.FD)("form",{method:"POST",action:ed,onSubmit:n=>{if(!C)return;n.preventDefault();let o=n.nativeEvent.submitter;o?.value==="true"?e.onAllow?.():e.onDeny?.()},children:[(0,r.FD)(f.Z.Root,{children:[(0,r.FD)(f.Z.Content,{children:[(0,r.FD)(b.Y.Root,{children:[Q&&i&&(0,r.FD)(O,{children:[(0,r.Y)(L,{justify:"end",children:(0,r.Y)(W,{children:(0,r.Y)(g.G,{src:Q,alt:K,href:X,isExternal:!0})})}),(0,r.Y)(M,{}),(0,r.Y)(L,{justify:"start",children:(0,r.Y)(W,{children:(0,r.Y)(g.G,{})})})]}),Q&&!i&&(0,r.Y)(O,{children:(0,r.FD)(p.az,{sx:{position:"relative"},children:[(0,r.Y)(W,{children:(0,r.Y)(g.G,{src:Q,alt:K,href:X,isExternal:!0})}),(0,r.Y)(W,{size:"sm",sx:e=>({position:"absolute",bottom:`calc(${e.space.$2x5} * -1)`,insetInlineEnd:`calc(${e.space.$2x5} * -1)`}),children:(0,r.Y)(j,{})})]})}),!Q&&i&&(0,r.FD)(O,{children:[(0,r.Y)(L,{justify:"end",children:(0,r.Y)(W,{children:(0,r.Y)(j,{icon:es?.icon,iconSx:es?.iconSx,label:es?.name})})}),(0,r.Y)(M,{}),(0,r.Y)(L,{justify:"start",children:(0,r.Y)(W,{children:(0,r.Y)(g.G,{})})})]}),!Q&&!i&&(0,r.Y)(O,{children:(0,r.Y)(W,{children:(0,r.Y)(j,{icon:es?.icon,iconSx:es?.iconSx,label:es?.name})})}),(0,r.Y)(b.Y.Title,{localizationKey:K}),(0,r.Y)(b.Y.Subtitle,{localizationKey:(0,h.G)("oauthConsent.subtitle",{applicationName:t,identifier:eh||""})})]}),en&&eo.length>0&&er&&(0,r.Y)(P,{options:eo,value:er,onChange:y}),(0,r.FD)(E,{children:[(0,r.Y)(T,{children:(0,r.Y)(R,{localizationKey:(0,h.G)("oauthConsent.scopeList.title",{applicationName:K})})}),(0,r.Y)(U,{children:ep.map(e=>(0,r.Y)(Z,{children:(0,r.Y)(_,{children:e.description||e.scope||""})},e.scope))})]}),(0,r.Y)(x.F,{colorScheme:"warning",children:(0,r.Y)(p.EY,{colorScheme:"warning",variant:"caption",children:(0,r.Y)(z,{text:el((0,h.G)("oauthConsent.warning",{applicationName:K||t,domainAction:ea})),actionText:ea,onClick:()=>Y(!0),tooltipText:ec})})}),(0,r.FD)(p.xA,{columns:2,gap:3,children:[(0,r.Y)(p.$n,{type:"submit",name:"consented",value:"false",colorScheme:"secondary",variant:"outline",localizationKey:(0,h.G)("oauthConsent.action__deny")}),(0,r.Y)(p.$n,{type:"submit",name:"consented",value:"true",localizationKey:(0,h.G)("oauthConsent.action__allow")}),(0,r.FD)(p.EY,{sx:{gridColumn:"span 2"},colorScheme:"secondary",variant:"caption",children:[(0,r.Y)(z,{text:el((0,h.G)("oauthConsent.redirectNotice",{domainAction:ea})),actionText:ea,onClick:()=>Y(!0),tooltipText:ec}),em&&el((0,h.G)("oauthConsent.offlineAccessNotice"))]})]})]}),(0,r.Y)(f.Z.Footer,{})]}),!C&&eu.map(([e,n])=>(0,r.Y)("input",{type:"hidden",name:e,value:n},e)),!C&&en&&er&&(0,r.Y)("input",{type:"hidden",name:"organization_id",value:er})]}),(0,r.Y)(J,{isOpen:m,onOpen:()=>Y(!0),onClose:()=>Y(!1),redirectUri:ee,oauthApplicationName:K})]})})),X=()=>(0,r.Y)(m.n.Root,{flow:"oauthConsent",children:(0,r.Y)(m.n.Part,{children:(0,r.Y)(C.d,{children:(0,r.Y)(k.q,{children:(0,r.Y)(Q,{})})})})})},4480(e,n,o){var t=o(9701);let i=(0,t.createContext)(null);o.d(n,{},{W:()=>{let e=(0,t.useContext)(i);if(null===e)throw Error("Clerk: useOAuthConsentContext called outside of the mounted OAuthConsent component.");return e},n:i})}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.rspackChunk_clerk_ui=globalThis.rspackChunk_clerk_ui||[]).push([[5591],{8051(e,n,o){o.r(n),o.d(n,{OAuthConsent:()=>X});var t,i,r=o(9763),l=o(6262),a=o(630),c=o(4480),s=o(1868),d=o(9203),u=o(6887),h=o(8342),p=o(9230),m=o(4641),g=o(914),f=o(5402),Y=o(7308),b=o(9642),$=o(9095),v=o(2574),x=o(6674),y=o(9684),C=o(6661),k=o(9922),w=o(5880);function z({text:e,actionText:n,onClick:o,tooltipText:t}){let i=e.indexOf(n);if(-1===i)return(0,r.Y)(r.FK,{children:e});let l=e.slice(0,i),a=e.slice(i+n.length),c="",s="";l.endsWith("(")&&(l=l.slice(0,-1),c="("),a.startsWith(")")&&(a=a.slice(1),s=")");let d=(0,r.FD)(w.m_.Root,{children:[(0,r.Y)(w.m_.Trigger,{children:(0,r.Y)(p.EY,{as:"span",role:"button",tabIndex:0,"aria-label":t,variant:"caption",onClick:o,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),o())},sx:e=>({textDecoration:"underline",textDecorationStyle:"dotted",cursor:"pointer",outline:"none",display:"inline-block","&:focus-visible":{outline:"2px solid",outlineColor:e.colors.$colorRing}}),children:n})}),(0,r.Y)(w.m_.Content,{text:t})]});return(0,r.FD)(r.FK,{children:[l,c||s?(0,r.FD)(p.EY,{as:"span",sx:{whiteSpace:"nowrap"},children:[c,d,s]}):d,a]})}function D(){return(D=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(null,arguments)}function F(){return(F=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(null,arguments)}let S=[{name:"Claude",icon:function(e){return a.createElement("svg",D({fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),t||(t=a.createElement("path",{fill:"#D97757",d:"m4.714 15.956 4.718-2.648.079-.23-.08-.128h-.23l-.79-.048-2.695-.073-2.337-.097-2.265-.122-.57-.121-.535-.704.055-.353.48-.321.685.06 1.518.104 2.277.157 1.651.098 2.447.255h.389l.054-.158-.133-.097-.103-.098-2.356-1.596-2.55-1.688-1.336-.972-.722-.491L2 6.223l-.158-1.008.655-.722.88.06.225.061.893.686 1.906 1.476 2.49 1.833.364.304.146-.104.018-.072-.164-.274-1.354-2.446-1.445-2.49-.644-1.032-.17-.619a2.972 2.972 0 0 1-.103-.729L6.287.133 6.7 0l.995.134.42.364.619 1.415L9.735 4.14l1.555 3.03.455.898.243.832.09.255h.159V9.01l.127-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.583.28.48.685-.067.444-.286 1.851-.558 2.903-.365 1.942h.213l.243-.242.983-1.306 1.652-2.064.728-.82.85-.904.547-.431h1.032l.759 1.129-.34 1.166-1.063 1.347-.88 1.142-1.263 1.7-.79 1.36.074.11.188-.02 2.853-.606 1.542-.28 1.84-.315.832.388.09.395-.327.807-1.967.486-2.307.462-3.436.813-.043.03.049.061 1.548.146.662.036h1.62l3.018.225.79.522.473.638-.08.485-1.213.62-1.64-.389-3.825-.91-1.31-.329h-.183v.11l1.093 1.068 2.003 1.81 2.508 2.33.127.578-.321.455-.34-.049-2.204-1.657-.85-.747-1.925-1.62h-.127v.17l.443.649 2.343 3.521.122 1.08-.17.353-.607.213-.668-.122-1.372-1.924-1.415-2.168-1.141-1.943-.14.08-.674 7.254-.316.37-.728.28-.607-.461-.322-.747.322-1.476.388-1.924.316-1.53.285-1.9.17-.632-.012-.042-.14.018-1.432 1.967-2.18 2.945-1.724 1.845-.413.164-.716-.37.066-.662.401-.589 2.386-3.036 1.439-1.882.929-1.086-.006-.158h-.055L4.138 18.56l-1.13.146-.485-.456.06-.746.231-.243 1.907-1.312Z"})))},domains:["claude.ai","claude.com","anthropic.com"]},{name:"ChatGPT",icon:function(e){return a.createElement("svg",F({viewBox:"180 180 356 356",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i||(i=a.createElement("path",{fill:"currentColor",d:"M508.749 317.399c8.028-30.085.242-63.515-23.36-87.117-23.601-23.601-57.029-31.387-87.116-23.359-22.042-21.995-54.883-31.967-87.125-23.327-32.242 8.638-55.698 33.696-63.788 63.765-30.069 8.09-55.127 31.549-63.765 63.788-8.638 32.242 1.332 65.083 23.329 87.125-8.028 30.085-.241 63.515 23.36 87.117 23.601 23.601 57.029 31.388 87.117 23.359 22.041 21.995 54.885 31.967 87.124 23.329 32.242-8.638 55.698-33.695 63.788-63.764 30.07-8.091 55.127-31.549 63.765-63.789 8.638-32.241-1.331-65.083-23.329-87.124v-.003Zm-37.85-72.623c15.993 15.994 22.589 37.825 19.788 58.636l-75.11-43.366a10.23 10.23 0 0 0-10.232 0l-87.944 50.774v-33.294a6.586 6.586 0 0 1 3.275-5.689l66.968-38.663c26.534-14.821 60.702-10.951 83.257 11.602h-.002Zm-113.062 66.368 40.438 23.347v46.694l-40.438 23.347-40.439-23.347v-46.694l40.439-23.347Zm-93.061-41.451c.431-30.388 20.868-58.044 51.677-66.3 21.847-5.853 44.052-.649 60.674 12.18l-75.113 43.364a10.232 10.232 0 0 0-5.116 8.861v101.548l-28.833-16.647a6.59 6.59 0 0 1-3.289-5.682v-77.326.002Zm-61.385 46.761c5.853-21.846 21.463-38.476 40.885-46.455v86.731c0 3.654 1.95 7.033 5.116 8.861l87.945 50.774-28.834 16.648a6.586 6.586 0 0 1-6.564.007l-66.968-38.663c-26.103-15.568-39.833-47.096-31.58-77.903ZM244.775 470.9c-15.994-15.994-22.589-37.825-19.789-58.636l75.11 43.366a10.236 10.236 0 0 0 10.232 0l87.945-50.774v33.293a6.585 6.585 0 0 1-3.276 5.69l-66.968 38.663c-26.534 14.82-60.702 10.95-83.257-11.602h.003Zm206.122-24.918c-.431 30.389-20.868 58.045-51.677 66.301-21.847 5.853-44.052.649-60.673-12.181l75.112-43.364a10.229 10.229 0 0 0 5.116-8.861V346.329l28.834 16.648a6.59 6.59 0 0 1 3.288 5.682v77.326-.003Zm61.385-46.761c-5.853 21.847-21.463 38.476-40.885 46.455v-86.73a10.23 10.23 0 0 0-5.116-8.861l-87.945-50.774 28.834-16.648a6.586 6.586 0 0 1 6.564-.008l66.968 38.663c26.103 15.569 39.834 47.097 31.58 77.903Z"})))},iconSx:e=>({color:e.colors.$colorForeground}),domains:["chatgpt.com","openai.com"]}];var A=o(1046),G=o(8343),I=o(9793);function E({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,sx:[e=>({textAlign:"start",borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg,overflow:"hidden"}),n],elementDescriptor:A.$z.listGroup,children:e})}function T({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,sx:[e=>({padding:e.space.$3,background:G.s.mergedColorsBackground(I.T.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50)}),n],elementDescriptor:A.$z.listGroupHeader,children:e})}function R(e){return(0,r.Y)(p.EY,{...e,variant:"subtitle",elementDescriptor:A.$z.listGroupHeaderTitle})}function U({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,as:"ul",sx:[e=>({margin:e.sizes.$none,padding:e.sizes.$none,maxBlockSize:"10.9375rem",backgroundColor:e.colors.$colorBackground,overflowY:"auto",...G.s.unstyledScrollbar(e),"--fade-distance":"2.5rem","&::before, &::after":{content:'""',display:"block",position:"sticky",insetInline:0,blockSize:"var(--fade-distance)",pointerEvents:"none",zIndex:1,opacity:0},"&::before":{insetBlockStart:0,marginBlockEnd:"calc(var(--fade-distance) * -1)",background:`linear-gradient(to bottom, ${e.colors.$colorBackground}, transparent)`},"&::after":{insetBlockEnd:0,marginBlockStart:"calc(var(--fade-distance) * -1)",background:`linear-gradient(to top, ${e.colors.$colorBackground}, transparent)`},"@keyframes list-fade-top":{from:{opacity:0},to:{opacity:1}},"@keyframes list-fade-bottom":{from:{opacity:1},to:{opacity:0}},"@supports (animation-timeline: scroll())":{"&::before":{animationName:"list-fade-top",animationDuration:"auto",animationTimingFunction:"linear",animationFillMode:"both",animationTimeline:"scroll(y)",animationRange:"0 var(--fade-distance)"},"&::after":{animationName:"list-fade-bottom",animationDuration:"auto",animationTimingFunction:"linear",animationFillMode:"both",animationTimeline:"scroll(y)",animationRange:"calc(100% - var(--fade-distance)) 100%"}}}),n],elementDescriptor:A.$z.listGroupContent,children:e})}function Z({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,as:"li",sx:[e=>({display:"flex",alignItems:"baseline",paddingInline:e.space.$3,paddingBlock:e.space.$2,borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100,"&::before":{content:'""',display:"inline-block",width:e.space.$1,height:e.space.$1,background:e.colors.$colorMutedForeground,borderRadius:e.radii.$circle,transform:"translateY(-0.1875rem)",marginInlineEnd:e.space.$2,flexShrink:0}}),n],elementDescriptor:A.$z.listGroupItem,children:e})}function B(e){return(0,r.Y)(p.EY,{...e,variant:"subtitle",elementDescriptor:A.$z.listGroupItemLabel})}var _=o(5033);function O({children:e}){return(0,r.Y)(p.so,{justify:"center",align:"center",gap:4,sx:e=>({marginBlockEnd:e.space.$6}),elementDescriptor:A.$z.logoGroup,children:e})}function W({children:e,sx:n,...o}){return(0,r.Y)(p.so,{...o,sx:[{flex:1},n],elementDescriptor:A.$z.logoGroupItem,children:e})}function L({size:e="md",sx:n,children:o}){let t=n=>{let o="sm"===e?n.space.$6:n.space.$12,t="sm"===e?n.space.$3:n.space.$5;return{width:o,height:o,"&& > *":{width:t,height:t}}};return(0,r.Y)(p.az,{sx:e=>[{background:G.s.mergedColorsBackground(I.T.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50),borderRadius:e.radii.$circle,borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,display:"flex",alignItems:"center",justifyContent:"center"},t,n],elementDescriptor:A.$z.logoGroupItemContainer,children:o})}function j({icon:e=_.A,iconSx:n=e=>({color:e.colors.$primary500}),label:o}){return(0,r.Y)(p.In,{icon:e,sx:n,elementDescriptor:A.$z.logoGroupIcon,role:o?"img":void 0,"aria-label":o,"aria-hidden":!o||void 0})}function M(){return(0,r.Y)(p.az,{as:"svg",fill:"none",viewBox:"0 0 16 2",height:2,"aria-hidden":!0,sx:e=>({color:e.colors.$colorMutedForeground}),elementDescriptor:A.$z.logoGroupSeparator,children:(0,r.Y)("path",{stroke:"currentColor",strokeDasharray:"0.1 4",strokeLinecap:"round",strokeWidth:"2",d:"M1 1h14"})})}var N=o(3919),K=o(3693);function P({options:e,value:n,onChange:o}){let t=(0,a.useRef)(null),i=e.find(e=>e.value===n);return(0,r.FD)(N.l6,{options:e,value:n,onChange:e=>o(e.value),referenceElement:t,renderOption:(e,n,o)=>(0,r.FD)(p.az,{as:"span",sx:e=>({width:"100%",display:"grid",gridTemplateColumns:`${e.sizes.$5} 1fr ${e.sizes.$3}`,columnGap:e.space.$2,paddingInlineStart:e.space.$1,paddingInlineEnd:e.space.$1x5,paddingBlock:e.space.$1,alignItems:"center",borderRadius:e.radii.$md,'&:hover, &[data-focused="true"]':{background:G.s.mutedBackground(e)}}),children:[(0,r.Y)(p._V,{src:e.logoUrl,alt:e.label,sx:e=>({width:e.sizes.$5,height:e.sizes.$5,objectFit:"contain",flexShrink:0,borderRadius:e.radii.$md})}),(0,r.Y)(p.EY,{sx:{flex:1,textAlign:"start",minWidth:0,maxInlineSize:"200px"},truncate:!0,as:"span",variant:"subtitle",children:e.label}),o&&(0,r.Y)(p.In,{icon:K.A,sx:e=>({color:e.colors.$primary500})})]}),children:[(0,r.FD)(N.JC,{ref:t,"aria-haspopup":"listbox",sx:e=>({paddingInline:e.space.$3}),children:[(0,r.Y)(p._V,{src:i?.logoUrl||"",alt:i?.label||"",sx:e=>({width:e.sizes.$5,height:e.sizes.$5,borderRadius:e.radii.$md,objectFit:"contain",flexShrink:0})}),(0,r.Y)(p.EY,{colorScheme:"body",as:"span",truncate:!0,sx:{flex:1,minWidth:0,textAlign:"start"},children:i?.label||"Select an option"})]}),(0,r.Y)(N.UL,{})]})}let V=()=>"u">typeof window&&!!window.location,q=/^(\d{1,3}\.){3}\d{1,3}$/,H="offline_access";function J({onOpen:e,onClose:n,isOpen:o,redirectUri:t,oauthApplicationName:i}){return o?(0,r.Y)(v.Modal,{handleOpen:e,handleClose:n,children:(0,r.Y)(f.Z.Root,{children:(0,r.FD)(f.Z.Content,{children:[(0,r.FD)(b.Y.Root,{children:[(0,r.Y)(b.Y.Title,{localizationKey:(0,h.G)("oauthConsent.redirectUriModal.title")}),(0,r.Y)(b.Y.Subtitle,{localizationKey:(0,h.G)("oauthConsent.redirectUriModal.subtitle",{applicationName:i})})]}),(0,r.Y)(y.TM,{style:{maxHeight:"none"},cols:50,rows:6,defaultValue:t,readOnly:!0})]})})}):null}let Q=(0,d.G)((0,Y.dm)(function(){let e=(0,c.W)(),n=(0,l.ho)(),{user:o}=(0,l.Jd)(),{displayConfig:{applicationName:t,logoImageUrl:i},organizationSettings:d}=(0,s.O)(),[m,Y]=(0,a.useState)(!1),[v,y]=(0,a.useState)(null),C=!!(e.onAllow||e.onDeny),k=function(){if(!V())return{oauthClientId:""};let e=new URLSearchParams(window.location.search),n=e.get("client_id")??"",o=e.get("scope")??void 0;return void 0!==o?{oauthClientId:n,scope:o}:{oauthClientId:n}}(),w=e.oauthClientId??k.oauthClientId,D=e.scope??k.scope,F=e.redirectUrl??(V()?new URL(window.location.href).searchParams.get("redirect_uri")??"":""),{data:A,isLoading:G,error:I}=(0,l.$U)({oauthClientId:w,scope:D,redirectUri:F||void 0,enabled:!C}),_=A?.scopes?.map(e=>({scope:e.scope,description:e.description,requires_consent:e.requiresConsent})),N=e.scopes??_??[],K=e.oauthApplicationName??A?.oauthApplicationName??"",Q=e.oauthApplicationLogoUrl??A?.oauthApplicationLogoUrl,X=e.oauthApplicationUrl??A?.oauthApplicationUrl,ee=e.redirectUrl??F,en=!!(N.some(e=>"user:org:read"===e.scope)&&d.enabled),eo=en?(o?.organizationMemberships??[]).map(e=>({value:e.organization.id,label:e.organization.name,logoUrl:e.organization.imageUrl})):[],et=n.session?.lastActiveOrganizationId,ei=eo.find(e=>e.value===et)?.value??eo[0]?.value??null,er=v??ei,{t:el}=(0,u._)(),ea=A?.redirectDomain??function(e){let n;try{n=new URL(e).hostname}catch{return""}if(!n)return"";let o=n.startsWith("[")&&n.endsWith("]")?n.slice(1,-1):n;return q.test(o)?o:o.includes(":")?`[${o}]`:o.split(".").slice(-2).join(".")}(ee),ec=el((0,h.G)("oauthConsent.viewFullUrl")),es=Q?void 0:function(e){if(!e)return;let n=e.trim().toLowerCase();return S.find(e=>e.domains.includes(n))}(ea);if(!C){let e=w?ee?I?I.message??"Failed to load consent information.":void 0:"The redirect URI is missing.":"The client ID is missing.";if(e)return(0,r.FD)(f.Z.Root,{children:[(0,r.Y)(f.Z.Content,{children:(0,r.Y)(f.Z.Alert,{children:e})}),(0,r.Y)(f.Z.Footer,{})]});if(G)return(0,r.FD)(f.Z.Root,{children:[(0,r.Y)(f.Z.Content,{children:(0,r.Y)($.W,{})}),(0,r.Y)(f.Z.Footer,{})]})}let ed=n.oauthApplication.buildConsentActionUrl({clientId:w}),eu=V()?Array.from(new URLSearchParams(window.location.search).entries()):[],eh=o?.primaryEmailAddress?.emailAddress||o?.primaryPhoneNumber?.phoneNumber,ep=N.filter(e=>e.scope!==H),em=N.some(e=>e.scope===H);return(0,r.FD)(r.FK,{children:[(0,r.FD)("form",{method:"POST",action:ed,onSubmit:n=>{if(!C)return;n.preventDefault();let o=n.nativeEvent.submitter;o?.value==="true"?e.onAllow?.():e.onDeny?.()},children:[(0,r.FD)(f.Z.Root,{children:[(0,r.FD)(f.Z.Content,{children:[(0,r.FD)(b.Y.Root,{children:[Q&&i&&(0,r.FD)(O,{children:[(0,r.Y)(W,{justify:"end",children:(0,r.Y)(L,{children:(0,r.Y)(g.G,{src:Q,alt:K,href:X,isExternal:!0})})}),(0,r.Y)(M,{}),(0,r.Y)(W,{justify:"start",children:(0,r.Y)(L,{children:(0,r.Y)(g.G,{})})})]}),Q&&!i&&(0,r.Y)(O,{children:(0,r.FD)(p.az,{sx:{position:"relative"},children:[(0,r.Y)(L,{children:(0,r.Y)(g.G,{src:Q,alt:K,href:X,isExternal:!0})}),(0,r.Y)(L,{size:"sm",sx:e=>({position:"absolute",bottom:`calc(${e.space.$2x5} * -1)`,insetInlineEnd:`calc(${e.space.$2x5} * -1)`}),children:(0,r.Y)(j,{})})]})}),!Q&&i&&(0,r.FD)(O,{children:[(0,r.Y)(W,{justify:"end",children:(0,r.Y)(L,{children:(0,r.Y)(j,{icon:es?.icon,iconSx:es?.iconSx,label:es?.name})})}),(0,r.Y)(M,{}),(0,r.Y)(W,{justify:"start",children:(0,r.Y)(L,{children:(0,r.Y)(g.G,{})})})]}),!Q&&!i&&(0,r.Y)(O,{children:(0,r.Y)(L,{children:(0,r.Y)(j,{icon:es?.icon,iconSx:es?.iconSx,label:es?.name})})}),(0,r.Y)(b.Y.Title,{localizationKey:K}),(0,r.Y)(b.Y.Subtitle,{localizationKey:(0,h.G)("oauthConsent.subtitle",{applicationName:t,identifier:eh||""})})]}),en&&eo.length>0&&er&&(0,r.Y)(P,{options:eo,value:er,onChange:y}),(0,r.FD)(E,{children:[(0,r.Y)(T,{children:(0,r.Y)(R,{localizationKey:(0,h.G)("oauthConsent.scopeList.title",{applicationName:K})})}),(0,r.Y)(U,{children:ep.map(e=>(0,r.Y)(Z,{children:(0,r.Y)(B,{children:e.description||e.scope||""})},e.scope))})]}),(0,r.Y)(x.F,{colorScheme:"warning",children:(0,r.Y)(p.EY,{colorScheme:"warning",variant:"caption",children:(0,r.Y)(z,{text:el((0,h.G)("oauthConsent.warning",{applicationName:K||t,domainAction:ea})),actionText:ea,onClick:()=>Y(!0),tooltipText:ec})})}),(0,r.FD)(p.xA,{columns:2,gap:3,children:[(0,r.Y)(p.$n,{type:"submit",name:"consented",value:"false",colorScheme:"secondary",variant:"outline",localizationKey:(0,h.G)("oauthConsent.action__deny")}),(0,r.Y)(p.$n,{type:"submit",name:"consented",value:"true",localizationKey:(0,h.G)("oauthConsent.action__allow")}),(0,r.FD)(p.EY,{sx:{gridColumn:"span 2"},colorScheme:"secondary",variant:"caption",children:[(0,r.Y)(z,{text:el((0,h.G)("oauthConsent.redirectNotice",{domainAction:ea})),actionText:ea,onClick:()=>Y(!0),tooltipText:ec}),em&&el((0,h.G)("oauthConsent.offlineAccessNotice"))]})]})]}),(0,r.Y)(f.Z.Footer,{})]}),!C&&eu.map(([e,n])=>(0,r.Y)("input",{type:"hidden",name:e,value:n},e)),!C&&en&&er&&(0,r.Y)("input",{type:"hidden",name:"organization_id",value:er})]}),(0,r.Y)(J,{isOpen:m,onOpen:()=>Y(!0),onClose:()=>Y(!1),redirectUri:ee,oauthApplicationName:K})]})})),X=()=>(0,r.Y)(m.n.Root,{flow:"oauthConsent",children:(0,r.Y)(m.n.Part,{children:(0,r.Y)(C.d,{children:(0,r.Y)(k.q,{children:(0,r.Y)(Q,{})})})})})},4480(e,n,o){var t=o(630);let i=(0,t.createContext)(null);o.d(n,{},{W:()=>{let e=(0,t.useContext)(i);if(null===e)throw Error("Clerk: useOAuthConsentContext called outside of the mounted OAuthConsent component.");return e},n:i})}}]);
|
|
1
|
+
"use strict";(globalThis.rspackChunk_clerk_ui=globalThis.rspackChunk_clerk_ui||[]).push([[5591],{8051(e,n,o){o.r(n),o.d(n,{OAuthConsent:()=>X});var t,i,r=o(9763),l=o(6262),a=o(630),c=o(4480),s=o(1868),d=o(9203),u=o(6887),h=o(8342),p=o(9230),m=o(4641),g=o(914),f=o(5402),Y=o(7308),b=o(9642),v=o(9095),$=o(2574),x=o(6674),y=o(9684),C=o(6661),k=o(9922),w=o(5880);function z({text:e,actionText:n,onClick:o,tooltipText:t}){let i=e.indexOf(n);if(-1===i)return(0,r.Y)(r.FK,{children:e});let l=e.slice(0,i),a=e.slice(i+n.length),c="",s="";l.endsWith("(")&&(l=l.slice(0,-1),c="("),a.startsWith(")")&&(a=a.slice(1),s=")");let d=(0,r.FD)(w.m_.Root,{children:[(0,r.Y)(w.m_.Trigger,{children:(0,r.Y)(p.EY,{as:"span",role:"button",tabIndex:0,"aria-label":t,variant:"caption",onClick:o,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),o())},sx:e=>({textDecoration:"underline",textDecorationStyle:"dotted",cursor:"pointer",outline:"none",display:"inline-block","&:focus-visible":{outline:"2px solid",outlineColor:e.colors.$colorRing}}),children:n})}),(0,r.Y)(w.m_.Content,{text:t})]});return(0,r.FD)(r.FK,{children:[l,c||s?(0,r.FD)(p.EY,{as:"span",sx:{whiteSpace:"nowrap"},children:[c,d,s]}):d,a]})}function D(){return(D=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(null,arguments)}function F(){return(F=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(null,arguments)}let S=[{name:"Claude",icon:function(e){return a.createElement("svg",D({fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),t||(t=a.createElement("path",{fill:"#D97757",d:"m4.714 15.956 4.718-2.648.079-.23-.08-.128h-.23l-.79-.048-2.695-.073-2.337-.097-2.265-.122-.57-.121-.535-.704.055-.353.48-.321.685.06 1.518.104 2.277.157 1.651.098 2.447.255h.389l.054-.158-.133-.097-.103-.098-2.356-1.596-2.55-1.688-1.336-.972-.722-.491L2 6.223l-.158-1.008.655-.722.88.06.225.061.893.686 1.906 1.476 2.49 1.833.364.304.146-.104.018-.072-.164-.274-1.354-2.446-1.445-2.49-.644-1.032-.17-.619a2.972 2.972 0 0 1-.103-.729L6.287.133 6.7 0l.995.134.42.364.619 1.415L9.735 4.14l1.555 3.03.455.898.243.832.09.255h.159V9.01l.127-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.583.28.48.685-.067.444-.286 1.851-.558 2.903-.365 1.942h.213l.243-.242.983-1.306 1.652-2.064.728-.82.85-.904.547-.431h1.032l.759 1.129-.34 1.166-1.063 1.347-.88 1.142-1.263 1.7-.79 1.36.074.11.188-.02 2.853-.606 1.542-.28 1.84-.315.832.388.09.395-.327.807-1.967.486-2.307.462-3.436.813-.043.03.049.061 1.548.146.662.036h1.62l3.018.225.79.522.473.638-.08.485-1.213.62-1.64-.389-3.825-.91-1.31-.329h-.183v.11l1.093 1.068 2.003 1.81 2.508 2.33.127.578-.321.455-.34-.049-2.204-1.657-.85-.747-1.925-1.62h-.127v.17l.443.649 2.343 3.521.122 1.08-.17.353-.607.213-.668-.122-1.372-1.924-1.415-2.168-1.141-1.943-.14.08-.674 7.254-.316.37-.728.28-.607-.461-.322-.747.322-1.476.388-1.924.316-1.53.285-1.9.17-.632-.012-.042-.14.018-1.432 1.967-2.18 2.945-1.724 1.845-.413.164-.716-.37.066-.662.401-.589 2.386-3.036 1.439-1.882.929-1.086-.006-.158h-.055L4.138 18.56l-1.13.146-.485-.456.06-.746.231-.243 1.907-1.312Z"})))},domains:["claude.ai","claude.com","anthropic.com"]},{name:"ChatGPT",icon:function(e){return a.createElement("svg",F({viewBox:"180 180 356 356",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i||(i=a.createElement("path",{fill:"currentColor",d:"M508.749 317.399c8.028-30.085.242-63.515-23.36-87.117-23.601-23.601-57.029-31.387-87.116-23.359-22.042-21.995-54.883-31.967-87.125-23.327-32.242 8.638-55.698 33.696-63.788 63.765-30.069 8.09-55.127 31.549-63.765 63.788-8.638 32.242 1.332 65.083 23.329 87.125-8.028 30.085-.241 63.515 23.36 87.117 23.601 23.601 57.029 31.388 87.117 23.359 22.041 21.995 54.885 31.967 87.124 23.329 32.242-8.638 55.698-33.695 63.788-63.764 30.07-8.091 55.127-31.549 63.765-63.789 8.638-32.241-1.331-65.083-23.329-87.124v-.003Zm-37.85-72.623c15.993 15.994 22.589 37.825 19.788 58.636l-75.11-43.366a10.23 10.23 0 0 0-10.232 0l-87.944 50.774v-33.294a6.586 6.586 0 0 1 3.275-5.689l66.968-38.663c26.534-14.821 60.702-10.951 83.257 11.602h-.002Zm-113.062 66.368 40.438 23.347v46.694l-40.438 23.347-40.439-23.347v-46.694l40.439-23.347Zm-93.061-41.451c.431-30.388 20.868-58.044 51.677-66.3 21.847-5.853 44.052-.649 60.674 12.18l-75.113 43.364a10.232 10.232 0 0 0-5.116 8.861v101.548l-28.833-16.647a6.59 6.59 0 0 1-3.289-5.682v-77.326.002Zm-61.385 46.761c5.853-21.846 21.463-38.476 40.885-46.455v86.731c0 3.654 1.95 7.033 5.116 8.861l87.945 50.774-28.834 16.648a6.586 6.586 0 0 1-6.564.007l-66.968-38.663c-26.103-15.568-39.833-47.096-31.58-77.903ZM244.775 470.9c-15.994-15.994-22.589-37.825-19.789-58.636l75.11 43.366a10.236 10.236 0 0 0 10.232 0l87.945-50.774v33.293a6.585 6.585 0 0 1-3.276 5.69l-66.968 38.663c-26.534 14.82-60.702 10.95-83.257-11.602h.003Zm206.122-24.918c-.431 30.389-20.868 58.045-51.677 66.301-21.847 5.853-44.052.649-60.673-12.181l75.112-43.364a10.229 10.229 0 0 0 5.116-8.861V346.329l28.834 16.648a6.59 6.59 0 0 1 3.288 5.682v77.326-.003Zm61.385-46.761c-5.853 21.847-21.463 38.476-40.885 46.455v-86.73a10.23 10.23 0 0 0-5.116-8.861l-87.945-50.774 28.834-16.648a6.586 6.586 0 0 1 6.564-.008l66.968 38.663c26.103 15.569 39.834 47.097 31.58 77.903Z"})))},iconSx:e=>({color:e.colors.$colorForeground}),domains:["chatgpt.com","openai.com"]}];var A=o(1046),G=o(8343),I=o(9793);function E({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,sx:[e=>({textAlign:"start",borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg,overflow:"hidden"}),n],elementDescriptor:A.$z.listGroup,children:e})}function T({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,sx:[e=>({padding:e.space.$3,background:G.s.mergedColorsBackground(I.T.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50)}),n],elementDescriptor:A.$z.listGroupHeader,children:e})}function R(e){return(0,r.Y)(p.EY,{...e,variant:"subtitle",elementDescriptor:A.$z.listGroupHeaderTitle})}function U({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,as:"ul",sx:[e=>({margin:e.sizes.$none,padding:e.sizes.$none,maxBlockSize:"10.9375rem",backgroundColor:e.colors.$colorBackground,overflowY:"auto",...G.s.unstyledScrollbar(e),"--fade-distance":"2.5rem","&::before, &::after":{content:'""',display:"block",position:"sticky",insetInline:0,blockSize:"var(--fade-distance)",pointerEvents:"none",zIndex:1,opacity:0},"&::before":{insetBlockStart:0,marginBlockEnd:"calc(var(--fade-distance) * -1)",background:`linear-gradient(to bottom, ${e.colors.$colorBackground}, transparent)`},"&::after":{insetBlockEnd:0,marginBlockStart:"calc(var(--fade-distance) * -1)",background:`linear-gradient(to top, ${e.colors.$colorBackground}, transparent)`},"@keyframes list-fade-top":{from:{opacity:0},to:{opacity:1}},"@keyframes list-fade-bottom":{from:{opacity:1},to:{opacity:0}},"@supports (animation-timeline: scroll())":{"&::before":{animationName:"list-fade-top",animationDuration:"auto",animationTimingFunction:"linear",animationFillMode:"both",animationTimeline:"scroll(y)",animationRange:"0 var(--fade-distance)"},"&::after":{animationName:"list-fade-bottom",animationDuration:"auto",animationTimingFunction:"linear",animationFillMode:"both",animationTimeline:"scroll(y)",animationRange:"calc(100% - var(--fade-distance)) 100%"}}}),n],elementDescriptor:A.$z.listGroupContent,children:e})}function Z({children:e,sx:n,...o}){return(0,r.Y)(p.az,{...o,as:"li",sx:[e=>({display:"flex",alignItems:"baseline",paddingInline:e.space.$3,paddingBlock:e.space.$2,borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100,"&::before":{content:'""',display:"inline-block",width:e.space.$1,height:e.space.$1,background:e.colors.$colorMutedForeground,borderRadius:e.radii.$circle,transform:"translateY(-0.1875rem)",marginInlineEnd:e.space.$2,flexShrink:0}}),n],elementDescriptor:A.$z.listGroupItem,children:e})}function _(e){return(0,r.Y)(p.EY,{...e,variant:"subtitle",elementDescriptor:A.$z.listGroupItemLabel})}var B=o(5033);function O({children:e}){return(0,r.Y)(p.so,{justify:"center",align:"center",gap:4,sx:e=>({marginBlockEnd:e.space.$6}),elementDescriptor:A.$z.logoGroup,children:e})}function L({children:e,sx:n,...o}){return(0,r.Y)(p.so,{...o,sx:[{flex:1},n],elementDescriptor:A.$z.logoGroupItem,children:e})}function W({size:e="md",sx:n,children:o}){let t=n=>{let o="sm"===e?n.space.$6:n.space.$12,t="sm"===e?n.space.$3:n.space.$5;return{width:o,height:o,"&& > *":{width:t,height:t}}};return(0,r.Y)(p.az,{sx:e=>[{background:G.s.mergedColorsBackground(I.T.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50),borderRadius:e.radii.$circle,borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,display:"flex",alignItems:"center",justifyContent:"center"},t,n],elementDescriptor:A.$z.logoGroupItemContainer,children:o})}function j({icon:e=B.A,iconSx:n=e=>({color:e.colors.$primary500}),label:o}){return(0,r.Y)(p.In,{icon:e,sx:n,elementDescriptor:A.$z.logoGroupIcon,role:o?"img":void 0,"aria-label":o,"aria-hidden":!o||void 0})}function M(){return(0,r.Y)(p.az,{as:"svg",fill:"none",viewBox:"0 0 16 2",height:2,"aria-hidden":!0,sx:e=>({color:e.colors.$colorMutedForeground}),elementDescriptor:A.$z.logoGroupSeparator,children:(0,r.Y)("path",{stroke:"currentColor",strokeDasharray:"0.1 4",strokeLinecap:"round",strokeWidth:"2",d:"M1 1h14"})})}var N=o(3919),K=o(3693);function P({options:e,value:n,onChange:o}){let t=(0,a.useRef)(null),i=e.find(e=>e.value===n);return(0,r.FD)(N.l6,{options:e,value:n,onChange:e=>o(e.value),referenceElement:t,renderOption:(e,n,o)=>(0,r.FD)(p.az,{as:"span",sx:e=>({width:"100%",display:"grid",gridTemplateColumns:`${e.sizes.$5} 1fr ${e.sizes.$3}`,columnGap:e.space.$2,paddingInlineStart:e.space.$1,paddingInlineEnd:e.space.$1x5,paddingBlock:e.space.$1,alignItems:"center",borderRadius:e.radii.$md,'&:hover, &[data-focused="true"]':{background:G.s.mutedBackground(e)}}),children:[(0,r.Y)(p._V,{src:e.logoUrl,alt:e.label,sx:e=>({width:e.sizes.$5,height:e.sizes.$5,objectFit:"contain",flexShrink:0,borderRadius:e.radii.$md})}),(0,r.Y)(p.EY,{sx:{flex:1,textAlign:"start",minWidth:0,maxInlineSize:"200px"},truncate:!0,as:"span",variant:"subtitle",children:e.label}),o&&(0,r.Y)(p.In,{icon:K.A,sx:e=>({color:e.colors.$primary500})})]}),children:[(0,r.FD)(N.JC,{ref:t,"aria-haspopup":"listbox",sx:e=>({paddingInline:e.space.$3}),children:[(0,r.Y)(p._V,{src:i?.logoUrl||"",alt:i?.label||"",sx:e=>({width:e.sizes.$5,height:e.sizes.$5,borderRadius:e.radii.$md,objectFit:"contain",flexShrink:0})}),(0,r.Y)(p.EY,{colorScheme:"body",as:"span",truncate:!0,sx:{flex:1,minWidth:0,textAlign:"start"},children:i?.label||"Select an option"})]}),(0,r.Y)(N.UL,{})]})}let V=()=>"u">typeof window&&!!window.location,q=/^(\d{1,3}\.){3}\d{1,3}$/,H="offline_access";function J({onOpen:e,onClose:n,isOpen:o,redirectUri:t,oauthApplicationName:i}){return o?(0,r.Y)($.Modal,{handleOpen:e,handleClose:n,children:(0,r.Y)(f.Z.Root,{children:(0,r.FD)(f.Z.Content,{children:[(0,r.FD)(b.Y.Root,{children:[(0,r.Y)(b.Y.Title,{localizationKey:(0,h.G)("oauthConsent.redirectUriModal.title")}),(0,r.Y)(b.Y.Subtitle,{localizationKey:(0,h.G)("oauthConsent.redirectUriModal.subtitle",{applicationName:i})})]}),(0,r.Y)(y.TM,{style:{maxHeight:"none"},cols:50,rows:6,defaultValue:t,readOnly:!0})]})})}):null}let Q=(0,d.G)((0,Y.dm)(function(){let e=(0,c.W)(),n=(0,l.ho)(),{user:o}=(0,l.Jd)(),{displayConfig:{applicationName:t,logoImageUrl:i},organizationSettings:d}=(0,s.O)(),[m,Y]=(0,a.useState)(!1),[$,y]=(0,a.useState)(null),C=!!(e.onAllow||e.onDeny),k=function(){if(!V())return{oauthClientId:""};let e=new URLSearchParams(window.location.search),n=e.get("client_id")??"",o=e.get("scope")??void 0;return void 0!==o?{oauthClientId:n,scope:o}:{oauthClientId:n}}(),w=e.oauthClientId??k.oauthClientId,D=e.scope??k.scope,F=e.redirectUrl??(V()?new URL(window.location.href).searchParams.get("redirect_uri")??"":""),{data:A,isLoading:G,error:I}=(0,l.$U)({oauthClientId:w,scope:D,redirectUri:F||void 0,enabled:!C}),B=A?.scopes?.map(e=>({scope:e.scope,description:e.description,requires_consent:e.requiresConsent})),N=e.scopes??B??[],K=e.oauthApplicationName??A?.oauthApplicationName??"",Q=e.oauthApplicationLogoUrl??A?.oauthApplicationLogoUrl,X=e.oauthApplicationUrl??A?.oauthApplicationUrl,ee=e.redirectUrl??F,en=!!(N.some(e=>"user:org:read"===e.scope)&&d.enabled),eo=en?(o?.organizationMemberships??[]).map(e=>({value:e.organization.id,label:e.organization.name,logoUrl:e.organization.imageUrl})):[],et=n.session?.lastActiveOrganizationId,ei=eo.find(e=>e.value===et)?.value??eo[0]?.value??null,er=$??ei,{t:el}=(0,u._)(),ea=A?.redirectDomain??function(e){let n;try{n=new URL(e).hostname}catch{return""}if(!n)return"";let o=n.startsWith("[")&&n.endsWith("]")?n.slice(1,-1):n;return q.test(o)?o:o.includes(":")?`[${o}]`:o.split(".").slice(-2).join(".")}(ee),ec=el((0,h.G)("oauthConsent.viewFullUrl")),es=Q?void 0:function(e){if(!e)return;let n=e.trim().toLowerCase();return S.find(e=>e.domains.includes(n))}(ea);if(!C){let e=w?ee?I?I.message??"Failed to load consent information.":void 0:"The redirect URI is missing.":"The client ID is missing.";if(e)return(0,r.FD)(f.Z.Root,{children:[(0,r.Y)(f.Z.Content,{children:(0,r.Y)(f.Z.Alert,{children:e})}),(0,r.Y)(f.Z.Footer,{})]});if(G)return(0,r.FD)(f.Z.Root,{children:[(0,r.Y)(f.Z.Content,{children:(0,r.Y)(v.W,{})}),(0,r.Y)(f.Z.Footer,{})]})}let ed=n.oauthApplication.buildConsentActionUrl({clientId:w}),eu=V()?Array.from(new URLSearchParams(window.location.search).entries()):[],eh=o?.primaryEmailAddress?.emailAddress||o?.primaryPhoneNumber?.phoneNumber,ep=N.filter(e=>e.scope!==H).map(e=>({...e,description:"private_metadata"===e.scope?el((0,h.G)("oauthConsent.scopeList.privateMetadata",{applicationName:t})):e.description})),em=N.some(e=>e.scope===H);return(0,r.FD)(r.FK,{children:[(0,r.FD)("form",{method:"POST",action:ed,onSubmit:n=>{if(!C)return;n.preventDefault();let o=n.nativeEvent.submitter;o?.value==="true"?e.onAllow?.():e.onDeny?.()},children:[(0,r.FD)(f.Z.Root,{children:[(0,r.FD)(f.Z.Content,{children:[(0,r.FD)(b.Y.Root,{children:[Q&&i&&(0,r.FD)(O,{children:[(0,r.Y)(L,{justify:"end",children:(0,r.Y)(W,{children:(0,r.Y)(g.G,{src:Q,alt:K,href:X,isExternal:!0})})}),(0,r.Y)(M,{}),(0,r.Y)(L,{justify:"start",children:(0,r.Y)(W,{children:(0,r.Y)(g.G,{})})})]}),Q&&!i&&(0,r.Y)(O,{children:(0,r.FD)(p.az,{sx:{position:"relative"},children:[(0,r.Y)(W,{children:(0,r.Y)(g.G,{src:Q,alt:K,href:X,isExternal:!0})}),(0,r.Y)(W,{size:"sm",sx:e=>({position:"absolute",bottom:`calc(${e.space.$2x5} * -1)`,insetInlineEnd:`calc(${e.space.$2x5} * -1)`}),children:(0,r.Y)(j,{})})]})}),!Q&&i&&(0,r.FD)(O,{children:[(0,r.Y)(L,{justify:"end",children:(0,r.Y)(W,{children:(0,r.Y)(j,{icon:es?.icon,iconSx:es?.iconSx,label:es?.name})})}),(0,r.Y)(M,{}),(0,r.Y)(L,{justify:"start",children:(0,r.Y)(W,{children:(0,r.Y)(g.G,{})})})]}),!Q&&!i&&(0,r.Y)(O,{children:(0,r.Y)(W,{children:(0,r.Y)(j,{icon:es?.icon,iconSx:es?.iconSx,label:es?.name})})}),(0,r.Y)(b.Y.Title,{localizationKey:K}),(0,r.Y)(b.Y.Subtitle,{localizationKey:(0,h.G)("oauthConsent.subtitle",{applicationName:t,identifier:eh||""})})]}),en&&eo.length>0&&er&&(0,r.Y)(P,{options:eo,value:er,onChange:y}),(0,r.FD)(E,{children:[(0,r.Y)(T,{children:(0,r.Y)(R,{localizationKey:(0,h.G)("oauthConsent.scopeList.title",{applicationName:K})})}),(0,r.Y)(U,{children:ep.map(e=>(0,r.Y)(Z,{children:(0,r.Y)(_,{children:e.description||e.scope||""})},e.scope))})]}),(0,r.Y)(x.F,{colorScheme:"warning",children:(0,r.Y)(p.EY,{colorScheme:"warning",variant:"caption",children:(0,r.Y)(z,{text:el((0,h.G)("oauthConsent.warning",{applicationName:K||t,domainAction:ea})),actionText:ea,onClick:()=>Y(!0),tooltipText:ec})})}),(0,r.FD)(p.xA,{columns:2,gap:3,children:[(0,r.Y)(p.$n,{type:"submit",name:"consented",value:"false",colorScheme:"secondary",variant:"outline",localizationKey:(0,h.G)("oauthConsent.action__deny")}),(0,r.Y)(p.$n,{type:"submit",name:"consented",value:"true",localizationKey:(0,h.G)("oauthConsent.action__allow")}),(0,r.FD)(p.EY,{sx:{gridColumn:"span 2"},colorScheme:"secondary",variant:"caption",children:[(0,r.Y)(z,{text:el((0,h.G)("oauthConsent.redirectNotice",{domainAction:ea})),actionText:ea,onClick:()=>Y(!0),tooltipText:ec}),em&&el((0,h.G)("oauthConsent.offlineAccessNotice"))]})]})]}),(0,r.Y)(f.Z.Footer,{})]}),!C&&eu.map(([e,n])=>(0,r.Y)("input",{type:"hidden",name:e,value:n},e)),!C&&en&&er&&(0,r.Y)("input",{type:"hidden",name:"organization_id",value:er})]}),(0,r.Y)(J,{isOpen:m,onOpen:()=>Y(!0),onClose:()=>Y(!1),redirectUri:ee,oauthApplicationName:K})]})})),X=()=>(0,r.Y)(m.n.Root,{flow:"oauthConsent",children:(0,r.Y)(m.n.Part,{children:(0,r.Y)(C.d,{children:(0,r.Y)(k.q,{children:(0,r.Y)(Q,{})})})})})},4480(e,n,o){var t=o(630);let i=(0,t.createContext)(null);o.d(n,{},{W:()=>{let e=(0,t.useContext)(i);if(null===e)throw Error("Clerk: useOAuthConsentContext called outside of the mounted OAuthConsent component.");return e},n:i})}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.rspackChunk_clerk_ui=globalThis.rspackChunk_clerk_ui||[]).push([[5591],{18051(e,n,o){o.r(n),o.d(n,{OAuthConsent:()=>X}),o(36395),o(42949),o(37891),o(12021),o(49678),o(18723);var l,t,i=o(59763),r=o(46262),a=o(59701),c=o(64480),s=o(91868),d=o(9203),u=o(66887),h=o(78342),p=o(39230),m=o(34641),g=o(30914),f=o(35402),v=o(17308),Y=o(39642),b=o(89095),x=o(62574),$=o(96674),y=o(89684),C=o(66661),k=o(59922),w=o(75880);function z(e){let{text:n,actionText:o,onClick:l,tooltipText:t}=e,r=n.indexOf(o);if(-1===r)return(0,i.Y)(i.FK,{children:n});let a=n.slice(0,r),c=n.slice(r+o.length),s="",d="";a.endsWith("(")&&(a=a.slice(0,-1),s="("),c.startsWith(")")&&(c=c.slice(1),d=")");let u=(0,i.FD)(w.m_.Root,{children:[(0,i.Y)(w.m_.Trigger,{children:(0,i.Y)(p.EY,{as:"span",role:"button",tabIndex:0,"aria-label":t,variant:"caption",onClick:l,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),l())},sx:e=>({textDecoration:"underline",textDecorationStyle:"dotted",cursor:"pointer",outline:"none",display:"inline-block","&:focus-visible":{outline:"2px solid",outlineColor:e.colors.$colorRing}}),children:o})}),(0,i.Y)(w.m_.Content,{text:t})]});return(0,i.FD)(i.FK,{children:[a,s||d?(0,i.FD)(p.EY,{as:"span",sx:{whiteSpace:"nowrap"},children:[s,u,d]}):u,c]})}function D(){return(D=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var l in o)({}).hasOwnProperty.call(o,l)&&(e[l]=o[l])}return e}).apply(null,arguments)}function F(){return(F=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var l in o)({}).hasOwnProperty.call(o,l)&&(e[l]=o[l])}return e}).apply(null,arguments)}o(52277);let S=[{name:"Claude",icon:function(e){return a.createElement("svg",D({fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),l||(l=a.createElement("path",{fill:"#D97757",d:"m4.714 15.956 4.718-2.648.079-.23-.08-.128h-.23l-.79-.048-2.695-.073-2.337-.097-2.265-.122-.57-.121-.535-.704.055-.353.48-.321.685.06 1.518.104 2.277.157 1.651.098 2.447.255h.389l.054-.158-.133-.097-.103-.098-2.356-1.596-2.55-1.688-1.336-.972-.722-.491L2 6.223l-.158-1.008.655-.722.88.06.225.061.893.686 1.906 1.476 2.49 1.833.364.304.146-.104.018-.072-.164-.274-1.354-2.446-1.445-2.49-.644-1.032-.17-.619a2.972 2.972 0 0 1-.103-.729L6.287.133 6.7 0l.995.134.42.364.619 1.415L9.735 4.14l1.555 3.03.455.898.243.832.09.255h.159V9.01l.127-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.583.28.48.685-.067.444-.286 1.851-.558 2.903-.365 1.942h.213l.243-.242.983-1.306 1.652-2.064.728-.82.85-.904.547-.431h1.032l.759 1.129-.34 1.166-1.063 1.347-.88 1.142-1.263 1.7-.79 1.36.074.11.188-.02 2.853-.606 1.542-.28 1.84-.315.832.388.09.395-.327.807-1.967.486-2.307.462-3.436.813-.043.03.049.061 1.548.146.662.036h1.62l3.018.225.79.522.473.638-.08.485-1.213.62-1.64-.389-3.825-.91-1.31-.329h-.183v.11l1.093 1.068 2.003 1.81 2.508 2.33.127.578-.321.455-.34-.049-2.204-1.657-.85-.747-1.925-1.62h-.127v.17l.443.649 2.343 3.521.122 1.08-.17.353-.607.213-.668-.122-1.372-1.924-1.415-2.168-1.141-1.943-.14.08-.674 7.254-.316.37-.728.28-.607-.461-.322-.747.322-1.476.388-1.924.316-1.53.285-1.9.17-.632-.012-.042-.14.018-1.432 1.967-2.18 2.945-1.724 1.845-.413.164-.716-.37.066-.662.401-.589 2.386-3.036 1.439-1.882.929-1.086-.006-.158h-.055L4.138 18.56l-1.13.146-.485-.456.06-.746.231-.243 1.907-1.312Z"})))},domains:["claude.ai","claude.com","anthropic.com"]},{name:"ChatGPT",icon:function(e){return a.createElement("svg",F({viewBox:"180 180 356 356",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=a.createElement("path",{fill:"currentColor",d:"M508.749 317.399c8.028-30.085.242-63.515-23.36-87.117-23.601-23.601-57.029-31.387-87.116-23.359-22.042-21.995-54.883-31.967-87.125-23.327-32.242 8.638-55.698 33.696-63.788 63.765-30.069 8.09-55.127 31.549-63.765 63.788-8.638 32.242 1.332 65.083 23.329 87.125-8.028 30.085-.241 63.515 23.36 87.117 23.601 23.601 57.029 31.388 87.117 23.359 22.041 21.995 54.885 31.967 87.124 23.329 32.242-8.638 55.698-33.695 63.788-63.764 30.07-8.091 55.127-31.549 63.765-63.789 8.638-32.241-1.331-65.083-23.329-87.124v-.003Zm-37.85-72.623c15.993 15.994 22.589 37.825 19.788 58.636l-75.11-43.366a10.23 10.23 0 0 0-10.232 0l-87.944 50.774v-33.294a6.586 6.586 0 0 1 3.275-5.689l66.968-38.663c26.534-14.821 60.702-10.951 83.257 11.602h-.002Zm-113.062 66.368 40.438 23.347v46.694l-40.438 23.347-40.439-23.347v-46.694l40.439-23.347Zm-93.061-41.451c.431-30.388 20.868-58.044 51.677-66.3 21.847-5.853 44.052-.649 60.674 12.18l-75.113 43.364a10.232 10.232 0 0 0-5.116 8.861v101.548l-28.833-16.647a6.59 6.59 0 0 1-3.289-5.682v-77.326.002Zm-61.385 46.761c5.853-21.846 21.463-38.476 40.885-46.455v86.731c0 3.654 1.95 7.033 5.116 8.861l87.945 50.774-28.834 16.648a6.586 6.586 0 0 1-6.564.007l-66.968-38.663c-26.103-15.568-39.833-47.096-31.58-77.903ZM244.775 470.9c-15.994-15.994-22.589-37.825-19.789-58.636l75.11 43.366a10.236 10.236 0 0 0 10.232 0l87.945-50.774v33.293a6.585 6.585 0 0 1-3.276 5.69l-66.968 38.663c-26.534 14.82-60.702 10.95-83.257-11.602h.003Zm206.122-24.918c-.431 30.389-20.868 58.045-51.677 66.301-21.847 5.853-44.052.649-60.673-12.181l75.112-43.364a10.229 10.229 0 0 0 5.116-8.861V346.329l28.834 16.648a6.59 6.59 0 0 1 3.288 5.682v77.326-.003Zm61.385-46.761c-5.853 21.847-21.463 38.476-40.885 46.455v-86.73a10.23 10.23 0 0 0-5.116-8.861l-87.945-50.774 28.834-16.648a6.586 6.586 0 0 1 6.564-.008l66.968 38.663c26.103 15.569 39.834 47.097 31.58 77.903Z"})))},iconSx:e=>({color:e.colors.$colorForeground}),domains:["chatgpt.com","openai.com"]}];var A=o(61046),G=o(8343),I=o(89793);function E(e){let{children:n,sx:o,...l}=e;return(0,i.Y)(p.az,{...l,sx:[e=>({textAlign:"start",borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg,overflow:"hidden"}),o],elementDescriptor:A.$z.listGroup,children:n})}function T(e){let{children:n,sx:o,...l}=e;return(0,i.Y)(p.az,{...l,sx:[e=>({padding:e.space.$3,background:G.s.mergedColorsBackground(I.T.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50)}),o],elementDescriptor:A.$z.listGroupHeader,children:n})}function R(e){return(0,i.Y)(p.EY,{...e,variant:"subtitle",elementDescriptor:A.$z.listGroupHeaderTitle})}function U(e){let{children:n,sx:o,...l}=e;return(0,i.Y)(p.az,{...l,as:"ul",sx:[e=>({margin:e.sizes.$none,padding:e.sizes.$none,maxBlockSize:"10.9375rem",backgroundColor:e.colors.$colorBackground,overflowY:"auto",...G.s.unstyledScrollbar(e),"--fade-distance":"2.5rem","&::before, &::after":{content:'""',display:"block",position:"sticky",insetInline:0,blockSize:"var(--fade-distance)",pointerEvents:"none",zIndex:1,opacity:0},"&::before":{insetBlockStart:0,marginBlockEnd:"calc(var(--fade-distance) * -1)",background:"linear-gradient(to bottom, ".concat(e.colors.$colorBackground,", transparent)")},"&::after":{insetBlockEnd:0,marginBlockStart:"calc(var(--fade-distance) * -1)",background:"linear-gradient(to top, ".concat(e.colors.$colorBackground,", transparent)")},"@keyframes list-fade-top":{from:{opacity:0},to:{opacity:1}},"@keyframes list-fade-bottom":{from:{opacity:1},to:{opacity:0}},"@supports (animation-timeline: scroll())":{"&::before":{animationName:"list-fade-top",animationDuration:"auto",animationTimingFunction:"linear",animationFillMode:"both",animationTimeline:"scroll(y)",animationRange:"0 var(--fade-distance)"},"&::after":{animationName:"list-fade-bottom",animationDuration:"auto",animationTimingFunction:"linear",animationFillMode:"both",animationTimeline:"scroll(y)",animationRange:"calc(100% - var(--fade-distance)) 100%"}}}),o],elementDescriptor:A.$z.listGroupContent,children:n})}function Z(e){let{children:n,sx:o,...l}=e;return(0,i.Y)(p.az,{...l,as:"li",sx:[e=>({display:"flex",alignItems:"baseline",paddingInline:e.space.$3,paddingBlock:e.space.$2,borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100,"&::before":{content:'""',display:"inline-block",width:e.space.$1,height:e.space.$1,background:e.colors.$colorMutedForeground,borderRadius:e.radii.$circle,transform:"translateY(-0.1875rem)",marginInlineEnd:e.space.$2,flexShrink:0}}),o],elementDescriptor:A.$z.listGroupItem,children:n})}function B(e){return(0,i.Y)(p.EY,{...e,variant:"subtitle",elementDescriptor:A.$z.listGroupItemLabel})}var _=o(55033);function O(e){let{children:n}=e;return(0,i.Y)(p.so,{justify:"center",align:"center",gap:4,sx:e=>({marginBlockEnd:e.space.$6}),elementDescriptor:A.$z.logoGroup,children:n})}function W(e){let{children:n,sx:o,...l}=e;return(0,i.Y)(p.so,{...l,sx:[{flex:1},o],elementDescriptor:A.$z.logoGroupItem,children:n})}function L(e){let{size:n="md",sx:o,children:l}=e,t=e=>{let o="sm"===n?e.space.$6:e.space.$12,l="sm"===n?e.space.$3:e.space.$5;return{width:o,height:o,"&& > *":{width:l,height:l}}};return(0,i.Y)(p.az,{sx:e=>[{background:G.s.mergedColorsBackground(I.T.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50),borderRadius:e.radii.$circle,borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,display:"flex",alignItems:"center",justifyContent:"center"},t,o],elementDescriptor:A.$z.logoGroupItemContainer,children:l})}function j(e){let{icon:n=_.A,iconSx:o=e=>({color:e.colors.$primary500}),label:l}=e;return(0,i.Y)(p.In,{icon:n,sx:o,elementDescriptor:A.$z.logoGroupIcon,role:l?"img":void 0,"aria-label":l,"aria-hidden":!l||void 0})}function M(){return(0,i.Y)(p.az,{as:"svg",fill:"none",viewBox:"0 0 16 2",height:2,"aria-hidden":!0,sx:e=>({color:e.colors.$colorMutedForeground}),elementDescriptor:A.$z.logoGroupSeparator,children:(0,i.Y)("path",{stroke:"currentColor",strokeDasharray:"0.1 4",strokeLinecap:"round",strokeWidth:"2",d:"M1 1h14"})})}var N=o(63919),K=o(53693);function P(e){let{options:n,value:o,onChange:l}=e,t=(0,a.useRef)(null),r=n.find(e=>e.value===o);return(0,i.FD)(N.l6,{options:n,value:o,onChange:e=>l(e.value),referenceElement:t,renderOption:(e,n,o)=>(0,i.FD)(p.az,{as:"span",sx:e=>({width:"100%",display:"grid",gridTemplateColumns:"".concat(e.sizes.$5," 1fr ").concat(e.sizes.$3),columnGap:e.space.$2,paddingInlineStart:e.space.$1,paddingInlineEnd:e.space.$1x5,paddingBlock:e.space.$1,alignItems:"center",borderRadius:e.radii.$md,'&:hover, &[data-focused="true"]':{background:G.s.mutedBackground(e)}}),children:[(0,i.Y)(p._V,{src:e.logoUrl,alt:e.label,sx:e=>({width:e.sizes.$5,height:e.sizes.$5,objectFit:"contain",flexShrink:0,borderRadius:e.radii.$md})}),(0,i.Y)(p.EY,{sx:{flex:1,textAlign:"start",minWidth:0,maxInlineSize:"200px"},truncate:!0,as:"span",variant:"subtitle",children:e.label}),o&&(0,i.Y)(p.In,{icon:K.A,sx:e=>({color:e.colors.$primary500})})]}),children:[(0,i.FD)(N.JC,{ref:t,"aria-haspopup":"listbox",sx:e=>({paddingInline:e.space.$3}),children:[(0,i.Y)(p._V,{src:(null==r?void 0:r.logoUrl)||"",alt:(null==r?void 0:r.label)||"",sx:e=>({width:e.sizes.$5,height:e.sizes.$5,borderRadius:e.radii.$md,objectFit:"contain",flexShrink:0})}),(0,i.Y)(p.EY,{colorScheme:"body",as:"span",truncate:!0,sx:{flex:1,minWidth:0,textAlign:"start"},children:(null==r?void 0:r.label)||"Select an option"})]}),(0,i.Y)(N.UL,{})]})}o(74302),o(30686),o(38978),o(52205),o(40768),o(76235),o(85281);let V=()=>"u">typeof window&&!!window.location,q=/^(\d{1,3}\.){3}\d{1,3}$/,H="offline_access";function J(e){let{onOpen:n,onClose:o,isOpen:l,redirectUri:t,oauthApplicationName:r}=e;return l?(0,i.Y)(x.Modal,{handleOpen:n,handleClose:o,children:(0,i.Y)(f.Z.Root,{children:(0,i.FD)(f.Z.Content,{children:[(0,i.FD)(Y.Y.Root,{children:[(0,i.Y)(Y.Y.Title,{localizationKey:(0,h.G)("oauthConsent.redirectUriModal.title")}),(0,i.Y)(Y.Y.Subtitle,{localizationKey:(0,h.G)("oauthConsent.redirectUriModal.subtitle",{applicationName:r})})]}),(0,i.Y)(y.TM,{style:{maxHeight:"none"},cols:50,rows:6,defaultValue:t,readOnly:!0})]})})}):null}let Q=(0,d.G)((0,v.dm)(function(){var e,n,o,l,t,d,m,v,x,y,C,k,w,D,F,A,G,I,_,N,K,Q;let X=(0,c.W)(),ee=(0,r.ho)(),{user:en}=(0,r.Jd)(),{displayConfig:{applicationName:eo,logoImageUrl:el},organizationSettings:et}=(0,s.O)(),[ei,er]=(0,a.useState)(!1),[ea,ec]=(0,a.useState)(null),es=!!(X.onAllow||X.onDeny),ed=function(){var e,n;if(!V())return{oauthClientId:""};let o=new URLSearchParams(window.location.search),l=null!=(e=o.get("client_id"))?e:"",t=null!=(n=o.get("scope"))?n:void 0;return void 0!==t?{oauthClientId:l,scope:t}:{oauthClientId:l}}(),eu=null!=(e=X.oauthClientId)?e:ed.oauthClientId,eh=null!=(n=X.scope)?n:ed.scope,ep=null!=(o=X.redirectUrl)?o:V()&&null!=(Q=new URL(window.location.href).searchParams.get("redirect_uri"))?Q:"",{data:em,isLoading:eg,error:ef}=(0,r.$U)({oauthClientId:eu,scope:eh,redirectUri:ep||void 0,enabled:!es}),ev=null==em||null==(F=em.scopes)?void 0:F.map(e=>({scope:e.scope,description:e.description,requires_consent:e.requiresConsent})),eY=null!=(l=null!=(t=X.scopes)?t:ev)?l:[],eb=null!=(d=null!=(m=X.oauthApplicationName)?m:null==em?void 0:em.oauthApplicationName)?d:"",ex=null!=(v=X.oauthApplicationLogoUrl)?v:null==em?void 0:em.oauthApplicationLogoUrl,e$=null!=(x=X.oauthApplicationUrl)?x:null==em?void 0:em.oauthApplicationUrl,ey=null!=(y=X.redirectUrl)?y:ep,eC=!!(eY.some(e=>"user:org:read"===e.scope)&&et.enabled),ek=eC?(null!=(C=null==en?void 0:en.organizationMemberships)?C:[]).map(e=>({value:e.organization.id,label:e.organization.name,logoUrl:e.organization.imageUrl})):[],ew=null==(A=ee.session)?void 0:A.lastActiveOrganizationId,ez=null!=(k=null!=(w=null==(G=ek.find(e=>e.value===ew))?void 0:G.value)?w:null==(I=ek[0])?void 0:I.value)?k:null,eD=null!=ea?ea:ez,{t:eF}=(0,u._)(),eS=null!=(D=null==em?void 0:em.redirectDomain)?D:function(e){let n;try{n=new URL(e).hostname}catch{return""}if(!n)return"";let o=n.startsWith("[")&&n.endsWith("]")?n.slice(1,-1):n;return q.test(o)?o:o.includes(":")?"[".concat(o,"]"):o.split(".").slice(-2).join(".")}(ey),eA=eF((0,h.G)("oauthConsent.viewFullUrl")),eG=ex?void 0:function(e){if(!e)return;let n=e.trim().toLowerCase();return S.find(e=>e.domains.includes(n))}(eS);if(!es){let e=eu?ey?ef?null!=(K=ef.message)?K:"Failed to load consent information.":void 0:"The redirect URI is missing.":"The client ID is missing.";if(e)return(0,i.FD)(f.Z.Root,{children:[(0,i.Y)(f.Z.Content,{children:(0,i.Y)(f.Z.Alert,{children:e})}),(0,i.Y)(f.Z.Footer,{})]});if(eg)return(0,i.FD)(f.Z.Root,{children:[(0,i.Y)(f.Z.Content,{children:(0,i.Y)(b.W,{})}),(0,i.Y)(f.Z.Footer,{})]})}let eI=ee.oauthApplication.buildConsentActionUrl({clientId:eu}),eE=V()?Array.from(new URLSearchParams(window.location.search).entries()):[],eT=(null==en||null==(_=en.primaryEmailAddress)?void 0:_.emailAddress)||(null==en||null==(N=en.primaryPhoneNumber)?void 0:N.phoneNumber),eR=eY.filter(e=>e.scope!==H),eU=eY.some(e=>e.scope===H);return(0,i.FD)(i.FK,{children:[(0,i.FD)("form",{method:"POST",action:eI,onSubmit:e=>{var n,o;if(!es)return;e.preventDefault();let l=e.nativeEvent.submitter;(null==l?void 0:l.value)==="true"?null==(n=X.onAllow)||n.call(X):null==(o=X.onDeny)||o.call(X)},children:[(0,i.FD)(f.Z.Root,{children:[(0,i.FD)(f.Z.Content,{children:[(0,i.FD)(Y.Y.Root,{children:[ex&&el&&(0,i.FD)(O,{children:[(0,i.Y)(W,{justify:"end",children:(0,i.Y)(L,{children:(0,i.Y)(g.G,{src:ex,alt:eb,href:e$,isExternal:!0})})}),(0,i.Y)(M,{}),(0,i.Y)(W,{justify:"start",children:(0,i.Y)(L,{children:(0,i.Y)(g.G,{})})})]}),ex&&!el&&(0,i.Y)(O,{children:(0,i.FD)(p.az,{sx:{position:"relative"},children:[(0,i.Y)(L,{children:(0,i.Y)(g.G,{src:ex,alt:eb,href:e$,isExternal:!0})}),(0,i.Y)(L,{size:"sm",sx:e=>({position:"absolute",bottom:"calc(".concat(e.space.$2x5," * -1)"),insetInlineEnd:"calc(".concat(e.space.$2x5," * -1)")}),children:(0,i.Y)(j,{})})]})}),!ex&&el&&(0,i.FD)(O,{children:[(0,i.Y)(W,{justify:"end",children:(0,i.Y)(L,{children:(0,i.Y)(j,{icon:null==eG?void 0:eG.icon,iconSx:null==eG?void 0:eG.iconSx,label:null==eG?void 0:eG.name})})}),(0,i.Y)(M,{}),(0,i.Y)(W,{justify:"start",children:(0,i.Y)(L,{children:(0,i.Y)(g.G,{})})})]}),!ex&&!el&&(0,i.Y)(O,{children:(0,i.Y)(L,{children:(0,i.Y)(j,{icon:null==eG?void 0:eG.icon,iconSx:null==eG?void 0:eG.iconSx,label:null==eG?void 0:eG.name})})}),(0,i.Y)(Y.Y.Title,{localizationKey:eb}),(0,i.Y)(Y.Y.Subtitle,{localizationKey:(0,h.G)("oauthConsent.subtitle",{applicationName:eo,identifier:eT||""})})]}),eC&&ek.length>0&&eD&&(0,i.Y)(P,{options:ek,value:eD,onChange:ec}),(0,i.FD)(E,{children:[(0,i.Y)(T,{children:(0,i.Y)(R,{localizationKey:(0,h.G)("oauthConsent.scopeList.title",{applicationName:eb})})}),(0,i.Y)(U,{children:eR.map(e=>(0,i.Y)(Z,{children:(0,i.Y)(B,{children:e.description||e.scope||""})},e.scope))})]}),(0,i.Y)($.F,{colorScheme:"warning",children:(0,i.Y)(p.EY,{colorScheme:"warning",variant:"caption",children:(0,i.Y)(z,{text:eF((0,h.G)("oauthConsent.warning",{applicationName:eb||eo,domainAction:eS})),actionText:eS,onClick:()=>er(!0),tooltipText:eA})})}),(0,i.FD)(p.xA,{columns:2,gap:3,children:[(0,i.Y)(p.$n,{type:"submit",name:"consented",value:"false",colorScheme:"secondary",variant:"outline",localizationKey:(0,h.G)("oauthConsent.action__deny")}),(0,i.Y)(p.$n,{type:"submit",name:"consented",value:"true",localizationKey:(0,h.G)("oauthConsent.action__allow")}),(0,i.FD)(p.EY,{sx:{gridColumn:"span 2"},colorScheme:"secondary",variant:"caption",children:[(0,i.Y)(z,{text:eF((0,h.G)("oauthConsent.redirectNotice",{domainAction:eS})),actionText:eS,onClick:()=>er(!0),tooltipText:eA}),eU&&eF((0,h.G)("oauthConsent.offlineAccessNotice"))]})]})]}),(0,i.Y)(f.Z.Footer,{})]}),!es&&eE.map(e=>{let[n,o]=e;return(0,i.Y)("input",{type:"hidden",name:n,value:o},n)}),!es&&eC&&eD&&(0,i.Y)("input",{type:"hidden",name:"organization_id",value:eD})]}),(0,i.Y)(J,{isOpen:ei,onOpen:()=>er(!0),onClose:()=>er(!1),redirectUri:ey,oauthApplicationName:eb})]})})),X=()=>(0,i.Y)(m.n.Root,{flow:"oauthConsent",children:(0,i.Y)(m.n.Part,{children:(0,i.Y)(C.d,{children:(0,i.Y)(k.q,{children:(0,i.Y)(Q,{})})})})})},64480(e,n,o){o(15254);var l=o(59701);let t=(0,l.createContext)(null);o.d(n,{},{W:()=>{let e=(0,l.useContext)(t);if(null===e)throw Error("Clerk: useOAuthConsentContext called outside of the mounted OAuthConsent component.");return e},n:t})}}]);
|
|
1
|
+
"use strict";(globalThis.rspackChunk_clerk_ui=globalThis.rspackChunk_clerk_ui||[]).push([[5591],{18051(e,n,o){o.r(n),o.d(n,{OAuthConsent:()=>X}),o(36395),o(42949),o(37891),o(12021),o(49678),o(18723);var t,l,i=o(59763),r=o(46262),a=o(59701),c=o(64480),s=o(91868),d=o(9203),u=o(66887),h=o(78342),p=o(39230),m=o(34641),g=o(30914),f=o(35402),v=o(17308),Y=o(39642),b=o(89095),x=o(62574),$=o(96674),y=o(89684),C=o(66661),k=o(59922),w=o(75880);function z(e){let{text:n,actionText:o,onClick:t,tooltipText:l}=e,r=n.indexOf(o);if(-1===r)return(0,i.Y)(i.FK,{children:n});let a=n.slice(0,r),c=n.slice(r+o.length),s="",d="";a.endsWith("(")&&(a=a.slice(0,-1),s="("),c.startsWith(")")&&(c=c.slice(1),d=")");let u=(0,i.FD)(w.m_.Root,{children:[(0,i.Y)(w.m_.Trigger,{children:(0,i.Y)(p.EY,{as:"span",role:"button",tabIndex:0,"aria-label":l,variant:"caption",onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())},sx:e=>({textDecoration:"underline",textDecorationStyle:"dotted",cursor:"pointer",outline:"none",display:"inline-block","&:focus-visible":{outline:"2px solid",outlineColor:e.colors.$colorRing}}),children:o})}),(0,i.Y)(w.m_.Content,{text:l})]});return(0,i.FD)(i.FK,{children:[a,s||d?(0,i.FD)(p.EY,{as:"span",sx:{whiteSpace:"nowrap"},children:[s,u,d]}):u,c]})}function D(){return(D=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(null,arguments)}function F(){return(F=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(null,arguments)}o(52277);let S=[{name:"Claude",icon:function(e){return a.createElement("svg",D({fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),t||(t=a.createElement("path",{fill:"#D97757",d:"m4.714 15.956 4.718-2.648.079-.23-.08-.128h-.23l-.79-.048-2.695-.073-2.337-.097-2.265-.122-.57-.121-.535-.704.055-.353.48-.321.685.06 1.518.104 2.277.157 1.651.098 2.447.255h.389l.054-.158-.133-.097-.103-.098-2.356-1.596-2.55-1.688-1.336-.972-.722-.491L2 6.223l-.158-1.008.655-.722.88.06.225.061.893.686 1.906 1.476 2.49 1.833.364.304.146-.104.018-.072-.164-.274-1.354-2.446-1.445-2.49-.644-1.032-.17-.619a2.972 2.972 0 0 1-.103-.729L6.287.133 6.7 0l.995.134.42.364.619 1.415L9.735 4.14l1.555 3.03.455.898.243.832.09.255h.159V9.01l.127-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.583.28.48.685-.067.444-.286 1.851-.558 2.903-.365 1.942h.213l.243-.242.983-1.306 1.652-2.064.728-.82.85-.904.547-.431h1.032l.759 1.129-.34 1.166-1.063 1.347-.88 1.142-1.263 1.7-.79 1.36.074.11.188-.02 2.853-.606 1.542-.28 1.84-.315.832.388.09.395-.327.807-1.967.486-2.307.462-3.436.813-.043.03.049.061 1.548.146.662.036h1.62l3.018.225.79.522.473.638-.08.485-1.213.62-1.64-.389-3.825-.91-1.31-.329h-.183v.11l1.093 1.068 2.003 1.81 2.508 2.33.127.578-.321.455-.34-.049-2.204-1.657-.85-.747-1.925-1.62h-.127v.17l.443.649 2.343 3.521.122 1.08-.17.353-.607.213-.668-.122-1.372-1.924-1.415-2.168-1.141-1.943-.14.08-.674 7.254-.316.37-.728.28-.607-.461-.322-.747.322-1.476.388-1.924.316-1.53.285-1.9.17-.632-.012-.042-.14.018-1.432 1.967-2.18 2.945-1.724 1.845-.413.164-.716-.37.066-.662.401-.589 2.386-3.036 1.439-1.882.929-1.086-.006-.158h-.055L4.138 18.56l-1.13.146-.485-.456.06-.746.231-.243 1.907-1.312Z"})))},domains:["claude.ai","claude.com","anthropic.com"]},{name:"ChatGPT",icon:function(e){return a.createElement("svg",F({viewBox:"180 180 356 356",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=a.createElement("path",{fill:"currentColor",d:"M508.749 317.399c8.028-30.085.242-63.515-23.36-87.117-23.601-23.601-57.029-31.387-87.116-23.359-22.042-21.995-54.883-31.967-87.125-23.327-32.242 8.638-55.698 33.696-63.788 63.765-30.069 8.09-55.127 31.549-63.765 63.788-8.638 32.242 1.332 65.083 23.329 87.125-8.028 30.085-.241 63.515 23.36 87.117 23.601 23.601 57.029 31.388 87.117 23.359 22.041 21.995 54.885 31.967 87.124 23.329 32.242-8.638 55.698-33.695 63.788-63.764 30.07-8.091 55.127-31.549 63.765-63.789 8.638-32.241-1.331-65.083-23.329-87.124v-.003Zm-37.85-72.623c15.993 15.994 22.589 37.825 19.788 58.636l-75.11-43.366a10.23 10.23 0 0 0-10.232 0l-87.944 50.774v-33.294a6.586 6.586 0 0 1 3.275-5.689l66.968-38.663c26.534-14.821 60.702-10.951 83.257 11.602h-.002Zm-113.062 66.368 40.438 23.347v46.694l-40.438 23.347-40.439-23.347v-46.694l40.439-23.347Zm-93.061-41.451c.431-30.388 20.868-58.044 51.677-66.3 21.847-5.853 44.052-.649 60.674 12.18l-75.113 43.364a10.232 10.232 0 0 0-5.116 8.861v101.548l-28.833-16.647a6.59 6.59 0 0 1-3.289-5.682v-77.326.002Zm-61.385 46.761c5.853-21.846 21.463-38.476 40.885-46.455v86.731c0 3.654 1.95 7.033 5.116 8.861l87.945 50.774-28.834 16.648a6.586 6.586 0 0 1-6.564.007l-66.968-38.663c-26.103-15.568-39.833-47.096-31.58-77.903ZM244.775 470.9c-15.994-15.994-22.589-37.825-19.789-58.636l75.11 43.366a10.236 10.236 0 0 0 10.232 0l87.945-50.774v33.293a6.585 6.585 0 0 1-3.276 5.69l-66.968 38.663c-26.534 14.82-60.702 10.95-83.257-11.602h.003Zm206.122-24.918c-.431 30.389-20.868 58.045-51.677 66.301-21.847 5.853-44.052.649-60.673-12.181l75.112-43.364a10.229 10.229 0 0 0 5.116-8.861V346.329l28.834 16.648a6.59 6.59 0 0 1 3.288 5.682v77.326-.003Zm61.385-46.761c-5.853 21.847-21.463 38.476-40.885 46.455v-86.73a10.23 10.23 0 0 0-5.116-8.861l-87.945-50.774 28.834-16.648a6.586 6.586 0 0 1 6.564-.008l66.968 38.663c26.103 15.569 39.834 47.097 31.58 77.903Z"})))},iconSx:e=>({color:e.colors.$colorForeground}),domains:["chatgpt.com","openai.com"]}];var A=o(61046),G=o(8343),I=o(89793);function E(e){let{children:n,sx:o,...t}=e;return(0,i.Y)(p.az,{...t,sx:[e=>({textAlign:"start",borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg,overflow:"hidden"}),o],elementDescriptor:A.$z.listGroup,children:n})}function T(e){let{children:n,sx:o,...t}=e;return(0,i.Y)(p.az,{...t,sx:[e=>({padding:e.space.$3,background:G.s.mergedColorsBackground(I.T.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50)}),o],elementDescriptor:A.$z.listGroupHeader,children:n})}function R(e){return(0,i.Y)(p.EY,{...e,variant:"subtitle",elementDescriptor:A.$z.listGroupHeaderTitle})}function U(e){let{children:n,sx:o,...t}=e;return(0,i.Y)(p.az,{...t,as:"ul",sx:[e=>({margin:e.sizes.$none,padding:e.sizes.$none,maxBlockSize:"10.9375rem",backgroundColor:e.colors.$colorBackground,overflowY:"auto",...G.s.unstyledScrollbar(e),"--fade-distance":"2.5rem","&::before, &::after":{content:'""',display:"block",position:"sticky",insetInline:0,blockSize:"var(--fade-distance)",pointerEvents:"none",zIndex:1,opacity:0},"&::before":{insetBlockStart:0,marginBlockEnd:"calc(var(--fade-distance) * -1)",background:"linear-gradient(to bottom, ".concat(e.colors.$colorBackground,", transparent)")},"&::after":{insetBlockEnd:0,marginBlockStart:"calc(var(--fade-distance) * -1)",background:"linear-gradient(to top, ".concat(e.colors.$colorBackground,", transparent)")},"@keyframes list-fade-top":{from:{opacity:0},to:{opacity:1}},"@keyframes list-fade-bottom":{from:{opacity:1},to:{opacity:0}},"@supports (animation-timeline: scroll())":{"&::before":{animationName:"list-fade-top",animationDuration:"auto",animationTimingFunction:"linear",animationFillMode:"both",animationTimeline:"scroll(y)",animationRange:"0 var(--fade-distance)"},"&::after":{animationName:"list-fade-bottom",animationDuration:"auto",animationTimingFunction:"linear",animationFillMode:"both",animationTimeline:"scroll(y)",animationRange:"calc(100% - var(--fade-distance)) 100%"}}}),o],elementDescriptor:A.$z.listGroupContent,children:n})}function Z(e){let{children:n,sx:o,...t}=e;return(0,i.Y)(p.az,{...t,as:"li",sx:[e=>({display:"flex",alignItems:"baseline",paddingInline:e.space.$3,paddingBlock:e.space.$2,borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100,"&::before":{content:'""',display:"inline-block",width:e.space.$1,height:e.space.$1,background:e.colors.$colorMutedForeground,borderRadius:e.radii.$circle,transform:"translateY(-0.1875rem)",marginInlineEnd:e.space.$2,flexShrink:0}}),o],elementDescriptor:A.$z.listGroupItem,children:n})}function _(e){return(0,i.Y)(p.EY,{...e,variant:"subtitle",elementDescriptor:A.$z.listGroupItemLabel})}var B=o(55033);function O(e){let{children:n}=e;return(0,i.Y)(p.so,{justify:"center",align:"center",gap:4,sx:e=>({marginBlockEnd:e.space.$6}),elementDescriptor:A.$z.logoGroup,children:n})}function L(e){let{children:n,sx:o,...t}=e;return(0,i.Y)(p.so,{...t,sx:[{flex:1},o],elementDescriptor:A.$z.logoGroupItem,children:n})}function W(e){let{size:n="md",sx:o,children:t}=e,l=e=>{let o="sm"===n?e.space.$6:e.space.$12,t="sm"===n?e.space.$3:e.space.$5;return{width:o,height:o,"&& > *":{width:t,height:t}}};return(0,i.Y)(p.az,{sx:e=>[{background:G.s.mergedColorsBackground(I.T.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50),borderRadius:e.radii.$circle,borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,display:"flex",alignItems:"center",justifyContent:"center"},l,o],elementDescriptor:A.$z.logoGroupItemContainer,children:t})}function j(e){let{icon:n=B.A,iconSx:o=e=>({color:e.colors.$primary500}),label:t}=e;return(0,i.Y)(p.In,{icon:n,sx:o,elementDescriptor:A.$z.logoGroupIcon,role:t?"img":void 0,"aria-label":t,"aria-hidden":!t||void 0})}function M(){return(0,i.Y)(p.az,{as:"svg",fill:"none",viewBox:"0 0 16 2",height:2,"aria-hidden":!0,sx:e=>({color:e.colors.$colorMutedForeground}),elementDescriptor:A.$z.logoGroupSeparator,children:(0,i.Y)("path",{stroke:"currentColor",strokeDasharray:"0.1 4",strokeLinecap:"round",strokeWidth:"2",d:"M1 1h14"})})}var N=o(63919),K=o(53693);function P(e){let{options:n,value:o,onChange:t}=e,l=(0,a.useRef)(null),r=n.find(e=>e.value===o);return(0,i.FD)(N.l6,{options:n,value:o,onChange:e=>t(e.value),referenceElement:l,renderOption:(e,n,o)=>(0,i.FD)(p.az,{as:"span",sx:e=>({width:"100%",display:"grid",gridTemplateColumns:"".concat(e.sizes.$5," 1fr ").concat(e.sizes.$3),columnGap:e.space.$2,paddingInlineStart:e.space.$1,paddingInlineEnd:e.space.$1x5,paddingBlock:e.space.$1,alignItems:"center",borderRadius:e.radii.$md,'&:hover, &[data-focused="true"]':{background:G.s.mutedBackground(e)}}),children:[(0,i.Y)(p._V,{src:e.logoUrl,alt:e.label,sx:e=>({width:e.sizes.$5,height:e.sizes.$5,objectFit:"contain",flexShrink:0,borderRadius:e.radii.$md})}),(0,i.Y)(p.EY,{sx:{flex:1,textAlign:"start",minWidth:0,maxInlineSize:"200px"},truncate:!0,as:"span",variant:"subtitle",children:e.label}),o&&(0,i.Y)(p.In,{icon:K.A,sx:e=>({color:e.colors.$primary500})})]}),children:[(0,i.FD)(N.JC,{ref:l,"aria-haspopup":"listbox",sx:e=>({paddingInline:e.space.$3}),children:[(0,i.Y)(p._V,{src:(null==r?void 0:r.logoUrl)||"",alt:(null==r?void 0:r.label)||"",sx:e=>({width:e.sizes.$5,height:e.sizes.$5,borderRadius:e.radii.$md,objectFit:"contain",flexShrink:0})}),(0,i.Y)(p.EY,{colorScheme:"body",as:"span",truncate:!0,sx:{flex:1,minWidth:0,textAlign:"start"},children:(null==r?void 0:r.label)||"Select an option"})]}),(0,i.Y)(N.UL,{})]})}o(74302),o(30686),o(38978),o(52205),o(40768),o(76235),o(85281);let V=()=>"u">typeof window&&!!window.location,q=/^(\d{1,3}\.){3}\d{1,3}$/,H="offline_access";function J(e){let{onOpen:n,onClose:o,isOpen:t,redirectUri:l,oauthApplicationName:r}=e;return t?(0,i.Y)(x.Modal,{handleOpen:n,handleClose:o,children:(0,i.Y)(f.Z.Root,{children:(0,i.FD)(f.Z.Content,{children:[(0,i.FD)(Y.Y.Root,{children:[(0,i.Y)(Y.Y.Title,{localizationKey:(0,h.G)("oauthConsent.redirectUriModal.title")}),(0,i.Y)(Y.Y.Subtitle,{localizationKey:(0,h.G)("oauthConsent.redirectUriModal.subtitle",{applicationName:r})})]}),(0,i.Y)(y.TM,{style:{maxHeight:"none"},cols:50,rows:6,defaultValue:l,readOnly:!0})]})})}):null}let Q=(0,d.G)((0,v.dm)(function(){var e,n,o,t,l,d,m,v,x,y,C,k,w,D,F,A,G,I,B,N,K,Q;let X=(0,c.W)(),ee=(0,r.ho)(),{user:en}=(0,r.Jd)(),{displayConfig:{applicationName:eo,logoImageUrl:et},organizationSettings:el}=(0,s.O)(),[ei,er]=(0,a.useState)(!1),[ea,ec]=(0,a.useState)(null),es=!!(X.onAllow||X.onDeny),ed=function(){var e,n;if(!V())return{oauthClientId:""};let o=new URLSearchParams(window.location.search),t=null!=(e=o.get("client_id"))?e:"",l=null!=(n=o.get("scope"))?n:void 0;return void 0!==l?{oauthClientId:t,scope:l}:{oauthClientId:t}}(),eu=null!=(e=X.oauthClientId)?e:ed.oauthClientId,eh=null!=(n=X.scope)?n:ed.scope,ep=null!=(o=X.redirectUrl)?o:V()&&null!=(Q=new URL(window.location.href).searchParams.get("redirect_uri"))?Q:"",{data:em,isLoading:eg,error:ef}=(0,r.$U)({oauthClientId:eu,scope:eh,redirectUri:ep||void 0,enabled:!es}),ev=null==em||null==(F=em.scopes)?void 0:F.map(e=>({scope:e.scope,description:e.description,requires_consent:e.requiresConsent})),eY=null!=(t=null!=(l=X.scopes)?l:ev)?t:[],eb=null!=(d=null!=(m=X.oauthApplicationName)?m:null==em?void 0:em.oauthApplicationName)?d:"",ex=null!=(v=X.oauthApplicationLogoUrl)?v:null==em?void 0:em.oauthApplicationLogoUrl,e$=null!=(x=X.oauthApplicationUrl)?x:null==em?void 0:em.oauthApplicationUrl,ey=null!=(y=X.redirectUrl)?y:ep,eC=!!(eY.some(e=>"user:org:read"===e.scope)&&el.enabled),ek=eC?(null!=(C=null==en?void 0:en.organizationMemberships)?C:[]).map(e=>({value:e.organization.id,label:e.organization.name,logoUrl:e.organization.imageUrl})):[],ew=null==(A=ee.session)?void 0:A.lastActiveOrganizationId,ez=null!=(k=null!=(w=null==(G=ek.find(e=>e.value===ew))?void 0:G.value)?w:null==(I=ek[0])?void 0:I.value)?k:null,eD=null!=ea?ea:ez,{t:eF}=(0,u._)(),eS=null!=(D=null==em?void 0:em.redirectDomain)?D:function(e){let n;try{n=new URL(e).hostname}catch{return""}if(!n)return"";let o=n.startsWith("[")&&n.endsWith("]")?n.slice(1,-1):n;return q.test(o)?o:o.includes(":")?"[".concat(o,"]"):o.split(".").slice(-2).join(".")}(ey),eA=eF((0,h.G)("oauthConsent.viewFullUrl")),eG=ex?void 0:function(e){if(!e)return;let n=e.trim().toLowerCase();return S.find(e=>e.domains.includes(n))}(eS);if(!es){let e=eu?ey?ef?null!=(K=ef.message)?K:"Failed to load consent information.":void 0:"The redirect URI is missing.":"The client ID is missing.";if(e)return(0,i.FD)(f.Z.Root,{children:[(0,i.Y)(f.Z.Content,{children:(0,i.Y)(f.Z.Alert,{children:e})}),(0,i.Y)(f.Z.Footer,{})]});if(eg)return(0,i.FD)(f.Z.Root,{children:[(0,i.Y)(f.Z.Content,{children:(0,i.Y)(b.W,{})}),(0,i.Y)(f.Z.Footer,{})]})}let eI=ee.oauthApplication.buildConsentActionUrl({clientId:eu}),eE=V()?Array.from(new URLSearchParams(window.location.search).entries()):[],eT=(null==en||null==(B=en.primaryEmailAddress)?void 0:B.emailAddress)||(null==en||null==(N=en.primaryPhoneNumber)?void 0:N.phoneNumber),eR=eY.filter(e=>e.scope!==H).map(e=>({...e,description:"private_metadata"===e.scope?eF((0,h.G)("oauthConsent.scopeList.privateMetadata",{applicationName:eo})):e.description})),eU=eY.some(e=>e.scope===H);return(0,i.FD)(i.FK,{children:[(0,i.FD)("form",{method:"POST",action:eI,onSubmit:e=>{var n,o;if(!es)return;e.preventDefault();let t=e.nativeEvent.submitter;(null==t?void 0:t.value)==="true"?null==(n=X.onAllow)||n.call(X):null==(o=X.onDeny)||o.call(X)},children:[(0,i.FD)(f.Z.Root,{children:[(0,i.FD)(f.Z.Content,{children:[(0,i.FD)(Y.Y.Root,{children:[ex&&et&&(0,i.FD)(O,{children:[(0,i.Y)(L,{justify:"end",children:(0,i.Y)(W,{children:(0,i.Y)(g.G,{src:ex,alt:eb,href:e$,isExternal:!0})})}),(0,i.Y)(M,{}),(0,i.Y)(L,{justify:"start",children:(0,i.Y)(W,{children:(0,i.Y)(g.G,{})})})]}),ex&&!et&&(0,i.Y)(O,{children:(0,i.FD)(p.az,{sx:{position:"relative"},children:[(0,i.Y)(W,{children:(0,i.Y)(g.G,{src:ex,alt:eb,href:e$,isExternal:!0})}),(0,i.Y)(W,{size:"sm",sx:e=>({position:"absolute",bottom:"calc(".concat(e.space.$2x5," * -1)"),insetInlineEnd:"calc(".concat(e.space.$2x5," * -1)")}),children:(0,i.Y)(j,{})})]})}),!ex&&et&&(0,i.FD)(O,{children:[(0,i.Y)(L,{justify:"end",children:(0,i.Y)(W,{children:(0,i.Y)(j,{icon:null==eG?void 0:eG.icon,iconSx:null==eG?void 0:eG.iconSx,label:null==eG?void 0:eG.name})})}),(0,i.Y)(M,{}),(0,i.Y)(L,{justify:"start",children:(0,i.Y)(W,{children:(0,i.Y)(g.G,{})})})]}),!ex&&!et&&(0,i.Y)(O,{children:(0,i.Y)(W,{children:(0,i.Y)(j,{icon:null==eG?void 0:eG.icon,iconSx:null==eG?void 0:eG.iconSx,label:null==eG?void 0:eG.name})})}),(0,i.Y)(Y.Y.Title,{localizationKey:eb}),(0,i.Y)(Y.Y.Subtitle,{localizationKey:(0,h.G)("oauthConsent.subtitle",{applicationName:eo,identifier:eT||""})})]}),eC&&ek.length>0&&eD&&(0,i.Y)(P,{options:ek,value:eD,onChange:ec}),(0,i.FD)(E,{children:[(0,i.Y)(T,{children:(0,i.Y)(R,{localizationKey:(0,h.G)("oauthConsent.scopeList.title",{applicationName:eb})})}),(0,i.Y)(U,{children:eR.map(e=>(0,i.Y)(Z,{children:(0,i.Y)(_,{children:e.description||e.scope||""})},e.scope))})]}),(0,i.Y)($.F,{colorScheme:"warning",children:(0,i.Y)(p.EY,{colorScheme:"warning",variant:"caption",children:(0,i.Y)(z,{text:eF((0,h.G)("oauthConsent.warning",{applicationName:eb||eo,domainAction:eS})),actionText:eS,onClick:()=>er(!0),tooltipText:eA})})}),(0,i.FD)(p.xA,{columns:2,gap:3,children:[(0,i.Y)(p.$n,{type:"submit",name:"consented",value:"false",colorScheme:"secondary",variant:"outline",localizationKey:(0,h.G)("oauthConsent.action__deny")}),(0,i.Y)(p.$n,{type:"submit",name:"consented",value:"true",localizationKey:(0,h.G)("oauthConsent.action__allow")}),(0,i.FD)(p.EY,{sx:{gridColumn:"span 2"},colorScheme:"secondary",variant:"caption",children:[(0,i.Y)(z,{text:eF((0,h.G)("oauthConsent.redirectNotice",{domainAction:eS})),actionText:eS,onClick:()=>er(!0),tooltipText:eA}),eU&&eF((0,h.G)("oauthConsent.offlineAccessNotice"))]})]})]}),(0,i.Y)(f.Z.Footer,{})]}),!es&&eE.map(e=>{let[n,o]=e;return(0,i.Y)("input",{type:"hidden",name:n,value:o},n)}),!es&&eC&&eD&&(0,i.Y)("input",{type:"hidden",name:"organization_id",value:eD})]}),(0,i.Y)(J,{isOpen:ei,onOpen:()=>er(!0),onClose:()=>er(!1),redirectUri:ey,oauthApplicationName:eb})]})})),X=()=>(0,i.Y)(m.n.Root,{flow:"oauthConsent",children:(0,i.Y)(m.n.Part,{children:(0,i.Y)(C.d,{children:(0,i.Y)(k.q,{children:(0,i.Y)(Q,{})})})})})},64480(e,n,o){o(15254);var t=o(59701);let l=(0,t.createContext)(null);o.d(n,{},{W:()=>{let e=(0,t.useContext)(l);if(null===e)throw Error("Clerk: useOAuthConsentContext called outside of the mounted OAuthConsent component.");return e},n:l})}}]);
|