@asgardeo/nextjs 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/AsgardeoNextClient.d.ts +11 -4
  2. package/dist/AsgardeoNextClient.js +111 -12
  3. package/dist/AsgardeoNextClient.js.map +1 -1
  4. package/dist/cjs/index.js +18 -0
  5. package/dist/cjs/index.js.map +3 -3
  6. package/dist/client/components/presentation/CreateOrganization/CreateOrganization.d.ts +67 -0
  7. package/dist/client/components/presentation/CreateOrganization/CreateOrganization.js +109 -0
  8. package/dist/client/components/presentation/CreateOrganization/CreateOrganization.js.map +1 -0
  9. package/dist/client/components/presentation/Organization/Organization.d.ts +66 -0
  10. package/dist/client/components/presentation/Organization/Organization.js +55 -0
  11. package/dist/client/components/presentation/Organization/Organization.js.map +1 -0
  12. package/dist/client/components/presentation/OrganizationList/OrganizationList.d.ts +92 -0
  13. package/dist/client/components/presentation/OrganizationList/OrganizationList.js +75 -0
  14. package/dist/client/components/presentation/OrganizationList/OrganizationList.js.map +1 -0
  15. package/dist/client/components/presentation/OrganizationProfile/OrganizationProfile.d.ts +119 -0
  16. package/dist/client/components/presentation/OrganizationProfile/OrganizationProfile.js +145 -0
  17. package/dist/client/components/presentation/OrganizationProfile/OrganizationProfile.js.map +1 -0
  18. package/dist/client/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts +71 -0
  19. package/dist/client/components/presentation/OrganizationSwitcher/OrganizationSwitcher.js +102 -0
  20. package/dist/client/components/presentation/OrganizationSwitcher/OrganizationSwitcher.js.map +1 -0
  21. package/dist/client/components/presentation/UserProfile/UserProfile.js +3 -4
  22. package/dist/client/components/presentation/UserProfile/UserProfile.js.map +1 -1
  23. package/dist/client/contexts/Asgardeo/AsgardeoContext.js +2 -0
  24. package/dist/client/contexts/Asgardeo/AsgardeoContext.js.map +1 -1
  25. package/dist/client/contexts/Asgardeo/AsgardeoProvider.d.ts +16 -1
  26. package/dist/client/contexts/Asgardeo/AsgardeoProvider.js +25 -6
  27. package/dist/client/contexts/Asgardeo/AsgardeoProvider.js.map +1 -1
  28. package/dist/index.d.ts +6 -0
  29. package/dist/index.js +3 -0
  30. package/dist/index.js.map +1 -1
  31. package/dist/server/AsgardeoProvider.js +71 -2
  32. package/dist/server/AsgardeoProvider.js.map +1 -1
  33. package/dist/server/actions/createOrganizationAction.d.ts +37 -0
  34. package/dist/server/actions/createOrganizationAction.js +40 -0
  35. package/dist/server/actions/createOrganizationAction.js.map +1 -0
  36. package/dist/server/actions/getAllOrganizations.d.ts +23 -0
  37. package/dist/server/actions/getAllOrganizations.js +34 -0
  38. package/dist/server/actions/getAllOrganizations.js.map +1 -0
  39. package/dist/server/actions/getBrandingPreference.d.ts +23 -0
  40. package/dist/server/actions/getBrandingPreference.js +32 -0
  41. package/dist/server/actions/getBrandingPreference.js.map +1 -0
  42. package/dist/server/actions/getCurrentOrganizationAction.d.ts +37 -0
  43. package/dist/server/actions/getCurrentOrganizationAction.js +40 -0
  44. package/dist/server/actions/getCurrentOrganizationAction.js.map +1 -0
  45. package/dist/server/actions/getMyOrganizations.d.ts +23 -0
  46. package/dist/server/actions/getMyOrganizations.js +34 -0
  47. package/dist/server/actions/getMyOrganizations.js.map +1 -0
  48. package/dist/server/actions/getOrganizationAction.d.ts +37 -0
  49. package/dist/server/actions/getOrganizationAction.js +40 -0
  50. package/dist/server/actions/getOrganizationAction.js.map +1 -0
  51. package/dist/server/actions/switchOrganization.d.ts +23 -0
  52. package/dist/server/actions/switchOrganization.js +34 -0
  53. package/dist/server/actions/switchOrganization.js.map +1 -0
  54. package/dist/server/actions/updateUserProfileAction.d.ts +2 -8
  55. package/dist/server/actions/updateUserProfileAction.js +2 -2
  56. package/dist/server/actions/updateUserProfileAction.js.map +1 -1
  57. package/dist/utils/decorateConfigWithNextEnv.js +4 -1
  58. package/dist/utils/decorateConfigWithNextEnv.js.map +1 -1
  59. package/package.json +3 -11
@@ -1 +1 @@
1
- {"version":3,"file":"AsgardeoContext.js","sourceRoot":"","sources":["../../../../src/client/contexts/Asgardeo/AsgardeoContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,CAAC;AAIb,OAAO,EAAU,aAAa,EAAC,MAAM,OAAO,CAAC;AAO7C;;GAEG;AACH,MAAM,eAAe,GAAyC,aAAa,CAA8B;IACvG,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,cAAc,EAAE,SAAS;IACzB,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,KAAK;IACpB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,KAAK;IACjB,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;CACX,CAAC,CAAC;AAEH,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAEhD,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"AsgardeoContext.js","sourceRoot":"","sources":["../../../../src/client/contexts/Asgardeo/AsgardeoContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,CAAC;AAIb,OAAO,EAAU,aAAa,EAAC,MAAM,OAAO,CAAC;AAO7C;;GAEG;AACH,MAAM,eAAe,GAAyC,aAAa,CAA8B;IACvG,kBAAkB,EAAE,SAAS;IAC7B,aAAa,EAAE,SAAS;IACxB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,cAAc,EAAE,SAAS;IACzB,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,KAAK;IACpB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,KAAK;IACjB,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;CACX,CAAC,CAAC;AAEH,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAEhD,eAAe,eAAe,CAAC"}
@@ -15,7 +15,7 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { User, UserProfile } from '@asgardeo/node';
18
+ import { AllOrganizationsApiResponse, Organization, UpdateMeProfileConfig, User, UserProfile, BrandingPreference } from '@asgardeo/node';
19
19
  import { AsgardeoProviderProps } from '@asgardeo/react';
20
20
  import { FC, PropsWithChildren } from 'react';
21
21
  import { AsgardeoContextProps } from './AsgardeoContext';
@@ -26,6 +26,8 @@ export type AsgardeoClientProviderProps = Partial<Omit<AsgardeoProviderProps, 'b
26
26
  signOut: AsgardeoContextProps['signOut'];
27
27
  signIn: AsgardeoContextProps['signIn'];
28
28
  signUp: AsgardeoContextProps['signUp'];
29
+ applicationId: AsgardeoContextProps['applicationId'];
30
+ organizationHandle: AsgardeoContextProps['organizationHandle'];
29
31
  handleOAuthCallback: (code: string, state: string, sessionState?: string) => Promise<{
30
32
  success: boolean;
31
33
  error?: string;
@@ -33,7 +35,20 @@ export type AsgardeoClientProviderProps = Partial<Omit<AsgardeoProviderProps, 'b
33
35
  }>;
34
36
  isSignedIn: boolean;
35
37
  userProfile: UserProfile;
38
+ currentOrganization: Organization;
36
39
  user: User | null;
40
+ updateProfile: (requestConfig: UpdateMeProfileConfig, sessionId?: string) => Promise<{
41
+ success: boolean;
42
+ data: {
43
+ user: User;
44
+ };
45
+ error: string;
46
+ }>;
47
+ getAllOrganizations: (options?: any, sessionId?: string) => Promise<AllOrganizationsApiResponse>;
48
+ myOrganizations: Organization[];
49
+ revalidateMyOrganizations?: (sessionId?: string) => Promise<Organization[]>;
50
+ brandingPreference?: BrandingPreference | null;
51
+ switchOrganization: (organization: Organization, sessionId?: string) => Promise<void>;
37
52
  };
38
53
  declare const AsgardeoClientProvider: FC<PropsWithChildren<AsgardeoClientProviderProps>>;
39
54
  export default AsgardeoClientProvider;
@@ -17,16 +17,25 @@
17
17
  */
18
18
  'use client';
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
- import { I18nProvider, FlowProvider, UserProvider, ThemeProvider } from '@asgardeo/react';
21
- import { useEffect, useMemo, useState } from 'react';
20
+ import { generateFlattenedUserProfile, } from '@asgardeo/node';
21
+ import { I18nProvider, FlowProvider, UserProvider, ThemeProvider, OrganizationProvider, BrandingProvider, } from '@asgardeo/react';
22
+ import { useEffect, useMemo, useRef, useState } from 'react';
22
23
  import { useRouter, useSearchParams } from 'next/navigation';
23
24
  import AsgardeoContext from './AsgardeoContext';
24
- const AsgardeoClientProvider = ({ baseUrl, children, signIn, signOut, signUp, handleOAuthCallback, preferences, isSignedIn, signInUrl, signUpUrl, user, userProfile, }) => {
25
+ const AsgardeoClientProvider = ({ baseUrl, children, signIn, signOut, signUp, handleOAuthCallback, preferences, isSignedIn, signInUrl, signUpUrl, user: _user, userProfile: _userProfile, currentOrganization, updateProfile, applicationId, organizationHandle, myOrganizations, revalidateMyOrganizations, getAllOrganizations, switchOrganization, brandingPreference, }) => {
26
+ const reRenderCheckRef = useRef(false);
25
27
  const router = useRouter();
26
28
  const searchParams = useSearchParams();
27
29
  const [isDarkMode, setIsDarkMode] = useState(false);
28
30
  const [isLoading, setIsLoading] = useState(true);
29
- const [_userProfile, setUserProfile] = useState(userProfile);
31
+ const [user, setUser] = useState(_user);
32
+ const [userProfile, setUserProfile] = useState(_userProfile);
33
+ useEffect(() => {
34
+ setUserProfile(_userProfile);
35
+ }, [_userProfile]);
36
+ useEffect(() => {
37
+ setUser(_user);
38
+ }, [_user]);
30
39
  // Handle OAuth callback automatically
31
40
  useEffect(() => {
32
41
  // Don't handle callback if already signed in
@@ -154,8 +163,18 @@ const AsgardeoClientProvider = ({ baseUrl, children, signIn, signOut, signUp, ha
154
163
  signUp: handleSignUp,
155
164
  signInUrl,
156
165
  signUpUrl,
157
- }), [baseUrl, user, isSignedIn, isLoading, signInUrl, signUpUrl]);
158
- return (_jsx(AsgardeoContext.Provider, { value: contextValue, children: _jsx(I18nProvider, { preferences: preferences?.i18n, children: _jsx(ThemeProvider, { theme: preferences?.theme?.overrides, defaultColorScheme: isDarkMode ? 'dark' : 'light', children: _jsx(FlowProvider, { children: _jsx(UserProvider, { profile: userProfile, children: children }) }) }) }) }));
166
+ applicationId,
167
+ organizationHandle,
168
+ }), [baseUrl, user, isSignedIn, isLoading, signInUrl, signUpUrl, applicationId, organizationHandle]);
169
+ const handleProfileUpdate = (payload) => {
170
+ setUser(payload);
171
+ setUserProfile(prev => ({
172
+ ...prev,
173
+ profile: payload,
174
+ flattenedProfile: generateFlattenedUserProfile(payload, prev?.schemas),
175
+ }));
176
+ };
177
+ return (_jsx(AsgardeoContext.Provider, { value: contextValue, children: _jsx(I18nProvider, { preferences: preferences?.i18n, children: _jsx(BrandingProvider, { brandingPreference: brandingPreference, children: _jsx(ThemeProvider, { theme: preferences?.theme?.overrides, mode: isDarkMode ? 'dark' : 'light', children: _jsx(FlowProvider, { children: _jsx(UserProvider, { profile: userProfile, onUpdateProfile: handleProfileUpdate, updateProfile: updateProfile, children: _jsx(OrganizationProvider, { getAllOrganizations: getAllOrganizations, myOrganizations: myOrganizations, currentOrganization: currentOrganization, onOrganizationSwitch: switchOrganization, revalidateMyOrganizations: revalidateMyOrganizations, children: children }) }) }) }) }) }) }));
159
178
  };
160
179
  export default AsgardeoClientProvider;
161
180
  //# sourceMappingURL=AsgardeoProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AsgardeoProvider.js","sourceRoot":"","sources":["../../../../src/client/contexts/Asgardeo/AsgardeoProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,CAAC;;AASb,OAAO,EAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAwB,MAAM,iBAAiB,CAAC;AAC/G,OAAO,EAAwB,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAC3D,OA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AAC,kBAAkB,EAAE,kBAAkB,YACtD,KAAC,aAAa,IAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,YACtF,KAAC,YAAY,cACX,KAAC,YAAY,IAAC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,YACpG,KAAC,oBAAoB,IACnB,mBAAmB,EAAE,mBAAmB,EACxC,eAAe,EAAE,eAAe,EAChC,mBAAmB,EAAE,mBAAmB,EACxC,oBAAoB,EAAE,kBAAkB,EACxC,yBAAyB,EAAE,yBAAgC,YAE1D,QAAQ,GACY,GACV,GACF,GACD,GACC,GACN,GACU,CAC5B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -21,6 +21,12 @@ export { default as useAsgardeo } from './client/contexts/Asgardeo/useAsgardeo';
21
21
  export * from './client/contexts/Asgardeo/useAsgardeo';
22
22
  export { default as isSignedIn } from './server/actions/isSignedIn';
23
23
  export { default as handleOAuthCallback } from './server/actions/handleOAuthCallbackAction';
24
+ export { default as CreateOrganization } from './client/components/presentation/CreateOrganization/CreateOrganization';
25
+ export { CreateOrganizationProps } from './client/components/presentation/CreateOrganization/CreateOrganization';
26
+ export { default as OrganizationProfile } from './client/components/presentation/OrganizationProfile/OrganizationProfile';
27
+ export { OrganizationProfileProps } from './client/components/presentation/OrganizationProfile/OrganizationProfile';
28
+ export { default as OrganizationSwitcher } from './client/components/presentation/OrganizationSwitcher/OrganizationSwitcher';
29
+ export { OrganizationSwitcherProps } from './client/components/presentation/OrganizationSwitcher/OrganizationSwitcher';
24
30
  export { default as SignedIn } from './client/components/control/SignedIn/SignedIn';
25
31
  export { SignedInProps } from './client/components/control/SignedIn/SignedIn';
26
32
  export { default as SignedOut } from './client/components/control/SignedOut/SignedOut';
package/dist/index.js CHANGED
@@ -21,6 +21,9 @@ export { default as useAsgardeo } from './client/contexts/Asgardeo/useAsgardeo';
21
21
  export * from './client/contexts/Asgardeo/useAsgardeo';
22
22
  export { default as isSignedIn } from './server/actions/isSignedIn';
23
23
  export { default as handleOAuthCallback } from './server/actions/handleOAuthCallbackAction';
24
+ export { default as CreateOrganization } from './client/components/presentation/CreateOrganization/CreateOrganization';
25
+ export { default as OrganizationProfile } from './client/components/presentation/OrganizationProfile/OrganizationProfile';
26
+ export { default as OrganizationSwitcher } from './client/components/presentation/OrganizationSwitcher/OrganizationSwitcher';
24
27
  export { default as SignedIn } from './client/components/control/SignedIn/SignedIn';
25
28
  export { default as SignedOut } from './client/components/control/SignedOut/SignedOut';
26
29
  export { default as SignInButton } from './client/components/actions/SignInButton/SignInButton';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AACtE,cAAc,2BAA2B,CAAC;AAE1C,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,wCAAwC,CAAC;AAC9E,cAAc,wCAAwC,CAAC;AAEvD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAC,OAAO,IAAI,mBAAmB,EAAC,MAAM,4CAA4C,CAAC;AAE1F,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,+CAA+C,CAAC;AAGlF,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,iDAAiD,CAAC;AAGrF,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,uDAAuD,CAAC;AAG9F,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,uDAAuD,CAAC;AAG9F,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,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Y,EAAC,MAAM,uDAAuD,CAAC;AAG9F,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,uDAAuD,CAAC;AAG9F,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,gDAAgD,CAAC;AAGjF,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,yDAAyD,CAAC;AAGjG,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,4CAA4C,CAAC;AAG3E,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,gDAAgD,CAAC;AAGjF,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,4DAA4D,CAAC;AAGnG,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,0DAA0D,CAAC;AAGhG,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,iCAAiC,CAAC"}
@@ -1,5 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ 'use server';
1
19
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { AsgardeoRuntimeError } from '@asgardeo/node';
20
+ import { AsgardeoRuntimeError, } from '@asgardeo/node';
3
21
  import AsgardeoClientProvider from '../client/contexts/Asgardeo/AsgardeoProvider';
4
22
  import AsgardeoNextClient from '../AsgardeoNextClient';
5
23
  import signInAction from './actions/signInAction';
@@ -10,6 +28,12 @@ import getSessionId from './actions/getSessionId';
10
28
  import getUserProfileAction from './actions/getUserProfileAction';
11
29
  import signUpAction from './actions/signUpAction';
12
30
  import handleOAuthCallbackAction from './actions/handleOAuthCallbackAction';
31
+ import getCurrentOrganizationAction from './actions/getCurrentOrganizationAction';
32
+ import updateUserProfileAction from './actions/updateUserProfileAction';
33
+ import getMyOrganizations from './actions/getMyOrganizations';
34
+ import getAllOrganizations from './actions/getAllOrganizations';
35
+ import getBrandingPreference from './actions/getBrandingPreference';
36
+ import switchOrganization from './actions/switchOrganization';
13
37
  /**
14
38
  * Server-side provider component for Asgardeo authentication.
15
39
  * Wraps the client-side provider and handles server-side authentication logic.
@@ -47,13 +71,58 @@ const AsgardeoServerProvider = async ({ children, afterSignInUrl, afterSignOutUr
47
71
  profile: {},
48
72
  flattenedProfile: {},
49
73
  };
74
+ let currentOrganization = {
75
+ id: '',
76
+ name: '',
77
+ orgHandle: '',
78
+ };
79
+ let myOrganizations = [];
80
+ let brandingPreference = null;
50
81
  if (_isSignedIn) {
82
+ // Check if there's a `user_org` claim in the ID token to determine if this is an organization login
83
+ const idToken = await asgardeoClient.getDecodedIdToken(sessionId);
84
+ let updatedBaseUrl = config?.baseUrl;
85
+ if (idToken?.['user_org']) {
86
+ // Treat this login as an organization login and modify the base URL
87
+ updatedBaseUrl = `${config?.baseUrl}/o`;
88
+ config = { ...config, baseUrl: updatedBaseUrl };
89
+ }
51
90
  const userResponse = await getUserAction(sessionId);
52
91
  const userProfileResponse = await getUserProfileAction(sessionId);
92
+ const currentOrganizationResponse = await getCurrentOrganizationAction(sessionId);
93
+ myOrganizations = await getMyOrganizations({}, sessionId);
53
94
  user = userResponse.data?.user || {};
54
95
  userProfile = userProfileResponse.data?.userProfile;
96
+ currentOrganization = currentOrganizationResponse?.data?.organization;
97
+ }
98
+ // Fetch branding preference if branding is enabled in config
99
+ if (config?.preferences?.theme?.inheritFromBranding !== false) {
100
+ try {
101
+ brandingPreference = await getBrandingPreference({
102
+ baseUrl: config?.baseUrl,
103
+ locale: 'en-US',
104
+ name: config.applicationId || config.organizationHandle,
105
+ type: config.applicationId ? 'APP' : 'ORG',
106
+ }, sessionId);
107
+ }
108
+ catch (error) {
109
+ console.warn('[AsgardeoServerProvider] Failed to fetch branding preference:', error);
110
+ }
55
111
  }
56
- return (_jsx(AsgardeoClientProvider, { baseUrl: config.baseUrl, signIn: signInAction, signOut: signOutAction, signUp: signUpAction, handleOAuthCallback: handleOAuthCallbackAction, signInUrl: config.signInUrl, signUpUrl: config.signUpUrl, preferences: config.preferences, clientId: config.clientId, user: user, userProfile: userProfile, isSignedIn: _isSignedIn, children: children }));
112
+ const handleGetAllOrganizations = async (options, _sessionId) => {
113
+ 'use server';
114
+ return await getAllOrganizations(options, sessionId);
115
+ };
116
+ const handleSwitchOrganization = async (organization, _sessionId) => {
117
+ 'use server';
118
+ await switchOrganization(organization, sessionId);
119
+ // After switching organization, we need to refresh the page to get updated session data
120
+ // This is because server components don't maintain state between function calls
121
+ const { revalidatePath } = await import('next/cache');
122
+ // Revalidate the current path to refresh the component with new data
123
+ revalidatePath('/');
124
+ };
125
+ return (_jsx(AsgardeoClientProvider, { organizationHandle: config?.organizationHandle, applicationId: config?.applicationId, baseUrl: config?.baseUrl, signIn: signInAction, signOut: signOutAction, signUp: signUpAction, handleOAuthCallback: handleOAuthCallbackAction, signInUrl: config?.signInUrl, signUpUrl: config?.signUpUrl, preferences: config?.preferences, clientId: config?.clientId, user: user, currentOrganization: currentOrganization, userProfile: userProfile, updateProfile: updateUserProfileAction, isSignedIn: _isSignedIn, myOrganizations: myOrganizations, getAllOrganizations: handleGetAllOrganizations, switchOrganization: handleSwitchOrganization, brandingPreference: brandingPreference, children: children }));
57
126
  };
58
127
  export default AsgardeoServerProvider;
59
128
  //# sourceMappingURL=AsgardeoProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AsgardeoProvider.js","sourceRoot":"","sources":["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AE,MAAM,EAAE,SAAS,EAC5B,SAAS,EAAE,MAAM,EAAE,SAAS,EAC5B,WAAW,EAAE,MAAM,EAAE,WAAW,EAChC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAC1B,IAAI,EAAE,IAAI,EACV,mBAAmB,EAAE,mBAAmB,EACxC,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,uBAAuB,EACtC,UAAU,EAAE,WAAW,EACvB,eAAe,EAAE,eAAe,EAChC,mBAAmB,EAAE,yBAAyB,EAC9C,kBAAkB,EAAE,wBAAwB,EAC5C,kBAAkB,EAAE,kBAAkB,YAErC,QAAQ,GACc,CAC1B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { CreateOrganizationPayload, Organization } from '@asgardeo/node';
19
+ /**
20
+ * Server action to create an organization.
21
+ */
22
+ declare const createOrganizationAction: (payload: CreateOrganizationPayload, sessionId: string) => Promise<{
23
+ success: boolean;
24
+ data: {
25
+ organization: Organization;
26
+ user?: undefined;
27
+ };
28
+ error: null;
29
+ } | {
30
+ success: boolean;
31
+ data: {
32
+ user: {};
33
+ organization?: undefined;
34
+ };
35
+ error: string;
36
+ }>;
37
+ export default createOrganizationAction;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ 'use server';
19
+ import AsgardeoNextClient from '../../AsgardeoNextClient';
20
+ /**
21
+ * Server action to create an organization.
22
+ */
23
+ const createOrganizationAction = async (payload, sessionId) => {
24
+ try {
25
+ const client = AsgardeoNextClient.getInstance();
26
+ const organization = await client.createOrganization(payload, sessionId);
27
+ return { success: true, data: { organization }, error: null };
28
+ }
29
+ catch (error) {
30
+ return {
31
+ success: false,
32
+ data: {
33
+ user: {},
34
+ },
35
+ error: 'Failed to create organization',
36
+ };
37
+ }
38
+ };
39
+ export default createOrganizationAction;
40
+ //# sourceMappingURL=createOrganizationAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createOrganizationAction.js","sourceRoot":"","sources":["../../../src/server/actions/createOrganizationAction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,CAAC;AAGb,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAE1D;;GAEG;AACH,MAAM,wBAAwB,GAAG,KAAK,EAAE,OAAkC,EAAE,SAAiB,EAAE,EAAE;IAC/F,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;QAChD,MAAM,YAAY,GAAiB,MAAM,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACvF,OAAO,EAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAC,YAAY,EAAC,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,KAAK;YACd,IAAI,EAAE;gBACJ,IAAI,EAAE,EAAE;aACT;YACD,KAAK,EAAE,+BAA+B;SACvC,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { AllOrganizationsApiResponse } from '@asgardeo/node';
19
+ /**
20
+ * Server action to get organizations.
21
+ */
22
+ declare const getAllOrganizations: (options?: any, sessionId?: string | undefined) => Promise<AllOrganizationsApiResponse>;
23
+ export default getAllOrganizations;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ 'use server';
19
+ import { AsgardeoAPIError } from '@asgardeo/node';
20
+ import AsgardeoNextClient from '../../AsgardeoNextClient';
21
+ /**
22
+ * Server action to get organizations.
23
+ */
24
+ const getAllOrganizations = async (options, sessionId) => {
25
+ try {
26
+ const client = AsgardeoNextClient.getInstance();
27
+ return client.getAllOrganizations(options, sessionId);
28
+ }
29
+ catch (error) {
30
+ throw new AsgardeoAPIError(`Failed to get all the organizations for the user: ${error instanceof Error ? error.message : String(error)}`, 'getAllOrganizations-ServerActionError-001', 'nextjs', error instanceof AsgardeoAPIError ? error.statusCode : undefined);
31
+ }
32
+ };
33
+ export default getAllOrganizations;
34
+ //# sourceMappingURL=getAllOrganizations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAllOrganizations.js","sourceRoot":"","sources":["../../../src/server/actions/getAllOrganizations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,CAAC;AAEb,OAAO,EAA8B,gBAAgB,EAAe,MAAM,gBAAgB,CAAC;AAC3F,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAE1D;;GAEG;AACH,MAAM,mBAAmB,GAAG,KAAK,EAAE,OAAa,EAAE,SAA8B,EAAwC,EAAE;IACxH,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;QAChD,OAAO,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACxD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,gBAAgB,CACxB,qDAAqD,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAC7G,2CAA2C,EAC3C,QAAQ,EACR,KAAK,YAAY,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CACjE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { GetBrandingPreferenceConfig, BrandingPreference } from '@asgardeo/node';
19
+ /**
20
+ * Server action to get branding preferences.
21
+ */
22
+ declare const getBrandingPreference: (config: GetBrandingPreferenceConfig, sessionId?: string | undefined) => Promise<BrandingPreference>;
23
+ export default getBrandingPreference;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ 'use server';
19
+ import { AsgardeoAPIError, getBrandingPreference as baseGetBrandingPreference, } from '@asgardeo/node';
20
+ /**
21
+ * Server action to get branding preferences.
22
+ */
23
+ const getBrandingPreference = async (config, sessionId) => {
24
+ try {
25
+ return await baseGetBrandingPreference(config);
26
+ }
27
+ catch (error) {
28
+ throw new AsgardeoAPIError(`Failed to get branding preferences: ${error instanceof Error ? error.message : String(error)}`, 'getBrandingPreferenceAction-ServerActionError-001', 'nextjs', error instanceof AsgardeoAPIError ? error.statusCode : undefined);
29
+ }
30
+ };
31
+ export default getBrandingPreference;
32
+ //# sourceMappingURL=getBrandingPreference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBrandingPreference.js","sourceRoot":"","sources":["../../../src/server/actions/getBrandingPreference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,CAAC;AAEb,OAAO,EACL,gBAAgB,EAGhB,qBAAqB,IAAI,yBAAyB,GACnD,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,qBAAqB,GAAG,KAAK,EACjC,MAAmC,EACnC,SAA8B,EACD,EAAE;IAC/B,IAAI,CAAC;QACH,OAAO,MAAM,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,gBAAgB,CACxB,uCAAuC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAC/F,mDAAmD,EACnD,QAAQ,EACR,KAAK,YAAY,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CACjE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { Organization } from '@asgardeo/node';
19
+ /**
20
+ * Server action to create an organization.
21
+ */
22
+ declare const getCurrentOrganizationAction: (sessionId: string) => Promise<{
23
+ success: boolean;
24
+ data: {
25
+ organization: Organization;
26
+ user?: undefined;
27
+ };
28
+ error: null;
29
+ } | {
30
+ success: boolean;
31
+ data: {
32
+ user: {};
33
+ organization?: undefined;
34
+ };
35
+ error: string;
36
+ }>;
37
+ export default getCurrentOrganizationAction;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ 'use server';
19
+ import AsgardeoNextClient from '../../AsgardeoNextClient';
20
+ /**
21
+ * Server action to create an organization.
22
+ */
23
+ const getCurrentOrganizationAction = async (sessionId) => {
24
+ try {
25
+ const client = AsgardeoNextClient.getInstance();
26
+ const organization = await client.getCurrentOrganization(sessionId);
27
+ return { success: true, data: { organization }, error: null };
28
+ }
29
+ catch (error) {
30
+ return {
31
+ success: false,
32
+ data: {
33
+ user: {},
34
+ },
35
+ error: 'Failed to get the current organization',
36
+ };
37
+ }
38
+ };
39
+ export default getCurrentOrganizationAction;
40
+ //# sourceMappingURL=getCurrentOrganizationAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCurrentOrganizationAction.js","sourceRoot":"","sources":["../../../src/server/actions/getCurrentOrganizationAction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,CAAC;AAGb,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAE1D;;GAEG;AACH,MAAM,4BAA4B,GAAG,KAAK,EAAE,SAAiB,EAAE,EAAE;IAC/D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;QAChD,MAAM,YAAY,GAAiB,MAAM,MAAM,CAAC,sBAAsB,CAAC,SAAS,CAAiB,CAAC;QAClG,OAAO,EAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAC,YAAY,EAAC,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,KAAK;YACd,IAAI,EAAE;gBACJ,IAAI,EAAE,EAAE;aACT;YACD,KAAK,EAAE,wCAAwC;SAChD,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { Organization } from '@asgardeo/node';
19
+ /**
20
+ * Server action to get organizations.
21
+ */
22
+ declare const getMyOrganizations: (options?: any, sessionId?: string | undefined) => Promise<Organization[]>;
23
+ export default getMyOrganizations;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ 'use server';
19
+ import { AsgardeoAPIError } from '@asgardeo/node';
20
+ import AsgardeoNextClient from '../../AsgardeoNextClient';
21
+ /**
22
+ * Server action to get organizations.
23
+ */
24
+ const getMyOrganizations = async (options, sessionId) => {
25
+ try {
26
+ const client = AsgardeoNextClient.getInstance();
27
+ return await client.getMyOrganizations(options, sessionId);
28
+ }
29
+ catch (error) {
30
+ throw new AsgardeoAPIError(`Failed to get the organizations for the user: ${error instanceof Error ? error.message : String(error)}`, 'getMyOrganizations-ServerActionError-001', 'nextjs', error instanceof AsgardeoAPIError ? error.statusCode : undefined);
31
+ }
32
+ };
33
+ export default getMyOrganizations;
34
+ //# sourceMappingURL=getMyOrganizations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getMyOrganizations.js","sourceRoot":"","sources":["../../../src/server/actions/getMyOrganizations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,CAAC;AAEb,OAAO,EAAC,gBAAgB,EAAe,MAAM,gBAAgB,CAAC;AAC9D,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAE1D;;GAEG;AACH,MAAM,kBAAkB,GAAG,KAAK,EAAE,OAAa,EAAE,SAA8B,EAA2B,EAAE;IAC1G,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;QAChD,OAAO,MAAM,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC7D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,gBAAgB,CACxB,iDAAiD,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EACzG,0CAA0C,EAC1C,QAAQ,EACR,KAAK,YAAY,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CACjE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}