@burdenoff/microfe-organization 2026.514.1 → 2026.518.1
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/generated/global-operations.d.ts +50 -0
- package/dist/generated/global-operations.d.ts.map +1 -1
- package/dist/generated/global-operations.js +90 -70
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/organization-management/AdminOrganizationRoutes.d.ts.map +1 -1
- package/dist/organization-management/AdminOrganizationRoutes.js +1 -1
- package/dist/organization-management/AdminOrganizationRoutes.js.map +1 -1
- package/dist/organization-management/UserOrganizationRoot.d.ts +11 -4
- package/dist/organization-management/UserOrganizationRoot.d.ts.map +1 -1
- package/dist/organization-management/UserOrganizationRoot.js +23 -16
- package/dist/organization-management/UserOrganizationRoot.js.map +1 -1
- package/dist/organization-management/UserOrganizationRoutes.d.ts +27 -5
- package/dist/organization-management/UserOrganizationRoutes.d.ts.map +1 -1
- package/dist/organization-management/UserOrganizationRoutes.js +61 -20
- package/dist/organization-management/UserOrganizationRoutes.js.map +1 -1
- package/dist/organization-management/modules/organizations/hooks/useOrganizations.d.ts +32 -0
- package/dist/organization-management/modules/organizations/hooks/useOrganizations.d.ts.map +1 -1
- package/dist/organization-management/modules/organizations/hooks/useOrganizations.js +64 -42
- package/dist/organization-management/modules/organizations/hooks/useOrganizations.js.map +1 -1
- package/dist/organization-management/modules/organizations/pages/OrganizationsListPage.d.ts +18 -1
- package/dist/organization-management/modules/organizations/pages/OrganizationsListPage.d.ts.map +1 -1
- package/dist/organization-management/modules/organizations/pages/OrganizationsListPage.js +205 -200
- package/dist/organization-management/modules/organizations/pages/OrganizationsListPage.js.map +1 -1
- package/dist/organization-management/modules/workspaces/schemas/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOrganizations.js","names":[],"sources":["../../../../../src/organization-management/modules/organizations/hooks/useOrganizations.ts"],"sourcesContent":["import {\n useGetOrganizationsQuery,\n useGetOrganizationQuery,\n useGetOrganizationBySlugQuery,\n useGetOrganizationsByTenantQuery,\n useCreateOrganizationMutation,\n useUpdateOrganizationMutation,\n useDeleteOrganizationMutation,\n} from '../../../../generated/global-operations';\nimport type {\n Organization,\n OrganizationFilterInput,\n CreateOrganizationInput,\n UpdateOrganizationInput,\n} from '../types';\nimport { useOrganizationEventEmitter } from '../../../hooks/useOrganizationEventEmitter';\nimport { logger, redactId } from '../../../shared/logger';\nimport { executeRecaptcha } from '../../../shared/recaptcha';\n\ninterface GraphqlExtensions {\n code?: string;\n}\n\ninterface GraphqlError {\n message?: string;\n extensions?: GraphqlExtensions;\n}\n\ninterface ApolloLikeError {\n message?: string;\n graphQLErrors?: ReadonlyArray<GraphqlError>;\n}\n\nfunction extractErrorCode(error: unknown): string | undefined {\n const apolloError = error as ApolloLikeError | undefined;\n return apolloError?.graphQLErrors?.[0]?.extensions?.code;\n}\n\nfunction extractErrorMessage(error: unknown): string {\n if (error instanceof Error) return error.message;\n const apolloError = error as ApolloLikeError | undefined;\n return apolloError?.message ?? 'Unknown error';\n}\n\n/**\n * Hook to fetch organizations with filtering and pagination\n */\nexport function useOrganizations(\n filter?: OrganizationFilterInput,\n limit: number = 20,\n offset: number = 0,\n enabled: boolean = true\n) {\n const { data, loading, error, refetch, fetchMore } = useGetOrganizationsQuery({\n variables: { filter, limit, offset },\n skip: !enabled,\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n return {\n organizations: (data?.organizations?.items as Organization[]) || [],\n total: data?.organizations?.total || 0,\n limit: data?.organizations?.limit || limit,\n offset: data?.organizations?.offset || offset,\n hasMore: data?.organizations?.hasMore || false,\n loading,\n error,\n refetch,\n fetchMore,\n };\n}\n\n/**\n * Hook to fetch a single organization by ID\n */\nexport function useOrganization(id: string) {\n const { data, loading, error, refetch } = useGetOrganizationQuery({\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n const organization = data?.organization as Organization | undefined;\n\n return {\n organization,\n loading: loading && !organization,\n error,\n refetch,\n };\n}\n\n/**\n * Hook to fetch an organization by slug\n */\nexport function useOrganizationBySlug(tenantId: string, slug: string) {\n const { data, loading, error, refetch } = useGetOrganizationBySlugQuery({\n variables: { tenantId, slug },\n skip: !tenantId || !slug,\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n return {\n organization: data?.organizationBySlug as Organization | undefined,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Hook to fetch organizations by tenant ID\n */\nexport function useOrganizationsByTenant(tenantId: string, limit: number = 20, offset: number = 0) {\n const { data, loading, error, refetch, fetchMore } = useGetOrganizationsByTenantQuery({\n variables: { tenantId, limit, offset },\n skip: !tenantId,\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n return {\n organizations: (data?.organizations?.items as Organization[]) || [],\n total: data?.organizations?.total || 0,\n limit: data?.organizations?.limit || limit,\n offset: data?.organizations?.offset || offset,\n hasMore: data?.organizations?.hasMore || false,\n loading,\n error,\n refetch,\n fetchMore,\n };\n}\n\n/**\n * Hook to create a new organization\n */\nexport function useCreateOrganization() {\n const { emit } = useOrganizationEventEmitter();\n const [createOrganization, { data, loading, error }] = useCreateOrganizationMutation();\n\n return {\n createOrganization: async (input: CreateOrganizationInput) => {\n logger.info('mutation.start', { name: 'createOrganization' });\n try {\n const recaptchaToken = await executeRecaptcha('organization_create');\n const result = await createOrganization({\n variables: {\n input: {\n ...input,\n ...(recaptchaToken ? { recaptchaToken } : {}),\n },\n },\n });\n const organizationId = result.data?.createOrganization?.id;\n emit('organization.created', { organizationId, source: 'microfe-organization' });\n logger.info('mutation.success', {\n name: 'createOrganization',\n organizationId: redactId(organizationId),\n });\n return result;\n } catch (mutationError) {\n const errorCode = extractErrorCode(mutationError);\n const errorMessage = extractErrorMessage(mutationError);\n emit('organization.create_failed', {\n source: 'microfe-organization',\n errorCode,\n errorMessage,\n });\n logger.error(\n 'mutation.failed',\n { name: 'createOrganization', errorCode, errorMessage },\n mutationError\n );\n throw mutationError;\n }\n },\n data,\n loading,\n error,\n };\n}\n\n/**\n * Hook to update an organization\n */\nexport function useUpdateOrganization() {\n const { emit } = useOrganizationEventEmitter();\n const [updateOrganization, { data, loading, error }] = useUpdateOrganizationMutation();\n\n return {\n updateOrganization: async (id: string, input: UpdateOrganizationInput) => {\n logger.info('mutation.start', {\n name: 'updateOrganization',\n organizationId: redactId(id),\n });\n try {\n const result = await updateOrganization({ variables: { id, input } });\n emit('organization.updated', { organizationId: id, source: 'microfe-organization' });\n logger.info('mutation.success', {\n name: 'updateOrganization',\n organizationId: redactId(id),\n });\n return result;\n } catch (mutationError) {\n const errorCode = extractErrorCode(mutationError);\n const errorMessage = extractErrorMessage(mutationError);\n emit('organization.update_failed', {\n organizationId: id,\n source: 'microfe-organization',\n errorCode,\n errorMessage,\n });\n logger.error(\n 'mutation.failed',\n {\n name: 'updateOrganization',\n organizationId: redactId(id),\n errorCode,\n errorMessage,\n },\n mutationError\n );\n throw mutationError;\n }\n },\n data,\n loading,\n error,\n };\n}\n\n/**\n * Hook to delete an organization\n */\nexport function useDeleteOrganization() {\n const { emit } = useOrganizationEventEmitter();\n const [deleteOrganization, { data, loading, error }] = useDeleteOrganizationMutation();\n\n return {\n deleteOrganization: async (id: string) => {\n logger.info('mutation.start', {\n name: 'deleteOrganization',\n organizationId: redactId(id),\n });\n try {\n const result = await deleteOrganization({ variables: { id } });\n emit('organization.deleted', { organizationId: id, source: 'microfe-organization' });\n logger.info('mutation.success', {\n name: 'deleteOrganization',\n organizationId: redactId(id),\n });\n return result;\n } catch (mutationError) {\n const errorCode = extractErrorCode(mutationError);\n const errorMessage = extractErrorMessage(mutationError);\n emit('organization.delete_failed', {\n organizationId: id,\n source: 'microfe-organization',\n errorCode,\n errorMessage,\n });\n logger.error(\n 'mutation.failed',\n {\n name: 'deleteOrganization',\n organizationId: redactId(id),\n errorCode,\n errorMessage,\n },\n mutationError\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AAoB,OAAO,MAAe;AACxC,KAAO,KAAK,kBAAkB;IAC5B,MAAM;IACN,gBAAgB,EAAS,EAAG;IAC7B,CAAC;AACF,OAAI;IACF,IAAM,IAAS,MAAM,EAAmB,EAAE,WAAW,EAAE,OAAI,EAAE,CAAC;AAM9D,WALA,EAAK,wBAAwB;KAAE,gBAAgB;KAAI,QAAQ;KAAwB,CAAC,EACpF,EAAO,KAAK,oBAAoB;KAC9B,MAAM;KACN,gBAAgB,EAAS,EAAG;KAC7B,CAAC,EACK;YACA,GAAe;IACtB,IAAM,IAAY,EAAiB,EAAc,EAC3C,IAAe,EAAoB,EAAc;AAiBvD,UAhBA,EAAK,8BAA8B;KACjC,gBAAgB;KAChB,QAAQ;KACR;KACA;KACD,CAAC,EACF,EAAO,MACL,mBACA;KACE,MAAM;KACN,gBAAgB,EAAS,EAAG;KAC5B;KACA;KACD,EACD,EACD,EACK;;;EAGV;EACA;EACA;EACD"}
|
|
1
|
+
{"version":3,"file":"useOrganizations.js","names":[],"sources":["../../../../../src/organization-management/modules/organizations/hooks/useOrganizations.ts"],"sourcesContent":["import {\n useGetOrganizationsQuery,\n useGetMyOrganizationsQuery,\n useGetOrganizationQuery,\n useGetOrganizationBySlugQuery,\n useGetOrganizationsByTenantQuery,\n useCreateOrganizationMutation,\n useUpdateOrganizationMutation,\n useDeleteOrganizationMutation,\n} from '../../../../generated/global-operations';\nimport type {\n Organization,\n OrganizationFilterInput,\n CreateOrganizationInput,\n UpdateOrganizationInput,\n} from '../types';\nimport { useOrganizationEventEmitter } from '../../../hooks/useOrganizationEventEmitter';\nimport { logger, redactId } from '../../../shared/logger';\nimport { executeRecaptcha } from '../../../shared/recaptcha';\n\ninterface GraphqlExtensions {\n code?: string;\n}\n\ninterface GraphqlError {\n message?: string;\n extensions?: GraphqlExtensions;\n}\n\ninterface ApolloLikeError {\n message?: string;\n graphQLErrors?: ReadonlyArray<GraphqlError>;\n}\n\nfunction extractErrorCode(error: unknown): string | undefined {\n const apolloError = error as ApolloLikeError | undefined;\n return apolloError?.graphQLErrors?.[0]?.extensions?.code;\n}\n\nfunction extractErrorMessage(error: unknown): string {\n if (error instanceof Error) return error.message;\n const apolloError = error as ApolloLikeError | undefined;\n return apolloError?.message ?? 'Unknown error';\n}\n\n/**\n * Hook to fetch organizations with filtering and pagination\n *\n * @deprecated Calls the platform-wide `organizations` admin query — which is\n * gated by global RBAC perm and will be removed once callers migrate. For the\n * end-user \"my orgs\" view use `useMyOrganizations`. For the admin \"all orgs\"\n * view (once the admin app pages land) use the upcoming `useAllOrganizations`.\n */\nexport function useOrganizations(\n filter?: OrganizationFilterInput,\n limit: number = 20,\n offset: number = 0,\n enabled: boolean = true\n) {\n const { data, loading, error, refetch, fetchMore } = useGetOrganizationsQuery({\n variables: { filter, limit, offset },\n skip: !enabled,\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n return {\n organizations: (data?.organizations?.items as Organization[]) || [],\n total: data?.organizations?.total || 0,\n limit: data?.organizations?.limit || limit,\n offset: data?.organizations?.offset || offset,\n hasMore: data?.organizations?.hasMore || false,\n loading,\n error,\n refetch,\n fetchMore,\n };\n}\n\n/**\n * Hook to fetch organizations the current user is a member of (owned + added to).\n *\n * Backed by the `myOrganizations` query which uses @rbac(scopeType: \"self\") —\n * authenticated user only, no permission check, resolver filters by actorId.\n * Use this in product-app contexts where the user should see *their* orgs.\n *\n * Filter input is intentionally not supported — `myOrganizations` returns the\n * full membership list and any further filtering should be done client-side\n * (or via a future `myOrganizationsFiltered` query if the use-case warrants it).\n */\nexport function useMyOrganizations(\n limit: number = 20,\n offset: number = 0,\n enabled: boolean = true\n) {\n const { data, loading, error, refetch, fetchMore } = useGetMyOrganizationsQuery({\n variables: { limit, offset },\n skip: !enabled,\n // First mount: use cache if present, then revalidate from the network in\n // the background. Subsequent renders within the same session reuse the\n // cache. This keeps the list fresh when the user navigates back after\n // accepting an invite in another tab without paying the round-trip on\n // every re-render.\n fetchPolicy: 'cache-and-network',\n nextFetchPolicy: 'cache-first',\n });\n\n return {\n organizations: (data?.myOrganizations?.items as Organization[]) || [],\n total: data?.myOrganizations?.total || 0,\n limit: data?.myOrganizations?.limit || limit,\n offset: data?.myOrganizations?.offset || offset,\n hasMore: data?.myOrganizations?.hasMore || false,\n loading,\n error,\n refetch,\n fetchMore,\n };\n}\n\n/**\n * Hook to fetch a single organization by ID\n */\nexport function useOrganization(id: string) {\n const { data, loading, error, refetch } = useGetOrganizationQuery({\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n const organization = data?.organization as Organization | undefined;\n\n return {\n organization,\n loading: loading && !organization,\n error,\n refetch,\n };\n}\n\n/**\n * Hook to fetch an organization by slug\n */\nexport function useOrganizationBySlug(tenantId: string, slug: string) {\n const { data, loading, error, refetch } = useGetOrganizationBySlugQuery({\n variables: { tenantId, slug },\n skip: !tenantId || !slug,\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n return {\n organization: data?.organizationBySlug as Organization | undefined,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Hook to fetch organizations by tenant ID\n */\nexport function useOrganizationsByTenant(tenantId: string, limit: number = 20, offset: number = 0) {\n const { data, loading, error, refetch, fetchMore } = useGetOrganizationsByTenantQuery({\n variables: { tenantId, limit, offset },\n skip: !tenantId,\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n return {\n organizations: (data?.organizations?.items as Organization[]) || [],\n total: data?.organizations?.total || 0,\n limit: data?.organizations?.limit || limit,\n offset: data?.organizations?.offset || offset,\n hasMore: data?.organizations?.hasMore || false,\n loading,\n error,\n refetch,\n fetchMore,\n };\n}\n\n/**\n * Hook to create a new organization\n */\nexport function useCreateOrganization() {\n const { emit } = useOrganizationEventEmitter();\n const [createOrganization, { data, loading, error }] = useCreateOrganizationMutation();\n\n return {\n createOrganization: async (input: CreateOrganizationInput) => {\n logger.info('mutation.start', { name: 'createOrganization' });\n try {\n const recaptchaToken = await executeRecaptcha('organization_create');\n const result = await createOrganization({\n variables: {\n input: {\n ...input,\n ...(recaptchaToken ? { recaptchaToken } : {}),\n },\n },\n });\n const organizationId = result.data?.createOrganization?.id;\n emit('organization.created', { organizationId, source: 'microfe-organization' });\n logger.info('mutation.success', {\n name: 'createOrganization',\n organizationId: redactId(organizationId),\n });\n return result;\n } catch (mutationError) {\n const errorCode = extractErrorCode(mutationError);\n const errorMessage = extractErrorMessage(mutationError);\n emit('organization.create_failed', {\n source: 'microfe-organization',\n errorCode,\n errorMessage,\n });\n logger.error(\n 'mutation.failed',\n { name: 'createOrganization', errorCode, errorMessage },\n mutationError\n );\n throw mutationError;\n }\n },\n data,\n loading,\n error,\n };\n}\n\n/**\n * Hook to update an organization\n */\nexport function useUpdateOrganization() {\n const { emit } = useOrganizationEventEmitter();\n const [updateOrganization, { data, loading, error }] = useUpdateOrganizationMutation();\n\n return {\n updateOrganization: async (id: string, input: UpdateOrganizationInput) => {\n logger.info('mutation.start', {\n name: 'updateOrganization',\n organizationId: redactId(id),\n });\n try {\n const result = await updateOrganization({ variables: { id, input } });\n emit('organization.updated', { organizationId: id, source: 'microfe-organization' });\n logger.info('mutation.success', {\n name: 'updateOrganization',\n organizationId: redactId(id),\n });\n return result;\n } catch (mutationError) {\n const errorCode = extractErrorCode(mutationError);\n const errorMessage = extractErrorMessage(mutationError);\n emit('organization.update_failed', {\n organizationId: id,\n source: 'microfe-organization',\n errorCode,\n errorMessage,\n });\n logger.error(\n 'mutation.failed',\n {\n name: 'updateOrganization',\n organizationId: redactId(id),\n errorCode,\n errorMessage,\n },\n mutationError\n );\n throw mutationError;\n }\n },\n data,\n loading,\n error,\n };\n}\n\n/**\n * Hook to delete an organization\n */\nexport function useDeleteOrganization() {\n const { emit } = useOrganizationEventEmitter();\n const [deleteOrganization, { data, loading, error }] = useDeleteOrganizationMutation();\n\n return {\n deleteOrganization: async (id: string) => {\n logger.info('mutation.start', {\n name: 'deleteOrganization',\n organizationId: redactId(id),\n });\n try {\n const result = await deleteOrganization({ variables: { id } });\n emit('organization.deleted', { organizationId: id, source: 'microfe-organization' });\n logger.info('mutation.success', {\n name: 'deleteOrganization',\n organizationId: redactId(id),\n });\n return result;\n } catch (mutationError) {\n const errorCode = extractErrorCode(mutationError);\n const errorMessage = extractErrorMessage(mutationError);\n emit('organization.delete_failed', {\n organizationId: id,\n source: 'microfe-organization',\n errorCode,\n errorMessage,\n });\n logger.error(\n 'mutation.failed',\n {\n name: 'deleteOrganization',\n organizationId: redactId(id),\n errorCode,\n errorMessage,\n },\n mutationError\n );\n throw mutationError;\n }\n },\n data,\n loading,\n error,\n };\n}\n"],"mappings":";;;;;AAkCA,SAAS,EAAiB,GAAoC;AAE5D,QADoB,GACA,gBAAgB,IAAI,YAAY;;AAGtD,SAAS,EAAoB,GAAwB;AAGnD,QAFI,aAAiB,QAAc,EAAM,UACrB,GACA,WAAW;;AAWjC,SAAgB,EACd,GACA,IAAgB,IAChB,IAAiB,GACjB,IAAmB,IACnB;CACA,IAAM,EAAE,SAAM,YAAS,UAAO,YAAS,iBAAc,EAAyB;EAC5E,WAAW;GAAE;GAAQ;GAAO;GAAQ;EACpC,MAAM,CAAC;EACP,aAAa;EACb,iBAAiB;EAClB,CAAC;AAEF,QAAO;EACL,eAAgB,GAAM,eAAe,SAA4B,EAAE;EACnE,OAAO,GAAM,eAAe,SAAS;EACrC,OAAO,GAAM,eAAe,SAAS;EACrC,QAAQ,GAAM,eAAe,UAAU;EACvC,SAAS,GAAM,eAAe,WAAW;EACzC;EACA;EACA;EACA;EACD;;AAcH,SAAgB,EACd,IAAgB,IAChB,IAAiB,GACjB,IAAmB,IACnB;CACA,IAAM,EAAE,SAAM,YAAS,UAAO,YAAS,iBAAc,EAA2B;EAC9E,WAAW;GAAE;GAAO;GAAQ;EAC5B,MAAM,CAAC;EAMP,aAAa;EACb,iBAAiB;EAClB,CAAC;AAEF,QAAO;EACL,eAAgB,GAAM,iBAAiB,SAA4B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KACR;KACA;KACD,CAAC,EACF,EAAO,MACL,mBACA;KACE,MAAM;KACN,gBAAgB,EAAS,EAAG;KAC5B;KACA;KACD,EACD,EACD,EACK;;;EAGV;EACA;EACA;EACD"}
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `mode` controls which scope of organizations the page renders:
|
|
3
|
+
*
|
|
4
|
+
* - `'my'` (default) calls `myOrganizations` (gateway @rbac(scopeType:"self")).
|
|
5
|
+
* Use this in product-app shells (e.g. vibecontrols) where the user should
|
|
6
|
+
* see only orgs they are a member of. Membership IS the access list, so no
|
|
7
|
+
* client-side permission gate is needed.
|
|
8
|
+
*
|
|
9
|
+
* - `'admin'` calls the legacy `organizations` query (gateway @rbac(scopeType:
|
|
10
|
+
* "global")). Restricted to actors with global `organization:read` (super
|
|
11
|
+
* admins / service / custom global-admin roles). Use this in the admin app
|
|
12
|
+
* where operators need the tenant-wide list. Once `allOrganizations` is
|
|
13
|
+
* published through Hive Cloud + codegen, switch to `useAllOrganizations`.
|
|
14
|
+
*/
|
|
15
|
+
export interface OrganizationsListPageProps {
|
|
16
|
+
mode?: 'my' | 'admin';
|
|
17
|
+
}
|
|
18
|
+
export declare function OrganizationsListPage({ mode }?: OrganizationsListPageProps): import("react/jsx-runtime").JSX.Element;
|
|
2
19
|
//# sourceMappingURL=OrganizationsListPage.d.ts.map
|
package/dist/organization-management/modules/organizations/pages/OrganizationsListPage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationsListPage.d.ts","sourceRoot":"","sources":["../../../../../src/organization-management/modules/organizations/pages/OrganizationsListPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OrganizationsListPage.d.ts","sourceRoot":"","sources":["../../../../../src/organization-management/modules/organizations/pages/OrganizationsListPage.tsx"],"names":[],"mappings":"AAkCA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,0BAA0B;IACzC,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,EAAE,IAAW,EAAE,GAAE,0BAA+B,2CA6iBrF"}
|