@asgardeo/react 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/contexts/Asgardeo/AsgardeoProvider.tsx", "../src/contexts/Asgardeo/AsgardeoContext.ts", "../src/AsgardeoReactClient.ts", "../src/__temp__/api.ts", "../src/api/getMeOrganizations.ts", "../src/api/getScim2Me.ts", "../src/api/getSchemas.ts", "../src/api/getAllOrganizations.ts", "../src/hooks/useBrowserUrl.ts", "../src/contexts/Flow/FlowProvider.tsx", "../src/contexts/Flow/FlowContext.ts", "../src/contexts/I18n/I18nProvider.tsx", "../src/contexts/I18n/I18nContext.ts", "../src/contexts/Organization/OrganizationProvider.tsx", "../src/contexts/Organization/OrganizationContext.ts", "../src/contexts/Theme/ThemeProvider.tsx", "../src/contexts/Theme/ThemeContext.ts", "../src/contexts/Branding/useBrandingContext.ts", "../src/contexts/Branding/BrandingContext.ts", "../src/contexts/Branding/BrandingProvider.tsx", "../src/contexts/User/UserProvider.tsx", "../src/contexts/User/UserContext.ts", "../src/contexts/Asgardeo/useAsgardeo.ts", "../src/contexts/User/useUser.ts", "../src/contexts/Organization/useOrganization.ts", "../src/contexts/Flow/useFlow.ts", "../src/contexts/I18n/useI18n.ts", "../src/contexts/Theme/useTheme.ts", "../src/hooks/useTranslation.ts", "../src/hooks/useForm.ts", "../src/hooks/useBranding.ts", "../src/components/actions/SignInButton/BaseSignInButton.tsx", "../src/components/primitives/Button/Button.tsx", "../src/components/primitives/Spinner/Spinner.tsx", "../src/components/actions/SignInButton/SignInButton.tsx", "../src/components/actions/SignOutButton/BaseSignOutButton.tsx", "../src/components/actions/SignOutButton/SignOutButton.tsx", "../src/components/actions/SignUpButton/BaseSignUpButton.tsx", "../src/components/actions/SignUpButton/SignUpButton.tsx", "../src/components/control/SignedIn.tsx", "../src/components/control/SignedOut.tsx", "../src/components/control/AsgardeoLoading.tsx", "../src/components/presentation/SignIn/BaseSignIn.tsx", "../src/components/presentation/SignIn/options/SignInOptionFactory.tsx", "../src/components/presentation/SignIn/options/UsernamePassword.tsx", "../src/components/primitives/TextField/TextField.tsx", "../src/components/primitives/Typography/Typography.tsx", "../src/components/primitives/FormControl/FormControl.tsx", "../src/components/primitives/InputLabel/InputLabel.tsx", "../src/components/primitives/Select/Select.tsx", "../src/components/primitives/OtpField/OtpField.tsx", "../src/components/primitives/PasswordField/PasswordField.tsx", "../src/components/primitives/Icons/Eye.tsx", "../src/components/primitives/Icons/EyeOff.tsx", "../src/components/primitives/DatePicker/DatePicker.tsx", "../src/components/primitives/Checkbox/Checkbox.tsx", "../src/components/factories/FieldFactory.tsx", "../src/components/presentation/SignIn/options/IdentifierFirst.tsx", "../src/components/presentation/SignIn/options/GoogleButton.tsx", "../src/components/presentation/SignIn/options/GitHubButton.tsx", "../src/components/presentation/SignIn/options/MicrosoftButton.tsx", "../src/components/presentation/SignIn/options/FacebookButton.tsx", "../src/components/presentation/SignIn/options/LinkedInButton.tsx", "../src/components/presentation/SignIn/options/SignInWithEthereumButton.tsx", "../src/components/presentation/SignIn/options/EmailOtp.tsx", "../src/components/presentation/SignIn/options/Totp.tsx", "../src/components/presentation/SignIn/options/SmsOtp.tsx", "../src/components/presentation/SignIn/options/SocialButton.tsx", "../src/components/presentation/SignIn/options/MultiOptionButton.tsx", "../src/components/primitives/Alert/Alert.tsx", "../src/components/primitives/Icons/CircleCheck.tsx", "../src/components/primitives/Icons/CircleAlert.tsx", "../src/components/primitives/Icons/TriangleAlert.tsx", "../src/components/primitives/Icons/Info.tsx", "../src/components/primitives/Card/Card.tsx", "../src/components/primitives/Divider/Divider.tsx", "../src/components/primitives/Logo/Logo.tsx", "../src/components/presentation/SignIn/SignIn.tsx", "../src/components/presentation/SignUp/BaseSignUp.tsx", "../src/components/presentation/SignUp/options/SignUpOptionFactory.tsx", "../src/components/presentation/SignUp/options/CheckboxInput.tsx", "../src/components/presentation/SignUp/options/DateInput.tsx", "../src/components/presentation/SignUp/options/DividerComponent.tsx", "../src/components/presentation/SignUp/options/EmailInput.tsx", "../src/components/presentation/SignUp/options/FormContainer.tsx", "../src/components/presentation/SignUp/options/GoogleButton.tsx", "../src/components/presentation/SignUp/options/ImageComponent.tsx", "../src/components/presentation/SignUp/options/NumberInput.tsx", "../src/components/presentation/SignUp/options/PasswordInput.tsx", "../src/components/presentation/SignUp/options/SubmitButton.tsx", "../src/components/presentation/SignUp/options/TelephoneInput.tsx", "../src/components/presentation/SignUp/options/TextInput.tsx", "../src/components/presentation/SignUp/options/Typography.tsx", "../src/components/presentation/SignUp/SignUp.tsx", "../src/components/presentation/User/BaseUser.tsx", "../src/components/presentation/User/User.tsx", "../src/components/presentation/Organization/BaseOrganization.tsx", "../src/components/presentation/Organization/Organization.tsx", "../src/components/presentation/UserProfile/BaseUserProfile.tsx", "../src/utils/getMappedUserProfileValue.ts", "../src/components/primitives/Avatar/Avatar.tsx", "../src/components/primitives/Popover/Popover.tsx", "../src/components/primitives/Icons/LogOut.tsx", "../src/components/primitives/Icons/Plus.tsx", "../src/components/primitives/Icons/User.tsx", "../src/components/primitives/Icons/X.tsx", "../src/components/primitives/MultiInput/MultiInput.tsx", "../src/api/updateMeProfile.ts", "../src/components/presentation/UserProfile/UserProfile.tsx", "../src/components/presentation/UserDropdown/BaseUserDropdown.tsx", "../src/components/presentation/UserDropdown/UserDropdown.tsx", "../src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx", "../src/components/primitives/Icons/Building.tsx", "../src/components/primitives/Icons/Check.tsx", "../src/components/primitives/Icons/ChevronDown.tsx", "../src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx", "../src/components/presentation/CreateOrganization/CreateOrganization.tsx", "../src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx", "../src/api/createOrganization.ts", "../src/components/presentation/OrganizationProfile/OrganizationProfile.tsx", "../src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx", "../src/components/primitives/KeyValueInput/KeyValueInput.tsx", "../src/api/getOrganization.ts", "../src/api/updateOrganization.ts", "../src/components/presentation/OrganizationList/OrganizationList.tsx", "../src/components/presentation/OrganizationList/BaseOrganizationList.tsx", "../src/components/primitives/Icons/BuildingAlt.tsx"],
4
- "sourcesContent": ["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n AsgardeoRuntimeError,\n EmbeddedFlowExecuteRequestPayload,\n EmbeddedFlowExecuteResponse,\n generateFlattenedUserProfile,\n Organization,\n SignInOptions,\n SignOutOptions,\n User,\n UserProfile,\n getBrandingPreference,\n GetBrandingPreferenceConfig,\n BrandingPreference,\n} from '@asgardeo/browser';\nimport {FC, RefObject, PropsWithChildren, ReactElement, useEffect, useMemo, useRef, useState, useCallback} from 'react';\nimport AsgardeoContext from './AsgardeoContext';\nimport AsgardeoReactClient from '../../AsgardeoReactClient';\nimport useBrowserUrl from '../../hooks/useBrowserUrl';\nimport {AsgardeoReactConfig} from '../../models/config';\nimport FlowProvider from '../Flow/FlowProvider';\nimport I18nProvider from '../I18n/I18nProvider';\nimport OrganizationProvider from '../Organization/OrganizationProvider';\nimport ThemeProvider from '../Theme/ThemeProvider';\nimport BrandingProvider from '../Branding/BrandingProvider';\nimport UserProvider from '../User/UserProvider';\n\n/**\n * Props interface of {@link AsgardeoProvider}\n */\nexport type AsgardeoProviderProps = AsgardeoReactConfig;\n\nconst AsgardeoProvider: FC<PropsWithChildren<AsgardeoProviderProps>> = ({\n afterSignInUrl = window.location.origin,\n afterSignOutUrl = window.location.origin,\n baseUrl: _baseUrl,\n clientId,\n children,\n scopes,\n preferences,\n signInUrl,\n signUpUrl,\n organizationHandle,\n applicationId,\n ...rest\n}: PropsWithChildren<AsgardeoProviderProps>): ReactElement => {\n const reRenderCheckRef: RefObject<boolean> = useRef(false);\n const asgardeo: AsgardeoReactClient = useMemo(() => new AsgardeoReactClient(), []);\n const {hasAuthParams} = useBrowserUrl();\n const [user, setUser] = useState<any | null>(null);\n const [currentOrganization, setCurrentOrganization] = useState<Organization | null>(null);\n\n const [isSignedInSync, setIsSignedInSync] = useState<boolean>(false);\n const [isInitializedSync, setIsInitializedSync] = useState<boolean>(false);\n\n const [myOrganizations, setMyOrganizations] = useState<Organization[]>([]);\n const [userProfile, setUserProfile] = useState<UserProfile | null>(null);\n const [baseUrl, setBaseUrl] = useState<string>(_baseUrl);\n const [config, setConfig] = useState<AsgardeoReactConfig>({\n applicationId,\n organizationHandle,\n afterSignInUrl,\n afterSignOutUrl,\n baseUrl,\n clientId,\n scopes,\n signUpUrl,\n signInUrl,\n ...rest,\n });\n\n // Branding state\n const [brandingPreference, setBrandingPreference] = useState<BrandingPreference | null>(null);\n const [isBrandingLoading, setIsBrandingLoading] = useState<boolean>(false);\n const [brandingError, setBrandingError] = useState<Error | null>(null);\n const [hasFetchedBranding, setHasFetchedBranding] = useState<boolean>(false);\n\n useEffect(() => {\n setBaseUrl(_baseUrl);\n // Reset branding state when baseUrl changes\n if (_baseUrl !== baseUrl) {\n setHasFetchedBranding(false);\n setBrandingPreference(null);\n setBrandingError(null);\n }\n }, [_baseUrl, baseUrl]);\n\n useEffect(() => {\n (async (): Promise<void> => {\n await asgardeo.initialize(config);\n setConfig(await asgardeo.getConfiguration());\n })();\n }, []);\n\n /**\n * Try signing in when the component is mounted.\n */\n useEffect(() => {\n // React 18.x Strict.Mode has a new check for `Ensuring reusable state` to facilitate an upcoming react feature.\n // https://reactjs.org/docs/strict-mode.html#ensuring-reusable-state\n // This will remount all the useEffects to ensure that there are no unexpected side effects.\n // When react remounts the signIn hook of the AuthProvider, it will cause a race condition. Hence, we have to\n // prevent the re-render of this hook as suggested in the following discussion.\n // https://github.com/reactwg/react-18/discussions/18#discussioncomment-795623\n if (reRenderCheckRef.current) {\n return;\n }\n\n reRenderCheckRef.current = true;\n\n (async (): Promise<void> => {\n // User is already authenticated. Skip...\n if (await asgardeo.isSignedIn()) {\n await updateSession();\n\n return;\n }\n\n if (hasAuthParams(new URL(window.location.href), afterSignInUrl)) {\n try {\n await signIn(\n {callOnlyOnRedirect: true},\n // authParams?.authorizationCode,\n // authParams?.sessionState,\n // authParams?.state,\n );\n\n // setError(null);\n } catch (error) {\n if (error && Object.prototype.hasOwnProperty.call(error, 'code')) {\n // setError(error);\n }\n }\n }\n })();\n }, []);\n\n /**\n * Check if the user is signed in and update the state accordingly.\n * This will also set an interval to check for the sign-in status every second\n * until the user is signed in.\n */\n useEffect(() => {\n let interval: NodeJS.Timeout;\n\n (async (): Promise<void> => {\n try {\n const status: boolean = await asgardeo.isSignedIn();\n\n setIsSignedInSync(status);\n\n if (!status) {\n interval = setInterval(async () => {\n const newStatus: boolean = await asgardeo.isSignedIn();\n\n if (newStatus) {\n setIsSignedInSync(true);\n clearInterval(interval);\n }\n }, 1000);\n }\n } catch (error) {\n setIsSignedInSync(false);\n }\n })();\n\n return (): void => {\n if (interval) {\n clearInterval(interval);\n }\n };\n }, [asgardeo]);\n\n useEffect(() => {\n (async (): Promise<void> => {\n try {\n const status: boolean = await asgardeo.isInitialized();\n\n setIsInitializedSync(status);\n } catch (error) {\n setIsInitializedSync(false);\n }\n })();\n }, [asgardeo]);\n\n const updateSession = async (): Promise<void> => {\n let _baseUrl: string = baseUrl;\n\n // If there's a `user_org` claim in the ID token,\n // Treat this login as a organization login.\n if ((await asgardeo.getDecodedIdToken())?.['user_org']) {\n _baseUrl = `${(await asgardeo.getConfiguration()).baseUrl}/o`;\n setBaseUrl(_baseUrl);\n }\n\n setUser(await asgardeo.getUser({baseUrl: _baseUrl}));\n setUserProfile(await asgardeo.getUserProfile({baseUrl: _baseUrl}));\n setCurrentOrganization(await asgardeo.getCurrentOrganization());\n setMyOrganizations(await asgardeo.getMyOrganizations());\n };\n\n // Branding fetch function\n const fetchBranding = useCallback(async (): Promise<void> => {\n if (!baseUrl) {\n return;\n }\n\n // Prevent multiple calls if already fetching\n if (isBrandingLoading) {\n return;\n }\n\n setIsBrandingLoading(true);\n setBrandingError(null);\n\n try {\n const getBrandingConfig: GetBrandingPreferenceConfig = {\n baseUrl,\n locale: preferences?.i18n?.language,\n // Add other branding config options as needed\n };\n\n const brandingData = await getBrandingPreference(getBrandingConfig);\n setBrandingPreference(brandingData);\n setHasFetchedBranding(true);\n } catch (err) {\n const errorMessage = err instanceof Error ? err : new Error('Failed to fetch branding preference');\n setBrandingError(errorMessage);\n setBrandingPreference(null);\n setHasFetchedBranding(true); // Mark as fetched even on error to prevent retries\n } finally {\n setIsBrandingLoading(false);\n }\n }, [baseUrl, preferences?.i18n?.language]);\n\n // Refetch branding function\n const refetchBranding = useCallback(async (): Promise<void> => {\n setHasFetchedBranding(false); // Reset the flag to allow refetching\n await fetchBranding();\n }, [fetchBranding]);\n\n // Auto-fetch branding when initialized and configured\n useEffect(() => {\n // Enable branding by default or when explicitly enabled\n const shouldFetchBranding = preferences?.theme?.inheritFromBranding !== false;\n\n if (shouldFetchBranding && isInitializedSync && baseUrl && !hasFetchedBranding && !isBrandingLoading) {\n fetchBranding();\n }\n }, [\n preferences?.theme?.inheritFromBranding,\n isInitializedSync,\n baseUrl,\n hasFetchedBranding,\n isBrandingLoading,\n fetchBranding,\n ]);\n\n const signIn = async (...args: any): Promise<User> => {\n try {\n const response: User = await asgardeo.signIn(...args);\n\n if (await asgardeo.isSignedIn()) {\n await updateSession();\n }\n\n return response;\n } catch (error) {\n throw new Error(`Error while signing in: ${error}`);\n }\n };\n\n const signUp = async (payload?: EmbeddedFlowExecuteRequestPayload): Promise<void | EmbeddedFlowExecuteResponse> => {\n try {\n return await asgardeo.signUp(payload);\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Error while signing up: ${error.message || error}`,\n 'asgardeo-signUp-Error',\n 'react',\n 'An error occurred while trying to sign up.',\n );\n }\n };\n\n const signOut = async (options?: SignOutOptions, afterSignOut?: () => void): Promise<string> =>\n asgardeo.signOut(options, afterSignOut);\n\n const switchOrganization = async (organization: Organization): Promise<void> => {\n try {\n await asgardeo.switchOrganization(organization);\n\n if (await asgardeo.isSignedIn()) {\n await updateSession();\n }\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Failed to switch organization: ${error.message || error}`,\n 'asgardeo-switchOrganization-Error',\n 'react',\n 'An error occurred while switching to the specified organization.',\n );\n }\n };\n\n const isDarkMode: boolean = useMemo(() => {\n if (!preferences?.theme?.mode || preferences.theme.mode === 'system') {\n return window.matchMedia('(prefers-color-scheme: dark)').matches;\n }\n return preferences.theme.mode === 'dark';\n }, [preferences?.theme?.mode]);\n\n const handleProfileUpdate = (payload: User): void => {\n setUser(payload);\n setUserProfile(prev => ({\n ...prev,\n profile: payload,\n flattenedProfile: generateFlattenedUserProfile(payload, prev?.schemas),\n }));\n };\n\n return (\n <AsgardeoContext.Provider\n value={{\n applicationId,\n organizationHandle: config?.organizationHandle,\n signInUrl,\n signUpUrl,\n afterSignInUrl,\n baseUrl,\n isInitialized: isInitializedSync,\n isLoading: asgardeo.isLoading(),\n isSignedIn: isSignedInSync,\n organization: currentOrganization,\n signIn,\n signOut,\n signUp,\n user,\n }}\n >\n <I18nProvider preferences={preferences?.i18n}>\n <BrandingProvider\n brandingPreference={brandingPreference}\n isLoading={isBrandingLoading}\n error={brandingError}\n enabled={preferences?.theme?.inheritFromBranding !== false}\n refetch={refetchBranding}\n >\n <ThemeProvider\n inheritFromBranding={preferences?.theme?.inheritFromBranding}\n theme={preferences?.theme?.overrides}\n mode={isDarkMode ? 'dark' : 'light'}\n >\n <FlowProvider>\n <UserProvider profile={userProfile} onUpdateProfile={handleProfileUpdate}>\n <OrganizationProvider\n getAllOrganizations={async () => await asgardeo.getAllOrganizations()}\n myOrganizations={myOrganizations}\n currentOrganization={currentOrganization}\n onOrganizationSwitch={switchOrganization}\n revalidateMyOrganizations={async () => await asgardeo.getMyOrganizations()}\n >\n {children}\n </OrganizationProvider>\n </UserProvider>\n </FlowProvider>\n </ThemeProvider>\n </BrandingProvider>\n </I18nProvider>\n </AsgardeoContext.Provider>\n );\n};\n\nexport default AsgardeoProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {Context, createContext} from 'react';\nimport {Organization} from '@asgardeo/browser';\n\n/**\n * Props interface of {@link AsgardeoContext}\n */\nexport type AsgardeoContextProps = {\n organizationHandle: string | undefined;\n applicationId: string | undefined;\n signInUrl: string | undefined;\n signUpUrl: string | undefined;\n afterSignInUrl: string | undefined;\n baseUrl: string | undefined;\n isInitialized: boolean;\n /**\n * Flag indicating whether the SDK is working in the background.\n */\n isLoading: boolean;\n /**\n * Flag indicating whether the user is signed in or not.\n */\n isSignedIn: boolean;\n /**\n * Sign-in function to initiate the authentication process.\n * @remark This is the programmatic version of the `SignInButton` component.\n * TODO: Fix the types.\n */\n signIn: any;\n /**\n * Sign-out function to terminate the authentication session.\n * @remark This is the programmatic version of the `SignOutButton` component.\n * FIXME: Fix the types.\n */\n signOut: any;\n /**\n * Sign-up function to initiate the registration process.\n * @remark This is the programmatic version of the `SignUpButton` component.\n * FIXME: Fix the types.\n */\n signUp: any;\n user: any;\n organization: Organization;\n};\n\n/**\n * Context object for managing the Authentication flow builder core context.\n */\nconst AsgardeoContext: Context<AsgardeoContextProps | null> = createContext<null | AsgardeoContextProps>({\n organizationHandle: undefined,\n applicationId: undefined,\n signInUrl: undefined,\n signUpUrl: undefined,\n afterSignInUrl: undefined,\n baseUrl: undefined,\n isInitialized: false,\n isLoading: true,\n isSignedIn: false,\n organization: null,\n signIn: null,\n signOut: null,\n signUp: null,\n user: null,\n});\n\nAsgardeoContext.displayName = 'AsgardeoContext';\n\nexport default AsgardeoContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n AsgardeoBrowserClient,\n flattenUserSchema,\n generateFlattenedUserProfile,\n UserProfile,\n SignInOptions,\n SignOutOptions,\n User,\n generateUserProfile,\n EmbeddedFlowExecuteResponse,\n SignUpOptions,\n EmbeddedFlowExecuteRequestPayload,\n AsgardeoRuntimeError,\n executeEmbeddedSignUpFlow,\n EmbeddedSignInFlowHandleRequestPayload,\n executeEmbeddedSignInFlow,\n Organization,\n IdToken,\n EmbeddedFlowExecuteRequestConfig,\n deriveOrganizationHandleFromBaseUrl,\n AllOrganizationsApiResponse,\n extractUserClaimsFromIdToken,\n TokenResponse,\n} from '@asgardeo/browser';\nimport AuthAPI from './__temp__/api';\nimport getMeOrganizations from './api/getMeOrganizations';\nimport getScim2Me from './api/getScim2Me';\nimport getSchemas from './api/getSchemas';\nimport {AsgardeoReactConfig} from './models/config';\nimport getAllOrganizations from './api/getAllOrganizations';\n\n/**\n * Client for mplementing Asgardeo in React applications.\n * This class provides the core functionality for managing user authentication and sessions.\n *\n * @typeParam T - Configuration type that extends AsgardeoReactConfig.\n */\nclass AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> extends AsgardeoBrowserClient<T> {\n private asgardeo: AuthAPI;\n\n constructor() {\n super();\n\n // FIXME: This has to be the browser client from `@asgardeo/browser` package.\n this.asgardeo = new AuthAPI();\n }\n\n override initialize(config: AsgardeoReactConfig): Promise<boolean> {\n let resolvedOrganizationHandle: string | undefined = config?.organizationHandle;\n\n if (!resolvedOrganizationHandle) {\n resolvedOrganizationHandle = deriveOrganizationHandleFromBaseUrl(config?.baseUrl);\n }\n\n return this.asgardeo.init({...config, organizationHandle: resolvedOrganizationHandle} as any);\n }\n\n override async updateUserProfile(payload: any, userId?: string): Promise<User> {\n throw new Error('Not implemented');\n }\n\n override async getUser(options?: any): Promise<User> {\n try {\n let baseUrl = options?.baseUrl;\n\n if (!baseUrl) {\n const configData = await this.asgardeo.getConfigData();\n baseUrl = configData?.baseUrl;\n }\n\n const profile = await getScim2Me({baseUrl});\n const schemas = await getSchemas({baseUrl});\n\n return generateUserProfile(profile, flattenUserSchema(schemas));\n } catch (error) {\n return extractUserClaimsFromIdToken(await this.getDecodedIdToken());\n }\n }\n\n async getDecodedIdToken(sessionId?: string): Promise<IdToken> {\n return this.asgardeo.getDecodedIdToken(sessionId);\n }\n\n async getUserProfile(options?: any): Promise<UserProfile> {\n try {\n let baseUrl = options?.baseUrl;\n\n if (!baseUrl) {\n const configData = await this.asgardeo.getConfigData();\n baseUrl = configData?.baseUrl;\n }\n\n const profile = await getScim2Me({baseUrl});\n const schemas = await getSchemas({baseUrl});\n\n const processedSchemas = flattenUserSchema(schemas);\n\n const output = {\n schemas: processedSchemas,\n flattenedProfile: generateFlattenedUserProfile(profile, processedSchemas),\n profile,\n };\n\n return output;\n } catch (error) {\n return {\n schemas: [],\n flattenedProfile: extractUserClaimsFromIdToken(await this.getDecodedIdToken()),\n profile: extractUserClaimsFromIdToken(await this.getDecodedIdToken()),\n };\n }\n }\n\n override async getMyOrganizations(options?: any, sessionId?: string): Promise<Organization[]> {\n try {\n let baseUrl = options?.baseUrl;\n\n if (!baseUrl) {\n const configData = await this.asgardeo.getConfigData();\n baseUrl = configData?.baseUrl;\n }\n\n return getMeOrganizations({baseUrl});\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Failed to fetch the user's associated organizations: ${\n error instanceof Error ? error.message : String(error)\n }`,\n 'AsgardeoReactClient-getMyOrganizations-RuntimeError-001',\n 'react',\n 'An error occurred while fetching associated organizations of the signed-in user.',\n );\n }\n }\n\n override async getAllOrganizations(options?: any, sessionId?: string): Promise<AllOrganizationsApiResponse> {\n try {\n let baseUrl = options?.baseUrl;\n\n if (!baseUrl) {\n const configData = await this.asgardeo.getConfigData();\n baseUrl = configData?.baseUrl;\n }\n\n return getAllOrganizations({baseUrl});\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Failed to fetch all organizations: ${error instanceof Error ? error.message : String(error)}`,\n 'AsgardeoReactClient-getAllOrganizations-RuntimeError-001',\n 'react',\n 'An error occurred while fetching all the organizations associated with the user.',\n );\n }\n }\n\n override async getCurrentOrganization(): Promise<Organization | null> {\n const idToken: IdToken = await this.getDecodedIdToken();\n\n return {\n orgHandle: idToken?.org_handle,\n name: idToken?.org_name,\n id: idToken?.org_id,\n };\n }\n\n override async switchOrganization(organization: Organization, sessionId?: string): Promise<TokenResponse | Response> {\n try {\n const configData = await this.asgardeo.getConfigData();\n const scopes = configData?.scopes;\n\n if (!organization.id) {\n throw new AsgardeoRuntimeError(\n 'Organization ID is required for switching organizations',\n 'react-AsgardeoReactClient-SwitchOrganizationError-001',\n 'react',\n 'The organization object must contain a valid ID to perform the organization switch.',\n );\n }\n\n const exchangeConfig = {\n attachToken: false,\n data: {\n client_id: '{{clientId}}',\n grant_type: 'organization_switch',\n scope: '{{scopes}}',\n switching_organization: organization.id,\n token: '{{accessToken}}',\n },\n id: 'organization-switch',\n returnsSession: true,\n signInRequired: true,\n };\n\n return await this.asgardeo.exchangeToken(\n exchangeConfig,\n (user: User) => {},\n () => null,\n ) as TokenResponse | Response;\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Failed to switch organization: ${error.message || error}`,\n 'react-AsgardeoReactClient-SwitchOrganizationError-003',\n 'react',\n 'An error occurred while switching to the specified organization. Please try again.',\n );\n }\n }\n\n override isLoading(): boolean {\n return this.asgardeo.isLoading();\n }\n\n async isInitialized(): Promise<boolean> {\n return this.asgardeo.isInitialized();\n }\n\n override isSignedIn(): Promise<boolean> {\n return this.asgardeo.isSignedIn();\n }\n\n override getConfiguration(): T {\n return this.asgardeo.getConfigData() as unknown as T;\n }\n\n override signIn(\n options?: SignInOptions,\n sessionId?: string,\n onSignInSuccess?: (afterSignInUrl: string) => void,\n ): Promise<User>;\n override signIn(\n payload: EmbeddedSignInFlowHandleRequestPayload,\n request: EmbeddedFlowExecuteRequestConfig,\n sessionId?: string,\n onSignInSuccess?: (afterSignInUrl: string) => void,\n ): Promise<User>;\n override async signIn(...args: any[]): Promise<User> {\n const arg1 = args[0];\n const arg2 = args[1];\n\n if (typeof arg1 === 'object' && 'flowId' in arg1 && typeof arg2 === 'object' && 'url' in arg2) {\n return executeEmbeddedSignInFlow({\n payload: arg1,\n url: arg2.url,\n });\n }\n\n return (await this.asgardeo.signIn(arg1 as any)) as unknown as Promise<User>;\n }\n\n override signOut(options?: SignOutOptions, afterSignOut?: (afterSignOutUrl: string) => void): Promise<string>;\n override signOut(\n options?: SignOutOptions,\n sessionId?: string,\n afterSignOut?: (afterSignOutUrl: string) => void,\n ): Promise<string>;\n override async signOut(...args: any[]): Promise<string> {\n if (args[1] && typeof args[1] !== 'function') {\n throw new Error('The second argument must be a function.');\n }\n\n const response: boolean = await this.asgardeo.signOut(args[1]);\n\n return Promise.resolve(String(response));\n }\n\n override async signUp(options?: SignUpOptions): Promise<void>;\n override async signUp(payload: EmbeddedFlowExecuteRequestPayload): Promise<EmbeddedFlowExecuteResponse>;\n override async signUp(...args: any[]): Promise<void | EmbeddedFlowExecuteResponse> {\n if (args.length === 0) {\n throw new AsgardeoRuntimeError(\n 'No arguments provided for signUp method.',\n 'react-AsgardeoReactClient-ValidationError-001',\n 'react',\n 'The signUp method requires at least one argument, either a SignUpOptions object or an EmbeddedFlowExecuteRequestPayload.',\n );\n }\n\n const firstArg = args[0];\n\n if (typeof firstArg === 'object' && 'flowType' in firstArg) {\n const configData = await this.asgardeo.getConfigData();\n const baseUrl: string = configData?.baseUrl;\n\n return executeEmbeddedSignUpFlow({\n baseUrl,\n payload: firstArg as EmbeddedFlowExecuteRequestPayload,\n });\n }\n throw new AsgardeoRuntimeError(\n 'Not implemented',\n 'react-AsgardeoReactClient-ValidationError-002',\n 'react',\n 'The signUp method with SignUpOptions is not implemented in the React client.',\n );\n }\n}\n\nexport default AsgardeoReactClient;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n AsgardeoSPAClient,\n AuthClientConfig,\n User,\n LegacyConfig as Config,\n IdToken,\n Hooks,\n HttpClientInstance,\n HttpRequestConfig,\n HttpResponse,\n OIDCEndpoints,\n SignInConfig,\n SPACustomGrantConfig,\n initializeEmbeddedSignInFlow,\n processOpenIDScopes,\n} from '@asgardeo/browser';\nimport {AuthStateInterface} from './models';\n\nclass AuthAPI {\n static DEFAULT_STATE: AuthStateInterface;\n\n private _authState = AuthAPI.DEFAULT_STATE;\n private _client: AsgardeoSPAClient;\n\n private _isLoading: boolean;\n\n constructor(spaClient?: AsgardeoSPAClient) {\n this._client = spaClient ?? AsgardeoSPAClient.getInstance();\n\n this.getState = this.getState.bind(this);\n this.init = this.init.bind(this);\n this.signIn = this.signIn.bind(this);\n this.signOut = this.signOut.bind(this);\n this.updateState = this.updateState.bind(this);\n }\n\n public _setIsLoading(isLoading: boolean): void {\n this._isLoading = isLoading;\n }\n\n public _getIsLoading(): boolean {\n return this._isLoading;\n }\n\n public isLoading(): boolean {\n return this._getIsLoading();\n }\n\n /**\n * Method to return Auth Client instance authentication state.\n *\n * @return {AuthStateInterface} Authentication State.\n */\n public getState(): AuthStateInterface {\n return this._authState;\n }\n\n /**\n * Method to initialize the AuthClient instance.\n *\n * @param {Config} config - `dispatch` function from React Auth Context.\n */\n public async init(config: AuthClientConfig<Config>): Promise<boolean> {\n return this._client.initialize(config);\n }\n\n /**\n * Method to get the configuration data.\n *\n * @returns {Promise<AuthClientConfig<Config>>} - A promise that resolves with the configuration data.\n */\n public async getConfigData(): Promise<AuthClientConfig<Config>> {\n return this._client.getConfigData();\n }\n\n /**\n * Method to get the configuration data.\n *\n * @returns {Promise<AuthClientConfig<Config>>} - A promise that resolves with the configuration data.\n */\n public async isInitialized(): Promise<boolean> {\n // Wait for initialization to complete\n return this._client.isInitialized();\n }\n\n /**\n * Method to handle user Sign In requests.\n *\n * @param {any} dispatch - `dispatch` function from React Auth Context.\n * @param {AuthStateInterface} state - Current authentication state in React Auth Context.\n * @param {any} callback - Action to trigger on successful sign in.\n */\n public async signIn(\n // dispatch: (state: AuthStateInterface) => void,\n // state: AuthStateInterface,\n config: SignInConfig,\n authorizationCode?: string,\n sessionState?: string,\n authState?: string,\n callback?: (response: User) => void,\n tokenRequestConfig?: {\n params: Record<string, unknown>;\n },\n ): Promise<any> {\n return this._client\n .signIn(config, authorizationCode, sessionState, authState, tokenRequestConfig)\n .then(async (response: User) => {\n if (!response) {\n return null; // FIXME: Validate this. Temp fix for: error TS7030: Not all code paths return a value.\n }\n\n if (await this._client.isSignedIn()) {\n const stateToUpdate = {\n displayName: response.displayName,\n email: response.email,\n isSignedIn: true,\n isLoading: false,\n isSigningOut: false,\n username: response.username,\n };\n\n this.updateState(stateToUpdate);\n\n // dispatch({...state, ...stateToUpdate});\n this._setIsLoading(false);\n\n if (callback) {\n callback(response);\n }\n }\n\n return response;\n })\n .catch(error => Promise.reject(error));\n }\n\n /**\n * Method to handle user Sign Out requests.\n *\n * @param {any} dispatch - `dispatch` function from React Auth Context.\n * @param {AuthStateInterface} state - Current authentication state in React Auth Context.\n * @param {any} callback - Action to trigger on successful sign out.\n */\n public signOut(callback?: (response?: boolean) => void): Promise<boolean> {\n return this._client\n .signOut()\n .then(response => {\n if (callback) {\n callback(response);\n }\n\n return response;\n })\n .catch(error => Promise.reject(error));\n }\n\n /**\n * Method to update Auth Client instance authentication state.\n *\n * @param {AuthStateInterface} state - State values to update in authentication state.\n */\n public updateState(state: AuthStateInterface): void {\n this._authState = {...this._authState, ...state};\n }\n\n /**\n * This method returns a Promise that resolves with the basic user information obtained from the ID token.\n *\n * @return {Promise<User>} - A promise that resolves with the user information.\n */\n public async getUser(): Promise<User> {\n return this._client.getUser();\n }\n\n /**\n * This method sends an API request to a protected endpoint.\n * The access token is automatically attached to the header of the request.\n * This is the only way by which protected endpoints can be accessed\n * when the web worker is used to store session information.\n *\n * @param {HttpRequestConfig} config - The config object containing attributes necessary to send a request.\n *\n * @return {Promise<Response>} - Returns a Promise that resolves with the response to the request.\n */\n public async httpRequest(config: HttpRequestConfig): Promise<HttpResponse<any>> {\n return this._client.httpRequest(config);\n }\n\n /**\n * This method sends multiple API requests to a protected endpoint.\n * The access token is automatically attached to the header of the request.\n * This is the only way by which multiple requests can be sent to protected endpoints\n * when the web worker is used to store session information.\n *\n * @param {HttpRequestConfig[]} config - The config object containing attributes necessary to send a request.\n *\n * @return {Promise<Response>} - Returns a Promise that resolves with the responses to the requests.\n */\n public async httpRequestAll(configs: HttpRequestConfig[]): Promise<HttpResponse<any>[]> {\n return this._client.httpRequestAll(configs);\n }\n\n /**\n * This method allows you to send a request with a custom grant.\n *\n * @param {CustomGrantRequestParams} config - The request parameters.\n *\n * @return {Promise<Response | SignInResponse>} - A Promise that resolves with\n * the value returned by the custom grant request.\n */\n public exchangeToken(\n config: SPACustomGrantConfig,\n callback: (response: User | Response) => void,\n dispatch: (state: AuthStateInterface) => void,\n ): Promise<User | Response> {\n return this._client\n .exchangeToken(config)\n .then((response: User | Response) => {\n if (!response) {\n return null; // FIXME: Validate this. Temp fix for: error TS7030: Not all code paths return a value.\n }\n\n if (config.returnsSession) {\n this.updateState({\n ...this.getState(),\n ...(response as User),\n isSignedIn: true,\n isLoading: false,\n });\n\n dispatch({...(response as User), isSignedIn: true, isLoading: false});\n }\n\n callback && callback(response);\n\n return response;\n })\n .catch(error => Promise.reject(error));\n }\n\n /**\n * This method ends a user session. The access token is revoked and the session information is destroyed.\n *\n * @return {Promise<boolean>} - A promise that resolves with `true` if the process is successful.\n */\n public async revokeAccessToken(dispatch: (state: AuthStateInterface) => void): Promise<boolean> {\n return this._client\n .revokeAccessToken()\n .then(() => {\n this.updateState({...AuthAPI.DEFAULT_STATE, isLoading: false});\n dispatch(AuthAPI.DEFAULT_STATE);\n return true;\n })\n .catch(error => Promise.reject(error));\n }\n\n /**\n * This method returns a Promise that resolves with an object containing the service endpoints.\n *\n * @return {Promise<ServiceResourcesType} - A Promise that resolves with an object containing the service endpoints.\n */\n public async getOpenIDProviderEndpoints(): Promise<OIDCEndpoints> {\n return this._client.getOpenIDProviderEndpoints();\n }\n\n /**\n * This methods returns the Axios http client.\n *\n * @return {HttpClientInstance} - The Axios HTTP client.\n */\n public async getHttpClient(): Promise<HttpClientInstance> {\n return this._client.getHttpClient();\n }\n\n /**\n * This method decodes the payload of the id token and returns it.\n *\n * @return {Promise<DecodedIDTokenPayloadInterface>} - A Promise that resolves with\n * the decoded payload of the id token.\n */\n public async getDecodedIdToken(sessionId?: string): Promise<IdToken> {\n return this._client.getDecodedIdToken(sessionId);\n }\n\n /**\n * This method decodes the payload of the idp id token and returns it.\n *\n * @return {Promise<DecodedIDTokenPayloadInterface>} - A Promise that resolves with\n * the decoded payload of the idp id token.\n */\n public async getDecodedIDPIDToken(): Promise<IdToken> {\n return this._client.getDecodedIdToken();\n }\n\n /**\n * This method returns the ID token.\n *\n * @return {Promise<string>} - A Promise that resolves with the id token.\n */\n public async getIdToken(): Promise<string> {\n return this._client.getIdToken();\n }\n\n /**\n * This method return a Promise that resolves with the access token.\n *\n * **This method will not return the access token if the storage type is set to `webWorker`.**\n *\n * @return {Promise<string>} - A Promise that resolves with the access token.\n */\n public async getAccessToken(): Promise<string> {\n return this._client.getAccessToken();\n }\n\n /**\n * This method return a Promise that resolves with the idp access token.\n *\n * **This method will not return the idp access token if the storage type is set to `webWorker`.**\n * **This can be used to access the IDP access token when custom auth grant functionalities are used**\n *\n * @return {Promise<string>} - A Promise that resolves with the idp access token.\n */\n public async getIDPAccessToken(): Promise<string> {\n return this._client.getIDPAccessToken();\n }\n\n /**\n * This method refreshes the access token.\n *\n * @return {TokenResponseInterface} - A Promise that resolves with an object containing\n * information about the refreshed access token.\n */\n public async refreshAccessToken(): Promise<User> {\n return this._client.refreshAccessToken();\n }\n\n /**\n * This method specifies if the user is authenticated or not.\n *\n * @return {Promise<boolean>} - A Promise that resolves with `true` if teh user is authenticated.\n */\n public async isSignedIn(): Promise<boolean> {\n return this._client.isSignedIn();\n }\n\n /**\n * This method specifies if the session is active or not.\n *\n * @return {Promise<boolean>} - A Promise that resolves with `true` if there is an active session.\n */\n public async isSessionActive(): Promise<boolean> {\n return this._client.isSessionActive();\n }\n\n /**\n * This method enables callback functions attached to the http client.\n *\n * @return {Promise<boolean>} - A promise that resolves with True.\n *\n */\n public async enableHttpHandler(): Promise<boolean> {\n return this._client.enableHttpHandler();\n }\n\n /**\n * This method disables callback functions attached to the http client.\n *\n * @return {Promise<boolean>} - A promise that resolves with True.\n */\n public async disableHttpHandler(): Promise<boolean> {\n return this._client.disableHttpHandler();\n }\n\n /**\n * This method updates the configuration that was passed into the constructor when instantiating this class.\n *\n * @param {Partial<AuthClientConfig<T>>} config - A config object to update the SDK configurations with.\n */\n public async reInitialize(config: Partial<AuthClientConfig<Config>>): Promise<void> {\n return this._client.reInitialize(config);\n }\n\n /**\n * This method attaches a callback function to an event hook that fires the callback when the event happens.\n *\n * @param {Hooks.CustomGrant} hook - The name of the hook.\n * @param {(response?: any) => void} callback - The callback function.\n * @param {string} id (optional) - The id of the hook. This is used when multiple custom grants are used.\n *\n */\n public on(hook: Hooks.CustomGrant, callback: (response?: any) => void, id: string): Promise<void>;\n public on(hook: Exclude<Hooks, Hooks.CustomGrant>, callback: (response?: any) => void): Promise<void>;\n public on(hook: Hooks, callback: (response?: any) => void, id?: string): Promise<void> {\n if (hook === Hooks.CustomGrant) {\n return this._client.on(hook, callback, id);\n }\n\n return this._client.on(hook, callback);\n }\n\n /**\n * This method allows you to sign in silently.\n * First, this method sends a prompt none request to see if there is an active user session in the identity server.\n * If there is one, then it requests the access token and stores it. Else, it returns false.\n *\n * @return {Promise<User | boolean>} - A Promise that resolves with the user information after signing in\n * or with `false` if the user is not signed in.\n *\n * @example\n *```\n * client.trySignInSilently()\n *```\n */\n public async trySignInSilently(\n state: AuthStateInterface,\n dispatch: (state: AuthStateInterface) => void,\n additionalParams?: Record<string, string | boolean>,\n tokenRequestConfig?: {params: Record<string, unknown>},\n ): Promise<User | boolean | undefined> {\n return this._client\n .trySignInSilently(additionalParams, tokenRequestConfig)\n .then(async (response: User | boolean) => {\n if (!response) {\n this.updateState({...this.getState(), isLoading: false});\n dispatch({...state, isLoading: false});\n\n return false;\n }\n\n if (await this._client.isSignedIn()) {\n const basicUserInfo = response as User;\n const stateToUpdate = {\n displayName: basicUserInfo.displayName,\n email: basicUserInfo.email,\n isSignedIn: true,\n isLoading: false,\n isSigningOut: false,\n username: basicUserInfo.username,\n };\n\n this.updateState(stateToUpdate);\n\n dispatch({...state, ...stateToUpdate});\n }\n\n return response;\n })\n .catch(error => Promise.reject(error));\n }\n}\n\nAuthAPI.DEFAULT_STATE = {\n displayName: '',\n email: '',\n isSignedIn: false,\n isLoading: true,\n username: '',\n};\n\nexport default AuthAPI;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n Organization,\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n getMeOrganizations as baseGetMeOrganizations,\n GetMeOrganizationsConfig as BaseGetMeOrganizationsConfig,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the getMeOrganizations request (React-specific)\n */\nexport interface GetMeOrganizationsConfig extends Omit<BaseGetMeOrganizationsConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Retrieves the organizations associated with the current user.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object containing baseUrl, optional query parameters, and request config.\n * @returns A promise that resolves with the organizations information.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * try {\n * const organizations = await getMeOrganizations({\n * baseUrl: \"https://api.asgardeo.io/t/<ORGANIZATION>\",\n * after: \"\",\n * before: \"\",\n * filter: \"\",\n * limit: 10,\n * recursive: false\n * });\n * console.log(organizations);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get organizations:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const organizations = await getMeOrganizations({\n * baseUrl: \"https://api.asgardeo.io/t/<ORGANIZATION>\",\n * after: \"\",\n * before: \"\",\n * filter: \"\",\n * limit: 10,\n * recursive: false,\n * fetcher: customFetchFunction\n * });\n * console.log(organizations);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get organizations:', error.message);\n * }\n * }\n * ```\n */\nconst getMeOrganizations = async ({fetcher, ...requestConfig}: GetMeOrganizationsConfig): Promise<Organization[]> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'GET',\n headers: config.headers as Record<string, string>,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetMeOrganizations({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getMeOrganizations;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n User,\n AsgardeoAPIError,\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n getScim2Me as baseGetScim2Me,\n GetScim2MeConfig as BaseGetScim2MeConfig\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the getScim2Me request (React-specific)\n */\nexport interface GetScim2MeConfig extends Omit<BaseGetScim2MeConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Retrieves the user profile information from the specified SCIM2 /Me endpoint.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param requestConfig - Request configuration object.\n * @returns A promise that resolves with the user profile information.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * try {\n * const userProfile = await getScim2Me({\n * url: \"https://api.asgardeo.io/t/<ORGANIZATION>/scim2/Me\",\n * });\n * console.log(userProfile);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get user profile:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const userProfile = await getScim2Me({\n * url: \"https://api.asgardeo.io/t/<ORGANIZATION>/scim2/Me\",\n * fetcher: customFetchFunction\n * });\n * console.log(userProfile);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get user profile:', error.message);\n * }\n * }\n * ```\n */\nconst getScim2Me = async ({fetcher, ...requestConfig}: GetScim2MeConfig): Promise<User> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'GET',\n headers: config.headers as Record<string, string>,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetScim2Me({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getScim2Me;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n Schema,\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n getSchemas as baseGetSchemas,\n GetSchemasConfig as BaseGetSchemasConfig,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the getSchemas request (React-specific)\n */\nexport interface GetSchemasConfig extends Omit<BaseGetSchemasConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Retrieves the SCIM2 schemas from the specified endpoint.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Request configuration object.\n * @returns A promise that resolves with the SCIM2 schemas information.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * try {\n * const schemas = await getSchemas({\n * url: \"https://api.asgardeo.io/t/<ORGANIZATION>/scim2/Schemas\",\n * });\n * console.log(schemas);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get schemas:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const schemas = await getSchemas({\n * url: \"https://api.asgardeo.io/t/<ORGANIZATION>/scim2/Schemas\",\n * fetcher: customFetchFunction\n * });\n * console.log(schemas);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get schemas:', error.message);\n * }\n * }\n * ```\n */\nconst getSchemas = async ({fetcher, ...requestConfig}: GetSchemasConfig): Promise<Schema[]> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'GET',\n headers: config.headers as Record<string, string>,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetSchemas({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getSchemas;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n getAllOrganizations as baseGetAllOrganizations,\n GetAllOrganizationsConfig as BaseGetAllOrganizationsConfig,\n AllOrganizationsApiResponse,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the getAllOrganizations request (React-specific)\n */\nexport interface GetAllOrganizationsConfig extends Omit<BaseGetAllOrganizationsConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Retrieves all organizations with pagination support.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object containing baseUrl, optional query parameters, and request config.\n * @returns A promise that resolves with the paginated organizations information.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * try {\n * const response = await getAllOrganizations({\n * baseUrl: \"https://api.asgardeo.io/t/<ORGANIZATION>\",\n * filter: \"\",\n * limit: 10,\n * recursive: false\n * });\n * console.log(response.organizations);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get organizations:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const response = await getAllOrganizations({\n * baseUrl: \"https://api.asgardeo.io/t/<ORGANIZATION>\",\n * filter: \"\",\n * limit: 10,\n * recursive: false,\n * fetcher: customFetchFunction\n * });\n * console.log(response.organizations);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get organizations:', error.message);\n * }\n * }\n * ```\n */\nconst getAllOrganizations = async ({\n fetcher,\n ...requestConfig\n}: GetAllOrganizationsConfig): Promise<AllOrganizationsApiResponse> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'GET',\n headers: config.headers as Record<string, string>,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetAllOrganizations({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getAllOrganizations;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {hasAuthParamsInUrl} from '@asgardeo/browser';\n\n/**\n * Interface for the useBrowserUrl hook return value.\n */\nexport interface UseBrowserUrl {\n /**\n * Checks if the current URL contains authentication parameters.\n *\n * @param url - The URL object to check for authentication parameters\n * @param afterSignInUrl - The URL where the authorization server should redirect after authentication\n * @returns True if the URL contains authentication parameters and matches the afterSignInUrl, or if it contains an error parameter\n */\n hasAuthParams: (url: URL, afterSignInUrl: string) => boolean;\n}\n\n/**\n * Hook that provides utilities for handling browser URLs in authentication flows.\n *\n * @returns An object containing URL utility functions\n *\n * @example\n * ```tsx\n * const { hasAuthParams } = useBrowserUrl();\n * const url = new URL(window.location.href);\n *\n * if (hasAuthParams(url, \"/after-signin\")) {\n * // Handle authentication callback\n * }\n * ```\n */\nconst useBrowserUrl = (): UseBrowserUrl => {\n const hasAuthParams = (url: URL, afterSignInUrl: string): boolean =>\n (hasAuthParamsInUrl() && new URL(url.origin + url.pathname).toString() === new URL(afterSignInUrl).toString()) ||\n // authParams?.authorizationCode || // FIXME: These are sent externally. Need to see what we can do about this.\n url.searchParams.get('error') !== null;\n\n return {hasAuthParams};\n};\n\nexport default useBrowserUrl;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactElement, useCallback, useMemo, useState} from 'react';\nimport FlowContext, {FlowContextValue, FlowMessage, FlowStep} from './FlowContext';\n\n/**\n * Props for the FlowProvider component.\n */\nexport interface FlowProviderProps {\n /**\n * Initial step to start with.\n */\n initialStep?: FlowStep;\n\n /**\n * Initial title.\n */\n initialTitle?: string;\n\n /**\n * Initial subtitle.\n */\n initialSubtitle?: string;\n\n /**\n * Callback when flow type changes.\n */\n onFlowChange?: (step: FlowStep) => void;\n}\n\n/**\n * Provider component for flow context.\n * Manages shared UI state for authentication flows including titles, messages, and navigation.\n */\nconst FlowProvider: FC<PropsWithChildren<FlowProviderProps>> = ({\n children,\n initialStep = null,\n initialTitle = '',\n initialSubtitle,\n onFlowChange,\n}: PropsWithChildren<FlowProviderProps>): ReactElement => {\n const [currentStep, setCurrentStepState] = useState<FlowStep>(initialStep);\n const [title, setTitle] = useState<string>(initialTitle);\n const [subtitle, setSubtitle] = useState<string | undefined>(initialSubtitle);\n const [messages, setMessages] = useState<FlowMessage[]>([]);\n const [error, setError] = useState<string | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [showBackButton, setShowBackButton] = useState<boolean>(false);\n const [onGoBack, setOnGoBack] = useState<(() => void) | undefined>(undefined);\n\n /**\n * Set the current flow step and notify listeners.\n */\n const setCurrentStep = useCallback(\n (step: FlowStep) => {\n setCurrentStepState(step);\n if (step) {\n setTitle(step.title);\n setSubtitle(step.subtitle);\n setShowBackButton(step.canGoBack ?? false);\n }\n onFlowChange?.(step);\n },\n [onFlowChange],\n );\n\n /**\n * Add a message to the message list.\n */\n const addMessage = useCallback((message: FlowMessage) => {\n const messageWithId = {\n ...message,\n id: message.id ?? `msg-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,\n };\n\n setMessages(prev => [...prev, messageWithId]);\n }, []);\n\n /**\n * Remove a specific message by ID.\n */\n const removeMessage = useCallback((messageId: string) => {\n setMessages(prev => prev.filter(msg => msg.id !== messageId));\n }, []);\n\n /**\n * Clear all messages.\n */\n const clearMessages = useCallback(() => {\n setMessages([]);\n }, []);\n\n /**\n * Reset the flow context to initial state.\n */\n const reset = useCallback(() => {\n setCurrentStepState(initialStep);\n setTitle(initialTitle);\n setSubtitle(initialSubtitle);\n setMessages([]);\n setError(null);\n setIsLoading(false);\n setShowBackButton(false);\n setOnGoBack(undefined);\n }, [initialStep, initialTitle, initialSubtitle]);\n\n /**\n * Navigate to a different authentication flow.\n */\n const navigateToFlow = useCallback(\n (\n flowType: NonNullable<FlowStep>['type'],\n options?: {\n title?: string;\n subtitle?: string;\n metadata?: Record<string, any>;\n },\n ) => {\n const stepId = `${flowType}-${Date.now()}`;\n const step: NonNullable<FlowStep> = {\n id: stepId,\n type: flowType,\n title: options?.title,\n subtitle: options?.subtitle,\n canGoBack: flowType !== 'signin', // Usually allow going back except for main signin\n metadata: options?.metadata,\n };\n\n setCurrentStep(step);\n clearMessages();\n setError(null);\n },\n [setCurrentStep, clearMessages],\n );\n\n const contextValue: FlowContextValue = useMemo(\n () => ({\n currentStep,\n setCurrentStep,\n title,\n setTitle,\n subtitle,\n setSubtitle,\n messages,\n addMessage,\n removeMessage,\n clearMessages,\n error,\n setError,\n isLoading,\n setIsLoading,\n showBackButton,\n setShowBackButton,\n onGoBack,\n setOnGoBack,\n reset,\n navigateToFlow,\n }),\n [\n currentStep,\n setCurrentStep,\n title,\n subtitle,\n messages,\n addMessage,\n removeMessage,\n clearMessages,\n error,\n isLoading,\n showBackButton,\n onGoBack,\n reset,\n navigateToFlow,\n ],\n );\n\n return <FlowContext.Provider value={contextValue}>{children}</FlowContext.Provider>;\n};\n\nexport default FlowProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {createContext} from 'react';\n\n/**\n * Types of authentication flows/steps that can be displayed.\n */\nexport type FlowStep = {\n id: string;\n type: 'signin' | 'signup' | 'organization-signin' | 'forgot-password' | 'reset-password' | 'verify-email' | 'mfa';\n title: string;\n subtitle?: string;\n canGoBack?: boolean;\n metadata?: Record<string, any>;\n} | null;\n\n/**\n * Message types for displaying in authentication flows.\n */\nexport interface FlowMessage {\n id?: string;\n type: 'success' | 'error' | 'warning' | 'info';\n message: string;\n dismissible?: boolean;\n}\n\n/**\n * Context value for managing authentication flow UI state.\n */\nexport interface FlowContextValue {\n // Current step/flow\n currentStep: FlowStep;\n setCurrentStep: (step: FlowStep) => void;\n\n // Title and subtitle\n title: string;\n setTitle: (title: string) => void;\n subtitle?: string;\n setSubtitle: (subtitle?: string) => void;\n\n // Messages\n messages: FlowMessage[];\n addMessage: (message: FlowMessage) => void;\n removeMessage: (messageId: string) => void;\n clearMessages: () => void;\n\n // Error state\n error: string | null;\n setError: (error: string | null) => void;\n\n // Loading state\n isLoading: boolean;\n setIsLoading: (loading: boolean) => void;\n\n // Navigation\n showBackButton: boolean;\n setShowBackButton: (show: boolean) => void;\n onGoBack?: () => void;\n setOnGoBack: (callback?: () => void) => void;\n\n // Utilities\n reset: () => void;\n navigateToFlow: (\n flowType: NonNullable<FlowStep>['type'],\n options?: {\n title?: string;\n subtitle?: string;\n metadata?: Record<string, any>;\n },\n ) => void;\n}\n\n/**\n * Context for managing authentication flow UI state.\n * This context handles titles, messages, navigation, and loading states\n * for authentication flows like SignIn, SignUp, organization signin, etc.\n */\nconst FlowContext = createContext<FlowContextValue | undefined>(undefined);\n\nFlowContext.displayName = 'FlowContext';\n\nexport default FlowContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactElement, useCallback, useEffect, useMemo, useState} from 'react';\nimport {I18nBundle, I18nPreferences, deepMerge} from '@asgardeo/browser';\nimport {getI18nBundles} from '@asgardeo/browser';\nimport I18nContext, {I18nContextValue} from './I18nContext';\n\nconst I18N_LANGUAGE_STORAGE_KEY = 'asgardeo-i18n-language';\n\nexport interface I18nProviderProps {\n /**\n * The i18n preferences from the AsgardeoProvider\n */\n preferences?: I18nPreferences;\n}\n\n/**\n * Detects the browser's default language or returns a fallback\n */\nconst detectBrowserLanguage = (): string => {\n if (typeof window !== 'undefined' && window.navigator) {\n return window.navigator.language || 'en-US';\n }\n return 'en-US';\n};\n\n/**\n * Gets the stored language from localStorage or returns null\n */\nconst getStoredLanguage = (): string | null => {\n if (typeof window !== 'undefined' && window.localStorage) {\n try {\n return window.localStorage.getItem(I18N_LANGUAGE_STORAGE_KEY);\n } catch (error) {\n // localStorage might not be available or accessible\n return null;\n }\n }\n return null;\n};\n\n/**\n * Stores the language in localStorage\n */\nconst storeLanguage = (language: string): void => {\n if (typeof window !== 'undefined' && window.localStorage) {\n try {\n window.localStorage.setItem(I18N_LANGUAGE_STORAGE_KEY, language);\n } catch (error) {\n // localStorage might not be available or accessible\n console.warn('Failed to store language preference:', error);\n }\n }\n};\n\n/**\n * I18nProvider component that manages internationalization state and provides\n * translation functions to child components.\n */\nconst I18nProvider: FC<PropsWithChildren<I18nProviderProps>> = ({\n children,\n preferences,\n}: PropsWithChildren<I18nProviderProps>): ReactElement => {\n // Get default bundles from the browser package\n const defaultBundles = getI18nBundles();\n\n // Determine the initial language based on preference order:\n // 1. User preference from config\n // 2. Stored language in localStorage\n // 3. Browser's default language\n // 4. Fallback language\n const determineInitialLanguage = (): string => {\n const configLanguage = preferences?.language;\n const storedLanguage = getStoredLanguage();\n const browserLanguage = detectBrowserLanguage();\n const fallbackLanguage = preferences?.fallbackLanguage || 'en-US';\n\n return configLanguage || storedLanguage || browserLanguage || fallbackLanguage;\n };\n\n const [currentLanguage, setCurrentLanguage] = useState<string>(determineInitialLanguage);\n\n // Merge default bundles with user-provided bundles\n const mergedBundles = useMemo(() => {\n const merged: Record<string, I18nBundle> = {};\n\n // Add default bundles\n Object.entries(defaultBundles).forEach(([key, bundle]) => {\n // Convert key format (e.g., 'en_US' to 'en-US')\n const languageKey = key.replace('_', '-');\n merged[languageKey] = bundle;\n });\n\n // Add user-provided bundles using deepMerge for better merging\n if (preferences?.bundles) {\n Object.entries(preferences.bundles).forEach(([key, userBundle]) => {\n if (merged[key]) {\n // Deep merge user bundle with existing default bundle\n merged[key] = {\n ...merged[key],\n translations: deepMerge(merged[key].translations, userBundle.translations),\n metadata: userBundle.metadata ? {...merged[key].metadata, ...userBundle.metadata} : merged[key].metadata,\n };\n } else {\n // No default bundle for this language, use user bundle as-is\n merged[key] = userBundle;\n }\n });\n }\n\n return merged;\n }, [defaultBundles, preferences?.bundles]);\n\n const fallbackLanguage = preferences?.fallbackLanguage || 'en-US';\n\n // Update stored language when current language changes\n useEffect(() => {\n storeLanguage(currentLanguage);\n }, [currentLanguage]);\n\n // Translation function\n const t = useCallback(\n (key: string, params?: Record<string, string | number>): string => {\n let translation: string | undefined;\n\n // Try to get translation from current language bundle\n const currentBundle = mergedBundles[currentLanguage];\n if (currentBundle?.translations[key]) {\n translation = currentBundle.translations[key];\n }\n\n // Fallback to fallback language if translation not found\n if (!translation && currentLanguage !== fallbackLanguage) {\n const fallbackBundle = mergedBundles[fallbackLanguage];\n if (fallbackBundle?.translations[key]) {\n translation = fallbackBundle.translations[key];\n }\n }\n\n // If still no translation found, return the key itself\n if (!translation) {\n translation = key;\n }\n\n // Replace parameters if provided\n if (params && Object.keys(params).length > 0) {\n return Object.entries(params).reduce((acc, [paramKey, paramValue]) => {\n return acc.replace(new RegExp(`\\\\{${paramKey}\\\\}`, 'g'), String(paramValue));\n }, translation);\n }\n\n return translation;\n },\n [mergedBundles, currentLanguage, fallbackLanguage],\n );\n\n // Language setter function\n const setLanguage = useCallback(\n (language: string) => {\n if (mergedBundles[language]) {\n setCurrentLanguage(language);\n } else {\n console.warn(\n `Language '${language}' is not available. Available languages: ${Object.keys(mergedBundles).join(', ')}`,\n );\n }\n },\n [mergedBundles],\n );\n\n const contextValue: I18nContextValue = useMemo(\n () => ({\n currentLanguage,\n fallbackLanguage,\n bundles: mergedBundles,\n setLanguage,\n t,\n }),\n [currentLanguage, fallbackLanguage, mergedBundles, setLanguage, t],\n );\n\n return <I18nContext.Provider value={contextValue}>{children}</I18nContext.Provider>;\n};\n\nexport default I18nProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {createContext} from 'react';\nimport {I18nBundle} from '@asgardeo/browser';\n\nexport interface I18nContextValue {\n /**\n * The current language code (e.g., 'en-US', 'fr-FR')\n */\n currentLanguage: string;\n \n /**\n * The fallback language code\n */\n fallbackLanguage: string;\n \n /**\n * All available i18n bundles (default + user provided)\n */\n bundles: Record<string, I18nBundle>;\n \n /**\n * Function to change the current language\n */\n setLanguage: (language: string) => void;\n \n /**\n * Function to get a translation by key with optional parameters\n */\n t: (key: string, params?: Record<string, string | number>) => string;\n}\n\nconst I18nContext = createContext<I18nContextValue | null>(null);\n\nI18nContext.displayName = 'I18nContext';\n\nexport default I18nContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AsgardeoRuntimeError, Organization, AllOrganizationsApiResponse} from '@asgardeo/browser';\nimport {FC, PropsWithChildren, ReactElement, useCallback, useMemo, useState} from 'react';\nimport OrganizationContext, {OrganizationContextProps} from './OrganizationContext';\n\n/**\n * Props interface of {@link OrganizationProvider}\n */\nexport interface OrganizationProviderProps {\n /**\n * Whether to automatically fetch organizations on mount\n */\n autoFetch?: boolean;\n /**\n * Initial current organization\n */\n currentOrganization?: Organization | null;\n /**\n * List of organizations the signed-in user belongs to.\n */\n myOrganizations?: Organization[];\n /**\n * Callback function called when an error occurs\n */\n onError?: (error: string) => void;\n /**\n * Callback function called when switching organizations\n */\n onOrganizationSwitch?: (organization: Organization) => Promise<void>;\n /**\n * Initial list of organizations\n */\n getAllOrganizations?: () => Promise<AllOrganizationsApiResponse>;\n /**\n * Refetch the my organizations list.\n * @returns\n */\n revalidateMyOrganizations: () => Promise<Organization[]>;\n}\n\n/**\n * OrganizationProvider component that manages organization data and provides it through OrganizationContext.\n *\n * This provider:\n * - Fetches organization data from the organizations endpoint\n * - Manages current organization state\n * - Provides functions for switching organizations and refreshing data\n * - Handles loading states and errors\n *\n * @example\n * ```tsx\n * // Basic usage with auto-fetch (uses internal API)\n * <OrganizationProvider>\n * <App />\n * </OrganizationProvider>\n *\n * // With custom error handling\n * <OrganizationProvider onError={(error) => console.error('Organization error:', error)}>\n * <App />\n * </OrganizationProvider>\n *\n * // With custom organization switch handler\n * <OrganizationProvider\n * onOrganizationSwitch={(org) => console.log('Switched to:', org.name)}\n * >\n * <App />\n * </OrganizationProvider>\n *\n * // Disable auto-fetch (fetch manually using revalidateMyOrganizations)\n * <OrganizationProvider autoFetch={false}>\n * <App />\n * </OrganizationProvider>\n * ```\n */\nconst OrganizationProvider: FC<PropsWithChildren<OrganizationProviderProps>> = ({\n children,\n currentOrganization,\n onError,\n myOrganizations,\n onOrganizationSwitch,\n revalidateMyOrganizations,\n getAllOrganizations,\n}: PropsWithChildren<OrganizationProviderProps>): ReactElement => {\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string | null>(null);\n\n /**\n * Switches to a different organization\n */\n const switchOrganization: (organization: Organization) => Promise<void> = useCallback(\n async (organization: Organization): Promise<void> => {\n if (!onOrganizationSwitch) {\n throw new AsgardeoRuntimeError(\n 'onOrganizationSwitch callback is required',\n 'OrganizationProvider-SwitchError-001',\n 'react',\n 'The onOrganizationSwitch callback must be provided to handle organization switching.',\n );\n }\n\n setIsLoading(true);\n setError(null);\n\n try {\n await onOrganizationSwitch(organization);\n // The organization state will be updated by the parent provider\n } catch (switchError) {\n const errorMessage: string =\n switchError instanceof Error ? switchError.message : 'Failed to switch organization';\n setError(errorMessage);\n if (onError) {\n onError(errorMessage);\n }\n throw switchError; // Re-throw so the UI can handle it\n } finally {\n setIsLoading(false);\n }\n },\n [onOrganizationSwitch, onError],\n );\n\n const contextValue: OrganizationContextProps = useMemo(\n () => ({\n currentOrganization,\n error,\n isLoading,\n myOrganizations,\n switchOrganization,\n revalidateMyOrganizations,\n getAllOrganizations,\n }),\n [\n currentOrganization,\n error,\n isLoading,\n myOrganizations,\n switchOrganization,\n revalidateMyOrganizations,\n getAllOrganizations,\n ],\n );\n\n return <OrganizationContext.Provider value={contextValue}>{children}</OrganizationContext.Provider>;\n};\n\nexport default OrganizationProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AllOrganizationsApiResponse, Organization} from '@asgardeo/browser';\nimport {Context, createContext} from 'react';\n\n/**\n * Props interface of {@link OrganizationContext}\n */\nexport type OrganizationContextProps = {\n currentOrganization: Organization | null;\n error: string | null;\n isLoading: boolean;\n myOrganizations: Organization[];\n switchOrganization: (organization: Organization) => Promise<void>;\n revalidateMyOrganizations: () => Promise<Organization[]>;\n getAllOrganizations: () => Promise<AllOrganizationsApiResponse>;\n};\n\n/**\n * Context object for managing organization data and related operations.\n */\nconst OrganizationContext: Context<OrganizationContextProps | null> = createContext<null | OrganizationContextProps>({\n currentOrganization: null,\n error: null,\n isLoading: false,\n myOrganizations: null,\n switchOrganization: () => Promise.resolve(),\n revalidateMyOrganizations: () => Promise.resolve([]),\n getAllOrganizations: () =>\n Promise.resolve({\n count: 0,\n organizations: [],\n }),\n});\n\nOrganizationContext.displayName = 'OrganizationContext';\n\nexport default OrganizationContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactElement, useEffect, useMemo, useState, useCallback} from 'react';\nimport {\n createTheme,\n Theme,\n ThemeConfig,\n ThemeMode,\n RecursivePartial,\n detectThemeMode,\n createClassObserver,\n createMediaQueryListener,\n BrowserThemeDetection,\n ThemePreferences,\n} from '@asgardeo/browser';\nimport ThemeContext from './ThemeContext';\nimport useBrandingContext from '../Branding/useBrandingContext';\n\nexport interface ThemeProviderProps {\n theme?: RecursivePartial<ThemeConfig>;\n /**\n * The theme mode to use for automatic detection\n * - 'light': Always use light theme\n * - 'dark': Always use dark theme\n * - 'system': Use system preference (prefers-color-scheme media query)\n * - 'class': Detect theme based on CSS classes on HTML element\n * - 'branding': Use active theme from branding preference (requires inheritFromBranding=true)\n */\n mode?: ThemeMode | 'branding';\n /**\n * Configuration for theme detection when using 'class' or 'system' mode\n */\n detection?: BrowserThemeDetection;\n /**\n * Configuration for branding integration\n */\n inheritFromBranding?: ThemePreferences['inheritFromBranding'];\n}\n\nconst applyThemeToDOM = (theme: Theme) => {\n Object.entries(theme.cssVariables).forEach(([key, value]) => {\n document.documentElement.style.setProperty(key, value);\n });\n};\n\n/**\n * ThemeProvider component that manages theme state and provides theme context to child components.\n *\n * This provider integrates with Asgardeo branding preferences to automatically apply\n * organization-specific themes while allowing for custom theme overrides.\n *\n * Features:\n * - Automatic theme mode detection (light/dark/system/class)\n * - Integration with Asgardeo branding API through useBranding hook\n * - Merging of branding themes with custom theme configurations\n * - CSS variable injection for easy styling\n * - Loading and error states for branding integration\n *\n * @example\n * Basic usage with branding integration:\n * ```tsx\n * <ThemeProvider inheritFromBranding={true}>\n * <App />\n * </ThemeProvider>\n * ```\n *\n * @example\n * With custom theme overrides:\n * ```tsx\n * <ThemeProvider\n * theme={{\n * colors: {\n * primary: { main: '#custom-color' }\n * }\n * }}\n * inheritFromBranding={true}\n * >\n * <App />\n * </ThemeProvider>\n * ```\n *\n * @example\n * With branding-driven theme mode:\n * ```tsx\n * <ThemeProvider\n * mode=\"branding\"\n * inheritFromBranding={true}\n * >\n * <App />\n * </ThemeProvider>\n * ```\n */\nconst ThemeProvider: FC<PropsWithChildren<ThemeProviderProps>> = ({\n children,\n theme: themeConfig,\n mode = 'system',\n detection = {},\n inheritFromBranding = true,\n}: PropsWithChildren<ThemeProviderProps>): ReactElement => {\n const [colorScheme, setColorScheme] = useState<'light' | 'dark'>(() => {\n // Initialize with detected theme mode or fallback to defaultMode\n if (mode === 'light' || mode === 'dark') {\n return mode;\n }\n // For 'branding' mode, start with system preference and update when branding loads\n if (mode === 'branding') {\n return detectThemeMode('system', detection);\n }\n return detectThemeMode(mode, detection);\n });\n\n // Use branding theme if inheritFromBranding is enabled\n // Handle case where BrandingProvider might not be available\n let brandingTheme = null;\n let brandingActiveTheme = null;\n let isBrandingLoading = false;\n let brandingError = null;\n\n try {\n const brandingContext = useBrandingContext();\n brandingTheme = brandingContext.theme;\n brandingActiveTheme = brandingContext.activeTheme;\n isBrandingLoading = brandingContext.isLoading;\n brandingError = brandingContext.error;\n } catch (error) {\n // BrandingProvider not available, fall back to no branding\n if (inheritFromBranding) {\n console.warn(\n 'ThemeProvider: inheritFromBranding is enabled but BrandingProvider is not available. ' +\n 'Make sure to wrap your app with BrandingProvider or AsgardeoProvider with branding preferences.',\n );\n }\n }\n\n // Update color scheme based on branding active theme when available\n useEffect(() => {\n if (inheritFromBranding && brandingActiveTheme) {\n // Update color scheme based on mode preference\n if (mode === 'branding') {\n // Always follow branding active theme\n setColorScheme(brandingActiveTheme);\n } else if (mode === 'system' && !isBrandingLoading) {\n // For system mode, prefer branding but allow system override if no branding\n setColorScheme(brandingActiveTheme);\n }\n }\n }, [inheritFromBranding, brandingActiveTheme, mode, isBrandingLoading]);\n\n // Merge user-provided theme config with branding theme\n const finalThemeConfig = useMemo(() => {\n if (!inheritFromBranding || !brandingTheme) {\n return themeConfig;\n }\n\n // Convert branding theme to our theme config format\n const brandingThemeConfig: RecursivePartial<ThemeConfig> = {\n colors: brandingTheme.colors,\n borderRadius: brandingTheme.borderRadius,\n shadows: brandingTheme.shadows,\n spacing: brandingTheme.spacing,\n images: brandingTheme.images,\n };\n\n // Merge branding theme with user-provided theme config\n // User-provided config takes precedence over branding\n return {\n ...brandingThemeConfig,\n ...themeConfig,\n colors: {\n ...brandingThemeConfig.colors,\n ...themeConfig?.colors,\n },\n borderRadius: {\n ...brandingThemeConfig.borderRadius,\n ...themeConfig?.borderRadius,\n },\n shadows: {\n ...brandingThemeConfig.shadows,\n ...themeConfig?.shadows,\n },\n spacing: {\n ...brandingThemeConfig.spacing,\n ...themeConfig?.spacing,\n },\n images: {\n ...brandingThemeConfig.images,\n ...themeConfig?.images,\n },\n };\n }, [inheritFromBranding, brandingTheme, themeConfig]);\n\n const theme = useMemo(() => createTheme(finalThemeConfig, colorScheme === 'dark'), [finalThemeConfig, colorScheme]);\n\n const handleThemeChange = useCallback((isDark: boolean) => {\n setColorScheme(isDark ? 'dark' : 'light');\n }, []);\n\n const toggleTheme = useCallback(() => {\n setColorScheme(prev => (prev === 'light' ? 'dark' : 'light'));\n }, []);\n\n useEffect(() => {\n let observer: MutationObserver | null = null;\n let mediaQuery: MediaQueryList | null = null;\n\n // Don't set up automatic theme detection for branding mode\n if (mode === 'branding') {\n return null;\n }\n\n if (mode === 'class') {\n const targetElement = detection.targetElement || document.documentElement;\n if (targetElement) {\n observer = createClassObserver(targetElement, handleThemeChange, detection);\n }\n } else if (mode === 'system') {\n // Only set up system listener if not using branding or branding hasn't loaded yet\n if (!inheritFromBranding || !brandingActiveTheme) {\n mediaQuery = createMediaQueryListener(handleThemeChange);\n }\n }\n\n return () => {\n if (observer) {\n observer.disconnect();\n }\n if (mediaQuery) {\n // Clean up media query listener\n if (mediaQuery.removeEventListener) {\n mediaQuery.removeEventListener('change', handleThemeChange as any);\n } else {\n // Fallback for older browsers\n mediaQuery.removeListener(handleThemeChange as any);\n }\n }\n };\n }, [mode, detection, handleThemeChange, inheritFromBranding, brandingActiveTheme]);\n\n useEffect(() => {\n applyThemeToDOM(theme);\n }, [theme]);\n\n const value = {\n theme,\n colorScheme,\n toggleTheme,\n isBrandingLoading,\n brandingError,\n inheritFromBranding,\n };\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n};\n\nexport default ThemeProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {createContext} from 'react';\nimport {Theme} from '@asgardeo/browser';\n\nexport interface ThemeContextValue {\n theme: Theme;\n colorScheme: 'light' | 'dark';\n toggleTheme: () => void;\n /**\n * Whether branding theme is currently loading\n */\n isBrandingLoading?: boolean;\n /**\n * Error from branding theme fetch, if any\n */\n brandingError?: Error | null;\n /**\n * Whether branding inheritance is enabled\n */\n inheritFromBranding?: boolean;\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\nThemeContext.displayName = 'ThemeContext';\n\nexport default ThemeContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport BrandingContext, {BrandingContextValue} from './BrandingContext';\n\n/**\n * Hook to access the branding context.\n * This hook provides access to branding preferences, theme data, and loading states.\n *\n * @returns The branding context value containing branding preference data, theme, and control functions\n * @throws Error if used outside of a BrandingProvider\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { theme, activeTheme, isLoading, error } = useBrandingContext();\n *\n * if (isLoading) return <div>Loading branding...</div>;\n * if (error) return <div>Error: {error.message}</div>;\n *\n * return (\n * <div style={{ color: theme?.colors?.primary?.main }}>\n * <p>Active theme mode: {activeTheme}</p>\n * <p>Styled with Asgardeo branding</p>\n * </div>\n * );\n * }\n * ```\n */\nconst useBrandingContext = (): BrandingContextValue => {\n const context = useContext(BrandingContext);\n if (!context) {\n throw new Error('useBrandingContext must be used within a BrandingProvider');\n }\n return context;\n};\n\nexport default useBrandingContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {createContext} from 'react';\nimport {BrandingPreference, Theme} from '@asgardeo/browser';\n\nexport interface BrandingContextValue {\n /**\n * The raw branding preference data\n */\n brandingPreference: BrandingPreference | null;\n /**\n * The transformed theme object\n */\n theme: Theme | null;\n /**\n * The active theme mode from branding preference ('light' | 'dark')\n */\n activeTheme: 'light' | 'dark' | null;\n /**\n * Loading state\n */\n isLoading: boolean;\n /**\n * Error state\n */\n error: Error | null;\n /**\n * Function to manually fetch branding preference\n */\n fetchBranding: () => Promise<void>;\n /**\n * Function to refetch branding preference\n * This bypasses the single-call restriction and forces a new API call\n */\n refetch: () => Promise<void>;\n}\n\nconst BrandingContext = createContext<BrandingContextValue | null>(null);\n\nBrandingContext.displayName = 'BrandingContext';\n\nexport default BrandingContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactElement, useCallback, useEffect, useState} from 'react';\nimport {BrandingPreference, Theme, transformBrandingPreferenceToTheme} from '@asgardeo/browser';\nimport BrandingContext from './BrandingContext';\n\n/**\n * Configuration options for the BrandingProvider\n */\nexport interface BrandingProviderProps {\n /**\n * The branding preference data passed from parent (typically AsgardeoProvider)\n */\n brandingPreference?: BrandingPreference | null;\n /**\n * Force a specific theme ('light' or 'dark')\n * If not provided, will use the activeTheme from branding preference\n */\n forceTheme?: 'light' | 'dark';\n /**\n * Whether the branding provider is enabled\n * @default true\n */\n enabled?: boolean;\n /**\n * Loading state passed from parent\n */\n isLoading?: boolean;\n /**\n * Error state passed from parent\n */\n error?: Error | null;\n /**\n * Function to refetch branding preference passed from parent\n */\n refetch?: () => Promise<void>;\n}\n\n/**\n * BrandingProvider component that manages branding state and provides branding context to child components.\n *\n * This provider receives branding preferences from a parent component (typically AsgardeoProvider)\n * and transforms them into theme objects, making them available to all child components.\n *\n * Features:\n * - Receives branding preferences as props\n * - Theme transformation from branding preferences\n * - Loading and error states\n * - Support for custom theme forcing\n *\n * @example\n * Basic usage (typically used within AsgardeoProvider):\n * ```tsx\n * <BrandingProvider\n * brandingPreference={brandingData}\n * isLoading={isFetching}\n * error={fetchError}\n * >\n * <App />\n * </BrandingProvider>\n * ```\n *\n * @example\n * With custom theme forcing:\n * ```tsx\n * <BrandingProvider\n * brandingPreference={brandingData}\n * forceTheme=\"dark\"\n * enabled={true}\n * >\n * <App />\n * </BrandingProvider>\n * ```\n */\nconst BrandingProvider: FC<PropsWithChildren<BrandingProviderProps>> = ({\n children,\n brandingPreference: externalBrandingPreference,\n forceTheme,\n enabled = true,\n isLoading: externalIsLoading = false,\n error: externalError = null,\n refetch: externalRefetch,\n}: PropsWithChildren<BrandingProviderProps>): ReactElement => {\n const [theme, setTheme] = useState<Theme | null>(null);\n const [activeTheme, setActiveTheme] = useState<'light' | 'dark' | null>(null);\n\n // Process branding preference when it changes\n useEffect(() => {\n if (!enabled || !externalBrandingPreference) {\n setTheme(null);\n setActiveTheme(null);\n return;\n }\n\n // Extract active theme from branding preference\n const activeThemeFromBranding = externalBrandingPreference?.preference?.theme?.activeTheme;\n let extractedActiveTheme: 'light' | 'dark' | null = null;\n\n if (activeThemeFromBranding) {\n // Convert to lowercase and map to our expected values\n const themeMode = activeThemeFromBranding.toLowerCase();\n if (themeMode === 'light' || themeMode === 'dark') {\n extractedActiveTheme = themeMode;\n }\n }\n\n setActiveTheme(extractedActiveTheme);\n\n // Transform branding preference to theme\n const transformedTheme = transformBrandingPreferenceToTheme(externalBrandingPreference, forceTheme);\n setTheme(transformedTheme);\n }, [externalBrandingPreference, forceTheme, enabled]);\n\n // Reset state when disabled\n useEffect(() => {\n if (!enabled) {\n setTheme(null);\n setActiveTheme(null);\n }\n }, [enabled]);\n\n // Dummy fetchBranding for backward compatibility\n const fetchBranding = useCallback(async (): Promise<void> => {\n if (externalRefetch) {\n await externalRefetch();\n }\n }, [externalRefetch]);\n\n const value = {\n brandingPreference: externalBrandingPreference || null,\n theme,\n activeTheme,\n isLoading: externalIsLoading,\n error: externalError,\n fetchBranding,\n refetch: externalRefetch || fetchBranding,\n };\n\n return <BrandingContext.Provider value={value}>{children}</BrandingContext.Provider>;\n};\n\nexport default BrandingProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {UpdateMeProfileConfig, User, UserProfile} from '@asgardeo/browser';\nimport {FC, PropsWithChildren, ReactElement, useEffect, useState, useCallback, useMemo} from 'react';\nimport UserContext from './UserContext';\n\n/**\n * Props interface of {@link UserProvider}\n */\nexport interface UserProviderProps {\n profile: UserProfile;\n revalidateProfile?: () => Promise<void>;\n updateProfile?: (\n requestConfig: UpdateMeProfileConfig,\n sessionId?: string,\n ) => Promise<{success: boolean; data: {user: User}; error: string}>;\n onUpdateProfile?: (payload: User) => void;\n}\n\n/**\n * UserProvider component that manages user profile data and provides it through UserContext.\n *\n * This provider:\n * - Fetches user profile data from the ME endpoint\n * - Retrieves SCIM2 schemas for profile structure\n * - Generates both nested and flattened user profiles\n * - Provides functions for refreshing and updating user data\n * - Handles loading states and errors\n *\n * @example\n * ```tsx\n * // Basic usage\n * <UserProvider>\n * <App />\n * </UserProvider>\n *\n * // With custom error handling\n * <UserProvider onError={(error) => console.error('User error:', error)}>\n * <App />\n * </UserProvider>\n *\n * // Disable auto-fetch (fetch manually using refreshUser)\n * <UserProvider autoFetch={false}>\n * <App />\n * </UserProvider>\n * ```\n */\nconst UserProvider: FC<PropsWithChildren<UserProviderProps>> = ({\n children,\n profile,\n revalidateProfile,\n onUpdateProfile,\n updateProfile,\n}: PropsWithChildren<UserProviderProps>): ReactElement => {\n const contextValue = useMemo(\n () => ({\n schemas: profile?.schemas,\n profile: profile?.profile,\n flattenedProfile: profile?.flattenedProfile,\n revalidateProfile,\n updateProfile,\n onUpdateProfile,\n }),\n [profile, onUpdateProfile, revalidateProfile, updateProfile],\n );\n\n return <UserContext.Provider value={contextValue}>{children}</UserContext.Provider>;\n};\n\nexport default UserProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User, Schema, UpdateMeProfileConfig, OrganizationDetails} from '@asgardeo/browser';\nimport {Context, createContext} from 'react';\n\n/**\n * Props interface of {@link UserContext}\n */\nexport type UserContextProps = {\n flattenedProfile: User | null;\n profile: User | null;\n revalidateProfile: () => Promise<void>;\n schemas: Schema[] | null;\n updateProfile: (\n requestConfig: UpdateMeProfileConfig,\n sessionId?: string,\n ) => Promise<{success: boolean; data: {user: User}; error: string}>;\n onUpdateProfile: (payload: User) => void;\n};\n\n/**\n * Context object for managing user profile data and related operations.\n */\nconst UserContext: Context<UserContextProps | null> = createContext<null | UserContextProps>({\n profile: null,\n schemas: null,\n flattenedProfile: null,\n revalidateProfile: () => null,\n updateProfile: () => null,\n onUpdateProfile: () => null,\n});\n\nUserContext.displayName = 'UserContext';\n\nexport default UserContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport AsgardeoContext, {AsgardeoContextProps} from './AsgardeoContext';\n\nconst useAsgardeo = (): AsgardeoContextProps => {\n const context: AsgardeoContextProps | null = useContext(AsgardeoContext);\n\n if (!context) {\n throw new Error('useAsgardeo must be used within an AsgardeoProvider');\n }\n\n return context;\n};\n\nexport default useAsgardeo;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport UserContext, {UserContextProps} from './UserContext';\n\n/**\n * Hook to access the User context.\n *\n * This hook provides access to user profile data including:\n * - Raw profile API response\n * - SCIM2 schemas\n * - Nested user object\n * - Flattened user profile\n * - Functions to refresh and update user data\n * - Loading states and error handling\n *\n * @returns {UserContextProps} The user context value containing all user-related data and functions\n * @throws {Error} Throws an error if used outside of UserProvider\n *\n * @example\n * ```tsx\n * import {useUser} from '@asgardeo/react';\n *\n * function ProfileComponent() {\n * const {\n * isLoading,\n * profile,\n * schemas,\n * user,\n * flattenedUser,\n * refreshUser,\n * updateUser,\n * error\n * } = useUser();\n *\n * if (isLoading) {\n * return <div>Loading user data...</div>;\n * }\n *\n * if (error) {\n * return <div>Error: {error.message}</div>;\n * }\n *\n * return (\n * <div>\n * <h1>Welcome {user?.name?.givenName}!</h1>\n * <p>Email: {flattenedUser?.emails}</p>\n * <button onClick={refreshUser}>Refresh Profile</button>\n * </div>\n * );\n * }\n *\n * // Access specific user properties\n * function UserEmail() {\n * const {flattenedUser} = useUser();\n * return <span>{flattenedUser?.emails?.[0]}</span>;\n * }\n *\n * // Update user profile\n * function EditProfile() {\n * const {updateUser, user} = useUser();\n *\n * const handleUpdate = async () => {\n * try {\n * await updateUser({\n * name: {\n * givenName: 'John',\n * familyName: 'Doe'\n * }\n * });\n * } catch (error) {\n * console.error('Update failed:', error);\n * }\n * };\n *\n * return <button onClick={handleUpdate}>Update Name</button>;\n * }\n * ```\n */\nconst useUser = (): UserContextProps => {\n const context = useContext(UserContext);\n\n if (!context) {\n throw new Error('useUser must be used within a UserProvider');\n }\n\n return context;\n};\n\nexport default useUser;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport OrganizationContext, {OrganizationContextProps} from './OrganizationContext';\n\n/**\n * Hook to access the Organization context.\n *\n * This hook provides access to organization data including:\n * - List of organizations the user belongs to\n * - Current organization\n * - Functions to switch organizations and refresh data\n * - Function to fetch organizations programmatically\n * - Loading states and error handling\n *\n * @returns {OrganizationContextProps} The organization context value containing all organization-related data and functions\n * @throws {Error} Throws an error if used outside of OrganizationProvider\n *\n * @example\n * ```tsx\n * import {useOrganization} from '@asgardeo/react';\n *\n * function OrganizationSelector() {\n * const {\n * organizations,\n * currentOrganization,\n * switchOrganization,\n * revalidateMyOrganizations,\n * getOrganizations,\n * isLoading,\n * error\n * } = useOrganization();\n *\n * if (isLoading) {\n * return <div>Loading organizations...</div>;\n * }\n *\n * if (error) {\n * return <div>Error: {error}</div>;\n * }\n *\n * return (\n * <div>\n * <h2>Current: {currentOrganization?.name}</h2>\n * <select\n * value={currentOrganization?.id || ''}\n * onChange={(e) => {\n * const org = organizations?.find(o => o.id === e.target.value);\n * if (org) switchOrganization(org);\n * }}\n * >\n * {organizations?.map(org => (\n * <option key={org.id} value={org.id}>\n * {org.name}\n * </option>\n * ))}\n * </select>\n * <button onClick={revalidateMyOrganizations}>\n * Refresh Organizations\n * </button>\n * <button onClick={async () => {\n * const fresh = await getOrganizations();\n * console.log('Fresh organizations:', fresh);\n * }}>\n * Get Organizations Manually\n * </button>\n * </div>\n * );\n * }\n *\n * // Switch to a specific organization\n * function SwitchOrgButton() {\n * const {organizations, switchOrganization} = useOrganization();\n *\n * const handleSwitch = (orgId: string) => {\n * const org = organizations?.find(o => o.id === orgId);\n * if (org) {\n * switchOrganization(org);\n * }\n * };\n *\n * return (\n * <button onClick={() => handleSwitch('org-123')}>\n * Switch to Organization\n * </button>\n * );\n * }\n * ```\n */\nconst useOrganization = (): OrganizationContextProps => {\n const context: OrganizationContextProps | null = useContext(OrganizationContext);\n\n if (!context) {\n throw new Error('useOrganization must be used within an OrganizationProvider');\n }\n\n return context;\n};\n\nexport default useOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport FlowContext, {FlowContextValue} from './FlowContext';\n\n/**\n * Hook to access the flow context.\n * Must be used within a FlowProvider.\n *\n * @example\n * ```tsx\n * const MyAuthComponent = () => {\n * const { title, setTitle, addMessage, isLoading } = useFlow();\n *\n * const handleSuccess = () => {\n * addMessage({\n * type: 'success',\n * message: 'Authentication successful!'\n * });\n * };\n *\n * return (\n * <div>\n * <h1>{title}</h1>\n * {isLoading && <p>Loading...</p>}\n * </div>\n * );\n * };\n * ```\n *\n * @returns The flow context value\n * @throws Error if used outside of FlowProvider\n */\nconst useFlow = (): FlowContextValue => {\n const context = useContext(FlowContext);\n\n if (!context) {\n throw new Error('useFlow must be used within a FlowProvider');\n }\n\n return context;\n};\n\nexport default useFlow;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport I18nContext, {I18nContextValue} from './I18nContext';\n\n/**\n * Hook for accessing the I18n context directly.\n * Provides access to the full i18n context including bundles and all utilities.\n *\n * @returns The complete I18n context value\n * @throws Error if used outside of I18nProvider context\n */\nconst useI18n = (): I18nContextValue => {\n const context = useContext(I18nContext);\n\n if (!context) {\n throw new Error(\n 'useI18n must be used within an I18nProvider. Make sure your component is wrapped with AsgardeoProvider which includes I18nProvider.',\n );\n }\n\n return context;\n};\n\nexport default useI18n;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport ThemeContext, {ThemeContextValue} from './ThemeContext';\n\nconst useTheme = (): ThemeContextValue => {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context;\n};\n\nexport default useTheme;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext, useMemo} from 'react';\nimport {deepMerge, I18nBundle, I18nPreferences} from '@asgardeo/browser';\nimport I18nContext, {I18nContextValue} from '../contexts/I18n/I18nContext';\n\nexport interface UseTranslation {\n /**\n * Translation function that returns a translated string for the given key\n */\n t: (key: string, params?: Record<string, string | number>) => string;\n\n /**\n * The current language code\n */\n currentLanguage: string;\n\n /**\n * Function to change the current language\n */\n setLanguage: (language: string) => void;\n\n /**\n * All available language codes\n */\n availableLanguages: string[];\n}\n\nexport interface UseTranslationWithPreferences extends UseTranslation {\n /**\n * Enhanced translation function that merges component-level preferences\n */\n t: (key: string, params?: Record<string, string | number>) => string;\n}\n\n/**\n * Hook for accessing translation functions and language management.\n * Must be used within an I18nProvider context.\n *\n * @param componentPreferences - Optional component-level i18n preferences to merge with global ones\n * @returns An object containing translation function and language management utilities\n * @throws Error if used outside of I18nProvider context\n */\nconst useTranslation = (componentPreferences?: I18nPreferences): UseTranslationWithPreferences => {\n const context = useContext(I18nContext);\n\n if (!context) {\n throw new Error(\n 'useTranslation must be used within an I18nProvider. Make sure your component is wrapped with AsgardeoProvider which includes I18nProvider.',\n );\n }\n\n const {t: globalT, currentLanguage, setLanguage, bundles: globalBundles, fallbackLanguage} = context;\n\n // Merge global bundles with component-level bundles if provided\n const mergedBundles = useMemo(() => {\n if (!componentPreferences?.bundles) {\n return globalBundles;\n }\n\n const merged: Record<string, I18nBundle> = {};\n\n // Start with global bundles\n Object.entries(globalBundles).forEach(([key, bundle]) => {\n merged[key] = bundle;\n });\n\n // Merge component-level bundles using deepMerge for better merging\n Object.entries(componentPreferences.bundles).forEach(([key, componentBundle]) => {\n if (merged[key]) {\n // Deep merge component bundle with existing global bundle\n merged[key] = {\n ...merged[key],\n translations: deepMerge(merged[key].translations, componentBundle.translations),\n metadata: componentBundle.metadata\n ? {...merged[key].metadata, ...componentBundle.metadata}\n : merged[key].metadata,\n };\n } else {\n // No global bundle for this language, use component bundle as-is\n merged[key] = componentBundle;\n }\n });\n\n return merged;\n }, [globalBundles, componentPreferences?.bundles]);\n\n // Create enhanced translation function that uses merged bundles\n const enhancedT = useMemo(() => {\n if (!componentPreferences?.bundles) {\n // No component preferences, use global translation function\n return globalT;\n }\n\n return (key: string, params?: Record<string, string | number>): string => {\n let translation: string | undefined;\n\n // Try to get translation from current language bundle\n const currentBundle = mergedBundles[currentLanguage];\n if (currentBundle?.translations[key]) {\n translation = currentBundle.translations[key];\n }\n\n // Fallback to fallback language if translation not found\n if (!translation && currentLanguage !== fallbackLanguage) {\n const fallbackBundle = mergedBundles[fallbackLanguage];\n if (fallbackBundle?.translations[key]) {\n translation = fallbackBundle.translations[key];\n }\n }\n\n // If still no translation found, return the key itself\n if (!translation) {\n translation = key;\n }\n\n // Replace parameters if provided\n if (params && Object.keys(params).length > 0) {\n return Object.entries(params).reduce((acc, [paramKey, paramValue]) => {\n return acc.replace(new RegExp(`\\\\{${paramKey}\\\\}`, 'g'), String(paramValue));\n }, translation);\n }\n\n return translation;\n };\n }, [mergedBundles, currentLanguage, fallbackLanguage, globalT, componentPreferences?.bundles]);\n\n return {\n t: enhancedT,\n currentLanguage,\n setLanguage,\n availableLanguages: Object.keys(mergedBundles),\n };\n};\n\nexport default useTranslation;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useState, useCallback} from 'react';\n\n/**\n * Generic form field configuration\n */\nexport interface FormField {\n initialValue?: string;\n name: string;\n required?: boolean;\n validator?: (value: string) => string | null;\n}\n\n/**\n * Form validation result\n */\nexport interface ValidationResult {\n errors: Record<string, string>;\n isValid: boolean;\n}\n\n/**\n * Configuration for the useForm hook\n */\nexport interface UseFormConfig<T extends Record<string, string>> {\n /**\n * Form field definitions\n */\n fields?: FormField[];\n /**\n * Initial form values\n */\n initialValues?: Partial<T>;\n /**\n * Custom required field validation message\n */\n requiredMessage?: string;\n /**\n * Whether to validate on blur (default: true)\n */\n validateOnBlur?: boolean;\n /**\n * Whether to validate on change (default: false)\n */\n validateOnChange?: boolean;\n /**\n * Global form validator function\n */\n validator?: (values: T) => Record<string, string>;\n}\n\n/**\n * Return type for the useForm hook\n */\nexport interface UseFormReturn<T extends Record<string, string>> {\n /**\n * Clear all errors\n */\n clearErrors: () => void;\n /**\n * Current validation errors\n */\n errors: Record<keyof T, string>;\n /**\n * Get field props for easy integration with form components\n */\n getFieldProps: (name: keyof T) => {\n error: string | undefined;\n name: keyof T;\n onBlur: () => void;\n onChange: (value: string) => void;\n required: boolean;\n touched: boolean;\n value: string;\n };\n /**\n * Handle form submission\n */\n handleSubmit: (onSubmit: (values: T) => void | Promise<void>) => (e?: React.FormEvent) => Promise<void>;\n /**\n * Whether the form has been submitted\n */\n isSubmitted: boolean;\n /**\n * Whether the form is currently valid\n */\n isValid: boolean;\n /**\n * Reset the form to initial values\n */\n reset: () => void;\n /**\n * Set a field error\n */\n setError: (name: keyof T, error: string) => void;\n /**\n * Set multiple field errors\n */\n setErrors: (errors: Partial<Record<keyof T, string>>) => void;\n /**\n * Mark a field as touched\n */\n setTouched: (name: keyof T, touched?: boolean) => void;\n /**\n * Mark multiple fields as touched\n */\n setTouchedFields: (touched: Partial<Record<keyof T, boolean>>) => void;\n /**\n * Set a single field value\n */\n setValue: (name: keyof T, value: string) => void;\n /**\n * Set multiple field values\n */\n setValues: (values: Partial<T>) => void;\n /**\n * Mark all fields as touched\n */\n touchAllFields: () => void;\n /**\n * Validate all fields\n */\n validateForm: () => ValidationResult;\n /**\n * Current form values\n */\n values: T;\n /**\n * Validate a single field\n */\n validateField: (name: keyof T) => string | null;\n /**\n * Fields that have been touched by the user\n */\n touched: Record<keyof T, boolean>;\n}\n\n/**\n * Generic form hook that provides comprehensive form state management and validation.\n *\n * @template T - The type of form values (must extend Record<string, string>)\n * @param config - Configuration options for the form\n * @returns Form state and methods\n *\n * @example\n * ```tsx\n * interface LoginForm {\n * username: string;\n * password: string;\n * }\n *\n * const {\n * values,\n * touched,\n * errors,\n * isValid,\n * setValue,\n * handleSubmit,\n * getFieldProps\n * } = useForm<LoginForm>({\n * initialValues: { username: '', password: '' },\n * fields: [\n * { name: 'username', required: true },\n * { name: 'password', required: true }\n * ]\n * });\n *\n * const onSubmit = handleSubmit((values) => {\n * console.log('Form submitted:', values);\n * });\n *\n * return (\n * <form onSubmit={onSubmit}>\n * <input {...getFieldProps('username')} />\n * <input {...getFieldProps('password')} type=\"password\" />\n * <button type=\"submit\" disabled={!isValid}>Submit</button>\n * </form>\n * );\n * ```\n */\nexport const useForm = <T extends Record<string, string>>(config: UseFormConfig<T> = {}): UseFormReturn<T> => {\n const {\n initialValues = {} as T,\n fields = [],\n validator,\n validateOnChange = false,\n validateOnBlur = true,\n requiredMessage = 'This field is required',\n } = config;\n\n // Initialize form state\n const [values, setFormValues] = useState<T>({...initialValues} as T);\n const [touched, setFormTouched] = useState<Record<keyof T, boolean>>({} as Record<keyof T, boolean>);\n const [errors, setFormErrors] = useState<Record<keyof T, string>>({} as Record<keyof T, string>);\n const [isSubmitted, setIsSubmitted] = useState(false);\n\n // Get field configuration by name\n const getFieldConfig = useCallback(\n (name: keyof T): FormField | undefined => fields.find(field => field.name === name),\n [fields],\n );\n\n // Validate a single field\n const validateField = useCallback(\n (name: keyof T): string | null => {\n const value = values[name] || '';\n const fieldConfig = getFieldConfig(name);\n\n // Check required validation\n if (fieldConfig?.required && (!value || value.trim() === '')) {\n return requiredMessage;\n }\n\n // Run custom field validator\n if (fieldConfig?.validator) {\n const fieldError = fieldConfig.validator(value);\n if (fieldError) return fieldError;\n }\n\n return null;\n },\n [values, getFieldConfig, requiredMessage],\n );\n\n // Validate the entire form\n const validateForm = useCallback((): ValidationResult => {\n const newErrors: Record<keyof T, string> = {} as Record<keyof T, string>;\n\n // Validate individual fields\n fields.forEach(field => {\n const error = validateField(field.name as keyof T);\n if (error) {\n newErrors[field.name as keyof T] = error;\n }\n });\n\n // Run global validator if provided\n if (validator) {\n const globalErrors = validator(values);\n Object.keys(globalErrors).forEach(key => {\n if (globalErrors[key]) {\n newErrors[key as keyof T] = globalErrors[key];\n }\n });\n }\n\n return {\n isValid: Object.keys(newErrors).length === 0,\n errors: newErrors,\n };\n }, [fields, validateField, validator, values]);\n\n // Check if form is currently valid\n const isValid = Object.keys(errors).length === 0;\n\n // Set a single field value\n const setValue = useCallback(\n (name: keyof T, value: string): void => {\n setFormValues((prev: T) => ({\n ...prev,\n [name]: value,\n }));\n\n // Validate on change if enabled\n if (validateOnChange) {\n const error = validateField(name);\n setFormErrors((prev: Record<keyof T, string>) => {\n const newErrors: Record<keyof T, string> = {...prev};\n if (error) {\n newErrors[name] = error;\n } else {\n delete newErrors[name];\n }\n return newErrors;\n });\n }\n },\n [validateField, validateOnChange],\n );\n\n // Set multiple field values\n const setValues = useCallback((newValues: Partial<T>): void => {\n setFormValues((prev: T) => ({\n ...prev,\n ...newValues,\n }));\n }, []);\n\n // Mark a field as touched\n const setTouched = useCallback(\n (name: keyof T, isTouched: boolean = true): void => {\n setFormTouched((prev: Record<keyof T, boolean>) => ({\n ...prev,\n [name]: isTouched,\n }));\n\n // Validate on blur if enabled and field is touched\n if (validateOnBlur && isTouched) {\n const error = validateField(name);\n setFormErrors((prev: Record<keyof T, string>) => {\n const newErrors: Record<keyof T, string> = {...prev};\n if (error) {\n newErrors[name] = error;\n } else {\n delete newErrors[name];\n }\n return newErrors;\n });\n }\n },\n [validateField, validateOnBlur],\n );\n\n // Set multiple touched fields\n const setTouchedFields = useCallback((touchedFields: Partial<Record<keyof T, boolean>>): void => {\n setFormTouched((prev: Record<keyof T, boolean>) => ({\n ...prev,\n ...touchedFields,\n }));\n }, []);\n\n // Mark all fields as touched\n const touchAllFields = useCallback((): void => {\n const allTouched: Record<keyof T, boolean> = fields.reduce((acc: Record<keyof T, boolean>, field: FormField) => {\n acc[field.name as keyof T] = true;\n return acc;\n }, {} as Record<keyof T, boolean>);\n\n setFormTouched(allTouched);\n\n // Validate all fields\n const validation: ValidationResult = validateForm();\n setFormErrors(validation.errors as Record<keyof T, string>);\n }, [fields, validateForm]);\n\n // Set a field error\n const setError = useCallback((name: keyof T, error: string): void => {\n setFormErrors((prev: Record<keyof T, string>) => ({\n ...prev,\n [name]: error,\n }));\n }, []);\n\n // Set multiple field errors\n const setErrors = useCallback((newErrors: Partial<Record<keyof T, string>>): void => {\n setFormErrors((prev: Record<keyof T, string>) => ({\n ...prev,\n ...newErrors,\n }));\n }, []);\n\n // Clear all errors\n const clearErrors = useCallback((): void => {\n setFormErrors({} as Record<keyof T, string>);\n }, []);\n\n // Reset form to initial state\n const reset = useCallback((): void => {\n setFormValues({...initialValues} as T);\n setFormTouched({} as Record<keyof T, boolean>);\n setFormErrors({} as Record<keyof T, string>);\n setIsSubmitted(false);\n }, [initialValues]);\n\n // Handle form submission\n const handleSubmit: (onSubmit: (values: T) => void | Promise<void>) => (e?: React.FormEvent) => Promise<void> =\n useCallback(\n (onSubmit: (values: T) => void | Promise<void>) =>\n async (e?: React.FormEvent): Promise<void> => {\n if (e) {\n e.preventDefault();\n }\n\n setIsSubmitted(true);\n touchAllFields();\n\n const validation: ValidationResult = validateForm();\n\n if (validation.isValid) {\n await onSubmit(values);\n }\n },\n [values, touchAllFields, validateForm],\n );\n\n // Get field props for easy integration\n const getFieldProps = useCallback(\n (name: keyof T) => {\n const fieldConfig: FormField | undefined = getFieldConfig(name);\n\n return {\n error: touched[name] ? errors[name] : undefined,\n name,\n onBlur: (): void => setTouched(name, true),\n onChange: (value: string): void => setValue(name, value),\n required: fieldConfig?.required || false,\n touched: touched[name] || false,\n value: values[name] || '',\n };\n },\n [values, errors, touched, setValue, setTouched, getFieldConfig],\n );\n\n return {\n clearErrors,\n errors,\n getFieldProps,\n handleSubmit,\n isSubmitted,\n isValid,\n reset,\n setError,\n setErrors,\n setTouched,\n setTouchedFields,\n setValue,\n setValues,\n touchAllFields,\n touched,\n validateField,\n validateForm,\n values,\n };\n};\n\nexport default useForm;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {BrandingPreference, Theme} from '@asgardeo/browser';\nimport useBrandingContext from '../contexts/Branding/useBrandingContext';\n\n/**\n * Configuration options for the useBranding hook\n * @deprecated Use BrandingProvider instead for better performance and consistency\n */\nexport interface UseBrandingConfig {\n /**\n * @deprecated This configuration is now handled by BrandingProvider\n */\n locale?: string;\n /**\n * @deprecated This configuration is now handled by BrandingProvider\n */\n name?: string;\n /**\n * @deprecated This configuration is now handled by BrandingProvider\n */\n type?: string;\n /**\n * @deprecated This configuration is now handled by BrandingProvider\n */\n forceTheme?: 'light' | 'dark';\n /**\n * @deprecated This configuration is now handled by BrandingProvider\n */\n autoFetch?: boolean;\n /**\n * @deprecated This configuration is now handled by BrandingProvider\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Return type of the useBranding hook\n */\nexport interface UseBrandingReturn {\n /**\n * The raw branding preference data\n */\n brandingPreference: BrandingPreference | null;\n /**\n * The transformed theme object\n */\n theme: Theme | null;\n /**\n * The active theme mode from branding preference ('light' | 'dark')\n */\n activeTheme: 'light' | 'dark' | null;\n /**\n * Loading state\n */\n isLoading: boolean;\n /**\n * Error state\n */\n error: Error | null;\n /**\n * Function to manually fetch branding preference\n */\n fetchBranding: () => Promise<void>;\n /**\n * Function to refetch branding preference\n * This bypasses the single-call restriction and forces a new API call\n */\n refetch: () => Promise<void>;\n}\n\n/**\n * React hook for accessing branding preferences from the BrandingProvider context.\n * This hook provides access to branding preferences, theme data, and loading states.\n *\n * @deprecated Consider using useBrandingContext directly for better performance.\n * This hook is maintained for backward compatibility.\n *\n * @param config - Configuration options (deprecated, use BrandingProvider props instead)\n * @returns Object containing branding preference data, theme, loading state, error, and refetch function\n *\n * @example\n * Basic usage:\n * ```tsx\n * function MyComponent() {\n * const { theme, activeTheme, isLoading, error } = useBranding();\n *\n * if (isLoading) return <div>Loading branding...</div>;\n * if (error) return <div>Error: {error.message}</div>;\n *\n * return (\n * <div style={{ color: theme?.colors?.primary?.main }}>\n * <p>Active theme mode: {activeTheme}</p>\n * <p>Styled with Asgardeo branding</p>\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * For new implementations, use BrandingProvider with useBrandingContext:\n * ```tsx\n * // In your root component\n * <BrandingProvider baseUrl=\"https://api.asgardeo.io/t/your-org\">\n * <App />\n * </BrandingProvider>\n *\n * // In your component\n * function MyComponent() {\n * const { theme, activeTheme, isLoading, error } = useBrandingContext();\n * // ... rest of your component\n * }\n * ```\n */\nexport const useBranding = (config: UseBrandingConfig = {}): UseBrandingReturn => {\n try {\n return useBrandingContext();\n } catch (error) {\n console.warn(\n 'useBranding: BrandingProvider not available. ' +\n 'Make sure to wrap your app with BrandingProvider or AsgardeoProvider with branding preferences.',\n );\n\n return {\n brandingPreference: null,\n theme: null,\n activeTheme: null,\n isLoading: false,\n error: new Error('BrandingProvider not available'),\n fetchBranding: async () => {},\n refetch: async () => {},\n };\n }\n};\n\nexport default useBranding;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {WithPreferences, withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {\n ButtonHTMLAttributes,\n forwardRef,\n ForwardRefExoticComponent,\n ReactElement,\n ReactNode,\n Ref,\n RefAttributes,\n} from 'react';\nimport Button from '../../primitives/Button/Button';\n\n/**\n * Common props shared by all {@link BaseSignInButton} components.\n */\nexport interface CommonBaseSignInButtonProps {\n /**\n * Loading state during sign-in process\n */\n isLoading?: boolean;\n /**\n * Function to initiate the sign-in process\n */\n signIn: () => Promise<void>;\n}\n\n/**\n * Props passed to the render function of {@link BaseSignInButton}\n */\nexport type BaseSignInButtonRenderProps = CommonBaseSignInButtonProps;\n\n/**\n * Props interface of {@link BaseSignInButton}\n */\nexport interface BaseSignInButtonProps\n extends Partial<CommonBaseSignInButtonProps>,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n WithPreferences {\n /**\n * Render prop function that receives sign-in props, or traditional ReactNode children\n */\n children?: ((props: BaseSignInButtonRenderProps) => ReactNode) | ReactNode;\n}\n\n/**\n * Base SignInButton component that supports both render props and traditional props patterns.\n *\n * @example Using render props\n * ```tsx\n * <BaseSignInButton>\n * {({signIn, isLoading}) => (\n * <button onClick={signIn} disabled={isLoading}>\n * {isLoading ? 'Signing in...' : 'Sign In'}\n * </button>\n * )}\n * </BaseSignInButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <BaseSignInButton className=\"custom-button\">Sign In</BaseSignInButton>\n * ```\n */\nconst BaseSignInButton: ForwardRefExoticComponent<BaseSignInButtonProps & RefAttributes<HTMLButtonElement>> =\n forwardRef<HTMLButtonElement, BaseSignInButtonProps>(\n (\n {children, className, style, signIn, isLoading, preferences, ...rest}: BaseSignInButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n if (typeof children === 'function') {\n return <>{children({isLoading, signIn})}</>;\n }\n\n return (\n <Button\n ref={ref}\n className={clsx(withVendorCSSClassPrefix('sign-in-button'), className)}\n style={style}\n disabled={isLoading}\n loading={isLoading}\n type=\"button\"\n {...rest}\n >\n {children}\n </Button>\n );\n },\n );\n\nBaseSignInButton.displayName = 'BaseSignInButton';\n\nexport default BaseSignInButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, ButtonHTMLAttributes, forwardRef, useMemo} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport Spinner, {SpinnerSize} from '../Spinner/Spinner';\n\nexport type ButtonColor = 'primary' | 'secondary' | 'tertiary' | string;\nexport type ButtonVariant = 'solid' | 'outline' | 'text';\nexport type ButtonSize = 'small' | 'medium' | 'large';\n\nexport interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'> {\n /**\n * The button color that determines the color scheme\n */\n color?: ButtonColor;\n /**\n * The button variant that determines the visual style\n */\n variant?: ButtonVariant;\n /**\n * The size of the button\n */\n size?: ButtonSize;\n /**\n * Whether the button should take the full width of its container\n */\n fullWidth?: boolean;\n /**\n * Whether the button is in a loading state\n */\n loading?: boolean;\n /**\n * Icon to display before the button text\n */\n startIcon?: React.ReactNode;\n /**\n * Icon to display after the button text\n */\n endIcon?: React.ReactNode;\n}\n\nconst useButtonStyles = (\n color: ButtonColor,\n variant: ButtonVariant,\n size: ButtonSize,\n fullWidth: boolean,\n disabled: boolean,\n loading: boolean,\n) => {\n const {theme} = useTheme();\n\n return useMemo(() => {\n // Size configurations\n const sizeConfig = {\n small: {\n padding: `calc(${theme.vars.spacing.unit} * 0.5) calc(${theme.vars.spacing.unit} * 1)`,\n fontSize: theme.vars.typography.fontSizes.sm,\n minHeight: `calc(${theme.vars.spacing.unit} * 3)`,\n },\n medium: {\n padding: `calc(${theme.vars.spacing.unit} * 1) calc(${theme.vars.spacing.unit} * 2)`,\n fontSize: theme.vars.typography.fontSizes.md,\n minHeight: `calc(${theme.vars.spacing.unit} * 4)`,\n },\n large: {\n padding: `calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 3)`,\n fontSize: theme.vars.typography.fontSizes.lg,\n minHeight: `calc(${theme.vars.spacing.unit} * 5)`,\n },\n };\n\n // Color configurations based on color and variant\n const getColorConfig = () => {\n switch (color) {\n case 'primary':\n switch (variant) {\n case 'solid':\n return {\n backgroundColor: theme.vars.colors.primary.main,\n color: theme.vars.colors.primary.contrastText,\n border: `1px solid ${theme.vars.colors.primary.main}`,\n '&:hover': {\n backgroundColor: theme.vars.colors.primary.main,\n opacity: 0.9,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.primary.main,\n opacity: 0.8,\n },\n };\n case 'outline':\n return {\n backgroundColor: 'transparent',\n color: theme.vars.colors.primary.main,\n border: `1px solid ${theme.vars.colors.primary.main}`,\n '&:hover': {\n backgroundColor: theme.vars.colors.primary.main,\n color: theme.vars.colors.primary.contrastText,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.primary.main,\n color: theme.vars.colors.primary.contrastText,\n opacity: 0.9,\n },\n };\n case 'text':\n return {\n backgroundColor: 'transparent',\n color: theme.vars.colors.primary.main,\n border: '1px solid transparent',\n '&:hover': {\n backgroundColor: theme.vars.colors.action.hover,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.action.selected,\n },\n };\n }\n break;\n case 'secondary':\n switch (variant) {\n case 'solid':\n return {\n backgroundColor: theme.vars.colors.secondary.main,\n color: theme.vars.colors.secondary.contrastText,\n border: `1px solid ${theme.vars.colors.secondary.main}`,\n '&:hover': {\n backgroundColor: theme.vars.colors.secondary.main,\n opacity: 0.9,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.secondary.main,\n opacity: 0.8,\n },\n };\n case 'outline':\n return {\n backgroundColor: 'transparent',\n color: theme.vars.colors.secondary.main,\n border: `1px solid ${theme.vars.colors.secondary.main}`,\n '&:hover': {\n backgroundColor: theme.vars.colors.secondary.main,\n color: theme.vars.colors.secondary.contrastText,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.secondary.main,\n color: theme.vars.colors.secondary.contrastText,\n opacity: 0.9,\n },\n };\n case 'text':\n return {\n backgroundColor: 'transparent',\n color: theme.vars.colors.secondary.main,\n border: '1px solid transparent',\n '&:hover': {\n backgroundColor: theme.vars.colors.action.hover,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.action.selected,\n },\n };\n }\n break;\n case 'tertiary':\n switch (variant) {\n case 'solid':\n return {\n backgroundColor: theme.vars.colors.text.secondary,\n color: theme.vars.colors.background.surface,\n border: `1px solid ${theme.vars.colors.text.secondary}`,\n '&:hover': {\n backgroundColor: theme.vars.colors.text.primary,\n color: theme.vars.colors.background.surface,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.text.primary,\n color: theme.vars.colors.background.surface,\n opacity: 0.9,\n },\n };\n case 'outline':\n return {\n backgroundColor: 'transparent',\n color: theme.vars.colors.text.secondary,\n border: `1px solid ${theme.vars.colors.border}`,\n '&:hover': {\n backgroundColor: theme.vars.colors.action.hover,\n borderColor: theme.vars.colors.text.secondary,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.action.selected,\n borderColor: theme.vars.colors.text.primary,\n },\n };\n case 'text':\n return {\n backgroundColor: 'transparent',\n color: theme.vars.colors.text.secondary,\n border: '1px solid transparent',\n '&:hover': {\n backgroundColor: theme.vars.colors.action.hover,\n color: theme.vars.colors.text.primary,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.action.selected,\n color: theme.vars.colors.text.primary,\n },\n };\n }\n break;\n default:\n return {};\n }\n };\n\n const baseStyle: CSSProperties = {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: `calc(${theme.vars.spacing.unit} * 1)`,\n borderRadius: theme.vars.borderRadius.medium,\n fontWeight: 500,\n cursor: disabled || loading ? 'not-allowed' : 'pointer',\n transition: 'all 0.2s ease-in-out',\n outline: 'none',\n textDecoration: 'none',\n whiteSpace: 'nowrap',\n width: fullWidth ? '100%' : 'auto',\n opacity: disabled || loading ? 0.6 : 1,\n ...sizeConfig[size],\n ...getColorConfig(),\n };\n\n return baseStyle;\n }, [theme, color, variant, size, fullWidth, disabled, loading]);\n};\n\n/**\n * Button component with multiple variants and types.\n *\n * @example\n * ```tsx\n * // Primary solid button\n * <Button color=\"primary\" variant=\"solid\">\n * Click me\n * </Button>\n *\n * // Secondary outline button\n * <Button color=\"secondary\" variant=\"outline\" size=\"large\">\n * Cancel\n * </Button>\n *\n * // Text button with loading state\n * <Button color=\"tertiary\" variant=\"text\" loading>\n * Loading...\n * </Button>\n *\n * // Button with icons\n * <Button\n * color=\"primary\"\n * startIcon={<Icon />}\n * endIcon={<Arrow />}\n * >\n * Save and Continue\n * </Button>\n * ```\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n color = 'primary',\n variant = 'solid',\n size = 'medium',\n fullWidth = false,\n loading = false,\n startIcon,\n endIcon,\n children,\n className,\n disabled,\n style,\n ...rest\n },\n ref,\n ) => {\n const {theme} = useTheme();\n const buttonStyle = useButtonStyles(color, variant, size, fullWidth, disabled || false, loading);\n\n return (\n <button\n ref={ref}\n style={{...buttonStyle, ...style}}\n className={clsx(\n withVendorCSSClassPrefix('button'),\n withVendorCSSClassPrefix(`button-${color}`),\n withVendorCSSClassPrefix(`button-${variant}`),\n withVendorCSSClassPrefix(`button-${size}`),\n {\n [withVendorCSSClassPrefix('button-full-width')]: fullWidth,\n [withVendorCSSClassPrefix('button-loading')]: loading,\n },\n className,\n )}\n disabled={disabled || loading}\n {...rest}\n >\n {loading && (\n <Spinner\n size={size as SpinnerSize}\n color=\"currentColor\"\n style={{\n width:\n size === 'small'\n ? `calc(${theme.vars.spacing.unit} * 1.5)`\n : size === 'medium'\n ? `calc(${theme.vars.spacing.unit} * 2)`\n : `calc(${theme.vars.spacing.unit} * 2.5)`,\n height:\n size === 'small'\n ? `calc(${theme.vars.spacing.unit} * 1.5)`\n : size === 'medium'\n ? `calc(${theme.vars.spacing.unit} * 2)`\n : `calc(${theme.vars.spacing.unit} * 2.5)`,\n }}\n />\n )}\n {!loading && startIcon && <span>{startIcon}</span>}\n {children && <>{children}</>}\n {!loading && endIcon && <span>{endIcon}</span>}\n </button>\n );\n },\n);\n\nButton.displayName = 'Button';\n\nexport default Button;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, CSSProperties} from 'react';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport {clsx} from 'clsx';\nimport useTheme from '../../../contexts/Theme/useTheme';\n\nexport type SpinnerSize = 'small' | 'medium' | 'large';\n\nexport interface SpinnerProps {\n /**\n * Size of the spinner\n */\n size?: SpinnerSize;\n /**\n * Custom color for the spinner\n */\n color?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Custom styles\n */\n style?: CSSProperties;\n}\n\n/**\n * Spinner component for loading states\n *\n * @example\n * ```tsx\n * // Basic spinner\n * <Spinner />\n *\n * // Large spinner with custom color\n * <Spinner size=\"large\" color=\"#3b82f6\" />\n *\n * // Small spinner\n * <Spinner size=\"small\" />\n * ```\n */\nconst Spinner: FC<SpinnerProps> = ({size = 'medium', color, className, style}) => {\n const {theme} = useTheme();\n\n const spinnerSize = {\n small: '16px',\n medium: '20px',\n large: '32px',\n }[size];\n\n const spinnerColor = color || theme.vars.colors.primary.main;\n\n const spinnerStyle: CSSProperties = {\n width: spinnerSize,\n height: spinnerSize,\n border: '2px solid transparent',\n borderTop: `2px solid ${spinnerColor}`,\n borderRadius: '50%',\n animation: 'asgardeo-spinner-spin 1s linear infinite',\n ...style,\n };\n\n return (\n <>\n <style>\n {`\n @keyframes asgardeo-spinner-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n `}\n </style>\n <span\n className={clsx(withVendorCSSClassPrefix('spinner'), className)}\n style={spinnerStyle}\n role=\"status\"\n aria-label=\"Loading\"\n />\n </>\n );\n};\n\nexport default Spinner;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AsgardeoRuntimeError} from '@asgardeo/browser';\nimport {forwardRef, ForwardRefExoticComponent, MouseEvent, ReactElement, Ref, RefAttributes, useState} from 'react';\nimport BaseSignInButton, {BaseSignInButtonProps} from './BaseSignInButton';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useTranslation from '../../../hooks/useTranslation';\n\n/**\n * Props interface of {@link SignInButton}\n */\nexport type SignInButtonProps = BaseSignInButtonProps;\n\n/**\n * SignInButton component that supports both render props and traditional props patterns.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example Using render props\n * ```tsx\n * <SignInButton>\n * {({signIn, isLoading}) => (\n * <button onClick={signIn} disabled={isLoading}>\n * {isLoading ? 'Signing in...' : 'Sign In'}\n * </button>\n * )}\n * </SignInButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <SignInButton className=\"custom-button\">Sign In</SignInButton>\n * ```\n *\n * @example Using component-level preferences\n * ```tsx\n * <SignInButton\n * preferences={{\n * i18n: {\n * bundles: {\n * 'en-US': {\n * translations: {\n * 'buttons.signIn': 'Custom Sign In Text'\n * }\n * }\n * }\n * }\n * }}\n * >\n * Custom Sign In\n * </SignInButton>\n * ```\n */\nconst SignInButton: ForwardRefExoticComponent<SignInButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<\n HTMLButtonElement,\n SignInButtonProps\n>(({children, onClick, preferences, ...rest}: SignInButtonProps, ref: Ref<HTMLButtonElement>): ReactElement => {\n const {signIn, signInUrl} = useAsgardeo();\n const {t} = useTranslation(preferences?.i18n);\n\n const [isLoading, setIsLoading] = useState(false);\n\n const handleSignIn = async (e?: MouseEvent<HTMLButtonElement>): Promise<void> => {\n try {\n setIsLoading(true);\n\n // If a custom `signInUrl` is provided, use it for navigation.\n if (signInUrl) {\n window.history.pushState(null, '', signInUrl);\n\n window.dispatchEvent(new PopStateEvent('popstate', {state: null}));\n } else {\n await signIn();\n }\n\n if (onClick) {\n onClick(e);\n }\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Sign in failed: ${error instanceof Error ? error.message : String(error)}`,\n 'SignInButton-handleSignIn-RuntimeError-001',\n 'react',\n 'Something went wrong while trying to sign in. Please try again later.',\n );\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <BaseSignInButton\n ref={ref}\n onClick={handleSignIn}\n isLoading={isLoading}\n signIn={handleSignIn}\n preferences={preferences}\n {...rest}\n >\n {children ?? t('elements.buttons.signIn')}\n </BaseSignInButton>\n );\n});\n\nSignInButton.displayName = 'SignInButton';\n\nexport default SignInButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {WithPreferences, withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {\n forwardRef,\n ForwardRefExoticComponent,\n ButtonHTMLAttributes,\n ReactElement,\n ReactNode,\n Ref,\n RefAttributes,\n} from 'react';\nimport Button from '../../primitives/Button/Button';\n\n/**\n * Common props shared by all {@link BaseSignOutButton} components.\n */\nexport interface CommonBaseSignOutButtonProps {\n /**\n * Loading state during sign-out process\n */\n isLoading?: boolean;\n /**\n * Function to initiate the sign-out process\n */\n signOut: () => Promise<void>;\n}\n\n/**\n * Props passed to the render function of {@link BaseSignOutButton}\n */\nexport type BaseSignOutButtonRenderProps = CommonBaseSignOutButtonProps;\n\n/**\n * Props interface of {@link BaseSignOutButton}\n */\nexport interface BaseSignOutButtonProps\n extends Partial<CommonBaseSignOutButtonProps>,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n WithPreferences {\n /**\n * Render prop function that receives sign-out props, or traditional ReactNode children\n */\n children?: ((props: BaseSignOutButtonRenderProps) => ReactNode) | ReactNode;\n}\n\n/**\n * Base SignOutButton component that supports both render props and traditional props patterns.\n *\n * @example Using render props\n * ```tsx\n * <BaseSignOutButton>\n * {({signOut, isLoading}) => (\n * <button onClick={signOut} disabled={isLoading}>\n * {isLoading ? 'Signing out...' : 'Sign Out'}\n * </button>\n * )}\n * </BaseSignOutButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <BaseSignOutButton className=\"custom-button\">Sign Out</BaseSignOutButton>\n * ```\n */\nconst BaseSignOutButton: ForwardRefExoticComponent<BaseSignOutButtonProps & RefAttributes<HTMLButtonElement>> =\n forwardRef<HTMLButtonElement, BaseSignOutButtonProps>(\n (\n {children, className, style, signOut, isLoading, preferences, ...rest}: BaseSignOutButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n if (typeof children === 'function') {\n return <>{children({isLoading, signOut})}</>;\n }\n\n return (\n <Button\n ref={ref}\n className={clsx(withVendorCSSClassPrefix('sign-out-button'), className)}\n style={style}\n disabled={isLoading}\n loading={isLoading}\n type=\"button\"\n color=\"secondary\"\n variant=\"outline\"\n {...rest}\n >\n {children}\n </Button>\n );\n },\n );\n\nBaseSignOutButton.displayName = 'BaseSignOutButton';\n\nexport default BaseSignOutButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AsgardeoRuntimeError} from '@asgardeo/browser';\nimport {forwardRef, ForwardRefExoticComponent, MouseEvent, ReactElement, Ref, RefAttributes, useState} from 'react';\nimport BaseSignOutButton, {BaseSignOutButtonProps} from './BaseSignOutButton';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useTranslation from '../../../hooks/useTranslation';\n\n/**\n * Props interface of {@link SignOutButton}\n */\nexport type SignOutButtonProps = BaseSignOutButtonProps;\n\n/**\n * SignOutButton component that supports both render props and traditional props patterns.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example Using render props pattern\n * ```tsx\n * <SignOutButton>\n * {({signOut, isLoading}) => (\n * <button onClick={signOut} disabled={isLoading}>\n * {isLoading ? 'Signing out...' : 'Sign Out'}\n * </button>\n * )}\n * </SignOutButton>\n * ```\n *\n * @example Using traditional props pattern\n * ```tsx\n * <SignOutButton className=\"custom-button\">Sign Out</SignOutButton>\n * ```\n *\n * @example Using component-level preferences\n * ```tsx\n * <SignOutButton\n * preferences={{\n * i18n: {\n * bundles: {\n * 'en-US': {\n * translations: {\n * 'buttons.signOut': 'Custom Sign Out Text'\n * }\n * }\n * }\n * }\n * }}\n * >\n * Custom Sign Out\n * </SignOutButton>\n * ```\n */\nconst SignOutButton: ForwardRefExoticComponent<SignOutButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<\n HTMLButtonElement,\n SignOutButtonProps\n>(({children, onClick, preferences, ...rest}: SignOutButtonProps, ref: Ref<HTMLButtonElement>): ReactElement => {\n const {signOut} = useAsgardeo();\n const {t} = useTranslation(preferences?.i18n);\n\n const [isLoading, setIsLoading] = useState(false);\n\n const handleSignOut = async (e?: MouseEvent<HTMLButtonElement>): Promise<void> => {\n try {\n setIsLoading(true);\n\n await signOut();\n\n if (onClick) {\n onClick(e);\n }\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Sign out failed: ${error instanceof Error ? error.message : String(error)}`,\n 'SignOutButton-handleSignOut-RuntimeError-001',\n 'react',\n 'Something went wrong while trying to sign out. Please try again later.',\n );\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <BaseSignOutButton\n ref={ref}\n onClick={handleSignOut}\n isLoading={isLoading}\n signOut={handleSignOut}\n preferences={preferences}\n {...rest}\n >\n {children ?? t('elements.buttons.signOut')}\n </BaseSignOutButton>\n );\n});\n\nSignOutButton.displayName = 'SignOutButton';\n\nexport default SignOutButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {WithPreferences, withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {\n forwardRef,\n ForwardRefExoticComponent,\n ButtonHTMLAttributes,\n ReactElement,\n ReactNode,\n Ref,\n RefAttributes,\n} from 'react';\nimport Button from '../../primitives/Button/Button';\n\n/**\n * Common props shared by all {@link BaseSignUpButton} components.\n */\nexport interface CommonBaseSignUpButtonProps {\n /**\n * Loading state during sign-up process\n */\n isLoading?: boolean;\n /**\n * Function to initiate the sign-up process\n */\n signUp?: () => Promise<void>;\n}\n\n/**\n * Props passed to the render function of {@link BaseSignUpButton}\n */\nexport type BaseSignUpButtonRenderProps = CommonBaseSignUpButtonProps;\n\n/**\n * Props interface of {@link BaseSignUpButton}\n */\nexport interface BaseSignUpButtonProps\n extends CommonBaseSignUpButtonProps,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n WithPreferences {\n /**\n * Render prop function that receives sign-up props, or traditional ReactNode children\n */\n children?: ((props: BaseSignUpButtonRenderProps) => ReactNode) | ReactNode;\n}\n\n/**\n * Base SignUpButton component that supports both render props and traditional props patterns.\n *\n * @example Using render props\n * ```tsx\n * <BaseSignUpButton>\n * {({ signUp, isLoading }) => (\n * <button onClick={signUp} disabled={isLoading}>\n * {isLoading ? 'Creating account...' : 'Create Account'}\n * </button>\n * )}\n * </BaseSignUpButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <BaseSignUpButton className=\"custom-button\">Create Account</BaseSignUpButton>\n * ```\n */\nconst BaseSignUpButton: ForwardRefExoticComponent<BaseSignUpButtonProps & RefAttributes<HTMLButtonElement>> =\n forwardRef<HTMLButtonElement, BaseSignUpButtonProps>(\n (\n {children, className, style, signUp, isLoading, preferences, ...rest}: BaseSignUpButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n if (typeof children === 'function') {\n return <>{children({isLoading, signUp})}</>;\n }\n\n return (\n <Button\n ref={ref}\n className={clsx(withVendorCSSClassPrefix('sign-up-button'), className)}\n style={style}\n disabled={isLoading}\n loading={isLoading}\n type=\"button\"\n color=\"primary\"\n variant=\"outline\"\n {...rest}\n >\n {children}\n </Button>\n );\n },\n );\n\nBaseSignUpButton.displayName = 'BaseSignUpButton';\n\nexport default BaseSignUpButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AsgardeoRuntimeError} from '@asgardeo/browser';\nimport {forwardRef, ForwardRefExoticComponent, MouseEvent, ReactElement, Ref, RefAttributes, useState} from 'react';\nimport BaseSignUpButton, {BaseSignUpButtonProps} from './BaseSignUpButton';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useTranslation from '../../../hooks/useTranslation';\n\n/**\n * Props interface of {@link SignUpButton}\n */\nexport type SignUpButtonProps = BaseSignUpButtonProps;\n\n/**\n * SignUpButton component that supports both render props and traditional props patterns.\n * It redirects the user to the Asgardeo sign-up page configured for the application.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example Using render props pattern\n * ```tsx\n * <SignUpButton>\n * {({ signUp, isLoading }) => (\n * <button onClick={signUp} disabled={isLoading}>\n * {isLoading ? 'Creating Account...' : 'Create Account'}\n * </button>\n * )}\n * </SignUpButton>\n * ```\n *\n * @example Using traditional props pattern\n * ```tsx\n * <SignUpButton className=\"custom-button\">Create Account</SignUpButton>\n * ```\n *\n * @example Using component-level preferences\n * ```tsx\n * <SignUpButton\n * preferences={{\n * i18n: {\n * bundles: {\n * 'en-US': {\n * translations: {\n * 'buttons.signUp': 'Custom Sign Up Text'\n * }\n * }\n * }\n * }\n * }}\n * >\n * Custom Sign Up\n * </SignUpButton>\n * ```\n */\nconst SignUpButton: ForwardRefExoticComponent<SignUpButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<\n HTMLButtonElement,\n SignUpButtonProps\n>(({children, onClick, preferences, ...rest}: SignUpButtonProps, ref: Ref<HTMLButtonElement>): ReactElement => {\n const {signUp, signUpUrl} = useAsgardeo();\n const {t} = useTranslation(preferences?.i18n);\n\n const [isLoading, setIsLoading] = useState(false);\n\n const handleSignUp = async (e?: MouseEvent<HTMLButtonElement>): Promise<void> => {\n try {\n setIsLoading(true);\n\n // If a custom `signUpUrl` is provided, use it for navigation.\n if (signUpUrl) {\n window.history.pushState(null, '', signUpUrl);\n\n window.dispatchEvent(new PopStateEvent('popstate', {state: null}));\n } else {\n await signUp();\n }\n\n if (onClick) {\n onClick(e);\n }\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Sign up failed: ${error instanceof Error ? error.message : String(error)}`,\n 'SignUpButton-handleSignUp-RuntimeError-001',\n 'react',\n 'Something went wrong while trying to sign up. Please try again later.',\n );\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <BaseSignUpButton\n ref={ref}\n onClick={handleSignUp}\n isLoading={isLoading}\n signUp={handleSignUp}\n preferences={preferences}\n {...rest}\n >\n {children ?? t('elements.buttons.signUp')}\n </BaseSignUpButton>\n );\n});\n\nSignUpButton.displayName = 'SignUpButton';\n\nexport default SignUpButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactNode} from 'react';\nimport useAsgardeo from '../../contexts/Asgardeo/useAsgardeo';\n\n/**\n * Props for the SignedIn component.\n */\nexport interface SignedInProps {\n /**\n * Content to show when the user is not signed in.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that only renders its children when the user is signed in.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example\n * ```tsx\n * import { SignedIn } from '@asgardeo/auth-react';\n *\n * const App = () => {\n * return (\n * <SignedIn fallback={<p>Please sign in to continue</p>}>\n * <p>Welcome! You are signed in.</p>\n * </SignedIn>\n * );\n * }\n * ```\n */\nconst SignedIn: FC<PropsWithChildren<SignedInProps>> = ({\n children,\n fallback = null,\n}: PropsWithChildren<SignedInProps>) => {\n const {isSignedIn} = useAsgardeo();\n\n if (!isSignedIn) {\n return <>{fallback}</>;\n }\n\n return <>{children}</>;\n};\n\nSignedIn.displayName = 'SignedIn';\n\nexport default SignedIn;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactNode} from 'react';\nimport useAsgardeo from '../../contexts/Asgardeo/useAsgardeo';\n\n/**\n * Props for the SignedOut component.\n */\nexport interface SignedOutProps {\n /**\n * Content to show when the user is signed in.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that only renders its children when the user is signed out.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example\n * ```tsx\n * import { SignedOut } from '@asgardeo/auth-react';\n *\n * const App = () => {\n * return (\n * <SignedOut fallback={<p>You are already signed in</p>}>\n * <p>Please sign in to continue</p>\n * </SignedOut>\n * );\n * }\n * ```\n */\nconst SignedOut: FC<PropsWithChildren<SignedOutProps>> = ({\n children,\n fallback = null,\n}: PropsWithChildren<SignedOutProps>) => {\n const {isSignedIn} = useAsgardeo();\n\n if (!isSignedIn) {\n return <>{children}</>;\n }\n\n return <>{fallback}</>;\n};\n\nSignedOut.displayName = 'SignedOut';\n\nexport default SignedOut;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactNode} from 'react';\nimport useAsgardeo from '../../contexts/Asgardeo/useAsgardeo';\n\n/**\n * Props for the Loading component.\n */\nexport interface AsgardeoLoadingProps {\n /**\n * Content to show when the user is not signed in.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that only renders its children when the Asgardeo is loading.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example\n * ```tsx\n * import { AsgardeoLoading } from '@asgardeo/auth-react';\n *\n * const App = () => {\n * return (\n * <AsgardeoLoading fallback={<p>Finished Loading...</p>}>\n * <p>Loading...</p>\n * </AsgardeoLoading>\n * );\n * }\n * ```\n */\nconst AsgardeoLoading: FC<PropsWithChildren<AsgardeoLoadingProps>> = ({\n children,\n fallback = null,\n}: PropsWithChildren<AsgardeoLoadingProps>) => {\n const {isLoading} = useAsgardeo();\n\n if (!isLoading) {\n return <>{fallback}</>;\n }\n\n return <>{children}</>;\n};\n\nAsgardeoLoading.displayName = 'AsgardeoLoading';\n\nexport default AsgardeoLoading;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n EmbeddedSignInFlowAuthenticator,\n EmbeddedSignInFlowInitiateResponse,\n EmbeddedSignInFlowHandleResponse,\n EmbeddedSignInFlowStepType,\n EmbeddedSignInFlowStatus,\n EmbeddedSignInFlowAuthenticatorPromptType,\n ApplicationNativeAuthenticationConstants,\n AsgardeoAPIError,\n withVendorCSSClassPrefix,\n EmbeddedSignInFlowHandleRequestPayload,\n EmbeddedFlowExecuteRequestConfig,\n} from '@asgardeo/browser';\nimport {clsx} from 'clsx';\nimport {FC, ReactElement, FormEvent, useEffect, useState, useCallback, useRef, useMemo, CSSProperties} from 'react';\nimport {createSignInOptionFromAuthenticator} from './options/SignInOptionFactory';\nimport FlowProvider from '../../../contexts/Flow/FlowProvider';\nimport useFlow from '../../../contexts/Flow/useFlow';\nimport {useForm, FormField} from '../../../hooks/useForm';\nimport useTranslation from '../../../hooks/useTranslation';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Alert from '../../primitives/Alert/Alert';\nimport Card, {CardProps} from '../../primitives/Card/Card';\nimport Divider from '../../primitives/Divider/Divider';\nimport Logo from '../../primitives/Logo/Logo';\nimport Spinner from '../../primitives/Spinner/Spinner';\nimport Typography from '../../primitives/Typography/Typography';\n\n/**\n * Utility functions for WebAuthn/Passkey operations\n */\n\n/**\n * Convert base64url string to ArrayBuffer\n */\nconst base64urlToArrayBuffer = (base64url: string): ArrayBuffer => {\n // Add padding if needed\n const padding = '='.repeat((4 - (base64url.length % 4)) % 4);\n const base64 = base64url.replace(/-/g, '+').replace(/_/g, '/') + padding;\n\n const binaryString = atob(base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes.buffer;\n};\n\n/**\n * Convert ArrayBuffer to base64url string\n */\nconst arrayBufferToBase64url = (buffer: ArrayBuffer): string => {\n const bytes = new Uint8Array(buffer);\n let binary = '';\n for (let i = 0; i < bytes.byteLength; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n};\n\n/**\n * Handle WebAuthn authentication\n */\nconst handleWebAuthnAuthentication = async (challengeData: string): Promise<string> => {\n // Check if WebAuthn is supported\n if (!window.navigator.credentials || !window.navigator.credentials.get) {\n throw new Error(\n 'WebAuthn is not supported in this browser. Please use a modern browser or try a different authentication method.',\n );\n }\n\n // Check if we're on HTTPS (required for WebAuthn)\n if (window.location.protocol !== 'https:' && window.location.hostname !== 'localhost') {\n throw new Error(\n 'Passkey authentication requires a secure connection (HTTPS). Please ensure you are accessing this site over HTTPS.',\n );\n }\n\n try {\n // Decode the challenge data\n const decodedChallenge = JSON.parse(atob(challengeData));\n const {publicKeyCredentialRequestOptions} = decodedChallenge;\n\n // Handle RP ID mismatch by checking domain compatibility\n const currentDomain = window.location.hostname;\n const challengeRpId = publicKeyCredentialRequestOptions.rpId;\n\n let rpIdToUse = challengeRpId;\n\n // Check if the challenge RP ID is compatible with current domain\n if (challengeRpId && !currentDomain.endsWith(challengeRpId) && challengeRpId !== currentDomain) {\n console.warn(`RP ID mismatch detected. Challenge RP ID: ${challengeRpId}, Current domain: ${currentDomain}`);\n // Use current domain as fallback to avoid errors\n rpIdToUse = currentDomain;\n }\n\n const adjustedOptions = {\n ...publicKeyCredentialRequestOptions,\n rpId: rpIdToUse,\n challenge: base64urlToArrayBuffer(publicKeyCredentialRequestOptions.challenge),\n // Convert user handle if present\n ...(publicKeyCredentialRequestOptions.userVerification && {\n userVerification: publicKeyCredentialRequestOptions.userVerification,\n }),\n // Convert allowCredentials if present\n ...(publicKeyCredentialRequestOptions.allowCredentials && {\n allowCredentials: publicKeyCredentialRequestOptions.allowCredentials.map((cred: any) => ({\n ...cred,\n id: base64urlToArrayBuffer(cred.id),\n })),\n }),\n };\n\n // Convert challenge from base64url to ArrayBuffer\n const credential = (await navigator.credentials.get({\n publicKey: adjustedOptions,\n })) as PublicKeyCredential;\n\n if (!credential) {\n throw new Error('No credential returned from WebAuthn');\n }\n\n const authData = credential.response as AuthenticatorAssertionResponse;\n\n // Create the token response for the server\n const tokenResponse = {\n requestId: decodedChallenge.requestId,\n credential: {\n id: credential.id,\n rawId: arrayBufferToBase64url(credential.rawId),\n response: {\n authenticatorData: arrayBufferToBase64url(authData.authenticatorData),\n clientDataJSON: arrayBufferToBase64url(authData.clientDataJSON),\n signature: arrayBufferToBase64url(authData.signature),\n ...(authData.userHandle && {\n userHandle: arrayBufferToBase64url(authData.userHandle),\n }),\n },\n type: credential.type,\n },\n };\n\n return JSON.stringify(tokenResponse);\n } catch (error) {\n console.error('WebAuthn authentication failed:', error);\n\n // Handle specific error cases\n if (error instanceof Error) {\n if (error.name === 'NotAllowedError') {\n throw new Error('Passkey authentication was cancelled or timed out. Please try again.');\n } else if (error.name === 'SecurityError') {\n if (error.message.includes('relying party ID') || error.message.includes('RP ID')) {\n throw new Error(\n 'Domain mismatch error. The passkey was registered for a different domain. Please contact support or try a different authentication method.',\n );\n } else {\n throw new Error(\n 'Passkey authentication failed. Please ensure you are using HTTPS and that your browser supports passkeys.',\n );\n }\n } else if (error.name === 'InvalidStateError') {\n throw new Error(\n 'No valid passkey found for this account. Please register a passkey first or use a different authentication method.',\n );\n } else if (error.name === 'NotSupportedError') {\n throw new Error(\n 'Passkey authentication is not supported on this device or browser. Please use a different authentication method.',\n );\n } else if (error.name === 'NetworkError') {\n throw new Error('Network error during passkey authentication. Please check your connection and try again.');\n } else if (error.name === 'UnknownError') {\n throw new Error(\n 'An unknown error occurred during passkey authentication. Please try again or use a different authentication method.',\n );\n }\n }\n\n throw new Error(`Passkey authentication failed: ${error instanceof Error ? error.message : 'Unknown error'}`);\n }\n};\n\n/**\n * Check if the authenticator is a passkey/FIDO authenticator\n */\nconst isPasskeyAuthenticator = (authenticator: EmbeddedSignInFlowAuthenticator): boolean =>\n authenticator.authenticatorId === ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Passkey &&\n authenticator.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.InternalPrompt &&\n (authenticator.metadata as any)?.additionalData?.challengeData;\n\n/**\n * Props for the BaseSignIn component.\n */\nexport interface BaseSignInProps {\n afterSignInUrl?: string;\n\n /**\n * Custom CSS class name for the submit button.\n */\n buttonClassName?: string;\n\n /**\n * Custom CSS class name for the form container.\n */\n className?: string;\n\n /**\n * Custom CSS class name for error messages.\n */\n errorClassName?: string;\n\n /**\n * Custom CSS class name for form inputs.\n */\n inputClassName?: string;\n\n /**\n * Custom CSS class name for info messages.\n */\n messageClassName?: string;\n\n /**\n * Callback function called when authentication fails.\n * @param error - The error that occurred during authentication.\n */\n onError?: (error: Error) => void;\n\n /**\n * Callback function called when authentication flow status changes.\n * @param response - The current authentication response.\n */\n onFlowChange?: (response: EmbeddedSignInFlowInitiateResponse | EmbeddedSignInFlowHandleResponse) => void;\n\n /**\n * Flag to determine the component is ready to be rendered.\n */\n isLoading?: boolean;\n\n /**\n * Function to initialize authentication flow.\n * @returns Promise resolving to the initial authentication response.\n */\n onInitialize?: () => Promise<EmbeddedSignInFlowInitiateResponse>;\n\n /**\n * Function to handle authentication steps.\n * @param payload - The authentication payload.\n * @returns Promise resolving to the authentication response.\n */\n onSubmit?: (\n payload: EmbeddedSignInFlowHandleRequestPayload,\n request: EmbeddedFlowExecuteRequestConfig,\n ) => Promise<EmbeddedSignInFlowHandleResponse>;\n\n /**\n * Callback function called when authentication is successful.\n * @param authData - The authentication data returned upon successful completion.\n */\n onSuccess?: (authData: Record<string, any>) => void;\n\n /**\n * Size variant for the component.\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Theme variant for the component.\n */\n variant?: CardProps['variant'];\n}\n\n/**\n * Custom hook for managing component styles\n */\nconst useStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n () => ({\n card: {\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n minWidth: '420px',\n } as CSSProperties,\n header: {\n gap: 0,\n } as CSSProperties,\n subtitle: {\n marginTop: `calc(${theme.vars.spacing.unit} * 1)`,\n } as CSSProperties,\n messagesContainer: {\n marginTop: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n messageItem: {\n marginBottom: `calc(${theme.vars.spacing.unit} * 1)`,\n } as CSSProperties,\n errorContainer: {\n marginBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n contentContainer: {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n loadingContainer: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n } as CSSProperties,\n loadingText: {\n marginTop: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n divider: {\n margin: `calc(${theme.vars.spacing.unit} * 1) 0`,\n } as CSSProperties,\n logoContainer: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n marginBottom: `calc(${theme.vars.spacing.unit} * 3)`,\n } as CSSProperties,\n centeredContainer: {\n textAlign: 'center',\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n } as CSSProperties,\n passkeyContainer: {\n marginBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n passkeyText: {\n marginTop: `calc(${theme.vars.spacing.unit} * 1)`,\n color: theme.vars.colors.text.secondary,\n } as CSSProperties,\n }),\n [theme.vars.spacing.unit, theme.vars.colors.text.secondary],\n );\n};\n\n/**\n * Base SignIn component that provides native authentication flow.\n * This component handles both the presentation layer and authentication flow logic.\n * It accepts API functions as props to maintain framework independence.\n *\n * @example\n * ```tsx\n * import { BaseSignIn } from '@asgardeo/react';\n *\n * const MySignIn = () => {\n * return (\n * <BaseSignIn\n * onInitialize={async () => {\n * // Your API call to initialize authentication\n * return await initializeAuth();\n * }}\n * onSubmit={async (payload) => {\n * // Your API call to handle authentication\n * return await handleAuth(payload);\n * }}\n * onSuccess={(authData) => {\n * console.log('Success:', authData);\n * }}\n * onError={(error) => {\n * console.error('Error:', error);\n * }}\n * className=\"max-w-md mx-auto\"\n * />\n * );\n * };\n * ```\n */\nconst BaseSignIn: FC<BaseSignInProps> = props => {\n const {theme} = useTheme();\n const styles = useStyles();\n\n return (\n <div>\n <div style={styles.logoContainer}>\n <Logo size=\"large\" />\n </div>\n <FlowProvider>\n <BaseSignInContent {...props} />\n </FlowProvider>\n </div>\n );\n};\n\n/**\n * Internal component that consumes FlowContext and renders the sign-in UI.\n */\nconst BaseSignInContent: FC<BaseSignInProps> = ({\n afterSignInUrl,\n onInitialize,\n isLoading: externalIsLoading,\n onSubmit,\n onSuccess,\n onError,\n onFlowChange,\n className = '',\n inputClassName = '',\n buttonClassName = '',\n errorClassName = '',\n messageClassName = '',\n size = 'medium',\n variant = 'outlined',\n}: BaseSignInProps) => {\n const {theme} = useTheme();\n const {t} = useTranslation();\n const {subtitle: flowSubtitle, title: flowTitle, messages: flowMessages} = useFlow();\n const styles = useStyles();\n\n const [isSignInInitializationRequestLoading, setIsSignInInitializationRequestLoading] = useState(false);\n const [isInitialized, setIsInitialized] = useState(false);\n const [currentFlow, setCurrentFlow] = useState<EmbeddedSignInFlowInitiateResponse | null>(null);\n const [currentAuthenticator, setCurrentAuthenticator] = useState<EmbeddedSignInFlowAuthenticator | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [messages, setMessages] = useState<Array<{message: string; type: string}>>([]);\n\n const isLoading = externalIsLoading || isSignInInitializationRequestLoading;\n\n const reRenderCheckRef = useRef(false);\n\n const formFields: FormField[] =\n currentAuthenticator?.metadata?.params?.map(param => ({\n name: param.param,\n required: currentAuthenticator.requiredParams.includes(param.param),\n initialValue: '',\n validator: (value: string) => {\n if (currentAuthenticator.requiredParams.includes(param.param) && (!value || value.trim() === '')) {\n return t('field.required');\n }\n return null;\n },\n })) || [];\n\n const form = useForm<Record<string, string>>({\n initialValues: {},\n fields: formFields,\n validateOnBlur: true,\n validateOnChange: false,\n requiredMessage: t('field.required'),\n });\n\n const {\n values: formValues,\n touched: touchedFields,\n errors: formErrors,\n isValid: isFormValid,\n setValue: setFormValue,\n setTouched: setFormTouched,\n clearErrors: clearFormErrors,\n validateField: validateFormField,\n validateForm,\n touchAllFields,\n reset: resetForm,\n } = form;\n\n /**\n * Setup form fields based on the current authenticator.\n */\n const setupFormFields = useCallback(\n (authenticator: EmbeddedSignInFlowAuthenticator) => {\n const initialValues: Record<string, string> = {};\n authenticator.metadata?.params?.forEach(param => {\n initialValues[param.param] = '';\n });\n\n // Reset form with new values\n resetForm();\n\n // Set initial values for all fields\n Object.keys(initialValues).forEach(key => {\n setFormValue(key, initialValues[key]);\n });\n },\n [resetForm, setFormValue],\n );\n\n /**\n * Mark all fields as touched for validation purposes.\n */\n const markAllFieldsAsTouched = () => {\n touchAllFields();\n };\n\n /**\n * Check if the response contains a redirection URL and perform the redirect if necessary.\n * @param response - The authentication response\n * @returns true if a redirect was performed, false otherwise\n */\n const handleRedirectionIfNeeded = (response: EmbeddedSignInFlowHandleResponse): boolean => {\n if (\n response &&\n 'nextStep' in response &&\n response.nextStep &&\n (response.nextStep as any).stepType === EmbeddedSignInFlowStepType.AuthenticatorPrompt &&\n (response.nextStep as any).authenticators &&\n (response.nextStep as any).authenticators.length === 1\n ) {\n const responseAuthenticator = (response.nextStep as any).authenticators[0];\n if (\n responseAuthenticator.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.RedirectionPrompt &&\n (responseAuthenticator.metadata as any)?.additionalData?.redirectUrl\n ) {\n /**\n * Open a popup window to handle redirection prompts\n */\n const redirectUrl = (responseAuthenticator.metadata as any)?.additionalData?.redirectUrl;\n const popup = window.open(redirectUrl, 'oauth_popup', 'width=500,height=600,scrollbars=yes,resizable=yes');\n\n if (!popup) {\n console.error('Failed to open popup window');\n return false;\n }\n\n /**\n * Add an event listener to the window to capture the message from the popup\n */\n const messageHandler = async function messageEventHandler(event: MessageEvent) {\n /**\n * Check if the message is from our popup window\n */\n if (event.source !== popup) {\n // Don't log every message rejection to reduce noise\n if (event.source !== window && event.source !== window.parent) {\n // TODO: Add logs\n }\n return;\n }\n\n /**\n * Check the origin of the message to ensure it's from a trusted source\n */\n const expectedOrigin = afterSignInUrl ? new URL(afterSignInUrl).origin : window.location.origin;\n if (event.origin !== expectedOrigin && event.origin !== window.location.origin) {\n return;\n }\n\n const {code, state} = event.data;\n\n if (code && state) {\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: responseAuthenticator.authenticatorId,\n params: {\n code,\n state,\n },\n },\n };\n\n await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n\n popup.close();\n cleanup();\n } else {\n // TODO: Add logs\n }\n };\n\n const cleanup = () => {\n window.removeEventListener('message', messageHandler);\n if (popupMonitor) {\n clearInterval(popupMonitor);\n }\n };\n\n window.addEventListener('message', messageHandler);\n\n /**\n * Monitor popup for closure and URL changes\n */\n let hasProcessedCallback = false; // Prevent multiple processing\n const popupMonitor = setInterval(async () => {\n try {\n if (popup.closed) {\n cleanup();\n\n return;\n }\n\n // Skip if we've already processed a callback\n if (hasProcessedCallback) {\n return;\n }\n\n // Try to access popup URL to check for callback\n try {\n const popupUrl = popup.location.href;\n\n // Check if we've been redirected to the callback URL\n if (popupUrl && (popupUrl.includes('code=') || popupUrl.includes('error='))) {\n hasProcessedCallback = true; // Set flag to prevent multiple processing\n\n // Parse the URL for OAuth parameters\n const url = new URL(popupUrl);\n const code = url.searchParams.get('code');\n const state = url.searchParams.get('state');\n const error = url.searchParams.get('error');\n\n if (error) {\n console.error('OAuth error:', error);\n popup.close();\n cleanup();\n return;\n }\n\n if (code && state) {\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: responseAuthenticator.authenticatorId,\n params: {\n code,\n state,\n },\n },\n };\n\n const response = await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n\n popup.close();\n\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.(response.authData);\n }\n }\n }\n } catch (e) {\n // Cross-origin error is expected when popup navigates to OAuth provider\n // This is normal and we can ignore it\n }\n } catch (e) {\n console.error('Error monitoring popup:', e);\n }\n }, 1000);\n\n return true;\n }\n }\n return false;\n };\n\n /**\n * Handle form submission.\n */\n const handleSubmit = async (submittedValues: Record<string, string>) => {\n if (!currentFlow || !currentAuthenticator) {\n return;\n }\n\n // Mark all fields as touched before validation\n touchAllFields();\n\n const validation = validateForm();\n if (!validation.isValid) {\n return;\n }\n\n setIsSignInInitializationRequestLoading(true);\n setError(null);\n setMessages([]);\n\n try {\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: currentAuthenticator.authenticatorId,\n params: submittedValues,\n },\n };\n\n const response = await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.(response.authData);\n return;\n }\n\n if (\n response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted ||\n response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete\n ) {\n setError(t('errors.sign.in.flow.completion.failure'));\n return;\n }\n\n // Check if the response contains a redirection URL and redirect if needed\n if (handleRedirectionIfNeeded(response)) {\n return;\n }\n\n if (response && 'flowId' in response && 'nextStep' in response) {\n const nextStepResponse = response as any;\n setCurrentFlow(nextStepResponse);\n\n if (nextStepResponse.nextStep?.authenticators?.length > 0) {\n if (\n nextStepResponse.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt &&\n nextStepResponse.nextStep.authenticators.length > 1\n ) {\n setCurrentAuthenticator(null);\n } else {\n const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];\n setCurrentAuthenticator(nextAuthenticator);\n setupFormFields(nextAuthenticator);\n }\n }\n\n if (nextStepResponse.nextStep?.messages) {\n setMessages(\n nextStepResponse.nextStep.messages.map((msg: any) => ({\n type: msg.type || 'INFO',\n message: msg.message || '',\n })),\n );\n }\n }\n } catch (err) {\n const errorMessage = err instanceof AsgardeoAPIError ? err.message : t('errors.sign.in.flow.failure');\n setError(errorMessage);\n onError?.(err as Error);\n } finally {\n setIsSignInInitializationRequestLoading(false);\n }\n };\n\n /**\n * Handle authenticator selection for multi-option prompts.\n */\n const handleAuthenticatorSelection = async (\n authenticator: EmbeddedSignInFlowAuthenticator,\n formData?: Record<string, string>,\n ) => {\n if (!currentFlow) {\n return;\n }\n\n // Mark all fields as touched if we have form data (i.e., this is a submission)\n if (formData) {\n touchAllFields();\n }\n\n setIsSignInInitializationRequestLoading(true);\n setError(null);\n setMessages([]);\n\n try {\n // Handle passkey/FIDO authentication\n if (isPasskeyAuthenticator(authenticator)) {\n try {\n const challengeData = (authenticator.metadata as any)?.additionalData?.challengeData;\n if (!challengeData) {\n throw new Error('Missing challenge data for passkey authentication');\n }\n\n const tokenResponse = await handleWebAuthnAuthentication(challengeData);\n\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: authenticator.authenticatorId,\n params: {\n tokenResponse,\n },\n },\n };\n\n const response = await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.(response.authData);\n return;\n }\n\n if (\n response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted ||\n response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete\n ) {\n setError(t('errors.sign.in.flow.passkeys.completion.failure'));\n return;\n }\n\n // Handle next step if authentication is not complete\n if (response && 'flowId' in response && 'nextStep' in response) {\n const nextStepResponse = response as any;\n setCurrentFlow(nextStepResponse);\n\n if (nextStepResponse.nextStep?.authenticators?.length > 0) {\n if (\n nextStepResponse.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt &&\n nextStepResponse.nextStep.authenticators.length > 1\n ) {\n setCurrentAuthenticator(null);\n } else {\n const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];\n\n // Check if the next authenticator is also a passkey - if so, auto-trigger it\n if (isPasskeyAuthenticator(nextAuthenticator)) {\n // Recursively handle the passkey authenticator without showing UI\n handleAuthenticatorSelection(nextAuthenticator);\n return;\n }\n setCurrentAuthenticator(nextAuthenticator);\n setupFormFields(nextAuthenticator);\n }\n }\n\n if (nextStepResponse.nextStep?.messages) {\n setMessages(\n nextStepResponse.nextStep.messages.map((msg: any) => ({\n type: msg.type || 'INFO',\n message: msg.message || '',\n })),\n );\n }\n }\n } catch (passkeyError) {\n console.error('Passkey authentication error:', passkeyError);\n\n // Provide more context for common errors\n let errorMessage =\n passkeyError instanceof Error ? passkeyError.message : t('errors.sign.in.flow.passkeys.failure');\n\n // Add additional context for security errors\n if (passkeyError instanceof Error && passkeyError.message.includes('security')) {\n errorMessage +=\n ' This may be due to browser security settings, an insecure connection, or device restrictions.';\n }\n\n setError(errorMessage);\n }\n } else if (authenticator.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.RedirectionPrompt) {\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: authenticator.authenticatorId,\n params: {},\n },\n };\n\n const response = await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.(response.authData);\n return;\n }\n\n // Check if the response contains a redirection URL and redirect if needed\n if (handleRedirectionIfNeeded(response)) {\n }\n } else if (formData) {\n const validation = validateForm();\n if (!validation.isValid) {\n return;\n }\n\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: authenticator.authenticatorId,\n params: formData,\n },\n };\n\n const response = await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.(response.authData);\n return;\n }\n\n if (\n response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted ||\n response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete\n ) {\n setError('Authentication failed. Please check your credentials and try again.');\n return;\n }\n\n // Check if the response contains a redirection URL and redirect if needed\n if (handleRedirectionIfNeeded(response)) {\n return;\n }\n\n if (response && 'flowId' in response && 'nextStep' in response) {\n const nextStepResponse = response as any;\n setCurrentFlow(nextStepResponse);\n\n if (nextStepResponse.nextStep?.authenticators?.length > 0) {\n if (\n nextStepResponse.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt &&\n nextStepResponse.nextStep.authenticators.length > 1\n ) {\n setCurrentAuthenticator(null);\n } else {\n const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];\n\n // Check if the next authenticator is a passkey - if so, auto-trigger it\n if (isPasskeyAuthenticator(nextAuthenticator)) {\n // Recursively handle the passkey authenticator without showing UI\n handleAuthenticatorSelection(nextAuthenticator);\n return;\n }\n setCurrentAuthenticator(nextAuthenticator);\n setupFormFields(nextAuthenticator);\n }\n }\n\n if (nextStepResponse.nextStep?.messages) {\n setMessages(\n nextStepResponse.nextStep.messages.map((msg: any) => ({\n type: msg.type || 'INFO',\n message: msg.message || '',\n })),\n );\n }\n }\n } else {\n // Check if the authenticator requires user input\n const hasParams = authenticator.metadata?.params && authenticator.metadata.params.length > 0;\n\n if (!hasParams) {\n // If no parameters are required, directly authenticate\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: authenticator.authenticatorId,\n params: {},\n },\n };\n\n const response = await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.(response.authData);\n return;\n }\n\n if (\n response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted ||\n response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete\n ) {\n setError('Authentication failed. Please try again.');\n return;\n }\n\n // Check if the response contains a redirection URL and redirect if needed\n if (handleRedirectionIfNeeded(response)) {\n return;\n }\n\n if (response && 'flowId' in response && 'nextStep' in response) {\n const nextStepResponse = response as any;\n setCurrentFlow(nextStepResponse);\n\n if (nextStepResponse.nextStep?.authenticators?.length > 0) {\n if (\n nextStepResponse.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt &&\n nextStepResponse.nextStep.authenticators.length > 1\n ) {\n setCurrentAuthenticator(null);\n } else {\n const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];\n\n // Check if the next authenticator is a passkey - if so, auto-trigger it\n if (isPasskeyAuthenticator(nextAuthenticator)) {\n // Recursively handle the passkey authenticator without showing UI\n handleAuthenticatorSelection(nextAuthenticator);\n return;\n }\n setCurrentAuthenticator(nextAuthenticator);\n setupFormFields(nextAuthenticator);\n }\n }\n\n if (nextStepResponse.nextStep?.messages) {\n setMessages(\n nextStepResponse.nextStep.messages.map((msg: any) => ({\n type: msg.type || 'INFO',\n message: msg.message || '',\n })),\n );\n }\n }\n } else {\n // If parameters are required, show the form\n setCurrentAuthenticator(authenticator);\n setupFormFields(authenticator);\n }\n }\n } catch (err) {\n const errorMessage = err instanceof AsgardeoAPIError ? err?.message : 'Authenticator selection failed';\n setError(errorMessage);\n onError?.(err as Error);\n } finally {\n setIsSignInInitializationRequestLoading(false);\n }\n };\n\n /**\n * Handle input value changes.\n */\n const handleInputChange = (param: string, value: string) => {\n setFormValue(param, value);\n setFormTouched(param, true);\n };\n\n /**\n * Check if current flow has multiple authenticator options.\n */\n const hasMultipleOptions = useCallback(\n (): boolean =>\n currentFlow &&\n 'nextStep' in currentFlow &&\n currentFlow.nextStep?.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt &&\n currentFlow.nextStep?.authenticators &&\n currentFlow.nextStep.authenticators.length > 1,\n [currentFlow],\n );\n\n /**\n * Get available authenticators for selection.\n */\n const getAvailableAuthenticators = useCallback((): EmbeddedSignInFlowAuthenticator[] => {\n if (!currentFlow || !('nextStep' in currentFlow) || !currentFlow.nextStep?.authenticators) {\n return [];\n }\n return currentFlow.nextStep.authenticators;\n }, [currentFlow]);\n\n // Generate CSS classes\n const containerClasses = clsx(\n [\n withVendorCSSClassPrefix('signin'),\n withVendorCSSClassPrefix(`signin--${size}`),\n withVendorCSSClassPrefix(`signin--${variant}`),\n ],\n className,\n );\n\n const inputClasses = clsx(\n [\n withVendorCSSClassPrefix('signin__input'),\n size === 'small' && withVendorCSSClassPrefix('signin__input--small'),\n size === 'large' && withVendorCSSClassPrefix('signin__input--large'),\n ],\n inputClassName,\n );\n\n const buttonClasses = clsx(\n [\n withVendorCSSClassPrefix('signin__button'),\n size === 'small' && withVendorCSSClassPrefix('signin__button--small'),\n size === 'large' && withVendorCSSClassPrefix('signin__button--large'),\n ],\n buttonClassName,\n );\n\n const errorClasses = clsx([withVendorCSSClassPrefix('signin__error')], errorClassName);\n\n const messageClasses = clsx([withVendorCSSClassPrefix('signin__messages')], messageClassName); // Initialize the flow on component mount\n\n useEffect(() => {\n if (isLoading) {\n return;\n }\n\n // React 18.x Strict.Mode has a new check for `Ensuring reusable state` to facilitate an upcoming react feature.\n // https://reactjs.org/docs/strict-mode.html#ensuring-reusable-state\n // This will remount all the useEffects to ensure that there are no unexpected side effects.\n // When react remounts the SignIn, it will send two authorize requests.\n // https://github.com/reactwg/react-18/discussions/18#discussioncomment-795623\n if (reRenderCheckRef.current) {\n return;\n }\n\n reRenderCheckRef.current = true;\n\n (async () => {\n setIsSignInInitializationRequestLoading(true);\n setError(null);\n\n try {\n const response = await onInitialize();\n\n setCurrentFlow(response);\n setIsInitialized(true);\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.((response as any).authData || {});\n return;\n }\n\n if (response?.nextStep?.authenticators?.length > 0) {\n if (\n response.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt &&\n response.nextStep.authenticators.length > 1\n ) {\n setCurrentAuthenticator(null);\n } else {\n const authenticator = response.nextStep.authenticators[0];\n setCurrentAuthenticator(authenticator);\n setupFormFields(authenticator);\n }\n }\n\n if (response && 'nextStep' in response && response.nextStep && 'messages' in response.nextStep) {\n const stepMessages = (response.nextStep as any).messages || [];\n setMessages(\n stepMessages.map((msg: any) => ({\n type: msg.type || 'INFO',\n message: msg.message || '',\n })),\n );\n }\n } catch (err) {\n const errorMessage = err instanceof AsgardeoAPIError ? err.message : t('errors.sign.in.initialization');\n setError(errorMessage);\n onError?.(err as Error);\n } finally {\n setIsSignInInitializationRequestLoading(false);\n }\n })();\n }, [isLoading]);\n\n if (!isInitialized && isLoading) {\n return (\n <Card className={containerClasses} style={styles.card} variant={variant}>\n <Card.Content>\n <div style={styles.loadingContainer}>\n <Spinner size=\"medium\" />\n <Typography variant=\"body1\" style={styles.loadingText}>\n {t('messages.loading')}\n </Typography>\n </div>\n </Card.Content>\n </Card>\n );\n }\n\n if (hasMultipleOptions() && !currentAuthenticator) {\n const availableAuthenticators = getAvailableAuthenticators();\n\n const userPromptAuthenticators = availableAuthenticators.filter(\n auth =>\n auth.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.UserPrompt ||\n // Fallback: LOCAL authenticators with params are typically user prompts\n (auth.idp === 'LOCAL' && auth.metadata?.params && auth.metadata.params.length > 0),\n );\n\n const optionAuthenticators = availableAuthenticators.filter(auth => !userPromptAuthenticators.includes(auth));\n\n return (\n <Card className={containerClasses} style={styles.card} variant={variant}>\n <Card.Header style={styles.header}>\n <Card.Title level={2}>{flowTitle || t('signin.title')}</Card.Title>\n {flowSubtitle && (\n <Typography variant=\"body1\" style={styles.subtitle}>\n {flowSubtitle || t('signin.subtitle')}\n </Typography>\n )}\n {flowMessages && flowMessages.length > 0 && (\n <div style={styles.messagesContainer}>\n {flowMessages.map((flowMessage, index) => (\n <Alert\n key={flowMessage.id || index}\n variant={flowMessage.type}\n style={styles.messageItem}\n className={messageClasses}\n >\n <Alert.Description>{flowMessage.message}</Alert.Description>\n </Alert>\n ))}\n </div>\n )}\n {messages.length > 0 && (\n <div style={styles.messagesContainer}>\n {messages.map((message, index) => {\n const variant =\n message.type.toLowerCase() === 'error'\n ? 'error'\n : message.type.toLowerCase() === 'warning'\n ? 'warning'\n : message.type.toLowerCase() === 'success'\n ? 'success'\n : 'info';\n\n return (\n <Alert key={index} variant={variant} style={styles.messageItem} className={messageClasses}>\n <Alert.Description>{message.message}</Alert.Description>\n </Alert>\n );\n })}\n </div>\n )}\n </Card.Header>\n\n <Card.Content>\n {error && (\n <Alert variant=\"error\" style={styles.errorContainer} className={errorClasses}>\n <Alert.Title>Error</Alert.Title>\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n )}\n\n <div style={styles.contentContainer}>\n {/* Render USER_PROMPT authenticators as form fields */}\n {userPromptAuthenticators.map((authenticator, index) => (\n <div key={authenticator.authenticatorId}>\n {index > 0 && <Divider style={styles.divider}>OR</Divider>}\n <form\n onSubmit={e => {\n e.preventDefault();\n const formData: Record<string, string> = {};\n authenticator.metadata?.params?.forEach(param => {\n formData[param.param] = formValues[param.param] || '';\n });\n handleAuthenticatorSelection(authenticator, formData);\n }}\n >\n {createSignInOptionFromAuthenticator(\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n handleInputChange,\n (auth, formData) => handleAuthenticatorSelection(auth, formData),\n {\n inputClassName: inputClasses,\n buttonClassName: buttonClasses,\n error,\n },\n )}\n </form>\n </div>\n ))}\n\n {/* Add divider between user prompts and option authenticators if both exist */}\n {userPromptAuthenticators.length > 0 && optionAuthenticators.length > 0 && (\n <Divider style={styles.divider}>OR</Divider>\n )}\n\n {/* Render all other authenticators (REDIRECTION_PROMPT, multi-option buttons, etc.) */}\n {optionAuthenticators.map((authenticator, index) => (\n <div key={authenticator.authenticatorId}>\n {createSignInOptionFromAuthenticator(\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n handleInputChange,\n (auth, formData) => handleAuthenticatorSelection(auth, formData),\n {\n inputClassName: inputClasses,\n buttonClassName: buttonClasses,\n error,\n },\n )}\n </div>\n ))}\n </div>\n </Card.Content>\n </Card>\n );\n }\n\n if (!currentAuthenticator) {\n return (\n <Card className={containerClasses} variant={variant}>\n <Card.Content>\n {error && (\n <Alert variant=\"error\">\n <Alert.Title>{t('errors.title') || 'Error'}</Alert.Title>\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n )}\n </Card.Content>\n </Card>\n );\n }\n\n // If the current authenticator is a passkey, auto-trigger it instead of showing a form\n if (isPasskeyAuthenticator(currentAuthenticator) && !isLoading) {\n // Auto-trigger passkey authentication\n useEffect(() => {\n handleAuthenticatorSelection(currentAuthenticator);\n }, [currentAuthenticator]);\n\n // Show loading state while passkey authentication is in progress\n return (\n <Card className={containerClasses} variant={variant}>\n <Card.Content>\n <div style={styles.centeredContainer}>\n <div style={styles.passkeyContainer}>\n <Spinner size=\"large\" />\n </div>\n <Typography variant=\"body1\">{t('passkey.authenticating') || 'Authenticating with passkey...'}</Typography>\n <Typography variant=\"body2\" style={styles.passkeyText}>\n {t('passkey.instruction') || 'Please use your fingerprint, face, or security key to authenticate.'}\n </Typography>\n </div>\n </Card.Content>\n </Card>\n );\n }\n\n return (\n <Card className={containerClasses} style={styles.card} variant={variant}>\n <Card.Header style={styles.header}>\n <Card.Title level={2}>{flowTitle || t('signin.title')}</Card.Title>\n <Typography variant=\"body1\" style={styles.subtitle}>\n {flowSubtitle || t('signin.subtitle')}\n </Typography>\n {flowMessages && flowMessages.length > 0 && (\n <div style={styles.messagesContainer}>\n {flowMessages.map((flowMessage, index) => (\n <Alert\n key={flowMessage.id || index}\n variant={flowMessage.type}\n style={styles.messageItem}\n className={messageClasses}\n >\n <Alert.Description>{flowMessage.message}</Alert.Description>\n </Alert>\n ))}\n </div>\n )}\n {messages.length > 0 && (\n <div style={styles.messagesContainer}>\n {messages.map((message, index) => {\n const variant =\n message.type.toLowerCase() === 'error'\n ? 'error'\n : message.type.toLowerCase() === 'warning'\n ? 'warning'\n : message.type.toLowerCase() === 'success'\n ? 'success'\n : 'info';\n\n return (\n <Alert key={index} variant={variant} style={styles.messageItem} className={messageClasses}>\n <Alert.Description>{message.message}</Alert.Description>\n </Alert>\n );\n })}\n </div>\n )}\n </Card.Header>\n\n <Card.Content>\n {error && (\n <Alert variant=\"error\" style={styles.errorContainer} className={errorClasses}>\n <Alert.Title>{t('errors.title')}</Alert.Title>\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n )}\n\n <form\n onSubmit={(e: FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData: Record<string, string> = {};\n currentAuthenticator.metadata?.params?.forEach(param => {\n formData[param.param] = formValues[param.param] || '';\n });\n handleSubmit(formData);\n }}\n >\n {createSignInOptionFromAuthenticator(\n currentAuthenticator,\n formValues,\n touchedFields,\n isLoading,\n handleInputChange,\n (authenticator, formData) => handleSubmit(formData || formValues),\n {\n inputClassName: inputClasses,\n buttonClassName: buttonClasses,\n error,\n },\n )}\n </form>\n </Card.Content>\n </Card>\n );\n};\n\nexport default BaseSignIn;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n EmbeddedSignInFlowAuthenticator,\n EmbeddedSignInFlowAuthenticatorKnownIdPType,\n ApplicationNativeAuthenticationConstants,\n WithPreferences,\n} from '@asgardeo/browser';\nimport {ReactElement} from 'react';\nimport UsernamePassword from './UsernamePassword';\nimport IdentifierFirst from './IdentifierFirst';\nimport GoogleButton from './GoogleButton';\nimport GitHubButton from './GitHubButton';\nimport MicrosoftButton from './MicrosoftButton';\nimport FacebookButton from './FacebookButton';\nimport LinkedInButton from './LinkedInButton';\nimport SignInWithEthereumButton from './SignInWithEthereumButton';\nimport EmailOtp from './EmailOtp';\nimport Totp from './Totp';\nimport SmsOtp from './SmsOtp';\nimport SocialButton from './SocialButton';\nimport MultiOptionButton from './MultiOptionButton';\n\n/**\n * Base props that all sign-in option components share.\n */\nexport interface BaseSignInOptionProps extends WithPreferences {\n /**\n * The authenticator configuration.\n */\n authenticator: EmbeddedSignInFlowAuthenticator;\n\n /**\n * Current form values.\n */\n formValues: Record<string, string>;\n\n /**\n * Touched state for form fields.\n */\n touchedFields: Record<string, boolean>;\n\n /**\n * Whether the component is in loading state.\n */\n isLoading: boolean;\n\n /**\n * Error message to display.\n */\n error?: string | null;\n\n /**\n * Callback function called when input values change.\n */\n onInputChange: (param: string, value: string) => void;\n\n /**\n * Callback function called when the option is submitted.\n */\n onSubmit: (authenticator: EmbeddedSignInFlowAuthenticator, formData?: Record<string, string>) => void;\n\n /**\n * Custom CSS class name for form inputs.\n */\n inputClassName?: string;\n\n /**\n * Custom CSS class name for the submit button.\n */\n buttonClassName?: string;\n\n /**\n * Text for the submit button.\n */\n submitButtonText?: string;\n}\n\n/**\n * Creates the appropriate sign-in option component based on the authenticator's ID.\n */\nexport const createSignInOption = (props: BaseSignInOptionProps): ReactElement => {\n const {authenticator, ...optionProps} = props;\n\n // Check if this authenticator has params (indicating it needs user input)\n const hasParams = authenticator.metadata?.params && authenticator.metadata.params.length > 0;\n\n // Use authenticatorId to determine the component type\n switch (authenticator.authenticatorId) {\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.UsernamePassword:\n return <UsernamePassword {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.IdentifierFirst:\n return <IdentifierFirst {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Google:\n return <GoogleButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.GitHub:\n return <GitHubButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Microsoft:\n return <MicrosoftButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Facebook:\n return <FacebookButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.LinkedIn:\n return <LinkedInButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.SignInWithEthereum:\n return <SignInWithEthereumButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.EmailOtp:\n // If it has params, render as input form, otherwise as selection button\n return hasParams ? <EmailOtp {...props} /> : <MultiOptionButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Totp:\n // If it has params, render as input form, otherwise as selection button\n return hasParams ? <Totp {...props} /> : <MultiOptionButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.SmsOtp:\n // If it has params, render as input form, otherwise as selection button\n return hasParams ? <SmsOtp {...props} /> : <MultiOptionButton {...props} />;\n\n default:\n // Check if it's a federated authenticator (non-LOCAL idp)\n if (authenticator.idp !== EmbeddedSignInFlowAuthenticatorKnownIdPType.Local) {\n // For unknown federated authenticators, use generic social login\n return <SocialButton {...props} />;\n }\n\n // For LOCAL authenticators, decide based on whether they have params\n if (hasParams) {\n // Fallback to username/password for unknown local authenticators with params\n return <UsernamePassword {...props} />;\n } else {\n // Use multi-option button for LOCAL authenticators without params\n return <MultiOptionButton {...props} />;\n }\n }\n};\n\n/**\n * Convenience function that creates the appropriate sign-in option component from an authenticator.\n */\nexport const createSignInOptionFromAuthenticator = (\n authenticator: EmbeddedSignInFlowAuthenticator,\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n isLoading: boolean,\n onInputChange: (param: string, value: string) => void,\n onSubmit: (authenticator: EmbeddedSignInFlowAuthenticator, formData?: Record<string, string>) => void,\n options?: {\n inputClassName?: string;\n buttonClassName?: string;\n error?: string | null;\n },\n): ReactElement => {\n return createSignInOption({\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n onInputChange,\n onSubmit,\n ...options,\n });\n};\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedSignInFlowAuthenticator, EmbeddedSignInFlowAuthenticatorParamType, FieldType} from '@asgardeo/browser';\nimport {FC, useEffect} from 'react';\nimport {createField} from '../../../factories/FieldFactory';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport useFlow from '../../../../contexts/Flow/useFlow';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * Username Password Sign-In Option Component.\n * Handles traditional username and password authentication.\n */\nconst UsernamePassword: FC<BaseSignInOptionProps> = ({\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n onInputChange,\n onSubmit,\n inputClassName = '',\n buttonClassName = '',\n preferences,\n}) => {\n const {theme} = useTheme();\n const {t} = useTranslation(preferences?.i18n);\n const {setTitle, setSubtitle} = useFlow();\n\n const formFields =\n authenticator.metadata?.params?.sort((a, b) => a.order - b.order)?.filter(param => param.param !== 'totp') || []; // Exclude TOTP fields for username/password\n\n useEffect(() => {\n setTitle(t('username.password.title'));\n setSubtitle(t('username.password.subtitle'));\n }, [setTitle, setSubtitle, t]);\n\n return (\n <>\n {formFields.map(param => (\n <div key={param.param} style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {createField({\n name: param.param,\n type:\n param.type === EmbeddedSignInFlowAuthenticatorParamType.String\n ? param.confidential\n ? FieldType.Password\n : FieldType.Text\n : FieldType.Text,\n label: param.displayName,\n required: authenticator.requiredParams.includes(param.param),\n value: formValues[param.param] || '',\n onChange: value => onInputChange(param.param, value),\n disabled: isLoading,\n className: inputClassName,\n touched: touchedFields[param.param] || false,\n placeholder: t(`elements.fields.placeholder`, {\n field: (param.displayName || param.param).toLowerCase(),\n }),\n })}\n </div>\n ))}\n\n <Button\n type=\"submit\"\n disabled={isLoading}\n loading={isLoading}\n className={buttonClassName}\n color=\"primary\"\n variant=\"solid\"\n fullWidth\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n {t('username.password.submit.button')}\n </Button>\n </>\n );\n};\n\nexport default UsernamePassword;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, InputHTMLAttributes, ReactNode} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\nexport interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className'> {\n /**\n * Label text to display above the input\n */\n label?: string;\n /**\n * Error message to display below the input\n */\n error?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n /**\n * Helper text to display below the input\n */\n helperText?: string;\n /**\n * Icon to display at the start (left) of the input\n */\n startIcon?: ReactNode;\n /**\n * Icon to display at the end (right) of the input\n */\n endIcon?: ReactNode;\n /**\n * Click handler for the start icon\n */\n onStartIconClick?: () => void;\n /**\n * Click handler for the end icon\n */\n onEndIconClick?: () => void;\n}\n\nconst TextField: FC<TextFieldProps> = ({\n label,\n error,\n required,\n className,\n disabled,\n helperText,\n startIcon,\n endIcon,\n onStartIconClick,\n onEndIconClick,\n type = 'text',\n style = {},\n ...rest\n}) => {\n const {theme} = useTheme();\n\n // Calculate padding based on icons\n const hasStartIcon = !!startIcon;\n const hasEndIcon = !!endIcon;\n const leftPadding = hasStartIcon ? theme.spacing.unit * 5 : theme.spacing.unit * 1.5;\n const rightPadding = hasEndIcon ? theme.spacing.unit * 5 : theme.spacing.unit * 1.5;\n\n const inputStyle: CSSProperties = {\n width: '100%',\n padding: `${theme.spacing.unit}px ${rightPadding}px ${theme.spacing.unit}px ${leftPadding}px`,\n border: `1px solid ${error ? theme.colors.error.main : theme.colors.border}`,\n borderRadius: theme.borderRadius.medium,\n fontSize: '1rem',\n color: theme.colors.text.primary,\n backgroundColor: disabled ? theme.colors.background.disabled : theme.colors.background.surface,\n outline: 'none',\n transition: 'border-color 0.2s ease',\n };\n\n const inputContainerStyle: CSSProperties = {\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n };\n\n const iconButtonStyle: CSSProperties = {\n position: 'absolute',\n background: 'none',\n border: 'none',\n cursor: disabled ? 'not-allowed' : 'pointer',\n padding: theme.spacing.unit / 2,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n color: theme.colors.text.secondary,\n opacity: disabled ? 0.5 : 1,\n top: '50%',\n transform: 'translateY(-50%)',\n };\n\n const startIconStyle: CSSProperties = {\n ...iconButtonStyle,\n left: theme.spacing.unit,\n };\n\n const endIconStyle: CSSProperties = {\n ...iconButtonStyle,\n right: theme.spacing.unit,\n };\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={clsx(withVendorCSSClassPrefix('text-field'), className)}\n style={style}\n >\n {label && (\n <InputLabel required={required} error={!!error}>\n {label}\n </InputLabel>\n )}\n <div style={inputContainerStyle}>\n {startIcon && (\n <div\n style={startIconStyle}\n onClick={onStartIconClick}\n role={onStartIconClick ? 'button' : undefined}\n tabIndex={onStartIconClick && !disabled ? 0 : undefined}\n aria-label=\"Start icon\"\n >\n {startIcon}\n </div>\n )}\n <input\n style={inputStyle}\n type={type}\n disabled={disabled}\n aria-invalid={!!error}\n aria-required={required}\n {...rest}\n />\n {endIcon && (\n <div\n style={endIconStyle}\n onClick={onEndIconClick}\n role={onEndIconClick ? 'button' : undefined}\n tabIndex={onEndIconClick && !disabled ? 0 : undefined}\n aria-label=\"End icon\"\n >\n {endIcon}\n </div>\n )}\n </div>\n </FormControl>\n );\n};\n\nexport default TextField;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, ReactNode, ComponentPropsWithoutRef, ElementType} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\n// Typography variants mapped to HTML elements and styling\nexport type TypographyVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'subtitle1'\n | 'subtitle2'\n | 'body1'\n | 'body2'\n | 'caption'\n | 'overline'\n | 'button';\n\nexport type TypographyAlign = 'left' | 'center' | 'right' | 'justify';\n\nexport type TypographyColor =\n | 'primary'\n | 'secondary'\n | 'error'\n | 'success'\n | 'warning'\n | 'info'\n | 'textPrimary'\n | 'textSecondary'\n | 'inherit';\n\nexport interface TypographyProps {\n /**\n * The content to be rendered\n */\n children: ReactNode;\n /**\n * The typography variant to apply\n */\n variant?: TypographyVariant;\n /**\n * The HTML element or React component to render\n */\n component?: ElementType;\n /**\n * Text alignment\n */\n align?: TypographyAlign;\n /**\n * Color variant\n */\n color?: TypographyColor;\n /**\n * Whether the text should be clipped with ellipsis when it overflows\n */\n noWrap?: boolean;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Custom styles\n */\n style?: CSSProperties;\n /**\n * Whether the text should be displayed inline\n */\n inline?: boolean;\n /**\n * Custom font weight\n */\n fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold' | number;\n /**\n * Custom font size (overrides variant sizing)\n */\n fontSize?: string | number;\n /**\n * Line height\n */\n lineHeight?: string | number;\n /**\n * Whether to disable gutters (margin bottom)\n */\n gutterBottom?: boolean;\n}\n\n// Default component mapping for variants\nconst variantMapping: Record<TypographyVariant, ElementType> = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n caption: 'span',\n overline: 'span',\n button: 'span',\n};\n\n/**\n * Typography component for consistent text rendering throughout the application.\n * Integrates with the theme system and provides semantic HTML elements.\n */\nconst Typography: FC<TypographyProps> = ({\n children,\n variant = 'body1',\n component,\n align = 'left',\n color = 'textPrimary',\n noWrap = false,\n className,\n style = {},\n inline = false,\n fontWeight,\n fontSize,\n lineHeight,\n gutterBottom = false,\n ...rest\n}) => {\n const {theme} = useTheme();\n\n // Determine the component to render\n const Component = component || variantMapping[variant] || 'span';\n\n // Get color value from theme\n const getColorValue = (colorVariant: TypographyColor): string => {\n switch (colorVariant) {\n case 'primary':\n return theme.colors.primary.main;\n case 'secondary':\n return theme.colors.secondary.main;\n case 'error':\n return theme.colors.error.main;\n case 'textPrimary':\n return theme.colors.text.primary;\n case 'textSecondary':\n return theme.colors.text.secondary;\n case 'inherit':\n return 'inherit';\n default:\n return theme.colors.text.primary;\n }\n };\n\n // Get variant styles\n const getVariantStyles = (variantName: TypographyVariant): CSSProperties => {\n const baseUnit = theme.spacing.unit;\n\n switch (variantName) {\n case 'h1':\n return {\n fontSize: theme.vars.typography.fontSizes['3xl'], // 34px\n fontWeight: 600,\n lineHeight: 1.235,\n letterSpacing: '-0.00735em',\n };\n case 'h2':\n return {\n fontSize: theme.vars.typography.fontSizes['2xl'], // 24px\n fontWeight: 600,\n lineHeight: 1.334,\n letterSpacing: '0em',\n };\n case 'h3':\n return {\n fontSize: theme.vars.typography.fontSizes.xl, // 20px\n fontWeight: 600,\n lineHeight: 1.6,\n letterSpacing: '0.0075em',\n };\n case 'h4':\n return {\n fontSize: theme.vars.typography.fontSizes.lg, // 18px\n fontWeight: 600,\n lineHeight: 1.5,\n letterSpacing: '0.00938em',\n };\n case 'h5':\n return {\n fontSize: theme.vars.typography.fontSizes.md, // 16px\n fontWeight: 600,\n lineHeight: 1.334,\n letterSpacing: '0em',\n };\n case 'h6':\n return {\n fontSize: theme.vars.typography.fontSizes.sm, // 14px\n fontWeight: 500,\n lineHeight: 1.6,\n letterSpacing: '0.0075em',\n };\n case 'subtitle1':\n return {\n fontSize: theme.vars.typography.fontSizes.md, // 16px\n fontWeight: 400,\n lineHeight: 1.75,\n letterSpacing: '0.00938em',\n };\n case 'subtitle2':\n return {\n fontSize: theme.vars.typography.fontSizes.sm, // 14px\n fontWeight: 500,\n lineHeight: 1.57,\n letterSpacing: '0.00714em',\n };\n case 'body1':\n return {\n fontSize: theme.vars.typography.fontSizes.md, // 16px\n fontWeight: 400,\n lineHeight: 1.5,\n letterSpacing: '0.00938em',\n };\n case 'body2':\n return {\n fontSize: theme.vars.typography.fontSizes.sm, // 14px\n fontWeight: 400,\n lineHeight: 1.43,\n letterSpacing: '0.01071em',\n };\n case 'caption':\n return {\n fontSize: theme.vars.typography.fontSizes.xs, // 12px\n fontWeight: 400,\n lineHeight: 1.66,\n letterSpacing: '0.03333em',\n };\n case 'overline':\n return {\n fontSize: theme.vars.typography.fontSizes.xs, // 12px\n fontWeight: 400,\n lineHeight: 2.66,\n letterSpacing: '0.08333em',\n textTransform: 'uppercase',\n };\n case 'button':\n return {\n fontSize: theme.vars.typography.fontSizes.sm, // 14px\n fontWeight: 500,\n lineHeight: 1.75,\n letterSpacing: '0.02857em',\n textTransform: 'uppercase',\n };\n default:\n return {};\n }\n };\n\n const variantStyles = getVariantStyles(variant);\n\n const typographyStyle: CSSProperties = {\n margin: 0,\n color: getColorValue(color),\n textAlign: align,\n display: inline ? 'inline' : variantMapping[variant] === 'span' ? 'inline' : 'block',\n ...variantStyles,\n // Custom overrides\n ...(fontWeight && {fontWeight}),\n ...(fontSize && {fontSize: typeof fontSize === 'number' ? `${fontSize}px` : fontSize}),\n ...(lineHeight && {lineHeight}),\n ...(noWrap && {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }),\n ...(gutterBottom && {\n marginBottom: theme.spacing.unit + 'px',\n }),\n ...style,\n };\n\n return (\n <Component\n className={clsx(\n withVendorCSSClassPrefix('typography'),\n withVendorCSSClassPrefix(`typography-${variant}`),\n {\n [withVendorCSSClassPrefix('typography-noWrap')]: noWrap,\n [withVendorCSSClassPrefix('typography-inline')]: inline,\n [withVendorCSSClassPrefix('typography-gutterBottom')]: gutterBottom,\n },\n className,\n )}\n style={typographyStyle}\n {...rest}\n >\n {children}\n </Component>\n );\n};\n\nexport default Typography;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, ReactNode} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport Typography from '../Typography/Typography';\n\nexport interface FormControlProps {\n /**\n * The content to be wrapped by the form control\n */\n children: ReactNode;\n /**\n * Error message to display below the content\n */\n error?: string;\n /**\n * Helper text to display below the content\n */\n helperText?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Custom container style\n */\n style?: CSSProperties;\n /**\n * Custom alignment for helper text (default: left, center for OTP)\n */\n helperTextAlign?: 'left' | 'center';\n /**\n * Custom margin left for helper text (for components like Checkbox)\n */\n helperTextMarginLeft?: string;\n}\n\nconst FormControl: FC<FormControlProps> = ({\n children,\n error,\n helperText,\n className,\n style = {},\n helperTextAlign = 'left',\n helperTextMarginLeft,\n}) => {\n const {theme} = useTheme();\n\n const containerStyle: CSSProperties = {\n textAlign: 'left',\n marginBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n ...style,\n };\n\n const helperTextStyle: CSSProperties = {\n marginTop: `calc(${theme.vars.spacing.unit} / 2)`,\n textAlign: helperTextAlign,\n ...(helperTextMarginLeft && {marginLeft: helperTextMarginLeft}),\n };\n\n return (\n <div style={containerStyle} className={className}>\n {children}\n {(error || helperText) && (\n <Typography variant=\"caption\" color={error ? 'error' : 'textSecondary'} style={helperTextStyle}>\n {error || helperText}\n </Typography>\n )}\n </div>\n );\n};\n\nexport default FormControl;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, LabelHTMLAttributes, ReactNode} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\n\nexport interface InputLabelProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, 'style'> {\n /**\n * Label text or content\n */\n children: ReactNode;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Whether there's an error state\n */\n error?: boolean;\n /**\n * Custom style overrides\n */\n style?: CSSProperties;\n /**\n * Display type for label positioning\n */\n variant?: 'block' | 'inline';\n /**\n * Custom margin bottom (useful for different form layouts)\n */\n marginBottom?: string;\n}\n\nconst InputLabel: FC<InputLabelProps> = ({\n children,\n required,\n error,\n style = {},\n variant = 'block',\n marginBottom,\n ...rest\n}) => {\n const {theme} = useTheme();\n\n const labelStyle: CSSProperties = {\n display: variant,\n marginBottom: marginBottom || (variant === 'block' ? `calc(${theme.vars.spacing.unit} + 1px)` : '0'),\n color: error ? theme.vars.colors.error.main : theme.vars.colors.text.secondary,\n fontSize: theme.vars.typography.fontSizes.sm,\n fontWeight: variant === 'block' ? 500 : 'normal',\n ...style,\n };\n\n return (\n <label style={labelStyle} {...rest}>\n {children}\n {required && <span style={{color: theme.vars.colors.error.main}}> *</span>}\n </label>\n );\n};\n\nexport default InputLabel;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, SelectHTMLAttributes} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\nexport interface SelectOption {\n /**\n * The value that will be submitted with the form\n */\n value: string;\n /**\n * The text that will be displayed in the select\n */\n label: string;\n}\n\nexport interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'className'> {\n /**\n * Label text to display above the select\n */\n label?: string;\n /**\n * Error message to display below the select\n */\n error?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n /**\n * Helper text to display below the select\n */\n helperText?: string;\n /**\n * The options to display in the select\n */\n options: SelectOption[];\n}\n\nconst Select: FC<SelectProps> = ({\n label,\n error,\n className,\n required,\n disabled,\n helperText,\n options,\n style = {},\n ...rest\n}) => {\n const {theme} = useTheme();\n\n const selectStyle: CSSProperties = {\n width: '100%',\n padding: `${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 1.5)`,\n border: `1px solid ${error ? theme.vars.colors.error.main : theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.medium,\n fontSize: theme.vars.typography.fontSizes.md,\n color: theme.vars.colors.text.primary,\n backgroundColor: disabled ? theme.vars.colors.background.disabled : theme.vars.colors.background.surface,\n outline: 'none',\n transition: 'border-color 0.2s ease',\n appearance: 'none',\n backgroundImage: `url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23${theme.colors.text.secondary.replace(\n '#',\n '',\n )}%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E')`,\n backgroundRepeat: 'no-repeat',\n backgroundPosition: 'right .7em top 50%',\n backgroundSize: '.65em auto',\n };\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={clsx(withVendorCSSClassPrefix('select'), className)}\n style={style}\n >\n {label && (\n <InputLabel required={required} error={!!error}>\n {label}\n </InputLabel>\n )}\n <select style={selectStyle} disabled={disabled} aria-invalid={!!error} aria-required={required} {...rest}>\n {options.map(option => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n </FormControl>\n );\n};\n\nexport default Select;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, KeyboardEvent, ChangeEvent, useRef, useEffect, useState} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\nexport interface OtpInputProps {\n /**\n * Label text to display above the OTP input\n */\n label?: string;\n /**\n * Error message to display below the OTP input\n */\n error?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n /**\n * Helper text to display below the OTP input\n */\n helperText?: string;\n /**\n * Number of OTP input fields\n */\n length?: number;\n /**\n * Current OTP value\n */\n value?: string;\n /**\n * Callback function called when OTP value changes\n */\n onChange?: (event: {target: {value: string}}) => void;\n /**\n * Callback function called when OTP input is complete\n */\n onComplete?: (value: string) => void;\n /**\n * Type of input (text, number, password)\n */\n type?: 'text' | 'number' | 'password';\n /**\n * Placeholder character for each input field\n */\n placeholder?: string;\n /**\n * Custom container style\n */\n style?: CSSProperties;\n /**\n * Auto focus the first input on mount\n */\n autoFocus?: boolean;\n /**\n * Pattern for numeric input validation\n */\n pattern?: string;\n}\n\nconst OtpField: FC<OtpInputProps> = ({\n label,\n error,\n className,\n required,\n disabled,\n helperText,\n length = 6,\n value = '',\n onChange,\n onComplete,\n type = 'text',\n placeholder = '',\n style = {},\n autoFocus = false,\n pattern,\n}) => {\n const {theme} = useTheme();\n const [otp, setOtp] = useState<string[]>(Array(length).fill(''));\n const inputRefs = useRef<HTMLInputElement[]>([]);\n\n // Initialize refs array\n useEffect(() => {\n inputRefs.current = inputRefs.current.slice(0, length);\n }, [length]);\n\n // Update internal state when value prop changes\n useEffect(() => {\n if (value) {\n const newOtp = value.split('').slice(0, length);\n while (newOtp.length < length) {\n newOtp.push('');\n }\n setOtp(newOtp);\n } else {\n setOtp(Array(length).fill(''));\n }\n }, [value, length]);\n\n // Auto focus first input\n useEffect(() => {\n if (autoFocus && inputRefs.current[0]) {\n inputRefs.current[0].focus();\n }\n }, [autoFocus]);\n\n const inputContainerStyle: CSSProperties = {\n display: 'flex',\n gap: theme.vars.spacing.unit,\n justifyContent: 'space-between',\n alignItems: 'center',\n flexWrap: 'wrap',\n };\n\n const inputStyle: CSSProperties = {\n width: `calc(${theme.vars.spacing.unit} * 6)`,\n height: `calc(${theme.vars.spacing.unit} * 6)`,\n textAlign: 'center',\n fontSize: theme.vars.typography.fontSizes.xl,\n fontWeight: 500,\n border: `2px solid ${error ? theme.vars.colors.error.main : theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.medium,\n color: theme.vars.colors.text.primary,\n backgroundColor: disabled ? theme.vars.colors.background.disabled : theme.vars.colors.background.surface,\n outline: 'none',\n transition: 'border-color 0.2s ease, box-shadow 0.2s ease',\n };\n\n const focusedInputStyle: CSSProperties = {\n borderColor: error ? theme.vars.colors.error.main : theme.vars.colors.primary.main,\n boxShadow: `0 0 0 2px ${error ? theme.vars.colors.error.main + '20' : theme.vars.colors.primary.main + '20'}`,\n };\n\n const handleChange = (index: number, event: ChangeEvent<HTMLInputElement>) => {\n const newValue = event.target.value;\n\n // Only allow single character\n if (newValue.length > 1) return;\n\n // For numeric type, only allow numbers\n if (type === 'number' && newValue && !/^\\d$/.test(newValue)) return;\n\n // Apply pattern if provided\n if (pattern && newValue && !new RegExp(pattern).test(newValue)) return;\n\n const newOtp = [...otp];\n newOtp[index] = newValue;\n setOtp(newOtp);\n\n // Call onChange callback\n const otpValue = newOtp.join('');\n onChange?.({target: {value: otpValue}});\n\n // Auto-focus next input if value is entered\n if (newValue && index < length - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n\n // Call onComplete when all fields are filled\n if (newOtp.every(digit => digit !== '') && onComplete) {\n onComplete(otpValue);\n }\n };\n\n const handleKeyDown = (index: number, event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Backspace') {\n if (!otp[index] && index > 0) {\n // If current field is empty, clear previous field and focus it\n const newOtp = [...otp];\n newOtp[index - 1] = '';\n setOtp(newOtp);\n inputRefs.current[index - 1]?.focus();\n onChange?.({target: {value: newOtp.join('')}});\n } else if (otp[index]) {\n // Clear current field\n const newOtp = [...otp];\n newOtp[index] = '';\n setOtp(newOtp);\n onChange?.({target: {value: newOtp.join('')}});\n }\n } else if (event.key === 'ArrowLeft' && index > 0) {\n inputRefs.current[index - 1]?.focus();\n } else if (event.key === 'ArrowRight' && index < length - 1) {\n inputRefs.current[index + 1]?.focus();\n } else if (event.key === 'Enter') {\n event.preventDefault();\n if (otp.every(digit => digit !== '') && onComplete) {\n onComplete(otp.join(''));\n }\n }\n };\n\n const handlePaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\n event.preventDefault();\n const pastedData = event.clipboardData.getData('text').slice(0, length);\n\n // Validate pasted data\n let validData = '';\n for (const char of pastedData) {\n if (type === 'number' && !/^\\d$/.test(char)) continue;\n if (pattern && !new RegExp(pattern).test(char)) continue;\n validData += char;\n }\n\n const newOtp = Array(length).fill('');\n for (let i = 0; i < Math.min(validData.length, length); i++) {\n newOtp[i] = validData[i];\n }\n\n setOtp(newOtp);\n onChange?.({target: {value: newOtp.join('')}});\n\n // Focus next empty field or last field\n const nextEmptyIndex = newOtp.findIndex(digit => digit === '');\n const focusIndex = nextEmptyIndex !== -1 ? nextEmptyIndex : length - 1;\n inputRefs.current[focusIndex]?.focus();\n\n // Call onComplete if all fields are filled\n if (newOtp.every(digit => digit !== '') && onComplete) {\n onComplete(newOtp.join(''));\n }\n };\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={clsx(withVendorCSSClassPrefix('otp-input'), className)}\n style={style}\n helperTextAlign=\"center\"\n >\n {label && (\n <InputLabel required={required} error={!!error}>\n {label}\n </InputLabel>\n )}\n <div style={inputContainerStyle}>\n {Array.from({length}, (_, index) => (\n <input\n key={index}\n ref={el => {\n if (el) inputRefs.current[index] = el;\n }}\n type={type === 'password' ? 'password' : 'text'}\n inputMode={type === 'number' ? 'numeric' : 'text'}\n value={otp[index] || ''}\n onChange={event => handleChange(index, event)}\n onKeyDown={event => handleKeyDown(index, event)}\n onPaste={handlePaste}\n onFocus={event => {\n event.target.style.borderColor = error ? theme.vars.colors.error.main : theme.vars.colors.primary.main;\n event.target.style.boxShadow = `0 0 0 2px ${\n error ? theme.vars.colors.error.main + '20' : theme.vars.colors.primary.main + '20'\n }`;\n }}\n onBlur={event => {\n event.target.style.borderColor = error ? theme.vars.colors.error.main : theme.vars.colors.border;\n event.target.style.boxShadow = 'none';\n }}\n style={inputStyle}\n maxLength={1}\n placeholder={placeholder}\n disabled={disabled}\n aria-label={`${label || 'OTP'} digit ${index + 1}`}\n aria-invalid={!!error}\n aria-required={required}\n autoComplete=\"one-time-code\"\n />\n ))}\n </div>\n </FormControl>\n );\n};\n\nexport default OtpField;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, useState} from 'react';\nimport TextField, {TextFieldProps} from '../TextField/TextField';\nimport Eye from '../Icons/Eye';\nimport EyeOff from '../Icons/EyeOff';\n\nexport interface PasswordFieldProps extends Omit<TextFieldProps, 'type' | 'endIcon' | 'onEndIconClick' | 'onChange'> {\n /**\n * Callback function when the field value changes\n */\n onChange: (value: string) => void;\n}\n\n/**\n * Password field component with show/hide toggle functionality.\n * This component extends TextField and adds password visibility toggle functionality.\n */\nconst PasswordField: FC<PasswordFieldProps> = ({\n onChange,\n ...textFieldProps\n}) => {\n const [showPassword, setShowPassword] = useState(false);\n\n return (\n <TextField\n {...textFieldProps}\n type={showPassword ? 'text' : 'password'}\n onChange={e => onChange(e.target.value)}\n autoComplete=\"current-password\"\n endIcon={showPassword ? <EyeOff width={16} height={16} /> : <Eye width={16} height={16} />}\n onEndIconClick={() => setShowPassword(!showPassword)}\n />\n );\n};\n\nexport default PasswordField;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * Eye icon component.\n */\nconst Eye: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n);\n\nexport default Eye;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * EyeOff icon component.\n */\nconst EyeOff: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\" />\n <path d=\"M14.084 14.158a3 3 0 0 1-4.242-4.242\" />\n <path d=\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n);\n\nexport default EyeOff;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, InputHTMLAttributes} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\nexport interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'type'> {\n /**\n * Label text to display above the input\n */\n label?: string;\n /**\n * Error message to display below the input\n */\n error?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n /**\n * Helper text to display below the input\n */\n helperText?: string;\n /**\n * Custom date format for the regex pattern\n */\n dateFormat?: string;\n}\n\nconst DatePicker: FC<DatePickerProps> = ({\n label,\n error,\n className,\n required,\n disabled,\n helperText,\n dateFormat = 'yyyy-MM-dd',\n style = {},\n ...rest\n}) => {\n const {theme} = useTheme();\n\n const inputStyle: CSSProperties = {\n width: '100%',\n padding: `${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 1.5)`,\n border: `1px solid ${error ? theme.vars.colors.error.main : theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.medium,\n fontSize: '1rem',\n color: theme.vars.colors.text.primary,\n backgroundColor: disabled ? theme.vars.colors.background.disabled : theme.vars.colors.background.surface,\n outline: 'none',\n transition: 'border-color 0.2s ease',\n };\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={clsx(withVendorCSSClassPrefix('date-picker'), className)}\n style={style}\n >\n {label && (\n <InputLabel required={required} error={!!error}>\n {label}\n </InputLabel>\n )}\n <input\n type=\"date\"\n pattern=\"\\d{4}-\\d{2}-\\d{2}\"\n placeholder={dateFormat}\n style={inputStyle}\n disabled={disabled}\n aria-invalid={!!error}\n aria-required={required}\n {...rest}\n />\n </FormControl>\n );\n};\n\nexport default DatePicker;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, InputHTMLAttributes} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\nexport interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'type'> {\n /**\n * Label text to display next to the checkbox\n */\n label?: string;\n /**\n * Error message to display below the checkbox\n */\n error?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Helper text to display below the checkbox\n */\n helperText?: string;\n}\n\nconst Checkbox: FC<CheckboxProps> = ({label, error, className, required, helperText, style = {}, ...rest}) => {\n const {theme} = useTheme();\n\n const containerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n ...style,\n };\n\n const inputStyle: CSSProperties = {\n width: `calc(${theme.vars.spacing.unit} * 2.5)`,\n height: `calc(${theme.vars.spacing.unit} * 2.5)`,\n marginRight: theme.vars.spacing.unit,\n accentColor: theme.vars.colors.primary.main,\n };\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={clsx(withVendorCSSClassPrefix('checkbox'), className)}\n helperTextMarginLeft={`calc(${theme.vars.spacing.unit} * 3.5)`}\n >\n <div style={containerStyle}>\n <input type=\"checkbox\" style={inputStyle} aria-invalid={!!error} aria-required={required} {...rest} />\n {label && (\n <InputLabel\n required={required}\n error={!!error}\n variant=\"inline\"\n style={{\n color: error ? theme.vars.colors.error.main : theme.vars.colors.text.primary,\n fontSize: '0.875rem',\n }}\n >\n {label}\n </InputLabel>\n )}\n </div>\n </FormControl>\n );\n};\n\nexport default Checkbox;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, ReactElement} from 'react';\nimport TextField from '../primitives/TextField/TextField';\nimport Select from '../primitives/Select/Select';\nimport {SelectOption} from '../primitives/Select/Select';\nimport OtpField from '../primitives/OtpField/OtpField';\nimport PasswordField from '../primitives/PasswordField/PasswordField';\nimport DatePicker from '../primitives/DatePicker/DatePicker';\nimport Checkbox from '../primitives/Checkbox/Checkbox';\nimport {FieldType} from '@asgardeo/browser';\n\n/**\n * Interface for field configuration.\n */\nexport interface FieldConfig {\n /**\n * The name of the field.\n */\n name: string;\n /**\n * The field type.\n */\n type: FieldType;\n /**\n * Display name for the field.\n */\n label: string;\n /**\n * Whether the field is required.\n */\n required: boolean;\n /**\n * Current value of the field.\n */\n value: string;\n /**\n * Callback function when the field value changes.\n */\n onChange: (value: string) => void;\n /**\n * Whether the field is disabled.\n */\n disabled?: boolean;\n /**\n * Error message to display.\n */\n error?: string;\n /**\n * Additional CSS class name.\n */\n className?: string;\n /**\n * Additional options for multi-valued fields.\n */\n options?: SelectOption[];\n /**\n * Whether the field has been touched/interacted with by the user.\n */\n touched?: boolean;\n /**\n * Placeholder text for the field.\n */\n placeholder?: string;\n}\n\n/**\n * Utility function to validate field values based on type\n */\nexport const validateFieldValue = (\n value: string,\n type: FieldType,\n required: boolean = false,\n touched: boolean = false,\n): string | null => {\n if (required && touched && (!value || value.trim() === '')) {\n return 'This field is required';\n }\n\n if (!value || value.trim() === '') {\n return null;\n }\n\n switch (type) {\n case FieldType.Number:\n const numValue = parseInt(value, 10);\n if (isNaN(numValue)) {\n return 'Please enter a valid number';\n }\n break;\n }\n\n return null;\n};\n\n/**\n * Factory function to create form fields based on the EmbeddedSignInFlowAuthenticatorParamType.\n *\n * @param config - The field configuration\n * @returns The appropriate React component for the field type\n *\n * @example\n * ```tsx\n * const field = createField({\n * param: 'username',\n * type: EmbeddedSignInFlowAuthenticatorParamType.String,\n * label: 'Username',\n * confidential: false,\n * required: true,\n * value: '',\n * onChange: (value) => console.log(value)\n * });\n * ```\n */\nexport const createField = (config: FieldConfig): ReactElement => {\n const {\n name,\n type,\n label,\n required,\n value,\n onChange,\n disabled = false,\n error,\n className,\n options = [],\n touched = false,\n placeholder,\n } = config;\n\n const validationError = error || validateFieldValue(value, type, required, touched);\n\n const commonProps = {\n name,\n label,\n required,\n disabled,\n error: validationError,\n className,\n value,\n placeholder,\n };\n\n switch (type) {\n case FieldType.Password:\n return <PasswordField {...commonProps} onChange={onChange} />;\n case FieldType.Text:\n return <TextField {...commonProps} type=\"text\" onChange={e => onChange(e.target.value)} autoComplete=\"off\" />;\n case FieldType.Email:\n return <TextField {...commonProps} type=\"email\" onChange={e => onChange(e.target.value)} autoComplete=\"email\" />;\n case FieldType.Date:\n return <DatePicker {...commonProps} onChange={e => onChange(e.target.value)} />;\n case FieldType.Checkbox:\n const isChecked = value === 'true' || (value as any) === true;\n return <Checkbox {...commonProps} checked={isChecked} onChange={e => onChange(e.target.checked.toString())} />;\n case FieldType.Otp:\n return <OtpField {...commonProps} onChange={e => onChange(e.target.value)} />;\n case FieldType.Number:\n return (\n <TextField\n {...commonProps}\n type=\"number\"\n onChange={e => onChange(e.target.value)}\n helperText=\"Enter a numeric value\"\n />\n );\n case FieldType.Select:\n const fieldOptions = options.length > 0 ? options : [];\n\n if (fieldOptions.length > 0) {\n return (\n <Select\n {...commonProps}\n options={fieldOptions}\n onChange={e => onChange(e.target.value)}\n helperText=\"Select from available options\"\n />\n );\n }\n\n return (\n <TextField\n {...commonProps}\n type=\"text\"\n onChange={e => onChange(e.target.value)}\n helperText=\"Enter multiple values separated by commas (e.g., value1, value2, value3)\"\n placeholder=\"value1, value2, value3\"\n />\n );\n\n default:\n return (\n <TextField\n {...commonProps}\n type=\"text\"\n onChange={e => onChange(e.target.value)}\n helperText=\"Unknown field type, treating as text\"\n />\n );\n }\n};\n\n/**\n * React component wrapper for the field factory.\n */\nexport const FieldFactory: FC<FieldConfig> = (props: FieldConfig): ReactElement => {\n return createField(props);\n};\n\nexport default FieldFactory;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedSignInFlowAuthenticator, EmbeddedSignInFlowAuthenticatorParamType, FieldType} from '@asgardeo/browser';\nimport {FC, useEffect} from 'react';\nimport {createField} from '../../../factories/FieldFactory';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport useFlow from '../../../../contexts/Flow/useFlow';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * Identifier First Sign-In Option Component.\n * Handles identifier-first authentication flow (username first, then password).\n */\nconst IdentifierFirst: FC<BaseSignInOptionProps> = ({\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n onInputChange,\n onSubmit,\n inputClassName = '',\n buttonClassName = '',\n preferences,\n}) => {\n const {theme} = useTheme();\n const {t} = useTranslation(preferences?.i18n);\n const {setTitle, setSubtitle} = useFlow();\n\n const formFields = authenticator.metadata?.params?.sort((a, b) => a.order - b.order) || [];\n\n useEffect(() => {\n setTitle(t('identifier.first.title'));\n setSubtitle(t('identifier.first.subtitle'));\n }, [setTitle, setSubtitle, t]);\n\n return (\n <>\n {formFields.map(param => (\n <div key={param.param} style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {createField({\n name: param.param,\n type:\n param.type === EmbeddedSignInFlowAuthenticatorParamType.String\n ? param.confidential\n ? FieldType.Password\n : FieldType.Text\n : FieldType.Text,\n label: param.displayName,\n required: authenticator.requiredParams.includes(param.param),\n value: formValues[param.param] || '',\n onChange: value => onInputChange(param.param, value),\n disabled: isLoading,\n className: inputClassName,\n touched: touchedFields[param.param] || false,\n placeholder: t(`elements.fields.placeholder`, {\n field: (param.displayName || param.param).toLowerCase(),\n }),\n })}\n </div>\n ))}\n\n <Button\n type=\"submit\"\n disabled={isLoading}\n loading={isLoading}\n className={buttonClassName}\n color=\"primary\"\n variant=\"solid\"\n fullWidth\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n {t('identifier.first.submit.button')}\n </Button>\n </>\n );\n};\n\nexport default IdentifierFirst;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport Button from '../../../primitives/Button/Button';\n\n/**\n * Google Sign-In Button Component.\n * Handles authentication with Google identity provider.\n */\nconst GoogleButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"solid\"\n color=\"secondary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 67.91 67.901\" xmlns=\"http://www.w3.org/2000/svg\">\n <g transform=\"translate(-0.001 -0.001)\">\n <path\n d=\"M15.049,160.965l-2.364,8.824-8.639.183a34.011,34.011,0,0,1-.25-31.7h0l7.691,1.41,3.369,7.645a20.262,20.262,0,0,0,.19,13.642Z\"\n transform=\"translate(0 -119.93)\"\n fill=\"#fbbb00\"\n />\n <path\n d=\"M294.24,208.176A33.939,33.939,0,0,1,282.137,241h0l-9.687-.494-1.371-8.559a20.235,20.235,0,0,0,8.706-10.333H261.628V208.176Z\"\n transform=\"translate(-226.93 -180.567)\"\n fill=\"#518ef8\"\n />\n <path\n d=\"M81.668,328.8h0a33.962,33.962,0,0,1-51.161-10.387l11-9.006a20.192,20.192,0,0,0,29.1,10.338Z\"\n transform=\"translate(-26.463 -268.374)\"\n fill=\"#28b446\"\n />\n <path\n d=\"M80.451,7.816l-11,9A20.19,20.19,0,0,0,39.686,27.393l-11.06-9.055h0A33.959,33.959,0,0,1,80.451,7.816Z\"\n transform=\"translate(-24.828)\"\n fill=\"#f14336\"\n />\n </g>\n </svg>\n }\n >\n {t('elements.buttons.google')}\n </Button>\n );\n};\n\nexport default GoogleButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\n\n/**\n * GitHub Sign-In Button Component.\n * Handles authentication with GitHub identity provider.\n */\nconst GitHubButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"solid\"\n color=\"secondary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 67.91 66.233\" xmlns=\"http://www.w3.org/2000/svg\">\n <g transform=\"translate(-386.96 658.072)\">\n <path\n d=\"M420.915-658.072a33.956,33.956,0,0,0-33.955,33.955,33.963,33.963,0,0,0,23.221,32.22c1.7.314,2.32-.737,2.32-1.633,0-.81-.031-3.484-.046-6.322-9.446,2.054-11.44-4.006-11.44-4.006-1.545-3.925-3.77-4.968-3.77-4.968-3.081-2.107.232-2.064.232-2.064,3.41.239,5.205,3.5,5.205,3.5,3.028,5.19,7.943,3.69,9.881,2.822a7.23,7.23,0,0,1,2.156-4.54c-7.542-.859-15.47-3.77-15.47-16.781a13.141,13.141,0,0,1,3.5-9.114,12.2,12.2,0,0,1,.329-8.986s2.851-.913,9.34,3.48a32.545,32.545,0,0,1,8.5-1.143,32.629,32.629,0,0,1,8.506,1.143c6.481-4.393,9.328-3.48,9.328-3.48a12.185,12.185,0,0,1,.333,8.986,13.115,13.115,0,0,1,3.495,9.114c0,13.042-7.943,15.913-15.5,16.754,1.218,1.054,2.3,3.12,2.3,6.288,0,4.543-.039,8.2-.039,9.318,0,.9.611,1.962,2.332,1.629a33.959,33.959,0,0,0,23.2-32.215,33.955,33.955,0,0,0-33.955-33.955\"\n fill=\"#ffffff\"\n />\n </g>\n </svg>\n }\n >\n {t('elements.buttons.github')}\n </Button>\n );\n};\n\nexport default GitHubButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\n\n/**\n * Microsoft Sign-In Button Component.\n * Handles authentication with Microsoft identity provider.\n */\nconst MicrosoftButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n color=\"primary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 23 23\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill=\"#f3f3f3\" d=\"M0 0h23v23H0z\" />\n <path fill=\"#f35325\" d=\"M1 1h10v10H1z\" />\n <path fill=\"#81bc06\" d=\"M12 1h10v10H12z\" />\n <path fill=\"#05a6f0\" d=\"M1 12h10v10H1z\" />\n <path fill=\"#ffba08\" d=\"M12 12h10v10H12z\" />\n </svg>\n }\n >\n {t('elements.buttons.microsoft')}\n </Button>\n );\n};\n\nexport default MicrosoftButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\n\n/**\n * Facebook Sign-In Button Component.\n * Handles authentication with Facebook identity provider.\n */\nconst FacebookButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n submitButtonText,\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"solid\"\n color=\"primary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"#1976D2\"\n d=\"M448,0H64C28.704,0,0,28.704,0,64v384c0,35.296,28.704,64,64,64h384c35.296,0,64-28.704,64-64V64C512,28.704,483.296,0,448,0z\"\n />\n <path\n fill=\"#FAFAFA\"\n d=\"M432,256h-80v-64c0-17.664,14.336-16,32-16h32V96h-64l0,0c-53.024,0-96,42.976-96,96v64h-64v80h64v176h96V336h48L432,256z\"\n />\n </svg>\n }\n >\n {t('elements.buttons.facebook')}\n </Button>\n );\n};\n\nexport default FacebookButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\n\n/**\n * LinkedIn Sign-In Button Component.\n * Handles authentication with LinkedIn identity provider.\n */\nconst LinkedInButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n color=\"primary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"#0077B5\"\n d=\"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z\"\n />\n </svg>\n }\n >\n {t('elements.buttons.linkedin')}\n </Button>\n );\n};\n\nexport default LinkedInButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\n\n/**\n * Sign In With Ethereum Button Component.\n * Handles authentication with Sign In With Ethereum identity provider.\n */\nconst SignInWithEthereumButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n color=\"secondary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"#627EEA\"\n d=\"M11.944 17.97L4.58 13.62 11.943 24l7.37-10.38-7.372 4.35h.003zM12.056 0L4.69 12.223l7.365 4.354 7.365-4.35L12.056 0z\"\n />\n </svg>\n }\n >\n {t('elements.buttons.ethereum')}\n </Button>\n );\n};\n\nexport default SignInWithEthereumButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedSignInFlowAuthenticator, EmbeddedSignInFlowAuthenticatorParamType, FieldType} from '@asgardeo/browser';\nimport {FC, useEffect} from 'react';\nimport {createField} from '../../../factories/FieldFactory';\nimport Button from '../../../primitives/Button/Button';\nimport OtpField from '../../../primitives/OtpField/OtpField';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport useFlow from '../../../../contexts/Flow/useFlow';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * Email OTP Sign-In Option Component.\n * Handles email-based OTP authentication.\n */\nconst EmailOtp: FC<BaseSignInOptionProps> = ({\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n onInputChange,\n onSubmit,\n inputClassName = '',\n buttonClassName = '',\n preferences,\n}) => {\n const {theme} = useTheme();\n const {t} = useTranslation(preferences?.i18n);\n const {setTitle, setSubtitle} = useFlow();\n\n const formFields = authenticator.metadata?.params?.sort((a, b) => a.order - b.order) || [];\n\n useEffect(() => {\n setTitle(t('email.otp.title'));\n setSubtitle(t('email.otp.subtitle'));\n }, [setTitle, setSubtitle, t]);\n\n // Check if this is an OTP field (typically has 'otpCode' or similar parameter)\n const hasOtpField = formFields.some(\n param => param.param.toLowerCase().includes('otp') || param.param.toLowerCase().includes('code'),\n );\n\n return (\n <>\n {formFields.map(param => {\n const isOtpParam = param.param.toLowerCase().includes('otp') || param.param.toLowerCase().includes('code');\n\n return (\n <div key={param.param} style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {isOtpParam && hasOtpField ? (\n <OtpField\n length={6}\n value={formValues[param.param] || ''}\n onChange={event => onInputChange(param.param, event.target.value)}\n disabled={isLoading}\n className={inputClassName}\n />\n ) : (\n createField({\n name: param.param,\n type:\n param.type === EmbeddedSignInFlowAuthenticatorParamType.String\n ? param.confidential\n ? FieldType.Password\n : FieldType.Text\n : FieldType.Text,\n label: param.displayName,\n required: authenticator.requiredParams.includes(param.param),\n value: formValues[param.param] || '',\n onChange: value => onInputChange(param.param, value),\n disabled: isLoading,\n className: inputClassName,\n touched: touchedFields[param.param] || false,\n })\n )}\n </div>\n );\n })}\n\n <Button\n type=\"submit\"\n disabled={isLoading}\n loading={isLoading}\n className={buttonClassName}\n color=\"primary\"\n variant=\"solid\"\n fullWidth\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n {t('email.otp.submit.button')}\n </Button>\n </>\n );\n};\n\nexport default EmailOtp;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedSignInFlowAuthenticator, EmbeddedSignInFlowAuthenticatorParamType, FieldType} from '@asgardeo/browser';\nimport {FC, useEffect} from 'react';\nimport {createField} from '../../../factories/FieldFactory';\nimport Button from '../../../primitives/Button/Button';\nimport OtpField from '../../../primitives/OtpField/OtpField';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport useFlow from '../../../../contexts/Flow/useFlow';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * TOTP Sign-In Option Component.\n * Handles Time-based One-Time Password (TOTP) authentication.\n */\nconst Totp: FC<BaseSignInOptionProps> = ({\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n onInputChange,\n onSubmit,\n inputClassName = '',\n buttonClassName = '',\n preferences,\n}) => {\n const {theme} = useTheme();\n const {t} = useTranslation(preferences?.i18n);\n const {setTitle, setSubtitle} = useFlow();\n\n const formFields = authenticator.metadata?.params?.sort((a, b) => a.order - b.order) || [];\n\n useEffect(() => {\n setTitle(t('totp.title'));\n setSubtitle(t('totp.subtitle'));\n }, [setTitle, setSubtitle, t]);\n\n const hasTotpField = formFields.some(\n param => param.param.toLowerCase().includes('totp') || param.param.toLowerCase().includes('token'),\n );\n\n return (\n <>\n {formFields.map(param => {\n const isTotpParam = param.param.toLowerCase().includes('totp') || param.param.toLowerCase().includes('token');\n\n return (\n <div key={param.param} style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {isTotpParam && hasTotpField ? (\n <OtpField\n length={6}\n value={formValues[param.param] || ''}\n onChange={event => onInputChange(param.param, event.target.value)}\n disabled={isLoading}\n className={inputClassName}\n />\n ) : (\n createField({\n name: param.param,\n type:\n param.type === EmbeddedSignInFlowAuthenticatorParamType.String\n ? param.confidential\n ? FieldType.Password\n : FieldType.Text\n : FieldType.Text,\n label: param.displayName,\n required: authenticator.requiredParams.includes(param.param),\n value: formValues[param.param] || '',\n onChange: value => onInputChange(param.param, value),\n disabled: isLoading,\n className: inputClassName,\n touched: touchedFields[param.param] || false,\n })\n )}\n </div>\n );\n })}\n\n <Button\n type=\"submit\"\n disabled={isLoading}\n loading={isLoading}\n className={buttonClassName}\n color=\"primary\"\n variant=\"solid\"\n fullWidth\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n {t('totp.submit.button')}\n </Button>\n </>\n );\n};\n\nexport default Totp;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedSignInFlowAuthenticator, EmbeddedSignInFlowAuthenticatorParamType, FieldType} from '@asgardeo/browser';\nimport {FC, useEffect} from 'react';\nimport {createField} from '../../../factories/FieldFactory';\nimport Button from '../../../primitives/Button/Button';\nimport OtpField from '../../../primitives/OtpField/OtpField';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport useFlow from '../../../../contexts/Flow/useFlow';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * SMS OTP Sign-In Option Component.\n * Handles SMS-based OTP authentication.\n */\nconst SmsOtp: FC<BaseSignInOptionProps> = ({\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n onInputChange,\n onSubmit,\n inputClassName = '',\n buttonClassName = '',\n preferences,\n}) => {\n const {theme} = useTheme();\n const {t} = useTranslation(preferences?.i18n);\n const {setTitle, setSubtitle} = useFlow();\n\n const formFields = authenticator.metadata?.params?.sort((a, b) => a.order - b.order) || [];\n\n useEffect(() => {\n setTitle(t('sms.otp.title'));\n setSubtitle(t('sms.otp.subtitle'));\n }, [setTitle, setSubtitle, t]);\n\n const hasOtpField = formFields.some(\n param => param.param.toLowerCase().includes('otp') || param.param.toLowerCase().includes('code'),\n );\n\n return (\n <>\n {formFields.map(param => {\n const isOtpParam = param.param.toLowerCase().includes('otp') || param.param.toLowerCase().includes('code');\n\n return (\n <div key={param.param} style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {isOtpParam && hasOtpField ? (\n <OtpField\n length={6}\n value={formValues[param.param] || ''}\n onChange={event => onInputChange(param.param, event.target.value)}\n disabled={isLoading}\n className={inputClassName}\n />\n ) : (\n createField({\n name: param.param,\n type:\n param.type === EmbeddedSignInFlowAuthenticatorParamType.String\n ? param.confidential\n ? FieldType.Password\n : FieldType.Text\n : FieldType.Text,\n label: param.displayName,\n required: authenticator.requiredParams.includes(param.param),\n value: formValues[param.param] || '',\n onChange: value => onInputChange(param.param, value),\n disabled: isLoading,\n className: inputClassName,\n touched: touchedFields[param.param] || false,\n })\n )}\n </div>\n );\n })}\n\n <Button\n type=\"submit\"\n disabled={isLoading}\n loading={isLoading}\n className={buttonClassName}\n color=\"primary\"\n variant=\"solid\"\n fullWidth\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n {t('sms.otp.submit.button')}\n </Button>\n </>\n );\n};\n\nexport default SmsOtp;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\n\n/**\n * Social Login Sign-In Option Component.\n * Handles authentication with external identity providers (Google, GitHub, etc.).\n */\nconst SocialLogin: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n\n /**\n * Get display name for the social provider.\n */\n const getDisplayName = (): string => {\n const providerName = authenticator.idp;\n return t('elements.buttons.social', {connection: providerName});\n };\n\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n color=\"secondary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"\n />\n </svg>\n }\n >\n {getDisplayName()}\n </Button>\n );\n};\n\nexport default SocialLogin;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, JSX, ReactElement} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport {ApplicationNativeAuthenticationConstants, EmbeddedSignInFlowAuthenticatorKnownIdPType} from '@asgardeo/browser';\nimport useTranslation from '../../../../hooks/useTranslation';\n\n/**\n * Multi Option Button Component.\n * Renders authenticators as selectable buttons for multi-option prompts.\n * Used when authenticators don't require immediate user input but need to be selected first.\n */\nconst MultiOptionButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n\n /**\n * Get display name for the authenticator.\n */\n const getDisplayName = (): string => {\n let authenticatorName = authenticator.authenticator;\n\n if (authenticator.idp !== EmbeddedSignInFlowAuthenticatorKnownIdPType.Local) {\n authenticatorName = authenticator.idp;\n }\n\n switch (authenticatorName) {\n default:\n return t('elements.buttons.multi.option', {connection: authenticatorName});\n }\n };\n\n /**\n * Get appropriate icon for the authenticator type.\n */\n const getIcon = (): ReactElement | null => {\n const authenticatorId: string = authenticator.authenticatorId;\n\n switch (authenticatorId) {\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.SmsOtp:\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M20 15.5c-1.25 0-2.45-.2-3.57-.57a1.02 1.02 0 0 0-1.02.24l-2.2 2.2a15.074 15.074 0 0 1-6.59-6.59l2.2-2.2c.27-.27.35-.67.24-1.02A11.36 11.36 0 0 1 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.5c0-.55-.45-1-1-1M12 3v10l3-3h6V3z\"\n />\n </svg>\n );\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.EmailOtp:\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4l-8 5l-8-5V6l8 5l8-5z\"\n />\n </svg>\n );\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Totp:\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill=\"currentColor\" d=\"M12 1L3 5v6c0 5.55 3.84 10.74 9 12c5.16-1.26 9-6.45 9-12V5z\" />\n </svg>\n );\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.PushNotification:\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8m1-13h-2v6h2zm0 8h-2v2h2z\"\n />\n </svg>\n );\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Passkey:\n return (\n <svg fill=\"currentColor\" width=\"18\" height=\"18\" viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"SVGRepo_bgCarrier\" strokeWidth=\"0\"></g>\n <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g id=\"SVGRepo_iconCarrier\">\n <path d=\"M7.7 4.7C9.36 3.07 12.68 2 16.17 2S23 3.06 24.6 4.7A1 1 0 0 0 26 3.3C23.6.86 19.34 0 16.16 0S8.72.87 6.3 3.3a1 1 0 0 0 1.4 1.4zM29.2 12.55C26.38 6.88 22 4 16.17 4s-10.22 2.88-13 8.55a1 1 0 0 0 .44 1.34 1 1 0 0 0 1.35-.45C7.4 8.45 11.08 6 16.15 6s8.77 2.44 11.27 7.45a1 1 0 0 0 .9.55.87.87 0 0 0 .44-.1 1 1 0 0 0 .45-1.35zM19.4 28.08c-4.13-1.77-5.8-4.5-6-6.5a2.87 2.87 0 0 1 1.13-2.75c.85-.57 2.1.24 3.87 1.52s4.13 3 6.17 1.45c1.8-1.35 2.34-3.76 1.45-6.44A10.85 10.85 0 0 0 16.16 8C7.2 8 4 15.75 4 23a1 1 0 0 0 2 0c0-3 .73-13 10.16-13 3.9 0 7 3.1 8 6 .3.87.8 3-.75 4.2-.8.6-2-.2-3.8-1.47s-4.07-2.94-6.14-1.56a4.87 4.87 0 0 0-2 4.6c.24 2.56 2.24 6 7.18 8.15A1 1 0 0 0 19 30a1 1 0 0 0 .4-1.92zM10 19.24a7.06 7.06 0 0 1 5.2-4.65c2.24-.43 4.32.6 6 3a1 1 0 1 0 1.62-1.17c-2.9-4.07-6.27-4.12-8-3.8A9.1 9.1 0 0 0 8 18.77c-1 3.94.43 8.27 4.2 12.87a1 1 0 0 0 .8.37.94.94 0 0 0 .63-.23 1 1 0 0 0 .14-1.4c-3.34-4.1-4.62-7.83-3.77-11.13zM25.3 24.3a3 3 0 0 1-3.06.63c-2.4-.57-4.78-2.7-5.3-4.25a1 1 0 1 0-1.9.64c.8 2.33 3.87 4.88 6.74 5.56a6.84 6.84 0 0 0 1.52.18 4.7 4.7 0 0 0 3.4-1.35 1 1 0 0 0-1.4-1.4z\"></path>{' '}\n </g>\n </svg>\n );\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.MagicLink:\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8m1-13h-2v6h2zm0 8h-2v2h2z\"\n />\n </svg>\n );\n default:\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m-2 15l-5-5l1.41-1.41L10 14.17l7.59-7.59L19 8z\"\n />\n </svg>\n );\n }\n };\n\n /**\n * Handle button click.\n */\n const handleClick = () => {\n // For multi-option buttons, we call onSubmit without form data\n // This will trigger the authenticator selection and likely move to the next step\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n color=\"primary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={getIcon()}\n >\n {getDisplayName()}\n </Button>\n );\n};\n\nexport default MultiOptionButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n CSSProperties,\n forwardRef,\n HTMLAttributes,\n ReactNode,\n RefAttributes,\n ForwardRefExoticComponent,\n useMemo,\n} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport Typography from '../Typography/Typography';\nimport CircleCheck from '../Icons/CircleCheck';\nimport CircleAlert from '../Icons/CircleAlert';\nimport TriangleAlert from '../Icons/TriangleAlert';\nimport Info from '../Icons/Info';\n\nexport type AlertVariant = 'success' | 'error' | 'warning' | 'info';\n\nexport interface AlertProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The visual variant of the alert that determines color scheme and icon\n */\n variant?: AlertVariant;\n /**\n * Whether to show the default icon for the variant\n */\n showIcon?: boolean;\n /**\n * Alert content\n */\n children?: ReactNode;\n}\n\nexport interface AlertTitleProps extends HTMLAttributes<HTMLHeadingElement> {\n /**\n * Title content\n */\n children?: ReactNode;\n}\n\nexport interface AlertDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {\n /**\n * Description content\n */\n children?: ReactNode;\n}\n\nconst useAlertStyles = (variant: AlertVariant) => {\n const {theme} = useTheme();\n\n return useMemo(() => {\n const variantStyles: Record<AlertVariant, CSSProperties> = {\n success: {\n backgroundColor: `${theme.vars.colors.success.main}15`,\n borderColor: theme.vars.colors.success.main,\n color: theme.vars.colors.success.main,\n },\n error: {\n backgroundColor: `${theme.vars.colors.error.main}15`,\n borderColor: theme.vars.colors.error.main,\n color: theme.vars.colors.error.main,\n },\n warning: {\n backgroundColor: `${theme.vars.colors.warning.main}15`,\n borderColor: theme.vars.colors.warning.main,\n color: theme.vars.colors.warning.main,\n },\n info: {\n backgroundColor: `${theme.vars.colors.primary.main}15`,\n borderColor: theme.vars.colors.primary.main,\n color: theme.vars.colors.primary.main,\n },\n };\n\n return {\n padding: `calc(${theme.vars.spacing.unit} * 2)`,\n borderRadius: theme.vars.borderRadius.medium,\n border: '1px solid',\n display: 'flex',\n gap: `calc(${theme.vars.spacing.unit} * 1.5)`,\n alignItems: 'flex-start',\n ...variantStyles[variant],\n };\n }, [theme, variant]);\n};\n\nconst useAlertIconStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n flexShrink: 0,\n marginTop: `calc(${theme.vars.spacing.unit} * 0.25)`, // Slight alignment adjustment\n width: `calc(${theme.vars.spacing.unit} * 2.5)`,\n height: `calc(${theme.vars.spacing.unit} * 2.5)`,\n }),\n [theme],\n );\n};\n\nconst useAlertContentStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n gap: theme.vars.spacing.unit,\n }),\n [theme],\n );\n};\n\nconst useAlertTitleStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n margin: 0,\n fontSize: theme.vars.typography.fontSizes.sm,\n fontWeight: 600,\n lineHeight: 1.4,\n color: 'inherit',\n }),\n [theme],\n );\n};\n\nconst useAlertDescriptionStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n margin: 0,\n fontSize: theme.vars.typography.fontSizes.sm,\n lineHeight: 1.4,\n color: theme.vars.colors.text.secondary,\n }),\n [theme],\n );\n};\n\nconst getDefaultIcon = (variant: AlertVariant) => {\n switch (variant) {\n case 'success':\n return CircleCheck;\n case 'error':\n return CircleAlert;\n case 'warning':\n return TriangleAlert;\n case 'info':\n return Info;\n default:\n return Info;\n }\n};\n\n/**\n * Alert component that displays important information with different severity levels.\n *\n * @example\n * ```tsx\n * <Alert variant=\"success\" showIcon>\n * <Alert.Title>Success! Your changes have been saved</Alert.Title>\n * <Alert.Description>\n * This is an alert with icon, title and description.\n * </Alert.Description>\n * </Alert>\n * ```\n */\nconst Alert = forwardRef<HTMLDivElement, AlertProps>(\n ({variant = 'info', showIcon = true, children, className, style, ...rest}, ref) => {\n const alertStyle = useAlertStyles(variant);\n const iconStyle = useAlertIconStyles();\n const contentStyle = useAlertContentStyles();\n const IconComponent = getDefaultIcon(variant);\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n style={{...alertStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('alert'), withVendorCSSClassPrefix(`alert-${variant}`), className)}\n {...rest}\n >\n {showIcon && (\n <div style={iconStyle} className={withVendorCSSClassPrefix('alert-icon')}>\n <IconComponent />\n </div>\n )}\n <div style={contentStyle} className={withVendorCSSClassPrefix('alert-content')}>\n {children}\n </div>\n </div>\n );\n },\n);\n\n/**\n * Alert title component.\n */\nconst AlertTitle = forwardRef<HTMLHeadingElement, AlertTitleProps>(({children, className, style, ...rest}, ref) => {\n const titleStyle = useAlertTitleStyles();\n\n // Filter out conflicting props that shouldn't be passed to Typography\n const {color, ...filteredRest} = rest;\n\n return (\n <Typography\n component=\"h3\"\n variant=\"h6\"\n fontWeight={600}\n style={{...titleStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('alert-title'), className)}\n {...filteredRest}\n >\n {children}\n </Typography>\n );\n});\n\n/**\n * Alert description component.\n */\nconst AlertDescription = forwardRef<HTMLParagraphElement, AlertDescriptionProps>(\n ({children, className, style, ...rest}, ref) => {\n const descriptionStyle = useAlertDescriptionStyles();\n\n // Filter out conflicting props that shouldn't be passed to Typography\n const {color, ...filteredRest} = rest;\n\n return (\n <Typography\n component=\"p\"\n variant=\"body2\"\n style={{...descriptionStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('alert-description'), className)}\n {...filteredRest}\n >\n {children}\n </Typography>\n );\n },\n);\n\nAlert.displayName = 'Alert';\nAlertTitle.displayName = 'Alert.Title';\nAlertDescription.displayName = 'Alert.Description';\n\n// Attach subcomponents to Alert for dot notation usage\n(Alert as any).Title = AlertTitle;\n(Alert as any).Description = AlertDescription;\n\n// TypeScript interface augmentation for dot notation\nexport interface AlertComponent extends ForwardRefExoticComponent<AlertProps & RefAttributes<HTMLDivElement>> {\n Title: typeof AlertTitle;\n Description: typeof AlertDescription;\n}\n\nexport default Alert as AlertComponent;\nexport {Alert, AlertTitle, AlertDescription};\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * CircleCheck icon component.\n */\nconst CircleCheck: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n);\n\nexport default CircleCheck;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * CircleAlert icon component.\n */\nconst CircleAlert: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />\n </svg>\n);\n\nexport default CircleAlert;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * TriangleAlert icon component.\n */\nconst TriangleAlert: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n);\n\nexport default TriangleAlert;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * Info icon component.\n */\nconst Info: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n);\n\nexport default Info;\n", "/**\n * Copyright (c) {{year}}, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n forwardRef,\n useMemo,\n ReactNode,\n ForwardRefExoticComponent,\n RefAttributes,\n} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Typography from '../Typography/Typography';\n\nexport type CardVariant = 'default' | 'outlined' | 'elevated';\n\nexport interface CardProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Card content\n */\n children?: ReactNode;\n /**\n * Whether the card should be clickable (shows hover effects)\n */\n clickable?: boolean;\n /**\n * The visual variant of the card\n */\n variant?: CardVariant;\n}\n\nexport interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Header content\n */\n children?: ReactNode;\n}\n\nexport interface CardTitleProps extends HTMLAttributes<HTMLHeadingElement> {\n /**\n * Title content\n */\n children?: ReactNode;\n /**\n * The heading level to use\n */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n}\n\nexport interface CardDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {\n /**\n * Description content\n */\n children?: ReactNode;\n}\n\nexport interface CardActionProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Action content\n */\n children?: ReactNode;\n}\n\nexport interface CardContentProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Content\n */\n children?: ReactNode;\n}\n\nexport interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Footer content\n */\n children?: ReactNode;\n}\n\nconst useCardStyles = (variant: CardVariant, clickable: boolean) => {\n const {theme} = useTheme();\n\n return useMemo(() => {\n const baseStyles: CSSProperties = {\n borderRadius: theme.borderRadius.medium,\n backgroundColor: theme.colors.background.surface,\n transition: 'all 0.2s ease-in-out',\n position: 'relative',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'hidden',\n padding: `${theme.spacing.unit * 2}px ${theme.spacing.unit * 2}px`,\n };\n\n const variantStyles: Record<CardVariant, CSSProperties> = {\n default: {\n ...baseStyles,\n },\n outlined: {\n ...baseStyles,\n border: `1px solid ${theme.colors.border}`,\n },\n elevated: {\n ...baseStyles,\n boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',\n border: 'none',\n },\n };\n\n const clickableStyles: CSSProperties = clickable\n ? {\n cursor: 'pointer',\n }\n : {};\n\n return {\n ...variantStyles[variant],\n ...clickableStyles,\n };\n }, [theme, variant, clickable]);\n};\n\nconst useCardHeaderStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n padding: `${theme.spacing.unit * 2}px ${theme.spacing.unit * 2}px 0`,\n display: 'flex',\n flexDirection: 'column',\n gap: `${theme.spacing.unit}px`,\n }),\n [theme],\n );\n};\n\nconst useCardTitleStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n margin: 0,\n // Typography component will handle color, fontSize, fontWeight, lineHeight\n }),\n [theme],\n );\n};\n\nconst useCardDescriptionStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n margin: 0,\n color: theme.colors.text.secondary,\n fontSize: '0.875rem',\n lineHeight: 1.5,\n }),\n [theme],\n );\n};\n\nconst useCardActionStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n marginTop: `${theme.spacing.unit}px`,\n }),\n [theme],\n );\n};\n\nconst useCardContentStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n padding: `${theme.spacing.unit * 2}px`,\n flex: 1,\n }),\n [theme],\n );\n};\n\nconst useCardFooterStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n padding: `0 ${theme.spacing.unit * 2}px ${theme.spacing.unit * 2}px`,\n display: 'flex',\n alignItems: 'center',\n gap: `${theme.spacing.unit}px`,\n }),\n [theme],\n );\n};\n\n/**\n * Card component that provides a flexible container for content.\n *\n * @example\n * ```tsx\n * <Card variant=\"elevated\" clickable>\n * <Card.Header>\n * <Card.Title>Card Title</Card.Title>\n * <Card.Description>Card Description</Card.Description>\n * <Card.Action>\n * <Button variant=\"link\">Action</Button>\n * </Card.Action>\n * </Card.Header>\n * <Card.Content>\n * <p>Card content goes here</p>\n * </Card.Content>\n * <Card.Footer>\n * <Button>Cancel</Button>\n * <Button variant=\"outline\">Submit</Button>\n * </Card.Footer>\n * </Card>\n * ```\n */\nconst Card = forwardRef<HTMLDivElement, CardProps>(\n ({variant = 'default', clickable = false, children, className, style, ...rest}, ref) => {\n const cardStyle = useCardStyles(variant, clickable);\n\n return (\n <div\n ref={ref}\n style={{...cardStyle, ...style}}\n className={clsx(\n withVendorCSSClassPrefix('card'),\n withVendorCSSClassPrefix(`card-${variant}`),\n {\n [withVendorCSSClassPrefix('card-clickable')]: clickable,\n },\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n\n/**\n * Card header component that contains the title, description, and optional actions.\n */\nconst CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(({children, className, style, ...rest}, ref) => {\n const headerStyle = useCardHeaderStyles();\n\n return (\n <div\n ref={ref}\n style={{...headerStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('card-header'), className)}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\n/**\n * Card title component.\n */\nconst CardTitle = forwardRef<HTMLHeadingElement, CardTitleProps>(\n ({children, level = 3, className, style, ...rest}, ref) => {\n const titleStyle = useCardTitleStyles();\n\n // Map level to Typography variant\n const getVariantFromLevel = (level: number) => {\n switch (level) {\n case 1:\n return 'h1';\n case 2:\n return 'h2';\n case 3:\n return 'h3';\n case 4:\n return 'h4';\n case 5:\n return 'h5';\n case 6:\n return 'h6';\n default:\n return 'h3';\n }\n };\n\n // Map level to HTML element for ref forwarding\n const getComponentFromLevel = (level: number) => {\n switch (level) {\n case 1:\n return 'h1';\n case 2:\n return 'h2';\n case 3:\n return 'h3';\n case 4:\n return 'h4';\n case 5:\n return 'h5';\n case 6:\n return 'h6';\n default:\n return 'h3';\n }\n };\n\n // Filter out conflicting props that shouldn't be passed to Typography\n const {color, ...filteredRest} = rest;\n\n return (\n <Typography\n component={getComponentFromLevel(level)}\n variant={getVariantFromLevel(level)}\n style={{...titleStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('card-title'), className)}\n fontWeight={600}\n {...filteredRest}\n // We can't forward ref to Typography since it doesn't use forwardRef\n // The ref will be handled by the Typography component's underlying element\n >\n {children}\n </Typography>\n );\n },\n);\n\n/**\n * Card description component.\n */\nconst CardDescription = forwardRef<HTMLParagraphElement, CardDescriptionProps>(\n ({children, className, style, ...rest}, ref) => {\n const descriptionStyle = useCardDescriptionStyles();\n\n // Filter out conflicting props that shouldn't be passed to Typography\n const {color, ...filteredRest} = rest;\n\n return (\n <Typography\n component=\"p\"\n variant=\"body2\"\n color=\"textSecondary\"\n style={{...descriptionStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('card-description'), className)}\n {...filteredRest}\n >\n {children}\n </Typography>\n );\n },\n);\n\n/**\n * Card action component for action elements in the header.\n */\nconst CardAction = forwardRef<HTMLDivElement, CardActionProps>(({children, className, style, ...rest}, ref) => {\n const actionStyle = useCardActionStyles();\n\n return (\n <div\n ref={ref}\n style={{...actionStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('card-action'), className)}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\n/**\n * Card content component that contains the main content of the card.\n */\nconst CardContent = forwardRef<HTMLDivElement, CardContentProps>(({children, className, style, ...rest}, ref) => {\n const contentStyle = useCardContentStyles();\n\n return (\n <div\n ref={ref}\n style={{...contentStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('card-content'), className)}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\n/**\n * Card footer component that contains footer actions or additional information.\n */\nconst CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(({children, className, style, ...rest}, ref) => {\n const footerStyle = useCardFooterStyles();\n\n return (\n <div\n ref={ref}\n style={{...footerStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('card-footer'), className)}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nCard.displayName = 'Card';\nCardHeader.displayName = 'Card.Header';\nCardTitle.displayName = 'Card.Title';\nCardDescription.displayName = 'Card.Description';\nCardAction.displayName = 'Card.Action';\nCardContent.displayName = 'Card.Content';\nCardFooter.displayName = 'Card.Footer';\n\n// Attach subcomponents to Card for dot notation usage\n(Card as any).Header = CardHeader;\n(Card as any).Title = CardTitle;\n(Card as any).Description = CardDescription;\n(Card as any).Action = CardAction;\n(Card as any).Content = CardContent;\n(Card as any).Footer = CardFooter;\n\n// TypeScript interface augmentation for dot notation\nexport interface CardComponent extends ForwardRefExoticComponent<CardProps & RefAttributes<HTMLDivElement>> {\n Action: typeof CardAction;\n Content: typeof CardContent;\n Description: typeof CardDescription;\n Footer: typeof CardFooter;\n Header: typeof CardHeader;\n Title: typeof CardTitle;\n}\n\nexport default Card as CardComponent;\nexport {Card, CardHeader, CardTitle, CardDescription, CardAction, CardContent, CardFooter};\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport {clsx} from 'clsx';\nimport {FC, HTMLAttributes, useMemo} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Typography from '../Typography/Typography';\n\nexport type DividerOrientation = 'horizontal' | 'vertical';\nexport type DividerVariant = 'solid' | 'dashed' | 'dotted';\n\nexport interface DividerProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Text to display in the center of the divider\n */\n children?: React.ReactNode;\n\n /**\n * Custom color for the divider\n */\n color?: string;\n\n /**\n * The orientation of the divider\n */\n orientation?: DividerOrientation;\n\n /**\n * The variant style of the divider\n */\n variant?: DividerVariant;\n}\n\nconst useStyles = (orientation: DividerOrientation, variant: DividerVariant, color?: string, hasChildren?: boolean) => {\n const {theme} = useTheme();\n\n return useMemo(() => {\n const baseColor = color || theme.colors.border;\n const borderStyle = variant === 'solid' ? 'solid' : variant === 'dashed' ? 'dashed' : 'dotted';\n\n const styles = `\n .${withVendorCSSClassPrefix('divider')} {\n margin: calc(${theme.vars.spacing.unit} * 2) 0;\n }\n\n .${withVendorCSSClassPrefix('divider--vertical')} {\n display: inline-block;\n height: 100%;\n min-height: calc(${theme.vars.spacing.unit} * 2);\n width: 1px;\n border-left: 1px ${borderStyle} ${baseColor};\n margin: 0 calc(${theme.vars.spacing.unit} * 1);\n }\n\n .${withVendorCSSClassPrefix('divider--horizontal')} {\n display: flex;\n align-items: center;\n width: 100%;\n }\n\n .${withVendorCSSClassPrefix('divider--horizontal')}:not(.${withVendorCSSClassPrefix('divider--with-text')}) {\n height: 1px;\n border-top: 1px ${borderStyle} ${baseColor};\n }\n\n .${withVendorCSSClassPrefix('divider__line')} {\n flex: 1;\n height: 1px;\n border-top: 1px ${borderStyle} ${baseColor};\n }\n\n .${withVendorCSSClassPrefix('divider__text')} {\n background-color: ${theme.vars.colors.background.surface};\n padding: 0 calc(${theme.vars.spacing.unit} * 1);\n white-space: nowrap;\n }\n `;\n\n return styles;\n }, [orientation, variant, color, hasChildren, theme]);\n};\n\n/**\n * Divider component for separating content sections.\n *\n * @example\n * ```tsx\n * // Basic horizontal divider\n * <Divider />\n *\n * // Divider with text\n * <Divider>OR</Divider>\n *\n * // Vertical divider\n * <Divider orientation=\"vertical\" />\n *\n * // Custom styled divider\n * <Divider variant=\"dashed\" color=\"#ccc\">Continue with</Divider>\n * ```\n */\nconst Divider: FC<DividerProps> = ({\n orientation = 'horizontal',\n variant = 'solid',\n children,\n color,\n className,\n style,\n ...rest\n}) => {\n const styles = useStyles(orientation, variant, color, !!children);\n\n if (orientation === 'vertical') {\n return (\n <>\n <style>{styles}</style>\n <div\n className={clsx(\n withVendorCSSClassPrefix('divider'),\n withVendorCSSClassPrefix('divider--vertical'),\n className,\n )}\n style={style}\n role=\"separator\"\n aria-orientation=\"vertical\"\n {...rest}\n />\n </>\n );\n }\n\n if (children) {\n return (\n <>\n <style>{styles}</style>\n <div\n className={clsx(\n withVendorCSSClassPrefix('divider'),\n withVendorCSSClassPrefix('divider--horizontal'),\n withVendorCSSClassPrefix('divider--with-text'),\n className,\n )}\n style={style}\n role=\"separator\"\n aria-orientation=\"horizontal\"\n {...rest}\n >\n <div className={withVendorCSSClassPrefix('divider__line')} />\n <Typography\n variant=\"body2\"\n color=\"textSecondary\"\n className={withVendorCSSClassPrefix('divider__text')}\n inline\n >\n {children}\n </Typography>\n <div className={withVendorCSSClassPrefix('divider__line')} />\n </div>\n </>\n );\n }\n\n return (\n <>\n <style>{styles}</style>\n <div\n className={clsx(\n withVendorCSSClassPrefix('divider'),\n withVendorCSSClassPrefix('divider--horizontal'),\n className,\n )}\n style={style}\n role=\"separator\"\n aria-orientation=\"horizontal\"\n {...rest}\n />\n </>\n );\n};\n\nexport default Divider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {clsx} from 'clsx';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport useTheme from '../../../contexts/Theme/useTheme';\n\n/**\n * Props for the Logo component.\n */\nexport interface LogoProps {\n /**\n * Custom CSS class name for the logo.\n */\n className?: string;\n /**\n * Custom logo URL to override theme logo.\n */\n src?: string;\n /**\n * Custom alt text for the logo.\n */\n alt?: string;\n /**\n * Custom title for the logo.\n */\n title?: string;\n /**\n * Size of the logo.\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Custom style object.\n */\n style?: React.CSSProperties;\n}\n\n/**\n * Logo component that displays the brand logo from theme or custom source.\n *\n * @param props - The props for the Logo component.\n * @returns The rendered Logo component.\n */\nconst Logo: FC<LogoProps> = ({className, src, alt, title, size = 'medium', style}) => {\n const {theme} = useTheme();\n\n // Get logo configuration from theme - use actual values, not CSS variables\n // Access the actual theme config values, not the CSS variable references from .vars\n const logoConfig = theme.images?.logo;\n\n const logoSrc = src || logoConfig?.url;\n\n const logoAlt = alt || logoConfig?.alt || 'Logo';\n\n const logoTitle = title || logoConfig?.title;\n\n const logoClasses = clsx(withVendorCSSClassPrefix('logo'), withVendorCSSClassPrefix(`logo--${size}`), className);\n\n const sizeStyles: Record<string, React.CSSProperties> = {\n small: {\n height: '32px',\n maxWidth: '120px',\n },\n medium: {\n height: '48px',\n maxWidth: '180px',\n },\n large: {\n height: '64px',\n maxWidth: '240px',\n },\n };\n\n const defaultStyles: React.CSSProperties = {\n width: 'auto',\n objectFit: 'contain',\n ...sizeStyles[size],\n ...style,\n };\n\n if (!logoSrc) {\n return null;\n }\n\n return <img src={logoSrc} alt={logoAlt} title={logoTitle} className={logoClasses} style={defaultStyles} />;\n};\n\nexport default Logo;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n EmbeddedSignInFlowInitiateResponse,\n EmbeddedSignInFlowHandleResponse,\n EmbeddedSignInFlowHandleRequestPayload,\n} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport BaseSignIn, {BaseSignInProps} from './BaseSignIn';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport {CardProps} from '../../primitives/Card/Card';\n\n/**\n * Props for the SignIn component.\n * Extends BaseSignInProps for full compatibility with the React BaseSignIn component\n */\nexport type SignInProps = Pick<BaseSignInProps, 'className' | 'onSuccess' | 'onError' | 'variant' | 'size'>;\n\n/**\n * A styled SignIn component that provides native authentication flow with pre-built styling.\n * This component handles the API calls for authentication and delegates UI logic to BaseSignIn.\n *\n * @example\n * ```tsx\n * import { SignIn } from '@asgardeo/react';\n *\n * const App = () => {\n * return (\n * <SignIn\n * onSuccess={(authData) => {\n * console.log('Authentication successful:', authData);\n * // Handle successful authentication (e.g., redirect, store tokens)\n * }}\n * onError={(error) => {\n * console.error('Authentication failed:', error);\n * }}\n * size=\"medium\"\n * variant=\"outlined\"\n * />\n * );\n * };\n * ```\n */\nconst SignIn: FC<SignInProps> = ({className, size = 'medium', ...rest}: SignInProps) => {\n const {signIn, afterSignInUrl, isInitialized, isLoading} = useAsgardeo();\n\n /**\n * Initialize the authentication flow.\n */\n const handleInitialize = async (): Promise<EmbeddedSignInFlowInitiateResponse> => {\n return await signIn({response_mode: 'direct'});\n };\n\n /**\n * Handle authentication steps.\n */\n const handleOnSubmit = async (\n payload: EmbeddedSignInFlowHandleRequestPayload,\n request: Request,\n ): Promise<EmbeddedSignInFlowHandleResponse> => {\n return await signIn(payload, request);\n };\n\n /**\n * Handle successful authentication and redirect with query params.\n */\n const handleSuccess = (authData: Record<string, any>): void => {\n if (authData && afterSignInUrl) {\n const url: URL = new URL(afterSignInUrl, window.location.origin);\n\n Object.entries(authData).forEach(([key, value]: [string, any]) => {\n if (value !== undefined && value !== null) {\n url.searchParams.append(key, String(value));\n }\n });\n\n window.location.href = url.toString();\n }\n };\n\n return (\n <BaseSignIn\n isLoading={isLoading || !isInitialized}\n afterSignInUrl={afterSignInUrl}\n onInitialize={handleInitialize}\n onSubmit={handleOnSubmit}\n onSuccess={handleSuccess}\n className={className}\n size={size}\n {...rest}\n />\n );\n};\n\nexport default SignIn;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n EmbeddedFlowExecuteRequestPayload,\n EmbeddedFlowExecuteResponse,\n EmbeddedFlowStatus,\n EmbeddedFlowComponentType,\n EmbeddedFlowResponseType,\n withVendorCSSClassPrefix,\n AsgardeoAPIError,\n} from '@asgardeo/browser';\nimport {clsx} from 'clsx';\nimport {FC, ReactElement, FormEvent, useEffect, useState, useCallback, useRef, useMemo, CSSProperties} from 'react';\nimport {renderSignUpComponents} from './options/SignUpOptionFactory';\nimport FlowProvider from '../../../contexts/Flow/FlowProvider';\nimport useFlow from '../../../contexts/Flow/useFlow';\nimport {useForm, FormField} from '../../../hooks/useForm';\nimport useTranslation from '../../../hooks/useTranslation';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Alert from '../../primitives/Alert/Alert';\nimport Card, {CardProps} from '../../primitives/Card/Card';\nimport Logo from '../../primitives/Logo/Logo';\nimport Spinner from '../../primitives/Spinner/Spinner';\nimport Typography from '../../primitives/Typography/Typography';\n\n/**\n * Props for the BaseSignUp component.\n */\nexport interface BaseSignUpProps {\n /**\n * URL to redirect after successful sign-up.\n */\n afterSignUpUrl?: string;\n\n /**\n * Custom CSS class name for the submit button.\n */\n buttonClassName?: string;\n\n /**\n * Custom CSS class name for the form container.\n */\n className?: string;\n\n /**\n * Custom CSS class name for error messages.\n */\n errorClassName?: string;\n\n /**\n * Custom CSS class name for form inputs.\n */\n inputClassName?: string;\n\n isInitialized?: boolean;\n\n /**\n * Custom CSS class name for info messages.\n */\n messageClassName?: string;\n\n /**\n * Callback function called when the sign-up flow completes and requires redirection.\n * This allows platform-specific handling of redirects (e.g., Next.js router.push).\n * @param response - The response from the sign-up flow containing the redirect URL, etc.\n */\n onComplete?: (response: EmbeddedFlowExecuteResponse) => void;\n\n /**\n * Callback function called when sign-up fails.\n * @param error - The error that occurred during sign-up.\n */\n onError?: (error: Error) => void;\n\n /**\n * Callback function called when sign-up flow status changes.\n * @param response - The current sign-up response.\n */\n onFlowChange?: (response: EmbeddedFlowExecuteResponse) => void;\n\n /**\n * Function to initialize sign-up flow.\n * @returns Promise resolving to the initial sign-up response.\n */\n onInitialize?: (payload?: EmbeddedFlowExecuteRequestPayload) => Promise<EmbeddedFlowExecuteResponse>;\n\n /**\n * Function to handle sign-up steps.\n * @param payload - The sign-up payload.\n * @returns Promise resolving to the sign-up response.\n */\n onSubmit?: (payload: EmbeddedFlowExecuteRequestPayload) => Promise<EmbeddedFlowExecuteResponse>;\n\n /**\n * Size variant for the component.\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Theme variant for the component.\n */\n variant?: CardProps['variant'];\n\n /**\n * Whether to redirect after sign-up.\n */\n shouldRedirectAfterSignUp?: boolean;\n}\n\n/**\n * Custom hook for managing component styles\n */\nconst useStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n () => ({\n card: {\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n minWidth: '420px',\n } as CSSProperties,\n header: {\n gap: 0,\n } as CSSProperties,\n subtitle: {\n marginTop: `calc(${theme.vars.spacing.unit} * 1)`,\n } as CSSProperties,\n messagesContainer: {\n marginTop: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n messageItem: {\n marginBottom: `calc(${theme.vars.spacing.unit} * 1)`,\n } as CSSProperties,\n errorContainer: {\n marginBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n contentContainer: {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n loadingContainer: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n } as CSSProperties,\n loadingText: {\n marginTop: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n divider: {\n margin: `calc(${theme.vars.spacing.unit} * 1) 0`,\n } as CSSProperties,\n logoContainer: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n marginBottom: `calc(${theme.vars.spacing.unit} * 3)`,\n } as CSSProperties,\n centeredContainer: {\n textAlign: 'center',\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n } as CSSProperties,\n passkeyContainer: {\n marginBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n passkeyText: {\n marginTop: `calc(${theme.vars.spacing.unit} * 1)`,\n color: theme.vars.colors.text.secondary,\n } as CSSProperties,\n }),\n [theme.vars.spacing.unit, theme.vars.colors.text.secondary],\n );\n};\n\n/**\n * Base SignUp component that provides embedded sign-up flow.\n * This component handles both the presentation layer and sign-up flow logic.\n * It accepts API functions as props to maintain framework independence.\n *\n * @example\n * ```tsx\n * import { BaseSignUp } from '@asgardeo/react';\n *\n * const MySignUp = () => {\n * return (\n * <BaseSignUp\n * onInitialize={async (payload) => {\n * // Your API call to initialize sign-up\n * return await initializeSignUp(payload);\n * }}\n * onSubmit={async (payload) => {\n * // Your API call to handle sign-up\n * return await handleSignUp(payload);\n * }}\n * onSuccess={(response) => {\n * console.log('Success:', response);\n * }} * onError={(error) => {\n * console.error('Error:', error);\n * }}\n * onComplete={(redirectUrl) => {\n * // Platform-specific redirect handling (e.g., Next.js router.push)\n * router.push(redirectUrl); // or window.location.href = redirectUrl\n * }}\n * className=\"max-w-md mx-auto\"\n * />\n * );\n * };\n * ```\n */\nconst BaseSignUp: FC<BaseSignUpProps> = props => {\n const {theme} = useTheme();\n const styles = useStyles();\n\n return (\n <div>\n <div style={styles.logoContainer}>\n <Logo size=\"large\" />\n </div>\n <FlowProvider>\n <BaseSignUpContent {...props} />\n </FlowProvider>\n </div>\n );\n};\n\n/**\n * Internal component that consumes FlowContext and renders the sign-up UI.\n */\nconst BaseSignUpContent: FC<BaseSignUpProps> = ({\n afterSignUpUrl,\n onInitialize,\n onSubmit,\n onError,\n onFlowChange,\n onComplete,\n className = '',\n inputClassName = '',\n buttonClassName = '',\n errorClassName = '',\n messageClassName = '',\n size = 'medium',\n variant = 'outlined',\n isInitialized,\n}) => {\n const {theme} = useTheme();\n const {t} = useTranslation();\n const {subtitle: flowSubtitle, title: flowTitle, messages: flowMessages} = useFlow();\n const styles = useStyles();\n\n const [isLoading, setIsLoading] = useState(false);\n const [isFlowInitialized, setIsFlowInitialized] = useState(false);\n const [currentFlow, setCurrentFlow] = useState<EmbeddedFlowExecuteResponse | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [formData, setFormData] = useState<Record<string, any>>({});\n\n // Ref to track if initialization has been attempted to prevent multiple calls\n const initializationAttemptedRef = useRef(false);\n\n /**\n * Extract form fields from flow components\n */\n const extractFormFields = useCallback(\n (components: any[]): FormField[] => {\n const fields: FormField[] = [];\n\n const processComponents = (comps: any[]) => {\n comps.forEach(component => {\n if (component.type === EmbeddedFlowComponentType.Input) {\n const config = component.config || {};\n fields.push({\n name: config.name || component.id,\n required: config.required || false,\n initialValue: config.defaultValue || '',\n validator: (value: string) => {\n if (config.required && (!value || value.trim() === '')) {\n return t('field.required');\n }\n // Add email validation if it's an email field\n if (config.type === 'email' && value && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) {\n return t('field.email.invalid');\n }\n // Add password strength validation if it's a password field\n if (config.type === 'password' && value && value.length < 8) {\n return t('field.password.weak');\n }\n return null;\n },\n });\n }\n\n if (component.components && Array.isArray(component.components)) {\n processComponents(component.components);\n }\n });\n };\n\n processComponents(components);\n return fields;\n },\n [t],\n );\n\n const formFields = currentFlow?.data?.components ? extractFormFields(currentFlow.data.components) : [];\n\n const form = useForm<Record<string, string>>({\n initialValues: {},\n fields: formFields,\n validateOnBlur: true,\n validateOnChange: true,\n requiredMessage: t('field.required'),\n });\n\n const {\n values: formValues,\n touched: touchedFields,\n errors: formErrors,\n isValid: isFormValid,\n setValue: setFormValue,\n setTouched: setFormTouched,\n clearErrors: clearFormErrors,\n validateField: validateFormField,\n validateForm,\n touchAllFields,\n reset: resetForm,\n } = form;\n\n /**\n * Setup form fields based on the current flow.\n */\n const setupFormFields = useCallback(\n (flowResponse: EmbeddedFlowExecuteResponse) => {\n const fields = extractFormFields(flowResponse.data?.components || []);\n const initialValues: Record<string, string> = {};\n\n fields.forEach(field => {\n initialValues[field.name] = field.initialValue || '';\n });\n\n // Reset form with new values\n resetForm();\n\n // Set initial values for all fields\n Object.keys(initialValues).forEach(key => {\n setFormValue(key, initialValues[key]);\n });\n },\n [extractFormFields, resetForm, setFormValue],\n );\n\n /**\n * Handle input value changes.\n */\n const handleInputChange = (name: string, value: string) => {\n setFormValue(name, value);\n setFormTouched(name, true);\n };\n\n /**\n * Handle component submission (for buttons outside forms).\n */\n const handleSubmit = async (component: any, data?: Record<string, any>) => {\n if (!currentFlow) {\n return;\n }\n\n setIsLoading(true);\n setError(null);\n\n try {\n // Filter out empty or undefined input values\n const filteredInputs: Record<string, any> = {};\n if (data) {\n Object.entries(data).forEach(([key, value]) => {\n if (value !== null && value !== undefined && value !== '') {\n filteredInputs[key] = value;\n }\n });\n }\n\n const payload: EmbeddedFlowExecuteRequestPayload = {\n ...(currentFlow.flowId && {flowId: currentFlow.flowId}),\n flowType: (currentFlow as any).flowType || 'REGISTRATION',\n inputs: filteredInputs,\n actionId: component.id,\n } as any;\n\n const response = await onSubmit(payload);\n onFlowChange?.(response);\n\n if (response.flowStatus === EmbeddedFlowStatus.Complete) {\n onComplete?.(response);\n return;\n }\n\n if (response.flowStatus === EmbeddedFlowStatus.Incomplete) {\n // Check if the response contains a redirection URL and redirect if needed\n if (handleRedirectionIfNeeded(response, component)) {\n return;\n }\n\n setCurrentFlow(response);\n setupFormFields(response);\n }\n } catch (err) {\n const errorMessage = err instanceof AsgardeoAPIError ? err.message : t('errors.sign.up.flow.failure');\n setError(errorMessage);\n onError?.(err as Error);\n } finally {\n setIsLoading(false);\n }\n };\n\n /**\n * Check if the response contains a redirection URL and perform the redirect if necessary.\n * @param response - The sign-up response\n * @param component - The component that triggered the submission (needed for actionId)\n * @returns true if a redirect was performed, false otherwise\n */\n const handleRedirectionIfNeeded = (response: EmbeddedFlowExecuteResponse, component: any): boolean => {\n if (response?.type === EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {\n /**\n * Open a popup window to handle redirection prompts for social sign-up\n */\n const redirectUrl = response.data.redirectURL;\n const popup = window.open(redirectUrl, 'oauth_popup', 'width=500,height=600,scrollbars=yes,resizable=yes');\n\n if (!popup) {\n console.error('Failed to open popup window');\n return false;\n }\n\n /**\n * Add an event listener to the window to capture the message from the popup\n */\n const messageHandler = async function messageEventHandler(event: MessageEvent) {\n /**\n * Check if the message is from our popup window\n */\n if (event.source !== popup) {\n return;\n }\n\n /**\n * Check the origin of the message to ensure it's from a trusted source\n */\n const expectedOrigin = afterSignUpUrl ? new URL(afterSignUpUrl).origin : window.location.origin;\n if (event.origin !== expectedOrigin && event.origin !== window.location.origin) {\n return;\n }\n\n const {code, state} = event.data;\n\n if (code && state) {\n const payload: EmbeddedFlowExecuteRequestPayload = {\n ...(currentFlow.flowId && {flowId: currentFlow.flowId}),\n flowType: (currentFlow as any).flowType || 'REGISTRATION',\n inputs: {\n code,\n state,\n },\n actionId: '',\n } as any;\n\n try {\n const continueResponse = await onSubmit(payload);\n onFlowChange?.(continueResponse);\n\n if (continueResponse.flowStatus === EmbeddedFlowStatus.Complete) {\n onComplete?.(continueResponse);\n } else if (continueResponse.flowStatus === EmbeddedFlowStatus.Incomplete) {\n setCurrentFlow(continueResponse);\n setupFormFields(continueResponse);\n }\n\n popup.close();\n cleanup();\n } catch (err) {\n const errorMessage = err instanceof AsgardeoAPIError ? err.message : t('errors.sign.up.flow.failure');\n setError(errorMessage);\n onError?.(err as Error);\n popup.close();\n cleanup();\n }\n }\n };\n\n const cleanup = () => {\n window.removeEventListener('message', messageHandler);\n if (popupMonitor) {\n clearInterval(popupMonitor);\n }\n };\n\n window.addEventListener('message', messageHandler);\n\n /**\n * Monitor popup for closure and URL changes\n */\n let hasProcessedCallback = false; // Prevent multiple processing\n const popupMonitor = setInterval(async () => {\n try {\n if (popup.closed) {\n cleanup();\n return;\n }\n\n // Skip if we've already processed a callback\n if (hasProcessedCallback) {\n return;\n }\n\n // Try to access popup URL to check for callback\n try {\n const popupUrl = popup.location.href;\n\n // Check if we've been redirected to the callback URL\n if (popupUrl && (popupUrl.includes('code=') || popupUrl.includes('error='))) {\n hasProcessedCallback = true; // Set flag to prevent multiple processing\n\n // Parse the URL for OAuth parameters\n const url = new URL(popupUrl);\n const code = url.searchParams.get('code');\n const state = url.searchParams.get('state');\n const error = url.searchParams.get('error');\n\n if (error) {\n console.error('OAuth error:', error);\n popup.close();\n cleanup();\n return;\n }\n\n if (code && state) {\n const payload: EmbeddedFlowExecuteRequestPayload = {\n ...(currentFlow.flowId && {flowId: currentFlow.flowId}),\n flowType: (currentFlow as any).flowType || 'REGISTRATION',\n inputs: {\n code,\n state,\n },\n actionId: '',\n } as any;\n\n try {\n const continueResponse = await onSubmit(payload);\n onFlowChange?.(continueResponse);\n\n if (continueResponse.flowStatus === EmbeddedFlowStatus.Complete) {\n onComplete?.(continueResponse);\n } else if (continueResponse.flowStatus === EmbeddedFlowStatus.Incomplete) {\n setCurrentFlow(continueResponse);\n setupFormFields(continueResponse);\n }\n\n popup.close();\n } catch (err) {\n const errorMessage = err instanceof AsgardeoAPIError ? err.message : t('errors.sign.up.flow.failure');\n setError(errorMessage);\n onError?.(err as Error);\n popup.close();\n }\n }\n }\n } catch (e) {\n // Cross-origin error is expected when popup navigates to OAuth provider\n // This is normal and we can ignore it\n }\n } catch (e) {\n console.error('Error monitoring popup:', e);\n }\n }, 1000);\n\n return true;\n }\n\n return false;\n };\n\n // Generate CSS classes\n const containerClasses = clsx(\n [\n withVendorCSSClassPrefix('signup'),\n withVendorCSSClassPrefix(`signup--${size}`),\n withVendorCSSClassPrefix(`signup--${variant}`),\n ],\n className,\n );\n\n const inputClasses = clsx(\n [\n withVendorCSSClassPrefix('signup__input'),\n size === 'small' && withVendorCSSClassPrefix('signup__input--small'),\n size === 'large' && withVendorCSSClassPrefix('signup__input--large'),\n ],\n inputClassName,\n );\n\n const buttonClasses = clsx(\n [\n withVendorCSSClassPrefix('signup__button'),\n size === 'small' && withVendorCSSClassPrefix('signup__button--small'),\n size === 'large' && withVendorCSSClassPrefix('signup__button--large'),\n ],\n buttonClassName,\n );\n\n const errorClasses = clsx([withVendorCSSClassPrefix('signup__error')], errorClassName);\n\n const messageClasses = clsx([withVendorCSSClassPrefix('signup__messages')], messageClassName);\n\n /**\n * Render form components based on flow data using the factory\n */\n const renderComponents = useCallback(\n (components: any[]): ReactElement[] =>\n renderSignUpComponents(\n components,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n handleInputChange,\n {\n buttonClassName: buttonClasses,\n error,\n inputClassName: inputClasses,\n onSubmit: handleSubmit,\n size,\n variant,\n },\n ),\n [\n formValues,\n touchedFields,\n formErrors,\n isFormValid,\n isLoading,\n size,\n variant,\n error,\n inputClasses,\n buttonClasses,\n handleSubmit,\n ],\n );\n\n // Initialize the flow on component mount\n useEffect(() => {\n if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {\n initializationAttemptedRef.current = true;\n\n // Inline initialization to avoid dependency issues\n const performInitialization = async () => {\n setIsLoading(true);\n setError(null);\n\n try {\n const response = await onInitialize();\n\n setCurrentFlow(response);\n setIsFlowInitialized(true);\n onFlowChange?.(response);\n\n if (response.flowStatus === EmbeddedFlowStatus.Complete) {\n onComplete?.(response);\n\n return;\n }\n\n if (response.flowStatus === EmbeddedFlowStatus.Incomplete) {\n setupFormFields(response);\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : t('errors.sign.up.flow.initialization.failure');\n setError(errorMessage);\n onError?.(err as Error);\n } finally {\n setIsLoading(false);\n }\n };\n\n performInitialization();\n }\n }, [\n isInitialized,\n isFlowInitialized,\n onInitialize,\n onComplete,\n onError,\n onFlowChange,\n setupFormFields,\n afterSignUpUrl,\n t,\n ]);\n\n if (!isFlowInitialized && isLoading) {\n return (\n <Card className={containerClasses} style={styles.card} variant={variant}>\n <Card.Content>\n <div style={{display: 'flex', justifyContent: 'center', padding: `calc(${theme.vars.spacing.unit} * 4)`}}>\n <Spinner size=\"medium\" />\n </div>\n </Card.Content>\n </Card>\n );\n }\n\n if (!currentFlow) {\n return (\n <Card className={containerClasses} style={styles.card} variant={variant}>\n <Card.Content>\n <Alert variant=\"error\" className={errorClasses}>\n <Alert.Title>{t('errors.title') || 'Error'}</Alert.Title>\n <Alert.Description>{error || t('errors.sign.up.flow.initialization.failure')}</Alert.Description>\n </Alert>\n </Card.Content>\n </Card>\n );\n }\n\n return (\n <Card className={containerClasses} style={styles.card} variant={variant}>\n {flowMessages && flowMessages.length > 0 && (\n <Card.Header style={styles.header}>\n <div style={{marginTop: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {flowMessages.map((message: any, index: number) => (\n <Alert\n key={message.id || index}\n variant={message.type?.toLowerCase() === 'error' ? 'error' : 'info'}\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 1)`}}\n className={messageClasses}\n >\n <Alert.Description>{message.message}</Alert.Description>\n </Alert>\n ))}\n </div>\n </Card.Header>\n )}\n <Card.Content>\n {error && (\n <Alert\n variant=\"error\"\n className={errorClasses}\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n <Alert.Title>{t('errors.title') || 'Error'}</Alert.Title>\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n )}\n\n <div style={{display: 'flex', flexDirection: 'column', gap: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {currentFlow.data?.components && renderComponents(currentFlow.data.components)}\n </div>\n </Card.Content>\n </Card>\n );\n};\n\nexport default BaseSignUp;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedFlowComponent, EmbeddedFlowComponentType, WithPreferences} from '@asgardeo/browser';\nimport {ReactElement} from 'react';\nimport CheckboxInput from './CheckboxInput';\nimport DateInput from './DateInput';\nimport DividerComponent from './DividerComponent';\nimport EmailInput from './EmailInput';\nimport FormContainer from './FormContainer';\nimport GoogleButton from './GoogleButton';\nimport ImageComponent from './ImageComponent';\nimport NumberInput from './NumberInput';\nimport PasswordInput from './PasswordInput';\nimport ButtonComponent from './SubmitButton';\nimport TelephoneInput from './TelephoneInput';\nimport TextInput from './TextInput';\nimport Typography from './Typography';\n\n/**\n * Base props that all sign-up option components share.\n */\nexport interface BaseSignUpOptionProps extends WithPreferences {\n /**\n * Custom CSS class name for buttons.\n */\n buttonClassName?: string;\n\n /**\n * The component configuration from the flow response.\n */\n component: EmbeddedFlowComponent;\n\n /**\n * Global error message to display.\n */\n error?: string | null;\n\n /**\n * Form validation errors.\n */\n formErrors: Record<string, string>;\n\n /**\n * Current form values.\n */\n formValues: Record<string, string>;\n\n /**\n * Custom CSS class name for form inputs.\n */\n inputClassName?: string;\n\n /**\n * Whether the form is valid.\n */\n isFormValid: boolean;\n\n /**\n * Whether the component is in loading state.\n */\n isLoading: boolean;\n\n /**\n * Callback function called when input values change.\n */\n onInputChange: (name: string, value: string) => void;\n\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>) => void;\n\n /**\n * Component size variant.\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Touched state for form fields.\n */\n touchedFields: Record<string, boolean>;\n\n /**\n * Component theme variant.\n */\n variant?: any;\n}\n\n/**\n * Creates the appropriate sign-up component based on the component type.\n */\nexport const createSignUpComponent = (props: BaseSignUpOptionProps): ReactElement => {\n const {component} = props;\n\n switch (component.type) {\n case EmbeddedFlowComponentType.Typography:\n return <Typography {...props} />;\n\n case EmbeddedFlowComponentType.Input:\n // Determine input type based on variant or config\n const inputVariant = component.variant?.toUpperCase();\n const inputType = component.config['type']?.toLowerCase();\n\n if (inputVariant === 'EMAIL' || inputType === 'email') {\n return <EmailInput {...props} />;\n }\n if (inputVariant === 'PASSWORD' || inputType === 'password') {\n return <PasswordInput {...props} />;\n }\n if (inputVariant === 'TELEPHONE' || inputType === 'tel') {\n return <TelephoneInput {...props} />;\n }\n if (inputVariant === 'NUMBER' || inputType === 'number') {\n return <NumberInput {...props} />;\n }\n if (inputVariant === 'DATE' || inputType === 'date') {\n return <DateInput {...props} />;\n }\n if (inputVariant === 'CHECKBOX' || inputType === 'checkbox') {\n return <CheckboxInput {...props} />;\n }\n return <TextInput {...props} />;\n\n case EmbeddedFlowComponentType.Button: {\n const buttonVariant: string | undefined = component.variant?.toUpperCase();\n const buttonText: string = component.config['text'] || component.config['label'] || '';\n\n // TODO: The connection type should come as metadata.\n if (buttonVariant === 'SOCIAL' && buttonText.toLowerCase().includes('google')) {\n return <GoogleButton {...props} />;\n }\n\n // Use the generic ButtonComponent for all other button variants\n // It will handle PRIMARY, SECONDARY, TEXT, SOCIAL mappings internally\n return <ButtonComponent {...props} />;\n }\n\n case EmbeddedFlowComponentType.Form:\n return <FormContainer {...props} />;\n\n case EmbeddedFlowComponentType.Divider:\n return <DividerComponent {...props} />;\n\n case EmbeddedFlowComponentType.Image:\n return <ImageComponent {...props} />;\n\n default:\n return <div />;\n }\n};\n\n/**\n * Convenience function that creates the appropriate sign-up component from flow component data.\n */\nexport const createSignUpOptionFromComponent = (\n component: EmbeddedFlowComponent,\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n options?: {\n buttonClassName?: string;\n error?: string | null;\n inputClassName?: string;\n key?: string | number;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>) => void;\n size?: 'small' | 'medium' | 'large';\n variant?: any;\n },\n): ReactElement =>\n createSignUpComponent({\n component,\n formErrors,\n formValues,\n isFormValid,\n isLoading,\n onInputChange,\n touchedFields,\n ...options,\n });\n\n/**\n * Processes an array of components and renders them as React elements.\n */\nexport const renderSignUpComponents = (\n components: EmbeddedFlowComponent[],\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n options?: {\n buttonClassName?: string;\n error?: string | null;\n inputClassName?: string;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>) => void;\n size?: 'small' | 'medium' | 'large';\n variant?: any;\n },\n): ReactElement[] =>\n components\n .map((component, index) =>\n createSignUpOptionFromComponent(\n component,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n {\n ...options,\n // Use component id as key, fallback to index\n key: component.id || index,\n },\n ),\n )\n .filter(Boolean);\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FieldType} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport {createField} from '../../../factories/FieldFactory';\n\n/**\n * Checkbox input component for sign-up forms.\n */\nconst CheckboxInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n type: FieldType.Checkbox,\n name: fieldName,\n label: config['label'] || '',\n placeholder: config['placeholder'] || '',\n required: config['required'] || false,\n value,\n error,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n className: inputClassName,\n });\n};\n\nexport default CheckboxInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FieldType} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport {createField} from '../../../factories/FieldFactory';\n\n/**\n * Date input component for sign-up forms.\n */\nconst DateInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n type: FieldType.Date,\n name: fieldName,\n label: config['label'] || '',\n placeholder: config['placeholder'] || '',\n required: config['required'] || false,\n value,\n error,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n className: inputClassName,\n });\n};\n\nexport default DateInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport Divider from '../../../primitives/Divider/Divider';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * Divider component for sign-up forms.\n */\nconst DividerComponent: FC<BaseSignUpOptionProps> = ({component}) => {\n const {theme} = useTheme();\n const config = component.config || {};\n const text = config['text'] || '';\n const variant = component.variant?.toLowerCase() || 'horizontal';\n\n return (\n <Divider\n key={component.id}\n orientation={variant === 'vertical' ? 'vertical' : 'horizontal'}\n style={{margin: `calc(${theme.vars.spacing.unit} * 2) 0`}}\n >\n {text}\n </Divider>\n );\n};\n\nexport default DividerComponent;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FieldType} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport {createField} from '../../../factories/FieldFactory';\n\n/**\n * Email input component for sign-up forms.\n */\nconst EmailInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n type: FieldType.Email,\n name: fieldName,\n label: config['label'] || 'Email',\n placeholder: config['placeholder'] || 'Enter your email',\n required: config['required'] || false,\n value,\n error,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n className: inputClassName,\n });\n};\n\nexport default EmailInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {createSignUpComponent, BaseSignUpOptionProps} from './SignUpOptionFactory';\n\n/**\n * Form container component that renders child components.\n */\nconst FormContainer: FC<BaseSignUpOptionProps> = props => {\n const {component} = props;\n\n // If the form has child components, render them wrapped in a form element\n if (component.components && component.components.length > 0) {\n const handleFormSubmit = (e: React.FormEvent): void => {\n e.preventDefault();\n\n // Find submit button in child components and trigger its submission\n const submitButton = component.components?.find(\n child =>\n child.type === 'BUTTON' &&\n (child.variant === 'PRIMARY' || child.variant === 'SECONDARY' || child.config?.['type'] === 'submit'),\n );\n\n if (submitButton && props.onSubmit) {\n props.onSubmit(submitButton, props.formValues);\n }\n };\n\n return (\n <form key={component.id} onSubmit={handleFormSubmit} style={{display: 'flex', flexDirection: 'column'}}>\n {component.components.map((childComponent, index) =>\n createSignUpComponent({\n ...props,\n component: childComponent,\n }),\n )}\n </form>\n );\n }\n\n // Empty form container\n return <div key={component.id} />;\n};\n\nexport default FormContainer;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\n\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport Button from '../../../primitives/Button/Button';\n\n/**\n * Google Sign-Up Button Component.\n * Handles registration with Google identity provider.\n */\nconst GoogleButton: FC<BaseSignUpOptionProps> = ({\n component,\n isLoading,\n buttonClassName = '',\n size = 'medium',\n onSubmit,\n}) => {\n const config = component.config || {};\n const buttonText: string = config['text'] || config['label'] || 'Continue with Google';\n\n /**\n * Handle button click.\n */\n const handleClick = (): void => {\n if (onSubmit) {\n onSubmit(component, {});\n }\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"solid\"\n color=\"secondary\"\n size={size}\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n style={{width: '100%'}}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 67.91 67.901\" xmlns=\"http://www.w3.org/2000/svg\">\n <g transform=\"translate(-0.001 -0.001)\">\n <path\n d=\"M15.049,160.965l-2.364,8.824-8.639.183a34.011,34.011,0,0,1-.25-31.7h0l7.691,1.41,3.369,7.645a20.262,20.262,0,0,0,.19,13.642Z\"\n transform=\"translate(0 -119.93)\"\n fill=\"#fbbb00\"\n />\n <path\n d=\"M294.24,208.176A33.939,33.939,0,0,1,282.137,241h0l-9.687-.494-1.371-8.559a20.235,20.235,0,0,0,8.706-10.333H261.628V208.176Z\"\n transform=\"translate(-226.93 -180.567)\"\n fill=\"#518ef8\"\n />\n <path\n d=\"M81.668,328.8h0a33.962,33.962,0,0,1-51.161-10.387l11-9.006a20.192,20.192,0,0,0,29.1,10.338Z\"\n transform=\"translate(-26.463 -268.374)\"\n fill=\"#28b446\"\n />\n <path\n d=\"M80.451,7.816l-11,9A20.19,20.19,0,0,0,39.686,27.393l-11.06-9.055h0A33.959,33.959,0,0,1,80.451,7.816Z\"\n transform=\"translate(-24.828)\"\n fill=\"#f14336\"\n />\n </g>\n </svg>\n }\n >\n {buttonText}\n </Button>\n );\n};\n\nexport default GoogleButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * Image component for sign-up forms.\n */\nconst ImageComponent: FC<BaseSignUpOptionProps> = ({component}) => {\n const {theme} = useTheme();\n const config = component.config || {};\n const src = config['src'] || '';\n const alt = config['alt'] || config['label'] || 'Image';\n const variant = component.variant?.toLowerCase() || 'image_block';\n\n const imageStyle: React.CSSProperties = {\n maxWidth: '100%',\n height: 'auto',\n display: 'block',\n margin: variant === 'image_block' ? '1rem auto' : '0',\n borderRadius: theme.vars.borderRadius.small,\n };\n\n if (!src) {\n return null;\n }\n\n return (\n <div key={component.id} style={{textAlign: 'center'}}>\n <img\n src={src}\n alt={alt}\n style={imageStyle}\n onError={e => {\n // Hide broken images\n e.currentTarget.style.display = 'none';\n }}\n />\n </div>\n );\n};\n\nexport default ImageComponent;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FieldType} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport {createField} from '../../../factories/FieldFactory';\n\n/**\n * Number input component for sign-up forms.\n */\nconst NumberInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n type: FieldType.Number,\n name: fieldName,\n label: config['label'] || '',\n placeholder: config['placeholder'] || '',\n required: config['required'] || false,\n value,\n error,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n className: inputClassName,\n });\n};\n\nexport default NumberInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FieldType} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport {createField} from '../../../factories/FieldFactory';\n\n/**\n * Password input component for sign-up forms.\n */\nconst PasswordInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n // Extract validation rules from the component config if available\n const validations = config['validations'] || [];\n const validationHints: string[] = [];\n\n validations.forEach((validation: any) => {\n if (validation.name === 'LengthValidator') {\n const minLength = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n const maxLength = validation.conditions?.find((c: any) => c.key === 'max.length')?.value;\n if (minLength || maxLength) {\n validationHints.push(`Length: ${minLength || '0'}-${maxLength || '\u221E'} characters`);\n }\n } else if (validation.name === 'UpperCaseValidator') {\n const minLength = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n if (minLength && parseInt(minLength, 10) > 0) {\n validationHints.push('Must contain uppercase letter(s)');\n }\n } else if (validation.name === 'LowerCaseValidator') {\n const minLength = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n if (minLength && parseInt(minLength, 10) > 0) {\n validationHints.push('Must contain lowercase letter(s)');\n }\n } else if (validation.name === 'NumeralValidator') {\n const minLength = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n if (minLength && parseInt(minLength, 10) > 0) {\n validationHints.push('Must contain number(s)');\n }\n } else if (validation.name === 'SpecialCharacterValidator') {\n const minLength = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n if (minLength && parseInt(minLength, 10) > 0) {\n validationHints.push('Must contain special character(s)');\n }\n }\n });\n\n const hint = validationHints.length > 0 ? validationHints.join(', ') : config['hint'] || '';\n\n return createField({\n type: FieldType.Password,\n name: fieldName,\n label: config['label'] || 'Password',\n placeholder: config['placeholder'] || 'Enter your password',\n required: config['required'] || false,\n value,\n error,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n className: inputClassName,\n });\n};\n\nexport default PasswordInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\n\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport Button from '../../../primitives/Button/Button';\nimport Spinner from '../../../primitives/Spinner/Spinner';\n\n/**\n * Button component for sign-up forms that handles all button variants.\n */\nconst ButtonComponent: FC<BaseSignUpOptionProps> = ({\n component,\n isLoading,\n isFormValid,\n buttonClassName,\n onSubmit,\n size = 'medium',\n}) => {\n const config = component.config || {};\n const buttonText = config['text'] || config['label'] || 'Continue';\n const buttonType = config['type'] || 'submit';\n const componentVariant = component.variant?.toUpperCase() || 'PRIMARY';\n\n // Map component variants to Button primitive props\n const getButtonProps = () => {\n switch (componentVariant) {\n case 'PRIMARY':\n return {variant: 'solid' as const, color: 'primary' as const};\n case 'SECONDARY':\n return {variant: 'solid' as const, color: 'secondary' as const};\n case 'TEXT':\n return {variant: 'text' as const, color: 'primary' as const};\n case 'SOCIAL':\n return {variant: 'outline' as const, color: 'primary' as const};\n default:\n return {variant: 'solid' as const, color: 'primary' as const};\n }\n };\n\n const {variant, color} = getButtonProps();\n\n const handleClick = () => {\n if (onSubmit && buttonType !== 'submit') {\n onSubmit(component);\n }\n };\n\n return (\n <Button\n key={component.id}\n type={buttonType === 'submit' ? 'submit' : 'button'}\n variant={variant}\n color={color}\n size={size}\n disabled={isLoading || (buttonType === 'submit' && !isFormValid)}\n onClick={buttonType !== 'submit' ? handleClick : undefined}\n className={buttonClassName}\n style={{width: '100%'}}\n >\n {isLoading ? <Spinner size=\"small\" /> : buttonText}\n </Button>\n );\n};\n\nexport default ButtonComponent;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport TextField from '../../../primitives/TextField/TextField';\n\n/**\n * Telephone input component for sign-up forms.\n */\nconst TelephoneInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return (\n <TextField\n key={component.id}\n name={fieldName}\n type=\"tel\"\n label={config['label'] || ''}\n placeholder={config['placeholder'] || ''}\n required={config['required'] || false}\n value={value}\n error={error}\n onChange={e => onInputChange(fieldName, e.target.value)}\n className={inputClassName}\n helperText={config['hint'] || ''}\n />\n );\n};\n\nexport default TelephoneInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FieldType} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport {createField} from '../../../factories/FieldFactory';\n\n/**\n * Text input component for sign-up forms.\n */\nconst TextInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n type: FieldType.Text,\n name: fieldName,\n label: config['label'] || '',\n placeholder: config['placeholder'] || '',\n required: config['required'] || false,\n value,\n error,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n className: inputClassName,\n });\n};\n\nexport default TextInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport Typography from '../../../primitives/Typography/Typography';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * Typography component for sign-up forms (titles, descriptions, etc.).\n */\nconst TypographyComponent: FC<BaseSignUpOptionProps> = ({component}) => {\n const {theme} = useTheme();\n const config = component.config || {};\n const text = config['text'] || config['content'] || '';\n const variant = component.variant?.toLowerCase() || 'body1';\n\n // Map component variants to Typography variants\n let typographyVariant: any = 'body1';\n\n switch (variant) {\n case 'h1':\n typographyVariant = 'h1';\n break;\n case 'h2':\n typographyVariant = 'h2';\n break;\n case 'h3':\n typographyVariant = 'h3';\n break;\n case 'h4':\n typographyVariant = 'h4';\n break;\n case 'h5':\n typographyVariant = 'h5';\n break;\n case 'h6':\n typographyVariant = 'h6';\n break;\n case 'subtitle1':\n typographyVariant = 'subtitle1';\n break;\n case 'subtitle2':\n typographyVariant = 'subtitle2';\n break;\n case 'body2':\n typographyVariant = 'body2';\n break;\n case 'caption':\n typographyVariant = 'caption';\n break;\n default:\n typographyVariant = 'body1';\n }\n\n return (\n <Typography\n key={component.id}\n variant={typographyVariant}\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n {text}\n </Typography>\n );\n};\n\nexport default TypographyComponent;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n EmbeddedFlowExecuteRequestPayload,\n EmbeddedFlowExecuteResponse,\n EmbeddedFlowResponseType,\n EmbeddedFlowType,\n} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport BaseSignUp, {BaseSignUpProps} from './BaseSignUp';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\n\n/**\n * Props for the SignUp component.\n */\nexport type SignUpProps = BaseSignUpProps;\n\n/**\n * A styled SignUp component that provides embedded sign-up flow with pre-built styling.\n * This component handles the API calls for sign-up and delegates UI logic to BaseSignUp.\n *\n * @example\n * ```tsx\n * import { SignUp } from '@asgardeo/react';\n *\n * const App = () => {\n * return (\n * <SignUp\n * onSuccess={(response) => {\n * console.log('Sign-up successful:', response);\n * // Handle successful sign-up (e.g., redirect, show confirmation)\n * }}\n * onError={(error) => {\n * console.error('Sign-up failed:', error);\n * }}\n * onComplete={(redirectUrl) => {\n * // Platform-specific redirect handling (e.g., Next.js router.push)\n * router.push(redirectUrl); // or window.location.href = redirectUrl\n * }}\n * size=\"medium\"\n * variant=\"outlined\"\n * afterSignUpUrl=\"/welcome\"\n * />\n * );\n * };\n * ```\n */\nconst SignUp: FC<SignUpProps> = ({\n className,\n size = 'medium',\n afterSignUpUrl,\n onError,\n onComplete,\n shouldRedirectAfterSignUp = true,\n ...rest\n}) => {\n const {signUp, isInitialized} = useAsgardeo();\n\n /**\n * Initialize the sign-up flow.\n */\n const handleInitialize = async (payload?: EmbeddedFlowExecuteRequestPayload): Promise<EmbeddedFlowExecuteResponse> =>\n await signUp(\n payload || {\n flowType: EmbeddedFlowType.Registration,\n },\n );\n\n /**\n * Handle sign-up steps.\n */\n const handleOnSubmit = async (payload: EmbeddedFlowExecuteRequestPayload): Promise<EmbeddedFlowExecuteResponse> =>\n await signUp(payload);\n\n /**\n * Handle successful sign-up and redirect.\n */\n const handleComplete = (response: EmbeddedFlowExecuteResponse) => {\n onComplete?.(response);\n\n // For non-redirection responses (regular sign-up completion), handle redirect if configured\n if (shouldRedirectAfterSignUp && response?.type !== EmbeddedFlowResponseType.Redirection && afterSignUpUrl) {\n window.location.href = afterSignUpUrl;\n }\n\n // For redirection responses (social sign-up), they are handled by BaseSignUp's popup mechanism\n // and we only redirect after the OAuth flow is complete if shouldRedirectAfterSignUp is true\n if (\n shouldRedirectAfterSignUp &&\n response?.type === EmbeddedFlowResponseType.Redirection &&\n response?.data?.redirectURL &&\n !response.data.redirectURL.includes('oauth') && // Not a social provider redirect\n !response.data.redirectURL.includes('auth') // Not an auth provider redirect\n ) {\n window.location.href = response.data.redirectURL;\n }\n };\n\n return (\n <BaseSignUp\n afterSignUpUrl={afterSignUpUrl}\n onInitialize={handleInitialize}\n onSubmit={handleOnSubmit}\n onError={onError}\n onComplete={handleComplete}\n className={className}\n size={size}\n isInitialized={isInitialized}\n {...rest}\n />\n );\n};\n\nexport default SignUp;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User as IUser} from '@asgardeo/browser';\nimport {FC, ReactElement, ReactNode} from 'react';\n\n/**\n * Props for the BaseUser component.\n */\nexport interface BaseUserProps {\n /**\n * The user object to display. If not provided, the component will render the fallback.\n */\n user: IUser | null;\n\n /**\n * Render prop that takes the user object and returns a ReactNode.\n * @param user - The authenticated user object from Asgardeo.\n * @returns A ReactNode to render.\n */\n children: (user: IUser | null) => ReactNode;\n\n /**\n * Optional element to render when no user is provided.\n */\n fallback?: ReactNode;\n}\n\n/**\n * Base User component that provides the core functionality for displaying user information.\n * This component takes a user object as a prop and uses render props to expose it.\n *\n * @remarks This is the base component that can be used in any context where you have\n * a user object available. For React applications, use the User component which\n * automatically retrieves the user from Asgardeo context.\n *\n * @example\n * ```tsx\n * import { BaseUser } from '@asgardeo/auth-react';\n *\n * const MyComponent = ({ user }) => {\n * return (\n * <BaseUser user={user} fallback={<p>No user data</p>}>\n * {(user) => (\n * <div>\n * <h1>Welcome, {user.displayName}!</h1>\n * <p>Email: {user.email}</p>\n * </div>\n * )}\n * </BaseUser>\n * );\n * }\n * ```\n */\nconst BaseUser: FC<BaseUserProps> = ({user, children, fallback = null}): ReactElement => {\n if (!user) {\n return <>{fallback}</>;\n }\n\n return <>{children(user)}</>;\n};\n\nBaseUser.displayName = 'BaseUser';\n\nexport default BaseUser;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User as IUser} from '@asgardeo/browser';\nimport {FC, ReactElement, ReactNode} from 'react';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport BaseUser, {BaseUserProps} from './BaseUser';\n\n/**\n * Props for the User component.\n * Extends BaseUserProps but makes the user prop optional since it will be obtained from useAsgardeo\n */\nexport interface UserProps extends Omit<BaseUserProps, 'user'> {\n /**\n * Render prop that takes the user object and returns a ReactNode.\n * @param user - The authenticated user object from Asgardeo.\n * @returns A ReactNode to render.\n */\n children: (user: IUser | null) => ReactNode;\n\n /**\n * Optional element to render when no user is signed in.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that uses render props to expose the authenticated user object.\n * This component automatically retrieves the user from Asgardeo context.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example\n * ```tsx\n * import { IUser } from '@asgardeo/auth-react';\n *\n * const App = () => {\n * return (\n * <User fallback={<p>Please sign in</p>}>\n * {(user) => (\n * <div>\n * <h1>Welcome, {user.displayName}!</h1>\n * <p>Email: {user.email}</p>\n * </div>\n * )}\n * </User>\n * );\n * }\n * ```\n */\nconst User: FC<UserProps> = ({children, fallback = null}): ReactElement => {\n const {user} = useAsgardeo();\n\n return (\n <BaseUser user={user} fallback={fallback}>\n {children}\n </BaseUser>\n );\n};\n\nUser.displayName = 'User';\n\nexport default User;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {Organization as IOrganization} from '@asgardeo/browser';\nimport {FC, ReactElement, ReactNode} from 'react';\n\n/**\n * Props for the BaseOrganization component.\n */\nexport interface BaseOrganizationProps {\n /**\n * Render prop that takes the organization object and returns a ReactNode.\n * @param organization - The organization object from Asgardeo.\n * @returns A ReactNode to render.\n */\n children: (organization: IOrganization | null) => ReactNode;\n\n /**\n * Optional element to render when no organization is provided.\n */\n fallback?: ReactNode;\n\n /**\n * The organization object to display. If not provided, the component will render the fallback.\n */\n organization: IOrganization | null;\n}\n\n/**\n * Base Organization component that provides the core functionality for displaying organization information.\n * This component takes an organization object as a prop and uses render props to expose it.\n *\n * @remarks This is the base component that can be used in any context where you have\n * an organization object available. For React applications, use the Organization component which\n * automatically retrieves the current organization from Organization context.\n *\n * @example\n * ```tsx\n * import { BaseOrganization } from '@asgardeo/auth-react';\n *\n * const MyComponent = ({ organization }) => {\n * return (\n * <BaseOrganization organization={organization} fallback={<p>No organization data</p>}>\n * {(org) => (\n * <div>\n * <h1>Organization: {org.name}</h1>\n * <p>ID: {org.id}</p>\n * </div>\n * )}\n * </BaseOrganization>\n * );\n * }\n * ```\n */\nconst BaseOrganization: FC<BaseOrganizationProps> = ({children, fallback = null, organization}): ReactElement => {\n if (!organization) {\n return <>{fallback}</>;\n }\n\n return <>{children(organization)}</>;\n};\n\nBaseOrganization.displayName = 'BaseOrganization';\n\nexport default BaseOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {Organization as IOrganization} from '@asgardeo/browser';\nimport {FC, ReactElement, ReactNode} from 'react';\nimport BaseOrganization, {BaseOrganizationProps} from './BaseOrganization';\nimport useOrganization from '../../../contexts/Organization/useOrganization';\n\n/**\n * Props for the Organization component.\n * Extends BaseOrganizationProps but makes the organization prop optional since it will be obtained from useOrganization\n */\nexport interface OrganizationProps extends Omit<BaseOrganizationProps, 'organization'> {\n /**\n * Render prop that takes the organization object and returns a ReactNode.\n * @param organization - The current organization object from Organization context.\n * @returns A ReactNode to render.\n */\n children: (organization: IOrganization | null) => ReactNode;\n\n /**\n * Optional element to render when no organization is selected.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that uses render props to expose the current organization object.\n * This component automatically retrieves the current organization from Organization context.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example\n * ```tsx\n * import { Organization } from '@asgardeo/auth-react';\n *\n * const App = () => {\n * return (\n * <Organization fallback={<p>No organization selected</p>}>\n * {(organization) => (\n * <div>\n * <h1>Current Organization: {organization.name}!</h1>\n * <p>ID: {organization.id}</p>\n * <p>Role: {organization.role}</p>\n * {organization.memberCount && (\n * <p>Members: {organization.memberCount}</p>\n * )}\n * </div>\n * )}\n * </Organization>\n * );\n * }\n * ```\n */\nconst Organization: FC<OrganizationProps> = ({children, fallback = null}): ReactElement => {\n const {currentOrganization} = useOrganization();\n\n return (\n <BaseOrganization organization={currentOrganization} fallback={fallback}>\n {children}\n </BaseOrganization>\n );\n};\n\nOrganization.displayName = 'Organization';\n\nexport default Organization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User, withVendorCSSClassPrefix, WellKnownSchemaIds} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {CSSProperties, FC, ReactElement, useMemo, useState, useCallback, useRef} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport getMappedUserProfileValue from '../../../utils/getMappedUserProfileValue';\nimport {Avatar} from '../../primitives/Avatar/Avatar';\nimport Button from '../../primitives/Button/Button';\nimport Checkbox from '../../primitives/Checkbox/Checkbox';\nimport DatePicker from '../../primitives/DatePicker/DatePicker';\nimport {Dialog, DialogContent, DialogHeading} from '../../primitives/Popover/Popover';\nimport TextField from '../../primitives/TextField/TextField';\nimport MultiInput from '../../primitives/MultiInput/MultiInput';\nimport Card from '../../primitives/Card/Card';\n\ninterface ExtendedFlatSchema {\n path?: string;\n schemaId?: string;\n}\n\ninterface Schema extends ExtendedFlatSchema {\n caseExact?: boolean;\n description?: string;\n displayName?: string;\n displayOrder?: string;\n multiValued?: boolean;\n mutability?: string;\n name?: string;\n required?: boolean;\n returned?: string;\n subAttributes?: Schema[];\n type?: string;\n uniqueness?: string;\n value?: any;\n}\n\nexport interface BaseUserProfileProps {\n attributeMapping?: {\n [key: string]: string | string[] | undefined;\n firstName?: string | string[];\n lastName?: string | string[];\n picture?: string | string[];\n username?: string | string[];\n };\n cancelButtonText?: string;\n cardLayout?: boolean;\n className?: string;\n editable?: boolean;\n fallback?: ReactElement;\n flattenedProfile?: User;\n mode?: 'inline' | 'popup';\n onChange?: (field: string, value: any) => void;\n onOpenChange?: (open: boolean) => void;\n onSubmit?: (data: any) => void;\n onUpdate?: (payload: any) => Promise<void>;\n open?: boolean;\n profile?: User;\n saveButtonText?: string;\n schemas?: Schema[];\n title?: string;\n}\n\n// Fields to skip based on schema.name\nconst fieldsToSkip: string[] = [\n 'roles.default',\n 'active',\n 'groups',\n 'accountLocked',\n 'accountDisabled',\n 'oneTimePassword',\n 'userSourceId',\n 'idpType',\n 'localCredentialExists',\n 'active',\n 'ResourceType',\n 'ExternalID',\n 'MetaData',\n 'verifiedMobileNumbers',\n 'verifiedEmailAddresses',\n 'phoneNumbers.mobile',\n 'emailAddresses',\n];\n\n// Fields that should be readonly\nconst readonlyFields: string[] = ['username', 'userName', 'user_name'];\n\nconst BaseUserProfile: FC<BaseUserProfileProps> = ({\n fallback = null,\n className = '',\n cardLayout = true,\n profile,\n schemas = [],\n flattenedProfile,\n mode = 'inline',\n title = 'User Profile',\n attributeMapping = {},\n editable = true,\n onChange,\n onOpenChange,\n onSubmit,\n onUpdate,\n open = false,\n saveButtonText = 'Save Changes',\n cancelButtonText = 'Cancel',\n}): ReactElement => {\n const {theme} = useTheme();\n const [editedUser, setEditedUser] = useState(flattenedProfile || profile);\n const [editingFields, setEditingFields] = useState<Record<string, boolean>>({});\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const PencilIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z\" />\n </svg>\n );\n\n const toggleFieldEdit = useCallback((fieldName: string) => {\n setEditingFields(prev => ({\n ...prev,\n [fieldName]: !prev[fieldName],\n }));\n }, []);\n\n const getFieldPlaceholder = useCallback((schema: Schema): string => {\n const {type, displayName, description, name} = schema;\n\n // Use the best available label for the field\n const fieldLabel = displayName || description || name || 'value';\n\n // Generate appropriate placeholder based on field type\n switch (type) {\n case 'DATE_TIME':\n return `Enter your ${fieldLabel.toLowerCase()}`;\n case 'BOOLEAN':\n return `Select ${fieldLabel.toLowerCase()}`;\n case 'COMPLEX':\n return `Enter ${fieldLabel.toLowerCase()} details`;\n default:\n // For STRING and other types, use generic placeholder\n return `Enter your ${fieldLabel.toLowerCase()}`;\n }\n }, []);\n\n const ObjectDisplay: FC<{data: unknown}> = ({data}) => {\n if (!data || typeof data !== 'object') return null;\n\n return (\n <table style={{width: '100%', borderCollapse: 'collapse'}}>\n <tbody>\n {Object.entries(data).map(([key, value]) => (\n <tr key={key} style={{borderBottom: `1px solid ${theme.vars.colors.border}`}}>\n <td style={{padding: theme.vars.spacing.unit, verticalAlign: 'top'}}>\n <strong>{formatLabel(key)}:</strong>\n </td>\n <td style={{padding: theme.vars.spacing.unit, verticalAlign: 'top'}}>\n {typeof value === 'object' ? <ObjectDisplay data={value} /> : String(value)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n };\n\n function set(obj: Record<string, any>, path: string, value: any): void {\n const keys = path.split('.');\n let current = obj;\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n\n // If last key, set the value\n if (i === keys.length - 1) {\n current[key] = value;\n } else {\n // If the next level does not exist or is not an object, create an object\n if (!current[key] || typeof current[key] !== 'object') {\n current[key] = {};\n }\n current = current[key];\n }\n }\n }\n\n const handleFieldSave = useCallback(\n (schema: Schema): void => {\n if (!onUpdate || !schema.name) return;\n\n const fieldName: string = schema.name;\n let fieldValue: any =\n editedUser && fieldName && editedUser[fieldName] !== undefined\n ? editedUser[fieldName]\n : flattenedProfile && flattenedProfile[fieldName] !== undefined\n ? flattenedProfile[fieldName]\n : '';\n\n // Filter out empty values for arrays when saving\n if (Array.isArray(fieldValue)) {\n fieldValue = fieldValue.filter(v => v !== undefined && v !== null && v !== '');\n }\n\n let payload: Record<string, any> = {};\n\n // SCIM Patch Operation Logic:\n // - Fields from core schema (urn:ietf:params:scim:schemas:core:2.0:User)\n // should be sent directly: {\"name\":{\"givenName\":\"John\"}}\n // - Fields from extension schemas (like urn:scim:wso2:schema)\n // should be nested under the schema namespace: {\"urn:scim:wso2:schema\":{\"country\":\"Sri Lanka\"}}\n if (schema.schemaId && schema.schemaId !== WellKnownSchemaIds.User) {\n // For non-core schemas, nest the field under the schema namespace\n payload = {\n [schema.schemaId]: {\n [fieldName]: fieldValue,\n },\n };\n } else {\n // For core schema or fields without schemaId, use the field path directly\n // This handles complex paths like \"name.givenName\" correctly\n set(payload, fieldName, fieldValue);\n }\n\n onUpdate(payload);\n // Exit edit mode for this field after save\n toggleFieldEdit(fieldName);\n },\n [editedUser, flattenedProfile, onUpdate, toggleFieldEdit],\n );\n\n const handleFieldCancel = useCallback(\n (fieldName: string) => {\n const currentUser = flattenedProfile || profile;\n setEditedUser(prev => ({\n ...prev,\n [fieldName]: currentUser[fieldName],\n }));\n toggleFieldEdit(fieldName);\n },\n [flattenedProfile, profile, toggleFieldEdit],\n );\n\n const formatLabel = useCallback(\n (key: string): string =>\n key\n .split(/(?=[A-Z])|_/)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' '),\n [],\n );\n\n const styles = useStyles();\n\n const defaultAttributeMappings = {\n picture: ['profile', 'profileUrl', 'picture', 'URL'],\n firstName: ['name.givenName', 'given_name'],\n lastName: ['name.familyName', 'family_name'],\n email: ['emails'],\n username: ['userName', 'username', 'user_name'],\n };\n\n const mergedMappings = {...defaultAttributeMappings, ...attributeMapping};\n\n // Combines label and value/field rendering for both view and edit modes\n const renderSchemaField = (\n schema: Schema,\n isEditing: boolean,\n onEditValue?: (value: any) => void,\n onStartEdit?: () => void,\n ): ReactElement | null => {\n if (!schema) return null;\n const {value, displayName, description, name, type, required, mutability, subAttributes, multiValued} = schema;\n const label = displayName || description || name || '';\n\n // If complex or subAttributes, fallback to original renderSchemaValue\n if (subAttributes && Array.isArray(subAttributes)) {\n return (\n <>\n {subAttributes.map((subAttr, index) => (\n <div key={index} style={styles.field}>\n <span style={styles.label}>{subAttr.displayName || subAttr.description || ''}</span>\n <div style={styles.value}>\n {Array.isArray(subAttr.value)\n ? subAttr.value\n .map(item => (typeof item === 'object' ? JSON.stringify(item) : String(item)))\n .join(', ')\n : typeof subAttr.value === 'object'\n ? JSON.stringify(subAttr.value)\n : String(subAttr.value)}\n </div>\n </div>\n ))}\n </>\n );\n }\n\n // Handle multi-valued fields (either array values or multiValued property)\n if (Array.isArray(value) || multiValued) {\n const hasValues = Array.isArray(value) ? value.length > 0 : value !== undefined && value !== null && value !== '';\n const isEditable = editable && mutability !== 'READ_ONLY' && !readonlyFields.includes(name || '');\n\n // If editing, show multi-valued input\n if (isEditing && onEditValue && isEditable) {\n // Use editedUser value if available, then flattenedProfile, then schema value\n const currentValue =\n editedUser && name && editedUser[name] !== undefined\n ? editedUser[name]\n : flattenedProfile && name && flattenedProfile[name] !== undefined\n ? flattenedProfile[name]\n : value;\n\n let fieldValues: string[];\n if (Array.isArray(currentValue)) {\n fieldValues = currentValue.map(String);\n } else if (currentValue !== undefined && currentValue !== null && currentValue !== '') {\n fieldValues = [String(currentValue)];\n } else {\n fieldValues = [];\n }\n\n return (\n <>\n <span style={styles.label}>{label}</span>\n <div style={styles.value}>\n <MultiInput\n values={fieldValues}\n onChange={newValues => {\n // Don't filter out empty values during editing - only when saving\n // This allows users to type and keeps empty fields for adding new values\n if (multiValued || Array.isArray(currentValue)) {\n onEditValue(newValues);\n } else {\n // Single value field, just take the first value (including empty for typing)\n onEditValue(newValues[0] || '');\n }\n }}\n placeholder={getFieldPlaceholder(schema)}\n fieldType={type as 'STRING' | 'DATE_TIME' | 'BOOLEAN'}\n type={type === 'DATE_TIME' ? 'date' : type === 'STRING' ? 'text' : 'text'}\n required={required}\n style={{\n marginBottom: 0,\n }}\n />\n </div>\n </>\n );\n }\n\n // View mode for multi-valued fields\n let displayValue: string;\n if (hasValues) {\n if (Array.isArray(value)) {\n displayValue = value.map(item => (typeof item === 'object' ? JSON.stringify(item) : String(item))).join(', ');\n } else {\n displayValue = String(value);\n }\n } else if (isEditable) {\n displayValue = getFieldPlaceholder(schema);\n } else {\n displayValue = '-';\n }\n\n return (\n <>\n <span style={styles.label}>{label}</span>\n <div style={{...styles.value, fontStyle: hasValues ? 'normal' : 'italic', opacity: hasValues ? 1 : 0.7}}>\n {!hasValues && isEditable && onStartEdit ? (\n <Button\n onClick={onStartEdit}\n variant=\"text\"\n color=\"secondary\"\n size=\"small\"\n title=\"Click to edit\"\n style={{\n fontStyle: 'italic',\n textDecoration: 'underline',\n opacity: 0.7,\n padding: 0,\n minHeight: 'auto',\n }}\n >\n {displayValue}\n </Button>\n ) : (\n displayValue\n )}\n </div>\n </>\n );\n }\n if (type === 'COMPLEX' && typeof value === 'object') {\n return <ObjectDisplay data={value} />;\n }\n // If editing, show field instead of value\n if (isEditing && onEditValue && mutability !== 'READ_ONLY' && !readonlyFields.includes(name || '')) {\n // Use editedUser value if available, then flattenedProfile, then schema value\n const fieldValue =\n editedUser && name && editedUser[name] !== undefined\n ? editedUser[name]\n : flattenedProfile && name && flattenedProfile[name] !== undefined\n ? flattenedProfile[name]\n : value || '';\n\n const commonProps = {\n label: undefined, // Don't show label in field, we render it outside\n required,\n value: fieldValue,\n onChange: (e: any) => onEditValue(e.target ? e.target.value : e),\n placeholder: getFieldPlaceholder(schema),\n style: {\n marginBottom: 0,\n },\n };\n let field: ReactElement;\n switch (type) {\n case 'STRING':\n field = <TextField {...commonProps} />;\n break;\n case 'DATE_TIME':\n field = <DatePicker {...commonProps} />;\n break;\n case 'BOOLEAN':\n field = <Checkbox {...commonProps} checked={!!fieldValue} onChange={e => onEditValue(e.target.checked)} />;\n break;\n case 'COMPLEX':\n // For complex types, use a textarea\n field = (\n <textarea\n value={fieldValue}\n onChange={e => onEditValue(e.target.value)}\n placeholder={getFieldPlaceholder(schema)}\n required={required}\n style={{\n ...commonProps.style,\n minHeight: '60px',\n width: '100%',\n padding: '8px',\n border: `1px solid ${theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.small,\n resize: 'vertical',\n }}\n />\n );\n break;\n default:\n field = <TextField {...commonProps} />;\n }\n return (\n <>\n <span style={styles.label}>{label}</span>\n <div style={styles.value}>{field}</div>\n </>\n );\n }\n // Default: view mode\n const hasValue = value !== undefined && value !== null && value !== '';\n const isEditable = editable && mutability !== 'READ_ONLY' && !readonlyFields.includes(name || '');\n\n let displayValue: string;\n if (hasValue) {\n displayValue = String(value);\n } else if (isEditable) {\n displayValue = getFieldPlaceholder(schema);\n } else {\n displayValue = '-';\n }\n\n return (\n <>\n <span style={styles.label}>{label}</span>\n <div style={{...styles.value, fontStyle: hasValue ? 'normal' : 'italic', opacity: hasValue ? 1 : 0.7}}>\n {!hasValue && isEditable && onStartEdit ? (\n <Button\n onClick={onStartEdit}\n variant=\"text\"\n color=\"secondary\"\n size=\"small\"\n title=\"Click to edit\"\n style={{\n fontStyle: 'italic',\n textDecoration: 'underline',\n opacity: 0.7,\n padding: 0,\n minHeight: 'auto',\n }}\n >\n {displayValue}\n </Button>\n ) : (\n displayValue\n )}\n </div>\n </>\n );\n };\n\n const renderUserInfo = (schema: Schema) => {\n if (!schema || !schema.name) return null;\n\n // Skip fields with undefined or empty values unless editing or editable\n const hasValue = schema.value !== undefined && schema.value !== '' && schema.value !== null;\n const isFieldEditing = editingFields[schema.name];\n const isReadonlyField = readonlyFields.includes(schema.name);\n\n // Show field if: has value, currently editing, or is editable and READ_WRITE\n const shouldShow = hasValue || isFieldEditing || (editable && schema.mutability === 'READ_WRITE');\n\n if (!shouldShow) {\n return null;\n }\n\n const fieldStyle = {\n ...styles.field,\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n };\n\n return (\n <div style={fieldStyle}>\n <div style={{flex: 1, display: 'flex', alignItems: 'center', gap: theme.vars.spacing.unit}}>\n {renderSchemaField(\n schema,\n isFieldEditing,\n value => {\n const tempEditedUser = {...editedUser};\n tempEditedUser[schema.name!] = value;\n setEditedUser(tempEditedUser);\n },\n () => toggleFieldEdit(schema.name!),\n )}\n </div>\n {editable && schema.mutability !== 'READ_ONLY' && !isReadonlyField && (\n <div\n style={{\n display: 'flex',\n gap: `calc(${theme.vars.spacing.unit} / 2)`,\n alignItems: 'center',\n marginLeft: theme.vars.spacing.unit,\n }}\n >\n {isFieldEditing && (\n <>\n <Button size=\"small\" color=\"primary\" variant=\"solid\" onClick={() => handleFieldSave(schema)}>\n Save\n </Button>\n <Button size=\"small\" color=\"secondary\" variant=\"solid\" onClick={() => handleFieldCancel(schema.name!)}>\n Cancel\n </Button>\n </>\n )}\n {!isFieldEditing && hasValue && (\n <Button\n size=\"small\"\n color=\"tertiary\"\n variant=\"text\"\n onClick={() => toggleFieldEdit(schema.name!)}\n title=\"Edit\"\n style={{\n padding: `calc(${theme.vars.spacing.unit} / 2)`,\n }}\n >\n <PencilIcon />\n </Button>\n )}\n </div>\n )}\n </div>\n );\n };\n\n const getDisplayName = () => {\n const firstName = getMappedUserProfileValue('firstName', mergedMappings, profile);\n const lastName = getMappedUserProfileValue('lastName', mergedMappings, profile);\n\n if (firstName && lastName) {\n return `${firstName} ${lastName}`;\n }\n\n return getMappedUserProfileValue('username', mergedMappings, profile) || '';\n };\n\n if (!profile && !flattenedProfile) {\n return fallback;\n }\n\n const containerStyle = {\n ...styles.root,\n ...(cardLayout ? styles.card : {}),\n };\n\n const currentUser = flattenedProfile || profile;\n const avatarAttributes = ['picture'];\n const excludedProps = avatarAttributes.map(attr => mergedMappings[attr] || attr);\n\n // Function to render profile fields when schemas are not available\n const renderProfileWithoutSchemas = () => {\n if (!currentUser) return null;\n\n const profileEntries = Object.entries(currentUser)\n .filter(([key, value]) => {\n // Skip fields that are in the fieldsToSkip array\n if (fieldsToSkip.includes(key)) return false;\n // Skip empty values\n return value !== undefined && value !== '' && value !== null;\n })\n .sort(([a], [b]) => a.localeCompare(b)); // Sort alphabetically\n\n return (\n <>\n {profileEntries.map(([key, value]) => (\n <div key={key} style={styles.field}>\n <span style={styles.label}>{formatLabel(key)}</span>\n <div style={styles.value}>{typeof value === 'object' ? JSON.stringify(value, null, 2) : String(value)}</div>\n </div>\n ))}\n </>\n );\n };\n\n const profileContent = (\n <Card style={containerStyle} className={clsx(withVendorCSSClassPrefix('user-profile'), className)}>\n <div style={styles.header}>\n <Avatar\n imageUrl={getMappedUserProfileValue('picture', mergedMappings, currentUser)}\n name={getDisplayName()}\n size={80}\n alt={`${getDisplayName()}'s avatar`}\n />\n </div>\n <div style={styles.infoContainer}>\n {schemas && schemas.length > 0\n ? // Render with schemas when available\n schemas\n .filter(schema => {\n // Skip fields that are in the fieldsToSkip array\n if (fieldsToSkip.includes(schema.name)) return false;\n\n // For non-editable mode, only show fields with values\n if (!editable) {\n const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : undefined;\n return value !== undefined && value !== '' && value !== null;\n }\n\n return true;\n })\n .sort((a, b) => {\n const orderA = a.displayOrder ? parseInt(a.displayOrder) : 999;\n const orderB = b.displayOrder ? parseInt(b.displayOrder) : 999;\n return orderA - orderB;\n })\n .map((schema, index) => {\n // Get the value from flattenedProfile\n const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : undefined;\n const schemaWithValue = {\n ...schema,\n value,\n };\n\n return <div key={schema.name || index}>{renderUserInfo(schemaWithValue)}</div>;\n })\n : // Fallback: render profile fields directly when schemas are not available\n renderProfileWithoutSchemas()}\n </div>\n </Card>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={{padding: `calc(${theme.vars.spacing.unit} * 2)`}}>{profileContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return profileContent;\n};\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n root: {\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n minWidth: '600px',\n margin: '0 auto',\n } as CSSProperties,\n card: {\n background: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.large,\n } as CSSProperties,\n header: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} * 1.5)`,\n marginBottom: `calc(${theme.vars.spacing.unit} * 1.5)`,\n } as CSSProperties,\n profileInfo: {\n flex: 1,\n } as CSSProperties,\n name: {\n fontSize: '1.5rem',\n fontWeight: 600,\n margin: '0',\n color: theme.vars.colors.text.primary,\n } as CSSProperties,\n infoContainer: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: theme.vars.spacing.unit,\n } as CSSProperties,\n field: {\n display: 'flex',\n alignItems: 'flex-start',\n padding: `calc(${theme.vars.spacing.unit} / 2) 0`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n minHeight: '28px',\n } as CSSProperties,\n lastField: {\n borderBottom: 'none',\n } as CSSProperties,\n label: {\n fontSize: '0.875rem',\n fontWeight: 500,\n color: theme.vars.colors.text.secondary,\n width: '120px',\n flexShrink: 0,\n lineHeight: '28px',\n } as CSSProperties,\n value: {\n color: theme.vars.colors.text.primary,\n flex: 1,\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n overflow: 'hidden',\n minHeight: '28px',\n '& input': {\n height: '32px',\n margin: 0,\n },\n lineHeight: '28px',\n wordBreak: 'break-word' as const,\n '& table': {\n backgroundColor: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.medium,\n whiteSpace: 'normal',\n },\n '& td': {\n borderColor: theme.vars.colors.border,\n },\n } as CSSProperties,\n popup: {\n padding: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\nexport default BaseUserProfile;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User, get} from '@asgardeo/browser';\n\n/**\n * Retrieves a user profile value based on attribute mapping configuration.\n *\n * This function allows flexible mapping of component attribute names to actual\n * user profile field paths. It supports both simple string mappings and arrays\n * of potential field paths for fallback scenarios.\n *\n * @param key - The logical attribute name to retrieve (e.g., 'firstName', 'email')\n * @param mappings - Object mapping logical names to user profile field paths\n * @param user - The user object to extract values from\n * @returns The mapped value from the user profile, or undefined if not found\n *\n * @example\n * ```typescript\n * const mappings = {\n * firstName: 'name.givenName',\n * email: 'emails[0]',\n * picture: ['profileUrl', 'profile', 'avatar'] // fallback options\n * };\n *\n * const user = {\n * name: { givenName: 'John' },\n * emails: ['john@example.com'],\n * profileUrl: 'https://example.com/avatar.jpg'\n * };\n *\n * getMappedUserProfileValue('firstName', mappings, user); // 'John'\n * getMappedUserProfileValue('email', mappings, user); // 'john@example.com'\n * getMappedUserProfileValue('picture', mappings, user); // 'https://example.com/avatar.jpg'\n * ```\n */\nconst getMappedUserProfileValue = (key: string, mappings: Record<string, string | string[]>, user: User): any => {\n if (!key || !mappings || !user) {\n return undefined;\n }\n\n const mapping = mappings[key];\n\n if (!mapping) {\n // If no mapping defined, try to get the value directly from the user object\n return get(user, key);\n }\n\n // If mapping is an array, try each path until we find a value\n if (Array.isArray(mapping)) {\n for (const path of mapping) {\n const value = get(user, path);\n if (value !== undefined && value !== null && value !== '') {\n return value;\n }\n }\n return undefined;\n }\n\n // For single string mapping, get the value directly\n return get(user, mapping);\n};\n\nexport default getMappedUserProfileValue;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {CSSProperties, FC, JSX, useMemo} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\n\nexport interface AvatarProps {\n /**\n * Alternative text for the avatar image\n */\n alt?: string;\n /**\n * Background generation strategy\n * - 'random': Generate background color based on ASCII values of the name\n * - 'none': Use default theme background\n * - string: Use custom background color\n * @default 'random'\n */\n background?: 'random' | 'none' | string;\n /**\n * Optional className for the avatar\n */\n className?: string;\n /**\n * The URL of the avatar image\n */\n imageUrl?: string;\n /**\n * The name to use for generating initials when no image is provided\n */\n name?: string;\n /**\n * The size of the avatar in pixels\n */\n size?: number;\n /**\n * The variant of the avatar shape\n * @default 'circular'\n */\n variant?: 'circular' | 'square';\n}\n\nconst useStyles = ({\n size,\n variant,\n backgroundColor,\n}: {\n size: number;\n variant: 'circular' | 'square';\n backgroundColor?: string;\n}): {\n avatar: CSSProperties;\n image: CSSProperties;\n} => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n avatar: {\n alignItems: 'center',\n background: backgroundColor || theme.vars.colors.background.surface,\n border: backgroundColor ? 'none' : `1px solid ${theme.vars.colors.border}`,\n borderRadius: variant === 'circular' ? '50%' : '8px',\n color: backgroundColor ? '#ffffff' : theme.vars.colors.text.primary,\n display: 'flex',\n fontSize: `${size * 0.4}px`,\n fontWeight: 600,\n height: `${size}px`,\n justifyContent: 'center',\n overflow: 'hidden',\n textShadow: backgroundColor ? '0 1px 2px rgba(0, 0, 0, 0.1)' : 'none',\n width: `${size}px`,\n } as CSSProperties,\n image: {\n height: '100%',\n objectFit: 'cover',\n width: '100%',\n } as CSSProperties,\n }),\n [size, theme, colorScheme, variant, backgroundColor],\n );\n};\n\nexport const Avatar: FC<AvatarProps> = ({\n alt = 'User avatar',\n background = 'random',\n className = '',\n imageUrl,\n name,\n size = 64,\n variant = 'circular',\n}): JSX.Element => {\n const generateBackgroundColor = (inputString: string): string => {\n const hash = inputString.split('').reduce((acc, char) => {\n const charCode = char.charCodeAt(0);\n return ((acc << 5) - acc + charCode) & 0xffffffff;\n }, 0);\n\n const seed = Math.abs(hash);\n\n const generateColor = (offset: number): string => {\n const hue1 = (seed + offset) % 360;\n const hue2 = (hue1 + 60 + (seed % 120)) % 360;\n\n const saturation = 70 + (seed % 20);\n const lightness1 = 55 + (seed % 15);\n const lightness2 = 60 + ((seed + offset) % 15);\n\n return `hsl(${hue1}, ${saturation}%, ${lightness1}%), hsl(${hue2}, ${saturation}%, ${lightness2}%)`;\n };\n\n const angle = 45 + (seed % 91);\n\n const colors = generateColor(seed);\n return `linear-gradient(${angle}deg, ${colors})`;\n };\n\n const backgroundColor = useMemo(() => {\n if (!name || imageUrl) {\n return undefined;\n }\n\n if (background === 'random') {\n return generateBackgroundColor(name);\n }\n\n if (background === 'none') {\n return undefined;\n }\n\n return background;\n }, [background, name, imageUrl]);\n\n const styles: {avatar: CSSProperties; image: CSSProperties} = useStyles({\n size,\n variant,\n backgroundColor,\n });\n\n const getInitials = (fullName: string): string =>\n fullName\n .split(' ')\n .map((part: string) => part[0])\n .slice(0, 2)\n .join('')\n .toUpperCase();\n\n const renderContent = (): JSX.Element | string => {\n if (imageUrl) {\n return <img src={imageUrl} alt={alt} style={styles.image} />;\n }\n if (name) {\n return getInitials(name);\n }\n\n // Skeleton loading animation\n return (\n <div\n style={{\n width: '100%',\n height: '100%',\n background: 'linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)',\n backgroundSize: '200% 100%',\n animation: 'skeleton-loading 1.5s infinite',\n borderRadius: variant === 'circular' ? '50%' : '8px',\n }}\n />\n );\n };\n\n return (\n <div style={styles.avatar} className={clsx(withVendorCSSClassPrefix('avatar'), className)}>\n <style>\n {`\n @keyframes skeleton-loading {\n 0% {\n background-position: -200% 0;\n }\n 100% {\n background-position: 200% 0;\n }\n }\n `}\n </style>\n {renderContent()}\n </div>\n );\n};\n\nexport default Avatar;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport {\n useFloating,\n autoUpdate,\n offset,\n flip,\n shift,\n useClick,\n useDismiss,\n useRole,\n useInteractions,\n useMergeRefs,\n FloatingFocusManager,\n FloatingOverlay,\n FloatingPortal,\n useId,\n UseFloatingReturn,\n UseInteractionsReturn,\n} from '@floating-ui/react';\nimport clsx from 'clsx';\nimport React, {CSSProperties, useMemo} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Button from '../Button/Button';\nimport {X} from '../Icons';\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n overlay: {\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 9999,\n } as CSSProperties,\n content: {\n background: theme.colors.background.surface,\n borderRadius: theme.borderRadius.large,\n boxShadow: `0 2px 8px ${colorScheme === 'dark' ? 'rgba(0, 0, 0, 0.3)' : 'rgba(0, 0, 0, 0.15)'}`,\n outline: 'none',\n maxWidth: '90vw',\n maxHeight: '90vh',\n overflowY: 'auto',\n zIndex: 10000,\n } as CSSProperties,\n dropdownContent: {\n background: theme.colors.background.surface,\n borderRadius: theme.borderRadius.large,\n boxShadow: `0 2px 8px ${colorScheme === 'dark' ? 'rgba(0, 0, 0, 0.3)' : 'rgba(0, 0, 0, 0.15)'}`,\n outline: 'none',\n maxWidth: '90vw',\n maxHeight: '90vh',\n overflowY: 'auto',\n zIndex: 10000,\n } as CSSProperties,\n header: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: `${theme.spacing.unit * 3}px ${theme.spacing.unit * 4.5}px`,\n borderBottom: `1px solid ${theme.colors.border}`,\n } as CSSProperties,\n headerTitle: {\n margin: 0,\n fontSize: '1.2rem',\n fontWeight: 600,\n color: theme.colors.text.primary,\n } as CSSProperties,\n contentBody: {\n padding: `${theme.spacing.unit * 2}px`,\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\n// Modal Dialog hook and components\ninterface DialogOptions {\n initialOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n open?: boolean;\n}\n\n// Return type for dialog hook\ninterface DialogHookReturn extends UseFloatingReturn, UseInteractionsReturn {\n descriptionId: string | undefined;\n labelId: string | undefined;\n open: boolean;\n setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setOpen: (open: boolean) => void;\n}\n\nexport function useDialog({\n initialOpen = false,\n open: controlledOpen,\n onOpenChange: setControlledOpen,\n}: DialogOptions = {}): DialogHookReturn {\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(initialOpen);\n const [labelId, setLabelId] = React.useState<string | undefined>();\n const [descriptionId, setDescriptionId] = React.useState<string | undefined>();\n\n const open = controlledOpen ?? uncontrolledOpen;\n const setOpen = setControlledOpen ?? setUncontrolledOpen;\n\n const data = useFloating({\n open,\n onOpenChange: setOpen,\n });\n\n const {context} = data;\n\n const click = useClick(context, {\n enabled: controlledOpen == null,\n });\n const dismiss = useDismiss(context, {outsidePressEvent: 'mousedown'});\n const role = useRole(context);\n\n const interactions = useInteractions([click, dismiss, role]);\n\n return React.useMemo(\n () => ({\n open,\n setOpen,\n ...interactions,\n ...data,\n labelId,\n descriptionId,\n setLabelId,\n setDescriptionId,\n }),\n [open, setOpen, interactions, data, labelId, descriptionId],\n );\n}\n\n// Dropdown Popover hook\ninterface PopoverOptions {\n initialOpen?: boolean;\n offset?: number;\n onOpenChange?: (open: boolean) => void;\n open?: boolean;\n placement?: 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';\n}\n\n// Return type for popover hook\ninterface PopoverHookReturn extends UseFloatingReturn, UseInteractionsReturn {\n descriptionId: string | undefined;\n labelId: string | undefined;\n open: boolean;\n setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setOpen: (open: boolean) => void;\n}\n\nexport function usePopover({\n initialOpen = false,\n open: controlledOpen,\n onOpenChange: setControlledOpen,\n placement = 'bottom',\n offset: offsetValue = 5,\n}: PopoverOptions = {}): PopoverHookReturn {\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(initialOpen);\n const [labelId, setLabelId] = React.useState<string | undefined>();\n const [descriptionId, setDescriptionId] = React.useState<string | undefined>();\n\n const open = controlledOpen ?? uncontrolledOpen;\n const setOpen = setControlledOpen ?? setUncontrolledOpen;\n\n const data = useFloating({\n open,\n onOpenChange: setOpen,\n middleware: [offset(offsetValue), flip(), shift()],\n whileElementsMounted: autoUpdate,\n placement,\n });\n\n const {context} = data;\n\n const click = useClick(context);\n const dismiss = useDismiss(context, {outsidePressEvent: 'mousedown'});\n const role = useRole(context);\n\n const interactions = useInteractions([click, dismiss, role]);\n\n return React.useMemo(\n () => ({\n open,\n setOpen,\n ...interactions,\n ...data,\n labelId,\n descriptionId,\n setLabelId,\n setDescriptionId,\n }),\n [open, setOpen, interactions, data, labelId, descriptionId],\n );\n}\n\n// Context types\ntype DialogContextType =\n | (DialogHookReturn & {\n setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;\n })\n | null;\n\ntype PopoverContextType =\n | (PopoverHookReturn & {\n setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;\n })\n | null;\n\nconst DialogContext = React.createContext<DialogContextType>(null);\nconst PopoverContext = React.createContext<PopoverContextType>(null);\n\nexport const useDialogContext = (): DialogHookReturn => {\n const context = React.useContext(DialogContext);\n if (context == null) {\n throw new Error('Dialog components must be wrapped in <Dialog />');\n }\n return context;\n};\n\nexport const usePopoverContext = (): PopoverHookReturn => {\n const context = React.useContext(PopoverContext);\n if (context == null) {\n throw new Error('Popover components must be wrapped in <Popover />');\n }\n return context;\n};\n\n// Dialog Components (Modal)\nexport function Dialog({children, ...options}: {children: React.ReactNode} & DialogOptions) {\n const dialog = useDialog(options);\n return <DialogContext.Provider value={dialog}>{children}</DialogContext.Provider>;\n}\n\ninterface DialogTriggerProps {\n asChild?: boolean;\n children: React.ReactNode;\n}\n\nexport const DialogTrigger = React.forwardRef<HTMLElement, React.HTMLProps<HTMLElement> & DialogTriggerProps>(\n ({children, asChild = false, ...props}, propRef) => {\n const context = useDialogContext();\n const childrenRef = (children as any).ref;\n const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef]);\n\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(\n children,\n context.getReferenceProps({\n ref,\n ...props,\n ...(children.props as any),\n 'data-state': context.open ? 'open' : 'closed',\n }),\n );\n }\n\n return (\n <button ref={ref} data-state={context.open ? 'open' : 'closed'} {...context.getReferenceProps(props)}>\n {children}\n </button>\n );\n },\n);\n\nexport const DialogContent = React.forwardRef<HTMLDivElement, React.HTMLProps<HTMLDivElement>>((props, propRef) => {\n const {context: floatingContext, ...context} = useDialogContext();\n const ref = useMergeRefs([context.refs.setFloating, propRef]);\n const styles = useStyles();\n\n if (!floatingContext.open) return null;\n\n return (\n <FloatingPortal>\n <FloatingOverlay className={withVendorCSSClassPrefix('popover-overlay')} style={styles.overlay} lockScroll>\n <FloatingFocusManager context={floatingContext}>\n <div\n ref={ref}\n style={styles.content}\n className={clsx(withVendorCSSClassPrefix('popover-content'), props.className)}\n aria-labelledby={context.labelId}\n aria-describedby={context.descriptionId}\n {...context.getFloatingProps(props)}\n >\n {props.children}\n </div>\n </FloatingFocusManager>\n </FloatingOverlay>\n </FloatingPortal>\n );\n});\n\n// Popover Components (Dropdown)\nexport function Popover({children, ...options}: {children: React.ReactNode} & PopoverOptions) {\n const popover = usePopover(options);\n return <PopoverContext.Provider value={popover}>{children}</PopoverContext.Provider>;\n}\n\ninterface PopoverTriggerProps {\n asChild?: boolean;\n children: React.ReactNode;\n}\n\nexport const PopoverTrigger = React.forwardRef<HTMLElement, React.HTMLProps<HTMLElement> & PopoverTriggerProps>(\n ({children, asChild = false, ...props}, propRef) => {\n const context = usePopoverContext();\n const childrenRef = (children as any).ref;\n const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef]);\n\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(\n children,\n context.getReferenceProps({\n ref,\n ...props,\n ...(children.props as any),\n 'data-state': context.open ? 'open' : 'closed',\n }),\n );\n }\n\n return (\n <button ref={ref} data-state={context.open ? 'open' : 'closed'} {...context.getReferenceProps(props)}>\n {children}\n </button>\n );\n },\n);\n\nexport const PopoverContent = React.forwardRef<HTMLDivElement, React.HTMLProps<HTMLDivElement>>((props, propRef) => {\n const {context: floatingContext, ...context} = usePopoverContext();\n const ref = useMergeRefs([context.refs.setFloating, propRef]);\n const styles = useStyles();\n\n if (!floatingContext.open) return null;\n\n return (\n <FloatingPortal>\n <FloatingFocusManager context={floatingContext}>\n <div\n ref={ref}\n style={{...styles.dropdownContent, ...context.floatingStyles}}\n className={clsx(withVendorCSSClassPrefix('popover-content'), props.className)}\n aria-labelledby={context.labelId}\n aria-describedby={context.descriptionId}\n {...context.getFloatingProps(props)}\n >\n {props.children}\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n );\n});\n\n// Shared components\nexport const PopoverHeading = React.forwardRef<HTMLHeadingElement, React.HTMLProps<HTMLHeadingElement>>(\n ({children, ...props}, ref) => {\n const context = usePopoverContext();\n const styles = useStyles();\n const id = useId();\n\n React.useLayoutEffect(() => {\n context.setLabelId(id);\n return () => context.setLabelId(undefined);\n }, [id, context.setLabelId]);\n\n return (\n <div style={styles.header}>\n <h2 {...props} ref={ref} id={id} style={styles.headerTitle}>\n {children}\n </h2>\n <Button color=\"tertiary\" variant=\"text\" size=\"small\" onClick={() => context.setOpen(false)} aria-label=\"Close\">\n <X width={16} height={16} />\n </Button>\n </div>\n );\n },\n);\n\nexport const DialogHeading = React.forwardRef<HTMLHeadingElement, React.HTMLProps<HTMLHeadingElement>>(\n ({children, ...props}, ref) => {\n const context = useDialogContext();\n const styles = useStyles();\n const id = useId();\n\n React.useLayoutEffect(() => {\n context.setLabelId(id);\n return () => context.setLabelId(undefined);\n }, [id, context.setLabelId]);\n\n return (\n <div style={styles.header}>\n <h2 {...props} ref={ref} id={id} style={styles.headerTitle}>\n {children}\n </h2>\n <Button color=\"tertiary\" variant=\"text\" size=\"small\" onClick={() => context.setOpen(false)} aria-label=\"Close\">\n <X width={16} height={16} />\n </Button>\n </div>\n );\n },\n);\n\nexport const PopoverDescription = React.forwardRef<HTMLParagraphElement, React.HTMLProps<HTMLParagraphElement>>(\n ({children, ...props}, ref) => {\n const context = usePopoverContext();\n const id = useId();\n\n React.useLayoutEffect(() => {\n context.setDescriptionId(id);\n return () => context.setDescriptionId(undefined);\n }, [id, context.setDescriptionId]);\n\n return (\n <p {...props} ref={ref} id={id}>\n {children}\n </p>\n );\n },\n);\n\nexport const DialogDescription = React.forwardRef<HTMLParagraphElement, React.HTMLProps<HTMLParagraphElement>>(\n ({children, ...props}, ref) => {\n const context = useDialogContext();\n const id = useId();\n\n React.useLayoutEffect(() => {\n context.setDescriptionId(id);\n return () => context.setDescriptionId(undefined);\n }, [id, context.setDescriptionId]);\n\n return (\n <p {...props} ref={ref} id={id}>\n {children}\n </p>\n );\n },\n);\n\nexport const PopoverClose = React.forwardRef<HTMLButtonElement, React.ButtonHTMLAttributes<HTMLButtonElement>>(\n (props, ref) => {\n const context = usePopoverContext();\n return <button type=\"button\" {...props} ref={ref} onClick={() => context.setOpen(false)} />;\n },\n);\n\nexport const DialogClose = React.forwardRef<HTMLButtonElement, React.ButtonHTMLAttributes<HTMLButtonElement>>(\n (props, ref) => {\n const context = useDialogContext();\n return <button type=\"button\" {...props} ref={ref} onClick={() => context.setOpen(false)} />;\n },\n);\n\n// Legacy API compatibility (for existing code)\ninterface LegacyPopoverProps {\n children: React.ReactNode;\n className?: string;\n isOpen: boolean;\n mode?: 'modal' | 'dropdown';\n offset?: number;\n onClose: () => void;\n placement?: 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';\n trigger?: HTMLElement | null;\n}\n\n// Legacy Header component for backward compatibility\nconst LegacyPopoverHeader: React.FC<{children?: React.ReactNode}> = ({children}) => {\n const styles = useStyles();\n\n return <div style={styles.header}>{children && <h3 style={styles.headerTitle}>{children}</h3>}</div>;\n};\n\n// Legacy Content component for backward compatibility\nconst LegacyPopoverContent: React.FC<{children: React.ReactNode}> = ({children}) => {\n const styles = useStyles();\n return <div style={styles.contentBody}>{children}</div>;\n};\n\n// Legacy component for backward compatibility\nexport const LegacyPopover: React.FC<LegacyPopoverProps> & {\n Content: typeof LegacyPopoverContent;\n Header: typeof LegacyPopoverHeader;\n} = ({isOpen, children, onClose, className = '', mode = 'modal', trigger, placement, offset}) => {\n if (mode === 'modal') {\n return (\n <Dialog open={isOpen} onOpenChange={onClose}>\n <DialogContent className={className}>{children}</DialogContent>\n </Dialog>\n );\n }\n\n return (\n <Popover open={isOpen} onOpenChange={onClose} placement={placement} offset={offset}>\n <PopoverContent className={className}>{children}</PopoverContent>\n </Popover>\n );\n};\n\nLegacyPopover.Header = LegacyPopoverHeader;\nLegacyPopover.Content = LegacyPopoverContent;\n\n// Export the legacy component as default for backward compatibility\nexport default LegacyPopover;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * LogOut icon component.\n */\nconst LogOut: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m16 17 5-5-5-5\" />\n <path d=\"M21 12H9\" />\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\" />\n </svg>\n);\n\nexport default LogOut;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * Plus (add) icon component.\n */\nconst Plus: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n);\n\nexport default Plus;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * User icon component.\n */\nconst User: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n);\n\nexport default User;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * X (close) icon component.\n */\nconst X: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n);\n\nexport default X;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, ReactNode, useCallback, useState, useMemo} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\nimport TextField from '../TextField/TextField';\nimport DatePicker from '../DatePicker/DatePicker';\nimport Checkbox from '../Checkbox/Checkbox';\nimport Button from '../Button/Button';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\nexport interface MultiInputProps {\n /**\n * Label text to display above the inputs\n */\n label?: string;\n /**\n * Error message to display below the inputs\n */\n error?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n /**\n * Helper text to display below the inputs\n */\n helperText?: string;\n /**\n * Placeholder text for input fields\n */\n placeholder?: string;\n /**\n * Array of values\n */\n values: string[];\n /**\n * Callback when values change\n */\n onChange: (values: string[]) => void;\n /**\n * Custom style object\n */\n style?: CSSProperties;\n /**\n * Input type\n */\n type?: 'text' | 'email' | 'tel' | 'url' | 'password' | 'date' | 'boolean';\n /**\n * Field type for different input components\n */\n fieldType?: 'STRING' | 'DATE_TIME' | 'BOOLEAN';\n /**\n * Icon to display at the start (left) of each input\n */\n startIcon?: ReactNode;\n /**\n * Icon to display at the end (right) of each input (in addition to add/remove buttons)\n */\n endIcon?: ReactNode;\n /**\n * Minimum number of fields to show (default: 1)\n */\n minFields?: number;\n /**\n * Maximum number of fields to allow (default: unlimited)\n */\n maxFields?: number;\n}\n\nconst useStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n () => ({\n container: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: `${theme.spacing.unit}px`,\n },\n inputRow: {\n display: 'flex',\n alignItems: 'center',\n gap: `${theme.spacing.unit}px`,\n position: 'relative' as const,\n },\n inputWrapper: {\n flex: 1,\n },\n plusIcon: {\n background: 'var(--asgardeo-color-secondary-main)',\n borderRadius: '50%',\n outline: '4px var(--asgardeo-color-secondary-main) auto',\n color: 'var(--asgardeo-color-secondary-contrastText)',\n },\n listContainer: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: `${theme.spacing.unit * 0}px`,\n },\n listItem: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: `${theme.spacing.unit}px ${theme.spacing.unit * 1.5}px`,\n backgroundColor: theme.colors.background.surface,\n borderRadius: theme.borderRadius.medium,\n fontSize: '1rem',\n color: theme.colors.text.primary,\n },\n removeButton: {\n padding: `${theme.spacing.unit / 2}px`,\n minWidth: 'auto',\n color: theme.colors.error.main,\n },\n }),\n [theme],\n );\n};\n\nconst MultiInput: FC<MultiInputProps> = ({\n label,\n error,\n required,\n className,\n disabled,\n helperText,\n placeholder = 'Enter value',\n values = [],\n onChange,\n style = {},\n type = 'text',\n fieldType = 'STRING',\n startIcon,\n endIcon,\n minFields = 1,\n maxFields,\n}) => {\n const styles = useStyles();\n\n const PlusIcon = ({style}) => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={style}\n >\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n );\n\n const BinIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14ZM10 11v6M14 11v6\" />\n </svg>\n );\n\n const handleAddValue = useCallback(\n (newValue: string) => {\n if (newValue.trim() !== '' && (!maxFields || values.length < maxFields)) {\n onChange([...values, newValue.trim()]);\n }\n },\n [values, onChange, maxFields],\n );\n\n const handleRemoveValue = useCallback(\n (index: number) => {\n if (values.length > minFields) {\n const updatedValues = values.filter((_, i) => i !== index);\n onChange(updatedValues);\n }\n },\n [values, onChange, minFields],\n );\n\n const renderInputField = useCallback(\n (\n value: string,\n onValueChange: (value: string) => void,\n attachedEndIcon?: ReactNode,\n onEndIconClick?: () => void,\n ) => {\n const handleInputChange = (e: any) => {\n const newValue = e.target ? e.target.value : e;\n onValueChange(newValue);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' && onEndIconClick) {\n e.preventDefault();\n onEndIconClick();\n }\n };\n\n const finalEndIcon = attachedEndIcon || endIcon;\n\n const commonProps = {\n value,\n onChange: handleInputChange,\n onKeyDown: handleKeyDown,\n placeholder,\n disabled,\n startIcon,\n endIcon: finalEndIcon,\n onEndIconClick,\n error,\n };\n\n switch (fieldType) {\n case 'DATE_TIME':\n return <DatePicker {...commonProps} />;\n case 'BOOLEAN':\n return (\n <Checkbox\n {...commonProps}\n checked={value === 'true' || Boolean(value)}\n onChange={(e: any) => onValueChange(e.target.checked ? 'true' : 'false')}\n />\n );\n default:\n return <TextField {...commonProps} type={type} />;\n }\n },\n [placeholder, disabled, startIcon, endIcon, error, fieldType, type],\n );\n\n const canAddMore = !maxFields || values.length < maxFields;\n const canRemove = values.length > minFields;\n\n // State for the current input value\n const [currentInputValue, setCurrentInputValue] = useState('');\n\n const handleInputSubmit = useCallback(() => {\n if (currentInputValue.trim() !== '') {\n handleAddValue(currentInputValue);\n setCurrentInputValue('');\n }\n }, [currentInputValue, handleAddValue]);\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={clsx(withVendorCSSClassPrefix('multi-input'), className)}\n style={style}\n >\n {label && (\n <InputLabel required={required} error={!!error}>\n {label}\n </InputLabel>\n )}\n <div style={styles.container}>\n {/* Input field at the top */}\n <div style={styles.inputRow}>\n <div style={styles.inputWrapper}>\n {renderInputField(\n currentInputValue,\n setCurrentInputValue,\n canAddMore ? <PlusIcon style={styles.plusIcon} /> : undefined,\n canAddMore ? handleInputSubmit : undefined,\n )}\n </div>\n </div>\n\n {/* List of added items */}\n {values.length > 0 && (\n <div style={styles.listContainer}>\n {values.map((value, index) => (\n <div key={index} style={styles.listItem}>\n <span>{value}</span>\n {canRemove && (\n <Button\n size=\"small\"\n color=\"secondary\"\n variant=\"text\"\n onClick={() => handleRemoveValue(index)}\n disabled={disabled}\n title=\"Remove value\"\n style={styles.removeButton}\n >\n <BinIcon />\n </Button>\n )}\n </div>\n ))}\n </div>\n )}\n </div>\n </FormControl>\n );\n};\n\nexport default MultiInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n User,\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n updateMeProfile as baseUpdateMeProfile,\n UpdateMeProfileConfig as BaseUpdateMeProfileConfig,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the updateMeProfile request (React-specific)\n */\nexport interface UpdateMeProfileConfig extends Omit<BaseUpdateMeProfileConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Updates the user profile information at the specified SCIM2 Me endpoint.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object with URL, payload and optional request config.\n * @returns A promise that resolves with the updated user profile information.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * await updateMeProfile({\n * url: \"https://api.asgardeo.io/t/<ORG>/scim2/Me\",\n * payload: { \"urn:scim:wso2:schema\": { mobileNumbers: [\"0777933830\"] } }\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * await updateMeProfile({\n * url: \"https://api.asgardeo.io/t/<ORG>/scim2/Me\",\n * payload: { \"urn:scim:wso2:schema\": { mobileNumbers: [\"0777933830\"] } },\n * fetcher: customFetchFunction\n * });\n * ```\n */\nconst updateMeProfile = async ({fetcher, ...requestConfig}: UpdateMeProfileConfig): Promise<User> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'PATCH',\n headers: config.headers as Record<string, string>,\n data: config.body ? JSON.parse(config.body as string) : undefined,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseUpdateMeProfile({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default updateMeProfile;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, ReactElement} from 'react';\nimport BaseUserProfile, {BaseUserProfileProps} from './BaseUserProfile';\nimport updateMeProfile from '../../../api/updateMeProfile';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useUser from '../../../contexts/User/useUser';\nimport {User} from '@asgardeo/browser';\n\n/**\n * Props for the UserProfile component.\n * Extends BaseUserProfileProps but makes the user prop optional since it will be obtained from useAsgardeo\n */\nexport type UserProfileProps = Omit<BaseUserProfileProps, 'user' | 'profile' | 'flattenedProfile' | 'schemas'>;\n\n/**\n * UserProfile component displays the authenticated user's profile information in a\n * structured and styled format. It shows user details such as display name, email,\n * username, and other available profile information from Asgardeo.\n *\n * This component is the React-specific implementation that uses the BaseUserProfile\n * and automatically retrieves the user data from Asgardeo context if not provided.\n *\n * @example\n * ```tsx\n * // Basic usage - will use user from Asgardeo context\n * <UserProfile />\n *\n * // With explicit user data\n * <UserProfile user={specificUser} />\n *\n * // With card layout and custom fallback\n * <UserProfile\n * cardLayout={true}\n * fallback={<div>Please sign in to view your profile</div>}\n * />\n * ```\n */\nconst UserProfile: FC<UserProfileProps> = ({...rest}: UserProfileProps): ReactElement => {\n const {baseUrl} = useAsgardeo();\n const {profile, flattenedProfile, schemas, onUpdateProfile} = useUser();\n\n const handleProfileUpdate = async (payload: any): Promise<void> => {\n const response: User = await updateMeProfile({baseUrl, payload});\n\n onUpdateProfile(response);\n };\n\n return (\n <BaseUserProfile\n profile={profile}\n flattenedProfile={flattenedProfile}\n schemas={schemas}\n onUpdate={handleProfileUpdate}\n {...rest}\n />\n );\n};\n\nexport default UserProfile;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport {\n useFloating,\n autoUpdate,\n offset,\n flip,\n shift,\n useClick,\n useDismiss,\n useRole,\n useInteractions,\n FloatingFocusManager,\n FloatingPortal,\n} from '@floating-ui/react';\nimport clsx from 'clsx';\nimport {CSSProperties, FC, ReactElement, ReactNode, useMemo, useRef, useState} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport getMappedUserProfileValue from '../../../utils/getMappedUserProfileValue';\nimport {Avatar} from '../../primitives/Avatar/Avatar';\nimport Button from '../../primitives/Button/Button';\nimport LogOut from '../../primitives/Icons/LogOut';\nimport User from '../../primitives/Icons/User';\nimport Typography from '../../primitives/Typography/Typography';\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n trigger: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} * 0.5)`,\n border: 'none',\n backgroundColor: 'none',\n cursor: 'pointer',\n borderRadius: theme.vars.borderRadius.medium,\n '&:hover': {\n backgroundColor: theme.vars.colors.background.surface,\n },\n } as CSSProperties,\n userName: {\n color: theme.vars.colors.text.primary,\n fontWeight: 500,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n maxWidth: '120px',\n } as CSSProperties,\n dropdownContent: {\n minWidth: '270px',\n maxWidth: '500px',\n backgroundColor: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.medium,\n boxShadow: theme.vars.shadows.medium,\n border: `1px solid ${theme.vars.colors.border}`,\n outline: 'none',\n zIndex: 1000,\n } as CSSProperties,\n dropdownMenu: {\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n } as CSSProperties,\n menuItem: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 2)`,\n width: '100%',\n color: theme.vars.colors.text.primary,\n textDecoration: 'none',\n border: 'none',\n backgroundColor: 'none',\n cursor: 'pointer',\n fontSize: '0.875rem',\n textAlign: 'left',\n borderRadius: theme.vars.borderRadius.medium,\n transition: 'background-color 0.15s ease-in-out',\n } as CSSProperties,\n menuItemAnchor: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 2)`,\n width: '100%',\n color: theme.vars.colors.text.primary,\n textDecoration: 'none',\n border: 'none',\n background: 'none',\n cursor: 'pointer',\n fontSize: '0.875rem',\n textAlign: 'left',\n borderRadius: theme.vars.borderRadius.medium,\n transition: 'background-color 0.15s ease-in-out',\n } as CSSProperties,\n divider: {\n margin: `calc(${theme.vars.spacing.unit} * 0.5) 0`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n } as CSSProperties,\n dropdownHeader: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} * 1.5)`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n } as CSSProperties,\n headerInfo: {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme.vars.spacing.unit} / 4)`,\n flex: 1,\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n } as CSSProperties,\n headerName: {\n color: theme.vars.colors.text.primary,\n fontSize: '1rem',\n fontWeight: 500,\n margin: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n } as CSSProperties,\n headerEmail: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n margin: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n } as CSSProperties,\n loadingContainer: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: '80px',\n gap: theme.vars.spacing.unit,\n } as CSSProperties,\n loadingText: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\ninterface MenuItem {\n href?: string;\n icon?: ReactNode;\n label: ReactNode;\n onClick?: () => void;\n}\n\nexport interface BaseUserDropdownProps {\n /**\n * Mapping of component attribute names to identity provider field names.\n * Allows customizing which user profile fields should be used for each attribute.\n */\n attributeMapping?: {\n [key: string]: string | string[] | undefined;\n firstName?: string | string[];\n lastName?: string | string[];\n picture?: string | string[];\n username?: string | string[];\n };\n /**\n * Optional size for the avatar\n */\n avatarSize?: number;\n /**\n * Optional className for the dropdown container.\n */\n className?: string;\n /**\n * Optional element to render when no user is signed in.\n */\n fallback?: ReactElement;\n /**\n * Whether the user data is currently loading\n */\n isLoading?: boolean;\n /**\n * Menu items to display in the dropdown\n */\n menuItems?: MenuItem[];\n /**\n * Callback function for \"Manage Profile\" action\n */\n onManageProfile?: () => void;\n /**\n * Callback function for \"Sign Out\" action\n */\n onSignOut?: () => void;\n /**\n * The HTML element ID where the portal should be mounted\n */\n portalId?: string;\n /**\n * Show dropdown header with user information\n */\n showDropdownHeader?: boolean;\n /**\n * Show user's display name next to avatar in the trigger button\n */\n showTriggerLabel?: boolean;\n /**\n * The user object containing profile information\n */\n user: any;\n}\n\n/**\n * BaseUserDropdown component displays a user avatar with a dropdown menu.\n * When clicked, it shows a popover with customizable menu items.\n * This component serves as the base for framework-specific implementations.\n */\nexport const BaseUserDropdown: FC<BaseUserDropdownProps> = ({\n fallback = null,\n className = '',\n user,\n isLoading = false,\n portalId = 'asgardeo-user-dropdown',\n menuItems = [],\n showTriggerLabel = false,\n avatarSize = 32,\n onManageProfile,\n onSignOut,\n attributeMapping = {},\n}): ReactElement => {\n const styles = useStyles();\n const [isOpen, setIsOpen] = useState(false);\n const [hoveredItemIndex, setHoveredItemIndex] = useState<number | null>(null);\n const {theme, colorScheme} = useTheme();\n\n const {refs, floatingStyles, context} = useFloating({\n open: isOpen,\n onOpenChange: setIsOpen,\n placement: 'bottom-end',\n middleware: [offset(5), flip({fallbackAxisSideDirection: 'end'}), shift({padding: 5})],\n whileElementsMounted: autoUpdate,\n });\n\n const click = useClick(context);\n const dismiss = useDismiss(context);\n const role = useRole(context);\n\n const {getReferenceProps, getFloatingProps} = useInteractions([click, dismiss, role]);\n\n const defaultAttributeMappings = {\n picture: ['profile', 'profileUrl', 'picture', 'URL'],\n firstName: ['name.givenName', 'given_name'],\n lastName: ['name.familyName', 'family_name'],\n email: ['emails'],\n username: ['userName', 'username', 'user_name'],\n };\n\n const mergedMappings = {...defaultAttributeMappings, ...attributeMapping};\n\n const getDisplayName = () => {\n const firstName = getMappedUserProfileValue('firstName', mergedMappings, user);\n const lastName = getMappedUserProfileValue('lastName', mergedMappings, user);\n\n if (firstName && lastName) {\n return `${firstName} ${lastName}`;\n }\n\n return getMappedUserProfileValue('username', mergedMappings, user) || '';\n };\n\n if (fallback && !user && !isLoading) {\n return fallback;\n }\n\n const handleMenuItemClick = (item: MenuItem) => {\n if (item.onClick) {\n item.onClick();\n }\n setIsOpen(false);\n };\n\n // Create default menu items\n const defaultMenuItems: MenuItem[] = [];\n\n if (onManageProfile) {\n defaultMenuItems.push({\n label: 'Manage Profile',\n onClick: onManageProfile,\n icon: <User width=\"16\" height=\"16\" />,\n });\n }\n\n if (onSignOut) {\n defaultMenuItems.push({\n label: 'Sign Out',\n onClick: onSignOut,\n icon: <LogOut width=\"16\" height=\"16\" />,\n });\n }\n\n // Merge custom menu items with default ones\n const allMenuItems = [...menuItems];\n if (defaultMenuItems.length > 0) {\n // Add divider before default items if there are custom items\n if (menuItems.length > 0) {\n allMenuItems.push({label: '', onClick: undefined}); // Divider placeholder\n }\n allMenuItems.push(...defaultMenuItems);\n }\n\n return (\n <div className={clsx(withVendorCSSClassPrefix('user-dropdown'), className)}>\n <Button\n ref={refs.setReference}\n className={withVendorCSSClassPrefix('user-dropdown__trigger')}\n style={styles.trigger}\n color=\"tertiary\"\n variant=\"text\"\n size=\"medium\"\n {...getReferenceProps()}\n >\n <Avatar\n imageUrl={getMappedUserProfileValue('picture', mergedMappings, user)}\n name={getDisplayName()}\n size={avatarSize}\n alt={`${getDisplayName()}'s avatar`}\n />\n {showTriggerLabel && (\n <Typography\n variant=\"body2\"\n className={withVendorCSSClassPrefix('user-dropdown__trigger-label')}\n style={styles.userName}\n >\n {getDisplayName()}\n </Typography>\n )}\n </Button>\n\n {isOpen && (\n <FloatingPortal id={portalId}>\n <FloatingFocusManager context={context} modal={false}>\n <div\n ref={refs.setFloating}\n className={withVendorCSSClassPrefix('user-dropdown__content')}\n style={{...floatingStyles, ...styles.dropdownContent}}\n {...getFloatingProps()}\n >\n <div className={withVendorCSSClassPrefix('user-dropdown__header')} style={styles.dropdownHeader}>\n <Avatar\n imageUrl={getMappedUserProfileValue('picture', mergedMappings, user)}\n name={getDisplayName()}\n size={avatarSize * 1.25}\n alt={`${getDisplayName()}'s avatar`}\n />\n <div className={withVendorCSSClassPrefix('user-dropdown__header-info')} style={styles.headerInfo}>\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('user-dropdown__header-name')}\n variant=\"body1\"\n fontWeight=\"medium\"\n >\n {getDisplayName()}\n </Typography>\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('user-dropdown__header-email')}\n variant=\"caption\"\n color=\"secondary\"\n >\n {getMappedUserProfileValue('username', mergedMappings, user) ||\n getMappedUserProfileValue('email', mergedMappings, user)}\n </Typography>\n </div>\n </div>\n <div className={withVendorCSSClassPrefix('user-dropdown__menu')} style={styles.dropdownMenu}>\n {allMenuItems.map((item, index) => (\n <div key={index}>\n {item.label === '' ? (\n // Render divider for empty label placeholder\n <div className={withVendorCSSClassPrefix('user-dropdown__menu-divider')} style={styles.divider} />\n ) : item.href ? (\n <a\n href={item.href}\n style={{\n ...styles.menuItemAnchor,\n backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : 'transparent',\n }}\n className={withVendorCSSClassPrefix('user-dropdown__menu-item')}\n onMouseEnter={() => setHoveredItemIndex(index)}\n onMouseLeave={() => setHoveredItemIndex(null)}\n onFocus={() => setHoveredItemIndex(index)}\n onBlur={() => setHoveredItemIndex(null)}\n >\n {item.icon}\n <span>{item.label}</span>\n </a>\n ) : (\n <Button\n onClick={() => handleMenuItemClick(item)}\n style={{\n ...styles.menuItem,\n backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : 'transparent',\n }}\n className={withVendorCSSClassPrefix('user-dropdown__menu-item')}\n color=\"tertiary\"\n variant=\"text\"\n size=\"small\"\n startIcon={item.icon}\n onMouseEnter={() => setHoveredItemIndex(index)}\n onMouseLeave={() => setHoveredItemIndex(null)}\n >\n {item.label}\n </Button>\n )}\n </div>\n ))}\n </div>\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n )}\n </div>\n );\n};\n\nexport default BaseUserDropdown;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, ReactElement, ReactNode, useState} from 'react';\nimport BaseUserDropdown, {BaseUserDropdownProps} from './BaseUserDropdown';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport UserProfile from '../UserProfile/UserProfile';\n\n/**\n * Render props data passed to the children function\n */\nexport interface UserDropdownRenderProps {\n /** Function to close the profile dialog */\n closeProfile: () => void;\n /** Whether user data is currently loading */\n isLoading: boolean;\n /** Whether the profile dialog is currently open */\n isProfileOpen: boolean;\n /** Function to open the user profile dialog */\n openProfile: () => void;\n /** Function to sign out the user */\n signOut: () => void;\n /** The authenticated user object */\n user: any;\n}\n\n/**\n * Props for the UserDropdown component.\n * Extends BaseUserDropdownProps but excludes user, onManageProfile, and onSignOut since they're handled internally\n */\nexport type UserDropdownProps = Omit<BaseUserDropdownProps, 'user' | 'onManageProfile'> & {\n /**\n * Render prop function that receives user state and actions.\n * When provided, this completely replaces the default dropdown rendering.\n */\n children?: (props: UserDropdownRenderProps) => ReactNode;\n /**\n * Custom render function for the dropdown content.\n * When provided, this replaces just the dropdown content while keeping the trigger.\n */\n renderDropdown?: (props: UserDropdownRenderProps) => ReactNode;\n /**\n * Custom render function for the trigger button.\n * When provided, this replaces just the trigger button while keeping the dropdown.\n */\n renderTrigger?: (props: UserDropdownRenderProps) => ReactNode;\n};\n\n/**\n * UserDropdown component displays a user avatar with a dropdown menu.\n * When clicked, it shows a popover with customizable menu items.\n * This component is the React-specific implementation that uses the BaseUserDropdown\n * and automatically retrieves the user data from Asgardeo context.\n *\n * Supports render props for complete customization of the dropdown appearance and behavior.\n *\n * @example\n * ```tsx\n * // Basic usage - will use user from Asgardeo context\n * <UserDropdown menuItems={[\n * { label: 'Profile', onClick: () => {} },\n * { label: 'Settings', href: '/settings' },\n * { label: 'Sign Out', onClick: () => {} }\n * ]} />\n *\n * // With custom configuration\n * <UserDropdown\n * showTriggerLabel={true}\n * avatarSize={40}\n * fallback={<div>Please sign in</div>}\n * />\n *\n * // Using render props for complete customization\n * <UserDropdown>\n * {({ user, isLoading, openProfile, signOut }) => (\n * <div>\n * <button onClick={openProfile}>\n * {user?.name || 'Loading...'}\n * </button>\n * <button onClick={signOut}>Logout</button>\n * </div>\n * )}\n * </UserDropdown>\n *\n * // Using partial render props\n * <UserDropdown\n * renderTrigger={({ user, openProfile }) => (\n * <button onClick={openProfile} className=\"custom-trigger\">\n * Welcome, {user?.name}!\n * </button>\n * )}\n * />\n * ```\n */\nconst UserDropdown: FC<UserDropdownProps> = ({\n children,\n renderTrigger,\n renderDropdown,\n onSignOut,\n ...rest\n}: UserDropdownProps): ReactElement => {\n const {user, isLoading, signOut} = useAsgardeo();\n const [isProfileOpen, setIsProfileOpen] = useState(false);\n\n const handleManageProfile = () => {\n setIsProfileOpen(true);\n };\n\n const handleSignOut = () => {\n signOut();\n onSignOut && onSignOut();\n };\n\n const closeProfile = () => {\n setIsProfileOpen(false);\n };\n\n // Prepare render props data\n const renderProps: UserDropdownRenderProps = {\n user,\n isLoading: isLoading as boolean,\n openProfile: handleManageProfile,\n signOut: handleSignOut,\n isProfileOpen,\n closeProfile,\n };\n\n // If children render prop is provided, use it for complete customization\n if (children) {\n return (\n <>\n {children(renderProps)}\n <UserProfile mode=\"popup\" open={isProfileOpen} onOpenChange={setIsProfileOpen} />\n </>\n );\n }\n\n // If partial render props are provided, customize specific parts\n if (renderTrigger || renderDropdown) {\n // This would require significant changes to BaseUserDropdown to support partial customization\n // For now, we'll provide a simple implementation that shows how it could work\n return (\n <>\n {renderTrigger ? (\n renderTrigger(renderProps)\n ) : (\n <BaseUserDropdown\n user={user}\n isLoading={isLoading}\n onManageProfile={handleManageProfile}\n onSignOut={handleSignOut}\n {...rest}\n />\n )}\n {/* Note: renderDropdown would need BaseUserDropdown modifications to implement properly */}\n <UserProfile mode=\"popup\" open={isProfileOpen} onOpenChange={setIsProfileOpen} />\n </>\n );\n }\n\n // Default behavior - use BaseUserDropdown as before\n return (\n <>\n <BaseUserDropdown\n user={user}\n isLoading={isLoading}\n onManageProfile={handleManageProfile}\n onSignOut={handleSignOut}\n {...rest}\n />\n {isProfileOpen && <UserProfile mode=\"popup\" open={isProfileOpen} onOpenChange={setIsProfileOpen} />}\n </>\n );\n};\n\nexport default UserDropdown;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport {\n useFloating,\n autoUpdate,\n offset,\n flip,\n shift,\n useClick,\n useDismiss,\n useRole,\n useInteractions,\n FloatingFocusManager,\n FloatingPortal,\n} from '@floating-ui/react';\nimport clsx from 'clsx';\nimport {CSSProperties, FC, ReactElement, ReactNode, useMemo, useState} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport useTranslation from '../../../hooks/useTranslation';\nimport {Avatar} from '../../primitives/Avatar/Avatar';\nimport Button from '../../primitives/Button/Button';\nimport Building from '../../primitives/Icons/Building';\nimport Check from '../../primitives/Icons/Check';\nimport ChevronDown from '../../primitives/Icons/ChevronDown';\nimport Typography from '../../primitives/Typography/Typography';\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n trigger: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} * 0.75) ${theme.vars.spacing.unit}`,\n border: `1px solid ${theme.vars.colors.border}`,\n background: theme.vars.colors.background.surface,\n cursor: 'pointer',\n borderRadius: theme.vars.borderRadius.medium,\n minWidth: '160px',\n '&:hover': {\n backgroundColor: theme.vars.colors.background.surface,\n },\n } as CSSProperties,\n orgName: {\n color: theme.vars.colors.text.primary,\n fontWeight: 500,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n flex: 1,\n } as CSSProperties,\n dropdownContent: {\n minWidth: '280px',\n maxWidth: '400px',\n backgroundColor: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.medium,\n boxShadow: theme.vars.shadows.medium,\n border: `1px solid ${theme.vars.colors.border}`,\n outline: 'none',\n zIndex: 1000,\n } as CSSProperties,\n dropdownMenu: {\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n } as CSSProperties,\n menuItem: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 2)`,\n width: '100%',\n color: theme.vars.colors.text.primary,\n textDecoration: 'none',\n border: 'none',\n backgroundColor: 'none',\n cursor: 'pointer',\n fontSize: '0.875rem',\n textAlign: 'left',\n borderRadius: theme.vars.borderRadius.medium,\n transition: 'background-color 0.15s ease-in-out',\n '&:hover': {\n backgroundColor: theme.vars.colors.action?.hover || 'rgba(0, 0, 0, 0.04)',\n },\n } as CSSProperties,\n organizationInfo: {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme.vars.spacing.unit} / 4)`,\n flex: 1,\n minWidth: 0,\n overflow: 'hidden',\n } as CSSProperties,\n organizationName: {\n color: theme.vars.colors.text.primary,\n fontSize: '0.875rem',\n fontWeight: 500,\n margin: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n } as CSSProperties,\n organizationMeta: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.75rem',\n margin: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n } as CSSProperties,\n divider: {\n margin: `calc(${theme.vars.spacing.unit} * 0.5) 0`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n } as CSSProperties,\n dropdownHeader: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n padding: `${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n loadingContainer: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: '80px',\n gap: theme.vars.spacing.unit,\n } as CSSProperties,\n loadingText: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n } as CSSProperties,\n errorContainer: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: '80px',\n padding: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n errorText: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n textAlign: 'center',\n } as CSSProperties,\n manageButton: {\n minWidth: 'auto',\n marginLeft: 'auto',\n } as CSSProperties,\n roleCapitalized: {\n textTransform: 'capitalize',\n } as CSSProperties,\n sectionHeader: {\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n color: theme.vars.colors.text.secondary,\n } as CSSProperties,\n sectionHeaderContainer: {\n borderTop: 'none',\n borderBottom: 'none',\n paddingBottom: `calc(${theme.vars.spacing.unit} / 2)`,\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\ninterface MenuItem {\n href?: string;\n icon?: ReactNode;\n label: ReactNode;\n onClick?: () => void;\n}\n\n/**\n * Interface for organization data.\n */\nexport interface Organization {\n /**\n * Avatar URL for the organization.\n */\n avatar?: string;\n /**\n * Unique identifier for the organization.\n */\n id: string;\n /**\n * Number of members in the organization.\n */\n memberCount?: number;\n /**\n * Additional metadata for the organization.\n */\n metadata?: Record<string, any>;\n /**\n * Display name of the organization.\n */\n name: string;\n /**\n * User's role in the organization.\n */\n role?: 'owner' | 'admin' | 'member';\n /**\n * URL slug for the organization.\n */\n slug?: string;\n}\n\n/**\n * Props interface for the BaseOrganizationSwitcher component.\n */\nexport interface BaseOrganizationSwitcherProps {\n /**\n * Optional size for the avatar\n */\n avatarSize?: number;\n /**\n * Custom class name for styling.\n */\n className?: string;\n /**\n * Currently selected organization.\n */\n currentOrganization?: Organization;\n /**\n * Error message to display.\n */\n error?: string;\n /**\n * Optional element to render when no organization is selected.\n */\n fallback?: ReactElement;\n /**\n * Whether the component is in a loading state.\n */\n loading?: boolean;\n /**\n * Additional menu items to display at the bottom of the dropdown.\n */\n menuItems?: MenuItem[];\n /**\n * Handler for when an organization is selected.\n */\n onOrganizationSwitch: (organization: Organization) => void;\n /**\n * Handler for when the manage profile button is clicked.\n */\n onManageProfile?: () => void;\n /**\n * List of available organizations.\n */\n organizations: Organization[];\n /**\n * The HTML element ID where the portal should be mounted\n */\n portalId?: string;\n /**\n * Custom render function for the error state.\n */\n renderError?: (error: string) => ReactElement;\n /**\n * Custom render function for the loading state.\n */\n renderLoading?: () => ReactElement;\n /**\n * Custom render function for the organization item.\n */\n renderOrganization?: (organization: Organization, isSelected: boolean) => ReactElement;\n /**\n * Whether to show the member count.\n */\n showMemberCount?: boolean;\n /**\n * Whether to show the role badge.\n */\n showRole?: boolean;\n /**\n * Show organization name next to avatar in the trigger button\n */\n showTriggerLabel?: boolean;\n /**\n * Custom styles for the component.\n */\n style?: React.CSSProperties;\n}\n\n/**\n * BaseOrganizationSwitcher component displays an organization selector with a dropdown menu.\n * When clicked, it shows a popover with available organizations to switch between.\n * This component serves as the base for framework-specific implementations.\n */\nexport const BaseOrganizationSwitcher: FC<BaseOrganizationSwitcherProps> = ({\n organizations,\n currentOrganization,\n loading = false,\n error,\n onOrganizationSwitch,\n onManageProfile,\n className = '',\n style,\n renderOrganization,\n renderLoading,\n renderError,\n showRole = false,\n showMemberCount = true,\n menuItems = [],\n portalId = 'asgardeo-organization-switcher',\n showTriggerLabel = true,\n avatarSize = 24,\n fallback = null,\n}): ReactElement => {\n const styles = useStyles();\n const [isOpen, setIsOpen] = useState(false);\n const [hoveredItemIndex, setHoveredItemIndex] = useState<number | null>(null);\n const {theme, colorScheme} = useTheme();\n const {t} = useTranslation();\n\n const {refs, floatingStyles, context} = useFloating({\n open: isOpen,\n onOpenChange: setIsOpen,\n placement: 'bottom-end',\n middleware: [offset(5), flip({fallbackAxisSideDirection: 'end'}), shift({padding: 5})],\n whileElementsMounted: autoUpdate,\n });\n\n const click = useClick(context);\n const dismiss = useDismiss(context);\n const role = useRole(context);\n\n const {getReferenceProps, getFloatingProps} = useInteractions([click, dismiss, role]);\n\n if (fallback && !currentOrganization && !loading && organizations.length === 0) {\n return fallback;\n }\n\n const handleOrganizationSwitch = (organization: Organization): void => {\n onOrganizationSwitch(organization);\n setIsOpen(false);\n };\n\n const handleMenuItemClick = (item: MenuItem): void => {\n if (item.onClick) {\n item.onClick();\n }\n setIsOpen(false);\n };\n\n // Filter out current organization from switchable list\n const switchableOrganizations: Organization[] = organizations.filter(\n (org: Organization): boolean => org.id !== currentOrganization?.id,\n );\n\n const defaultRenderOrganization = (organization: Organization, isSelected: boolean) => (\n <>\n <Avatar\n variant=\"square\"\n imageUrl={organization.avatar}\n name={organization.name}\n size={avatarSize * 1.25}\n alt={`${organization.name} avatar`}\n />\n <div style={styles.organizationInfo}>\n <Typography variant=\"body2\" fontWeight=\"medium\" style={styles.organizationName}>\n {organization.name}\n </Typography>\n <div style={styles.organizationMeta}>\n {showMemberCount && organization.memberCount !== undefined && (\n <span>\n {organization.memberCount}{' '}\n {organization.memberCount === 1 ? t('organization.switcher.member') : t('organization.switcher.members')}\n </span>\n )}\n {showRole && organization.role && showMemberCount && organization.memberCount !== undefined && (\n <span> \u2022 </span>\n )}\n {showRole && organization.role && <span style={styles.roleCapitalized}>{organization.role}</span>}\n </div>\n </div>\n {isSelected && <Check width=\"16\" height=\"16\" color={theme.vars.colors.text.primary} />}\n </>\n );\n\n const defaultRenderLoading = () => (\n <div style={styles.loadingContainer}>\n <Typography variant=\"caption\" style={styles.loadingText}>\n {t('organization.switcher.loading.organizations')}\n </Typography>\n </div>\n );\n\n const defaultRenderError = (errorMessage: string) => (\n <div style={styles.errorContainer}>\n <Typography variant=\"caption\" style={styles.errorText}>\n {errorMessage}\n </Typography>\n </div>\n );\n\n return (\n <div className={clsx(withVendorCSSClassPrefix('organization-switcher'), className)} style={style}>\n <Button\n ref={refs.setReference}\n className={withVendorCSSClassPrefix('organization-switcher__trigger')}\n style={styles.trigger}\n color=\"tertiary\"\n variant=\"outline\"\n size=\"medium\"\n {...getReferenceProps()}\n >\n {currentOrganization ? (\n <>\n <Avatar\n variant=\"square\"\n imageUrl={currentOrganization.avatar}\n name={currentOrganization.name}\n size={avatarSize}\n alt={`${currentOrganization.name} avatar`}\n />\n {showTriggerLabel && (\n <Typography\n variant=\"body2\"\n className={withVendorCSSClassPrefix('organization-switcher__trigger-label')}\n style={styles.orgName}\n >\n {currentOrganization.name}\n </Typography>\n )}\n </>\n ) : (\n <>\n <Building width={avatarSize} height={avatarSize} />\n {showTriggerLabel && (\n <Typography\n variant=\"body2\"\n className={withVendorCSSClassPrefix('organization-switcher__trigger-label')}\n style={styles.orgName}\n >\n {t('organization.switcher.select.organization')}\n </Typography>\n )}\n </>\n )}\n <ChevronDown width=\"16\" height=\"16\" />\n </Button>\n\n {isOpen && (\n <FloatingPortal id={portalId}>\n <FloatingFocusManager context={context} modal={false}>\n <div\n ref={refs.setFloating}\n className={withVendorCSSClassPrefix('organization-switcher__content')}\n style={{...floatingStyles, ...styles.dropdownContent}}\n {...getFloatingProps()}\n >\n {/* Header - Current Organization */}\n {currentOrganization && (\n <div\n className={withVendorCSSClassPrefix('organization-switcher__header')}\n style={styles.dropdownHeader}\n >\n <Avatar\n variant=\"square\"\n imageUrl={currentOrganization.avatar}\n name={currentOrganization.name}\n size={avatarSize * 1.5}\n alt={`${currentOrganization.name} avatar`}\n />\n <div\n className={withVendorCSSClassPrefix('organization-switcher__header-info')}\n style={styles.organizationInfo}\n >\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('organization-switcher__header-name')}\n variant=\"body1\"\n fontWeight=\"medium\"\n style={styles.organizationName}\n >\n {currentOrganization.name}\n </Typography>\n <div style={styles.organizationMeta}>\n {showMemberCount && currentOrganization.memberCount !== undefined && (\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('organization-switcher__header-meta')}\n variant=\"caption\"\n color=\"secondary\"\n >\n {currentOrganization.memberCount}{' '}\n {currentOrganization.memberCount === 1\n ? t('organization.switcher.member')\n : t('organization.switcher.members')}\n {showRole && currentOrganization.role && <span> \u2022 {currentOrganization.role}</span>}\n </Typography>\n )}\n {showRole &&\n currentOrganization.role &&\n (!showMemberCount || currentOrganization.memberCount === undefined) && (\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('organization-switcher__header-role')}\n variant=\"caption\"\n color=\"secondary\"\n style={styles.roleCapitalized}\n >\n {currentOrganization.role}\n </Typography>\n )}\n </div>\n </div>\n {onManageProfile && (\n <Button\n onClick={onManageProfile}\n color=\"tertiary\"\n variant=\"outline\"\n size=\"small\"\n aria-label=\"Manage Organization Profile\"\n style={styles.manageButton}\n endIcon={\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n <path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z\" />\n </svg>\n }\n >\n {t('organization.switcher.manage.button')}\n </Button>\n )}\n </div>\n )}\n\n {/* Section Header for Other Organizations */}\n {organizations.length > 1 && (\n <div\n style={{\n ...styles.dropdownHeader,\n ...styles.sectionHeaderContainer,\n borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : 'none',\n }}\n >\n <Typography variant=\"caption\" fontWeight={600} style={styles.sectionHeader}>\n {t('organization.switcher.switch.organization')}\n </Typography>\n </div>\n )}\n\n {/* Content */}\n <div className={withVendorCSSClassPrefix('organization-switcher__menu')} style={styles.dropdownMenu}>\n {loading ? (\n renderLoading ? (\n renderLoading()\n ) : (\n defaultRenderLoading()\n )\n ) : error ? (\n renderError ? (\n renderError(error)\n ) : (\n defaultRenderError(error)\n )\n ) : (\n <>\n {switchableOrganizations.map((organization: Organization): ReactElement => {\n const isSelected: boolean = false; // Never selected since we exclude current org\n return (\n <Button\n key={organization.id}\n onClick={(): void => handleOrganizationSwitch(organization)}\n className={withVendorCSSClassPrefix('organization-switcher__menu-item')}\n color=\"tertiary\"\n variant=\"text\"\n size=\"small\"\n style={{\n ...styles.menuItem,\n backgroundColor:\n hoveredItemIndex === switchableOrganizations.indexOf(organization)\n ? theme.vars.colors.action?.hover\n : 'transparent',\n }}\n onMouseEnter={(): void => setHoveredItemIndex(switchableOrganizations.indexOf(organization))}\n onMouseLeave={(): void => setHoveredItemIndex(null)}\n >\n {renderOrganization\n ? renderOrganization(organization, isSelected)\n : defaultRenderOrganization(organization, isSelected)}\n </Button>\n );\n })}\n\n {/* Menu Items */}\n {menuItems.length > 0 && (\n <>\n <div\n className={withVendorCSSClassPrefix('organization-switcher__menu-divider')}\n style={styles.divider}\n />\n {menuItems.map(\n (item, index: number): ReactElement => (\n <div key={index}>\n {item.href ? (\n <a\n href={item.href}\n style={{\n ...styles.menuItem,\n backgroundColor:\n hoveredItemIndex === switchableOrganizations.length + index\n ? theme.vars.colors.action?.hover\n : 'transparent',\n }}\n className={withVendorCSSClassPrefix('organization-switcher__menu-item')}\n onMouseEnter={(): void => setHoveredItemIndex(switchableOrganizations.length + index)}\n onMouseLeave={(): void => setHoveredItemIndex(null)}\n onFocus={(): void => setHoveredItemIndex(switchableOrganizations.length + index)}\n onBlur={(): void => setHoveredItemIndex(null)}\n >\n {item.icon}\n <span>{item.label}</span>\n </a>\n ) : (\n <Button\n onClick={(): void => handleMenuItemClick(item)}\n style={{\n ...styles.menuItem,\n backgroundColor:\n hoveredItemIndex === switchableOrganizations.length + index\n ? theme.vars.colors.action?.hover\n : 'transparent',\n }}\n className={withVendorCSSClassPrefix('organization-switcher__menu-item')}\n color=\"tertiary\"\n variant=\"text\"\n size=\"small\"\n startIcon={item.icon}\n onMouseEnter={(): void => setHoveredItemIndex(switchableOrganizations.length + index)}\n onMouseLeave={(): void => setHoveredItemIndex(null)}\n >\n {item.label}\n </Button>\n )}\n </div>\n ),\n )}\n </>\n )}\n </>\n )}\n </div>\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n )}\n </div>\n );\n};\n\nexport default BaseOrganizationSwitcher;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\n\nexport interface BuildingProps {\n /**\n * Color of the icon.\n */\n color?: string;\n /**\n * Height of the icon.\n */\n height?: number | string;\n /**\n * Width of the icon.\n */\n width?: number | string;\n}\n\n/**\n * Building Icon component.\n *\n * @param props - Props injected to the component.\n * @returns Building Icon component.\n */\nconst Building: FC<BuildingProps> = ({color = 'currentColor', height = 24, width = 24}: BuildingProps) => (\n <svg width={width} height={height} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z\"\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path d=\"M6 12h4\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M6 8h4\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M14 8h4\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M14 12h4\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M6 18h4\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M14 18h4\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\nBuilding.displayName = 'Building';\n\nexport default Building;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\n\nexport interface CheckProps {\n /**\n * Color of the icon.\n */\n color?: string;\n /**\n * Height of the icon.\n */\n height?: number | string;\n /**\n * Width of the icon.\n */\n width?: number | string;\n}\n\n/**\n * Check Icon component.\n *\n * @param props - Props injected to the component.\n * @returns Check Icon component.\n */\nconst Check: FC<CheckProps> = ({color = 'currentColor', height = 24, width = 24}: CheckProps) => (\n <svg width={width} height={height} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M20 6 9 17l-5-5\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\nCheck.displayName = 'Check';\n\nexport default Check;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\n\nexport interface ChevronDownProps {\n /**\n * Color of the icon.\n */\n color?: string;\n /**\n * Height of the icon.\n */\n height?: number | string;\n /**\n * Width of the icon.\n */\n width?: number | string;\n}\n\n/**\n * ChevronDown Icon component.\n *\n * @param props - Props injected to the component.\n * @returns ChevronDown Icon component.\n */\nconst ChevronDown: FC<ChevronDownProps> = ({color = 'currentColor', height = 24, width = 24}: ChevronDownProps) => (\n <svg width={width} height={height} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m6 9 6 6 6-6\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\nChevronDown.displayName = 'ChevronDown';\n\nexport default ChevronDown;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, ReactElement, useState} from 'react';\n\nimport BaseOrganizationSwitcher, {BaseOrganizationSwitcherProps, Organization} from './BaseOrganizationSwitcher';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useOrganization from '../../../contexts/Organization/useOrganization';\nimport useTranslation from '../../../hooks/useTranslation';\nimport {CreateOrganization} from '../CreateOrganization/CreateOrganization';\nimport OrganizationProfile from '../OrganizationProfile/OrganizationProfile';\nimport OrganizationList from '../OrganizationList/OrganizationList';\nimport BuildingAlt from '../../primitives/Icons/BuildingAlt';\n\n/**\n * Props interface for the OrganizationSwitcher component.\n * Makes organizations optional since they'll be retrieved from OrganizationContext.\n */\nexport interface OrganizationSwitcherProps\n extends Omit<BaseOrganizationSwitcherProps, 'organizations' | 'currentOrganization' | 'onOrganizationSwitch'> {\n /**\n * Optional override for current organization (will use context if not provided)\n */\n currentOrganization?: Organization;\n /**\n * Fallback element to render when the user is not signed in.\n */\n fallback?: ReactElement;\n /**\n * Optional callback for organization switch (will use context if not provided)\n */\n onOrganizationSwitch?: (organization: Organization) => Promise<void> | void;\n /**\n * Optional override for organizations list (will use context if not provided)\n */\n organizations?: Organization[];\n}\n\n/**\n * OrganizationSwitcher component that provides organization switching functionality.\n * This component automatically retrieves organizations from the OrganizationContext.\n * You can also override the organizations, currentOrganization, and onOrganizationSwitch\n * by passing them as props.\n *\n * @example\n * ```tsx\n * import { OrganizationSwitcher } from '@asgardeo/react';\n *\n * // Basic usage - uses OrganizationContext\n * <OrganizationSwitcher />\n *\n * // With custom organization switch handler\n * <OrganizationSwitcher\n * onOrganizationSwitch={(org) => {\n * console.log('Switching to:', org.name);\n * // Custom logic here\n * }}\n * />\n *\n * // With fallback for unauthenticated users\n * <OrganizationSwitcher\n * fallback={<div>Please sign in to view organizations</div>}\n * />\n * ```\n */\nexport const OrganizationSwitcher: FC<OrganizationSwitcherProps> = ({\n currentOrganization: propCurrentOrganization,\n fallback = null,\n onOrganizationSwitch: propOnOrganizationSwitch,\n organizations: propOrganizations,\n ...props\n}: OrganizationSwitcherProps): ReactElement => {\n const {isSignedIn} = useAsgardeo();\n const {\n currentOrganization: contextCurrentOrganization,\n myOrganizations: contextOrganizations,\n switchOrganization,\n isLoading,\n error,\n } = useOrganization();\n const [isCreateOrgOpen, setIsCreateOrgOpen] = useState(false);\n const [isProfileOpen, setIsProfileOpen] = useState(false);\n const [isOrganizationListOpen, setIsOrganizationListOpen] = useState(false);\n const {t} = useTranslation();\n\n if (!isSignedIn && fallback) {\n return fallback;\n }\n\n if (!isSignedIn) {\n return <></>;\n }\n\n const organizations: Organization[] = propOrganizations || contextOrganizations || [];\n const currentOrganization: Organization | null = propCurrentOrganization || contextCurrentOrganization;\n const onOrganizationSwitch: (organization: Organization) => Promise<void> | void =\n propOnOrganizationSwitch || switchOrganization;\n\n const handleManageOrganizations = (): void => {\n setIsOrganizationListOpen(true);\n };\n\n const handleManageOrganization = (): void => {\n setIsProfileOpen(true);\n };\n\n const defaultMenuItems: Array<{icon?: ReactElement; label: string; onClick: () => void}> = [];\n\n if (currentOrganization) {\n defaultMenuItems.push({\n icon: <BuildingAlt />,\n label: t('organization.switcher.manage.organizations'),\n onClick: handleManageOrganizations,\n });\n }\n\n defaultMenuItems.push({\n icon: (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\">\n <path d=\"M12 5v14m-7-7h14\" />\n </svg>\n ),\n label: t('organization.switcher.create.organization'),\n onClick: (): void => setIsCreateOrgOpen(true),\n });\n\n const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;\n\n return (\n <>\n <BaseOrganizationSwitcher\n organizations={organizations}\n currentOrganization={currentOrganization}\n onOrganizationSwitch={onOrganizationSwitch}\n loading={isLoading}\n error={error}\n menuItems={menuItems}\n onManageProfile={handleManageOrganization}\n {...props}\n />\n <CreateOrganization\n mode=\"popup\"\n open={isCreateOrgOpen}\n onOpenChange={setIsCreateOrgOpen}\n onSuccess={(org: Organization) => {\n if (org && onOrganizationSwitch) {\n onOrganizationSwitch(org);\n }\n setIsCreateOrgOpen(false);\n }}\n />\n {currentOrganization && (\n <OrganizationProfile\n organizationId={currentOrganization.id}\n mode=\"popup\"\n open={isProfileOpen}\n onOpenChange={setIsProfileOpen}\n cardLayout={true}\n loadingFallback={<div>{t('organization.profile.loading')}</div>}\n errorFallback={<div>{t('organization.profile.error')}</div>}\n />\n )}\n <OrganizationList\n mode=\"popup\"\n open={isOrganizationListOpen}\n onOpenChange={setIsOrganizationListOpen}\n title={t('organization.switcher.manage.organizations')}\n onOrganizationSelect={(organization: Organization) => {\n if (onOrganizationSwitch) {\n onOrganizationSwitch(organization);\n }\n setIsOrganizationListOpen(false);\n }}\n />\n </>\n );\n};\n\nexport default OrganizationSwitcher;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, ReactElement, useState} from 'react';\n\nimport {BaseCreateOrganization, BaseCreateOrganizationProps} from './BaseCreateOrganization';\nimport {CreateOrganizationPayload} from '@asgardeo/browser';\nimport createOrganization from '../../../api/createOrganization';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useOrganization from '../../../contexts/Organization/useOrganization';\n\n/**\n * Props interface for the CreateOrganization component.\n */\nexport interface CreateOrganizationProps extends Omit<BaseCreateOrganizationProps, 'onSubmit' | 'loading' | 'error'> {\n /**\n * Fallback element to render when the user is not signed in.\n */\n fallback?: ReactElement;\n /**\n * Custom organization creation handler (will use default API if not provided).\n */\n onCreateOrganization?: (payload: CreateOrganizationPayload) => Promise<any>;\n}\n\n/**\n * CreateOrganization component that provides organization creation functionality.\n * This component automatically integrates with the Asgardeo and Organization contexts.\n *\n * @example\n * ```tsx\n * import { CreateOrganization } from '@asgardeo/react';\n *\n * // Basic usage - uses default API and contexts\n * <CreateOrganization\n * onSuccess={(org) => console.log('Created:', org)}\n * onCancel={() => navigate('/organizations')}\n * />\n *\n * // With custom organization creation handler\n * <CreateOrganization\n * onCreateOrganization={async (payload) => {\n * const result = await myCustomAPI.createOrganization(payload);\n * return result;\n * }}\n * onSuccess={(org) => {\n * console.log('Organization created:', org.name);\n * // Custom success logic here\n * }}\n * />\n *\n * // With fallback for unauthenticated users\n * <CreateOrganization\n * fallback={<div>Please sign in to create an organization</div>}\n * />\n * ```\n */\nexport const CreateOrganization: FC<CreateOrganizationProps> = ({\n onCreateOrganization,\n fallback = null,\n onSuccess,\n defaultParentId,\n ...props\n}: CreateOrganizationProps): ReactElement => {\n const {isSignedIn, baseUrl} = useAsgardeo();\n const {currentOrganization, revalidateMyOrganizations} = useOrganization();\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n // Don't render if not authenticated\n if (!isSignedIn && fallback) {\n return fallback;\n }\n\n if (!isSignedIn) {\n return <></>;\n }\n\n // Use current organization as parent if no defaultParentId provided\n const parentId: string = defaultParentId || currentOrganization?.id || '';\n\n const handleSubmit = async (payload: CreateOrganizationPayload): Promise<void> => {\n setLoading(true);\n setError(null);\n\n try {\n let result: any;\n\n if (onCreateOrganization) {\n // Use the provided custom creation function\n result = await onCreateOrganization(payload);\n } else {\n // Use the default API\n if (!baseUrl) {\n throw new Error('Base URL is required for organization creation');\n }\n result = await createOrganization({\n baseUrl,\n payload: {\n ...payload,\n parentId,\n },\n });\n }\n\n // Refresh organizations list to include the new organization\n await revalidateMyOrganizations();\n\n // Call success callback if provided\n if (onSuccess) {\n onSuccess(result);\n }\n } catch (createError) {\n const errorMessage: string = createError instanceof Error ? createError.message : 'Failed to create organization';\n setError(errorMessage);\n throw createError; // Re-throw to allow form to handle it\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <BaseCreateOrganization\n onSubmit={handleSubmit}\n loading={loading}\n error={error}\n defaultParentId={parentId}\n onSuccess={onSuccess}\n {...props}\n />\n );\n};\n\nexport default CreateOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix, CreateOrganizationPayload} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {ChangeEvent, CSSProperties, FC, ReactElement, ReactNode, useMemo, useState} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport useTranslation from '../../../hooks/useTranslation';\nimport Alert from '../../primitives/Alert/Alert';\nimport Button from '../../primitives/Button/Button';\nimport {Dialog, DialogContent, DialogHeading} from '../../primitives/Popover/Popover';\nimport FormControl from '../../primitives/FormControl/FormControl';\nimport InputLabel from '../../primitives/InputLabel/InputLabel';\nimport TextField from '../../primitives/TextField/TextField';\nimport Typography from '../../primitives/Typography/Typography';\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n root: {\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n minWidth: '600px',\n margin: '0 auto',\n } as CSSProperties,\n card: {\n background: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.large,\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n } as CSSProperties,\n content: {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n form: {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n width: '100%',\n } as CSSProperties,\n header: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} * 1.5)`,\n marginBottom: `calc(${theme.vars.spacing.unit} * 1.5)`,\n } as CSSProperties,\n field: {\n display: 'flex',\n alignItems: 'center',\n padding: `${theme.vars.spacing.unit} 0`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n minHeight: '32px',\n } as CSSProperties,\n textarea: {\n width: '100%',\n padding: `${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 1.5)`,\n border: `1px solid ${theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.medium,\n fontSize: theme.vars.typography.fontSizes.md,\n color: theme.vars.colors.text.primary,\n backgroundColor: theme.vars.colors.background.surface,\n fontFamily: 'inherit',\n minHeight: '80px',\n resize: 'vertical',\n outline: 'none',\n '&:focus': {\n borderColor: theme.vars.colors.primary.main,\n boxShadow: `0 0 0 2px ${theme.vars.colors.primary.main}20`,\n },\n '&:disabled': {\n backgroundColor: theme.vars.colors.background.disabled,\n color: theme.vars.colors.text.secondary,\n cursor: 'not-allowed',\n },\n } as CSSProperties,\n avatarContainer: {\n alignItems: 'flex-start',\n display: 'flex',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n marginBottom: theme.vars.spacing.unit,\n } as CSSProperties,\n actions: {\n display: 'flex',\n gap: theme.vars.spacing.unit,\n justifyContent: 'flex-end',\n paddingTop: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n infoContainer: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: theme.vars.spacing.unit,\n } as CSSProperties,\n value: {\n color: theme.vars.colors.text.primary,\n flex: 1,\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n overflow: 'hidden',\n minHeight: '32px',\n lineHeight: '32px',\n } as CSSProperties,\n popup: {\n padding: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\n/**\n * Interface for organization form data.\n */\nexport interface OrganizationFormData {\n description: string;\n handle: string;\n name: string;\n}\n\n/**\n * Props interface for the BaseCreateOrganization component.\n */\nexport interface BaseCreateOrganizationProps {\n cardLayout?: boolean;\n className?: string;\n defaultParentId?: string;\n error?: string | null;\n initialValues?: Partial<OrganizationFormData>;\n loading?: boolean;\n mode?: 'inline' | 'popup';\n onCancel?: () => void;\n onOpenChange?: (open: boolean) => void;\n onSubmit?: (payload: CreateOrganizationPayload) => void | Promise<void>;\n onSuccess?: (organization: any) => void;\n open?: boolean;\n renderAdditionalFields?: () => ReactNode;\n style?: CSSProperties;\n title?: string;\n}\n\n/**\n * BaseCreateOrganization component provides the core functionality for creating organizations.\n * This component serves as the base for framework-specific implementations.\n */\nexport const BaseCreateOrganization: FC<BaseCreateOrganizationProps> = ({\n cardLayout = true,\n className = '',\n defaultParentId = '',\n error,\n initialValues = {},\n loading = false,\n mode = 'inline',\n onCancel,\n onOpenChange,\n onSubmit,\n onSuccess,\n open = false,\n renderAdditionalFields,\n style,\n title = 'Create Organization',\n}): ReactElement => {\n const styles = useStyles();\n const {theme} = useTheme();\n const {t} = useTranslation();\n const [formData, setFormData] = useState<OrganizationFormData>({\n description: '',\n handle: '',\n name: '',\n ...initialValues,\n });\n const [formErrors, setFormErrors] = useState<Partial<OrganizationFormData> & {avatar?: string}>({});\n\n const validateForm = (): boolean => {\n const errors: Partial<OrganizationFormData> = {};\n\n if (!formData.name.trim()) {\n errors.name = 'Organization name is required';\n }\n\n if (!formData.handle.trim()) {\n errors.handle = 'Organization handle is required';\n } else if (!/^[a-z0-9-]+$/.test(formData.handle)) {\n errors.handle = 'Handle can only contain lowercase letters, numbers, and hyphens';\n }\n\n if (!formData.description.trim()) {\n errors.description = 'Organization description is required';\n }\n\n setFormErrors(errors);\n return Object.keys(errors).length === 0;\n };\n\n const handleInputChange = (field: keyof OrganizationFormData, value: string): void => {\n setFormData(prev => ({\n ...prev,\n [field]: value,\n }));\n\n // Clear error when user starts typing\n if (formErrors[field]) {\n setFormErrors(prev => ({\n ...prev,\n [field]: undefined,\n }));\n }\n };\n\n const handleNameChange = (value: string): void => {\n handleInputChange('name', value);\n\n // Auto-generate handle from name if handle is empty or matches previous auto-generated value\n if (!formData.handle || formData.handle === generateHandleFromName(formData.name)) {\n const newHandle = generateHandleFromName(value);\n handleInputChange('handle', newHandle);\n }\n };\n\n const generateHandleFromName = (name: string): string => {\n return name\n .toLowerCase()\n .replace(/[^a-z0-9\\s-]/g, '') // Remove special characters except spaces and hyphens\n .replace(/\\s+/g, '-') // Replace spaces with hyphens\n .replace(/-+/g, '-') // Replace multiple hyphens with single hyphen\n .replace(/^-|-$/g, ''); // Remove leading/trailing hyphens\n };\n\n const handleSubmit = async (e: React.FormEvent): Promise<void> => {\n e.preventDefault();\n\n if (!validateForm() || loading) {\n return;\n }\n\n const payload: CreateOrganizationPayload = {\n description: formData.description.trim(),\n orgHandle: formData.handle.trim(),\n name: formData.name.trim(),\n parentId: defaultParentId,\n type: 'TENANT',\n };\n\n try {\n await onSubmit?.(payload);\n if (onSuccess) {\n onSuccess(payload);\n }\n } catch (submitError) {\n // Error handling is done by parent component\n console.error('Form submission error:', submitError);\n }\n };\n\n const containerStyle = {\n ...styles.root,\n ...(cardLayout ? styles.card : {}),\n };\n\n const createOrganizationContent = (\n <div\n className={clsx(withVendorCSSClassPrefix('create-organization'), className)}\n style={{...containerStyle, ...style}}\n >\n <div className={withVendorCSSClassPrefix('create-organization__content')} style={styles.content}>\n <form\n id=\"create-organization-form\"\n className={withVendorCSSClassPrefix('create-organization__form')}\n style={styles.form}\n onSubmit={handleSubmit}\n >\n {/* Error Alert */}\n {error && (\n <Alert variant=\"error\" style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}>\n <Alert.Title>Error</Alert.Title>\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n )}\n\n {/* Organization Name */}\n <div className={withVendorCSSClassPrefix('create-organization__field-group')}>\n <TextField\n label={`${t('organization.create.name.label')}`}\n placeholder={t('organization.create.name.placeholder')}\n value={formData.name}\n onChange={(e: ChangeEvent<HTMLInputElement>) => handleNameChange(e.target.value)}\n disabled={loading}\n required\n error={formErrors.name}\n className={withVendorCSSClassPrefix('create-organization__input')}\n />\n </div>\n\n {/* Organization Handle */}\n <div className={withVendorCSSClassPrefix('create-organization__field-group')}>\n <TextField\n label={`${t('organization.create.handle.label') || 'Organization Handle'}`}\n placeholder={t('organization.create.handle.placeholder') || 'my-organization'}\n value={formData.handle}\n onChange={(e: ChangeEvent<HTMLInputElement>) => handleInputChange('handle', e.target.value)}\n disabled={loading}\n required\n error={formErrors.handle}\n helperText=\"This will be your organization's unique identifier. Only lowercase letters, numbers, and hyphens are allowed.\"\n className={withVendorCSSClassPrefix('create-organization__input')}\n />\n </div>\n\n {/* Organization Description */}\n <div className={withVendorCSSClassPrefix('create-organization__field-group')}>\n <FormControl error={formErrors.description}>\n <InputLabel required>{t('organization.create.description.label')}</InputLabel>\n <textarea\n className={withVendorCSSClassPrefix('create-organization__textarea')}\n style={{\n ...styles.textarea,\n borderColor: formErrors.description ? theme.vars.colors.error.main : theme.vars.colors.border,\n }}\n placeholder={t('organization.create.description.placeholder')}\n value={formData.description}\n onChange={(e: ChangeEvent<HTMLTextAreaElement>) => handleInputChange('description', e.target.value)}\n disabled={loading}\n required\n />\n </FormControl>\n </div>\n\n {/* Additional Fields */}\n {renderAdditionalFields && renderAdditionalFields()}\n </form>\n\n {/* Actions */}\n <div className={withVendorCSSClassPrefix('create-organization__actions')} style={styles.actions}>\n {onCancel && (\n <Button type=\"button\" variant=\"outline\" onClick={onCancel} disabled={loading}>\n {t('organization.create.cancel')}\n </Button>\n )}\n <Button type=\"submit\" variant=\"solid\" color=\"primary\" disabled={loading} form=\"create-organization-form\">\n {loading ? t('organization.create.creating') : t('organization.create.button')}\n </Button>\n </div>\n </div>\n </div>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={{padding: `calc(${theme.vars.spacing.unit} * 2)`}}>{createOrganizationContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return createOrganizationContent;\n};\n\nexport default BaseCreateOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n Organization,\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n createOrganization as baseCreateOrganization,\n CreateOrganizationConfig as BaseCreateOrganizationConfig,\n CreateOrganizationPayload,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the createOrganization request (React-specific)\n */\nexport interface CreateOrganizationConfig extends Omit<BaseCreateOrganizationConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Creates a new organization.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object containing baseUrl, payload and optional request config.\n * @returns A promise that resolves with the created organization information.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * try {\n * const organization = await createOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/<ORGANIZATION>\",\n * payload: {\n * description: \"Share your screens\",\n * name: \"Team Viewer\",\n * orgHandle: \"team-viewer\",\n * parentId: \"f4825104-4948-40d9-ab65-a960eee3e3d5\",\n * type: \"TENANT\"\n * }\n * });\n * console.log(organization);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to create organization:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const organization = await createOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/<ORGANIZATION>\",\n * payload: {\n * description: \"Share your screens\",\n * name: \"Team Viewer\",\n * orgHandle: \"team-viewer\",\n * parentId: \"f4825104-4948-40d9-ab65-a960eee3e3d5\",\n * type: \"TENANT\"\n * },\n * fetcher: customFetchFunction\n * });\n * console.log(organization);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to create organization:', error.message);\n * }\n * }\n * ```\n */\nconst createOrganization = async ({fetcher, ...requestConfig}: CreateOrganizationConfig): Promise<Organization> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'POST',\n headers: config.headers as Record<string, string>,\n data: config.body ? JSON.parse(config.body as string) : undefined,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseCreateOrganization({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default createOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, ReactElement, useEffect, useState} from 'react';\nimport BaseOrganizationProfile, {BaseOrganizationProfileProps} from './BaseOrganizationProfile';\nimport {OrganizationDetails} from '@asgardeo/browser';\nimport getOrganization from '../../../api/getOrganization';\nimport updateOrganization, {createPatchOperations} from '../../../api/updateOrganization';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useTranslation from '../../../hooks/useTranslation';\n\n/**\n * Props for the OrganizationProfile component.\n * Extends BaseOrganizationProfileProps but makes the organization prop optional\n * since it will be fetched using the organizationId\n */\nexport type OrganizationProfileProps = Omit<BaseOrganizationProfileProps, 'organization' | 'mode'> & {\n /**\n * Component to show when there's an error loading organization data.\n */\n errorFallback?: ReactElement;\n\n /**\n * Component to show while loading organization data.\n */\n loadingFallback?: ReactElement;\n\n /**\n * Display mode for the component.\n */\n mode?: 'default' | 'popup';\n\n /**\n * Callback fired when the popup should be closed (only used in popup mode).\n */\n onOpenChange?: (open: boolean) => void;\n\n /**\n * Callback fired when the organization should be updated.\n */\n onUpdate?: (payload: any) => Promise<void>;\n\n /**\n * Whether the popup is open (only used in popup mode).\n */\n open?: boolean;\n\n /**\n * The ID of the organization to fetch and display.\n */\n organizationId: string;\n\n /**\n * Custom title for the popup dialog (only used in popup mode).\n */\n popupTitle?: string;\n};\n\n/**\n * OrganizationProfile component displays organization information in a\n * structured and styled format. It automatically fetches organization details\n * using the provided organization ID and displays them using BaseOrganizationProfile.\n *\n * The component supports editing functionality, allowing users to modify organization\n * fields inline. Updates are automatically synced with the backend via the SCIM2 API.\n *\n * This component is the React-specific implementation that automatically\n * retrieves the organization data from Asgardeo API.\n *\n * @example\n * ```tsx\n * // Basic usage with editing enabled (default)\n * <OrganizationProfile organizationId=\"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\" />\n *\n * // Read-only mode\n * <OrganizationProfile\n * organizationId=\"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\"\n * editable={false}\n * />\n *\n * // With card layout and custom fallbacks\n * <OrganizationProfile\n * organizationId=\"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\"\n * cardLayout={true}\n * loadingFallback={<div>Loading organization...</div>}\n * errorFallback={<div>Failed to load organization</div>}\n * fallback={<div>No organization data available</div>}\n * />\n *\n * // With custom fields configuration and update callback\n * <OrganizationProfile\n * organizationId=\"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\"\n * fields={[\n * { key: 'id', label: 'Organization ID', editable: false },\n * { key: 'name', label: 'Organization Name', editable: true },\n * { key: 'description', label: 'Description', editable: true, render: (value) => value || 'No description' },\n * { key: 'created', label: 'Created Date', editable: false, render: (value) => new Date(value).toLocaleDateString() },\n * { key: 'lastModified', label: 'Last Modified Date', editable: false, render: (value) => new Date(value).toLocaleDateString() },\n * { key: 'attributes', label: 'Custom Attributes', editable: true }\n * ]}\n * onUpdate={async (payload) => {\n * console.log('Organization updated:', payload);\n * // payload contains the updated field values\n * // The component automatically converts these to patch operations\n * }}\n * />\n *\n * // In popup mode\n * <OrganizationProfile\n * organizationId=\"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\"\n * mode=\"popup\"\n * open={isOpen}\n * onOpenChange={setIsOpen}\n * popupTitle=\"Edit Organization Profile\"\n * />\n * ```\n */\nconst OrganizationProfile: FC<OrganizationProfileProps> = ({\n organizationId,\n mode = 'default',\n open = false,\n onOpenChange,\n onUpdate,\n popupTitle,\n loadingFallback = <div>Loading organization...</div>,\n errorFallback = <div>Failed to load organization data</div>,\n ...rest\n}: OrganizationProfileProps): ReactElement => {\n const {baseUrl} = useAsgardeo();\n const {t} = useTranslation();\n const [organization, setOrganization] = useState<OrganizationDetails | null>(null);\n const [loading, setLoading] = useState<boolean>(true);\n const [error, setError] = useState<boolean>(false);\n\n const fetchOrganization = async () => {\n if (!baseUrl || !organizationId) {\n setLoading(false);\n setError(true);\n return;\n }\n\n try {\n setLoading(true);\n setError(false);\n const orgData = await getOrganization({\n baseUrl,\n organizationId,\n });\n setOrganization(orgData);\n } catch (err) {\n console.error('Failed to fetch organization:', err);\n setError(true);\n setOrganization(null);\n } finally {\n setLoading(false);\n }\n };\n\n useEffect(() => {\n fetchOrganization();\n }, [baseUrl, organizationId]);\n\n const handleOrganizationUpdate = async (payload: any): Promise<void> => {\n if (!baseUrl || !organizationId) return;\n\n try {\n // Convert payload to patch operations format\n const operations = createPatchOperations(payload);\n\n await updateOrganization({\n baseUrl,\n organizationId,\n operations,\n });\n // Refetch organization data after update\n await fetchOrganization();\n\n // Call the optional onUpdate callback\n if (onUpdate) {\n await onUpdate(payload);\n }\n } catch (err) {\n console.error('Failed to update organization:', err);\n throw err;\n }\n };\n\n return (\n <BaseOrganizationProfile\n organization={organization}\n onUpdate={handleOrganizationUpdate}\n mode={mode === 'popup' ? 'popup' : 'inline'}\n open={open}\n onOpenChange={onOpenChange}\n title={popupTitle || t('organization.profile.title')}\n {...rest}\n />\n );\n};\n\nexport default OrganizationProfile;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix, OrganizationDetails} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {FC, ReactElement, useMemo, CSSProperties, useState, useCallback, useRef} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {Avatar} from '../../primitives/Avatar/Avatar';\nimport Button from '../../primitives/Button/Button';\nimport Checkbox from '../../primitives/Checkbox/Checkbox';\nimport DatePicker from '../../primitives/DatePicker/DatePicker';\nimport KeyValueInput from '../../primitives/KeyValueInput/KeyValueInput';\nimport {Dialog, DialogContent, DialogHeading} from '../../primitives/Popover/Popover';\nimport TextField from '../../primitives/TextField/TextField';\nimport Card from '../../primitives/Card/Card';\n\n/**\n * Formats a date string to a human-readable format\n */\nconst formatDate = (dateString?: string): string => {\n if (!dateString) return '-';\n try {\n return new Date(dateString).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n });\n } catch {\n return dateString;\n }\n};\n\nexport interface BaseOrganizationProfileProps {\n /**\n * Callback fired when the cancel button is clicked (only used in editable mode).\n */\n cancelButtonText?: string;\n\n /**\n * Whether to display the profile in a card layout.\n */\n cardLayout?: boolean;\n\n /**\n * CSS class name for styling the component.\n */\n className?: string;\n\n /**\n * Whether the organization profile is editable.\n */\n editable?: boolean;\n\n /**\n * Component to render when no organization data is available.\n */\n fallback?: ReactElement;\n\n /**\n * Array of field configurations to display. Each field specifies what organization data to show.\n */\n fields?: Array<{\n key: keyof OrganizationDetails | 'attributes';\n label: string;\n editable?: boolean;\n render?: (value: any, organization: OrganizationDetails) => React.ReactNode;\n }>;\n\n /**\n * Display mode for the component.\n */\n mode?: 'inline' | 'popup';\n\n /**\n * Callback fired when a field value changes.\n */\n onChange?: (field: string, value: any) => void;\n\n /**\n * Callback fired when the popup should be closed (only used in popup mode).\n */\n onOpenChange?: (open: boolean) => void;\n\n /**\n * Callback fired when the form is submitted (only used in editable mode).\n */\n onSubmit?: (data: any) => void;\n\n /**\n * Callback fired when the organization should be updated.\n */\n onUpdate?: (payload: any) => Promise<void>;\n\n /**\n * Whether the popup is open (only used in popup mode).\n */\n open?: boolean;\n\n /**\n * The organization details to display.\n */\n organization?: OrganizationDetails | null;\n\n /**\n * Text for the save button (only used in editable mode).\n */\n saveButtonText?: string;\n\n /**\n * Custom title for the profile.\n */\n title?: string;\n}\n\n/**\n * BaseOrganizationProfile component displays organization information in a\n * structured and styled format. It shows organization details such as name,\n * description, status, and other available information with support for inline editing.\n *\n * This is the base component that can be used in any context where you have\n * an organization object available. It provides editing capabilities similar to\n * the UserProfile component, allowing users to modify organization fields directly.\n *\n * @example\n * ```tsx\n * // Basic usage\n * <BaseOrganizationProfile organization={organizationData} />\n *\n * // With editing enabled and update handler\n * <BaseOrganizationProfile\n * organization={organizationData}\n * editable={true}\n * onUpdate={async (payload) => {\n * await updateOrganizationAPI(orgId, payload);\n * }}\n * />\n *\n * // With card layout and custom title\n * <BaseOrganizationProfile\n * organization={organizationData}\n * cardLayout={true}\n * title=\"Organization Details\"\n * fallback={<div>No organization data available</div>}\n * />\n *\n * // With custom fields configuration\n * <BaseOrganizationProfile\n * organization={organizationData}\n * fields={[\n * { key: 'id', label: 'Organization ID', editable: false },\n * { key: 'name', label: 'Organization Name', editable: true },\n * { key: 'description', label: 'Description', editable: true, render: (value) => value || 'No description' },\n * { key: 'created', label: 'Created Date', editable: false, render: (value) => new Date(value).toLocaleDateString() },\n * { key: 'attributes', label: 'Custom Attributes', editable: true }\n * ]}\n * onUpdate={handleUpdate}\n * />\n *\n * // In popup mode\n * <BaseOrganizationProfile\n * organization={organizationData}\n * mode=\"popup\"\n * open={isOpen}\n * onOpenChange={setIsOpen}\n * title=\"Edit Organization\"\n * />\n * ```\n * <BaseOrganizationProfile\n * organization={organizationData}\n * fields={[\n * { key: 'id', label: 'Organization ID' },\n * { key: 'name', label: 'Organization Name' },\n * { key: 'description', label: 'Description', render: (value) => value || 'No description' },\n * { key: 'created', label: 'Created Date', render: (value) => new Date(value).toLocaleDateString() },\n * { key: 'attributes', label: 'Custom Attributes' }\n * ]}\n * />\n * ```\n */\nconst BaseOrganizationProfile: FC<BaseOrganizationProfileProps> = ({\n fallback = null,\n className = '',\n cardLayout = true,\n organization,\n title = 'Organization Profile',\n mode = 'inline',\n editable = true,\n onChange,\n onOpenChange,\n onSubmit,\n onUpdate,\n open = false,\n saveButtonText = 'Save Changes',\n cancelButtonText = 'Cancel',\n fields = [\n {\n key: 'id',\n label: 'Organization ID',\n editable: false,\n },\n {\n key: 'name',\n label: 'Organization Name',\n editable: true,\n },\n {\n key: 'description',\n label: 'Organization Description',\n editable: true,\n render: value => value || '-',\n },\n {\n key: 'created',\n label: 'Created Date',\n editable: false,\n render: value => formatDate(value),\n },\n {\n key: 'lastModified',\n label: 'Last Modified Date',\n editable: false,\n render: value => formatDate(value),\n },\n ],\n}): ReactElement => {\n const {theme} = useTheme();\n const [editedOrganization, setEditedOrganization] = useState(organization);\n const [editingFields, setEditingFields] = useState<Record<string, boolean>>({});\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const PencilIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z\" />\n </svg>\n );\n\n const toggleFieldEdit = useCallback((fieldName: string) => {\n setEditingFields(prev => ({\n ...prev,\n [fieldName]: !prev[fieldName],\n }));\n }, []);\n\n const getFieldPlaceholder = useCallback((fieldKey: string): string => {\n const fieldLabels: Record<string, string> = {\n name: 'organization name',\n description: 'organization description',\n orgHandle: 'organization handle',\n status: 'organization status',\n type: 'organization type',\n };\n\n const fieldLabel = fieldLabels[fieldKey] || fieldKey.toLowerCase();\n return `Enter ${fieldLabel}`;\n }, []);\n\n const handleFieldSave = useCallback(\n (fieldKey: string): void => {\n if (!onUpdate || !fieldKey) return;\n\n const fieldValue: any =\n editedOrganization && fieldKey && editedOrganization[fieldKey as keyof OrganizationDetails] !== undefined\n ? editedOrganization[fieldKey as keyof OrganizationDetails]\n : organization && organization[fieldKey as keyof OrganizationDetails] !== undefined\n ? organization[fieldKey as keyof OrganizationDetails]\n : '';\n\n const payload: Record<string, any> = {\n [fieldKey]: fieldValue,\n };\n\n onUpdate(payload);\n // Exit edit mode for this field after save\n toggleFieldEdit(fieldKey);\n },\n [editedOrganization, organization, onUpdate, toggleFieldEdit],\n );\n\n const handleFieldCancel = useCallback(\n (fieldKey: string) => {\n setEditedOrganization(prev => ({\n ...prev,\n [fieldKey]: organization?.[fieldKey as keyof OrganizationDetails],\n }));\n toggleFieldEdit(fieldKey);\n },\n [organization, toggleFieldEdit],\n );\n\n const formatLabel = (key: string): string =>\n key\n .split(/(?=[A-Z])|_/)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n const getStatusColor = (status?: string): string => {\n switch (status?.toUpperCase()) {\n case 'ACTIVE':\n return theme.vars.colors.success.main;\n case 'INACTIVE':\n return theme.vars.colors.warning.main;\n case 'SUSPENDED':\n return theme.vars.colors.error.main;\n default:\n return theme.vars.colors.text.secondary;\n }\n };\n\n const getOrgInitials = (name?: string): string => {\n if (!name) return 'ORG';\n return name\n .split(' ')\n .map(word => word.charAt(0))\n .join('')\n .toUpperCase()\n .slice(0, 2);\n };\n\n const styles = useStyles();\n\n // Renders individual field in view or edit mode\n const renderField = (\n field: any,\n isEditing: boolean,\n onEditValue?: (value: any) => void,\n onStartEdit?: () => void,\n ): ReactElement | null => {\n if (!field) return null;\n\n const {key, label, editable: fieldEditable = true} = field;\n const value =\n key === 'attributes' ? organization?.attributes || {} : organization?.[key as keyof OrganizationDetails];\n\n const renderedValue = field.render ? field.render(value, organization) : value;\n\n // If editing, show input field\n if (isEditing && onEditValue && fieldEditable && editable) {\n const fieldValue =\n editedOrganization && key && editedOrganization[key as keyof OrganizationDetails] !== undefined\n ? editedOrganization[key as keyof OrganizationDetails]\n : value || '';\n\n const commonProps = {\n label: undefined,\n value: typeof fieldValue === 'object' ? JSON.stringify(fieldValue) : String(fieldValue || ''),\n onChange: (e: any) => onEditValue(e.target ? e.target.value : e),\n placeholder: getFieldPlaceholder(key),\n style: {\n marginBottom: 0,\n },\n };\n\n let fieldInput: ReactElement;\n\n if (key === 'attributes') {\n // For attributes, use KeyValueInput component\n const attributesValue = typeof fieldValue === 'object' && fieldValue !== null ? fieldValue : {};\n fieldInput = (\n <KeyValueInput\n value={attributesValue}\n onChange={pairs => {\n const attributesObject = pairs.reduce((acc, pair) => {\n acc[pair.key] = pair.value;\n return acc;\n }, {} as Record<string, any>);\n onEditValue(attributesObject);\n }}\n onAdd={pair => {\n if (onUpdate) {\n const operation = {\n operation: 'ADD',\n path: `/attributes/${pair.key}`,\n value: pair.value,\n };\n onUpdate([operation]);\n }\n }}\n onRemove={(pair, index) => {\n if (onUpdate) {\n const operation = {\n operation: 'REMOVE',\n path: `/attributes/${pair.key}`,\n value: '',\n };\n onUpdate([operation]);\n }\n }}\n label=\"\"\n keyPlaceholder=\"Attribute name\"\n valuePlaceholder=\"Attribute value\"\n helperText=\"Add custom attributes as key-value pairs\"\n />\n );\n } else {\n fieldInput = <TextField {...commonProps} />;\n }\n\n return (\n <>\n <span style={styles.label}>{label}</span>\n <div style={styles.value}>{fieldInput}</div>\n </>\n );\n }\n\n // Default: view mode\n const hasValue = value !== undefined && value !== null && value !== '';\n const isFieldEditable = editable && fieldEditable;\n\n let displayValue: string | ReactElement;\n if (hasValue) {\n displayValue =\n key === 'attributes' && typeof value === 'object' && value !== null ? (\n <KeyValueInput value={value} readOnly={true} label=\"\" />\n ) : (\n String(renderedValue)\n );\n } else if (isFieldEditable) {\n displayValue = getFieldPlaceholder(key);\n } else {\n displayValue = '-';\n }\n\n return (\n <>\n <span style={styles.label}>{label}</span>\n <div\n style={{\n ...styles.value,\n fontStyle: hasValue ? 'normal' : 'italic',\n opacity: hasValue ? 1 : 0.7,\n }}\n >\n {!hasValue && isFieldEditable && onStartEdit ? (\n <Button\n onClick={onStartEdit}\n variant=\"text\"\n color=\"secondary\"\n size=\"small\"\n title=\"Click to edit\"\n style={{\n fontStyle: 'italic',\n textDecoration: 'underline',\n opacity: 0.7,\n padding: 0,\n minHeight: 'auto',\n }}\n >\n {displayValue}\n </Button>\n ) : (\n displayValue\n )}\n </div>\n </>\n );\n };\n\n const renderOrganizationField = (field: any) => {\n if (!field || !field.key) return null;\n\n const hasValue =\n organization?.[field.key as keyof OrganizationDetails] !== undefined &&\n organization?.[field.key as keyof OrganizationDetails] !== '' &&\n organization?.[field.key as keyof OrganizationDetails] !== null;\n const isFieldEditing = editingFields[field.key];\n const isFieldEditable = editable && field.editable !== false;\n\n // Show field if: has value, currently editing, or is editable\n const shouldShow = hasValue || isFieldEditing || isFieldEditable;\n\n if (!shouldShow) {\n return null;\n }\n\n const fieldStyle = {\n ...styles.field,\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n };\n\n return (\n <div style={fieldStyle} key={field.key}>\n <div style={{flex: 1, display: 'flex', alignItems: 'center', gap: theme.vars.spacing.unit}}>\n {renderField(\n field,\n isFieldEditing,\n value => {\n const tempEditedOrganization = {...editedOrganization};\n tempEditedOrganization[field.key as keyof OrganizationDetails] = value;\n setEditedOrganization(tempEditedOrganization);\n },\n () => toggleFieldEdit(field.key),\n )}\n </div>\n {isFieldEditable && (\n <div style={{display: 'flex', alignItems: 'center', gap: `calc(${theme.vars.spacing.unit} / 2)`}}>\n {isFieldEditing ? (\n <>\n <Button\n onClick={() => handleFieldSave(field.key)}\n color=\"primary\"\n variant=\"solid\"\n size=\"small\"\n title=\"Save changes\"\n >\n {saveButtonText}\n </Button>\n <Button\n onClick={() => handleFieldCancel(field.key)}\n color=\"secondary\"\n variant=\"solid\"\n size=\"small\"\n title=\"Cancel editing\"\n >\n {cancelButtonText}\n </Button>\n </>\n ) : (\n // Only show pencil icon when there's a value\n hasValue && (\n <Button\n onClick={() => toggleFieldEdit(field.key)}\n variant=\"text\"\n color=\"secondary\"\n size=\"small\"\n title=\"Edit field\"\n style={{\n minWidth: 'auto',\n padding: `calc(${theme.vars.spacing.unit} / 2)`,\n minHeight: 'auto',\n }}\n >\n <PencilIcon />\n </Button>\n )\n )}\n </div>\n )}\n </div>\n );\n };\n\n if (!organization) {\n return fallback;\n }\n\n const containerStyle = {\n ...styles.root,\n ...(cardLayout ? styles.card : {}),\n };\n\n const profileContent = (\n <Card style={containerStyle} className={clsx(withVendorCSSClassPrefix('organization-profile'), className)}>\n <div style={styles.header}>\n <Avatar name={getOrgInitials(organization.name)} size={80} alt={`${organization.name} logo`} />\n <div style={styles.orgInfo}>\n <h2 style={styles.name}>{organization.name}</h2>\n {organization.orgHandle && <p style={styles.handle}>@{organization.orgHandle}</p>}\n </div>\n </div>\n\n <div style={styles.infoContainer}>{fields.map((field, index) => renderOrganizationField(field))}</div>\n </Card>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={{padding: `calc(${theme.vars.spacing.unit} * 2)`}}>{profileContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return profileContent;\n};\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n root: {\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n minWidth: '600px',\n margin: '0 auto',\n } as CSSProperties,\n card: {\n background: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.large,\n } as CSSProperties,\n header: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n marginBottom: `calc(${theme.vars.spacing.unit} * 3)`,\n paddingBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n orgInfo: {\n flex: 1,\n } as CSSProperties,\n name: {\n fontSize: '1.5rem',\n fontWeight: 600,\n margin: '0 0 8px 0',\n color: theme.vars.colors.text.primary,\n } as CSSProperties,\n handle: {\n fontSize: '1rem',\n color: theme.vars.colors.text.secondary,\n margin: '0',\n fontFamily: 'monospace',\n } as CSSProperties,\n infoContainer: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: theme.vars.spacing.unit,\n } as CSSProperties,\n field: {\n display: 'flex',\n alignItems: 'flex-start',\n padding: `calc(${theme.vars.spacing.unit} / 2) 0`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n minHeight: '28px',\n } as CSSProperties,\n lastField: {\n borderBottom: 'none',\n } as CSSProperties,\n label: {\n fontSize: '0.875rem',\n fontWeight: 500,\n color: theme.vars.colors.text.secondary,\n width: '120px',\n flexShrink: 0,\n lineHeight: '28px',\n } as CSSProperties,\n value: {\n color: theme.vars.colors.text.primary,\n flex: 1,\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n overflow: 'hidden',\n minHeight: '28px',\n lineHeight: '28px',\n wordBreak: 'break-word' as const,\n } as CSSProperties,\n statusBadge: {\n padding: `calc(${theme.vars.spacing.unit} / 2) ${theme.vars.spacing.unit}`,\n borderRadius: theme.vars.borderRadius.small,\n fontSize: '0.75rem',\n fontWeight: 500,\n color: 'white',\n textTransform: 'uppercase' as const,\n letterSpacing: '0.5px',\n } as CSSProperties,\n permissionsList: {\n display: 'flex',\n flexWrap: 'wrap' as const,\n gap: `calc(${theme.vars.spacing.unit} / 2)`,\n } as CSSProperties,\n permissionBadge: {\n padding: `calc(${theme.vars.spacing.unit} / 4) ${theme.vars.spacing.unit}`,\n borderRadius: theme.vars.borderRadius.small,\n fontSize: '0.75rem',\n backgroundColor: theme.vars.colors.primary.main,\n color: theme.vars.colors.primary.contrastText,\n border: `1px solid ${theme.vars.colors.border}`,\n } as CSSProperties,\n attributesList: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: `calc(${theme.vars.spacing.unit} / 4)`,\n } as CSSProperties,\n attributeItem: {\n display: 'flex',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} / 4) 0`,\n alignItems: 'center',\n } as CSSProperties,\n attributeKey: {\n fontSize: '0.75rem',\n fontWeight: 500,\n color: theme.vars.colors.text.secondary,\n minWidth: '80px',\n flexShrink: 0,\n } as CSSProperties,\n attributeValue: {\n fontSize: '0.75rem',\n color: theme.vars.colors.text.primary,\n wordBreak: 'break-word' as const,\n flex: 1,\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\nexport default BaseOrganizationProfile;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {FC, ReactElement, useState, useCallback, CSSProperties} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Button from '../Button/Button';\nimport TextField from '../TextField/TextField';\nimport {Plus, X} from '../Icons';\n\nexport interface KeyValuePair {\n key: string;\n value: string;\n}\n\nexport interface KeyValueInputProps {\n /**\n * CSS class name for styling the component.\n */\n className?: string;\n\n /**\n * Whether the input is disabled.\n */\n disabled?: boolean;\n\n /**\n * Error message to display.\n */\n error?: string;\n\n /**\n * Help text to display below the input.\n */\n helperText?: string;\n\n /**\n * Label for the key input field.\n */\n keyLabel?: string;\n\n /**\n * Placeholder text for the key input field.\n */\n keyPlaceholder?: string;\n\n /**\n * Label for the component.\n */\n label?: string;\n\n /**\n * Maximum number of key-value pairs allowed.\n */\n maxPairs?: number;\n /**\n * Callback fired when the key-value pairs change.\n */\n onChange?: (pairs: KeyValuePair[]) => void;\n\n /**\n * Callback fired when a pair is added.\n */\n onAdd?: (pair: KeyValuePair) => void;\n\n /**\n * Callback fired when a pair is removed.\n */\n onRemove?: (pair: KeyValuePair, index: number) => void;\n\n /**\n * Whether the component is in read-only mode.\n */\n readOnly?: boolean;\n\n /**\n * Text for the remove button.\n */\n removeButtonText?: string;\n\n /**\n * Whether the component is required.\n */\n required?: boolean;\n\n /**\n * Current key-value pairs.\n */\n value?: Record<string, any> | KeyValuePair[];\n\n /**\n * Label for the value input field.\n */\n valueLabel?: string;\n\n /**\n * Placeholder text for the value input field.\n */\n valuePlaceholder?: string;\n}\n\n/**\n * KeyValueInput component allows users to manage key-value pairs with add/remove functionality.\n * It provides a user-friendly interface for editing organization attributes or similar data structures.\n *\n * @example\n * ```tsx\n * // Basic usage\n * <KeyValueInput\n * label=\"Organization Attributes\"\n * onChange={(pairs) => console.log(pairs)}\n * />\n *\n * // With initial values\n * <KeyValueInput\n * label=\"Organization Attributes\"\n * value={{department: 'IT', location: 'New York'}}\n * onChange={(pairs) => console.log(pairs)}\n * />\n *\n * // With add/remove callbacks\n * <KeyValueInput\n * label=\"Custom Attributes\"\n * value={attributes}\n * onChange={(pairs) => setAttributes(pairs)}\n * onAdd={(pair) => console.log('Added:', pair)}\n * onRemove={(pair, index) => console.log('Removed:', pair, 'at index:', index)}\n * />\n * ```\n */\nconst KeyValueInput: FC<KeyValueInputProps> = ({\n className = '',\n disabled = false,\n error,\n helperText,\n keyLabel = 'Key',\n keyPlaceholder = 'Enter key',\n label,\n maxPairs,\n onChange,\n onAdd,\n onRemove,\n readOnly = false,\n removeButtonText = 'Remove',\n required = false,\n value = {},\n valueLabel = 'Value',\n valuePlaceholder = 'Enter value',\n}): ReactElement => {\n const {theme} = useTheme();\n\n // Convert value to array format\n const initialPairs: KeyValuePair[] = Array.isArray(value)\n ? value\n : Object.entries(value).map(([key, val]) => ({key, value: String(val)}));\n\n const [pairs, setPairs] = useState<KeyValuePair[]>(initialPairs);\n const [newKey, setNewKey] = useState('');\n const [newValue, setNewValue] = useState('');\n\n const handleAddPair = useCallback(() => {\n if (!newKey.trim() || !newValue.trim()) return;\n if (maxPairs && pairs.length >= maxPairs) return;\n\n const newPair: KeyValuePair = {\n key: newKey.trim(),\n value: newValue.trim(),\n };\n\n const updatedPairs = [...pairs, newPair];\n setPairs(updatedPairs);\n setNewKey('');\n setNewValue('');\n\n if (onChange) {\n onChange(updatedPairs);\n }\n\n if (onAdd) {\n onAdd(newPair);\n }\n }, [newKey, newValue, pairs, maxPairs, onChange, onAdd]);\n\n const handleRemovePair = useCallback(\n (index: number) => {\n const pairToRemove = pairs[index];\n const updatedPairs = pairs.filter((_, i) => i !== index);\n setPairs(updatedPairs);\n\n if (onChange) {\n onChange(updatedPairs);\n }\n\n if (onRemove) {\n onRemove(pairToRemove, index);\n }\n },\n [pairs, onChange, onRemove],\n );\n\n const handleUpdatePair = useCallback(\n (index: number, field: 'key' | 'value', newVal: string) => {\n const updatedPairs = pairs.map((pair, i) => {\n if (i === index) {\n return {...pair, [field]: newVal};\n }\n return pair;\n });\n setPairs(updatedPairs);\n\n if (onChange) {\n onChange(updatedPairs);\n }\n },\n [pairs, onChange],\n );\n\n const canAddMore = !maxPairs || pairs.length < maxPairs;\n const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();\n\n const styles = {\n container: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: `calc(${theme.vars.spacing.unit} / 2)`,\n } as CSSProperties,\n label: {\n fontSize: '0.875rem',\n fontWeight: 500,\n color: theme.vars.colors.text.primary,\n marginBottom: `calc(${theme.vars.spacing.unit} / 2)`,\n } as CSSProperties,\n pairsList: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: `calc(${theme.vars.spacing.unit} / 4)`,\n } as CSSProperties,\n pairRow: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} / 2)`,\n padding: `calc(${theme.vars.spacing.unit} / 2)`,\n borderRadius: theme.vars.borderRadius.small,\n backgroundColor: 'transparent',\n border: 'none',\n '&:hover': {\n backgroundColor: theme.vars.colors.action.hover,\n },\n } as CSSProperties,\n pairInput: {\n flex: 1,\n minWidth: 0,\n } as CSSProperties,\n addRow: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} / 2)`,\n padding: `calc(${theme.vars.spacing.unit} / 2)`,\n border: 'none',\n borderRadius: theme.vars.borderRadius.small,\n backgroundColor: 'transparent',\n marginTop: `calc(${theme.vars.spacing.unit} / 2)`,\n } as CSSProperties,\n removeButton: {\n minWidth: 'auto',\n width: '24px',\n height: '24px',\n padding: '0',\n backgroundColor: 'transparent',\n color: theme.vars.colors.text.secondary,\n border: 'none',\n borderRadius: theme.vars.borderRadius.small,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '&:hover': {\n backgroundColor: theme.vars.colors.action.hover,\n color: theme.vars.colors.error.main,\n },\n } as CSSProperties,\n addButton: {\n minWidth: 'auto',\n width: '24px',\n height: '24px',\n padding: '0',\n backgroundColor: 'transparent',\n color: theme.vars.colors.primary.main,\n border: 'none',\n borderRadius: theme.vars.borderRadius.small,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '&:hover': {\n backgroundColor: theme.vars.colors.primary.main,\n color: theme.vars.colors.primary.contrastText,\n },\n } as CSSProperties,\n helperText: {\n fontSize: '0.75rem',\n color: error ? theme.vars.colors.error.main : theme.vars.colors.text.secondary,\n marginTop: `calc(${theme.vars.spacing.unit} / 2)`,\n } as CSSProperties,\n emptyState: {\n padding: theme.vars.spacing.unit,\n textAlign: 'center' as const,\n color: theme.vars.colors.text.secondary,\n fontStyle: 'italic',\n fontSize: '0.75rem',\n } as CSSProperties,\n readOnlyPair: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} / 2)`,\n padding: `calc(${theme.vars.spacing.unit} / 4) 0`,\n minHeight: '20px',\n } as CSSProperties,\n readOnlyKey: {\n fontSize: '0.75rem',\n fontWeight: 500,\n color: theme.vars.colors.text.secondary,\n minWidth: '80px',\n flexShrink: 0,\n } as CSSProperties,\n readOnlyValue: {\n fontSize: '0.75rem',\n color: theme.vars.colors.text.primary,\n wordBreak: 'break-word' as const,\n flex: 1,\n } as CSSProperties,\n };\n\n return (\n <div className={clsx(withVendorCSSClassPrefix('key-value-input'), className)} style={styles.container}>\n {label && (\n <label style={styles.label}>\n {label}\n {required && <span style={{color: theme.vars.colors.error.main}}> *</span>}\n </label>\n )}\n\n <div style={styles.pairsList}>\n {pairs.length === 0 && readOnly ? (\n <div style={styles.emptyState}>No attributes defined</div>\n ) : readOnly ? (\n pairs.map((pair, index) => (\n <div key={`${pair.key}-${index}`} style={styles.readOnlyPair}>\n <span style={styles.readOnlyKey}>{pair.key}:</span>\n <span style={styles.readOnlyValue}>{pair.value}</span>\n </div>\n ))\n ) : (\n pairs.map((pair, index) => (\n <div key={`${pair.key}-${index}`} style={styles.pairRow}>\n <TextField\n placeholder={keyPlaceholder}\n value={pair.key}\n onChange={e => handleUpdatePair(index, 'key', e.target.value)}\n disabled={disabled || readOnly}\n style={styles.pairInput}\n aria-label={`${keyLabel} ${index + 1}`}\n />\n <TextField\n placeholder={valuePlaceholder}\n value={pair.value}\n onChange={e => handleUpdatePair(index, 'value', e.target.value)}\n disabled={disabled || readOnly}\n style={styles.pairInput}\n aria-label={`${valueLabel} ${index + 1}`}\n />\n {!readOnly && (\n <Button\n variant=\"outline\"\n size=\"small\"\n onClick={() => handleRemovePair(index)}\n disabled={disabled}\n style={styles.removeButton}\n aria-label={`${removeButtonText} ${pair.key}`}\n >\n <X width={16} height={16} />\n </Button>\n )}\n </div>\n ))\n )}\n\n {!readOnly && (\n <div style={styles.addRow}>\n <TextField\n placeholder={keyPlaceholder}\n value={newKey}\n onChange={e => setNewKey(e.target.value)}\n disabled={disabled}\n style={styles.pairInput}\n aria-label=\"New key\"\n />\n <TextField\n placeholder={valuePlaceholder}\n value={newValue}\n onChange={e => setNewValue(e.target.value)}\n disabled={disabled}\n style={styles.pairInput}\n aria-label=\"New value\"\n onKeyPress={e => {\n if (e.key === 'Enter' && !isAddDisabled) {\n handleAddPair();\n }\n }}\n />\n <Button\n variant=\"solid\"\n size=\"small\"\n onClick={handleAddPair}\n disabled={isAddDisabled}\n style={styles.addButton}\n aria-label=\"Add new key-value pair\"\n >\n <Plus width={16} height={16} />\n </Button>\n </div>\n )}\n </div>\n\n {(helperText || error) && <div style={styles.helperText}>{error || helperText}</div>}\n\n {maxPairs && (\n <div style={styles.helperText}>\n {pairs.length} of {maxPairs} pairs used\n </div>\n )}\n </div>\n );\n};\n\nexport default KeyValueInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n getOrganization as baseGetOrganization,\n GetOrganizationConfig as BaseGetOrganizationConfig,\n OrganizationDetails,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the getOrganization request (React-specific)\n */\nexport interface GetOrganizationConfig extends Omit<BaseGetOrganizationConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Retrieves detailed information for a specific organization.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object containing baseUrl, organizationId, and request config.\n * @returns A promise that resolves with the organization details.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * try {\n * const organization = await getOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/dxlab\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\"\n * });\n * console.log(organization);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get organization:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const organization = await getOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/dxlab\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\",\n * fetcher: customFetchFunction\n * });\n * console.log(organization);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get organization:', error.message);\n * }\n * }\n * ```\n */\nconst getOrganization = async ({fetcher, ...requestConfig}: GetOrganizationConfig): Promise<OrganizationDetails> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'GET',\n headers: config.headers as Record<string, string>,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetOrganization({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n updateOrganization as baseUpdateOrganization,\n UpdateOrganizationConfig as BaseUpdateOrganizationConfig,\n OrganizationDetails,\n createPatchOperations,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the updateOrganization request (React-specific)\n */\nexport interface UpdateOrganizationConfig extends Omit<BaseUpdateOrganizationConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Updates the organization information using the Organizations Management API.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object with baseUrl, organizationId, operations and optional request config.\n * @returns A promise that resolves with the updated organization information.\n * @example\n * ```typescript\n * // Using the helper function to create operations automatically\n * const operations = createPatchOperations({\n * name: \"Updated Organization Name\", // Will use REPLACE\n * description: \"\", // Will use REMOVE (empty string)\n * customField: \"Some value\" // Will use REPLACE\n * });\n *\n * await updateOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/<ORG>\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\",\n * operations\n * });\n *\n * // Or manually specify operations\n * await updateOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/<ORG>\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\",\n * operations: [\n * { operation: \"REPLACE\", path: \"/name\", value: \"Updated Organization Name\" },\n * { operation: \"REMOVE\", path: \"/description\" }\n * ]\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * await updateOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/<ORG>\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\",\n * operations: [\n * { operation: \"REPLACE\", path: \"/name\", value: \"Updated Organization Name\" }\n * ],\n * fetcher: customFetchFunction\n * });\n * ```\n */\nconst updateOrganization = async ({\n fetcher,\n ...requestConfig\n}: UpdateOrganizationConfig): Promise<OrganizationDetails> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'PATCH',\n headers: config.headers as Record<string, string>,\n data: config.body ? JSON.parse(config.body as string) : undefined,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseUpdateOrganization({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\n// Re-export the helper function\nexport {createPatchOperations};\n\nexport default updateOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AllOrganizationsApiResponse, Organization} from '@asgardeo/browser';\nimport {FC, ReactElement, useEffect, useState} from 'react';\nimport {BaseOrganizationListProps, OrganizationWithSwitchAccess} from './BaseOrganizationList';\nimport BaseOrganizationList from './BaseOrganizationList';\nimport useOrganization from '../../../contexts/Organization/useOrganization';\n\n/**\n * Configuration options for the OrganizationList component.\n */\nexport interface OrganizationListConfig {\n /**\n * Whether to automatically fetch organizations on mount\n */\n autoFetch?: boolean;\n /**\n * Filter string for organizations\n */\n filter?: string;\n /**\n * Number of organizations to fetch per page\n */\n limit?: number;\n /**\n * Whether to include recursive organizations\n */\n recursive?: boolean;\n}\n\n/**\n * Props interface for the OrganizationList component.\n * Uses the enhanced OrganizationContext instead of the useOrganizations hook.\n */\nexport interface OrganizationListProps\n extends Omit<\n BaseOrganizationListProps,\n | 'myOrganizations'\n | 'allOrganizations'\n | 'error'\n | 'fetchMore'\n | 'hasMore'\n | 'isLoading'\n | 'isLoadingMore'\n | 'myOrganizations'\n >,\n OrganizationListConfig {\n /**\n * Function called when an organization is selected/clicked\n */\n onOrganizationSelect?: (organization: OrganizationWithSwitchAccess) => void;\n}\n\n/**\n * OrganizationList component that provides organization listing functionality with pagination.\n * This component uses the enhanced OrganizationContext, eliminating the polling issue and\n * providing better integration with the existing context system.\n *\n * @example\n * ```tsx\n * import { OrganizationList } from '@asgardeo/react';\n *\n * // Basic usage\n * <OrganizationList />\n *\n * // With custom limit and filter\n * <OrganizationList\n * limit={20}\n * filter=\"active\"\n * onOrganizationSelect={(org) => {\n * console.log('Selected organization:', org.name);\n * }}\n * />\n *\n * // As a popup dialog\n * <OrganizationList\n * mode=\"popup\"\n * open={isOpen}\n * onOpenChange={setIsOpen}\n * title=\"Select Organization\"\n * />\n *\n * // With custom organization renderer\n * <OrganizationList\n * renderOrganization={(org) => (\n * <div key={org.id}>\n * <h3>{org.name}</h3>\n * <p>Can switch: {org.canSwitch ? 'Yes' : 'No'}</p>\n * </div>\n * )}\n * />\n * ```\n */\nexport const OrganizationList: FC<OrganizationListProps> = ({\n autoFetch = true,\n filter = '',\n limit = 10,\n onOrganizationSelect,\n recursive = false,\n ...baseProps\n}: OrganizationListProps): ReactElement => {\n const {getAllOrganizations, error, isLoading, myOrganizations} = useOrganization();\n\n const [allOrganizations, setAllOrganizations] = useState<AllOrganizationsApiResponse>({\n organizations: [],\n });\n\n useEffect(() => {\n (async () => {\n setAllOrganizations(await getAllOrganizations());\n })();\n }, []);\n\n return (\n <BaseOrganizationList\n allOrganizations={allOrganizations}\n myOrganizations={myOrganizations}\n error={error}\n isLoading={isLoading}\n onOrganizationSelect={onOrganizationSelect}\n {...baseProps}\n />\n );\n};\n\nexport default OrganizationList;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AllOrganizationsApiResponse, Organization, withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {FC, ReactElement, ReactNode, useMemo, CSSProperties} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport useTranslation from '../../../hooks/useTranslation';\nimport {Dialog, DialogContent, DialogHeading} from '../../primitives/Popover/Popover';\nimport Avatar from '../../primitives/Avatar/Avatar';\nimport Button from '../../primitives/Button/Button';\nimport Typography from '../../primitives/Typography/Typography';\nimport Spinner from '../../primitives/Spinner/Spinner';\n\nexport interface OrganizationWithSwitchAccess extends Organization {\n canSwitch: boolean;\n}\n\n/**\n * Props interface for the BaseOrganizationList component.\n */\nexport interface BaseOrganizationListProps {\n /**\n * Additional CSS class names to apply to the container\n */\n className?: string;\n /**\n * List of organizations discoverable to the signed-in user.\n */\n allOrganizations: AllOrganizationsApiResponse;\n /**\n * List of organizations associated to the signed-in user.\n */\n myOrganizations: Organization[];\n /**\n * Error message to display\n */\n error?: string | null;\n /**\n * Function called when \"Load More\" is clicked\n */\n fetchMore?: () => Promise<void>;\n /**\n * Whether there are more organizations to load\n */\n hasMore?: boolean;\n /**\n * Whether the initial data is loading\n */\n isLoading?: boolean;\n /**\n * Whether more data is being loaded\n */\n isLoadingMore?: boolean;\n /**\n * Function called when refresh is requested\n */\n onRefresh?: () => Promise<void>;\n /**\n * Custom renderer for when no organizations are found\n */\n renderEmpty?: () => ReactNode;\n /**\n * Custom renderer for the error state\n */\n renderError?: (error: string) => ReactNode;\n /**\n * Custom renderer for the load more button\n */\n renderLoadMore?: (onLoadMore: () => Promise<void>, isLoading: boolean) => ReactNode;\n /**\n * Custom renderer for the loading state\n */\n renderLoading?: () => ReactNode;\n /**\n * Custom renderer for each organization item\n */\n renderOrganization?: (organization: OrganizationWithSwitchAccess, index: number) => ReactNode;\n /**\n * Function called when an organization is selected/clicked\n */\n onOrganizationSelect?: (organization: OrganizationWithSwitchAccess) => void;\n /**\n * Inline styles to apply to the container\n */\n style?: React.CSSProperties;\n /**\n * Display mode: 'inline' for normal display, 'popup' for modal dialog\n */\n mode?: 'inline' | 'popup';\n /**\n * Function called when popup open state changes (only used in popup mode)\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Whether the popup is open (only used in popup mode)\n */\n open?: boolean;\n /**\n * Title for the popup dialog (only used in popup mode)\n */\n title?: string;\n /**\n * Whether to show the organization status in the list\n */\n showStatus?: boolean;\n}\n\n/**\n * Default organization item renderer\n */\nconst defaultRenderOrganization = (\n organization: OrganizationWithSwitchAccess,\n styles: any,\n t: (key: string, params?: Record<string, string | number>) => string,\n onOrganizationSelect?: (organization: OrganizationWithSwitchAccess) => void,\n showStatus?: boolean,\n): ReactNode => {\n return (\n <div\n key={organization.id}\n style={{\n ...styles.organizationItem,\n }}\n >\n <div style={styles.organizationContent}>\n <Avatar variant=\"square\" name={organization.name} size={48} alt={`${organization.name} logo`} />\n <div style={styles.organizationInfo}>\n <Typography variant=\"h6\" style={styles.organizationName}>\n {organization.name}\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\" style={styles.organizationHandle}>\n @{organization.orgHandle}\n </Typography>\n {showStatus && (\n <Typography variant=\"body2\" color=\"textSecondary\" style={styles.organizationStatus}>\n {t('organization.switcher.status.label')}{' '}\n <span\n style={{\n ...styles.statusText,\n color: organization.status === 'ACTIVE' ? styles.activeColor : styles.inactiveColor,\n }}\n >\n {organization.status}\n </span>\n </Typography>\n )}\n </div>\n </div>\n {organization.canSwitch && (\n <div style={styles.organizationActions}>\n <Button\n onClick={e => {\n e.stopPropagation();\n onOrganizationSelect(organization);\n }}\n type=\"button\"\n size=\"small\"\n >\n {t('organization.switcher.switch.button')}\n </Button>\n </div>\n )}\n </div>\n );\n};\n\n/**\n * Default loading renderer\n */\nconst defaultRenderLoading = (\n t: (key: string, params?: Record<string, string | number>) => string,\n styles: any,\n): ReactNode => (\n <div style={styles.loadingContainer}>\n <Spinner size=\"medium\" />\n <Typography variant=\"body1\" color=\"textSecondary\" style={styles.loadingText}>\n {t('organization.switcher.loading.organizations')}\n </Typography>\n </div>\n);\n\n/**\n * Default error renderer\n */\nconst defaultRenderError = (\n error: string,\n t: (key: string, params?: Record<string, string | number>) => string,\n styles: any,\n): ReactNode => (\n <div style={styles.errorContainer}>\n <Typography variant=\"body1\" color=\"error\">\n <strong>{t('organization.switcher.error.prefix')}</strong> {error}\n </Typography>\n </div>\n);\n\n/**\n * Default load more button renderer\n */\nconst defaultRenderLoadMore = (\n onLoadMore: () => Promise<void>,\n isLoading: boolean,\n t: (key: string, params?: Record<string, string | number>) => string,\n styles: any,\n): ReactNode => (\n <Button\n onClick={onLoadMore}\n disabled={isLoading}\n style={{\n ...styles.loadMoreButton,\n ...(isLoading ? styles.loadMoreButtonDisabled : {}),\n }}\n type=\"button\"\n fullWidth\n >\n {isLoading ? t('organization.switcher.loading.more') : t('organization.switcher.load.more')}\n </Button>\n);\n\n/**\n * Default empty state renderer\n */\nconst defaultRenderEmpty = (\n t: (key: string, params?: Record<string, string | number>) => string,\n styles: any,\n): ReactNode => (\n <div style={styles.emptyContainer}>\n <Typography variant=\"body1\" color=\"textSecondary\" style={styles.emptyText}>\n {t('organization.switcher.no.organizations')}\n </Typography>\n </div>\n);\n\n/**\n * BaseOrganizationList component displays a list of organizations with pagination support.\n * This component serves as the base for framework-specific implementations.\n *\n * @example\n * ```tsx\n * <BaseOrganizationList\n * data={organizations}\n * isLoading={isLoading}\n * hasMore={hasMore}\n * fetchMore={fetchMore}\n * error={error}\n * />\n * ```\n */\nexport const BaseOrganizationList: FC<BaseOrganizationListProps> = ({\n className = '',\n allOrganizations,\n myOrganizations,\n error,\n fetchMore,\n hasMore = false,\n isLoading = false,\n isLoadingMore = false,\n mode = 'inline',\n onOpenChange,\n onOrganizationSelect,\n onRefresh,\n open = false,\n renderEmpty,\n renderError,\n renderLoading,\n renderLoadMore,\n renderOrganization,\n style,\n title = 'Organizations',\n showStatus,\n}): ReactElement => {\n const styles = useStyles();\n const {t} = useTranslation();\n\n // Combine allOrganizations with myOrganizations to determine which orgs can be switched to\n const organizationsWithSwitchAccess: OrganizationWithSwitchAccess[] = useMemo(() => {\n if (!allOrganizations?.organizations) {\n return [];\n }\n\n // Create a Set of IDs from myOrganizations for faster lookup\n const myOrgIds = new Set(myOrganizations?.map(org => org.id) || []);\n\n return allOrganizations.organizations.map(org => ({\n ...org,\n canSwitch: myOrgIds.has(org.id),\n }));\n }, [allOrganizations?.organizations, myOrganizations]);\n\n // Use custom renderers or defaults with styles and translations\n const renderLoadingWithStyles = renderLoading || (() => defaultRenderLoading(t, styles));\n const renderErrorWithStyles = renderError || ((error: string) => defaultRenderError(error, t, styles));\n const renderEmptyWithStyles = renderEmpty || (() => defaultRenderEmpty(t, styles));\n const renderLoadMoreWithStyles =\n renderLoadMore ||\n ((onLoadMore: () => Promise<void>, isLoading: boolean) => defaultRenderLoadMore(onLoadMore, isLoading, t, styles));\n const renderOrganizationWithStyles =\n renderOrganization ||\n ((org: OrganizationWithSwitchAccess) =>\n defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));\n\n // Show loading state\n if (isLoading && organizationsWithSwitchAccess?.length === 0) {\n const loadingContent = (\n <div\n className={clsx(withVendorCSSClassPrefix('organization-list'), className)}\n style={{...styles.root, ...style}}\n >\n {renderLoadingWithStyles()}\n </div>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={styles.popupContent}>{loadingContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return loadingContent;\n }\n\n // Show error state\n if (error && organizationsWithSwitchAccess?.length === 0) {\n const errorContent = (\n <div\n className={clsx(withVendorCSSClassPrefix('organization-list'), className)}\n style={{...styles.root, ...style}}\n >\n {renderErrorWithStyles(error)}\n </div>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={styles.popupContent}>{errorContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return errorContent;\n }\n\n // Show empty state\n if (!isLoading && organizationsWithSwitchAccess?.length === 0) {\n const emptyContent = (\n <div\n className={clsx(withVendorCSSClassPrefix('organization-list'), className)}\n style={{...styles.root, ...style}}\n >\n {renderEmptyWithStyles()}\n </div>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={styles.popupContent}>{emptyContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return emptyContent;\n }\n\n const organizationListContent = (\n <div className={clsx(withVendorCSSClassPrefix('organization-list'), className)} style={{...styles.root, ...style}}>\n {/* Header with total count and refresh button */}\n <div style={styles.header}>\n <div style={styles.headerInfo}>\n <Typography variant=\"body2\" color=\"textSecondary\" style={styles.subtitle}>\n {t('organization.switcher.showing.count', {\n showing: organizationsWithSwitchAccess?.length,\n total: allOrganizations?.organizations?.length || 0,\n })}\n </Typography>\n </div>\n {onRefresh && (\n <Button onClick={onRefresh} style={styles.refreshButton} type=\"button\" variant=\"outline\" size=\"small\">\n {t('organization.switcher.refresh.button')}\n </Button>\n )}\n </div>\n\n {/* Organizations list */}\n <div style={styles.listContainer}>\n {organizationsWithSwitchAccess?.map((organization: OrganizationWithSwitchAccess, index: number) =>\n renderOrganizationWithStyles(organization, index),\n )}\n </div>\n\n {/* Error message for additional data */}\n {error && organizationsWithSwitchAccess?.length > 0 && (\n <div style={styles.errorMargin}>{renderErrorWithStyles(error)}</div>\n )}\n\n {/* Load more button */}\n {hasMore && fetchMore && (\n <div style={styles.loadMoreMargin}>{renderLoadMoreWithStyles(fetchMore, isLoadingMore)}</div>\n )}\n </div>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={styles.popupContent}>{organizationListContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return organizationListContent;\n};\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n root: {\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n minWidth: '600px',\n margin: '0 auto',\n background: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.large,\n } as CSSProperties,\n header: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: `calc(${theme.vars.spacing.unit} * 3)`,\n paddingBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n } as CSSProperties,\n headerInfo: {\n flex: 1,\n } as CSSProperties,\n title: {\n fontSize: '1.5rem',\n fontWeight: 600,\n margin: '0 0 8px 0',\n color: theme.vars.colors.text.primary,\n } as CSSProperties,\n subtitle: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n margin: '0',\n } as CSSProperties,\n refreshButton: {\n backgroundColor: theme.vars.colors.background.surface,\n border: `1px solid ${theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.small,\n color: theme.vars.colors.text.primary,\n cursor: 'pointer',\n fontSize: '0.875rem',\n padding: `${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 2)`,\n transition: 'all 0.2s',\n } as CSSProperties,\n listContainer: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: `calc(${theme.vars.spacing.unit} * 1.5)`,\n } as CSSProperties,\n organizationItem: {\n border: `1px solid ${theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.medium,\n display: 'flex',\n justifyContent: 'space-between',\n padding: `calc(${theme.vars.spacing.unit} * 2)`,\n transition: 'all 0.2s',\n backgroundColor: theme.vars.colors.background.surface,\n } as CSSProperties,\n organizationContent: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n flex: 1,\n } as CSSProperties,\n organizationInfo: {\n flex: 1,\n } as CSSProperties,\n organizationName: {\n fontSize: '1.125rem',\n fontWeight: 600,\n margin: '0 0 4px 0',\n color: theme.vars.colors.text.primary,\n } as CSSProperties,\n organizationHandle: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n margin: '0 0 4px 0',\n fontFamily: 'monospace',\n } as CSSProperties,\n organizationStatus: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n margin: '0',\n } as CSSProperties,\n statusText: {\n fontWeight: 500,\n } as CSSProperties,\n activeColor: theme.vars.colors.success.main,\n inactiveColor: theme.vars.colors.error.main,\n organizationActions: {\n display: 'flex',\n alignItems: 'center',\n } as CSSProperties,\n badge: {\n borderRadius: theme.vars.borderRadius.large,\n fontSize: '0.75rem',\n fontWeight: 500,\n padding: `calc(${theme.vars.spacing.unit} / 2) calc(${theme.vars.spacing.unit} * 1.5)`,\n textTransform: 'uppercase' as const,\n letterSpacing: '0.5px',\n } as CSSProperties,\n successBadge: {\n backgroundColor: `color-mix(in srgb, ${theme.vars.colors.success.main} 20%, transparent)`,\n color: theme.vars.colors.success.main,\n } as CSSProperties,\n errorBadge: {\n backgroundColor: `color-mix(in srgb, ${theme.vars.colors.error.main} 20%, transparent)`,\n color: theme.vars.colors.error.main,\n } as CSSProperties,\n loadingContainer: {\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n textAlign: 'center' as const,\n display: 'flex',\n flexDirection: 'column' as const,\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n loadingText: {\n marginTop: theme.vars.spacing.unit,\n } as CSSProperties,\n errorContainer: {\n backgroundColor: `color-mix(in srgb, ${theme.vars.colors.error.main} 20%, transparent)`,\n border: `1px solid ${theme.vars.colors.error.main}`,\n borderRadius: theme.vars.borderRadius.medium,\n color: theme.vars.colors.error.main,\n padding: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n emptyContainer: {\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n textAlign: 'center' as const,\n } as CSSProperties,\n emptyText: {\n color: theme.vars.colors.text.secondary,\n fontSize: '1rem',\n } as CSSProperties,\n loadMoreButton: {\n backgroundColor: theme.vars.colors.primary.main,\n border: 'none',\n borderRadius: theme.vars.borderRadius.medium,\n color: theme.vars.colors.primary.contrastText,\n cursor: 'pointer',\n fontSize: '0.875rem',\n fontWeight: 500,\n padding: `calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 3)`,\n width: '100%',\n transition: 'all 0.2s',\n } as CSSProperties,\n loadMoreButtonDisabled: {\n backgroundColor: theme.vars.colors.text.secondary,\n cursor: 'not-allowed',\n opacity: 0.6,\n } as CSSProperties,\n errorMargin: {\n marginTop: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n loadMoreMargin: {\n marginTop: `calc(${theme.vars.spacing.unit} * 3)`,\n } as CSSProperties,\n popupContent: {\n padding: theme.vars.spacing.unit,\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\nexport default BaseOrganizationList;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\n\nexport interface BuildingAltProps {\n /**\n * Color of the icon.\n */\n color?: string;\n /**\n * Height of the icon.\n */\n height?: number | string;\n /**\n * Width of the icon.\n */\n width?: number | string;\n}\n\n/**\n * Alternative Building Icon component.\n *\n * @param props - Props injected to the component.\n * @returns Alternative Building Icon component.\n */\nconst BuildingAlt: FC<BuildingAltProps> = ({color = 'currentColor', height = 24, width = 24}: BuildingAltProps) => (\n <svg\n width={width}\n height={height}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z\" />\n <path d=\"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2\" />\n <path d=\"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2\" />\n <path d=\"M10 6h4\" />\n <path d=\"M10 10h4\" />\n <path d=\"M10 14h4\" />\n <path d=\"M10 18h4\" />\n </svg>\n);\n\nBuildingAlt.displayName = 'BuildingAlt';\n\nexport default BuildingAlt;\n"],
5
- "mappings": ";;;;;AAkBA;AAAA,EACE,wBAAAA;AAAA,EAGA,gCAAAC;AAAA,EAMA;AAAA,OAGK;AACP,SAAwD,aAAAC,YAAW,WAAAC,UAAS,QAAQ,YAAAC,WAAU,eAAAC,oBAAkB;;;ACdhH,SAAiB,qBAAoB;AA+CrC,IAAM,kBAAwD,cAA2C;AAAA,EACvG,oBAAoB;AAAA,EACpB,eAAe;AAAA,EACf,WAAW;AAAA,EACX,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,eAAe;AAAA,EACf,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AACR,CAAC;AAED,gBAAgB,cAAc;AAE9B,IAAO,0BAAQ;;;AClEf;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAKA;AAAA,EAIA;AAAA,EACA;AAAA,EAEA;AAAA,EAIA;AAAA,EAEA;AAAA,OAEK;;;ACvBP;AAAA,EACE;AAAA,EAKA;AAAA,OASK;AAGP,IAAM,WAAN,MAAM,SAAQ;AAAA,EAQZ,YAAY,WAA+B;AAL3C,wBAAQ,cAAa,SAAQ;AAC7B,wBAAQ;AAER,wBAAQ;AAGN,SAAK,UAAU,aAAa,kBAAkB,YAAY;AAE1D,SAAK,WAAW,KAAK,SAAS,KAAK,IAAI;AACvC,SAAK,OAAO,KAAK,KAAK,KAAK,IAAI;AAC/B,SAAK,SAAS,KAAK,OAAO,KAAK,IAAI;AACnC,SAAK,UA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oBAAAC;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,iBAAiB;AAAA,QAChB,GAAG;AAAA;AAAA,IACN;AAAA,IACA,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAM;AAAA,QACN,cAAc;AAAA,QACd,WAAW,CAAC,QAAsB;AAChC,cAAI,OAAO,sBAAsB;AAC/B,iCAAqB,GAAG;AAAA,UAC1B;AACA,6BAAmB,KAAK;AAAA,QAC1B;AAAA;AAAA,IACF;AAAA,IACC,uBACC,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,gBAAgB,oBAAoB;AAAA,QACpC,MAAK;AAAA,QACL,MAAM;AAAA,QACN,cAAc;AAAA,QACd,YAAY;AAAA,QACZ,iBAAiB,gBAAAA,MAAC,SAAK,YAAE,8BAA8B,GAAE;AAAA,QACzD,eAAe,gBAAAA,MAAC,SAAK,YAAE,4BAA4B,GAAE;AAAA;AAAA,IACvD;AAAA,IAEF,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAM;AAAA,QACN,cAAc;AAAA,QACd,OAAO,EAAE,4CAA4C;AAAA,QACrD,sBAAsB,CAAC,iBAA+B;AACpD,cAAI,sBAAsB;AACxB,iCAAqB,YAAY;AAAA,UACnC;AACA,oCAA0B,KAAK;AAAA,QACjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,IAAO,+BAAQ;",
6
- "names": ["AsgardeoRuntimeError", "generateFlattenedUserProfile", "useEffect", "useMemo", "useState", "useCallback", "AsgardeoSPAClient", "AsgardeoSPAClient", "httpClient", "AsgardeoSPAClient", "httpClient", "AsgardeoSPAClient", "httpClient", "createContext", "useCallback", "useMemo", "useState", "createContext", "jsx", "fallbackLanguage", "useState", "useMemo", "useCallback", "AsgardeoRuntimeError", "useCallback", "useMemo", "useState", "createContext", "jsx", "getAllOrganizations", "useState", "useCallback", "AsgardeoRuntimeError", "useMemo", "useEffect", "useMemo", "useState", "useCallback", "createContext", "createContext", "jsx", "useState", "useEffect", "useMemo", "useCallback", "useCallback", "useEffect", "useState", "jsx", "useState", "useEffect", "useCallback", "useMemo", "createContext", "jsx", "useMemo", "jsx", "useMemo", "useState", "useEffect", "_baseUrl", "useCallback", "AsgardeoRuntimeError", "generateFlattenedUserProfile", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useMemo", "deepMerge", "useContext", "useMemo", "deepMerge", "useState", "useCallback", "withVendorCSSClassPrefix", "clsx", "forwardRef", "useMemo", "withVendorCSSClassPrefix", "clsx", "jsx", "Fragment", "jsx", "jsxs", "useMemo", "clsx", "withVendorCSSClassPrefix", "Fragment", "jsx", "forwardRef", "clsx", "withVendorCSSClassPrefix", "AsgardeoRuntimeError", "forwardRef", "useState", "jsx", "forwardRef", "useState", "AsgardeoRuntimeError", "withVendorCSSClassPrefix", "clsx", "forwardRef", "Fragment", "jsx", "forwardRef", "clsx", "withVendorCSSClassPrefix", "AsgardeoRuntimeError", "forwardRef", "useState", "jsx", "forwardRef", "useState", "AsgardeoRuntimeError", "withVendorCSSClassPrefix", "clsx", "forwardRef", "Fragment", "jsx", "forwardRef", "clsx", "withVendorCSSClassPrefix", "AsgardeoRuntimeError", "forwardRef", "useState", "jsx", "forwardRef", "useState", "AsgardeoRuntimeError", "Fragment", "jsx", "Fragment", "jsx", "Fragment", "jsx", "ApplicationNativeAuthenticationConstants", "AsgardeoAPIError", "withVendorCSSClassPrefix", "clsx", "useEffect", "useState", "useCallback", "useRef", "useMemo", "EmbeddedSignInFlowAuthenticatorKnownIdPType", "ApplicationNativeAuthenticationConstants", "FieldType", "useEffect", "clsx", "clsx", "withVendorCSSClassPrefix", "jsx", "jsx", "jsxs", "jsx", "jsxs", "withVendorCSSClassPrefix", "jsx", "jsxs", "clsx", "clsx", "withVendorCSSClassPrefix", "jsx", "jsxs", "clsx", "useRef", "useEffect", "useState", "clsx", "withVendorCSSClassPrefix", "jsx", "jsxs", "useState", "useRef", "useEffect", "clsx", "useState", "jsx", "jsxs", "jsx", "jsxs", "jsx", "useState", "clsx", "withVendorCSSClassPrefix", "jsx", "jsxs", "clsx", "clsx", "withVendorCSSClassPrefix", "jsx", "jsxs", "clsx", "jsx", "Fragment", "jsx", "jsxs", "useEffect", "FieldType", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "useEffect", "Fragment", "jsx", "jsxs", "useEffect", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "jsx", "jsxs", "jsx", "jsx", "jsxs", "jsx", "jsxs", "jsx", "jsx", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "useEffect", "Fragment", "jsx", "jsxs", "useEffect", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "useEffect", "Fragment", "jsx", "jsxs", "useEffect", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "useEffect", "Fragment", "jsx", "jsxs", "useEffect", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "jsx", "jsx", "jsxs", "jsx", "ApplicationNativeAuthenticationConstants", "EmbeddedSignInFlowAuthenticatorKnownIdPType", "forwardRef", "useMemo", "withVendorCSSClassPrefix", "clsx", "jsx", "jsxs", "jsx", "jsxs", "jsx", "jsxs", "jsx", "jsxs", "jsx", "jsxs", "useMemo", "forwardRef", "clsx", "withVendorCSSClassPrefix", "withVendorCSSClassPrefix", "clsx", "forwardRef", "useMemo", "jsx", "useMemo", "forwardRef", "clsx", "withVendorCSSClassPrefix", "level", "withVendorCSSClassPrefix", "clsx", "useMemo", "Fragment", "jsx", "jsxs", "useMemo", "withVendorCSSClassPrefix", "clsx", "clsx", "withVendorCSSClassPrefix", "jsx", "clsx", "withVendorCSSClassPrefix", "jsx", "jsxs", "ApplicationNativeAuthenticationConstants", "useStyles", "useMemo", "useState", "useRef", "useCallback", "error", "response", "AsgardeoAPIError", "clsx", "withVendorCSSClassPrefix", "useEffect", "variant", "jsx", "EmbeddedFlowComponentType", "withVendorCSSClassPrefix", "AsgardeoAPIError", "clsx", "useEffect", "useState", "useCallback", "useRef", "useMemo", "FieldType", "FieldType", "FieldType", "FieldType", "jsx", "FieldType", "FieldType", "jsx", "jsx", "jsxs", "GoogleButton", "GoogleButton_default", "jsx", "FieldType", "FieldType", "FieldType", "FieldType", "jsx", "jsx", "FieldType", "FieldType", "jsx", "Typography_default", "jsx", "Typography_default", "GoogleButton_default", "jsx", "jsxs", "useStyles", "useMemo", "useState", "useRef", "useCallback", "EmbeddedFlowComponentType", "AsgardeoAPIError", "error", "clsx", "withVendorCSSClassPrefix", "useEffect", "EmbeddedFlowResponseType", "jsx", "EmbeddedFlowResponseType", "Fragment", "jsx", "jsx", "User", "Fragment", "jsx", "jsx", "Organization", "withVendorCSSClassPrefix", "clsx", "useMemo", "useState", "useCallback", "useRef", "withVendorCSSClassPrefix", "clsx", "useMemo", "jsx", "jsxs", "useStyles", "useMemo", "offset", "clsx", "withVendorCSSClassPrefix", "withVendorCSSClassPrefix", "clsx", "useMemo", "jsx", "jsxs", "jsx", "jsxs", "jsx", "jsxs", "User", "User_default", "jsx", "jsxs", "jsx", "jsxs", "useStyles", "useMemo", "withVendorCSSClassPrefix", "clsx", "offset", "useCallback", "useState", "useMemo", "clsx", "withVendorCSSClassPrefix", "jsx", "jsxs", "useStyles", "useMemo", "style", "useCallback", "useState", "clsx", "Fragment", "jsx", "jsxs", "useState", "useRef", "useCallback", "currentUser", "useStyles", "isEditable", "displayValue", "clsx", "withVendorCSSClassPrefix", "useMemo", "AsgardeoSPAClient", "httpClient", "jsx", "UserProfile", "withVendorCSSClassPrefix", "useFloating", "autoUpdate", "offset", "flip", "shift", "useClick", "useDismiss", "useRole", "useInteractions", "FloatingFocusManager", "FloatingPortal", "clsx", "useMemo", "useState", "jsx", "jsxs", "useStyles", "useMemo", "useState", "useFloating", "offset", "flip", "shift", "autoUpdate", "useClick", "useDismiss", "useRole", "useInteractions", "User_default", "clsx", "withVendorCSSClassPrefix", "FloatingPortal", "FloatingFocusManager", "useState", "Fragment", "jsx", "jsxs", "useState", "withVendorCSSClassPrefix", "useFloating", "autoUpdate", "offset", "flip", "shift", "useClick", "useDismiss", "useRole", "useInteractions", "FloatingFocusManager", "FloatingPortal", "clsx", "useMemo", "useState", "jsx", "jsxs", "jsx", "jsx", "Fragment", "jsx", "jsxs", "useStyles", "useMemo", "useState", "useFloating", "offset", "flip", "shift", "autoUpdate", "useClick", "useDismiss", "useRole", "useInteractions", "defaultRenderOrganization", "defaultRenderLoading", "defaultRenderError", "clsx", "withVendorCSSClassPrefix", "FloatingPortal", "FloatingFocusManager", "useState", "useState", "withVendorCSSClassPrefix", "clsx", "useMemo", "useState", "jsx", "jsxs", "useStyles", "useMemo", "useState", "clsx", "withVendorCSSClassPrefix", "AsgardeoSPAClient", "httpClient", "Fragment", "jsx", "useState", "useEffect", "useState", "withVendorCSSClassPrefix", "clsx", "useMemo", "useState", "useCallback", "useRef", "withVendorCSSClassPrefix", "clsx", "useState", "useCallback", "jsx", "jsxs", "useState", "useCallback", "clsx", "withVendorCSSClassPrefix", "Fragment", "jsx", "jsxs", "useState", "useRef", "useCallback", "useStyles", "clsx", "withVendorCSSClassPrefix", "useMemo", "AsgardeoSPAClient", "httpClient", "AsgardeoSPAClient", "httpClient", "jsx", "useState", "useEffect", "useEffect", "useState", "withVendorCSSClassPrefix", "clsx", "useMemo", "jsx", "jsxs", "useStyles", "useMemo", "error", "isLoading", "clsx", "withVendorCSSClassPrefix", "jsx", "getAllOrganizations", "useState", "useEffect", "jsx", "jsxs", "Fragment", "jsx", "jsxs", "useState"]
4
+ "sourcesContent": ["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n AsgardeoRuntimeError,\n EmbeddedFlowExecuteRequestPayload,\n EmbeddedFlowExecuteResponse,\n generateFlattenedUserProfile,\n Organization,\n SignInOptions,\n SignOutOptions,\n User,\n UserProfile,\n getBrandingPreference,\n GetBrandingPreferenceConfig,\n BrandingPreference,\n} from '@asgardeo/browser';\nimport {FC, RefObject, PropsWithChildren, ReactElement, useEffect, useMemo, useRef, useState, useCallback} from 'react';\nimport AsgardeoContext from './AsgardeoContext';\nimport AsgardeoReactClient from '../../AsgardeoReactClient';\nimport useBrowserUrl from '../../hooks/useBrowserUrl';\nimport {AsgardeoReactConfig} from '../../models/config';\nimport FlowProvider from '../Flow/FlowProvider';\nimport I18nProvider from '../I18n/I18nProvider';\nimport OrganizationProvider from '../Organization/OrganizationProvider';\nimport ThemeProvider from '../Theme/ThemeProvider';\nimport BrandingProvider from '../Branding/BrandingProvider';\nimport UserProvider from '../User/UserProvider';\n\n/**\n * Props interface of {@link AsgardeoProvider}\n */\nexport type AsgardeoProviderProps = AsgardeoReactConfig;\n\nconst AsgardeoProvider: FC<PropsWithChildren<AsgardeoProviderProps>> = ({\n afterSignInUrl = window.location.origin,\n afterSignOutUrl = window.location.origin,\n baseUrl: _baseUrl,\n clientId,\n children,\n scopes,\n preferences,\n signInUrl,\n signUpUrl,\n organizationHandle,\n applicationId,\n ...rest\n}: PropsWithChildren<AsgardeoProviderProps>): ReactElement => {\n const reRenderCheckRef: RefObject<boolean> = useRef(false);\n const asgardeo: AsgardeoReactClient = useMemo(() => new AsgardeoReactClient(), []);\n const {hasAuthParams} = useBrowserUrl();\n const [user, setUser] = useState<any | null>(null);\n const [currentOrganization, setCurrentOrganization] = useState<Organization | null>(null);\n\n const [isSignedInSync, setIsSignedInSync] = useState<boolean>(false);\n const [isInitializedSync, setIsInitializedSync] = useState<boolean>(false);\n\n const [myOrganizations, setMyOrganizations] = useState<Organization[]>([]);\n const [userProfile, setUserProfile] = useState<UserProfile | null>(null);\n const [baseUrl, setBaseUrl] = useState<string>(_baseUrl);\n const [config, setConfig] = useState<AsgardeoReactConfig>({\n applicationId,\n organizationHandle,\n afterSignInUrl,\n afterSignOutUrl,\n baseUrl,\n clientId,\n scopes,\n signUpUrl,\n signInUrl,\n ...rest,\n });\n\n // Branding state\n const [brandingPreference, setBrandingPreference] = useState<BrandingPreference | null>(null);\n const [isBrandingLoading, setIsBrandingLoading] = useState<boolean>(false);\n const [brandingError, setBrandingError] = useState<Error | null>(null);\n const [hasFetchedBranding, setHasFetchedBranding] = useState<boolean>(false);\n\n useEffect(() => {\n setBaseUrl(_baseUrl);\n // Reset branding state when baseUrl changes\n if (_baseUrl !== baseUrl) {\n setHasFetchedBranding(false);\n setBrandingPreference(null);\n setBrandingError(null);\n }\n }, [_baseUrl, baseUrl]);\n\n useEffect(() => {\n (async (): Promise<void> => {\n await asgardeo.initialize(config);\n setConfig(await asgardeo.getConfiguration());\n })();\n }, []);\n\n /**\n * Try signing in when the component is mounted.\n */\n useEffect(() => {\n // React 18.x Strict.Mode has a new check for `Ensuring reusable state` to facilitate an upcoming react feature.\n // https://reactjs.org/docs/strict-mode.html#ensuring-reusable-state\n // This will remount all the useEffects to ensure that there are no unexpected side effects.\n // When react remounts the signIn hook of the AuthProvider, it will cause a race condition. Hence, we have to\n // prevent the re-render of this hook as suggested in the following discussion.\n // https://github.com/reactwg/react-18/discussions/18#discussioncomment-795623\n if (reRenderCheckRef.current) {\n return;\n }\n\n reRenderCheckRef.current = true;\n\n (async (): Promise<void> => {\n // User is already authenticated. Skip...\n if (await asgardeo.isSignedIn()) {\n await updateSession();\n\n return;\n }\n\n if (hasAuthParams(new URL(window.location.href), afterSignInUrl)) {\n try {\n await signIn(\n {callOnlyOnRedirect: true},\n // authParams?.authorizationCode,\n // authParams?.sessionState,\n // authParams?.state,\n );\n\n // setError(null);\n } catch (error) {\n if (error && Object.prototype.hasOwnProperty.call(error, 'code')) {\n // setError(error);\n }\n }\n }\n })();\n }, []);\n\n /**\n * Check if the user is signed in and update the state accordingly.\n * This will also set an interval to check for the sign-in status every second\n * until the user is signed in.\n */\n useEffect(() => {\n let interval: NodeJS.Timeout;\n\n (async (): Promise<void> => {\n try {\n const status: boolean = await asgardeo.isSignedIn();\n\n setIsSignedInSync(status);\n\n if (!status) {\n interval = setInterval(async () => {\n const newStatus: boolean = await asgardeo.isSignedIn();\n\n if (newStatus) {\n setIsSignedInSync(true);\n clearInterval(interval);\n }\n }, 1000);\n }\n } catch (error) {\n setIsSignedInSync(false);\n }\n })();\n\n return (): void => {\n if (interval) {\n clearInterval(interval);\n }\n };\n }, [asgardeo]);\n\n useEffect(() => {\n (async (): Promise<void> => {\n try {\n const status: boolean = await asgardeo.isInitialized();\n\n setIsInitializedSync(status);\n } catch (error) {\n setIsInitializedSync(false);\n }\n })();\n }, [asgardeo]);\n\n const updateSession = async (): Promise<void> => {\n let _baseUrl: string = baseUrl;\n\n // If there's a `user_org` claim in the ID token,\n // Treat this login as a organization login.\n if ((await asgardeo.getDecodedIdToken())?.['user_org']) {\n _baseUrl = `${(await asgardeo.getConfiguration()).baseUrl}/o`;\n setBaseUrl(_baseUrl);\n }\n\n setUser(await asgardeo.getUser({baseUrl: _baseUrl}));\n setUserProfile(await asgardeo.getUserProfile({baseUrl: _baseUrl}));\n setCurrentOrganization(await asgardeo.getCurrentOrganization());\n setMyOrganizations(await asgardeo.getMyOrganizations());\n };\n\n // Branding fetch function\n const fetchBranding = useCallback(async (): Promise<void> => {\n if (!baseUrl) {\n return;\n }\n\n // Prevent multiple calls if already fetching\n if (isBrandingLoading) {\n return;\n }\n\n setIsBrandingLoading(true);\n setBrandingError(null);\n\n try {\n const getBrandingConfig: GetBrandingPreferenceConfig = {\n baseUrl,\n locale: preferences?.i18n?.language,\n // Add other branding config options as needed\n };\n\n const brandingData = await getBrandingPreference(getBrandingConfig);\n setBrandingPreference(brandingData);\n setHasFetchedBranding(true);\n } catch (err) {\n const errorMessage = err instanceof Error ? err : new Error('Failed to fetch branding preference');\n setBrandingError(errorMessage);\n setBrandingPreference(null);\n setHasFetchedBranding(true); // Mark as fetched even on error to prevent retries\n } finally {\n setIsBrandingLoading(false);\n }\n }, [baseUrl, preferences?.i18n?.language]);\n\n // Refetch branding function\n const refetchBranding = useCallback(async (): Promise<void> => {\n setHasFetchedBranding(false); // Reset the flag to allow refetching\n await fetchBranding();\n }, [fetchBranding]);\n\n // Auto-fetch branding when initialized and configured\n useEffect(() => {\n // Enable branding by default or when explicitly enabled\n const shouldFetchBranding = preferences?.theme?.inheritFromBranding !== false;\n\n if (shouldFetchBranding && isInitializedSync && baseUrl && !hasFetchedBranding && !isBrandingLoading) {\n fetchBranding();\n }\n }, [\n preferences?.theme?.inheritFromBranding,\n isInitializedSync,\n baseUrl,\n hasFetchedBranding,\n isBrandingLoading,\n fetchBranding,\n ]);\n\n const signIn = async (...args: any): Promise<User> => {\n try {\n const response: User = await asgardeo.signIn(...args);\n\n if (await asgardeo.isSignedIn()) {\n await updateSession();\n }\n\n return response;\n } catch (error) {\n throw new Error(`Error while signing in: ${error}`);\n }\n };\n\n const signUp = async (payload?: EmbeddedFlowExecuteRequestPayload): Promise<void | EmbeddedFlowExecuteResponse> => {\n try {\n return await asgardeo.signUp(payload);\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Error while signing up: ${error.message || error}`,\n 'asgardeo-signUp-Error',\n 'react',\n 'An error occurred while trying to sign up.',\n );\n }\n };\n\n const signOut = async (options?: SignOutOptions, afterSignOut?: () => void): Promise<string> =>\n asgardeo.signOut(options, afterSignOut);\n\n const switchOrganization = async (organization: Organization): Promise<void> => {\n try {\n await asgardeo.switchOrganization(organization);\n\n if (await asgardeo.isSignedIn()) {\n await updateSession();\n }\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Failed to switch organization: ${error.message || error}`,\n 'asgardeo-switchOrganization-Error',\n 'react',\n 'An error occurred while switching to the specified organization.',\n );\n }\n };\n\n const isDarkMode: boolean = useMemo(() => {\n if (!preferences?.theme?.mode || preferences.theme.mode === 'system') {\n return window.matchMedia('(prefers-color-scheme: dark)').matches;\n }\n return preferences.theme.mode === 'dark';\n }, [preferences?.theme?.mode]);\n\n const handleProfileUpdate = (payload: User): void => {\n setUser(payload);\n setUserProfile(prev => ({\n ...prev,\n profile: payload,\n flattenedProfile: generateFlattenedUserProfile(payload, prev?.schemas),\n }));\n };\n\n return (\n <AsgardeoContext.Provider\n value={{\n applicationId,\n organizationHandle: config?.organizationHandle,\n signInUrl,\n signUpUrl,\n afterSignInUrl,\n baseUrl,\n isInitialized: isInitializedSync,\n isLoading: asgardeo.isLoading(),\n isSignedIn: isSignedInSync,\n organization: currentOrganization,\n signIn,\n signOut,\n signUp,\n user,\n }}\n >\n <I18nProvider preferences={preferences?.i18n}>\n <BrandingProvider\n brandingPreference={brandingPreference}\n isLoading={isBrandingLoading}\n error={brandingError}\n enabled={preferences?.theme?.inheritFromBranding !== false}\n refetch={refetchBranding}\n >\n <ThemeProvider\n inheritFromBranding={preferences?.theme?.inheritFromBranding}\n theme={preferences?.theme?.overrides}\n mode={isDarkMode ? 'dark' : 'light'}\n >\n <FlowProvider>\n <UserProvider profile={userProfile} onUpdateProfile={handleProfileUpdate}>\n <OrganizationProvider\n getAllOrganizations={async () => await asgardeo.getAllOrganizations()}\n myOrganizations={myOrganizations}\n currentOrganization={currentOrganization}\n onOrganizationSwitch={switchOrganization}\n revalidateMyOrganizations={async () => await asgardeo.getMyOrganizations()}\n >\n {children}\n </OrganizationProvider>\n </UserProvider>\n </FlowProvider>\n </ThemeProvider>\n </BrandingProvider>\n </I18nProvider>\n </AsgardeoContext.Provider>\n );\n};\n\nexport default AsgardeoProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {Context, createContext} from 'react';\nimport {Organization} from '@asgardeo/browser';\n\n/**\n * Props interface of {@link AsgardeoContext}\n */\nexport type AsgardeoContextProps = {\n organizationHandle: string | undefined;\n applicationId: string | undefined;\n signInUrl: string | undefined;\n signUpUrl: string | undefined;\n afterSignInUrl: string | undefined;\n baseUrl: string | undefined;\n isInitialized: boolean;\n /**\n * Flag indicating whether the SDK is working in the background.\n */\n isLoading: boolean;\n /**\n * Flag indicating whether the user is signed in or not.\n */\n isSignedIn: boolean;\n /**\n * Sign-in function to initiate the authentication process.\n * @remark This is the programmatic version of the `SignInButton` component.\n * TODO: Fix the types.\n */\n signIn: any;\n /**\n * Sign-out function to terminate the authentication session.\n * @remark This is the programmatic version of the `SignOutButton` component.\n * FIXME: Fix the types.\n */\n signOut: any;\n /**\n * Sign-up function to initiate the registration process.\n * @remark This is the programmatic version of the `SignUpButton` component.\n * FIXME: Fix the types.\n */\n signUp: any;\n user: any;\n organization: Organization;\n};\n\n/**\n * Context object for managing the Authentication flow builder core context.\n */\nconst AsgardeoContext: Context<AsgardeoContextProps | null> = createContext<null | AsgardeoContextProps>({\n organizationHandle: undefined,\n applicationId: undefined,\n signInUrl: undefined,\n signUpUrl: undefined,\n afterSignInUrl: undefined,\n baseUrl: undefined,\n isInitialized: false,\n isLoading: true,\n isSignedIn: false,\n organization: null,\n signIn: null,\n signOut: null,\n signUp: null,\n user: null,\n});\n\nAsgardeoContext.displayName = 'AsgardeoContext';\n\nexport default AsgardeoContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n AsgardeoBrowserClient,\n flattenUserSchema,\n generateFlattenedUserProfile,\n UserProfile,\n SignInOptions,\n SignOutOptions,\n User,\n generateUserProfile,\n EmbeddedFlowExecuteResponse,\n SignUpOptions,\n EmbeddedFlowExecuteRequestPayload,\n AsgardeoRuntimeError,\n executeEmbeddedSignUpFlow,\n EmbeddedSignInFlowHandleRequestPayload,\n executeEmbeddedSignInFlow,\n Organization,\n IdToken,\n EmbeddedFlowExecuteRequestConfig,\n deriveOrganizationHandleFromBaseUrl,\n AllOrganizationsApiResponse,\n extractUserClaimsFromIdToken,\n TokenResponse,\n} from '@asgardeo/browser';\nimport AuthAPI from './__temp__/api';\nimport getMeOrganizations from './api/getMeOrganizations';\nimport getScim2Me from './api/getScim2Me';\nimport getSchemas from './api/getSchemas';\nimport {AsgardeoReactConfig} from './models/config';\nimport getAllOrganizations from './api/getAllOrganizations';\n\n/**\n * Client for mplementing Asgardeo in React applications.\n * This class provides the core functionality for managing user authentication and sessions.\n *\n * @typeParam T - Configuration type that extends AsgardeoReactConfig.\n */\nclass AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> extends AsgardeoBrowserClient<T> {\n private asgardeo: AuthAPI;\n\n constructor() {\n super();\n\n // FIXME: This has to be the browser client from `@asgardeo/browser` package.\n this.asgardeo = new AuthAPI();\n }\n\n override initialize(config: AsgardeoReactConfig): Promise<boolean> {\n let resolvedOrganizationHandle: string | undefined = config?.organizationHandle;\n\n if (!resolvedOrganizationHandle) {\n resolvedOrganizationHandle = deriveOrganizationHandleFromBaseUrl(config?.baseUrl);\n }\n\n return this.asgardeo.init({...config, organizationHandle: resolvedOrganizationHandle} as any);\n }\n\n override async updateUserProfile(payload: any, userId?: string): Promise<User> {\n throw new Error('Not implemented');\n }\n\n override async getUser(options?: any): Promise<User> {\n try {\n let baseUrl = options?.baseUrl;\n\n if (!baseUrl) {\n const configData = await this.asgardeo.getConfigData();\n baseUrl = configData?.baseUrl;\n }\n\n const profile = await getScim2Me({baseUrl});\n const schemas = await getSchemas({baseUrl});\n\n return generateUserProfile(profile, flattenUserSchema(schemas));\n } catch (error) {\n return extractUserClaimsFromIdToken(await this.getDecodedIdToken());\n }\n }\n\n async getDecodedIdToken(sessionId?: string): Promise<IdToken> {\n return this.asgardeo.getDecodedIdToken(sessionId);\n }\n\n async getUserProfile(options?: any): Promise<UserProfile> {\n try {\n let baseUrl = options?.baseUrl;\n\n if (!baseUrl) {\n const configData = await this.asgardeo.getConfigData();\n baseUrl = configData?.baseUrl;\n }\n\n const profile = await getScim2Me({baseUrl});\n const schemas = await getSchemas({baseUrl});\n\n const processedSchemas = flattenUserSchema(schemas);\n\n const output = {\n schemas: processedSchemas,\n flattenedProfile: generateFlattenedUserProfile(profile, processedSchemas),\n profile,\n };\n\n return output;\n } catch (error) {\n return {\n schemas: [],\n flattenedProfile: extractUserClaimsFromIdToken(await this.getDecodedIdToken()),\n profile: extractUserClaimsFromIdToken(await this.getDecodedIdToken()),\n };\n }\n }\n\n override async getMyOrganizations(options?: any, sessionId?: string): Promise<Organization[]> {\n try {\n let baseUrl = options?.baseUrl;\n\n if (!baseUrl) {\n const configData = await this.asgardeo.getConfigData();\n baseUrl = configData?.baseUrl;\n }\n\n return getMeOrganizations({baseUrl});\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Failed to fetch the user's associated organizations: ${\n error instanceof Error ? error.message : String(error)\n }`,\n 'AsgardeoReactClient-getMyOrganizations-RuntimeError-001',\n 'react',\n 'An error occurred while fetching associated organizations of the signed-in user.',\n );\n }\n }\n\n override async getAllOrganizations(options?: any, sessionId?: string): Promise<AllOrganizationsApiResponse> {\n try {\n let baseUrl = options?.baseUrl;\n\n if (!baseUrl) {\n const configData = await this.asgardeo.getConfigData();\n baseUrl = configData?.baseUrl;\n }\n\n return getAllOrganizations({baseUrl});\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Failed to fetch all organizations: ${error instanceof Error ? error.message : String(error)}`,\n 'AsgardeoReactClient-getAllOrganizations-RuntimeError-001',\n 'react',\n 'An error occurred while fetching all the organizations associated with the user.',\n );\n }\n }\n\n override async getCurrentOrganization(): Promise<Organization | null> {\n const idToken: IdToken = await this.getDecodedIdToken();\n\n return {\n orgHandle: idToken?.org_handle,\n name: idToken?.org_name,\n id: idToken?.org_id,\n };\n }\n\n override async switchOrganization(organization: Organization, sessionId?: string): Promise<TokenResponse | Response> {\n try {\n const configData = await this.asgardeo.getConfigData();\n const scopes = configData?.scopes;\n\n if (!organization.id) {\n throw new AsgardeoRuntimeError(\n 'Organization ID is required for switching organizations',\n 'react-AsgardeoReactClient-SwitchOrganizationError-001',\n 'react',\n 'The organization object must contain a valid ID to perform the organization switch.',\n );\n }\n\n const exchangeConfig = {\n attachToken: false,\n data: {\n client_id: '{{clientId}}',\n grant_type: 'organization_switch',\n scope: '{{scopes}}',\n switching_organization: organization.id,\n token: '{{accessToken}}',\n },\n id: 'organization-switch',\n returnsSession: true,\n signInRequired: true,\n };\n\n return await this.asgardeo.exchangeToken(\n exchangeConfig,\n (user: User) => {},\n () => null,\n ) as TokenResponse | Response;\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Failed to switch organization: ${error.message || error}`,\n 'react-AsgardeoReactClient-SwitchOrganizationError-003',\n 'react',\n 'An error occurred while switching to the specified organization. Please try again.',\n );\n }\n }\n\n override isLoading(): boolean {\n return this.asgardeo.isLoading();\n }\n\n async isInitialized(): Promise<boolean> {\n return this.asgardeo.isInitialized();\n }\n\n override isSignedIn(): Promise<boolean> {\n return this.asgardeo.isSignedIn();\n }\n\n override getConfiguration(): T {\n return this.asgardeo.getConfigData() as unknown as T;\n }\n\n override signIn(\n options?: SignInOptions,\n sessionId?: string,\n onSignInSuccess?: (afterSignInUrl: string) => void,\n ): Promise<User>;\n override signIn(\n payload: EmbeddedSignInFlowHandleRequestPayload,\n request: EmbeddedFlowExecuteRequestConfig,\n sessionId?: string,\n onSignInSuccess?: (afterSignInUrl: string) => void,\n ): Promise<User>;\n override async signIn(...args: any[]): Promise<User> {\n const arg1 = args[0];\n const arg2 = args[1];\n\n if (typeof arg1 === 'object' && 'flowId' in arg1 && typeof arg2 === 'object' && 'url' in arg2) {\n return executeEmbeddedSignInFlow({\n payload: arg1,\n url: arg2.url,\n });\n }\n\n return (await this.asgardeo.signIn(arg1 as any)) as unknown as Promise<User>;\n }\n\n override signOut(options?: SignOutOptions, afterSignOut?: (afterSignOutUrl: string) => void): Promise<string>;\n override signOut(\n options?: SignOutOptions,\n sessionId?: string,\n afterSignOut?: (afterSignOutUrl: string) => void,\n ): Promise<string>;\n override async signOut(...args: any[]): Promise<string> {\n if (args[1] && typeof args[1] !== 'function') {\n throw new Error('The second argument must be a function.');\n }\n\n const response: boolean = await this.asgardeo.signOut(args[1]);\n\n return Promise.resolve(String(response));\n }\n\n override async signUp(options?: SignUpOptions): Promise<void>;\n override async signUp(payload: EmbeddedFlowExecuteRequestPayload): Promise<EmbeddedFlowExecuteResponse>;\n override async signUp(...args: any[]): Promise<void | EmbeddedFlowExecuteResponse> {\n if (args.length === 0) {\n throw new AsgardeoRuntimeError(\n 'No arguments provided for signUp method.',\n 'react-AsgardeoReactClient-ValidationError-001',\n 'react',\n 'The signUp method requires at least one argument, either a SignUpOptions object or an EmbeddedFlowExecuteRequestPayload.',\n );\n }\n\n const firstArg = args[0];\n\n if (typeof firstArg === 'object' && 'flowType' in firstArg) {\n const configData = await this.asgardeo.getConfigData();\n const baseUrl: string = configData?.baseUrl;\n\n return executeEmbeddedSignUpFlow({\n baseUrl,\n payload: firstArg as EmbeddedFlowExecuteRequestPayload,\n });\n }\n throw new AsgardeoRuntimeError(\n 'Not implemented',\n 'react-AsgardeoReactClient-ValidationError-002',\n 'react',\n 'The signUp method with SignUpOptions is not implemented in the React client.',\n );\n }\n}\n\nexport default AsgardeoReactClient;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n AsgardeoSPAClient,\n AuthClientConfig,\n User,\n LegacyConfig as Config,\n IdToken,\n Hooks,\n HttpClientInstance,\n HttpRequestConfig,\n HttpResponse,\n OIDCEndpoints,\n SignInConfig,\n SPACustomGrantConfig,\n initializeEmbeddedSignInFlow,\n processOpenIDScopes,\n} from '@asgardeo/browser';\nimport {AuthStateInterface} from './models';\n\nclass AuthAPI {\n static DEFAULT_STATE: AuthStateInterface;\n\n private _authState = AuthAPI.DEFAULT_STATE;\n private _client: AsgardeoSPAClient;\n\n private _isLoading: boolean;\n\n constructor(spaClient?: AsgardeoSPAClient) {\n this._client = spaClient ?? AsgardeoSPAClient.getInstance();\n\n this.getState = this.getState.bind(this);\n this.init = this.init.bind(this);\n this.signIn = this.signIn.bind(this);\n this.signOut = this.signOut.bind(this);\n this.updateState = this.updateState.bind(this);\n }\n\n public _setIsLoading(isLoading: boolean): void {\n this._isLoading = isLoading;\n }\n\n public _getIsLoading(): boolean {\n return this._isLoading;\n }\n\n public isLoading(): boolean {\n return this._getIsLoading();\n }\n\n /**\n * Method to return Auth Client instance authentication state.\n *\n * @return {AuthStateInterface} Authentication State.\n */\n public getState(): AuthStateInterface {\n return this._authState;\n }\n\n /**\n * Method to initialize the AuthClient instance.\n *\n * @param {Config} config - `dispatch` function from React Auth Context.\n */\n public async init(config: AuthClientConfig<Config>): Promise<boolean> {\n return this._client.initialize(config);\n }\n\n /**\n * Method to get the configuration data.\n *\n * @returns {Promise<AuthClientConfig<Config>>} - A promise that resolves with the configuration data.\n */\n public async getConfigData(): Promise<AuthClientConfig<Config>> {\n return this._client.getConfigData();\n }\n\n /**\n * Method to get the configuration data.\n *\n * @returns {Promise<AuthClientConfig<Config>>} - A promise that resolves with the configuration data.\n */\n public async isInitialized(): Promise<boolean> {\n // Wait for initialization to complete\n return this._client.isInitialized();\n }\n\n /**\n * Method to handle user Sign In requests.\n *\n * @param {any} dispatch - `dispatch` function from React Auth Context.\n * @param {AuthStateInterface} state - Current authentication state in React Auth Context.\n * @param {any} callback - Action to trigger on successful sign in.\n */\n public async signIn(\n // dispatch: (state: AuthStateInterface) => void,\n // state: AuthStateInterface,\n config: SignInConfig,\n authorizationCode?: string,\n sessionState?: string,\n authState?: string,\n callback?: (response: User) => void,\n tokenRequestConfig?: {\n params: Record<string, unknown>;\n },\n ): Promise<any> {\n return this._client\n .signIn(config, authorizationCode, sessionState, authState, tokenRequestConfig)\n .then(async (response: User) => {\n if (!response) {\n return null; // FIXME: Validate this. Temp fix for: error TS7030: Not all code paths return a value.\n }\n\n if (await this._client.isSignedIn()) {\n const stateToUpdate = {\n displayName: response.displayName,\n email: response.email,\n isSignedIn: true,\n isLoading: false,\n isSigningOut: false,\n username: response.username,\n };\n\n this.updateState(stateToUpdate);\n\n // dispatch({...state, ...stateToUpdate});\n this._setIsLoading(false);\n\n if (callback) {\n callback(response);\n }\n }\n\n return response;\n })\n .catch(error => Promise.reject(error));\n }\n\n /**\n * Method to handle user Sign Out requests.\n *\n * @param {any} dispatch - `dispatch` function from React Auth Context.\n * @param {AuthStateInterface} state - Current authentication state in React Auth Context.\n * @param {any} callback - Action to trigger on successful sign out.\n */\n public signOut(callback?: (response?: boolean) => void): Promise<boolean> {\n return this._client\n .signOut()\n .then(response => {\n if (callback) {\n callback(response);\n }\n\n return response;\n })\n .catch(error => Promise.reject(error));\n }\n\n /**\n * Method to update Auth Client instance authentication state.\n *\n * @param {AuthStateInterface} state - State values to update in authentication state.\n */\n public updateState(state: AuthStateInterface): void {\n this._authState = {...this._authState, ...state};\n }\n\n /**\n * This method returns a Promise that resolves with the basic user information obtained from the ID token.\n *\n * @return {Promise<User>} - A promise that resolves with the user information.\n */\n public async getUser(): Promise<User> {\n return this._client.getUser();\n }\n\n /**\n * This method sends an API request to a protected endpoint.\n * The access token is automatically attached to the header of the request.\n * This is the only way by which protected endpoints can be accessed\n * when the web worker is used to store session information.\n *\n * @param {HttpRequestConfig} config - The config object containing attributes necessary to send a request.\n *\n * @return {Promise<Response>} - Returns a Promise that resolves with the response to the request.\n */\n public async httpRequest(config: HttpRequestConfig): Promise<HttpResponse<any>> {\n return this._client.httpRequest(config);\n }\n\n /**\n * This method sends multiple API requests to a protected endpoint.\n * The access token is automatically attached to the header of the request.\n * This is the only way by which multiple requests can be sent to protected endpoints\n * when the web worker is used to store session information.\n *\n * @param {HttpRequestConfig[]} config - The config object containing attributes necessary to send a request.\n *\n * @return {Promise<Response>} - Returns a Promise that resolves with the responses to the requests.\n */\n public async httpRequestAll(configs: HttpRequestConfig[]): Promise<HttpResponse<any>[]> {\n return this._client.httpRequestAll(configs);\n }\n\n /**\n * This method allows you to send a request with a custom grant.\n *\n * @param {CustomGrantRequestParams} config - The request parameters.\n *\n * @return {Promise<Response | SignInResponse>} - A Promise that resolves with\n * the value returned by the custom grant request.\n */\n public exchangeToken(\n config: SPACustomGrantConfig,\n callback: (response: User | Response) => void,\n dispatch: (state: AuthStateInterface) => void,\n ): Promise<User | Response> {\n return this._client\n .exchangeToken(config)\n .then((response: User | Response) => {\n if (!response) {\n return null; // FIXME: Validate this. Temp fix for: error TS7030: Not all code paths return a value.\n }\n\n if (config.returnsSession) {\n this.updateState({\n ...this.getState(),\n ...(response as User),\n isSignedIn: true,\n isLoading: false,\n });\n\n dispatch({...(response as User), isSignedIn: true, isLoading: false});\n }\n\n callback && callback(response);\n\n return response;\n })\n .catch(error => Promise.reject(error));\n }\n\n /**\n * This method ends a user session. The access token is revoked and the session information is destroyed.\n *\n * @return {Promise<boolean>} - A promise that resolves with `true` if the process is successful.\n */\n public async revokeAccessToken(dispatch: (state: AuthStateInterface) => void): Promise<boolean> {\n return this._client\n .revokeAccessToken()\n .then(() => {\n this.updateState({...AuthAPI.DEFAULT_STATE, isLoading: false});\n dispatch(AuthAPI.DEFAULT_STATE);\n return true;\n })\n .catch(error => Promise.reject(error));\n }\n\n /**\n * This method returns a Promise that resolves with an object containing the service endpoints.\n *\n * @return {Promise<ServiceResourcesType} - A Promise that resolves with an object containing the service endpoints.\n */\n public async getOpenIDProviderEndpoints(): Promise<OIDCEndpoints> {\n return this._client.getOpenIDProviderEndpoints();\n }\n\n /**\n * This methods returns the Axios http client.\n *\n * @return {HttpClientInstance} - The Axios HTTP client.\n */\n public async getHttpClient(): Promise<HttpClientInstance> {\n return this._client.getHttpClient();\n }\n\n /**\n * This method decodes the payload of the id token and returns it.\n *\n * @return {Promise<DecodedIDTokenPayloadInterface>} - A Promise that resolves with\n * the decoded payload of the id token.\n */\n public async getDecodedIdToken(sessionId?: string): Promise<IdToken> {\n return this._client.getDecodedIdToken(sessionId);\n }\n\n /**\n * This method decodes the payload of the idp id token and returns it.\n *\n * @return {Promise<DecodedIDTokenPayloadInterface>} - A Promise that resolves with\n * the decoded payload of the idp id token.\n */\n public async getDecodedIDPIDToken(): Promise<IdToken> {\n return this._client.getDecodedIdToken();\n }\n\n /**\n * This method returns the ID token.\n *\n * @return {Promise<string>} - A Promise that resolves with the id token.\n */\n public async getIdToken(): Promise<string> {\n return this._client.getIdToken();\n }\n\n /**\n * This method return a Promise that resolves with the access token.\n *\n * **This method will not return the access token if the storage type is set to `webWorker`.**\n *\n * @return {Promise<string>} - A Promise that resolves with the access token.\n */\n public async getAccessToken(): Promise<string> {\n return this._client.getAccessToken();\n }\n\n /**\n * This method return a Promise that resolves with the idp access token.\n *\n * **This method will not return the idp access token if the storage type is set to `webWorker`.**\n * **This can be used to access the IDP access token when custom auth grant functionalities are used**\n *\n * @return {Promise<string>} - A Promise that resolves with the idp access token.\n */\n public async getIDPAccessToken(): Promise<string> {\n return this._client.getIDPAccessToken();\n }\n\n /**\n * This method refreshes the access token.\n *\n * @return {TokenResponseInterface} - A Promise that resolves with an object containing\n * information about the refreshed access token.\n */\n public async refreshAccessToken(): Promise<User> {\n return this._client.refreshAccessToken();\n }\n\n /**\n * This method specifies if the user is authenticated or not.\n *\n * @return {Promise<boolean>} - A Promise that resolves with `true` if teh user is authenticated.\n */\n public async isSignedIn(): Promise<boolean> {\n return this._client.isSignedIn();\n }\n\n /**\n * This method specifies if the session is active or not.\n *\n * @return {Promise<boolean>} - A Promise that resolves with `true` if there is an active session.\n */\n public async isSessionActive(): Promise<boolean> {\n return this._client.isSessionActive();\n }\n\n /**\n * This method enables callback functions attached to the http client.\n *\n * @return {Promise<boolean>} - A promise that resolves with True.\n *\n */\n public async enableHttpHandler(): Promise<boolean> {\n return this._client.enableHttpHandler();\n }\n\n /**\n * This method disables callback functions attached to the http client.\n *\n * @return {Promise<boolean>} - A promise that resolves with True.\n */\n public async disableHttpHandler(): Promise<boolean> {\n return this._client.disableHttpHandler();\n }\n\n /**\n * This method updates the configuration that was passed into the constructor when instantiating this class.\n *\n * @param {Partial<AuthClientConfig<T>>} config - A config object to update the SDK configurations with.\n */\n public async reInitialize(config: Partial<AuthClientConfig<Config>>): Promise<void> {\n return this._client.reInitialize(config);\n }\n\n /**\n * This method attaches a callback function to an event hook that fires the callback when the event happens.\n *\n * @param {Hooks.CustomGrant} hook - The name of the hook.\n * @param {(response?: any) => void} callback - The callback function.\n * @param {string} id (optional) - The id of the hook. This is used when multiple custom grants are used.\n *\n */\n public on(hook: Hooks.CustomGrant, callback: (response?: any) => void, id: string): Promise<void>;\n public on(hook: Exclude<Hooks, Hooks.CustomGrant>, callback: (response?: any) => void): Promise<void>;\n public on(hook: Hooks, callback: (response?: any) => void, id?: string): Promise<void> {\n if (hook === Hooks.CustomGrant) {\n return this._client.on(hook, callback, id);\n }\n\n return this._client.on(hook, callback);\n }\n\n /**\n * This method allows you to sign in silently.\n * First, this method sends a prompt none request to see if there is an active user session in the identity server.\n * If there is one, then it requests the access token and stores it. Else, it returns false.\n *\n * @return {Promise<User | boolean>} - A Promise that resolves with the user information after signing in\n * or with `false` if the user is not signed in.\n *\n * @example\n *```\n * client.trySignInSilently()\n *```\n */\n public async trySignInSilently(\n state: AuthStateInterface,\n dispatch: (state: AuthStateInterface) => void,\n additionalParams?: Record<string, string | boolean>,\n tokenRequestConfig?: {params: Record<string, unknown>},\n ): Promise<User | boolean | undefined> {\n return this._client\n .trySignInSilently(additionalParams, tokenRequestConfig)\n .then(async (response: User | boolean) => {\n if (!response) {\n this.updateState({...this.getState(), isLoading: false});\n dispatch({...state, isLoading: false});\n\n return false;\n }\n\n if (await this._client.isSignedIn()) {\n const basicUserInfo = response as User;\n const stateToUpdate = {\n displayName: basicUserInfo.displayName,\n email: basicUserInfo.email,\n isSignedIn: true,\n isLoading: false,\n isSigningOut: false,\n username: basicUserInfo.username,\n };\n\n this.updateState(stateToUpdate);\n\n dispatch({...state, ...stateToUpdate});\n }\n\n return response;\n })\n .catch(error => Promise.reject(error));\n }\n}\n\nAuthAPI.DEFAULT_STATE = {\n displayName: '',\n email: '',\n isSignedIn: false,\n isLoading: true,\n username: '',\n};\n\nexport default AuthAPI;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n Organization,\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n getMeOrganizations as baseGetMeOrganizations,\n GetMeOrganizationsConfig as BaseGetMeOrganizationsConfig,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the getMeOrganizations request (React-specific)\n */\nexport interface GetMeOrganizationsConfig extends Omit<BaseGetMeOrganizationsConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Retrieves the organizations associated with the current user.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object containing baseUrl, optional query parameters, and request config.\n * @returns A promise that resolves with the organizations information.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * try {\n * const organizations = await getMeOrganizations({\n * baseUrl: \"https://api.asgardeo.io/t/<ORGANIZATION>\",\n * after: \"\",\n * before: \"\",\n * filter: \"\",\n * limit: 10,\n * recursive: false\n * });\n * console.log(organizations);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get organizations:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const organizations = await getMeOrganizations({\n * baseUrl: \"https://api.asgardeo.io/t/<ORGANIZATION>\",\n * after: \"\",\n * before: \"\",\n * filter: \"\",\n * limit: 10,\n * recursive: false,\n * fetcher: customFetchFunction\n * });\n * console.log(organizations);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get organizations:', error.message);\n * }\n * }\n * ```\n */\nconst getMeOrganizations = async ({fetcher, ...requestConfig}: GetMeOrganizationsConfig): Promise<Organization[]> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'GET',\n headers: config.headers as Record<string, string>,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetMeOrganizations({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getMeOrganizations;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n User,\n AsgardeoAPIError,\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n getScim2Me as baseGetScim2Me,\n GetScim2MeConfig as BaseGetScim2MeConfig\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the getScim2Me request (React-specific)\n */\nexport interface GetScim2MeConfig extends Omit<BaseGetScim2MeConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Retrieves the user profile information from the specified SCIM2 /Me endpoint.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param requestConfig - Request configuration object.\n * @returns A promise that resolves with the user profile information.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * try {\n * const userProfile = await getScim2Me({\n * url: \"https://api.asgardeo.io/t/<ORGANIZATION>/scim2/Me\",\n * });\n * console.log(userProfile);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get user profile:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const userProfile = await getScim2Me({\n * url: \"https://api.asgardeo.io/t/<ORGANIZATION>/scim2/Me\",\n * fetcher: customFetchFunction\n * });\n * console.log(userProfile);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get user profile:', error.message);\n * }\n * }\n * ```\n */\nconst getScim2Me = async ({fetcher, ...requestConfig}: GetScim2MeConfig): Promise<User> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'GET',\n headers: config.headers as Record<string, string>,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetScim2Me({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getScim2Me;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n Schema,\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n getSchemas as baseGetSchemas,\n GetSchemasConfig as BaseGetSchemasConfig,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the getSchemas request (React-specific)\n */\nexport interface GetSchemasConfig extends Omit<BaseGetSchemasConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Retrieves the SCIM2 schemas from the specified endpoint.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Request configuration object.\n * @returns A promise that resolves with the SCIM2 schemas information.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * try {\n * const schemas = await getSchemas({\n * url: \"https://api.asgardeo.io/t/<ORGANIZATION>/scim2/Schemas\",\n * });\n * console.log(schemas);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get schemas:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const schemas = await getSchemas({\n * url: \"https://api.asgardeo.io/t/<ORGANIZATION>/scim2/Schemas\",\n * fetcher: customFetchFunction\n * });\n * console.log(schemas);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get schemas:', error.message);\n * }\n * }\n * ```\n */\nconst getSchemas = async ({fetcher, ...requestConfig}: GetSchemasConfig): Promise<Schema[]> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'GET',\n headers: config.headers as Record<string, string>,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetSchemas({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getSchemas;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n getAllOrganizations as baseGetAllOrganizations,\n GetAllOrganizationsConfig as BaseGetAllOrganizationsConfig,\n AllOrganizationsApiResponse,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the getAllOrganizations request (React-specific)\n */\nexport interface GetAllOrganizationsConfig extends Omit<BaseGetAllOrganizationsConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Retrieves all organizations with pagination support.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object containing baseUrl, optional query parameters, and request config.\n * @returns A promise that resolves with the paginated organizations information.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * try {\n * const response = await getAllOrganizations({\n * baseUrl: \"https://api.asgardeo.io/t/<ORGANIZATION>\",\n * filter: \"\",\n * limit: 10,\n * recursive: false\n * });\n * console.log(response.organizations);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get organizations:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const response = await getAllOrganizations({\n * baseUrl: \"https://api.asgardeo.io/t/<ORGANIZATION>\",\n * filter: \"\",\n * limit: 10,\n * recursive: false,\n * fetcher: customFetchFunction\n * });\n * console.log(response.organizations);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get organizations:', error.message);\n * }\n * }\n * ```\n */\nconst getAllOrganizations = async ({\n fetcher,\n ...requestConfig\n}: GetAllOrganizationsConfig): Promise<AllOrganizationsApiResponse> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'GET',\n headers: config.headers as Record<string, string>,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetAllOrganizations({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getAllOrganizations;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {hasAuthParamsInUrl} from '@asgardeo/browser';\n\n/**\n * Interface for the useBrowserUrl hook return value.\n */\nexport interface UseBrowserUrl {\n /**\n * Checks if the current URL contains authentication parameters.\n *\n * @param url - The URL object to check for authentication parameters\n * @param afterSignInUrl - The URL where the authorization server should redirect after authentication\n * @returns True if the URL contains authentication parameters and matches the afterSignInUrl, or if it contains an error parameter\n */\n hasAuthParams: (url: URL, afterSignInUrl: string) => boolean;\n}\n\n/**\n * Hook that provides utilities for handling browser URLs in authentication flows.\n *\n * @returns An object containing URL utility functions\n *\n * @example\n * ```tsx\n * const { hasAuthParams } = useBrowserUrl();\n * const url = new URL(window.location.href);\n *\n * if (hasAuthParams(url, \"/after-signin\")) {\n * // Handle authentication callback\n * }\n * ```\n */\nconst useBrowserUrl = (): UseBrowserUrl => {\n const hasAuthParams = (url: URL, afterSignInUrl: string): boolean =>\n (hasAuthParamsInUrl() && new URL(url.origin + url.pathname).toString() === new URL(afterSignInUrl).toString()) ||\n // authParams?.authorizationCode || // FIXME: These are sent externally. Need to see what we can do about this.\n url.searchParams.get('error') !== null;\n\n return {hasAuthParams};\n};\n\nexport default useBrowserUrl;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactElement, useCallback, useMemo, useState} from 'react';\nimport FlowContext, {FlowContextValue, FlowMessage, FlowStep} from './FlowContext';\n\n/**\n * Props for the FlowProvider component.\n */\nexport interface FlowProviderProps {\n /**\n * Initial step to start with.\n */\n initialStep?: FlowStep;\n\n /**\n * Initial title.\n */\n initialTitle?: string;\n\n /**\n * Initial subtitle.\n */\n initialSubtitle?: string;\n\n /**\n * Callback when flow type changes.\n */\n onFlowChange?: (step: FlowStep) => void;\n}\n\n/**\n * Provider component for flow context.\n * Manages shared UI state for authentication flows including titles, messages, and navigation.\n */\nconst FlowProvider: FC<PropsWithChildren<FlowProviderProps>> = ({\n children,\n initialStep = null,\n initialTitle = '',\n initialSubtitle,\n onFlowChange,\n}: PropsWithChildren<FlowProviderProps>): ReactElement => {\n const [currentStep, setCurrentStepState] = useState<FlowStep>(initialStep);\n const [title, setTitle] = useState<string>(initialTitle);\n const [subtitle, setSubtitle] = useState<string | undefined>(initialSubtitle);\n const [messages, setMessages] = useState<FlowMessage[]>([]);\n const [error, setError] = useState<string | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [showBackButton, setShowBackButton] = useState<boolean>(false);\n const [onGoBack, setOnGoBack] = useState<(() => void) | undefined>(undefined);\n\n /**\n * Set the current flow step and notify listeners.\n */\n const setCurrentStep = useCallback(\n (step: FlowStep) => {\n setCurrentStepState(step);\n if (step) {\n setTitle(step.title);\n setSubtitle(step.subtitle);\n setShowBackButton(step.canGoBack ?? false);\n }\n onFlowChange?.(step);\n },\n [onFlowChange],\n );\n\n /**\n * Add a message to the message list.\n */\n const addMessage = useCallback((message: FlowMessage) => {\n const messageWithId = {\n ...message,\n id: message.id ?? `msg-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,\n };\n\n setMessages(prev => [...prev, messageWithId]);\n }, []);\n\n /**\n * Remove a specific message by ID.\n */\n const removeMessage = useCallback((messageId: string) => {\n setMessages(prev => prev.filter(msg => msg.id !== messageId));\n }, []);\n\n /**\n * Clear all messages.\n */\n const clearMessages = useCallback(() => {\n setMessages([]);\n }, []);\n\n /**\n * Reset the flow context to initial state.\n */\n const reset = useCallback(() => {\n setCurrentStepState(initialStep);\n setTitle(initialTitle);\n setSubtitle(initialSubtitle);\n setMessages([]);\n setError(null);\n setIsLoading(false);\n setShowBackButton(false);\n setOnGoBack(undefined);\n }, [initialStep, initialTitle, initialSubtitle]);\n\n /**\n * Navigate to a different authentication flow.\n */\n const navigateToFlow = useCallback(\n (\n flowType: NonNullable<FlowStep>['type'],\n options?: {\n title?: string;\n subtitle?: string;\n metadata?: Record<string, any>;\n },\n ) => {\n const stepId = `${flowType}-${Date.now()}`;\n const step: NonNullable<FlowStep> = {\n id: stepId,\n type: flowType,\n title: options?.title,\n subtitle: options?.subtitle,\n canGoBack: flowType !== 'signin', // Usually allow going back except for main signin\n metadata: options?.metadata,\n };\n\n setCurrentStep(step);\n clearMessages();\n setError(null);\n },\n [setCurrentStep, clearMessages],\n );\n\n const contextValue: FlowContextValue = useMemo(\n () => ({\n currentStep,\n setCurrentStep,\n title,\n setTitle,\n subtitle,\n setSubtitle,\n messages,\n addMessage,\n removeMessage,\n clearMessages,\n error,\n setError,\n isLoading,\n setIsLoading,\n showBackButton,\n setShowBackButton,\n onGoBack,\n setOnGoBack,\n reset,\n navigateToFlow,\n }),\n [\n currentStep,\n setCurrentStep,\n title,\n subtitle,\n messages,\n addMessage,\n removeMessage,\n clearMessages,\n error,\n isLoading,\n showBackButton,\n onGoBack,\n reset,\n navigateToFlow,\n ],\n );\n\n return <FlowContext.Provider value={contextValue}>{children}</FlowContext.Provider>;\n};\n\nexport default FlowProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {createContext} from 'react';\n\n/**\n * Types of authentication flows/steps that can be displayed.\n */\nexport type FlowStep = {\n id: string;\n type: 'signin' | 'signup' | 'organization-signin' | 'forgot-password' | 'reset-password' | 'verify-email' | 'mfa';\n title: string;\n subtitle?: string;\n canGoBack?: boolean;\n metadata?: Record<string, any>;\n} | null;\n\n/**\n * Message types for displaying in authentication flows.\n */\nexport interface FlowMessage {\n id?: string;\n type: 'success' | 'error' | 'warning' | 'info';\n message: string;\n dismissible?: boolean;\n}\n\n/**\n * Context value for managing authentication flow UI state.\n */\nexport interface FlowContextValue {\n // Current step/flow\n currentStep: FlowStep;\n setCurrentStep: (step: FlowStep) => void;\n\n // Title and subtitle\n title: string;\n setTitle: (title: string) => void;\n subtitle?: string;\n setSubtitle: (subtitle?: string) => void;\n\n // Messages\n messages: FlowMessage[];\n addMessage: (message: FlowMessage) => void;\n removeMessage: (messageId: string) => void;\n clearMessages: () => void;\n\n // Error state\n error: string | null;\n setError: (error: string | null) => void;\n\n // Loading state\n isLoading: boolean;\n setIsLoading: (loading: boolean) => void;\n\n // Navigation\n showBackButton: boolean;\n setShowBackButton: (show: boolean) => void;\n onGoBack?: () => void;\n setOnGoBack: (callback?: () => void) => void;\n\n // Utilities\n reset: () => void;\n navigateToFlow: (\n flowType: NonNullable<FlowStep>['type'],\n options?: {\n title?: string;\n subtitle?: string;\n metadata?: Record<string, any>;\n },\n ) => void;\n}\n\n/**\n * Context for managing authentication flow UI state.\n * This context handles titles, messages, navigation, and loading states\n * for authentication flows like SignIn, SignUp, organization signin, etc.\n */\nconst FlowContext = createContext<FlowContextValue | undefined>(undefined);\n\nFlowContext.displayName = 'FlowContext';\n\nexport default FlowContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactElement, useCallback, useEffect, useMemo, useState} from 'react';\nimport {I18nBundle, I18nPreferences, deepMerge} from '@asgardeo/browser';\nimport {getI18nBundles} from '@asgardeo/browser';\nimport I18nContext, {I18nContextValue} from './I18nContext';\n\nconst I18N_LANGUAGE_STORAGE_KEY = 'asgardeo-i18n-language';\n\nexport interface I18nProviderProps {\n /**\n * The i18n preferences from the AsgardeoProvider\n */\n preferences?: I18nPreferences;\n}\n\n/**\n * Detects the browser's default language or returns a fallback\n */\nconst detectBrowserLanguage = (): string => {\n if (typeof window !== 'undefined' && window.navigator) {\n return window.navigator.language || 'en-US';\n }\n return 'en-US';\n};\n\n/**\n * Gets the stored language from localStorage or returns null\n */\nconst getStoredLanguage = (): string | null => {\n if (typeof window !== 'undefined' && window.localStorage) {\n try {\n return window.localStorage.getItem(I18N_LANGUAGE_STORAGE_KEY);\n } catch (error) {\n // localStorage might not be available or accessible\n return null;\n }\n }\n return null;\n};\n\n/**\n * Stores the language in localStorage\n */\nconst storeLanguage = (language: string): void => {\n if (typeof window !== 'undefined' && window.localStorage) {\n try {\n window.localStorage.setItem(I18N_LANGUAGE_STORAGE_KEY, language);\n } catch (error) {\n // localStorage might not be available or accessible\n console.warn('Failed to store language preference:', error);\n }\n }\n};\n\n/**\n * I18nProvider component that manages internationalization state and provides\n * translation functions to child components.\n */\nconst I18nProvider: FC<PropsWithChildren<I18nProviderProps>> = ({\n children,\n preferences,\n}: PropsWithChildren<I18nProviderProps>): ReactElement => {\n // Get default bundles from the browser package\n const defaultBundles = getI18nBundles();\n\n // Determine the initial language based on preference order:\n // 1. User preference from config\n // 2. Stored language in localStorage\n // 3. Browser's default language\n // 4. Fallback language\n const determineInitialLanguage = (): string => {\n const configLanguage = preferences?.language;\n const storedLanguage = getStoredLanguage();\n const browserLanguage = detectBrowserLanguage();\n const fallbackLanguage = preferences?.fallbackLanguage || 'en-US';\n\n return configLanguage || storedLanguage || browserLanguage || fallbackLanguage;\n };\n\n const [currentLanguage, setCurrentLanguage] = useState<string>(determineInitialLanguage);\n\n // Merge default bundles with user-provided bundles\n const mergedBundles = useMemo(() => {\n const merged: Record<string, I18nBundle> = {};\n\n // Add default bundles\n Object.entries(defaultBundles).forEach(([key, bundle]) => {\n // Convert key format (e.g., 'en_US' to 'en-US')\n const languageKey = key.replace('_', '-');\n merged[languageKey] = bundle;\n });\n\n // Add user-provided bundles using deepMerge for better merging\n if (preferences?.bundles) {\n Object.entries(preferences.bundles).forEach(([key, userBundle]) => {\n if (merged[key]) {\n // Deep merge user bundle with existing default bundle\n merged[key] = {\n ...merged[key],\n translations: deepMerge(merged[key].translations, userBundle.translations),\n metadata: userBundle.metadata ? {...merged[key].metadata, ...userBundle.metadata} : merged[key].metadata,\n };\n } else {\n // No default bundle for this language, use user bundle as-is\n merged[key] = userBundle;\n }\n });\n }\n\n return merged;\n }, [defaultBundles, preferences?.bundles]);\n\n const fallbackLanguage = preferences?.fallbackLanguage || 'en-US';\n\n // Update stored language when current language changes\n useEffect(() => {\n storeLanguage(currentLanguage);\n }, [currentLanguage]);\n\n // Translation function\n const t = useCallback(\n (key: string, params?: Record<string, string | number>): string => {\n let translation: string | undefined;\n\n // Try to get translation from current language bundle\n const currentBundle = mergedBundles[currentLanguage];\n if (currentBundle?.translations[key]) {\n translation = currentBundle.translations[key];\n }\n\n // Fallback to fallback language if translation not found\n if (!translation && currentLanguage !== fallbackLanguage) {\n const fallbackBundle = mergedBundles[fallbackLanguage];\n if (fallbackBundle?.translations[key]) {\n translation = fallbackBundle.translations[key];\n }\n }\n\n // If still no translation found, return the key itself\n if (!translation) {\n translation = key;\n }\n\n // Replace parameters if provided\n if (params && Object.keys(params).length > 0) {\n return Object.entries(params).reduce((acc, [paramKey, paramValue]) => {\n return acc.replace(new RegExp(`\\\\{${paramKey}\\\\}`, 'g'), String(paramValue));\n }, translation);\n }\n\n return translation;\n },\n [mergedBundles, currentLanguage, fallbackLanguage],\n );\n\n // Language setter function\n const setLanguage = useCallback(\n (language: string) => {\n if (mergedBundles[language]) {\n setCurrentLanguage(language);\n } else {\n console.warn(\n `Language '${language}' is not available. Available languages: ${Object.keys(mergedBundles).join(', ')}`,\n );\n }\n },\n [mergedBundles],\n );\n\n const contextValue: I18nContextValue = useMemo(\n () => ({\n currentLanguage,\n fallbackLanguage,\n bundles: mergedBundles,\n setLanguage,\n t,\n }),\n [currentLanguage, fallbackLanguage, mergedBundles, setLanguage, t],\n );\n\n return <I18nContext.Provider value={contextValue}>{children}</I18nContext.Provider>;\n};\n\nexport default I18nProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {createContext} from 'react';\nimport {I18nBundle} from '@asgardeo/browser';\n\nexport interface I18nContextValue {\n /**\n * The current language code (e.g., 'en-US', 'fr-FR')\n */\n currentLanguage: string;\n \n /**\n * The fallback language code\n */\n fallbackLanguage: string;\n \n /**\n * All available i18n bundles (default + user provided)\n */\n bundles: Record<string, I18nBundle>;\n \n /**\n * Function to change the current language\n */\n setLanguage: (language: string) => void;\n \n /**\n * Function to get a translation by key with optional parameters\n */\n t: (key: string, params?: Record<string, string | number>) => string;\n}\n\nconst I18nContext = createContext<I18nContextValue | null>(null);\n\nI18nContext.displayName = 'I18nContext';\n\nexport default I18nContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n AsgardeoRuntimeError,\n Organization,\n AllOrganizationsApiResponse,\n CreateOrganizationPayload,\n} from '@asgardeo/browser';\nimport {FC, PropsWithChildren, ReactElement, useCallback, useMemo, useState} from 'react';\nimport OrganizationContext, {OrganizationContextProps} from './OrganizationContext';\n\n/**\n * Props interface of {@link OrganizationProvider}\n */\nexport interface OrganizationProviderProps {\n /**\n * Whether to automatically fetch organizations on mount\n */\n autoFetch?: boolean;\n /**\n * Function to create a new organization.\n */\n createOrganization?: (payload: CreateOrganizationPayload, sessionId: string) => Promise<Organization>;\n /**\n * Initial current organization\n */\n currentOrganization?: Organization | null;\n /**\n * Initial list of organizations\n */\n getAllOrganizations?: () => Promise<AllOrganizationsApiResponse>;\n /**\n * List of organizations the signed-in user belongs to.\n */\n myOrganizations?: Organization[];\n /**\n * Callback function called when an error occurs\n */\n onError?: (error: string) => void;\n /**\n * Callback function called when switching organizations\n */\n onOrganizationSwitch?: (organization: Organization) => Promise<void>;\n /**\n * Refetch the my organizations list.\n * @returns\n */\n revalidateMyOrganizations: () => Promise<Organization[]>;\n}\n\n/**\n * OrganizationProvider component that manages organization data and provides it through OrganizationContext.\n *\n * This provider:\n * - Fetches organization data from the organizations endpoint\n * - Manages current organization state\n * - Provides functions for switching organizations and refreshing data\n * - Handles loading states and errors\n *\n * @example\n * ```tsx\n * // Basic usage with auto-fetch (uses internal API)\n * <OrganizationProvider>\n * <App />\n * </OrganizationProvider>\n *\n * // With custom error handling\n * <OrganizationProvider onError={(error) => console.error('Organization error:', error)}>\n * <App />\n * </OrganizationProvider>\n *\n * // With custom organization switch handler\n * <OrganizationProvider\n * onOrganizationSwitch={(org) => console.log('Switched to:', org.name)}\n * >\n * <App />\n * </OrganizationProvider>\n *\n * // Disable auto-fetch (fetch manually using revalidateMyOrganizations)\n * <OrganizationProvider autoFetch={false}>\n * <App />\n * </OrganizationProvider>\n * ```\n */\nconst OrganizationProvider: FC<PropsWithChildren<OrganizationProviderProps>> = ({\n children,\n currentOrganization,\n onError,\n myOrganizations,\n onOrganizationSwitch,\n revalidateMyOrganizations,\n getAllOrganizations,\n createOrganization,\n}: PropsWithChildren<OrganizationProviderProps>): ReactElement => {\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string | null>(null);\n\n /**\n * Switches to a different organization\n */\n const switchOrganization: (organization: Organization) => Promise<void> = useCallback(\n async (organization: Organization): Promise<void> => {\n if (!onOrganizationSwitch) {\n throw new AsgardeoRuntimeError(\n 'onOrganizationSwitch callback is required',\n 'OrganizationProvider-SwitchError-001',\n 'react',\n 'The onOrganizationSwitch callback must be provided to handle organization switching.',\n );\n }\n\n setIsLoading(true);\n setError(null);\n\n try {\n await onOrganizationSwitch(organization);\n // The organization state will be updated by the parent provider\n } catch (switchError) {\n const errorMessage: string =\n switchError instanceof Error ? switchError.message : 'Failed to switch organization';\n setError(errorMessage);\n if (onError) {\n onError(errorMessage);\n }\n throw switchError; // Re-throw so the UI can handle it\n } finally {\n setIsLoading(false);\n }\n },\n [onOrganizationSwitch, onError],\n );\n\n const contextValue: OrganizationContextProps = useMemo(\n () => ({\n createOrganization,\n currentOrganization,\n error,\n getAllOrganizations,\n isLoading,\n myOrganizations,\n revalidateMyOrganizations,\n switchOrganization,\n }),\n [\n currentOrganization,\n error,\n isLoading,\n myOrganizations,\n switchOrganization,\n revalidateMyOrganizations,\n getAllOrganizations,\n createOrganization,\n ],\n );\n\n return <OrganizationContext.Provider value={contextValue}>{children}</OrganizationContext.Provider>;\n};\n\nexport default OrganizationProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AllOrganizationsApiResponse, Organization, CreateOrganizationPayload} from '@asgardeo/browser';\nimport {Context, createContext} from 'react';\n\n/**\n * Props interface of {@link OrganizationContext}\n */\nexport type OrganizationContextProps = {\n /**\n * Function to create a new organization.\n */\n createOrganization?: (payload: CreateOrganizationPayload, sessionId: string) => Promise<Organization>;\n currentOrganization: Organization | null;\n error: string | null;\n getAllOrganizations: () => Promise<AllOrganizationsApiResponse>;\n isLoading: boolean;\n myOrganizations: Organization[];\n revalidateMyOrganizations: () => Promise<Organization[]>;\n switchOrganization: (organization: Organization) => Promise<void>;\n};\n\n/**\n * Context object for managing organization data and related operations.\n */\nconst OrganizationContext: Context<OrganizationContextProps | null> = createContext<null | OrganizationContextProps>({\n createOrganization: () => null,\n currentOrganization: null,\n error: null,\n getAllOrganizations: () =>\n Promise.resolve({\n count: 0,\n organizations: [],\n }),\n isLoading: false,\n myOrganizations: null,\n revalidateMyOrganizations: () => Promise.resolve([]),\n switchOrganization: () => Promise.resolve(),\n});\n\nOrganizationContext.displayName = 'OrganizationContext';\n\nexport default OrganizationContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactElement, useEffect, useMemo, useState, useCallback} from 'react';\nimport {\n createTheme,\n Theme,\n ThemeConfig,\n ThemeMode,\n RecursivePartial,\n detectThemeMode,\n createClassObserver,\n createMediaQueryListener,\n BrowserThemeDetection,\n ThemePreferences,\n} from '@asgardeo/browser';\nimport ThemeContext from './ThemeContext';\nimport useBrandingContext from '../Branding/useBrandingContext';\n\nexport interface ThemeProviderProps {\n theme?: RecursivePartial<ThemeConfig>;\n /**\n * The theme mode to use for automatic detection\n * - 'light': Always use light theme\n * - 'dark': Always use dark theme\n * - 'system': Use system preference (prefers-color-scheme media query)\n * - 'class': Detect theme based on CSS classes on HTML element\n * - 'branding': Use active theme from branding preference (requires inheritFromBranding=true)\n */\n mode?: ThemeMode | 'branding';\n /**\n * Configuration for theme detection when using 'class' or 'system' mode\n */\n detection?: BrowserThemeDetection;\n /**\n * Configuration for branding integration\n */\n inheritFromBranding?: ThemePreferences['inheritFromBranding'];\n}\n\nconst applyThemeToDOM = (theme: Theme) => {\n Object.entries(theme.cssVariables).forEach(([key, value]) => {\n document.documentElement.style.setProperty(key, value);\n });\n};\n\n/**\n * ThemeProvider component that manages theme state and provides theme context to child components.\n *\n * This provider integrates with Asgardeo branding preferences to automatically apply\n * organization-specific themes while allowing for custom theme overrides.\n *\n * Features:\n * - Automatic theme mode detection (light/dark/system/class)\n * - Integration with Asgardeo branding API through useBranding hook\n * - Merging of branding themes with custom theme configurations\n * - CSS variable injection for easy styling\n * - Loading and error states for branding integration\n *\n * @example\n * Basic usage with branding integration:\n * ```tsx\n * <ThemeProvider inheritFromBranding={true}>\n * <App />\n * </ThemeProvider>\n * ```\n *\n * @example\n * With custom theme overrides:\n * ```tsx\n * <ThemeProvider\n * theme={{\n * colors: {\n * primary: { main: '#custom-color' }\n * }\n * }}\n * inheritFromBranding={true}\n * >\n * <App />\n * </ThemeProvider>\n * ```\n *\n * @example\n * With branding-driven theme mode:\n * ```tsx\n * <ThemeProvider\n * mode=\"branding\"\n * inheritFromBranding={true}\n * >\n * <App />\n * </ThemeProvider>\n * ```\n */\nconst ThemeProvider: FC<PropsWithChildren<ThemeProviderProps>> = ({\n children,\n theme: themeConfig,\n mode = 'system',\n detection = {},\n inheritFromBranding = true,\n}: PropsWithChildren<ThemeProviderProps>): ReactElement => {\n const [colorScheme, setColorScheme] = useState<'light' | 'dark'>(() => {\n // Initialize with detected theme mode or fallback to defaultMode\n if (mode === 'light' || mode === 'dark') {\n return mode;\n }\n // For 'branding' mode, start with system preference and update when branding loads\n if (mode === 'branding') {\n return detectThemeMode('system', detection);\n }\n return detectThemeMode(mode, detection);\n });\n\n // Use branding theme if inheritFromBranding is enabled\n // Handle case where BrandingProvider might not be available\n let brandingTheme = null;\n let brandingActiveTheme = null;\n let isBrandingLoading = false;\n let brandingError = null;\n\n try {\n const brandingContext = useBrandingContext();\n brandingTheme = brandingContext.theme;\n brandingActiveTheme = brandingContext.activeTheme;\n isBrandingLoading = brandingContext.isLoading;\n brandingError = brandingContext.error;\n } catch (error) {\n // BrandingProvider not available, fall back to no branding\n if (inheritFromBranding) {\n console.warn(\n 'ThemeProvider: inheritFromBranding is enabled but BrandingProvider is not available. ' +\n 'Make sure to wrap your app with BrandingProvider or AsgardeoProvider with branding preferences.',\n );\n }\n }\n\n // Update color scheme based on branding active theme when available\n useEffect(() => {\n if (inheritFromBranding && brandingActiveTheme) {\n // Update color scheme based on mode preference\n if (mode === 'branding') {\n // Always follow branding active theme\n setColorScheme(brandingActiveTheme);\n } else if (mode === 'system' && !isBrandingLoading) {\n // For system mode, prefer branding but allow system override if no branding\n setColorScheme(brandingActiveTheme);\n }\n }\n }, [inheritFromBranding, brandingActiveTheme, mode, isBrandingLoading]);\n\n // Merge user-provided theme config with branding theme\n const finalThemeConfig = useMemo(() => {\n if (!inheritFromBranding || !brandingTheme) {\n return themeConfig;\n }\n\n // Convert branding theme to our theme config format\n const brandingThemeConfig: RecursivePartial<ThemeConfig> = {\n colors: brandingTheme.colors,\n borderRadius: brandingTheme.borderRadius,\n shadows: brandingTheme.shadows,\n spacing: brandingTheme.spacing,\n images: brandingTheme.images,\n };\n\n // Merge branding theme with user-provided theme config\n // User-provided config takes precedence over branding\n return {\n ...brandingThemeConfig,\n ...themeConfig,\n colors: {\n ...brandingThemeConfig.colors,\n ...themeConfig?.colors,\n },\n borderRadius: {\n ...brandingThemeConfig.borderRadius,\n ...themeConfig?.borderRadius,\n },\n shadows: {\n ...brandingThemeConfig.shadows,\n ...themeConfig?.shadows,\n },\n spacing: {\n ...brandingThemeConfig.spacing,\n ...themeConfig?.spacing,\n },\n images: {\n ...brandingThemeConfig.images,\n ...themeConfig?.images,\n },\n };\n }, [inheritFromBranding, brandingTheme, themeConfig]);\n\n const theme = useMemo(() => createTheme(finalThemeConfig, colorScheme === 'dark'), [finalThemeConfig, colorScheme]);\n\n const handleThemeChange = useCallback((isDark: boolean) => {\n setColorScheme(isDark ? 'dark' : 'light');\n }, []);\n\n const toggleTheme = useCallback(() => {\n setColorScheme(prev => (prev === 'light' ? 'dark' : 'light'));\n }, []);\n\n useEffect(() => {\n let observer: MutationObserver | null = null;\n let mediaQuery: MediaQueryList | null = null;\n\n // Don't set up automatic theme detection for branding mode\n if (mode === 'branding') {\n return null;\n }\n\n if (mode === 'class') {\n const targetElement = detection.targetElement || document.documentElement;\n if (targetElement) {\n observer = createClassObserver(targetElement, handleThemeChange, detection);\n }\n } else if (mode === 'system') {\n // Only set up system listener if not using branding or branding hasn't loaded yet\n if (!inheritFromBranding || !brandingActiveTheme) {\n mediaQuery = createMediaQueryListener(handleThemeChange);\n }\n }\n\n return () => {\n if (observer) {\n observer.disconnect();\n }\n if (mediaQuery) {\n // Clean up media query listener\n if (mediaQuery.removeEventListener) {\n mediaQuery.removeEventListener('change', handleThemeChange as any);\n } else {\n // Fallback for older browsers\n mediaQuery.removeListener(handleThemeChange as any);\n }\n }\n };\n }, [mode, detection, handleThemeChange, inheritFromBranding, brandingActiveTheme]);\n\n useEffect(() => {\n applyThemeToDOM(theme);\n }, [theme]);\n\n const value = {\n theme,\n colorScheme,\n toggleTheme,\n isBrandingLoading,\n brandingError,\n inheritFromBranding,\n };\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n};\n\nexport default ThemeProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {createContext} from 'react';\nimport {Theme} from '@asgardeo/browser';\n\nexport interface ThemeContextValue {\n theme: Theme;\n colorScheme: 'light' | 'dark';\n toggleTheme: () => void;\n /**\n * Whether branding theme is currently loading\n */\n isBrandingLoading?: boolean;\n /**\n * Error from branding theme fetch, if any\n */\n brandingError?: Error | null;\n /**\n * Whether branding inheritance is enabled\n */\n inheritFromBranding?: boolean;\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\nThemeContext.displayName = 'ThemeContext';\n\nexport default ThemeContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport BrandingContext, {BrandingContextValue} from './BrandingContext';\n\n/**\n * Hook to access the branding context.\n * This hook provides access to branding preferences, theme data, and loading states.\n *\n * @returns The branding context value containing branding preference data, theme, and control functions\n * @throws Error if used outside of a BrandingProvider\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { theme, activeTheme, isLoading, error } = useBrandingContext();\n *\n * if (isLoading) return <div>Loading branding...</div>;\n * if (error) return <div>Error: {error.message}</div>;\n *\n * return (\n * <div style={{ color: theme?.colors?.primary?.main }}>\n * <p>Active theme mode: {activeTheme}</p>\n * <p>Styled with Asgardeo branding</p>\n * </div>\n * );\n * }\n * ```\n */\nconst useBrandingContext = (): BrandingContextValue => {\n const context = useContext(BrandingContext);\n if (!context) {\n throw new Error('useBrandingContext must be used within a BrandingProvider');\n }\n return context;\n};\n\nexport default useBrandingContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {createContext} from 'react';\nimport {BrandingPreference, Theme} from '@asgardeo/browser';\n\nexport interface BrandingContextValue {\n /**\n * The raw branding preference data\n */\n brandingPreference: BrandingPreference | null;\n /**\n * The transformed theme object\n */\n theme: Theme | null;\n /**\n * The active theme mode from branding preference ('light' | 'dark')\n */\n activeTheme: 'light' | 'dark' | null;\n /**\n * Loading state\n */\n isLoading: boolean;\n /**\n * Error state\n */\n error: Error | null;\n /**\n * Function to manually fetch branding preference\n */\n fetchBranding: () => Promise<void>;\n /**\n * Function to refetch branding preference\n * This bypasses the single-call restriction and forces a new API call\n */\n refetch: () => Promise<void>;\n}\n\nconst BrandingContext = createContext<BrandingContextValue | null>(null);\n\nBrandingContext.displayName = 'BrandingContext';\n\nexport default BrandingContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactElement, useCallback, useEffect, useState} from 'react';\nimport {BrandingPreference, Theme, transformBrandingPreferenceToTheme} from '@asgardeo/browser';\nimport BrandingContext from './BrandingContext';\n\n/**\n * Configuration options for the BrandingProvider\n */\nexport interface BrandingProviderProps {\n /**\n * The branding preference data passed from parent (typically AsgardeoProvider)\n */\n brandingPreference?: BrandingPreference | null;\n /**\n * Force a specific theme ('light' or 'dark')\n * If not provided, will use the activeTheme from branding preference\n */\n forceTheme?: 'light' | 'dark';\n /**\n * Whether the branding provider is enabled\n * @default true\n */\n enabled?: boolean;\n /**\n * Loading state passed from parent\n */\n isLoading?: boolean;\n /**\n * Error state passed from parent\n */\n error?: Error | null;\n /**\n * Function to refetch branding preference passed from parent\n */\n refetch?: () => Promise<void>;\n}\n\n/**\n * BrandingProvider component that manages branding state and provides branding context to child components.\n *\n * This provider receives branding preferences from a parent component (typically AsgardeoProvider)\n * and transforms them into theme objects, making them available to all child components.\n *\n * Features:\n * - Receives branding preferences as props\n * - Theme transformation from branding preferences\n * - Loading and error states\n * - Support for custom theme forcing\n *\n * @example\n * Basic usage (typically used within AsgardeoProvider):\n * ```tsx\n * <BrandingProvider\n * brandingPreference={brandingData}\n * isLoading={isFetching}\n * error={fetchError}\n * >\n * <App />\n * </BrandingProvider>\n * ```\n *\n * @example\n * With custom theme forcing:\n * ```tsx\n * <BrandingProvider\n * brandingPreference={brandingData}\n * forceTheme=\"dark\"\n * enabled={true}\n * >\n * <App />\n * </BrandingProvider>\n * ```\n */\nconst BrandingProvider: FC<PropsWithChildren<BrandingProviderProps>> = ({\n children,\n brandingPreference: externalBrandingPreference,\n forceTheme,\n enabled = true,\n isLoading: externalIsLoading = false,\n error: externalError = null,\n refetch: externalRefetch,\n}: PropsWithChildren<BrandingProviderProps>): ReactElement => {\n const [theme, setTheme] = useState<Theme | null>(null);\n const [activeTheme, setActiveTheme] = useState<'light' | 'dark' | null>(null);\n\n // Process branding preference when it changes\n useEffect(() => {\n if (!enabled || !externalBrandingPreference) {\n setTheme(null);\n setActiveTheme(null);\n return;\n }\n\n // Extract active theme from branding preference\n const activeThemeFromBranding = externalBrandingPreference?.preference?.theme?.activeTheme;\n let extractedActiveTheme: 'light' | 'dark' | null = null;\n\n if (activeThemeFromBranding) {\n // Convert to lowercase and map to our expected values\n const themeMode = activeThemeFromBranding.toLowerCase();\n if (themeMode === 'light' || themeMode === 'dark') {\n extractedActiveTheme = themeMode;\n }\n }\n\n setActiveTheme(extractedActiveTheme);\n\n // Transform branding preference to theme\n const transformedTheme = transformBrandingPreferenceToTheme(externalBrandingPreference, forceTheme);\n setTheme(transformedTheme);\n }, [externalBrandingPreference, forceTheme, enabled]);\n\n // Reset state when disabled\n useEffect(() => {\n if (!enabled) {\n setTheme(null);\n setActiveTheme(null);\n }\n }, [enabled]);\n\n // Dummy fetchBranding for backward compatibility\n const fetchBranding = useCallback(async (): Promise<void> => {\n if (externalRefetch) {\n await externalRefetch();\n }\n }, [externalRefetch]);\n\n const value = {\n brandingPreference: externalBrandingPreference || null,\n theme,\n activeTheme,\n isLoading: externalIsLoading,\n error: externalError,\n fetchBranding,\n refetch: externalRefetch || fetchBranding,\n };\n\n return <BrandingContext.Provider value={value}>{children}</BrandingContext.Provider>;\n};\n\nexport default BrandingProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {UpdateMeProfileConfig, User, UserProfile} from '@asgardeo/browser';\nimport {FC, PropsWithChildren, ReactElement, useEffect, useState, useCallback, useMemo} from 'react';\nimport UserContext from './UserContext';\n\n/**\n * Props interface of {@link UserProvider}\n */\nexport interface UserProviderProps {\n profile: UserProfile;\n revalidateProfile?: () => Promise<void>;\n updateProfile?: (\n requestConfig: UpdateMeProfileConfig,\n sessionId?: string,\n ) => Promise<{success: boolean; data: {user: User}; error: string}>;\n onUpdateProfile?: (payload: User) => void;\n}\n\n/**\n * UserProvider component that manages user profile data and provides it through UserContext.\n *\n * This provider:\n * - Fetches user profile data from the ME endpoint\n * - Retrieves SCIM2 schemas for profile structure\n * - Generates both nested and flattened user profiles\n * - Provides functions for refreshing and updating user data\n * - Handles loading states and errors\n *\n * @example\n * ```tsx\n * // Basic usage\n * <UserProvider>\n * <App />\n * </UserProvider>\n *\n * // With custom error handling\n * <UserProvider onError={(error) => console.error('User error:', error)}>\n * <App />\n * </UserProvider>\n *\n * // Disable auto-fetch (fetch manually using refreshUser)\n * <UserProvider autoFetch={false}>\n * <App />\n * </UserProvider>\n * ```\n */\nconst UserProvider: FC<PropsWithChildren<UserProviderProps>> = ({\n children,\n profile,\n revalidateProfile,\n onUpdateProfile,\n updateProfile,\n}: PropsWithChildren<UserProviderProps>): ReactElement => {\n const contextValue = useMemo(\n () => ({\n schemas: profile?.schemas,\n profile: profile?.profile,\n flattenedProfile: profile?.flattenedProfile,\n revalidateProfile,\n updateProfile,\n onUpdateProfile,\n }),\n [profile, onUpdateProfile, revalidateProfile, updateProfile],\n );\n\n return <UserContext.Provider value={contextValue}>{children}</UserContext.Provider>;\n};\n\nexport default UserProvider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User, Schema, UpdateMeProfileConfig, OrganizationDetails} from '@asgardeo/browser';\nimport {Context, createContext} from 'react';\n\n/**\n * Props interface of {@link UserContext}\n */\nexport type UserContextProps = {\n flattenedProfile: User | null;\n profile: User | null;\n revalidateProfile: () => Promise<void>;\n schemas: Schema[] | null;\n updateProfile: (\n requestConfig: UpdateMeProfileConfig,\n sessionId?: string,\n ) => Promise<{success: boolean; data: {user: User}; error: string}>;\n onUpdateProfile: (payload: User) => void;\n};\n\n/**\n * Context object for managing user profile data and related operations.\n */\nconst UserContext: Context<UserContextProps | null> = createContext<null | UserContextProps>({\n profile: null,\n schemas: null,\n flattenedProfile: null,\n revalidateProfile: () => null,\n updateProfile: () => null,\n onUpdateProfile: () => null,\n});\n\nUserContext.displayName = 'UserContext';\n\nexport default UserContext;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport AsgardeoContext, {AsgardeoContextProps} from './AsgardeoContext';\n\nconst useAsgardeo = (): AsgardeoContextProps => {\n const context: AsgardeoContextProps | null = useContext(AsgardeoContext);\n\n if (!context) {\n throw new Error('useAsgardeo must be used within an AsgardeoProvider');\n }\n\n return context;\n};\n\nexport default useAsgardeo;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport UserContext, {UserContextProps} from './UserContext';\n\n/**\n * Hook to access the User context.\n *\n * This hook provides access to user profile data including:\n * - Raw profile API response\n * - SCIM2 schemas\n * - Nested user object\n * - Flattened user profile\n * - Functions to refresh and update user data\n * - Loading states and error handling\n *\n * @returns {UserContextProps} The user context value containing all user-related data and functions\n * @throws {Error} Throws an error if used outside of UserProvider\n *\n * @example\n * ```tsx\n * import {useUser} from '@asgardeo/react';\n *\n * function ProfileComponent() {\n * const {\n * isLoading,\n * profile,\n * schemas,\n * user,\n * flattenedUser,\n * refreshUser,\n * updateUser,\n * error\n * } = useUser();\n *\n * if (isLoading) {\n * return <div>Loading user data...</div>;\n * }\n *\n * if (error) {\n * return <div>Error: {error.message}</div>;\n * }\n *\n * return (\n * <div>\n * <h1>Welcome {user?.name?.givenName}!</h1>\n * <p>Email: {flattenedUser?.emails}</p>\n * <button onClick={refreshUser}>Refresh Profile</button>\n * </div>\n * );\n * }\n *\n * // Access specific user properties\n * function UserEmail() {\n * const {flattenedUser} = useUser();\n * return <span>{flattenedUser?.emails?.[0]}</span>;\n * }\n *\n * // Update user profile\n * function EditProfile() {\n * const {updateUser, user} = useUser();\n *\n * const handleUpdate = async () => {\n * try {\n * await updateUser({\n * name: {\n * givenName: 'John',\n * familyName: 'Doe'\n * }\n * });\n * } catch (error) {\n * console.error('Update failed:', error);\n * }\n * };\n *\n * return <button onClick={handleUpdate}>Update Name</button>;\n * }\n * ```\n */\nconst useUser = (): UserContextProps => {\n const context = useContext(UserContext);\n\n if (!context) {\n throw new Error('useUser must be used within a UserProvider');\n }\n\n return context;\n};\n\nexport default useUser;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport OrganizationContext, {OrganizationContextProps} from './OrganizationContext';\n\n/**\n * Hook to access the Organization context.\n *\n * This hook provides access to organization data including:\n * - List of organizations the user belongs to\n * - Current organization\n * - Functions to switch organizations and refresh data\n * - Function to fetch organizations programmatically\n * - Loading states and error handling\n *\n * @returns {OrganizationContextProps} The organization context value containing all organization-related data and functions\n * @throws {Error} Throws an error if used outside of OrganizationProvider\n *\n * @example\n * ```tsx\n * import {useOrganization} from '@asgardeo/react';\n *\n * function OrganizationSelector() {\n * const {\n * organizations,\n * currentOrganization,\n * switchOrganization,\n * revalidateMyOrganizations,\n * getOrganizations,\n * isLoading,\n * error\n * } = useOrganization();\n *\n * if (isLoading) {\n * return <div>Loading organizations...</div>;\n * }\n *\n * if (error) {\n * return <div>Error: {error}</div>;\n * }\n *\n * return (\n * <div>\n * <h2>Current: {currentOrganization?.name}</h2>\n * <select\n * value={currentOrganization?.id || ''}\n * onChange={(e) => {\n * const org = organizations?.find(o => o.id === e.target.value);\n * if (org) switchOrganization(org);\n * }}\n * >\n * {organizations?.map(org => (\n * <option key={org.id} value={org.id}>\n * {org.name}\n * </option>\n * ))}\n * </select>\n * <button onClick={revalidateMyOrganizations}>\n * Refresh Organizations\n * </button>\n * <button onClick={async () => {\n * const fresh = await getOrganizations();\n * console.log('Fresh organizations:', fresh);\n * }}>\n * Get Organizations Manually\n * </button>\n * </div>\n * );\n * }\n *\n * // Switch to a specific organization\n * function SwitchOrgButton() {\n * const {organizations, switchOrganization} = useOrganization();\n *\n * const handleSwitch = (orgId: string) => {\n * const org = organizations?.find(o => o.id === orgId);\n * if (org) {\n * switchOrganization(org);\n * }\n * };\n *\n * return (\n * <button onClick={() => handleSwitch('org-123')}>\n * Switch to Organization\n * </button>\n * );\n * }\n * ```\n */\nconst useOrganization = (): OrganizationContextProps => {\n const context: OrganizationContextProps | null = useContext(OrganizationContext);\n\n if (!context) {\n throw new Error('useOrganization must be used within an OrganizationProvider');\n }\n\n return context;\n};\n\nexport default useOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport FlowContext, {FlowContextValue} from './FlowContext';\n\n/**\n * Hook to access the flow context.\n * Must be used within a FlowProvider.\n *\n * @example\n * ```tsx\n * const MyAuthComponent = () => {\n * const { title, setTitle, addMessage, isLoading } = useFlow();\n *\n * const handleSuccess = () => {\n * addMessage({\n * type: 'success',\n * message: 'Authentication successful!'\n * });\n * };\n *\n * return (\n * <div>\n * <h1>{title}</h1>\n * {isLoading && <p>Loading...</p>}\n * </div>\n * );\n * };\n * ```\n *\n * @returns The flow context value\n * @throws Error if used outside of FlowProvider\n */\nconst useFlow = (): FlowContextValue => {\n const context = useContext(FlowContext);\n\n if (!context) {\n throw new Error('useFlow must be used within a FlowProvider');\n }\n\n return context;\n};\n\nexport default useFlow;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport I18nContext, {I18nContextValue} from './I18nContext';\n\n/**\n * Hook for accessing the I18n context directly.\n * Provides access to the full i18n context including bundles and all utilities.\n *\n * @returns The complete I18n context value\n * @throws Error if used outside of I18nProvider context\n */\nconst useI18n = (): I18nContextValue => {\n const context = useContext(I18nContext);\n\n if (!context) {\n throw new Error(\n 'useI18n must be used within an I18nProvider. Make sure your component is wrapped with AsgardeoProvider which includes I18nProvider.',\n );\n }\n\n return context;\n};\n\nexport default useI18n;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext} from 'react';\nimport ThemeContext, {ThemeContextValue} from './ThemeContext';\n\nconst useTheme = (): ThemeContextValue => {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context;\n};\n\nexport default useTheme;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useContext, useMemo} from 'react';\nimport {deepMerge, I18nBundle, I18nPreferences} from '@asgardeo/browser';\nimport I18nContext, {I18nContextValue} from '../contexts/I18n/I18nContext';\n\nexport interface UseTranslation {\n /**\n * Translation function that returns a translated string for the given key\n */\n t: (key: string, params?: Record<string, string | number>) => string;\n\n /**\n * The current language code\n */\n currentLanguage: string;\n\n /**\n * Function to change the current language\n */\n setLanguage: (language: string) => void;\n\n /**\n * All available language codes\n */\n availableLanguages: string[];\n}\n\nexport interface UseTranslationWithPreferences extends UseTranslation {\n /**\n * Enhanced translation function that merges component-level preferences\n */\n t: (key: string, params?: Record<string, string | number>) => string;\n}\n\n/**\n * Hook for accessing translation functions and language management.\n * Must be used within an I18nProvider context.\n *\n * @param componentPreferences - Optional component-level i18n preferences to merge with global ones\n * @returns An object containing translation function and language management utilities\n * @throws Error if used outside of I18nProvider context\n */\nconst useTranslation = (componentPreferences?: I18nPreferences): UseTranslationWithPreferences => {\n const context = useContext(I18nContext);\n\n if (!context) {\n throw new Error(\n 'useTranslation must be used within an I18nProvider. Make sure your component is wrapped with AsgardeoProvider which includes I18nProvider.',\n );\n }\n\n const {t: globalT, currentLanguage, setLanguage, bundles: globalBundles, fallbackLanguage} = context;\n\n // Merge global bundles with component-level bundles if provided\n const mergedBundles = useMemo(() => {\n if (!componentPreferences?.bundles) {\n return globalBundles;\n }\n\n const merged: Record<string, I18nBundle> = {};\n\n // Start with global bundles\n Object.entries(globalBundles).forEach(([key, bundle]) => {\n merged[key] = bundle;\n });\n\n // Merge component-level bundles using deepMerge for better merging\n Object.entries(componentPreferences.bundles).forEach(([key, componentBundle]) => {\n if (merged[key]) {\n // Deep merge component bundle with existing global bundle\n merged[key] = {\n ...merged[key],\n translations: deepMerge(merged[key].translations, componentBundle.translations),\n metadata: componentBundle.metadata\n ? {...merged[key].metadata, ...componentBundle.metadata}\n : merged[key].metadata,\n };\n } else {\n // No global bundle for this language, use component bundle as-is\n merged[key] = componentBundle;\n }\n });\n\n return merged;\n }, [globalBundles, componentPreferences?.bundles]);\n\n // Create enhanced translation function that uses merged bundles\n const enhancedT = useMemo(() => {\n if (!componentPreferences?.bundles) {\n // No component preferences, use global translation function\n return globalT;\n }\n\n return (key: string, params?: Record<string, string | number>): string => {\n let translation: string | undefined;\n\n // Try to get translation from current language bundle\n const currentBundle = mergedBundles[currentLanguage];\n if (currentBundle?.translations[key]) {\n translation = currentBundle.translations[key];\n }\n\n // Fallback to fallback language if translation not found\n if (!translation && currentLanguage !== fallbackLanguage) {\n const fallbackBundle = mergedBundles[fallbackLanguage];\n if (fallbackBundle?.translations[key]) {\n translation = fallbackBundle.translations[key];\n }\n }\n\n // If still no translation found, return the key itself\n if (!translation) {\n translation = key;\n }\n\n // Replace parameters if provided\n if (params && Object.keys(params).length > 0) {\n return Object.entries(params).reduce((acc, [paramKey, paramValue]) => {\n return acc.replace(new RegExp(`\\\\{${paramKey}\\\\}`, 'g'), String(paramValue));\n }, translation);\n }\n\n return translation;\n };\n }, [mergedBundles, currentLanguage, fallbackLanguage, globalT, componentPreferences?.bundles]);\n\n return {\n t: enhancedT,\n currentLanguage,\n setLanguage,\n availableLanguages: Object.keys(mergedBundles),\n };\n};\n\nexport default useTranslation;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {useState, useCallback} from 'react';\n\n/**\n * Generic form field configuration\n */\nexport interface FormField {\n initialValue?: string;\n name: string;\n required?: boolean;\n validator?: (value: string) => string | null;\n}\n\n/**\n * Form validation result\n */\nexport interface ValidationResult {\n errors: Record<string, string>;\n isValid: boolean;\n}\n\n/**\n * Configuration for the useForm hook\n */\nexport interface UseFormConfig<T extends Record<string, string>> {\n /**\n * Form field definitions\n */\n fields?: FormField[];\n /**\n * Initial form values\n */\n initialValues?: Partial<T>;\n /**\n * Custom required field validation message\n */\n requiredMessage?: string;\n /**\n * Whether to validate on blur (default: true)\n */\n validateOnBlur?: boolean;\n /**\n * Whether to validate on change (default: false)\n */\n validateOnChange?: boolean;\n /**\n * Global form validator function\n */\n validator?: (values: T) => Record<string, string>;\n}\n\n/**\n * Return type for the useForm hook\n */\nexport interface UseFormReturn<T extends Record<string, string>> {\n /**\n * Clear all errors\n */\n clearErrors: () => void;\n /**\n * Current validation errors\n */\n errors: Record<keyof T, string>;\n /**\n * Get field props for easy integration with form components\n */\n getFieldProps: (name: keyof T) => {\n error: string | undefined;\n name: keyof T;\n onBlur: () => void;\n onChange: (value: string) => void;\n required: boolean;\n touched: boolean;\n value: string;\n };\n /**\n * Handle form submission\n */\n handleSubmit: (onSubmit: (values: T) => void | Promise<void>) => (e?: React.FormEvent) => Promise<void>;\n /**\n * Whether the form has been submitted\n */\n isSubmitted: boolean;\n /**\n * Whether the form is currently valid\n */\n isValid: boolean;\n /**\n * Reset the form to initial values\n */\n reset: () => void;\n /**\n * Set a field error\n */\n setError: (name: keyof T, error: string) => void;\n /**\n * Set multiple field errors\n */\n setErrors: (errors: Partial<Record<keyof T, string>>) => void;\n /**\n * Mark a field as touched\n */\n setTouched: (name: keyof T, touched?: boolean) => void;\n /**\n * Mark multiple fields as touched\n */\n setTouchedFields: (touched: Partial<Record<keyof T, boolean>>) => void;\n /**\n * Set a single field value\n */\n setValue: (name: keyof T, value: string) => void;\n /**\n * Set multiple field values\n */\n setValues: (values: Partial<T>) => void;\n /**\n * Mark all fields as touched\n */\n touchAllFields: () => void;\n /**\n * Validate all fields\n */\n validateForm: () => ValidationResult;\n /**\n * Current form values\n */\n values: T;\n /**\n * Validate a single field\n */\n validateField: (name: keyof T) => string | null;\n /**\n * Fields that have been touched by the user\n */\n touched: Record<keyof T, boolean>;\n}\n\n/**\n * Generic form hook that provides comprehensive form state management and validation.\n *\n * @template T - The type of form values (must extend Record<string, string>)\n * @param config - Configuration options for the form\n * @returns Form state and methods\n *\n * @example\n * ```tsx\n * interface LoginForm {\n * username: string;\n * password: string;\n * }\n *\n * const {\n * values,\n * touched,\n * errors,\n * isValid,\n * setValue,\n * handleSubmit,\n * getFieldProps\n * } = useForm<LoginForm>({\n * initialValues: { username: '', password: '' },\n * fields: [\n * { name: 'username', required: true },\n * { name: 'password', required: true }\n * ]\n * });\n *\n * const onSubmit = handleSubmit((values) => {\n * console.log('Form submitted:', values);\n * });\n *\n * return (\n * <form onSubmit={onSubmit}>\n * <input {...getFieldProps('username')} />\n * <input {...getFieldProps('password')} type=\"password\" />\n * <button type=\"submit\" disabled={!isValid}>Submit</button>\n * </form>\n * );\n * ```\n */\nexport const useForm = <T extends Record<string, string>>(config: UseFormConfig<T> = {}): UseFormReturn<T> => {\n const {\n initialValues = {} as T,\n fields = [],\n validator,\n validateOnChange = false,\n validateOnBlur = true,\n requiredMessage = 'This field is required',\n } = config;\n\n // Initialize form state\n const [values, setFormValues] = useState<T>({...initialValues} as T);\n const [touched, setFormTouched] = useState<Record<keyof T, boolean>>({} as Record<keyof T, boolean>);\n const [errors, setFormErrors] = useState<Record<keyof T, string>>({} as Record<keyof T, string>);\n const [isSubmitted, setIsSubmitted] = useState(false);\n\n // Get field configuration by name\n const getFieldConfig = useCallback(\n (name: keyof T): FormField | undefined => fields.find(field => field.name === name),\n [fields],\n );\n\n // Validate a single field\n const validateField = useCallback(\n (name: keyof T): string | null => {\n const value = values[name] || '';\n const fieldConfig = getFieldConfig(name);\n\n // Check required validation\n if (fieldConfig?.required && (!value || value.trim() === '')) {\n return requiredMessage;\n }\n\n // Run custom field validator\n if (fieldConfig?.validator) {\n const fieldError = fieldConfig.validator(value);\n if (fieldError) return fieldError;\n }\n\n return null;\n },\n [values, getFieldConfig, requiredMessage],\n );\n\n // Validate the entire form\n const validateForm = useCallback((): ValidationResult => {\n const newErrors: Record<keyof T, string> = {} as Record<keyof T, string>;\n\n // Validate individual fields\n fields.forEach(field => {\n const error = validateField(field.name as keyof T);\n if (error) {\n newErrors[field.name as keyof T] = error;\n }\n });\n\n // Run global validator if provided\n if (validator) {\n const globalErrors = validator(values);\n Object.keys(globalErrors).forEach(key => {\n if (globalErrors[key]) {\n newErrors[key as keyof T] = globalErrors[key];\n }\n });\n }\n\n return {\n isValid: Object.keys(newErrors).length === 0,\n errors: newErrors,\n };\n }, [fields, validateField, validator, values]);\n\n // Check if form is currently valid\n const isValid = Object.keys(errors).length === 0;\n\n // Set a single field value\n const setValue = useCallback(\n (name: keyof T, value: string): void => {\n setFormValues((prev: T) => ({\n ...prev,\n [name]: value,\n }));\n\n // Validate on change if enabled\n if (validateOnChange) {\n const error = validateField(name);\n setFormErrors((prev: Record<keyof T, string>) => {\n const newErrors: Record<keyof T, string> = {...prev};\n if (error) {\n newErrors[name] = error;\n } else {\n delete newErrors[name];\n }\n return newErrors;\n });\n }\n },\n [validateField, validateOnChange],\n );\n\n // Set multiple field values\n const setValues = useCallback((newValues: Partial<T>): void => {\n setFormValues((prev: T) => ({\n ...prev,\n ...newValues,\n }));\n }, []);\n\n // Mark a field as touched\n const setTouched = useCallback(\n (name: keyof T, isTouched: boolean = true): void => {\n setFormTouched((prev: Record<keyof T, boolean>) => ({\n ...prev,\n [name]: isTouched,\n }));\n\n // Validate on blur if enabled and field is touched\n if (validateOnBlur && isTouched) {\n const error = validateField(name);\n setFormErrors((prev: Record<keyof T, string>) => {\n const newErrors: Record<keyof T, string> = {...prev};\n if (error) {\n newErrors[name] = error;\n } else {\n delete newErrors[name];\n }\n return newErrors;\n });\n }\n },\n [validateField, validateOnBlur],\n );\n\n // Set multiple touched fields\n const setTouchedFields = useCallback((touchedFields: Partial<Record<keyof T, boolean>>): void => {\n setFormTouched((prev: Record<keyof T, boolean>) => ({\n ...prev,\n ...touchedFields,\n }));\n }, []);\n\n // Mark all fields as touched\n const touchAllFields = useCallback((): void => {\n const allTouched: Record<keyof T, boolean> = fields.reduce((acc: Record<keyof T, boolean>, field: FormField) => {\n acc[field.name as keyof T] = true;\n return acc;\n }, {} as Record<keyof T, boolean>);\n\n setFormTouched(allTouched);\n\n // Validate all fields\n const validation: ValidationResult = validateForm();\n setFormErrors(validation.errors as Record<keyof T, string>);\n }, [fields, validateForm]);\n\n // Set a field error\n const setError = useCallback((name: keyof T, error: string): void => {\n setFormErrors((prev: Record<keyof T, string>) => ({\n ...prev,\n [name]: error,\n }));\n }, []);\n\n // Set multiple field errors\n const setErrors = useCallback((newErrors: Partial<Record<keyof T, string>>): void => {\n setFormErrors((prev: Record<keyof T, string>) => ({\n ...prev,\n ...newErrors,\n }));\n }, []);\n\n // Clear all errors\n const clearErrors = useCallback((): void => {\n setFormErrors({} as Record<keyof T, string>);\n }, []);\n\n // Reset form to initial state\n const reset = useCallback((): void => {\n setFormValues({...initialValues} as T);\n setFormTouched({} as Record<keyof T, boolean>);\n setFormErrors({} as Record<keyof T, string>);\n setIsSubmitted(false);\n }, [initialValues]);\n\n // Handle form submission\n const handleSubmit: (onSubmit: (values: T) => void | Promise<void>) => (e?: React.FormEvent) => Promise<void> =\n useCallback(\n (onSubmit: (values: T) => void | Promise<void>) =>\n async (e?: React.FormEvent): Promise<void> => {\n if (e) {\n e.preventDefault();\n }\n\n setIsSubmitted(true);\n touchAllFields();\n\n const validation: ValidationResult = validateForm();\n\n if (validation.isValid) {\n await onSubmit(values);\n }\n },\n [values, touchAllFields, validateForm],\n );\n\n // Get field props for easy integration\n const getFieldProps = useCallback(\n (name: keyof T) => {\n const fieldConfig: FormField | undefined = getFieldConfig(name);\n\n return {\n error: touched[name] ? errors[name] : undefined,\n name,\n onBlur: (): void => setTouched(name, true),\n onChange: (value: string): void => setValue(name, value),\n required: fieldConfig?.required || false,\n touched: touched[name] || false,\n value: values[name] || '',\n };\n },\n [values, errors, touched, setValue, setTouched, getFieldConfig],\n );\n\n return {\n clearErrors,\n errors,\n getFieldProps,\n handleSubmit,\n isSubmitted,\n isValid,\n reset,\n setError,\n setErrors,\n setTouched,\n setTouchedFields,\n setValue,\n setValues,\n touchAllFields,\n touched,\n validateField,\n validateForm,\n values,\n };\n};\n\nexport default useForm;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {BrandingPreference, Theme} from '@asgardeo/browser';\nimport useBrandingContext from '../contexts/Branding/useBrandingContext';\n\n/**\n * Configuration options for the useBranding hook\n * @deprecated Use BrandingProvider instead for better performance and consistency\n */\nexport interface UseBrandingConfig {\n /**\n * @deprecated This configuration is now handled by BrandingProvider\n */\n locale?: string;\n /**\n * @deprecated This configuration is now handled by BrandingProvider\n */\n name?: string;\n /**\n * @deprecated This configuration is now handled by BrandingProvider\n */\n type?: string;\n /**\n * @deprecated This configuration is now handled by BrandingProvider\n */\n forceTheme?: 'light' | 'dark';\n /**\n * @deprecated This configuration is now handled by BrandingProvider\n */\n autoFetch?: boolean;\n /**\n * @deprecated This configuration is now handled by BrandingProvider\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Return type of the useBranding hook\n */\nexport interface UseBrandingReturn {\n /**\n * The raw branding preference data\n */\n brandingPreference: BrandingPreference | null;\n /**\n * The transformed theme object\n */\n theme: Theme | null;\n /**\n * The active theme mode from branding preference ('light' | 'dark')\n */\n activeTheme: 'light' | 'dark' | null;\n /**\n * Loading state\n */\n isLoading: boolean;\n /**\n * Error state\n */\n error: Error | null;\n /**\n * Function to manually fetch branding preference\n */\n fetchBranding: () => Promise<void>;\n /**\n * Function to refetch branding preference\n * This bypasses the single-call restriction and forces a new API call\n */\n refetch: () => Promise<void>;\n}\n\n/**\n * React hook for accessing branding preferences from the BrandingProvider context.\n * This hook provides access to branding preferences, theme data, and loading states.\n *\n * @deprecated Consider using useBrandingContext directly for better performance.\n * This hook is maintained for backward compatibility.\n *\n * @param config - Configuration options (deprecated, use BrandingProvider props instead)\n * @returns Object containing branding preference data, theme, loading state, error, and refetch function\n *\n * @example\n * Basic usage:\n * ```tsx\n * function MyComponent() {\n * const { theme, activeTheme, isLoading, error } = useBranding();\n *\n * if (isLoading) return <div>Loading branding...</div>;\n * if (error) return <div>Error: {error.message}</div>;\n *\n * return (\n * <div style={{ color: theme?.colors?.primary?.main }}>\n * <p>Active theme mode: {activeTheme}</p>\n * <p>Styled with Asgardeo branding</p>\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * For new implementations, use BrandingProvider with useBrandingContext:\n * ```tsx\n * // In your root component\n * <BrandingProvider baseUrl=\"https://api.asgardeo.io/t/your-org\">\n * <App />\n * </BrandingProvider>\n *\n * // In your component\n * function MyComponent() {\n * const { theme, activeTheme, isLoading, error } = useBrandingContext();\n * // ... rest of your component\n * }\n * ```\n */\nexport const useBranding = (config: UseBrandingConfig = {}): UseBrandingReturn => {\n try {\n return useBrandingContext();\n } catch (error) {\n console.warn(\n 'useBranding: BrandingProvider not available. ' +\n 'Make sure to wrap your app with BrandingProvider or AsgardeoProvider with branding preferences.',\n );\n\n return {\n brandingPreference: null,\n theme: null,\n activeTheme: null,\n isLoading: false,\n error: new Error('BrandingProvider not available'),\n fetchBranding: async () => {},\n refetch: async () => {},\n };\n }\n};\n\nexport default useBranding;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {WithPreferences, withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {\n ButtonHTMLAttributes,\n forwardRef,\n ForwardRefExoticComponent,\n ReactElement,\n ReactNode,\n Ref,\n RefAttributes,\n} from 'react';\nimport Button from '../../primitives/Button/Button';\n\n/**\n * Common props shared by all {@link BaseSignInButton} components.\n */\nexport interface CommonBaseSignInButtonProps {\n /**\n * Loading state during sign-in process\n */\n isLoading?: boolean;\n /**\n * Function to initiate the sign-in process\n */\n signIn: () => Promise<void>;\n}\n\n/**\n * Props passed to the render function of {@link BaseSignInButton}\n */\nexport type BaseSignInButtonRenderProps = CommonBaseSignInButtonProps;\n\n/**\n * Props interface of {@link BaseSignInButton}\n */\nexport interface BaseSignInButtonProps\n extends Partial<CommonBaseSignInButtonProps>,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n WithPreferences {\n /**\n * Render prop function that receives sign-in props, or traditional ReactNode children\n */\n children?: ((props: BaseSignInButtonRenderProps) => ReactNode) | ReactNode;\n}\n\n/**\n * Base SignInButton component that supports both render props and traditional props patterns.\n *\n * @example Using render props\n * ```tsx\n * <BaseSignInButton>\n * {({signIn, isLoading}) => (\n * <button onClick={signIn} disabled={isLoading}>\n * {isLoading ? 'Signing in...' : 'Sign In'}\n * </button>\n * )}\n * </BaseSignInButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <BaseSignInButton className=\"custom-button\">Sign In</BaseSignInButton>\n * ```\n */\nconst BaseSignInButton: ForwardRefExoticComponent<BaseSignInButtonProps & RefAttributes<HTMLButtonElement>> =\n forwardRef<HTMLButtonElement, BaseSignInButtonProps>(\n (\n {children, className, style, signIn, isLoading, preferences, ...rest}: BaseSignInButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n if (typeof children === 'function') {\n return <>{children({isLoading, signIn})}</>;\n }\n\n return (\n <Button\n ref={ref}\n className={clsx(withVendorCSSClassPrefix('sign-in-button'), className)}\n style={style}\n disabled={isLoading}\n loading={isLoading}\n type=\"button\"\n {...rest}\n >\n {children}\n </Button>\n );\n },\n );\n\nBaseSignInButton.displayName = 'BaseSignInButton';\n\nexport default BaseSignInButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, ButtonHTMLAttributes, forwardRef, useMemo} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport Spinner, {SpinnerSize} from '../Spinner/Spinner';\n\nexport type ButtonColor = 'primary' | 'secondary' | 'tertiary' | string;\nexport type ButtonVariant = 'solid' | 'outline' | 'text';\nexport type ButtonSize = 'small' | 'medium' | 'large';\n\nexport interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'> {\n /**\n * The button color that determines the color scheme\n */\n color?: ButtonColor;\n /**\n * The button variant that determines the visual style\n */\n variant?: ButtonVariant;\n /**\n * The size of the button\n */\n size?: ButtonSize;\n /**\n * Whether the button should take the full width of its container\n */\n fullWidth?: boolean;\n /**\n * Whether the button is in a loading state\n */\n loading?: boolean;\n /**\n * Icon to display before the button text\n */\n startIcon?: React.ReactNode;\n /**\n * Icon to display after the button text\n */\n endIcon?: React.ReactNode;\n}\n\nconst useButtonStyles = (\n color: ButtonColor,\n variant: ButtonVariant,\n size: ButtonSize,\n fullWidth: boolean,\n disabled: boolean,\n loading: boolean,\n) => {\n const {theme} = useTheme();\n\n return useMemo(() => {\n // Size configurations\n const sizeConfig = {\n small: {\n padding: `calc(${theme.vars.spacing.unit} * 0.5) calc(${theme.vars.spacing.unit} * 1)`,\n fontSize: theme.vars.typography.fontSizes.sm,\n minHeight: `calc(${theme.vars.spacing.unit} * 3)`,\n },\n medium: {\n padding: `calc(${theme.vars.spacing.unit} * 1) calc(${theme.vars.spacing.unit} * 2)`,\n fontSize: theme.vars.typography.fontSizes.md,\n minHeight: `calc(${theme.vars.spacing.unit} * 4)`,\n },\n large: {\n padding: `calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 3)`,\n fontSize: theme.vars.typography.fontSizes.lg,\n minHeight: `calc(${theme.vars.spacing.unit} * 5)`,\n },\n };\n\n // Color configurations based on color and variant\n const getColorConfig = () => {\n switch (color) {\n case 'primary':\n switch (variant) {\n case 'solid':\n return {\n backgroundColor: theme.vars.colors.primary.main,\n color: theme.vars.colors.primary.contrastText,\n border: `1px solid ${theme.vars.colors.primary.main}`,\n '&:hover': {\n backgroundColor: theme.vars.colors.primary.main,\n opacity: 0.9,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.primary.main,\n opacity: 0.8,\n },\n };\n case 'outline':\n return {\n backgroundColor: 'transparent',\n color: theme.vars.colors.primary.main,\n border: `1px solid ${theme.vars.colors.primary.main}`,\n '&:hover': {\n backgroundColor: theme.vars.colors.primary.main,\n color: theme.vars.colors.primary.contrastText,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.primary.main,\n color: theme.vars.colors.primary.contrastText,\n opacity: 0.9,\n },\n };\n case 'text':\n return {\n backgroundColor: 'transparent',\n color: theme.vars.colors.primary.main,\n border: '1px solid transparent',\n '&:hover': {\n backgroundColor: theme.vars.colors.action.hover,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.action.selected,\n },\n };\n }\n break;\n case 'secondary':\n switch (variant) {\n case 'solid':\n return {\n backgroundColor: theme.vars.colors.secondary.main,\n color: theme.vars.colors.secondary.contrastText,\n border: `1px solid ${theme.vars.colors.secondary.main}`,\n '&:hover': {\n backgroundColor: theme.vars.colors.secondary.main,\n opacity: 0.9,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.secondary.main,\n opacity: 0.8,\n },\n };\n case 'outline':\n return {\n backgroundColor: 'transparent',\n color: theme.vars.colors.secondary.main,\n border: `1px solid ${theme.vars.colors.secondary.main}`,\n '&:hover': {\n backgroundColor: theme.vars.colors.secondary.main,\n color: theme.vars.colors.secondary.contrastText,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.secondary.main,\n color: theme.vars.colors.secondary.contrastText,\n opacity: 0.9,\n },\n };\n case 'text':\n return {\n backgroundColor: 'transparent',\n color: theme.vars.colors.secondary.main,\n border: '1px solid transparent',\n '&:hover': {\n backgroundColor: theme.vars.colors.action.hover,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.action.selected,\n },\n };\n }\n break;\n case 'tertiary':\n switch (variant) {\n case 'solid':\n return {\n backgroundColor: theme.vars.colors.text.secondary,\n color: theme.vars.colors.background.surface,\n border: `1px solid ${theme.vars.colors.text.secondary}`,\n '&:hover': {\n backgroundColor: theme.vars.colors.text.primary,\n color: theme.vars.colors.background.surface,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.text.primary,\n color: theme.vars.colors.background.surface,\n opacity: 0.9,\n },\n };\n case 'outline':\n return {\n backgroundColor: 'transparent',\n color: theme.vars.colors.text.secondary,\n border: `1px solid ${theme.vars.colors.border}`,\n '&:hover': {\n backgroundColor: theme.vars.colors.action.hover,\n borderColor: theme.vars.colors.text.secondary,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.action.selected,\n borderColor: theme.vars.colors.text.primary,\n },\n };\n case 'text':\n return {\n backgroundColor: 'transparent',\n color: theme.vars.colors.text.secondary,\n border: '1px solid transparent',\n '&:hover': {\n backgroundColor: theme.vars.colors.action.hover,\n color: theme.vars.colors.text.primary,\n },\n '&:active': {\n backgroundColor: theme.vars.colors.action.selected,\n color: theme.vars.colors.text.primary,\n },\n };\n }\n break;\n default:\n return {};\n }\n };\n\n const baseStyle: CSSProperties = {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: `calc(${theme.vars.spacing.unit} * 1)`,\n borderRadius: theme.vars.borderRadius.medium,\n fontWeight: 500,\n cursor: disabled || loading ? 'not-allowed' : 'pointer',\n transition: 'all 0.2s ease-in-out',\n outline: 'none',\n textDecoration: 'none',\n whiteSpace: 'nowrap',\n width: fullWidth ? '100%' : 'auto',\n opacity: disabled || loading ? 0.6 : 1,\n ...sizeConfig[size],\n ...getColorConfig(),\n };\n\n return baseStyle;\n }, [theme, color, variant, size, fullWidth, disabled, loading]);\n};\n\n/**\n * Button component with multiple variants and types.\n *\n * @example\n * ```tsx\n * // Primary solid button\n * <Button color=\"primary\" variant=\"solid\">\n * Click me\n * </Button>\n *\n * // Secondary outline button\n * <Button color=\"secondary\" variant=\"outline\" size=\"large\">\n * Cancel\n * </Button>\n *\n * // Text button with loading state\n * <Button color=\"tertiary\" variant=\"text\" loading>\n * Loading...\n * </Button>\n *\n * // Button with icons\n * <Button\n * color=\"primary\"\n * startIcon={<Icon />}\n * endIcon={<Arrow />}\n * >\n * Save and Continue\n * </Button>\n * ```\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n color = 'primary',\n variant = 'solid',\n size = 'medium',\n fullWidth = false,\n loading = false,\n startIcon,\n endIcon,\n children,\n className,\n disabled,\n style,\n ...rest\n },\n ref,\n ) => {\n const {theme} = useTheme();\n const buttonStyle = useButtonStyles(color, variant, size, fullWidth, disabled || false, loading);\n\n return (\n <button\n ref={ref}\n style={{...buttonStyle, ...style}}\n className={clsx(\n withVendorCSSClassPrefix('button'),\n withVendorCSSClassPrefix(`button-${color}`),\n withVendorCSSClassPrefix(`button-${variant}`),\n withVendorCSSClassPrefix(`button-${size}`),\n {\n [withVendorCSSClassPrefix('button-full-width')]: fullWidth,\n [withVendorCSSClassPrefix('button-loading')]: loading,\n },\n className,\n )}\n disabled={disabled || loading}\n {...rest}\n >\n {loading && (\n <Spinner\n size={size as SpinnerSize}\n color=\"currentColor\"\n style={{\n width:\n size === 'small'\n ? `calc(${theme.vars.spacing.unit} * 1.5)`\n : size === 'medium'\n ? `calc(${theme.vars.spacing.unit} * 2)`\n : `calc(${theme.vars.spacing.unit} * 2.5)`,\n height:\n size === 'small'\n ? `calc(${theme.vars.spacing.unit} * 1.5)`\n : size === 'medium'\n ? `calc(${theme.vars.spacing.unit} * 2)`\n : `calc(${theme.vars.spacing.unit} * 2.5)`,\n }}\n />\n )}\n {!loading && startIcon && <span>{startIcon}</span>}\n {children && <>{children}</>}\n {!loading && endIcon && <span>{endIcon}</span>}\n </button>\n );\n },\n);\n\nButton.displayName = 'Button';\n\nexport default Button;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, CSSProperties} from 'react';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport {clsx} from 'clsx';\nimport useTheme from '../../../contexts/Theme/useTheme';\n\nexport type SpinnerSize = 'small' | 'medium' | 'large';\n\nexport interface SpinnerProps {\n /**\n * Size of the spinner\n */\n size?: SpinnerSize;\n /**\n * Custom color for the spinner\n */\n color?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Custom styles\n */\n style?: CSSProperties;\n}\n\n/**\n * Spinner component for loading states\n *\n * @example\n * ```tsx\n * // Basic spinner\n * <Spinner />\n *\n * // Large spinner with custom color\n * <Spinner size=\"large\" color=\"#3b82f6\" />\n *\n * // Small spinner\n * <Spinner size=\"small\" />\n * ```\n */\nconst Spinner: FC<SpinnerProps> = ({size = 'medium', color, className, style}) => {\n const {theme} = useTheme();\n\n const spinnerSize = {\n small: '16px',\n medium: '20px',\n large: '32px',\n }[size];\n\n const spinnerColor = color || theme.vars.colors.primary.main;\n\n const spinnerStyle: CSSProperties = {\n width: spinnerSize,\n height: spinnerSize,\n border: '2px solid transparent',\n borderTop: `2px solid ${spinnerColor}`,\n borderRadius: '50%',\n animation: 'asgardeo-spinner-spin 1s linear infinite',\n ...style,\n };\n\n return (\n <>\n <style>\n {`\n @keyframes asgardeo-spinner-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n `}\n </style>\n <span\n className={clsx(withVendorCSSClassPrefix('spinner'), className)}\n style={spinnerStyle}\n role=\"status\"\n aria-label=\"Loading\"\n />\n </>\n );\n};\n\nexport default Spinner;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AsgardeoRuntimeError} from '@asgardeo/browser';\nimport {forwardRef, ForwardRefExoticComponent, MouseEvent, ReactElement, Ref, RefAttributes, useState} from 'react';\nimport BaseSignInButton, {BaseSignInButtonProps} from './BaseSignInButton';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useTranslation from '../../../hooks/useTranslation';\n\n/**\n * Props interface of {@link SignInButton}\n */\nexport type SignInButtonProps = BaseSignInButtonProps;\n\n/**\n * SignInButton component that supports both render props and traditional props patterns.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example Using render props\n * ```tsx\n * <SignInButton>\n * {({signIn, isLoading}) => (\n * <button onClick={signIn} disabled={isLoading}>\n * {isLoading ? 'Signing in...' : 'Sign In'}\n * </button>\n * )}\n * </SignInButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <SignInButton className=\"custom-button\">Sign In</SignInButton>\n * ```\n *\n * @example Using component-level preferences\n * ```tsx\n * <SignInButton\n * preferences={{\n * i18n: {\n * bundles: {\n * 'en-US': {\n * translations: {\n * 'buttons.signIn': 'Custom Sign In Text'\n * }\n * }\n * }\n * }\n * }}\n * >\n * Custom Sign In\n * </SignInButton>\n * ```\n */\nconst SignInButton: ForwardRefExoticComponent<SignInButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<\n HTMLButtonElement,\n SignInButtonProps\n>(({children, onClick, preferences, ...rest}: SignInButtonProps, ref: Ref<HTMLButtonElement>): ReactElement => {\n const {signIn, signInUrl} = useAsgardeo();\n const {t} = useTranslation(preferences?.i18n);\n\n const [isLoading, setIsLoading] = useState(false);\n\n const handleSignIn = async (e?: MouseEvent<HTMLButtonElement>): Promise<void> => {\n try {\n setIsLoading(true);\n\n // If a custom `signInUrl` is provided, use it for navigation.\n if (signInUrl) {\n window.history.pushState(null, '', signInUrl);\n\n window.dispatchEvent(new PopStateEvent('popstate', {state: null}));\n } else {\n await signIn();\n }\n\n if (onClick) {\n onClick(e);\n }\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Sign in failed: ${error instanceof Error ? error.message : String(error)}`,\n 'SignInButton-handleSignIn-RuntimeError-001',\n 'react',\n 'Something went wrong while trying to sign in. Please try again later.',\n );\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <BaseSignInButton\n ref={ref}\n onClick={handleSignIn}\n isLoading={isLoading}\n signIn={handleSignIn}\n preferences={preferences}\n {...rest}\n >\n {children ?? t('elements.buttons.signIn')}\n </BaseSignInButton>\n );\n});\n\nSignInButton.displayName = 'SignInButton';\n\nexport default SignInButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {WithPreferences, withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {\n forwardRef,\n ForwardRefExoticComponent,\n ButtonHTMLAttributes,\n ReactElement,\n ReactNode,\n Ref,\n RefAttributes,\n} from 'react';\nimport Button from '../../primitives/Button/Button';\n\n/**\n * Common props shared by all {@link BaseSignOutButton} components.\n */\nexport interface CommonBaseSignOutButtonProps {\n /**\n * Loading state during sign-out process\n */\n isLoading?: boolean;\n /**\n * Function to initiate the sign-out process\n */\n signOut: () => Promise<void>;\n}\n\n/**\n * Props passed to the render function of {@link BaseSignOutButton}\n */\nexport type BaseSignOutButtonRenderProps = CommonBaseSignOutButtonProps;\n\n/**\n * Props interface of {@link BaseSignOutButton}\n */\nexport interface BaseSignOutButtonProps\n extends Partial<CommonBaseSignOutButtonProps>,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n WithPreferences {\n /**\n * Render prop function that receives sign-out props, or traditional ReactNode children\n */\n children?: ((props: BaseSignOutButtonRenderProps) => ReactNode) | ReactNode;\n}\n\n/**\n * Base SignOutButton component that supports both render props and traditional props patterns.\n *\n * @example Using render props\n * ```tsx\n * <BaseSignOutButton>\n * {({signOut, isLoading}) => (\n * <button onClick={signOut} disabled={isLoading}>\n * {isLoading ? 'Signing out...' : 'Sign Out'}\n * </button>\n * )}\n * </BaseSignOutButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <BaseSignOutButton className=\"custom-button\">Sign Out</BaseSignOutButton>\n * ```\n */\nconst BaseSignOutButton: ForwardRefExoticComponent<BaseSignOutButtonProps & RefAttributes<HTMLButtonElement>> =\n forwardRef<HTMLButtonElement, BaseSignOutButtonProps>(\n (\n {children, className, style, signOut, isLoading, preferences, ...rest}: BaseSignOutButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n if (typeof children === 'function') {\n return <>{children({isLoading, signOut})}</>;\n }\n\n return (\n <Button\n ref={ref}\n className={clsx(withVendorCSSClassPrefix('sign-out-button'), className)}\n style={style}\n disabled={isLoading}\n loading={isLoading}\n type=\"button\"\n color=\"secondary\"\n variant=\"outline\"\n {...rest}\n >\n {children}\n </Button>\n );\n },\n );\n\nBaseSignOutButton.displayName = 'BaseSignOutButton';\n\nexport default BaseSignOutButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AsgardeoRuntimeError} from '@asgardeo/browser';\nimport {forwardRef, ForwardRefExoticComponent, MouseEvent, ReactElement, Ref, RefAttributes, useState} from 'react';\nimport BaseSignOutButton, {BaseSignOutButtonProps} from './BaseSignOutButton';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useTranslation from '../../../hooks/useTranslation';\n\n/**\n * Props interface of {@link SignOutButton}\n */\nexport type SignOutButtonProps = BaseSignOutButtonProps;\n\n/**\n * SignOutButton component that supports both render props and traditional props patterns.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example Using render props pattern\n * ```tsx\n * <SignOutButton>\n * {({signOut, isLoading}) => (\n * <button onClick={signOut} disabled={isLoading}>\n * {isLoading ? 'Signing out...' : 'Sign Out'}\n * </button>\n * )}\n * </SignOutButton>\n * ```\n *\n * @example Using traditional props pattern\n * ```tsx\n * <SignOutButton className=\"custom-button\">Sign Out</SignOutButton>\n * ```\n *\n * @example Using component-level preferences\n * ```tsx\n * <SignOutButton\n * preferences={{\n * i18n: {\n * bundles: {\n * 'en-US': {\n * translations: {\n * 'buttons.signOut': 'Custom Sign Out Text'\n * }\n * }\n * }\n * }\n * }}\n * >\n * Custom Sign Out\n * </SignOutButton>\n * ```\n */\nconst SignOutButton: ForwardRefExoticComponent<SignOutButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<\n HTMLButtonElement,\n SignOutButtonProps\n>(({children, onClick, preferences, ...rest}: SignOutButtonProps, ref: Ref<HTMLButtonElement>): ReactElement => {\n const {signOut} = useAsgardeo();\n const {t} = useTranslation(preferences?.i18n);\n\n const [isLoading, setIsLoading] = useState(false);\n\n const handleSignOut = async (e?: MouseEvent<HTMLButtonElement>): Promise<void> => {\n try {\n setIsLoading(true);\n\n await signOut();\n\n if (onClick) {\n onClick(e);\n }\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Sign out failed: ${error instanceof Error ? error.message : String(error)}`,\n 'SignOutButton-handleSignOut-RuntimeError-001',\n 'react',\n 'Something went wrong while trying to sign out. Please try again later.',\n );\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <BaseSignOutButton\n ref={ref}\n onClick={handleSignOut}\n isLoading={isLoading}\n signOut={handleSignOut}\n preferences={preferences}\n {...rest}\n >\n {children ?? t('elements.buttons.signOut')}\n </BaseSignOutButton>\n );\n});\n\nSignOutButton.displayName = 'SignOutButton';\n\nexport default SignOutButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {WithPreferences, withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {\n forwardRef,\n ForwardRefExoticComponent,\n ButtonHTMLAttributes,\n ReactElement,\n ReactNode,\n Ref,\n RefAttributes,\n} from 'react';\nimport Button from '../../primitives/Button/Button';\n\n/**\n * Common props shared by all {@link BaseSignUpButton} components.\n */\nexport interface CommonBaseSignUpButtonProps {\n /**\n * Loading state during sign-up process\n */\n isLoading?: boolean;\n /**\n * Function to initiate the sign-up process\n */\n signUp?: () => Promise<void>;\n}\n\n/**\n * Props passed to the render function of {@link BaseSignUpButton}\n */\nexport type BaseSignUpButtonRenderProps = CommonBaseSignUpButtonProps;\n\n/**\n * Props interface of {@link BaseSignUpButton}\n */\nexport interface BaseSignUpButtonProps\n extends CommonBaseSignUpButtonProps,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n WithPreferences {\n /**\n * Render prop function that receives sign-up props, or traditional ReactNode children\n */\n children?: ((props: BaseSignUpButtonRenderProps) => ReactNode) | ReactNode;\n}\n\n/**\n * Base SignUpButton component that supports both render props and traditional props patterns.\n *\n * @example Using render props\n * ```tsx\n * <BaseSignUpButton>\n * {({ signUp, isLoading }) => (\n * <button onClick={signUp} disabled={isLoading}>\n * {isLoading ? 'Creating account...' : 'Create Account'}\n * </button>\n * )}\n * </BaseSignUpButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <BaseSignUpButton className=\"custom-button\">Create Account</BaseSignUpButton>\n * ```\n */\nconst BaseSignUpButton: ForwardRefExoticComponent<BaseSignUpButtonProps & RefAttributes<HTMLButtonElement>> =\n forwardRef<HTMLButtonElement, BaseSignUpButtonProps>(\n (\n {children, className, style, signUp, isLoading, preferences, ...rest}: BaseSignUpButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n if (typeof children === 'function') {\n return <>{children({isLoading, signUp})}</>;\n }\n\n return (\n <Button\n ref={ref}\n className={clsx(withVendorCSSClassPrefix('sign-up-button'), className)}\n style={style}\n disabled={isLoading}\n loading={isLoading}\n type=\"button\"\n color=\"primary\"\n variant=\"outline\"\n {...rest}\n >\n {children}\n </Button>\n );\n },\n );\n\nBaseSignUpButton.displayName = 'BaseSignUpButton';\n\nexport default BaseSignUpButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AsgardeoRuntimeError} from '@asgardeo/browser';\nimport {forwardRef, ForwardRefExoticComponent, MouseEvent, ReactElement, Ref, RefAttributes, useState} from 'react';\nimport BaseSignUpButton, {BaseSignUpButtonProps} from './BaseSignUpButton';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useTranslation from '../../../hooks/useTranslation';\n\n/**\n * Props interface of {@link SignUpButton}\n */\nexport type SignUpButtonProps = BaseSignUpButtonProps;\n\n/**\n * SignUpButton component that supports both render props and traditional props patterns.\n * It redirects the user to the Asgardeo sign-up page configured for the application.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example Using render props pattern\n * ```tsx\n * <SignUpButton>\n * {({ signUp, isLoading }) => (\n * <button onClick={signUp} disabled={isLoading}>\n * {isLoading ? 'Creating Account...' : 'Create Account'}\n * </button>\n * )}\n * </SignUpButton>\n * ```\n *\n * @example Using traditional props pattern\n * ```tsx\n * <SignUpButton className=\"custom-button\">Create Account</SignUpButton>\n * ```\n *\n * @example Using component-level preferences\n * ```tsx\n * <SignUpButton\n * preferences={{\n * i18n: {\n * bundles: {\n * 'en-US': {\n * translations: {\n * 'buttons.signUp': 'Custom Sign Up Text'\n * }\n * }\n * }\n * }\n * }}\n * >\n * Custom Sign Up\n * </SignUpButton>\n * ```\n */\nconst SignUpButton: ForwardRefExoticComponent<SignUpButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<\n HTMLButtonElement,\n SignUpButtonProps\n>(({children, onClick, preferences, ...rest}: SignUpButtonProps, ref: Ref<HTMLButtonElement>): ReactElement => {\n const {signUp, signUpUrl} = useAsgardeo();\n const {t} = useTranslation(preferences?.i18n);\n\n const [isLoading, setIsLoading] = useState(false);\n\n const handleSignUp = async (e?: MouseEvent<HTMLButtonElement>): Promise<void> => {\n try {\n setIsLoading(true);\n\n // If a custom `signUpUrl` is provided, use it for navigation.\n if (signUpUrl) {\n window.history.pushState(null, '', signUpUrl);\n\n window.dispatchEvent(new PopStateEvent('popstate', {state: null}));\n } else {\n await signUp();\n }\n\n if (onClick) {\n onClick(e);\n }\n } catch (error) {\n throw new AsgardeoRuntimeError(\n `Sign up failed: ${error instanceof Error ? error.message : String(error)}`,\n 'SignUpButton-handleSignUp-RuntimeError-001',\n 'react',\n 'Something went wrong while trying to sign up. Please try again later.',\n );\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <BaseSignUpButton\n ref={ref}\n onClick={handleSignUp}\n isLoading={isLoading}\n signUp={handleSignUp}\n preferences={preferences}\n {...rest}\n >\n {children ?? t('elements.buttons.signUp')}\n </BaseSignUpButton>\n );\n});\n\nSignUpButton.displayName = 'SignUpButton';\n\nexport default SignUpButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactNode} from 'react';\nimport useAsgardeo from '../../contexts/Asgardeo/useAsgardeo';\n\n/**\n * Props for the SignedIn component.\n */\nexport interface SignedInProps {\n /**\n * Content to show when the user is not signed in.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that only renders its children when the user is signed in.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example\n * ```tsx\n * import { SignedIn } from '@asgardeo/auth-react';\n *\n * const App = () => {\n * return (\n * <SignedIn fallback={<p>Please sign in to continue</p>}>\n * <p>Welcome! You are signed in.</p>\n * </SignedIn>\n * );\n * }\n * ```\n */\nconst SignedIn: FC<PropsWithChildren<SignedInProps>> = ({\n children,\n fallback = null,\n}: PropsWithChildren<SignedInProps>) => {\n const {isSignedIn} = useAsgardeo();\n\n if (!isSignedIn) {\n return <>{fallback}</>;\n }\n\n return <>{children}</>;\n};\n\nSignedIn.displayName = 'SignedIn';\n\nexport default SignedIn;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactNode} from 'react';\nimport useAsgardeo from '../../contexts/Asgardeo/useAsgardeo';\n\n/**\n * Props for the SignedOut component.\n */\nexport interface SignedOutProps {\n /**\n * Content to show when the user is signed in.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that only renders its children when the user is signed out.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example\n * ```tsx\n * import { SignedOut } from '@asgardeo/auth-react';\n *\n * const App = () => {\n * return (\n * <SignedOut fallback={<p>You are already signed in</p>}>\n * <p>Please sign in to continue</p>\n * </SignedOut>\n * );\n * }\n * ```\n */\nconst SignedOut: FC<PropsWithChildren<SignedOutProps>> = ({\n children,\n fallback = null,\n}: PropsWithChildren<SignedOutProps>) => {\n const {isSignedIn} = useAsgardeo();\n\n if (!isSignedIn) {\n return <>{children}</>;\n }\n\n return <>{fallback}</>;\n};\n\nSignedOut.displayName = 'SignedOut';\n\nexport default SignedOut;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren, ReactNode} from 'react';\nimport useAsgardeo from '../../contexts/Asgardeo/useAsgardeo';\n\n/**\n * Props for the Loading component.\n */\nexport interface AsgardeoLoadingProps {\n /**\n * Content to show when the user is not signed in.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that only renders its children when the Asgardeo is loading.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example\n * ```tsx\n * import { AsgardeoLoading } from '@asgardeo/auth-react';\n *\n * const App = () => {\n * return (\n * <AsgardeoLoading fallback={<p>Finished Loading...</p>}>\n * <p>Loading...</p>\n * </AsgardeoLoading>\n * );\n * }\n * ```\n */\nconst AsgardeoLoading: FC<PropsWithChildren<AsgardeoLoadingProps>> = ({\n children,\n fallback = null,\n}: PropsWithChildren<AsgardeoLoadingProps>) => {\n const {isLoading} = useAsgardeo();\n\n if (!isLoading) {\n return <>{fallback}</>;\n }\n\n return <>{children}</>;\n};\n\nAsgardeoLoading.displayName = 'AsgardeoLoading';\n\nexport default AsgardeoLoading;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n EmbeddedSignInFlowAuthenticator,\n EmbeddedSignInFlowInitiateResponse,\n EmbeddedSignInFlowHandleResponse,\n EmbeddedSignInFlowStepType,\n EmbeddedSignInFlowStatus,\n EmbeddedSignInFlowAuthenticatorPromptType,\n ApplicationNativeAuthenticationConstants,\n AsgardeoAPIError,\n withVendorCSSClassPrefix,\n EmbeddedSignInFlowHandleRequestPayload,\n EmbeddedFlowExecuteRequestConfig,\n} from '@asgardeo/browser';\nimport {clsx} from 'clsx';\nimport {FC, ReactElement, FormEvent, useEffect, useState, useCallback, useRef, useMemo, CSSProperties} from 'react';\nimport {createSignInOptionFromAuthenticator} from './options/SignInOptionFactory';\nimport FlowProvider from '../../../contexts/Flow/FlowProvider';\nimport useFlow from '../../../contexts/Flow/useFlow';\nimport {useForm, FormField} from '../../../hooks/useForm';\nimport useTranslation from '../../../hooks/useTranslation';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Alert from '../../primitives/Alert/Alert';\nimport Card, {CardProps} from '../../primitives/Card/Card';\nimport Divider from '../../primitives/Divider/Divider';\nimport Logo from '../../primitives/Logo/Logo';\nimport Spinner from '../../primitives/Spinner/Spinner';\nimport Typography from '../../primitives/Typography/Typography';\n\n/**\n * Utility functions for WebAuthn/Passkey operations\n */\n\n/**\n * Convert base64url string to ArrayBuffer\n */\nconst base64urlToArrayBuffer = (base64url: string): ArrayBuffer => {\n // Add padding if needed\n const padding = '='.repeat((4 - (base64url.length % 4)) % 4);\n const base64 = base64url.replace(/-/g, '+').replace(/_/g, '/') + padding;\n\n const binaryString = atob(base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes.buffer;\n};\n\n/**\n * Convert ArrayBuffer to base64url string\n */\nconst arrayBufferToBase64url = (buffer: ArrayBuffer): string => {\n const bytes = new Uint8Array(buffer);\n let binary = '';\n for (let i = 0; i < bytes.byteLength; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n};\n\n/**\n * Handle WebAuthn authentication\n */\nconst handleWebAuthnAuthentication = async (challengeData: string): Promise<string> => {\n // Check if WebAuthn is supported\n if (!window.navigator.credentials || !window.navigator.credentials.get) {\n throw new Error(\n 'WebAuthn is not supported in this browser. Please use a modern browser or try a different authentication method.',\n );\n }\n\n // Check if we're on HTTPS (required for WebAuthn)\n if (window.location.protocol !== 'https:' && window.location.hostname !== 'localhost') {\n throw new Error(\n 'Passkey authentication requires a secure connection (HTTPS). Please ensure you are accessing this site over HTTPS.',\n );\n }\n\n try {\n // Decode the challenge data\n const decodedChallenge = JSON.parse(atob(challengeData));\n const {publicKeyCredentialRequestOptions} = decodedChallenge;\n\n // Handle RP ID mismatch by checking domain compatibility\n const currentDomain = window.location.hostname;\n const challengeRpId = publicKeyCredentialRequestOptions.rpId;\n\n let rpIdToUse = challengeRpId;\n\n // Check if the challenge RP ID is compatible with current domain\n if (challengeRpId && !currentDomain.endsWith(challengeRpId) && challengeRpId !== currentDomain) {\n console.warn(`RP ID mismatch detected. Challenge RP ID: ${challengeRpId}, Current domain: ${currentDomain}`);\n // Use current domain as fallback to avoid errors\n rpIdToUse = currentDomain;\n }\n\n const adjustedOptions = {\n ...publicKeyCredentialRequestOptions,\n rpId: rpIdToUse,\n challenge: base64urlToArrayBuffer(publicKeyCredentialRequestOptions.challenge),\n // Convert user handle if present\n ...(publicKeyCredentialRequestOptions.userVerification && {\n userVerification: publicKeyCredentialRequestOptions.userVerification,\n }),\n // Convert allowCredentials if present\n ...(publicKeyCredentialRequestOptions.allowCredentials && {\n allowCredentials: publicKeyCredentialRequestOptions.allowCredentials.map((cred: any) => ({\n ...cred,\n id: base64urlToArrayBuffer(cred.id),\n })),\n }),\n };\n\n // Convert challenge from base64url to ArrayBuffer\n const credential = (await navigator.credentials.get({\n publicKey: adjustedOptions,\n })) as PublicKeyCredential;\n\n if (!credential) {\n throw new Error('No credential returned from WebAuthn');\n }\n\n const authData = credential.response as AuthenticatorAssertionResponse;\n\n // Create the token response for the server\n const tokenResponse = {\n requestId: decodedChallenge.requestId,\n credential: {\n id: credential.id,\n rawId: arrayBufferToBase64url(credential.rawId),\n response: {\n authenticatorData: arrayBufferToBase64url(authData.authenticatorData),\n clientDataJSON: arrayBufferToBase64url(authData.clientDataJSON),\n signature: arrayBufferToBase64url(authData.signature),\n ...(authData.userHandle && {\n userHandle: arrayBufferToBase64url(authData.userHandle),\n }),\n },\n type: credential.type,\n },\n };\n\n return JSON.stringify(tokenResponse);\n } catch (error) {\n console.error('WebAuthn authentication failed:', error);\n\n // Handle specific error cases\n if (error instanceof Error) {\n if (error.name === 'NotAllowedError') {\n throw new Error('Passkey authentication was cancelled or timed out. Please try again.');\n } else if (error.name === 'SecurityError') {\n if (error.message.includes('relying party ID') || error.message.includes('RP ID')) {\n throw new Error(\n 'Domain mismatch error. The passkey was registered for a different domain. Please contact support or try a different authentication method.',\n );\n } else {\n throw new Error(\n 'Passkey authentication failed. Please ensure you are using HTTPS and that your browser supports passkeys.',\n );\n }\n } else if (error.name === 'InvalidStateError') {\n throw new Error(\n 'No valid passkey found for this account. Please register a passkey first or use a different authentication method.',\n );\n } else if (error.name === 'NotSupportedError') {\n throw new Error(\n 'Passkey authentication is not supported on this device or browser. Please use a different authentication method.',\n );\n } else if (error.name === 'NetworkError') {\n throw new Error('Network error during passkey authentication. Please check your connection and try again.');\n } else if (error.name === 'UnknownError') {\n throw new Error(\n 'An unknown error occurred during passkey authentication. Please try again or use a different authentication method.',\n );\n }\n }\n\n throw new Error(`Passkey authentication failed: ${error instanceof Error ? error.message : 'Unknown error'}`);\n }\n};\n\n/**\n * Check if the authenticator is a passkey/FIDO authenticator\n */\nconst isPasskeyAuthenticator = (authenticator: EmbeddedSignInFlowAuthenticator): boolean =>\n authenticator.authenticatorId === ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Passkey &&\n authenticator.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.InternalPrompt &&\n (authenticator.metadata as any)?.additionalData?.challengeData;\n\n/**\n * Props for the BaseSignIn component.\n */\nexport interface BaseSignInProps {\n afterSignInUrl?: string;\n\n /**\n * Custom CSS class name for the submit button.\n */\n buttonClassName?: string;\n\n /**\n * Custom CSS class name for the form container.\n */\n className?: string;\n\n /**\n * Custom CSS class name for error messages.\n */\n errorClassName?: string;\n\n /**\n * Custom CSS class name for form inputs.\n */\n inputClassName?: string;\n\n /**\n * Custom CSS class name for info messages.\n */\n messageClassName?: string;\n\n /**\n * Callback function called when authentication fails.\n * @param error - The error that occurred during authentication.\n */\n onError?: (error: Error) => void;\n\n /**\n * Callback function called when authentication flow status changes.\n * @param response - The current authentication response.\n */\n onFlowChange?: (response: EmbeddedSignInFlowInitiateResponse | EmbeddedSignInFlowHandleResponse) => void;\n\n /**\n * Flag to determine the component is ready to be rendered.\n */\n isLoading?: boolean;\n\n /**\n * Function to initialize authentication flow.\n * @returns Promise resolving to the initial authentication response.\n */\n onInitialize?: () => Promise<EmbeddedSignInFlowInitiateResponse>;\n\n /**\n * Function to handle authentication steps.\n * @param payload - The authentication payload.\n * @returns Promise resolving to the authentication response.\n */\n onSubmit?: (\n payload: EmbeddedSignInFlowHandleRequestPayload,\n request: EmbeddedFlowExecuteRequestConfig,\n ) => Promise<EmbeddedSignInFlowHandleResponse>;\n\n /**\n * Callback function called when authentication is successful.\n * @param authData - The authentication data returned upon successful completion.\n */\n onSuccess?: (authData: Record<string, any>) => void;\n\n /**\n * Size variant for the component.\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Theme variant for the component.\n */\n variant?: CardProps['variant'];\n}\n\n/**\n * Custom hook for managing component styles\n */\nconst useStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n () => ({\n card: {\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n minWidth: '420px',\n } as CSSProperties,\n header: {\n gap: 0,\n } as CSSProperties,\n subtitle: {\n marginTop: `calc(${theme.vars.spacing.unit} * 1)`,\n } as CSSProperties,\n messagesContainer: {\n marginTop: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n messageItem: {\n marginBottom: `calc(${theme.vars.spacing.unit} * 1)`,\n } as CSSProperties,\n errorContainer: {\n marginBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n contentContainer: {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n loadingContainer: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n } as CSSProperties,\n loadingText: {\n marginTop: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n divider: {\n margin: `calc(${theme.vars.spacing.unit} * 1) 0`,\n } as CSSProperties,\n logoContainer: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n marginBottom: `calc(${theme.vars.spacing.unit} * 3)`,\n } as CSSProperties,\n centeredContainer: {\n textAlign: 'center',\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n } as CSSProperties,\n passkeyContainer: {\n marginBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n passkeyText: {\n marginTop: `calc(${theme.vars.spacing.unit} * 1)`,\n color: theme.vars.colors.text.secondary,\n } as CSSProperties,\n }),\n [theme.vars.spacing.unit, theme.vars.colors.text.secondary],\n );\n};\n\n/**\n * Base SignIn component that provides native authentication flow.\n * This component handles both the presentation layer and authentication flow logic.\n * It accepts API functions as props to maintain framework independence.\n *\n * @example\n * ```tsx\n * import { BaseSignIn } from '@asgardeo/react';\n *\n * const MySignIn = () => {\n * return (\n * <BaseSignIn\n * onInitialize={async () => {\n * // Your API call to initialize authentication\n * return await initializeAuth();\n * }}\n * onSubmit={async (payload) => {\n * // Your API call to handle authentication\n * return await handleAuth(payload);\n * }}\n * onSuccess={(authData) => {\n * console.log('Success:', authData);\n * }}\n * onError={(error) => {\n * console.error('Error:', error);\n * }}\n * className=\"max-w-md mx-auto\"\n * />\n * );\n * };\n * ```\n */\nconst BaseSignIn: FC<BaseSignInProps> = props => {\n const {theme} = useTheme();\n const styles = useStyles();\n\n return (\n <div>\n <div style={styles.logoContainer}>\n <Logo size=\"large\" />\n </div>\n <FlowProvider>\n <BaseSignInContent {...props} />\n </FlowProvider>\n </div>\n );\n};\n\n/**\n * Internal component that consumes FlowContext and renders the sign-in UI.\n */\nconst BaseSignInContent: FC<BaseSignInProps> = ({\n afterSignInUrl,\n onInitialize,\n isLoading: externalIsLoading,\n onSubmit,\n onSuccess,\n onError,\n onFlowChange,\n className = '',\n inputClassName = '',\n buttonClassName = '',\n errorClassName = '',\n messageClassName = '',\n size = 'medium',\n variant = 'outlined',\n}: BaseSignInProps) => {\n const {theme} = useTheme();\n const {t} = useTranslation();\n const {subtitle: flowSubtitle, title: flowTitle, messages: flowMessages} = useFlow();\n const styles = useStyles();\n\n const [isSignInInitializationRequestLoading, setIsSignInInitializationRequestLoading] = useState(false);\n const [isInitialized, setIsInitialized] = useState(false);\n const [currentFlow, setCurrentFlow] = useState<EmbeddedSignInFlowInitiateResponse | null>(null);\n const [currentAuthenticator, setCurrentAuthenticator] = useState<EmbeddedSignInFlowAuthenticator | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [messages, setMessages] = useState<Array<{message: string; type: string}>>([]);\n\n const isLoading = externalIsLoading || isSignInInitializationRequestLoading;\n\n const reRenderCheckRef = useRef(false);\n\n const formFields: FormField[] =\n currentAuthenticator?.metadata?.params?.map(param => ({\n name: param.param,\n required: currentAuthenticator.requiredParams.includes(param.param),\n initialValue: '',\n validator: (value: string) => {\n if (currentAuthenticator.requiredParams.includes(param.param) && (!value || value.trim() === '')) {\n return t('field.required');\n }\n return null;\n },\n })) || [];\n\n const form = useForm<Record<string, string>>({\n initialValues: {},\n fields: formFields,\n validateOnBlur: true,\n validateOnChange: false,\n requiredMessage: t('field.required'),\n });\n\n const {\n values: formValues,\n touched: touchedFields,\n errors: formErrors,\n isValid: isFormValid,\n setValue: setFormValue,\n setTouched: setFormTouched,\n clearErrors: clearFormErrors,\n validateField: validateFormField,\n validateForm,\n touchAllFields,\n reset: resetForm,\n } = form;\n\n /**\n * Setup form fields based on the current authenticator.\n */\n const setupFormFields = useCallback(\n (authenticator: EmbeddedSignInFlowAuthenticator) => {\n const initialValues: Record<string, string> = {};\n authenticator.metadata?.params?.forEach(param => {\n initialValues[param.param] = '';\n });\n\n // Reset form with new values\n resetForm();\n\n // Set initial values for all fields\n Object.keys(initialValues).forEach(key => {\n setFormValue(key, initialValues[key]);\n });\n },\n [resetForm, setFormValue],\n );\n\n /**\n * Mark all fields as touched for validation purposes.\n */\n const markAllFieldsAsTouched = () => {\n touchAllFields();\n };\n\n /**\n * Check if the response contains a redirection URL and perform the redirect if necessary.\n * @param response - The authentication response\n * @returns true if a redirect was performed, false otherwise\n */\n const handleRedirectionIfNeeded = (response: EmbeddedSignInFlowHandleResponse): boolean => {\n if (\n response &&\n 'nextStep' in response &&\n response.nextStep &&\n (response.nextStep as any).stepType === EmbeddedSignInFlowStepType.AuthenticatorPrompt &&\n (response.nextStep as any).authenticators &&\n (response.nextStep as any).authenticators.length === 1\n ) {\n const responseAuthenticator = (response.nextStep as any).authenticators[0];\n if (\n responseAuthenticator.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.RedirectionPrompt &&\n (responseAuthenticator.metadata as any)?.additionalData?.redirectUrl\n ) {\n /**\n * Open a popup window to handle redirection prompts\n */\n const redirectUrl = (responseAuthenticator.metadata as any)?.additionalData?.redirectUrl;\n const popup = window.open(redirectUrl, 'oauth_popup', 'width=500,height=600,scrollbars=yes,resizable=yes');\n\n if (!popup) {\n console.error('Failed to open popup window');\n return false;\n }\n\n /**\n * Add an event listener to the window to capture the message from the popup\n */\n const messageHandler = async function messageEventHandler(event: MessageEvent) {\n /**\n * Check if the message is from our popup window\n */\n if (event.source !== popup) {\n // Don't log every message rejection to reduce noise\n if (event.source !== window && event.source !== window.parent) {\n // TODO: Add logs\n }\n return;\n }\n\n /**\n * Check the origin of the message to ensure it's from a trusted source\n */\n const expectedOrigin = afterSignInUrl ? new URL(afterSignInUrl).origin : window.location.origin;\n if (event.origin !== expectedOrigin && event.origin !== window.location.origin) {\n return;\n }\n\n const {code, state} = event.data;\n\n if (code && state) {\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: responseAuthenticator.authenticatorId,\n params: {\n code,\n state,\n },\n },\n };\n\n await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n\n popup.close();\n cleanup();\n } else {\n // TODO: Add logs\n }\n };\n\n const cleanup = () => {\n window.removeEventListener('message', messageHandler);\n if (popupMonitor) {\n clearInterval(popupMonitor);\n }\n };\n\n window.addEventListener('message', messageHandler);\n\n /**\n * Monitor popup for closure and URL changes\n */\n let hasProcessedCallback = false; // Prevent multiple processing\n const popupMonitor = setInterval(async () => {\n try {\n if (popup.closed) {\n cleanup();\n\n return;\n }\n\n // Skip if we've already processed a callback\n if (hasProcessedCallback) {\n return;\n }\n\n // Try to access popup URL to check for callback\n try {\n const popupUrl = popup.location.href;\n\n // Check if we've been redirected to the callback URL\n if (popupUrl && (popupUrl.includes('code=') || popupUrl.includes('error='))) {\n hasProcessedCallback = true; // Set flag to prevent multiple processing\n\n // Parse the URL for OAuth parameters\n const url = new URL(popupUrl);\n const code = url.searchParams.get('code');\n const state = url.searchParams.get('state');\n const error = url.searchParams.get('error');\n\n if (error) {\n console.error('OAuth error:', error);\n popup.close();\n cleanup();\n return;\n }\n\n if (code && state) {\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: responseAuthenticator.authenticatorId,\n params: {\n code,\n state,\n },\n },\n };\n\n const response = await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n\n popup.close();\n\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.(response.authData);\n }\n }\n }\n } catch (e) {\n // Cross-origin error is expected when popup navigates to OAuth provider\n // This is normal and we can ignore it\n }\n } catch (e) {\n console.error('Error monitoring popup:', e);\n }\n }, 1000);\n\n return true;\n }\n }\n return false;\n };\n\n /**\n * Handle form submission.\n */\n const handleSubmit = async (submittedValues: Record<string, string>) => {\n if (!currentFlow || !currentAuthenticator) {\n return;\n }\n\n // Mark all fields as touched before validation\n touchAllFields();\n\n const validation = validateForm();\n if (!validation.isValid) {\n return;\n }\n\n setIsSignInInitializationRequestLoading(true);\n setError(null);\n setMessages([]);\n\n try {\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: currentAuthenticator.authenticatorId,\n params: submittedValues,\n },\n };\n\n const response = await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.(response.authData);\n return;\n }\n\n if (\n response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted ||\n response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete\n ) {\n setError(t('errors.sign.in.flow.completion.failure'));\n return;\n }\n\n // Check if the response contains a redirection URL and redirect if needed\n if (handleRedirectionIfNeeded(response)) {\n return;\n }\n\n if (response && 'flowId' in response && 'nextStep' in response) {\n const nextStepResponse = response as any;\n setCurrentFlow(nextStepResponse);\n\n if (nextStepResponse.nextStep?.authenticators?.length > 0) {\n if (\n nextStepResponse.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt &&\n nextStepResponse.nextStep.authenticators.length > 1\n ) {\n setCurrentAuthenticator(null);\n } else {\n const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];\n setCurrentAuthenticator(nextAuthenticator);\n setupFormFields(nextAuthenticator);\n }\n }\n\n if (nextStepResponse.nextStep?.messages) {\n setMessages(\n nextStepResponse.nextStep.messages.map((msg: any) => ({\n type: msg.type || 'INFO',\n message: msg.message || '',\n })),\n );\n }\n }\n } catch (err) {\n const errorMessage = err instanceof AsgardeoAPIError ? err.message : t('errors.sign.in.flow.failure');\n setError(errorMessage);\n onError?.(err as Error);\n } finally {\n setIsSignInInitializationRequestLoading(false);\n }\n };\n\n /**\n * Handle authenticator selection for multi-option prompts.\n */\n const handleAuthenticatorSelection = async (\n authenticator: EmbeddedSignInFlowAuthenticator,\n formData?: Record<string, string>,\n ) => {\n if (!currentFlow) {\n return;\n }\n\n // Mark all fields as touched if we have form data (i.e., this is a submission)\n if (formData) {\n touchAllFields();\n }\n\n setIsSignInInitializationRequestLoading(true);\n setError(null);\n setMessages([]);\n\n try {\n // Handle passkey/FIDO authentication\n if (isPasskeyAuthenticator(authenticator)) {\n try {\n const challengeData = (authenticator.metadata as any)?.additionalData?.challengeData;\n if (!challengeData) {\n throw new Error('Missing challenge data for passkey authentication');\n }\n\n const tokenResponse = await handleWebAuthnAuthentication(challengeData);\n\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: authenticator.authenticatorId,\n params: {\n tokenResponse,\n },\n },\n };\n\n const response = await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.(response.authData);\n return;\n }\n\n if (\n response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted ||\n response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete\n ) {\n setError(t('errors.sign.in.flow.passkeys.completion.failure'));\n return;\n }\n\n // Handle next step if authentication is not complete\n if (response && 'flowId' in response && 'nextStep' in response) {\n const nextStepResponse = response as any;\n setCurrentFlow(nextStepResponse);\n\n if (nextStepResponse.nextStep?.authenticators?.length > 0) {\n if (\n nextStepResponse.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt &&\n nextStepResponse.nextStep.authenticators.length > 1\n ) {\n setCurrentAuthenticator(null);\n } else {\n const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];\n\n // Check if the next authenticator is also a passkey - if so, auto-trigger it\n if (isPasskeyAuthenticator(nextAuthenticator)) {\n // Recursively handle the passkey authenticator without showing UI\n handleAuthenticatorSelection(nextAuthenticator);\n return;\n }\n setCurrentAuthenticator(nextAuthenticator);\n setupFormFields(nextAuthenticator);\n }\n }\n\n if (nextStepResponse.nextStep?.messages) {\n setMessages(\n nextStepResponse.nextStep.messages.map((msg: any) => ({\n type: msg.type || 'INFO',\n message: msg.message || '',\n })),\n );\n }\n }\n } catch (passkeyError) {\n console.error('Passkey authentication error:', passkeyError);\n\n // Provide more context for common errors\n let errorMessage =\n passkeyError instanceof Error ? passkeyError.message : t('errors.sign.in.flow.passkeys.failure');\n\n // Add additional context for security errors\n if (passkeyError instanceof Error && passkeyError.message.includes('security')) {\n errorMessage +=\n ' This may be due to browser security settings, an insecure connection, or device restrictions.';\n }\n\n setError(errorMessage);\n }\n } else if (authenticator.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.RedirectionPrompt) {\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: authenticator.authenticatorId,\n params: {},\n },\n };\n\n const response = await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.(response.authData);\n return;\n }\n\n // Check if the response contains a redirection URL and redirect if needed\n if (handleRedirectionIfNeeded(response)) {\n }\n } else if (formData) {\n const validation = validateForm();\n if (!validation.isValid) {\n return;\n }\n\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: authenticator.authenticatorId,\n params: formData,\n },\n };\n\n const response = await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.(response.authData);\n return;\n }\n\n if (\n response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted ||\n response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete\n ) {\n setError('Authentication failed. Please check your credentials and try again.');\n return;\n }\n\n // Check if the response contains a redirection URL and redirect if needed\n if (handleRedirectionIfNeeded(response)) {\n return;\n }\n\n if (response && 'flowId' in response && 'nextStep' in response) {\n const nextStepResponse = response as any;\n setCurrentFlow(nextStepResponse);\n\n if (nextStepResponse.nextStep?.authenticators?.length > 0) {\n if (\n nextStepResponse.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt &&\n nextStepResponse.nextStep.authenticators.length > 1\n ) {\n setCurrentAuthenticator(null);\n } else {\n const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];\n\n // Check if the next authenticator is a passkey - if so, auto-trigger it\n if (isPasskeyAuthenticator(nextAuthenticator)) {\n // Recursively handle the passkey authenticator without showing UI\n handleAuthenticatorSelection(nextAuthenticator);\n return;\n }\n setCurrentAuthenticator(nextAuthenticator);\n setupFormFields(nextAuthenticator);\n }\n }\n\n if (nextStepResponse.nextStep?.messages) {\n setMessages(\n nextStepResponse.nextStep.messages.map((msg: any) => ({\n type: msg.type || 'INFO',\n message: msg.message || '',\n })),\n );\n }\n }\n } else {\n // Check if the authenticator requires user input\n const hasParams = authenticator.metadata?.params && authenticator.metadata.params.length > 0;\n\n if (!hasParams) {\n // If no parameters are required, directly authenticate\n const payload = {\n flowId: currentFlow.flowId,\n selectedAuthenticator: {\n authenticatorId: authenticator.authenticatorId,\n params: {},\n },\n };\n\n const response = await onSubmit(payload, {\n method: currentFlow?.links[0].method,\n url: currentFlow?.links[0].href,\n });\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.(response.authData);\n return;\n }\n\n if (\n response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted ||\n response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete\n ) {\n setError('Authentication failed. Please try again.');\n return;\n }\n\n // Check if the response contains a redirection URL and redirect if needed\n if (handleRedirectionIfNeeded(response)) {\n return;\n }\n\n if (response && 'flowId' in response && 'nextStep' in response) {\n const nextStepResponse = response as any;\n setCurrentFlow(nextStepResponse);\n\n if (nextStepResponse.nextStep?.authenticators?.length > 0) {\n if (\n nextStepResponse.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt &&\n nextStepResponse.nextStep.authenticators.length > 1\n ) {\n setCurrentAuthenticator(null);\n } else {\n const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];\n\n // Check if the next authenticator is a passkey - if so, auto-trigger it\n if (isPasskeyAuthenticator(nextAuthenticator)) {\n // Recursively handle the passkey authenticator without showing UI\n handleAuthenticatorSelection(nextAuthenticator);\n return;\n }\n setCurrentAuthenticator(nextAuthenticator);\n setupFormFields(nextAuthenticator);\n }\n }\n\n if (nextStepResponse.nextStep?.messages) {\n setMessages(\n nextStepResponse.nextStep.messages.map((msg: any) => ({\n type: msg.type || 'INFO',\n message: msg.message || '',\n })),\n );\n }\n }\n } else {\n // If parameters are required, show the form\n setCurrentAuthenticator(authenticator);\n setupFormFields(authenticator);\n }\n }\n } catch (err) {\n const errorMessage = err instanceof AsgardeoAPIError ? err?.message : 'Authenticator selection failed';\n setError(errorMessage);\n onError?.(err as Error);\n } finally {\n setIsSignInInitializationRequestLoading(false);\n }\n };\n\n /**\n * Handle input value changes.\n */\n const handleInputChange = (param: string, value: string) => {\n setFormValue(param, value);\n setFormTouched(param, true);\n };\n\n /**\n * Check if current flow has multiple authenticator options.\n */\n const hasMultipleOptions = useCallback(\n (): boolean =>\n currentFlow &&\n 'nextStep' in currentFlow &&\n currentFlow.nextStep?.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt &&\n currentFlow.nextStep?.authenticators &&\n currentFlow.nextStep.authenticators.length > 1,\n [currentFlow],\n );\n\n /**\n * Get available authenticators for selection.\n */\n const getAvailableAuthenticators = useCallback((): EmbeddedSignInFlowAuthenticator[] => {\n if (!currentFlow || !('nextStep' in currentFlow) || !currentFlow.nextStep?.authenticators) {\n return [];\n }\n return currentFlow.nextStep.authenticators;\n }, [currentFlow]);\n\n // Generate CSS classes\n const containerClasses = clsx(\n [\n withVendorCSSClassPrefix('signin'),\n withVendorCSSClassPrefix(`signin--${size}`),\n withVendorCSSClassPrefix(`signin--${variant}`),\n ],\n className,\n );\n\n const inputClasses = clsx(\n [\n withVendorCSSClassPrefix('signin__input'),\n size === 'small' && withVendorCSSClassPrefix('signin__input--small'),\n size === 'large' && withVendorCSSClassPrefix('signin__input--large'),\n ],\n inputClassName,\n );\n\n const buttonClasses = clsx(\n [\n withVendorCSSClassPrefix('signin__button'),\n size === 'small' && withVendorCSSClassPrefix('signin__button--small'),\n size === 'large' && withVendorCSSClassPrefix('signin__button--large'),\n ],\n buttonClassName,\n );\n\n const errorClasses = clsx([withVendorCSSClassPrefix('signin__error')], errorClassName);\n\n const messageClasses = clsx([withVendorCSSClassPrefix('signin__messages')], messageClassName); // Initialize the flow on component mount\n\n useEffect(() => {\n if (isLoading) {\n return;\n }\n\n // React 18.x Strict.Mode has a new check for `Ensuring reusable state` to facilitate an upcoming react feature.\n // https://reactjs.org/docs/strict-mode.html#ensuring-reusable-state\n // This will remount all the useEffects to ensure that there are no unexpected side effects.\n // When react remounts the SignIn, it will send two authorize requests.\n // https://github.com/reactwg/react-18/discussions/18#discussioncomment-795623\n if (reRenderCheckRef.current) {\n return;\n }\n\n reRenderCheckRef.current = true;\n\n (async () => {\n setIsSignInInitializationRequestLoading(true);\n setError(null);\n\n try {\n const response = await onInitialize();\n\n setCurrentFlow(response);\n setIsInitialized(true);\n onFlowChange?.(response);\n\n if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {\n onSuccess?.((response as any).authData || {});\n return;\n }\n\n if (response?.nextStep?.authenticators?.length > 0) {\n if (\n response.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt &&\n response.nextStep.authenticators.length > 1\n ) {\n setCurrentAuthenticator(null);\n } else {\n const authenticator = response.nextStep.authenticators[0];\n setCurrentAuthenticator(authenticator);\n setupFormFields(authenticator);\n }\n }\n\n if (response && 'nextStep' in response && response.nextStep && 'messages' in response.nextStep) {\n const stepMessages = (response.nextStep as any).messages || [];\n setMessages(\n stepMessages.map((msg: any) => ({\n type: msg.type || 'INFO',\n message: msg.message || '',\n })),\n );\n }\n } catch (err) {\n const errorMessage = err instanceof AsgardeoAPIError ? err.message : t('errors.sign.in.initialization');\n setError(errorMessage);\n onError?.(err as Error);\n } finally {\n setIsSignInInitializationRequestLoading(false);\n }\n })();\n }, [isLoading]);\n\n if (!isInitialized && isLoading) {\n return (\n <Card className={containerClasses} style={styles.card} variant={variant}>\n <Card.Content>\n <div style={styles.loadingContainer}>\n <Spinner size=\"medium\" />\n <Typography variant=\"body1\" style={styles.loadingText}>\n {t('messages.loading')}\n </Typography>\n </div>\n </Card.Content>\n </Card>\n );\n }\n\n if (hasMultipleOptions() && !currentAuthenticator) {\n const availableAuthenticators = getAvailableAuthenticators();\n\n const userPromptAuthenticators = availableAuthenticators.filter(\n auth =>\n auth.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.UserPrompt ||\n // Fallback: LOCAL authenticators with params are typically user prompts\n (auth.idp === 'LOCAL' && auth.metadata?.params && auth.metadata.params.length > 0),\n );\n\n const optionAuthenticators = availableAuthenticators.filter(auth => !userPromptAuthenticators.includes(auth));\n\n return (\n <Card className={containerClasses} style={styles.card} variant={variant}>\n <Card.Header style={styles.header}>\n <Card.Title level={2}>{flowTitle || t('signin.title')}</Card.Title>\n {flowSubtitle && (\n <Typography variant=\"body1\" style={styles.subtitle}>\n {flowSubtitle || t('signin.subtitle')}\n </Typography>\n )}\n {flowMessages && flowMessages.length > 0 && (\n <div style={styles.messagesContainer}>\n {flowMessages.map((flowMessage, index) => (\n <Alert\n key={flowMessage.id || index}\n variant={flowMessage.type}\n style={styles.messageItem}\n className={messageClasses}\n >\n <Alert.Description>{flowMessage.message}</Alert.Description>\n </Alert>\n ))}\n </div>\n )}\n {messages.length > 0 && (\n <div style={styles.messagesContainer}>\n {messages.map((message, index) => {\n const variant =\n message.type.toLowerCase() === 'error'\n ? 'error'\n : message.type.toLowerCase() === 'warning'\n ? 'warning'\n : message.type.toLowerCase() === 'success'\n ? 'success'\n : 'info';\n\n return (\n <Alert key={index} variant={variant} style={styles.messageItem} className={messageClasses}>\n <Alert.Description>{message.message}</Alert.Description>\n </Alert>\n );\n })}\n </div>\n )}\n </Card.Header>\n\n <Card.Content>\n {error && (\n <Alert variant=\"error\" style={styles.errorContainer} className={errorClasses}>\n <Alert.Title>Error</Alert.Title>\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n )}\n\n <div style={styles.contentContainer}>\n {/* Render USER_PROMPT authenticators as form fields */}\n {userPromptAuthenticators.map((authenticator, index) => (\n <div key={authenticator.authenticatorId}>\n {index > 0 && <Divider style={styles.divider}>OR</Divider>}\n <form\n onSubmit={e => {\n e.preventDefault();\n const formData: Record<string, string> = {};\n authenticator.metadata?.params?.forEach(param => {\n formData[param.param] = formValues[param.param] || '';\n });\n handleAuthenticatorSelection(authenticator, formData);\n }}\n >\n {createSignInOptionFromAuthenticator(\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n handleInputChange,\n (auth, formData) => handleAuthenticatorSelection(auth, formData),\n {\n inputClassName: inputClasses,\n buttonClassName: buttonClasses,\n error,\n },\n )}\n </form>\n </div>\n ))}\n\n {/* Add divider between user prompts and option authenticators if both exist */}\n {userPromptAuthenticators.length > 0 && optionAuthenticators.length > 0 && (\n <Divider style={styles.divider}>OR</Divider>\n )}\n\n {/* Render all other authenticators (REDIRECTION_PROMPT, multi-option buttons, etc.) */}\n {optionAuthenticators.map((authenticator, index) => (\n <div key={authenticator.authenticatorId}>\n {createSignInOptionFromAuthenticator(\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n handleInputChange,\n (auth, formData) => handleAuthenticatorSelection(auth, formData),\n {\n inputClassName: inputClasses,\n buttonClassName: buttonClasses,\n error,\n },\n )}\n </div>\n ))}\n </div>\n </Card.Content>\n </Card>\n );\n }\n\n if (!currentAuthenticator) {\n return (\n <Card className={containerClasses} variant={variant}>\n <Card.Content>\n {error && (\n <Alert variant=\"error\">\n <Alert.Title>{t('errors.title') || 'Error'}</Alert.Title>\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n )}\n </Card.Content>\n </Card>\n );\n }\n\n // If the current authenticator is a passkey, auto-trigger it instead of showing a form\n if (isPasskeyAuthenticator(currentAuthenticator) && !isLoading) {\n // Auto-trigger passkey authentication\n useEffect(() => {\n handleAuthenticatorSelection(currentAuthenticator);\n }, [currentAuthenticator]);\n\n // Show loading state while passkey authentication is in progress\n return (\n <Card className={containerClasses} variant={variant}>\n <Card.Content>\n <div style={styles.centeredContainer}>\n <div style={styles.passkeyContainer}>\n <Spinner size=\"large\" />\n </div>\n <Typography variant=\"body1\">{t('passkey.authenticating') || 'Authenticating with passkey...'}</Typography>\n <Typography variant=\"body2\" style={styles.passkeyText}>\n {t('passkey.instruction') || 'Please use your fingerprint, face, or security key to authenticate.'}\n </Typography>\n </div>\n </Card.Content>\n </Card>\n );\n }\n\n return (\n <Card className={containerClasses} style={styles.card} variant={variant}>\n <Card.Header style={styles.header}>\n <Card.Title level={2}>{flowTitle || t('signin.title')}</Card.Title>\n <Typography variant=\"body1\" style={styles.subtitle}>\n {flowSubtitle || t('signin.subtitle')}\n </Typography>\n {flowMessages && flowMessages.length > 0 && (\n <div style={styles.messagesContainer}>\n {flowMessages.map((flowMessage, index) => (\n <Alert\n key={flowMessage.id || index}\n variant={flowMessage.type}\n style={styles.messageItem}\n className={messageClasses}\n >\n <Alert.Description>{flowMessage.message}</Alert.Description>\n </Alert>\n ))}\n </div>\n )}\n {messages.length > 0 && (\n <div style={styles.messagesContainer}>\n {messages.map((message, index) => {\n const variant =\n message.type.toLowerCase() === 'error'\n ? 'error'\n : message.type.toLowerCase() === 'warning'\n ? 'warning'\n : message.type.toLowerCase() === 'success'\n ? 'success'\n : 'info';\n\n return (\n <Alert key={index} variant={variant} style={styles.messageItem} className={messageClasses}>\n <Alert.Description>{message.message}</Alert.Description>\n </Alert>\n );\n })}\n </div>\n )}\n </Card.Header>\n\n <Card.Content>\n {error && (\n <Alert variant=\"error\" style={styles.errorContainer} className={errorClasses}>\n <Alert.Title>{t('errors.title')}</Alert.Title>\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n )}\n\n <form\n onSubmit={(e: FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData: Record<string, string> = {};\n currentAuthenticator.metadata?.params?.forEach(param => {\n formData[param.param] = formValues[param.param] || '';\n });\n handleSubmit(formData);\n }}\n >\n {createSignInOptionFromAuthenticator(\n currentAuthenticator,\n formValues,\n touchedFields,\n isLoading,\n handleInputChange,\n (authenticator, formData) => handleSubmit(formData || formValues),\n {\n inputClassName: inputClasses,\n buttonClassName: buttonClasses,\n error,\n },\n )}\n </form>\n </Card.Content>\n </Card>\n );\n};\n\nexport default BaseSignIn;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n EmbeddedSignInFlowAuthenticator,\n EmbeddedSignInFlowAuthenticatorKnownIdPType,\n ApplicationNativeAuthenticationConstants,\n WithPreferences,\n} from '@asgardeo/browser';\nimport {ReactElement} from 'react';\nimport UsernamePassword from './UsernamePassword';\nimport IdentifierFirst from './IdentifierFirst';\nimport GoogleButton from './GoogleButton';\nimport GitHubButton from './GitHubButton';\nimport MicrosoftButton from './MicrosoftButton';\nimport FacebookButton from './FacebookButton';\nimport LinkedInButton from './LinkedInButton';\nimport SignInWithEthereumButton from './SignInWithEthereumButton';\nimport EmailOtp from './EmailOtp';\nimport Totp from './Totp';\nimport SmsOtp from './SmsOtp';\nimport SocialButton from './SocialButton';\nimport MultiOptionButton from './MultiOptionButton';\n\n/**\n * Base props that all sign-in option components share.\n */\nexport interface BaseSignInOptionProps extends WithPreferences {\n /**\n * The authenticator configuration.\n */\n authenticator: EmbeddedSignInFlowAuthenticator;\n\n /**\n * Current form values.\n */\n formValues: Record<string, string>;\n\n /**\n * Touched state for form fields.\n */\n touchedFields: Record<string, boolean>;\n\n /**\n * Whether the component is in loading state.\n */\n isLoading: boolean;\n\n /**\n * Error message to display.\n */\n error?: string | null;\n\n /**\n * Callback function called when input values change.\n */\n onInputChange: (param: string, value: string) => void;\n\n /**\n * Callback function called when the option is submitted.\n */\n onSubmit: (authenticator: EmbeddedSignInFlowAuthenticator, formData?: Record<string, string>) => void;\n\n /**\n * Custom CSS class name for form inputs.\n */\n inputClassName?: string;\n\n /**\n * Custom CSS class name for the submit button.\n */\n buttonClassName?: string;\n\n /**\n * Text for the submit button.\n */\n submitButtonText?: string;\n}\n\n/**\n * Creates the appropriate sign-in option component based on the authenticator's ID.\n */\nexport const createSignInOption = (props: BaseSignInOptionProps): ReactElement => {\n const {authenticator, ...optionProps} = props;\n\n // Check if this authenticator has params (indicating it needs user input)\n const hasParams = authenticator.metadata?.params && authenticator.metadata.params.length > 0;\n\n // Use authenticatorId to determine the component type\n switch (authenticator.authenticatorId) {\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.UsernamePassword:\n return <UsernamePassword {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.IdentifierFirst:\n return <IdentifierFirst {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Google:\n return <GoogleButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.GitHub:\n return <GitHubButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Microsoft:\n return <MicrosoftButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Facebook:\n return <FacebookButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.LinkedIn:\n return <LinkedInButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.SignInWithEthereum:\n return <SignInWithEthereumButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.EmailOtp:\n // If it has params, render as input form, otherwise as selection button\n return hasParams ? <EmailOtp {...props} /> : <MultiOptionButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Totp:\n // If it has params, render as input form, otherwise as selection button\n return hasParams ? <Totp {...props} /> : <MultiOptionButton {...props} />;\n\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.SmsOtp:\n // If it has params, render as input form, otherwise as selection button\n return hasParams ? <SmsOtp {...props} /> : <MultiOptionButton {...props} />;\n\n default:\n // Check if it's a federated authenticator (non-LOCAL idp)\n if (authenticator.idp !== EmbeddedSignInFlowAuthenticatorKnownIdPType.Local) {\n // For unknown federated authenticators, use generic social login\n return <SocialButton {...props} />;\n }\n\n // For LOCAL authenticators, decide based on whether they have params\n if (hasParams) {\n // Fallback to username/password for unknown local authenticators with params\n return <UsernamePassword {...props} />;\n } else {\n // Use multi-option button for LOCAL authenticators without params\n return <MultiOptionButton {...props} />;\n }\n }\n};\n\n/**\n * Convenience function that creates the appropriate sign-in option component from an authenticator.\n */\nexport const createSignInOptionFromAuthenticator = (\n authenticator: EmbeddedSignInFlowAuthenticator,\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n isLoading: boolean,\n onInputChange: (param: string, value: string) => void,\n onSubmit: (authenticator: EmbeddedSignInFlowAuthenticator, formData?: Record<string, string>) => void,\n options?: {\n inputClassName?: string;\n buttonClassName?: string;\n error?: string | null;\n },\n): ReactElement => {\n return createSignInOption({\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n onInputChange,\n onSubmit,\n ...options,\n });\n};\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedSignInFlowAuthenticator, EmbeddedSignInFlowAuthenticatorParamType, FieldType} from '@asgardeo/browser';\nimport {FC, useEffect} from 'react';\nimport {createField} from '../../../factories/FieldFactory';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport useFlow from '../../../../contexts/Flow/useFlow';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * Username Password Sign-In Option Component.\n * Handles traditional username and password authentication.\n */\nconst UsernamePassword: FC<BaseSignInOptionProps> = ({\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n onInputChange,\n onSubmit,\n inputClassName = '',\n buttonClassName = '',\n preferences,\n}) => {\n const {theme} = useTheme();\n const {t} = useTranslation(preferences?.i18n);\n const {setTitle, setSubtitle} = useFlow();\n\n const formFields =\n authenticator.metadata?.params?.sort((a, b) => a.order - b.order)?.filter(param => param.param !== 'totp') || []; // Exclude TOTP fields for username/password\n\n useEffect(() => {\n setTitle(t('username.password.title'));\n setSubtitle(t('username.password.subtitle'));\n }, [setTitle, setSubtitle, t]);\n\n return (\n <>\n {formFields.map(param => (\n <div key={param.param} style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {createField({\n name: param.param,\n type:\n param.type === EmbeddedSignInFlowAuthenticatorParamType.String\n ? param.confidential\n ? FieldType.Password\n : FieldType.Text\n : FieldType.Text,\n label: param.displayName,\n required: authenticator.requiredParams.includes(param.param),\n value: formValues[param.param] || '',\n onChange: value => onInputChange(param.param, value),\n disabled: isLoading,\n className: inputClassName,\n touched: touchedFields[param.param] || false,\n placeholder: t(`elements.fields.placeholder`, {\n field: (param.displayName || param.param).toLowerCase(),\n }),\n })}\n </div>\n ))}\n\n <Button\n type=\"submit\"\n disabled={isLoading}\n loading={isLoading}\n className={buttonClassName}\n color=\"primary\"\n variant=\"solid\"\n fullWidth\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n {t('username.password.submit.button')}\n </Button>\n </>\n );\n};\n\nexport default UsernamePassword;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, InputHTMLAttributes, ReactNode} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\nexport interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className'> {\n /**\n * Label text to display above the input\n */\n label?: string;\n /**\n * Error message to display below the input\n */\n error?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n /**\n * Helper text to display below the input\n */\n helperText?: string;\n /**\n * Icon to display at the start (left) of the input\n */\n startIcon?: ReactNode;\n /**\n * Icon to display at the end (right) of the input\n */\n endIcon?: ReactNode;\n /**\n * Click handler for the start icon\n */\n onStartIconClick?: () => void;\n /**\n * Click handler for the end icon\n */\n onEndIconClick?: () => void;\n}\n\nconst TextField: FC<TextFieldProps> = ({\n label,\n error,\n required,\n className,\n disabled,\n helperText,\n startIcon,\n endIcon,\n onStartIconClick,\n onEndIconClick,\n type = 'text',\n style = {},\n ...rest\n}) => {\n const {theme} = useTheme();\n\n // Calculate padding based on icons\n const hasStartIcon = !!startIcon;\n const hasEndIcon = !!endIcon;\n const leftPadding = hasStartIcon ? theme.spacing.unit * 5 : theme.spacing.unit * 1.5;\n const rightPadding = hasEndIcon ? theme.spacing.unit * 5 : theme.spacing.unit * 1.5;\n\n const inputStyle: CSSProperties = {\n width: '100%',\n padding: `${theme.spacing.unit}px ${rightPadding}px ${theme.spacing.unit}px ${leftPadding}px`,\n border: `1px solid ${error ? theme.colors.error.main : theme.colors.border}`,\n borderRadius: theme.borderRadius.medium,\n fontSize: '1rem',\n color: theme.colors.text.primary,\n backgroundColor: disabled ? theme.colors.background.disabled : theme.colors.background.surface,\n outline: 'none',\n transition: 'border-color 0.2s ease',\n };\n\n const inputContainerStyle: CSSProperties = {\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n };\n\n const iconButtonStyle: CSSProperties = {\n position: 'absolute',\n background: 'none',\n border: 'none',\n cursor: disabled ? 'not-allowed' : 'pointer',\n padding: theme.spacing.unit / 2,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n color: theme.colors.text.secondary,\n opacity: disabled ? 0.5 : 1,\n top: '50%',\n transform: 'translateY(-50%)',\n };\n\n const startIconStyle: CSSProperties = {\n ...iconButtonStyle,\n left: theme.spacing.unit,\n };\n\n const endIconStyle: CSSProperties = {\n ...iconButtonStyle,\n right: theme.spacing.unit,\n };\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={clsx(withVendorCSSClassPrefix('text-field'), className)}\n style={style}\n >\n {label && (\n <InputLabel required={required} error={!!error}>\n {label}\n </InputLabel>\n )}\n <div style={inputContainerStyle}>\n {startIcon && (\n <div\n style={startIconStyle}\n onClick={onStartIconClick}\n role={onStartIconClick ? 'button' : undefined}\n tabIndex={onStartIconClick && !disabled ? 0 : undefined}\n aria-label=\"Start icon\"\n >\n {startIcon}\n </div>\n )}\n <input\n style={inputStyle}\n type={type}\n disabled={disabled}\n aria-invalid={!!error}\n aria-required={required}\n {...rest}\n />\n {endIcon && (\n <div\n style={endIconStyle}\n onClick={onEndIconClick}\n role={onEndIconClick ? 'button' : undefined}\n tabIndex={onEndIconClick && !disabled ? 0 : undefined}\n aria-label=\"End icon\"\n >\n {endIcon}\n </div>\n )}\n </div>\n </FormControl>\n );\n};\n\nexport default TextField;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, ReactNode, ComponentPropsWithoutRef, ElementType} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\n// Typography variants mapped to HTML elements and styling\nexport type TypographyVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'subtitle1'\n | 'subtitle2'\n | 'body1'\n | 'body2'\n | 'caption'\n | 'overline'\n | 'button';\n\nexport type TypographyAlign = 'left' | 'center' | 'right' | 'justify';\n\nexport type TypographyColor =\n | 'primary'\n | 'secondary'\n | 'error'\n | 'success'\n | 'warning'\n | 'info'\n | 'textPrimary'\n | 'textSecondary'\n | 'inherit';\n\nexport interface TypographyProps {\n /**\n * The content to be rendered\n */\n children: ReactNode;\n /**\n * The typography variant to apply\n */\n variant?: TypographyVariant;\n /**\n * The HTML element or React component to render\n */\n component?: ElementType;\n /**\n * Text alignment\n */\n align?: TypographyAlign;\n /**\n * Color variant\n */\n color?: TypographyColor;\n /**\n * Whether the text should be clipped with ellipsis when it overflows\n */\n noWrap?: boolean;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Custom styles\n */\n style?: CSSProperties;\n /**\n * Whether the text should be displayed inline\n */\n inline?: boolean;\n /**\n * Custom font weight\n */\n fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold' | number;\n /**\n * Custom font size (overrides variant sizing)\n */\n fontSize?: string | number;\n /**\n * Line height\n */\n lineHeight?: string | number;\n /**\n * Whether to disable gutters (margin bottom)\n */\n gutterBottom?: boolean;\n}\n\n// Default component mapping for variants\nconst variantMapping: Record<TypographyVariant, ElementType> = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n caption: 'span',\n overline: 'span',\n button: 'span',\n};\n\n/**\n * Typography component for consistent text rendering throughout the application.\n * Integrates with the theme system and provides semantic HTML elements.\n */\nconst Typography: FC<TypographyProps> = ({\n children,\n variant = 'body1',\n component,\n align = 'left',\n color = 'textPrimary',\n noWrap = false,\n className,\n style = {},\n inline = false,\n fontWeight,\n fontSize,\n lineHeight,\n gutterBottom = false,\n ...rest\n}) => {\n const {theme} = useTheme();\n\n // Determine the component to render\n const Component = component || variantMapping[variant] || 'span';\n\n // Get color value from theme\n const getColorValue = (colorVariant: TypographyColor): string => {\n switch (colorVariant) {\n case 'primary':\n return theme.colors.primary.main;\n case 'secondary':\n return theme.colors.secondary.main;\n case 'error':\n return theme.colors.error.main;\n case 'textPrimary':\n return theme.colors.text.primary;\n case 'textSecondary':\n return theme.colors.text.secondary;\n case 'inherit':\n return 'inherit';\n default:\n return theme.colors.text.primary;\n }\n };\n\n // Get variant styles\n const getVariantStyles = (variantName: TypographyVariant): CSSProperties => {\n const baseUnit = theme.spacing.unit;\n\n switch (variantName) {\n case 'h1':\n return {\n fontSize: theme.vars.typography.fontSizes['3xl'], // 34px\n fontWeight: 600,\n lineHeight: 1.235,\n letterSpacing: '-0.00735em',\n };\n case 'h2':\n return {\n fontSize: theme.vars.typography.fontSizes['2xl'], // 24px\n fontWeight: 600,\n lineHeight: 1.334,\n letterSpacing: '0em',\n };\n case 'h3':\n return {\n fontSize: theme.vars.typography.fontSizes.xl, // 20px\n fontWeight: 600,\n lineHeight: 1.6,\n letterSpacing: '0.0075em',\n };\n case 'h4':\n return {\n fontSize: theme.vars.typography.fontSizes.lg, // 18px\n fontWeight: 600,\n lineHeight: 1.5,\n letterSpacing: '0.00938em',\n };\n case 'h5':\n return {\n fontSize: theme.vars.typography.fontSizes.md, // 16px\n fontWeight: 600,\n lineHeight: 1.334,\n letterSpacing: '0em',\n };\n case 'h6':\n return {\n fontSize: theme.vars.typography.fontSizes.sm, // 14px\n fontWeight: 500,\n lineHeight: 1.6,\n letterSpacing: '0.0075em',\n };\n case 'subtitle1':\n return {\n fontSize: theme.vars.typography.fontSizes.md, // 16px\n fontWeight: 400,\n lineHeight: 1.75,\n letterSpacing: '0.00938em',\n };\n case 'subtitle2':\n return {\n fontSize: theme.vars.typography.fontSizes.sm, // 14px\n fontWeight: 500,\n lineHeight: 1.57,\n letterSpacing: '0.00714em',\n };\n case 'body1':\n return {\n fontSize: theme.vars.typography.fontSizes.md, // 16px\n fontWeight: 400,\n lineHeight: 1.5,\n letterSpacing: '0.00938em',\n };\n case 'body2':\n return {\n fontSize: theme.vars.typography.fontSizes.sm, // 14px\n fontWeight: 400,\n lineHeight: 1.43,\n letterSpacing: '0.01071em',\n };\n case 'caption':\n return {\n fontSize: theme.vars.typography.fontSizes.xs, // 12px\n fontWeight: 400,\n lineHeight: 1.66,\n letterSpacing: '0.03333em',\n };\n case 'overline':\n return {\n fontSize: theme.vars.typography.fontSizes.xs, // 12px\n fontWeight: 400,\n lineHeight: 2.66,\n letterSpacing: '0.08333em',\n textTransform: 'uppercase',\n };\n case 'button':\n return {\n fontSize: theme.vars.typography.fontSizes.sm, // 14px\n fontWeight: 500,\n lineHeight: 1.75,\n letterSpacing: '0.02857em',\n textTransform: 'uppercase',\n };\n default:\n return {};\n }\n };\n\n const variantStyles = getVariantStyles(variant);\n\n const typographyStyle: CSSProperties = {\n margin: 0,\n color: getColorValue(color),\n textAlign: align,\n display: inline ? 'inline' : variantMapping[variant] === 'span' ? 'inline' : 'block',\n ...variantStyles,\n // Custom overrides\n ...(fontWeight && {fontWeight}),\n ...(fontSize && {fontSize: typeof fontSize === 'number' ? `${fontSize}px` : fontSize}),\n ...(lineHeight && {lineHeight}),\n ...(noWrap && {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }),\n ...(gutterBottom && {\n marginBottom: theme.spacing.unit + 'px',\n }),\n ...style,\n };\n\n return (\n <Component\n className={clsx(\n withVendorCSSClassPrefix('typography'),\n withVendorCSSClassPrefix(`typography-${variant}`),\n {\n [withVendorCSSClassPrefix('typography-noWrap')]: noWrap,\n [withVendorCSSClassPrefix('typography-inline')]: inline,\n [withVendorCSSClassPrefix('typography-gutterBottom')]: gutterBottom,\n },\n className,\n )}\n style={typographyStyle}\n {...rest}\n >\n {children}\n </Component>\n );\n};\n\nexport default Typography;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, ReactNode} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport Typography from '../Typography/Typography';\n\nexport interface FormControlProps {\n /**\n * The content to be wrapped by the form control\n */\n children: ReactNode;\n /**\n * Error message to display below the content\n */\n error?: string;\n /**\n * Helper text to display below the content\n */\n helperText?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Custom container style\n */\n style?: CSSProperties;\n /**\n * Custom alignment for helper text (default: left, center for OTP)\n */\n helperTextAlign?: 'left' | 'center';\n /**\n * Custom margin left for helper text (for components like Checkbox)\n */\n helperTextMarginLeft?: string;\n}\n\nconst FormControl: FC<FormControlProps> = ({\n children,\n error,\n helperText,\n className,\n style = {},\n helperTextAlign = 'left',\n helperTextMarginLeft,\n}) => {\n const {theme} = useTheme();\n\n const containerStyle: CSSProperties = {\n textAlign: 'left',\n marginBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n ...style,\n };\n\n const helperTextStyle: CSSProperties = {\n marginTop: `calc(${theme.vars.spacing.unit} / 2)`,\n textAlign: helperTextAlign,\n ...(helperTextMarginLeft && {marginLeft: helperTextMarginLeft}),\n };\n\n return (\n <div style={containerStyle} className={className}>\n {children}\n {(error || helperText) && (\n <Typography variant=\"caption\" color={error ? 'error' : 'textSecondary'} style={helperTextStyle}>\n {error || helperText}\n </Typography>\n )}\n </div>\n );\n};\n\nexport default FormControl;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, LabelHTMLAttributes, ReactNode} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\n\nexport interface InputLabelProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, 'style'> {\n /**\n * Label text or content\n */\n children: ReactNode;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Whether there's an error state\n */\n error?: boolean;\n /**\n * Custom style overrides\n */\n style?: CSSProperties;\n /**\n * Display type for label positioning\n */\n variant?: 'block' | 'inline';\n /**\n * Custom margin bottom (useful for different form layouts)\n */\n marginBottom?: string;\n}\n\nconst InputLabel: FC<InputLabelProps> = ({\n children,\n required,\n error,\n style = {},\n variant = 'block',\n marginBottom,\n ...rest\n}) => {\n const {theme} = useTheme();\n\n const labelStyle: CSSProperties = {\n display: variant,\n marginBottom: marginBottom || (variant === 'block' ? `calc(${theme.vars.spacing.unit} + 1px)` : '0'),\n color: error ? theme.vars.colors.error.main : theme.vars.colors.text.secondary,\n fontSize: theme.vars.typography.fontSizes.sm,\n fontWeight: variant === 'block' ? 500 : 'normal',\n ...style,\n };\n\n return (\n <label style={labelStyle} {...rest}>\n {children}\n {required && <span style={{color: theme.vars.colors.error.main}}> *</span>}\n </label>\n );\n};\n\nexport default InputLabel;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, SelectHTMLAttributes} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\nexport interface SelectOption {\n /**\n * The value that will be submitted with the form\n */\n value: string;\n /**\n * The text that will be displayed in the select\n */\n label: string;\n}\n\nexport interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'className'> {\n /**\n * Label text to display above the select\n */\n label?: string;\n /**\n * Error message to display below the select\n */\n error?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n /**\n * Helper text to display below the select\n */\n helperText?: string;\n /**\n * The options to display in the select\n */\n options: SelectOption[];\n}\n\nconst Select: FC<SelectProps> = ({\n label,\n error,\n className,\n required,\n disabled,\n helperText,\n options,\n style = {},\n ...rest\n}) => {\n const {theme} = useTheme();\n\n const selectStyle: CSSProperties = {\n width: '100%',\n padding: `${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 1.5)`,\n border: `1px solid ${error ? theme.vars.colors.error.main : theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.medium,\n fontSize: theme.vars.typography.fontSizes.md,\n color: theme.vars.colors.text.primary,\n backgroundColor: disabled ? theme.vars.colors.background.disabled : theme.vars.colors.background.surface,\n outline: 'none',\n transition: 'border-color 0.2s ease',\n appearance: 'none',\n backgroundImage: `url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23${theme.colors.text.secondary.replace(\n '#',\n '',\n )}%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E')`,\n backgroundRepeat: 'no-repeat',\n backgroundPosition: 'right .7em top 50%',\n backgroundSize: '.65em auto',\n };\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={clsx(withVendorCSSClassPrefix('select'), className)}\n style={style}\n >\n {label && (\n <InputLabel required={required} error={!!error}>\n {label}\n </InputLabel>\n )}\n <select style={selectStyle} disabled={disabled} aria-invalid={!!error} aria-required={required} {...rest}>\n {options.map(option => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n </FormControl>\n );\n};\n\nexport default Select;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, KeyboardEvent, ChangeEvent, useRef, useEffect, useState} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\nexport interface OtpInputProps {\n /**\n * Label text to display above the OTP input\n */\n label?: string;\n /**\n * Error message to display below the OTP input\n */\n error?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n /**\n * Helper text to display below the OTP input\n */\n helperText?: string;\n /**\n * Number of OTP input fields\n */\n length?: number;\n /**\n * Current OTP value\n */\n value?: string;\n /**\n * Callback function called when OTP value changes\n */\n onChange?: (event: {target: {value: string}}) => void;\n /**\n * Callback function called when OTP input is complete\n */\n onComplete?: (value: string) => void;\n /**\n * Type of input (text, number, password)\n */\n type?: 'text' | 'number' | 'password';\n /**\n * Placeholder character for each input field\n */\n placeholder?: string;\n /**\n * Custom container style\n */\n style?: CSSProperties;\n /**\n * Auto focus the first input on mount\n */\n autoFocus?: boolean;\n /**\n * Pattern for numeric input validation\n */\n pattern?: string;\n}\n\nconst OtpField: FC<OtpInputProps> = ({\n label,\n error,\n className,\n required,\n disabled,\n helperText,\n length = 6,\n value = '',\n onChange,\n onComplete,\n type = 'text',\n placeholder = '',\n style = {},\n autoFocus = false,\n pattern,\n}) => {\n const {theme} = useTheme();\n const [otp, setOtp] = useState<string[]>(Array(length).fill(''));\n const inputRefs = useRef<HTMLInputElement[]>([]);\n\n // Initialize refs array\n useEffect(() => {\n inputRefs.current = inputRefs.current.slice(0, length);\n }, [length]);\n\n // Update internal state when value prop changes\n useEffect(() => {\n if (value) {\n const newOtp = value.split('').slice(0, length);\n while (newOtp.length < length) {\n newOtp.push('');\n }\n setOtp(newOtp);\n } else {\n setOtp(Array(length).fill(''));\n }\n }, [value, length]);\n\n // Auto focus first input\n useEffect(() => {\n if (autoFocus && inputRefs.current[0]) {\n inputRefs.current[0].focus();\n }\n }, [autoFocus]);\n\n const inputContainerStyle: CSSProperties = {\n display: 'flex',\n gap: theme.vars.spacing.unit,\n justifyContent: 'space-between',\n alignItems: 'center',\n flexWrap: 'wrap',\n };\n\n const inputStyle: CSSProperties = {\n width: `calc(${theme.vars.spacing.unit} * 6)`,\n height: `calc(${theme.vars.spacing.unit} * 6)`,\n textAlign: 'center',\n fontSize: theme.vars.typography.fontSizes.xl,\n fontWeight: 500,\n border: `2px solid ${error ? theme.vars.colors.error.main : theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.medium,\n color: theme.vars.colors.text.primary,\n backgroundColor: disabled ? theme.vars.colors.background.disabled : theme.vars.colors.background.surface,\n outline: 'none',\n transition: 'border-color 0.2s ease, box-shadow 0.2s ease',\n };\n\n const focusedInputStyle: CSSProperties = {\n borderColor: error ? theme.vars.colors.error.main : theme.vars.colors.primary.main,\n boxShadow: `0 0 0 2px ${error ? theme.vars.colors.error.main + '20' : theme.vars.colors.primary.main + '20'}`,\n };\n\n const handleChange = (index: number, event: ChangeEvent<HTMLInputElement>) => {\n const newValue = event.target.value;\n\n // Only allow single character\n if (newValue.length > 1) return;\n\n // For numeric type, only allow numbers\n if (type === 'number' && newValue && !/^\\d$/.test(newValue)) return;\n\n // Apply pattern if provided\n if (pattern && newValue && !new RegExp(pattern).test(newValue)) return;\n\n const newOtp = [...otp];\n newOtp[index] = newValue;\n setOtp(newOtp);\n\n // Call onChange callback\n const otpValue = newOtp.join('');\n onChange?.({target: {value: otpValue}});\n\n // Auto-focus next input if value is entered\n if (newValue && index < length - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n\n // Call onComplete when all fields are filled\n if (newOtp.every(digit => digit !== '') && onComplete) {\n onComplete(otpValue);\n }\n };\n\n const handleKeyDown = (index: number, event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Backspace') {\n if (!otp[index] && index > 0) {\n // If current field is empty, clear previous field and focus it\n const newOtp = [...otp];\n newOtp[index - 1] = '';\n setOtp(newOtp);\n inputRefs.current[index - 1]?.focus();\n onChange?.({target: {value: newOtp.join('')}});\n } else if (otp[index]) {\n // Clear current field\n const newOtp = [...otp];\n newOtp[index] = '';\n setOtp(newOtp);\n onChange?.({target: {value: newOtp.join('')}});\n }\n } else if (event.key === 'ArrowLeft' && index > 0) {\n inputRefs.current[index - 1]?.focus();\n } else if (event.key === 'ArrowRight' && index < length - 1) {\n inputRefs.current[index + 1]?.focus();\n } else if (event.key === 'Enter') {\n event.preventDefault();\n if (otp.every(digit => digit !== '') && onComplete) {\n onComplete(otp.join(''));\n }\n }\n };\n\n const handlePaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\n event.preventDefault();\n const pastedData = event.clipboardData.getData('text').slice(0, length);\n\n // Validate pasted data\n let validData = '';\n for (const char of pastedData) {\n if (type === 'number' && !/^\\d$/.test(char)) continue;\n if (pattern && !new RegExp(pattern).test(char)) continue;\n validData += char;\n }\n\n const newOtp = Array(length).fill('');\n for (let i = 0; i < Math.min(validData.length, length); i++) {\n newOtp[i] = validData[i];\n }\n\n setOtp(newOtp);\n onChange?.({target: {value: newOtp.join('')}});\n\n // Focus next empty field or last field\n const nextEmptyIndex = newOtp.findIndex(digit => digit === '');\n const focusIndex = nextEmptyIndex !== -1 ? nextEmptyIndex : length - 1;\n inputRefs.current[focusIndex]?.focus();\n\n // Call onComplete if all fields are filled\n if (newOtp.every(digit => digit !== '') && onComplete) {\n onComplete(newOtp.join(''));\n }\n };\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={clsx(withVendorCSSClassPrefix('otp-input'), className)}\n style={style}\n helperTextAlign=\"center\"\n >\n {label && (\n <InputLabel required={required} error={!!error}>\n {label}\n </InputLabel>\n )}\n <div style={inputContainerStyle}>\n {Array.from({length}, (_, index) => (\n <input\n key={index}\n ref={el => {\n if (el) inputRefs.current[index] = el;\n }}\n type={type === 'password' ? 'password' : 'text'}\n inputMode={type === 'number' ? 'numeric' : 'text'}\n value={otp[index] || ''}\n onChange={event => handleChange(index, event)}\n onKeyDown={event => handleKeyDown(index, event)}\n onPaste={handlePaste}\n onFocus={event => {\n event.target.style.borderColor = error ? theme.vars.colors.error.main : theme.vars.colors.primary.main;\n event.target.style.boxShadow = `0 0 0 2px ${\n error ? theme.vars.colors.error.main + '20' : theme.vars.colors.primary.main + '20'\n }`;\n }}\n onBlur={event => {\n event.target.style.borderColor = error ? theme.vars.colors.error.main : theme.vars.colors.border;\n event.target.style.boxShadow = 'none';\n }}\n style={inputStyle}\n maxLength={1}\n placeholder={placeholder}\n disabled={disabled}\n aria-label={`${label || 'OTP'} digit ${index + 1}`}\n aria-invalid={!!error}\n aria-required={required}\n autoComplete=\"one-time-code\"\n />\n ))}\n </div>\n </FormControl>\n );\n};\n\nexport default OtpField;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, useState} from 'react';\nimport TextField, {TextFieldProps} from '../TextField/TextField';\nimport Eye from '../Icons/Eye';\nimport EyeOff from '../Icons/EyeOff';\n\nexport interface PasswordFieldProps extends Omit<TextFieldProps, 'type' | 'endIcon' | 'onEndIconClick' | 'onChange'> {\n /**\n * Callback function when the field value changes\n */\n onChange: (value: string) => void;\n}\n\n/**\n * Password field component with show/hide toggle functionality.\n * This component extends TextField and adds password visibility toggle functionality.\n */\nconst PasswordField: FC<PasswordFieldProps> = ({\n onChange,\n ...textFieldProps\n}) => {\n const [showPassword, setShowPassword] = useState(false);\n\n return (\n <TextField\n {...textFieldProps}\n type={showPassword ? 'text' : 'password'}\n onChange={e => onChange(e.target.value)}\n autoComplete=\"current-password\"\n endIcon={showPassword ? <EyeOff width={16} height={16} /> : <Eye width={16} height={16} />}\n onEndIconClick={() => setShowPassword(!showPassword)}\n />\n );\n};\n\nexport default PasswordField;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * Eye icon component.\n */\nconst Eye: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n);\n\nexport default Eye;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * EyeOff icon component.\n */\nconst EyeOff: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\" />\n <path d=\"M14.084 14.158a3 3 0 0 1-4.242-4.242\" />\n <path d=\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n);\n\nexport default EyeOff;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, InputHTMLAttributes} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\nexport interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'type'> {\n /**\n * Label text to display above the input\n */\n label?: string;\n /**\n * Error message to display below the input\n */\n error?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n /**\n * Helper text to display below the input\n */\n helperText?: string;\n /**\n * Custom date format for the regex pattern\n */\n dateFormat?: string;\n}\n\nconst DatePicker: FC<DatePickerProps> = ({\n label,\n error,\n className,\n required,\n disabled,\n helperText,\n dateFormat = 'yyyy-MM-dd',\n style = {},\n ...rest\n}) => {\n const {theme} = useTheme();\n\n const inputStyle: CSSProperties = {\n width: '100%',\n padding: `${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 1.5)`,\n border: `1px solid ${error ? theme.vars.colors.error.main : theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.medium,\n fontSize: '1rem',\n color: theme.vars.colors.text.primary,\n backgroundColor: disabled ? theme.vars.colors.background.disabled : theme.vars.colors.background.surface,\n outline: 'none',\n transition: 'border-color 0.2s ease',\n };\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={clsx(withVendorCSSClassPrefix('date-picker'), className)}\n style={style}\n >\n {label && (\n <InputLabel required={required} error={!!error}>\n {label}\n </InputLabel>\n )}\n <input\n type=\"date\"\n pattern=\"\\d{4}-\\d{2}-\\d{2}\"\n placeholder={dateFormat}\n style={inputStyle}\n disabled={disabled}\n aria-invalid={!!error}\n aria-required={required}\n {...rest}\n />\n </FormControl>\n );\n};\n\nexport default DatePicker;\n", "/**\n * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, InputHTMLAttributes} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\nexport interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'type'> {\n /**\n * Label text to display next to the checkbox\n */\n label?: string;\n /**\n * Error message to display below the checkbox\n */\n error?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Helper text to display below the checkbox\n */\n helperText?: string;\n}\n\nconst Checkbox: FC<CheckboxProps> = ({label, error, className, required, helperText, style = {}, ...rest}) => {\n const {theme} = useTheme();\n\n const containerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n ...style,\n };\n\n const inputStyle: CSSProperties = {\n width: `calc(${theme.vars.spacing.unit} * 2.5)`,\n height: `calc(${theme.vars.spacing.unit} * 2.5)`,\n marginRight: theme.vars.spacing.unit,\n accentColor: theme.vars.colors.primary.main,\n };\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={clsx(withVendorCSSClassPrefix('checkbox'), className)}\n helperTextMarginLeft={`calc(${theme.vars.spacing.unit} * 3.5)`}\n >\n <div style={containerStyle}>\n <input type=\"checkbox\" style={inputStyle} aria-invalid={!!error} aria-required={required} {...rest} />\n {label && (\n <InputLabel\n required={required}\n error={!!error}\n variant=\"inline\"\n style={{\n color: error ? theme.vars.colors.error.main : theme.vars.colors.text.primary,\n fontSize: '0.875rem',\n }}\n >\n {label}\n </InputLabel>\n )}\n </div>\n </FormControl>\n );\n};\n\nexport default Checkbox;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, ReactElement} from 'react';\nimport TextField from '../primitives/TextField/TextField';\nimport Select from '../primitives/Select/Select';\nimport {SelectOption} from '../primitives/Select/Select';\nimport OtpField from '../primitives/OtpField/OtpField';\nimport PasswordField from '../primitives/PasswordField/PasswordField';\nimport DatePicker from '../primitives/DatePicker/DatePicker';\nimport Checkbox from '../primitives/Checkbox/Checkbox';\nimport {FieldType} from '@asgardeo/browser';\n\n/**\n * Interface for field configuration.\n */\nexport interface FieldConfig {\n /**\n * The name of the field.\n */\n name: string;\n /**\n * The field type.\n */\n type: FieldType;\n /**\n * Display name for the field.\n */\n label: string;\n /**\n * Whether the field is required.\n */\n required: boolean;\n /**\n * Current value of the field.\n */\n value: string;\n /**\n * Callback function when the field value changes.\n */\n onChange: (value: string) => void;\n /**\n * Whether the field is disabled.\n */\n disabled?: boolean;\n /**\n * Error message to display.\n */\n error?: string;\n /**\n * Additional CSS class name.\n */\n className?: string;\n /**\n * Additional options for multi-valued fields.\n */\n options?: SelectOption[];\n /**\n * Whether the field has been touched/interacted with by the user.\n */\n touched?: boolean;\n /**\n * Placeholder text for the field.\n */\n placeholder?: string;\n}\n\n/**\n * Utility function to validate field values based on type\n */\nexport const validateFieldValue = (\n value: string,\n type: FieldType,\n required: boolean = false,\n touched: boolean = false,\n): string | null => {\n if (required && touched && (!value || value.trim() === '')) {\n return 'This field is required';\n }\n\n if (!value || value.trim() === '') {\n return null;\n }\n\n switch (type) {\n case FieldType.Number:\n const numValue = parseInt(value, 10);\n if (isNaN(numValue)) {\n return 'Please enter a valid number';\n }\n break;\n }\n\n return null;\n};\n\n/**\n * Factory function to create form fields based on the EmbeddedSignInFlowAuthenticatorParamType.\n *\n * @param config - The field configuration\n * @returns The appropriate React component for the field type\n *\n * @example\n * ```tsx\n * const field = createField({\n * param: 'username',\n * type: EmbeddedSignInFlowAuthenticatorParamType.String,\n * label: 'Username',\n * confidential: false,\n * required: true,\n * value: '',\n * onChange: (value) => console.log(value)\n * });\n * ```\n */\nexport const createField = (config: FieldConfig): ReactElement => {\n const {\n name,\n type,\n label,\n required,\n value,\n onChange,\n disabled = false,\n error,\n className,\n options = [],\n touched = false,\n placeholder,\n } = config;\n\n const validationError = error || validateFieldValue(value, type, required, touched);\n\n const commonProps = {\n name,\n label,\n required,\n disabled,\n error: validationError,\n className,\n value,\n placeholder,\n };\n\n switch (type) {\n case FieldType.Password:\n return <PasswordField {...commonProps} onChange={onChange} />;\n case FieldType.Text:\n return <TextField {...commonProps} type=\"text\" onChange={e => onChange(e.target.value)} autoComplete=\"off\" />;\n case FieldType.Email:\n return <TextField {...commonProps} type=\"email\" onChange={e => onChange(e.target.value)} autoComplete=\"email\" />;\n case FieldType.Date:\n return <DatePicker {...commonProps} onChange={e => onChange(e.target.value)} />;\n case FieldType.Checkbox:\n const isChecked = value === 'true' || (value as any) === true;\n return <Checkbox {...commonProps} checked={isChecked} onChange={e => onChange(e.target.checked.toString())} />;\n case FieldType.Otp:\n return <OtpField {...commonProps} onChange={e => onChange(e.target.value)} />;\n case FieldType.Number:\n return (\n <TextField\n {...commonProps}\n type=\"number\"\n onChange={e => onChange(e.target.value)}\n helperText=\"Enter a numeric value\"\n />\n );\n case FieldType.Select:\n const fieldOptions = options.length > 0 ? options : [];\n\n if (fieldOptions.length > 0) {\n return (\n <Select\n {...commonProps}\n options={fieldOptions}\n onChange={e => onChange(e.target.value)}\n helperText=\"Select from available options\"\n />\n );\n }\n\n return (\n <TextField\n {...commonProps}\n type=\"text\"\n onChange={e => onChange(e.target.value)}\n helperText=\"Enter multiple values separated by commas (e.g., value1, value2, value3)\"\n placeholder=\"value1, value2, value3\"\n />\n );\n\n default:\n return (\n <TextField\n {...commonProps}\n type=\"text\"\n onChange={e => onChange(e.target.value)}\n helperText=\"Unknown field type, treating as text\"\n />\n );\n }\n};\n\n/**\n * React component wrapper for the field factory.\n */\nexport const FieldFactory: FC<FieldConfig> = (props: FieldConfig): ReactElement => {\n return createField(props);\n};\n\nexport default FieldFactory;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedSignInFlowAuthenticator, EmbeddedSignInFlowAuthenticatorParamType, FieldType} from '@asgardeo/browser';\nimport {FC, useEffect} from 'react';\nimport {createField} from '../../../factories/FieldFactory';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport useFlow from '../../../../contexts/Flow/useFlow';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * Identifier First Sign-In Option Component.\n * Handles identifier-first authentication flow (username first, then password).\n */\nconst IdentifierFirst: FC<BaseSignInOptionProps> = ({\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n onInputChange,\n onSubmit,\n inputClassName = '',\n buttonClassName = '',\n preferences,\n}) => {\n const {theme} = useTheme();\n const {t} = useTranslation(preferences?.i18n);\n const {setTitle, setSubtitle} = useFlow();\n\n const formFields = authenticator.metadata?.params?.sort((a, b) => a.order - b.order) || [];\n\n useEffect(() => {\n setTitle(t('identifier.first.title'));\n setSubtitle(t('identifier.first.subtitle'));\n }, [setTitle, setSubtitle, t]);\n\n return (\n <>\n {formFields.map(param => (\n <div key={param.param} style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {createField({\n name: param.param,\n type:\n param.type === EmbeddedSignInFlowAuthenticatorParamType.String\n ? param.confidential\n ? FieldType.Password\n : FieldType.Text\n : FieldType.Text,\n label: param.displayName,\n required: authenticator.requiredParams.includes(param.param),\n value: formValues[param.param] || '',\n onChange: value => onInputChange(param.param, value),\n disabled: isLoading,\n className: inputClassName,\n touched: touchedFields[param.param] || false,\n placeholder: t(`elements.fields.placeholder`, {\n field: (param.displayName || param.param).toLowerCase(),\n }),\n })}\n </div>\n ))}\n\n <Button\n type=\"submit\"\n disabled={isLoading}\n loading={isLoading}\n className={buttonClassName}\n color=\"primary\"\n variant=\"solid\"\n fullWidth\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n {t('identifier.first.submit.button')}\n </Button>\n </>\n );\n};\n\nexport default IdentifierFirst;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport Button from '../../../primitives/Button/Button';\n\n/**\n * Google Sign-In Button Component.\n * Handles authentication with Google identity provider.\n */\nconst GoogleButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"solid\"\n color=\"secondary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 67.91 67.901\" xmlns=\"http://www.w3.org/2000/svg\">\n <g transform=\"translate(-0.001 -0.001)\">\n <path\n d=\"M15.049,160.965l-2.364,8.824-8.639.183a34.011,34.011,0,0,1-.25-31.7h0l7.691,1.41,3.369,7.645a20.262,20.262,0,0,0,.19,13.642Z\"\n transform=\"translate(0 -119.93)\"\n fill=\"#fbbb00\"\n />\n <path\n d=\"M294.24,208.176A33.939,33.939,0,0,1,282.137,241h0l-9.687-.494-1.371-8.559a20.235,20.235,0,0,0,8.706-10.333H261.628V208.176Z\"\n transform=\"translate(-226.93 -180.567)\"\n fill=\"#518ef8\"\n />\n <path\n d=\"M81.668,328.8h0a33.962,33.962,0,0,1-51.161-10.387l11-9.006a20.192,20.192,0,0,0,29.1,10.338Z\"\n transform=\"translate(-26.463 -268.374)\"\n fill=\"#28b446\"\n />\n <path\n d=\"M80.451,7.816l-11,9A20.19,20.19,0,0,0,39.686,27.393l-11.06-9.055h0A33.959,33.959,0,0,1,80.451,7.816Z\"\n transform=\"translate(-24.828)\"\n fill=\"#f14336\"\n />\n </g>\n </svg>\n }\n >\n {t('elements.buttons.google')}\n </Button>\n );\n};\n\nexport default GoogleButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\n\n/**\n * GitHub Sign-In Button Component.\n * Handles authentication with GitHub identity provider.\n */\nconst GitHubButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"solid\"\n color=\"secondary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 67.91 66.233\" xmlns=\"http://www.w3.org/2000/svg\">\n <g transform=\"translate(-386.96 658.072)\">\n <path\n d=\"M420.915-658.072a33.956,33.956,0,0,0-33.955,33.955,33.963,33.963,0,0,0,23.221,32.22c1.7.314,2.32-.737,2.32-1.633,0-.81-.031-3.484-.046-6.322-9.446,2.054-11.44-4.006-11.44-4.006-1.545-3.925-3.77-4.968-3.77-4.968-3.081-2.107.232-2.064.232-2.064,3.41.239,5.205,3.5,5.205,3.5,3.028,5.19,7.943,3.69,9.881,2.822a7.23,7.23,0,0,1,2.156-4.54c-7.542-.859-15.47-3.77-15.47-16.781a13.141,13.141,0,0,1,3.5-9.114,12.2,12.2,0,0,1,.329-8.986s2.851-.913,9.34,3.48a32.545,32.545,0,0,1,8.5-1.143,32.629,32.629,0,0,1,8.506,1.143c6.481-4.393,9.328-3.48,9.328-3.48a12.185,12.185,0,0,1,.333,8.986,13.115,13.115,0,0,1,3.495,9.114c0,13.042-7.943,15.913-15.5,16.754,1.218,1.054,2.3,3.12,2.3,6.288,0,4.543-.039,8.2-.039,9.318,0,.9.611,1.962,2.332,1.629a33.959,33.959,0,0,0,23.2-32.215,33.955,33.955,0,0,0-33.955-33.955\"\n fill=\"#ffffff\"\n />\n </g>\n </svg>\n }\n >\n {t('elements.buttons.github')}\n </Button>\n );\n};\n\nexport default GitHubButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\n\n/**\n * Microsoft Sign-In Button Component.\n * Handles authentication with Microsoft identity provider.\n */\nconst MicrosoftButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n color=\"primary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 23 23\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill=\"#f3f3f3\" d=\"M0 0h23v23H0z\" />\n <path fill=\"#f35325\" d=\"M1 1h10v10H1z\" />\n <path fill=\"#81bc06\" d=\"M12 1h10v10H12z\" />\n <path fill=\"#05a6f0\" d=\"M1 12h10v10H1z\" />\n <path fill=\"#ffba08\" d=\"M12 12h10v10H12z\" />\n </svg>\n }\n >\n {t('elements.buttons.microsoft')}\n </Button>\n );\n};\n\nexport default MicrosoftButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\n\n/**\n * Facebook Sign-In Button Component.\n * Handles authentication with Facebook identity provider.\n */\nconst FacebookButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n submitButtonText,\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"solid\"\n color=\"primary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"#1976D2\"\n d=\"M448,0H64C28.704,0,0,28.704,0,64v384c0,35.296,28.704,64,64,64h384c35.296,0,64-28.704,64-64V64C512,28.704,483.296,0,448,0z\"\n />\n <path\n fill=\"#FAFAFA\"\n d=\"M432,256h-80v-64c0-17.664,14.336-16,32-16h32V96h-64l0,0c-53.024,0-96,42.976-96,96v64h-64v80h64v176h96V336h48L432,256z\"\n />\n </svg>\n }\n >\n {t('elements.buttons.facebook')}\n </Button>\n );\n};\n\nexport default FacebookButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\n\n/**\n * LinkedIn Sign-In Button Component.\n * Handles authentication with LinkedIn identity provider.\n */\nconst LinkedInButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n color=\"primary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"#0077B5\"\n d=\"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z\"\n />\n </svg>\n }\n >\n {t('elements.buttons.linkedin')}\n </Button>\n );\n};\n\nexport default LinkedInButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\n\n/**\n * Sign In With Ethereum Button Component.\n * Handles authentication with Sign In With Ethereum identity provider.\n */\nconst SignInWithEthereumButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n color=\"secondary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"#627EEA\"\n d=\"M11.944 17.97L4.58 13.62 11.943 24l7.37-10.38-7.372 4.35h.003zM12.056 0L4.69 12.223l7.365 4.354 7.365-4.35L12.056 0z\"\n />\n </svg>\n }\n >\n {t('elements.buttons.ethereum')}\n </Button>\n );\n};\n\nexport default SignInWithEthereumButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedSignInFlowAuthenticator, EmbeddedSignInFlowAuthenticatorParamType, FieldType} from '@asgardeo/browser';\nimport {FC, useEffect} from 'react';\nimport {createField} from '../../../factories/FieldFactory';\nimport Button from '../../../primitives/Button/Button';\nimport OtpField from '../../../primitives/OtpField/OtpField';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport useFlow from '../../../../contexts/Flow/useFlow';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * Email OTP Sign-In Option Component.\n * Handles email-based OTP authentication.\n */\nconst EmailOtp: FC<BaseSignInOptionProps> = ({\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n onInputChange,\n onSubmit,\n inputClassName = '',\n buttonClassName = '',\n preferences,\n}) => {\n const {theme} = useTheme();\n const {t} = useTranslation(preferences?.i18n);\n const {setTitle, setSubtitle} = useFlow();\n\n const formFields = authenticator.metadata?.params?.sort((a, b) => a.order - b.order) || [];\n\n useEffect(() => {\n setTitle(t('email.otp.title'));\n setSubtitle(t('email.otp.subtitle'));\n }, [setTitle, setSubtitle, t]);\n\n // Check if this is an OTP field (typically has 'otpCode' or similar parameter)\n const hasOtpField = formFields.some(\n param => param.param.toLowerCase().includes('otp') || param.param.toLowerCase().includes('code'),\n );\n\n return (\n <>\n {formFields.map(param => {\n const isOtpParam = param.param.toLowerCase().includes('otp') || param.param.toLowerCase().includes('code');\n\n return (\n <div key={param.param} style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {isOtpParam && hasOtpField ? (\n <OtpField\n length={6}\n value={formValues[param.param] || ''}\n onChange={event => onInputChange(param.param, event.target.value)}\n disabled={isLoading}\n className={inputClassName}\n />\n ) : (\n createField({\n name: param.param,\n type:\n param.type === EmbeddedSignInFlowAuthenticatorParamType.String\n ? param.confidential\n ? FieldType.Password\n : FieldType.Text\n : FieldType.Text,\n label: param.displayName,\n required: authenticator.requiredParams.includes(param.param),\n value: formValues[param.param] || '',\n onChange: value => onInputChange(param.param, value),\n disabled: isLoading,\n className: inputClassName,\n touched: touchedFields[param.param] || false,\n })\n )}\n </div>\n );\n })}\n\n <Button\n type=\"submit\"\n disabled={isLoading}\n loading={isLoading}\n className={buttonClassName}\n color=\"primary\"\n variant=\"solid\"\n fullWidth\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n {t('email.otp.submit.button')}\n </Button>\n </>\n );\n};\n\nexport default EmailOtp;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedSignInFlowAuthenticator, EmbeddedSignInFlowAuthenticatorParamType, FieldType} from '@asgardeo/browser';\nimport {FC, useEffect} from 'react';\nimport {createField} from '../../../factories/FieldFactory';\nimport Button from '../../../primitives/Button/Button';\nimport OtpField from '../../../primitives/OtpField/OtpField';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport useFlow from '../../../../contexts/Flow/useFlow';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * TOTP Sign-In Option Component.\n * Handles Time-based One-Time Password (TOTP) authentication.\n */\nconst Totp: FC<BaseSignInOptionProps> = ({\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n onInputChange,\n onSubmit,\n inputClassName = '',\n buttonClassName = '',\n preferences,\n}) => {\n const {theme} = useTheme();\n const {t} = useTranslation(preferences?.i18n);\n const {setTitle, setSubtitle} = useFlow();\n\n const formFields = authenticator.metadata?.params?.sort((a, b) => a.order - b.order) || [];\n\n useEffect(() => {\n setTitle(t('totp.title'));\n setSubtitle(t('totp.subtitle'));\n }, [setTitle, setSubtitle, t]);\n\n const hasTotpField = formFields.some(\n param => param.param.toLowerCase().includes('totp') || param.param.toLowerCase().includes('token'),\n );\n\n return (\n <>\n {formFields.map(param => {\n const isTotpParam = param.param.toLowerCase().includes('totp') || param.param.toLowerCase().includes('token');\n\n return (\n <div key={param.param} style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {isTotpParam && hasTotpField ? (\n <OtpField\n length={6}\n value={formValues[param.param] || ''}\n onChange={event => onInputChange(param.param, event.target.value)}\n disabled={isLoading}\n className={inputClassName}\n />\n ) : (\n createField({\n name: param.param,\n type:\n param.type === EmbeddedSignInFlowAuthenticatorParamType.String\n ? param.confidential\n ? FieldType.Password\n : FieldType.Text\n : FieldType.Text,\n label: param.displayName,\n required: authenticator.requiredParams.includes(param.param),\n value: formValues[param.param] || '',\n onChange: value => onInputChange(param.param, value),\n disabled: isLoading,\n className: inputClassName,\n touched: touchedFields[param.param] || false,\n })\n )}\n </div>\n );\n })}\n\n <Button\n type=\"submit\"\n disabled={isLoading}\n loading={isLoading}\n className={buttonClassName}\n color=\"primary\"\n variant=\"solid\"\n fullWidth\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n {t('totp.submit.button')}\n </Button>\n </>\n );\n};\n\nexport default Totp;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedSignInFlowAuthenticator, EmbeddedSignInFlowAuthenticatorParamType, FieldType} from '@asgardeo/browser';\nimport {FC, useEffect} from 'react';\nimport {createField} from '../../../factories/FieldFactory';\nimport Button from '../../../primitives/Button/Button';\nimport OtpField from '../../../primitives/OtpField/OtpField';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport useFlow from '../../../../contexts/Flow/useFlow';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * SMS OTP Sign-In Option Component.\n * Handles SMS-based OTP authentication.\n */\nconst SmsOtp: FC<BaseSignInOptionProps> = ({\n authenticator,\n formValues,\n touchedFields,\n isLoading,\n onInputChange,\n onSubmit,\n inputClassName = '',\n buttonClassName = '',\n preferences,\n}) => {\n const {theme} = useTheme();\n const {t} = useTranslation(preferences?.i18n);\n const {setTitle, setSubtitle} = useFlow();\n\n const formFields = authenticator.metadata?.params?.sort((a, b) => a.order - b.order) || [];\n\n useEffect(() => {\n setTitle(t('sms.otp.title'));\n setSubtitle(t('sms.otp.subtitle'));\n }, [setTitle, setSubtitle, t]);\n\n const hasOtpField = formFields.some(\n param => param.param.toLowerCase().includes('otp') || param.param.toLowerCase().includes('code'),\n );\n\n return (\n <>\n {formFields.map(param => {\n const isOtpParam = param.param.toLowerCase().includes('otp') || param.param.toLowerCase().includes('code');\n\n return (\n <div key={param.param} style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {isOtpParam && hasOtpField ? (\n <OtpField\n length={6}\n value={formValues[param.param] || ''}\n onChange={event => onInputChange(param.param, event.target.value)}\n disabled={isLoading}\n className={inputClassName}\n />\n ) : (\n createField({\n name: param.param,\n type:\n param.type === EmbeddedSignInFlowAuthenticatorParamType.String\n ? param.confidential\n ? FieldType.Password\n : FieldType.Text\n : FieldType.Text,\n label: param.displayName,\n required: authenticator.requiredParams.includes(param.param),\n value: formValues[param.param] || '',\n onChange: value => onInputChange(param.param, value),\n disabled: isLoading,\n className: inputClassName,\n touched: touchedFields[param.param] || false,\n })\n )}\n </div>\n );\n })}\n\n <Button\n type=\"submit\"\n disabled={isLoading}\n loading={isLoading}\n className={buttonClassName}\n color=\"primary\"\n variant=\"solid\"\n fullWidth\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n {t('sms.otp.submit.button')}\n </Button>\n </>\n );\n};\n\nexport default SmsOtp;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport useTranslation from '../../../../hooks/useTranslation';\n\n/**\n * Social Login Sign-In Option Component.\n * Handles authentication with external identity providers (Google, GitHub, etc.).\n */\nconst SocialLogin: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n\n /**\n * Get display name for the social provider.\n */\n const getDisplayName = (): string => {\n const providerName = authenticator.idp;\n return t('elements.buttons.social', {connection: providerName});\n };\n\n /**\n * Handle button click.\n */\n const handleClick = () => {\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n color=\"secondary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"\n />\n </svg>\n }\n >\n {getDisplayName()}\n </Button>\n );\n};\n\nexport default SocialLogin;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, JSX, ReactElement} from 'react';\nimport Button from '../../../primitives/Button/Button';\nimport {BaseSignInOptionProps} from './SignInOptionFactory';\nimport {ApplicationNativeAuthenticationConstants, EmbeddedSignInFlowAuthenticatorKnownIdPType} from '@asgardeo/browser';\nimport useTranslation from '../../../../hooks/useTranslation';\n\n/**\n * Multi Option Button Component.\n * Renders authenticators as selectable buttons for multi-option prompts.\n * Used when authenticators don't require immediate user input but need to be selected first.\n */\nconst MultiOptionButton: FC<BaseSignInOptionProps> = ({\n authenticator,\n isLoading,\n onSubmit,\n buttonClassName = '',\n preferences,\n}) => {\n const {t} = useTranslation(preferences?.i18n);\n\n /**\n * Get display name for the authenticator.\n */\n const getDisplayName = (): string => {\n let authenticatorName = authenticator.authenticator;\n\n if (authenticator.idp !== EmbeddedSignInFlowAuthenticatorKnownIdPType.Local) {\n authenticatorName = authenticator.idp;\n }\n\n switch (authenticatorName) {\n default:\n return t('elements.buttons.multi.option', {connection: authenticatorName});\n }\n };\n\n /**\n * Get appropriate icon for the authenticator type.\n */\n const getIcon = (): ReactElement | null => {\n const authenticatorId: string = authenticator.authenticatorId;\n\n switch (authenticatorId) {\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.SmsOtp:\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M20 15.5c-1.25 0-2.45-.2-3.57-.57a1.02 1.02 0 0 0-1.02.24l-2.2 2.2a15.074 15.074 0 0 1-6.59-6.59l2.2-2.2c.27-.27.35-.67.24-1.02A11.36 11.36 0 0 1 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.5c0-.55-.45-1-1-1M12 3v10l3-3h6V3z\"\n />\n </svg>\n );\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.EmailOtp:\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4l-8 5l-8-5V6l8 5l8-5z\"\n />\n </svg>\n );\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Totp:\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill=\"currentColor\" d=\"M12 1L3 5v6c0 5.55 3.84 10.74 9 12c5.16-1.26 9-6.45 9-12V5z\" />\n </svg>\n );\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.PushNotification:\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8m1-13h-2v6h2zm0 8h-2v2h2z\"\n />\n </svg>\n );\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Passkey:\n return (\n <svg fill=\"currentColor\" width=\"18\" height=\"18\" viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"SVGRepo_bgCarrier\" strokeWidth=\"0\"></g>\n <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g id=\"SVGRepo_iconCarrier\">\n <path d=\"M7.7 4.7C9.36 3.07 12.68 2 16.17 2S23 3.06 24.6 4.7A1 1 0 0 0 26 3.3C23.6.86 19.34 0 16.16 0S8.72.87 6.3 3.3a1 1 0 0 0 1.4 1.4zM29.2 12.55C26.38 6.88 22 4 16.17 4s-10.22 2.88-13 8.55a1 1 0 0 0 .44 1.34 1 1 0 0 0 1.35-.45C7.4 8.45 11.08 6 16.15 6s8.77 2.44 11.27 7.45a1 1 0 0 0 .9.55.87.87 0 0 0 .44-.1 1 1 0 0 0 .45-1.35zM19.4 28.08c-4.13-1.77-5.8-4.5-6-6.5a2.87 2.87 0 0 1 1.13-2.75c.85-.57 2.1.24 3.87 1.52s4.13 3 6.17 1.45c1.8-1.35 2.34-3.76 1.45-6.44A10.85 10.85 0 0 0 16.16 8C7.2 8 4 15.75 4 23a1 1 0 0 0 2 0c0-3 .73-13 10.16-13 3.9 0 7 3.1 8 6 .3.87.8 3-.75 4.2-.8.6-2-.2-3.8-1.47s-4.07-2.94-6.14-1.56a4.87 4.87 0 0 0-2 4.6c.24 2.56 2.24 6 7.18 8.15A1 1 0 0 0 19 30a1 1 0 0 0 .4-1.92zM10 19.24a7.06 7.06 0 0 1 5.2-4.65c2.24-.43 4.32.6 6 3a1 1 0 1 0 1.62-1.17c-2.9-4.07-6.27-4.12-8-3.8A9.1 9.1 0 0 0 8 18.77c-1 3.94.43 8.27 4.2 12.87a1 1 0 0 0 .8.37.94.94 0 0 0 .63-.23 1 1 0 0 0 .14-1.4c-3.34-4.1-4.62-7.83-3.77-11.13zM25.3 24.3a3 3 0 0 1-3.06.63c-2.4-.57-4.78-2.7-5.3-4.25a1 1 0 1 0-1.9.64c.8 2.33 3.87 4.88 6.74 5.56a6.84 6.84 0 0 0 1.52.18 4.7 4.7 0 0 0 3.4-1.35 1 1 0 0 0-1.4-1.4z\"></path>{' '}\n </g>\n </svg>\n );\n case ApplicationNativeAuthenticationConstants.SupportedAuthenticators.MagicLink:\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8m1-13h-2v6h2zm0 8h-2v2h2z\"\n />\n </svg>\n );\n default:\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m-2 15l-5-5l1.41-1.41L10 14.17l7.59-7.59L19 8z\"\n />\n </svg>\n );\n }\n };\n\n /**\n * Handle button click.\n */\n const handleClick = () => {\n // For multi-option buttons, we call onSubmit without form data\n // This will trigger the authenticator selection and likely move to the next step\n onSubmit(authenticator);\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n color=\"primary\"\n fullWidth\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n startIcon={getIcon()}\n >\n {getDisplayName()}\n </Button>\n );\n};\n\nexport default MultiOptionButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n CSSProperties,\n forwardRef,\n HTMLAttributes,\n ReactNode,\n RefAttributes,\n ForwardRefExoticComponent,\n useMemo,\n} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport Typography from '../Typography/Typography';\nimport CircleCheck from '../Icons/CircleCheck';\nimport CircleAlert from '../Icons/CircleAlert';\nimport TriangleAlert from '../Icons/TriangleAlert';\nimport Info from '../Icons/Info';\n\nexport type AlertVariant = 'success' | 'error' | 'warning' | 'info';\n\nexport interface AlertProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The visual variant of the alert that determines color scheme and icon\n */\n variant?: AlertVariant;\n /**\n * Whether to show the default icon for the variant\n */\n showIcon?: boolean;\n /**\n * Alert content\n */\n children?: ReactNode;\n}\n\nexport interface AlertTitleProps extends HTMLAttributes<HTMLHeadingElement> {\n /**\n * Title content\n */\n children?: ReactNode;\n}\n\nexport interface AlertDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {\n /**\n * Description content\n */\n children?: ReactNode;\n}\n\nconst useAlertStyles = (variant: AlertVariant) => {\n const {theme} = useTheme();\n\n return useMemo(() => {\n const variantStyles: Record<AlertVariant, CSSProperties> = {\n success: {\n backgroundColor: `${theme.vars.colors.success.main}15`,\n borderColor: theme.vars.colors.success.main,\n color: theme.vars.colors.success.main,\n },\n error: {\n backgroundColor: `${theme.vars.colors.error.main}15`,\n borderColor: theme.vars.colors.error.main,\n color: theme.vars.colors.error.main,\n },\n warning: {\n backgroundColor: `${theme.vars.colors.warning.main}15`,\n borderColor: theme.vars.colors.warning.main,\n color: theme.vars.colors.warning.main,\n },\n info: {\n backgroundColor: `${theme.vars.colors.primary.main}15`,\n borderColor: theme.vars.colors.primary.main,\n color: theme.vars.colors.primary.main,\n },\n };\n\n return {\n padding: `calc(${theme.vars.spacing.unit} * 2)`,\n borderRadius: theme.vars.borderRadius.medium,\n border: '1px solid',\n display: 'flex',\n gap: `calc(${theme.vars.spacing.unit} * 1.5)`,\n alignItems: 'flex-start',\n ...variantStyles[variant],\n };\n }, [theme, variant]);\n};\n\nconst useAlertIconStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n flexShrink: 0,\n marginTop: `calc(${theme.vars.spacing.unit} * 0.25)`, // Slight alignment adjustment\n width: `calc(${theme.vars.spacing.unit} * 2.5)`,\n height: `calc(${theme.vars.spacing.unit} * 2.5)`,\n }),\n [theme],\n );\n};\n\nconst useAlertContentStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n gap: theme.vars.spacing.unit,\n }),\n [theme],\n );\n};\n\nconst useAlertTitleStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n margin: 0,\n fontSize: theme.vars.typography.fontSizes.sm,\n fontWeight: 600,\n lineHeight: 1.4,\n color: 'inherit',\n }),\n [theme],\n );\n};\n\nconst useAlertDescriptionStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n margin: 0,\n fontSize: theme.vars.typography.fontSizes.sm,\n lineHeight: 1.4,\n color: theme.vars.colors.text.secondary,\n }),\n [theme],\n );\n};\n\nconst getDefaultIcon = (variant: AlertVariant) => {\n switch (variant) {\n case 'success':\n return CircleCheck;\n case 'error':\n return CircleAlert;\n case 'warning':\n return TriangleAlert;\n case 'info':\n return Info;\n default:\n return Info;\n }\n};\n\n/**\n * Alert component that displays important information with different severity levels.\n *\n * @example\n * ```tsx\n * <Alert variant=\"success\" showIcon>\n * <Alert.Title>Success! Your changes have been saved</Alert.Title>\n * <Alert.Description>\n * This is an alert with icon, title and description.\n * </Alert.Description>\n * </Alert>\n * ```\n */\nconst Alert = forwardRef<HTMLDivElement, AlertProps>(\n ({variant = 'info', showIcon = true, children, className, style, ...rest}, ref) => {\n const alertStyle = useAlertStyles(variant);\n const iconStyle = useAlertIconStyles();\n const contentStyle = useAlertContentStyles();\n const IconComponent = getDefaultIcon(variant);\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n style={{...alertStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('alert'), withVendorCSSClassPrefix(`alert-${variant}`), className)}\n {...rest}\n >\n {showIcon && (\n <div style={iconStyle} className={withVendorCSSClassPrefix('alert-icon')}>\n <IconComponent />\n </div>\n )}\n <div style={contentStyle} className={withVendorCSSClassPrefix('alert-content')}>\n {children}\n </div>\n </div>\n );\n },\n);\n\n/**\n * Alert title component.\n */\nconst AlertTitle = forwardRef<HTMLHeadingElement, AlertTitleProps>(({children, className, style, ...rest}, ref) => {\n const titleStyle = useAlertTitleStyles();\n\n // Filter out conflicting props that shouldn't be passed to Typography\n const {color, ...filteredRest} = rest;\n\n return (\n <Typography\n component=\"h3\"\n variant=\"h6\"\n fontWeight={600}\n style={{...titleStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('alert-title'), className)}\n {...filteredRest}\n >\n {children}\n </Typography>\n );\n});\n\n/**\n * Alert description component.\n */\nconst AlertDescription = forwardRef<HTMLParagraphElement, AlertDescriptionProps>(\n ({children, className, style, ...rest}, ref) => {\n const descriptionStyle = useAlertDescriptionStyles();\n\n // Filter out conflicting props that shouldn't be passed to Typography\n const {color, ...filteredRest} = rest;\n\n return (\n <Typography\n component=\"p\"\n variant=\"body2\"\n style={{...descriptionStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('alert-description'), className)}\n {...filteredRest}\n >\n {children}\n </Typography>\n );\n },\n);\n\nAlert.displayName = 'Alert';\nAlertTitle.displayName = 'Alert.Title';\nAlertDescription.displayName = 'Alert.Description';\n\n// Attach subcomponents to Alert for dot notation usage\n(Alert as any).Title = AlertTitle;\n(Alert as any).Description = AlertDescription;\n\n// TypeScript interface augmentation for dot notation\nexport interface AlertComponent extends ForwardRefExoticComponent<AlertProps & RefAttributes<HTMLDivElement>> {\n Title: typeof AlertTitle;\n Description: typeof AlertDescription;\n}\n\nexport default Alert as AlertComponent;\nexport {Alert, AlertTitle, AlertDescription};\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * CircleCheck icon component.\n */\nconst CircleCheck: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n);\n\nexport default CircleCheck;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * CircleAlert icon component.\n */\nconst CircleAlert: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />\n </svg>\n);\n\nexport default CircleAlert;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * TriangleAlert icon component.\n */\nconst TriangleAlert: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n);\n\nexport default TriangleAlert;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * Info icon component.\n */\nconst Info: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n);\n\nexport default Info;\n", "/**\n * Copyright (c) {{year}}, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n forwardRef,\n useMemo,\n ReactNode,\n ForwardRefExoticComponent,\n RefAttributes,\n} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Typography from '../Typography/Typography';\n\nexport type CardVariant = 'default' | 'outlined' | 'elevated';\n\nexport interface CardProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Card content\n */\n children?: ReactNode;\n /**\n * Whether the card should be clickable (shows hover effects)\n */\n clickable?: boolean;\n /**\n * The visual variant of the card\n */\n variant?: CardVariant;\n}\n\nexport interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Header content\n */\n children?: ReactNode;\n}\n\nexport interface CardTitleProps extends HTMLAttributes<HTMLHeadingElement> {\n /**\n * Title content\n */\n children?: ReactNode;\n /**\n * The heading level to use\n */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n}\n\nexport interface CardDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {\n /**\n * Description content\n */\n children?: ReactNode;\n}\n\nexport interface CardActionProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Action content\n */\n children?: ReactNode;\n}\n\nexport interface CardContentProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Content\n */\n children?: ReactNode;\n}\n\nexport interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Footer content\n */\n children?: ReactNode;\n}\n\nconst useCardStyles = (variant: CardVariant, clickable: boolean) => {\n const {theme} = useTheme();\n\n return useMemo(() => {\n const baseStyles: CSSProperties = {\n borderRadius: theme.borderRadius.medium,\n backgroundColor: theme.colors.background.surface,\n transition: 'all 0.2s ease-in-out',\n position: 'relative',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'hidden',\n padding: `${theme.spacing.unit * 2}px ${theme.spacing.unit * 2}px`,\n };\n\n const variantStyles: Record<CardVariant, CSSProperties> = {\n default: {\n ...baseStyles,\n },\n outlined: {\n ...baseStyles,\n border: `1px solid ${theme.colors.border}`,\n },\n elevated: {\n ...baseStyles,\n boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',\n border: 'none',\n },\n };\n\n const clickableStyles: CSSProperties = clickable\n ? {\n cursor: 'pointer',\n }\n : {};\n\n return {\n ...variantStyles[variant],\n ...clickableStyles,\n };\n }, [theme, variant, clickable]);\n};\n\nconst useCardHeaderStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n padding: `${theme.spacing.unit * 2}px ${theme.spacing.unit * 2}px 0`,\n display: 'flex',\n flexDirection: 'column',\n gap: `${theme.spacing.unit}px`,\n }),\n [theme],\n );\n};\n\nconst useCardTitleStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n margin: 0,\n // Typography component will handle color, fontSize, fontWeight, lineHeight\n }),\n [theme],\n );\n};\n\nconst useCardDescriptionStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n margin: 0,\n color: theme.colors.text.secondary,\n fontSize: '0.875rem',\n lineHeight: 1.5,\n }),\n [theme],\n );\n};\n\nconst useCardActionStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n marginTop: `${theme.spacing.unit}px`,\n }),\n [theme],\n );\n};\n\nconst useCardContentStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n padding: `${theme.spacing.unit * 2}px`,\n flex: 1,\n }),\n [theme],\n );\n};\n\nconst useCardFooterStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n (): CSSProperties => ({\n padding: `0 ${theme.spacing.unit * 2}px ${theme.spacing.unit * 2}px`,\n display: 'flex',\n alignItems: 'center',\n gap: `${theme.spacing.unit}px`,\n }),\n [theme],\n );\n};\n\n/**\n * Card component that provides a flexible container for content.\n *\n * @example\n * ```tsx\n * <Card variant=\"elevated\" clickable>\n * <Card.Header>\n * <Card.Title>Card Title</Card.Title>\n * <Card.Description>Card Description</Card.Description>\n * <Card.Action>\n * <Button variant=\"link\">Action</Button>\n * </Card.Action>\n * </Card.Header>\n * <Card.Content>\n * <p>Card content goes here</p>\n * </Card.Content>\n * <Card.Footer>\n * <Button>Cancel</Button>\n * <Button variant=\"outline\">Submit</Button>\n * </Card.Footer>\n * </Card>\n * ```\n */\nconst Card = forwardRef<HTMLDivElement, CardProps>(\n ({variant = 'default', clickable = false, children, className, style, ...rest}, ref) => {\n const cardStyle = useCardStyles(variant, clickable);\n\n return (\n <div\n ref={ref}\n style={{...cardStyle, ...style}}\n className={clsx(\n withVendorCSSClassPrefix('card'),\n withVendorCSSClassPrefix(`card-${variant}`),\n {\n [withVendorCSSClassPrefix('card-clickable')]: clickable,\n },\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n\n/**\n * Card header component that contains the title, description, and optional actions.\n */\nconst CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(({children, className, style, ...rest}, ref) => {\n const headerStyle = useCardHeaderStyles();\n\n return (\n <div\n ref={ref}\n style={{...headerStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('card-header'), className)}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\n/**\n * Card title component.\n */\nconst CardTitle = forwardRef<HTMLHeadingElement, CardTitleProps>(\n ({children, level = 3, className, style, ...rest}, ref) => {\n const titleStyle = useCardTitleStyles();\n\n // Map level to Typography variant\n const getVariantFromLevel = (level: number) => {\n switch (level) {\n case 1:\n return 'h1';\n case 2:\n return 'h2';\n case 3:\n return 'h3';\n case 4:\n return 'h4';\n case 5:\n return 'h5';\n case 6:\n return 'h6';\n default:\n return 'h3';\n }\n };\n\n // Map level to HTML element for ref forwarding\n const getComponentFromLevel = (level: number) => {\n switch (level) {\n case 1:\n return 'h1';\n case 2:\n return 'h2';\n case 3:\n return 'h3';\n case 4:\n return 'h4';\n case 5:\n return 'h5';\n case 6:\n return 'h6';\n default:\n return 'h3';\n }\n };\n\n // Filter out conflicting props that shouldn't be passed to Typography\n const {color, ...filteredRest} = rest;\n\n return (\n <Typography\n component={getComponentFromLevel(level)}\n variant={getVariantFromLevel(level)}\n style={{...titleStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('card-title'), className)}\n fontWeight={600}\n {...filteredRest}\n // We can't forward ref to Typography since it doesn't use forwardRef\n // The ref will be handled by the Typography component's underlying element\n >\n {children}\n </Typography>\n );\n },\n);\n\n/**\n * Card description component.\n */\nconst CardDescription = forwardRef<HTMLParagraphElement, CardDescriptionProps>(\n ({children, className, style, ...rest}, ref) => {\n const descriptionStyle = useCardDescriptionStyles();\n\n // Filter out conflicting props that shouldn't be passed to Typography\n const {color, ...filteredRest} = rest;\n\n return (\n <Typography\n component=\"p\"\n variant=\"body2\"\n color=\"textSecondary\"\n style={{...descriptionStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('card-description'), className)}\n {...filteredRest}\n >\n {children}\n </Typography>\n );\n },\n);\n\n/**\n * Card action component for action elements in the header.\n */\nconst CardAction = forwardRef<HTMLDivElement, CardActionProps>(({children, className, style, ...rest}, ref) => {\n const actionStyle = useCardActionStyles();\n\n return (\n <div\n ref={ref}\n style={{...actionStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('card-action'), className)}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\n/**\n * Card content component that contains the main content of the card.\n */\nconst CardContent = forwardRef<HTMLDivElement, CardContentProps>(({children, className, style, ...rest}, ref) => {\n const contentStyle = useCardContentStyles();\n\n return (\n <div\n ref={ref}\n style={{...contentStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('card-content'), className)}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\n/**\n * Card footer component that contains footer actions or additional information.\n */\nconst CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(({children, className, style, ...rest}, ref) => {\n const footerStyle = useCardFooterStyles();\n\n return (\n <div\n ref={ref}\n style={{...footerStyle, ...style}}\n className={clsx(withVendorCSSClassPrefix('card-footer'), className)}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nCard.displayName = 'Card';\nCardHeader.displayName = 'Card.Header';\nCardTitle.displayName = 'Card.Title';\nCardDescription.displayName = 'Card.Description';\nCardAction.displayName = 'Card.Action';\nCardContent.displayName = 'Card.Content';\nCardFooter.displayName = 'Card.Footer';\n\n// Attach subcomponents to Card for dot notation usage\n(Card as any).Header = CardHeader;\n(Card as any).Title = CardTitle;\n(Card as any).Description = CardDescription;\n(Card as any).Action = CardAction;\n(Card as any).Content = CardContent;\n(Card as any).Footer = CardFooter;\n\n// TypeScript interface augmentation for dot notation\nexport interface CardComponent extends ForwardRefExoticComponent<CardProps & RefAttributes<HTMLDivElement>> {\n Action: typeof CardAction;\n Content: typeof CardContent;\n Description: typeof CardDescription;\n Footer: typeof CardFooter;\n Header: typeof CardHeader;\n Title: typeof CardTitle;\n}\n\nexport default Card as CardComponent;\nexport {Card, CardHeader, CardTitle, CardDescription, CardAction, CardContent, CardFooter};\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport {clsx} from 'clsx';\nimport {FC, HTMLAttributes, useMemo} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Typography from '../Typography/Typography';\n\nexport type DividerOrientation = 'horizontal' | 'vertical';\nexport type DividerVariant = 'solid' | 'dashed' | 'dotted';\n\nexport interface DividerProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Text to display in the center of the divider\n */\n children?: React.ReactNode;\n\n /**\n * Custom color for the divider\n */\n color?: string;\n\n /**\n * The orientation of the divider\n */\n orientation?: DividerOrientation;\n\n /**\n * The variant style of the divider\n */\n variant?: DividerVariant;\n}\n\nconst useStyles = (orientation: DividerOrientation, variant: DividerVariant, color?: string, hasChildren?: boolean) => {\n const {theme} = useTheme();\n\n return useMemo(() => {\n const baseColor = color || theme.colors.border;\n const borderStyle = variant === 'solid' ? 'solid' : variant === 'dashed' ? 'dashed' : 'dotted';\n\n const styles = `\n .${withVendorCSSClassPrefix('divider')} {\n margin: calc(${theme.vars.spacing.unit} * 2) 0;\n }\n\n .${withVendorCSSClassPrefix('divider--vertical')} {\n display: inline-block;\n height: 100%;\n min-height: calc(${theme.vars.spacing.unit} * 2);\n width: 1px;\n border-left: 1px ${borderStyle} ${baseColor};\n margin: 0 calc(${theme.vars.spacing.unit} * 1);\n }\n\n .${withVendorCSSClassPrefix('divider--horizontal')} {\n display: flex;\n align-items: center;\n width: 100%;\n }\n\n .${withVendorCSSClassPrefix('divider--horizontal')}:not(.${withVendorCSSClassPrefix('divider--with-text')}) {\n height: 1px;\n border-top: 1px ${borderStyle} ${baseColor};\n }\n\n .${withVendorCSSClassPrefix('divider__line')} {\n flex: 1;\n height: 1px;\n border-top: 1px ${borderStyle} ${baseColor};\n }\n\n .${withVendorCSSClassPrefix('divider__text')} {\n background-color: ${theme.vars.colors.background.surface};\n padding: 0 calc(${theme.vars.spacing.unit} * 1);\n white-space: nowrap;\n }\n `;\n\n return styles;\n }, [orientation, variant, color, hasChildren, theme]);\n};\n\n/**\n * Divider component for separating content sections.\n *\n * @example\n * ```tsx\n * // Basic horizontal divider\n * <Divider />\n *\n * // Divider with text\n * <Divider>OR</Divider>\n *\n * // Vertical divider\n * <Divider orientation=\"vertical\" />\n *\n * // Custom styled divider\n * <Divider variant=\"dashed\" color=\"#ccc\">Continue with</Divider>\n * ```\n */\nconst Divider: FC<DividerProps> = ({\n orientation = 'horizontal',\n variant = 'solid',\n children,\n color,\n className,\n style,\n ...rest\n}) => {\n const styles = useStyles(orientation, variant, color, !!children);\n\n if (orientation === 'vertical') {\n return (\n <>\n <style>{styles}</style>\n <div\n className={clsx(\n withVendorCSSClassPrefix('divider'),\n withVendorCSSClassPrefix('divider--vertical'),\n className,\n )}\n style={style}\n role=\"separator\"\n aria-orientation=\"vertical\"\n {...rest}\n />\n </>\n );\n }\n\n if (children) {\n return (\n <>\n <style>{styles}</style>\n <div\n className={clsx(\n withVendorCSSClassPrefix('divider'),\n withVendorCSSClassPrefix('divider--horizontal'),\n withVendorCSSClassPrefix('divider--with-text'),\n className,\n )}\n style={style}\n role=\"separator\"\n aria-orientation=\"horizontal\"\n {...rest}\n >\n <div className={withVendorCSSClassPrefix('divider__line')} />\n <Typography\n variant=\"body2\"\n color=\"textSecondary\"\n className={withVendorCSSClassPrefix('divider__text')}\n inline\n >\n {children}\n </Typography>\n <div className={withVendorCSSClassPrefix('divider__line')} />\n </div>\n </>\n );\n }\n\n return (\n <>\n <style>{styles}</style>\n <div\n className={clsx(\n withVendorCSSClassPrefix('divider'),\n withVendorCSSClassPrefix('divider--horizontal'),\n className,\n )}\n style={style}\n role=\"separator\"\n aria-orientation=\"horizontal\"\n {...rest}\n />\n </>\n );\n};\n\nexport default Divider;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {clsx} from 'clsx';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport useTheme from '../../../contexts/Theme/useTheme';\n\n/**\n * Props for the Logo component.\n */\nexport interface LogoProps {\n /**\n * Custom CSS class name for the logo.\n */\n className?: string;\n /**\n * Custom logo URL to override theme logo.\n */\n src?: string;\n /**\n * Custom alt text for the logo.\n */\n alt?: string;\n /**\n * Custom title for the logo.\n */\n title?: string;\n /**\n * Size of the logo.\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Custom style object.\n */\n style?: React.CSSProperties;\n}\n\n/**\n * Logo component that displays the brand logo from theme or custom source.\n *\n * @param props - The props for the Logo component.\n * @returns The rendered Logo component.\n */\nconst Logo: FC<LogoProps> = ({className, src, alt, title, size = 'medium', style}) => {\n const {theme} = useTheme();\n\n // Get logo configuration from theme - use actual values, not CSS variables\n // Access the actual theme config values, not the CSS variable references from .vars\n const logoConfig = theme.images?.logo;\n\n const logoSrc = src || logoConfig?.url;\n\n const logoAlt = alt || logoConfig?.alt || 'Logo';\n\n const logoTitle = title || logoConfig?.title;\n\n const logoClasses = clsx(withVendorCSSClassPrefix('logo'), withVendorCSSClassPrefix(`logo--${size}`), className);\n\n const sizeStyles: Record<string, React.CSSProperties> = {\n small: {\n height: '32px',\n maxWidth: '120px',\n },\n medium: {\n height: '48px',\n maxWidth: '180px',\n },\n large: {\n height: '64px',\n maxWidth: '240px',\n },\n };\n\n const defaultStyles: React.CSSProperties = {\n width: 'auto',\n objectFit: 'contain',\n ...sizeStyles[size],\n ...style,\n };\n\n if (!logoSrc) {\n return null;\n }\n\n return <img src={logoSrc} alt={logoAlt} title={logoTitle} className={logoClasses} style={defaultStyles} />;\n};\n\nexport default Logo;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n EmbeddedSignInFlowInitiateResponse,\n EmbeddedSignInFlowHandleResponse,\n EmbeddedSignInFlowHandleRequestPayload,\n} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport BaseSignIn, {BaseSignInProps} from './BaseSignIn';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport {CardProps} from '../../primitives/Card/Card';\n\n/**\n * Props for the SignIn component.\n * Extends BaseSignInProps for full compatibility with the React BaseSignIn component\n */\nexport type SignInProps = Pick<BaseSignInProps, 'className' | 'onSuccess' | 'onError' | 'variant' | 'size'>;\n\n/**\n * A styled SignIn component that provides native authentication flow with pre-built styling.\n * This component handles the API calls for authentication and delegates UI logic to BaseSignIn.\n *\n * @example\n * ```tsx\n * import { SignIn } from '@asgardeo/react';\n *\n * const App = () => {\n * return (\n * <SignIn\n * onSuccess={(authData) => {\n * console.log('Authentication successful:', authData);\n * // Handle successful authentication (e.g., redirect, store tokens)\n * }}\n * onError={(error) => {\n * console.error('Authentication failed:', error);\n * }}\n * size=\"medium\"\n * variant=\"outlined\"\n * />\n * );\n * };\n * ```\n */\nconst SignIn: FC<SignInProps> = ({className, size = 'medium', ...rest}: SignInProps) => {\n const {signIn, afterSignInUrl, isInitialized, isLoading} = useAsgardeo();\n\n /**\n * Initialize the authentication flow.\n */\n const handleInitialize = async (): Promise<EmbeddedSignInFlowInitiateResponse> => {\n return await signIn({response_mode: 'direct'});\n };\n\n /**\n * Handle authentication steps.\n */\n const handleOnSubmit = async (\n payload: EmbeddedSignInFlowHandleRequestPayload,\n request: Request,\n ): Promise<EmbeddedSignInFlowHandleResponse> => {\n return await signIn(payload, request);\n };\n\n /**\n * Handle successful authentication and redirect with query params.\n */\n const handleSuccess = (authData: Record<string, any>): void => {\n if (authData && afterSignInUrl) {\n const url: URL = new URL(afterSignInUrl, window.location.origin);\n\n Object.entries(authData).forEach(([key, value]: [string, any]) => {\n if (value !== undefined && value !== null) {\n url.searchParams.append(key, String(value));\n }\n });\n\n window.location.href = url.toString();\n }\n };\n\n return (\n <BaseSignIn\n isLoading={isLoading || !isInitialized}\n afterSignInUrl={afterSignInUrl}\n onInitialize={handleInitialize}\n onSubmit={handleOnSubmit}\n onSuccess={handleSuccess}\n className={className}\n size={size}\n {...rest}\n />\n );\n};\n\nexport default SignIn;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n EmbeddedFlowExecuteRequestPayload,\n EmbeddedFlowExecuteResponse,\n EmbeddedFlowStatus,\n EmbeddedFlowComponentType,\n EmbeddedFlowResponseType,\n withVendorCSSClassPrefix,\n AsgardeoAPIError,\n} from '@asgardeo/browser';\nimport {clsx} from 'clsx';\nimport {FC, ReactElement, FormEvent, useEffect, useState, useCallback, useRef, useMemo, CSSProperties} from 'react';\nimport {renderSignUpComponents} from './options/SignUpOptionFactory';\nimport FlowProvider from '../../../contexts/Flow/FlowProvider';\nimport useFlow from '../../../contexts/Flow/useFlow';\nimport {useForm, FormField} from '../../../hooks/useForm';\nimport useTranslation from '../../../hooks/useTranslation';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Alert from '../../primitives/Alert/Alert';\nimport Card, {CardProps} from '../../primitives/Card/Card';\nimport Logo from '../../primitives/Logo/Logo';\nimport Spinner from '../../primitives/Spinner/Spinner';\nimport Typography from '../../primitives/Typography/Typography';\n\n/**\n * Props for the BaseSignUp component.\n */\nexport interface BaseSignUpProps {\n /**\n * URL to redirect after successful sign-up.\n */\n afterSignUpUrl?: string;\n\n /**\n * Custom CSS class name for the submit button.\n */\n buttonClassName?: string;\n\n /**\n * Custom CSS class name for the form container.\n */\n className?: string;\n\n /**\n * Custom CSS class name for error messages.\n */\n errorClassName?: string;\n\n /**\n * Custom CSS class name for form inputs.\n */\n inputClassName?: string;\n\n isInitialized?: boolean;\n\n /**\n * Custom CSS class name for info messages.\n */\n messageClassName?: string;\n\n /**\n * Callback function called when the sign-up flow completes and requires redirection.\n * This allows platform-specific handling of redirects (e.g., Next.js router.push).\n * @param response - The response from the sign-up flow containing the redirect URL, etc.\n */\n onComplete?: (response: EmbeddedFlowExecuteResponse) => void;\n\n /**\n * Callback function called when sign-up fails.\n * @param error - The error that occurred during sign-up.\n */\n onError?: (error: Error) => void;\n\n /**\n * Callback function called when sign-up flow status changes.\n * @param response - The current sign-up response.\n */\n onFlowChange?: (response: EmbeddedFlowExecuteResponse) => void;\n\n /**\n * Function to initialize sign-up flow.\n * @returns Promise resolving to the initial sign-up response.\n */\n onInitialize?: (payload?: EmbeddedFlowExecuteRequestPayload) => Promise<EmbeddedFlowExecuteResponse>;\n\n /**\n * Function to handle sign-up steps.\n * @param payload - The sign-up payload.\n * @returns Promise resolving to the sign-up response.\n */\n onSubmit?: (payload: EmbeddedFlowExecuteRequestPayload) => Promise<EmbeddedFlowExecuteResponse>;\n\n /**\n * Size variant for the component.\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Theme variant for the component.\n */\n variant?: CardProps['variant'];\n\n /**\n * Whether to redirect after sign-up.\n */\n shouldRedirectAfterSignUp?: boolean;\n}\n\n/**\n * Custom hook for managing component styles\n */\nconst useStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n () => ({\n card: {\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n minWidth: '420px',\n } as CSSProperties,\n header: {\n gap: 0,\n } as CSSProperties,\n subtitle: {\n marginTop: `calc(${theme.vars.spacing.unit} * 1)`,\n } as CSSProperties,\n messagesContainer: {\n marginTop: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n messageItem: {\n marginBottom: `calc(${theme.vars.spacing.unit} * 1)`,\n } as CSSProperties,\n errorContainer: {\n marginBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n contentContainer: {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n loadingContainer: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n } as CSSProperties,\n loadingText: {\n marginTop: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n divider: {\n margin: `calc(${theme.vars.spacing.unit} * 1) 0`,\n } as CSSProperties,\n logoContainer: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n marginBottom: `calc(${theme.vars.spacing.unit} * 3)`,\n } as CSSProperties,\n centeredContainer: {\n textAlign: 'center',\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n } as CSSProperties,\n passkeyContainer: {\n marginBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n passkeyText: {\n marginTop: `calc(${theme.vars.spacing.unit} * 1)`,\n color: theme.vars.colors.text.secondary,\n } as CSSProperties,\n }),\n [theme.vars.spacing.unit, theme.vars.colors.text.secondary],\n );\n};\n\n/**\n * Base SignUp component that provides embedded sign-up flow.\n * This component handles both the presentation layer and sign-up flow logic.\n * It accepts API functions as props to maintain framework independence.\n *\n * @example\n * ```tsx\n * import { BaseSignUp } from '@asgardeo/react';\n *\n * const MySignUp = () => {\n * return (\n * <BaseSignUp\n * onInitialize={async (payload) => {\n * // Your API call to initialize sign-up\n * return await initializeSignUp(payload);\n * }}\n * onSubmit={async (payload) => {\n * // Your API call to handle sign-up\n * return await handleSignUp(payload);\n * }}\n * onSuccess={(response) => {\n * console.log('Success:', response);\n * }} * onError={(error) => {\n * console.error('Error:', error);\n * }}\n * onComplete={(redirectUrl) => {\n * // Platform-specific redirect handling (e.g., Next.js router.push)\n * router.push(redirectUrl); // or window.location.href = redirectUrl\n * }}\n * className=\"max-w-md mx-auto\"\n * />\n * );\n * };\n * ```\n */\nconst BaseSignUp: FC<BaseSignUpProps> = props => {\n const {theme} = useTheme();\n const styles = useStyles();\n\n return (\n <div>\n <div style={styles.logoContainer}>\n <Logo size=\"large\" />\n </div>\n <FlowProvider>\n <BaseSignUpContent {...props} />\n </FlowProvider>\n </div>\n );\n};\n\n/**\n * Internal component that consumes FlowContext and renders the sign-up UI.\n */\nconst BaseSignUpContent: FC<BaseSignUpProps> = ({\n afterSignUpUrl,\n onInitialize,\n onSubmit,\n onError,\n onFlowChange,\n onComplete,\n className = '',\n inputClassName = '',\n buttonClassName = '',\n errorClassName = '',\n messageClassName = '',\n size = 'medium',\n variant = 'outlined',\n isInitialized,\n}) => {\n const {theme} = useTheme();\n const {t} = useTranslation();\n const {subtitle: flowSubtitle, title: flowTitle, messages: flowMessages} = useFlow();\n const styles = useStyles();\n\n const [isLoading, setIsLoading] = useState(false);\n const [isFlowInitialized, setIsFlowInitialized] = useState(false);\n const [currentFlow, setCurrentFlow] = useState<EmbeddedFlowExecuteResponse | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [formData, setFormData] = useState<Record<string, any>>({});\n\n // Ref to track if initialization has been attempted to prevent multiple calls\n const initializationAttemptedRef = useRef(false);\n\n /**\n * Extract form fields from flow components\n */\n const extractFormFields = useCallback(\n (components: any[]): FormField[] => {\n const fields: FormField[] = [];\n\n const processComponents = (comps: any[]) => {\n comps.forEach(component => {\n if (component.type === EmbeddedFlowComponentType.Input) {\n const config = component.config || {};\n fields.push({\n name: config.name || component.id,\n required: config.required || false,\n initialValue: config.defaultValue || '',\n validator: (value: string) => {\n if (config.required && (!value || value.trim() === '')) {\n return t('field.required');\n }\n // Add email validation if it's an email field\n if (config.type === 'email' && value && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) {\n return t('field.email.invalid');\n }\n // Add password strength validation if it's a password field\n if (config.type === 'password' && value && value.length < 8) {\n return t('field.password.weak');\n }\n return null;\n },\n });\n }\n\n if (component.components && Array.isArray(component.components)) {\n processComponents(component.components);\n }\n });\n };\n\n processComponents(components);\n return fields;\n },\n [t],\n );\n\n const formFields = currentFlow?.data?.components ? extractFormFields(currentFlow.data.components) : [];\n\n const form = useForm<Record<string, string>>({\n initialValues: {},\n fields: formFields,\n validateOnBlur: true,\n validateOnChange: true,\n requiredMessage: t('field.required'),\n });\n\n const {\n values: formValues,\n touched: touchedFields,\n errors: formErrors,\n isValid: isFormValid,\n setValue: setFormValue,\n setTouched: setFormTouched,\n clearErrors: clearFormErrors,\n validateField: validateFormField,\n validateForm,\n touchAllFields,\n reset: resetForm,\n } = form;\n\n /**\n * Setup form fields based on the current flow.\n */\n const setupFormFields = useCallback(\n (flowResponse: EmbeddedFlowExecuteResponse) => {\n const fields = extractFormFields(flowResponse.data?.components || []);\n const initialValues: Record<string, string> = {};\n\n fields.forEach(field => {\n initialValues[field.name] = field.initialValue || '';\n });\n\n // Reset form with new values\n resetForm();\n\n // Set initial values for all fields\n Object.keys(initialValues).forEach(key => {\n setFormValue(key, initialValues[key]);\n });\n },\n [extractFormFields, resetForm, setFormValue],\n );\n\n /**\n * Handle input value changes.\n */\n const handleInputChange = (name: string, value: string) => {\n setFormValue(name, value);\n setFormTouched(name, true);\n };\n\n /**\n * Handle component submission (for buttons outside forms).\n */\n const handleSubmit = async (component: any, data?: Record<string, any>) => {\n if (!currentFlow) {\n return;\n }\n\n setIsLoading(true);\n setError(null);\n\n try {\n // Filter out empty or undefined input values\n const filteredInputs: Record<string, any> = {};\n if (data) {\n Object.entries(data).forEach(([key, value]) => {\n if (value !== null && value !== undefined && value !== '') {\n filteredInputs[key] = value;\n }\n });\n }\n\n const payload: EmbeddedFlowExecuteRequestPayload = {\n ...(currentFlow.flowId && {flowId: currentFlow.flowId}),\n flowType: (currentFlow as any).flowType || 'REGISTRATION',\n inputs: filteredInputs,\n actionId: component.id,\n } as any;\n\n const response = await onSubmit(payload);\n onFlowChange?.(response);\n\n if (response.flowStatus === EmbeddedFlowStatus.Complete) {\n onComplete?.(response);\n return;\n }\n\n if (response.flowStatus === EmbeddedFlowStatus.Incomplete) {\n // Check if the response contains a redirection URL and redirect if needed\n if (handleRedirectionIfNeeded(response, component)) {\n return;\n }\n\n setCurrentFlow(response);\n setupFormFields(response);\n }\n } catch (err) {\n const errorMessage = err instanceof AsgardeoAPIError ? err.message : t('errors.sign.up.flow.failure');\n setError(errorMessage);\n onError?.(err as Error);\n } finally {\n setIsLoading(false);\n }\n };\n\n /**\n * Check if the response contains a redirection URL and perform the redirect if necessary.\n * @param response - The sign-up response\n * @param component - The component that triggered the submission (needed for actionId)\n * @returns true if a redirect was performed, false otherwise\n */\n const handleRedirectionIfNeeded = (response: EmbeddedFlowExecuteResponse, component: any): boolean => {\n if (response?.type === EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {\n /**\n * Open a popup window to handle redirection prompts for social sign-up\n */\n const redirectUrl = response.data.redirectURL;\n const popup = window.open(redirectUrl, 'oauth_popup', 'width=500,height=600,scrollbars=yes,resizable=yes');\n\n if (!popup) {\n console.error('Failed to open popup window');\n return false;\n }\n\n /**\n * Add an event listener to the window to capture the message from the popup\n */\n const messageHandler = async function messageEventHandler(event: MessageEvent) {\n /**\n * Check if the message is from our popup window\n */\n if (event.source !== popup) {\n return;\n }\n\n /**\n * Check the origin of the message to ensure it's from a trusted source\n */\n const expectedOrigin = afterSignUpUrl ? new URL(afterSignUpUrl).origin : window.location.origin;\n if (event.origin !== expectedOrigin && event.origin !== window.location.origin) {\n return;\n }\n\n const {code, state} = event.data;\n\n if (code && state) {\n const payload: EmbeddedFlowExecuteRequestPayload = {\n ...(currentFlow.flowId && {flowId: currentFlow.flowId}),\n flowType: (currentFlow as any).flowType || 'REGISTRATION',\n inputs: {\n code,\n state,\n },\n actionId: '',\n } as any;\n\n try {\n const continueResponse = await onSubmit(payload);\n onFlowChange?.(continueResponse);\n\n if (continueResponse.flowStatus === EmbeddedFlowStatus.Complete) {\n onComplete?.(continueResponse);\n } else if (continueResponse.flowStatus === EmbeddedFlowStatus.Incomplete) {\n setCurrentFlow(continueResponse);\n setupFormFields(continueResponse);\n }\n\n popup.close();\n cleanup();\n } catch (err) {\n const errorMessage = err instanceof AsgardeoAPIError ? err.message : t('errors.sign.up.flow.failure');\n setError(errorMessage);\n onError?.(err as Error);\n popup.close();\n cleanup();\n }\n }\n };\n\n const cleanup = () => {\n window.removeEventListener('message', messageHandler);\n if (popupMonitor) {\n clearInterval(popupMonitor);\n }\n };\n\n window.addEventListener('message', messageHandler);\n\n /**\n * Monitor popup for closure and URL changes\n */\n let hasProcessedCallback = false; // Prevent multiple processing\n const popupMonitor = setInterval(async () => {\n try {\n if (popup.closed) {\n cleanup();\n return;\n }\n\n // Skip if we've already processed a callback\n if (hasProcessedCallback) {\n return;\n }\n\n // Try to access popup URL to check for callback\n try {\n const popupUrl = popup.location.href;\n\n // Check if we've been redirected to the callback URL\n if (popupUrl && (popupUrl.includes('code=') || popupUrl.includes('error='))) {\n hasProcessedCallback = true; // Set flag to prevent multiple processing\n\n // Parse the URL for OAuth parameters\n const url = new URL(popupUrl);\n const code = url.searchParams.get('code');\n const state = url.searchParams.get('state');\n const error = url.searchParams.get('error');\n\n if (error) {\n console.error('OAuth error:', error);\n popup.close();\n cleanup();\n return;\n }\n\n if (code && state) {\n const payload: EmbeddedFlowExecuteRequestPayload = {\n ...(currentFlow.flowId && {flowId: currentFlow.flowId}),\n flowType: (currentFlow as any).flowType || 'REGISTRATION',\n inputs: {\n code,\n state,\n },\n actionId: '',\n } as any;\n\n try {\n const continueResponse = await onSubmit(payload);\n onFlowChange?.(continueResponse);\n\n if (continueResponse.flowStatus === EmbeddedFlowStatus.Complete) {\n onComplete?.(continueResponse);\n } else if (continueResponse.flowStatus === EmbeddedFlowStatus.Incomplete) {\n setCurrentFlow(continueResponse);\n setupFormFields(continueResponse);\n }\n\n popup.close();\n } catch (err) {\n const errorMessage = err instanceof AsgardeoAPIError ? err.message : t('errors.sign.up.flow.failure');\n setError(errorMessage);\n onError?.(err as Error);\n popup.close();\n }\n }\n }\n } catch (e) {\n // Cross-origin error is expected when popup navigates to OAuth provider\n // This is normal and we can ignore it\n }\n } catch (e) {\n console.error('Error monitoring popup:', e);\n }\n }, 1000);\n\n return true;\n }\n\n return false;\n };\n\n // Generate CSS classes\n const containerClasses = clsx(\n [\n withVendorCSSClassPrefix('signup'),\n withVendorCSSClassPrefix(`signup--${size}`),\n withVendorCSSClassPrefix(`signup--${variant}`),\n ],\n className,\n );\n\n const inputClasses = clsx(\n [\n withVendorCSSClassPrefix('signup__input'),\n size === 'small' && withVendorCSSClassPrefix('signup__input--small'),\n size === 'large' && withVendorCSSClassPrefix('signup__input--large'),\n ],\n inputClassName,\n );\n\n const buttonClasses = clsx(\n [\n withVendorCSSClassPrefix('signup__button'),\n size === 'small' && withVendorCSSClassPrefix('signup__button--small'),\n size === 'large' && withVendorCSSClassPrefix('signup__button--large'),\n ],\n buttonClassName,\n );\n\n const errorClasses = clsx([withVendorCSSClassPrefix('signup__error')], errorClassName);\n\n const messageClasses = clsx([withVendorCSSClassPrefix('signup__messages')], messageClassName);\n\n /**\n * Render form components based on flow data using the factory\n */\n const renderComponents = useCallback(\n (components: any[]): ReactElement[] =>\n renderSignUpComponents(\n components,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n handleInputChange,\n {\n buttonClassName: buttonClasses,\n error,\n inputClassName: inputClasses,\n onSubmit: handleSubmit,\n size,\n variant,\n },\n ),\n [\n formValues,\n touchedFields,\n formErrors,\n isFormValid,\n isLoading,\n size,\n variant,\n error,\n inputClasses,\n buttonClasses,\n handleSubmit,\n ],\n );\n\n // Initialize the flow on component mount\n useEffect(() => {\n if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {\n initializationAttemptedRef.current = true;\n\n // Inline initialization to avoid dependency issues\n const performInitialization = async () => {\n setIsLoading(true);\n setError(null);\n\n try {\n const response = await onInitialize();\n\n setCurrentFlow(response);\n setIsFlowInitialized(true);\n onFlowChange?.(response);\n\n if (response.flowStatus === EmbeddedFlowStatus.Complete) {\n onComplete?.(response);\n\n return;\n }\n\n if (response.flowStatus === EmbeddedFlowStatus.Incomplete) {\n setupFormFields(response);\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : t('errors.sign.up.flow.initialization.failure');\n setError(errorMessage);\n onError?.(err as Error);\n } finally {\n setIsLoading(false);\n }\n };\n\n performInitialization();\n }\n }, [\n isInitialized,\n isFlowInitialized,\n onInitialize,\n onComplete,\n onError,\n onFlowChange,\n setupFormFields,\n afterSignUpUrl,\n t,\n ]);\n\n if (!isFlowInitialized && isLoading) {\n return (\n <Card className={containerClasses} style={styles.card} variant={variant}>\n <Card.Content>\n <div style={{display: 'flex', justifyContent: 'center', padding: `calc(${theme.vars.spacing.unit} * 4)`}}>\n <Spinner size=\"medium\" />\n </div>\n </Card.Content>\n </Card>\n );\n }\n\n if (!currentFlow) {\n return (\n <Card className={containerClasses} style={styles.card} variant={variant}>\n <Card.Content>\n <Alert variant=\"error\" className={errorClasses}>\n <Alert.Title>{t('errors.title') || 'Error'}</Alert.Title>\n <Alert.Description>{error || t('errors.sign.up.flow.initialization.failure')}</Alert.Description>\n </Alert>\n </Card.Content>\n </Card>\n );\n }\n\n return (\n <Card className={containerClasses} style={styles.card} variant={variant}>\n {flowMessages && flowMessages.length > 0 && (\n <Card.Header style={styles.header}>\n <div style={{marginTop: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {flowMessages.map((message: any, index: number) => (\n <Alert\n key={message.id || index}\n variant={message.type?.toLowerCase() === 'error' ? 'error' : 'info'}\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 1)`}}\n className={messageClasses}\n >\n <Alert.Description>{message.message}</Alert.Description>\n </Alert>\n ))}\n </div>\n </Card.Header>\n )}\n <Card.Content>\n {error && (\n <Alert\n variant=\"error\"\n className={errorClasses}\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n <Alert.Title>{t('errors.title') || 'Error'}</Alert.Title>\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n )}\n\n <div style={{display: 'flex', flexDirection: 'column', gap: `calc(${theme.vars.spacing.unit} * 2)`}}>\n {currentFlow.data?.components && renderComponents(currentFlow.data.components)}\n </div>\n </Card.Content>\n </Card>\n );\n};\n\nexport default BaseSignUp;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedFlowComponent, EmbeddedFlowComponentType, WithPreferences} from '@asgardeo/browser';\nimport {ReactElement} from 'react';\nimport CheckboxInput from './CheckboxInput';\nimport DateInput from './DateInput';\nimport DividerComponent from './DividerComponent';\nimport EmailInput from './EmailInput';\nimport FormContainer from './FormContainer';\nimport GoogleButton from './GoogleButton';\nimport ImageComponent from './ImageComponent';\nimport NumberInput from './NumberInput';\nimport PasswordInput from './PasswordInput';\nimport ButtonComponent from './SubmitButton';\nimport TelephoneInput from './TelephoneInput';\nimport TextInput from './TextInput';\nimport Typography from './Typography';\n\n/**\n * Base props that all sign-up option components share.\n */\nexport interface BaseSignUpOptionProps extends WithPreferences {\n /**\n * Custom CSS class name for buttons.\n */\n buttonClassName?: string;\n\n /**\n * The component configuration from the flow response.\n */\n component: EmbeddedFlowComponent;\n\n /**\n * Global error message to display.\n */\n error?: string | null;\n\n /**\n * Form validation errors.\n */\n formErrors: Record<string, string>;\n\n /**\n * Current form values.\n */\n formValues: Record<string, string>;\n\n /**\n * Custom CSS class name for form inputs.\n */\n inputClassName?: string;\n\n /**\n * Whether the form is valid.\n */\n isFormValid: boolean;\n\n /**\n * Whether the component is in loading state.\n */\n isLoading: boolean;\n\n /**\n * Callback function called when input values change.\n */\n onInputChange: (name: string, value: string) => void;\n\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>) => void;\n\n /**\n * Component size variant.\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Touched state for form fields.\n */\n touchedFields: Record<string, boolean>;\n\n /**\n * Component theme variant.\n */\n variant?: any;\n}\n\n/**\n * Creates the appropriate sign-up component based on the component type.\n */\nexport const createSignUpComponent = (props: BaseSignUpOptionProps): ReactElement => {\n const {component} = props;\n\n switch (component.type) {\n case EmbeddedFlowComponentType.Typography:\n return <Typography {...props} />;\n\n case EmbeddedFlowComponentType.Input:\n // Determine input type based on variant or config\n const inputVariant = component.variant?.toUpperCase();\n const inputType = component.config['type']?.toLowerCase();\n\n if (inputVariant === 'EMAIL' || inputType === 'email') {\n return <EmailInput {...props} />;\n }\n if (inputVariant === 'PASSWORD' || inputType === 'password') {\n return <PasswordInput {...props} />;\n }\n if (inputVariant === 'TELEPHONE' || inputType === 'tel') {\n return <TelephoneInput {...props} />;\n }\n if (inputVariant === 'NUMBER' || inputType === 'number') {\n return <NumberInput {...props} />;\n }\n if (inputVariant === 'DATE' || inputType === 'date') {\n return <DateInput {...props} />;\n }\n if (inputVariant === 'CHECKBOX' || inputType === 'checkbox') {\n return <CheckboxInput {...props} />;\n }\n return <TextInput {...props} />;\n\n case EmbeddedFlowComponentType.Button: {\n const buttonVariant: string | undefined = component.variant?.toUpperCase();\n const buttonText: string = component.config['text'] || component.config['label'] || '';\n\n // TODO: The connection type should come as metadata.\n if (buttonVariant === 'SOCIAL' && buttonText.toLowerCase().includes('google')) {\n return <GoogleButton {...props} />;\n }\n\n // Use the generic ButtonComponent for all other button variants\n // It will handle PRIMARY, SECONDARY, TEXT, SOCIAL mappings internally\n return <ButtonComponent {...props} />;\n }\n\n case EmbeddedFlowComponentType.Form:\n return <FormContainer {...props} />;\n\n case EmbeddedFlowComponentType.Divider:\n return <DividerComponent {...props} />;\n\n case EmbeddedFlowComponentType.Image:\n return <ImageComponent {...props} />;\n\n default:\n return <div />;\n }\n};\n\n/**\n * Convenience function that creates the appropriate sign-up component from flow component data.\n */\nexport const createSignUpOptionFromComponent = (\n component: EmbeddedFlowComponent,\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n options?: {\n buttonClassName?: string;\n error?: string | null;\n inputClassName?: string;\n key?: string | number;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>) => void;\n size?: 'small' | 'medium' | 'large';\n variant?: any;\n },\n): ReactElement =>\n createSignUpComponent({\n component,\n formErrors,\n formValues,\n isFormValid,\n isLoading,\n onInputChange,\n touchedFields,\n ...options,\n });\n\n/**\n * Processes an array of components and renders them as React elements.\n */\nexport const renderSignUpComponents = (\n components: EmbeddedFlowComponent[],\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n options?: {\n buttonClassName?: string;\n error?: string | null;\n inputClassName?: string;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>) => void;\n size?: 'small' | 'medium' | 'large';\n variant?: any;\n },\n): ReactElement[] =>\n components\n .map((component, index) =>\n createSignUpOptionFromComponent(\n component,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n {\n ...options,\n // Use component id as key, fallback to index\n key: component.id || index,\n },\n ),\n )\n .filter(Boolean);\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FieldType} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport {createField} from '../../../factories/FieldFactory';\n\n/**\n * Checkbox input component for sign-up forms.\n */\nconst CheckboxInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n type: FieldType.Checkbox,\n name: fieldName,\n label: config['label'] || '',\n placeholder: config['placeholder'] || '',\n required: config['required'] || false,\n value,\n error,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n className: inputClassName,\n });\n};\n\nexport default CheckboxInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FieldType} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport {createField} from '../../../factories/FieldFactory';\n\n/**\n * Date input component for sign-up forms.\n */\nconst DateInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n type: FieldType.Date,\n name: fieldName,\n label: config['label'] || '',\n placeholder: config['placeholder'] || '',\n required: config['required'] || false,\n value,\n error,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n className: inputClassName,\n });\n};\n\nexport default DateInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport Divider from '../../../primitives/Divider/Divider';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * Divider component for sign-up forms.\n */\nconst DividerComponent: FC<BaseSignUpOptionProps> = ({component}) => {\n const {theme} = useTheme();\n const config = component.config || {};\n const text = config['text'] || '';\n const variant = component.variant?.toLowerCase() || 'horizontal';\n\n return (\n <Divider\n key={component.id}\n orientation={variant === 'vertical' ? 'vertical' : 'horizontal'}\n style={{margin: `calc(${theme.vars.spacing.unit} * 2) 0`}}\n >\n {text}\n </Divider>\n );\n};\n\nexport default DividerComponent;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FieldType} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport {createField} from '../../../factories/FieldFactory';\n\n/**\n * Email input component for sign-up forms.\n */\nconst EmailInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n type: FieldType.Email,\n name: fieldName,\n label: config['label'] || 'Email',\n placeholder: config['placeholder'] || 'Enter your email',\n required: config['required'] || false,\n value,\n error,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n className: inputClassName,\n });\n};\n\nexport default EmailInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {createSignUpComponent, BaseSignUpOptionProps} from './SignUpOptionFactory';\n\n/**\n * Form container component that renders child components.\n */\nconst FormContainer: FC<BaseSignUpOptionProps> = props => {\n const {component} = props;\n\n // If the form has child components, render them wrapped in a form element\n if (component.components && component.components.length > 0) {\n const handleFormSubmit = (e: React.FormEvent): void => {\n e.preventDefault();\n\n // Find submit button in child components and trigger its submission\n const submitButton = component.components?.find(\n child =>\n child.type === 'BUTTON' &&\n (child.variant === 'PRIMARY' || child.variant === 'SECONDARY' || child.config?.['type'] === 'submit'),\n );\n\n if (submitButton && props.onSubmit) {\n props.onSubmit(submitButton, props.formValues);\n }\n };\n\n return (\n <form key={component.id} onSubmit={handleFormSubmit} style={{display: 'flex', flexDirection: 'column'}}>\n {component.components.map((childComponent, index) =>\n createSignUpComponent({\n ...props,\n component: childComponent,\n }),\n )}\n </form>\n );\n }\n\n // Empty form container\n return <div key={component.id} />;\n};\n\nexport default FormContainer;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\n\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport Button from '../../../primitives/Button/Button';\n\n/**\n * Google Sign-Up Button Component.\n * Handles registration with Google identity provider.\n */\nconst GoogleButton: FC<BaseSignUpOptionProps> = ({\n component,\n isLoading,\n buttonClassName = '',\n size = 'medium',\n onSubmit,\n}) => {\n const config = component.config || {};\n const buttonText: string = config['text'] || config['label'] || 'Continue with Google';\n\n /**\n * Handle button click.\n */\n const handleClick = (): void => {\n if (onSubmit) {\n onSubmit(component, {});\n }\n };\n\n return (\n <Button\n type=\"button\"\n variant=\"solid\"\n color=\"secondary\"\n size={size}\n disabled={isLoading}\n onClick={handleClick}\n className={buttonClassName}\n style={{width: '100%'}}\n startIcon={\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 67.91 67.901\" xmlns=\"http://www.w3.org/2000/svg\">\n <g transform=\"translate(-0.001 -0.001)\">\n <path\n d=\"M15.049,160.965l-2.364,8.824-8.639.183a34.011,34.011,0,0,1-.25-31.7h0l7.691,1.41,3.369,7.645a20.262,20.262,0,0,0,.19,13.642Z\"\n transform=\"translate(0 -119.93)\"\n fill=\"#fbbb00\"\n />\n <path\n d=\"M294.24,208.176A33.939,33.939,0,0,1,282.137,241h0l-9.687-.494-1.371-8.559a20.235,20.235,0,0,0,8.706-10.333H261.628V208.176Z\"\n transform=\"translate(-226.93 -180.567)\"\n fill=\"#518ef8\"\n />\n <path\n d=\"M81.668,328.8h0a33.962,33.962,0,0,1-51.161-10.387l11-9.006a20.192,20.192,0,0,0,29.1,10.338Z\"\n transform=\"translate(-26.463 -268.374)\"\n fill=\"#28b446\"\n />\n <path\n d=\"M80.451,7.816l-11,9A20.19,20.19,0,0,0,39.686,27.393l-11.06-9.055h0A33.959,33.959,0,0,1,80.451,7.816Z\"\n transform=\"translate(-24.828)\"\n fill=\"#f14336\"\n />\n </g>\n </svg>\n }\n >\n {buttonText}\n </Button>\n );\n};\n\nexport default GoogleButton;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * Image component for sign-up forms.\n */\nconst ImageComponent: FC<BaseSignUpOptionProps> = ({component}) => {\n const {theme} = useTheme();\n const config = component.config || {};\n const src = config['src'] || '';\n const alt = config['alt'] || config['label'] || 'Image';\n const variant = component.variant?.toLowerCase() || 'image_block';\n\n const imageStyle: React.CSSProperties = {\n maxWidth: '100%',\n height: 'auto',\n display: 'block',\n margin: variant === 'image_block' ? '1rem auto' : '0',\n borderRadius: theme.vars.borderRadius.small,\n };\n\n if (!src) {\n return null;\n }\n\n return (\n <div key={component.id} style={{textAlign: 'center'}}>\n <img\n src={src}\n alt={alt}\n style={imageStyle}\n onError={e => {\n // Hide broken images\n e.currentTarget.style.display = 'none';\n }}\n />\n </div>\n );\n};\n\nexport default ImageComponent;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FieldType} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport {createField} from '../../../factories/FieldFactory';\n\n/**\n * Number input component for sign-up forms.\n */\nconst NumberInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n type: FieldType.Number,\n name: fieldName,\n label: config['label'] || '',\n placeholder: config['placeholder'] || '',\n required: config['required'] || false,\n value,\n error,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n className: inputClassName,\n });\n};\n\nexport default NumberInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FieldType} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport {createField} from '../../../factories/FieldFactory';\n\n/**\n * Password input component for sign-up forms.\n */\nconst PasswordInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n // Extract validation rules from the component config if available\n const validations = config['validations'] || [];\n const validationHints: string[] = [];\n\n validations.forEach((validation: any) => {\n if (validation.name === 'LengthValidator') {\n const minLength = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n const maxLength = validation.conditions?.find((c: any) => c.key === 'max.length')?.value;\n if (minLength || maxLength) {\n validationHints.push(`Length: ${minLength || '0'}-${maxLength || '\u221E'} characters`);\n }\n } else if (validation.name === 'UpperCaseValidator') {\n const minLength = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n if (minLength && parseInt(minLength, 10) > 0) {\n validationHints.push('Must contain uppercase letter(s)');\n }\n } else if (validation.name === 'LowerCaseValidator') {\n const minLength = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n if (minLength && parseInt(minLength, 10) > 0) {\n validationHints.push('Must contain lowercase letter(s)');\n }\n } else if (validation.name === 'NumeralValidator') {\n const minLength = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n if (minLength && parseInt(minLength, 10) > 0) {\n validationHints.push('Must contain number(s)');\n }\n } else if (validation.name === 'SpecialCharacterValidator') {\n const minLength = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n if (minLength && parseInt(minLength, 10) > 0) {\n validationHints.push('Must contain special character(s)');\n }\n }\n });\n\n const hint = validationHints.length > 0 ? validationHints.join(', ') : config['hint'] || '';\n\n return createField({\n type: FieldType.Password,\n name: fieldName,\n label: config['label'] || 'Password',\n placeholder: config['placeholder'] || 'Enter your password',\n required: config['required'] || false,\n value,\n error,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n className: inputClassName,\n });\n};\n\nexport default PasswordInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\n\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport Button from '../../../primitives/Button/Button';\nimport Spinner from '../../../primitives/Spinner/Spinner';\n\n/**\n * Button component for sign-up forms that handles all button variants.\n */\nconst ButtonComponent: FC<BaseSignUpOptionProps> = ({\n component,\n isLoading,\n isFormValid,\n buttonClassName,\n onSubmit,\n size = 'medium',\n}) => {\n const config = component.config || {};\n const buttonText = config['text'] || config['label'] || 'Continue';\n const buttonType = config['type'] || 'submit';\n const componentVariant = component.variant?.toUpperCase() || 'PRIMARY';\n\n // Map component variants to Button primitive props\n const getButtonProps = () => {\n switch (componentVariant) {\n case 'PRIMARY':\n return {variant: 'solid' as const, color: 'primary' as const};\n case 'SECONDARY':\n return {variant: 'solid' as const, color: 'secondary' as const};\n case 'TEXT':\n return {variant: 'text' as const, color: 'primary' as const};\n case 'SOCIAL':\n return {variant: 'outline' as const, color: 'primary' as const};\n default:\n return {variant: 'solid' as const, color: 'primary' as const};\n }\n };\n\n const {variant, color} = getButtonProps();\n\n const handleClick = () => {\n if (onSubmit && buttonType !== 'submit') {\n onSubmit(component);\n }\n };\n\n return (\n <Button\n key={component.id}\n type={buttonType === 'submit' ? 'submit' : 'button'}\n variant={variant}\n color={color}\n size={size}\n disabled={isLoading || (buttonType === 'submit' && !isFormValid)}\n onClick={buttonType !== 'submit' ? handleClick : undefined}\n className={buttonClassName}\n style={{width: '100%'}}\n >\n {isLoading ? <Spinner size=\"small\" /> : buttonText}\n </Button>\n );\n};\n\nexport default ButtonComponent;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport TextField from '../../../primitives/TextField/TextField';\n\n/**\n * Telephone input component for sign-up forms.\n */\nconst TelephoneInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return (\n <TextField\n key={component.id}\n name={fieldName}\n type=\"tel\"\n label={config['label'] || ''}\n placeholder={config['placeholder'] || ''}\n required={config['required'] || false}\n value={value}\n error={error}\n onChange={e => onInputChange(fieldName, e.target.value)}\n className={inputClassName}\n helperText={config['hint'] || ''}\n />\n );\n};\n\nexport default TelephoneInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FieldType} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport {createField} from '../../../factories/FieldFactory';\n\n/**\n * Text input component for sign-up forms.\n */\nconst TextInput: FC<BaseSignUpOptionProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}) => {\n const config = component.config || {};\n const fieldName = config['identifier'] || config['name'] || component.id;\n const value = formValues[fieldName] || '';\n const error = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n type: FieldType.Text,\n name: fieldName,\n label: config['label'] || '',\n placeholder: config['placeholder'] || '',\n required: config['required'] || false,\n value,\n error,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n className: inputClassName,\n });\n};\n\nexport default TextInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\nimport {BaseSignUpOptionProps} from './SignUpOptionFactory';\nimport Typography from '../../../primitives/Typography/Typography';\nimport useTheme from '../../../../contexts/Theme/useTheme';\n\n/**\n * Typography component for sign-up forms (titles, descriptions, etc.).\n */\nconst TypographyComponent: FC<BaseSignUpOptionProps> = ({component}) => {\n const {theme} = useTheme();\n const config = component.config || {};\n const text = config['text'] || config['content'] || '';\n const variant = component.variant?.toLowerCase() || 'body1';\n\n // Map component variants to Typography variants\n let typographyVariant: any = 'body1';\n\n switch (variant) {\n case 'h1':\n typographyVariant = 'h1';\n break;\n case 'h2':\n typographyVariant = 'h2';\n break;\n case 'h3':\n typographyVariant = 'h3';\n break;\n case 'h4':\n typographyVariant = 'h4';\n break;\n case 'h5':\n typographyVariant = 'h5';\n break;\n case 'h6':\n typographyVariant = 'h6';\n break;\n case 'subtitle1':\n typographyVariant = 'subtitle1';\n break;\n case 'subtitle2':\n typographyVariant = 'subtitle2';\n break;\n case 'body2':\n typographyVariant = 'body2';\n break;\n case 'caption':\n typographyVariant = 'caption';\n break;\n default:\n typographyVariant = 'body1';\n }\n\n return (\n <Typography\n key={component.id}\n variant={typographyVariant}\n style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}\n >\n {text}\n </Typography>\n );\n};\n\nexport default TypographyComponent;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n EmbeddedFlowExecuteRequestPayload,\n EmbeddedFlowExecuteResponse,\n EmbeddedFlowResponseType,\n EmbeddedFlowType,\n} from '@asgardeo/browser';\nimport {FC} from 'react';\nimport BaseSignUp, {BaseSignUpProps} from './BaseSignUp';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\n\n/**\n * Props for the SignUp component.\n */\nexport type SignUpProps = BaseSignUpProps;\n\n/**\n * A styled SignUp component that provides embedded sign-up flow with pre-built styling.\n * This component handles the API calls for sign-up and delegates UI logic to BaseSignUp.\n *\n * @example\n * ```tsx\n * import { SignUp } from '@asgardeo/react';\n *\n * const App = () => {\n * return (\n * <SignUp\n * onSuccess={(response) => {\n * console.log('Sign-up successful:', response);\n * // Handle successful sign-up (e.g., redirect, show confirmation)\n * }}\n * onError={(error) => {\n * console.error('Sign-up failed:', error);\n * }}\n * onComplete={(redirectUrl) => {\n * // Platform-specific redirect handling (e.g., Next.js router.push)\n * router.push(redirectUrl); // or window.location.href = redirectUrl\n * }}\n * size=\"medium\"\n * variant=\"outlined\"\n * afterSignUpUrl=\"/welcome\"\n * />\n * );\n * };\n * ```\n */\nconst SignUp: FC<SignUpProps> = ({\n className,\n size = 'medium',\n afterSignUpUrl,\n onError,\n onComplete,\n shouldRedirectAfterSignUp = true,\n ...rest\n}) => {\n const {signUp, isInitialized} = useAsgardeo();\n\n /**\n * Initialize the sign-up flow.\n */\n const handleInitialize = async (payload?: EmbeddedFlowExecuteRequestPayload): Promise<EmbeddedFlowExecuteResponse> =>\n await signUp(\n payload || {\n flowType: EmbeddedFlowType.Registration,\n },\n );\n\n /**\n * Handle sign-up steps.\n */\n const handleOnSubmit = async (payload: EmbeddedFlowExecuteRequestPayload): Promise<EmbeddedFlowExecuteResponse> =>\n await signUp(payload);\n\n /**\n * Handle successful sign-up and redirect.\n */\n const handleComplete = (response: EmbeddedFlowExecuteResponse) => {\n onComplete?.(response);\n\n // For non-redirection responses (regular sign-up completion), handle redirect if configured\n if (shouldRedirectAfterSignUp && response?.type !== EmbeddedFlowResponseType.Redirection && afterSignUpUrl) {\n window.location.href = afterSignUpUrl;\n }\n\n // For redirection responses (social sign-up), they are handled by BaseSignUp's popup mechanism\n // and we only redirect after the OAuth flow is complete if shouldRedirectAfterSignUp is true\n if (\n shouldRedirectAfterSignUp &&\n response?.type === EmbeddedFlowResponseType.Redirection &&\n response?.data?.redirectURL &&\n !response.data.redirectURL.includes('oauth') && // Not a social provider redirect\n !response.data.redirectURL.includes('auth') // Not an auth provider redirect\n ) {\n window.location.href = response.data.redirectURL;\n }\n };\n\n return (\n <BaseSignUp\n afterSignUpUrl={afterSignUpUrl}\n onInitialize={handleInitialize}\n onSubmit={handleOnSubmit}\n onError={onError}\n onComplete={handleComplete}\n className={className}\n size={size}\n isInitialized={isInitialized}\n {...rest}\n />\n );\n};\n\nexport default SignUp;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User as IUser} from '@asgardeo/browser';\nimport {FC, ReactElement, ReactNode} from 'react';\n\n/**\n * Props for the BaseUser component.\n */\nexport interface BaseUserProps {\n /**\n * The user object to display. If not provided, the component will render the fallback.\n */\n user: IUser | null;\n\n /**\n * Render prop that takes the user object and returns a ReactNode.\n * @param user - The authenticated user object from Asgardeo.\n * @returns A ReactNode to render.\n */\n children: (user: IUser | null) => ReactNode;\n\n /**\n * Optional element to render when no user is provided.\n */\n fallback?: ReactNode;\n}\n\n/**\n * Base User component that provides the core functionality for displaying user information.\n * This component takes a user object as a prop and uses render props to expose it.\n *\n * @remarks This is the base component that can be used in any context where you have\n * a user object available. For React applications, use the User component which\n * automatically retrieves the user from Asgardeo context.\n *\n * @example\n * ```tsx\n * import { BaseUser } from '@asgardeo/auth-react';\n *\n * const MyComponent = ({ user }) => {\n * return (\n * <BaseUser user={user} fallback={<p>No user data</p>}>\n * {(user) => (\n * <div>\n * <h1>Welcome, {user.displayName}!</h1>\n * <p>Email: {user.email}</p>\n * </div>\n * )}\n * </BaseUser>\n * );\n * }\n * ```\n */\nconst BaseUser: FC<BaseUserProps> = ({user, children, fallback = null}): ReactElement => {\n if (!user) {\n return <>{fallback}</>;\n }\n\n return <>{children(user)}</>;\n};\n\nBaseUser.displayName = 'BaseUser';\n\nexport default BaseUser;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User as IUser} from '@asgardeo/browser';\nimport {FC, ReactElement, ReactNode} from 'react';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport BaseUser, {BaseUserProps} from './BaseUser';\n\n/**\n * Props for the User component.\n * Extends BaseUserProps but makes the user prop optional since it will be obtained from useAsgardeo\n */\nexport interface UserProps extends Omit<BaseUserProps, 'user'> {\n /**\n * Render prop that takes the user object and returns a ReactNode.\n * @param user - The authenticated user object from Asgardeo.\n * @returns A ReactNode to render.\n */\n children: (user: IUser | null) => ReactNode;\n\n /**\n * Optional element to render when no user is signed in.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that uses render props to expose the authenticated user object.\n * This component automatically retrieves the user from Asgardeo context.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example\n * ```tsx\n * import { IUser } from '@asgardeo/auth-react';\n *\n * const App = () => {\n * return (\n * <User fallback={<p>Please sign in</p>}>\n * {(user) => (\n * <div>\n * <h1>Welcome, {user.displayName}!</h1>\n * <p>Email: {user.email}</p>\n * </div>\n * )}\n * </User>\n * );\n * }\n * ```\n */\nconst User: FC<UserProps> = ({children, fallback = null}): ReactElement => {\n const {user} = useAsgardeo();\n\n return (\n <BaseUser user={user} fallback={fallback}>\n {children}\n </BaseUser>\n );\n};\n\nUser.displayName = 'User';\n\nexport default User;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {Organization as IOrganization} from '@asgardeo/browser';\nimport {FC, ReactElement, ReactNode} from 'react';\n\n/**\n * Props for the BaseOrganization component.\n */\nexport interface BaseOrganizationProps {\n /**\n * Render prop that takes the organization object and returns a ReactNode.\n * @param organization - The organization object from Asgardeo.\n * @returns A ReactNode to render.\n */\n children: (organization: IOrganization | null) => ReactNode;\n\n /**\n * Optional element to render when no organization is provided.\n */\n fallback?: ReactNode;\n\n /**\n * The organization object to display. If not provided, the component will render the fallback.\n */\n organization: IOrganization | null;\n}\n\n/**\n * Base Organization component that provides the core functionality for displaying organization information.\n * This component takes an organization object as a prop and uses render props to expose it.\n *\n * @remarks This is the base component that can be used in any context where you have\n * an organization object available. For React applications, use the Organization component which\n * automatically retrieves the current organization from Organization context.\n *\n * @example\n * ```tsx\n * import { BaseOrganization } from '@asgardeo/auth-react';\n *\n * const MyComponent = ({ organization }) => {\n * return (\n * <BaseOrganization organization={organization} fallback={<p>No organization data</p>}>\n * {(org) => (\n * <div>\n * <h1>Organization: {org.name}</h1>\n * <p>ID: {org.id}</p>\n * </div>\n * )}\n * </BaseOrganization>\n * );\n * }\n * ```\n */\nconst BaseOrganization: FC<BaseOrganizationProps> = ({children, fallback = null, organization}): ReactElement => {\n if (!organization) {\n return <>{fallback}</>;\n }\n\n return <>{children(organization)}</>;\n};\n\nBaseOrganization.displayName = 'BaseOrganization';\n\nexport default BaseOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {Organization as IOrganization} from '@asgardeo/browser';\nimport {FC, ReactElement, ReactNode} from 'react';\nimport BaseOrganization, {BaseOrganizationProps} from './BaseOrganization';\nimport useOrganization from '../../../contexts/Organization/useOrganization';\n\n/**\n * Props for the Organization component.\n * Extends BaseOrganizationProps but makes the organization prop optional since it will be obtained from useOrganization\n */\nexport interface OrganizationProps extends Omit<BaseOrganizationProps, 'organization'> {\n /**\n * Render prop that takes the organization object and returns a ReactNode.\n * @param organization - The current organization object from Organization context.\n * @returns A ReactNode to render.\n */\n children: (organization: IOrganization | null) => ReactNode;\n\n /**\n * Optional element to render when no organization is selected.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that uses render props to expose the current organization object.\n * This component automatically retrieves the current organization from Organization context.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example\n * ```tsx\n * import { Organization } from '@asgardeo/auth-react';\n *\n * const App = () => {\n * return (\n * <Organization fallback={<p>No organization selected</p>}>\n * {(organization) => (\n * <div>\n * <h1>Current Organization: {organization.name}!</h1>\n * <p>ID: {organization.id}</p>\n * <p>Role: {organization.role}</p>\n * {organization.memberCount && (\n * <p>Members: {organization.memberCount}</p>\n * )}\n * </div>\n * )}\n * </Organization>\n * );\n * }\n * ```\n */\nconst Organization: FC<OrganizationProps> = ({children, fallback = null}): ReactElement => {\n const {currentOrganization} = useOrganization();\n\n return (\n <BaseOrganization organization={currentOrganization} fallback={fallback}>\n {children}\n </BaseOrganization>\n );\n};\n\nOrganization.displayName = 'Organization';\n\nexport default Organization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User, withVendorCSSClassPrefix, WellKnownSchemaIds} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {CSSProperties, FC, ReactElement, useMemo, useState, useCallback, useRef} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport getMappedUserProfileValue from '../../../utils/getMappedUserProfileValue';\nimport {Avatar} from '../../primitives/Avatar/Avatar';\nimport Button from '../../primitives/Button/Button';\nimport Checkbox from '../../primitives/Checkbox/Checkbox';\nimport DatePicker from '../../primitives/DatePicker/DatePicker';\nimport {Dialog, DialogContent, DialogHeading} from '../../primitives/Popover/Popover';\nimport TextField from '../../primitives/TextField/TextField';\nimport MultiInput from '../../primitives/MultiInput/MultiInput';\nimport Card from '../../primitives/Card/Card';\n\ninterface ExtendedFlatSchema {\n path?: string;\n schemaId?: string;\n}\n\ninterface Schema extends ExtendedFlatSchema {\n caseExact?: boolean;\n description?: string;\n displayName?: string;\n displayOrder?: string;\n multiValued?: boolean;\n mutability?: string;\n name?: string;\n required?: boolean;\n returned?: string;\n subAttributes?: Schema[];\n type?: string;\n uniqueness?: string;\n value?: any;\n}\n\nexport interface BaseUserProfileProps {\n attributeMapping?: {\n [key: string]: string | string[] | undefined;\n firstName?: string | string[];\n lastName?: string | string[];\n picture?: string | string[];\n username?: string | string[];\n };\n cancelButtonText?: string;\n cardLayout?: boolean;\n className?: string;\n editable?: boolean;\n fallback?: ReactElement;\n flattenedProfile?: User;\n mode?: 'inline' | 'popup';\n onChange?: (field: string, value: any) => void;\n onOpenChange?: (open: boolean) => void;\n onSubmit?: (data: any) => void;\n onUpdate?: (payload: any) => Promise<void>;\n open?: boolean;\n profile?: User;\n saveButtonText?: string;\n schemas?: Schema[];\n title?: string;\n}\n\n// Fields to skip based on schema.name\nconst fieldsToSkip: string[] = [\n 'roles.default',\n 'active',\n 'groups',\n 'accountLocked',\n 'accountDisabled',\n 'oneTimePassword',\n 'userSourceId',\n 'idpType',\n 'localCredentialExists',\n 'active',\n 'ResourceType',\n 'ExternalID',\n 'MetaData',\n 'verifiedMobileNumbers',\n 'verifiedEmailAddresses',\n 'phoneNumbers.mobile',\n 'emailAddresses',\n];\n\n// Fields that should be readonly\nconst readonlyFields: string[] = ['username', 'userName', 'user_name'];\n\nconst BaseUserProfile: FC<BaseUserProfileProps> = ({\n fallback = null,\n className = '',\n cardLayout = true,\n profile,\n schemas = [],\n flattenedProfile,\n mode = 'inline',\n title = 'User Profile',\n attributeMapping = {},\n editable = true,\n onChange,\n onOpenChange,\n onSubmit,\n onUpdate,\n open = false,\n saveButtonText = 'Save Changes',\n cancelButtonText = 'Cancel',\n}): ReactElement => {\n const {theme} = useTheme();\n const [editedUser, setEditedUser] = useState(flattenedProfile || profile);\n const [editingFields, setEditingFields] = useState<Record<string, boolean>>({});\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const PencilIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z\" />\n </svg>\n );\n\n const toggleFieldEdit = useCallback((fieldName: string) => {\n setEditingFields(prev => ({\n ...prev,\n [fieldName]: !prev[fieldName],\n }));\n }, []);\n\n const getFieldPlaceholder = useCallback((schema: Schema): string => {\n const {type, displayName, description, name} = schema;\n\n // Use the best available label for the field\n const fieldLabel = displayName || description || name || 'value';\n\n // Generate appropriate placeholder based on field type\n switch (type) {\n case 'DATE_TIME':\n return `Enter your ${fieldLabel.toLowerCase()}`;\n case 'BOOLEAN':\n return `Select ${fieldLabel.toLowerCase()}`;\n case 'COMPLEX':\n return `Enter ${fieldLabel.toLowerCase()} details`;\n default:\n // For STRING and other types, use generic placeholder\n return `Enter your ${fieldLabel.toLowerCase()}`;\n }\n }, []);\n\n const ObjectDisplay: FC<{data: unknown}> = ({data}) => {\n if (!data || typeof data !== 'object') return null;\n\n return (\n <table style={{width: '100%', borderCollapse: 'collapse'}}>\n <tbody>\n {Object.entries(data).map(([key, value]) => (\n <tr key={key} style={{borderBottom: `1px solid ${theme.vars.colors.border}`}}>\n <td style={{padding: theme.vars.spacing.unit, verticalAlign: 'top'}}>\n <strong>{formatLabel(key)}:</strong>\n </td>\n <td style={{padding: theme.vars.spacing.unit, verticalAlign: 'top'}}>\n {typeof value === 'object' ? <ObjectDisplay data={value} /> : String(value)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n };\n\n function set(obj: Record<string, any>, path: string, value: any): void {\n const keys = path.split('.');\n let current = obj;\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n\n // If last key, set the value\n if (i === keys.length - 1) {\n current[key] = value;\n } else {\n // If the next level does not exist or is not an object, create an object\n if (!current[key] || typeof current[key] !== 'object') {\n current[key] = {};\n }\n current = current[key];\n }\n }\n }\n\n const handleFieldSave = useCallback(\n (schema: Schema): void => {\n if (!onUpdate || !schema.name) return;\n\n const fieldName: string = schema.name;\n let fieldValue: any =\n editedUser && fieldName && editedUser[fieldName] !== undefined\n ? editedUser[fieldName]\n : flattenedProfile && flattenedProfile[fieldName] !== undefined\n ? flattenedProfile[fieldName]\n : '';\n\n // Filter out empty values for arrays when saving\n if (Array.isArray(fieldValue)) {\n fieldValue = fieldValue.filter(v => v !== undefined && v !== null && v !== '');\n }\n\n let payload: Record<string, any> = {};\n\n // SCIM Patch Operation Logic:\n // - Fields from core schema (urn:ietf:params:scim:schemas:core:2.0:User)\n // should be sent directly: {\"name\":{\"givenName\":\"John\"}}\n // - Fields from extension schemas (like urn:scim:wso2:schema)\n // should be nested under the schema namespace: {\"urn:scim:wso2:schema\":{\"country\":\"Sri Lanka\"}}\n if (schema.schemaId && schema.schemaId !== WellKnownSchemaIds.User) {\n // For non-core schemas, nest the field under the schema namespace\n payload = {\n [schema.schemaId]: {\n [fieldName]: fieldValue,\n },\n };\n } else {\n // For core schema or fields without schemaId, use the field path directly\n // This handles complex paths like \"name.givenName\" correctly\n set(payload, fieldName, fieldValue);\n }\n\n onUpdate(payload);\n // Exit edit mode for this field after save\n toggleFieldEdit(fieldName);\n },\n [editedUser, flattenedProfile, onUpdate, toggleFieldEdit],\n );\n\n const handleFieldCancel = useCallback(\n (fieldName: string) => {\n const currentUser = flattenedProfile || profile;\n setEditedUser(prev => ({\n ...prev,\n [fieldName]: currentUser[fieldName],\n }));\n toggleFieldEdit(fieldName);\n },\n [flattenedProfile, profile, toggleFieldEdit],\n );\n\n const formatLabel = useCallback(\n (key: string): string =>\n key\n .split(/(?=[A-Z])|_/)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' '),\n [],\n );\n\n const styles = useStyles();\n\n const defaultAttributeMappings = {\n picture: ['profile', 'profileUrl', 'picture', 'URL'],\n firstName: ['name.givenName', 'given_name'],\n lastName: ['name.familyName', 'family_name'],\n email: ['emails'],\n username: ['userName', 'username', 'user_name'],\n };\n\n const mergedMappings = {...defaultAttributeMappings, ...attributeMapping};\n\n // Combines label and value/field rendering for both view and edit modes\n const renderSchemaField = (\n schema: Schema,\n isEditing: boolean,\n onEditValue?: (value: any) => void,\n onStartEdit?: () => void,\n ): ReactElement | null => {\n if (!schema) return null;\n const {value, displayName, description, name, type, required, mutability, subAttributes, multiValued} = schema;\n const label = displayName || description || name || '';\n\n // If complex or subAttributes, fallback to original renderSchemaValue\n if (subAttributes && Array.isArray(subAttributes)) {\n return (\n <>\n {subAttributes.map((subAttr, index) => (\n <div key={index} style={styles.field}>\n <span style={styles.label}>{subAttr.displayName || subAttr.description || ''}</span>\n <div style={styles.value}>\n {Array.isArray(subAttr.value)\n ? subAttr.value\n .map(item => (typeof item === 'object' ? JSON.stringify(item) : String(item)))\n .join(', ')\n : typeof subAttr.value === 'object'\n ? JSON.stringify(subAttr.value)\n : String(subAttr.value)}\n </div>\n </div>\n ))}\n </>\n );\n }\n\n // Handle multi-valued fields (either array values or multiValued property)\n if (Array.isArray(value) || multiValued) {\n const hasValues = Array.isArray(value) ? value.length > 0 : value !== undefined && value !== null && value !== '';\n const isEditable = editable && mutability !== 'READ_ONLY' && !readonlyFields.includes(name || '');\n\n // If editing, show multi-valued input\n if (isEditing && onEditValue && isEditable) {\n // Use editedUser value if available, then flattenedProfile, then schema value\n const currentValue =\n editedUser && name && editedUser[name] !== undefined\n ? editedUser[name]\n : flattenedProfile && name && flattenedProfile[name] !== undefined\n ? flattenedProfile[name]\n : value;\n\n let fieldValues: string[];\n if (Array.isArray(currentValue)) {\n fieldValues = currentValue.map(String);\n } else if (currentValue !== undefined && currentValue !== null && currentValue !== '') {\n fieldValues = [String(currentValue)];\n } else {\n fieldValues = [];\n }\n\n return (\n <>\n <span style={styles.label}>{label}</span>\n <div style={styles.value}>\n <MultiInput\n values={fieldValues}\n onChange={newValues => {\n // Don't filter out empty values during editing - only when saving\n // This allows users to type and keeps empty fields for adding new values\n if (multiValued || Array.isArray(currentValue)) {\n onEditValue(newValues);\n } else {\n // Single value field, just take the first value (including empty for typing)\n onEditValue(newValues[0] || '');\n }\n }}\n placeholder={getFieldPlaceholder(schema)}\n fieldType={type as 'STRING' | 'DATE_TIME' | 'BOOLEAN'}\n type={type === 'DATE_TIME' ? 'date' : type === 'STRING' ? 'text' : 'text'}\n required={required}\n style={{\n marginBottom: 0,\n }}\n />\n </div>\n </>\n );\n }\n\n // View mode for multi-valued fields\n let displayValue: string;\n if (hasValues) {\n if (Array.isArray(value)) {\n displayValue = value.map(item => (typeof item === 'object' ? JSON.stringify(item) : String(item))).join(', ');\n } else {\n displayValue = String(value);\n }\n } else if (isEditable) {\n displayValue = getFieldPlaceholder(schema);\n } else {\n displayValue = '-';\n }\n\n return (\n <>\n <span style={styles.label}>{label}</span>\n <div style={{...styles.value, fontStyle: hasValues ? 'normal' : 'italic', opacity: hasValues ? 1 : 0.7}}>\n {!hasValues && isEditable && onStartEdit ? (\n <Button\n onClick={onStartEdit}\n variant=\"text\"\n color=\"secondary\"\n size=\"small\"\n title=\"Click to edit\"\n style={{\n fontStyle: 'italic',\n textDecoration: 'underline',\n opacity: 0.7,\n padding: 0,\n minHeight: 'auto',\n }}\n >\n {displayValue}\n </Button>\n ) : (\n displayValue\n )}\n </div>\n </>\n );\n }\n if (type === 'COMPLEX' && typeof value === 'object') {\n return <ObjectDisplay data={value} />;\n }\n // If editing, show field instead of value\n if (isEditing && onEditValue && mutability !== 'READ_ONLY' && !readonlyFields.includes(name || '')) {\n // Use editedUser value if available, then flattenedProfile, then schema value\n const fieldValue =\n editedUser && name && editedUser[name] !== undefined\n ? editedUser[name]\n : flattenedProfile && name && flattenedProfile[name] !== undefined\n ? flattenedProfile[name]\n : value || '';\n\n const commonProps = {\n label: undefined, // Don't show label in field, we render it outside\n required,\n value: fieldValue,\n onChange: (e: any) => onEditValue(e.target ? e.target.value : e),\n placeholder: getFieldPlaceholder(schema),\n style: {\n marginBottom: 0,\n },\n };\n let field: ReactElement;\n switch (type) {\n case 'STRING':\n field = <TextField {...commonProps} />;\n break;\n case 'DATE_TIME':\n field = <DatePicker {...commonProps} />;\n break;\n case 'BOOLEAN':\n field = <Checkbox {...commonProps} checked={!!fieldValue} onChange={e => onEditValue(e.target.checked)} />;\n break;\n case 'COMPLEX':\n // For complex types, use a textarea\n field = (\n <textarea\n value={fieldValue}\n onChange={e => onEditValue(e.target.value)}\n placeholder={getFieldPlaceholder(schema)}\n required={required}\n style={{\n ...commonProps.style,\n minHeight: '60px',\n width: '100%',\n padding: '8px',\n border: `1px solid ${theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.small,\n resize: 'vertical',\n }}\n />\n );\n break;\n default:\n field = <TextField {...commonProps} />;\n }\n return (\n <>\n <span style={styles.label}>{label}</span>\n <div style={styles.value}>{field}</div>\n </>\n );\n }\n // Default: view mode\n const hasValue = value !== undefined && value !== null && value !== '';\n const isEditable = editable && mutability !== 'READ_ONLY' && !readonlyFields.includes(name || '');\n\n let displayValue: string;\n if (hasValue) {\n displayValue = String(value);\n } else if (isEditable) {\n displayValue = getFieldPlaceholder(schema);\n } else {\n displayValue = '-';\n }\n\n return (\n <>\n <span style={styles.label}>{label}</span>\n <div style={{...styles.value, fontStyle: hasValue ? 'normal' : 'italic', opacity: hasValue ? 1 : 0.7}}>\n {!hasValue && isEditable && onStartEdit ? (\n <Button\n onClick={onStartEdit}\n variant=\"text\"\n color=\"secondary\"\n size=\"small\"\n title=\"Click to edit\"\n style={{\n fontStyle: 'italic',\n textDecoration: 'underline',\n opacity: 0.7,\n padding: 0,\n minHeight: 'auto',\n }}\n >\n {displayValue}\n </Button>\n ) : (\n displayValue\n )}\n </div>\n </>\n );\n };\n\n const renderUserInfo = (schema: Schema) => {\n if (!schema || !schema.name) return null;\n\n // Skip fields with undefined or empty values unless editing or editable\n const hasValue = schema.value !== undefined && schema.value !== '' && schema.value !== null;\n const isFieldEditing = editingFields[schema.name];\n const isReadonlyField = readonlyFields.includes(schema.name);\n\n // Show field if: has value, currently editing, or is editable and READ_WRITE\n const shouldShow = hasValue || isFieldEditing || (editable && schema.mutability === 'READ_WRITE');\n\n if (!shouldShow) {\n return null;\n }\n\n const fieldStyle = {\n ...styles.field,\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n };\n\n return (\n <div style={fieldStyle}>\n <div style={{flex: 1, display: 'flex', alignItems: 'center', gap: theme.vars.spacing.unit}}>\n {renderSchemaField(\n schema,\n isFieldEditing,\n value => {\n const tempEditedUser = {...editedUser};\n tempEditedUser[schema.name!] = value;\n setEditedUser(tempEditedUser);\n },\n () => toggleFieldEdit(schema.name!),\n )}\n </div>\n {editable && schema.mutability !== 'READ_ONLY' && !isReadonlyField && (\n <div\n style={{\n display: 'flex',\n gap: `calc(${theme.vars.spacing.unit} / 2)`,\n alignItems: 'center',\n marginLeft: theme.vars.spacing.unit,\n }}\n >\n {isFieldEditing && (\n <>\n <Button size=\"small\" color=\"primary\" variant=\"solid\" onClick={() => handleFieldSave(schema)}>\n Save\n </Button>\n <Button size=\"small\" color=\"secondary\" variant=\"solid\" onClick={() => handleFieldCancel(schema.name!)}>\n Cancel\n </Button>\n </>\n )}\n {!isFieldEditing && hasValue && (\n <Button\n size=\"small\"\n color=\"tertiary\"\n variant=\"text\"\n onClick={() => toggleFieldEdit(schema.name!)}\n title=\"Edit\"\n style={{\n padding: `calc(${theme.vars.spacing.unit} / 2)`,\n }}\n >\n <PencilIcon />\n </Button>\n )}\n </div>\n )}\n </div>\n );\n };\n\n const getDisplayName = () => {\n const firstName = getMappedUserProfileValue('firstName', mergedMappings, profile);\n const lastName = getMappedUserProfileValue('lastName', mergedMappings, profile);\n\n if (firstName && lastName) {\n return `${firstName} ${lastName}`;\n }\n\n return getMappedUserProfileValue('username', mergedMappings, profile) || '';\n };\n\n if (!profile && !flattenedProfile) {\n return fallback;\n }\n\n const containerStyle = {\n ...styles.root,\n ...(cardLayout ? styles.card : {}),\n };\n\n const currentUser = flattenedProfile || profile;\n const avatarAttributes = ['picture'];\n const excludedProps = avatarAttributes.map(attr => mergedMappings[attr] || attr);\n\n // Function to render profile fields when schemas are not available\n const renderProfileWithoutSchemas = () => {\n if (!currentUser) return null;\n\n const profileEntries = Object.entries(currentUser)\n .filter(([key, value]) => {\n // Skip fields that are in the fieldsToSkip array\n if (fieldsToSkip.includes(key)) return false;\n // Skip empty values\n return value !== undefined && value !== '' && value !== null;\n })\n .sort(([a], [b]) => a.localeCompare(b)); // Sort alphabetically\n\n return (\n <>\n {profileEntries.map(([key, value]) => (\n <div key={key} style={styles.field}>\n <span style={styles.label}>{formatLabel(key)}</span>\n <div style={styles.value}>{typeof value === 'object' ? JSON.stringify(value, null, 2) : String(value)}</div>\n </div>\n ))}\n </>\n );\n };\n\n const profileContent = (\n <Card style={containerStyle} className={clsx(withVendorCSSClassPrefix('user-profile'), className)}>\n <div style={styles.header}>\n <Avatar\n imageUrl={getMappedUserProfileValue('picture', mergedMappings, currentUser)}\n name={getDisplayName()}\n size={80}\n alt={`${getDisplayName()}'s avatar`}\n />\n </div>\n <div style={styles.infoContainer}>\n {schemas && schemas.length > 0\n ? // Render with schemas when available\n schemas\n .filter(schema => {\n // Skip fields that are in the fieldsToSkip array\n if (fieldsToSkip.includes(schema.name)) return false;\n\n // For non-editable mode, only show fields with values\n if (!editable) {\n const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : undefined;\n return value !== undefined && value !== '' && value !== null;\n }\n\n return true;\n })\n .sort((a, b) => {\n const orderA = a.displayOrder ? parseInt(a.displayOrder) : 999;\n const orderB = b.displayOrder ? parseInt(b.displayOrder) : 999;\n return orderA - orderB;\n })\n .map((schema, index) => {\n // Get the value from flattenedProfile\n const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : undefined;\n const schemaWithValue = {\n ...schema,\n value,\n };\n\n return <div key={schema.name || index}>{renderUserInfo(schemaWithValue)}</div>;\n })\n : // Fallback: render profile fields directly when schemas are not available\n renderProfileWithoutSchemas()}\n </div>\n </Card>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={{padding: `calc(${theme.vars.spacing.unit} * 2)`}}>{profileContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return profileContent;\n};\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n root: {\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n minWidth: '600px',\n margin: '0 auto',\n } as CSSProperties,\n card: {\n background: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.large,\n } as CSSProperties,\n header: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} * 1.5)`,\n marginBottom: `calc(${theme.vars.spacing.unit} * 1.5)`,\n } as CSSProperties,\n profileInfo: {\n flex: 1,\n } as CSSProperties,\n name: {\n fontSize: '1.5rem',\n fontWeight: 600,\n margin: '0',\n color: theme.vars.colors.text.primary,\n } as CSSProperties,\n infoContainer: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: theme.vars.spacing.unit,\n } as CSSProperties,\n field: {\n display: 'flex',\n alignItems: 'flex-start',\n padding: `calc(${theme.vars.spacing.unit} / 2) 0`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n minHeight: '28px',\n } as CSSProperties,\n lastField: {\n borderBottom: 'none',\n } as CSSProperties,\n label: {\n fontSize: '0.875rem',\n fontWeight: 500,\n color: theme.vars.colors.text.secondary,\n width: '120px',\n flexShrink: 0,\n lineHeight: '28px',\n } as CSSProperties,\n value: {\n color: theme.vars.colors.text.primary,\n flex: 1,\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n overflow: 'hidden',\n minHeight: '28px',\n '& input': {\n height: '32px',\n margin: 0,\n },\n lineHeight: '28px',\n wordBreak: 'break-word' as const,\n '& table': {\n backgroundColor: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.medium,\n whiteSpace: 'normal',\n },\n '& td': {\n borderColor: theme.vars.colors.border,\n },\n } as CSSProperties,\n popup: {\n padding: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\nexport default BaseUserProfile;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User, get} from '@asgardeo/browser';\n\n/**\n * Retrieves a user profile value based on attribute mapping configuration.\n *\n * This function allows flexible mapping of component attribute names to actual\n * user profile field paths. It supports both simple string mappings and arrays\n * of potential field paths for fallback scenarios.\n *\n * @param key - The logical attribute name to retrieve (e.g., 'firstName', 'email')\n * @param mappings - Object mapping logical names to user profile field paths\n * @param user - The user object to extract values from\n * @returns The mapped value from the user profile, or undefined if not found\n *\n * @example\n * ```typescript\n * const mappings = {\n * firstName: 'name.givenName',\n * email: 'emails[0]',\n * picture: ['profileUrl', 'profile', 'avatar'] // fallback options\n * };\n *\n * const user = {\n * name: { givenName: 'John' },\n * emails: ['john@example.com'],\n * profileUrl: 'https://example.com/avatar.jpg'\n * };\n *\n * getMappedUserProfileValue('firstName', mappings, user); // 'John'\n * getMappedUserProfileValue('email', mappings, user); // 'john@example.com'\n * getMappedUserProfileValue('picture', mappings, user); // 'https://example.com/avatar.jpg'\n * ```\n */\nconst getMappedUserProfileValue = (key: string, mappings: Record<string, string | string[]>, user: User): any => {\n if (!key || !mappings || !user) {\n return undefined;\n }\n\n const mapping = mappings[key];\n\n if (!mapping) {\n // If no mapping defined, try to get the value directly from the user object\n return get(user, key);\n }\n\n // If mapping is an array, try each path until we find a value\n if (Array.isArray(mapping)) {\n for (const path of mapping) {\n const value = get(user, path);\n if (value !== undefined && value !== null && value !== '') {\n return value;\n }\n }\n return undefined;\n }\n\n // For single string mapping, get the value directly\n return get(user, mapping);\n};\n\nexport default getMappedUserProfileValue;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {CSSProperties, FC, JSX, useMemo} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\n\nexport interface AvatarProps {\n /**\n * Alternative text for the avatar image\n */\n alt?: string;\n /**\n * Background generation strategy\n * - 'random': Generate background color based on ASCII values of the name\n * - 'none': Use default theme background\n * - string: Use custom background color\n * @default 'random'\n */\n background?: 'random' | 'none' | string;\n /**\n * Optional className for the avatar\n */\n className?: string;\n /**\n * The URL of the avatar image\n */\n imageUrl?: string;\n /**\n * The name to use for generating initials when no image is provided\n */\n name?: string;\n /**\n * The size of the avatar in pixels\n */\n size?: number;\n /**\n * The variant of the avatar shape\n * @default 'circular'\n */\n variant?: 'circular' | 'square';\n}\n\nconst useStyles = ({\n size,\n variant,\n backgroundColor,\n}: {\n size: number;\n variant: 'circular' | 'square';\n backgroundColor?: string;\n}): {\n avatar: CSSProperties;\n image: CSSProperties;\n} => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n avatar: {\n alignItems: 'center',\n background: backgroundColor || theme.vars.colors.background.surface,\n border: backgroundColor ? 'none' : `1px solid ${theme.vars.colors.border}`,\n borderRadius: variant === 'circular' ? '50%' : '8px',\n color: backgroundColor ? '#ffffff' : theme.vars.colors.text.primary,\n display: 'flex',\n fontSize: `${size * 0.4}px`,\n fontWeight: 600,\n height: `${size}px`,\n justifyContent: 'center',\n overflow: 'hidden',\n textShadow: backgroundColor ? '0 1px 2px rgba(0, 0, 0, 0.1)' : 'none',\n width: `${size}px`,\n } as CSSProperties,\n image: {\n height: '100%',\n objectFit: 'cover',\n width: '100%',\n } as CSSProperties,\n }),\n [size, theme, colorScheme, variant, backgroundColor],\n );\n};\n\nexport const Avatar: FC<AvatarProps> = ({\n alt = 'User avatar',\n background = 'random',\n className = '',\n imageUrl,\n name,\n size = 64,\n variant = 'circular',\n}): JSX.Element => {\n const generateBackgroundColor = (inputString: string): string => {\n const hash = inputString.split('').reduce((acc, char) => {\n const charCode = char.charCodeAt(0);\n return ((acc << 5) - acc + charCode) & 0xffffffff;\n }, 0);\n\n const seed = Math.abs(hash);\n\n const generateColor = (offset: number): string => {\n const hue1 = (seed + offset) % 360;\n const hue2 = (hue1 + 60 + (seed % 120)) % 360;\n\n const saturation = 70 + (seed % 20);\n const lightness1 = 55 + (seed % 15);\n const lightness2 = 60 + ((seed + offset) % 15);\n\n return `hsl(${hue1}, ${saturation}%, ${lightness1}%), hsl(${hue2}, ${saturation}%, ${lightness2}%)`;\n };\n\n const angle = 45 + (seed % 91);\n\n const colors = generateColor(seed);\n return `linear-gradient(${angle}deg, ${colors})`;\n };\n\n const backgroundColor = useMemo(() => {\n if (!name || imageUrl) {\n return undefined;\n }\n\n if (background === 'random') {\n return generateBackgroundColor(name);\n }\n\n if (background === 'none') {\n return undefined;\n }\n\n return background;\n }, [background, name, imageUrl]);\n\n const styles: {avatar: CSSProperties; image: CSSProperties} = useStyles({\n size,\n variant,\n backgroundColor,\n });\n\n const getInitials = (fullName: string): string =>\n fullName\n .split(' ')\n .map((part: string) => part[0])\n .slice(0, 2)\n .join('')\n .toUpperCase();\n\n const renderContent = (): JSX.Element | string => {\n if (imageUrl) {\n return <img src={imageUrl} alt={alt} style={styles.image} />;\n }\n if (name) {\n return getInitials(name);\n }\n\n // Skeleton loading animation\n return (\n <div\n style={{\n width: '100%',\n height: '100%',\n background: 'linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)',\n backgroundSize: '200% 100%',\n animation: 'skeleton-loading 1.5s infinite',\n borderRadius: variant === 'circular' ? '50%' : '8px',\n }}\n />\n );\n };\n\n return (\n <div style={styles.avatar} className={clsx(withVendorCSSClassPrefix('avatar'), className)}>\n <style>\n {`\n @keyframes skeleton-loading {\n 0% {\n background-position: -200% 0;\n }\n 100% {\n background-position: 200% 0;\n }\n }\n `}\n </style>\n {renderContent()}\n </div>\n );\n};\n\nexport default Avatar;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport {\n useFloating,\n autoUpdate,\n offset,\n flip,\n shift,\n useClick,\n useDismiss,\n useRole,\n useInteractions,\n useMergeRefs,\n FloatingFocusManager,\n FloatingOverlay,\n FloatingPortal,\n useId,\n UseFloatingReturn,\n UseInteractionsReturn,\n} from '@floating-ui/react';\nimport clsx from 'clsx';\nimport React, {CSSProperties, useMemo} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Button from '../Button/Button';\nimport {X} from '../Icons';\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n overlay: {\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 9999,\n } as CSSProperties,\n content: {\n background: theme.colors.background.surface,\n borderRadius: theme.borderRadius.large,\n boxShadow: `0 2px 8px ${colorScheme === 'dark' ? 'rgba(0, 0, 0, 0.3)' : 'rgba(0, 0, 0, 0.15)'}`,\n outline: 'none',\n maxWidth: '90vw',\n maxHeight: '90vh',\n overflowY: 'auto',\n zIndex: 10000,\n } as CSSProperties,\n dropdownContent: {\n background: theme.colors.background.surface,\n borderRadius: theme.borderRadius.large,\n boxShadow: `0 2px 8px ${colorScheme === 'dark' ? 'rgba(0, 0, 0, 0.3)' : 'rgba(0, 0, 0, 0.15)'}`,\n outline: 'none',\n maxWidth: '90vw',\n maxHeight: '90vh',\n overflowY: 'auto',\n zIndex: 10000,\n } as CSSProperties,\n header: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: `${theme.spacing.unit * 3}px ${theme.spacing.unit * 4.5}px`,\n borderBottom: `1px solid ${theme.colors.border}`,\n } as CSSProperties,\n headerTitle: {\n margin: 0,\n fontSize: '1.2rem',\n fontWeight: 600,\n color: theme.colors.text.primary,\n } as CSSProperties,\n contentBody: {\n padding: `${theme.spacing.unit * 2}px`,\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\n// Modal Dialog hook and components\ninterface DialogOptions {\n initialOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n open?: boolean;\n}\n\n// Return type for dialog hook\ninterface DialogHookReturn extends UseFloatingReturn, UseInteractionsReturn {\n descriptionId: string | undefined;\n labelId: string | undefined;\n open: boolean;\n setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setOpen: (open: boolean) => void;\n}\n\nexport function useDialog({\n initialOpen = false,\n open: controlledOpen,\n onOpenChange: setControlledOpen,\n}: DialogOptions = {}): DialogHookReturn {\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(initialOpen);\n const [labelId, setLabelId] = React.useState<string | undefined>();\n const [descriptionId, setDescriptionId] = React.useState<string | undefined>();\n\n const open = controlledOpen ?? uncontrolledOpen;\n const setOpen = setControlledOpen ?? setUncontrolledOpen;\n\n const data = useFloating({\n open,\n onOpenChange: setOpen,\n });\n\n const {context} = data;\n\n const click = useClick(context, {\n enabled: controlledOpen == null,\n });\n const dismiss = useDismiss(context, {outsidePressEvent: 'mousedown'});\n const role = useRole(context);\n\n const interactions = useInteractions([click, dismiss, role]);\n\n return React.useMemo(\n () => ({\n open,\n setOpen,\n ...interactions,\n ...data,\n labelId,\n descriptionId,\n setLabelId,\n setDescriptionId,\n }),\n [open, setOpen, interactions, data, labelId, descriptionId],\n );\n}\n\n// Dropdown Popover hook\ninterface PopoverOptions {\n initialOpen?: boolean;\n offset?: number;\n onOpenChange?: (open: boolean) => void;\n open?: boolean;\n placement?: 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';\n}\n\n// Return type for popover hook\ninterface PopoverHookReturn extends UseFloatingReturn, UseInteractionsReturn {\n descriptionId: string | undefined;\n labelId: string | undefined;\n open: boolean;\n setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setOpen: (open: boolean) => void;\n}\n\nexport function usePopover({\n initialOpen = false,\n open: controlledOpen,\n onOpenChange: setControlledOpen,\n placement = 'bottom',\n offset: offsetValue = 5,\n}: PopoverOptions = {}): PopoverHookReturn {\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(initialOpen);\n const [labelId, setLabelId] = React.useState<string | undefined>();\n const [descriptionId, setDescriptionId] = React.useState<string | undefined>();\n\n const open = controlledOpen ?? uncontrolledOpen;\n const setOpen = setControlledOpen ?? setUncontrolledOpen;\n\n const data = useFloating({\n open,\n onOpenChange: setOpen,\n middleware: [offset(offsetValue), flip(), shift()],\n whileElementsMounted: autoUpdate,\n placement,\n });\n\n const {context} = data;\n\n const click = useClick(context);\n const dismiss = useDismiss(context, {outsidePressEvent: 'mousedown'});\n const role = useRole(context);\n\n const interactions = useInteractions([click, dismiss, role]);\n\n return React.useMemo(\n () => ({\n open,\n setOpen,\n ...interactions,\n ...data,\n labelId,\n descriptionId,\n setLabelId,\n setDescriptionId,\n }),\n [open, setOpen, interactions, data, labelId, descriptionId],\n );\n}\n\n// Context types\ntype DialogContextType =\n | (DialogHookReturn & {\n setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;\n })\n | null;\n\ntype PopoverContextType =\n | (PopoverHookReturn & {\n setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;\n })\n | null;\n\nconst DialogContext = React.createContext<DialogContextType>(null);\nconst PopoverContext = React.createContext<PopoverContextType>(null);\n\nexport const useDialogContext = (): DialogHookReturn => {\n const context = React.useContext(DialogContext);\n if (context == null) {\n throw new Error('Dialog components must be wrapped in <Dialog />');\n }\n return context;\n};\n\nexport const usePopoverContext = (): PopoverHookReturn => {\n const context = React.useContext(PopoverContext);\n if (context == null) {\n throw new Error('Popover components must be wrapped in <Popover />');\n }\n return context;\n};\n\n// Dialog Components (Modal)\nexport function Dialog({children, ...options}: {children: React.ReactNode} & DialogOptions) {\n const dialog = useDialog(options);\n return <DialogContext.Provider value={dialog}>{children}</DialogContext.Provider>;\n}\n\ninterface DialogTriggerProps {\n asChild?: boolean;\n children: React.ReactNode;\n}\n\nexport const DialogTrigger = React.forwardRef<HTMLElement, React.HTMLProps<HTMLElement> & DialogTriggerProps>(\n ({children, asChild = false, ...props}, propRef) => {\n const context = useDialogContext();\n const childrenRef = (children as any).ref;\n const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef]);\n\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(\n children,\n context.getReferenceProps({\n ref,\n ...props,\n ...(children.props as any),\n 'data-state': context.open ? 'open' : 'closed',\n }),\n );\n }\n\n return (\n <button ref={ref} data-state={context.open ? 'open' : 'closed'} {...context.getReferenceProps(props)}>\n {children}\n </button>\n );\n },\n);\n\nexport const DialogContent = React.forwardRef<HTMLDivElement, React.HTMLProps<HTMLDivElement>>((props, propRef) => {\n const {context: floatingContext, ...context} = useDialogContext();\n const ref = useMergeRefs([context.refs.setFloating, propRef]);\n const styles = useStyles();\n\n if (!floatingContext.open) return null;\n\n return (\n <FloatingPortal>\n <FloatingOverlay className={withVendorCSSClassPrefix('popover-overlay')} style={styles.overlay} lockScroll>\n <FloatingFocusManager context={floatingContext}>\n <div\n ref={ref}\n style={styles.content}\n className={clsx(withVendorCSSClassPrefix('popover-content'), props.className)}\n aria-labelledby={context.labelId}\n aria-describedby={context.descriptionId}\n {...context.getFloatingProps(props)}\n >\n {props.children}\n </div>\n </FloatingFocusManager>\n </FloatingOverlay>\n </FloatingPortal>\n );\n});\n\n// Popover Components (Dropdown)\nexport function Popover({children, ...options}: {children: React.ReactNode} & PopoverOptions) {\n const popover = usePopover(options);\n return <PopoverContext.Provider value={popover}>{children}</PopoverContext.Provider>;\n}\n\ninterface PopoverTriggerProps {\n asChild?: boolean;\n children: React.ReactNode;\n}\n\nexport const PopoverTrigger = React.forwardRef<HTMLElement, React.HTMLProps<HTMLElement> & PopoverTriggerProps>(\n ({children, asChild = false, ...props}, propRef) => {\n const context = usePopoverContext();\n const childrenRef = (children as any).ref;\n const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef]);\n\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(\n children,\n context.getReferenceProps({\n ref,\n ...props,\n ...(children.props as any),\n 'data-state': context.open ? 'open' : 'closed',\n }),\n );\n }\n\n return (\n <button ref={ref} data-state={context.open ? 'open' : 'closed'} {...context.getReferenceProps(props)}>\n {children}\n </button>\n );\n },\n);\n\nexport const PopoverContent = React.forwardRef<HTMLDivElement, React.HTMLProps<HTMLDivElement>>((props, propRef) => {\n const {context: floatingContext, ...context} = usePopoverContext();\n const ref = useMergeRefs([context.refs.setFloating, propRef]);\n const styles = useStyles();\n\n if (!floatingContext.open) return null;\n\n return (\n <FloatingPortal>\n <FloatingFocusManager context={floatingContext}>\n <div\n ref={ref}\n style={{...styles.dropdownContent, ...context.floatingStyles}}\n className={clsx(withVendorCSSClassPrefix('popover-content'), props.className)}\n aria-labelledby={context.labelId}\n aria-describedby={context.descriptionId}\n {...context.getFloatingProps(props)}\n >\n {props.children}\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n );\n});\n\n// Shared components\nexport const PopoverHeading = React.forwardRef<HTMLHeadingElement, React.HTMLProps<HTMLHeadingElement>>(\n ({children, ...props}, ref) => {\n const context = usePopoverContext();\n const styles = useStyles();\n const id = useId();\n\n React.useLayoutEffect(() => {\n context.setLabelId(id);\n return () => context.setLabelId(undefined);\n }, [id, context.setLabelId]);\n\n return (\n <div style={styles.header}>\n <h2 {...props} ref={ref} id={id} style={styles.headerTitle}>\n {children}\n </h2>\n <Button color=\"tertiary\" variant=\"text\" size=\"small\" onClick={() => context.setOpen(false)} aria-label=\"Close\">\n <X width={16} height={16} />\n </Button>\n </div>\n );\n },\n);\n\nexport const DialogHeading = React.forwardRef<HTMLHeadingElement, React.HTMLProps<HTMLHeadingElement>>(\n ({children, ...props}, ref) => {\n const context = useDialogContext();\n const styles = useStyles();\n const id = useId();\n\n React.useLayoutEffect(() => {\n context.setLabelId(id);\n return () => context.setLabelId(undefined);\n }, [id, context.setLabelId]);\n\n return (\n <div style={styles.header}>\n <h2 {...props} ref={ref} id={id} style={styles.headerTitle}>\n {children}\n </h2>\n <Button color=\"tertiary\" variant=\"text\" size=\"small\" onClick={() => context.setOpen(false)} aria-label=\"Close\">\n <X width={16} height={16} />\n </Button>\n </div>\n );\n },\n);\n\nexport const PopoverDescription = React.forwardRef<HTMLParagraphElement, React.HTMLProps<HTMLParagraphElement>>(\n ({children, ...props}, ref) => {\n const context = usePopoverContext();\n const id = useId();\n\n React.useLayoutEffect(() => {\n context.setDescriptionId(id);\n return () => context.setDescriptionId(undefined);\n }, [id, context.setDescriptionId]);\n\n return (\n <p {...props} ref={ref} id={id}>\n {children}\n </p>\n );\n },\n);\n\nexport const DialogDescription = React.forwardRef<HTMLParagraphElement, React.HTMLProps<HTMLParagraphElement>>(\n ({children, ...props}, ref) => {\n const context = useDialogContext();\n const id = useId();\n\n React.useLayoutEffect(() => {\n context.setDescriptionId(id);\n return () => context.setDescriptionId(undefined);\n }, [id, context.setDescriptionId]);\n\n return (\n <p {...props} ref={ref} id={id}>\n {children}\n </p>\n );\n },\n);\n\nexport const PopoverClose = React.forwardRef<HTMLButtonElement, React.ButtonHTMLAttributes<HTMLButtonElement>>(\n (props, ref) => {\n const context = usePopoverContext();\n return <button type=\"button\" {...props} ref={ref} onClick={() => context.setOpen(false)} />;\n },\n);\n\nexport const DialogClose = React.forwardRef<HTMLButtonElement, React.ButtonHTMLAttributes<HTMLButtonElement>>(\n (props, ref) => {\n const context = useDialogContext();\n return <button type=\"button\" {...props} ref={ref} onClick={() => context.setOpen(false)} />;\n },\n);\n\n// Legacy API compatibility (for existing code)\ninterface LegacyPopoverProps {\n children: React.ReactNode;\n className?: string;\n isOpen: boolean;\n mode?: 'modal' | 'dropdown';\n offset?: number;\n onClose: () => void;\n placement?: 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';\n trigger?: HTMLElement | null;\n}\n\n// Legacy Header component for backward compatibility\nconst LegacyPopoverHeader: React.FC<{children?: React.ReactNode}> = ({children}) => {\n const styles = useStyles();\n\n return <div style={styles.header}>{children && <h3 style={styles.headerTitle}>{children}</h3>}</div>;\n};\n\n// Legacy Content component for backward compatibility\nconst LegacyPopoverContent: React.FC<{children: React.ReactNode}> = ({children}) => {\n const styles = useStyles();\n return <div style={styles.contentBody}>{children}</div>;\n};\n\n// Legacy component for backward compatibility\nexport const LegacyPopover: React.FC<LegacyPopoverProps> & {\n Content: typeof LegacyPopoverContent;\n Header: typeof LegacyPopoverHeader;\n} = ({isOpen, children, onClose, className = '', mode = 'modal', trigger, placement, offset}) => {\n if (mode === 'modal') {\n return (\n <Dialog open={isOpen} onOpenChange={onClose}>\n <DialogContent className={className}>{children}</DialogContent>\n </Dialog>\n );\n }\n\n return (\n <Popover open={isOpen} onOpenChange={onClose} placement={placement} offset={offset}>\n <PopoverContent className={className}>{children}</PopoverContent>\n </Popover>\n );\n};\n\nLegacyPopover.Header = LegacyPopoverHeader;\nLegacyPopover.Content = LegacyPopoverContent;\n\n// Export the legacy component as default for backward compatibility\nexport default LegacyPopover;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * LogOut icon component.\n */\nconst LogOut: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m16 17 5-5-5-5\" />\n <path d=\"M21 12H9\" />\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\" />\n </svg>\n);\n\nexport default LogOut;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * Plus (add) icon component.\n */\nconst Plus: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n);\n\nexport default Plus;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * User icon component.\n */\nconst User: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n);\n\nexport default User;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, SVGProps} from 'react';\n\n/**\n * X (close) icon component.\n */\nconst X: FC<SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n);\n\nexport default X;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {CSSProperties, FC, ReactNode, useCallback, useState, useMemo} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport clsx from 'clsx';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\nimport TextField from '../TextField/TextField';\nimport DatePicker from '../DatePicker/DatePicker';\nimport Checkbox from '../Checkbox/Checkbox';\nimport Button from '../Button/Button';\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\n\nexport interface MultiInputProps {\n /**\n * Label text to display above the inputs\n */\n label?: string;\n /**\n * Error message to display below the inputs\n */\n error?: string;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n /**\n * Helper text to display below the inputs\n */\n helperText?: string;\n /**\n * Placeholder text for input fields\n */\n placeholder?: string;\n /**\n * Array of values\n */\n values: string[];\n /**\n * Callback when values change\n */\n onChange: (values: string[]) => void;\n /**\n * Custom style object\n */\n style?: CSSProperties;\n /**\n * Input type\n */\n type?: 'text' | 'email' | 'tel' | 'url' | 'password' | 'date' | 'boolean';\n /**\n * Field type for different input components\n */\n fieldType?: 'STRING' | 'DATE_TIME' | 'BOOLEAN';\n /**\n * Icon to display at the start (left) of each input\n */\n startIcon?: ReactNode;\n /**\n * Icon to display at the end (right) of each input (in addition to add/remove buttons)\n */\n endIcon?: ReactNode;\n /**\n * Minimum number of fields to show (default: 1)\n */\n minFields?: number;\n /**\n * Maximum number of fields to allow (default: unlimited)\n */\n maxFields?: number;\n}\n\nconst useStyles = () => {\n const {theme} = useTheme();\n\n return useMemo(\n () => ({\n container: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: `${theme.spacing.unit}px`,\n },\n inputRow: {\n display: 'flex',\n alignItems: 'center',\n gap: `${theme.spacing.unit}px`,\n position: 'relative' as const,\n },\n inputWrapper: {\n flex: 1,\n },\n plusIcon: {\n background: 'var(--asgardeo-color-secondary-main)',\n borderRadius: '50%',\n outline: '4px var(--asgardeo-color-secondary-main) auto',\n color: 'var(--asgardeo-color-secondary-contrastText)',\n },\n listContainer: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: `${theme.spacing.unit * 0}px`,\n },\n listItem: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: `${theme.spacing.unit}px ${theme.spacing.unit * 1.5}px`,\n backgroundColor: theme.colors.background.surface,\n borderRadius: theme.borderRadius.medium,\n fontSize: '1rem',\n color: theme.colors.text.primary,\n },\n removeButton: {\n padding: `${theme.spacing.unit / 2}px`,\n minWidth: 'auto',\n color: theme.colors.error.main,\n },\n }),\n [theme],\n );\n};\n\nconst MultiInput: FC<MultiInputProps> = ({\n label,\n error,\n required,\n className,\n disabled,\n helperText,\n placeholder = 'Enter value',\n values = [],\n onChange,\n style = {},\n type = 'text',\n fieldType = 'STRING',\n startIcon,\n endIcon,\n minFields = 1,\n maxFields,\n}) => {\n const styles = useStyles();\n\n const PlusIcon = ({style}) => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={style}\n >\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n );\n\n const BinIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14ZM10 11v6M14 11v6\" />\n </svg>\n );\n\n const handleAddValue = useCallback(\n (newValue: string) => {\n if (newValue.trim() !== '' && (!maxFields || values.length < maxFields)) {\n onChange([...values, newValue.trim()]);\n }\n },\n [values, onChange, maxFields],\n );\n\n const handleRemoveValue = useCallback(\n (index: number) => {\n if (values.length > minFields) {\n const updatedValues = values.filter((_, i) => i !== index);\n onChange(updatedValues);\n }\n },\n [values, onChange, minFields],\n );\n\n const renderInputField = useCallback(\n (\n value: string,\n onValueChange: (value: string) => void,\n attachedEndIcon?: ReactNode,\n onEndIconClick?: () => void,\n ) => {\n const handleInputChange = (e: any) => {\n const newValue = e.target ? e.target.value : e;\n onValueChange(newValue);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' && onEndIconClick) {\n e.preventDefault();\n onEndIconClick();\n }\n };\n\n const finalEndIcon = attachedEndIcon || endIcon;\n\n const commonProps = {\n value,\n onChange: handleInputChange,\n onKeyDown: handleKeyDown,\n placeholder,\n disabled,\n startIcon,\n endIcon: finalEndIcon,\n onEndIconClick,\n error,\n };\n\n switch (fieldType) {\n case 'DATE_TIME':\n return <DatePicker {...commonProps} />;\n case 'BOOLEAN':\n return (\n <Checkbox\n {...commonProps}\n checked={value === 'true' || Boolean(value)}\n onChange={(e: any) => onValueChange(e.target.checked ? 'true' : 'false')}\n />\n );\n default:\n return <TextField {...commonProps} type={type} />;\n }\n },\n [placeholder, disabled, startIcon, endIcon, error, fieldType, type],\n );\n\n const canAddMore = !maxFields || values.length < maxFields;\n const canRemove = values.length > minFields;\n\n // State for the current input value\n const [currentInputValue, setCurrentInputValue] = useState('');\n\n const handleInputSubmit = useCallback(() => {\n if (currentInputValue.trim() !== '') {\n handleAddValue(currentInputValue);\n setCurrentInputValue('');\n }\n }, [currentInputValue, handleAddValue]);\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={clsx(withVendorCSSClassPrefix('multi-input'), className)}\n style={style}\n >\n {label && (\n <InputLabel required={required} error={!!error}>\n {label}\n </InputLabel>\n )}\n <div style={styles.container}>\n {/* Input field at the top */}\n <div style={styles.inputRow}>\n <div style={styles.inputWrapper}>\n {renderInputField(\n currentInputValue,\n setCurrentInputValue,\n canAddMore ? <PlusIcon style={styles.plusIcon} /> : undefined,\n canAddMore ? handleInputSubmit : undefined,\n )}\n </div>\n </div>\n\n {/* List of added items */}\n {values.length > 0 && (\n <div style={styles.listContainer}>\n {values.map((value, index) => (\n <div key={index} style={styles.listItem}>\n <span>{value}</span>\n {canRemove && (\n <Button\n size=\"small\"\n color=\"secondary\"\n variant=\"text\"\n onClick={() => handleRemoveValue(index)}\n disabled={disabled}\n title=\"Remove value\"\n style={styles.removeButton}\n >\n <BinIcon />\n </Button>\n )}\n </div>\n ))}\n </div>\n )}\n </div>\n </FormControl>\n );\n};\n\nexport default MultiInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n User,\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n updateMeProfile as baseUpdateMeProfile,\n UpdateMeProfileConfig as BaseUpdateMeProfileConfig,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the updateMeProfile request (React-specific)\n */\nexport interface UpdateMeProfileConfig extends Omit<BaseUpdateMeProfileConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Updates the user profile information at the specified SCIM2 Me endpoint.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object with URL, payload and optional request config.\n * @returns A promise that resolves with the updated user profile information.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * await updateMeProfile({\n * url: \"https://api.asgardeo.io/t/<ORG>/scim2/Me\",\n * payload: { \"urn:scim:wso2:schema\": { mobileNumbers: [\"0777933830\"] } }\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * await updateMeProfile({\n * url: \"https://api.asgardeo.io/t/<ORG>/scim2/Me\",\n * payload: { \"urn:scim:wso2:schema\": { mobileNumbers: [\"0777933830\"] } },\n * fetcher: customFetchFunction\n * });\n * ```\n */\nconst updateMeProfile = async ({fetcher, ...requestConfig}: UpdateMeProfileConfig): Promise<User> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'PATCH',\n headers: config.headers as Record<string, string>,\n data: config.body ? JSON.parse(config.body as string) : undefined,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseUpdateMeProfile({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default updateMeProfile;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, ReactElement} from 'react';\nimport BaseUserProfile, {BaseUserProfileProps} from './BaseUserProfile';\nimport updateMeProfile from '../../../api/updateMeProfile';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useUser from '../../../contexts/User/useUser';\nimport {User} from '@asgardeo/browser';\n\n/**\n * Props for the UserProfile component.\n * Extends BaseUserProfileProps but makes the user prop optional since it will be obtained from useAsgardeo\n */\nexport type UserProfileProps = Omit<BaseUserProfileProps, 'user' | 'profile' | 'flattenedProfile' | 'schemas'>;\n\n/**\n * UserProfile component displays the authenticated user's profile information in a\n * structured and styled format. It shows user details such as display name, email,\n * username, and other available profile information from Asgardeo.\n *\n * This component is the React-specific implementation that uses the BaseUserProfile\n * and automatically retrieves the user data from Asgardeo context if not provided.\n *\n * @example\n * ```tsx\n * // Basic usage - will use user from Asgardeo context\n * <UserProfile />\n *\n * // With explicit user data\n * <UserProfile user={specificUser} />\n *\n * // With card layout and custom fallback\n * <UserProfile\n * cardLayout={true}\n * fallback={<div>Please sign in to view your profile</div>}\n * />\n * ```\n */\nconst UserProfile: FC<UserProfileProps> = ({...rest}: UserProfileProps): ReactElement => {\n const {baseUrl} = useAsgardeo();\n const {profile, flattenedProfile, schemas, onUpdateProfile} = useUser();\n\n const handleProfileUpdate = async (payload: any): Promise<void> => {\n const response: User = await updateMeProfile({baseUrl, payload});\n\n onUpdateProfile(response);\n };\n\n return (\n <BaseUserProfile\n profile={profile}\n flattenedProfile={flattenedProfile}\n schemas={schemas}\n onUpdate={handleProfileUpdate}\n {...rest}\n />\n );\n};\n\nexport default UserProfile;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport {\n useFloating,\n autoUpdate,\n offset,\n flip,\n shift,\n useClick,\n useDismiss,\n useRole,\n useInteractions,\n FloatingFocusManager,\n FloatingPortal,\n} from '@floating-ui/react';\nimport clsx from 'clsx';\nimport {CSSProperties, FC, ReactElement, ReactNode, useMemo, useRef, useState} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport getMappedUserProfileValue from '../../../utils/getMappedUserProfileValue';\nimport {Avatar} from '../../primitives/Avatar/Avatar';\nimport Button from '../../primitives/Button/Button';\nimport LogOut from '../../primitives/Icons/LogOut';\nimport User from '../../primitives/Icons/User';\nimport Typography from '../../primitives/Typography/Typography';\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n trigger: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} * 0.5)`,\n border: 'none',\n backgroundColor: 'none',\n cursor: 'pointer',\n borderRadius: theme.vars.borderRadius.medium,\n '&:hover': {\n backgroundColor: theme.vars.colors.background.surface,\n },\n } as CSSProperties,\n userName: {\n color: theme.vars.colors.text.primary,\n fontWeight: 500,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n maxWidth: '120px',\n } as CSSProperties,\n dropdownContent: {\n minWidth: '270px',\n maxWidth: '500px',\n backgroundColor: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.medium,\n boxShadow: theme.vars.shadows.medium,\n border: `1px solid ${theme.vars.colors.border}`,\n outline: 'none',\n zIndex: 1000,\n } as CSSProperties,\n dropdownMenu: {\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n } as CSSProperties,\n menuItem: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 2)`,\n width: '100%',\n color: theme.vars.colors.text.primary,\n textDecoration: 'none',\n border: 'none',\n backgroundColor: 'none',\n cursor: 'pointer',\n fontSize: '0.875rem',\n textAlign: 'left',\n borderRadius: theme.vars.borderRadius.medium,\n transition: 'background-color 0.15s ease-in-out',\n } as CSSProperties,\n menuItemAnchor: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 2)`,\n width: '100%',\n color: theme.vars.colors.text.primary,\n textDecoration: 'none',\n border: 'none',\n background: 'none',\n cursor: 'pointer',\n fontSize: '0.875rem',\n textAlign: 'left',\n borderRadius: theme.vars.borderRadius.medium,\n transition: 'background-color 0.15s ease-in-out',\n } as CSSProperties,\n divider: {\n margin: `calc(${theme.vars.spacing.unit} * 0.5) 0`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n } as CSSProperties,\n dropdownHeader: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} * 1.5)`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n } as CSSProperties,\n headerInfo: {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme.vars.spacing.unit} / 4)`,\n flex: 1,\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n } as CSSProperties,\n headerName: {\n color: theme.vars.colors.text.primary,\n fontSize: '1rem',\n fontWeight: 500,\n margin: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n } as CSSProperties,\n headerEmail: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n margin: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n } as CSSProperties,\n loadingContainer: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: '80px',\n gap: theme.vars.spacing.unit,\n } as CSSProperties,\n loadingText: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\ninterface MenuItem {\n href?: string;\n icon?: ReactNode;\n label: ReactNode;\n onClick?: () => void;\n}\n\nexport interface BaseUserDropdownProps {\n /**\n * Mapping of component attribute names to identity provider field names.\n * Allows customizing which user profile fields should be used for each attribute.\n */\n attributeMapping?: {\n [key: string]: string | string[] | undefined;\n firstName?: string | string[];\n lastName?: string | string[];\n picture?: string | string[];\n username?: string | string[];\n };\n /**\n * Optional size for the avatar\n */\n avatarSize?: number;\n /**\n * Optional className for the dropdown container.\n */\n className?: string;\n /**\n * Optional element to render when no user is signed in.\n */\n fallback?: ReactElement;\n /**\n * Whether the user data is currently loading\n */\n isLoading?: boolean;\n /**\n * Menu items to display in the dropdown\n */\n menuItems?: MenuItem[];\n /**\n * Callback function for \"Manage Profile\" action\n */\n onManageProfile?: () => void;\n /**\n * Callback function for \"Sign Out\" action\n */\n onSignOut?: () => void;\n /**\n * The HTML element ID where the portal should be mounted\n */\n portalId?: string;\n /**\n * Show dropdown header with user information\n */\n showDropdownHeader?: boolean;\n /**\n * Show user's display name next to avatar in the trigger button\n */\n showTriggerLabel?: boolean;\n /**\n * The user object containing profile information\n */\n user: any;\n}\n\n/**\n * BaseUserDropdown component displays a user avatar with a dropdown menu.\n * When clicked, it shows a popover with customizable menu items.\n * This component serves as the base for framework-specific implementations.\n */\nexport const BaseUserDropdown: FC<BaseUserDropdownProps> = ({\n fallback = null,\n className = '',\n user,\n isLoading = false,\n portalId = 'asgardeo-user-dropdown',\n menuItems = [],\n showTriggerLabel = false,\n avatarSize = 32,\n onManageProfile,\n onSignOut,\n attributeMapping = {},\n}): ReactElement => {\n const styles = useStyles();\n const [isOpen, setIsOpen] = useState(false);\n const [hoveredItemIndex, setHoveredItemIndex] = useState<number | null>(null);\n const {theme, colorScheme} = useTheme();\n\n const {refs, floatingStyles, context} = useFloating({\n open: isOpen,\n onOpenChange: setIsOpen,\n placement: 'bottom-end',\n middleware: [offset(5), flip({fallbackAxisSideDirection: 'end'}), shift({padding: 5})],\n whileElementsMounted: autoUpdate,\n });\n\n const click = useClick(context);\n const dismiss = useDismiss(context);\n const role = useRole(context);\n\n const {getReferenceProps, getFloatingProps} = useInteractions([click, dismiss, role]);\n\n const defaultAttributeMappings = {\n picture: ['profile', 'profileUrl', 'picture', 'URL'],\n firstName: ['name.givenName', 'given_name'],\n lastName: ['name.familyName', 'family_name'],\n email: ['emails'],\n username: ['userName', 'username', 'user_name'],\n };\n\n const mergedMappings = {...defaultAttributeMappings, ...attributeMapping};\n\n const getDisplayName = () => {\n const firstName = getMappedUserProfileValue('firstName', mergedMappings, user);\n const lastName = getMappedUserProfileValue('lastName', mergedMappings, user);\n\n if (firstName && lastName) {\n return `${firstName} ${lastName}`;\n }\n\n return getMappedUserProfileValue('username', mergedMappings, user) || '';\n };\n\n if (fallback && !user && !isLoading) {\n return fallback;\n }\n\n const handleMenuItemClick = (item: MenuItem) => {\n if (item.onClick) {\n item.onClick();\n }\n setIsOpen(false);\n };\n\n // Create default menu items\n const defaultMenuItems: MenuItem[] = [];\n\n if (onManageProfile) {\n defaultMenuItems.push({\n label: 'Manage Profile',\n onClick: onManageProfile,\n icon: <User width=\"16\" height=\"16\" />,\n });\n }\n\n if (onSignOut) {\n defaultMenuItems.push({\n label: 'Sign Out',\n onClick: onSignOut,\n icon: <LogOut width=\"16\" height=\"16\" />,\n });\n }\n\n // Merge custom menu items with default ones\n const allMenuItems = [...menuItems];\n if (defaultMenuItems.length > 0) {\n // Add divider before default items if there are custom items\n if (menuItems.length > 0) {\n allMenuItems.push({label: '', onClick: undefined}); // Divider placeholder\n }\n allMenuItems.push(...defaultMenuItems);\n }\n\n return (\n <div className={clsx(withVendorCSSClassPrefix('user-dropdown'), className)}>\n <Button\n ref={refs.setReference}\n className={withVendorCSSClassPrefix('user-dropdown__trigger')}\n style={styles.trigger}\n color=\"tertiary\"\n variant=\"text\"\n size=\"medium\"\n {...getReferenceProps()}\n >\n <Avatar\n imageUrl={getMappedUserProfileValue('picture', mergedMappings, user)}\n name={getDisplayName()}\n size={avatarSize}\n alt={`${getDisplayName()}'s avatar`}\n />\n {showTriggerLabel && (\n <Typography\n variant=\"body2\"\n className={withVendorCSSClassPrefix('user-dropdown__trigger-label')}\n style={styles.userName}\n >\n {getDisplayName()}\n </Typography>\n )}\n </Button>\n\n {isOpen && (\n <FloatingPortal id={portalId}>\n <FloatingFocusManager context={context} modal={false}>\n <div\n ref={refs.setFloating}\n className={withVendorCSSClassPrefix('user-dropdown__content')}\n style={{...floatingStyles, ...styles.dropdownContent}}\n {...getFloatingProps()}\n >\n <div className={withVendorCSSClassPrefix('user-dropdown__header')} style={styles.dropdownHeader}>\n <Avatar\n imageUrl={getMappedUserProfileValue('picture', mergedMappings, user)}\n name={getDisplayName()}\n size={avatarSize * 1.25}\n alt={`${getDisplayName()}'s avatar`}\n />\n <div className={withVendorCSSClassPrefix('user-dropdown__header-info')} style={styles.headerInfo}>\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('user-dropdown__header-name')}\n variant=\"body1\"\n fontWeight=\"medium\"\n >\n {getDisplayName()}\n </Typography>\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('user-dropdown__header-email')}\n variant=\"caption\"\n color=\"secondary\"\n >\n {getMappedUserProfileValue('username', mergedMappings, user) ||\n getMappedUserProfileValue('email', mergedMappings, user)}\n </Typography>\n </div>\n </div>\n <div className={withVendorCSSClassPrefix('user-dropdown__menu')} style={styles.dropdownMenu}>\n {allMenuItems.map((item, index) => (\n <div key={index}>\n {item.label === '' ? (\n // Render divider for empty label placeholder\n <div className={withVendorCSSClassPrefix('user-dropdown__menu-divider')} style={styles.divider} />\n ) : item.href ? (\n <a\n href={item.href}\n style={{\n ...styles.menuItemAnchor,\n backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : 'transparent',\n }}\n className={withVendorCSSClassPrefix('user-dropdown__menu-item')}\n onMouseEnter={() => setHoveredItemIndex(index)}\n onMouseLeave={() => setHoveredItemIndex(null)}\n onFocus={() => setHoveredItemIndex(index)}\n onBlur={() => setHoveredItemIndex(null)}\n >\n {item.icon}\n <span>{item.label}</span>\n </a>\n ) : (\n <Button\n onClick={() => handleMenuItemClick(item)}\n style={{\n ...styles.menuItem,\n backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : 'transparent',\n }}\n className={withVendorCSSClassPrefix('user-dropdown__menu-item')}\n color=\"tertiary\"\n variant=\"text\"\n size=\"small\"\n startIcon={item.icon}\n onMouseEnter={() => setHoveredItemIndex(index)}\n onMouseLeave={() => setHoveredItemIndex(null)}\n >\n {item.label}\n </Button>\n )}\n </div>\n ))}\n </div>\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n )}\n </div>\n );\n};\n\nexport default BaseUserDropdown;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, ReactElement, ReactNode, useState} from 'react';\nimport BaseUserDropdown, {BaseUserDropdownProps} from './BaseUserDropdown';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport UserProfile from '../UserProfile/UserProfile';\n\n/**\n * Render props data passed to the children function\n */\nexport interface UserDropdownRenderProps {\n /** Function to close the profile dialog */\n closeProfile: () => void;\n /** Whether user data is currently loading */\n isLoading: boolean;\n /** Whether the profile dialog is currently open */\n isProfileOpen: boolean;\n /** Function to open the user profile dialog */\n openProfile: () => void;\n /** Function to sign out the user */\n signOut: () => void;\n /** The authenticated user object */\n user: any;\n}\n\n/**\n * Props for the UserDropdown component.\n * Extends BaseUserDropdownProps but excludes user, onManageProfile, and onSignOut since they're handled internally\n */\nexport type UserDropdownProps = Omit<BaseUserDropdownProps, 'user' | 'onManageProfile'> & {\n /**\n * Render prop function that receives user state and actions.\n * When provided, this completely replaces the default dropdown rendering.\n */\n children?: (props: UserDropdownRenderProps) => ReactNode;\n /**\n * Custom render function for the dropdown content.\n * When provided, this replaces just the dropdown content while keeping the trigger.\n */\n renderDropdown?: (props: UserDropdownRenderProps) => ReactNode;\n /**\n * Custom render function for the trigger button.\n * When provided, this replaces just the trigger button while keeping the dropdown.\n */\n renderTrigger?: (props: UserDropdownRenderProps) => ReactNode;\n};\n\n/**\n * UserDropdown component displays a user avatar with a dropdown menu.\n * When clicked, it shows a popover with customizable menu items.\n * This component is the React-specific implementation that uses the BaseUserDropdown\n * and automatically retrieves the user data from Asgardeo context.\n *\n * Supports render props for complete customization of the dropdown appearance and behavior.\n *\n * @example\n * ```tsx\n * // Basic usage - will use user from Asgardeo context\n * <UserDropdown menuItems={[\n * { label: 'Profile', onClick: () => {} },\n * { label: 'Settings', href: '/settings' },\n * { label: 'Sign Out', onClick: () => {} }\n * ]} />\n *\n * // With custom configuration\n * <UserDropdown\n * showTriggerLabel={true}\n * avatarSize={40}\n * fallback={<div>Please sign in</div>}\n * />\n *\n * // Using render props for complete customization\n * <UserDropdown>\n * {({ user, isLoading, openProfile, signOut }) => (\n * <div>\n * <button onClick={openProfile}>\n * {user?.name || 'Loading...'}\n * </button>\n * <button onClick={signOut}>Logout</button>\n * </div>\n * )}\n * </UserDropdown>\n *\n * // Using partial render props\n * <UserDropdown\n * renderTrigger={({ user, openProfile }) => (\n * <button onClick={openProfile} className=\"custom-trigger\">\n * Welcome, {user?.name}!\n * </button>\n * )}\n * />\n * ```\n */\nconst UserDropdown: FC<UserDropdownProps> = ({\n children,\n renderTrigger,\n renderDropdown,\n onSignOut,\n ...rest\n}: UserDropdownProps): ReactElement => {\n const {user, isLoading, signOut} = useAsgardeo();\n const [isProfileOpen, setIsProfileOpen] = useState(false);\n\n const handleManageProfile = () => {\n setIsProfileOpen(true);\n };\n\n const handleSignOut = () => {\n signOut();\n onSignOut && onSignOut();\n };\n\n const closeProfile = () => {\n setIsProfileOpen(false);\n };\n\n // Prepare render props data\n const renderProps: UserDropdownRenderProps = {\n user,\n isLoading: isLoading as boolean,\n openProfile: handleManageProfile,\n signOut: handleSignOut,\n isProfileOpen,\n closeProfile,\n };\n\n // If children render prop is provided, use it for complete customization\n if (children) {\n return (\n <>\n {children(renderProps)}\n <UserProfile mode=\"popup\" open={isProfileOpen} onOpenChange={setIsProfileOpen} />\n </>\n );\n }\n\n // If partial render props are provided, customize specific parts\n if (renderTrigger || renderDropdown) {\n // This would require significant changes to BaseUserDropdown to support partial customization\n // For now, we'll provide a simple implementation that shows how it could work\n return (\n <>\n {renderTrigger ? (\n renderTrigger(renderProps)\n ) : (\n <BaseUserDropdown\n user={user}\n isLoading={isLoading}\n onManageProfile={handleManageProfile}\n onSignOut={handleSignOut}\n {...rest}\n />\n )}\n {/* Note: renderDropdown would need BaseUserDropdown modifications to implement properly */}\n <UserProfile mode=\"popup\" open={isProfileOpen} onOpenChange={setIsProfileOpen} />\n </>\n );\n }\n\n // Default behavior - use BaseUserDropdown as before\n return (\n <>\n <BaseUserDropdown\n user={user}\n isLoading={isLoading}\n onManageProfile={handleManageProfile}\n onSignOut={handleSignOut}\n {...rest}\n />\n {isProfileOpen && <UserProfile mode=\"popup\" open={isProfileOpen} onOpenChange={setIsProfileOpen} />}\n </>\n );\n};\n\nexport default UserDropdown;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport {\n useFloating,\n autoUpdate,\n offset,\n flip,\n shift,\n useClick,\n useDismiss,\n useRole,\n useInteractions,\n FloatingFocusManager,\n FloatingPortal,\n} from '@floating-ui/react';\nimport clsx from 'clsx';\nimport {CSSProperties, FC, ReactElement, ReactNode, useMemo, useState} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport useTranslation from '../../../hooks/useTranslation';\nimport {Avatar} from '../../primitives/Avatar/Avatar';\nimport Button from '../../primitives/Button/Button';\nimport Building from '../../primitives/Icons/Building';\nimport Check from '../../primitives/Icons/Check';\nimport ChevronDown from '../../primitives/Icons/ChevronDown';\nimport Typography from '../../primitives/Typography/Typography';\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n trigger: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} * 0.75) ${theme.vars.spacing.unit}`,\n border: `1px solid ${theme.vars.colors.border}`,\n background: theme.vars.colors.background.surface,\n cursor: 'pointer',\n borderRadius: theme.vars.borderRadius.medium,\n minWidth: '160px',\n '&:hover': {\n backgroundColor: theme.vars.colors.background.surface,\n },\n } as CSSProperties,\n orgName: {\n color: theme.vars.colors.text.primary,\n fontWeight: 500,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n flex: 1,\n } as CSSProperties,\n dropdownContent: {\n minWidth: '280px',\n maxWidth: '400px',\n backgroundColor: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.medium,\n boxShadow: theme.vars.shadows.medium,\n border: `1px solid ${theme.vars.colors.border}`,\n outline: 'none',\n zIndex: 1000,\n } as CSSProperties,\n dropdownMenu: {\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n } as CSSProperties,\n menuItem: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 2)`,\n width: '100%',\n color: theme.vars.colors.text.primary,\n textDecoration: 'none',\n border: 'none',\n backgroundColor: 'none',\n cursor: 'pointer',\n fontSize: '0.875rem',\n textAlign: 'left',\n borderRadius: theme.vars.borderRadius.medium,\n transition: 'background-color 0.15s ease-in-out',\n '&:hover': {\n backgroundColor: theme.vars.colors.action?.hover || 'rgba(0, 0, 0, 0.04)',\n },\n } as CSSProperties,\n organizationInfo: {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme.vars.spacing.unit} / 4)`,\n flex: 1,\n minWidth: 0,\n overflow: 'hidden',\n } as CSSProperties,\n organizationName: {\n color: theme.vars.colors.text.primary,\n fontSize: '0.875rem',\n fontWeight: 500,\n margin: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n } as CSSProperties,\n organizationMeta: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.75rem',\n margin: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n } as CSSProperties,\n divider: {\n margin: `calc(${theme.vars.spacing.unit} * 0.5) 0`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n } as CSSProperties,\n dropdownHeader: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n padding: `${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n loadingContainer: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: '80px',\n gap: theme.vars.spacing.unit,\n } as CSSProperties,\n loadingText: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n } as CSSProperties,\n errorContainer: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: '80px',\n padding: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n errorText: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n textAlign: 'center',\n } as CSSProperties,\n manageButton: {\n minWidth: 'auto',\n marginLeft: 'auto',\n } as CSSProperties,\n roleCapitalized: {\n textTransform: 'capitalize',\n } as CSSProperties,\n sectionHeader: {\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n color: theme.vars.colors.text.secondary,\n } as CSSProperties,\n sectionHeaderContainer: {\n borderTop: 'none',\n borderBottom: 'none',\n paddingBottom: `calc(${theme.vars.spacing.unit} / 2)`,\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\ninterface MenuItem {\n href?: string;\n icon?: ReactNode;\n label: ReactNode;\n onClick?: () => void;\n}\n\n/**\n * Interface for organization data.\n */\nexport interface Organization {\n /**\n * Avatar URL for the organization.\n */\n avatar?: string;\n /**\n * Unique identifier for the organization.\n */\n id: string;\n /**\n * Number of members in the organization.\n */\n memberCount?: number;\n /**\n * Additional metadata for the organization.\n */\n metadata?: Record<string, any>;\n /**\n * Display name of the organization.\n */\n name: string;\n /**\n * User's role in the organization.\n */\n role?: 'owner' | 'admin' | 'member';\n /**\n * URL slug for the organization.\n */\n slug?: string;\n}\n\n/**\n * Props interface for the BaseOrganizationSwitcher component.\n */\nexport interface BaseOrganizationSwitcherProps {\n /**\n * Optional size for the avatar\n */\n avatarSize?: number;\n /**\n * Custom class name for styling.\n */\n className?: string;\n /**\n * Currently selected organization.\n */\n currentOrganization?: Organization;\n /**\n * Error message to display.\n */\n error?: string;\n /**\n * Optional element to render when no organization is selected.\n */\n fallback?: ReactElement;\n /**\n * Whether the component is in a loading state.\n */\n loading?: boolean;\n /**\n * Additional menu items to display at the bottom of the dropdown.\n */\n menuItems?: MenuItem[];\n /**\n * Handler for when an organization is selected.\n */\n onOrganizationSwitch: (organization: Organization) => void;\n /**\n * Handler for when the manage profile button is clicked.\n */\n onManageProfile?: () => void;\n /**\n * List of available organizations.\n */\n organizations: Organization[];\n /**\n * The HTML element ID where the portal should be mounted\n */\n portalId?: string;\n /**\n * Custom render function for the error state.\n */\n renderError?: (error: string) => ReactElement;\n /**\n * Custom render function for the loading state.\n */\n renderLoading?: () => ReactElement;\n /**\n * Custom render function for the organization item.\n */\n renderOrganization?: (organization: Organization, isSelected: boolean) => ReactElement;\n /**\n * Whether to show the member count.\n */\n showMemberCount?: boolean;\n /**\n * Whether to show the role badge.\n */\n showRole?: boolean;\n /**\n * Show organization name next to avatar in the trigger button\n */\n showTriggerLabel?: boolean;\n /**\n * Custom styles for the component.\n */\n style?: React.CSSProperties;\n}\n\n/**\n * BaseOrganizationSwitcher component displays an organization selector with a dropdown menu.\n * When clicked, it shows a popover with available organizations to switch between.\n * This component serves as the base for framework-specific implementations.\n */\nexport const BaseOrganizationSwitcher: FC<BaseOrganizationSwitcherProps> = ({\n organizations,\n currentOrganization,\n loading = false,\n error,\n onOrganizationSwitch,\n onManageProfile,\n className = '',\n style,\n renderOrganization,\n renderLoading,\n renderError,\n showRole = false,\n showMemberCount = true,\n menuItems = [],\n portalId = 'asgardeo-organization-switcher',\n showTriggerLabel = true,\n avatarSize = 24,\n fallback = null,\n}): ReactElement => {\n const styles = useStyles();\n const [isOpen, setIsOpen] = useState(false);\n const [hoveredItemIndex, setHoveredItemIndex] = useState<number | null>(null);\n const {theme, colorScheme} = useTheme();\n const {t} = useTranslation();\n\n const {refs, floatingStyles, context} = useFloating({\n open: isOpen,\n onOpenChange: setIsOpen,\n placement: 'bottom-end',\n middleware: [offset(5), flip({fallbackAxisSideDirection: 'end'}), shift({padding: 5})],\n whileElementsMounted: autoUpdate,\n });\n\n const click = useClick(context);\n const dismiss = useDismiss(context);\n const role = useRole(context);\n\n const {getReferenceProps, getFloatingProps} = useInteractions([click, dismiss, role]);\n\n if (fallback && !currentOrganization && !loading && organizations.length === 0) {\n return fallback;\n }\n\n const handleOrganizationSwitch = (organization: Organization): void => {\n onOrganizationSwitch(organization);\n setIsOpen(false);\n };\n\n const handleMenuItemClick = (item: MenuItem): void => {\n if (item.onClick) {\n item.onClick();\n }\n setIsOpen(false);\n };\n\n // Filter out current organization from switchable list\n const switchableOrganizations: Organization[] = organizations.filter(\n (org: Organization): boolean => org.id !== currentOrganization?.id,\n );\n\n const defaultRenderOrganization = (organization: Organization, isSelected: boolean) => (\n <>\n <Avatar\n variant=\"square\"\n imageUrl={organization.avatar}\n name={organization.name}\n size={avatarSize * 1.25}\n alt={`${organization.name} avatar`}\n />\n <div style={styles.organizationInfo}>\n <Typography variant=\"body2\" fontWeight=\"medium\" style={styles.organizationName}>\n {organization.name}\n </Typography>\n <div style={styles.organizationMeta}>\n {showMemberCount && organization.memberCount !== undefined && (\n <span>\n {organization.memberCount}{' '}\n {organization.memberCount === 1 ? t('organization.switcher.member') : t('organization.switcher.members')}\n </span>\n )}\n {showRole && organization.role && showMemberCount && organization.memberCount !== undefined && (\n <span> \u2022 </span>\n )}\n {showRole && organization.role && <span style={styles.roleCapitalized}>{organization.role}</span>}\n </div>\n </div>\n {isSelected && <Check width=\"16\" height=\"16\" color={theme.vars.colors.text.primary} />}\n </>\n );\n\n const defaultRenderLoading = () => (\n <div style={styles.loadingContainer}>\n <Typography variant=\"caption\" style={styles.loadingText}>\n {t('organization.switcher.loading.organizations')}\n </Typography>\n </div>\n );\n\n const defaultRenderError = (errorMessage: string) => (\n <div style={styles.errorContainer}>\n <Typography variant=\"caption\" style={styles.errorText}>\n {errorMessage}\n </Typography>\n </div>\n );\n\n return (\n <div className={clsx(withVendorCSSClassPrefix('organization-switcher'), className)} style={style}>\n <Button\n ref={refs.setReference}\n className={withVendorCSSClassPrefix('organization-switcher__trigger')}\n style={styles.trigger}\n color=\"tertiary\"\n variant=\"outline\"\n size=\"medium\"\n {...getReferenceProps()}\n >\n {currentOrganization ? (\n <>\n <Avatar\n variant=\"square\"\n imageUrl={currentOrganization.avatar}\n name={currentOrganization.name}\n size={avatarSize}\n alt={`${currentOrganization.name} avatar`}\n />\n {showTriggerLabel && (\n <Typography\n variant=\"body2\"\n className={withVendorCSSClassPrefix('organization-switcher__trigger-label')}\n style={styles.orgName}\n >\n {currentOrganization.name}\n </Typography>\n )}\n </>\n ) : (\n <>\n <Building width={avatarSize} height={avatarSize} />\n {showTriggerLabel && (\n <Typography\n variant=\"body2\"\n className={withVendorCSSClassPrefix('organization-switcher__trigger-label')}\n style={styles.orgName}\n >\n {t('organization.switcher.select.organization')}\n </Typography>\n )}\n </>\n )}\n <ChevronDown width=\"16\" height=\"16\" />\n </Button>\n\n {isOpen && (\n <FloatingPortal id={portalId}>\n <FloatingFocusManager context={context} modal={false}>\n <div\n ref={refs.setFloating}\n className={withVendorCSSClassPrefix('organization-switcher__content')}\n style={{...floatingStyles, ...styles.dropdownContent}}\n {...getFloatingProps()}\n >\n {/* Header - Current Organization */}\n {currentOrganization && (\n <div\n className={withVendorCSSClassPrefix('organization-switcher__header')}\n style={styles.dropdownHeader}\n >\n <Avatar\n variant=\"square\"\n imageUrl={currentOrganization.avatar}\n name={currentOrganization.name}\n size={avatarSize * 1.5}\n alt={`${currentOrganization.name} avatar`}\n />\n <div\n className={withVendorCSSClassPrefix('organization-switcher__header-info')}\n style={styles.organizationInfo}\n >\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('organization-switcher__header-name')}\n variant=\"body1\"\n fontWeight=\"medium\"\n style={styles.organizationName}\n >\n {currentOrganization.name}\n </Typography>\n <div style={styles.organizationMeta}>\n {showMemberCount && currentOrganization.memberCount !== undefined && (\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('organization-switcher__header-meta')}\n variant=\"caption\"\n color=\"secondary\"\n >\n {currentOrganization.memberCount}{' '}\n {currentOrganization.memberCount === 1\n ? t('organization.switcher.member')\n : t('organization.switcher.members')}\n {showRole && currentOrganization.role && <span> \u2022 {currentOrganization.role}</span>}\n </Typography>\n )}\n {showRole &&\n currentOrganization.role &&\n (!showMemberCount || currentOrganization.memberCount === undefined) && (\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('organization-switcher__header-role')}\n variant=\"caption\"\n color=\"secondary\"\n style={styles.roleCapitalized}\n >\n {currentOrganization.role}\n </Typography>\n )}\n </div>\n </div>\n {onManageProfile && (\n <Button\n onClick={onManageProfile}\n color=\"tertiary\"\n variant=\"outline\"\n size=\"small\"\n aria-label=\"Manage Organization Profile\"\n style={styles.manageButton}\n endIcon={\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n <path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z\" />\n </svg>\n }\n >\n {t('organization.switcher.manage.button')}\n </Button>\n )}\n </div>\n )}\n\n {/* Section Header for Other Organizations */}\n {organizations.length > 1 && (\n <div\n style={{\n ...styles.dropdownHeader,\n ...styles.sectionHeaderContainer,\n borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : 'none',\n }}\n >\n <Typography variant=\"caption\" fontWeight={600} style={styles.sectionHeader}>\n {t('organization.switcher.switch.organization')}\n </Typography>\n </div>\n )}\n\n {/* Content */}\n <div className={withVendorCSSClassPrefix('organization-switcher__menu')} style={styles.dropdownMenu}>\n {loading ? (\n renderLoading ? (\n renderLoading()\n ) : (\n defaultRenderLoading()\n )\n ) : error ? (\n renderError ? (\n renderError(error)\n ) : (\n defaultRenderError(error)\n )\n ) : (\n <>\n {switchableOrganizations.map((organization: Organization): ReactElement => {\n const isSelected: boolean = false; // Never selected since we exclude current org\n return (\n <Button\n key={organization.id}\n onClick={(): void => handleOrganizationSwitch(organization)}\n className={withVendorCSSClassPrefix('organization-switcher__menu-item')}\n color=\"tertiary\"\n variant=\"text\"\n size=\"small\"\n style={{\n ...styles.menuItem,\n backgroundColor:\n hoveredItemIndex === switchableOrganizations.indexOf(organization)\n ? theme.vars.colors.action?.hover\n : 'transparent',\n }}\n onMouseEnter={(): void => setHoveredItemIndex(switchableOrganizations.indexOf(organization))}\n onMouseLeave={(): void => setHoveredItemIndex(null)}\n >\n {renderOrganization\n ? renderOrganization(organization, isSelected)\n : defaultRenderOrganization(organization, isSelected)}\n </Button>\n );\n })}\n\n {/* Menu Items */}\n {menuItems.length > 0 && (\n <>\n <div\n className={withVendorCSSClassPrefix('organization-switcher__menu-divider')}\n style={styles.divider}\n />\n {menuItems.map(\n (item, index: number): ReactElement => (\n <div key={index}>\n {item.href ? (\n <a\n href={item.href}\n style={{\n ...styles.menuItem,\n backgroundColor:\n hoveredItemIndex === switchableOrganizations.length + index\n ? theme.vars.colors.action?.hover\n : 'transparent',\n }}\n className={withVendorCSSClassPrefix('organization-switcher__menu-item')}\n onMouseEnter={(): void => setHoveredItemIndex(switchableOrganizations.length + index)}\n onMouseLeave={(): void => setHoveredItemIndex(null)}\n onFocus={(): void => setHoveredItemIndex(switchableOrganizations.length + index)}\n onBlur={(): void => setHoveredItemIndex(null)}\n >\n {item.icon}\n <span>{item.label}</span>\n </a>\n ) : (\n <Button\n onClick={(): void => handleMenuItemClick(item)}\n style={{\n ...styles.menuItem,\n backgroundColor:\n hoveredItemIndex === switchableOrganizations.length + index\n ? theme.vars.colors.action?.hover\n : 'transparent',\n }}\n className={withVendorCSSClassPrefix('organization-switcher__menu-item')}\n color=\"tertiary\"\n variant=\"text\"\n size=\"small\"\n startIcon={item.icon}\n onMouseEnter={(): void => setHoveredItemIndex(switchableOrganizations.length + index)}\n onMouseLeave={(): void => setHoveredItemIndex(null)}\n >\n {item.label}\n </Button>\n )}\n </div>\n ),\n )}\n </>\n )}\n </>\n )}\n </div>\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n )}\n </div>\n );\n};\n\nexport default BaseOrganizationSwitcher;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\n\nexport interface BuildingProps {\n /**\n * Color of the icon.\n */\n color?: string;\n /**\n * Height of the icon.\n */\n height?: number | string;\n /**\n * Width of the icon.\n */\n width?: number | string;\n}\n\n/**\n * Building Icon component.\n *\n * @param props - Props injected to the component.\n * @returns Building Icon component.\n */\nconst Building: FC<BuildingProps> = ({color = 'currentColor', height = 24, width = 24}: BuildingProps) => (\n <svg width={width} height={height} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z\"\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path d=\"M6 12h4\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M6 8h4\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M14 8h4\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M14 12h4\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M6 18h4\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M14 18h4\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\nBuilding.displayName = 'Building';\n\nexport default Building;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\n\nexport interface CheckProps {\n /**\n * Color of the icon.\n */\n color?: string;\n /**\n * Height of the icon.\n */\n height?: number | string;\n /**\n * Width of the icon.\n */\n width?: number | string;\n}\n\n/**\n * Check Icon component.\n *\n * @param props - Props injected to the component.\n * @returns Check Icon component.\n */\nconst Check: FC<CheckProps> = ({color = 'currentColor', height = 24, width = 24}: CheckProps) => (\n <svg width={width} height={height} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M20 6 9 17l-5-5\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\nCheck.displayName = 'Check';\n\nexport default Check;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\n\nexport interface ChevronDownProps {\n /**\n * Color of the icon.\n */\n color?: string;\n /**\n * Height of the icon.\n */\n height?: number | string;\n /**\n * Width of the icon.\n */\n width?: number | string;\n}\n\n/**\n * ChevronDown Icon component.\n *\n * @param props - Props injected to the component.\n * @returns ChevronDown Icon component.\n */\nconst ChevronDown: FC<ChevronDownProps> = ({color = 'currentColor', height = 24, width = 24}: ChevronDownProps) => (\n <svg width={width} height={height} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m6 9 6 6 6-6\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\nChevronDown.displayName = 'ChevronDown';\n\nexport default ChevronDown;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, ReactElement, useState} from 'react';\n\nimport BaseOrganizationSwitcher, {BaseOrganizationSwitcherProps, Organization} from './BaseOrganizationSwitcher';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useOrganization from '../../../contexts/Organization/useOrganization';\nimport useTranslation from '../../../hooks/useTranslation';\nimport {CreateOrganization} from '../CreateOrganization/CreateOrganization';\nimport OrganizationProfile from '../OrganizationProfile/OrganizationProfile';\nimport OrganizationList from '../OrganizationList/OrganizationList';\nimport BuildingAlt from '../../primitives/Icons/BuildingAlt';\n\n/**\n * Props interface for the OrganizationSwitcher component.\n * Makes organizations optional since they'll be retrieved from OrganizationContext.\n */\nexport interface OrganizationSwitcherProps\n extends Omit<BaseOrganizationSwitcherProps, 'organizations' | 'currentOrganization' | 'onOrganizationSwitch'> {\n /**\n * Optional override for current organization (will use context if not provided)\n */\n currentOrganization?: Organization;\n /**\n * Fallback element to render when the user is not signed in.\n */\n fallback?: ReactElement;\n /**\n * Optional callback for organization switch (will use context if not provided)\n */\n onOrganizationSwitch?: (organization: Organization) => Promise<void> | void;\n /**\n * Optional override for organizations list (will use context if not provided)\n */\n organizations?: Organization[];\n}\n\n/**\n * OrganizationSwitcher component that provides organization switching functionality.\n * This component automatically retrieves organizations from the OrganizationContext.\n * You can also override the organizations, currentOrganization, and onOrganizationSwitch\n * by passing them as props.\n *\n * @example\n * ```tsx\n * import { OrganizationSwitcher } from '@asgardeo/react';\n *\n * // Basic usage - uses OrganizationContext\n * <OrganizationSwitcher />\n *\n * // With custom organization switch handler\n * <OrganizationSwitcher\n * onOrganizationSwitch={(org) => {\n * console.log('Switching to:', org.name);\n * // Custom logic here\n * }}\n * />\n *\n * // With fallback for unauthenticated users\n * <OrganizationSwitcher\n * fallback={<div>Please sign in to view organizations</div>}\n * />\n * ```\n */\nexport const OrganizationSwitcher: FC<OrganizationSwitcherProps> = ({\n currentOrganization: propCurrentOrganization,\n fallback = null,\n onOrganizationSwitch: propOnOrganizationSwitch,\n organizations: propOrganizations,\n ...props\n}: OrganizationSwitcherProps): ReactElement => {\n const {isSignedIn} = useAsgardeo();\n const {\n currentOrganization: contextCurrentOrganization,\n myOrganizations: contextOrganizations,\n switchOrganization,\n isLoading,\n error,\n } = useOrganization();\n const [isCreateOrgOpen, setIsCreateOrgOpen] = useState(false);\n const [isProfileOpen, setIsProfileOpen] = useState(false);\n const [isOrganizationListOpen, setIsOrganizationListOpen] = useState(false);\n const {t} = useTranslation();\n\n if (!isSignedIn && fallback) {\n return fallback;\n }\n\n if (!isSignedIn) {\n return <></>;\n }\n\n const organizations: Organization[] = propOrganizations || contextOrganizations || [];\n const currentOrganization: Organization | null = propCurrentOrganization || contextCurrentOrganization;\n const onOrganizationSwitch: (organization: Organization) => Promise<void> | void =\n propOnOrganizationSwitch || switchOrganization;\n\n const handleManageOrganizations = (): void => {\n setIsOrganizationListOpen(true);\n };\n\n const handleManageOrganization = (): void => {\n setIsProfileOpen(true);\n };\n\n const defaultMenuItems: Array<{icon?: ReactElement; label: string; onClick: () => void}> = [];\n\n if (currentOrganization) {\n defaultMenuItems.push({\n icon: <BuildingAlt />,\n label: t('organization.switcher.manage.organizations'),\n onClick: handleManageOrganizations,\n });\n }\n\n defaultMenuItems.push({\n icon: (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\">\n <path d=\"M12 5v14m-7-7h14\" />\n </svg>\n ),\n label: t('organization.switcher.create.organization'),\n onClick: (): void => setIsCreateOrgOpen(true),\n });\n\n const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;\n\n return (\n <>\n <BaseOrganizationSwitcher\n organizations={organizations}\n currentOrganization={currentOrganization}\n onOrganizationSwitch={onOrganizationSwitch}\n loading={isLoading}\n error={error}\n menuItems={menuItems}\n onManageProfile={handleManageOrganization}\n {...props}\n />\n <CreateOrganization\n mode=\"popup\"\n open={isCreateOrgOpen}\n onOpenChange={setIsCreateOrgOpen}\n onSuccess={(org: Organization) => {\n if (org && onOrganizationSwitch) {\n onOrganizationSwitch(org);\n }\n setIsCreateOrgOpen(false);\n }}\n />\n {currentOrganization && (\n <OrganizationProfile\n organizationId={currentOrganization.id}\n mode=\"popup\"\n open={isProfileOpen}\n onOpenChange={setIsProfileOpen}\n cardLayout={true}\n loadingFallback={<div>{t('organization.profile.loading')}</div>}\n errorFallback={<div>{t('organization.profile.error')}</div>}\n />\n )}\n <OrganizationList\n mode=\"popup\"\n open={isOrganizationListOpen}\n onOpenChange={setIsOrganizationListOpen}\n title={t('organization.switcher.manage.organizations')}\n onOrganizationSelect={(organization: Organization) => {\n if (onOrganizationSwitch) {\n onOrganizationSwitch(organization);\n }\n setIsOrganizationListOpen(false);\n }}\n />\n </>\n );\n};\n\nexport default OrganizationSwitcher;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, ReactElement, useState} from 'react';\n\nimport {BaseCreateOrganization, BaseCreateOrganizationProps} from './BaseCreateOrganization';\nimport {CreateOrganizationPayload} from '@asgardeo/browser';\nimport createOrganization from '../../../api/createOrganization';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useOrganization from '../../../contexts/Organization/useOrganization';\n\n/**\n * Props interface for the CreateOrganization component.\n */\nexport interface CreateOrganizationProps extends Omit<BaseCreateOrganizationProps, 'onSubmit' | 'loading' | 'error'> {\n /**\n * Fallback element to render when the user is not signed in.\n */\n fallback?: ReactElement;\n /**\n * Custom organization creation handler (will use default API if not provided).\n */\n onCreateOrganization?: (payload: CreateOrganizationPayload) => Promise<any>;\n}\n\n/**\n * CreateOrganization component that provides organization creation functionality.\n * This component automatically integrates with the Asgardeo and Organization contexts.\n *\n * @example\n * ```tsx\n * import { CreateOrganization } from '@asgardeo/react';\n *\n * // Basic usage - uses default API and contexts\n * <CreateOrganization\n * onSuccess={(org) => console.log('Created:', org)}\n * onCancel={() => navigate('/organizations')}\n * />\n *\n * // With custom organization creation handler\n * <CreateOrganization\n * onCreateOrganization={async (payload) => {\n * const result = await myCustomAPI.createOrganization(payload);\n * return result;\n * }}\n * onSuccess={(org) => {\n * console.log('Organization created:', org.name);\n * // Custom success logic here\n * }}\n * />\n *\n * // With fallback for unauthenticated users\n * <CreateOrganization\n * fallback={<div>Please sign in to create an organization</div>}\n * />\n * ```\n */\nexport const CreateOrganization: FC<CreateOrganizationProps> = ({\n onCreateOrganization,\n fallback = null,\n onSuccess,\n defaultParentId,\n ...props\n}: CreateOrganizationProps): ReactElement => {\n const {isSignedIn, baseUrl} = useAsgardeo();\n const {currentOrganization, revalidateMyOrganizations} = useOrganization();\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n // Don't render if not authenticated\n if (!isSignedIn && fallback) {\n return fallback;\n }\n\n if (!isSignedIn) {\n return <></>;\n }\n\n // Use current organization as parent if no defaultParentId provided\n const parentId: string = defaultParentId || currentOrganization?.id || '';\n\n const handleSubmit = async (payload: CreateOrganizationPayload): Promise<void> => {\n setLoading(true);\n setError(null);\n\n try {\n let result: any;\n\n if (onCreateOrganization) {\n // Use the provided custom creation function\n result = await onCreateOrganization(payload);\n } else {\n // Use the default API\n if (!baseUrl) {\n throw new Error('Base URL is required for organization creation');\n }\n result = await createOrganization({\n baseUrl,\n payload: {\n ...payload,\n parentId,\n },\n });\n }\n\n // Refresh organizations list to include the new organization\n await revalidateMyOrganizations();\n\n // Call success callback if provided\n if (onSuccess) {\n onSuccess(result);\n }\n } catch (createError) {\n const errorMessage: string = createError instanceof Error ? createError.message : 'Failed to create organization';\n setError(errorMessage);\n throw createError; // Re-throw to allow form to handle it\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <BaseCreateOrganization\n onSubmit={handleSubmit}\n loading={loading}\n error={error}\n defaultParentId={parentId}\n onSuccess={onSuccess}\n {...props}\n />\n );\n};\n\nexport default CreateOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix, CreateOrganizationPayload} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {ChangeEvent, CSSProperties, FC, ReactElement, ReactNode, useMemo, useState} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport useTranslation from '../../../hooks/useTranslation';\nimport Alert from '../../primitives/Alert/Alert';\nimport Button from '../../primitives/Button/Button';\nimport {Dialog, DialogContent, DialogHeading} from '../../primitives/Popover/Popover';\nimport FormControl from '../../primitives/FormControl/FormControl';\nimport InputLabel from '../../primitives/InputLabel/InputLabel';\nimport TextField from '../../primitives/TextField/TextField';\nimport Typography from '../../primitives/Typography/Typography';\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n root: {\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n minWidth: '600px',\n margin: '0 auto',\n } as CSSProperties,\n card: {\n background: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.large,\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n } as CSSProperties,\n content: {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n form: {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n width: '100%',\n } as CSSProperties,\n header: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} * 1.5)`,\n marginBottom: `calc(${theme.vars.spacing.unit} * 1.5)`,\n } as CSSProperties,\n field: {\n display: 'flex',\n alignItems: 'center',\n padding: `${theme.vars.spacing.unit} 0`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n minHeight: '32px',\n } as CSSProperties,\n textarea: {\n width: '100%',\n padding: `${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 1.5)`,\n border: `1px solid ${theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.medium,\n fontSize: theme.vars.typography.fontSizes.md,\n color: theme.vars.colors.text.primary,\n backgroundColor: theme.vars.colors.background.surface,\n fontFamily: 'inherit',\n minHeight: '80px',\n resize: 'vertical',\n outline: 'none',\n '&:focus': {\n borderColor: theme.vars.colors.primary.main,\n boxShadow: `0 0 0 2px ${theme.vars.colors.primary.main}20`,\n },\n '&:disabled': {\n backgroundColor: theme.vars.colors.background.disabled,\n color: theme.vars.colors.text.secondary,\n cursor: 'not-allowed',\n },\n } as CSSProperties,\n avatarContainer: {\n alignItems: 'flex-start',\n display: 'flex',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n marginBottom: theme.vars.spacing.unit,\n } as CSSProperties,\n actions: {\n display: 'flex',\n gap: theme.vars.spacing.unit,\n justifyContent: 'flex-end',\n paddingTop: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n infoContainer: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: theme.vars.spacing.unit,\n } as CSSProperties,\n value: {\n color: theme.vars.colors.text.primary,\n flex: 1,\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n overflow: 'hidden',\n minHeight: '32px',\n lineHeight: '32px',\n } as CSSProperties,\n popup: {\n padding: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\n/**\n * Interface for organization form data.\n */\nexport interface OrganizationFormData {\n description: string;\n handle: string;\n name: string;\n}\n\n/**\n * Props interface for the BaseCreateOrganization component.\n */\nexport interface BaseCreateOrganizationProps {\n cardLayout?: boolean;\n className?: string;\n defaultParentId?: string;\n error?: string | null;\n initialValues?: Partial<OrganizationFormData>;\n loading?: boolean;\n mode?: 'inline' | 'popup';\n onCancel?: () => void;\n onOpenChange?: (open: boolean) => void;\n onSubmit?: (payload: CreateOrganizationPayload) => void | Promise<void>;\n onSuccess?: (organization: any) => void;\n open?: boolean;\n renderAdditionalFields?: () => ReactNode;\n style?: CSSProperties;\n title?: string;\n}\n\n/**\n * BaseCreateOrganization component provides the core functionality for creating organizations.\n * This component serves as the base for framework-specific implementations.\n */\nexport const BaseCreateOrganization: FC<BaseCreateOrganizationProps> = ({\n cardLayout = true,\n className = '',\n defaultParentId = '',\n error,\n initialValues = {},\n loading = false,\n mode = 'inline',\n onCancel,\n onOpenChange,\n onSubmit,\n onSuccess,\n open = false,\n renderAdditionalFields,\n style,\n title = 'Create Organization',\n}): ReactElement => {\n const styles = useStyles();\n const {theme} = useTheme();\n const {t} = useTranslation();\n const [formData, setFormData] = useState<OrganizationFormData>({\n description: '',\n handle: '',\n name: '',\n ...initialValues,\n });\n const [formErrors, setFormErrors] = useState<Partial<OrganizationFormData> & {avatar?: string}>({});\n\n const validateForm = (): boolean => {\n const errors: Partial<OrganizationFormData> = {};\n\n if (!formData.name.trim()) {\n errors.name = 'Organization name is required';\n }\n\n if (!formData.handle.trim()) {\n errors.handle = 'Organization handle is required';\n } else if (!/^[a-z0-9-]+$/.test(formData.handle)) {\n errors.handle = 'Handle can only contain lowercase letters, numbers, and hyphens';\n }\n\n if (!formData.description.trim()) {\n errors.description = 'Organization description is required';\n }\n\n setFormErrors(errors);\n return Object.keys(errors).length === 0;\n };\n\n const handleInputChange = (field: keyof OrganizationFormData, value: string): void => {\n setFormData(prev => ({\n ...prev,\n [field]: value,\n }));\n\n // Clear error when user starts typing\n if (formErrors[field]) {\n setFormErrors(prev => ({\n ...prev,\n [field]: undefined,\n }));\n }\n };\n\n const handleNameChange = (value: string): void => {\n handleInputChange('name', value);\n\n // Auto-generate handle from name if handle is empty or matches previous auto-generated value\n if (!formData.handle || formData.handle === generateHandleFromName(formData.name)) {\n const newHandle = generateHandleFromName(value);\n handleInputChange('handle', newHandle);\n }\n };\n\n const generateHandleFromName = (name: string): string => {\n return name\n .toLowerCase()\n .replace(/[^a-z0-9\\s-]/g, '') // Remove special characters except spaces and hyphens\n .replace(/\\s+/g, '-') // Replace spaces with hyphens\n .replace(/-+/g, '-') // Replace multiple hyphens with single hyphen\n .replace(/^-|-$/g, ''); // Remove leading/trailing hyphens\n };\n\n const handleSubmit = async (e: React.FormEvent): Promise<void> => {\n e.preventDefault();\n\n if (!validateForm() || loading) {\n return;\n }\n\n const payload: CreateOrganizationPayload = {\n description: formData.description.trim(),\n orgHandle: formData.handle.trim(),\n name: formData.name.trim(),\n parentId: defaultParentId,\n type: 'TENANT',\n };\n\n try {\n await onSubmit?.(payload);\n if (onSuccess) {\n onSuccess(payload);\n }\n } catch (submitError) {\n // Error handling is done by parent component\n console.error('Form submission error:', submitError);\n }\n };\n\n const containerStyle = {\n ...styles.root,\n ...(cardLayout ? styles.card : {}),\n };\n\n const createOrganizationContent = (\n <div\n className={clsx(withVendorCSSClassPrefix('create-organization'), className)}\n style={{...containerStyle, ...style}}\n >\n <div className={withVendorCSSClassPrefix('create-organization__content')} style={styles.content}>\n <form\n id=\"create-organization-form\"\n className={withVendorCSSClassPrefix('create-organization__form')}\n style={styles.form}\n onSubmit={handleSubmit}\n >\n {/* Error Alert */}\n {error && (\n <Alert variant=\"error\" style={{marginBottom: `calc(${theme.vars.spacing.unit} * 2)`}}>\n <Alert.Title>Error</Alert.Title>\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n )}\n\n {/* Organization Name */}\n <div className={withVendorCSSClassPrefix('create-organization__field-group')}>\n <TextField\n label={`${t('organization.create.name.label')}`}\n placeholder={t('organization.create.name.placeholder')}\n value={formData.name}\n onChange={(e: ChangeEvent<HTMLInputElement>) => handleNameChange(e.target.value)}\n disabled={loading}\n required\n error={formErrors.name}\n className={withVendorCSSClassPrefix('create-organization__input')}\n />\n </div>\n\n {/* Organization Handle */}\n <div className={withVendorCSSClassPrefix('create-organization__field-group')}>\n <TextField\n label={`${t('organization.create.handle.label') || 'Organization Handle'}`}\n placeholder={t('organization.create.handle.placeholder') || 'my-organization'}\n value={formData.handle}\n onChange={(e: ChangeEvent<HTMLInputElement>) => handleInputChange('handle', e.target.value)}\n disabled={loading}\n required\n error={formErrors.handle}\n helperText=\"This will be your organization's unique identifier. Only lowercase letters, numbers, and hyphens are allowed.\"\n className={withVendorCSSClassPrefix('create-organization__input')}\n />\n </div>\n\n {/* Organization Description */}\n <div className={withVendorCSSClassPrefix('create-organization__field-group')}>\n <FormControl error={formErrors.description}>\n <InputLabel required>{t('organization.create.description.label')}</InputLabel>\n <textarea\n className={withVendorCSSClassPrefix('create-organization__textarea')}\n style={{\n ...styles.textarea,\n borderColor: formErrors.description ? theme.vars.colors.error.main : theme.vars.colors.border,\n }}\n placeholder={t('organization.create.description.placeholder')}\n value={formData.description}\n onChange={(e: ChangeEvent<HTMLTextAreaElement>) => handleInputChange('description', e.target.value)}\n disabled={loading}\n required\n />\n </FormControl>\n </div>\n\n {/* Additional Fields */}\n {renderAdditionalFields && renderAdditionalFields()}\n </form>\n\n {/* Actions */}\n <div className={withVendorCSSClassPrefix('create-organization__actions')} style={styles.actions}>\n {onCancel && (\n <Button type=\"button\" variant=\"outline\" onClick={onCancel} disabled={loading}>\n {t('organization.create.cancel')}\n </Button>\n )}\n <Button type=\"submit\" variant=\"solid\" color=\"primary\" disabled={loading} form=\"create-organization-form\">\n {loading ? t('organization.create.creating') : t('organization.create.button')}\n </Button>\n </div>\n </div>\n </div>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={{padding: `calc(${theme.vars.spacing.unit} * 2)`}}>{createOrganizationContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return createOrganizationContent;\n};\n\nexport default BaseCreateOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n Organization,\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n createOrganization as baseCreateOrganization,\n CreateOrganizationConfig as BaseCreateOrganizationConfig,\n CreateOrganizationPayload,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the createOrganization request (React-specific)\n */\nexport interface CreateOrganizationConfig extends Omit<BaseCreateOrganizationConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Creates a new organization.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object containing baseUrl, payload and optional request config.\n * @returns A promise that resolves with the created organization information.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * try {\n * const organization = await createOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/<ORGANIZATION>\",\n * payload: {\n * description: \"Share your screens\",\n * name: \"Team Viewer\",\n * orgHandle: \"team-viewer\",\n * parentId: \"f4825104-4948-40d9-ab65-a960eee3e3d5\",\n * type: \"TENANT\"\n * }\n * });\n * console.log(organization);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to create organization:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const organization = await createOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/<ORGANIZATION>\",\n * payload: {\n * description: \"Share your screens\",\n * name: \"Team Viewer\",\n * orgHandle: \"team-viewer\",\n * parentId: \"f4825104-4948-40d9-ab65-a960eee3e3d5\",\n * type: \"TENANT\"\n * },\n * fetcher: customFetchFunction\n * });\n * console.log(organization);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to create organization:', error.message);\n * }\n * }\n * ```\n */\nconst createOrganization = async ({fetcher, ...requestConfig}: CreateOrganizationConfig): Promise<Organization> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'POST',\n headers: config.headers as Record<string, string>,\n data: config.body ? JSON.parse(config.body as string) : undefined,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseCreateOrganization({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default createOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, ReactElement, useEffect, useState} from 'react';\nimport BaseOrganizationProfile, {BaseOrganizationProfileProps} from './BaseOrganizationProfile';\nimport {OrganizationDetails} from '@asgardeo/browser';\nimport getOrganization from '../../../api/getOrganization';\nimport updateOrganization, {createPatchOperations} from '../../../api/updateOrganization';\nimport useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';\nimport useTranslation from '../../../hooks/useTranslation';\n\n/**\n * Props for the OrganizationProfile component.\n * Extends BaseOrganizationProfileProps but makes the organization prop optional\n * since it will be fetched using the organizationId\n */\nexport type OrganizationProfileProps = Omit<BaseOrganizationProfileProps, 'organization' | 'mode'> & {\n /**\n * Component to show when there's an error loading organization data.\n */\n errorFallback?: ReactElement;\n\n /**\n * Component to show while loading organization data.\n */\n loadingFallback?: ReactElement;\n\n /**\n * Display mode for the component.\n */\n mode?: 'default' | 'popup';\n\n /**\n * Callback fired when the popup should be closed (only used in popup mode).\n */\n onOpenChange?: (open: boolean) => void;\n\n /**\n * Callback fired when the organization should be updated.\n */\n onUpdate?: (payload: any) => Promise<void>;\n\n /**\n * Whether the popup is open (only used in popup mode).\n */\n open?: boolean;\n\n /**\n * The ID of the organization to fetch and display.\n */\n organizationId: string;\n\n /**\n * Custom title for the popup dialog (only used in popup mode).\n */\n popupTitle?: string;\n};\n\n/**\n * OrganizationProfile component displays organization information in a\n * structured and styled format. It automatically fetches organization details\n * using the provided organization ID and displays them using BaseOrganizationProfile.\n *\n * The component supports editing functionality, allowing users to modify organization\n * fields inline. Updates are automatically synced with the backend via the SCIM2 API.\n *\n * This component is the React-specific implementation that automatically\n * retrieves the organization data from Asgardeo API.\n *\n * @example\n * ```tsx\n * // Basic usage with editing enabled (default)\n * <OrganizationProfile organizationId=\"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\" />\n *\n * // Read-only mode\n * <OrganizationProfile\n * organizationId=\"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\"\n * editable={false}\n * />\n *\n * // With card layout and custom fallbacks\n * <OrganizationProfile\n * organizationId=\"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\"\n * cardLayout={true}\n * loadingFallback={<div>Loading organization...</div>}\n * errorFallback={<div>Failed to load organization</div>}\n * fallback={<div>No organization data available</div>}\n * />\n *\n * // With custom fields configuration and update callback\n * <OrganizationProfile\n * organizationId=\"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\"\n * fields={[\n * { key: 'id', label: 'Organization ID', editable: false },\n * { key: 'name', label: 'Organization Name', editable: true },\n * { key: 'description', label: 'Description', editable: true, render: (value) => value || 'No description' },\n * { key: 'created', label: 'Created Date', editable: false, render: (value) => new Date(value).toLocaleDateString() },\n * { key: 'lastModified', label: 'Last Modified Date', editable: false, render: (value) => new Date(value).toLocaleDateString() },\n * { key: 'attributes', label: 'Custom Attributes', editable: true }\n * ]}\n * onUpdate={async (payload) => {\n * console.log('Organization updated:', payload);\n * // payload contains the updated field values\n * // The component automatically converts these to patch operations\n * }}\n * />\n *\n * // In popup mode\n * <OrganizationProfile\n * organizationId=\"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\"\n * mode=\"popup\"\n * open={isOpen}\n * onOpenChange={setIsOpen}\n * popupTitle=\"Edit Organization Profile\"\n * />\n * ```\n */\nconst OrganizationProfile: FC<OrganizationProfileProps> = ({\n organizationId,\n mode = 'default',\n open = false,\n onOpenChange,\n onUpdate,\n popupTitle,\n loadingFallback = <div>Loading organization...</div>,\n errorFallback = <div>Failed to load organization data</div>,\n ...rest\n}: OrganizationProfileProps): ReactElement => {\n const {baseUrl} = useAsgardeo();\n const {t} = useTranslation();\n const [organization, setOrganization] = useState<OrganizationDetails | null>(null);\n const [loading, setLoading] = useState<boolean>(true);\n const [error, setError] = useState<boolean>(false);\n\n const fetchOrganization = async () => {\n if (!baseUrl || !organizationId) {\n setLoading(false);\n setError(true);\n return;\n }\n\n try {\n setLoading(true);\n setError(false);\n const orgData = await getOrganization({\n baseUrl,\n organizationId,\n });\n setOrganization(orgData);\n } catch (err) {\n console.error('Failed to fetch organization:', err);\n setError(true);\n setOrganization(null);\n } finally {\n setLoading(false);\n }\n };\n\n useEffect(() => {\n fetchOrganization();\n }, [baseUrl, organizationId]);\n\n const handleOrganizationUpdate = async (payload: any): Promise<void> => {\n if (!baseUrl || !organizationId) return;\n\n try {\n // Convert payload to patch operations format\n const operations = createPatchOperations(payload);\n\n await updateOrganization({\n baseUrl,\n organizationId,\n operations,\n });\n // Refetch organization data after update\n await fetchOrganization();\n\n // Call the optional onUpdate callback\n if (onUpdate) {\n await onUpdate(payload);\n }\n } catch (err) {\n console.error('Failed to update organization:', err);\n throw err;\n }\n };\n\n return (\n <BaseOrganizationProfile\n organization={organization}\n onUpdate={handleOrganizationUpdate}\n mode={mode === 'popup' ? 'popup' : 'inline'}\n open={open}\n onOpenChange={onOpenChange}\n title={popupTitle || t('organization.profile.title')}\n {...rest}\n />\n );\n};\n\nexport default OrganizationProfile;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix, OrganizationDetails} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {FC, ReactElement, useMemo, CSSProperties, useState, useCallback, useRef} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {Avatar} from '../../primitives/Avatar/Avatar';\nimport Button from '../../primitives/Button/Button';\nimport Checkbox from '../../primitives/Checkbox/Checkbox';\nimport DatePicker from '../../primitives/DatePicker/DatePicker';\nimport KeyValueInput from '../../primitives/KeyValueInput/KeyValueInput';\nimport {Dialog, DialogContent, DialogHeading} from '../../primitives/Popover/Popover';\nimport TextField from '../../primitives/TextField/TextField';\nimport Card from '../../primitives/Card/Card';\n\n/**\n * Formats a date string to a human-readable format\n */\nconst formatDate = (dateString?: string): string => {\n if (!dateString) return '-';\n try {\n return new Date(dateString).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n });\n } catch {\n return dateString;\n }\n};\n\nexport interface BaseOrganizationProfileProps {\n /**\n * Callback fired when the cancel button is clicked (only used in editable mode).\n */\n cancelButtonText?: string;\n\n /**\n * Whether to display the profile in a card layout.\n */\n cardLayout?: boolean;\n\n /**\n * CSS class name for styling the component.\n */\n className?: string;\n\n /**\n * Whether the organization profile is editable.\n */\n editable?: boolean;\n\n /**\n * Component to render when no organization data is available.\n */\n fallback?: ReactElement;\n\n /**\n * Array of field configurations to display. Each field specifies what organization data to show.\n */\n fields?: Array<{\n key: keyof OrganizationDetails | 'attributes';\n label: string;\n editable?: boolean;\n render?: (value: any, organization: OrganizationDetails) => React.ReactNode;\n }>;\n\n /**\n * Display mode for the component.\n */\n mode?: 'inline' | 'popup';\n\n /**\n * Callback fired when a field value changes.\n */\n onChange?: (field: string, value: any) => void;\n\n /**\n * Callback fired when the popup should be closed (only used in popup mode).\n */\n onOpenChange?: (open: boolean) => void;\n\n /**\n * Callback fired when the form is submitted (only used in editable mode).\n */\n onSubmit?: (data: any) => void;\n\n /**\n * Callback fired when the organization should be updated.\n */\n onUpdate?: (payload: any) => Promise<void>;\n\n /**\n * Whether the popup is open (only used in popup mode).\n */\n open?: boolean;\n\n /**\n * The organization details to display.\n */\n organization?: OrganizationDetails | null;\n\n /**\n * Text for the save button (only used in editable mode).\n */\n saveButtonText?: string;\n\n /**\n * Custom title for the profile.\n */\n title?: string;\n}\n\n/**\n * BaseOrganizationProfile component displays organization information in a\n * structured and styled format. It shows organization details such as name,\n * description, status, and other available information with support for inline editing.\n *\n * This is the base component that can be used in any context where you have\n * an organization object available. It provides editing capabilities similar to\n * the UserProfile component, allowing users to modify organization fields directly.\n *\n * @example\n * ```tsx\n * // Basic usage\n * <BaseOrganizationProfile organization={organizationData} />\n *\n * // With editing enabled and update handler\n * <BaseOrganizationProfile\n * organization={organizationData}\n * editable={true}\n * onUpdate={async (payload) => {\n * await updateOrganizationAPI(orgId, payload);\n * }}\n * />\n *\n * // With card layout and custom title\n * <BaseOrganizationProfile\n * organization={organizationData}\n * cardLayout={true}\n * title=\"Organization Details\"\n * fallback={<div>No organization data available</div>}\n * />\n *\n * // With custom fields configuration\n * <BaseOrganizationProfile\n * organization={organizationData}\n * fields={[\n * { key: 'id', label: 'Organization ID', editable: false },\n * { key: 'name', label: 'Organization Name', editable: true },\n * { key: 'description', label: 'Description', editable: true, render: (value) => value || 'No description' },\n * { key: 'created', label: 'Created Date', editable: false, render: (value) => new Date(value).toLocaleDateString() },\n * { key: 'attributes', label: 'Custom Attributes', editable: true }\n * ]}\n * onUpdate={handleUpdate}\n * />\n *\n * // In popup mode\n * <BaseOrganizationProfile\n * organization={organizationData}\n * mode=\"popup\"\n * open={isOpen}\n * onOpenChange={setIsOpen}\n * title=\"Edit Organization\"\n * />\n * ```\n * <BaseOrganizationProfile\n * organization={organizationData}\n * fields={[\n * { key: 'id', label: 'Organization ID' },\n * { key: 'name', label: 'Organization Name' },\n * { key: 'description', label: 'Description', render: (value) => value || 'No description' },\n * { key: 'created', label: 'Created Date', render: (value) => new Date(value).toLocaleDateString() },\n * { key: 'attributes', label: 'Custom Attributes' }\n * ]}\n * />\n * ```\n */\nconst BaseOrganizationProfile: FC<BaseOrganizationProfileProps> = ({\n fallback = null,\n className = '',\n cardLayout = true,\n organization,\n title = 'Organization Profile',\n mode = 'inline',\n editable = true,\n onChange,\n onOpenChange,\n onSubmit,\n onUpdate,\n open = false,\n saveButtonText = 'Save Changes',\n cancelButtonText = 'Cancel',\n fields = [\n {\n key: 'id',\n label: 'Organization ID',\n editable: false,\n },\n {\n key: 'name',\n label: 'Organization Name',\n editable: true,\n },\n {\n key: 'description',\n label: 'Organization Description',\n editable: true,\n render: value => value || '-',\n },\n {\n key: 'created',\n label: 'Created Date',\n editable: false,\n render: value => formatDate(value),\n },\n {\n key: 'lastModified',\n label: 'Last Modified Date',\n editable: false,\n render: value => formatDate(value),\n },\n ],\n}): ReactElement => {\n const {theme} = useTheme();\n const [editedOrganization, setEditedOrganization] = useState(organization);\n const [editingFields, setEditingFields] = useState<Record<string, boolean>>({});\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const PencilIcon = () => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z\" />\n </svg>\n );\n\n const toggleFieldEdit = useCallback((fieldName: string) => {\n setEditingFields(prev => ({\n ...prev,\n [fieldName]: !prev[fieldName],\n }));\n }, []);\n\n const getFieldPlaceholder = useCallback((fieldKey: string): string => {\n const fieldLabels: Record<string, string> = {\n name: 'organization name',\n description: 'organization description',\n orgHandle: 'organization handle',\n status: 'organization status',\n type: 'organization type',\n };\n\n const fieldLabel = fieldLabels[fieldKey] || fieldKey.toLowerCase();\n return `Enter ${fieldLabel}`;\n }, []);\n\n const handleFieldSave = useCallback(\n (fieldKey: string): void => {\n if (!onUpdate || !fieldKey) return;\n\n const fieldValue: any =\n editedOrganization && fieldKey && editedOrganization[fieldKey as keyof OrganizationDetails] !== undefined\n ? editedOrganization[fieldKey as keyof OrganizationDetails]\n : organization && organization[fieldKey as keyof OrganizationDetails] !== undefined\n ? organization[fieldKey as keyof OrganizationDetails]\n : '';\n\n const payload: Record<string, any> = {\n [fieldKey]: fieldValue,\n };\n\n onUpdate(payload);\n // Exit edit mode for this field after save\n toggleFieldEdit(fieldKey);\n },\n [editedOrganization, organization, onUpdate, toggleFieldEdit],\n );\n\n const handleFieldCancel = useCallback(\n (fieldKey: string) => {\n setEditedOrganization(prev => ({\n ...prev,\n [fieldKey]: organization?.[fieldKey as keyof OrganizationDetails],\n }));\n toggleFieldEdit(fieldKey);\n },\n [organization, toggleFieldEdit],\n );\n\n const formatLabel = (key: string): string =>\n key\n .split(/(?=[A-Z])|_/)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n const getStatusColor = (status?: string): string => {\n switch (status?.toUpperCase()) {\n case 'ACTIVE':\n return theme.vars.colors.success.main;\n case 'INACTIVE':\n return theme.vars.colors.warning.main;\n case 'SUSPENDED':\n return theme.vars.colors.error.main;\n default:\n return theme.vars.colors.text.secondary;\n }\n };\n\n const getOrgInitials = (name?: string): string => {\n if (!name) return 'ORG';\n return name\n .split(' ')\n .map(word => word.charAt(0))\n .join('')\n .toUpperCase()\n .slice(0, 2);\n };\n\n const styles = useStyles();\n\n // Renders individual field in view or edit mode\n const renderField = (\n field: any,\n isEditing: boolean,\n onEditValue?: (value: any) => void,\n onStartEdit?: () => void,\n ): ReactElement | null => {\n if (!field) return null;\n\n const {key, label, editable: fieldEditable = true} = field;\n const value =\n key === 'attributes' ? organization?.attributes || {} : organization?.[key as keyof OrganizationDetails];\n\n const renderedValue = field.render ? field.render(value, organization) : value;\n\n // If editing, show input field\n if (isEditing && onEditValue && fieldEditable && editable) {\n const fieldValue =\n editedOrganization && key && editedOrganization[key as keyof OrganizationDetails] !== undefined\n ? editedOrganization[key as keyof OrganizationDetails]\n : value || '';\n\n const commonProps = {\n label: undefined,\n value: typeof fieldValue === 'object' ? JSON.stringify(fieldValue) : String(fieldValue || ''),\n onChange: (e: any) => onEditValue(e.target ? e.target.value : e),\n placeholder: getFieldPlaceholder(key),\n style: {\n marginBottom: 0,\n },\n };\n\n let fieldInput: ReactElement;\n\n if (key === 'attributes') {\n // For attributes, use KeyValueInput component\n const attributesValue = typeof fieldValue === 'object' && fieldValue !== null ? fieldValue : {};\n fieldInput = (\n <KeyValueInput\n value={attributesValue}\n onChange={pairs => {\n const attributesObject = pairs.reduce((acc, pair) => {\n acc[pair.key] = pair.value;\n return acc;\n }, {} as Record<string, any>);\n onEditValue(attributesObject);\n }}\n onAdd={pair => {\n if (onUpdate) {\n const operation = {\n operation: 'ADD',\n path: `/attributes/${pair.key}`,\n value: pair.value,\n };\n onUpdate([operation]);\n }\n }}\n onRemove={(pair, index) => {\n if (onUpdate) {\n const operation = {\n operation: 'REMOVE',\n path: `/attributes/${pair.key}`,\n value: '',\n };\n onUpdate([operation]);\n }\n }}\n label=\"\"\n keyPlaceholder=\"Attribute name\"\n valuePlaceholder=\"Attribute value\"\n helperText=\"Add custom attributes as key-value pairs\"\n />\n );\n } else {\n fieldInput = <TextField {...commonProps} />;\n }\n\n return (\n <>\n <span style={styles.label}>{label}</span>\n <div style={styles.value}>{fieldInput}</div>\n </>\n );\n }\n\n // Default: view mode\n const hasValue = value !== undefined && value !== null && value !== '';\n const isFieldEditable = editable && fieldEditable;\n\n let displayValue: string | ReactElement;\n if (hasValue) {\n displayValue =\n key === 'attributes' && typeof value === 'object' && value !== null ? (\n <KeyValueInput value={value} readOnly={true} label=\"\" />\n ) : (\n String(renderedValue)\n );\n } else if (isFieldEditable) {\n displayValue = getFieldPlaceholder(key);\n } else {\n displayValue = '-';\n }\n\n return (\n <>\n <span style={styles.label}>{label}</span>\n <div\n style={{\n ...styles.value,\n fontStyle: hasValue ? 'normal' : 'italic',\n opacity: hasValue ? 1 : 0.7,\n }}\n >\n {!hasValue && isFieldEditable && onStartEdit ? (\n <Button\n onClick={onStartEdit}\n variant=\"text\"\n color=\"secondary\"\n size=\"small\"\n title=\"Click to edit\"\n style={{\n fontStyle: 'italic',\n textDecoration: 'underline',\n opacity: 0.7,\n padding: 0,\n minHeight: 'auto',\n }}\n >\n {displayValue}\n </Button>\n ) : (\n displayValue\n )}\n </div>\n </>\n );\n };\n\n const renderOrganizationField = (field: any) => {\n if (!field || !field.key) return null;\n\n const hasValue =\n organization?.[field.key as keyof OrganizationDetails] !== undefined &&\n organization?.[field.key as keyof OrganizationDetails] !== '' &&\n organization?.[field.key as keyof OrganizationDetails] !== null;\n const isFieldEditing = editingFields[field.key];\n const isFieldEditable = editable && field.editable !== false;\n\n // Show field if: has value, currently editing, or is editable\n const shouldShow = hasValue || isFieldEditing || isFieldEditable;\n\n if (!shouldShow) {\n return null;\n }\n\n const fieldStyle = {\n ...styles.field,\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n };\n\n return (\n <div style={fieldStyle} key={field.key}>\n <div style={{flex: 1, display: 'flex', alignItems: 'center', gap: theme.vars.spacing.unit}}>\n {renderField(\n field,\n isFieldEditing,\n value => {\n const tempEditedOrganization = {...editedOrganization};\n tempEditedOrganization[field.key as keyof OrganizationDetails] = value;\n setEditedOrganization(tempEditedOrganization);\n },\n () => toggleFieldEdit(field.key),\n )}\n </div>\n {isFieldEditable && (\n <div style={{display: 'flex', alignItems: 'center', gap: `calc(${theme.vars.spacing.unit} / 2)`}}>\n {isFieldEditing ? (\n <>\n <Button\n onClick={() => handleFieldSave(field.key)}\n color=\"primary\"\n variant=\"solid\"\n size=\"small\"\n title=\"Save changes\"\n >\n {saveButtonText}\n </Button>\n <Button\n onClick={() => handleFieldCancel(field.key)}\n color=\"secondary\"\n variant=\"solid\"\n size=\"small\"\n title=\"Cancel editing\"\n >\n {cancelButtonText}\n </Button>\n </>\n ) : (\n // Only show pencil icon when there's a value\n hasValue && (\n <Button\n onClick={() => toggleFieldEdit(field.key)}\n variant=\"text\"\n color=\"secondary\"\n size=\"small\"\n title=\"Edit field\"\n style={{\n minWidth: 'auto',\n padding: `calc(${theme.vars.spacing.unit} / 2)`,\n minHeight: 'auto',\n }}\n >\n <PencilIcon />\n </Button>\n )\n )}\n </div>\n )}\n </div>\n );\n };\n\n if (!organization) {\n return fallback;\n }\n\n const containerStyle = {\n ...styles.root,\n ...(cardLayout ? styles.card : {}),\n };\n\n const profileContent = (\n <Card style={containerStyle} className={clsx(withVendorCSSClassPrefix('organization-profile'), className)}>\n <div style={styles.header}>\n <Avatar name={getOrgInitials(organization.name)} size={80} alt={`${organization.name} logo`} />\n <div style={styles.orgInfo}>\n <h2 style={styles.name}>{organization.name}</h2>\n {organization.orgHandle && <p style={styles.handle}>@{organization.orgHandle}</p>}\n </div>\n </div>\n\n <div style={styles.infoContainer}>{fields.map((field, index) => renderOrganizationField(field))}</div>\n </Card>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={{padding: `calc(${theme.vars.spacing.unit} * 2)`}}>{profileContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return profileContent;\n};\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n root: {\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n minWidth: '600px',\n margin: '0 auto',\n } as CSSProperties,\n card: {\n background: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.large,\n } as CSSProperties,\n header: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n marginBottom: `calc(${theme.vars.spacing.unit} * 3)`,\n paddingBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n orgInfo: {\n flex: 1,\n } as CSSProperties,\n name: {\n fontSize: '1.5rem',\n fontWeight: 600,\n margin: '0 0 8px 0',\n color: theme.vars.colors.text.primary,\n } as CSSProperties,\n handle: {\n fontSize: '1rem',\n color: theme.vars.colors.text.secondary,\n margin: '0',\n fontFamily: 'monospace',\n } as CSSProperties,\n infoContainer: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: theme.vars.spacing.unit,\n } as CSSProperties,\n field: {\n display: 'flex',\n alignItems: 'flex-start',\n padding: `calc(${theme.vars.spacing.unit} / 2) 0`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n minHeight: '28px',\n } as CSSProperties,\n lastField: {\n borderBottom: 'none',\n } as CSSProperties,\n label: {\n fontSize: '0.875rem',\n fontWeight: 500,\n color: theme.vars.colors.text.secondary,\n width: '120px',\n flexShrink: 0,\n lineHeight: '28px',\n } as CSSProperties,\n value: {\n color: theme.vars.colors.text.primary,\n flex: 1,\n display: 'flex',\n alignItems: 'center',\n gap: theme.vars.spacing.unit,\n overflow: 'hidden',\n minHeight: '28px',\n lineHeight: '28px',\n wordBreak: 'break-word' as const,\n } as CSSProperties,\n statusBadge: {\n padding: `calc(${theme.vars.spacing.unit} / 2) ${theme.vars.spacing.unit}`,\n borderRadius: theme.vars.borderRadius.small,\n fontSize: '0.75rem',\n fontWeight: 500,\n color: 'white',\n textTransform: 'uppercase' as const,\n letterSpacing: '0.5px',\n } as CSSProperties,\n permissionsList: {\n display: 'flex',\n flexWrap: 'wrap' as const,\n gap: `calc(${theme.vars.spacing.unit} / 2)`,\n } as CSSProperties,\n permissionBadge: {\n padding: `calc(${theme.vars.spacing.unit} / 4) ${theme.vars.spacing.unit}`,\n borderRadius: theme.vars.borderRadius.small,\n fontSize: '0.75rem',\n backgroundColor: theme.vars.colors.primary.main,\n color: theme.vars.colors.primary.contrastText,\n border: `1px solid ${theme.vars.colors.border}`,\n } as CSSProperties,\n attributesList: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: `calc(${theme.vars.spacing.unit} / 4)`,\n } as CSSProperties,\n attributeItem: {\n display: 'flex',\n gap: theme.vars.spacing.unit,\n padding: `calc(${theme.vars.spacing.unit} / 4) 0`,\n alignItems: 'center',\n } as CSSProperties,\n attributeKey: {\n fontSize: '0.75rem',\n fontWeight: 500,\n color: theme.vars.colors.text.secondary,\n minWidth: '80px',\n flexShrink: 0,\n } as CSSProperties,\n attributeValue: {\n fontSize: '0.75rem',\n color: theme.vars.colors.text.primary,\n wordBreak: 'break-word' as const,\n flex: 1,\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\nexport default BaseOrganizationProfile;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {FC, ReactElement, useState, useCallback, CSSProperties} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Button from '../Button/Button';\nimport TextField from '../TextField/TextField';\nimport {Plus, X} from '../Icons';\n\nexport interface KeyValuePair {\n key: string;\n value: string;\n}\n\nexport interface KeyValueInputProps {\n /**\n * CSS class name for styling the component.\n */\n className?: string;\n\n /**\n * Whether the input is disabled.\n */\n disabled?: boolean;\n\n /**\n * Error message to display.\n */\n error?: string;\n\n /**\n * Help text to display below the input.\n */\n helperText?: string;\n\n /**\n * Label for the key input field.\n */\n keyLabel?: string;\n\n /**\n * Placeholder text for the key input field.\n */\n keyPlaceholder?: string;\n\n /**\n * Label for the component.\n */\n label?: string;\n\n /**\n * Maximum number of key-value pairs allowed.\n */\n maxPairs?: number;\n /**\n * Callback fired when the key-value pairs change.\n */\n onChange?: (pairs: KeyValuePair[]) => void;\n\n /**\n * Callback fired when a pair is added.\n */\n onAdd?: (pair: KeyValuePair) => void;\n\n /**\n * Callback fired when a pair is removed.\n */\n onRemove?: (pair: KeyValuePair, index: number) => void;\n\n /**\n * Whether the component is in read-only mode.\n */\n readOnly?: boolean;\n\n /**\n * Text for the remove button.\n */\n removeButtonText?: string;\n\n /**\n * Whether the component is required.\n */\n required?: boolean;\n\n /**\n * Current key-value pairs.\n */\n value?: Record<string, any> | KeyValuePair[];\n\n /**\n * Label for the value input field.\n */\n valueLabel?: string;\n\n /**\n * Placeholder text for the value input field.\n */\n valuePlaceholder?: string;\n}\n\n/**\n * KeyValueInput component allows users to manage key-value pairs with add/remove functionality.\n * It provides a user-friendly interface for editing organization attributes or similar data structures.\n *\n * @example\n * ```tsx\n * // Basic usage\n * <KeyValueInput\n * label=\"Organization Attributes\"\n * onChange={(pairs) => console.log(pairs)}\n * />\n *\n * // With initial values\n * <KeyValueInput\n * label=\"Organization Attributes\"\n * value={{department: 'IT', location: 'New York'}}\n * onChange={(pairs) => console.log(pairs)}\n * />\n *\n * // With add/remove callbacks\n * <KeyValueInput\n * label=\"Custom Attributes\"\n * value={attributes}\n * onChange={(pairs) => setAttributes(pairs)}\n * onAdd={(pair) => console.log('Added:', pair)}\n * onRemove={(pair, index) => console.log('Removed:', pair, 'at index:', index)}\n * />\n * ```\n */\nconst KeyValueInput: FC<KeyValueInputProps> = ({\n className = '',\n disabled = false,\n error,\n helperText,\n keyLabel = 'Key',\n keyPlaceholder = 'Enter key',\n label,\n maxPairs,\n onChange,\n onAdd,\n onRemove,\n readOnly = false,\n removeButtonText = 'Remove',\n required = false,\n value = {},\n valueLabel = 'Value',\n valuePlaceholder = 'Enter value',\n}): ReactElement => {\n const {theme} = useTheme();\n\n // Convert value to array format\n const initialPairs: KeyValuePair[] = Array.isArray(value)\n ? value\n : Object.entries(value).map(([key, val]) => ({key, value: String(val)}));\n\n const [pairs, setPairs] = useState<KeyValuePair[]>(initialPairs);\n const [newKey, setNewKey] = useState('');\n const [newValue, setNewValue] = useState('');\n\n const handleAddPair = useCallback(() => {\n if (!newKey.trim() || !newValue.trim()) return;\n if (maxPairs && pairs.length >= maxPairs) return;\n\n const newPair: KeyValuePair = {\n key: newKey.trim(),\n value: newValue.trim(),\n };\n\n const updatedPairs = [...pairs, newPair];\n setPairs(updatedPairs);\n setNewKey('');\n setNewValue('');\n\n if (onChange) {\n onChange(updatedPairs);\n }\n\n if (onAdd) {\n onAdd(newPair);\n }\n }, [newKey, newValue, pairs, maxPairs, onChange, onAdd]);\n\n const handleRemovePair = useCallback(\n (index: number) => {\n const pairToRemove = pairs[index];\n const updatedPairs = pairs.filter((_, i) => i !== index);\n setPairs(updatedPairs);\n\n if (onChange) {\n onChange(updatedPairs);\n }\n\n if (onRemove) {\n onRemove(pairToRemove, index);\n }\n },\n [pairs, onChange, onRemove],\n );\n\n const handleUpdatePair = useCallback(\n (index: number, field: 'key' | 'value', newVal: string) => {\n const updatedPairs = pairs.map((pair, i) => {\n if (i === index) {\n return {...pair, [field]: newVal};\n }\n return pair;\n });\n setPairs(updatedPairs);\n\n if (onChange) {\n onChange(updatedPairs);\n }\n },\n [pairs, onChange],\n );\n\n const canAddMore = !maxPairs || pairs.length < maxPairs;\n const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();\n\n const styles = {\n container: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: `calc(${theme.vars.spacing.unit} / 2)`,\n } as CSSProperties,\n label: {\n fontSize: '0.875rem',\n fontWeight: 500,\n color: theme.vars.colors.text.primary,\n marginBottom: `calc(${theme.vars.spacing.unit} / 2)`,\n } as CSSProperties,\n pairsList: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: `calc(${theme.vars.spacing.unit} / 4)`,\n } as CSSProperties,\n pairRow: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} / 2)`,\n padding: `calc(${theme.vars.spacing.unit} / 2)`,\n borderRadius: theme.vars.borderRadius.small,\n backgroundColor: 'transparent',\n border: 'none',\n '&:hover': {\n backgroundColor: theme.vars.colors.action.hover,\n },\n } as CSSProperties,\n pairInput: {\n flex: 1,\n minWidth: 0,\n } as CSSProperties,\n addRow: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} / 2)`,\n padding: `calc(${theme.vars.spacing.unit} / 2)`,\n border: 'none',\n borderRadius: theme.vars.borderRadius.small,\n backgroundColor: 'transparent',\n marginTop: `calc(${theme.vars.spacing.unit} / 2)`,\n } as CSSProperties,\n removeButton: {\n minWidth: 'auto',\n width: '24px',\n height: '24px',\n padding: '0',\n backgroundColor: 'transparent',\n color: theme.vars.colors.text.secondary,\n border: 'none',\n borderRadius: theme.vars.borderRadius.small,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '&:hover': {\n backgroundColor: theme.vars.colors.action.hover,\n color: theme.vars.colors.error.main,\n },\n } as CSSProperties,\n addButton: {\n minWidth: 'auto',\n width: '24px',\n height: '24px',\n padding: '0',\n backgroundColor: 'transparent',\n color: theme.vars.colors.primary.main,\n border: 'none',\n borderRadius: theme.vars.borderRadius.small,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '&:hover': {\n backgroundColor: theme.vars.colors.primary.main,\n color: theme.vars.colors.primary.contrastText,\n },\n } as CSSProperties,\n helperText: {\n fontSize: '0.75rem',\n color: error ? theme.vars.colors.error.main : theme.vars.colors.text.secondary,\n marginTop: `calc(${theme.vars.spacing.unit} / 2)`,\n } as CSSProperties,\n emptyState: {\n padding: theme.vars.spacing.unit,\n textAlign: 'center' as const,\n color: theme.vars.colors.text.secondary,\n fontStyle: 'italic',\n fontSize: '0.75rem',\n } as CSSProperties,\n readOnlyPair: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} / 2)`,\n padding: `calc(${theme.vars.spacing.unit} / 4) 0`,\n minHeight: '20px',\n } as CSSProperties,\n readOnlyKey: {\n fontSize: '0.75rem',\n fontWeight: 500,\n color: theme.vars.colors.text.secondary,\n minWidth: '80px',\n flexShrink: 0,\n } as CSSProperties,\n readOnlyValue: {\n fontSize: '0.75rem',\n color: theme.vars.colors.text.primary,\n wordBreak: 'break-word' as const,\n flex: 1,\n } as CSSProperties,\n };\n\n return (\n <div className={clsx(withVendorCSSClassPrefix('key-value-input'), className)} style={styles.container}>\n {label && (\n <label style={styles.label}>\n {label}\n {required && <span style={{color: theme.vars.colors.error.main}}> *</span>}\n </label>\n )}\n\n <div style={styles.pairsList}>\n {pairs.length === 0 && readOnly ? (\n <div style={styles.emptyState}>No attributes defined</div>\n ) : readOnly ? (\n pairs.map((pair, index) => (\n <div key={`${pair.key}-${index}`} style={styles.readOnlyPair}>\n <span style={styles.readOnlyKey}>{pair.key}:</span>\n <span style={styles.readOnlyValue}>{pair.value}</span>\n </div>\n ))\n ) : (\n pairs.map((pair, index) => (\n <div key={`${pair.key}-${index}`} style={styles.pairRow}>\n <TextField\n placeholder={keyPlaceholder}\n value={pair.key}\n onChange={e => handleUpdatePair(index, 'key', e.target.value)}\n disabled={disabled || readOnly}\n style={styles.pairInput}\n aria-label={`${keyLabel} ${index + 1}`}\n />\n <TextField\n placeholder={valuePlaceholder}\n value={pair.value}\n onChange={e => handleUpdatePair(index, 'value', e.target.value)}\n disabled={disabled || readOnly}\n style={styles.pairInput}\n aria-label={`${valueLabel} ${index + 1}`}\n />\n {!readOnly && (\n <Button\n variant=\"outline\"\n size=\"small\"\n onClick={() => handleRemovePair(index)}\n disabled={disabled}\n style={styles.removeButton}\n aria-label={`${removeButtonText} ${pair.key}`}\n >\n <X width={16} height={16} />\n </Button>\n )}\n </div>\n ))\n )}\n\n {!readOnly && (\n <div style={styles.addRow}>\n <TextField\n placeholder={keyPlaceholder}\n value={newKey}\n onChange={e => setNewKey(e.target.value)}\n disabled={disabled}\n style={styles.pairInput}\n aria-label=\"New key\"\n />\n <TextField\n placeholder={valuePlaceholder}\n value={newValue}\n onChange={e => setNewValue(e.target.value)}\n disabled={disabled}\n style={styles.pairInput}\n aria-label=\"New value\"\n onKeyPress={e => {\n if (e.key === 'Enter' && !isAddDisabled) {\n handleAddPair();\n }\n }}\n />\n <Button\n variant=\"solid\"\n size=\"small\"\n onClick={handleAddPair}\n disabled={isAddDisabled}\n style={styles.addButton}\n aria-label=\"Add new key-value pair\"\n >\n <Plus width={16} height={16} />\n </Button>\n </div>\n )}\n </div>\n\n {(helperText || error) && <div style={styles.helperText}>{error || helperText}</div>}\n\n {maxPairs && (\n <div style={styles.helperText}>\n {pairs.length} of {maxPairs} pairs used\n </div>\n )}\n </div>\n );\n};\n\nexport default KeyValueInput;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n getOrganization as baseGetOrganization,\n GetOrganizationConfig as BaseGetOrganizationConfig,\n OrganizationDetails,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the getOrganization request (React-specific)\n */\nexport interface GetOrganizationConfig extends Omit<BaseGetOrganizationConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Retrieves detailed information for a specific organization.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object containing baseUrl, organizationId, and request config.\n * @returns A promise that resolves with the organization details.\n * @example\n * ```typescript\n * // Using default Asgardeo SPA client httpClient\n * try {\n * const organization = await getOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/dxlab\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\"\n * });\n * console.log(organization);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get organization:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const organization = await getOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/dxlab\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\",\n * fetcher: customFetchFunction\n * });\n * console.log(organization);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get organization:', error.message);\n * }\n * }\n * ```\n */\nconst getOrganization = async ({fetcher, ...requestConfig}: GetOrganizationConfig): Promise<OrganizationDetails> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'GET',\n headers: config.headers as Record<string, string>,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetOrganization({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n HttpInstance,\n AsgardeoSPAClient,\n HttpRequestConfig,\n updateOrganization as baseUpdateOrganization,\n UpdateOrganizationConfig as BaseUpdateOrganizationConfig,\n OrganizationDetails,\n createPatchOperations,\n} from '@asgardeo/browser';\n\nconst httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance());\n\n/**\n * Configuration for the updateOrganization request (React-specific)\n */\nexport interface UpdateOrganizationConfig extends Omit<BaseUpdateOrganizationConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the Asgardeo SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n}\n\n/**\n * Updates the organization information using the Organizations Management API.\n * This function uses the Asgardeo SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object with baseUrl, organizationId, operations and optional request config.\n * @returns A promise that resolves with the updated organization information.\n * @example\n * ```typescript\n * // Using the helper function to create operations automatically\n * const operations = createPatchOperations({\n * name: \"Updated Organization Name\", // Will use REPLACE\n * description: \"\", // Will use REMOVE (empty string)\n * customField: \"Some value\" // Will use REPLACE\n * });\n *\n * await updateOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/<ORG>\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\",\n * operations\n * });\n *\n * // Or manually specify operations\n * await updateOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/<ORG>\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\",\n * operations: [\n * { operation: \"REPLACE\", path: \"/name\", value: \"Updated Organization Name\" },\n * { operation: \"REMOVE\", path: \"/description\" }\n * ]\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * await updateOrganization({\n * baseUrl: \"https://api.asgardeo.io/t/<ORG>\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\",\n * operations: [\n * { operation: \"REPLACE\", path: \"/name\", value: \"Updated Organization Name\" }\n * ],\n * fetcher: customFetchFunction\n * });\n * ```\n */\nconst updateOrganization = async ({\n fetcher,\n ...requestConfig\n}: UpdateOrganizationConfig): Promise<OrganizationDetails> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const response = await httpClient({\n url,\n method: config.method || 'PATCH',\n headers: config.headers as Record<string, string>,\n data: config.body ? JSON.parse(config.body as string) : undefined,\n } as HttpRequestConfig);\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n json: () => Promise.resolve(response.data),\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseUpdateOrganization({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\n// Re-export the helper function\nexport {createPatchOperations};\n\nexport default updateOrganization;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AllOrganizationsApiResponse, Organization} from '@asgardeo/browser';\nimport {FC, ReactElement, useEffect, useState} from 'react';\nimport {BaseOrganizationListProps, OrganizationWithSwitchAccess} from './BaseOrganizationList';\nimport BaseOrganizationList from './BaseOrganizationList';\nimport useOrganization from '../../../contexts/Organization/useOrganization';\n\n/**\n * Configuration options for the OrganizationList component.\n */\nexport interface OrganizationListConfig {\n /**\n * Whether to automatically fetch organizations on mount\n */\n autoFetch?: boolean;\n /**\n * Filter string for organizations\n */\n filter?: string;\n /**\n * Number of organizations to fetch per page\n */\n limit?: number;\n /**\n * Whether to include recursive organizations\n */\n recursive?: boolean;\n}\n\n/**\n * Props interface for the OrganizationList component.\n * Uses the enhanced OrganizationContext instead of the useOrganizations hook.\n */\nexport interface OrganizationListProps\n extends Omit<\n BaseOrganizationListProps,\n | 'myOrganizations'\n | 'allOrganizations'\n | 'error'\n | 'fetchMore'\n | 'hasMore'\n | 'isLoading'\n | 'isLoadingMore'\n | 'myOrganizations'\n >,\n OrganizationListConfig {\n /**\n * Function called when an organization is selected/clicked\n */\n onOrganizationSelect?: (organization: OrganizationWithSwitchAccess) => void;\n}\n\n/**\n * OrganizationList component that provides organization listing functionality with pagination.\n * This component uses the enhanced OrganizationContext, eliminating the polling issue and\n * providing better integration with the existing context system.\n *\n * @example\n * ```tsx\n * import { OrganizationList } from '@asgardeo/react';\n *\n * // Basic usage\n * <OrganizationList />\n *\n * // With custom limit and filter\n * <OrganizationList\n * limit={20}\n * filter=\"active\"\n * onOrganizationSelect={(org) => {\n * console.log('Selected organization:', org.name);\n * }}\n * />\n *\n * // As a popup dialog\n * <OrganizationList\n * mode=\"popup\"\n * open={isOpen}\n * onOpenChange={setIsOpen}\n * title=\"Select Organization\"\n * />\n *\n * // With custom organization renderer\n * <OrganizationList\n * renderOrganization={(org) => (\n * <div key={org.id}>\n * <h3>{org.name}</h3>\n * <p>Can switch: {org.canSwitch ? 'Yes' : 'No'}</p>\n * </div>\n * )}\n * />\n * ```\n */\nexport const OrganizationList: FC<OrganizationListProps> = ({\n autoFetch = true,\n filter = '',\n limit = 10,\n onOrganizationSelect,\n recursive = false,\n ...baseProps\n}: OrganizationListProps): ReactElement => {\n const {getAllOrganizations, error, isLoading, myOrganizations} = useOrganization();\n\n const [allOrganizations, setAllOrganizations] = useState<AllOrganizationsApiResponse>({\n organizations: [],\n });\n\n useEffect(() => {\n (async () => {\n setAllOrganizations(await getAllOrganizations());\n })();\n }, []);\n\n return (\n <BaseOrganizationList\n allOrganizations={allOrganizations}\n myOrganizations={myOrganizations}\n error={error}\n isLoading={isLoading}\n onOrganizationSelect={onOrganizationSelect}\n {...baseProps}\n />\n );\n};\n\nexport default OrganizationList;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AllOrganizationsApiResponse, Organization, withVendorCSSClassPrefix} from '@asgardeo/browser';\nimport clsx from 'clsx';\nimport {FC, ReactElement, ReactNode, useMemo, CSSProperties} from 'react';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport useTranslation from '../../../hooks/useTranslation';\nimport {Dialog, DialogContent, DialogHeading} from '../../primitives/Popover/Popover';\nimport Avatar from '../../primitives/Avatar/Avatar';\nimport Button from '../../primitives/Button/Button';\nimport Typography from '../../primitives/Typography/Typography';\nimport Spinner from '../../primitives/Spinner/Spinner';\n\nexport interface OrganizationWithSwitchAccess extends Organization {\n canSwitch: boolean;\n}\n\n/**\n * Props interface for the BaseOrganizationList component.\n */\nexport interface BaseOrganizationListProps {\n /**\n * Additional CSS class names to apply to the container\n */\n className?: string;\n /**\n * List of organizations discoverable to the signed-in user.\n */\n allOrganizations: AllOrganizationsApiResponse;\n /**\n * List of organizations associated to the signed-in user.\n */\n myOrganizations: Organization[];\n /**\n * Error message to display\n */\n error?: string | null;\n /**\n * Function called when \"Load More\" is clicked\n */\n fetchMore?: () => Promise<void>;\n /**\n * Whether there are more organizations to load\n */\n hasMore?: boolean;\n /**\n * Whether the initial data is loading\n */\n isLoading?: boolean;\n /**\n * Whether more data is being loaded\n */\n isLoadingMore?: boolean;\n /**\n * Function called when refresh is requested\n */\n onRefresh?: () => Promise<void>;\n /**\n * Custom renderer for when no organizations are found\n */\n renderEmpty?: () => ReactNode;\n /**\n * Custom renderer for the error state\n */\n renderError?: (error: string) => ReactNode;\n /**\n * Custom renderer for the load more button\n */\n renderLoadMore?: (onLoadMore: () => Promise<void>, isLoading: boolean) => ReactNode;\n /**\n * Custom renderer for the loading state\n */\n renderLoading?: () => ReactNode;\n /**\n * Custom renderer for each organization item\n */\n renderOrganization?: (organization: OrganizationWithSwitchAccess, index: number) => ReactNode;\n /**\n * Function called when an organization is selected/clicked\n */\n onOrganizationSelect?: (organization: OrganizationWithSwitchAccess) => void;\n /**\n * Inline styles to apply to the container\n */\n style?: React.CSSProperties;\n /**\n * Display mode: 'inline' for normal display, 'popup' for modal dialog\n */\n mode?: 'inline' | 'popup';\n /**\n * Function called when popup open state changes (only used in popup mode)\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Whether the popup is open (only used in popup mode)\n */\n open?: boolean;\n /**\n * Title for the popup dialog (only used in popup mode)\n */\n title?: string;\n /**\n * Whether to show the organization status in the list\n */\n showStatus?: boolean;\n}\n\n/**\n * Default organization item renderer\n */\nconst defaultRenderOrganization = (\n organization: OrganizationWithSwitchAccess,\n styles: any,\n t: (key: string, params?: Record<string, string | number>) => string,\n onOrganizationSelect?: (organization: OrganizationWithSwitchAccess) => void,\n showStatus?: boolean,\n): ReactNode => {\n return (\n <div\n key={organization.id}\n style={{\n ...styles.organizationItem,\n }}\n >\n <div style={styles.organizationContent}>\n <Avatar variant=\"square\" name={organization.name} size={48} alt={`${organization.name} logo`} />\n <div style={styles.organizationInfo}>\n <Typography variant=\"h6\" style={styles.organizationName}>\n {organization.name}\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\" style={styles.organizationHandle}>\n @{organization.orgHandle}\n </Typography>\n {showStatus && (\n <Typography variant=\"body2\" color=\"textSecondary\" style={styles.organizationStatus}>\n {t('organization.switcher.status.label')}{' '}\n <span\n style={{\n ...styles.statusText,\n color: organization.status === 'ACTIVE' ? styles.activeColor : styles.inactiveColor,\n }}\n >\n {organization.status}\n </span>\n </Typography>\n )}\n </div>\n </div>\n {organization.canSwitch && (\n <div style={styles.organizationActions}>\n <Button\n onClick={e => {\n e.stopPropagation();\n onOrganizationSelect(organization);\n }}\n type=\"button\"\n size=\"small\"\n >\n {t('organization.switcher.switch.button')}\n </Button>\n </div>\n )}\n </div>\n );\n};\n\n/**\n * Default loading renderer\n */\nconst defaultRenderLoading = (\n t: (key: string, params?: Record<string, string | number>) => string,\n styles: any,\n): ReactNode => (\n <div style={styles.loadingContainer}>\n <Spinner size=\"medium\" />\n <Typography variant=\"body1\" color=\"textSecondary\" style={styles.loadingText}>\n {t('organization.switcher.loading.organizations')}\n </Typography>\n </div>\n);\n\n/**\n * Default error renderer\n */\nconst defaultRenderError = (\n error: string,\n t: (key: string, params?: Record<string, string | number>) => string,\n styles: any,\n): ReactNode => (\n <div style={styles.errorContainer}>\n <Typography variant=\"body1\" color=\"error\">\n <strong>{t('organization.switcher.error.prefix')}</strong> {error}\n </Typography>\n </div>\n);\n\n/**\n * Default load more button renderer\n */\nconst defaultRenderLoadMore = (\n onLoadMore: () => Promise<void>,\n isLoading: boolean,\n t: (key: string, params?: Record<string, string | number>) => string,\n styles: any,\n): ReactNode => (\n <Button\n onClick={onLoadMore}\n disabled={isLoading}\n style={{\n ...styles.loadMoreButton,\n ...(isLoading ? styles.loadMoreButtonDisabled : {}),\n }}\n type=\"button\"\n fullWidth\n >\n {isLoading ? t('organization.switcher.loading.more') : t('organization.switcher.load.more')}\n </Button>\n);\n\n/**\n * Default empty state renderer\n */\nconst defaultRenderEmpty = (\n t: (key: string, params?: Record<string, string | number>) => string,\n styles: any,\n): ReactNode => (\n <div style={styles.emptyContainer}>\n <Typography variant=\"body1\" color=\"textSecondary\" style={styles.emptyText}>\n {t('organization.switcher.no.organizations')}\n </Typography>\n </div>\n);\n\n/**\n * BaseOrganizationList component displays a list of organizations with pagination support.\n * This component serves as the base for framework-specific implementations.\n *\n * @example\n * ```tsx\n * <BaseOrganizationList\n * data={organizations}\n * isLoading={isLoading}\n * hasMore={hasMore}\n * fetchMore={fetchMore}\n * error={error}\n * />\n * ```\n */\nexport const BaseOrganizationList: FC<BaseOrganizationListProps> = ({\n className = '',\n allOrganizations,\n myOrganizations,\n error,\n fetchMore,\n hasMore = false,\n isLoading = false,\n isLoadingMore = false,\n mode = 'inline',\n onOpenChange,\n onOrganizationSelect,\n onRefresh,\n open = false,\n renderEmpty,\n renderError,\n renderLoading,\n renderLoadMore,\n renderOrganization,\n style,\n title = 'Organizations',\n showStatus,\n}): ReactElement => {\n const styles = useStyles();\n const {t} = useTranslation();\n\n // Combine allOrganizations with myOrganizations to determine which orgs can be switched to\n const organizationsWithSwitchAccess: OrganizationWithSwitchAccess[] = useMemo(() => {\n if (!allOrganizations?.organizations) {\n return [];\n }\n\n // Create a Set of IDs from myOrganizations for faster lookup\n const myOrgIds = new Set(myOrganizations?.map(org => org.id) || []);\n\n return allOrganizations.organizations.map(org => ({\n ...org,\n canSwitch: myOrgIds.has(org.id),\n }));\n }, [allOrganizations?.organizations, myOrganizations]);\n\n // Use custom renderers or defaults with styles and translations\n const renderLoadingWithStyles = renderLoading || (() => defaultRenderLoading(t, styles));\n const renderErrorWithStyles = renderError || ((error: string) => defaultRenderError(error, t, styles));\n const renderEmptyWithStyles = renderEmpty || (() => defaultRenderEmpty(t, styles));\n const renderLoadMoreWithStyles =\n renderLoadMore ||\n ((onLoadMore: () => Promise<void>, isLoading: boolean) => defaultRenderLoadMore(onLoadMore, isLoading, t, styles));\n const renderOrganizationWithStyles =\n renderOrganization ||\n ((org: OrganizationWithSwitchAccess) =>\n defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));\n\n // Show loading state\n if (isLoading && organizationsWithSwitchAccess?.length === 0) {\n const loadingContent = (\n <div\n className={clsx(withVendorCSSClassPrefix('organization-list'), className)}\n style={{...styles.root, ...style}}\n >\n {renderLoadingWithStyles()}\n </div>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={styles.popupContent}>{loadingContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return loadingContent;\n }\n\n // Show error state\n if (error && organizationsWithSwitchAccess?.length === 0) {\n const errorContent = (\n <div\n className={clsx(withVendorCSSClassPrefix('organization-list'), className)}\n style={{...styles.root, ...style}}\n >\n {renderErrorWithStyles(error)}\n </div>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={styles.popupContent}>{errorContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return errorContent;\n }\n\n // Show empty state\n if (!isLoading && organizationsWithSwitchAccess?.length === 0) {\n const emptyContent = (\n <div\n className={clsx(withVendorCSSClassPrefix('organization-list'), className)}\n style={{...styles.root, ...style}}\n >\n {renderEmptyWithStyles()}\n </div>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={styles.popupContent}>{emptyContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return emptyContent;\n }\n\n const organizationListContent = (\n <div className={clsx(withVendorCSSClassPrefix('organization-list'), className)} style={{...styles.root, ...style}}>\n {/* Header with total count and refresh button */}\n <div style={styles.header}>\n <div style={styles.headerInfo}>\n <Typography variant=\"body2\" color=\"textSecondary\" style={styles.subtitle}>\n {t('organization.switcher.showing.count', {\n showing: organizationsWithSwitchAccess?.length,\n total: allOrganizations?.organizations?.length || 0,\n })}\n </Typography>\n </div>\n {onRefresh && (\n <Button onClick={onRefresh} style={styles.refreshButton} type=\"button\" variant=\"outline\" size=\"small\">\n {t('organization.switcher.refresh.button')}\n </Button>\n )}\n </div>\n\n {/* Organizations list */}\n <div style={styles.listContainer}>\n {organizationsWithSwitchAccess?.map((organization: OrganizationWithSwitchAccess, index: number) =>\n renderOrganizationWithStyles(organization, index),\n )}\n </div>\n\n {/* Error message for additional data */}\n {error && organizationsWithSwitchAccess?.length > 0 && (\n <div style={styles.errorMargin}>{renderErrorWithStyles(error)}</div>\n )}\n\n {/* Load more button */}\n {hasMore && fetchMore && (\n <div style={styles.loadMoreMargin}>{renderLoadMoreWithStyles(fetchMore, isLoadingMore)}</div>\n )}\n </div>\n );\n\n if (mode === 'popup') {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent>\n <DialogHeading>{title}</DialogHeading>\n <div style={styles.popupContent}>{organizationListContent}</div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return organizationListContent;\n};\n\nconst useStyles = () => {\n const {theme, colorScheme} = useTheme();\n\n return useMemo(\n () => ({\n root: {\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n minWidth: '600px',\n margin: '0 auto',\n background: theme.vars.colors.background.surface,\n borderRadius: theme.vars.borderRadius.large,\n } as CSSProperties,\n header: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: `calc(${theme.vars.spacing.unit} * 3)`,\n paddingBottom: `calc(${theme.vars.spacing.unit} * 2)`,\n borderBottom: `1px solid ${theme.vars.colors.border}`,\n } as CSSProperties,\n headerInfo: {\n flex: 1,\n } as CSSProperties,\n title: {\n fontSize: '1.5rem',\n fontWeight: 600,\n margin: '0 0 8px 0',\n color: theme.vars.colors.text.primary,\n } as CSSProperties,\n subtitle: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n margin: '0',\n } as CSSProperties,\n refreshButton: {\n backgroundColor: theme.vars.colors.background.surface,\n border: `1px solid ${theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.small,\n color: theme.vars.colors.text.primary,\n cursor: 'pointer',\n fontSize: '0.875rem',\n padding: `${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 2)`,\n transition: 'all 0.2s',\n } as CSSProperties,\n listContainer: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: `calc(${theme.vars.spacing.unit} * 1.5)`,\n } as CSSProperties,\n organizationItem: {\n border: `1px solid ${theme.vars.colors.border}`,\n borderRadius: theme.vars.borderRadius.medium,\n display: 'flex',\n justifyContent: 'space-between',\n padding: `calc(${theme.vars.spacing.unit} * 2)`,\n transition: 'all 0.2s',\n backgroundColor: theme.vars.colors.background.surface,\n } as CSSProperties,\n organizationContent: {\n display: 'flex',\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n flex: 1,\n } as CSSProperties,\n organizationInfo: {\n flex: 1,\n } as CSSProperties,\n organizationName: {\n fontSize: '1.125rem',\n fontWeight: 600,\n margin: '0 0 4px 0',\n color: theme.vars.colors.text.primary,\n } as CSSProperties,\n organizationHandle: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n margin: '0 0 4px 0',\n fontFamily: 'monospace',\n } as CSSProperties,\n organizationStatus: {\n color: theme.vars.colors.text.secondary,\n fontSize: '0.875rem',\n margin: '0',\n } as CSSProperties,\n statusText: {\n fontWeight: 500,\n } as CSSProperties,\n activeColor: theme.vars.colors.success.main,\n inactiveColor: theme.vars.colors.error.main,\n organizationActions: {\n display: 'flex',\n alignItems: 'center',\n } as CSSProperties,\n badge: {\n borderRadius: theme.vars.borderRadius.large,\n fontSize: '0.75rem',\n fontWeight: 500,\n padding: `calc(${theme.vars.spacing.unit} / 2) calc(${theme.vars.spacing.unit} * 1.5)`,\n textTransform: 'uppercase' as const,\n letterSpacing: '0.5px',\n } as CSSProperties,\n successBadge: {\n backgroundColor: `color-mix(in srgb, ${theme.vars.colors.success.main} 20%, transparent)`,\n color: theme.vars.colors.success.main,\n } as CSSProperties,\n errorBadge: {\n backgroundColor: `color-mix(in srgb, ${theme.vars.colors.error.main} 20%, transparent)`,\n color: theme.vars.colors.error.main,\n } as CSSProperties,\n loadingContainer: {\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n textAlign: 'center' as const,\n display: 'flex',\n flexDirection: 'column' as const,\n alignItems: 'center',\n gap: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n loadingText: {\n marginTop: theme.vars.spacing.unit,\n } as CSSProperties,\n errorContainer: {\n backgroundColor: `color-mix(in srgb, ${theme.vars.colors.error.main} 20%, transparent)`,\n border: `1px solid ${theme.vars.colors.error.main}`,\n borderRadius: theme.vars.borderRadius.medium,\n color: theme.vars.colors.error.main,\n padding: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n emptyContainer: {\n padding: `calc(${theme.vars.spacing.unit} * 4)`,\n textAlign: 'center' as const,\n } as CSSProperties,\n emptyText: {\n color: theme.vars.colors.text.secondary,\n fontSize: '1rem',\n } as CSSProperties,\n loadMoreButton: {\n backgroundColor: theme.vars.colors.primary.main,\n border: 'none',\n borderRadius: theme.vars.borderRadius.medium,\n color: theme.vars.colors.primary.contrastText,\n cursor: 'pointer',\n fontSize: '0.875rem',\n fontWeight: 500,\n padding: `calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 3)`,\n width: '100%',\n transition: 'all 0.2s',\n } as CSSProperties,\n loadMoreButtonDisabled: {\n backgroundColor: theme.vars.colors.text.secondary,\n cursor: 'not-allowed',\n opacity: 0.6,\n } as CSSProperties,\n errorMargin: {\n marginTop: `calc(${theme.vars.spacing.unit} * 2)`,\n } as CSSProperties,\n loadMoreMargin: {\n marginTop: `calc(${theme.vars.spacing.unit} * 3)`,\n } as CSSProperties,\n popupContent: {\n padding: theme.vars.spacing.unit,\n } as CSSProperties,\n }),\n [theme, colorScheme],\n );\n};\n\nexport default BaseOrganizationList;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC} from 'react';\n\nexport interface BuildingAltProps {\n /**\n * Color of the icon.\n */\n color?: string;\n /**\n * Height of the icon.\n */\n height?: number | string;\n /**\n * Width of the icon.\n */\n width?: number | string;\n}\n\n/**\n * Alternative Building Icon component.\n *\n * @param props - Props injected to the component.\n * @returns Alternative Building Icon component.\n */\nconst BuildingAlt: FC<BuildingAltProps> = ({color = 'currentColor', height = 24, width = 24}: BuildingAltProps) => (\n <svg\n width={width}\n height={height}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z\" />\n <path d=\"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2\" />\n <path d=\"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 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;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,iBAAiB;AAAA,QAChB,GAAG;AAAA;AAAA,IACN;AAAA,IACA,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAM;AAAA,QACN,cAAc;AAAA,QACd,WAAW,CAAC,QAAsB;AAChC,cAAI,OAAO,sBAAsB;AAC/B,iCAAqB,GAAG;AAAA,UAC1B;AACA,6BAAmB,KAAK;AAAA,QAC1B;AAAA;AAAA,IACF;AAAA,IACC,uBACC,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,gBAAgB,oBAAoB;AAAA,QACpC,MAAK;AAAA,QACL,MAAM;AAAA,QACN,cAAc;AAAA,QACd,YAAY;AAAA,QACZ,iBAAiB,gBAAAA,MAAC,SAAK,YAAE,8BAA8B,GAAE;AAAA,QACzD,eAAe,gBAAAA,MAAC,SAAK,YAAE,4BAA4B,GAAE;AAAA;AAAA,IACvD;AAAA,IAEF,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAM;AAAA,QACN,cAAc;AAAA,QACd,OAAO,EAAE,4CAA4C;AAAA,QACrD,sBAAsB,CAAC,iBAA+B;AACpD,cAAI,sBAAsB;AACxB,iCAAqB,YAAY;AAAA,UACnC;AACA,oCAA0B,KAAK;AAAA,QACjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,IAAO,+BAAQ;",
6
+ "names": ["AsgardeoRuntimeError", "generateFlattenedUserProfile", "useEffect", "useMemo", "useState", "useCallback", "AsgardeoSPAClient", "AsgardeoSPAClient", "httpClient", "AsgardeoSPAClient", "httpClient", "AsgardeoSPAClient", "httpClient", "createContext", "useCallback", "useMemo", "useState", "createContext", "jsx", "fallbackLanguage", "useState", "useMemo", "useCallback", "AsgardeoRuntimeError", "useCallback", "useMemo", "useState", "createContext", "jsx", "getAllOrganizations", "createOrganization", "useState", "useCallback", "AsgardeoRuntimeError", "useMemo", "useEffect", "useMemo", "useState", "useCallback", "createContext", "createContext", "jsx", "useState", "useEffect", "useMemo", "useCallback", "useCallback", "useEffect", "useState", "jsx", "useState", "useEffect", "useCallback", "useMemo", "createContext", "jsx", "useMemo", "jsx", "useMemo", "useState", "useEffect", "_baseUrl", "useCallback", "AsgardeoRuntimeError", "generateFlattenedUserProfile", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useContext", "useMemo", "deepMerge", "useContext", "useMemo", "deepMerge", "useState", "useCallback", "withVendorCSSClassPrefix", "clsx", "forwardRef", "useMemo", "withVendorCSSClassPrefix", "clsx", "jsx", "Fragment", "jsx", "jsxs", "useMemo", "clsx", "withVendorCSSClassPrefix", "Fragment", "jsx", "forwardRef", "clsx", "withVendorCSSClassPrefix", "AsgardeoRuntimeError", "forwardRef", "useState", "jsx", "forwardRef", "useState", "AsgardeoRuntimeError", "withVendorCSSClassPrefix", "clsx", "forwardRef", "Fragment", "jsx", "forwardRef", "clsx", "withVendorCSSClassPrefix", "AsgardeoRuntimeError", "forwardRef", "useState", "jsx", "forwardRef", "useState", "AsgardeoRuntimeError", "withVendorCSSClassPrefix", "clsx", "forwardRef", "Fragment", "jsx", "forwardRef", "clsx", "withVendorCSSClassPrefix", "AsgardeoRuntimeError", "forwardRef", "useState", "jsx", "forwardRef", "useState", "AsgardeoRuntimeError", "Fragment", "jsx", "Fragment", "jsx", "Fragment", "jsx", "ApplicationNativeAuthenticationConstants", "AsgardeoAPIError", "withVendorCSSClassPrefix", "clsx", "useEffect", "useState", "useCallback", "useRef", "useMemo", "EmbeddedSignInFlowAuthenticatorKnownIdPType", "ApplicationNativeAuthenticationConstants", "FieldType", "useEffect", "clsx", "clsx", "withVendorCSSClassPrefix", "jsx", "jsx", "jsxs", "jsx", "jsxs", "withVendorCSSClassPrefix", "jsx", "jsxs", "clsx", "clsx", "withVendorCSSClassPrefix", "jsx", "jsxs", "clsx", "useRef", "useEffect", "useState", "clsx", "withVendorCSSClassPrefix", "jsx", "jsxs", "useState", "useRef", "useEffect", "clsx", "useState", "jsx", "jsxs", "jsx", "jsxs", "jsx", "useState", "clsx", "withVendorCSSClassPrefix", "jsx", "jsxs", "clsx", "clsx", "withVendorCSSClassPrefix", "jsx", "jsxs", "clsx", "jsx", "Fragment", "jsx", "jsxs", "useEffect", "FieldType", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "useEffect", "Fragment", "jsx", "jsxs", "useEffect", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "jsx", "jsxs", "jsx", "jsx", "jsxs", "jsx", "jsxs", "jsx", "jsx", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "useEffect", "Fragment", "jsx", "jsxs", "useEffect", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "useEffect", "Fragment", "jsx", "jsxs", "useEffect", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "useEffect", "Fragment", "jsx", "jsxs", "useEffect", "EmbeddedSignInFlowAuthenticatorParamType", "FieldType", "jsx", "jsx", "jsxs", "jsx", "ApplicationNativeAuthenticationConstants", "EmbeddedSignInFlowAuthenticatorKnownIdPType", "forwardRef", "useMemo", "withVendorCSSClassPrefix", "clsx", "jsx", "jsxs", "jsx", "jsxs", "jsx", "jsxs", "jsx", "jsxs", "jsx", "jsxs", "useMemo", "forwardRef", "clsx", "withVendorCSSClassPrefix", "withVendorCSSClassPrefix", "clsx", "forwardRef", "useMemo", "jsx", "useMemo", "forwardRef", "clsx", "withVendorCSSClassPrefix", "level", "withVendorCSSClassPrefix", "clsx", "useMemo", "Fragment", "jsx", "jsxs", "useMemo", "withVendorCSSClassPrefix", "clsx", "clsx", "withVendorCSSClassPrefix", "jsx", "clsx", "withVendorCSSClassPrefix", "jsx", "jsxs", "ApplicationNativeAuthenticationConstants", "useStyles", "useMemo", "useState", "useRef", "useCallback", "error", "response", "AsgardeoAPIError", "clsx", "withVendorCSSClassPrefix", "useEffect", "variant", "jsx", "EmbeddedFlowComponentType", "withVendorCSSClassPrefix", "AsgardeoAPIError", "clsx", "useEffect", "useState", "useCallback", "useRef", "useMemo", "FieldType", "FieldType", "FieldType", "FieldType", "jsx", "FieldType", "FieldType", "jsx", "jsx", "jsxs", "GoogleButton", "GoogleButton_default", "jsx", "FieldType", "FieldType", "FieldType", "FieldType", "jsx", "jsx", "FieldType", "FieldType", "jsx", "Typography_default", "jsx", "Typography_default", "GoogleButton_default", "jsx", "jsxs", "useStyles", "useMemo", "useState", "useRef", "useCallback", "EmbeddedFlowComponentType", "AsgardeoAPIError", "error", "clsx", "withVendorCSSClassPrefix", "useEffect", "EmbeddedFlowResponseType", "jsx", "EmbeddedFlowResponseType", "Fragment", "jsx", "jsx", "User", "Fragment", "jsx", "jsx", "Organization", "withVendorCSSClassPrefix", "clsx", "useMemo", "useState", "useCallback", "useRef", "withVendorCSSClassPrefix", "clsx", "useMemo", "jsx", "jsxs", "useStyles", "useMemo", "offset", "clsx", "withVendorCSSClassPrefix", "withVendorCSSClassPrefix", "clsx", "useMemo", "jsx", "jsxs", "jsx", "jsxs", "jsx", "jsxs", "User", "User_default", "jsx", "jsxs", "jsx", "jsxs", "useStyles", "useMemo", "withVendorCSSClassPrefix", "clsx", "offset", "useCallback", "useState", "useMemo", "clsx", "withVendorCSSClassPrefix", "jsx", "jsxs", "useStyles", "useMemo", "style", "useCallback", "useState", "clsx", "Fragment", "jsx", "jsxs", "useState", "useRef", "useCallback", "currentUser", "useStyles", "isEditable", "displayValue", "clsx", "withVendorCSSClassPrefix", "useMemo", "AsgardeoSPAClient", "httpClient", "jsx", "UserProfile", "withVendorCSSClassPrefix", "useFloating", "autoUpdate", "offset", "flip", "shift", "useClick", "useDismiss", "useRole", "useInteractions", "FloatingFocusManager", "FloatingPortal", "clsx", "useMemo", "useState", "jsx", "jsxs", "useStyles", "useMemo", "useState", "useFloating", "offset", "flip", "shift", "autoUpdate", "useClick", "useDismiss", "useRole", "useInteractions", "User_default", "clsx", "withVendorCSSClassPrefix", "FloatingPortal", "FloatingFocusManager", "useState", "Fragment", "jsx", "jsxs", "useState", "withVendorCSSClassPrefix", "useFloating", "autoUpdate", "offset", "flip", "shift", "useClick", "useDismiss", "useRole", "useInteractions", "FloatingFocusManager", "FloatingPortal", "clsx", "useMemo", "useState", "jsx", "jsxs", "jsx", "jsx", "Fragment", "jsx", "jsxs", "useStyles", "useMemo", "useState", "useFloating", "offset", "flip", "shift", "autoUpdate", "useClick", "useDismiss", "useRole", "useInteractions", "defaultRenderOrganization", "defaultRenderLoading", "defaultRenderError", "clsx", "withVendorCSSClassPrefix", "FloatingPortal", "FloatingFocusManager", "useState", "useState", "withVendorCSSClassPrefix", "clsx", "useMemo", "useState", "jsx", "jsxs", "useStyles", "useMemo", "useState", "clsx", "withVendorCSSClassPrefix", "AsgardeoSPAClient", "httpClient", "Fragment", "jsx", "useState", "useEffect", "useState", "withVendorCSSClassPrefix", "clsx", "useMemo", "useState", "useCallback", "useRef", "withVendorCSSClassPrefix", "clsx", "useState", "useCallback", "jsx", "jsxs", "useState", "useCallback", "clsx", "withVendorCSSClassPrefix", "Fragment", "jsx", "jsxs", "useState", "useRef", "useCallback", "useStyles", "clsx", "withVendorCSSClassPrefix", "useMemo", "AsgardeoSPAClient", "httpClient", "AsgardeoSPAClient", "httpClient", "jsx", "useState", "useEffect", "useEffect", "useState", "withVendorCSSClassPrefix", "clsx", "useMemo", "jsx", "jsxs", "useStyles", "useMemo", "error", "isLoading", "clsx", "withVendorCSSClassPrefix", "jsx", "getAllOrganizations", "useState", "useEffect", "jsx", "jsxs", "Fragment", "jsx", "jsxs", "useState"]
7
7
  }