@volter/twin-clerk 0.1.0
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/LICENSE +202 -0
- package/README.md +102 -0
- package/client/clerk-js-dist/167_clerk.headless_b86dff_5.127.2.js +1 -0
- package/client/clerk-js-dist/2172_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/2172_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/368_clerk.headless_b86dff_5.127.2.js +3 -0
- package/client/clerk-js-dist/377_clerk.headless_b86dff_5.127.2.js +1 -0
- package/client/clerk-js-dist/4170_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/4170_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/437_clerk.headless_b86dff_5.127.2.js +1 -0
- package/client/clerk-js-dist/5192_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/5192_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/553_clerk.headless_b86dff_5.127.2.js +1 -0
- package/client/clerk-js-dist/5645_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/5645_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/623_clerk.headless_b86dff_5.127.2.js +42 -0
- package/client/clerk-js-dist/7067_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/7067_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/7502_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/7502_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/785_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/client/clerk-js-dist/785_clerk.headless_b86dff_5.127.2.js +1 -0
- package/client/clerk-js-dist/8043_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/825_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/client/clerk-js-dist/825_clerk.headless_b86dff_5.127.2.js +1 -0
- package/client/clerk-js-dist/890_clerk.headless_b86dff_5.127.2.js +2 -0
- package/client/clerk-js-dist/901_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/client/clerk-js-dist/apiKeys_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/apiKeys_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/base-account-sdk_clerk.browser_0cc2cc_5.127.2.js +42 -0
- package/client/clerk-js-dist/base-account-sdk_clerk.headless.browser_540199_5.127.2.js +42 -0
- package/client/clerk-js-dist/base-account-sdk_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/blankcaptcha_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/blankcaptcha_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/checkout_clerk.browser_0cc2cc_5.127.2.js +9 -0
- package/client/clerk-js-dist/checkout_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/clerk.browser.js +19 -0
- package/client/clerk-js-dist/clerk.headless.browser.js +19 -0
- package/client/clerk-js-dist/clerk.headless.js +19 -0
- package/client/clerk-js-dist/clerk.js +809 -0
- package/client/clerk-js-dist/clerk.legacy.browser.js +1 -0
- package/client/clerk-js-dist/clerk.no-rhc.js +766 -0
- package/client/clerk-js-dist/coinbase-wallet-sdk_clerk.browser_0cc2cc_5.127.2.js +3 -0
- package/client/clerk-js-dist/coinbase-wallet-sdk_clerk.headless.browser_540199_5.127.2.js +3 -0
- package/client/clerk-js-dist/coinbase-wallet-sdk_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/cookieSuffix_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/cookieSuffix_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/client/clerk-js-dist/cookieSuffix_clerk.headless_b86dff_5.127.2.js +1 -0
- package/client/clerk-js-dist/cookieSuffix_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/copy-api-key-modal_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/copy-api-key-modal_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/createorganization_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/createorganization_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/enableOrganizationsPrompt_clerk.browser_0cc2cc_5.127.2.js +247 -0
- package/client/clerk-js-dist/enableOrganizationsPrompt_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/framework_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/framework_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/impersonationfab_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/impersonationfab_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/keylessPrompt_clerk.browser_0cc2cc_5.127.2.js +228 -0
- package/client/clerk-js-dist/keylessPrompt_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/oauthConsent_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/oauthConsent_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/onetap_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/onetap_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/op-api-keys-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/op-api-keys-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/op-billing-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/op-billing-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/op-plans-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/op-plans-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/organizationlist_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/organizationlist_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/organizationprofile_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/organizationprofile_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/organizationswitcher_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/organizationswitcher_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/payment-attempt-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/payment-attempt-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/planDetails_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/planDetails_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/prefetchorganizationlist_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/prefetchorganizationlist_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/pricingTable_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/pricingTable_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/query-core-vendors_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/query-core-vendors_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/client/clerk-js-dist/query-core-vendors_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/revoke-api-key-modal_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/revoke-api-key-modal_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/sessionTasks_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/sessionTasks_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/signin_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/signin_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/signup_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/signup_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/statement-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/statement-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/stripe-vendors_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/stripe-vendors_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/client/clerk-js-dist/stripe-vendors_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/subscriptionDetails_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/subscriptionDetails_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/taskChooseOrganization_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/taskChooseOrganization_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/taskResetPassword_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/taskResetPassword_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/taskSetupMFA_clerk.browser_0cc2cc_5.127.2.js +4 -0
- package/client/clerk-js-dist/taskSetupMFA_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/ui-common_clerk.browser_0cc2cc_5.127.2.js +124 -0
- package/client/clerk-js-dist/ui-common_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/up-api-keys-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/up-api-keys-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/up-billing-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/up-billing-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/up-plans-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/up-plans-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/useravatar_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/useravatar_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/userbutton_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/userbutton_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/userprofile_clerk.browser_0cc2cc_5.127.2.js +4 -0
- package/client/clerk-js-dist/userprofile_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/userverification_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/userverification_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/vendors_clerk.browser_0cc2cc_5.127.2.js +20 -0
- package/client/clerk-js-dist/vendors_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/client/clerk-js-dist/vendors_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/waitlist_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/waitlist_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/web3-solana-wallet-buttons_clerk.browser_0cc2cc_5.127.2.js +143 -0
- package/client/clerk-js-dist/web3-solana-wallet-buttons_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/zxcvbn-common_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/client/clerk-js-dist/zxcvbn-common_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/client/clerk-js-dist/zxcvbn-common_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-js-dist/zxcvbn-ts-core_clerk.browser_0cc2cc_5.127.2.js +2 -0
- package/client/clerk-js-dist/zxcvbn-ts-core_clerk.headless.browser_540199_5.127.2.js +2 -0
- package/client/clerk-js-dist/zxcvbn-ts-core_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/client/clerk-mirror.css +72 -0
- package/client/clerk-mirror.tsx +204 -0
- package/client/clerk.browser.js +19 -0
- package/dist/client/clerk-js-dist/167_clerk.headless_b86dff_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/2172_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/2172_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/368_clerk.headless_b86dff_5.127.2.js +3 -0
- package/dist/client/clerk-js-dist/377_clerk.headless_b86dff_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/4170_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/4170_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/437_clerk.headless_b86dff_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/5192_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/5192_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/553_clerk.headless_b86dff_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/5645_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/5645_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/623_clerk.headless_b86dff_5.127.2.js +42 -0
- package/dist/client/clerk-js-dist/7067_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/7067_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/7502_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/7502_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/785_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/785_clerk.headless_b86dff_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/8043_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/825_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/825_clerk.headless_b86dff_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/890_clerk.headless_b86dff_5.127.2.js +2 -0
- package/dist/client/clerk-js-dist/901_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/apiKeys_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/apiKeys_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/base-account-sdk_clerk.browser_0cc2cc_5.127.2.js +42 -0
- package/dist/client/clerk-js-dist/base-account-sdk_clerk.headless.browser_540199_5.127.2.js +42 -0
- package/dist/client/clerk-js-dist/base-account-sdk_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/blankcaptcha_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/blankcaptcha_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/checkout_clerk.browser_0cc2cc_5.127.2.js +9 -0
- package/dist/client/clerk-js-dist/checkout_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/clerk.browser.js +19 -0
- package/dist/client/clerk-js-dist/clerk.headless.browser.js +19 -0
- package/dist/client/clerk-js-dist/clerk.headless.js +19 -0
- package/dist/client/clerk-js-dist/clerk.js +809 -0
- package/dist/client/clerk-js-dist/clerk.legacy.browser.js +1 -0
- package/dist/client/clerk-js-dist/clerk.no-rhc.js +766 -0
- package/dist/client/clerk-js-dist/coinbase-wallet-sdk_clerk.browser_0cc2cc_5.127.2.js +3 -0
- package/dist/client/clerk-js-dist/coinbase-wallet-sdk_clerk.headless.browser_540199_5.127.2.js +3 -0
- package/dist/client/clerk-js-dist/coinbase-wallet-sdk_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/cookieSuffix_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/cookieSuffix_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/cookieSuffix_clerk.headless_b86dff_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/cookieSuffix_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/copy-api-key-modal_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/copy-api-key-modal_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/createorganization_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/createorganization_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/enableOrganizationsPrompt_clerk.browser_0cc2cc_5.127.2.js +247 -0
- package/dist/client/clerk-js-dist/enableOrganizationsPrompt_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/framework_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/framework_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/impersonationfab_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/impersonationfab_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/keylessPrompt_clerk.browser_0cc2cc_5.127.2.js +228 -0
- package/dist/client/clerk-js-dist/keylessPrompt_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/oauthConsent_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/oauthConsent_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/onetap_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/onetap_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/op-api-keys-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/op-api-keys-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/op-billing-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/op-billing-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/op-plans-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/op-plans-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/organizationlist_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/organizationlist_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/organizationprofile_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/organizationprofile_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/organizationswitcher_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/organizationswitcher_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/payment-attempt-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/payment-attempt-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/planDetails_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/planDetails_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/prefetchorganizationlist_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/prefetchorganizationlist_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/pricingTable_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/pricingTable_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/query-core-vendors_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/query-core-vendors_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/query-core-vendors_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/revoke-api-key-modal_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/revoke-api-key-modal_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/sessionTasks_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/sessionTasks_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/signin_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/signin_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/signup_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/signup_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/statement-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/statement-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/stripe-vendors_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/stripe-vendors_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/stripe-vendors_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/subscriptionDetails_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/subscriptionDetails_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/taskChooseOrganization_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/taskChooseOrganization_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/taskResetPassword_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/taskResetPassword_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/taskSetupMFA_clerk.browser_0cc2cc_5.127.2.js +4 -0
- package/dist/client/clerk-js-dist/taskSetupMFA_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/ui-common_clerk.browser_0cc2cc_5.127.2.js +124 -0
- package/dist/client/clerk-js-dist/ui-common_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/up-api-keys-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/up-api-keys-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/up-billing-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/up-billing-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/up-plans-page_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/up-plans-page_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/useravatar_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/useravatar_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/userbutton_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/userbutton_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/userprofile_clerk.browser_0cc2cc_5.127.2.js +4 -0
- package/dist/client/clerk-js-dist/userprofile_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/userverification_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/userverification_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/vendors_clerk.browser_0cc2cc_5.127.2.js +20 -0
- package/dist/client/clerk-js-dist/vendors_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/vendors_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/waitlist_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/waitlist_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/web3-solana-wallet-buttons_clerk.browser_0cc2cc_5.127.2.js +143 -0
- package/dist/client/clerk-js-dist/web3-solana-wallet-buttons_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/zxcvbn-common_clerk.browser_0cc2cc_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/zxcvbn-common_clerk.headless.browser_540199_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/zxcvbn-common_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-js-dist/zxcvbn-ts-core_clerk.browser_0cc2cc_5.127.2.js +2 -0
- package/dist/client/clerk-js-dist/zxcvbn-ts-core_clerk.headless.browser_540199_5.127.2.js +2 -0
- package/dist/client/clerk-js-dist/zxcvbn-ts-core_clerk.legacy.browser_6070dd_5.127.2.js +1 -0
- package/dist/client/clerk-mirror.bundle.js +321 -0
- package/dist/client/clerk-mirror.css +72 -0
- package/dist/client/clerk-mirror.d.ts +33 -0
- package/dist/client/clerk-mirror.js +143 -0
- package/dist/client/clerk-mirror.tsx +204 -0
- package/dist/client/clerk.browser.js +19 -0
- package/dist/src/clerk-capabilities.d.ts +4 -0
- package/dist/src/clerk-capabilities.js +1132 -0
- package/dist/src/clerk-conformance.d.ts +32 -0
- package/dist/src/clerk-conformance.js +158 -0
- package/dist/src/clerk-connector.d.ts +170 -0
- package/dist/src/clerk-connector.js +223 -0
- package/dist/src/clerk-events.d.ts +55 -0
- package/dist/src/clerk-events.js +146 -0
- package/dist/src/clerk-fapi.d.ts +19 -0
- package/dist/src/clerk-fapi.js +665 -0
- package/dist/src/clerk-jwt.d.ts +109 -0
- package/dist/src/clerk-jwt.js +230 -0
- package/dist/src/clerk-mirror-ui.d.ts +34 -0
- package/dist/src/clerk-mirror-ui.js +160 -0
- package/dist/src/clerk-server.d.ts +35 -0
- package/dist/src/clerk-server.js +172 -0
- package/dist/src/clerk-twin.d.ts +28 -0
- package/dist/src/clerk-twin.js +1658 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +35 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/index.js +56 -0
- package/dist/test-fixtures/clerk-openapi-operations.SOURCE.md +16 -0
- package/dist/test-fixtures/clerk-openapi-operations.json +1989 -0
- package/package.json +76 -0
- package/src/clerk-capabilities.ts +1246 -0
- package/src/clerk-conformance.ts +172 -0
- package/src/clerk-connector.ts +268 -0
- package/src/clerk-events.ts +166 -0
- package/src/clerk-fapi.ts +673 -0
- package/src/clerk-jwt.ts +256 -0
- package/src/clerk-mirror-ui.ts +165 -0
- package/src/clerk-server.ts +175 -0
- package/src/clerk-twin.ts +1580 -0
- package/src/cli.ts +33 -0
- package/src/index.ts +94 -0
- package/test-fixtures/clerk-openapi-operations.SOURCE.md +16 -0
- package/test-fixtures/clerk-openapi-operations.json +1989 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["4307"],{48641:function(n,e,t){t.r(e),t.d(e,{KeylessPrompt:()=>F,getResolvedContent:()=>A,getCurrentState:()=>M});var i=t(66950);t(91634),t(98383),t(45261),t(70957),t(24551),t(22349),t(65223);var r=t(73312),o=t(61869),a=t(65909),l=t(69144),c=t(51217),s=t(51164),d=t(11576);function u(){let n=(0,i._)(["\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n background: none;\n border: none;\n font-family:\n -apple-system,\n BlinkMacSystemFont,\n avenir next,\n avenir,\n segoe ui,\n helvetica neue,\n helvetica,\n Cantarell,\n Ubuntu,\n roboto,\n noto,\n arial,\n sans-serif;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n text-decoration: none;\n color: inherit;\n appearance: none;\n"]);return u=function(){return n},n}function p(){let n=(0,i._)(["\n ",";\n margin: 0.75rem 0 0;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 1.75rem;\n padding: 0.25rem 0.625rem;\n border-radius: 0.375rem;\n font-size: 0.75rem;\n font-weight: 500;\n letter-spacing: 0.12px;\n color: #fde047;\n text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.32);\n white-space: nowrap;\n user-select: none;\n cursor: pointer;\n background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30.5%, rgba(0, 0, 0, 0.05) 100%), #454545;\n box-shadow:\n 0px 0px 0px 1px rgba(255, 255, 255, 0.04) inset,\n 0px 1px 0px 0px rgba(255, 255, 255, 0.04) inset,\n 0px 0px 0px 1px rgba(0, 0, 0, 0.12),\n 0px 1.5px 2px 0px rgba(0, 0, 0, 0.48),\n 0px 0px 4px 0px rgba(243, 107, 22, 0) inset;\n outline: none;\n &:hover {\n background: #4b4b4b;\n transition: background-color 120ms ease-in-out;\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n }\n &:focus-visible {\n outline: 2px solid #6c47ff;\n outline-offset: 2px;\n }\n"]);return p=function(){return n},n}function f(){let n=(0,i._)(["\n ",";\n position: fixed;\n bottom: 1.25rem;\n right: 1.25rem;\n border-radius: ",";\n background-color: #1f1f1f;\n box-shadow:\n 0px 0px 0px 0.5px #2f3037 inset,\n 0px 1px 0px 0px rgba(255, 255, 255, 0.08) inset,\n 0px 0px 0.8px 0.8px rgba(255, 255, 255, 0.2) inset,\n 0px 0px 0px 0px rgba(255, 255, 255, 0.72),\n 0px 16px 36px -6px rgba(0, 0, 0, 0.36),\n 0px 6px 16px -2px rgba(0, 0, 0, 0.2);\n height: auto;\n isolation: isolate;\n transform: translateZ(0);\n backface-visibility: hidden;\n width: ",";\n transition:\n border-radius "," cubic-bezier(0.2, 0, 0, 1),\n width "," ",";\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n &:has(button:focus-visible) {\n outline: 2px solid #6c47ff;\n outline-offset: 2px;\n }\n &::before {\n content: '';\n pointer-events: none;\n position: absolute;\n inset: 0;\n border-radius: inherit;\n background-image: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);\n opacity: 0.16;\n transition: opacity "," ",";\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n }\n &[data-expanded='true']::before,\n &:hover::before {\n opacity: 0.2;\n }\n "]);return f=function(){return n},n}function h(){let n=(0,i._)(["\n ",";\n display: flex;\n align-items: center;\n width: 100%;\n border-radius: inherit;\n padding-inline: 0.75rem;\n gap: 0.25rem;\n height: 2.5rem;\n outline: none;\n cursor: pointer;\n user-select: none;\n "]);return h=function(){return n},n}function x(){let n=(0,i._)(["\n width: 1rem;\n height: 1rem;\n flex-shrink: 0;\n "]);return x=function(){return n},n}function m(){let n=(0,i._)(["\n ",";\n font-size: 0.875rem;\n font-weight: 500;\n color: #d9d9d9;\n white-space: nowrap;\n "]);return m=function(){return n},n}function g(){let n=(0,i._)(["\n button:hover & {\n opacity: 1;\n }\n "]);return g=function(){return n},n}function b(){let n=(0,i._)(["\n width: 1rem;\n height: 1rem;\n flex-shrink: 0;\n color: #d9d9d9;\n margin-inline-start: auto;\n opacity: ",";\n transition: opacity "," ease-out;\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n ","\n "]);return b=function(){return n},n}function C(){let n=(0,i._)(["\n ",";\n display: grid;\n grid-template-rows: ",";\n transition: grid-template-rows "," ",";\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n "]);return C=function(){return n},n}function v(){let n=(0,i._)(["\n ",";\n min-height: 0;\n overflow: hidden;\n "]);return v=function(){return n},n}function y(){let n=(0,i._)(["\n ",";\n width: ",";\n padding-inline: 0.75rem;\n padding-block-end: 0.75rem;\n opacity: ",";\n transition: opacity "," ",";\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n "]);return y=function(){return n},n}function k(){let n=(0,i._)(["\n ",";\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n & ul {\n ",";\n list-style: disc;\n padding-left: 1rem;\n }\n & p,\n & li {\n ",";\n color: #b4b4b4;\n font-size: 0.8125rem;\n font-weight: 400;\n line-height: 1rem;\n text-wrap: pretty;\n }\n & a {\n color: #fde047;\n font-weight: 500;\n outline: none;\n text-decoration: underline;\n &:focus-visible {\n outline: 2px solid #6c47ff;\n outline-offset: 2px;\n }\n }\n "]);return k=function(){return n},n}let w="18rem",Z="cubic-bezier(0.2, 0, 0, 1)",_=(0,a.iv)(u());function B(n){return n?"220ms":"180ms"}let U=(0,a.iv)(p(),_),L={idle:{triggerWidth:"14.25rem",title:"Configure your application",description:(0,r.BX)(r.HY,{children:[(0,r.tZ)("p",{children:"Temporary API keys are enabled so you can get started immediately."}),(0,r.tZ)("ul",{children:["Add SSO connections (eg. GitHub)","Set up B2B authentication","Enable MFA"].map(n=>(0,r.tZ)("li",{children:n},n))}),(0,r.tZ)("p",{children:"Access the dashboard to customize auth settings and explore Clerk features."})]}),cta:{kind:"link",text:"Configure your application",href:n=>{let{claimUrl:e}=n;return e}}},userCreated:{triggerWidth:"15.75rem",title:"You've created your first user!",description:(0,r.tZ)("p",{children:"Head to the dashboard to customize authentication settings, view user info, and explore more features."}),cta:{kind:"link",text:"Configure your application",href:n=>{let{claimUrl:e}=n;return e}}},claimed:{triggerWidth:"14.25rem",title:"Missing environment keys",description:(0,r.tZ)("p",{children:"You claimed this application but haven't set keys in your environment. Get them from the Clerk Dashboard."}),cta:{kind:"link",text:"Get API keys",href:n=>{let{claimUrl:e}=n;return e}}},completed:{triggerWidth:"10.5rem",title:"Your app is ready",description:n=>{let{appName:e,instanceUrl:t}=n;return(0,r.BX)("p",{children:["Your application"," ",(0,r.tZ)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:e})," ","has been configured. You may now customize your settings in the Clerk dashboard."]})},cta:{kind:"action",text:"Dismiss",onClick:n=>{null==n||n().then(()=>{window.location.reload()})}}}};function M(n,e,t){return e?"completed":n?"claimed":t?"userCreated":"idle"}function A(n,e){let t=L[n],i="function"==typeof t.description?t.description({appName:e.appName,instanceUrl:e.instanceUrl}):t.description,r=t.cta,o="link"===r.kind?{kind:"link",text:r.text,href:"function"==typeof r.href?r.href({claimUrl:e.claimUrl,instanceUrl:e.instanceUrl}):r.href}:{kind:"action",text:r.text,onClick:()=>r.onClick(e.onDismiss)};return{state:n,triggerWidth:t.triggerWidth,title:t.title,description:i,cta:o}}function D(n){let e=(0,l.useId)(),t=function(){let n=(0,o.cL)(),e=(0,l.useRef)(Date.now()),[,t]=(0,l.useReducer)(n=>n+1,0);return(0,l.useEffect)(()=>{let i=new AbortController;return window.addEventListener("focus",async()=>{let r=n.__unstable__environment;if(r){if(null!==r.authConfig.claimedAt)return i.abort();if(!(Date.now()<e.current+1e4)&&"visible"===document.visibilityState)for(let n=0;n<2;n++){let{authConfig:{claimedAt:n}}=await r.fetch();if(e.current=Date.now(),null!==n){t();break}}}},{signal:i.signal}),()=>{i.abort()}},[]),(0,d.useEnvironment)()}(),i=!!t.authConfig.claimedAt,c="function"==typeof n.onDismiss&&i,{isSignedIn:u}=(0,o.aF)(),p=t.displayConfig.applicationName,L=(0,l.useMemo)(()=>{if(i)return n.copyKeysUrl;let e=new URL(n.claimUrl);return e.searchParams.append("return_url",window.location.href),e.href},[i,n.copyKeysUrl,n.claimUrl]),D=(0,l.useMemo)(()=>(function(n){try{return n()}catch{return"https://dashboard.clerk.com/last-active"}})(()=>{let e=(0,s.EA)(n.copyKeysUrl);return new URL("".concat(e.baseDomain,"/apps/").concat(e.appId,"/instances/").concat(e.instanceId,"/user-authentication/email-phone-username")).href}),[n.copyKeysUrl]),[F,z]=(0,l.useState)(!0),S=M(i,c,!!u),I=(0,l.useMemo)(()=>A(S,{appName:p,instanceUrl:D,claimUrl:L,onDismiss:n.onDismiss}),[S,p,D,L,n.onDismiss]),X="link"===I.cta.kind?(0,r.tZ)("a",{href:I.cta.href,target:"_blank",rel:"noopener noreferrer",css:U,children:I.cta.text}):(0,r.tZ)("button",{type:"button",onClick:I.cta.onClick,css:U,children:I.cta.text});return(0,r.BX)("div",{"data-expanded":F,css:(0,a.iv)(f(),_,F?"0.75rem":"2.5rem",F?w:I.triggerWidth,B(F),B(F),Z,B(F),Z),children:[(0,r.BX)("button",{type:"button","aria-label":"Keyless prompt","aria-controls":e,"aria-expanded":F,onClick:()=>z(n=>!n),css:(0,a.iv)(h(),_),children:[(0,r.BX)("svg",{css:(0,a.iv)(x()),fill:"none",viewBox:"0 0 128 128",children:[(0,r.tZ)("circle",{cx:"64",cy:"64",r:"20",fill:"#fff"}),(0,r.tZ)("path",{fill:"#fff",fillOpacity:".4",d:"M99.572 10.788c1.999 1.34 2.17 4.156.468 5.858L85.424 31.262c-1.32 1.32-3.37 1.53-5.033.678A35.846 35.846 0 0 0 64 28c-19.882 0-36 16.118-36 36a35.846 35.846 0 0 0 3.94 16.391c.851 1.663.643 3.712-.678 5.033L16.646 100.04c-1.702 1.702-4.519 1.531-5.858-.468C3.974 89.399 0 77.163 0 64 0 28.654 28.654 0 64 0c13.163 0 25.399 3.974 35.572 10.788Z"}),(0,r.tZ)("path",{fill:"#fff",d:"M100.04 111.354c1.702 1.702 1.531 4.519-.468 5.858C89.399 124.026 77.164 128 64 128c-13.164 0-25.399-3.974-35.572-10.788-2-1.339-2.17-4.156-.468-5.858l14.615-14.616c1.322-1.32 3.37-1.53 5.033-.678A35.847 35.847 0 0 0 64 100a35.846 35.846 0 0 0 16.392-3.94c1.662-.852 3.712-.643 5.032.678l14.616 14.616Z"})]}),(0,r.tZ)("span",{css:(0,a.iv)(m(),_),children:I.title}),(0,r.tZ)("svg",{css:(0,a.iv)(b(),.5*!!F,B(F),F&&(0,a.iv)(g())),viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:(0,r.tZ)("path",{d:"M3.75 8H12.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),(0,r.tZ)("div",{id:e,...!F&&{inert:""},css:(0,a.iv)(C(),_,F?"1fr":"0fr",B(F),Z),children:(0,r.tZ)("div",{css:(0,a.iv)(v(),_),children:(0,r.BX)("div",{css:(0,a.iv)(y(),_,w,+!!F,B(F),Z),children:[(0,r.tZ)("div",{css:(0,a.iv)(k(),_,_,_),children:I.description}),X]})})})]})}function F(n){return(0,r.tZ)(c.InternalThemeProvider,{children:(0,r.tZ)(D,{...n})})}},51164:function(n,e,t){t.d(e,{EA:()=>u,H8:()=>d,Ui:()=>s,Xz:()=>p,lc:()=>c});var i=t(66950);t(91634),t(98383),t(45261),t(70957),t(24551),t(22349),t(65223),t(56113),t(92037);var r=t(73312),o=t(65909),a=t(64204);function l(){let n=(0,i._)(["\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n background: none;\n border: none;\n line-height: 1.5;\n font-family:\n -apple-system,\n BlinkMacSystemFont,\n avenir next,\n avenir,\n segoe ui,\n helvetica neue,\n helvetica,\n Cantarell,\n Ubuntu,\n roboto,\n noto,\n arial,\n sans-serif;\n text-decoration: none;\n"]);return l=function(){return n},n}function c(n){let{children:e,sx:t,...i}=n;return(0,r.tZ)(a.Flex,{sx:n=>[{borderRadius:"1.25rem",fontFamily:n.fonts.$main,background:"linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 100%), #1f1f1f",boxShadow:"0px 0px 0px 0.5px #2F3037 inset, 0px 1px 0px 0px rgba(255, 255, 255, 0.08) inset, 0px 0px 0.8px 0.8px rgba(255, 255, 255, 0.20) inset, 0px 0px 0px 0px rgba(255, 255, 255, 0.72), 0px 16px 36px -6px rgba(0, 0, 0, 0.36), 0px 6px 16px -2px rgba(0, 0, 0, 0.20);"},t],...i,children:e})}let s=(0,o.iv)(l());function d(n){return(0,r.tZ)("svg",{...n,viewBox:"0 0 16 17",fill:"none","aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg",children:(0,r.BX)("g",{opacity:"0.88",children:[(0,r.tZ)("path",{d:"M13.8002 8.20039C13.8002 8.96206 13.6502 9.71627 13.3587 10.42C13.0672 11.1236 12.64 11.763 12.1014 12.3016C11.5628 12.8402 10.9234 13.2674 10.2198 13.5589C9.51607 13.8504 8.76186 14.0004 8.0002 14.0004C7.23853 14.0004 6.48432 13.8504 5.78063 13.5589C5.07694 13.2674 4.43756 12.8402 3.89898 12.3016C3.3604 11.763 2.93317 11.1236 2.64169 10.42C2.35022 9.71627 2.2002 8.96206 2.2002 8.20039C2.2002 6.66214 2.81126 5.18688 3.89898 4.09917C4.98669 3.01146 6.46194 2.40039 8.0002 2.40039C9.53845 2.40039 11.0137 3.01146 12.1014 4.09917C13.1891 5.18688 13.8002 6.66214 13.8002 8.20039Z",fill:"#22C543",fillOpacity:"0.16"}),(0,r.tZ)("path",{d:"M6.06686 8.68372L7.51686 10.1337L9.93353 6.75039M13.8002 8.20039C13.8002 8.96206 13.6502 9.71627 13.3587 10.42C13.0672 11.1236 12.64 11.763 12.1014 12.3016C11.5628 12.8402 10.9234 13.2674 10.2198 13.5589C9.51607 13.8504 8.76186 14.0004 8.0002 14.0004C7.23853 14.0004 6.48432 13.8504 5.78063 13.5589C5.07694 13.2674 4.43756 12.8402 3.89898 12.3016C3.3604 11.763 2.93317 11.1236 2.64169 10.42C2.35022 9.71627 2.2002 8.96206 2.2002 8.20039C2.2002 6.66214 2.81126 5.18688 3.89898 4.09917C4.98669 3.01146 6.46194 2.40039 8.0002 2.40039C9.53845 2.40039 11.0137 3.01146 12.1014 4.09917C13.1891 5.18688 13.8002 6.66214 13.8002 8.20039Z",stroke:"#22C543",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function u(n){let e=new URL(n).href.match(/^https?:\/\/(.*?)\/apps\/app_(.+?)\/instances\/ins_(.+?)(?:\/.*)?$/);if(!e)throw Error("Invalid value Dashboard URL structure");return{baseDomain:"https://".concat(e[1]),appId:"app_".concat(e[2]),instanceId:"ins_".concat(e[3])}}function p(){return(0,r.BX)("svg",{width:"1rem",height:"1.25rem",viewBox:"0 0 16 20",fill:"none","aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg",children:[(0,r.BX)("g",{filter:"url(#filter0_i_438_501)",children:[(0,r.tZ)("path",{d:"M10.4766 9.99979C10.4766 11.3774 9.35978 12.4942 7.98215 12.4942C6.60452 12.4942 5.48773 11.3774 5.48773 9.99979C5.48773 8.62216 6.60452 7.50537 7.98215 7.50537C9.35978 7.50537 10.4766 8.62216 10.4766 9.99979Z",fill:"#BBBBBB"}),(0,r.tZ)("path",{d:"M12.4176 3.36236C12.6676 3.52972 12.6889 3.88187 12.4762 4.09457L10.6548 5.91595C10.4897 6.08107 10.2336 6.10714 10.0257 6.00071C9.41273 5.68684 8.71811 5.50976 7.98214 5.50976C5.5024 5.50976 3.49219 7.51998 3.49219 9.99972C3.49219 10.7357 3.66926 11.4303 3.98314 12.0433C4.08957 12.2511 4.06349 12.5073 3.89837 12.6724L2.07699 14.4938C1.86429 14.7065 1.51215 14.6851 1.34479 14.4352C0.495381 13.1666 0 11.641 0 9.99972C0 5.5913 3.57373 2.01758 7.98214 2.01758C9.62345 2.01758 11.1491 2.51296 12.4176 3.36236Z",fill:"#8F8F8F"}),(0,r.tZ)("path",{d:"M12.4762 15.905C12.6889 16.1177 12.6675 16.4698 12.4176 16.6372C11.149 17.4866 9.62342 17.982 7.9821 17.982C6.34078 17.982 4.81516 17.4866 3.54661 16.6372C3.29666 16.4698 3.27531 16.1177 3.48801 15.905L5.30938 14.0836C5.4745 13.9185 5.73066 13.8924 5.93851 13.9988C6.55149 14.3127 7.24612 14.4898 7.9821 14.4898C8.71808 14.4898 9.4127 14.3127 10.0257 13.9988C10.2335 13.8924 10.4897 13.9185 10.6548 14.0836L12.4762 15.905Z",fill:"#BBBBBB"})]}),(0,r.tZ)("defs",{children:(0,r.BX)("filter",{id:"filter0_i_438_501",x:"0",y:"1.86758",width:"12.6217",height:"16.1144",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.tZ)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.tZ)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.tZ)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,r.tZ)("feOffset",{dy:"-0.15"}),(0,r.tZ)("feGaussianBlur",{stdDeviation:"0.15"}),(0,r.tZ)("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),(0,r.tZ)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),(0,r.tZ)("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_438_501"})]})})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["8776"],{40429:function(e,t,o){o.r(t),o.d(t,{OAuthConsent:()=>w,OAuthConsentInternal:()=>m});var r=o(73312),n=o(61869),l=o(69144),i=o(11576),a=o(64204),c=o(53174),s=o(92418),d=o(2672),u=o(92654),h=o(56459),p=o(19732),b=o(34174),Z=o(30215),x=o(51217),g=o(25407);let y="offline_access";function m(){let{scopes:e,oAuthApplicationName:t,oAuthApplicationLogoUrl:o,oAuthApplicationUrl:d,redirectUrl:h,onDeny:b,onAllow:m}=(0,i.useOAuthConsentContext)(),{user:w}=(0,n.aF)(),{applicationName:R,logoImageUrl:S}=(0,i.useEnvironment)().displayConfig,[v,A]=(0,l.useState)(!1),T=w?.primaryEmailAddress?.emailAddress||w?.primaryPhoneNumber?.phoneNumber,X=(e||[]).filter(e=>e.scope!==y),z=(e||[]).some(e=>e.scope===y);function j(){try{let{hostname:e}=new URL(h);return e.split(".").slice(-2).join(".")}catch{return""}}return(0,r.BX)(a.Flow.Root,{flow:"oauthConsent",children:[(0,r.BX)(s.Z.Root,{children:[(0,r.BX)(s.Z.Content,{children:[(0,r.BX)(u.h.Root,{children:[o&&S&&(0,r.BX)(f,{children:[(0,r.tZ)(k,{justify:"end",children:(0,r.tZ)(c.u,{src:o,alt:t,href:d,isExternal:!0})}),(0,r.tZ)(C,{}),(0,r.tZ)(k,{justify:"start",children:(0,r.tZ)(c.u,{})})]}),o&&!S&&(0,r.tZ)(f,{children:(0,r.BX)(a.Box,{sx:{position:"relative"},children:[(0,r.tZ)(c.u,{src:o,alt:t,href:d,isExternal:!0}),(0,r.tZ)(B,{size:"sm",sx:e=>({position:"absolute",bottom:`calc(${e.space.$3} * -1)`,right:`calc(${e.space.$3} * -1)`})})]})}),!o&&S&&(0,r.BX)(f,{children:[(0,r.tZ)(k,{justify:"end",children:(0,r.tZ)(B,{})}),(0,r.tZ)(C,{}),(0,r.tZ)(k,{justify:"start",children:(0,r.tZ)(c.u,{})})]}),!o&&!S&&(0,r.tZ)(f,{children:(0,r.tZ)(B,{})}),(0,r.tZ)(u.h.Title,{localizationKey:t}),(0,r.tZ)(u.h.Subtitle,{localizationKey:`wants to access ${R} on behalf of ${T}`})]}),(0,r.BX)(a.Box,{sx:e=>({textAlign:"left",borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg,overflow:"hidden"}),children:[(0,r.tZ)(a.Box,{sx:e=>({padding:e.space.$3,background:x.common.mergedColorsBackground(g.O9.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50)}),children:(0,r.tZ)(a.Text,{variant:"subtitle",localizationKey:`This will allow ${t} access to:`})}),(0,r.tZ)(a.Box,{as:"ul",sx:e=>({margin:e.sizes.$none,padding:e.sizes.$none}),children:X.map(e=>(0,r.tZ)(a.Box,{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)",marginRight:e.space.$2,flexShrink:0}}),as:"li",children:(0,r.tZ)(a.Text,{variant:"subtitle",localizationKey:e.description||e.scope||""})},e.scope))})]}),(0,r.tZ)(Z.bZ,{colorScheme:"warning",children:(0,r.BX)(a.Text,{colorScheme:"warning",variant:"caption",children:["Make sure that you trust ",t," ","",(0,r.BX)(p.u.Root,{children:[(0,r.tZ)(p.u.Trigger,{children:(0,r.BX)(a.Text,{as:"span",role:"button",tabIndex:0,"aria-label":"View full URL",variant:"caption",sx:{textDecoration:"underline",textDecorationStyle:"dotted",cursor:"pointer",outline:"none",display:"inline-block"},onClick:()=>A(!0),children:["(",j(),")"]})}),(0,r.tZ)(p.u.Content,{text:"View full URL"})]}),"",". You may be sharing sensitive data with this site or app."]})}),(0,r.BX)(a.Grid,{columns:2,gap:3,children:[(0,r.tZ)(a.Button,{colorScheme:"secondary",variant:"outline",localizationKey:"Deny",onClick:b}),(0,r.tZ)(a.Button,{localizationKey:"Allow",onClick:m}),(0,r.BX)(a.Text,{sx:{gridColumn:"span 2"},colorScheme:"secondary",variant:"caption",children:["If you allow access, this app will redirect you to"," ",(0,r.BX)(p.u.Root,{children:[(0,r.tZ)(p.u.Trigger,{children:(0,r.tZ)(a.Text,{as:"span",role:"button",tabIndex:0,"aria-label":"View full URL",variant:"caption",sx:{textDecoration:"underline",textDecorationStyle:"dotted",cursor:"pointer",outline:"none",display:"inline-block"},onClick:()=>A(!0),children:j()})}),(0,r.tZ)(p.u.Content,{text:"View full URL"})]}),".",z&&" You'll stay signed in until you sign out or revoke access."]})]})]}),(0,r.tZ)(s.Z.Footer,{})]}),(0,r.tZ)($,{isOpen:v,onOpen:()=>A(!0),onClose:()=>A(!1),redirectUri:h,oAuthApplicationName:t})]})}function $({onOpen:e,onClose:t,isOpen:o,redirectUri:n,oAuthApplicationName:l}){return o?(0,r.tZ)(h.Modal,{handleOpen:e,handleClose:t,children:(0,r.tZ)(s.Z.Root,{children:(0,r.BX)(s.Z.Content,{children:[(0,r.BX)(u.h.Root,{children:[(0,r.tZ)(u.h.Title,{localizationKey:"Redirect URL"}),(0,r.tZ)(u.h.Subtitle,{localizationKey:`Make sure you trust ${l} and that this URL belongs to ${l}.`})]}),(0,r.tZ)(Z.gx,{style:{maxHeight:"none"},cols:50,rows:6,defaultValue:n,readOnly:!0})]})})}):null}function f({children:e}){return(0,r.tZ)(a.Flex,{justify:"center",align:"center",gap:4,sx:e=>({marginBlockEnd:e.space.$6}),children:e})}function k({children:e,sx:t,...o}){return(0,r.tZ)(a.Flex,{...o,sx:[{flex:1},t],children:e})}function B({size:e="md",sx:t}){let o=t=>{let o="sm"===e?t.space.$6:t.space.$12;return{width:o,height:o}};return(0,r.tZ)(a.Box,{sx:e=>[{background:x.common.mergedColorsBackground(g.O9.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"},o,t],children:(0,r.tZ)(a.Icon,{icon:b.LG,sx:e=>({color:e.colors.$primary500})})})}function C(){return(0,r.tZ)(a.Box,{as:"svg",fill:"none",viewBox:"0 0 16 2",height:2,"aria-hidden":!0,sx:e=>({color:e.colors.$colorMutedForeground}),children:(0,r.tZ)("path",{stroke:"currentColor",strokeDasharray:"0.1 4",strokeLinecap:"round",strokeWidth:"2",d:"M1 1h14"})})}let w=(0,d.withCardStateProvider)(m)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["8776"],{40429:function(e,t,o){o.r(t),o.d(t,{OAuthConsent:()=>w,OAuthConsentInternal:()=>m}),o(65223),o(91634),o(98383),o(45261),o(70957),o(24551),o(22349),o(56113);var r=o(73312),n=o(61869),l=o(69144),i=o(11576),a=o(64204),c=o(53174),s=o(92418),d=o(2672),u=o(92654),h=o(56459),p=o(19732),b=o(96519),Z=o(30215),x=o(51217),g=o(25407);let y="offline_access";function m(){var e,t;let{scopes:o,oAuthApplicationName:d,oAuthApplicationLogoUrl:h,oAuthApplicationUrl:b,redirectUrl:m,onDeny:w,onAllow:v}=(0,i.useOAuthConsentContext)(),{user:R}=(0,n.aF)(),{applicationName:S,logoImageUrl:A}=(0,i.useEnvironment)().displayConfig,[T,X]=(0,l.useState)(!1),z=(null==R||null==(e=R.primaryEmailAddress)?void 0:e.emailAddress)||(null==R||null==(t=R.primaryPhoneNumber)?void 0:t.phoneNumber),j=(o||[]).filter(e=>e.scope!==y),L=(o||[]).some(e=>e.scope===y);function O(){try{let{hostname:e}=new URL(m);return e.split(".").slice(-2).join(".")}catch{return""}}return(0,r.BX)(a.Flow.Root,{flow:"oauthConsent",children:[(0,r.BX)(s.Z.Root,{children:[(0,r.BX)(s.Z.Content,{children:[(0,r.BX)(u.h.Root,{children:[h&&A&&(0,r.BX)(k,{children:[(0,r.tZ)(B,{justify:"end",children:(0,r.tZ)(c.u,{src:h,alt:d,href:b,isExternal:!0})}),(0,r.tZ)(C,{}),(0,r.tZ)(B,{justify:"start",children:(0,r.tZ)(c.u,{})})]}),h&&!A&&(0,r.tZ)(k,{children:(0,r.BX)(a.Box,{sx:{position:"relative"},children:[(0,r.tZ)(c.u,{src:h,alt:d,href:b,isExternal:!0}),(0,r.tZ)($,{size:"sm",sx:e=>({position:"absolute",bottom:"calc(".concat(e.space.$3," * -1)"),right:"calc(".concat(e.space.$3," * -1)")})})]})}),!h&&A&&(0,r.BX)(k,{children:[(0,r.tZ)(B,{justify:"end",children:(0,r.tZ)($,{})}),(0,r.tZ)(C,{}),(0,r.tZ)(B,{justify:"start",children:(0,r.tZ)(c.u,{})})]}),!h&&!A&&(0,r.tZ)(k,{children:(0,r.tZ)($,{})}),(0,r.tZ)(u.h.Title,{localizationKey:d}),(0,r.tZ)(u.h.Subtitle,{localizationKey:"wants to access ".concat(S," on behalf of ").concat(z)})]}),(0,r.BX)(a.Box,{sx:e=>({textAlign:"left",borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg,overflow:"hidden"}),children:[(0,r.tZ)(a.Box,{sx:e=>({padding:e.space.$3,background:x.common.mergedColorsBackground(g.O9.setAlpha(e.colors.$colorBackground,1),e.colors.$neutralAlpha50)}),children:(0,r.tZ)(a.Text,{variant:"subtitle",localizationKey:"This will allow ".concat(d," access to:")})}),(0,r.tZ)(a.Box,{as:"ul",sx:e=>({margin:e.sizes.$none,padding:e.sizes.$none}),children:j.map(e=>(0,r.tZ)(a.Box,{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)",marginRight:e.space.$2,flexShrink:0}}),as:"li",children:(0,r.tZ)(a.Text,{variant:"subtitle",localizationKey:e.description||e.scope||""})},e.scope))})]}),(0,r.tZ)(Z.bZ,{colorScheme:"warning",children:(0,r.BX)(a.Text,{colorScheme:"warning",variant:"caption",children:["Make sure that you trust ",d," ","",(0,r.BX)(p.u.Root,{children:[(0,r.tZ)(p.u.Trigger,{children:(0,r.BX)(a.Text,{as:"span",role:"button",tabIndex:0,"aria-label":"View full URL",variant:"caption",sx:{textDecoration:"underline",textDecorationStyle:"dotted",cursor:"pointer",outline:"none",display:"inline-block"},onClick:()=>X(!0),children:["(",O(),")"]})}),(0,r.tZ)(p.u.Content,{text:"View full URL"})]}),"",". You may be sharing sensitive data with this site or app."]})}),(0,r.BX)(a.Grid,{columns:2,gap:3,children:[(0,r.tZ)(a.Button,{colorScheme:"secondary",variant:"outline",localizationKey:"Deny",onClick:w}),(0,r.tZ)(a.Button,{localizationKey:"Allow",onClick:v}),(0,r.BX)(a.Text,{sx:{gridColumn:"span 2"},colorScheme:"secondary",variant:"caption",children:["If you allow access, this app will redirect you to"," ",(0,r.BX)(p.u.Root,{children:[(0,r.tZ)(p.u.Trigger,{children:(0,r.tZ)(a.Text,{as:"span",role:"button",tabIndex:0,"aria-label":"View full URL",variant:"caption",sx:{textDecoration:"underline",textDecorationStyle:"dotted",cursor:"pointer",outline:"none",display:"inline-block"},onClick:()=>X(!0),children:O()})}),(0,r.tZ)(p.u.Content,{text:"View full URL"})]}),".",L&&" You'll stay signed in until you sign out or revoke access."]})]})]}),(0,r.tZ)(s.Z.Footer,{})]}),(0,r.tZ)(f,{isOpen:T,onOpen:()=>X(!0),onClose:()=>X(!1),redirectUri:m,oAuthApplicationName:d})]})}function f(e){let{onOpen:t,onClose:o,isOpen:n,redirectUri:l,oAuthApplicationName:i}=e;return n?(0,r.tZ)(h.Modal,{handleOpen:t,handleClose:o,children:(0,r.tZ)(s.Z.Root,{children:(0,r.BX)(s.Z.Content,{children:[(0,r.BX)(u.h.Root,{children:[(0,r.tZ)(u.h.Title,{localizationKey:"Redirect URL"}),(0,r.tZ)(u.h.Subtitle,{localizationKey:"Make sure you trust ".concat(i," and that this URL belongs to ").concat(i,".")})]}),(0,r.tZ)(Z.gx,{style:{maxHeight:"none"},cols:50,rows:6,defaultValue:l,readOnly:!0})]})})}):null}function k(e){let{children:t}=e;return(0,r.tZ)(a.Flex,{justify:"center",align:"center",gap:4,sx:e=>({marginBlockEnd:e.space.$6}),children:t})}function B(e){let{children:t,sx:o,...n}=e;return(0,r.tZ)(a.Flex,{...n,sx:[{flex:1},o],children:t})}function $(e){let{size:t="md",sx:o}=e,n=e=>{let o="sm"===t?e.space.$6:e.space.$12;return{width:o,height:o}};return(0,r.tZ)(a.Box,{sx:e=>[{background:x.common.mergedColorsBackground(g.O9.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"},n,o],children:(0,r.tZ)(a.Icon,{icon:b.LG,sx:e=>({color:e.colors.$primary500})})})}function C(){return(0,r.tZ)(a.Box,{as:"svg",fill:"none",viewBox:"0 0 16 2",height:2,"aria-hidden":!0,sx:e=>({color:e.colors.$colorMutedForeground}),children:(0,r.tZ)("path",{stroke:"currentColor",strokeDasharray:"0.1 4",strokeLinecap:"round",strokeWidth:"2",d:"M1 1h14"})})}let w=(0,d.withCardStateProvider)(m)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["9920"],{41491:function(e,t,n){n.r(t),n.d(t,{OneTap:()=>f});var c=n(73312),o=n(69144),a=n(11576),i=n(64204),l=n(24676),r=n(61869),u=n(2672),s=n(25758),p=n(65695);let d=(0,u.withCardStateProvider)(function(){let e=(0,r.cL)(),{user:t}=(0,r.aF)(),n=(0,a.useEnvironment)(),c=(0,o.useRef)(!1),{navigate:i}=(0,l.useRouter)(),u=(0,a.useGoogleOneTapContext)();async function d(t){c.current=!1;try{let n=await e.authenticateWithGoogleOneTap({token:t.credential});await e.handleGoogleOneTapCallback(n,u.generateCallbackUrls(window.location.href),i)}catch(e){console.error(e)}}let h=n.displayConfig.googleOneTapClientId,f=!t?.id&&!!h;async function _(){let e=await (0,s.g)();return e.accounts.id.initialize({client_id:h,callback:d,itp_support:u.itpSupport,cancel_on_tap_outside:u.cancelOnTapOutside,auto_select:!1,use_fedcm_for_prompt:u.fedCmSupport}),e}let{data:g}=(0,p.ib)(f?_:void 0,"google-identity-services-script");return(0,o.useEffect)(()=>{!g||t?.id||c.current||(g.accounts.id.prompt(t=>{"skipped"===t.getMomentType()&&e.closeGoogleOneTap()}),c.current=!0)},[e,g,t?.id]),(0,o.useEffect)(()=>()=>{g&&c.current&&(c.current=!1,g.accounts.id.cancel())},[g]),null});function h(){return(0,c.tZ)(l.Route,{path:"one-tap",children:(0,c.tZ)(i.Flow.Root,{flow:"oneTap",children:(0,c.tZ)(l.Switch,{children:(0,c.tZ)(l.Route,{index:!0,children:(0,c.tZ)(d,{})})})})})}h.displayName="OneTap";let f=(0,a.withCoreSessionSwitchGuard)(h)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["9920"],{41491:function(e,t,n){n.r(t),n.d(t,{OneTap:()=>f});var o=n(73312),i=n(69144),a=n(11576),c=n(64204),l=n(24676);n(50725);var r=n(61869),u=n(2672);n(24152);var s=n(25758),d=n(65695);let p=(0,u.withCardStateProvider)(function(){let e=(0,r.cL)(),{user:t}=(0,r.aF)(),n=(0,a.useEnvironment)(),o=(0,i.useRef)(!1),{navigate:c}=(0,l.useRouter)(),u=(0,a.useGoogleOneTapContext)();async function p(t){o.current=!1;try{let n=await e.authenticateWithGoogleOneTap({token:t.credential});await e.handleGoogleOneTapCallback(n,u.generateCallbackUrls(window.location.href),c)}catch(e){console.error(e)}}let h=n.displayConfig.googleOneTapClientId,f=!(null==t?void 0:t.id)&&!!h;async function _(){let e=await (0,s.g)();return e.accounts.id.initialize({client_id:h,callback:p,itp_support:u.itpSupport,cancel_on_tap_outside:u.cancelOnTapOutside,auto_select:!1,use_fedcm_for_prompt:u.fedCmSupport}),e}let{data:g}=(0,d.ib)(f?_:void 0,"google-identity-services-script");return(0,i.useEffect)(()=>{!g||(null==t?void 0:t.id)||o.current||(g.accounts.id.prompt(t=>{"skipped"===t.getMomentType()&&e.closeGoogleOneTap()}),o.current=!0)},[e,g,null==t?void 0:t.id]),(0,i.useEffect)(()=>()=>{g&&o.current&&(o.current=!1,g.accounts.id.cancel())},[g]),null});function h(){return(0,o.tZ)(l.Route,{path:"one-tap",children:(0,o.tZ)(c.Flow.Root,{flow:"oneTap",children:(0,o.tZ)(l.Switch,{children:(0,o.tZ)(l.Route,{index:!0,children:(0,o.tZ)(p,{})})})})})}h.displayName="OneTap";let f=(0,a.withCoreSessionSwitchGuard)(h)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["7150"],{60815:function(e,t,l){l.r(t),l.d(t,{OrganizationAPIKeysPage:()=>h});var o=l(73312),a=l(61869),i=l(11576),n=l(64204),r=l(92654),c=l(15579),s=l(84808);let h=()=>{let{organization:e}=(0,a.o8)(),{contentRef:t}=(0,c.jh)(),{apiKeysProps:l}=(0,i.useOrganizationProfileContext)();return e?(0,o.BX)(n.Col,{gap:4,children:[(0,o.tZ)(r.h.Root,{children:(0,o.tZ)(r.h.Title,{localizationKey:(0,n.localizationKeys)("organizationProfile.apiKeysPage.title"),textVariant:"h2"})}),(0,o.tZ)(i.APIKeysContext.Provider,{value:{...l,componentName:"APIKeys"},children:(0,o.tZ)(s.APIKeysPage,{subject:e.id,revokeModalRoot:t})})]}):null}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["7150"],{60815:function(e,t,l){l.r(t),l.d(t,{OrganizationAPIKeysPage:()=>h});var o=l(73312),a=l(61869),i=l(11576),n=l(64204),r=l(92654),c=l(15579),s=l(84808);let h=()=>{let{organization:e}=(0,a.o8)(),{contentRef:t}=(0,c.jh)(),{apiKeysProps:l}=(0,i.useOrganizationProfileContext)();return e?(0,o.BX)(n.Col,{gap:4,children:[(0,o.tZ)(r.h.Root,{children:(0,o.tZ)(r.h.Title,{localizationKey:(0,n.localizationKeys)("organizationProfile.apiKeysPage.title"),textVariant:"h2"})}),(0,o.tZ)(i.APIKeysContext.Provider,{value:{...l,componentName:"APIKeys"},children:(0,o.tZ)(s.APIKeysPage,{subject:e.id,revokeModalRoot:t})})]}):null}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["6916"],{14961:function(i,e,t){t.r(e),t.d(e,{OrganizationBillingPage:()=>_});var l=t(73312),a=t(92418),n=t(2672),o=t(92654),r=t(36148),s=t(96231),c=t(11576),g=t(64204),b=t(93746),d=t(12264),p=t(11061),h=t(15515),P=t(91800);let u={0:"subscriptions",1:"statements",2:"payments"},z=(0,n.withCardStateProvider)(()=>{let i=(0,n.useCardState)(),{selectedTab:e,handleTabChange:t}=(0,b.x)(u);return(0,l.tZ)(g.Col,{elementDescriptor:g.descriptors.page,sx:i=>({gap:i.space.$8,color:i.colors.$colorForeground}),children:(0,l.BX)(g.Col,{elementDescriptor:g.descriptors.profilePage,elementId:g.descriptors.profilePage.setId("billing"),gap:4,children:[(0,l.tZ)(o.h.Root,{children:(0,l.tZ)(o.h.Title,{localizationKey:(0,g.localizationKeys)("organizationProfile.billingPage.title"),textVariant:"h2"})}),(0,l.tZ)(a.Z.Alert,{children:i.error}),(0,l.BX)(r.mQ,{value:e,onChange:t,children:[(0,l.BX)(r.dr,{sx:i=>({gap:i.space.$6}),children:[(0,l.tZ)(r.OK,{localizationKey:(0,g.localizationKeys)("organizationProfile.billingPage.start.headerTitle__subscriptions")}),(0,l.tZ)(r.OK,{localizationKey:(0,g.localizationKeys)("organizationProfile.billingPage.start.headerTitle__statements")}),(0,l.tZ)(r.OK,{localizationKey:(0,g.localizationKeys)("organizationProfile.billingPage.start.headerTitle__payments")})]}),(0,l.BX)(r.nP,{children:[(0,l.BX)(r.x4,{sx:{width:"100%",flexDirection:"column"},children:[(0,l.tZ)(P.b,{title:(0,g.localizationKeys)("organizationProfile.billingPage.subscriptionsListSection.title"),switchPlansLabel:(0,g.localizationKeys)("organizationProfile.billingPage.subscriptionsListSection.actionLabel__switchPlan"),newSubscriptionLabel:(0,g.localizationKeys)("organizationProfile.billingPage.subscriptionsListSection.actionLabel__newSubscription"),manageSubscriptionLabel:(0,g.localizationKeys)("organizationProfile.billingPage.subscriptionsListSection.actionLabel__manageSubscription")}),(0,l.tZ)(s.Cv,{condition:i=>i({permission:"org:sys_billing:manage"}),children:(0,l.tZ)(p.A6,{})})]}),(0,l.tZ)(r.x4,{sx:{width:"100%"},children:(0,l.tZ)(h.StatementsList,{})}),(0,l.tZ)(r.x4,{sx:{width:"100%"},children:(0,l.tZ)(d.PaymentAttemptsList,{})})]})]})]})})}),_=()=>(0,l.tZ)(c.SubscriberTypeContext.Provider,{value:"organization",children:(0,l.tZ)(z,{})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["6916"],{14961:function(i,e,t){t.r(e),t.d(e,{OrganizationBillingPage:()=>_});var l=t(73312),a=t(92418),n=t(2672),o=t(92654),r=t(36148),s=t(96231),c=t(11576),g=t(64204),b=t(93746),d=t(12264),p=t(11061),h=t(15515),P=t(91800);let u={0:"subscriptions",1:"statements",2:"payments"},z=(0,n.withCardStateProvider)(()=>{let i=(0,n.useCardState)(),{selectedTab:e,handleTabChange:t}=(0,b.x)(u);return(0,l.tZ)(g.Col,{elementDescriptor:g.descriptors.page,sx:i=>({gap:i.space.$8,color:i.colors.$colorForeground}),children:(0,l.BX)(g.Col,{elementDescriptor:g.descriptors.profilePage,elementId:g.descriptors.profilePage.setId("billing"),gap:4,children:[(0,l.tZ)(o.h.Root,{children:(0,l.tZ)(o.h.Title,{localizationKey:(0,g.localizationKeys)("organizationProfile.billingPage.title"),textVariant:"h2"})}),(0,l.tZ)(a.Z.Alert,{children:i.error}),(0,l.BX)(r.mQ,{value:e,onChange:t,children:[(0,l.BX)(r.dr,{sx:i=>({gap:i.space.$6}),children:[(0,l.tZ)(r.OK,{localizationKey:(0,g.localizationKeys)("organizationProfile.billingPage.start.headerTitle__subscriptions")}),(0,l.tZ)(r.OK,{localizationKey:(0,g.localizationKeys)("organizationProfile.billingPage.start.headerTitle__statements")}),(0,l.tZ)(r.OK,{localizationKey:(0,g.localizationKeys)("organizationProfile.billingPage.start.headerTitle__payments")})]}),(0,l.BX)(r.nP,{children:[(0,l.BX)(r.x4,{sx:{width:"100%",flexDirection:"column"},children:[(0,l.tZ)(P.b,{title:(0,g.localizationKeys)("organizationProfile.billingPage.subscriptionsListSection.title"),switchPlansLabel:(0,g.localizationKeys)("organizationProfile.billingPage.subscriptionsListSection.actionLabel__switchPlan"),newSubscriptionLabel:(0,g.localizationKeys)("organizationProfile.billingPage.subscriptionsListSection.actionLabel__newSubscription"),manageSubscriptionLabel:(0,g.localizationKeys)("organizationProfile.billingPage.subscriptionsListSection.actionLabel__manageSubscription")}),(0,l.tZ)(s.Cv,{condition:i=>i({permission:"org:sys_billing:manage"}),children:(0,l.tZ)(p.A6,{})})]}),(0,l.tZ)(r.x4,{sx:{width:"100%"},children:(0,l.tZ)(h.StatementsList,{})}),(0,l.tZ)(r.x4,{sx:{width:"100%"},children:(0,l.tZ)(d.PaymentAttemptsList,{})})]})]})]})})}),_=()=>(0,l.tZ)(c.SubscriberTypeContext.Provider,{value:"organization",children:(0,l.tZ)(z,{})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["6511"],{88758:function(e,o,r){r.r(o),r.d(o,{OrganizationPlansPage:()=>g});var i=r(73312),n=r(9117),a=r(92654),t=r(96231),l=r(11576),c=r(64204),s=r(17703),d=r(24676),h=r(24718);let b=()=>{let{navigate:e}=(0,d.useRouter)();return(0,i.BX)(i.HY,{children:[(0,i.tZ)(a.h.Root,{sx:e=>({borderBottomWidth:e.borderWidths.$normal,borderBottomStyle:e.borderStyles.$solid,borderBottomColor:e.colors.$borderAlpha100,marginBlockEnd:e.space.$4,paddingBlockEnd:e.space.$4}),children:(0,i.tZ)(a.h.BackLink,{onClick:()=>void e("../",{searchParams:new URLSearchParams("tab=subscriptions")}),children:(0,i.tZ)(a.h.Title,{localizationKey:(0,s.u1)("organizationProfile.plansPage.title"),textVariant:"h2"})})}),(0,i.BX)(c.Flex,{direction:"col",gap:4,children:[(0,i.tZ)(t.Cv,{condition:e=>!e({permission:"org:sys_billing:manage"}),children:(0,i.tZ)(n.b,{variant:"info",colorScheme:"info",title:(0,s.u1)("organizationProfile.plansPage.alerts.noPermissionsToManageBilling")})}),(0,i.tZ)(l.PricingTableContext.Provider,{value:{componentName:"PricingTable",mode:"modal"},children:(0,i.tZ)(h.b,{})})]})]})},g=()=>(0,i.tZ)(l.SubscriberTypeContext.Provider,{value:"organization",children:(0,i.tZ)(b,{})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["6511"],{88758:function(e,o,r){r.r(o),r.d(o,{OrganizationPlansPage:()=>g}),r(45261),r(70957),r(24551),r(22349),r(65223);var i=r(73312),n=r(9117),a=r(92654),t=r(96231),l=r(11576),c=r(64204),s=r(17703),d=r(24676),h=r(24718);let b=()=>{let{navigate:e}=(0,d.useRouter)();return(0,i.BX)(i.HY,{children:[(0,i.tZ)(a.h.Root,{sx:e=>({borderBottomWidth:e.borderWidths.$normal,borderBottomStyle:e.borderStyles.$solid,borderBottomColor:e.colors.$borderAlpha100,marginBlockEnd:e.space.$4,paddingBlockEnd:e.space.$4}),children:(0,i.tZ)(a.h.BackLink,{onClick:()=>void e("../",{searchParams:new URLSearchParams("tab=subscriptions")}),children:(0,i.tZ)(a.h.Title,{localizationKey:(0,s.u1)("organizationProfile.plansPage.title"),textVariant:"h2"})})}),(0,i.BX)(c.Flex,{direction:"col",gap:4,children:[(0,i.tZ)(t.Cv,{condition:e=>!e({permission:"org:sys_billing:manage"}),children:(0,i.tZ)(n.b,{variant:"info",colorScheme:"info",title:(0,s.u1)("organizationProfile.plansPage.alerts.noPermissionsToManageBilling")})}),(0,i.tZ)(l.PricingTableContext.Provider,{value:{componentName:"PricingTable",mode:"modal"},children:(0,i.tZ)(h.b,{})})]})]})},g=()=>(0,i.tZ)(l.SubscriberTypeContext.Provider,{value:"organization",children:(0,i.tZ)(b,{})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["3158"],{91816:function(e,t,i){i.d(t,{$:()=>_});var a=i(73312),n=i(61869),r=i(69144),o=i(11576),l=i(2672),s=i(70431),c=i(19460),d=i(68487),u=i(92654),g=i(53412),h=i(67263),p=i(7259),z=i(88870),m=i(36788),Z=i(96231),b=i(64204),C=i(34174),S=i(17703),$=i(88493),v=i(45727),x=i(8181),f=i(57484);let _=(0,l.withCardStateProvider)(e=>{let t=(0,l.useCardState)(),i=(0,Z.a2)({onNextStep:()=>t.setError(void 0)}),_=r.useRef(null),{createOrganization:L,isLoaded:w,setActive:y,userMemberships:P}=(0,n.eW)({userMemberships:f.AO.userMemberships}),{organization:k}=(0,n.o8)(),{organizationSettings:A}=(0,o.useEnvironment)(),[O,B]=r.useState(),D=(0,m.Yp)("name","",{type:"text",label:(0,S.u1)("formFieldLabel__organizationName"),placeholder:(0,S.u1)("formFieldInputPlaceholder__organizationName")}),I=(0,m.Yp)("slug","",{type:"text",label:(0,S.u1)("formFieldLabel__organizationSlug"),placeholder:(0,S.u1)("formFieldInputPlaceholder__organizationSlug")}),T=!!D.value,K=!A.slug.disabled&&!e.hideSlug,R=async a=>{if((a.preventDefault(),T)&&w)try{let t={name:D.value};K&&(t.slug=I.value);let a=await L(t);if(O&&await a.setLogo({file:O}),_.current=a,await y({organization:a}),P.revalidate?.(),e.skipInvitationScreen??1===a.maxAllowedMemberships)return F();i.nextStep()}catch(e){(0,z.S3)(e,[D,I],t.setError)}},F=()=>{e.navigateAfterCreateOrganization?.(_.current),e.onComplete?.()},E=e=>{I.setValue(e)},X="organizationList"===e.flow?"subtitle":void 0;return(0,a.BX)(Z.en,{...i.props,children:[(0,a.tZ)(d.Y,{headerTitle:e?.startPage?.headerTitle,headerSubtitle:e?.startPage?.headerSubtitle,headerTitleTextVariant:"h2",headerSubtitleTextVariant:X,sx:e=>({minHeight:e.sizes.$60,gap:e.space.$6,textAlign:"left"}),children:(0,a.BX)(s.l.Root,{onSubmit:R,sx:e=>({gap:e.space.$6}),children:[(0,a.tZ)(b.Col,{children:(0,a.tZ)(x.D,{organization:{name:D.value},onAvatarChange:async e=>await B(e),onAvatarRemove:O?()=>(t.setIdle(),B(null)):null,avatarPreviewPlaceholder:(0,a.tZ)(g.h,{variant:"ghost","aria-label":"Upload organization logo",icon:(0,a.tZ)(b.Icon,{size:"md",icon:C.gq,sx:e=>({color:e.colors.$colorMutedForeground,transitionDuration:e.transitionDuration.$controls})}),sx:e=>({width:e.sizes.$16,height:e.sizes.$16,borderRadius:e.radii.$md,borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$dashed,borderColor:e.colors.$borderAlpha200,backgroundColor:e.colors.$neutralAlpha50,":hover":{backgroundColor:e.colors.$neutralAlpha50,svg:{transform:"scale(1.2)"}}})})})}),(0,a.tZ)(s.l.ControlRow,{elementId:D.id,children:(0,a.tZ)(s.l.PlainInput,{...D.props,onChange:e=>{D.setValue(e.target.value),E((0,p.q)(e.target.value))},isRequired:!0,autoFocus:!0,ignorePasswordManager:!0})}),K&&(0,a.tZ)(s.l.ControlRow,{elementId:I.id,children:(0,a.tZ)(s.l.PlainInput,{...I.props,onChange:e=>{E(e.target.value)},isRequired:!0,pattern:"^(?=.*[a-z0-9])[a-z0-9\\-]+$",ignorePasswordManager:!0})}),(0,a.BX)(c.K,{sx:e=>({marginTop:e.space.$none}),children:[(0,a.tZ)(s.l.SubmitButton,{block:!1,isDisabled:!T,localizationKey:(0,S.u1)("createOrganization.formButtonSubmit")}),e.onCancel&&(0,a.tZ)(s.l.ResetButton,{localizationKey:(0,S.u1)("userProfile.formButtonReset"),block:!1,onClick:e.onCancel})]})]})}),(0,a.tZ)(d.Y,{headerTitle:(0,S.u1)("organizationProfile.invitePage.title"),headerTitleTextVariant:"h2",headerSubtitleTextVariant:X,sx:e=>({minHeight:e.sizes.$60,textAlign:"left"}),children:k&&(0,a.tZ)($.l,{resetButtonLabel:(0,S.u1)("createOrganization.invitePage.formButtonReset"),onSuccess:i.nextStep,onReset:F})}),(0,a.BX)(b.Col,{children:[(0,a.tZ)(u.h.Root,{children:(0,a.tZ)(u.h.Title,{localizationKey:(0,S.u1)("organizationProfile.invitePage.title"),sx:{textAlign:"left"}})}),(0,a.tZ)(h.I,{contents:(0,a.tZ)(v.a,{}),sx:e=>({minHeight:e.sizes.$60}),onFinish:F})]})]})})},30683:function(e,t,i){i.r(t),i.d(t,{OrganizationList:()=>E});var a=i(73312),n=i(11576),r=i(64204),o=i(24676),l=i(61869),s=i(69144),c=i(20237),d=i(42305),u=i(92418),g=i(2672),h=i(92654),p=i(76028),z=i(34174),m=i(91816);let Z=e=>(0,a.tZ)(c.o2,{elementDescriptor:r.descriptors.organizationListPreviewItems,...e}),b=e=>(0,a.tZ)(c.ij,{elementId:"organizationList",elementDescriptor:r.descriptors.organizationListPreviewItem,...e}),C=e=>(0,a.tZ)(c.De,{elementDescriptor:r.descriptors.organizationListPreviewItemActionButton,...e}),S=e=>(0,a.tZ)(c.Td,{elementDescriptor:r.descriptors.organizationListPreviewButton,...e});var $=i(88870),v=i(57484),x=i(41024),f=i(35973),_=i(62915);let L=e=>{let{user:t}=(0,l.aF)(),i=(0,g.useCardState)(),{navigateAfterSelectOrganization:o}=(0,n.useOrganizationListContext)(),{t:s}=(0,r.useLocalizations)(),{isLoaded:d,setActive:u}=(0,l.eW)();return d?(0,a.tZ)(S,{onClick:()=>{let a;return a=e.organization,i.runAsync(async()=>{try{await u({organization:a}),await o(a)}catch(e){if(!(0,x.kD)(e))return void(0,$.S3)(e,[],i.setError);switch(e.errors?.[0]?.code){case"organization_not_found_or_unauthorized":case"not_a_member_in_organization":t?.createOrganizationEnabled?i.setError(s((0,r.localizationKeys)("unstable__errors.organization_not_found_or_unauthorized"))):i.setError(s((0,r.localizationKeys)("unstable__errors.organization_not_found_or_unauthorized_with_create_organization_disabled")));break;default:(0,$.S3)(e,[],i.setError)}}})},children:(0,a.tZ)(f.Z,{elementId:"organizationList",mainIdentifierSx:c.fq,organization:e.organization})}):null},w=(0,g.withCardStateProvider)(()=>{let e=(0,g.useCardState)(),{hidePersonal:t,navigateAfterSelectPersonal:i}=(0,n.useOrganizationListContext)(),{isLoaded:o,setActive:s}=(0,l.eW)(),{user:d}=(0,l.aF)();if(!d)return null;let{username:u,primaryEmailAddress:h,primaryPhoneNumber:p,...z}=d;return t?null:(0,a.tZ)(S,{onClick:()=>{if(o)return e.runAsync(async()=>{await s({organization:null}),await i(d)})},children:(0,a.tZ)(_.g,{user:z,mainIdentifierSx:c.fq,title:(0,r.localizationKeys)("organizationSwitcher.personalWorkspace")})})}),y={infinite:!0},P={infinite:!0},k={infinite:!0,status:["pending","accepted"]},A=e=>{let t=(0,g.useCardState)();return(0,a.tZ)(C,{isLoading:t.isLoading,onClick:e.onAccept,localizationKey:(0,r.localizationKeys)("organizationList.action__invitationAccept")})},O=(0,g.withCardStateProvider)(e=>{let t=(0,g.useCardState)(),{getOrganization:i}=(0,l.cL)(),[n,r]=(0,s.useState)(null),{userInvitations:o}=(0,l.eW)({userInvitations:P,userMemberships:y});return n?(0,a.tZ)(L,{organization:n}):(0,a.tZ)(b,{organizationData:e.publicOrganizationData,children:(0,a.tZ)(A,{onAccept:()=>t.runAsync(async()=>[await e.accept(),await i(e.publicOrganizationData.id)]).then(([e,t])=>{o?.setData?.(t=>(0,v.Sz)(e,t,"negative")),r(t)}).catch(e=>(0,$.S3)(e,[],t.setError))})})}),B=e=>{let t=(0,g.useCardState)(),{userSuggestions:i}=(0,l.eW)({userSuggestions:k});return"accepted"===e.status?(0,a.tZ)(r.Text,{colorScheme:"secondary",localizationKey:(0,r.localizationKeys)("organizationList.suggestionsAcceptedLabel")}):(0,a.tZ)(C,{isLoading:t.isLoading,onClick:()=>t.runAsync(e.accept).then(e=>i?.setData?.(t=>(0,v.Sz)(e,t))).catch(e=>(0,$.S3)(e,[],t.setError)),localizationKey:(0,r.localizationKeys)("organizationList.action__suggestionsAccept")})},D=(0,g.withCardStateProvider)(e=>(0,a.tZ)(b,{organizationData:e.publicOrganizationData,children:(0,a.tZ)(B,{...e})})),I=({onCreateOrganizationClick:e})=>{let{user:t}=(0,l.aF)();return t?.createOrganizationEnabled?(0,a.tZ)(d.aU,{elementDescriptor:r.descriptors.organizationListCreateOrganizationActionButton,icon:z.mm,label:(0,r.localizationKeys)("organizationList.action__createOrganization"),onClick:e,sx:e=>({borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100,padding:`${e.space.$5} ${e.space.$5}`}),iconSx:e=>({width:e.sizes.$9,height:e.sizes.$6})}):null},T=(0,g.withCardStateProvider)(()=>{let{userMemberships:e,userSuggestions:t,userInvitations:i}=(0,p.H)(),o=e?.isLoading||i?.isLoading||t?.isLoading,l=!!(e?.count||i?.count||t?.count),{hidePersonal:s}=(0,n.useOrganizationListContext)();return(0,a.BX)(u.Z.Root,{children:[(0,a.BX)(u.Z.Content,{sx:e=>({padding:`${e.space.$8} ${e.space.$none} ${e.space.$none}`}),children:[o&&(0,a.tZ)(r.Flex,{direction:"row",align:"center",justify:"center",sx:e=>({height:"100%",minHeight:e.sizes.$60}),children:(0,a.tZ)(r.Spinner,{size:"lg",colorScheme:"primary",elementDescriptor:r.descriptors.spinner})}),!o&&(0,a.tZ)(K,{showListInitially:!(s&&!l)})]}),(0,a.tZ)(u.Z.Footer,{})]})}),K=({showListInitially:e})=>{let t=(0,g.useCardState)(),{navigateAfterCreateOrganization:i,skipInvitationScreen:o,hideSlug:l}=(0,n.useOrganizationListContext)(),[c,d]=(0,s.useState)(!e);return(0,a.BX)(a.HY,{children:[!c&&(0,a.tZ)(R,{onCreateOrganizationClick:()=>d(!0)}),c&&(0,a.BX)(a.HY,{children:[(0,a.tZ)(u.Z.Alert,{sx:e=>({margin:`${e.space.$none} ${e.space.$5}`}),children:t.error}),(0,a.tZ)(r.Box,{sx:e=>({padding:`${e.space.$none} ${e.space.$5} ${e.space.$5}`}),children:(0,a.tZ)(m.$,{flow:"organizationList",startPage:{headerTitle:(0,r.localizationKeys)("organizationList.createOrganization")},skipInvitationScreen:o,navigateAfterCreateOrganization:e=>i(e).then(()=>d(!1)),onCancel:e&&c?()=>d(!1):void 0,hideSlug:l})})]})]})},R=e=>{let t=(0,g.useCardState)(),i=(0,n.useEnvironment)(),{ref:o,userMemberships:l,userSuggestions:s,userInvitations:z}=(0,p.H)(),{hidePersonal:m}=(0,n.useOrganizationListContext)(),b=l?.isLoading||z?.isLoading||s?.isLoading,C=l?.hasNextPage||z?.hasNextPage||s?.hasNextPage,S=z.data?.filter(e=>!!e),$=s.data?.filter(e=>!!e);return(0,a.BX)(a.HY,{children:[(0,a.BX)(h.h.Root,{sx:e=>({padding:`${e.space.$none} ${e.space.$8}`}),children:[(0,a.tZ)(h.h.Title,{localizationKey:(0,r.localizationKeys)(m?"organizationList.titleWithoutPersonal":"organizationList.title")}),(0,a.tZ)(h.h.Subtitle,{localizationKey:(0,r.localizationKeys)("organizationList.subtitle",{applicationName:i.displayConfig.applicationName})})]}),(0,a.tZ)(u.Z.Alert,{sx:e=>({margin:`${e.space.$none} ${e.space.$5}`}),children:t.error}),(0,a.tZ)(r.Col,{elementDescriptor:r.descriptors.main,children:(0,a.tZ)(Z,{children:(0,a.BX)(d.eX,{role:"menu",children:[(0,a.tZ)(w,{}),(l.count||0)>0&&l.data?.map(e=>(0,a.tZ)(L,{...e},e.id)),!l.hasNextPage&&S?.map(e=>(0,a.tZ)(O,{...e},e.id)),!l.hasNextPage&&!z.hasNextPage&&$?.map(e=>(0,a.tZ)(D,{...e},e.id)),(C||b)&&(0,a.tZ)(c.pr,{ref:o}),(0,a.tZ)(I,{onCreateOrganizationClick:()=>{t.setError(void 0),e.onCreateOrganizationClick()}})]})})})]})},F=(0,n.withCoreUserGuard)(T),E=()=>(0,a.tZ)(r.Flow.Root,{flow:"organizationList",children:(0,a.tZ)(r.Flow.Part,{children:(0,a.tZ)(o.Switch,{children:(0,a.tZ)(o.Route,{children:(0,a.tZ)(F,{})})})})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["3158"],{91816:function(t,e,i){i.d(e,{$:()=>L}),i(65223);var a=i(73312),n=i(61869),o=i(69144),r=i(11576),l=i(2672),s=i(70431),c=i(19460),d=i(68487),u=i(92654),g=i(53412),h=i(67263),p=i(7259),z=i(88870),v=i(36788),m=i(96231),Z=i(64204),b=i(96519),C=i(17703),S=i(88493),x=i(45727),f=i(8181),_=i(57484);let L=(0,l.withCardStateProvider)(t=>{var e,i;let L=(0,l.useCardState)(),w=(0,m.a2)({onNextStep:()=>L.setError(void 0)}),y=o.useRef(null),{createOrganization:$,isLoaded:P,setActive:k,userMemberships:A}=(0,n.eW)({userMemberships:_.AO.userMemberships}),{organization:O}=(0,n.o8)(),{organizationSettings:B}=(0,r.useEnvironment)(),[D,I]=o.useState(),T=(0,v.Yp)("name","",{type:"text",label:(0,C.u1)("formFieldLabel__organizationName"),placeholder:(0,C.u1)("formFieldInputPlaceholder__organizationName")}),K=(0,v.Yp)("slug","",{type:"text",label:(0,C.u1)("formFieldLabel__organizationSlug"),placeholder:(0,C.u1)("formFieldInputPlaceholder__organizationSlug")}),R=!!T.value,F=!B.slug.disabled&&!t.hideSlug,E=async e=>{if((e.preventDefault(),R)&&P)try{var i,a;let e={name:T.value};F&&(e.slug=K.value);let n=await $(e);if(D&&await n.setLogo({file:D}),y.current=n,await k({organization:n}),null==(i=A.revalidate)||i.call(A),null!=(a=t.skipInvitationScreen)?a:1===n.maxAllowedMemberships)return X();w.nextStep()}catch(t){(0,z.S3)(t,[T,K],L.setError)}},X=()=>{var e,i;null==(e=t.navigateAfterCreateOrganization)||e.call(t,y.current),null==(i=t.onComplete)||i.call(t)},N=t=>{K.setValue(t)},W="organizationList"===t.flow?"subtitle":void 0;return(0,a.BX)(m.en,{...w.props,children:[(0,a.tZ)(d.Y,{headerTitle:null==t||null==(e=t.startPage)?void 0:e.headerTitle,headerSubtitle:null==t||null==(i=t.startPage)?void 0:i.headerSubtitle,headerTitleTextVariant:"h2",headerSubtitleTextVariant:W,sx:t=>({minHeight:t.sizes.$60,gap:t.space.$6,textAlign:"left"}),children:(0,a.BX)(s.l.Root,{onSubmit:E,sx:t=>({gap:t.space.$6}),children:[(0,a.tZ)(Z.Col,{children:(0,a.tZ)(f.D,{organization:{name:T.value},onAvatarChange:async t=>await I(t),onAvatarRemove:D?()=>(L.setIdle(),I(null)):null,avatarPreviewPlaceholder:(0,a.tZ)(g.h,{variant:"ghost","aria-label":"Upload organization logo",icon:(0,a.tZ)(Z.Icon,{size:"md",icon:b.gq,sx:t=>({color:t.colors.$colorMutedForeground,transitionDuration:t.transitionDuration.$controls})}),sx:t=>({width:t.sizes.$16,height:t.sizes.$16,borderRadius:t.radii.$md,borderWidth:t.borderWidths.$normal,borderStyle:t.borderStyles.$dashed,borderColor:t.colors.$borderAlpha200,backgroundColor:t.colors.$neutralAlpha50,":hover":{backgroundColor:t.colors.$neutralAlpha50,svg:{transform:"scale(1.2)"}}})})})}),(0,a.tZ)(s.l.ControlRow,{elementId:T.id,children:(0,a.tZ)(s.l.PlainInput,{...T.props,onChange:t=>{T.setValue(t.target.value),N((0,p.q)(t.target.value))},isRequired:!0,autoFocus:!0,ignorePasswordManager:!0})}),F&&(0,a.tZ)(s.l.ControlRow,{elementId:K.id,children:(0,a.tZ)(s.l.PlainInput,{...K.props,onChange:t=>{N(t.target.value)},isRequired:!0,pattern:"^(?=.*[a-z0-9])[a-z0-9\\-]+$",ignorePasswordManager:!0})}),(0,a.BX)(c.K,{sx:t=>({marginTop:t.space.$none}),children:[(0,a.tZ)(s.l.SubmitButton,{block:!1,isDisabled:!R,localizationKey:(0,C.u1)("createOrganization.formButtonSubmit")}),t.onCancel&&(0,a.tZ)(s.l.ResetButton,{localizationKey:(0,C.u1)("userProfile.formButtonReset"),block:!1,onClick:t.onCancel})]})]})}),(0,a.tZ)(d.Y,{headerTitle:(0,C.u1)("organizationProfile.invitePage.title"),headerTitleTextVariant:"h2",headerSubtitleTextVariant:W,sx:t=>({minHeight:t.sizes.$60,textAlign:"left"}),children:O&&(0,a.tZ)(S.l,{resetButtonLabel:(0,C.u1)("createOrganization.invitePage.formButtonReset"),onSuccess:w.nextStep,onReset:X})}),(0,a.BX)(Z.Col,{children:[(0,a.tZ)(u.h.Root,{children:(0,a.tZ)(u.h.Title,{localizationKey:(0,C.u1)("organizationProfile.invitePage.title"),sx:{textAlign:"left"}})}),(0,a.tZ)(h.I,{contents:(0,a.tZ)(x.a,{}),sx:t=>({minHeight:t.sizes.$60}),onFinish:X})]})]})})},30683:function(t,e,i){i.r(e),i.d(e,{OrganizationList:()=>E});var a=i(73312),n=i(11576),o=i(64204),r=i(24676);i(65223);var l=i(61869),s=i(69144),c=i(20237),d=i(42305),u=i(92418),g=i(2672),h=i(92654),p=i(76028),z=i(96519),v=i(91816);let m=t=>(0,a.tZ)(c.o2,{elementDescriptor:o.descriptors.organizationListPreviewItems,...t}),Z=t=>(0,a.tZ)(c.ij,{elementId:"organizationList",elementDescriptor:o.descriptors.organizationListPreviewItem,...t}),b=t=>(0,a.tZ)(c.De,{elementDescriptor:o.descriptors.organizationListPreviewItemActionButton,...t}),C=t=>(0,a.tZ)(c.Td,{elementDescriptor:o.descriptors.organizationListPreviewButton,...t});var S=i(88870),x=i(57484),f=i(41024),_=i(35973),L=i(62915);let w=t=>{let{user:e}=(0,l.aF)(),i=(0,g.useCardState)(),{navigateAfterSelectOrganization:r}=(0,n.useOrganizationListContext)(),{t:s}=(0,o.useLocalizations)(),{isLoaded:d,setActive:u}=(0,l.eW)();return d?(0,a.tZ)(C,{onClick:()=>{let a;return a=t.organization,i.runAsync(async()=>{try{await u({organization:a}),await r(a)}catch(a){var t,n;if(!(0,f.kD)(a))return void(0,S.S3)(a,[],i.setError);switch(null==(n=a.errors)||null==(t=n[0])?void 0:t.code){case"organization_not_found_or_unauthorized":case"not_a_member_in_organization":(null==e?void 0:e.createOrganizationEnabled)?i.setError(s((0,o.localizationKeys)("unstable__errors.organization_not_found_or_unauthorized"))):i.setError(s((0,o.localizationKeys)("unstable__errors.organization_not_found_or_unauthorized_with_create_organization_disabled")));break;default:(0,S.S3)(a,[],i.setError)}}})},children:(0,a.tZ)(_.Z,{elementId:"organizationList",mainIdentifierSx:c.fq,organization:t.organization})}):null},y=(0,g.withCardStateProvider)(()=>{let t=(0,g.useCardState)(),{hidePersonal:e,navigateAfterSelectPersonal:i}=(0,n.useOrganizationListContext)(),{isLoaded:r,setActive:s}=(0,l.eW)(),{user:d}=(0,l.aF)();if(!d)return null;let{username:u,primaryEmailAddress:h,primaryPhoneNumber:p,...z}=d;return e?null:(0,a.tZ)(C,{onClick:()=>{if(r)return t.runAsync(async()=>{await s({organization:null}),await i(d)})},children:(0,a.tZ)(L.g,{user:z,mainIdentifierSx:c.fq,title:(0,o.localizationKeys)("organizationSwitcher.personalWorkspace")})})}),$={infinite:!0},P={infinite:!0},k={infinite:!0,status:["pending","accepted"]},A=t=>{let e=(0,g.useCardState)();return(0,a.tZ)(b,{isLoading:e.isLoading,onClick:t.onAccept,localizationKey:(0,o.localizationKeys)("organizationList.action__invitationAccept")})},O=(0,g.withCardStateProvider)(t=>{let e=(0,g.useCardState)(),{getOrganization:i}=(0,l.cL)(),[n,o]=(0,s.useState)(null),{userInvitations:r}=(0,l.eW)({userInvitations:P,userMemberships:$});return n?(0,a.tZ)(w,{organization:n}):(0,a.tZ)(Z,{organizationData:t.publicOrganizationData,children:(0,a.tZ)(A,{onAccept:()=>e.runAsync(async()=>[await t.accept(),await i(t.publicOrganizationData.id)]).then(t=>{var e;let[i,a]=t;null==r||null==(e=r.setData)||e.call(r,t=>(0,x.Sz)(i,t,"negative")),o(a)}).catch(t=>(0,S.S3)(t,[],e.setError))})})}),B=t=>{let e=(0,g.useCardState)(),{userSuggestions:i}=(0,l.eW)({userSuggestions:k});return"accepted"===t.status?(0,a.tZ)(o.Text,{colorScheme:"secondary",localizationKey:(0,o.localizationKeys)("organizationList.suggestionsAcceptedLabel")}):(0,a.tZ)(b,{isLoading:e.isLoading,onClick:()=>e.runAsync(t.accept).then(t=>{var e;return null==i||null==(e=i.setData)?void 0:e.call(i,e=>(0,x.Sz)(t,e))}).catch(t=>(0,S.S3)(t,[],e.setError)),localizationKey:(0,o.localizationKeys)("organizationList.action__suggestionsAccept")})},D=(0,g.withCardStateProvider)(t=>(0,a.tZ)(Z,{organizationData:t.publicOrganizationData,children:(0,a.tZ)(B,{...t})})),I=t=>{let{onCreateOrganizationClick:e}=t,{user:i}=(0,l.aF)();return(null==i?void 0:i.createOrganizationEnabled)?(0,a.tZ)(d.aU,{elementDescriptor:o.descriptors.organizationListCreateOrganizationActionButton,icon:z.mm,label:(0,o.localizationKeys)("organizationList.action__createOrganization"),onClick:e,sx:t=>({borderTopWidth:t.borderWidths.$normal,borderTopStyle:t.borderStyles.$solid,borderTopColor:t.colors.$borderAlpha100,padding:"".concat(t.space.$5," ").concat(t.space.$5)}),iconSx:t=>({width:t.sizes.$9,height:t.sizes.$6})}):null},T=(0,g.withCardStateProvider)(()=>{let{userMemberships:t,userSuggestions:e,userInvitations:i}=(0,p.H)(),r=(null==t?void 0:t.isLoading)||(null==i?void 0:i.isLoading)||(null==e?void 0:e.isLoading),l=!!((null==t?void 0:t.count)||(null==i?void 0:i.count)||(null==e?void 0:e.count)),{hidePersonal:s}=(0,n.useOrganizationListContext)();return(0,a.BX)(u.Z.Root,{children:[(0,a.BX)(u.Z.Content,{sx:t=>({padding:"".concat(t.space.$8," ").concat(t.space.$none," ").concat(t.space.$none)}),children:[r&&(0,a.tZ)(o.Flex,{direction:"row",align:"center",justify:"center",sx:t=>({height:"100%",minHeight:t.sizes.$60}),children:(0,a.tZ)(o.Spinner,{size:"lg",colorScheme:"primary",elementDescriptor:o.descriptors.spinner})}),!r&&(0,a.tZ)(K,{showListInitially:!(s&&!l)})]}),(0,a.tZ)(u.Z.Footer,{})]})}),K=t=>{let{showListInitially:e}=t,i=(0,g.useCardState)(),{navigateAfterCreateOrganization:r,skipInvitationScreen:l,hideSlug:c}=(0,n.useOrganizationListContext)(),[d,h]=(0,s.useState)(!e);return(0,a.BX)(a.HY,{children:[!d&&(0,a.tZ)(R,{onCreateOrganizationClick:()=>h(!0)}),d&&(0,a.BX)(a.HY,{children:[(0,a.tZ)(u.Z.Alert,{sx:t=>({margin:"".concat(t.space.$none," ").concat(t.space.$5)}),children:i.error}),(0,a.tZ)(o.Box,{sx:t=>({padding:"".concat(t.space.$none," ").concat(t.space.$5," ").concat(t.space.$5)}),children:(0,a.tZ)(v.$,{flow:"organizationList",startPage:{headerTitle:(0,o.localizationKeys)("organizationList.createOrganization")},skipInvitationScreen:l,navigateAfterCreateOrganization:t=>r(t).then(()=>h(!1)),onCancel:e&&d?()=>h(!1):void 0,hideSlug:c})})]})]})},R=t=>{var e,i,r;let l=(0,g.useCardState)(),s=(0,n.useEnvironment)(),{ref:z,userMemberships:v,userSuggestions:Z,userInvitations:b}=(0,p.H)(),{hidePersonal:C}=(0,n.useOrganizationListContext)(),S=(null==v?void 0:v.isLoading)||(null==b?void 0:b.isLoading)||(null==Z?void 0:Z.isLoading),x=(null==v?void 0:v.hasNextPage)||(null==b?void 0:b.hasNextPage)||(null==Z?void 0:Z.hasNextPage),f=null==(e=b.data)?void 0:e.filter(t=>!!t),_=null==(i=Z.data)?void 0:i.filter(t=>!!t);return(0,a.BX)(a.HY,{children:[(0,a.BX)(h.h.Root,{sx:t=>({padding:"".concat(t.space.$none," ").concat(t.space.$8)}),children:[(0,a.tZ)(h.h.Title,{localizationKey:(0,o.localizationKeys)(C?"organizationList.titleWithoutPersonal":"organizationList.title")}),(0,a.tZ)(h.h.Subtitle,{localizationKey:(0,o.localizationKeys)("organizationList.subtitle",{applicationName:s.displayConfig.applicationName})})]}),(0,a.tZ)(u.Z.Alert,{sx:t=>({margin:"".concat(t.space.$none," ").concat(t.space.$5)}),children:l.error}),(0,a.tZ)(o.Col,{elementDescriptor:o.descriptors.main,children:(0,a.tZ)(m,{children:(0,a.BX)(d.eX,{role:"menu",children:[(0,a.tZ)(y,{}),(v.count||0)>0&&(null==(r=v.data)?void 0:r.map(t=>(0,a.tZ)(w,{...t},t.id))),!v.hasNextPage&&(null==f?void 0:f.map(t=>(0,a.tZ)(O,{...t},t.id))),!v.hasNextPage&&!b.hasNextPage&&(null==_?void 0:_.map(t=>(0,a.tZ)(D,{...t},t.id))),(x||S)&&(0,a.tZ)(c.pr,{ref:z}),(0,a.tZ)(I,{onCreateOrganizationClick:()=>{l.setError(void 0),t.onCreateOrganizationClick()}})]})})})]})},F=(0,n.withCoreUserGuard)(T),E=()=>(0,a.tZ)(o.Flow.Root,{flow:"organizationList",children:(0,a.tZ)(o.Flow.Part,{children:(0,a.tZ)(r.Switch,{children:(0,a.tZ)(r.Route,{children:(0,a.tZ)(F,{})})})})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["8554"],{51853:function(e,i,t){t.r(i),t.d(i,{OrganizationProfile:()=>eF,OrganizationProfileModal:()=>eq});var a=t(73312),n=t(61869),o=t(69144),r=t(2672),l=t(15579),s=t(23394),d=t(31673),c=t(11576),g=t(64204),m=t(24676),u=t(96231),p=t(17703);let h=e=>{let{organization:i}=(0,n.o8)(),{apiKeysProps:t,pages:o}=(0,c.useOrganizationProfileContext)(),r=(0,u.N2)(e=>e({permission:"org:sys_memberships:read"})||e({permission:"org:sys_memberships:manage"})),s=(0,u.N2)(e=>e({permission:"org:sys_billing:read"})||e({permission:"org:sys_billing:manage"})),g=o.routes.filter(e=>e.id!==d.bm.MEMBERS||e.id===d.bm.MEMBERS&&r).filter(e=>e.id!==d.bm.BILLING||e.id===d.bm.BILLING&&s).filter(e=>e.id!==d.bm.API_KEYS||!t?.hide);return i?(0,a.BX)(l.Uh,{contentRef:e.contentRef,children:[(0,a.tZ)(l.l2,{title:(0,p.u1)("organizationProfile.navbar.title"),description:(0,p.u1)("organizationProfile.navbar.description"),routes:g,contentRef:e.contentRef}),e.children]}):null};var f=t(94995),z=t(92654),b=t(35973),v=t(19655),P=t(99805),Z=t(44709),y=t(70431),S=t(19460),C=t(68487),_=t(67263),x=t(88870),K=t(36788),D=t(57484);let R=e=>{let i=(0,r.useCardState)(),{navigateAfterLeaveOrganization:t}=(0,c.useOrganizationProfileContext)(),{userMemberships:a,userInvitations:o}=(0,n.eW)({userMemberships:D.AO.userMemberships,userInvitations:D.AO.userInvitations});return()=>i.runAsync(async()=>{await e?.()}).then(()=>{a.revalidate?.(),o.revalidate?.(),t()})},B=e=>{let{organization:i}=(0,n.o8)(),{user:t}=(0,n.aF)(),o=R(()=>t.leaveOrganization(i.id));return i&&t?(0,a.tZ)(w,{organizationName:i.name,title:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.title"),messageLine1:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.messageLine1"),messageLine2:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.messageLine2"),actionDescription:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.actionDescription",{organizationName:i.name}),submitLabel:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.title"),successMessage:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.successMessage"),onConfirmation:o,...e}):null},T=e=>{let{organization:i,membership:t}=(0,n.o8)(),o=R(i?.destroy);return i&&t?(0,a.tZ)(w,{organizationName:i.name,title:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.title"),messageLine1:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.messageLine1"),messageLine2:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.messageLine2"),actionDescription:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.actionDescription",{organizationName:i.name}),submitLabel:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.title"),successMessage:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.successMessage"),onConfirmation:o,...e}):null},w=(0,r.withCardStateProvider)(e=>{let{title:i,messageLine1:t,messageLine2:n,actionDescription:o,organizationName:l,successMessage:s,submitLabel:d,onSuccess:c,onReset:m,onConfirmation:p,colorScheme:h="danger"}=e,f=(0,u.a2)(),z=(0,r.useCardState)(),b=(0,K.Yp)("deleteOrganizationConfirmation","",{type:"text",label:o,isRequired:!0,placeholder:l}),v=!o||b.value===l,P=async()=>{if(v)try{await p().then(()=>f.nextStep())}catch(e){(0,x.S3)(e,[],z.setError)}};return(0,a.BX)(u.en,{...f.props,children:[(0,a.tZ)(C.Y,{headerTitle:i,gap:1,children:(0,a.BX)(y.l.Root,{onSubmit:P,children:[(0,a.BX)(g.Col,{children:[(0,a.tZ)(g.Text,{localizationKey:t,colorScheme:"secondary"}),(0,a.tZ)(g.Text,{localizationKey:n,colorScheme:"danger"})]}),(0,a.tZ)(y.l.ControlRow,{elementId:b.id,children:(0,a.tZ)(y.l.PlainInput,{...b.props})}),(0,a.BX)(S.K,{children:[(0,a.tZ)(y.l.SubmitButton,{block:!1,colorScheme:h,localizationKey:d,isDisabled:!v}),(0,a.tZ)(y.l.ResetButton,{localizationKey:(0,g.localizationKeys)("userProfile.formButtonReset"),block:!1,onClick:m})]})]})}),(0,a.tZ)(_.I,{title:i,text:s,onFinish:c})]})});var I=t(12667),L=t(65695),$=t(34174);let X=(0,r.withCardStateProvider)(e=>{let{domainId:i,mode:t="edit",onSuccess:l,onReset:s}=e,d=(0,r.useCardState)(),{organizationSettings:m}=(0,c.useEnvironment)(),{membership:p,organization:h,domains:f}=(0,n.o8)({domains:{infinite:!0}}),b="edit"===t,v=(()=>{let{organizationSettings:e}=(0,c.useEnvironment)(),i=[];return e.domains.enrollmentModes.includes("manual_invitation")&&i.push({value:"manual_invitation",label:(0,g.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.manualInvitationOption__label"),description:(0,g.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.manualInvitationOption__description")}),e.domains.enrollmentModes.includes("automatic_invitation")&&i.push({value:"automatic_invitation",label:(0,g.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.automaticInvitationOption__label"),description:(0,g.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.automaticInvitationOption__description")}),e.domains.enrollmentModes.includes("automatic_suggestion")&&i.push({value:"automatic_suggestion",label:(0,g.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.automaticSuggestionOption__label"),description:(0,g.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.automaticSuggestionOption__description")}),i})(),P=(0,K.Yp)("enrollmentMode","",{type:"radio",radioOptions:v,isRequired:!0}),Z=(0,K.Yp)("deleteExistingInvitationsSuggestions","",{label:(0,g.localizationKeys)("formFieldLabel__organizationDomainDeletePending"),type:"checkbox"}),{data:_,isLoading:D}=(0,L.ib)(h?.getDomain,{domainId:i});(0,o.useEffect)(()=>{_&&P.setValue(_.enrollmentMode)},[_?.id]);let R=(0,g.localizationKeys)("organizationProfile.verifiedDomainPage.title",{domain:_?.name||""}),B=(0,g.localizationKeys)("organizationProfile.verifiedDomainPage.subtitle",{domain:_?.name||""}),T=((e,{infoLabel:i})=>{let t=e?.totalPendingInvitations||0;return 0===(e?.totalPendingSuggestions||0)+t?[]:[i,(0,g.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.calloutInvitationCountLabel",{count:t}),(0,g.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.calloutSuggestionCountLabel",{count:t})]})(_,{infoLabel:(0,g.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.calloutInfoLabel")}),w=async()=>{if(_&&h&&p&&f)try{await _.updateEnrollmentMode({enrollmentMode:P.value,deletePending:Z.checked}),await f.revalidate(),l()}catch(e){(0,x.S3)(e,[P],d.setError)}};return h&&m?D||!_?(0,a.tZ)(g.Flex,{direction:"row",align:"center",justify:"center",sx:{height:"100%"},children:(0,a.tZ)(g.Spinner,{size:"lg",colorScheme:"primary",elementDescriptor:g.descriptors.spinner})}):(_.verification&&"verified"===_.verification.status||s(),(0,a.tZ)(C.Y,{headerTitle:R,headerSubtitle:b?void 0:B,gap:4,children:(0,a.BX)(g.Col,{gap:6,children:[T.length>0&&(0,a.tZ)(u.aX,{icon:$.I$,children:T.map((e,i)=>(0,a.tZ)(g.Text,{as:"span",sx:{display:"block"},localizationKey:e},i))}),(0,a.tZ)(z.h.Root,{children:(0,a.tZ)(z.h.Subtitle,{localizationKey:(0,g.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.subtitle"),variant:"subtitle"})}),(0,a.BX)(y.l.Root,{onSubmit:w,gap:6,children:[(0,a.tZ)(y.l.ControlRow,{elementId:P.id,children:(0,a.tZ)(y.l.RadioGroup,{...P.props})}),b&&"manual_invitation"===P.value&&(0,a.tZ)(y.l.ControlRow,{elementId:Z.id,children:(0,a.tZ)(y.l.Checkbox,{...Z.props})}),(0,a.tZ)(S.A,{isDisabled:D||!_,onReset:s})]})]})})):null}),O=(0,r.withCardStateProvider)(e=>{let{domainId:i,onSuccess:t,onReset:l,skipToVerified:s}=e,d=(0,r.useCardState)(),{organizationSettings:m}=(0,c.useEnvironment)(),{organization:p}=(0,n.o8)(),{data:h,isLoading:f}=(0,L.ib)(s?void 0:p?.getDomain,{domainId:i}),z=(0,g.localizationKeys)("organizationProfile.verifyDomainPage.title"),b=(0,g.localizationKeys)("organizationProfile.verifyDomainPage.subtitle",{domainName:h?.name??""}),v=(0,u.a2)({defaultStep:2*!!s,onNextStep:()=>d.setError(void 0)}),P=(0,K.Yp)("affiliationEmailAddress","",{type:"text",label:(0,g.localizationKeys)("formFieldLabel__organizationDomainEmailAddress"),placeholder:(0,g.localizationKeys)("formFieldInputPlaceholder__organizationDomainEmailAddress"),infoText:(0,g.localizationKeys)("formFieldLabel__organizationDomainEmailAddressDescription"),isRequired:!0}),Z=(0,o.useRef)(),_=(0,g.localizationKeys)("organizationProfile.verifyDomainPage.subtitleVerificationCodeScreen",{emailAddress:Z.current||""}),D=(0,I.e3)({onCodeEntryFinished:(e,i,a)=>{h?.attemptAffiliationVerification?.({code:e}).then(async e=>{await i(),e.verification?.status==="verified"?v.nextStep():t?.()}).catch(e=>a(e))},onResendCodeClicked:()=>{h?.prepareAffiliationVerification({affiliationEmailAddress:P.value}).catch(e=>{(0,x.S3)(e,[P],d.setError)})}});if(!p||!m)return null;let R=p.name!==P.value,B=`@${h?.name}`;return!f&&h||s?(0,a.BX)(u.en,{...v.props,children:[(0,a.tZ)(C.Y,{headerTitle:z,headerSubtitle:b,children:(0,a.BX)(y.l.Root,{onSubmit:e=>{if(e.preventDefault(),h)return Z.current=`${P.value}${B}`,h.prepareAffiliationVerification({affiliationEmailAddress:Z.current}).then(v.nextStep).catch(e=>{(0,x.S3)(e,[P],d.setError)})},children:[(0,a.tZ)(y.l.ControlRow,{elementId:P.id,children:(0,a.tZ)(y.l.InputGroup,{...P.props,autoFocus:!0,groupSuffix:B,ignorePasswordManager:!0})}),(0,a.tZ)(S.A,{isDisabled:!R,onReset:l})]})}),(0,a.BX)(C.Y,{headerTitle:z,headerSubtitle:_,children:[(0,a.tZ)(y.l.OTPInput,{...D,label:(0,g.localizationKeys)("organizationProfile.verifyDomainPage.formTitle"),description:(0,g.localizationKeys)("organizationProfile.verifyDomainPage.formSubtitle"),resendButton:(0,g.localizationKeys)("organizationProfile.verifyDomainPage.resendButton")}),(0,a.tZ)(S.K,{children:(0,a.tZ)(g.Button,{elementDescriptor:g.descriptors.formButtonReset,block:!1,variant:"ghost",textVariant:"buttonSmall",type:"reset",isDisabled:D.isLoading||"success"===D.otpControl.otpInputProps.feedbackType,onClick:()=>{D.otpControl.otpInputProps.clearFeedback(),D.otpControl.reset(),v.prevStep()},localizationKey:(0,g.localizationKeys)("userProfile.formButtonReset")})})]}),(0,a.tZ)(X,{domainId:i,mode:"select",onSuccess:t,onReset:l})]}):(0,a.tZ)(g.Flex,{direction:"row",align:"center",justify:"center",children:(0,a.tZ)(g.Spinner,{size:"lg",colorScheme:"primary",elementDescriptor:g.descriptors.spinner})})}),k=(0,r.withCardStateProvider)(e=>{let{onSuccess:i,onReset:t}=e,{organizationSettings:l}=(0,c.useEnvironment)(),{domains:s}=(0,n.o8)({domains:{infinite:!0}}),d=(0,u.a2)({onNextStep:()=>v.setError(void 0)}),[m,p]=(0,o.useState)(""),[h,f]=(0,o.useState)(!1),z=(0,g.localizationKeys)("organizationProfile.createDomainPage.title"),b=(0,g.localizationKeys)("organizationProfile.createDomainPage.subtitle"),v=(0,r.useCardState)(),{organization:P}=(0,n.o8)(),Z=(0,K.Yp)("name","",{type:"text",label:(0,g.localizationKeys)("formFieldLabel__organizationDomain"),placeholder:(0,g.localizationKeys)("formFieldInputPlaceholder__organizationDomain")});if(!P||!l)return null;let _=""!==Z.value.trim();return(0,a.BX)(u.en,{...d.props,children:[(0,a.tZ)(C.Y,{headerTitle:z,headerSubtitle:b,children:(0,a.BX)(y.l.Root,{onSubmit:e=>(Z.clearFeedback(),e.preventDefault(),P.createDomain(Z.value).then(async e=>{p(e.id),s?.revalidate?.(),e.verification&&"verified"===e.verification.status&&f(!0),d.nextStep()}).catch(e=>{(0,x.S3)(e,[Z],v.setError)})),children:[(0,a.tZ)(y.l.ControlRow,{elementId:Z.id,children:(0,a.tZ)(y.l.PlainInput,{...Z.props,autoFocus:!0,ignorePasswordManager:!0,isRequired:!0})}),(0,a.tZ)(S.A,{isDisabled:!_,onReset:t})]})}),(0,a.tZ)(O,{domainId:m,onSuccess:()=>{s?.revalidate?.(),i?.()},skipToVerified:h,onReset:t})]})});var A=t(33009);let M={manual_invitation:(0,g.localizationKeys)("organizationProfile.badge__manualInvitation"),automatic_invitation:(0,g.localizationKeys)("organizationProfile.badge__automaticInvitation"),automatic_suggestion:(0,g.localizationKeys)("organizationProfile.badge__automaticSuggestion")},E=e=>{let{organizationDomain:i}=e;return i?i.verification&&"verified"===i.verification.status?(0,a.tZ)(g.Badge,{localizationKey:M[i.enrollmentMode],colorScheme:"manual_invitation"===i.enrollmentMode?"primary":"success"}):(0,a.tZ)(g.Badge,{localizationKey:(0,g.localizationKeys)("organizationProfile.badge__unverified"),colorScheme:"warning"}):null},F=e=>{let{organizationSettings:i}=(0,c.useEnvironment)(),{organization:t}=(0,n.o8)(),{domainId:r,onSuccess:l,onReset:s}=e,d=o.useRef(),{data:m,isLoading:h}=(0,L.ib)(t?.getDomain,{domainId:r},{onSuccess(e){d.current={...e}}}),{domains:f}=(0,n.o8)({domains:{infinite:!0}});return t&&i?h||!m?(0,a.tZ)(g.Flex,{direction:"row",align:"center",justify:"center",children:(0,a.tZ)(g.Spinner,{size:"lg",colorScheme:"primary",elementDescriptor:g.descriptors.spinner})}):(0,a.tZ)(u.LE,{title:(0,p.u1)("organizationProfile.removeDomainPage.title"),messageLine1:(0,p.u1)("organizationProfile.removeDomainPage.messageLine1",{domain:d.current?.name||""}),messageLine2:(0,p.u1)("organizationProfile.removeDomainPage.messageLine2"),deleteResource:()=>m?.delete().then(async()=>{await f?.revalidate?.(),l()}),onSuccess:l,onReset:s}):null},q=e=>{let{close:i}=(0,Z.XC)();return(0,a.tZ)(F,{onSuccess:i,onReset:i,...e})},N=e=>{let{close:i}=(0,Z.XC)();return(0,a.tZ)(X,{onSuccess:i,onReset:i,...e})},V=e=>{let{close:i}=(0,Z.XC)();return(0,a.tZ)(O,{onSuccess:i,onReset:i,skipToVerified:!1,...e})},Y=({domain:e})=>{let i=(e=>{let{open:i}=(0,Z.XC)(),t=[];return e.verification&&"verified"===e.verification.status?t.push({label:(0,g.localizationKeys)("organizationProfile.profilePage.domainSection.menuAction__manage"),onClick:()=>i("manage")}):t.push({label:(0,g.localizationKeys)("organizationProfile.profilePage.domainSection.menuAction__verify"),onClick:()=>i("verify")}),t.push({label:(0,g.localizationKeys)("organizationProfile.profilePage.domainSection.menuAction__remove"),isDestructive:!0,onClick:()=>i("remove")}),t})(e);return(0,a.tZ)(A.a,{actions:i})},j=(0,u.Ci)(e=>{let{verificationStatus:i,enrollmentMode:t,fallback:r,...l}=e,{organization:s,domains:d}=(0,n.o8)({domains:{infinite:!0,...l}}),{ref:c}=(0,L.YD)({threshold:0,onChange:e=>{e&&d?.fetchNext?.()}}),m=(0,o.useMemo)(()=>d?.data?d.data.filter(e=>{let a=!0,n=!0;return i&&(a=!!e.verification&&e.verification.status===i),t&&(n=e.enrollmentMode===t),a&&n}):[],[d?.data]);if(!s)return null;let p=d?.hasNextPage||d?.isFetching;return 0!==m.length||d?.isLoading||r?(0,a.BX)(v.zd.ItemList,{id:"organizationDomains",children:[0===m.length&&!d?.isLoading&&r,m.map(e=>(0,a.BX)(P.a.Root,{children:[(0,a.BX)(v.zd.Item,{id:"organizationDomains",hoverable:!0,children:[(0,a.BX)(g.Flex,{sx:e=>({gap:e.space.$1}),children:[(0,a.tZ)(g.Text,{children:e.name}),(0,a.tZ)(E,{organizationDomain:e})]}),(0,a.tZ)(u.Cv,{permission:"org:sys_domains:manage",children:(0,a.tZ)(Y,{domain:e})})]}),(0,a.tZ)(P.a.Open,{value:"remove",children:(0,a.tZ)(P.a.Card,{variant:"destructive",children:(0,a.tZ)(q,{domainId:e.id})})}),(0,a.tZ)(P.a.Open,{value:"verify",children:(0,a.tZ)(P.a.Card,{children:(0,a.tZ)(V,{domainId:e.id})})}),(0,a.tZ)(P.a.Open,{value:"manage",children:(0,a.tZ)(P.a.Card,{children:(0,a.tZ)(N,{domainId:e.id})})})]},e.id)),(0,a.tZ)(g.Box,{ref:d?.hasNextPage&&!d.isFetching?c:void 0,sx:{visibility:"hidden"}}),p&&0===d.data.length&&(0,a.tZ)(g.Box,{sx:[e=>({width:"100%",height:e.space.$10,position:"relative"})],children:(0,a.tZ)(g.Box,{sx:{display:"flex",margin:"auto",position:"absolute",left:"50%",top:"50%",transform:"translateY(-50%) translateX(-50%)"},children:(0,a.tZ)(g.Spinner,{size:"sm",colorScheme:"primary",elementDescriptor:g.descriptors.spinner})})})]}):null},{permission:"org:sys_domains:read"});var H=t(63872),W=t(8181);let U=(0,r.withCardStateProvider)(e=>{let{onSuccess:i,onReset:t}=e,o=(0,g.localizationKeys)("organizationProfile.profilePage.title"),l=(0,r.useCardState)(),{organization:s}=(0,n.o8)(),{organizationSettings:d}=(0,c.useEnvironment)(),m=(0,K.Yp)("name",s?.name||"",{type:"text",label:(0,g.localizationKeys)("formFieldLabel__organizationName"),placeholder:(0,g.localizationKeys)("formFieldInputPlaceholder__organizationName")}),u=(0,K.Yp)("slug",s?.slug||"",{type:"text",label:(0,g.localizationKeys)("formFieldLabel__organizationSlug"),placeholder:(0,g.localizationKeys)("formFieldInputPlaceholder__organizationSlug")});if(!s)return null;let p=(s.name!==m.value||s.slug!==u.value)&&"error"!==u.feedbackType,h=!d.slug.disabled,f=async e=>{e.preventDefault();let t={name:m.value};return h&&(t.slug=u.value),(p?s.update(t):Promise.resolve()).then(i).catch(e=>{(0,x.S3)(e,[m,u],l.setError)})};return(0,a.tZ)(C.Y,{headerTitle:o,children:(0,a.BX)(y.l.Root,{onSubmit:f,children:[(0,a.tZ)(W.D,{organization:s,onAvatarChange:e=>s.setLogo({file:e}).then(()=>{l.setIdle(),i?.()}).catch(e=>(0,x.S3)(e,[],l.setError)),onAvatarRemove:(0,H.QO)(s.imageUrl)?null:()=>{s.setLogo({file:null}).then(()=>{l.setIdle(),i?.()}).catch(e=>(0,x.S3)(e,[],l.setError))}}),(0,a.tZ)(y.l.ControlRow,{elementId:m.id,children:(0,a.tZ)(y.l.PlainInput,{...m.props,autoFocus:!0,isRequired:!0,ignorePasswordManager:!0})}),h&&(0,a.tZ)(y.l.ControlRow,{elementId:u.id,children:(0,a.tZ)(y.l.PlainInput,{...u.props,onChange:e=>{var i;i=e.target.value,u.setValue(i),u.clearFeedback()},ignorePasswordManager:!0})}),(0,a.tZ)(S.A,{isDisabled:!p,onReset:t})]})})}),Q=()=>{let{close:e}=(0,Z.XC)();return(0,a.tZ)(U,{onSuccess:e,onReset:e})},G=()=>{let{close:e}=(0,Z.XC)();return(0,a.tZ)(k,{onSuccess:e,onReset:e})},J=()=>{let{close:e}=(0,Z.XC)();return(0,a.tZ)(B,{onSuccess:e,onReset:e})},ee=()=>{let{close:e}=(0,Z.XC)();return(0,a.tZ)(T,{onSuccess:e,onReset:e})},ei=()=>(0,a.tZ)(g.Col,{elementDescriptor:g.descriptors.page,sx:e=>({gap:e.space.$8}),children:(0,a.BX)(g.Col,{elementDescriptor:g.descriptors.profilePage,elementId:g.descriptors.profilePage.setId("organizationGeneral"),children:[(0,a.tZ)(z.h.Root,{children:(0,a.tZ)(z.h.Title,{localizationKey:(0,g.localizationKeys)("organizationProfile.start.headerTitle__general"),sx:e=>({marginBottom:e.space.$4}),textVariant:"h2"})}),(0,a.tZ)(et,{}),(0,a.tZ)(u.Cv,{permission:"org:sys_domains:read",children:(0,a.tZ)(ea,{})}),(0,a.tZ)(en,{}),(0,a.tZ)(eo,{})]})}),et=()=>{let{organization:e}=(0,n.o8)();if(!e)return null;let i=(0,a.tZ)(b.Z,{size:"lg",mainIdentifierVariant:"subtitle",organization:e});return(0,a.tZ)(v.zd.Root,{title:(0,g.localizationKeys)("organizationProfile.start.profileSection.title"),id:"organizationProfile",children:(0,a.BX)(P.a.Root,{children:[(0,a.tZ)(u.Cv,{permission:"org:sys_profile:manage",fallback:i,children:(0,a.tZ)(P.a.Closed,{value:"edit",children:(0,a.BX)(v.zd.Item,{id:"organizationProfile",children:[i,(0,a.tZ)(P.a.Trigger,{value:"edit",children:(0,a.tZ)(v.zd.Button,{id:"organizationProfile",localizationKey:(0,g.localizationKeys)("organizationProfile.start.profileSection.primaryButton")})})]})})}),(0,a.tZ)(P.a.Open,{value:"edit",children:(0,a.tZ)(P.a.Card,{children:(0,a.tZ)(Q,{})})})]})})},ea=()=>{let{organizationSettings:e}=(0,c.useEnvironment)(),{organization:i}=(0,n.o8)();return e&&i&&e.domains.enabled?(0,a.tZ)(v.zd.Root,{title:(0,g.localizationKeys)("organizationProfile.profilePage.domainSection.title"),id:"organizationDomains",centered:!1,children:(0,a.BX)(P.a.Root,{children:[(0,a.tZ)(j,{}),(0,a.BX)(u.Cv,{permission:"org:sys_domains:manage",children:[(0,a.tZ)(P.a.Trigger,{value:"add",children:(0,a.BX)(g.Col,{children:[(0,a.tZ)(v.zd.ArrowButton,{localizationKey:(0,g.localizationKeys)("organizationProfile.profilePage.domainSection.primaryButton"),id:"organizationDomains"}),(0,a.tZ)(g.Text,{localizationKey:(0,g.localizationKeys)("organizationProfile.profilePage.domainSection.subtitle"),sx:e=>({paddingLeft:e.space.$9}),colorScheme:"secondary"})]})}),(0,a.tZ)(P.a.Open,{value:"add",children:(0,a.tZ)(P.a.Card,{children:(0,a.tZ)(G,{})})})]})]})}):null},en=()=>{let{organization:e}=(0,n.o8)();return e?(0,a.tZ)(v.zd.Root,{id:"organizationDanger",title:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.title"),children:(0,a.BX)(P.a.Root,{children:[(0,a.tZ)(P.a.Closed,{value:"leave",children:(0,a.tZ)(v.zd.Item,{sx:e=>({paddingTop:0,paddingBottom:0,paddingLeft:e.space.$1}),id:"organizationDanger",children:(0,a.tZ)(P.a.Trigger,{value:"leave",children:(0,a.tZ)(v.zd.Button,{id:"organizationDanger",variant:"ghost",colorScheme:"danger",textVariant:"buttonLarge",localizationKey:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.title")})})})}),(0,a.tZ)(P.a.Open,{value:"leave",children:(0,a.tZ)(P.a.Card,{variant:"destructive",children:(0,a.tZ)(J,{})})})]})}):null},eo=()=>{let{organization:e}=(0,n.o8)(),i=(0,u.N2)({permission:"org:sys_profile:delete"});if(!e)return null;let t=e.adminDeleteEnabled;return i&&t?(0,a.tZ)(v.zd.Root,{id:"organizationDanger",title:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.title"),sx:e=>({marginBottom:e.space.$4}),children:(0,a.BX)(P.a.Root,{children:[(0,a.tZ)(P.a.Closed,{value:"delete",children:(0,a.tZ)(v.zd.Item,{sx:e=>({paddingTop:0,paddingBottom:0,paddingLeft:e.space.$1}),id:"organizationDanger",children:(0,a.tZ)(P.a.Trigger,{value:"delete",children:(0,a.tZ)(v.zd.Button,{id:"organizationDanger",variant:"ghost",colorScheme:"danger",textVariant:"buttonLarge",localizationKey:(0,g.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.title")})})})}),(0,a.tZ)(P.a.Open,{value:"delete",children:(0,a.tZ)(P.a.Card,{variant:"destructive",children:(0,a.tZ)(ee,{})})})]})}):null};var er=t(9117),el=t(36781),es=t(92418),ed=t(36148),ec=t(93266),eg=t(51217),em=t(97295),eu=t(13559),ep=t(90408);let eh=({memberships:e,pageSize:i})=>{let t=(0,r.useCardState)(),{organization:o}=(0,n.o8)(),{options:l,isLoading:s,hasRoleSetMigration:d}=(0,ec.e)();return o?(0,a.tZ)(ep.wQ,{page:e?.page||1,onPageChange:i=>e?.fetchPage?.(i),itemCount:e?.count||0,pageCount:e?.pageCount||0,itemsPerPage:i,isLoading:e?.isLoading&&!e?.data.length||s,emptyStateLocalizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.detailsTitle__emptyRow"),headers:[(0,g.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__user"),(0,g.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__joined"),(0,g.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__role"),(0,g.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__actions")],rows:(e?.data||[]).map(i=>(0,a.tZ)(ef,{membership:i,options:l,onRoleChange:e=>t.runAsync(()=>i.update({role:e})).catch(e=>(0,x.S3)(e,[],t.setError)),onRemove:async()=>t.runAsync(async()=>{let t=await i.destroy();return await e?.revalidate?.(),t}).catch(e=>(0,x.S3)(e,[],t.setError)),hasRoleSetMigration:d},i.id))}):null},ef=e=>{let{membership:i,onRemove:t,onRoleChange:o,options:l,hasRoleSetMigration:s}=e,{localizeCustomRole:d}=(0,ec.q)(),c=(0,r.useCardState)(),{user:m}=(0,n.aF)(),u=m?.id===i.publicUserData?.userId,p=l?.find(e=>e.value===i.role)?.label;return(0,a.BX)(ep.RN,{children:[(0,a.tZ)(g.Td,{children:(0,a.tZ)(em.E,{sx:{maxWidth:"30ch"},user:i.publicUserData,subtitle:i.publicUserData?.identifier,subtitleProps:{variant:"caption"},badge:u&&(0,a.tZ)(g.Badge,{localizationKey:(0,g.localizationKeys)("badge__you")})})}),(0,a.tZ)(g.Td,{children:(0,a.tZ)(g.Box,{as:"span",elementDescriptor:g.descriptors.formattedDate,elementId:g.descriptors.formattedDate.setId("tableCell"),children:i.createdAt.toLocaleDateString()})}),(0,a.tZ)(g.Td,{children:(0,a.tZ)(eu.Cv,{permission:"org:sys_memberships:manage",fallback:(0,a.tZ)(g.Text,{sx:e=>({opacity:e.opacity.$inactive}),children:d(i.role)||p}),children:(0,a.tZ)(ep.DQ,{isDisabled:c.isLoading||!o||s,value:i.role,fallbackLabel:i.roleName,onChange:o,roles:l})})}),(0,a.tZ)(g.Td,{children:(0,a.tZ)(eu.Cv,{permission:"org:sys_memberships:manage",children:(0,a.tZ)(A.a,{actions:[{label:(0,g.localizationKeys)("organizationProfile.membersPage.activeMembersTab.menuAction__remove"),isDestructive:!0,onClick:t,isDisabled:u}],elementId:"member"})})})]})};var ez=t(45727);let eb=({actionSlot:e})=>{let i=(0,u.N2)({permission:"org:sys_memberships:manage"});return(0,a.BX)(P.a.Root,{animate:!1,children:[(0,a.tZ)(el.f,{asChild:!0,children:(0,a.BX)(g.Flex,{justify:e?"between":"end",sx:e=>({width:"100%",marginLeft:"auto",padding:`${e.space.$none} ${e.space.$1}`}),gap:e?2:void 0,children:[e,i&&(0,a.tZ)(P.a.Trigger,{value:"invite",hideOnActive:!e,children:(0,a.tZ)(g.Button,{elementDescriptor:g.descriptors.membersPageInviteButton,"aria-label":"Invite",localizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.action__invite")})})]})}),i&&(0,a.tZ)(el.f,{children:(0,a.tZ)(P.a.Open,{value:"invite",children:(0,a.tZ)(g.Flex,{sx:e=>({paddingBottom:e.space.$6,padding:`${e.space.$none} ${e.space.$1} ${e.space.$6} ${e.space.$1}`}),children:(0,a.tZ)(P.a.Card,{sx:{width:"100%"},children:(0,a.tZ)(ez.N,{})})})})})]})};var ev=t(932);let eP=()=>{let{organization:e}=(0,n.o8)(),{__unstable_manageBillingUrl:i,__unstable_manageBillingLabel:t,__unstable_manageBillingMembersLimit:o}=(0,c.useOrganizationProfileContext)(),r=(0,m.useRouter)();if(!e)return null;let l=e?.membersCount+e?.pendingInvitationsCount,s=(0,H.OR)(o);return(0,a.tZ)(g.Flex,{sx:e=>({background:e.colors.$neutralAlpha50,padding:e.space.$2,borderRadius:e.radii.$md,gap:e.space.$4}),children:(0,a.BX)(g.Flex,{align:"center",sx:e=>({[eg.mqu.sm]:{gap:e.space.$3},gap:e.space.$2}),children:[s>0&&(0,a.tZ)(ev.a,{limit:s,value:l,size:"xs"}),(0,a.BX)(g.Flex,{sx:e=>({[eg.mqu.sm]:{flexDirection:"column"},gap:e.space.$0x5}),children:[(0,a.BX)(g.Text,{children:["You can invite ",o?`up to ${s}`:"unlimited"," members."]}),s>0&&(0,a.BX)(g.Link,{sx:e=>({fontWeight:e.fontWeights.$medium}),variant:"body",onClick:()=>r.navigate((0,H.OR)(i)),children:[(0,H.OR)(t)||"Manage billing",(0,a.tZ)(g.Icon,{icon:$.LZ})]})]})]})})};var eZ=t(81319),ey=t(30215);let eS=({query:e,value:i,memberships:t,onSearchChange:n,onQueryTrigger:r})=>{let{t:l}=(0,g.useLocalizations)(),s=(0,o.useRef)(null);(0,o.useEffect)(()=>{e&&t?.data&&(t?.count??0)<=eI&&t?.fetchPage?.(1)},[e,t]);let d=i&&!!t?.isLoading&&!!t.data?.length;return(0,a.tZ)(el.f,{asChild:!0,children:(0,a.tZ)(g.Flex,{sx:{width:"50%",[eg.mqu.sm]:{width:"auto"}},children:(0,a.tZ)(eZ.W,{value:i,type:"search",autoCapitalize:"none",spellCheck:!1,"aria-label":"Search",placeholder:l((0,g.localizationKeys)("organizationProfile.membersPage.action__search")),leftIcon:d?(0,a.tZ)(ey.$j,{size:"xs"}):(0,a.tZ)(g.Icon,{icon:$.Yt,elementDescriptor:g.descriptors.organizationProfileMembersSearchInputIcon,sx:e=>({color:e.colors.$colorMutedForeground})}),onKeyUp:function(){s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{r(i.trim())},500)},onChange:e=>{let i=e.target.value;n(i),""===i&&r(i)},elementDescriptor:g.descriptors.organizationProfileMembersSearchInput})})})},eC={invitations:{pageSize:10,keepPreviousData:!0}},e_=()=>{let e=(0,r.useCardState)(),{organization:i,invitations:t}=(0,n.o8)(eC),{options:o,isLoading:l}=(0,ec.e)();return i?(0,a.tZ)(ep.wQ,{page:t?.page||1,onPageChange:t?.fetchPage||(()=>null),itemCount:t?.count||0,pageCount:t?.pageCount||0,itemsPerPage:eC.invitations.pageSize,isLoading:t?.isLoading||l,emptyStateLocalizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.invitationsTab.table__emptyRow"),headers:[(0,g.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__user"),(0,g.localizationKeys)("organizationProfile.membersPage.invitedMembersTab.tableHeader__invited"),(0,g.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__role"),(0,g.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__actions")],rows:(t?.data||[]).map(i=>(0,a.tZ)(ex,{options:o,invitation:i,onRevoke:async()=>e.runAsync(async()=>(await i.revoke(),await t?.revalidate?.(),i)).catch(i=>(0,x.S3)(i,[],e.setError))},i.id))}):null},ex=e=>{let{invitation:i,onRevoke:t,options:n}=e,{localizeCustomRole:o}=(0,ec.q)(),r=n?.find(e=>e.value===i.role)?.label;return(0,a.BX)(ep.RN,{children:[(0,a.tZ)(g.Td,{children:(0,a.tZ)(em.E,{sx:{maxWidth:"30ch"},user:{primaryEmailAddress:{emailAddress:i.emailAddress}},subtitleProps:{variant:"caption"}})}),(0,a.tZ)(g.Td,{children:(0,a.tZ)(g.Box,{as:"span",elementDescriptor:g.descriptors.formattedDate,elementId:g.descriptors.formattedDate.setId("tableCell"),children:i.createdAt.toLocaleDateString()})}),(0,a.tZ)(g.Td,{children:(0,a.tZ)(g.Text,{colorScheme:"secondary",localizationKey:o(i.role)||r})}),(0,a.tZ)(g.Td,{children:(0,a.tZ)(A.a,{actions:[{label:(0,g.localizationKeys)("organizationProfile.membersPage.invitedMembersTab.menuAction__revoke"),isDestructive:!0,onClick:t}],elementId:"invitation"})})]})},eK=(0,r.withCardStateProvider)(()=>{let{organizationSettings:e}=(0,c.useEnvironment)(),{__unstable_manageBillingUrl:i,navigateToGeneralPageRoot:t}=(0,c.useOrganizationProfileContext)(),n=e?.domains?.enabled;return(0,a.BX)(g.Col,{gap:4,sx:{width:"100%"},children:[i&&(0,a.tZ)(eP,{}),n&&(0,a.tZ)(u.Cv,{permission:"org:sys_domains:manage",children:(0,a.BX)(g.Flex,{sx:e=>({width:"100%",gap:e.space.$8,paddingBottom:e.space.$4,paddingLeft:e.space.$1,paddingRight:e.space.$1,borderBottomWidth:e.borderWidths.$normal,borderBottomStyle:e.borderStyles.$solid,borderBottomColor:e.colors.$borderAlpha100,[eg.mqu.md]:{flexDirection:"column",gap:e.space.$2}}),children:[(0,a.tZ)(g.Col,{sx:e=>({width:e.space.$66,marginTop:e.space.$2}),children:(0,a.tZ)(z.h.Root,{children:(0,a.tZ)(z.h.Title,{localizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.invitationsTab.autoInvitations.headerTitle"),textVariant:"h3"})})}),(0,a.tZ)(g.Col,{sx:{width:"100%"},children:(0,a.tZ)(j,{fallback:(0,a.BX)(a.HY,{children:[(0,a.tZ)(v.zd.ArrowButton,{localizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.invitationsTab.autoInvitations.primaryButton"),id:"manageVerifiedDomains",sx:e=>({gap:e.space.$2}),onClick:t}),(0,a.tZ)(g.Text,{localizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.invitationsTab.autoInvitations.headerSubtitle"),sx:e=>({paddingLeft:e.space.$10,color:e.colors.$colorMutedForeground,[eg.mqu.md]:{paddingLeft:0}})})]}),verificationStatus:"verified",enrollmentMode:"automatic_invitation"})})]})}),(0,a.BX)(g.Flex,{direction:"col",gap:2,sx:{width:"100%"},children:[(0,a.tZ)(eb,{}),(0,a.tZ)(e_,{})]})]})}),eD={membershipRequests:{pageSize:10,keepPreviousData:!0}},eR=()=>{let e=(0,r.useCardState)(),{organization:i,membershipRequests:t}=(0,n.o8)(eD);return i?(0,a.tZ)(ep.wQ,{page:t?.page||1,onPageChange:t?.fetchPage??(()=>null),itemCount:t?.count||0,pageCount:t?.pageCount||0,itemsPerPage:eD.membershipRequests.pageSize,isLoading:t?.isLoading,emptyStateLocalizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.requestsTab.table__emptyRow"),headers:[(0,g.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__user"),(0,g.localizationKeys)("organizationProfile.membersPage.requestsTab.tableHeader__requested"),(0,g.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__actions")],rows:(t?.data||[]).map(i=>(0,a.tZ)(eB,{request:i,onError:e.setError},i.id))}):null},eB=(0,r.withCardStateProvider)(e=>{let{request:i,onError:t}=e,o=(0,r.useCardState)(),{membership:l,membershipRequests:s}=(0,n.o8)(eD);return(0,a.BX)(ep.RN,{children:[(0,a.tZ)(g.Td,{children:(0,a.tZ)(em.E,{sx:{maxWidth:"30ch"},showAvatar:!1,user:{primaryEmailAddress:{emailAddress:i.publicUserData.identifier}},subtitleProps:{variant:"caption"}})}),(0,a.tZ)(g.Td,{children:(0,a.tZ)(g.Box,{as:"span",elementDescriptor:g.descriptors.formattedDate,elementId:g.descriptors.formattedDate.setId("tableCell"),children:i.createdAt.toLocaleDateString()})}),(0,a.tZ)(g.Td,{children:(0,a.tZ)(eT,{onAccept:()=>{if(l&&s)return o.runAsync(async()=>{await i.accept(),await s.revalidate()},"accept").catch(e=>(0,x.S3)(e,[],t))},onReject:()=>{if(l&&s)return o.runAsync(async()=>{await i.reject(),await s.revalidate()},"reject").catch(e=>(0,x.S3)(e,[],t))}})})]})}),eT=e=>{let i=(0,r.useCardState)();return(0,a.BX)(g.Flex,{gap:2,children:[(0,a.tZ)(g.Button,{textVariant:"buttonSmall",variant:"ghost",isLoading:i.isLoading&&"reject"===i.loadingMetadata,isDisabled:i.isLoading&&"reject"!==i.loadingMetadata,onClick:e.onReject,localizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.requestsTab.menuAction__reject")}),(0,a.tZ)(g.Button,{textVariant:"buttonSmall",isLoading:i.isLoading&&"accept"===i.loadingMetadata,isDisabled:i.isLoading&&"accept"!==i.loadingMetadata,onClick:e.onAccept,localizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.requestsTab.menuAction__approve")})]})},ew=()=>{let{organizationSettings:e}=(0,c.useEnvironment)(),{__unstable_manageBillingUrl:i,navigateToGeneralPageRoot:t}=(0,c.useOrganizationProfileContext)(),n=e?.domains?.enabled;return(0,a.BX)(g.Col,{gap:4,sx:{width:"100%"},children:[i&&(0,a.tZ)(eP,{}),n&&(0,a.tZ)(u.Cv,{permission:"org:sys_domains:manage",children:(0,a.BX)(g.Flex,{sx:e=>({width:"100%",gap:e.space.$8,paddingBottom:e.space.$4,paddingLeft:e.space.$1,paddingRight:e.space.$1,borderBottomWidth:e.borderWidths.$normal,borderBottomStyle:e.borderStyles.$solid,borderBottomColor:e.colors.$borderAlpha100,[eg.mqu.md]:{flexDirection:"column",gap:e.space.$2}}),children:[(0,a.tZ)(g.Col,{sx:e=>({width:e.space.$66,marginTop:e.space.$2}),children:(0,a.tZ)(z.h.Root,{children:(0,a.tZ)(z.h.Title,{localizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.requestsTab.autoSuggestions.headerTitle"),textVariant:"h3"})})}),(0,a.tZ)(g.Col,{sx:{width:"100%"},children:(0,a.tZ)(j,{fallback:(0,a.BX)(a.HY,{children:[(0,a.tZ)(v.zd.ArrowButton,{localizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.requestsTab.autoSuggestions.primaryButton"),sx:e=>({gap:e.space.$2}),id:"manageVerifiedDomains",onClick:t}),(0,a.tZ)(g.Text,{localizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.requestsTab.autoSuggestions.headerSubtitle"),sx:e=>({paddingLeft:e.space.$10,color:e.colors.$colorMutedForeground,[eg.mqu.md]:{paddingLeft:0}})})]}),verificationStatus:"verified",enrollmentMode:"automatic_suggestion"})})]})}),(0,a.BX)(g.Flex,{direction:"col",gap:2,sx:{width:"100%"},children:[(0,a.tZ)(eb,{}),(0,a.tZ)(eR,{})]})]})},eI=10,eL=(0,r.withCardStateProvider)(()=>{let{organizationSettings:e}=(0,c.useEnvironment)(),i=(0,r.useCardState)(),{hasRoleSetMigration:t}=(0,ec.e)(),l=(0,u.N2)({permission:"org:sys_memberships:manage"}),s=(0,u.N2)({permission:"org:sys_memberships:read"}),d=e?.domains?.enabled&&l,[m,p]=(0,o.useState)(""),[h,f]=(0,o.useState)(""),{membershipRequests:b,memberships:v,invitations:Z}=(0,n.o8)({membershipRequests:d||void 0,invitations:l||void 0,memberships:s?{keepPreviousData:!0,query:m||void 0}:void 0}),{__unstable_manageBillingUrl:y}=(0,c.useOrganizationProfileContext)();return null===l?null:(0,a.tZ)(g.Col,{elementDescriptor:g.descriptors.page,gap:2,children:(0,a.tZ)(g.Col,{elementDescriptor:g.descriptors.profilePage,elementId:g.descriptors.profilePage.setId("organizationMembers"),gap:4,children:(0,a.BX)(P.a.Root,{animate:!1,children:[(0,a.tZ)(el.f,{asChild:!0,children:(0,a.tZ)(z.h.Root,{contentSx:{[eg.mqu.md]:{flexDirection:"row",width:"100%",justifyContent:"space-between"}},children:(0,a.tZ)(z.h.Title,{localizationKey:(0,g.localizationKeys)("organizationProfile.start.headerTitle__members"),textVariant:"h2"})})}),(0,a.tZ)(es.Z.Alert,{children:i.error}),(0,a.BX)(ed.mQ,{children:[(0,a.BX)(ed.dr,{sx:e=>({gap:e.space.$2}),children:[s&&(0,a.tZ)(ed.OK,{localizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.start.headerTitle__members"),children:!!v?.count&&(0,a.tZ)(u.dN,{shouldAnimate:!m,notificationCount:v.count,colorScheme:"outline"})}),l&&(0,a.tZ)(ed.OK,{localizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.start.headerTitle__invitations"),children:Z?.data&&!Z.isLoading&&(0,a.tZ)(u.dN,{notificationCount:Z.count,colorScheme:"outline"})}),l&&d&&(0,a.tZ)(ed.OK,{localizationKey:(0,g.localizationKeys)("organizationProfile.membersPage.start.headerTitle__requests"),children:b?.data&&!b.isLoading&&(0,a.tZ)(u.dN,{notificationCount:b.count,colorScheme:"outline"})})]}),(0,a.BX)(ed.nP,{children:[s&&(0,a.tZ)(ed.x4,{sx:{width:"100%"},children:(0,a.BX)(g.Flex,{gap:4,direction:"col",sx:{width:"100%"},children:[l&&y&&(0,a.tZ)(eP,{}),(0,a.BX)(g.Flex,{gap:2,direction:"col",sx:{width:"100%"},children:[(0,a.tZ)(eb,{actionSlot:(0,a.tZ)(eS,{query:m,value:h,memberships:v,onSearchChange:e=>f(e),onQueryTrigger:e=>p(e)})}),t&&(0,a.tZ)(er.b,{variant:"warning",title:(0,g.localizationKeys)("organizationProfile.membersPage.alerts.roleSetMigrationInProgress.title"),subtitle:(0,g.localizationKeys)("organizationProfile.membersPage.alerts.roleSetMigrationInProgress.subtitle")}),(0,a.tZ)(eh,{pageSize:eI,memberships:v})]})]})}),l&&(0,a.tZ)(ed.x4,{sx:{width:"100%"},children:(0,a.tZ)(eK,{})}),l&&d&&(0,a.tZ)(ed.x4,{sx:{width:"100%"},children:(0,a.tZ)(ew,{})})]})]})]})})})}),e$=(0,o.lazy)(()=>Promise.all([t.e("9573"),t.e("5645"),t.e("7502"),t.e("6916")]).then(t.bind(t,14961)).then(e=>({default:e.OrganizationBillingPage}))),eX=(0,o.lazy)(()=>Promise.all([t.e("9573"),t.e("4616"),t.e("7150")]).then(t.bind(t,60815)).then(e=>({default:e.OrganizationAPIKeysPage}))),eO=(0,o.lazy)(()=>Promise.all([t.e("9573"),t.e("4170"),t.e("6511")]).then(t.bind(t,88758)).then(e=>({default:e.OrganizationPlansPage}))),ek=(0,o.lazy)(()=>Promise.all([t.e("9573"),t.e("5645"),t.e("9177")]).then(t.bind(t,29181)).then(e=>({default:e.OrganizationStatementPage}))),eA=(0,o.lazy)(()=>Promise.all([t.e("9573"),t.e("8711")]).then(t.bind(t,8317)).then(e=>({default:e.OrganizationPaymentAttemptPage}))),eM=()=>{let{pages:e,isMembersPageRoot:i,isGeneralPageRoot:t,isBillingPageRoot:n,isAPIKeysPageRoot:r,shouldShowBilling:l,apiKeysProps:s}=(0,c.useOrganizationProfileContext)(),{apiKeysSettings:d,commerceSettings:g}=(0,c.useEnvironment)(),p=e.contents?.map((e,n)=>{let o=!t&&!i&&0===n;return(0,a.tZ)(m.Route,{index:o,path:o?void 0:e.url,children:(0,a.tZ)(f.O,{mount:e.mount,unmount:e.unmount})},`custom-page-${e.url}`)});return(0,a.BX)(m.Switch,{children:[p,(0,a.BX)(m.Route,{children:[(0,a.tZ)(m.Route,{path:t?void 0:"organization-general",children:(0,a.tZ)(m.Switch,{children:(0,a.tZ)(m.Route,{index:!0,children:(0,a.tZ)(ei,{})})})}),(0,a.tZ)(m.Route,{path:i?void 0:"organization-members",children:(0,a.tZ)(m.Switch,{children:(0,a.tZ)(m.Route,{index:!0,children:(0,a.tZ)(u.Cv,{condition:e=>e({permission:"org:sys_memberships:read"})||e({permission:"org:sys_memberships:manage"}),redirectTo:t?"../":"./organization-general",children:(0,a.tZ)(eL,{})})})})}),g.billing.organization.enabled&&l?(0,a.tZ)(u.Cv,{condition:e=>e({permission:"org:sys_billing:read"})||e({permission:"org:sys_billing:manage"}),children:(0,a.tZ)(m.Route,{path:n?void 0:"organization-billing",children:(0,a.BX)(m.Switch,{children:[(0,a.tZ)(m.Route,{index:!0,children:(0,a.tZ)(o.Suspense,{fallback:"",children:(0,a.tZ)(e$,{})})}),g.billing.organization.hasPaidPlans?(0,a.tZ)(m.Route,{path:"plans",children:(0,a.tZ)(o.Suspense,{fallback:"",children:(0,a.tZ)(eO,{})})}):null,(0,a.tZ)(m.Route,{path:"statement/:statementId",children:(0,a.tZ)(o.Suspense,{fallback:"",children:(0,a.tZ)(ek,{})})}),(0,a.tZ)(m.Route,{path:"payment-attempt/:paymentAttemptId",children:(0,a.tZ)(o.Suspense,{fallback:"",children:(0,a.tZ)(eA,{})})})]})})}):null,d.orgs_api_keys_enabled&&!s?.hide&&(0,a.tZ)(u.Cv,{condition:e=>e({permission:"org:sys_api_keys:read"})||e({permission:"org:sys_api_keys:manage"}),children:(0,a.tZ)(m.Route,{path:r?void 0:"organization-api-keys",children:(0,a.tZ)(m.Switch,{children:(0,a.tZ)(m.Route,{index:!0,children:(0,a.tZ)(o.Suspense,{fallback:"",children:(0,a.tZ)(eX,{})})})})})})]})]})},eE=(0,c.withCoreUserGuard)(()=>{let e=o.useRef(null);return(0,a.tZ)(s.P.Root,{sx:e=>({display:"grid",gridTemplateColumns:"1fr 3fr",height:e.sizes.$176,overflow:"hidden"}),children:(0,a.BX)(h,{contentRef:e,children:[(0,a.tZ)(l.ap,{navbarTitleLocalizationKey:(0,g.localizationKeys)("organizationProfile.navbar.title")}),(0,a.tZ)(s.P.Content,{contentRef:e,scrollBoxId:d.aw,children:(0,a.tZ)(eM,{})})]})})}),eF=(0,r.withCardStateProvider)(e=>{let{organization:i}=(0,n.o8)();return i?(0,a.tZ)(g.Flow.Root,{flow:"organizationProfile",children:(0,a.tZ)(g.Flow.Part,{children:(0,a.tZ)(m.Switch,{children:(0,a.tZ)(m.Route,{children:(0,a.tZ)(c.SubscriberTypeContext.Provider,{value:"organization",children:(0,a.tZ)(eE,{})})})})})}):null}),eq=e=>{let i={...e,routing:"virtual",componentName:"OrganizationProfile",mode:"modal"};return(0,a.tZ)(m.Route,{path:"organizationProfile",children:(0,a.tZ)(c.OrganizationProfileContext.Provider,{value:i,children:(0,a.tZ)("div",{children:(0,a.tZ)(eF,{...i})})})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["8554"],{51853:function(e,i,t){t.r(i),t.d(i,{OrganizationProfile:()=>eF,OrganizationProfileModal:()=>eq});var a=t(73312),n=t(61869),o=t(69144),l=t(2672),r=t(15579),s=t(23394),d=t(31673),c=t(11576),u=t(64204),g=t(24676),m=t(96231),p=t(17703);let h=e=>{let{organization:i}=(0,n.o8)(),{apiKeysProps:t,pages:o}=(0,c.useOrganizationProfileContext)(),l=(0,m.N2)(e=>e({permission:"org:sys_memberships:read"})||e({permission:"org:sys_memberships:manage"})),s=(0,m.N2)(e=>e({permission:"org:sys_billing:read"})||e({permission:"org:sys_billing:manage"})),u=o.routes.filter(e=>e.id!==d.bm.MEMBERS||e.id===d.bm.MEMBERS&&l).filter(e=>e.id!==d.bm.BILLING||e.id===d.bm.BILLING&&s).filter(e=>e.id!==d.bm.API_KEYS||!(null==t?void 0:t.hide));return i?(0,a.BX)(r.Uh,{contentRef:e.contentRef,children:[(0,a.tZ)(r.l2,{title:(0,p.u1)("organizationProfile.navbar.title"),description:(0,p.u1)("organizationProfile.navbar.description"),routes:u,contentRef:e.contentRef}),e.children]}):null};t(50725);var v=t(94995),f=t(92654),z=t(35973),b=t(19655),P=t(99805),Z=t(44709),y=t(70431),S=t(19460),C=t(68487),_=t(67263),x=t(88870),K=t(36788),D=t(57484);let R=e=>{let i=(0,l.useCardState)(),{navigateAfterLeaveOrganization:t}=(0,c.useOrganizationProfileContext)(),{userMemberships:a,userInvitations:o}=(0,n.eW)({userMemberships:D.AO.userMemberships,userInvitations:D.AO.userInvitations});return()=>i.runAsync(async()=>{await (null==e?void 0:e())}).then(()=>{var e,i;null==(e=a.revalidate)||e.call(a),null==(i=o.revalidate)||i.call(o),t()})},B=e=>{let{organization:i}=(0,n.o8)(),{user:t}=(0,n.aF)(),o=R(()=>t.leaveOrganization(i.id));return i&&t?(0,a.tZ)(w,{organizationName:i.name,title:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.title"),messageLine1:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.messageLine1"),messageLine2:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.messageLine2"),actionDescription:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.actionDescription",{organizationName:i.name}),submitLabel:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.title"),successMessage:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.successMessage"),onConfirmation:o,...e}):null},T=e=>{let{organization:i,membership:t}=(0,n.o8)(),o=R(null==i?void 0:i.destroy);return i&&t?(0,a.tZ)(w,{organizationName:i.name,title:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.title"),messageLine1:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.messageLine1"),messageLine2:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.messageLine2"),actionDescription:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.actionDescription",{organizationName:i.name}),submitLabel:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.title"),successMessage:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.successMessage"),onConfirmation:o,...e}):null},w=(0,l.withCardStateProvider)(e=>{let{title:i,messageLine1:t,messageLine2:n,actionDescription:o,organizationName:r,successMessage:s,submitLabel:d,onSuccess:c,onReset:g,onConfirmation:p,colorScheme:h="danger"}=e,v=(0,m.a2)(),f=(0,l.useCardState)(),z=(0,K.Yp)("deleteOrganizationConfirmation","",{type:"text",label:o,isRequired:!0,placeholder:r}),b=!o||z.value===r,P=async()=>{if(b)try{await p().then(()=>v.nextStep())}catch(e){(0,x.S3)(e,[],f.setError)}};return(0,a.BX)(m.en,{...v.props,children:[(0,a.tZ)(C.Y,{headerTitle:i,gap:1,children:(0,a.BX)(y.l.Root,{onSubmit:P,children:[(0,a.BX)(u.Col,{children:[(0,a.tZ)(u.Text,{localizationKey:t,colorScheme:"secondary"}),(0,a.tZ)(u.Text,{localizationKey:n,colorScheme:"danger"})]}),(0,a.tZ)(y.l.ControlRow,{elementId:z.id,children:(0,a.tZ)(y.l.PlainInput,{...z.props})}),(0,a.BX)(S.K,{children:[(0,a.tZ)(y.l.SubmitButton,{block:!1,colorScheme:h,localizationKey:d,isDisabled:!b}),(0,a.tZ)(y.l.ResetButton,{localizationKey:(0,u.localizationKeys)("userProfile.formButtonReset"),block:!1,onClick:g})]})]})}),(0,a.tZ)(_.I,{title:i,text:s,onFinish:c})]})});t(65223);var I=t(12667),L=t(65695);t(28419),t(79876);var X=t(96519);let O=(0,l.withCardStateProvider)(e=>{let{domainId:i,mode:t="edit",onSuccess:r,onReset:s}=e,d=(0,l.useCardState)(),{organizationSettings:g}=(0,c.useEnvironment)(),{membership:p,organization:h,domains:v}=(0,n.o8)({domains:{infinite:!0}}),z="edit"===t,b=(()=>{let{organizationSettings:e}=(0,c.useEnvironment)(),i=[];return e.domains.enrollmentModes.includes("manual_invitation")&&i.push({value:"manual_invitation",label:(0,u.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.manualInvitationOption__label"),description:(0,u.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.manualInvitationOption__description")}),e.domains.enrollmentModes.includes("automatic_invitation")&&i.push({value:"automatic_invitation",label:(0,u.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.automaticInvitationOption__label"),description:(0,u.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.automaticInvitationOption__description")}),e.domains.enrollmentModes.includes("automatic_suggestion")&&i.push({value:"automatic_suggestion",label:(0,u.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.automaticSuggestionOption__label"),description:(0,u.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.automaticSuggestionOption__description")}),i})(),P=(0,K.Yp)("enrollmentMode","",{type:"radio",radioOptions:b,isRequired:!0}),Z=(0,K.Yp)("deleteExistingInvitationsSuggestions","",{label:(0,u.localizationKeys)("formFieldLabel__organizationDomainDeletePending"),type:"checkbox"}),{data:_,isLoading:D}=(0,L.ib)(null==h?void 0:h.getDomain,{domainId:i});(0,o.useEffect)(()=>{_&&P.setValue(_.enrollmentMode)},[null==_?void 0:_.id]);let R=(0,u.localizationKeys)("organizationProfile.verifiedDomainPage.title",{domain:(null==_?void 0:_.name)||""}),B=(0,u.localizationKeys)("organizationProfile.verifiedDomainPage.subtitle",{domain:(null==_?void 0:_.name)||""}),T=((e,i)=>{let{infoLabel:t}=i,a=(null==e?void 0:e.totalPendingInvitations)||0;return 0===((null==e?void 0:e.totalPendingSuggestions)||0)+a?[]:[t,(0,u.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.calloutInvitationCountLabel",{count:a}),(0,u.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.calloutSuggestionCountLabel",{count:a})]})(_,{infoLabel:(0,u.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.calloutInfoLabel")}),w=async()=>{if(_&&h&&p&&v)try{await _.updateEnrollmentMode({enrollmentMode:P.value,deletePending:Z.checked}),await v.revalidate(),r()}catch(e){(0,x.S3)(e,[P],d.setError)}};return h&&g?D||!_?(0,a.tZ)(u.Flex,{direction:"row",align:"center",justify:"center",sx:{height:"100%"},children:(0,a.tZ)(u.Spinner,{size:"lg",colorScheme:"primary",elementDescriptor:u.descriptors.spinner})}):(_.verification&&"verified"===_.verification.status||s(),(0,a.tZ)(C.Y,{headerTitle:R,headerSubtitle:z?void 0:B,gap:4,children:(0,a.BX)(u.Col,{gap:6,children:[T.length>0&&(0,a.tZ)(m.aX,{icon:X.I$,children:T.map((e,i)=>(0,a.tZ)(u.Text,{as:"span",sx:{display:"block"},localizationKey:e},i))}),(0,a.tZ)(f.h.Root,{children:(0,a.tZ)(f.h.Subtitle,{localizationKey:(0,u.localizationKeys)("organizationProfile.verifiedDomainPage.enrollmentTab.subtitle"),variant:"subtitle"})}),(0,a.BX)(y.l.Root,{onSubmit:w,gap:6,children:[(0,a.tZ)(y.l.ControlRow,{elementId:P.id,children:(0,a.tZ)(y.l.RadioGroup,{...P.props})}),z&&"manual_invitation"===P.value&&(0,a.tZ)(y.l.ControlRow,{elementId:Z.id,children:(0,a.tZ)(y.l.Checkbox,{...Z.props})}),(0,a.tZ)(S.A,{isDisabled:D||!_,onReset:s})]})]})})):null}),k=(0,l.withCardStateProvider)(e=>{var i;let{domainId:t,onSuccess:r,onReset:s,skipToVerified:d}=e,g=(0,l.useCardState)(),{organizationSettings:p}=(0,c.useEnvironment)(),{organization:h}=(0,n.o8)(),{data:v,isLoading:f}=(0,L.ib)(d||null==h?void 0:h.getDomain,{domainId:t}),z=(0,u.localizationKeys)("organizationProfile.verifyDomainPage.title"),b=(0,u.localizationKeys)("organizationProfile.verifyDomainPage.subtitle",{domainName:null!=(i=null==v?void 0:v.name)?i:""}),P=(0,m.a2)({defaultStep:2*!!d,onNextStep:()=>g.setError(void 0)}),Z=(0,K.Yp)("affiliationEmailAddress","",{type:"text",label:(0,u.localizationKeys)("formFieldLabel__organizationDomainEmailAddress"),placeholder:(0,u.localizationKeys)("formFieldInputPlaceholder__organizationDomainEmailAddress"),infoText:(0,u.localizationKeys)("formFieldLabel__organizationDomainEmailAddressDescription"),isRequired:!0}),_=(0,o.useRef)(),D=(0,u.localizationKeys)("organizationProfile.verifyDomainPage.subtitleVerificationCodeScreen",{emailAddress:_.current||""}),R=(0,I.e3)({onCodeEntryFinished:(e,i,t)=>{var a;null==v||null==(a=v.attemptAffiliationVerification)||a.call(v,{code:e}).then(async e=>{var t;await i(),(null==(t=e.verification)?void 0:t.status)==="verified"?P.nextStep():null==r||r()}).catch(e=>t(e))},onResendCodeClicked:()=>{null==v||v.prepareAffiliationVerification({affiliationEmailAddress:Z.value}).catch(e=>{(0,x.S3)(e,[Z],g.setError)})}});if(!h||!p)return null;let B=h.name!==Z.value,T="@".concat(null==v?void 0:v.name);return!f&&v||d?(0,a.BX)(m.en,{...P.props,children:[(0,a.tZ)(C.Y,{headerTitle:z,headerSubtitle:b,children:(0,a.BX)(y.l.Root,{onSubmit:e=>{if(e.preventDefault(),v)return _.current="".concat(Z.value).concat(T),v.prepareAffiliationVerification({affiliationEmailAddress:_.current}).then(P.nextStep).catch(e=>{(0,x.S3)(e,[Z],g.setError)})},children:[(0,a.tZ)(y.l.ControlRow,{elementId:Z.id,children:(0,a.tZ)(y.l.InputGroup,{...Z.props,autoFocus:!0,groupSuffix:T,ignorePasswordManager:!0})}),(0,a.tZ)(S.A,{isDisabled:!B,onReset:s})]})}),(0,a.BX)(C.Y,{headerTitle:z,headerSubtitle:D,children:[(0,a.tZ)(y.l.OTPInput,{...R,label:(0,u.localizationKeys)("organizationProfile.verifyDomainPage.formTitle"),description:(0,u.localizationKeys)("organizationProfile.verifyDomainPage.formSubtitle"),resendButton:(0,u.localizationKeys)("organizationProfile.verifyDomainPage.resendButton")}),(0,a.tZ)(S.K,{children:(0,a.tZ)(u.Button,{elementDescriptor:u.descriptors.formButtonReset,block:!1,variant:"ghost",textVariant:"buttonSmall",type:"reset",isDisabled:R.isLoading||"success"===R.otpControl.otpInputProps.feedbackType,onClick:()=>{R.otpControl.otpInputProps.clearFeedback(),R.otpControl.reset(),P.prevStep()},localizationKey:(0,u.localizationKeys)("userProfile.formButtonReset")})})]}),(0,a.tZ)(O,{domainId:t,mode:"select",onSuccess:r,onReset:s})]}):(0,a.tZ)(u.Flex,{direction:"row",align:"center",justify:"center",children:(0,a.tZ)(u.Spinner,{size:"lg",colorScheme:"primary",elementDescriptor:u.descriptors.spinner})})}),A=(0,l.withCardStateProvider)(e=>{let{onSuccess:i,onReset:t}=e,{organizationSettings:r}=(0,c.useEnvironment)(),{domains:s}=(0,n.o8)({domains:{infinite:!0}}),d=(0,m.a2)({onNextStep:()=>b.setError(void 0)}),[g,p]=(0,o.useState)(""),[h,v]=(0,o.useState)(!1),f=(0,u.localizationKeys)("organizationProfile.createDomainPage.title"),z=(0,u.localizationKeys)("organizationProfile.createDomainPage.subtitle"),b=(0,l.useCardState)(),{organization:P}=(0,n.o8)(),Z=(0,K.Yp)("name","",{type:"text",label:(0,u.localizationKeys)("formFieldLabel__organizationDomain"),placeholder:(0,u.localizationKeys)("formFieldInputPlaceholder__organizationDomain")});if(!P||!r)return null;let _=""!==Z.value.trim();return(0,a.BX)(m.en,{...d.props,children:[(0,a.tZ)(C.Y,{headerTitle:f,headerSubtitle:z,children:(0,a.BX)(y.l.Root,{onSubmit:e=>(Z.clearFeedback(),e.preventDefault(),P.createDomain(Z.value).then(async e=>{var i;p(e.id),null==s||null==(i=s.revalidate)||i.call(s),e.verification&&"verified"===e.verification.status&&v(!0),d.nextStep()}).catch(e=>{(0,x.S3)(e,[Z],b.setError)})),children:[(0,a.tZ)(y.l.ControlRow,{elementId:Z.id,children:(0,a.tZ)(y.l.PlainInput,{...Z.props,autoFocus:!0,ignorePasswordManager:!0,isRequired:!0})}),(0,a.tZ)(S.A,{isDisabled:!_,onReset:t})]})}),(0,a.tZ)(k,{domainId:g,onSuccess:()=>{var e;null==s||null==(e=s.revalidate)||e.call(s),null==i||i()},skipToVerified:h,onReset:t})]})});var $=t(33009);let M={manual_invitation:(0,u.localizationKeys)("organizationProfile.badge__manualInvitation"),automatic_invitation:(0,u.localizationKeys)("organizationProfile.badge__automaticInvitation"),automatic_suggestion:(0,u.localizationKeys)("organizationProfile.badge__automaticSuggestion")},E=e=>{let{organizationDomain:i}=e;return i?i.verification&&"verified"===i.verification.status?(0,a.tZ)(u.Badge,{localizationKey:M[i.enrollmentMode],colorScheme:"manual_invitation"===i.enrollmentMode?"primary":"success"}):(0,a.tZ)(u.Badge,{localizationKey:(0,u.localizationKeys)("organizationProfile.badge__unverified"),colorScheme:"warning"}):null},F=e=>{var i;let{organizationSettings:t}=(0,c.useEnvironment)(),{organization:l}=(0,n.o8)(),{domainId:r,onSuccess:s,onReset:d}=e,g=o.useRef(),{data:h,isLoading:v}=(0,L.ib)(null==l?void 0:l.getDomain,{domainId:r},{onSuccess(e){g.current={...e}}}),{domains:f}=(0,n.o8)({domains:{infinite:!0}});return l&&t?v||!h?(0,a.tZ)(u.Flex,{direction:"row",align:"center",justify:"center",children:(0,a.tZ)(u.Spinner,{size:"lg",colorScheme:"primary",elementDescriptor:u.descriptors.spinner})}):(0,a.tZ)(m.LE,{title:(0,p.u1)("organizationProfile.removeDomainPage.title"),messageLine1:(0,p.u1)("organizationProfile.removeDomainPage.messageLine1",{domain:(null==(i=g.current)?void 0:i.name)||""}),messageLine2:(0,p.u1)("organizationProfile.removeDomainPage.messageLine2"),deleteResource:()=>null==h?void 0:h.delete().then(async()=>{var e;await (null==f||null==(e=f.revalidate)?void 0:e.call(f)),s()}),onSuccess:s,onReset:d}):null},q=e=>{let{close:i}=(0,Z.XC)();return(0,a.tZ)(F,{onSuccess:i,onReset:i,...e})},N=e=>{let{close:i}=(0,Z.XC)();return(0,a.tZ)(O,{onSuccess:i,onReset:i,...e})},V=e=>{let{close:i}=(0,Z.XC)();return(0,a.tZ)(k,{onSuccess:i,onReset:i,skipToVerified:!1,...e})},Y=e=>{let{domain:i}=e,t=(e=>{let{open:i}=(0,Z.XC)(),t=[];return e.verification&&"verified"===e.verification.status?t.push({label:(0,u.localizationKeys)("organizationProfile.profilePage.domainSection.menuAction__manage"),onClick:()=>i("manage")}):t.push({label:(0,u.localizationKeys)("organizationProfile.profilePage.domainSection.menuAction__verify"),onClick:()=>i("verify")}),t.push({label:(0,u.localizationKeys)("organizationProfile.profilePage.domainSection.menuAction__remove"),isDestructive:!0,onClick:()=>i("remove")}),t})(i);return(0,a.tZ)($.a,{actions:t})},j=(0,m.Ci)(e=>{let{verificationStatus:i,enrollmentMode:t,fallback:l,...r}=e,{organization:s,domains:d}=(0,n.o8)({domains:{infinite:!0,...r}}),{ref:c}=(0,L.YD)({threshold:0,onChange:e=>{if(e){var i;null==d||null==(i=d.fetchNext)||i.call(d)}}}),g=(0,o.useMemo)(()=>(null==d?void 0:d.data)?d.data.filter(e=>{let a=!0,n=!0;return i&&(a=!!e.verification&&e.verification.status===i),t&&(n=e.enrollmentMode===t),a&&n}):[],[null==d?void 0:d.data]);if(!s)return null;let p=(null==d?void 0:d.hasNextPage)||(null==d?void 0:d.isFetching);return 0!==g.length||(null==d?void 0:d.isLoading)||l?(0,a.BX)(b.zd.ItemList,{id:"organizationDomains",children:[0===g.length&&!(null==d?void 0:d.isLoading)&&l,g.map(e=>(0,a.BX)(P.a.Root,{children:[(0,a.BX)(b.zd.Item,{id:"organizationDomains",hoverable:!0,children:[(0,a.BX)(u.Flex,{sx:e=>({gap:e.space.$1}),children:[(0,a.tZ)(u.Text,{children:e.name}),(0,a.tZ)(E,{organizationDomain:e})]}),(0,a.tZ)(m.Cv,{permission:"org:sys_domains:manage",children:(0,a.tZ)(Y,{domain:e})})]}),(0,a.tZ)(P.a.Open,{value:"remove",children:(0,a.tZ)(P.a.Card,{variant:"destructive",children:(0,a.tZ)(q,{domainId:e.id})})}),(0,a.tZ)(P.a.Open,{value:"verify",children:(0,a.tZ)(P.a.Card,{children:(0,a.tZ)(V,{domainId:e.id})})}),(0,a.tZ)(P.a.Open,{value:"manage",children:(0,a.tZ)(P.a.Card,{children:(0,a.tZ)(N,{domainId:e.id})})})]},e.id)),(0,a.tZ)(u.Box,{ref:(null==d?void 0:d.hasNextPage)&&!d.isFetching?c:void 0,sx:{visibility:"hidden"}}),p&&0===d.data.length&&(0,a.tZ)(u.Box,{sx:[e=>({width:"100%",height:e.space.$10,position:"relative"})],children:(0,a.tZ)(u.Box,{sx:{display:"flex",margin:"auto",position:"absolute",left:"50%",top:"50%",transform:"translateY(-50%) translateX(-50%)"},children:(0,a.tZ)(u.Spinner,{size:"sm",colorScheme:"primary",elementDescriptor:u.descriptors.spinner})})})]}):null},{permission:"org:sys_domains:read"});var H=t(96620),W=t(8181);let U=(0,l.withCardStateProvider)(e=>{let{onSuccess:i,onReset:t}=e,o=(0,u.localizationKeys)("organizationProfile.profilePage.title"),r=(0,l.useCardState)(),{organization:s}=(0,n.o8)(),{organizationSettings:d}=(0,c.useEnvironment)(),g=(0,K.Yp)("name",(null==s?void 0:s.name)||"",{type:"text",label:(0,u.localizationKeys)("formFieldLabel__organizationName"),placeholder:(0,u.localizationKeys)("formFieldInputPlaceholder__organizationName")}),m=(0,K.Yp)("slug",(null==s?void 0:s.slug)||"",{type:"text",label:(0,u.localizationKeys)("formFieldLabel__organizationSlug"),placeholder:(0,u.localizationKeys)("formFieldInputPlaceholder__organizationSlug")});if(!s)return null;let p=(s.name!==g.value||s.slug!==m.value)&&"error"!==m.feedbackType,h=!d.slug.disabled,v=async e=>{e.preventDefault();let t={name:g.value};return h&&(t.slug=m.value),(p?s.update(t):Promise.resolve()).then(i).catch(e=>{(0,x.S3)(e,[g,m],r.setError)})};return(0,a.tZ)(C.Y,{headerTitle:o,children:(0,a.BX)(y.l.Root,{onSubmit:v,children:[(0,a.tZ)(W.D,{organization:s,onAvatarChange:e=>s.setLogo({file:e}).then(()=>{r.setIdle(),null==i||i()}).catch(e=>(0,x.S3)(e,[],r.setError)),onAvatarRemove:(0,H.QO)(s.imageUrl)?null:()=>{s.setLogo({file:null}).then(()=>{r.setIdle(),null==i||i()}).catch(e=>(0,x.S3)(e,[],r.setError))}}),(0,a.tZ)(y.l.ControlRow,{elementId:g.id,children:(0,a.tZ)(y.l.PlainInput,{...g.props,autoFocus:!0,isRequired:!0,ignorePasswordManager:!0})}),h&&(0,a.tZ)(y.l.ControlRow,{elementId:m.id,children:(0,a.tZ)(y.l.PlainInput,{...m.props,onChange:e=>{var i;i=e.target.value,m.setValue(i),m.clearFeedback()},ignorePasswordManager:!0})}),(0,a.tZ)(S.A,{isDisabled:!p,onReset:t})]})})}),Q=()=>{let{close:e}=(0,Z.XC)();return(0,a.tZ)(U,{onSuccess:e,onReset:e})},G=()=>{let{close:e}=(0,Z.XC)();return(0,a.tZ)(A,{onSuccess:e,onReset:e})},J=()=>{let{close:e}=(0,Z.XC)();return(0,a.tZ)(B,{onSuccess:e,onReset:e})},ee=()=>{let{close:e}=(0,Z.XC)();return(0,a.tZ)(T,{onSuccess:e,onReset:e})},ei=()=>(0,a.tZ)(u.Col,{elementDescriptor:u.descriptors.page,sx:e=>({gap:e.space.$8}),children:(0,a.BX)(u.Col,{elementDescriptor:u.descriptors.profilePage,elementId:u.descriptors.profilePage.setId("organizationGeneral"),children:[(0,a.tZ)(f.h.Root,{children:(0,a.tZ)(f.h.Title,{localizationKey:(0,u.localizationKeys)("organizationProfile.start.headerTitle__general"),sx:e=>({marginBottom:e.space.$4}),textVariant:"h2"})}),(0,a.tZ)(et,{}),(0,a.tZ)(m.Cv,{permission:"org:sys_domains:read",children:(0,a.tZ)(ea,{})}),(0,a.tZ)(en,{}),(0,a.tZ)(eo,{})]})}),et=()=>{let{organization:e}=(0,n.o8)();if(!e)return null;let i=(0,a.tZ)(z.Z,{size:"lg",mainIdentifierVariant:"subtitle",organization:e});return(0,a.tZ)(b.zd.Root,{title:(0,u.localizationKeys)("organizationProfile.start.profileSection.title"),id:"organizationProfile",children:(0,a.BX)(P.a.Root,{children:[(0,a.tZ)(m.Cv,{permission:"org:sys_profile:manage",fallback:i,children:(0,a.tZ)(P.a.Closed,{value:"edit",children:(0,a.BX)(b.zd.Item,{id:"organizationProfile",children:[i,(0,a.tZ)(P.a.Trigger,{value:"edit",children:(0,a.tZ)(b.zd.Button,{id:"organizationProfile",localizationKey:(0,u.localizationKeys)("organizationProfile.start.profileSection.primaryButton")})})]})})}),(0,a.tZ)(P.a.Open,{value:"edit",children:(0,a.tZ)(P.a.Card,{children:(0,a.tZ)(Q,{})})})]})})},ea=()=>{let{organizationSettings:e}=(0,c.useEnvironment)(),{organization:i}=(0,n.o8)();return e&&i&&e.domains.enabled?(0,a.tZ)(b.zd.Root,{title:(0,u.localizationKeys)("organizationProfile.profilePage.domainSection.title"),id:"organizationDomains",centered:!1,children:(0,a.BX)(P.a.Root,{children:[(0,a.tZ)(j,{}),(0,a.BX)(m.Cv,{permission:"org:sys_domains:manage",children:[(0,a.tZ)(P.a.Trigger,{value:"add",children:(0,a.BX)(u.Col,{children:[(0,a.tZ)(b.zd.ArrowButton,{localizationKey:(0,u.localizationKeys)("organizationProfile.profilePage.domainSection.primaryButton"),id:"organizationDomains"}),(0,a.tZ)(u.Text,{localizationKey:(0,u.localizationKeys)("organizationProfile.profilePage.domainSection.subtitle"),sx:e=>({paddingLeft:e.space.$9}),colorScheme:"secondary"})]})}),(0,a.tZ)(P.a.Open,{value:"add",children:(0,a.tZ)(P.a.Card,{children:(0,a.tZ)(G,{})})})]})]})}):null},en=()=>{let{organization:e}=(0,n.o8)();return e?(0,a.tZ)(b.zd.Root,{id:"organizationDanger",title:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.title"),children:(0,a.BX)(P.a.Root,{children:[(0,a.tZ)(P.a.Closed,{value:"leave",children:(0,a.tZ)(b.zd.Item,{sx:e=>({paddingTop:0,paddingBottom:0,paddingLeft:e.space.$1}),id:"organizationDanger",children:(0,a.tZ)(P.a.Trigger,{value:"leave",children:(0,a.tZ)(b.zd.Button,{id:"organizationDanger",variant:"ghost",colorScheme:"danger",textVariant:"buttonLarge",localizationKey:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.leaveOrganization.title")})})})}),(0,a.tZ)(P.a.Open,{value:"leave",children:(0,a.tZ)(P.a.Card,{variant:"destructive",children:(0,a.tZ)(J,{})})})]})}):null},eo=()=>{let{organization:e}=(0,n.o8)(),i=(0,m.N2)({permission:"org:sys_profile:delete"});if(!e)return null;let t=e.adminDeleteEnabled;return i&&t?(0,a.tZ)(b.zd.Root,{id:"organizationDanger",title:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.title"),sx:e=>({marginBottom:e.space.$4}),children:(0,a.BX)(P.a.Root,{children:[(0,a.tZ)(P.a.Closed,{value:"delete",children:(0,a.tZ)(b.zd.Item,{sx:e=>({paddingTop:0,paddingBottom:0,paddingLeft:e.space.$1}),id:"organizationDanger",children:(0,a.tZ)(P.a.Trigger,{value:"delete",children:(0,a.tZ)(b.zd.Button,{id:"organizationDanger",variant:"ghost",colorScheme:"danger",textVariant:"buttonLarge",localizationKey:(0,u.localizationKeys)("organizationProfile.profilePage.dangerSection.deleteOrganization.title")})})})}),(0,a.tZ)(P.a.Open,{value:"delete",children:(0,a.tZ)(P.a.Card,{variant:"destructive",children:(0,a.tZ)(ee,{})})})]})}):null};var el=t(9117),er=t(36781),es=t(92418),ed=t(36148),ec=t(93266),eu=t(51217),eg=t(97295),em=t(13559),ep=t(90408);let eh=e=>{let{memberships:i,pageSize:t}=e,o=(0,l.useCardState)(),{organization:r}=(0,n.o8)(),{options:s,isLoading:d,hasRoleSetMigration:c}=(0,ec.e)();return r?(0,a.tZ)(ep.wQ,{page:(null==i?void 0:i.page)||1,onPageChange:e=>{var t;return null==i||null==(t=i.fetchPage)?void 0:t.call(i,e)},itemCount:(null==i?void 0:i.count)||0,pageCount:(null==i?void 0:i.pageCount)||0,itemsPerPage:t,isLoading:(null==i?void 0:i.isLoading)&&!(null==i?void 0:i.data.length)||d,emptyStateLocalizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.detailsTitle__emptyRow"),headers:[(0,u.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__user"),(0,u.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__joined"),(0,u.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__role"),(0,u.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__actions")],rows:((null==i?void 0:i.data)||[]).map(e=>(0,a.tZ)(ev,{membership:e,options:s,onRoleChange:i=>o.runAsync(()=>e.update({role:i})).catch(e=>(0,x.S3)(e,[],o.setError)),onRemove:async()=>o.runAsync(async()=>{var t;let a=await e.destroy();return await (null==i||null==(t=i.revalidate)?void 0:t.call(i)),a}).catch(e=>(0,x.S3)(e,[],o.setError)),hasRoleSetMigration:c},e.id))}):null},ev=e=>{var i,t,o;let{membership:r,onRemove:s,onRoleChange:d,options:c,hasRoleSetMigration:g}=e,{localizeCustomRole:m}=(0,ec.q)(),p=(0,l.useCardState)(),{user:h}=(0,n.aF)(),v=(null==h?void 0:h.id)===(null==(i=r.publicUserData)?void 0:i.userId),f=null==c||null==(t=c.find(e=>e.value===r.role))?void 0:t.label;return(0,a.BX)(ep.RN,{children:[(0,a.tZ)(u.Td,{children:(0,a.tZ)(eg.E,{sx:{maxWidth:"30ch"},user:r.publicUserData,subtitle:null==(o=r.publicUserData)?void 0:o.identifier,subtitleProps:{variant:"caption"},badge:v&&(0,a.tZ)(u.Badge,{localizationKey:(0,u.localizationKeys)("badge__you")})})}),(0,a.tZ)(u.Td,{children:(0,a.tZ)(u.Box,{as:"span",elementDescriptor:u.descriptors.formattedDate,elementId:u.descriptors.formattedDate.setId("tableCell"),children:r.createdAt.toLocaleDateString()})}),(0,a.tZ)(u.Td,{children:(0,a.tZ)(em.Cv,{permission:"org:sys_memberships:manage",fallback:(0,a.tZ)(u.Text,{sx:e=>({opacity:e.opacity.$inactive}),children:m(r.role)||f}),children:(0,a.tZ)(ep.DQ,{isDisabled:p.isLoading||!d||g,value:r.role,fallbackLabel:r.roleName,onChange:d,roles:c})})}),(0,a.tZ)(u.Td,{children:(0,a.tZ)(em.Cv,{permission:"org:sys_memberships:manage",children:(0,a.tZ)($.a,{actions:[{label:(0,u.localizationKeys)("organizationProfile.membersPage.activeMembersTab.menuAction__remove"),isDestructive:!0,onClick:s,isDisabled:v}],elementId:"member"})})})]})};var ef=t(45727);let ez=e=>{let{actionSlot:i}=e,t=(0,m.N2)({permission:"org:sys_memberships:manage"});return(0,a.BX)(P.a.Root,{animate:!1,children:[(0,a.tZ)(er.f,{asChild:!0,children:(0,a.BX)(u.Flex,{justify:i?"between":"end",sx:e=>({width:"100%",marginLeft:"auto",padding:"".concat(e.space.$none," ").concat(e.space.$1)}),gap:i?2:void 0,children:[i,t&&(0,a.tZ)(P.a.Trigger,{value:"invite",hideOnActive:!i,children:(0,a.tZ)(u.Button,{elementDescriptor:u.descriptors.membersPageInviteButton,"aria-label":"Invite",localizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.action__invite")})})]})}),t&&(0,a.tZ)(er.f,{children:(0,a.tZ)(P.a.Open,{value:"invite",children:(0,a.tZ)(u.Flex,{sx:e=>({paddingBottom:e.space.$6,padding:"".concat(e.space.$none," ").concat(e.space.$1," ").concat(e.space.$6," ").concat(e.space.$1)}),children:(0,a.tZ)(P.a.Card,{sx:{width:"100%"},children:(0,a.tZ)(ef.N,{})})})})})]})};var eb=t(932);let eP=()=>{let{organization:e}=(0,n.o8)(),{__unstable_manageBillingUrl:i,__unstable_manageBillingLabel:t,__unstable_manageBillingMembersLimit:o}=(0,c.useOrganizationProfileContext)(),l=(0,g.useRouter)();if(!e)return null;let r=(null==e?void 0:e.membersCount)+(null==e?void 0:e.pendingInvitationsCount),s=(0,H.OR)(o);return(0,a.tZ)(u.Flex,{sx:e=>({background:e.colors.$neutralAlpha50,padding:e.space.$2,borderRadius:e.radii.$md,gap:e.space.$4}),children:(0,a.BX)(u.Flex,{align:"center",sx:e=>({[eu.mqu.sm]:{gap:e.space.$3},gap:e.space.$2}),children:[s>0&&(0,a.tZ)(eb.a,{limit:s,value:r,size:"xs"}),(0,a.BX)(u.Flex,{sx:e=>({[eu.mqu.sm]:{flexDirection:"column"},gap:e.space.$0x5}),children:[(0,a.BX)(u.Text,{children:["You can invite ",o?"up to ".concat(s):"unlimited"," members."]}),s>0&&(0,a.BX)(u.Link,{sx:e=>({fontWeight:e.fontWeights.$medium}),variant:"body",onClick:()=>l.navigate((0,H.OR)(i)),children:[(0,H.OR)(t)||"Manage billing",(0,a.tZ)(u.Icon,{icon:X.LZ})]})]})]})})};var eZ=t(81319),ey=t(30215);let eS=e=>{var i;let{query:t,value:n,memberships:l,onSearchChange:r,onQueryTrigger:s}=e,{t:d}=(0,u.useLocalizations)(),c=(0,o.useRef)(null);(0,o.useEffect)(()=>{var e,i;t&&(null==l?void 0:l.data)&&(null!=(e=null==l?void 0:l.count)?e:0)<=eI&&(null==l||null==(i=l.fetchPage)||i.call(l,1))},[t,l]);let g=n&&!!(null==l?void 0:l.isLoading)&&!!(null==(i=l.data)?void 0:i.length);return(0,a.tZ)(er.f,{asChild:!0,children:(0,a.tZ)(u.Flex,{sx:{width:"50%",[eu.mqu.sm]:{width:"auto"}},children:(0,a.tZ)(eZ.W,{value:n,type:"search",autoCapitalize:"none",spellCheck:!1,"aria-label":"Search",placeholder:d((0,u.localizationKeys)("organizationProfile.membersPage.action__search")),leftIcon:g?(0,a.tZ)(ey.$j,{size:"xs"}):(0,a.tZ)(u.Icon,{icon:X.Yt,elementDescriptor:u.descriptors.organizationProfileMembersSearchInputIcon,sx:e=>({color:e.colors.$colorMutedForeground})}),onKeyUp:function(){c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{s(n.trim())},500)},onChange:e=>{let i=e.target.value;r(i),""===i&&s(i)},elementDescriptor:u.descriptors.organizationProfileMembersSearchInput})})})},eC={invitations:{pageSize:10,keepPreviousData:!0}},e_=()=>{let e=(0,l.useCardState)(),{organization:i,invitations:t}=(0,n.o8)(eC),{options:o,isLoading:r}=(0,ec.e)();return i?(0,a.tZ)(ep.wQ,{page:(null==t?void 0:t.page)||1,onPageChange:(null==t?void 0:t.fetchPage)||(()=>null),itemCount:(null==t?void 0:t.count)||0,pageCount:(null==t?void 0:t.pageCount)||0,itemsPerPage:eC.invitations.pageSize,isLoading:(null==t?void 0:t.isLoading)||r,emptyStateLocalizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.invitationsTab.table__emptyRow"),headers:[(0,u.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__user"),(0,u.localizationKeys)("organizationProfile.membersPage.invitedMembersTab.tableHeader__invited"),(0,u.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__role"),(0,u.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__actions")],rows:((null==t?void 0:t.data)||[]).map(i=>(0,a.tZ)(ex,{options:o,invitation:i,onRevoke:async()=>e.runAsync(async()=>{var e;return await i.revoke(),await (null==t||null==(e=t.revalidate)?void 0:e.call(t)),i}).catch(i=>(0,x.S3)(i,[],e.setError))},i.id))}):null},ex=e=>{var i;let{invitation:t,onRevoke:n,options:o}=e,{localizeCustomRole:l}=(0,ec.q)(),r=null==o||null==(i=o.find(e=>e.value===t.role))?void 0:i.label;return(0,a.BX)(ep.RN,{children:[(0,a.tZ)(u.Td,{children:(0,a.tZ)(eg.E,{sx:{maxWidth:"30ch"},user:{primaryEmailAddress:{emailAddress:t.emailAddress}},subtitleProps:{variant:"caption"}})}),(0,a.tZ)(u.Td,{children:(0,a.tZ)(u.Box,{as:"span",elementDescriptor:u.descriptors.formattedDate,elementId:u.descriptors.formattedDate.setId("tableCell"),children:t.createdAt.toLocaleDateString()})}),(0,a.tZ)(u.Td,{children:(0,a.tZ)(u.Text,{colorScheme:"secondary",localizationKey:l(t.role)||r})}),(0,a.tZ)(u.Td,{children:(0,a.tZ)($.a,{actions:[{label:(0,u.localizationKeys)("organizationProfile.membersPage.invitedMembersTab.menuAction__revoke"),isDestructive:!0,onClick:n}],elementId:"invitation"})})]})},eK=(0,l.withCardStateProvider)(()=>{var e;let{organizationSettings:i}=(0,c.useEnvironment)(),{__unstable_manageBillingUrl:t,navigateToGeneralPageRoot:n}=(0,c.useOrganizationProfileContext)(),o=null==i||null==(e=i.domains)?void 0:e.enabled;return(0,a.BX)(u.Col,{gap:4,sx:{width:"100%"},children:[t&&(0,a.tZ)(eP,{}),o&&(0,a.tZ)(m.Cv,{permission:"org:sys_domains:manage",children:(0,a.BX)(u.Flex,{sx:e=>({width:"100%",gap:e.space.$8,paddingBottom:e.space.$4,paddingLeft:e.space.$1,paddingRight:e.space.$1,borderBottomWidth:e.borderWidths.$normal,borderBottomStyle:e.borderStyles.$solid,borderBottomColor:e.colors.$borderAlpha100,[eu.mqu.md]:{flexDirection:"column",gap:e.space.$2}}),children:[(0,a.tZ)(u.Col,{sx:e=>({width:e.space.$66,marginTop:e.space.$2}),children:(0,a.tZ)(f.h.Root,{children:(0,a.tZ)(f.h.Title,{localizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.invitationsTab.autoInvitations.headerTitle"),textVariant:"h3"})})}),(0,a.tZ)(u.Col,{sx:{width:"100%"},children:(0,a.tZ)(j,{fallback:(0,a.BX)(a.HY,{children:[(0,a.tZ)(b.zd.ArrowButton,{localizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.invitationsTab.autoInvitations.primaryButton"),id:"manageVerifiedDomains",sx:e=>({gap:e.space.$2}),onClick:n}),(0,a.tZ)(u.Text,{localizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.invitationsTab.autoInvitations.headerSubtitle"),sx:e=>({paddingLeft:e.space.$10,color:e.colors.$colorMutedForeground,[eu.mqu.md]:{paddingLeft:0}})})]}),verificationStatus:"verified",enrollmentMode:"automatic_invitation"})})]})}),(0,a.BX)(u.Flex,{direction:"col",gap:2,sx:{width:"100%"},children:[(0,a.tZ)(ez,{}),(0,a.tZ)(e_,{})]})]})}),eD={membershipRequests:{pageSize:10,keepPreviousData:!0}},eR=()=>{var e;let i=(0,l.useCardState)(),{organization:t,membershipRequests:o}=(0,n.o8)(eD);return t?(0,a.tZ)(ep.wQ,{page:(null==o?void 0:o.page)||1,onPageChange:null!=(e=null==o?void 0:o.fetchPage)?e:()=>null,itemCount:(null==o?void 0:o.count)||0,pageCount:(null==o?void 0:o.pageCount)||0,itemsPerPage:eD.membershipRequests.pageSize,isLoading:null==o?void 0:o.isLoading,emptyStateLocalizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.requestsTab.table__emptyRow"),headers:[(0,u.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__user"),(0,u.localizationKeys)("organizationProfile.membersPage.requestsTab.tableHeader__requested"),(0,u.localizationKeys)("organizationProfile.membersPage.activeMembersTab.tableHeader__actions")],rows:((null==o?void 0:o.data)||[]).map(e=>(0,a.tZ)(eB,{request:e,onError:i.setError},e.id))}):null},eB=(0,l.withCardStateProvider)(e=>{let{request:i,onError:t}=e,o=(0,l.useCardState)(),{membership:r,membershipRequests:s}=(0,n.o8)(eD);return(0,a.BX)(ep.RN,{children:[(0,a.tZ)(u.Td,{children:(0,a.tZ)(eg.E,{sx:{maxWidth:"30ch"},showAvatar:!1,user:{primaryEmailAddress:{emailAddress:i.publicUserData.identifier}},subtitleProps:{variant:"caption"}})}),(0,a.tZ)(u.Td,{children:(0,a.tZ)(u.Box,{as:"span",elementDescriptor:u.descriptors.formattedDate,elementId:u.descriptors.formattedDate.setId("tableCell"),children:i.createdAt.toLocaleDateString()})}),(0,a.tZ)(u.Td,{children:(0,a.tZ)(eT,{onAccept:()=>{if(r&&s)return o.runAsync(async()=>{await i.accept(),await s.revalidate()},"accept").catch(e=>(0,x.S3)(e,[],t))},onReject:()=>{if(r&&s)return o.runAsync(async()=>{await i.reject(),await s.revalidate()},"reject").catch(e=>(0,x.S3)(e,[],t))}})})]})}),eT=e=>{let i=(0,l.useCardState)();return(0,a.BX)(u.Flex,{gap:2,children:[(0,a.tZ)(u.Button,{textVariant:"buttonSmall",variant:"ghost",isLoading:i.isLoading&&"reject"===i.loadingMetadata,isDisabled:i.isLoading&&"reject"!==i.loadingMetadata,onClick:e.onReject,localizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.requestsTab.menuAction__reject")}),(0,a.tZ)(u.Button,{textVariant:"buttonSmall",isLoading:i.isLoading&&"accept"===i.loadingMetadata,isDisabled:i.isLoading&&"accept"!==i.loadingMetadata,onClick:e.onAccept,localizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.requestsTab.menuAction__approve")})]})},ew=()=>{var e;let{organizationSettings:i}=(0,c.useEnvironment)(),{__unstable_manageBillingUrl:t,navigateToGeneralPageRoot:n}=(0,c.useOrganizationProfileContext)(),o=null==i||null==(e=i.domains)?void 0:e.enabled;return(0,a.BX)(u.Col,{gap:4,sx:{width:"100%"},children:[t&&(0,a.tZ)(eP,{}),o&&(0,a.tZ)(m.Cv,{permission:"org:sys_domains:manage",children:(0,a.BX)(u.Flex,{sx:e=>({width:"100%",gap:e.space.$8,paddingBottom:e.space.$4,paddingLeft:e.space.$1,paddingRight:e.space.$1,borderBottomWidth:e.borderWidths.$normal,borderBottomStyle:e.borderStyles.$solid,borderBottomColor:e.colors.$borderAlpha100,[eu.mqu.md]:{flexDirection:"column",gap:e.space.$2}}),children:[(0,a.tZ)(u.Col,{sx:e=>({width:e.space.$66,marginTop:e.space.$2}),children:(0,a.tZ)(f.h.Root,{children:(0,a.tZ)(f.h.Title,{localizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.requestsTab.autoSuggestions.headerTitle"),textVariant:"h3"})})}),(0,a.tZ)(u.Col,{sx:{width:"100%"},children:(0,a.tZ)(j,{fallback:(0,a.BX)(a.HY,{children:[(0,a.tZ)(b.zd.ArrowButton,{localizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.requestsTab.autoSuggestions.primaryButton"),sx:e=>({gap:e.space.$2}),id:"manageVerifiedDomains",onClick:n}),(0,a.tZ)(u.Text,{localizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.requestsTab.autoSuggestions.headerSubtitle"),sx:e=>({paddingLeft:e.space.$10,color:e.colors.$colorMutedForeground,[eu.mqu.md]:{paddingLeft:0}})})]}),verificationStatus:"verified",enrollmentMode:"automatic_suggestion"})})]})}),(0,a.BX)(u.Flex,{direction:"col",gap:2,sx:{width:"100%"},children:[(0,a.tZ)(ez,{}),(0,a.tZ)(eR,{})]})]})},eI=10,eL=(0,l.withCardStateProvider)(()=>{var e;let{organizationSettings:i}=(0,c.useEnvironment)(),t=(0,l.useCardState)(),{hasRoleSetMigration:r}=(0,ec.e)(),s=(0,m.N2)({permission:"org:sys_memberships:manage"}),d=(0,m.N2)({permission:"org:sys_memberships:read"}),g=(null==i||null==(e=i.domains)?void 0:e.enabled)&&s,[p,h]=(0,o.useState)(""),[v,z]=(0,o.useState)(""),{membershipRequests:b,memberships:Z,invitations:y}=(0,n.o8)({membershipRequests:g||void 0,invitations:s||void 0,memberships:d?{keepPreviousData:!0,query:p||void 0}:void 0}),{__unstable_manageBillingUrl:S}=(0,c.useOrganizationProfileContext)();return null===s?null:(0,a.tZ)(u.Col,{elementDescriptor:u.descriptors.page,gap:2,children:(0,a.tZ)(u.Col,{elementDescriptor:u.descriptors.profilePage,elementId:u.descriptors.profilePage.setId("organizationMembers"),gap:4,children:(0,a.BX)(P.a.Root,{animate:!1,children:[(0,a.tZ)(er.f,{asChild:!0,children:(0,a.tZ)(f.h.Root,{contentSx:{[eu.mqu.md]:{flexDirection:"row",width:"100%",justifyContent:"space-between"}},children:(0,a.tZ)(f.h.Title,{localizationKey:(0,u.localizationKeys)("organizationProfile.start.headerTitle__members"),textVariant:"h2"})})}),(0,a.tZ)(es.Z.Alert,{children:t.error}),(0,a.BX)(ed.mQ,{children:[(0,a.BX)(ed.dr,{sx:e=>({gap:e.space.$2}),children:[d&&(0,a.tZ)(ed.OK,{localizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.start.headerTitle__members"),children:!!(null==Z?void 0:Z.count)&&(0,a.tZ)(m.dN,{shouldAnimate:!p,notificationCount:Z.count,colorScheme:"outline"})}),s&&(0,a.tZ)(ed.OK,{localizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.start.headerTitle__invitations"),children:(null==y?void 0:y.data)&&!y.isLoading&&(0,a.tZ)(m.dN,{notificationCount:y.count,colorScheme:"outline"})}),s&&g&&(0,a.tZ)(ed.OK,{localizationKey:(0,u.localizationKeys)("organizationProfile.membersPage.start.headerTitle__requests"),children:(null==b?void 0:b.data)&&!b.isLoading&&(0,a.tZ)(m.dN,{notificationCount:b.count,colorScheme:"outline"})})]}),(0,a.BX)(ed.nP,{children:[d&&(0,a.tZ)(ed.x4,{sx:{width:"100%"},children:(0,a.BX)(u.Flex,{gap:4,direction:"col",sx:{width:"100%"},children:[s&&S&&(0,a.tZ)(eP,{}),(0,a.BX)(u.Flex,{gap:2,direction:"col",sx:{width:"100%"},children:[(0,a.tZ)(ez,{actionSlot:(0,a.tZ)(eS,{query:p,value:v,memberships:Z,onSearchChange:e=>z(e),onQueryTrigger:e=>h(e)})}),r&&(0,a.tZ)(el.b,{variant:"warning",title:(0,u.localizationKeys)("organizationProfile.membersPage.alerts.roleSetMigrationInProgress.title"),subtitle:(0,u.localizationKeys)("organizationProfile.membersPage.alerts.roleSetMigrationInProgress.subtitle")}),(0,a.tZ)(eh,{pageSize:eI,memberships:Z})]})]})}),s&&(0,a.tZ)(ed.x4,{sx:{width:"100%"},children:(0,a.tZ)(eK,{})}),s&&g&&(0,a.tZ)(ed.x4,{sx:{width:"100%"},children:(0,a.tZ)(ew,{})})]})]})]})})})}),eX=(0,o.lazy)(()=>Promise.all([t.e("9573"),t.e("5645"),t.e("7502"),t.e("6916")]).then(t.bind(t,14961)).then(e=>({default:e.OrganizationBillingPage}))),eO=(0,o.lazy)(()=>Promise.all([t.e("9573"),t.e("4616"),t.e("7150")]).then(t.bind(t,60815)).then(e=>({default:e.OrganizationAPIKeysPage}))),ek=(0,o.lazy)(()=>Promise.all([t.e("9573"),t.e("4170"),t.e("6511")]).then(t.bind(t,88758)).then(e=>({default:e.OrganizationPlansPage}))),eA=(0,o.lazy)(()=>Promise.all([t.e("9573"),t.e("5645"),t.e("9177")]).then(t.bind(t,29181)).then(e=>({default:e.OrganizationStatementPage}))),e$=(0,o.lazy)(()=>Promise.all([t.e("9573"),t.e("8711")]).then(t.bind(t,8317)).then(e=>({default:e.OrganizationPaymentAttemptPage}))),eM=()=>{var e;let{pages:i,isMembersPageRoot:t,isGeneralPageRoot:n,isBillingPageRoot:l,isAPIKeysPageRoot:r,shouldShowBilling:s,apiKeysProps:d}=(0,c.useOrganizationProfileContext)(),{apiKeysSettings:u,commerceSettings:p}=(0,c.useEnvironment)(),h=null==(e=i.contents)?void 0:e.map((e,i)=>{let o=!n&&!t&&0===i;return(0,a.tZ)(g.Route,{index:o,path:o?void 0:e.url,children:(0,a.tZ)(v.O,{mount:e.mount,unmount:e.unmount})},"custom-page-".concat(e.url))});return(0,a.BX)(g.Switch,{children:[h,(0,a.BX)(g.Route,{children:[(0,a.tZ)(g.Route,{path:n?void 0:"organization-general",children:(0,a.tZ)(g.Switch,{children:(0,a.tZ)(g.Route,{index:!0,children:(0,a.tZ)(ei,{})})})}),(0,a.tZ)(g.Route,{path:t?void 0:"organization-members",children:(0,a.tZ)(g.Switch,{children:(0,a.tZ)(g.Route,{index:!0,children:(0,a.tZ)(m.Cv,{condition:e=>e({permission:"org:sys_memberships:read"})||e({permission:"org:sys_memberships:manage"}),redirectTo:n?"../":"./organization-general",children:(0,a.tZ)(eL,{})})})})}),p.billing.organization.enabled&&s?(0,a.tZ)(m.Cv,{condition:e=>e({permission:"org:sys_billing:read"})||e({permission:"org:sys_billing:manage"}),children:(0,a.tZ)(g.Route,{path:l?void 0:"organization-billing",children:(0,a.BX)(g.Switch,{children:[(0,a.tZ)(g.Route,{index:!0,children:(0,a.tZ)(o.Suspense,{fallback:"",children:(0,a.tZ)(eX,{})})}),p.billing.organization.hasPaidPlans?(0,a.tZ)(g.Route,{path:"plans",children:(0,a.tZ)(o.Suspense,{fallback:"",children:(0,a.tZ)(ek,{})})}):null,(0,a.tZ)(g.Route,{path:"statement/:statementId",children:(0,a.tZ)(o.Suspense,{fallback:"",children:(0,a.tZ)(eA,{})})}),(0,a.tZ)(g.Route,{path:"payment-attempt/:paymentAttemptId",children:(0,a.tZ)(o.Suspense,{fallback:"",children:(0,a.tZ)(e$,{})})})]})})}):null,u.orgs_api_keys_enabled&&!(null==d?void 0:d.hide)&&(0,a.tZ)(m.Cv,{condition:e=>e({permission:"org:sys_api_keys:read"})||e({permission:"org:sys_api_keys:manage"}),children:(0,a.tZ)(g.Route,{path:r?void 0:"organization-api-keys",children:(0,a.tZ)(g.Switch,{children:(0,a.tZ)(g.Route,{index:!0,children:(0,a.tZ)(o.Suspense,{fallback:"",children:(0,a.tZ)(eO,{})})})})})})]})]})},eE=(0,c.withCoreUserGuard)(()=>{let e=o.useRef(null);return(0,a.tZ)(s.P.Root,{sx:e=>({display:"grid",gridTemplateColumns:"1fr 3fr",height:e.sizes.$176,overflow:"hidden"}),children:(0,a.BX)(h,{contentRef:e,children:[(0,a.tZ)(r.ap,{navbarTitleLocalizationKey:(0,u.localizationKeys)("organizationProfile.navbar.title")}),(0,a.tZ)(s.P.Content,{contentRef:e,scrollBoxId:d.aw,children:(0,a.tZ)(eM,{})})]})})}),eF=(0,l.withCardStateProvider)(e=>{let{organization:i}=(0,n.o8)();return i?(0,a.tZ)(u.Flow.Root,{flow:"organizationProfile",children:(0,a.tZ)(u.Flow.Part,{children:(0,a.tZ)(g.Switch,{children:(0,a.tZ)(g.Route,{children:(0,a.tZ)(c.SubscriberTypeContext.Provider,{value:"organization",children:(0,a.tZ)(eE,{})})})})})}):null}),eq=e=>{let i={...e,routing:"virtual",componentName:"OrganizationProfile",mode:"modal"};return(0,a.tZ)(g.Route,{path:"organizationProfile",children:(0,a.tZ)(c.OrganizationProfileContext.Provider,{value:i,children:(0,a.tZ)("div",{children:(0,a.tZ)(eF,{...i})})})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["4780"],{96061:function(e,t,i){i.r(t),i.d(t,{OrganizationSwitcher:()=>E});var o=i(73312),n=i(69144),r=i(2672),a=i(84045),c=i(11576),s=i(64204),l=i(65695),d=i(61869),g=i(42305),p=i(35973),u=i(62915),h=i(1151),z=i(63872),m=i(96231),S=i(53929),w=i(34174),v=i(24676),x=i(48774),$=i(88870),Z=i(51217),f=i(57484);let b=e=>{let t=(0,r.useCardState)(),{userSuggestions:i}=(0,d.eW)({userSuggestions:f.AO.userSuggestions});return"accepted"===e.status?(0,o.tZ)(s.Text,{colorScheme:"secondary",localizationKey:(0,s.localizationKeys)("organizationSwitcher.suggestionsAcceptedLabel")}):(0,o.tZ)(s.Button,{elementDescriptor:s.descriptors.organizationSwitcherInvitationAcceptButton,textVariant:"buttonSmall",variant:"outline",colorScheme:"neutral",size:"sm",isLoading:t.isLoading,onClick:()=>t.runAsync(e.accept).then(e=>i?.setData?.(t=>(0,f.Sz)(e,t))).catch(e=>(0,$.S3)(e,[],t.setError)),localizationKey:(0,s.localizationKeys)("organizationSwitcher.action__suggestionsAccept")})},B=e=>{let t=(0,r.useCardState)();return(0,o.tZ)(s.Button,{elementDescriptor:s.descriptors.organizationSwitcherInvitationAcceptButton,textVariant:"buttonSmall",variant:"outline",colorScheme:"neutral",size:"xs",isLoading:t.isLoading,onClick:e.onAccept,localizationKey:(0,s.localizationKeys)("organizationSwitcher.action__invitationAccept")})},I=e=>{let{children:t,publicOrganizationData:i}=e;return(0,o.BX)(s.Flex,{align:"center",gap:2,sx:e=>({justifyContent:"space-between",padding:`${e.space.$4} ${e.space.$5}`}),elementDescriptor:s.descriptors.organizationSwitcherPopoverInvitationActionsBox,children:[(0,o.tZ)(p.Z,{elementId:"organizationSwitcherListedOrganization",organization:i,sx:e=>({color:e.colors.$colorMutedForeground,":hover":{color:e.colors.$colorMutedForeground}})}),t]})},O=(0,r.withCardStateProvider)(e=>{let{invitation:t,onOrganizationClick:i}=e,{accept:n,publicOrganizationData:a,status:l}=t,g=(0,r.useCardState)(),{getOrganization:u}=(0,d.cL)(),{organization:h}=(0,d.o8)(),{userInvitations:z}=(0,d.eW)({userInvitations:f.AO.userInvitations,userMemberships:f.AO.userMemberships}),{acceptedInvitations:m,setAcceptedInvitations:S}=(0,c.useAcceptedInvitations)(),v=m.find(e=>e.invitation.id===t.id)?.organization;return"accepted"===l?t.publicOrganizationData.id===h?.id||v?.id&&h?.id===v.id?null:(0,o.tZ)(x.K,{elementDescriptor:s.descriptors.organizationSwitcherPreviewButton,icon:w.nR,onClick:v?()=>i(v):void 0,role:"menuitem",children:(0,o.tZ)(p.Z,{elementId:"organizationSwitcherListedOrganization",organization:a,sx:e=>({color:e.colors.$colorMutedForeground,":hover":{color:e.colors.$colorMutedForeground}})})}):(0,o.tZ)(I,{publicOrganizationData:a,children:(0,o.tZ)(B,{onAccept:()=>g.runAsync(async()=>[await n(),await u(a.id)]).then(([e,t])=>{z?.setData?.(t=>(0,f.Sz)(e,t,"negative")),S(i=>[...i,{organization:t,invitation:e}])}).catch(e=>(0,$.S3)(e,[],g.setError))})})}),A=e=>{let{showBorder:t,...i}=e;return(0,o.tZ)(g.eX,{role:"menu",...i})},C=(0,r.withCardStateProvider)(e=>(0,o.tZ)(I,{publicOrganizationData:e.publicOrganizationData,children:(0,o.tZ)(b,{...e})})),P=e=>{let{onOrganizationClick:t}=e,{ref:i,userSuggestions:n,userInvitations:r}=(()=>{let{userInvitations:e,userSuggestions:t}=(0,d.eW)(f.AO),{ref:i}=(0,l.YD)({threshold:0,onChange:i=>{i&&(e.hasNextPage?e.fetchNext?.():t.fetchNext?.())}});return{userInvitations:e,userSuggestions:t,ref:i}})(),a=r.isLoading||n.isLoading,c=r.hasNextPage||n.hasNextPage,g=r.data?.filter(e=>!!e)||[],p=n.data?.filter(e=>!!e)||[],u=g.length>0||p.length>0;return u||a?(0,o.tZ)(A,{showBorder:u||a,elementDescriptor:s.descriptors.organizationSwitcherPopoverInvitationActions,children:(0,o.BX)(s.Box,{sx:e=>({maxHeight:`calc(4 * ${e.sizes.$17} + 4px)`,overflowY:"auto",...Z.common.unstyledScrollbar(e)}),children:[g?.map(e=>(0,o.tZ)(O,{invitation:e,onOrganizationClick:t},e.id)),!r.hasNextPage&&p?.map(e=>(0,o.tZ)(C,{...e},e.id)),(c||a)&&(0,o.tZ)(m.q7,{ref:i})]})}):null},y=e=>{let{onPersonalWorkspaceClick:t,onOrganizationClick:i}=e,{hidePersonal:n}=(0,c.useOrganizationSwitcherContext)(),{organization:r}=(0,d.o8)(),{ref:a,userMemberships:g}=(()=>{let{userMemberships:e}=(0,d.eW)({userMemberships:f.AO.userMemberships}),{ref:t}=(0,l.YD)({threshold:0,onChange:t=>{t&&e.hasNextPage&&e.fetchNext?.()}});return{userMemberships:e,ref:t}})(),{user:h}=(0,d.aF)(),z=((g.count||0)>0&&g.data||[]).map(e=>e.organization).filter(e=>e.id!==r?.id);if(!h)return null;let{username:S,primaryEmailAddress:v,primaryPhoneNumber:$,...b}=h,{isLoading:B,hasNextPage:I}=g;return(0,o.BX)(s.Box,{sx:e=>({maxHeight:`calc((4 * ${e.sizes.$17}) + 4px)`,overflowY:"auto","> button,div":{border:`0 solid ${e.colors.$borderAlpha100}`},">:not([hidden])~:not([hidden])":{borderTopWidth:"1px",borderBottomWidth:"0"},...Z.common.unstyledScrollbar(e)}),role:"group","aria-label":n?"List of all organization memberships":"List of all accounts",children:[r&&!n&&(0,o.tZ)(x.K,{elementDescriptor:s.descriptors.organizationSwitcherPreviewButton,elementId:s.descriptors.organizationSwitcherPreviewButton.setId("personal"),icon:w.nR,onClick:t,role:"menuitem",children:(0,o.tZ)(u.g,{user:b,mainIdentifierVariant:"buttonLarge",title:(0,s.localizationKeys)("organizationSwitcher.personalWorkspace")})}),z.map(e=>(0,o.tZ)(x.K,{elementDescriptor:s.descriptors.organizationSwitcherPreviewButton,elementId:s.descriptors.organizationSwitcherPreviewButton.setId("organization"),icon:w.nR,onClick:()=>i(e),role:"menuitem",sx:e=>({border:`0 solid ${e.colors.$borderAlpha100}`}),children:(0,o.tZ)(p.Z,{elementId:"organizationSwitcherListedOrganization",organization:e})},e.id)),(I||B)&&(0,o.tZ)(m.q7,{ref:a})]})},D=({onCreateOrganizationClick:e})=>{let{user:t}=(0,d.aF)();return t?.createOrganizationEnabled?(0,o.tZ)(g.aU,{elementDescriptor:s.descriptors.organizationSwitcherPopoverActionButton,elementId:s.descriptors.organizationSwitcherPopoverActionButton.setId("createOrganization"),iconBoxElementDescriptor:s.descriptors.organizationSwitcherPopoverActionButtonIconBox,iconBoxElementId:s.descriptors.organizationSwitcherPopoverActionButtonIconBox.setId("createOrganization"),iconElementDescriptor:s.descriptors.organizationSwitcherPopoverActionButtonIcon,iconElementId:s.descriptors.organizationSwitcherPopoverActionButtonIcon.setId("createOrganization"),icon:w.mm,label:(0,s.localizationKeys)("organizationSwitcher.action__createOrganization"),onClick:e,sx:e=>({padding:`${e.space.$5} ${e.space.$5}`}),iconSx:e=>({width:e.sizes.$9,height:e.sizes.$6}),iconBoxSx:e=>({width:e.sizes.$9,height:e.sizes.$6}),spinnerSize:"sm"}):null},k=e=>{let{onCreateOrganizationClick:t,onPersonalWorkspaceClick:i,onOrganizationClick:n}=e;return(0,o.BX)(o.HY,{children:[(0,o.tZ)(P,{onOrganizationClick:n}),(0,o.tZ)(y,{onPersonalWorkspaceClick:i,onOrganizationClick:n}),(0,o.tZ)(D,{onCreateOrganizationClick:t})]})},_=n.forwardRef((e,t)=>{let{close:i,...n}=e,a=()=>i?.(!1),l=(0,r.useCardState)(),{__experimental_asStandalone:m}=(0,c.useOrganizationSwitcherContext)(),{openOrganizationProfile:x,openCreateOrganization:$}=(0,d.cL)(),{organization:Z}=(0,d.o8)(),{isLoaded:f,setActive:b}=(0,d.eW)(),B=(0,v.useRouter)(),{hidePersonal:I,__unstable_manageBillingUrl:O,__unstable_manageBillingLabel:A,__unstable_manageBillingMembersLimit:C,createOrganizationMode:P,organizationProfileMode:y,afterLeaveOrganizationUrl:D,afterCreateOrganizationUrl:_,navigateCreateOrganization:F,navigateOrganizationProfile:K,afterSelectOrganizationUrl:R,afterSelectPersonalUrl:E,organizationProfileProps:W,skipInvitationScreen:X,hideSlug:M}=(0,c.useOrganizationSwitcherContext)(),{user:N}=(0,d.aF)();if(!N)return null;let{username:T,primaryEmailAddress:U,primaryPhoneNumber:Y,...j}=N;if(!f)return null;let H=(0,o.tZ)(g.U8,{elementDescriptor:s.descriptors.organizationSwitcherPopoverActionButton,elementId:s.descriptors.organizationSwitcherPopoverActionButton.setId("manageOrganization"),iconBoxElementDescriptor:s.descriptors.organizationSwitcherPopoverActionButtonIconBox,iconBoxElementId:s.descriptors.organizationSwitcherPopoverActionButtonIconBox.setId("manageOrganization"),iconElementDescriptor:s.descriptors.organizationSwitcherPopoverActionButtonIcon,iconElementId:s.descriptors.organizationSwitcherPopoverActionButtonIcon.setId("manageOrganization"),icon:w.tc,label:(0,s.localizationKeys)("organizationSwitcher.action__manageOrganization"),onClick:()=>(a(),"navigation"===y)?K():x({...W,afterLeaveOrganizationUrl:D,__unstable_manageBillingUrl:O,__unstable_manageBillingLabel:A,__unstable_manageBillingMembersLimit:C}),trailing:(0,o.tZ)(L,{}),focusRing:!0}),V=(0,o.tZ)(g.U8,{icon:w.Nj,label:(0,z.OR)(A)||"Upgrade",onClick:()=>B.navigate((0,z.OR)(O)),focusRing:!0});return(0,o.tZ)(S.r,{elementDescriptor:s.descriptors.organizationSwitcherPopoverRootBox,children:(0,o.BX)(h.f.Root,{elementDescriptor:s.descriptors.organizationSwitcherPopoverCard,ref:t,role:"dialog","aria-label":`${Z?.name} is active`,shouldEntryAnimate:!m,...n,children:[(0,o.tZ)(h.f.Content,{elementDescriptor:s.descriptors.organizationSwitcherPopoverMain,children:(0,o.BX)(g.eX,{elementDescriptor:s.descriptors.organizationSwitcherPopoverActions,role:"menu",children:[Z?O?(0,o.BX)(o.HY,{children:[(0,o.tZ)(p.Z,{elementId:"organizationSwitcherActiveOrganization",organization:Z,user:N,mainIdentifierVariant:"buttonLarge",sx:e=>({padding:`${e.space.$4} ${e.space.$5}`})}),(0,o.tZ)(g.eX,{role:"menu",sx:e=>({borderBottomWidth:e.borderWidths.$normal,borderBottomStyle:e.borderStyles.$solid,borderBottomColor:e.colors.$borderAlpha100}),children:(0,o.BX)(s.Flex,{justify:"between",sx:e=>({marginLeft:e.space.$12,padding:`0 ${e.space.$5} ${e.space.$4}`,gap:e.space.$2}),children:[H,V]})})]}):(0,o.BX)(s.Flex,{justify:"between",align:"center",sx:e=>({width:"100%",paddingRight:e.space.$5}),children:[(0,o.tZ)(p.Z,{elementId:"organizationSwitcherActiveOrganization",organization:Z,user:N,mainIdentifierVariant:"buttonLarge",sx:e=>({padding:`${e.space.$4} ${e.space.$5}`})}),(0,o.tZ)(g.eX,{role:"menu",children:H})]}):!I&&(0,o.tZ)(u.g,{user:j,sx:e=>({padding:`${e.space.$4} ${e.space.$5}`,width:"100%"}),title:(0,s.localizationKeys)("organizationSwitcher.personalWorkspace")}),(0,o.tZ)(k,{onCreateOrganizationClick:()=>(a(),"navigation"===P)?F():$({afterCreateOrganizationUrl:_,skipInvitationScreen:X,hideSlug:M}),onPersonalWorkspaceClick:()=>l.runAsync(()=>b({organization:null,redirectUrl:E(N)})).then(a),onOrganizationClick:e=>l.runAsync(()=>b({organization:e,redirectUrl:R(e)})).then(a)})]})}),(0,o.tZ)(h.f.Footer,{elementDescriptor:s.descriptors.organizationSwitcherPopoverFooter})]})})}),L=(0,m.Ci)(({sx:e})=>{let{organizationSettings:t}=(0,c.useEnvironment)(),i=t?.domains?.enabled,{membershipRequests:n}=(0,d.o8)({membershipRequests:i||void 0});return n?.count?(0,o.tZ)(m.dN,{notificationCount:n.count,containerSx:e}):null},{permission:"org:sys_memberships:manage"}),F=(0,i(77711).C)((0,n.forwardRef)((e,t)=>{let{sx:i,...n}=e,{user:r}=(0,d.aF)(),{organization:a}=(0,d.o8)(),{hidePersonal:l}=(0,c.useOrganizationSwitcherContext)(),{t:g}=(0,s.useLocalizations)();if(!r)return null;let{username:h,primaryEmailAddress:z,primaryPhoneNumber:m,...S}=r;return(0,o.BX)(s.Button,{elementDescriptor:s.descriptors.organizationSwitcherTrigger,elementId:s.descriptors.organizationSwitcherTrigger.setId(a?"organization":"personal"),variant:"ghost",colorScheme:"neutral",hoverAsFocus:!0,focusRing:!1,sx:[e=>({padding:`${e.space.$1} ${e.space.$2}`,position:"relative"}),i],ref:t,"aria-label":`${g(e.isOpen?(0,s.localizationKeys)("organizationSwitcher.action__closeOrganizationSwitcher"):(0,s.localizationKeys)("organizationSwitcher.action__openOrganizationSwitcher"))}`,"aria-expanded":e.isOpen,"aria-haspopup":"dialog",...n,children:[a&&(0,o.tZ)(p.Z,{elementId:"organizationSwitcherTrigger",gap:3,size:"xs",organization:a,sx:{maxWidth:"30ch"}}),!a&&(0,o.tZ)(u.g,{size:"xs",gap:3,user:S,showAvatar:!l,sx:e=>({color:e.colors.$colorMutedForeground}),title:l?(0,s.localizationKeys)("organizationSwitcher.notSelected"):(0,s.localizationKeys)("organizationSwitcher.personalWorkspace")}),(0,o.tZ)(K,{}),(0,o.tZ)(s.Icon,{elementDescriptor:s.descriptors.organizationSwitcherTriggerIcon,icon:w._M,sx:e=>({marginLeft:`${e.space.$2}`})})]})})),K=()=>{let{userInvitations:e,userSuggestions:t}=(0,d.eW)(f.AO),{organizationSettings:i}=(0,c.useEnvironment)(),n=(0,m.N2)({permission:"org:sys_memberships:manage"}),r=i?.domains?.enabled,{membershipRequests:a}=(0,d.o8)({membershipRequests:r&&n||void 0}),s=(e.count||0)+(t.count||0)+(a?.count||0);return s?(0,o.tZ)(m.dN,{containerSx:e=>({position:"absolute",top:`calc(${e.space.$2} * -1)`,right:`calc(${e.space.$2} * -1)`}),notificationCount:s}):null},R=(0,r.withFloatingTree)(({children:e})=>{let{defaultOpen:t}=(0,c.useOrganizationSwitcherContext)(),{floating:i,reference:r,styles:s,toggle:d,isOpen:g,nodeId:p,context:u}=(0,l.Sv)({defaultOpen:t,placement:"bottom-start",offset:8}),h=(0,n.useId)();return(0,o.BX)(o.HY,{children:[(0,o.tZ)(F,{ref:r,onClick:d,isOpen:g,"aria-controls":g?h:void 0,"aria-expanded":g}),(0,o.tZ)(a.J,{nodeId:p,context:u,isOpen:g,children:(0,n.cloneElement)(e,{id:h,close:d,ref:i,style:s})})]})}),E=(0,c.withCoreUserGuard)((0,r.withCardStateProvider)(()=>{let{__experimental_asStandalone:e}=(0,c.useOrganizationSwitcherContext)();return(0,o.tZ)(s.Flow.Root,{flow:"organizationSwitcher",sx:{display:"inline-flex"},children:(0,o.tZ)(c.AcceptedInvitationsProvider,{children:e?(0,o.tZ)(_,{close:"function"==typeof e?e:void 0}):(0,o.tZ)(R,{children:(0,o.tZ)(_,{})})})})}))},57484:function(e,t,i){i.d(t,{AO:()=>o,Sz:()=>n});let o={userMemberships:{infinite:!0},userInvitations:{infinite:!0},userSuggestions:{infinite:!0,status:["pending","accepted"]}},n=(e,t,i)=>{if(void 0===t)return[{data:[e],total_count:1}];let o=t?.[t.length-1]?.total_count||1;return t.map(t=>{if(void 0===t)return t;let n=t.data.map(t=>t.id===e.id?{...e}:t);return{...t,data:n,total_count:"negative"===i?o-1:o}})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["4780"],{96061:function(t,e,i){i.r(e),i.d(e,{OrganizationSwitcher:()=>E});var o=i(73312),n=i(69144),r=i(2672),a=i(84045),c=i(11576),l=i(64204),s=i(65695),d=i(61869),u=i(42305),g=i(35973),p=i(62915),h=i(1151),z=i(96620),m=i(96231),v=i(53929),S=i(96519),w=i(24676);i(65223);var x=i(48774),f=i(88870),Z=i(51217),b=i(57484);let B=t=>{let e=(0,r.useCardState)(),{userSuggestions:i}=(0,d.eW)({userSuggestions:b.AO.userSuggestions});return"accepted"===t.status?(0,o.tZ)(l.Text,{colorScheme:"secondary",localizationKey:(0,l.localizationKeys)("organizationSwitcher.suggestionsAcceptedLabel")}):(0,o.tZ)(l.Button,{elementDescriptor:l.descriptors.organizationSwitcherInvitationAcceptButton,textVariant:"buttonSmall",variant:"outline",colorScheme:"neutral",size:"sm",isLoading:e.isLoading,onClick:()=>e.runAsync(t.accept).then(t=>{var e;return null==i||null==(e=i.setData)?void 0:e.call(i,e=>(0,b.Sz)(t,e))}).catch(t=>(0,f.S3)(t,[],e.setError)),localizationKey:(0,l.localizationKeys)("organizationSwitcher.action__suggestionsAccept")})},I=t=>{let e=(0,r.useCardState)();return(0,o.tZ)(l.Button,{elementDescriptor:l.descriptors.organizationSwitcherInvitationAcceptButton,textVariant:"buttonSmall",variant:"outline",colorScheme:"neutral",size:"xs",isLoading:e.isLoading,onClick:t.onAccept,localizationKey:(0,l.localizationKeys)("organizationSwitcher.action__invitationAccept")})},O=t=>{let{children:e,publicOrganizationData:i}=t;return(0,o.BX)(l.Flex,{align:"center",gap:2,sx:t=>({justifyContent:"space-between",padding:"".concat(t.space.$4," ").concat(t.space.$5)}),elementDescriptor:l.descriptors.organizationSwitcherPopoverInvitationActionsBox,children:[(0,o.tZ)(g.Z,{elementId:"organizationSwitcherListedOrganization",organization:i,sx:t=>({color:t.colors.$colorMutedForeground,":hover":{color:t.colors.$colorMutedForeground}})}),e]})},A=(0,r.withCardStateProvider)(t=>{var e;let{invitation:i,onOrganizationClick:n}=t,{accept:a,publicOrganizationData:s,status:u}=i,p=(0,r.useCardState)(),{getOrganization:h}=(0,d.cL)(),{organization:z}=(0,d.o8)(),{userInvitations:m}=(0,d.eW)({userInvitations:b.AO.userInvitations,userMemberships:b.AO.userMemberships}),{acceptedInvitations:v,setAcceptedInvitations:w}=(0,c.useAcceptedInvitations)(),Z=null==(e=v.find(t=>t.invitation.id===i.id))?void 0:e.organization;return"accepted"===u?i.publicOrganizationData.id===(null==z?void 0:z.id)||(null==Z?void 0:Z.id)&&(null==z?void 0:z.id)===Z.id?null:(0,o.tZ)(x.K,{elementDescriptor:l.descriptors.organizationSwitcherPreviewButton,icon:S.nR,onClick:Z?()=>n(Z):void 0,role:"menuitem",children:(0,o.tZ)(g.Z,{elementId:"organizationSwitcherListedOrganization",organization:s,sx:t=>({color:t.colors.$colorMutedForeground,":hover":{color:t.colors.$colorMutedForeground}})})}):(0,o.tZ)(O,{publicOrganizationData:s,children:(0,o.tZ)(I,{onAccept:()=>p.runAsync(async()=>[await a(),await h(s.id)]).then(t=>{var e;let[i,o]=t;null==m||null==(e=m.setData)||e.call(m,t=>(0,b.Sz)(i,t,"negative")),w(t=>[...t,{organization:o,invitation:i}])}).catch(t=>(0,f.S3)(t,[],p.setError))})})}),C=t=>{let{showBorder:e,...i}=t;return(0,o.tZ)(u.eX,{role:"menu",...i})},$=(0,r.withCardStateProvider)(t=>(0,o.tZ)(O,{publicOrganizationData:t.publicOrganizationData,children:(0,o.tZ)(B,{...t})})),P=t=>{var e,i;let{onOrganizationClick:n}=t,{ref:r,userSuggestions:a,userInvitations:c}=(()=>{let{userInvitations:t,userSuggestions:e}=(0,d.eW)(b.AO),{ref:i}=(0,s.YD)({threshold:0,onChange:i=>{var o,n;i&&(t.hasNextPage?null==(o=t.fetchNext)||o.call(t):null==(n=e.fetchNext)||n.call(e))}});return{userInvitations:t,userSuggestions:e,ref:i}})(),u=c.isLoading||a.isLoading,g=c.hasNextPage||a.hasNextPage,p=(null==(e=c.data)?void 0:e.filter(t=>!!t))||[],h=(null==(i=a.data)?void 0:i.filter(t=>!!t))||[],z=p.length>0||h.length>0;return z||u?(0,o.tZ)(C,{showBorder:z||u,elementDescriptor:l.descriptors.organizationSwitcherPopoverInvitationActions,children:(0,o.BX)(l.Box,{sx:t=>({maxHeight:"calc(4 * ".concat(t.sizes.$17," + 4px)"),overflowY:"auto",...Z.common.unstyledScrollbar(t)}),children:[null==p?void 0:p.map(t=>(0,o.tZ)(A,{invitation:t,onOrganizationClick:n},t.id)),!c.hasNextPage&&(null==h?void 0:h.map(t=>(0,o.tZ)($,{...t},t.id))),(g||u)&&(0,o.tZ)(m.q7,{ref:r})]})}):null},y=t=>{let{onPersonalWorkspaceClick:e,onOrganizationClick:i}=t,{hidePersonal:n}=(0,c.useOrganizationSwitcherContext)(),{organization:r}=(0,d.o8)(),{ref:a,userMemberships:u}=(()=>{let{userMemberships:t}=(0,d.eW)({userMemberships:b.AO.userMemberships}),{ref:e}=(0,s.YD)({threshold:0,onChange:e=>{if(e&&t.hasNextPage){var i;null==(i=t.fetchNext)||i.call(t)}}});return{userMemberships:t,ref:e}})(),{user:h}=(0,d.aF)(),z=((u.count||0)>0&&u.data||[]).map(t=>t.organization).filter(t=>t.id!==(null==r?void 0:r.id));if(!h)return null;let{username:v,primaryEmailAddress:w,primaryPhoneNumber:f,...B}=h,{isLoading:I,hasNextPage:O}=u;return(0,o.BX)(l.Box,{sx:t=>({maxHeight:"calc((4 * ".concat(t.sizes.$17,") + 4px)"),overflowY:"auto","> button,div":{border:"0 solid ".concat(t.colors.$borderAlpha100)},">:not([hidden])~:not([hidden])":{borderTopWidth:"1px",borderBottomWidth:"0"},...Z.common.unstyledScrollbar(t)}),role:"group","aria-label":n?"List of all organization memberships":"List of all accounts",children:[r&&!n&&(0,o.tZ)(x.K,{elementDescriptor:l.descriptors.organizationSwitcherPreviewButton,elementId:l.descriptors.organizationSwitcherPreviewButton.setId("personal"),icon:S.nR,onClick:e,role:"menuitem",children:(0,o.tZ)(p.g,{user:B,mainIdentifierVariant:"buttonLarge",title:(0,l.localizationKeys)("organizationSwitcher.personalWorkspace")})}),z.map(t=>(0,o.tZ)(x.K,{elementDescriptor:l.descriptors.organizationSwitcherPreviewButton,elementId:l.descriptors.organizationSwitcherPreviewButton.setId("organization"),icon:S.nR,onClick:()=>i(t),role:"menuitem",sx:t=>({border:"0 solid ".concat(t.colors.$borderAlpha100)}),children:(0,o.tZ)(g.Z,{elementId:"organizationSwitcherListedOrganization",organization:t})},t.id)),(O||I)&&(0,o.tZ)(m.q7,{ref:a})]})},D=t=>{let{onCreateOrganizationClick:e}=t,{user:i}=(0,d.aF)();return(null==i?void 0:i.createOrganizationEnabled)?(0,o.tZ)(u.aU,{elementDescriptor:l.descriptors.organizationSwitcherPopoverActionButton,elementId:l.descriptors.organizationSwitcherPopoverActionButton.setId("createOrganization"),iconBoxElementDescriptor:l.descriptors.organizationSwitcherPopoverActionButtonIconBox,iconBoxElementId:l.descriptors.organizationSwitcherPopoverActionButtonIconBox.setId("createOrganization"),iconElementDescriptor:l.descriptors.organizationSwitcherPopoverActionButtonIcon,iconElementId:l.descriptors.organizationSwitcherPopoverActionButtonIcon.setId("createOrganization"),icon:S.mm,label:(0,l.localizationKeys)("organizationSwitcher.action__createOrganization"),onClick:e,sx:t=>({padding:"".concat(t.space.$5," ").concat(t.space.$5)}),iconSx:t=>({width:t.sizes.$9,height:t.sizes.$6}),iconBoxSx:t=>({width:t.sizes.$9,height:t.sizes.$6}),spinnerSize:"sm"}):null},k=t=>{let{onCreateOrganizationClick:e,onPersonalWorkspaceClick:i,onOrganizationClick:n}=t;return(0,o.BX)(o.HY,{children:[(0,o.tZ)(P,{onOrganizationClick:n}),(0,o.tZ)(y,{onPersonalWorkspaceClick:i,onOrganizationClick:n}),(0,o.tZ)(D,{onCreateOrganizationClick:e})]})},_=n.forwardRef((t,e)=>{let{close:i,...n}=t,a=()=>null==i?void 0:i(!1),s=(0,r.useCardState)(),{__experimental_asStandalone:m}=(0,c.useOrganizationSwitcherContext)(),{openOrganizationProfile:x,openCreateOrganization:f}=(0,d.cL)(),{organization:Z}=(0,d.o8)(),{isLoaded:b,setActive:B}=(0,d.eW)(),I=(0,w.useRouter)(),{hidePersonal:O,__unstable_manageBillingUrl:A,__unstable_manageBillingLabel:C,__unstable_manageBillingMembersLimit:$,createOrganizationMode:P,organizationProfileMode:y,afterLeaveOrganizationUrl:D,afterCreateOrganizationUrl:_,navigateCreateOrganization:F,navigateOrganizationProfile:K,afterSelectOrganizationUrl:R,afterSelectPersonalUrl:E,organizationProfileProps:W,skipInvitationScreen:X,hideSlug:M}=(0,c.useOrganizationSwitcherContext)(),{user:N}=(0,d.aF)();if(!N)return null;let{username:T,primaryEmailAddress:U,primaryPhoneNumber:Y,...j}=N;if(!b)return null;let H=(0,o.tZ)(u.U8,{elementDescriptor:l.descriptors.organizationSwitcherPopoverActionButton,elementId:l.descriptors.organizationSwitcherPopoverActionButton.setId("manageOrganization"),iconBoxElementDescriptor:l.descriptors.organizationSwitcherPopoverActionButtonIconBox,iconBoxElementId:l.descriptors.organizationSwitcherPopoverActionButtonIconBox.setId("manageOrganization"),iconElementDescriptor:l.descriptors.organizationSwitcherPopoverActionButtonIcon,iconElementId:l.descriptors.organizationSwitcherPopoverActionButtonIcon.setId("manageOrganization"),icon:S.tc,label:(0,l.localizationKeys)("organizationSwitcher.action__manageOrganization"),onClick:()=>(a(),"navigation"===y)?K():x({...W,afterLeaveOrganizationUrl:D,__unstable_manageBillingUrl:A,__unstable_manageBillingLabel:C,__unstable_manageBillingMembersLimit:$}),trailing:(0,o.tZ)(L,{}),focusRing:!0}),V=(0,o.tZ)(u.U8,{icon:S.Nj,label:(0,z.OR)(C)||"Upgrade",onClick:()=>I.navigate((0,z.OR)(A)),focusRing:!0});return(0,o.tZ)(v.r,{elementDescriptor:l.descriptors.organizationSwitcherPopoverRootBox,children:(0,o.BX)(h.f.Root,{elementDescriptor:l.descriptors.organizationSwitcherPopoverCard,ref:e,role:"dialog","aria-label":"".concat(null==Z?void 0:Z.name," is active"),shouldEntryAnimate:!m,...n,children:[(0,o.tZ)(h.f.Content,{elementDescriptor:l.descriptors.organizationSwitcherPopoverMain,children:(0,o.BX)(u.eX,{elementDescriptor:l.descriptors.organizationSwitcherPopoverActions,role:"menu",children:[Z?A?(0,o.BX)(o.HY,{children:[(0,o.tZ)(g.Z,{elementId:"organizationSwitcherActiveOrganization",organization:Z,user:N,mainIdentifierVariant:"buttonLarge",sx:t=>({padding:"".concat(t.space.$4," ").concat(t.space.$5)})}),(0,o.tZ)(u.eX,{role:"menu",sx:t=>({borderBottomWidth:t.borderWidths.$normal,borderBottomStyle:t.borderStyles.$solid,borderBottomColor:t.colors.$borderAlpha100}),children:(0,o.BX)(l.Flex,{justify:"between",sx:t=>({marginLeft:t.space.$12,padding:"0 ".concat(t.space.$5," ").concat(t.space.$4),gap:t.space.$2}),children:[H,V]})})]}):(0,o.BX)(l.Flex,{justify:"between",align:"center",sx:t=>({width:"100%",paddingRight:t.space.$5}),children:[(0,o.tZ)(g.Z,{elementId:"organizationSwitcherActiveOrganization",organization:Z,user:N,mainIdentifierVariant:"buttonLarge",sx:t=>({padding:"".concat(t.space.$4," ").concat(t.space.$5)})}),(0,o.tZ)(u.eX,{role:"menu",children:H})]}):!O&&(0,o.tZ)(p.g,{user:j,sx:t=>({padding:"".concat(t.space.$4," ").concat(t.space.$5),width:"100%"}),title:(0,l.localizationKeys)("organizationSwitcher.personalWorkspace")}),(0,o.tZ)(k,{onCreateOrganizationClick:()=>(a(),"navigation"===P)?F():f({afterCreateOrganizationUrl:_,skipInvitationScreen:X,hideSlug:M}),onPersonalWorkspaceClick:()=>s.runAsync(()=>B({organization:null,redirectUrl:E(N)})).then(a),onOrganizationClick:t=>s.runAsync(()=>B({organization:t,redirectUrl:R(t)})).then(a)})]})}),(0,o.tZ)(h.f.Footer,{elementDescriptor:l.descriptors.organizationSwitcherPopoverFooter})]})})}),L=(0,m.Ci)(t=>{var e;let{sx:i}=t,{organizationSettings:n}=(0,c.useEnvironment)(),r=null==n||null==(e=n.domains)?void 0:e.enabled,{membershipRequests:a}=(0,d.o8)({membershipRequests:r||void 0});return(null==a?void 0:a.count)?(0,o.tZ)(m.dN,{notificationCount:a.count,containerSx:i}):null},{permission:"org:sys_memberships:manage"}),F=(0,i(77711).C)((0,n.forwardRef)((t,e)=>{let{sx:i,...n}=t,{user:r}=(0,d.aF)(),{organization:a}=(0,d.o8)(),{hidePersonal:s}=(0,c.useOrganizationSwitcherContext)(),{t:u}=(0,l.useLocalizations)();if(!r)return null;let{username:h,primaryEmailAddress:z,primaryPhoneNumber:m,...v}=r;return(0,o.BX)(l.Button,{elementDescriptor:l.descriptors.organizationSwitcherTrigger,elementId:l.descriptors.organizationSwitcherTrigger.setId(a?"organization":"personal"),variant:"ghost",colorScheme:"neutral",hoverAsFocus:!0,focusRing:!1,sx:[t=>({padding:"".concat(t.space.$1," ").concat(t.space.$2),position:"relative"}),i],ref:e,"aria-label":"".concat(u(t.isOpen?(0,l.localizationKeys)("organizationSwitcher.action__closeOrganizationSwitcher"):(0,l.localizationKeys)("organizationSwitcher.action__openOrganizationSwitcher"))),"aria-expanded":t.isOpen,"aria-haspopup":"dialog",...n,children:[a&&(0,o.tZ)(g.Z,{elementId:"organizationSwitcherTrigger",gap:3,size:"xs",organization:a,sx:{maxWidth:"30ch"}}),!a&&(0,o.tZ)(p.g,{size:"xs",gap:3,user:v,showAvatar:!s,sx:t=>({color:t.colors.$colorMutedForeground}),title:s?(0,l.localizationKeys)("organizationSwitcher.notSelected"):(0,l.localizationKeys)("organizationSwitcher.personalWorkspace")}),(0,o.tZ)(K,{}),(0,o.tZ)(l.Icon,{elementDescriptor:l.descriptors.organizationSwitcherTriggerIcon,icon:S._M,sx:t=>({marginLeft:"".concat(t.space.$2)})})]})})),K=()=>{var t;let{userInvitations:e,userSuggestions:i}=(0,d.eW)(b.AO),{organizationSettings:n}=(0,c.useEnvironment)(),r=(0,m.N2)({permission:"org:sys_memberships:manage"}),a=null==n||null==(t=n.domains)?void 0:t.enabled,{membershipRequests:l}=(0,d.o8)({membershipRequests:a&&r||void 0}),s=(e.count||0)+(i.count||0)+((null==l?void 0:l.count)||0);return s?(0,o.tZ)(m.dN,{containerSx:t=>({position:"absolute",top:"calc(".concat(t.space.$2," * -1)"),right:"calc(".concat(t.space.$2," * -1)")}),notificationCount:s}):null},R=(0,r.withFloatingTree)(t=>{let{children:e}=t,{defaultOpen:i}=(0,c.useOrganizationSwitcherContext)(),{floating:r,reference:l,styles:d,toggle:u,isOpen:g,nodeId:p,context:h}=(0,s.Sv)({defaultOpen:i,placement:"bottom-start",offset:8}),z=(0,n.useId)();return(0,o.BX)(o.HY,{children:[(0,o.tZ)(F,{ref:l,onClick:u,isOpen:g,"aria-controls":g?z:void 0,"aria-expanded":g}),(0,o.tZ)(a.J,{nodeId:p,context:h,isOpen:g,children:(0,n.cloneElement)(e,{id:z,close:u,ref:r,style:d})})]})}),E=(0,c.withCoreUserGuard)((0,r.withCardStateProvider)(()=>{let{__experimental_asStandalone:t}=(0,c.useOrganizationSwitcherContext)();return(0,o.tZ)(l.Flow.Root,{flow:"organizationSwitcher",sx:{display:"inline-flex"},children:(0,o.tZ)(c.AcceptedInvitationsProvider,{children:t?(0,o.tZ)(_,{close:"function"==typeof t?t:void 0}):(0,o.tZ)(R,{children:(0,o.tZ)(_,{})})})})}))},57484:function(t,e,i){i.d(e,{AO:()=>o,Sz:()=>n});let o={userMemberships:{infinite:!0},userInvitations:{infinite:!0},userSuggestions:{infinite:!0,status:["pending","accepted"]}},n=(t,e,i)=>{var o;if(void 0===e)return[{data:[t],total_count:1}];let n=(null==e||null==(o=e[e.length-1])?void 0:o.total_count)||1;return e.map(e=>{if(void 0===e)return e;let o=e.data.map(e=>e.id===t.id?{...t}:e);return{...e,data:o,total_count:"negative"===i?n-1:n}})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["8711"],{8317:function(e,t,r){r.r(t),r.d(t,{OrganizationPaymentAttemptPage:()=>n});var a=r(73312),o=r(11576),i=r(12264);let n=()=>(0,a.tZ)(o.SubscriberTypeContext.Provider,{value:"organization",children:(0,a.tZ)(i.PaymentAttemptPage,{})})},12264:function(e,t,r){r.r(t),r.d(t,{PaymentAttemptPage:()=>$,PaymentAttemptsList:()=>d});var a=r(73312),o=r(16600),i=r(39082),n=r(55913),l=r(11576),s=r(64204),c=r(24676);let d=()=>{let{data:e,isLoading:t,count:r}=(0,l.usePaymentAttempts)(),i=(0,l.useSubscriberTypeLocalizationRoot)();return(0,a.tZ)(o.wQ,{page:1,onPageChange:e=>{},itemCount:r,pageCount:1,itemsPerPage:10,isLoading:t,emptyStateLocalizationKey:(0,s.localizationKeys)(`${i}.billingPage.paymentHistorySection.empty`),headers:[(0,s.localizationKeys)(`${i}.billingPage.paymentHistorySection.tableHeader__date`),(0,s.localizationKeys)(`${i}.billingPage.paymentHistorySection.tableHeader__amount`),(0,s.localizationKeys)(`${i}.billingPage.paymentHistorySection.tableHeader__status`)],rows:e.map(e=>(0,a.tZ)(p,{paymentAttempt:e},e.id))})},p=({paymentAttempt:e})=>{let{id:t,amount:r,failedAt:l,paidAt:d,updatedAt:p,status:m}=e,{navigate:y}=(0,c.useRouter)();return(0,a.BX)(o.Uk,{onClick:()=>{y(`payment-attempt/${t}`)},children:[(0,a.BX)(s.Td,{sx:{cursor:"pointer"},children:[(0,a.tZ)(s.Text,{variant:"subtitle",children:(0,i.p)(d||l||p,"long")}),(0,a.tZ)(s.Text,{colorScheme:"secondary",variant:"caption",truncate:!0,sx:e=>({marginTop:e.space.$0x5}),children:(0,n.L)(t)})]}),(0,a.tZ)(s.Td,{sx:{cursor:"pointer"},children:(0,a.BX)(s.Text,{children:[r.currencySymbol,r.amountFormatted]})}),(0,a.tZ)(s.Td,{children:(0,a.tZ)(s.Badge,{colorScheme:"paid"===m?"success":"failed"===m?"danger":"primary",sx:{textTransform:"capitalize"},children:m})})]})};var m=r(61869),y=r(9117),u=r(92654),h=r(28e3),b=r(7439),g=r(65695),x=r(34174);let $=()=>{let{params:e,navigate:t}=(0,c.useRouter)(),r=(0,b.sC)(),o=(0,b.xr)(),{t:l,translateError:d}=(0,s.useLocalizations)(),{data:p,isLoading:h,error:g}=(0,m.bj)({paymentAttemptId:e.paymentAttemptId,for:"organization"===r?"organization":"user",enabled:!!e.paymentAttemptId}),x=p?.subscriptionItem;return h?(0,a.tZ)(s.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,a.tZ)(s.Spinner,{colorScheme:"primary",sx:{margin:"auto",display:"block"},elementDescriptor:s.descriptors.spinner})}):(0,a.BX)(a.HY,{children:[(0,a.tZ)(u.h.Root,{sx:e=>({borderBlockEndWidth:e.borderWidths.$normal,borderBlockEndStyle:e.borderStyles.$solid,borderBlockEndColor:e.colors.$borderAlpha100,marginBlockEnd:e.space.$4,paddingBlockEnd:e.space.$4}),children:(0,a.tZ)(u.h.BackLink,{onClick:()=>void t("../../",{searchParams:new URLSearchParams("tab=payments")}),children:(0,a.tZ)(u.h.Title,{localizationKey:(0,s.localizationKeys)(`${o}.billingPage.start.headerTitle__payments`),textVariant:"h2"})})}),p?(0,a.BX)(s.Box,{elementDescriptor:s.descriptors.paymentAttemptRoot,as:"article",sx:e=>({borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg,overflow:"clip"}),children:[(0,a.BX)(s.Box,{elementDescriptor:s.descriptors.paymentAttemptHeader,as:"header",sx:e=>({padding:e.space.$4,background:e.colors.$neutralAlpha25,display:"flex",justifyContent:"space-between",alignItems:"flex-start"}),children:[(0,a.BX)(s.Span,{elementDescriptor:s.descriptors.paymentAttemptHeaderTitleContainer,children:[(0,a.tZ)(s.Heading,{elementDescriptor:s.descriptors.paymentAttemptHeaderTitle,textVariant:"h2",localizationKey:(0,i.p)(p.paidAt||p.failedAt||p.updatedAt,"long")}),(0,a.BX)(s.Span,{sx:e=>({display:"flex",alignItems:"center",gap:e.space.$0x25,color:e.colors.$colorMutedForeground}),children:[(0,a.tZ)(S,{copyLabel:"Copy payment attempt ID",text:p.id}),(0,a.tZ)(s.Text,{colorScheme:"secondary",variant:"subtitle",children:(0,n.L)(p.id)})]})]}),(0,a.tZ)(s.Badge,{elementDescriptor:s.descriptors.paymentAttemptHeaderBadge,colorScheme:"paid"===p.status?"success":"failed"===p.status?"danger":"primary",sx:{textTransform:"capitalize"},children:p.status})]}),(0,a.tZ)(B,{subscriptionItem:x}),(0,a.BX)(s.Box,{elementDescriptor:s.descriptors.paymentAttemptFooter,as:"footer",sx:e=>({paddingInline:e.space.$4,paddingBlock:e.space.$3,background:e.colors.$neutralAlpha25,borderBlockStartWidth:e.borderWidths.$normal,borderBlockStartStyle:e.borderStyles.$solid,borderBlockStartColor:e.colors.$borderAlpha100,display:"flex",justifyContent:"space-between"}),children:[(0,a.tZ)(s.Text,{variant:"h3",localizationKey:(0,s.localizationKeys)("billing.totalDue"),elementDescriptor:s.descriptors.paymentAttemptFooterLabel}),(0,a.BX)(s.Span,{elementDescriptor:s.descriptors.paymentAttemptFooterValueContainer,sx:e=>({display:"flex",alignItems:"center",gap:e.space.$2x5}),children:[(0,a.tZ)(s.Text,{variant:"caption",colorScheme:"secondary",elementDescriptor:s.descriptors.paymentAttemptFooterCurrency,sx:{textTransform:"uppercase"},children:p.amount.currency}),(0,a.BX)(s.Text,{variant:"h3",elementDescriptor:s.descriptors.paymentAttemptFooterValue,children:[p.amount.currencySymbol,p.amount.amountFormatted]})]})]})]}):(0,a.tZ)(s.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,a.tZ)(y.b,{variant:"danger",colorScheme:"danger",children:g?d(g.errors[0]):l((0,s.localizationKeys)(`${o}.billingPage.paymentHistorySection.notFound`))})})]})};function B({subscriptionItem:e}){if(!e)return null;let t="month"===e.planPeriod?e.plan.fee:e.plan.annualMonthlyFee;return(0,a.tZ)(s.Box,{elementDescriptor:s.descriptors.paymentAttemptBody,sx:e=>({padding:e.space.$4}),children:(0,a.BX)(h.a.Root,{children:[(0,a.BX)(h.a.Group,{children:[(0,a.tZ)(h.a.Title,{title:e.plan.name}),(0,a.tZ)(h.a.Description,{prefix:"annual"===e.planPeriod?"x12":void 0,text:`${t.currencySymbol}${t.amountFormatted}`})]}),(0,a.BX)(h.a.Group,{borderTop:!0,variant:"tertiary",children:[(0,a.tZ)(h.a.Title,{title:(0,s.localizationKeys)("billing.subtotal")}),(0,a.tZ)(h.a.Description,{text:`${e.amount?.currencySymbol}${e.amount?.amountFormatted}`})]}),e.credits&&e.credits.proration&&e.credits.proration.amount.amount>0&&(0,a.BX)(h.a.Group,{variant:"tertiary",children:[(0,a.tZ)(h.a.Title,{title:(0,s.localizationKeys)("billing.prorationCredit")}),(0,a.tZ)(h.a.Description,{text:`- ${e.credits.proration.amount.currencySymbol}${e.credits.proration.amount.amountFormatted}`})]}),e.credits&&e.credits.payer&&e.credits.payer.appliedAmount.amount>0&&(0,a.BX)(h.a.Group,{variant:"tertiary",children:[(0,a.tZ)(h.a.Title,{title:(0,s.localizationKeys)("billing.accountCredit")}),(0,a.tZ)(h.a.Description,{text:`- ${e.credits.payer.appliedAmount.currencySymbol}${e.credits.payer.appliedAmount.amountFormatted}`})]})]})})}function S({text:e,copyLabel:t="Copy"}){let{onCopy:r,hasCopied:o}=(0,g.VP)(e);return(0,a.tZ)(s.Button,{elementDescriptor:s.descriptors.paymentAttemptCopyButton,variant:"unstyled",onClick:r,sx:e=>({color:"inherit",width:e.sizes.$4,height:e.sizes.$4,padding:0,borderRadius:e.radii.$sm,"&:focus-visible":{outline:"2px solid",outlineColor:e.colors.$colorRing}}),focusRing:!1,"aria-label":o?"Copied":t,children:(0,a.tZ)(s.Icon,{size:"sm",icon:o?x.Jr:x.CK,"aria-hidden":!0})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["8711"],{8317:function(t,e,r){r.r(e),r.d(e,{OrganizationPaymentAttemptPage:()=>i});var a=r(73312),o=r(11576),n=r(12264);let i=()=>(0,a.tZ)(o.SubscriberTypeContext.Provider,{value:"organization",children:(0,a.tZ)(n.PaymentAttemptPage,{})})},12264:function(t,e,r){r.r(e),r.d(e,{PaymentAttemptPage:()=>B,PaymentAttemptsList:()=>d});var a=r(73312),o=r(16600),n=r(39082),i=r(55913),l=r(11576),c=r(64204),s=r(24676);let d=()=>{let{data:t,isLoading:e,count:r}=(0,l.usePaymentAttempts)(),n=(0,l.useSubscriberTypeLocalizationRoot)();return(0,a.tZ)(o.wQ,{page:1,onPageChange:t=>{},itemCount:r,pageCount:1,itemsPerPage:10,isLoading:e,emptyStateLocalizationKey:(0,c.localizationKeys)("".concat(n,".billingPage.paymentHistorySection.empty")),headers:[(0,c.localizationKeys)("".concat(n,".billingPage.paymentHistorySection.tableHeader__date")),(0,c.localizationKeys)("".concat(n,".billingPage.paymentHistorySection.tableHeader__amount")),(0,c.localizationKeys)("".concat(n,".billingPage.paymentHistorySection.tableHeader__status"))],rows:t.map(t=>(0,a.tZ)(p,{paymentAttempt:t},t.id))})},p=t=>{let{paymentAttempt:e}=t,{id:r,amount:l,failedAt:d,paidAt:p,updatedAt:m,status:u}=e,{navigate:y}=(0,s.useRouter)();return(0,a.BX)(o.Uk,{onClick:()=>{y("payment-attempt/".concat(r))},children:[(0,a.BX)(c.Td,{sx:{cursor:"pointer"},children:[(0,a.tZ)(c.Text,{variant:"subtitle",children:(0,n.p)(p||d||m,"long")}),(0,a.tZ)(c.Text,{colorScheme:"secondary",variant:"caption",truncate:!0,sx:t=>({marginTop:t.space.$0x5}),children:(0,i.L)(r)})]}),(0,a.tZ)(c.Td,{sx:{cursor:"pointer"},children:(0,a.BX)(c.Text,{children:[l.currencySymbol,l.amountFormatted]})}),(0,a.tZ)(c.Td,{children:(0,a.tZ)(c.Badge,{colorScheme:"paid"===u?"success":"failed"===u?"danger":"primary",sx:{textTransform:"capitalize"},children:u})})]})};r(45261),r(70957),r(24551),r(22349),r(65223);var m=r(61869),u=r(9117),y=r(92654),h=r(28e3),b=r(7439),g=r(65695),x=r(96519);let B=()=>{let{params:t,navigate:e}=(0,s.useRouter)(),r=(0,b.sC)(),o=(0,b.xr)(),{t:l,translateError:d}=(0,c.useLocalizations)(),{data:p,isLoading:h,error:g}=(0,m.bj)({paymentAttemptId:t.paymentAttemptId,for:"organization"===r?"organization":"user",enabled:!!t.paymentAttemptId}),x=null==p?void 0:p.subscriptionItem;return h?(0,a.tZ)(c.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,a.tZ)(c.Spinner,{colorScheme:"primary",sx:{margin:"auto",display:"block"},elementDescriptor:c.descriptors.spinner})}):(0,a.BX)(a.HY,{children:[(0,a.tZ)(y.h.Root,{sx:t=>({borderBlockEndWidth:t.borderWidths.$normal,borderBlockEndStyle:t.borderStyles.$solid,borderBlockEndColor:t.colors.$borderAlpha100,marginBlockEnd:t.space.$4,paddingBlockEnd:t.space.$4}),children:(0,a.tZ)(y.h.BackLink,{onClick:()=>void e("../../",{searchParams:new URLSearchParams("tab=payments")}),children:(0,a.tZ)(y.h.Title,{localizationKey:(0,c.localizationKeys)("".concat(o,".billingPage.start.headerTitle__payments")),textVariant:"h2"})})}),p?(0,a.BX)(c.Box,{elementDescriptor:c.descriptors.paymentAttemptRoot,as:"article",sx:t=>({borderWidth:t.borderWidths.$normal,borderStyle:t.borderStyles.$solid,borderColor:t.colors.$borderAlpha100,borderRadius:t.radii.$lg,overflow:"clip"}),children:[(0,a.BX)(c.Box,{elementDescriptor:c.descriptors.paymentAttemptHeader,as:"header",sx:t=>({padding:t.space.$4,background:t.colors.$neutralAlpha25,display:"flex",justifyContent:"space-between",alignItems:"flex-start"}),children:[(0,a.BX)(c.Span,{elementDescriptor:c.descriptors.paymentAttemptHeaderTitleContainer,children:[(0,a.tZ)(c.Heading,{elementDescriptor:c.descriptors.paymentAttemptHeaderTitle,textVariant:"h2",localizationKey:(0,n.p)(p.paidAt||p.failedAt||p.updatedAt,"long")}),(0,a.BX)(c.Span,{sx:t=>({display:"flex",alignItems:"center",gap:t.space.$0x25,color:t.colors.$colorMutedForeground}),children:[(0,a.tZ)(Z,{copyLabel:"Copy payment attempt ID",text:p.id}),(0,a.tZ)(c.Text,{colorScheme:"secondary",variant:"subtitle",children:(0,i.L)(p.id)})]})]}),(0,a.tZ)(c.Badge,{elementDescriptor:c.descriptors.paymentAttemptHeaderBadge,colorScheme:"paid"===p.status?"success":"failed"===p.status?"danger":"primary",sx:{textTransform:"capitalize"},children:p.status})]}),(0,a.tZ)(S,{subscriptionItem:x}),(0,a.BX)(c.Box,{elementDescriptor:c.descriptors.paymentAttemptFooter,as:"footer",sx:t=>({paddingInline:t.space.$4,paddingBlock:t.space.$3,background:t.colors.$neutralAlpha25,borderBlockStartWidth:t.borderWidths.$normal,borderBlockStartStyle:t.borderStyles.$solid,borderBlockStartColor:t.colors.$borderAlpha100,display:"flex",justifyContent:"space-between"}),children:[(0,a.tZ)(c.Text,{variant:"h3",localizationKey:(0,c.localizationKeys)("billing.totalDue"),elementDescriptor:c.descriptors.paymentAttemptFooterLabel}),(0,a.BX)(c.Span,{elementDescriptor:c.descriptors.paymentAttemptFooterValueContainer,sx:t=>({display:"flex",alignItems:"center",gap:t.space.$2x5}),children:[(0,a.tZ)(c.Text,{variant:"caption",colorScheme:"secondary",elementDescriptor:c.descriptors.paymentAttemptFooterCurrency,sx:{textTransform:"uppercase"},children:p.amount.currency}),(0,a.BX)(c.Text,{variant:"h3",elementDescriptor:c.descriptors.paymentAttemptFooterValue,children:[p.amount.currencySymbol,p.amount.amountFormatted]})]})]})]}):(0,a.tZ)(c.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,a.tZ)(u.b,{variant:"danger",colorScheme:"danger",children:g?d(g.errors[0]):l((0,c.localizationKeys)("".concat(o,".billingPage.paymentHistorySection.notFound")))})})]})};function S(t){var e,r;let{subscriptionItem:o}=t;if(!o)return null;let n="month"===o.planPeriod?o.plan.fee:o.plan.annualMonthlyFee;return(0,a.tZ)(c.Box,{elementDescriptor:c.descriptors.paymentAttemptBody,sx:t=>({padding:t.space.$4}),children:(0,a.BX)(h.a.Root,{children:[(0,a.BX)(h.a.Group,{children:[(0,a.tZ)(h.a.Title,{title:o.plan.name}),(0,a.tZ)(h.a.Description,{prefix:"annual"===o.planPeriod?"x12":void 0,text:"".concat(n.currencySymbol).concat(n.amountFormatted)})]}),(0,a.BX)(h.a.Group,{borderTop:!0,variant:"tertiary",children:[(0,a.tZ)(h.a.Title,{title:(0,c.localizationKeys)("billing.subtotal")}),(0,a.tZ)(h.a.Description,{text:"".concat(null==(e=o.amount)?void 0:e.currencySymbol).concat(null==(r=o.amount)?void 0:r.amountFormatted)})]}),o.credits&&o.credits.proration&&o.credits.proration.amount.amount>0&&(0,a.BX)(h.a.Group,{variant:"tertiary",children:[(0,a.tZ)(h.a.Title,{title:(0,c.localizationKeys)("billing.prorationCredit")}),(0,a.tZ)(h.a.Description,{text:"- ".concat(o.credits.proration.amount.currencySymbol).concat(o.credits.proration.amount.amountFormatted)})]}),o.credits&&o.credits.payer&&o.credits.payer.appliedAmount.amount>0&&(0,a.BX)(h.a.Group,{variant:"tertiary",children:[(0,a.tZ)(h.a.Title,{title:(0,c.localizationKeys)("billing.accountCredit")}),(0,a.tZ)(h.a.Description,{text:"- ".concat(o.credits.payer.appliedAmount.currencySymbol).concat(o.credits.payer.appliedAmount.amountFormatted)})]})]})})}function Z(t){let{text:e,copyLabel:r="Copy"}=t,{onCopy:o,hasCopied:n}=(0,g.VP)(e);return(0,a.tZ)(c.Button,{elementDescriptor:c.descriptors.paymentAttemptCopyButton,variant:"unstyled",onClick:o,sx:t=>({color:"inherit",width:t.sizes.$4,height:t.sizes.$4,padding:0,borderRadius:t.radii.$sm,"&:focus-visible":{outline:"2px solid",outlineColor:t.colors.$colorRing}}),focusRing:!1,"aria-label":n?"Copied":r,children:(0,a.tZ)(c.Icon,{size:"sm",icon:n?x.Jr:x.CK,"aria-hidden":!0})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["1033"],{65207:function(e,t,r){r.r(t),r.d(t,{PlanDetails:()=>m});var l=r(73312),a=r(61869),i=r(69144),n=r(9117),o=r(29629),s=r(81102),c=r(67322),p=r(11576),d=r(64204);let m=e=>(0,l.tZ)(d.Flow.Root,{flow:"planDetails",children:(0,l.tZ)(d.Flow.Part,{children:(0,l.tZ)(s.Drawer.Content,{children:(0,l.tZ)(D,{...e})})})}),u=({children:e})=>(0,l.tZ)(s.Drawer.Body,{sx:e=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,overflowY:"auto",padding:e.space.$4,gap:e.space.$4}),children:e}),h=({error:e})=>{let{translateError:t}=(0,d.useLocalizations)();return(0,l.tZ)(u,{children:(0,l.tZ)(n.b,{variant:"danger",colorScheme:"danger",children:t(e.errors[0])})})},D=({planId:e,plan:t,initialPlanPeriod:r="month"})=>{let[n,c]=(0,i.useState)(r),{data:m,isLoading:D,error:x}=(0,a.Fv)({planId:e,initialPlan:t,enabled:!!(e||t?.id)});if(D&&!t)return(0,l.tZ)(u,{children:(0,l.tZ)(d.Spinner,{})});if(!m&&x)return(0,l.tZ)(h,{error:x});if(!m)return null;let y=m.features,f=y.length>0;return(0,l.BX)(p.SubscriberTypeContext.Provider,{value:"org"===m.forPayerType?"organization":"user",children:[(0,l.tZ)(s.Drawer.Header,{sx:e=>f?null:{flex:1,borderBottomWidth:0,background:e.colors.$colorBackground},children:(0,l.tZ)(g,{plan:m,planPeriod:n,setPlanPeriod:c,closeSlot:(0,l.tZ)(s.Drawer.Close,{})})}),f?(0,l.BX)(s.Drawer.Body,{children:[(0,l.tZ)(d.Text,{elementDescriptor:d.descriptors.planDetailCaption,variant:"caption",localizationKey:(0,d.localizationKeys)("billing.availableFeatures"),colorScheme:"secondary",sx:e=>({padding:e.space.$4,paddingBottom:0})}),(0,l.tZ)(d.Box,{elementDescriptor:d.descriptors.planDetailFeaturesList,as:"ul",role:"list",sx:e=>({display:"grid",rowGap:e.space.$6,padding:e.space.$4,margin:0}),children:y.map(e=>(0,l.BX)(d.Box,{elementDescriptor:d.descriptors.planDetailFeaturesListItem,as:"li",sx:e=>({display:"flex",alignItems:"baseline",gap:e.space.$3}),children:[e.avatarUrl?(0,l.tZ)(o.q,{size:e=>24,title:e.name,initials:e.name[0],rounded:!1,imageUrl:e.avatarUrl}):null,(0,l.BX)(d.Span,{elementDescriptor:d.descriptors.planDetailFeaturesListItemContent,children:[(0,l.tZ)(d.Text,{elementDescriptor:d.descriptors.planDetailFeaturesListItemTitle,colorScheme:"body",sx:e=>({fontWeight:e.fontWeights.$medium}),children:e.name}),e.description?(0,l.tZ)(d.Text,{elementDescriptor:d.descriptors.planDetailFeaturesListItemDescription,colorScheme:"secondary",sx:e=>({marginBlockStart:e.space.$0x25}),children:e.description}):null]})]},e.id))})]}):null]})},g=i.forwardRef((e,t)=>{let{plan:r,closeSlot:a,planPeriod:n,setPlanPeriod:s}=e,m=(0,i.useMemo)(()=>r.annualMonthlyFee&&"annual"===n?r.annualMonthlyFee:r.fee,[r,n]),u=i.useMemo(()=>(0,p.normalizeFormatted)(m.amountFormatted),[m.amountFormatted]);return(0,l.BX)(d.Box,{ref:t,elementDescriptor:d.descriptors.planDetailHeader,sx:e=>({width:"100%",padding:e.space.$4,position:"relative"}),children:[a?(0,l.tZ)(d.Box,{sx:e=>({position:"absolute",top:e.space.$2,insetInlineEnd:e.space.$2}),children:a}):null,(0,l.BX)(d.Col,{gap:3,elementDescriptor:d.descriptors.planDetailBadgeAvatarTitleDescriptionContainer,children:[r.avatarUrl?(0,l.tZ)(o.q,{boxElementDescriptor:d.descriptors.planDetailAvatar,size:e=>40,title:r.name,initials:r.name[0],rounded:!1,imageUrl:r.avatarUrl,sx:e=>({marginBlockEnd:e.space.$3})}):null,(0,l.BX)(d.Col,{gap:1,elementDescriptor:d.descriptors.planDetailTitleDescriptionContainer,children:[(0,l.tZ)(d.Heading,{elementDescriptor:d.descriptors.planDetailTitle,as:"h2",textVariant:"h2",children:r.name}),r.description?(0,l.tZ)(d.Text,{elementDescriptor:d.descriptors.planDetailDescription,variant:"subtitle",colorScheme:"secondary",children:r.description}):null]})]}),(0,l.tZ)(d.Flex,{elementDescriptor:d.descriptors.planDetailFeeContainer,align:"center",wrap:"wrap",sx:e=>({marginTop:e.space.$3,columnGap:e.space.$1x5}),children:(0,l.BX)(l.HY,{children:[(0,l.BX)(d.Text,{elementDescriptor:d.descriptors.planDetailFee,variant:"h1",colorScheme:"body",children:[m.currencySymbol,u]}),(0,l.tZ)(d.Text,{elementDescriptor:d.descriptors.planDetailFeePeriod,variant:"caption",colorScheme:"secondary",sx:e=>({textTransform:"lowercase",":before":{content:'"/"',marginInlineEnd:e.space.$1}}),localizationKey:(0,d.localizationKeys)("billing.month")})]})}),r.annualMonthlyFee&&!r.isDefault?(0,l.tZ)(d.Box,{elementDescriptor:d.descriptors.planDetailPeriodToggle,sx:e=>({display:"flex",marginTop:e.space.$3}),children:(0,l.tZ)(c.r,{isChecked:"annual"===n,onChange:e=>s(e?"annual":"month"),label:(0,d.localizationKeys)("billing.billedAnnually")})}):(0,l.tZ)(d.Text,{elementDescriptor:d.descriptors.pricingTableCardFeePeriodNotice,variant:"caption",colorScheme:"secondary",localizationKey:r.isDefault?(0,d.localizationKeys)("billing.alwaysFree"):(0,d.localizationKeys)("billing.billedMonthlyOnly"),sx:e=>({justifySelf:"flex-start",alignSelf:"center",marginTop:e.space.$3})})]})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["1033"],{65207:function(e,t,r){r.r(t),r.d(t,{PlanDetails:()=>m}),r(65223);var l=r(73312),a=r(61869),i=r(69144),n=r(9117),o=r(29629),s=r(81102),c=r(67322),p=r(11576),d=r(64204);let m=e=>(0,l.tZ)(d.Flow.Root,{flow:"planDetails",children:(0,l.tZ)(d.Flow.Part,{children:(0,l.tZ)(s.Drawer.Content,{children:(0,l.tZ)(D,{...e})})})}),u=e=>{let{children:t}=e;return(0,l.tZ)(s.Drawer.Body,{sx:e=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,overflowY:"auto",padding:e.space.$4,gap:e.space.$4}),children:t})},h=e=>{let{error:t}=e,{translateError:r}=(0,d.useLocalizations)();return(0,l.tZ)(u,{children:(0,l.tZ)(n.b,{variant:"danger",colorScheme:"danger",children:r(t.errors[0])})})},D=e=>{let{planId:t,plan:r,initialPlanPeriod:n="month"}=e,[c,m]=(0,i.useState)(n),{data:D,isLoading:x,error:y}=(0,a.Fv)({planId:t,initialPlan:r,enabled:!!(t||(null==r?void 0:r.id))});if(x&&!r)return(0,l.tZ)(u,{children:(0,l.tZ)(d.Spinner,{})});if(!D&&y)return(0,l.tZ)(h,{error:y});if(!D)return null;let f=D.features,b=f.length>0;return(0,l.BX)(p.SubscriberTypeContext.Provider,{value:"org"===D.forPayerType?"organization":"user",children:[(0,l.tZ)(s.Drawer.Header,{sx:e=>b?null:{flex:1,borderBottomWidth:0,background:e.colors.$colorBackground},children:(0,l.tZ)(g,{plan:D,planPeriod:c,setPlanPeriod:m,closeSlot:(0,l.tZ)(s.Drawer.Close,{})})}),b?(0,l.BX)(s.Drawer.Body,{children:[(0,l.tZ)(d.Text,{elementDescriptor:d.descriptors.planDetailCaption,variant:"caption",localizationKey:(0,d.localizationKeys)("billing.availableFeatures"),colorScheme:"secondary",sx:e=>({padding:e.space.$4,paddingBottom:0})}),(0,l.tZ)(d.Box,{elementDescriptor:d.descriptors.planDetailFeaturesList,as:"ul",role:"list",sx:e=>({display:"grid",rowGap:e.space.$6,padding:e.space.$4,margin:0}),children:f.map(e=>(0,l.BX)(d.Box,{elementDescriptor:d.descriptors.planDetailFeaturesListItem,as:"li",sx:e=>({display:"flex",alignItems:"baseline",gap:e.space.$3}),children:[e.avatarUrl?(0,l.tZ)(o.q,{size:e=>24,title:e.name,initials:e.name[0],rounded:!1,imageUrl:e.avatarUrl}):null,(0,l.BX)(d.Span,{elementDescriptor:d.descriptors.planDetailFeaturesListItemContent,children:[(0,l.tZ)(d.Text,{elementDescriptor:d.descriptors.planDetailFeaturesListItemTitle,colorScheme:"body",sx:e=>({fontWeight:e.fontWeights.$medium}),children:e.name}),e.description?(0,l.tZ)(d.Text,{elementDescriptor:d.descriptors.planDetailFeaturesListItemDescription,colorScheme:"secondary",sx:e=>({marginBlockStart:e.space.$0x25}),children:e.description}):null]})]},e.id))})]}):null]})},g=i.forwardRef((e,t)=>{let{plan:r,closeSlot:a,planPeriod:n,setPlanPeriod:s}=e,m=(0,i.useMemo)(()=>r.annualMonthlyFee&&"annual"===n?r.annualMonthlyFee:r.fee,[r,n]),u=i.useMemo(()=>(0,p.normalizeFormatted)(m.amountFormatted),[m.amountFormatted]);return(0,l.BX)(d.Box,{ref:t,elementDescriptor:d.descriptors.planDetailHeader,sx:e=>({width:"100%",padding:e.space.$4,position:"relative"}),children:[a?(0,l.tZ)(d.Box,{sx:e=>({position:"absolute",top:e.space.$2,insetInlineEnd:e.space.$2}),children:a}):null,(0,l.BX)(d.Col,{gap:3,elementDescriptor:d.descriptors.planDetailBadgeAvatarTitleDescriptionContainer,children:[r.avatarUrl?(0,l.tZ)(o.q,{boxElementDescriptor:d.descriptors.planDetailAvatar,size:e=>40,title:r.name,initials:r.name[0],rounded:!1,imageUrl:r.avatarUrl,sx:e=>({marginBlockEnd:e.space.$3})}):null,(0,l.BX)(d.Col,{gap:1,elementDescriptor:d.descriptors.planDetailTitleDescriptionContainer,children:[(0,l.tZ)(d.Heading,{elementDescriptor:d.descriptors.planDetailTitle,as:"h2",textVariant:"h2",children:r.name}),r.description?(0,l.tZ)(d.Text,{elementDescriptor:d.descriptors.planDetailDescription,variant:"subtitle",colorScheme:"secondary",children:r.description}):null]})]}),(0,l.tZ)(d.Flex,{elementDescriptor:d.descriptors.planDetailFeeContainer,align:"center",wrap:"wrap",sx:e=>({marginTop:e.space.$3,columnGap:e.space.$1x5}),children:(0,l.BX)(l.HY,{children:[(0,l.BX)(d.Text,{elementDescriptor:d.descriptors.planDetailFee,variant:"h1",colorScheme:"body",children:[m.currencySymbol,u]}),(0,l.tZ)(d.Text,{elementDescriptor:d.descriptors.planDetailFeePeriod,variant:"caption",colorScheme:"secondary",sx:e=>({textTransform:"lowercase",":before":{content:'"/"',marginInlineEnd:e.space.$1}}),localizationKey:(0,d.localizationKeys)("billing.month")})]})}),r.annualMonthlyFee&&!r.isDefault?(0,l.tZ)(d.Box,{elementDescriptor:d.descriptors.planDetailPeriodToggle,sx:e=>({display:"flex",marginTop:e.space.$3}),children:(0,l.tZ)(c.r,{isChecked:"annual"===n,onChange:e=>s(e?"annual":"month"),label:(0,d.localizationKeys)("billing.billedAnnually")})}):(0,l.tZ)(d.Text,{elementDescriptor:d.descriptors.pricingTableCardFeePeriodNotice,variant:"caption",colorScheme:"secondary",localizationKey:r.isDefault?(0,d.localizationKeys)("billing.alwaysFree"):(0,d.localizationKeys)("billing.billedMonthlyOnly"),sx:e=>({justifySelf:"flex-start",alignSelf:"center",marginTop:e.space.$3})})]})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["2211"],{57484:function(t,e,n){n.d(e,{AO:()=>i,Sz:()=>r});let i={userMemberships:{infinite:!0},userInvitations:{infinite:!0},userSuggestions:{infinite:!0,status:["pending","accepted"]}},r=(t,e,n)=>{if(void 0===e)return[{data:[t],total_count:1}];let i=e?.[e.length-1]?.total_count||1;return e.map(e=>{if(void 0===e)return e;let r=e.data.map(e=>e.id===t.id?{...t}:e);return{...e,data:r,total_count:"negative"===n?i-1:i}})}},66703:function(t,e,n){n.r(e),n.d(e,{OrganizationSwitcherPrefetch:()=>a});var i=n(61869),r=n(57484);function a(){return(0,i.eW)(r.AO),null}}}]);
|