@iblai/iblai-js 2.20.0 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import React__default, { useState, useEffect, forwardRef, createElement as createElement$3, useLayoutEffect, createContext, useContext, useMemo, useReducer, useRef, useImperativeHandle, useCallback, isValidElement, Children, PureComponent, cloneElement, Component as Component$1, Fragment as Fragment$2, useId as useId$2, useDebugValue, lazy, Suspense } from 'react';
4
4
  import * as dataLayer from '@iblai/data-layer';
5
- import { useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useGetUserProfileSummaryQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useGetLearnerDetailsQuery, useGetUserEnrolledCoursesQuery, useGetUserEnrolledProgramsQuery, useGetUserCatalogPathwaysQuery, useGetUsersAsAssertionsQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useUpdateMentorMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, useDeleteMentorMemoryMutation, useGetAiSearchMentorsQuery, useStarMentorMutation, useUnstarMentorMutation, useGetUserChatHistoryReportsQuery, USER_CHAT_HISTORY_REPORT_ACTIVE_STATES, useCreateUserChatHistoryReportMutation, useLazyGetDownloadReportFromURLQuery, useGetUserChatHistoryReportStatusQuery, userChatHistoryApiSlice, USER_CHAT_HISTORY_QUERY_KEYS, useGetUserChatHistoryQuery, useGetUserChatHistoryFilterQuery, useGetMentorsQuery, useGetUserChatHistorySessionQuery, useUserLlmUsageSummary, useUserLlmSpendOverTime, useUserLlmCostByModel, useUserLlmCostByService, useUserLlmRecentActivity, USER_LLM_RECENT_ACTIVITY_PAGE_SIZE, useUserLlmTraceObservations, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useGetVectorDocumentsQuery, useGetLlmsQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, useGetAccessibleUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useGetApplicationFormsQuery, useGetApplicationFormDetailQuery, useCreateApplicationFormMutation, useUpdateApplicationFormMutation, useGetApplicationAdminDetailQuery, useInviteApplicationCandidateMutation, useLazyGetApplicationAttachmentFileQuery, useCreateApplicationWaiverMutation, useDeleteApplicationWaiverMutation, useSubmitApplicationOverrideMutation, useUpdateApplicationPlacementMutation, useDeleteApplicationCourseAssignmentMutation, useCreateApplicationNoteMutation, useUpdateApplicationNoteMutation, useDeleteApplicationNoteMutation, useTransitionApplicationMutation, useLinkApplicationCandidateMutation, useCreateApplicationPlacementsMutation, useGetCustomMentorsQuery, useCreateApplicationCourseAssignmentsMutation, useGetApplicationBlocksQuery, useDeleteApplicationBlockMutation, useGetApplicationsPipelineStatsQuery, useGetApplicationsPipelineQuery, useGetTenantMetadataQuery, useUpdateTenantMetadataMutation, useLazyGetTenantMetadataQuery, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useGetAgentSpendCapQuery, useGetTenantSpendCapQuery, useListAgentUserSpendCapsQuery, useUpsertAgentSpendCapMutation, useDeleteAgentSpendCapMutation, useUpsertTenantSpendCapMutation, useDeleteTenantSpendCapMutation, useUpsertUserSpendCapMutation, useDeleteUserSpendCapMutation, useGetLlmUsageMetricsQuery, useListAgentSpendCapsQuery, useGetCreditTransactionsQuery, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, VERCEL_SPA, useGetCustomDomainsQuery, useGetHostingProjectsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useCreateHostingProjectDomainMutation, useUpdateHostingDomainMutation, useDeleteHostingDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useCreateMentorMemoryMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetMentorSkillAssignmentsQuery, useGetAgentSkillsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useUploadLightLogoMutation, useUploadDarkLogoMutation, useUpdatePlatformInfoMutation, LOGO_ENDPOINTS, useCreateEvalDatasetMutation, useAddEvalDatasetItemsMutation, useUploadEvalDatasetCsvMutation, useDeleteEvalDatasetItemMutation, useListEvalDatasetItemsQuery, evalTotalPages, useListEvalDatasetsQuery, useGetUserProjectsQuery, useCreateSessionIdMutation, useGetMentorCategoriesQuery, useGetTenantChatPrivacyConfigQuery as useGetTenantChatPrivacyConfigQuery$1, useGetCallConfigurationsQuery, useCreateCallConfigurationMutation, useUpdateCallConfigurationMutation, chatPrivacyApiSlice, useDeleteMentorMutation, useForkMentorMutation, useGetToolsQuery, useLazyGetMCPServersQuery, useOauthFindMutation, useLazyStartOAuthFlowQuery, useCreateMCPServerMutation, usePartialUpdateMCPServerMutation, useCreateMCPServerConnectionMutation, usePatchMCPServerConnectionMutation, useGetConnectedServicesQuery, useGetMCPServersQuery, useGetMCPServerConnectionsQuery, useUpdateMCPServerMutation, useDeleteMCPServerMutation, useEditMentorJsonMutation, useDisconnectServiceMutation, useGetPromptCategoriesQuery, PRIVACY_ACTIONS, PRIVACY_ENTITY_TYPES, useGetVoicesQuery, useGetVoiceQuery, isBaseAgentMentor, useGetGradeResultQuery, useOverrideGradeResultMutation, useGetChatHistoryFilterQuery, useListGradeResultsQuery, useGetMentorGraderConfigurationQuery, useListGraderCriteriaQuery, useCreateMentorGraderConfigurationMutation, useUpdateMentorGraderConfigurationMutation, useCreateGraderCriterionMutation, useUpdateGraderCriterionMutation, useDeleteGraderCriterionMutation, useGetSpendCapStatusQuery, useGetMentorPublicSettingsQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useGetSupportTicketsQuery, useGetSupportTicketMessagesQuery, useCreateSupportTicketMessageMutation, usePatchSupportTicketMutation, useCloseSupportTicketMutation, useCreateLtiMentorMutation, useUpdateLtiMentorMutation, useGetLtiMentorsQuery, useDeleteLtiMentorMutation, useCreateLtiKeyMutation, useUpdateLtiKeyMutation, useDeleteLtiKeyMutation, useGetLtiKeysQuery, useCreateLtiToolMutation, useUpdateLtiToolMutation, useGetLtiToolsQuery, useGetPlatformInfoQuery, useCreatePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useCreateRedirectTokenMutation, useGetShareableLinkQuery, useCreateShareableLinkMutation, useUpdateShareableLinkMutation, useCreateDisclaimerMutation, useUpdateDisclaimerMutation, useGetDisclaimersQuery, useUpdateRbacMentorAccessMutation, useGetRbacMentorAccessListQuery, useStartEvalRunMutation, useEvaluateEvalRunMutation, useGetEvalRunQuery, useDeleteEvalScoreMutation, useListEvalRunJudgesQuery, useCreateEvalScoreMutation, useDeleteEvalRunMutation, useExportEvalRunMutation, useListEvalRunsQuery, useLazyGetEvalRunQuery, evaluationsApiSlice, EVALUATIONS_TAGS, useGetPersonnalizedMentorsQuery, useCreateCallCredentialsMutation, useGetGuidedPromptsQuery, useUpdateChatSessionSharedMutation, useUpdateMessageFeedbackMutation, useLazyGetPromptsSearchQuery, useLazyGetGuidedPromptsQuery, useGetPublicMentorsQuery, useGetPeriodicAgentsQuery, useGetPeriodicAgentLogsListQuery, useCreatePeriodicAgentMutation, useDeletePeriodicAgentMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
5
+ import { useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useGetUserProfileSummaryQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useGetLearnerCourseOutlineQuery, getSections, findResumeBlock, flattenOutline, normalizeLearnerCompletionError, useGetLearnerDetailsQuery, useGetUserEnrolledCoursesQuery, useGetUserEnrolledProgramsQuery, useGetUserCatalogPathwaysQuery, useGetUsersAsAssertionsQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useUpdateMentorMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, useDeleteMentorMemoryMutation, useGetAiSearchMentorsQuery, useStarMentorMutation, useUnstarMentorMutation, useGetUserChatHistoryReportsQuery, USER_CHAT_HISTORY_REPORT_ACTIVE_STATES, useCreateUserChatHistoryReportMutation, useLazyGetDownloadReportFromURLQuery, useGetUserChatHistoryReportStatusQuery, userChatHistoryApiSlice, USER_CHAT_HISTORY_QUERY_KEYS, useGetUserChatHistoryQuery, useGetUserChatHistoryFilterQuery, useGetMentorsQuery, useGetUserChatHistorySessionQuery, useUserLlmUsageSummary, useUserLlmSpendOverTime, useUserLlmCostByModel, useUserLlmCostByService, useUserLlmRecentActivity, USER_LLM_RECENT_ACTIVITY_PAGE_SIZE, useUserLlmTraceObservations, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useGetVectorDocumentsQuery, useGetLlmsQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, useGetAccessibleUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useGetApplicationFormsQuery, useGetApplicationFormDetailQuery, useCreateApplicationFormMutation, useUpdateApplicationFormMutation, useGetApplicationAdminDetailQuery, useInviteApplicationCandidateMutation, useLazyGetApplicationAttachmentFileQuery, useCreateApplicationWaiverMutation, useDeleteApplicationWaiverMutation, useSubmitApplicationOverrideMutation, useUpdateApplicationPlacementMutation, useDeleteApplicationCourseAssignmentMutation, useCreateApplicationNoteMutation, useUpdateApplicationNoteMutation, useDeleteApplicationNoteMutation, useTransitionApplicationMutation, useLinkApplicationCandidateMutation, useCreateApplicationPlacementsMutation, useGetCustomMentorsQuery, useCreateApplicationCourseAssignmentsMutation, useGetApplicationBlocksQuery, useDeleteApplicationBlockMutation, useGetApplicationsPipelineStatsQuery, useGetApplicationsPipelineQuery, useGetTenantMetadataQuery, useUpdateTenantMetadataMutation, useLazyGetTenantMetadataQuery, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useGetAgentSpendCapQuery, useGetTenantSpendCapQuery, useListAgentUserSpendCapsQuery, useUpsertAgentSpendCapMutation, useDeleteAgentSpendCapMutation, useUpsertTenantSpendCapMutation, useDeleteTenantSpendCapMutation, useUpsertUserSpendCapMutation, useDeleteUserSpendCapMutation, useGetLlmUsageMetricsQuery, useListAgentSpendCapsQuery, useGetCreditTransactionsQuery, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, VERCEL_SPA, useGetCustomDomainsQuery, useGetHostingProjectsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useCreateHostingProjectDomainMutation, useUpdateHostingDomainMutation, useDeleteHostingDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useCreateMentorMemoryMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetMentorSkillAssignmentsQuery, useGetAgentSkillsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useUploadLightLogoMutation, useUploadDarkLogoMutation, useUpdatePlatformInfoMutation, LOGO_ENDPOINTS, useCreateEvalDatasetMutation, useAddEvalDatasetItemsMutation, useUploadEvalDatasetCsvMutation, useDeleteEvalDatasetItemMutation, useListEvalDatasetItemsQuery, evalTotalPages, useListEvalDatasetsQuery, useGetUserProjectsQuery, useCreateSessionIdMutation, useGetMentorCategoriesQuery, useGetTenantChatPrivacyConfigQuery as useGetTenantChatPrivacyConfigQuery$1, useGetCallConfigurationsQuery, useCreateCallConfigurationMutation, useUpdateCallConfigurationMutation, chatPrivacyApiSlice, useDeleteMentorMutation, useForkMentorMutation, useGetToolsQuery, useLazyGetMCPServersQuery, useOauthFindMutation, useLazyStartOAuthFlowQuery, useCreateMCPServerMutation, usePartialUpdateMCPServerMutation, useCreateMCPServerConnectionMutation, usePatchMCPServerConnectionMutation, useGetConnectedServicesQuery, useGetMCPServersQuery, useGetMCPServerConnectionsQuery, useUpdateMCPServerMutation, useDeleteMCPServerMutation, useEditMentorJsonMutation, useDisconnectServiceMutation, useGetPromptCategoriesQuery, PRIVACY_ACTIONS, PRIVACY_ENTITY_TYPES, useGetVoicesQuery, useGetVoiceQuery, isBaseAgentMentor, useGetGradeResultQuery, useOverrideGradeResultMutation, useGetChatHistoryFilterQuery, useListGradeResultsQuery, useGetMentorGraderConfigurationQuery, useListGraderCriteriaQuery, useCreateMentorGraderConfigurationMutation, useUpdateMentorGraderConfigurationMutation, useCreateGraderCriterionMutation, useUpdateGraderCriterionMutation, useDeleteGraderCriterionMutation, useGetSpendCapStatusQuery, useGetMentorPublicSettingsQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useGetSupportTicketsQuery, useGetSupportTicketMessagesQuery, useCreateSupportTicketMessageMutation, usePatchSupportTicketMutation, useCloseSupportTicketMutation, useCreateLtiMentorMutation, useUpdateLtiMentorMutation, useGetLtiMentorsQuery, useDeleteLtiMentorMutation, useCreateLtiKeyMutation, useUpdateLtiKeyMutation, useDeleteLtiKeyMutation, useGetLtiKeysQuery, useCreateLtiToolMutation, useUpdateLtiToolMutation, useGetLtiToolsQuery, useGetPlatformInfoQuery, useCreatePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useCreateRedirectTokenMutation, useGetShareableLinkQuery, useCreateShareableLinkMutation, useUpdateShareableLinkMutation, useCreateDisclaimerMutation, useUpdateDisclaimerMutation, useGetDisclaimersQuery, useUpdateRbacMentorAccessMutation, useGetRbacMentorAccessListQuery, useStartEvalRunMutation, useEvaluateEvalRunMutation, useGetEvalRunQuery, useDeleteEvalScoreMutation, useListEvalRunJudgesQuery, useCreateEvalScoreMutation, useDeleteEvalRunMutation, useExportEvalRunMutation, useListEvalRunsQuery, useLazyGetEvalRunQuery, evaluationsApiSlice, EVALUATIONS_TAGS, useGetPersonnalizedMentorsQuery, useCreateCallCredentialsMutation, useGetGuidedPromptsQuery, useUpdateChatSessionSharedMutation, useUpdateMessageFeedbackMutation, useLazyGetPromptsSearchQuery, useLazyGetGuidedPromptsQuery, useGetPublicMentorsQuery, useGetPeriodicAgentsQuery, useGetPeriodicAgentLogsListQuery, useCreatePeriodicAgentMutation, useDeletePeriodicAgentMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useGetDisclaimerAgreementsQuery, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
6
6
  import { removeAuthItem, setAuthItem, isTauriEmbeddedLLMHost, selectRbacPermissions, useCurrentTenant, canViewOtherUsersChatHistory, isPureWatcher, getInitials, useTenantMetadata, useUsername, selectStreaming, isLoggedIn, TOOL_NAME_MAP, WRITE_TODOS_TOOL, WithPermissions, canWriteField, useStripeUpgrade, openExternalUrl, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, selectNumberOfActiveChatMessages, TOOLS, hasRemoteAiConfig, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, removeFile, chatInputSliceActions, chatActions, WithFormPermissions, useTenantContext, TimeTracker, advancedTabsProperties, defaultSessionIds, pickWritableFields, ANONYMOUS_USERNAME as ANONYMOUS_USERNAME$3, redirectToAuthSpaJoinTenant, selectActiveTab, useAxdToken, useWelcomeMessage, markdownToPlainText, useCachedSessionId, use402ErrorCheck, use401TokenRefresh, selectTokenEnabled, selectToken, useServiceWorker, useUserAgreement, useAdvancedChat, sendMessageToParentWebsite, useMentorTools, useFileDragDrop, eventBus, RemoteEvents, selectEnableChatActionsPopup, advancedTabs, isInIframe, getAuthSpaJoinUrl, addMessage, clearFiles, MENTOR_VISIBILITY } from '@iblai/web-utils';
7
7
  import { useDispatch, useSelector } from 'react-redux';
8
8
  import { toast } from 'sonner';
@@ -96896,6 +96896,8 @@ var analyticsAnalyticsMonetizationStats$3 = {
96896
96896
  tableHeadPlan: "Plan",
96897
96897
  tableHeadAmount: "Amount",
96898
96898
  tableHeadStatus: "Status",
96899
+ tableHeadUser: "User",
96900
+ tableHeadSubscribed: "Subscribed",
96899
96901
  subscriberCountTotal: "{count} subscriber{plural} total",
96900
96902
  previous: "Previous",
96901
96903
  pageLabel: "Page {page}",
@@ -98487,6 +98489,7 @@ var disclaimersTabLabels$3 = {
98487
98489
  title: "Disclaimers",
98488
98490
  description: "Configure disclaimer settings for your agent."
98489
98491
  },
98492
+ infoBox: "Show your users the fine print. Add notices — like 'This is an AI assistant' or a compliance statement — that appear in the chat so people know what to expect.",
98490
98493
  userAgreement: {
98491
98494
  title: "User Agreement",
98492
98495
  tooltip: "Controls User Agreement",
@@ -98507,7 +98510,8 @@ var disclaimersTabLabels$3 = {
98507
98510
  edit: "Edit",
98508
98511
  save: "Save",
98509
98512
  saving: "Saving...",
98510
- cancel: "Cancel"
98513
+ cancel: "Cancel",
98514
+ viewAgreements: "View Agreements"
98511
98515
  },
98512
98516
  toasts: {
98513
98517
  advisorySuccess: "Agent updated successfully",
@@ -98517,6 +98521,20 @@ var disclaimersTabLabels$3 = {
98517
98521
  userAgreementEnabled: "User agreement enabled successfully",
98518
98522
  userAgreementDisabled: "User agreement disabled successfully",
98519
98523
  toggleError: "Failed to update user agreement"
98524
+ },
98525
+ agreements: {
98526
+ title: "Agreements",
98527
+ dialogDescription: "Users who have accepted this agent's User Agreement.",
98528
+ totalAgreements: "{count} Total Agreements",
98529
+ summaryDescription: "Review the users who have accepted this agent's User Agreement. Each entry shows the user's name, email and when they agreed. Users who haven't accepted yet aren't listed. Search matches the exact username.",
98530
+ searchPlaceholder: "Search by username",
98531
+ searchAriaLabel: "Search agreements by username",
98532
+ columnUser: "User",
98533
+ columnAgreedAt: "Agreed at",
98534
+ empty: "No agreements yet",
98535
+ emptyDescription: "Users who accept the User Agreement will appear here with the time they agreed.",
98536
+ noMatches: "No users match your search",
98537
+ noMatchesDescription: "Search matches the exact username — try the full username."
98520
98538
  }
98521
98539
  };
98522
98540
  var documentSidebar$3 = {
@@ -104201,6 +104219,8 @@ var analyticsAnalyticsMonetizationStats$2 = {
104201
104219
  tableHeadPlan: "Plan",
104202
104220
  tableHeadAmount: "Montant",
104203
104221
  tableHeadStatus: "Statut",
104222
+ tableHeadUser: "Utilisateur",
104223
+ tableHeadSubscribed: "Abonné le",
104204
104224
  subscriberCountTotal: "{count} abonné{plural} au total",
104205
104225
  previous: "Précédent",
104206
104226
  pageLabel: "Page {page}",
@@ -105958,6 +105978,7 @@ var disclaimersTabLabels$2 = {
105958
105978
  title: "Avertissements",
105959
105979
  description: "Configurez les paramètres d'avertissement pour votre agent."
105960
105980
  },
105981
+ infoBox: "Affichez les mentions légales à vos utilisateurs. Ajoutez des avis — comme « Ceci est un assistant IA » ou une déclaration de conformité — qui apparaissent dans la conversation pour que les gens sachent à quoi s'attendre.",
105961
105982
  userAgreement: {
105962
105983
  title: "Accord utilisateur",
105963
105984
  tooltip: "Contrôle l'accord utilisateur",
@@ -105978,7 +105999,8 @@ var disclaimersTabLabels$2 = {
105978
105999
  edit: "Modifier",
105979
106000
  save: "Enregistrer",
105980
106001
  saving: "Enregistrement...",
105981
- cancel: "Annuler"
106002
+ cancel: "Annuler",
106003
+ viewAgreements: "Voir les acceptations"
105982
106004
  },
105983
106005
  toasts: {
105984
106006
  advisorySuccess: "Agent mis à jour avec succès",
@@ -105988,6 +106010,20 @@ var disclaimersTabLabels$2 = {
105988
106010
  userAgreementEnabled: "Accord utilisateur activé avec succès",
105989
106011
  userAgreementDisabled: "Accord utilisateur désactivé avec succès",
105990
106012
  toggleError: "Échec de la mise à jour de l'accord utilisateur"
106013
+ },
106014
+ agreements: {
106015
+ title: "Acceptations",
106016
+ dialogDescription: "Utilisateurs ayant accepté l'Accord utilisateur de cet agent.",
106017
+ totalAgreements: "{count} acceptations au total",
106018
+ summaryDescription: "Consultez les utilisateurs ayant accepté l'Accord utilisateur de cet agent. Chaque entrée indique le nom et l'e-mail de l'utilisateur ainsi que la date de son acceptation. Les utilisateurs qui ne l'ont pas encore accepté n'apparaissent pas. La recherche correspond au nom d'utilisateur exact.",
106019
+ searchPlaceholder: "Rechercher par nom d'utilisateur",
106020
+ searchAriaLabel: "Rechercher les acceptations par nom d'utilisateur",
106021
+ columnUser: "Utilisateur",
106022
+ columnAgreedAt: "Accepté le",
106023
+ empty: "Aucune acceptation pour le moment",
106024
+ emptyDescription: "Les utilisateurs qui acceptent l'Accord utilisateur apparaîtront ici avec l'heure de leur acceptation.",
106025
+ noMatches: "Aucun utilisateur ne correspond à votre recherche",
106026
+ noMatchesDescription: "La recherche correspond au nom d'utilisateur exact : essayez le nom d'utilisateur complet."
105991
106027
  }
105992
106028
  };
105993
106029
  var documentSidebar$2 = {
@@ -111506,6 +111542,8 @@ var analyticsAnalyticsMonetizationStats$1 = {
111506
111542
  tableHeadPlan: "Plan",
111507
111543
  tableHeadAmount: "Monto",
111508
111544
  tableHeadStatus: "Estado",
111545
+ tableHeadUser: "Usuario",
111546
+ tableHeadSubscribed: "Suscrito el",
111509
111547
  subscriberCountTotal: "{count} suscriptor{plural} en total",
111510
111548
  previous: "Anterior",
111511
111549
  pageLabel: "Página {page}",
@@ -113263,6 +113301,7 @@ var disclaimersTabLabels$1 = {
113263
113301
  title: "Avisos legales",
113264
113302
  description: "Configure los ajustes de aviso legal para su agente."
113265
113303
  },
113304
+ infoBox: "Muestra la letra pequeña a tus usuarios. Agrega avisos —como «Este es un asistente de IA» o una declaración de cumplimiento— que aparecen en el chat para que las personas sepan qué esperar.",
113266
113305
  userAgreement: {
113267
113306
  title: "Acuerdo de usuario",
113268
113307
  tooltip: "Controla el acuerdo de usuario",
@@ -113283,7 +113322,8 @@ var disclaimersTabLabels$1 = {
113283
113322
  edit: "Editar",
113284
113323
  save: "Guardar",
113285
113324
  saving: "Guardando...",
113286
- cancel: "Cancelar"
113325
+ cancel: "Cancelar",
113326
+ viewAgreements: "Ver aceptaciones"
113287
113327
  },
113288
113328
  toasts: {
113289
113329
  advisorySuccess: "Agente actualizado correctamente",
@@ -113293,6 +113333,20 @@ var disclaimersTabLabels$1 = {
113293
113333
  userAgreementEnabled: "Acuerdo de usuario habilitado correctamente",
113294
113334
  userAgreementDisabled: "Acuerdo de usuario deshabilitado correctamente",
113295
113335
  toggleError: "Error al actualizar el acuerdo de usuario"
113336
+ },
113337
+ agreements: {
113338
+ title: "Aceptaciones",
113339
+ dialogDescription: "Usuarios que han aceptado el Acuerdo de usuario de este agente.",
113340
+ totalAgreements: "{count} aceptaciones en total",
113341
+ summaryDescription: "Revisa los usuarios que han aceptado el Acuerdo de usuario de este agente. Cada entrada muestra el nombre y el correo electrónico del usuario y cuándo lo aceptó. Los usuarios que aún no lo han aceptado no aparecen. La búsqueda coincide con el nombre de usuario exacto.",
113342
+ searchPlaceholder: "Buscar por nombre de usuario",
113343
+ searchAriaLabel: "Buscar aceptaciones por nombre de usuario",
113344
+ columnUser: "Usuario",
113345
+ columnAgreedAt: "Aceptado el",
113346
+ empty: "Aún no hay aceptaciones",
113347
+ emptyDescription: "Los usuarios que acepten el Acuerdo de usuario aparecerán aquí con la hora en que lo aceptaron.",
113348
+ noMatches: "Ningún usuario coincide con tu búsqueda",
113349
+ noMatchesDescription: "La búsqueda coincide con el nombre de usuario exacto: prueba con el nombre de usuario completo."
113296
113350
  }
113297
113351
  };
113298
113352
  var documentSidebar$1 = {
@@ -118811,6 +118865,8 @@ var analyticsAnalyticsMonetizationStats = {
118811
118865
  tableHeadPlan: "方案",
118812
118866
  tableHeadAmount: "金额",
118813
118867
  tableHeadStatus: "状态",
118868
+ tableHeadUser: "用户",
118869
+ tableHeadSubscribed: "订阅日期",
118814
118870
  subscriberCountTotal: "共 {count} 位订阅者",
118815
118871
  previous: "上一页",
118816
118872
  pageLabel: "第 {page} 页",
@@ -120568,6 +120624,7 @@ var disclaimersTabLabels = {
120568
120624
  title: "免责声明",
120569
120625
  description: "为您的智能体配置免责声明设置。"
120570
120626
  },
120627
+ infoBox: "向用户展示必要的声明。添加提示——例如“这是一个 AI 助手”或合规声明——它们会显示在对话中,让用户知道会得到什么。",
120571
120628
  userAgreement: {
120572
120629
  title: "用户协议",
120573
120630
  tooltip: "控制用户协议",
@@ -120588,7 +120645,8 @@ var disclaimersTabLabels = {
120588
120645
  edit: "编辑",
120589
120646
  save: "保存",
120590
120647
  saving: "保存中……",
120591
- cancel: "取消"
120648
+ cancel: "取消",
120649
+ viewAgreements: "查看同意记录"
120592
120650
  },
120593
120651
  toasts: {
120594
120652
  advisorySuccess: "智能体更新成功",
@@ -120598,6 +120656,20 @@ var disclaimersTabLabels = {
120598
120656
  userAgreementEnabled: "用户协议已成功启用",
120599
120657
  userAgreementDisabled: "用户协议已成功停用",
120600
120658
  toggleError: "更新用户协议失败"
120659
+ },
120660
+ agreements: {
120661
+ title: "同意记录",
120662
+ dialogDescription: "已接受此智能体用户协议的用户。",
120663
+ totalAgreements: "共 {count} 条同意记录",
120664
+ summaryDescription: "查看已接受此智能体用户协议的用户。每条记录显示用户的姓名、邮箱和同意时间。尚未接受的用户不会列出。搜索需与用户名完全匹配。",
120665
+ searchPlaceholder: "按用户名搜索",
120666
+ searchAriaLabel: "按用户名搜索同意记录",
120667
+ columnUser: "用户",
120668
+ columnAgreedAt: "同意时间",
120669
+ empty: "尚无同意记录",
120670
+ emptyDescription: "接受用户协议的用户将与其同意时间一起显示在此处。",
120671
+ noMatches: "没有匹配的用户",
120672
+ noMatchesDescription: "搜索需与用户名完全匹配,请尝试输入完整的用户名。"
120601
120673
  }
120602
120674
  };
120603
120675
  var documentSidebar = {
@@ -179276,7 +179348,205 @@ const EmptyStats = ({ title = 'No data available' }) => {
179276
179348
  return (jsx("div", { className: "flex justify-center items-center h-full", children: jsx("p", { className: "text-gray-500 text-sm", children: title }) }));
179277
179349
  };
179278
179350
 
179279
- const COMPLETED_COLOR = '#ED8936';
179351
+ var COLLAPSIBLE_NAME = "Collapsible";
179352
+ var [createCollapsibleContext] = createContextScope$1(COLLAPSIBLE_NAME);
179353
+ var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
179354
+ var Collapsible$1 = React.forwardRef(
179355
+ (props, forwardedRef) => {
179356
+ const {
179357
+ __scopeCollapsible,
179358
+ open: openProp,
179359
+ defaultOpen,
179360
+ disabled,
179361
+ onOpenChange,
179362
+ ...collapsibleProps
179363
+ } = props;
179364
+ const [open, setOpen] = useControllableState$1({
179365
+ prop: openProp,
179366
+ defaultProp: defaultOpen ?? false,
179367
+ onChange: onOpenChange,
179368
+ caller: COLLAPSIBLE_NAME
179369
+ });
179370
+ return /* @__PURE__ */ jsx(
179371
+ CollapsibleProvider,
179372
+ {
179373
+ scope: __scopeCollapsible,
179374
+ disabled,
179375
+ contentId: useId$1(),
179376
+ open,
179377
+ onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
179378
+ children: /* @__PURE__ */ jsx(
179379
+ Primitive$2.div,
179380
+ {
179381
+ "data-state": getState$3(open),
179382
+ "data-disabled": disabled ? "" : void 0,
179383
+ ...collapsibleProps,
179384
+ ref: forwardedRef
179385
+ }
179386
+ )
179387
+ }
179388
+ );
179389
+ }
179390
+ );
179391
+ Collapsible$1.displayName = COLLAPSIBLE_NAME;
179392
+ var TRIGGER_NAME$3 = "CollapsibleTrigger";
179393
+ var CollapsibleTrigger$1 = React.forwardRef(
179394
+ (props, forwardedRef) => {
179395
+ const { __scopeCollapsible, ...triggerProps } = props;
179396
+ const context = useCollapsibleContext(TRIGGER_NAME$3, __scopeCollapsible);
179397
+ return /* @__PURE__ */ jsx(
179398
+ Primitive$2.button,
179399
+ {
179400
+ type: "button",
179401
+ "aria-controls": context.contentId,
179402
+ "aria-expanded": context.open || false,
179403
+ "data-state": getState$3(context.open),
179404
+ "data-disabled": context.disabled ? "" : void 0,
179405
+ disabled: context.disabled,
179406
+ ...triggerProps,
179407
+ ref: forwardedRef,
179408
+ onClick: composeEventHandlers$1(props.onClick, context.onOpenToggle)
179409
+ }
179410
+ );
179411
+ }
179412
+ );
179413
+ CollapsibleTrigger$1.displayName = TRIGGER_NAME$3;
179414
+ var CONTENT_NAME$4 = "CollapsibleContent";
179415
+ var CollapsibleContent$1 = React.forwardRef(
179416
+ (props, forwardedRef) => {
179417
+ const { forceMount, ...contentProps } = props;
179418
+ const context = useCollapsibleContext(CONTENT_NAME$4, props.__scopeCollapsible);
179419
+ return /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
179420
+ }
179421
+ );
179422
+ CollapsibleContent$1.displayName = CONTENT_NAME$4;
179423
+ var CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => {
179424
+ const { __scopeCollapsible, present, children, ...contentProps } = props;
179425
+ const context = useCollapsibleContext(CONTENT_NAME$4, __scopeCollapsible);
179426
+ const [isPresent, setIsPresent] = React.useState(present);
179427
+ const ref = React.useRef(null);
179428
+ const composedRefs = useComposedRefs$1(forwardedRef, ref);
179429
+ const heightRef = React.useRef(0);
179430
+ const height = heightRef.current;
179431
+ const widthRef = React.useRef(0);
179432
+ const width = widthRef.current;
179433
+ const isOpen = context.open || isPresent;
179434
+ const isMountAnimationPreventedRef = React.useRef(isOpen);
179435
+ const originalStylesRef = React.useRef(void 0);
179436
+ React.useEffect(() => {
179437
+ const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
179438
+ return () => cancelAnimationFrame(rAF);
179439
+ }, []);
179440
+ useLayoutEffect2$1(() => {
179441
+ const node = ref.current;
179442
+ if (node) {
179443
+ originalStylesRef.current = originalStylesRef.current || {
179444
+ transitionDuration: node.style.transitionDuration,
179445
+ animationName: node.style.animationName
179446
+ };
179447
+ node.style.transitionDuration = "0s";
179448
+ node.style.animationName = "none";
179449
+ const rect = node.getBoundingClientRect();
179450
+ heightRef.current = rect.height;
179451
+ widthRef.current = rect.width;
179452
+ if (!isMountAnimationPreventedRef.current) {
179453
+ node.style.transitionDuration = originalStylesRef.current.transitionDuration;
179454
+ node.style.animationName = originalStylesRef.current.animationName;
179455
+ }
179456
+ setIsPresent(present);
179457
+ }
179458
+ }, [context.open, present]);
179459
+ return /* @__PURE__ */ jsx(
179460
+ Primitive$2.div,
179461
+ {
179462
+ "data-state": getState$3(context.open),
179463
+ "data-disabled": context.disabled ? "" : void 0,
179464
+ id: context.contentId,
179465
+ hidden: !isOpen,
179466
+ ...contentProps,
179467
+ ref: composedRefs,
179468
+ style: {
179469
+ [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
179470
+ [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,
179471
+ ...props.style
179472
+ },
179473
+ children: isOpen && children
179474
+ }
179475
+ );
179476
+ });
179477
+ function getState$3(open) {
179478
+ return open ? "open" : "closed";
179479
+ }
179480
+ var Root$7 = Collapsible$1;
179481
+
179482
+ const Collapsible = Root$7;
179483
+ const CollapsibleTrigger = CollapsibleTrigger$1;
179484
+ const CollapsibleContent = CollapsibleContent$1;
179485
+
179486
+ const BAR_COLOR$1 = 'var(--color-amber-500, #f59e0b)';
179487
+ const ERROR_MESSAGES = {
179488
+ forbidden: 'Completion breakdown is not available for this learner.',
179489
+ not_enrolled: 'This learner is not enrolled in this course.',
179490
+ unavailable: 'Could not load the completion breakdown. Please try again later.',
179491
+ unauthorized: 'Completion breakdown is not available for this learner.',
179492
+ invalid_request: 'Completion breakdown is not available for this course.',
179493
+ unknown: 'Could not load the completion breakdown.',
179494
+ };
179495
+ // Backend values are already rounded to 2 decimals; show whole numbers
179496
+ // unless the value is fractional (e.g. 33.33).
179497
+ const formatPct = (value) => {
179498
+ const pct = value !== null && value !== void 0 ? value : 0;
179499
+ return `${Number.isInteger(pct) ? pct : pct.toFixed(2).replace(/\.?0+$/, '')}%`;
179500
+ };
179501
+ function CompletionBar({ value, label }) {
179502
+ const clamped = Math.min(Math.max(value, 0), 100);
179503
+ return (jsx("span", { className: "block h-1.5 w-full rounded-full bg-gray-200", role: "progressbar", "aria-label": label, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": clamped, children: jsx("span", { className: "block h-1.5 rounded-full", style: { width: `${clamped}%`, backgroundColor: BAR_COLOR$1 } }) }));
179504
+ }
179505
+ function SubsectionRow({ block }) {
179506
+ return (jsxs("li", { className: "space-y-1 py-2", children: [jsxs("div", { className: "flex items-center justify-between gap-3", children: [jsxs("span", { className: "flex min-w-0 items-center gap-1.5 text-sm text-gray-700", children: [jsx("span", { className: "truncate", children: block.display_name }), block.special_exam_info ? (jsxs("span", { className: "inline-flex shrink-0 items-center gap-1 rounded-full bg-gray-100 px-2 py-0.5 text-[11px] text-gray-600", children: [jsx(Clock, { className: "h-3 w-3", "aria-hidden": "true" }), block.special_exam_info.short_description] })) : null] }), jsx("span", { className: "shrink-0 text-xs font-medium text-gray-600", children: formatPct(block.completion_percentage) })] }), jsx(CompletionBar, { value: block.completion_percentage, label: `${block.display_name} completion` })] }));
179507
+ }
179508
+ function SectionRow({ block }) {
179509
+ var _a;
179510
+ const [open, setOpen] = useState(false);
179511
+ const subsections = (_a = block.children) !== null && _a !== void 0 ? _a : [];
179512
+ return (jsx(Collapsible, { open: open, onOpenChange: setOpen, asChild: true, children: jsxs("li", { className: "py-2.5", children: [jsxs(CollapsibleTrigger, { className: "flex w-full items-center gap-2 rounded text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 disabled:cursor-default", disabled: subsections.length === 0, children: [jsx(ChevronRight, { className: `h-4 w-4 shrink-0 text-gray-400 transition-transform ${open ? 'rotate-90' : ''} ${subsections.length === 0 ? 'invisible' : ''}`, "aria-hidden": "true" }), jsxs("span", { className: "block min-w-0 flex-1 space-y-1.5", children: [jsxs("span", { className: "flex items-center justify-between gap-3", children: [jsxs("span", { className: "flex min-w-0 items-center gap-1.5 text-sm font-medium text-gray-900", children: [jsx("span", { className: "truncate", children: block.display_name }), block.complete ? (jsx(CircleCheck, { className: "h-4 w-4 shrink-0 text-green-600", "aria-label": "Complete" })) : null] }), jsx("span", { className: "shrink-0 text-sm font-semibold text-gray-700", children: formatPct(block.completion_percentage) })] }), jsx(CompletionBar, { value: block.completion_percentage, label: `${block.display_name} completion` })] })] }), subsections.length > 0 ? (jsx(CollapsibleContent, { children: jsx("ul", { className: "ml-6 mt-1 divide-y divide-gray-100", children: subsections.map((subsection) => (jsx(SubsectionRow, { block: subsection }, subsection.id))) }) })) : null] }) }));
179513
+ }
179514
+ /**
179515
+ * Per-section completion for one learner in one course, from the DM
179516
+ * completion outline. Percentages come from the backend as-is.
179517
+ */
179518
+ function CourseCompletionBreakdown({ username, courseId, tenantKey, skip = false, }) {
179519
+ const { data, error, isLoading, isFetching, refetch } = useGetLearnerCourseOutlineQuery({ username, course_id: courseId, platform_key: tenantKey }, { skip: skip || !username || !courseId || !tenantKey });
179520
+ const sections = useMemo(() => (data ? getSections(data) : []), [data]);
179521
+ const resumePath = useMemo(() => {
179522
+ if (!data)
179523
+ return null;
179524
+ const resume = findResumeBlock(data);
179525
+ if (!resume || resume.id === data.id)
179526
+ return null;
179527
+ const entry = flattenOutline(data).find(({ block }) => block.id === resume.id);
179528
+ // Drop the course name; the modal header already shows it.
179529
+ return entry ? entry.path.slice(1).join(' › ') : null;
179530
+ }, [data]);
179531
+ const normalizedError = normalizeLearnerCompletionError(error);
179532
+ let body;
179533
+ if (isLoading || (isFetching && !data)) {
179534
+ body = jsx("p", { className: "py-4 text-sm text-gray-500", children: "Loading completion breakdown..." });
179535
+ }
179536
+ else if (normalizedError) {
179537
+ body = (jsxs("div", { className: "flex items-center justify-between gap-3 py-2", children: [jsx("p", { className: "text-sm text-gray-500", children: ERROR_MESSAGES[normalizedError.kind] }), normalizedError.retryable ? (jsx(Button$1, { variant: "outline", size: "sm", onClick: () => refetch(), disabled: isFetching, children: "Retry" })) : null] }));
179538
+ }
179539
+ else if (sections.length === 0) {
179540
+ body = jsx("p", { className: "py-2 text-sm text-gray-500", children: "No sections in this course yet." });
179541
+ }
179542
+ else {
179543
+ body = (jsxs(Fragment$1, { children: [resumePath ? (jsxs("p", { className: "text-xs text-gray-500", children: ["Last visited: ", jsx("span", { className: "font-medium text-gray-700", children: resumePath })] })) : null, jsx("ul", { className: "divide-y divide-[oklch(0.922_0_0)]", children: sections.map((section) => (jsx(SectionRow, { block: section.block }, section.id))) })] }));
179544
+ }
179545
+ return (jsxs("section", { className: "space-y-2 rounded-lg border p-4", style: { borderColor: 'oklch(.922 0 0)' }, "aria-labelledby": "completion-breakdown-heading", children: [jsxs("div", { children: [jsx("h4", { id: "completion-breakdown-heading", className: "text-sm font-semibold text-gray-900", children: "Completion breakdown" }), jsx("p", { className: "text-xs text-gray-500", children: "Progress through each section of this course." })] }), body] }));
179546
+ }
179547
+
179548
+ // Theme token (the same one bg-amber-500 resolves to), with Tailwind's default as fallback.
179549
+ const COMPLETED_COLOR = 'var(--color-amber-500, #f59e0b)';
179280
179550
  const REMAINING_COLOR = '#E5E7EB';
179281
179551
  const formatDate$1 = (value) => {
179282
179552
  if (!value)
@@ -179382,13 +179652,13 @@ function EnrolledUserProgressModal({ open, onOpenChange, username, userName, ema
179382
179652
  const passingPct = getPassingPct((_h = (_g = item === null || item === void 0 ? void 0 : item.edx_progress) === null || _g === void 0 ? void 0 : _g.grading_policy) === null || _h === void 0 ? void 0 : _h.grade_range);
179383
179653
  return (jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: jsxs(DialogContent, { className: "max-w-2xl max-h-[85vh] overflow-y-auto", "aria-label": "Enrolled user progress", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: userName || username || 'Learner progress' }), jsxs(DialogDescription, { children: [email ? `${email} · ` : '', resolvedName || (isProgram ? 'Program progress' : 'Course progress')] })] }), loading ? (jsx("div", { className: "flex items-center justify-center py-12", children: jsx("div", { className: "text-sm text-gray-500", children: "Loading..." }) })) : !item ? (jsx(EmptyStats, { title: "No progress data available" })) : (jsxs("div", { className: "space-y-6", children: [jsxs("div", { className: "relative mx-auto", style: { width: 220, height: 220 }, children: [jsx(ResponsiveContainer, { width: "100%", height: "100%", children: jsx(PieChart, { children: jsxs(Pie, { data: pieData, dataKey: "value", cx: "50%", cy: "50%", innerRadius: 75, outerRadius: 100, startAngle: 90, endAngle: -270, stroke: "none", isAnimationActive: false, children: [jsx(Cell, { fill: COMPLETED_COLOR }), jsx(Cell, { fill: REMAINING_COLOR })] }) }) }), jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center pointer-events-none", children: [jsxs("span", { className: "text-3xl font-bold text-gray-700", children: [percentage, "%"] }), jsx("span", { className: "text-sm text-gray-500", children: "completed" })] })] }), jsxs("div", { className: "divide-y divide-[oklch(0.922_0_0)]", children: [jsx(DetailRow, { label: "Status", children: jsx("span", { className: `inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${((_j = item.completion) === null || _j === void 0 ? void 0 : _j.passed)
179384
179654
  ? 'bg-green-50 text-green-700'
179385
- : 'bg-gray-100 text-gray-600'}`, children: ((_k = item.completion) === null || _k === void 0 ? void 0 : _k.passed) ? 'Passed' : 'Not passed' }) }), jsx(DetailRow, { label: "Passed on", children: formatDate$1((_l = item.completion) === null || _l === void 0 ? void 0 : _l.passed_date) }), jsx(DetailRow, { label: "Time spent", children: item.time_spent || '—' }), jsx(DetailRow, { label: "Enrollment date", children: formatDate$1((_o = (_m = item.enrollment) === null || _m === void 0 ? void 0 : _m.started) !== null && _o !== void 0 ? _o : (_p = item.enrollment) === null || _p === void 0 ? void 0 : _p.created) })] }), ((_s = (_r = (_q = item.edx_progress) === null || _q === void 0 ? void 0 : _q.grading_policy) === null || _r === void 0 ? void 0 : _r.assignment_policies) === null || _s === void 0 ? void 0 : _s.length) ? (jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "rounded-lg border p-4", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("h4", { className: "text-sm font-semibold text-gray-900", children: "Grades" }), jsx("p", { className: "text-xs text-gray-500", children: "This represents the weighted grade against the grade needed to pass this course." }), jsx(GradeBar, { currentPct: currentGradePct, passingPct: passingPct })] }), jsxs("div", { className: "flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 px-4 py-3", children: [jsx(TriangleAlert, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-600" }), jsxs("span", { className: "text-sm font-medium text-gray-800", children: ["A weighted grade of ", passingPct, "% is required to pass in this course"] })] }), jsxs("div", { className: "rounded-lg border p-4 space-y-3", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("h4", { className: "text-sm font-semibold text-gray-900", children: "Grade summary" }), jsx("div", { className: "overflow-x-auto", children: jsxs("table", { className: "w-full border-collapse text-sm", children: [jsx("thead", { children: jsxs("tr", { className: "bg-amber-50 text-[11px] uppercase tracking-wide text-gray-600", children: [jsx("th", { className: "px-3 py-2 text-left font-medium", children: "Assignment type" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Weight" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Grade" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Weighted grade" })] }) }), jsxs("tbody", { children: [gradeSummary === null || gradeSummary === void 0 ? void 0 : gradeSummary.rows.map((row, index) => (jsxs("tr", { className: index % 2 === 0 ? '' : 'bg-gray-50', children: [jsxs("td", { className: "px-3 py-2 text-gray-800", children: [row.type, row.footnote ? (jsx("sup", { className: "ml-0.5 text-amber-500", children: row.footnote })) : null] }), jsxs("td", { className: "px-3 py-2 text-right text-gray-700", children: [row.weightPct, "%"] }), jsxs("td", { className: "px-3 py-2 text-right text-gray-700", children: [row.gradePct, "%"] }), jsxs("td", { className: "px-3 py-2 text-right font-semibold text-amber-600", children: [row.weightedGradePct, "%"] })] }, row.type))), jsxs("tr", { className: "border-l-2 border-amber-400 bg-amber-50", children: [jsx("td", { className: "px-3 py-2 font-medium text-gray-800", colSpan: 3, children: "Current weighted grade summary" }), jsxs("td", { className: "px-3 py-2 text-right font-bold text-amber-600", children: [currentGradePct, "%"] })] })] })] }) }), gradeSummary && gradeSummary.footnotes.length > 0 ? (jsx("div", { className: "space-y-1", children: gradeSummary.footnotes.map((note, index) => (jsxs("p", { className: "text-xs text-gray-500", children: [jsx("sup", { className: "text-amber-500", children: index + 1 }), " ", note] }, note))) })) : null] })] })) : null] }))] }) }));
179655
+ : 'bg-gray-100 text-gray-600'}`, children: ((_k = item.completion) === null || _k === void 0 ? void 0 : _k.passed) ? 'Passed' : 'Not passed' }) }), jsx(DetailRow, { label: "Passed on", children: formatDate$1((_l = item.completion) === null || _l === void 0 ? void 0 : _l.passed_date) }), jsx(DetailRow, { label: "Time spent", children: item.time_spent || '—' }), jsx(DetailRow, { label: "Enrollment date", children: formatDate$1((_o = (_m = item.enrollment) === null || _m === void 0 ? void 0 : _m.started) !== null && _o !== void 0 ? _o : (_p = item.enrollment) === null || _p === void 0 ? void 0 : _p.created) })] }), !isProgram ? (jsx(CourseCompletionBreakdown, { username: username, courseId: normalizedId, tenantKey: tenantKey, skip: !open })) : null, ((_s = (_r = (_q = item.edx_progress) === null || _q === void 0 ? void 0 : _q.grading_policy) === null || _r === void 0 ? void 0 : _r.assignment_policies) === null || _s === void 0 ? void 0 : _s.length) ? (jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "rounded-lg border p-4", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("h4", { className: "text-sm font-semibold text-gray-900", children: "Grades" }), jsx("p", { className: "text-xs text-gray-500", children: "This represents the weighted grade against the grade needed to pass this course." }), jsx(GradeBar, { currentPct: currentGradePct, passingPct: passingPct })] }), jsxs("div", { className: "flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 px-4 py-3", children: [jsx(TriangleAlert, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-600" }), jsxs("span", { className: "text-sm font-medium text-gray-800", children: ["A weighted grade of ", passingPct, "% is required to pass in this course"] })] }), jsxs("div", { className: "rounded-lg border p-4 space-y-3", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("h4", { className: "text-sm font-semibold text-gray-900", children: "Grade summary" }), jsx("div", { className: "overflow-x-auto", children: jsxs("table", { className: "w-full border-collapse text-sm", children: [jsx("thead", { children: jsxs("tr", { className: "bg-amber-50 text-[11px] uppercase tracking-wide text-gray-600", children: [jsx("th", { className: "px-3 py-2 text-left font-medium", children: "Assignment type" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Weight" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Grade" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Weighted grade" })] }) }), jsxs("tbody", { children: [gradeSummary === null || gradeSummary === void 0 ? void 0 : gradeSummary.rows.map((row, index) => (jsxs("tr", { className: index % 2 === 0 ? '' : 'bg-gray-50', children: [jsxs("td", { className: "px-3 py-2 text-gray-800", children: [row.type, row.footnote ? (jsx("sup", { className: "ml-0.5 text-amber-500", children: row.footnote })) : null] }), jsxs("td", { className: "px-3 py-2 text-right text-gray-700", children: [row.weightPct, "%"] }), jsxs("td", { className: "px-3 py-2 text-right text-gray-700", children: [row.gradePct, "%"] }), jsxs("td", { className: "px-3 py-2 text-right font-semibold text-amber-600", children: [row.weightedGradePct, "%"] })] }, row.type))), jsxs("tr", { className: "border-l-2 border-amber-400 bg-amber-50", children: [jsx("td", { className: "px-3 py-2 font-medium text-gray-800", colSpan: 3, children: "Current weighted grade summary" }), jsxs("td", { className: "px-3 py-2 text-right font-bold text-amber-600", children: [currentGradePct, "%"] })] })] })] }) }), gradeSummary && gradeSummary.footnotes.length > 0 ? (jsx("div", { className: "space-y-1", children: gradeSummary.footnotes.map((note, index) => (jsxs("p", { className: "text-xs text-gray-500", children: [jsx("sup", { className: "text-amber-500", children: index + 1 }), " ", note] }, note))) })) : null] })] })) : null] }))] }) }));
179386
179656
  }
179387
179657
  function DetailRow({ label, children }) {
179388
179658
  return (jsxs("div", { className: "flex items-center justify-between gap-4 py-2", children: [jsx("span", { className: "text-sm text-gray-500", children: label }), jsx("span", { className: "text-sm font-medium text-gray-900 text-right", children: children })] }));
179389
179659
  }
179390
179660
 
179391
- const PAGE_SIZE$e = 8;
179661
+ const PAGE_SIZE$f = 8;
179392
179662
  const CONTENT_TYPES = [
179393
179663
  { value: 'courses', labelKey: 'gradebookGradebookTab.typeCourses', icon: GraduationCap },
179394
179664
  { value: 'programs', labelKey: 'gradebookGradebookTab.typePrograms', icon: Layers },
@@ -179419,14 +179689,14 @@ function useGradebookData(type, org, username, page, search) {
179419
179689
  username,
179420
179690
  query: {
179421
179691
  page,
179422
- page_size: PAGE_SIZE$e,
179692
+ page_size: PAGE_SIZE$f,
179423
179693
  platform_key: org,
179424
179694
  ...(trimmed ? { course_name: trimmed } : {}),
179425
179695
  },
179426
179696
  }, { skip: type !== 'courses', refetchOnMountOrArgChange: true });
179427
179697
  const programsQ = useGetUserEnrolledProgramsQuery([{ username, platformKey: org }], { skip: type !== 'programs' });
179428
179698
  const pathwaysQ = useGetUserCatalogPathwaysQuery({ username, platform_key: org }, { skip: type !== 'pathways' });
179429
- const credentialsQ = useGetUsersAsAssertionsQuery({ platformKey: org, userId: username, page, pageSize: PAGE_SIZE$e }, { skip: type !== 'credentials', refetchOnMountOrArgChange: true });
179699
+ const credentialsQ = useGetUsersAsAssertionsQuery({ platformKey: org, userId: username, page, pageSize: PAGE_SIZE$f }, { skip: type !== 'credentials', refetchOnMountOrArgChange: true });
179430
179700
  const earnedQ = useGetUserEarnedSkillsQuery([{ org, userId: username }], { skip: type !== 'skills' });
179431
179701
  const reportedQ = useGetUserReportedSkillsQuery([{ username }], { skip: type !== 'skills' });
179432
179702
  const desiredQ = useGetUserDesiredSkillsQuery([{ username }], { skip: type !== 'skills' });
@@ -179436,12 +179706,12 @@ function useGradebookData(type, org, username, page, search) {
179436
179706
  const filtered = trimmed
179437
179707
  ? rows.filter((row) => row.name.toLowerCase().includes(trimmed.toLowerCase()))
179438
179708
  : rows;
179439
- const start = (page - 1) * PAGE_SIZE$e;
179709
+ const start = (page - 1) * PAGE_SIZE$f;
179440
179710
  return {
179441
- rows: filtered.slice(start, start + PAGE_SIZE$e),
179711
+ rows: filtered.slice(start, start + PAGE_SIZE$f),
179442
179712
  total: filtered.length,
179443
179713
  hasPrev: page > 1,
179444
- hasNext: start + PAGE_SIZE$e < filtered.length,
179714
+ hasNext: start + PAGE_SIZE$f < filtered.length,
179445
179715
  };
179446
179716
  };
179447
179717
  switch (type) {
@@ -179498,7 +179768,7 @@ function useGradebookData(type, org, username, page, search) {
179498
179768
  rows,
179499
179769
  total,
179500
179770
  hasPrev: page > 1,
179501
- hasNext: page * PAGE_SIZE$e < total,
179771
+ hasNext: page * PAGE_SIZE$f < total,
179502
179772
  isLoading: credentialsQ.isLoading,
179503
179773
  isFetching: credentialsQ.isFetching,
179504
179774
  isError: credentialsQ.isError,
@@ -181687,7 +181957,7 @@ function PreviousMonthButton(props) {
181687
181957
  * @group Components
181688
181958
  * @see https://daypicker.dev/guides/custom-components
181689
181959
  */
181690
- function Root$7(props) {
181960
+ function Root$6(props) {
181691
181961
  const { rootRef, ...rest } = props;
181692
181962
  return React__default.createElement("div", { ...rest, ref: rootRef });
181693
181963
  }
@@ -181795,7 +182065,7 @@ var components$1 = /*#__PURE__*/Object.freeze({
181795
182065
  NextMonthButton: NextMonthButton,
181796
182066
  Option: Option,
181797
182067
  PreviousMonthButton: PreviousMonthButton,
181798
- Root: Root$7,
182068
+ Root: Root$6,
181799
182069
  Select: Select,
181800
182070
  Week: Week,
181801
182071
  WeekNumber: WeekNumber,
@@ -183865,11 +184135,11 @@ var PopoverAnchor$1 = React.forwardRef(
183865
184135
  }
183866
184136
  );
183867
184137
  PopoverAnchor$1.displayName = ANCHOR_NAME$1;
183868
- var TRIGGER_NAME$3 = "PopoverTrigger";
184138
+ var TRIGGER_NAME$2 = "PopoverTrigger";
183869
184139
  var PopoverTrigger$1 = React.forwardRef(
183870
184140
  (props, forwardedRef) => {
183871
184141
  const { __scopePopover, ...triggerProps } = props;
183872
- const context = usePopoverContext(TRIGGER_NAME$3, __scopePopover);
184142
+ const context = usePopoverContext(TRIGGER_NAME$2, __scopePopover);
183873
184143
  const popperScope = usePopperScope$1(__scopePopover);
183874
184144
  const composedTriggerRef = useComposedRefs$1(forwardedRef, context.triggerRef);
183875
184145
  const trigger = /* @__PURE__ */ jsx(
@@ -183879,7 +184149,7 @@ var PopoverTrigger$1 = React.forwardRef(
183879
184149
  "aria-haspopup": "dialog",
183880
184150
  "aria-expanded": context.open,
183881
184151
  "aria-controls": context.contentId,
183882
- "data-state": getState$3(context.open),
184152
+ "data-state": getState$2(context.open),
183883
184153
  ...triggerProps,
183884
184154
  ref: composedTriggerRef,
183885
184155
  onClick: composeEventHandlers$2(props.onClick, context.onOpenToggle)
@@ -183888,7 +184158,7 @@ var PopoverTrigger$1 = React.forwardRef(
183888
184158
  return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(Anchor$3, { asChild: true, ...popperScope, children: trigger });
183889
184159
  }
183890
184160
  );
183891
- PopoverTrigger$1.displayName = TRIGGER_NAME$3;
184161
+ PopoverTrigger$1.displayName = TRIGGER_NAME$2;
183892
184162
  var PORTAL_NAME$2 = "PopoverPortal";
183893
184163
  var [PortalProvider$1, usePortalContext$1] = createPopoverContext(PORTAL_NAME$2, {
183894
184164
  forceMount: void 0
@@ -183899,20 +184169,20 @@ var PopoverPortal = (props) => {
183899
184169
  return /* @__PURE__ */ jsx(PortalProvider$1, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence$3, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$7, { asChild: true, container, children }) }) });
183900
184170
  };
183901
184171
  PopoverPortal.displayName = PORTAL_NAME$2;
183902
- var CONTENT_NAME$4 = "PopoverContent";
184172
+ var CONTENT_NAME$3 = "PopoverContent";
183903
184173
  var PopoverContent$1 = React.forwardRef(
183904
184174
  (props, forwardedRef) => {
183905
- const portalContext = usePortalContext$1(CONTENT_NAME$4, props.__scopePopover);
184175
+ const portalContext = usePortalContext$1(CONTENT_NAME$3, props.__scopePopover);
183906
184176
  const { forceMount = portalContext.forceMount, ...contentProps } = props;
183907
- const context = usePopoverContext(CONTENT_NAME$4, props.__scopePopover);
184177
+ const context = usePopoverContext(CONTENT_NAME$3, props.__scopePopover);
183908
184178
  return /* @__PURE__ */ jsx(Presence$3, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
183909
184179
  }
183910
184180
  );
183911
- PopoverContent$1.displayName = CONTENT_NAME$4;
184181
+ PopoverContent$1.displayName = CONTENT_NAME$3;
183912
184182
  var Slot = createSlot$1("PopoverContent.RemoveScroll");
183913
184183
  var PopoverContentModal = React.forwardRef(
183914
184184
  (props, forwardedRef) => {
183915
- const context = usePopoverContext(CONTENT_NAME$4, props.__scopePopover);
184185
+ const context = usePopoverContext(CONTENT_NAME$3, props.__scopePopover);
183916
184186
  const contentRef = React.useRef(null);
183917
184187
  const composedRefs = useComposedRefs$1(forwardedRef, contentRef);
183918
184188
  const isRightClickOutsideRef = React.useRef(false);
@@ -183952,7 +184222,7 @@ var PopoverContentModal = React.forwardRef(
183952
184222
  );
183953
184223
  var PopoverContentNonModal = React.forwardRef(
183954
184224
  (props, forwardedRef) => {
183955
- const context = usePopoverContext(CONTENT_NAME$4, props.__scopePopover);
184225
+ const context = usePopoverContext(CONTENT_NAME$3, props.__scopePopover);
183956
184226
  const hasInteractedOutsideRef = React.useRef(false);
183957
184227
  const hasPointerDownOutsideRef = React.useRef(false);
183958
184228
  return /* @__PURE__ */ jsx(
@@ -184004,7 +184274,7 @@ var PopoverContentImpl = React.forwardRef(
184004
184274
  onInteractOutside,
184005
184275
  ...contentProps
184006
184276
  } = props;
184007
- const context = usePopoverContext(CONTENT_NAME$4, __scopePopover);
184277
+ const context = usePopoverContext(CONTENT_NAME$3, __scopePopover);
184008
184278
  const popperScope = usePopperScope$1(__scopePopover);
184009
184279
  useFocusGuards();
184010
184280
  return /* @__PURE__ */ jsx(
@@ -184028,7 +184298,7 @@ var PopoverContentImpl = React.forwardRef(
184028
184298
  children: /* @__PURE__ */ jsx(
184029
184299
  Content$3,
184030
184300
  {
184031
- "data-state": getState$3(context.open),
184301
+ "data-state": getState$2(context.open),
184032
184302
  role: "dialog",
184033
184303
  id: context.contentId,
184034
184304
  ...popperScope,
@@ -184079,7 +184349,7 @@ var PopoverArrow = React.forwardRef(
184079
184349
  }
184080
184350
  );
184081
184351
  PopoverArrow.displayName = ARROW_NAME$2;
184082
- function getState$3(open) {
184352
+ function getState$2(open) {
184083
184353
  return open ? "open" : "closed";
184084
184354
  }
184085
184355
  var Root2$4 = Popover$1;
@@ -220833,7 +221103,7 @@ var Checkbox$1 = React.forwardRef(
220833
221103
  role: "checkbox",
220834
221104
  "aria-checked": isIndeterminate(checked) ? "mixed" : checked,
220835
221105
  "aria-required": required,
220836
- "data-state": getState$2(checked),
221106
+ "data-state": getState$1(checked),
220837
221107
  "data-disabled": disabled ? "" : void 0,
220838
221108
  disabled,
220839
221109
  value,
@@ -220878,7 +221148,7 @@ var CheckboxIndicator = React.forwardRef(
220878
221148
  return /* @__PURE__ */ jsx(Presence$1, { present: forceMount || isIndeterminate(context.state) || context.state === true, children: /* @__PURE__ */ jsx(
220879
221149
  Primitive$3.span,
220880
221150
  {
220881
- "data-state": getState$2(context.state),
221151
+ "data-state": getState$1(context.state),
220882
221152
  "data-disabled": context.disabled ? "" : void 0,
220883
221153
  ...indicatorProps,
220884
221154
  ref: forwardedRef,
@@ -220944,14 +221214,14 @@ CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;
220944
221214
  function isIndeterminate(checked) {
220945
221215
  return checked === "indeterminate";
220946
221216
  }
220947
- function getState$2(checked) {
221217
+ function getState$1(checked) {
220948
221218
  return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
220949
221219
  }
220950
- var Root$6 = Checkbox$1;
221220
+ var Root$5 = Checkbox$1;
220951
221221
  var Indicator$1 = CheckboxIndicator;
220952
221222
 
220953
- const Checkbox = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$6, { ref: ref, className: cn("peer border-primary focus-visible:ring-ring h-4 w-4 shrink-0 rounded-sm border shadow-sm focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=checked]:text-white", className), ...props, children: jsx(Indicator$1, { className: cn("flex items-center justify-center text-current"), children: jsx(Check, { className: "h-4 w-4" }) }) })));
220954
- Checkbox.displayName = Root$6.displayName;
221223
+ const Checkbox = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$5, { ref: ref, className: cn("peer border-primary focus-visible:ring-ring h-4 w-4 shrink-0 rounded-sm border shadow-sm focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=checked]:text-white", className), ...props, children: jsx(Indicator$1, { className: cn("flex items-center justify-center text-current"), children: jsx(Check, { className: "h-4 w-4" }) }) })));
221224
+ Checkbox.displayName = Root$5.displayName;
220955
221225
 
220956
221226
  function CoursesTab({ tenant, currentPage, itemsPerPage, hasManageUsersPermission = false, }) {
220957
221227
  var _a;
@@ -221925,141 +222195,6 @@ function RetrievedDocumentsButton({ sessionId = '', documents, className, label,
221925
222195
  }, "data-testid": "retrieved-documents-button", children: [jsx(FileText, { className: "h-4 w-4 text-blue-600" }), jsx("span", { children: label !== null && label !== void 0 ? label : t('retrievedDocumentsButton.title') })] }), jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent, { className: "flex max-h-[80vh] flex-col gap-0 p-0 sm:max-w-[425px] md:max-w-[600px]", children: [jsx(DialogHeader, { className: "border-b border-gray-200 px-4 py-2", children: jsxs(DialogTitle, { className: "flex items-center gap-2 text-base font-medium text-[#646464]", children: [jsx(FileText, { className: "h-5 w-5 text-blue-600" }), t('retrievedDocumentsButton.title')] }) }), jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", "data-testid": "retrieved-documents-scroll", children: jsx(DocumentSidebar, { isModal: true, sessionId: sessionId, documents: documents }) })] }) })] }));
221926
222196
  }
221927
222197
 
221928
- var COLLAPSIBLE_NAME = "Collapsible";
221929
- var [createCollapsibleContext] = createContextScope$1(COLLAPSIBLE_NAME);
221930
- var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
221931
- var Collapsible$1 = React.forwardRef(
221932
- (props, forwardedRef) => {
221933
- const {
221934
- __scopeCollapsible,
221935
- open: openProp,
221936
- defaultOpen,
221937
- disabled,
221938
- onOpenChange,
221939
- ...collapsibleProps
221940
- } = props;
221941
- const [open, setOpen] = useControllableState$1({
221942
- prop: openProp,
221943
- defaultProp: defaultOpen ?? false,
221944
- onChange: onOpenChange,
221945
- caller: COLLAPSIBLE_NAME
221946
- });
221947
- return /* @__PURE__ */ jsx(
221948
- CollapsibleProvider,
221949
- {
221950
- scope: __scopeCollapsible,
221951
- disabled,
221952
- contentId: useId$1(),
221953
- open,
221954
- onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
221955
- children: /* @__PURE__ */ jsx(
221956
- Primitive$2.div,
221957
- {
221958
- "data-state": getState$1(open),
221959
- "data-disabled": disabled ? "" : void 0,
221960
- ...collapsibleProps,
221961
- ref: forwardedRef
221962
- }
221963
- )
221964
- }
221965
- );
221966
- }
221967
- );
221968
- Collapsible$1.displayName = COLLAPSIBLE_NAME;
221969
- var TRIGGER_NAME$2 = "CollapsibleTrigger";
221970
- var CollapsibleTrigger$1 = React.forwardRef(
221971
- (props, forwardedRef) => {
221972
- const { __scopeCollapsible, ...triggerProps } = props;
221973
- const context = useCollapsibleContext(TRIGGER_NAME$2, __scopeCollapsible);
221974
- return /* @__PURE__ */ jsx(
221975
- Primitive$2.button,
221976
- {
221977
- type: "button",
221978
- "aria-controls": context.contentId,
221979
- "aria-expanded": context.open || false,
221980
- "data-state": getState$1(context.open),
221981
- "data-disabled": context.disabled ? "" : void 0,
221982
- disabled: context.disabled,
221983
- ...triggerProps,
221984
- ref: forwardedRef,
221985
- onClick: composeEventHandlers$1(props.onClick, context.onOpenToggle)
221986
- }
221987
- );
221988
- }
221989
- );
221990
- CollapsibleTrigger$1.displayName = TRIGGER_NAME$2;
221991
- var CONTENT_NAME$3 = "CollapsibleContent";
221992
- var CollapsibleContent$1 = React.forwardRef(
221993
- (props, forwardedRef) => {
221994
- const { forceMount, ...contentProps } = props;
221995
- const context = useCollapsibleContext(CONTENT_NAME$3, props.__scopeCollapsible);
221996
- return /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
221997
- }
221998
- );
221999
- CollapsibleContent$1.displayName = CONTENT_NAME$3;
222000
- var CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => {
222001
- const { __scopeCollapsible, present, children, ...contentProps } = props;
222002
- const context = useCollapsibleContext(CONTENT_NAME$3, __scopeCollapsible);
222003
- const [isPresent, setIsPresent] = React.useState(present);
222004
- const ref = React.useRef(null);
222005
- const composedRefs = useComposedRefs$1(forwardedRef, ref);
222006
- const heightRef = React.useRef(0);
222007
- const height = heightRef.current;
222008
- const widthRef = React.useRef(0);
222009
- const width = widthRef.current;
222010
- const isOpen = context.open || isPresent;
222011
- const isMountAnimationPreventedRef = React.useRef(isOpen);
222012
- const originalStylesRef = React.useRef(void 0);
222013
- React.useEffect(() => {
222014
- const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
222015
- return () => cancelAnimationFrame(rAF);
222016
- }, []);
222017
- useLayoutEffect2$1(() => {
222018
- const node = ref.current;
222019
- if (node) {
222020
- originalStylesRef.current = originalStylesRef.current || {
222021
- transitionDuration: node.style.transitionDuration,
222022
- animationName: node.style.animationName
222023
- };
222024
- node.style.transitionDuration = "0s";
222025
- node.style.animationName = "none";
222026
- const rect = node.getBoundingClientRect();
222027
- heightRef.current = rect.height;
222028
- widthRef.current = rect.width;
222029
- if (!isMountAnimationPreventedRef.current) {
222030
- node.style.transitionDuration = originalStylesRef.current.transitionDuration;
222031
- node.style.animationName = originalStylesRef.current.animationName;
222032
- }
222033
- setIsPresent(present);
222034
- }
222035
- }, [context.open, present]);
222036
- return /* @__PURE__ */ jsx(
222037
- Primitive$2.div,
222038
- {
222039
- "data-state": getState$1(context.open),
222040
- "data-disabled": context.disabled ? "" : void 0,
222041
- id: context.contentId,
222042
- hidden: !isOpen,
222043
- ...contentProps,
222044
- ref: composedRefs,
222045
- style: {
222046
- [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
222047
- [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,
222048
- ...props.style
222049
- },
222050
- children: isOpen && children
222051
- }
222052
- );
222053
- });
222054
- function getState$1(open) {
222055
- return open ? "open" : "closed";
222056
- }
222057
- var Root$5 = Collapsible$1;
222058
-
222059
- const Collapsible = Root$5;
222060
- const CollapsibleTrigger = CollapsibleTrigger$1;
222061
- const CollapsibleContent = CollapsibleContent$1;
222062
-
222063
222198
  function getFriendlyToolName(toolName) {
222064
222199
  if (TOOL_NAME_MAP === null || TOOL_NAME_MAP === void 0 ? void 0 : TOOL_NAME_MAP[toolName])
222065
222200
  return TOOL_NAME_MAP[toolName];
@@ -222482,7 +222617,7 @@ const AdvancedPagination = ({ currentPage, totalPages, onPageChange, totalCount,
222482
222617
  return (jsxs("div", { className: cn('flex items-center gap-2', showSummary ? 'justify-between' : 'justify-center', variant === 'footer' && 'border-t border-gray-200 bg-gray-50 px-3 py-3 sm:px-6 sm:py-4', className), children: [showSummary && (jsx("p", { className: "hidden text-sm text-gray-700 sm:block", children: t('advancePagination.showing', { from, to, totalCount, itemLabel }) })), jsxs("div", { className: "flex items-center justify-center gap-1 sm:gap-2", children: [jsx(Button$1, { variant: "outline", size: "sm", className: "hidden h-8 w-8 items-center justify-center rounded-md border-gray-300 bg-transparent p-0 hover:bg-gray-100 sm:flex", onClick: () => onPageChange(1), disabled: currentPage === 1, "aria-label": t('advancePagination.goToFirstPage'), children: jsx(ChevronFirst, { className: "h-4 w-4" }) }), jsxs(Button$1, { variant: "outline", size: "sm", className: "flex h-8 w-8 items-center justify-center rounded-md border-none bg-transparent px-2 text-xs hover:bg-gray-100 sm:border-gray-300 sm:p-0 sm:text-sm", onClick: () => onPageChange(currentPage - 1), disabled: currentPage === 1, "aria-label": t('advancePagination.goToPreviousPage'), children: [jsx(ChevronLeft, { className: "mr-1 h-4 w-4 sm:mr-0" }), jsx("span", { className: "sm:hidden", children: t('advancePagination.prev') })] }), jsxs("span", { className: "mx-1 px-2 text-xs text-gray-700 sm:mx-2 sm:text-sm", children: [jsxs("span", { className: "hidden sm:inline", children: [t('advancePagination.page'), " "] }), currentPage, " ", jsxs("span", { className: "hidden sm:inline", children: [t('advancePagination.of'), " "] }), jsxs("span", { className: "inline sm:hidden", children: [" ", t('advancePagination.mobileSeparator'), " "] }), totalPages] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "flex h-8 w-8 items-center justify-center rounded-md border-none bg-transparent px-2 text-xs hover:bg-gray-100 sm:border-gray-300 sm:p-0 sm:text-sm", onClick: () => onPageChange(currentPage + 1), disabled: currentPage === totalPages, "aria-label": t('advancePagination.goToNextPage'), children: [jsx("span", { className: "sm:hidden", children: t('advancePagination.next') }), jsx(ChevronRight, { className: "ml-1 h-4 w-4 sm:ml-0" })] }), jsx(Button$1, { variant: "outline", size: "sm", className: "hidden h-8 w-8 items-center justify-center rounded-md border-gray-300 bg-transparent p-0 hover:bg-gray-100 sm:flex", onClick: () => onPageChange(totalPages), disabled: currentPage === totalPages, "aria-label": t('advancePagination.goToLastPage'), children: jsx(ChevronLast, { className: "h-4 w-4" }) })] })] }));
222483
222618
  };
222484
222619
 
222485
- const PAGE_SIZE$d = 10;
222620
+ const PAGE_SIZE$e = 10;
222486
222621
  function UsersTab({ tenant, onInviteClick, currentSpa, showGradebookTab = false, }) {
222487
222622
  var _a, _b;
222488
222623
  const t = useT();
@@ -222505,7 +222640,7 @@ function UsersTab({ tenant, onInviteClick, currentSpa, showGradebookTab = false,
222505
222640
  const isWatcher = isPureWatcher(rbacPermissions, currentTenant);
222506
222641
  const { data: users, refetch: refetchPlatformUsers, isLoading: isLoadingPlatformUsers, } = usePlatformUsersQuery({
222507
222642
  page,
222508
- page_size: PAGE_SIZE$d,
222643
+ page_size: PAGE_SIZE$e,
222509
222644
  platform_key: tenant,
222510
222645
  platform_org: tenant,
222511
222646
  query: debouncedSearchQuery,
@@ -222519,7 +222654,7 @@ function UsersTab({ tenant, onInviteClick, currentSpa, showGradebookTab = false,
222519
222654
  // TODO to use required_action: 'Ibl.Core/Users/read',
222520
222655
  required_action: 'Ibl.Mentor/Memory/list',
222521
222656
  page,
222522
- page_size: PAGE_SIZE$d,
222657
+ page_size: PAGE_SIZE$e,
222523
222658
  sort: 'name',
222524
222659
  ...(debouncedSearchQuery.includes('@')
222525
222660
  ? { email: debouncedSearchQuery }
@@ -222694,7 +222829,7 @@ function UsersTab({ tenant, onInviteClick, currentSpa, showGradebookTab = false,
222694
222829
  managed: user,
222695
222830
  }));
222696
222831
  const totalCount = (_b = (isWatcher ? accessibleUsers === null || accessibleUsers === void 0 ? void 0 : accessibleUsers.count : users === null || users === void 0 ? void 0 : users.count)) !== null && _b !== void 0 ? _b : 0;
222697
- const totalPages = Math.ceil(totalCount / PAGE_SIZE$d);
222832
+ const totalPages = Math.ceil(totalCount / PAGE_SIZE$e);
222698
222833
  return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1", children: [jsxs("div", { className: "relative mb-6 max-w-sm", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { type: "text", value: searchQuery, onChange: (event) => setQuerySearch(event.target.value), placeholder: t('tabsUserstab.searchPlaceholder'), className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]", "aria-label": t('tabsUserstab.searchAriaLabel') }), searchQuery.length > 0 && (searchQuery !== debouncedSearchQuery || isLoading) && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), !isWatcher && (jsx("div", { className: "mb-6", children: jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", onClick: onInviteClick, children: t('tabsUserstab.inviteButton') }) }))] }), isLoading ? (jsx("div", { className: "flex justify-center items-center h-64", children: jsx(Spinner, {}) })) : (jsxs(Fragment$1, { children: [jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: `px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 ${isWatcher ? 'w-full' : 'w-[41%]'}`, children: t('tabsUserstab.columnEmail') }), !isWatcher && (jsxs(Fragment$1, { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[16%]", children: t('tabsUserstab.columnRole') }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[25%]", children: t('tabsUserstab.columnPolicies') }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[18%]", children: t('tabsUserstab.columnStatus') })] }))] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [rows.map((row) => {
222699
222834
  var _a;
222700
222835
  // Only set on the admin path — see {@link UserRow}.
@@ -222725,7 +222860,7 @@ function UsersTab({ tenant, onInviteClick, currentSpa, showGradebookTab = false,
222725
222860
  })] }) })] }) }), jsx("td", { className: "px-6 py-4", onClick: (e) => e.stopPropagation(), children: jsx(Switch, { checked: user.active, onCheckedChange: (checked) => handleUserStatusChange(user, checked), disabled: updatingUserIds.has(user === null || user === void 0 ? void 0 : user.user_id), "aria-label": t('tabsUserstab.toggleStatusAriaLabel', {
222726
222861
  name: user.name,
222727
222862
  }), className: "cursor-pointer data-[state=checked]:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50" }) })] }))] }, row.key));
222728
- }), rows.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: isWatcher ? 2 : 5, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: t('tabsUserstab.noUsersFound') }) }))] })] }) }), jsx(AdvancedPagination, { variant: "footer", className: "-mx-6 -mb-6 mt-4 rounded-b-lg", totalPages: totalPages, currentPage: page, onPageChange: (_page) => handlePageChange(_page), totalCount: totalCount, itemsPerPage: PAGE_SIZE$d, itemLabel: "users" })] })), selectedUser && (jsx(Dialog, { open: !!selectedUser, onOpenChange: (open) => {
222863
+ }), rows.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: isWatcher ? 2 : 5, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: t('tabsUserstab.noUsersFound') }) }))] })] }) }), jsx(AdvancedPagination, { variant: "footer", className: "-mx-6 -mb-6 mt-4 rounded-b-lg", totalPages: totalPages, currentPage: page, onPageChange: (_page) => handlePageChange(_page), totalCount: totalCount, itemsPerPage: PAGE_SIZE$e, itemLabel: "users" })] })), selectedUser && (jsx(Dialog, { open: !!selectedUser, onOpenChange: (open) => {
222729
222864
  if (!open)
222730
222865
  setSelectedUser(null);
222731
222866
  }, children: jsxs(DialogContent, { autoFocus: false, className: "max-w-7xl w-[85vw] p-0 gap-0 overflow-hidden bg-white profile-component-dialog", style: { height: '85vh', display: 'flex', flexDirection: 'column' }, children: [jsx(DialogTitle, { className: "sr-only", children: t('tabsUserstab.profileDialogTitle') }), jsx(DialogDescription, { className: "sr-only", children: t('tabsUserstab.profileDialogDescription') }), jsx(Profile, { tenant: tenant, tenants: [], username: selectedUser.username, isAdmin: selectedUser.isAdmin, currentSPA: currentSpa, onClose: () => setSelectedUser(null), customization: {
@@ -223945,7 +224080,7 @@ function PoliciesTab({ tenant }) {
223945
224080
  : t('tabsPoliciestab.createPolicy')] }) }) }), editing && (policyDetails === null || policyDetails === void 0 ? void 0 : policyDetails.is_internal) && (jsx(TooltipContent, { children: jsx("p", { children: t('tabsPoliciestab.cannotEditInternal') }) }))] }) })] })] }) }), jsx(ResourcePickerModal, { open: isResourcePickerOpen, onOpenChange: setIsResourcePickerOpen, tenant: tenant, onSelect: addPickedResource })] }));
223946
224081
  }
223947
224082
 
223948
- const PAGE_SIZE$c = 10;
224083
+ const PAGE_SIZE$d = 10;
223949
224084
  function normalizeEvents(events) {
223950
224085
  if (!events)
223951
224086
  return [];
@@ -223994,8 +224129,8 @@ function AlertsTab({ tenant }) {
223994
224129
  const { data: watchedGroupsData, isLoading, isError, refetch, } = useGetWatchedGroupsQuery({
223995
224130
  params: {
223996
224131
  platform_key: tenant,
223997
- limit: PAGE_SIZE$c,
223998
- offset: (page - 1) * PAGE_SIZE$c,
224132
+ limit: PAGE_SIZE$d,
224133
+ offset: (page - 1) * PAGE_SIZE$d,
223999
224134
  },
224000
224135
  });
224001
224136
  const groups = useMemo(() => {
@@ -224008,7 +224143,7 @@ function AlertsTab({ tenant }) {
224008
224143
  return results;
224009
224144
  }, [watchedGroupsData, debouncedSearchQuery]);
224010
224145
  const totalPages = watchedGroupsData
224011
- ? Math.max(1, Math.ceil(watchedGroupsData.count / PAGE_SIZE$c))
224146
+ ? Math.max(1, Math.ceil(watchedGroupsData.count / PAGE_SIZE$d))
224012
224147
  : 0;
224013
224148
  const handlePageChange = async (newPage) => {
224014
224149
  setPage(newPage);
@@ -224317,7 +224452,7 @@ function AlertsTab({ tenant }) {
224317
224452
  setDeletingGroupId(null);
224318
224453
  }
224319
224454
  }
224320
- return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex mb-6 gap-2 flex-row items-center justify-between", children: [jsxs("div", { className: "relative max-w-sm w-full sm:w-auto", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: t('tabsAlertstab.searchAlertsPlaceholder'), "aria-label": t('tabsAlertstab.searchAlertsAriaLabel'), className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]" }), isLoading && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx("div", { className: "flex gap-2", children: jsx(Button$1, { onClick: openNew, "aria-label": t('tabsAlertstab.newAlertAriaLabel'), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: t('tabsAlertstab.newAlert') }) })] }), isLoading && (jsx("div", { className: "flex justify-center items-center h-64", children: jsx("div", { className: "py-8 text-center text-sm text-gray-500 dark:text-gray-400", children: t('tabsAlertstab.loading') }) })), isError && (jsx("div", { className: "py-8 text-center text-sm text-red-500", children: t('tabsAlertstab.failedToLoadAlerts') })), !isLoading && !isError && (jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: t('tabsAlertstab.columnName') }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[120px]" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [groups.map((g) => (jsxs("tr", { children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm", children: g.name }), jsx("td", { className: "px-6 py-4", children: jsxs("div", { className: "flex gap-2 justify-end", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => openEdit(g), disabled: deletingGroupId === g.id, "aria-label": t('tabsAlertstab.editAlertAriaLabel', { name: g.name }), children: jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) }), jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => onDelete(g), className: "text-red-600 hover:text-red-700", disabled: deletingGroupId === g.id, "aria-label": t('tabsAlertstab.deleteAlertAriaLabel', { name: g.name }), children: deletingGroupId === g.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) })] }) })] }, g.id))), groups.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 2, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: t('tabsAlertstab.noAlertsFound') }) }))] })] }) })), !isLoading && !isError && (jsx(AdvancedPagination, { variant: "footer", className: "-mx-6 -mb-6 mt-4 rounded-b-lg", totalPages: totalPages, currentPage: page, onPageChange: (newPage) => handlePageChange(newPage), totalCount: watchedGroupsData === null || watchedGroupsData === void 0 ? void 0 : watchedGroupsData.count, itemsPerPage: PAGE_SIZE$c, itemLabel: "alerts" })), jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent, { "aria-describedby": undefined, className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [jsx(DialogHeader, { children: jsx(DialogTitle, { children: editingGroup ? t('tabsAlertstab.editAlert') : t('tabsAlertstab.newAlert') }) }), jsxs("div", { className: "space-y-5", children: [jsxs("div", { className: "grid gap-1.5", children: [jsx(Label$1, { htmlFor: "wg-name", children: t('tabsAlertstab.nameLabel') }), jsx(Input, { id: "wg-name", value: name, onChange: (e) => setName(e.target.value), placeholder: t('tabsAlertstab.enterAlertNamePlaceholder'), required: true })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label$1, { children: t('tabsAlertstab.watchedUsersLabel') }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: t('tabsAlertstab.watchedUsersDescription') }), watchedUsers.length > 0 ? (jsx("div", { className: "space-y-2 max-h-48 overflow-y-auto border border-gray-200 dark:border-gray-700 rounded-md p-2", children: watchedUsers.map((user) => (jsxs("div", { className: "flex items-center justify-between bg-gray-50 dark:bg-gray-800 p-2 rounded-md", children: [jsxs("div", { className: "flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: user.name || user.username }), user.email && (jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: user.email }))] }), jsx(Button$1, { type: "button", variant: "ghost", size: "sm", onClick: () => removeWatchedUserDraft(user.id), className: "h-8 w-8 p-0 text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-900/20", "aria-label": t('tabsAlertstab.removeWatchedUserAriaLabel', {
224455
+ return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex mb-6 gap-2 flex-row items-center justify-between", children: [jsxs("div", { className: "relative max-w-sm w-full sm:w-auto", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: t('tabsAlertstab.searchAlertsPlaceholder'), "aria-label": t('tabsAlertstab.searchAlertsAriaLabel'), className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]" }), isLoading && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx("div", { className: "flex gap-2", children: jsx(Button$1, { onClick: openNew, "aria-label": t('tabsAlertstab.newAlertAriaLabel'), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: t('tabsAlertstab.newAlert') }) })] }), isLoading && (jsx("div", { className: "flex justify-center items-center h-64", children: jsx("div", { className: "py-8 text-center text-sm text-gray-500 dark:text-gray-400", children: t('tabsAlertstab.loading') }) })), isError && (jsx("div", { className: "py-8 text-center text-sm text-red-500", children: t('tabsAlertstab.failedToLoadAlerts') })), !isLoading && !isError && (jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: t('tabsAlertstab.columnName') }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[120px]" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [groups.map((g) => (jsxs("tr", { children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm", children: g.name }), jsx("td", { className: "px-6 py-4", children: jsxs("div", { className: "flex gap-2 justify-end", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => openEdit(g), disabled: deletingGroupId === g.id, "aria-label": t('tabsAlertstab.editAlertAriaLabel', { name: g.name }), children: jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) }), jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => onDelete(g), className: "text-red-600 hover:text-red-700", disabled: deletingGroupId === g.id, "aria-label": t('tabsAlertstab.deleteAlertAriaLabel', { name: g.name }), children: deletingGroupId === g.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) })] }) })] }, g.id))), groups.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 2, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: t('tabsAlertstab.noAlertsFound') }) }))] })] }) })), !isLoading && !isError && (jsx(AdvancedPagination, { variant: "footer", className: "-mx-6 -mb-6 mt-4 rounded-b-lg", totalPages: totalPages, currentPage: page, onPageChange: (newPage) => handlePageChange(newPage), totalCount: watchedGroupsData === null || watchedGroupsData === void 0 ? void 0 : watchedGroupsData.count, itemsPerPage: PAGE_SIZE$d, itemLabel: "alerts" })), jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent, { "aria-describedby": undefined, className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [jsx(DialogHeader, { children: jsx(DialogTitle, { children: editingGroup ? t('tabsAlertstab.editAlert') : t('tabsAlertstab.newAlert') }) }), jsxs("div", { className: "space-y-5", children: [jsxs("div", { className: "grid gap-1.5", children: [jsx(Label$1, { htmlFor: "wg-name", children: t('tabsAlertstab.nameLabel') }), jsx(Input, { id: "wg-name", value: name, onChange: (e) => setName(e.target.value), placeholder: t('tabsAlertstab.enterAlertNamePlaceholder'), required: true })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label$1, { children: t('tabsAlertstab.watchedUsersLabel') }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: t('tabsAlertstab.watchedUsersDescription') }), watchedUsers.length > 0 ? (jsx("div", { className: "space-y-2 max-h-48 overflow-y-auto border border-gray-200 dark:border-gray-700 rounded-md p-2", children: watchedUsers.map((user) => (jsxs("div", { className: "flex items-center justify-between bg-gray-50 dark:bg-gray-800 p-2 rounded-md", children: [jsxs("div", { className: "flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: user.name || user.username }), user.email && (jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: user.email }))] }), jsx(Button$1, { type: "button", variant: "ghost", size: "sm", onClick: () => removeWatchedUserDraft(user.id), className: "h-8 w-8 p-0 text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-900/20", "aria-label": t('tabsAlertstab.removeWatchedUserAriaLabel', {
224321
224456
  username: user.username,
224322
224457
  }), children: jsx(X$2, { className: "h-4 w-4" }) })] }, user.id))) })) : (jsx("div", { className: "text-sm text-gray-500 dark:text-gray-400 p-4 text-center border border-dashed border-gray-300 dark:border-gray-600 rounded-md", children: t('tabsAlertstab.noWatchedUsersAdded') })), jsxs("div", { className: "relative", children: [jsx(Input, { value: watchedUserSearch, onChange: (e) => {
224323
224458
  setWatchedUserSearch(e.target.value);
@@ -225505,7 +225640,7 @@ function BlocksView({ platformKey, onBack, }) {
225505
225640
  }
225506
225641
 
225507
225642
  const FILTER_ORDER = ['all', ...APPLICATION_STATUSES];
225508
- const PAGE_SIZE$b = 20;
225643
+ const PAGE_SIZE$c = 20;
225509
225644
  const SEARCH_DEBOUNCE_MS$1 = 300;
225510
225645
  /**
225511
225646
  * The public application URL on the auth SPA for one form of a platform
@@ -225648,7 +225783,7 @@ function SubmissionsPipeline({ platformKey, form, onBack, onOpen, }) {
225648
225783
  ...(sort !== '-created' ? { sort } : {}),
225649
225784
  ...candidateParams,
225650
225785
  page,
225651
- page_size: PAGE_SIZE$b,
225786
+ page_size: PAGE_SIZE$c,
225652
225787
  }, {
225653
225788
  refetchOnMountOrArgChange: true,
225654
225789
  });
@@ -225657,7 +225792,7 @@ function SubmissionsPipeline({ platformKey, form, onBack, onOpen, }) {
225657
225792
  : [];
225658
225793
  const rows = form ? allRows.filter((row) => row.form_id === form.id) : allRows;
225659
225794
  const count = typeof (pipeline === null || pipeline === void 0 ? void 0 : pipeline.count) === 'number' ? pipeline.count : allRows.length;
225660
- const totalPages = Math.max(1, Math.ceil(count / PAGE_SIZE$b));
225795
+ const totalPages = Math.max(1, Math.ceil(count / PAGE_SIZE$c));
225661
225796
  const counts = statsCounts(stats);
225662
225797
  const countFor = (key) => {
225663
225798
  if (!stats)
@@ -225695,7 +225830,7 @@ function SubmissionsPipeline({ platformKey, form, onBack, onOpen, }) {
225695
225830
  }) }) }), jsx("td", { className: "whitespace-nowrap px-6 py-4 text-sm text-gray-600 dark:text-gray-300", children: formatDate(row) }), jsx("td", { className: "px-6 py-4", children: jsx(Badge, { variant: "outline", className: approvalTone(row.status), children: STATUS_LABEL_KEYS[row.status]
225696
225831
  ? t(STATUS_LABEL_KEYS[row.status])
225697
225832
  : row.status }) })] }, row.id));
225698
- })) })] }) }), jsx(AdvancedPagination, { variant: "footer", className: "-mx-6 -mb-6 mt-4 rounded-b-lg", totalPages: totalPages, currentPage: page, onPageChange: (newPage) => setPage(newPage), totalCount: count, itemsPerPage: PAGE_SIZE$b, itemLabel: "applications" })] }))] }));
225833
+ })) })] }) }), jsx(AdvancedPagination, { variant: "footer", className: "-mx-6 -mb-6 mt-4 rounded-b-lg", totalPages: totalPages, currentPage: page, onPageChange: (newPage) => setPage(newPage), totalCount: count, itemsPerPage: PAGE_SIZE$c, itemLabel: "applications" })] }))] }));
225699
225834
  }
225700
225835
 
225701
225836
  // The user-onboarding form contract: the schema an admin authors in the admin
@@ -231744,7 +231879,7 @@ function ItemSearchDropdown({ platformKey, onSelect, }) {
231744
231879
  }, children: [jsx("div", { className: "flex-1 min-w-0", children: jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100 block truncate", children: item.name }) }), jsx(Badge, { variant: "secondary", className: "text-xs shrink-0 capitalize", children: displayItemType(item.itemType) })] }, `${item.itemType}-${item.id}`)))) : isFetching ? (jsx("div", { className: "px-3 py-4 text-center text-sm text-gray-400", children: t('monetizationItemSearchDropdown.searching') })) : (jsx("div", { className: "px-3 py-4 text-center text-sm text-gray-400", children: t('monetizationItemSearchDropdown.noItemsFound') })) }))] }));
231745
231880
  }
231746
231881
 
231747
- const PAGE_SIZE$a = 8;
231882
+ const PAGE_SIZE$b = 8;
231748
231883
  function PaywalledItemsList({ platformKey, onSelectItem, onAddCustomItem, }) {
231749
231884
  const t = useT();
231750
231885
  const [page, setPage] = useState(1);
@@ -231752,7 +231887,7 @@ function PaywalledItemsList({ platformKey, onSelectItem, onAddCustomItem, }) {
231752
231887
  const { data: paywalls, isLoading } = useListPaywallsQuery({
231753
231888
  platform_key: platformKey,
231754
231889
  page,
231755
- page_size: PAGE_SIZE$a,
231890
+ page_size: PAGE_SIZE$b,
231756
231891
  ...(statusFilter !== 'all' && { is_enabled: statusFilter === 'active' }),
231757
231892
  }, { refetchOnMountOrArgChange: true });
231758
231893
  return (jsxs("div", { className: "space-y-4", children: [jsx(Card$1, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", children: [jsx("h4", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: t('monetizationPaywalledItemsList.configureItemForSale') }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(ItemSearchDropdown, { platformKey: platformKey, onSelect: (itemType, uniqueId, name) => onSelectItem(itemType, uniqueId, name) }), jsx(Button$1, { variant: "outline", size: "icon", onClick: onAddCustomItem, className: "shrink-0 cursor-pointer", title: t('monetizationPaywalledItemsList.addCustomItemTitle'), children: jsx(Plus, { className: "h-4 w-4" }) })] })] }) }), jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsx("h4", { className: "text-sm font-medium text-gray-500", children: t('monetizationPaywalledItemsList.configuredItems') }), jsxs(Select$1, { value: statusFilter, onValueChange: (v) => {
@@ -231775,7 +231910,7 @@ function PaywalledItemsList({ platformKey, onSelectItem, onAddCustomItem, }) {
231775
231910
  : 'bg-gray-100 text-gray-500 border-gray-200 hover:bg-gray-100', children: pw.is_enabled
231776
231911
  ? t('monetizationPaywalledItemsList.statusActive')
231777
231912
  : t('monetizationPaywalledItemsList.statusDisabled') })] }) }, `${pw.item_type}-${pw.item_id}`));
231778
- }), jsx(AdvancedPagination, { variant: "footer", className: "mt-2 rounded-lg border", currentPage: page, totalPages: Math.ceil(paywalls.count / PAGE_SIZE$a), onPageChange: setPage, totalCount: paywalls.count, itemsPerPage: PAGE_SIZE$a, itemLabel: "items" })] })) : (jsx("p", { className: "text-sm text-gray-400 text-center py-6", children: statusFilter !== 'all'
231913
+ }), jsx(AdvancedPagination, { variant: "footer", className: "mt-2 rounded-lg border", currentPage: page, totalPages: Math.ceil(paywalls.count / PAGE_SIZE$b), onPageChange: setPage, totalCount: paywalls.count, itemsPerPage: PAGE_SIZE$b, itemLabel: "items" })] })) : (jsx("p", { className: "text-sm text-gray-400 text-center py-6", children: statusFilter !== 'all'
231779
231914
  ? t('monetizationPaywalledItemsList.noFilteredItemsFound', { status: statusFilter })
231780
231915
  : t('monetizationPaywalledItemsList.noItemsConfigured') }))] })] }));
231781
231916
  }
@@ -232126,7 +232261,7 @@ function MonetizationTab({ platformKey, authURL }) {
232126
232261
  }
232127
232262
 
232128
232263
  /** Matches the server-side cap on the global memories listing. */
232129
- const PAGE_SIZE$9 = 25;
232264
+ const PAGE_SIZE$a = 25;
232130
232265
  /**
232131
232266
  * Popup for managing one user's global memories. Reads them the way the
232132
232267
  * profile preview does — the caller in the path, the managed user identified
@@ -232147,10 +232282,10 @@ function UserMemoriesModal({ isOpen, onClose, tenantKey, adminUsername, user, })
232147
232282
  userId: adminUsername,
232148
232283
  // `user_id` must be the managed user's id (username) — the backend does
232149
232284
  // not resolve emails here, so passing one returns an empty list.
232150
- params: { page, page_size: PAGE_SIZE$9, user_id: user.username },
232285
+ params: { page, page_size: PAGE_SIZE$a, user_id: user.username },
232151
232286
  });
232152
232287
  const memories = (_a = memoriesData === null || memoriesData === void 0 ? void 0 : memoriesData.results) !== null && _a !== void 0 ? _a : [];
232153
- const totalPages = (memoriesData === null || memoriesData === void 0 ? void 0 : memoriesData.count) ? Math.ceil(memoriesData.count / PAGE_SIZE$9) : 0;
232288
+ const totalPages = (memoriesData === null || memoriesData === void 0 ? void 0 : memoriesData.count) ? Math.ceil(memoriesData.count / PAGE_SIZE$a) : 0;
232154
232289
  const isForbidden = !!error && error.status === 403;
232155
232290
  // The managed user's capture/personalization toggles, addressed through
232156
232291
  // their path the way every admin write here is. Hidden unless they load.
@@ -232206,7 +232341,7 @@ function UserMemoriesModal({ isOpen, onClose, tenantKey, adminUsername, user, })
232206
232341
  }), className: "cursor-pointer data-[state=checked]:bg-blue-500 flex-shrink-0" })] })] })), !isForbidden && (jsx("div", { className: "flex justify-end mb-4", children: jsxs(Button$1, { "data-testid": "user-memories-add", variant: "outline", size: "sm", onClick: () => setShowAdd(true), className: "text-xs", children: [jsx(Plus, { className: "h-3 w-3 mr-1" }), t('memoryAdminUserMemoriesModal.addMemoryButton')] }) })), isForbidden ? (jsx("div", { className: "rounded-lg border px-6 py-8 text-center", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx("p", { className: "text-sm text-gray-500", children: t('memoryAdminUserMemoriesModal.forbidden') }) })) : error ? (jsx("div", { className: "rounded-lg border px-6 py-8 text-center", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx("p", { className: "text-sm text-gray-500", children: t('memoryAdminUserMemoriesModal.failedToLoad') }) })) : (jsx(MemoriesList, { memories: memories, isLoading: isLoading, emptyText: t('memoryAdminUserMemoriesModal.noMemories'), deletingId: deletingId, onEdit: setEditingMemory, onDelete: handleDeleteMemory, totalPages: totalPages, currentPage: page, onPageChange: setPage })), jsx(AddMemoryDialog, { open: showAdd, onOpenChange: setShowAdd, org: tenantKey, username: user.username }), editingMemory && (jsx(EditMemoryDialog, { open: !!editingMemory, onOpenChange: (open) => !open && setEditingMemory(null), org: tenantKey, username: user.username, memory: editingMemory }))] }) }));
232207
232342
  }
232208
232343
 
232209
- const PAGE_SIZE$8 = 10;
232344
+ const PAGE_SIZE$9 = 10;
232210
232345
  const SEARCH_DEBOUNCE_MS = 300;
232211
232346
  /**
232212
232347
  * Tenant users table with server-side search. Opening a row shows that user's
@@ -232239,7 +232374,7 @@ function GlobalMemoriesSection({ tenantKey, username }) {
232239
232374
  platform_key: tenantKey,
232240
232375
  platform_org: tenantKey,
232241
232376
  page,
232242
- page_size: PAGE_SIZE$8,
232377
+ page_size: PAGE_SIZE$9,
232243
232378
  query: debouncedSearch,
232244
232379
  return_policies: 'false',
232245
232380
  });
@@ -232260,7 +232395,7 @@ function GlobalMemoriesSection({ tenantKey, username }) {
232260
232395
  email: user.email,
232261
232396
  }));
232262
232397
  }, [data]);
232263
- const totalPages = Math.ceil(((_a = data === null || data === void 0 ? void 0 : data.count) !== null && _a !== void 0 ? _a : 0) / PAGE_SIZE$8);
232398
+ const totalPages = Math.ceil(((_a = data === null || data === void 0 ? void 0 : data.count) !== null && _a !== void 0 ? _a : 0) / PAGE_SIZE$9);
232264
232399
  const isForbidden = !!error && error.status === 403;
232265
232400
  return (jsxs("div", { "data-testid": "memory-admin-global-section", children: [jsxs("div", { className: "relative mb-6 max-w-sm w-full sm:w-auto", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { "data-testid": "memory-admin-users-search", type: "text", value: searchQuery, onChange: (event) => setSearchQuery(event.target.value), placeholder: t('memoryAdminTab.searchUsersPlaceholder'), className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]", "aria-label": t('memoryAdminTab.searchUsersAriaLabel') }), searchQuery.length > 0 && (searchQuery !== debouncedSearch || isFetching) && (jsx(LoaderCircle, { "data-testid": "user-search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), isForbidden ? (jsx("div", { className: "rounded-lg border px-6 py-8 text-center", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx("p", { className: "text-sm text-gray-500", children: t('memoryAdminTab.forbidden') }) })) : isLoading ? (jsx("div", { className: "flex justify-center items-center h-64", children: jsx(Spinner, {}) })) : (jsxs(Fragment$1, { children: [jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[28%]", children: t('memoryAdminTab.nameColumn') }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[26%]", children: t('memoryAdminTab.usernameColumn') }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[30%]", children: t('memoryAdminTab.emailColumn') }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[16%]", children: t('memoryAdminTab.actionsColumn') })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [users.map((user) => (jsxs("tr", { "data-testid": `memory-admin-user-row-${user.username}`, children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 max-w-0", children: jsx("div", { className: "truncate font-medium", children: user.name || '—' }) }), jsx("td", { className: "px-6 py-4 text-gray-600 dark:text-gray-300 max-w-0", children: jsx("div", { className: "truncate", children: user.username }) }), jsx("td", { className: "px-6 py-4 text-gray-600 dark:text-gray-300 max-w-0", children: jsx("div", { className: "truncate", children: user.email || '—' }) }), jsx("td", { className: "px-6 py-4", children: jsx("div", { className: "flex justify-end gap-2", children: jsx(Button$1, { "data-testid": `memory-admin-user-view-${user.username}`, variant: "ghost", size: "sm", "aria-label": t('memoryAdminTab.viewMemoriesAriaLabel', {
232266
232401
  name: user.email || user.username,
@@ -232282,7 +232417,7 @@ const BulkDeleteMemoryModal$1 = dynamic(() => Promise.resolve().then(function ()
232282
232417
  const ManageCategoriesModal$1 = dynamic(() => Promise.resolve().then(function () { return manageCategoriesModal; }).then((module) => ({
232283
232418
  default: module.ManageCategoriesModal,
232284
232419
  })), { ssr: false });
232285
- const PAGE_SIZE$7 = 20;
232420
+ const PAGE_SIZE$8 = 20;
232286
232421
  const SNAPSHOT_PAGE_SIZE = 1000;
232287
232422
  function ManageMemories({ tenantKey, username, mentorId }) {
232288
232423
  var _a, _b, _c, _d, _e;
@@ -232297,7 +232432,7 @@ function ManageMemories({ tenantKey, username, mentorId }) {
232297
232432
  setPage(1);
232298
232433
  }, [selectedLearner, dateRange, selectedCategorySlug]);
232299
232434
  const listParams = useMemo(() => {
232300
- const params = { page, page_size: PAGE_SIZE$7 };
232435
+ const params = { page, page_size: PAGE_SIZE$8 };
232301
232436
  if (selectedLearner)
232302
232437
  params.email = selectedLearner;
232303
232438
  if (selectedCategorySlug !== 'all')
@@ -232316,7 +232451,7 @@ function ManageMemories({ tenantKey, username, mentorId }) {
232316
232451
  }, {
232317
232452
  skip: !tenantKey || !username || !mentorId,
232318
232453
  });
232319
- const totalPages = Math.max(1, Math.ceil(((_a = listResponse === null || listResponse === void 0 ? void 0 : listResponse.count) !== null && _a !== void 0 ? _a : 0) / PAGE_SIZE$7));
232454
+ const totalPages = Math.max(1, Math.ceil(((_a = listResponse === null || listResponse === void 0 ? void 0 : listResponse.count) !== null && _a !== void 0 ? _a : 0) / PAGE_SIZE$8));
232320
232455
  const { data: adminCategories } = useGetMemoryCategoriesAdminQuery({
232321
232456
  org: tenantKey,
232322
232457
  mentorId,
@@ -232558,7 +232693,7 @@ function AgentMemoriesModal({ isOpen, onClose, tenantKey, username, agent, }) {
232558
232693
  return (jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: jsxs(DialogContent, { "data-testid": "agent-memories-modal", "aria-label": "agent-memories", className: "flex max-h-[90vh] w-[calc(100vw-2rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl", children: [jsxs(DialogHeader, { className: "flex-shrink-0 border-b border-gray-200 px-6 py-4 pr-12", children: [jsx(DialogTitle, { className: "ibl-dialog-title", children: agent.name }), jsx(DialogDescription, { children: t('memoryAdminAgentMemoriesModal.description') })] }), jsx("div", { className: "min-h-0 flex-1 overflow-y-auto p-3 lg:p-4", children: jsx("div", { className: "space-y-8", children: jsx(ManageMemories, { tenantKey: tenantKey, username: username, mentorId: agent.unique_id }) }) })] }) }));
232559
232694
  }
232560
232695
 
232561
- const PAGE_SIZE$6 = 10;
232696
+ const PAGE_SIZE$7 = 10;
232562
232697
  /**
232563
232698
  * Agents table filtered by the same agent autocomplete the Billing tab's
232564
232699
  * Agent Limits section uses. Opening a row shows that agent's memories in a
@@ -232591,12 +232726,12 @@ function AgentMemoriesSection({ tenantKey, username }) {
232591
232726
  const { data, isLoading, isFetching, error } = useGetMentorsQuery({
232592
232727
  org: tenantKey,
232593
232728
  username,
232594
- limit: PAGE_SIZE$6,
232595
- offset: (page - 1) * PAGE_SIZE$6,
232729
+ limit: PAGE_SIZE$7,
232730
+ offset: (page - 1) * PAGE_SIZE$7,
232596
232731
  ...(agentFilter ? { uniqueId: agentFilter.value } : {}),
232597
232732
  });
232598
232733
  const agents = ((_a = data === null || data === void 0 ? void 0 : data.results) !== null && _a !== void 0 ? _a : []);
232599
- const totalPages = (data === null || data === void 0 ? void 0 : data.count) ? Math.ceil(data.count / PAGE_SIZE$6) : 0;
232734
+ const totalPages = (data === null || data === void 0 ? void 0 : data.count) ? Math.ceil(data.count / PAGE_SIZE$7) : 0;
232600
232735
  const isForbidden = !!error && error.status === 403;
232601
232736
  return (jsxs("div", { "data-testid": "memory-admin-agent-section", children: [jsx("div", { className: "mb-6 max-w-sm", children: jsx(SearchSelect, { labels: {
232602
232737
  // No field label — the users tab's search carries none either.
@@ -263346,7 +263481,7 @@ const AutoResizeTextarea = ({ allowEmptySubmit = false, value, onChange, onSubmi
263346
263481
  disabled, placeholder: placeholder, style: combinedStyle, className: `flex max-h-32 min-h-[36px] w-full resize-none rounded-2xl border-0 border-gray-200 bg-transparent px-4 py-2 pt-2 pb-1 text-base ring-offset-white placeholder:text-gray-400 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-800 dark:bg-gray-950 dark:ring-offset-gray-950 dark:placeholder:text-gray-400 ${className}`, ...props }));
263347
263482
  };
263348
263483
 
263349
- const PAGE_SIZE$5 = 10;
263484
+ const PAGE_SIZE$6 = 10;
263350
263485
  const MemoryMenu = ({ onClose, mentorId, tenantKey, username }) => {
263351
263486
  const t = useT();
263352
263487
  const [page, setPage] = useState(1);
@@ -263364,7 +263499,7 @@ const MemoryMenu = ({ onClose, mentorId, tenantKey, username }) => {
263364
263499
  mentorId,
263365
263500
  params: {
263366
263501
  page,
263367
- page_size: PAGE_SIZE$5,
263502
+ page_size: PAGE_SIZE$6,
263368
263503
  my_memory: true,
263369
263504
  },
263370
263505
  }, {
@@ -267316,7 +267451,7 @@ function DeleteItemConfirm({ isOpen, onClose, tenantKey, username, datasetName,
267316
267451
  : t('benchmarksDeleteItemConfirm.delete') })] })] }) }));
267317
267452
  }
267318
267453
 
267319
- const PAGE_SIZE$4 = 10;
267454
+ const PAGE_SIZE$5 = 10;
267320
267455
  function BenchmarkItemsModal({ isOpen, onClose, tenantKey, username, datasetName }) {
267321
267456
  var _a;
267322
267457
  const t = useT();
@@ -267328,17 +267463,17 @@ function BenchmarkItemsModal({ isOpen, onClose, tenantKey, username, datasetName
267328
267463
  userId: username,
267329
267464
  datasetName,
267330
267465
  page,
267331
- limit: PAGE_SIZE$4,
267466
+ limit: PAGE_SIZE$5,
267332
267467
  });
267333
267468
  const items = (_a = data === null || data === void 0 ? void 0 : data.results) !== null && _a !== void 0 ? _a : [];
267334
- const totalPages = evalTotalPages(data === null || data === void 0 ? void 0 : data.count, PAGE_SIZE$4);
267469
+ const totalPages = evalTotalPages(data === null || data === void 0 ? void 0 : data.count, PAGE_SIZE$5);
267335
267470
  return (jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: jsxs(DialogContent, { "aria-label": "benchmark-items", className: "w-full max-w-4xl max-h-[90vh] overflow-y-auto", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: datasetName }), jsx(DialogDescription, { children: t('benchmarksBenchmarkItemsModal.description') })] }), jsx("div", { className: "flex justify-end mb-4", children: jsxs(Button$1, { onClick: () => setShowAdd(true), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: [jsx(Plus, { className: "h-4 w-4 mr-1" }), t('benchmarksBenchmarkItemsModal.addItems')] }) }), isLoading ? (jsx("div", { className: "flex justify-center items-center h-40", children: jsx(Spinner, {}) })) : (jsxs(Fragment$1, { children: [jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-4 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[45%]", children: t('benchmarksBenchmarkItemsModal.questionColumn') }), jsx("th", { className: "px-4 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[45%]", children: t('benchmarksBenchmarkItemsModal.answerColumn') }), jsx("th", { className: "px-4 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[10%]", children: t('benchmarksBenchmarkItemsModal.actionsColumn') })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [items.map((item) => {
267336
267471
  var _a;
267337
267472
  return (jsxs("tr", { className: "align-top", children: [jsx("td", { className: "px-4 py-3 text-gray-900 dark:text-gray-100", children: jsx("div", { className: "line-clamp-3 break-words", children: typeof item.input === 'string' ? item.input : JSON.stringify(item.input) }) }), jsx("td", { className: "px-4 py-3 text-gray-600 dark:text-gray-300", children: jsx("div", { className: "line-clamp-3 break-words", children: (_a = item.expected_output) !== null && _a !== void 0 ? _a : jsx("span", { className: "text-gray-400", children: "\u2014" }) }) }), jsx("td", { className: "px-4 py-3 text-right", children: jsx(Button$1, { variant: "ghost", size: "sm", "aria-label": t('benchmarksBenchmarkItemsModal.deleteItemAriaLabel'), onClick: () => setDeleteItemId(item.id), children: jsx(Trash2, { className: "h-4 w-4 text-red-500" }) }) })] }, item.id));
267338
267473
  }), items.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 3, className: "px-4 py-8 text-center text-gray-500 dark:text-gray-400", children: t('benchmarksBenchmarkItemsModal.empty') }) }))] })] }) }), totalPages > 1 && (jsx("div", { className: "mt-6", children: jsx(AdvancedPagination, { totalPages: totalPages, currentPage: page, onPageChange: setPage }) }))] })), jsx(AddItemsModal, { isOpen: showAdd, onClose: () => setShowAdd(false), tenantKey: tenantKey, username: username, datasetName: datasetName }), deleteItemId && (jsx(DeleteItemConfirm, { isOpen: !!deleteItemId, onClose: () => setDeleteItemId(null), tenantKey: tenantKey, username: username, datasetName: datasetName, itemId: deleteItemId }))] }) }));
267339
267474
  }
267340
267475
 
267341
- const PAGE_SIZE$3 = 10;
267476
+ const PAGE_SIZE$4 = 10;
267342
267477
  function BenchmarksTab({ tenantKey, username, }) {
267343
267478
  var _a;
267344
267479
  const t = useT();
@@ -267350,13 +267485,13 @@ function BenchmarksTab({ tenantKey, username, }) {
267350
267485
  org: tenantKey,
267351
267486
  userId: username,
267352
267487
  page,
267353
- limit: PAGE_SIZE$3,
267488
+ limit: PAGE_SIZE$4,
267354
267489
  });
267355
267490
  const benchmarks = (_a = data === null || data === void 0 ? void 0 : data.results) !== null && _a !== void 0 ? _a : [];
267356
267491
  const filtered = searchQuery.trim()
267357
267492
  ? benchmarks.filter((benchmark) => benchmark.name.toLowerCase().includes(searchQuery.toLowerCase()))
267358
267493
  : benchmarks;
267359
- const totalPages = evalTotalPages(data === null || data === void 0 ? void 0 : data.count, PAGE_SIZE$3);
267494
+ const totalPages = evalTotalPages(data === null || data === void 0 ? void 0 : data.count, PAGE_SIZE$4);
267360
267495
  return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1 flex-wrap", children: [jsxs("div", { className: "relative mb-6 max-w-sm w-full sm:w-auto", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { type: "text", value: searchQuery, onChange: (event) => setSearchQuery(event.target.value), placeholder: t('benchmarksIndex.searchPlaceholder'), className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]", "aria-label": t('benchmarksIndex.searchAriaLabel') })] }), jsx("div", { className: "mb-6", children: jsxs(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", onClick: () => setShowCreate(true), children: [jsx(Plus, { className: "h-4 w-4 mr-1" }), t('benchmarksIndex.newBenchmark')] }) })] }), isLoading ? (jsx("div", { className: "flex justify-center items-center h-64", children: jsx(Spinner, {}) })) : (jsxs(Fragment$1, { children: [jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[28%]", children: t('benchmarksIndex.nameColumn') }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[36%]", children: t('benchmarksIndex.descriptionColumn') }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[20%]", children: t('benchmarksIndex.createdColumn') }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[16%]", children: t('benchmarksIndex.actionsColumn') })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [filtered.map((benchmark) => (jsxs("tr", { children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 max-w-0", children: jsx("div", { className: "truncate font-medium", children: benchmark.name }) }), jsx("td", { className: "px-6 py-4 text-gray-600 dark:text-gray-300 max-w-0", children: jsx("div", { className: "truncate", children: benchmark.description || '—' }) }), jsx("td", { className: "px-6 py-4 text-gray-600 dark:text-gray-300 whitespace-nowrap", children: benchmark.created_at
267361
267496
  ? formatDistanceToNow(new Date(benchmark.created_at), {
267362
267497
  addSuffix: true,
@@ -276950,7 +277085,7 @@ function isIblaiVoice(voice) {
276950
277085
  return voice.provider === 'iblai';
276951
277086
  }
276952
277087
 
276953
- const PAGE_SIZE$2 = 20;
277088
+ const PAGE_SIZE$3 = 20;
276954
277089
  function VoicePicker({ org, userId, provider, selectedVoiceId, onSelect, disabled, labels, }) {
276955
277090
  var _a, _b;
276956
277091
  const t = useT();
@@ -276970,13 +277105,13 @@ function VoicePicker({ org, userId, provider, selectedVoiceId, onSelect, disable
276970
277105
  userId,
276971
277106
  provider,
276972
277107
  page,
276973
- pageSize: PAGE_SIZE$2,
277108
+ pageSize: PAGE_SIZE$3,
276974
277109
  ...(debouncedSearch ? { search: debouncedSearch } : {}),
276975
277110
  }, { skip: !org || !userId });
276976
277111
  const paginated = data;
276977
277112
  const voices = (_a = paginated === null || paginated === void 0 ? void 0 : paginated.results) !== null && _a !== void 0 ? _a : [];
276978
277113
  const total = (_b = paginated === null || paginated === void 0 ? void 0 : paginated.count) !== null && _b !== void 0 ? _b : 0;
276979
- const totalPages = total > 0 ? Math.ceil(total / PAGE_SIZE$2) : 1;
277114
+ const totalPages = total > 0 ? Math.ceil(total / PAGE_SIZE$3) : 1;
276980
277115
  // Whenever a voice id is saved on the mentor settings, fetch it directly
276981
277116
  // so we can pin it at the top of the list. Otherwise the user can land
276982
277117
  // on a page that doesn't contain the selected voice and the selection
@@ -278555,7 +278690,7 @@ function GradeResultOverrideModal({ isOpen, onClose, result, tenantKey, mentorId
278555
278690
  return (jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent, { "aria-describedby": "grader-override-modal-description", "data-testid": "grader-override-modal", children: [jsx(DialogHeader, { children: jsx(DialogTitle, { className: "ibl-dialog-title", children: m.title }) }), isLoading || !detail ? (jsx("div", { className: "flex items-center justify-center py-8", "data-testid": "grader-override-loading", children: jsx(Spinner, {}) })) : (jsxs("div", { className: "space-y-4", id: "grader-override-modal-description", children: [jsxs("div", { className: "grid grid-cols-2 gap-2 rounded-lg border border-gray-200 bg-gray-50/60 p-3 text-sm", children: [jsx("span", { className: "text-gray-500", children: m.learnerLabel }), jsx("span", { className: "truncate text-gray-900", title: detail.student.email, children: detail.student.email }), jsx("span", { className: "text-gray-500", children: m.aiScoreLabel }), jsx("span", { className: "text-gray-900", children: formatPercent$1(detail.score) }), jsx("span", { className: "text-gray-500", children: m.currentOverrideLabel }), jsx("span", { className: "text-gray-900", "data-testid": "grader-override-current", children: hasExistingOverride ? `${detail.override_points} / ${totalPoints}` : m.noOverride })] }), jsxs("div", { className: "space-y-1.5", children: [jsx(Label$1, { htmlFor: "grader-override-points", children: m.pointsLabel }), jsx(Input, { id: "grader-override-points", type: "number", min: 0, max: maxPoints, step: "any", value: points, className: "w-28", onChange: (e) => setPoints(e.target.value) }), jsx("p", { className: "text-xs text-gray-500", children: m.pointsHelp.replace('{total}', String(maxPoints)) }), showErrors && !pointsValid && (jsx("p", { className: "text-xs text-red-500", children: m.pointsRange.replace('{total}', String(maxPoints)) }))] }), jsxs("div", { className: "space-y-1.5", children: [jsx(Label$1, { htmlFor: "grader-override-feedback", children: m.feedbackLabel }), jsx(Textarea, { id: "grader-override-feedback", value: feedback, placeholder: m.feedbackPlaceholder, rows: 3, onChange: (e) => setFeedback(e.target.value) })] }), hasExistingOverride && jsx("p", { className: "text-xs text-gray-500", children: m.clearHelp })] })), jsxs(DialogFooter, { className: "gap-3", children: [hasExistingOverride && (jsx(Button$1, { variant: "outline", className: "mr-auto text-red-600 hover:text-red-700", onClick: handleClear, disabled: isSaving || isLoading, "data-testid": "grader-override-clear", children: isClearing ? m.clearing : m.clear })), jsx(Button$1, { variant: "outline", onClick: onClose, children: m.cancel }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", onClick: handleSave, disabled: isSaving || isLoading, "data-testid": "grader-override-save", children: isSaving && !isClearing ? m.saving : m.save })] })] }) }));
278556
278691
  }
278557
278692
 
278558
- const PAGE_SIZE$1 = 10;
278693
+ const PAGE_SIZE$2 = 10;
278559
278694
  const STATUS_ALL = 'all';
278560
278695
  function formatPercent(score) {
278561
278696
  return `${Math.round(score * 100)}%`;
@@ -278597,10 +278732,10 @@ function ResultsSection({ labels, tenantKey, mentorId, username, canOverride, })
278597
278732
  graded_at_after: gradedAtAfter,
278598
278733
  graded_at_before: gradedAtBefore,
278599
278734
  page,
278600
- page_size: PAGE_SIZE$1,
278735
+ page_size: PAGE_SIZE$2,
278601
278736
  }, { skip: !tenantKey || !mentorId });
278602
278737
  const results = (_b = data === null || data === void 0 ? void 0 : data.results) !== null && _b !== void 0 ? _b : [];
278603
- const totalPages = Math.max(1, Math.ceil(((_c = data === null || data === void 0 ? void 0 : data.count) !== null && _c !== void 0 ? _c : 0) / PAGE_SIZE$1));
278738
+ const totalPages = Math.max(1, Math.ceil(((_c = data === null || data === void 0 ? void 0 : data.count) !== null && _c !== void 0 ? _c : 0) / PAGE_SIZE$2));
278604
278739
  const statusText = (value) => value ? labels.statusValues[value] : '—';
278605
278740
  return (jsxs("div", { className: "space-y-3", "data-testid": "grader-results-section", children: [jsxs("div", { children: [jsx("h4", { className: "text-sm font-medium text-gray-900", children: labels.sectionTitle }), jsx("p", { className: "text-xs text-gray-600", children: labels.description })] }), jsx("div", { className: "rounded-lg border p-4", children: jsxs("div", { className: "flex flex-col gap-3 lg:flex-row", children: [jsx("div", { className: "relative min-w-[200px] flex-1", children: jsxs(Popover, { children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { variant: "outline", role: "combobox", "aria-label": labels.filters.searchUser, className: "w-full justify-between bg-transparent font-normal", "data-testid": "grader-results-user-filter", children: [selectedEmail || labels.filters.searchUser, jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })] }) }), jsx(PopoverContent, { className: "w-full p-0", align: "start", portalled: false, children: jsxs(Command, { children: [jsx(CommandInput, { placeholder: labels.filters.searchUsersPlaceholder }), jsxs(CommandList, { children: [jsx(CommandEmpty, { children: labels.filters.noUsersFound }), jsxs(CommandGroup, { children: [jsxs(CommandItem, { value: "", onSelect: () => setSelectedEmail(''), children: [jsx(Check, { className: cn('mr-2 h-4 w-4', !selectedEmail ? 'opacity-100' : 'opacity-0') }), labels.filters.allUsers] }), learners.map((learner) => (jsxs(CommandItem, { value: learner.email, onSelect: () => setSelectedEmail(learner.email), children: [jsx(Check, { className: cn('mr-2 h-4 w-4', selectedEmail === learner.email ? 'opacity-100' : 'opacity-0') }), jsx("div", { className: "flex flex-col", children: jsx("span", { className: "font-medium text-gray-700", children: learner.email }) })] }, learner.email)))] })] })] }) })] }) }), jsxs(Select$1, { value: status, onValueChange: setStatus, children: [jsx(SelectTrigger, { className: "w-full lg:w-[160px]", "aria-label": labels.filters.statusLabel, "data-testid": "grader-results-status-filter", children: jsx(SelectValue, { placeholder: labels.filters.statusLabel }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: STATUS_ALL, children: labels.filters.allStatuses }), jsx(SelectItem, { value: "pending", children: labels.statusValues.pending }), jsx(SelectItem, { value: "published", children: labels.statusValues.published }), jsx(SelectItem, { value: "failed", children: labels.statusValues.failed })] })] }), jsxs(Popover, { children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { variant: "outline", className: "flex w-full items-center gap-2 bg-transparent font-normal whitespace-nowrap lg:w-auto", "data-testid": "grader-results-date-filter", children: [jsx(Calendar$1, { className: "h-4 w-4" }), (dateRange === null || dateRange === void 0 ? void 0 : dateRange.from) && (dateRange === null || dateRange === void 0 ? void 0 : dateRange.to)
278606
278741
  ? `${format$1(dateRange.from, 'MMM dd')} - ${format$1(dateRange.to, 'MMM dd')}`
@@ -282613,6 +282748,7 @@ const AGENT_DISCLAIMERS_TAB_LABELS = {
282613
282748
  title: 'Disclaimers',
282614
282749
  description: 'Configure disclaimer settings for your agent.',
282615
282750
  },
282751
+ infoBox: "Show your users the fine print. Add notices — like 'This is an AI assistant' or a compliance statement — that appear in the chat so people know what to expect.",
282616
282752
  userAgreement: {
282617
282753
  title: 'User Agreement',
282618
282754
  tooltip: 'Controls User Agreement',
@@ -282634,6 +282770,7 @@ const AGENT_DISCLAIMERS_TAB_LABELS = {
282634
282770
  save: 'Save',
282635
282771
  saving: 'Saving...',
282636
282772
  cancel: 'Cancel',
282773
+ viewAgreements: 'View Agreements',
282637
282774
  },
282638
282775
  toasts: {
282639
282776
  advisorySuccess: 'Agent updated successfully',
@@ -282644,6 +282781,20 @@ const AGENT_DISCLAIMERS_TAB_LABELS = {
282644
282781
  userAgreementDisabled: 'User agreement disabled successfully',
282645
282782
  toggleError: 'Failed to update user agreement',
282646
282783
  },
282784
+ agreements: {
282785
+ title: 'Agreements',
282786
+ dialogDescription: "Users who have accepted this agent's User Agreement.",
282787
+ totalAgreements: (count) => `${count} Total Agreements`,
282788
+ summaryDescription: "Review the users who have accepted this agent's User Agreement. Each entry shows the user's name, email and when they agreed. Users who haven't accepted yet aren't listed. Search matches the exact username.",
282789
+ searchPlaceholder: 'Search by username',
282790
+ searchAriaLabel: 'Search agreements by username',
282791
+ columnUser: 'User',
282792
+ columnAgreedAt: 'Agreed at',
282793
+ empty: 'No agreements yet',
282794
+ emptyDescription: 'Users who accept the User Agreement will appear here with the time they agreed.',
282795
+ noMatches: 'No users match your search',
282796
+ noMatchesDescription: 'Search matches the exact username — try the full username.',
282797
+ },
282647
282798
  };
282648
282799
  function buildDisclaimersTabLabels(t) {
282649
282800
  return {
@@ -282651,6 +282802,7 @@ function buildDisclaimersTabLabels(t) {
282651
282802
  title: t('disclaimersTabLabels.header.title'),
282652
282803
  description: t('disclaimersTabLabels.header.description'),
282653
282804
  },
282805
+ infoBox: t('disclaimersTabLabels.infoBox'),
282654
282806
  userAgreement: {
282655
282807
  title: t('disclaimersTabLabels.userAgreement.title'),
282656
282808
  tooltip: t('disclaimersTabLabels.userAgreement.tooltip'),
@@ -282672,6 +282824,7 @@ function buildDisclaimersTabLabels(t) {
282672
282824
  save: t('disclaimersTabLabels.actions.save'),
282673
282825
  saving: t('disclaimersTabLabels.actions.saving'),
282674
282826
  cancel: t('disclaimersTabLabels.actions.cancel'),
282827
+ viewAgreements: t('disclaimersTabLabels.actions.viewAgreements'),
282675
282828
  },
282676
282829
  toasts: {
282677
282830
  advisorySuccess: t('disclaimersTabLabels.toasts.advisorySuccess'),
@@ -282682,6 +282835,20 @@ function buildDisclaimersTabLabels(t) {
282682
282835
  userAgreementDisabled: t('disclaimersTabLabels.toasts.userAgreementDisabled'),
282683
282836
  toggleError: t('disclaimersTabLabels.toasts.toggleError'),
282684
282837
  },
282838
+ agreements: {
282839
+ title: t('disclaimersTabLabels.agreements.title'),
282840
+ dialogDescription: t('disclaimersTabLabels.agreements.dialogDescription'),
282841
+ totalAgreements: (count) => t('disclaimersTabLabels.agreements.totalAgreements', { count }),
282842
+ summaryDescription: t('disclaimersTabLabels.agreements.summaryDescription'),
282843
+ searchPlaceholder: t('disclaimersTabLabels.agreements.searchPlaceholder'),
282844
+ searchAriaLabel: t('disclaimersTabLabels.agreements.searchAriaLabel'),
282845
+ columnUser: t('disclaimersTabLabels.agreements.columnUser'),
282846
+ columnAgreedAt: t('disclaimersTabLabels.agreements.columnAgreedAt'),
282847
+ empty: t('disclaimersTabLabels.agreements.empty'),
282848
+ emptyDescription: t('disclaimersTabLabels.agreements.emptyDescription'),
282849
+ noMatches: t('disclaimersTabLabels.agreements.noMatches'),
282850
+ noMatchesDescription: t('disclaimersTabLabels.agreements.noMatchesDescription'),
282851
+ },
282685
282852
  };
282686
282853
  }
282687
282854
  function resolveDisclaimersTabLabels(override, t) {
@@ -282691,18 +282858,23 @@ function resolveDisclaimersTabLabels(override, t) {
282691
282858
  return deepMerge(base, override);
282692
282859
  }
282693
282860
 
282861
+ /* istanbul ignore next -- @preserve dynamic import is not testable in unit tests */
282862
+ const AgreementsModal$1 = dynamic(() => Promise.resolve().then(function () { return agreementsModal; }).then((module) => ({
282863
+ default: module.AgreementsModal,
282864
+ })), { ssr: false });
282694
282865
  // ── Component ────────────────────────────────────────────────────────────
282695
282866
  const DEFAULT_FALLBACK_DISCLAIMER = '';
282696
282867
  function AgentDisclaimersTab({ labels: labelsProp, defaultDisclaimerContent = DEFAULT_FALLBACK_DISCLAIMER, renderContent, }) {
282697
282868
  var _a, _b, _c, _d, _e;
282698
282869
  const t = useT();
282699
282870
  const labels = React__default.useMemo(() => resolveDisclaimersTabLabels(labelsProp, t), [labelsProp, t]);
282700
- const { tenantKey, mentorId, username, rbacPermissions } = useAgentSettings();
282871
+ const { tenantKey, mentorId, username, enableRBAC, rbacPermissions } = useAgentSettings();
282701
282872
  const [editMentor, { isLoading: isEditMentorLoading }] = useEditMentorMutation();
282702
282873
  const [createDisclaimer, { isLoading: isCreateDisclaimerLoading }] = useCreateDisclaimerMutation();
282703
282874
  const [updateDisclaimer, { isLoading: isUpdateDisclaimerLoading }] = useUpdateDisclaimerMutation();
282704
282875
  const [isEditDisclaimerModalOpen, setIsEditDisclaimerModalOpen] = React__default.useState(false);
282705
282876
  const [isEditUserAgreementModalOpen, setIsEditUserAgreementModalOpen] = React__default.useState(false);
282877
+ const [isAgreementsModalOpen, setIsAgreementsModalOpen] = React__default.useState(false);
282706
282878
  const { data: mentorSettings } = useGetMentorSettingsQuery({
282707
282879
  mentor: mentorId,
282708
282880
  org: tenantKey,
@@ -282816,25 +282988,27 @@ function AgentDisclaimersTab({ labels: labelsProp, defaultDisclaimerContent = DE
282816
282988
  // match any entry and WithPermissions resolves hasPermission=false.
282817
282989
  // @ts-ignore mentor_id exists on MentorSettings
282818
282990
  const viewDisclaimersResource = `/mentors/${mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor_id}/#view_disclaimers`;
282819
- return (jsxs(Fragment$1, { children: [jsx("div", { className: "flex h-[73px] flex-shrink-0 items-center border-b border-gray-200 bg-white p-4 lg:block", children: jsxs("div", { children: [jsx("h3", { className: "mb-1 text-base font-medium text-gray-900", children: labels.header.title }), jsx("p", { className: "text-xs text-gray-600", children: labels.header.description })] }) }), jsx("div", { className: "flex-1 space-y-6 overflow-y-auto p-3 lg:p-4", children: jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [jsx(WithPermissions, { rbacResource: viewDisclaimersResource, rbacPermissions: rbacPermissions !== null && rbacPermissions !== void 0 ? rbacPermissions : {}, children: ({ hasPermission }) => {
282820
- var _a;
282821
- return hasPermission && (jsx(UserAgreementCard, { content: (_a = userAgreement.content) !== null && _a !== void 0 ? _a : '', active: userAgreement.active, isDisabled: isUserAgreementDisabled, onToggle: toggleUserAgreement, onEditClick: () => setIsEditUserAgreementModalOpen(true), renderText: renderText, labels: labels }));
282822
- } }), jsx(WithFormPermissions, { name: "disclaimer",
282823
- // @ts-ignore permissions not in type of MentorSettingsPublic
282824
- permissions: (_c = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.permissions) === null || _c === void 0 ? void 0 : _c.field, children: ({ disabled }) => {
282825
- var _a, _b;
282826
- return (jsxs("div", { className: "overflow-hidden rounded-lg bg-gray-50", children: [jsx("div", { className: "flex items-center justify-between border-b border-gray-200 p-4", children: jsxs("div", { className: "flex items-center gap-2", children: [jsx("h3", { className: "text-sm font-medium text-gray-900", children: labels.advisory.title }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('tabsDisclaimersTab.advisoryMoreInfo', {
282827
- title: labels.advisory.title,
282828
- }), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.advisory.tooltip }) })] }) })] }) }), jsxs("div", { className: "flex items-start gap-2 p-4", children: [jsx("div", { className: "mt-1 flex-shrink-0", children: "\uD83D\uDCDD" }), jsx("div", { className: "flex h-[180px] flex-1 flex-col", children: jsx("div", { className: "mb-4 flex-grow overflow-y-auto", tabIndex: 0, role: "region", "aria-label": t('tabsDisclaimersTab.advisoryContentRegion', {
282829
- title: labels.advisory.title,
282830
- }), children: renderText((_a = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.disclaimer) !== null && _a !== void 0 ? _a : '') }) })] }), jsxs("div", { className: "flex w-full gap-2 px-4 pb-4", children: [jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 flex-1 py-5", disabled: disabled, onClick: () => setIsEditDisclaimerModalOpen(true), children: [jsx(SquarePen, { className: "mr-2 h-4 w-4" }), labels.actions.edit] }), jsx(CopyButton
282831
- // @ts-ignore disclaimer not in type of MentorSettingsPublic
282832
- , {
282991
+ return (jsxs(Fragment$1, { children: [jsx("div", { className: "flex h-[73px] flex-shrink-0 items-center border-b border-gray-200 bg-white p-4 lg:block", children: jsxs("div", { children: [jsx("h3", { className: "mb-1 text-base font-medium text-gray-900", children: labels.header.title }), jsx("p", { className: "text-xs text-gray-600", children: labels.header.description })] }) }), jsxs("div", { className: "flex-1 space-y-6 overflow-y-auto p-3 lg:p-4", children: [jsx("div", { className: "rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-600", "data-testid": "disclaimers-info-box", children: labels.infoBox }), jsx(WithPermissions, { rbacResource: viewDisclaimersResource, rbacPermissions: rbacPermissions !== null && rbacPermissions !== void 0 ? rbacPermissions : {}, children: ({ hasPermission }) => hasPermission &&
282992
+ userAgreementRecord &&
282993
+ userAgreement.active && (jsx("div", { className: "flex justify-end", children: jsxs(Button$1, { onClick: () => setIsAgreementsModalOpen(true), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", "data-testid": "view-agreements-button", children: [jsx(Users, { className: "mr-2 h-4 w-4" }), labels.actions.viewAgreements] }) })) }), jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [jsx(WithPermissions, { rbacResource: viewDisclaimersResource, rbacPermissions: rbacPermissions !== null && rbacPermissions !== void 0 ? rbacPermissions : {}, children: ({ hasPermission }) => {
282994
+ var _a;
282995
+ return hasPermission && (jsx(UserAgreementCard, { content: (_a = userAgreement.content) !== null && _a !== void 0 ? _a : '', active: userAgreement.active, isDisabled: isUserAgreementDisabled, onToggle: toggleUserAgreement, onEditClick: () => setIsEditUserAgreementModalOpen(true), renderText: renderText, labels: labels }));
282996
+ } }), jsx(WithFormPermissions, { name: "disclaimer",
282997
+ // @ts-ignore permissions not in type of MentorSettingsPublic
282998
+ permissions: (_c = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.permissions) === null || _c === void 0 ? void 0 : _c.field, enableRBAC: enableRBAC, children: ({ disabled }) => {
282999
+ var _a, _b;
283000
+ return (jsxs("div", { className: "overflow-hidden rounded-lg bg-gray-50", children: [jsx("div", { className: "flex items-center justify-between border-b border-gray-200 p-4", children: jsxs("div", { className: "flex items-center gap-2", children: [jsx("h3", { className: "text-sm font-medium text-gray-900", children: labels.advisory.title }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('tabsDisclaimersTab.advisoryMoreInfo', {
283001
+ title: labels.advisory.title,
283002
+ }), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.advisory.tooltip }) })] }) })] }) }), jsxs("div", { className: "flex items-start gap-2 p-4", children: [jsx("div", { className: "mt-1 flex-shrink-0", children: "\uD83D\uDCDD" }), jsx("div", { className: "flex h-[180px] flex-1 flex-col", children: jsx("div", { className: "mb-4 flex-grow overflow-y-auto", tabIndex: 0, role: "region", "aria-label": t('tabsDisclaimersTab.advisoryContentRegion', {
283003
+ title: labels.advisory.title,
283004
+ }), children: renderText((_a = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.disclaimer) !== null && _a !== void 0 ? _a : '') }) })] }), jsxs("div", { className: "flex w-full gap-2 px-4 pb-4", children: [jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 flex-1 py-5", disabled: disabled, onClick: () => setIsEditDisclaimerModalOpen(true), children: [jsx(SquarePen, { className: "mr-2 h-4 w-4" }), labels.actions.edit] }), jsx(CopyButton
282833
283005
  // @ts-ignore disclaimer not in type of MentorSettingsPublic
282834
- text: (_b = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.disclaimer) !== null && _b !== void 0 ? _b : '' })] })] }));
282835
- } })] }) }), jsx(EditDisclaimerModal, { open: isEditDisclaimerModalOpen, onOpenChange: setIsEditDisclaimerModalOpen,
283006
+ , {
283007
+ // @ts-ignore disclaimer not in type of MentorSettingsPublic
283008
+ text: (_b = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.disclaimer) !== null && _b !== void 0 ? _b : '' })] })] }));
283009
+ } })] })] }), jsx(EditDisclaimerModal, { open: isEditDisclaimerModalOpen, onOpenChange: setIsEditDisclaimerModalOpen,
282836
283010
  // @ts-ignore disclaimer not in type of MentorSettingsPublic
282837
- disclaimer: (_d = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.disclaimer) !== null && _d !== void 0 ? _d : '', onSave: handleSaveDisclaimer, onCancel: () => setIsEditDisclaimerModalOpen(false), isSaving: isEditMentorLoading, labels: labels }), jsx(EditUserAgreementModal, { open: isEditUserAgreementModalOpen, onOpenChange: setIsEditUserAgreementModalOpen, content: (_e = userAgreement.content) !== null && _e !== void 0 ? _e : '', onSave: handleSaveUserAgreement, onCancel: () => setIsEditUserAgreementModalOpen(false), isSaving: isUserAgreementDisabled, labels: labels })] }));
283011
+ disclaimer: (_d = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.disclaimer) !== null && _d !== void 0 ? _d : '', onSave: handleSaveDisclaimer, onCancel: () => setIsEditDisclaimerModalOpen(false), isSaving: isEditMentorLoading, labels: labels }), jsx(EditUserAgreementModal, { open: isEditUserAgreementModalOpen, onOpenChange: setIsEditUserAgreementModalOpen, content: (_e = userAgreement.content) !== null && _e !== void 0 ? _e : '', onSave: handleSaveUserAgreement, onCancel: () => setIsEditUserAgreementModalOpen(false), isSaving: isUserAgreementDisabled, labels: labels }), userAgreementRecord && (jsx(AgreementsModal$1, { open: isAgreementsModalOpen, onOpenChange: setIsAgreementsModalOpen, org: tenantKey, userId: username, mentorId: mentorId, disclaimerId: userAgreementRecord.id, labels: labels }))] }));
282838
283012
  }
282839
283013
 
282840
283014
  const DEFAULT_MENTOR_ROLES = ['editor', 'chat'];
@@ -284522,7 +284696,7 @@ function resolveEvaluationTabLabels(override, t) {
284522
284696
  return deepMerge(base, override);
284523
284697
  }
284524
284698
 
284525
- const PAGE_SIZE = 10;
284699
+ const PAGE_SIZE$1 = 10;
284526
284700
  function StatusBadge({ status }) {
284527
284701
  const upper = status === null || status === void 0 ? void 0 : status.toUpperCase();
284528
284702
  const color = upper === 'COMPLETED'
@@ -284575,7 +284749,7 @@ function AgentEvaluationTabContent({ labels: labelsOverride, PaginationComponent
284575
284749
  userId: username,
284576
284750
  datasetName: selectedBenchmark,
284577
284751
  page,
284578
- limit: PAGE_SIZE,
284752
+ limit: PAGE_SIZE$1,
284579
284753
  }, { skip: !selectedBenchmark });
284580
284754
  // Runs are benchmark-scoped server-side, but a benchmark can be evaluated
284581
284755
  // against multiple agents. Filter client-side to the agent we're editing:
@@ -284591,7 +284765,7 @@ function AgentEvaluationTabContent({ labels: labelsOverride, PaginationComponent
284591
284765
  return runMentor === mentorId;
284592
284766
  return !!username && run.username === username;
284593
284767
  }), [allRuns, mentorId, username]);
284594
- const totalPages = evalTotalPages(runsData === null || runsData === void 0 ? void 0 : runsData.count, PAGE_SIZE);
284768
+ const totalPages = evalTotalPages(runsData === null || runsData === void 0 ? void 0 : runsData.count, PAGE_SIZE$1);
284595
284769
  const [fetchRunDetail] = useLazyGetEvalRunQuery();
284596
284770
  const handleCheckStatus = async (runName) => {
284597
284771
  setCheckingRun(runName);
@@ -291176,6 +291350,62 @@ var trainOrDeleteModal = /*#__PURE__*/Object.freeze({
291176
291350
  TrainOrDeleteModal: TrainOrDeleteModal
291177
291351
  });
291178
291352
 
291353
+ const PAGE_SIZE = 20;
291354
+ function AgreementsModal({ open, onOpenChange, ...bodyProps }) {
291355
+ return (jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: open && jsx(AgreementsBody, { ...bodyProps }) }));
291356
+ }
291357
+ function AgreementsBody({ org, userId, mentorId, disclaimerId, labels }) {
291358
+ var _a, _b;
291359
+ const t = labels.agreements;
291360
+ const [searchTerm, setSearchTerm] = React__default.useState('');
291361
+ const [debouncedSearchTerm] = a$3(searchTerm, 300);
291362
+ const [page, setPage] = React__default.useState(1);
291363
+ const [pageSearchTerm, setPageSearchTerm] = React__default.useState(debouncedSearchTerm);
291364
+ // A new search always starts from the first page. Adjusting during render
291365
+ // (not in an effect) means no render is committed -- and no request fired --
291366
+ // with the new term and the old page.
291367
+ if (pageSearchTerm !== debouncedSearchTerm) {
291368
+ setPageSearchTerm(debouncedSearchTerm);
291369
+ setPage(1);
291370
+ }
291371
+ const { data, isLoading, isFetching } = useGetDisclaimerAgreementsQuery({
291372
+ org,
291373
+ userId,
291374
+ params: {
291375
+ disclaimer: disclaimerId,
291376
+ mentor_id: mentorId,
291377
+ username: debouncedSearchTerm || undefined,
291378
+ page,
291379
+ page_size: PAGE_SIZE,
291380
+ },
291381
+ },
291382
+ // Other users' agreements land in other clients, so the cached list goes
291383
+ // stale without any invalidation here; always refetch on (re)open.
291384
+ { refetchOnMountOrArgChange: true });
291385
+ const agreements = (_a = data === null || data === void 0 ? void 0 : data.results) !== null && _a !== void 0 ? _a : [];
291386
+ const count = (_b = data === null || data === void 0 ? void 0 : data.count) !== null && _b !== void 0 ? _b : 0;
291387
+ const totalPages = Math.max(1, Math.ceil(count / PAGE_SIZE));
291388
+ // An empty list is either nobody agreed yet or a search miss.
291389
+ const emptyState = debouncedSearchTerm
291390
+ ? { Icon: Search, heading: t.noMatches, description: t.noMatchesDescription }
291391
+ : { Icon: Users, heading: t.empty, description: t.emptyDescription };
291392
+ return (jsxs(DialogContent, { className: "flex h-[90vh] max-w-6xl flex-col p-0", "data-testid": "disclaimer-agreements", children: [jsxs(DialogHeader, { className: "flex-shrink-0 border-b border-gray-200 px-6 pt-6 pb-4", children: [jsx(DialogTitle, { className: "text-xl font-semibold text-gray-900", children: t.title }), jsx(DialogDescription, { className: "sr-only", children: t.dialogDescription })] }), jsx("div", { className: "scrollbar-hide flex-1 overflow-y-auto p-4", children: jsxs("div", { className: "space-y-6", children: [jsxs("div", { className: "rounded-lg border p-4", "data-testid": "disclaimer-agreements-summary", children: [jsxs("div", { className: "mb-3 flex items-center gap-2", children: [jsx(Users, { className: "h-5 w-5 text-blue-600", "aria-hidden": "true" }), jsx("span", { className: "font-semibold text-gray-900", "data-testid": "disclaimer-agreements-count", children: t.totalAgreements(count) })] }), jsx("p", { className: "text-sm leading-relaxed text-gray-900", role: "note", "data-testid": "disclaimer-agreements-banner", children: t.summaryDescription })] }), jsx("div", { className: "rounded-lg border p-4", children: jsxs("div", { className: "relative", children: [jsx(Search, { className: "absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 transform text-gray-500", "aria-hidden": "true" }), jsx(Input, { type: "search", value: searchTerm, onChange: (event) => setSearchTerm(event.target.value), placeholder: t.searchPlaceholder, "aria-label": t.searchAriaLabel, className: "w-full pl-9", "data-testid": "disclaimer-agreements-search" })] }) }), isLoading ? (jsx("div", { className: "space-y-2", "data-testid": "disclaimer-agreements-loading", "aria-busy": "true", children: [0, 1, 2].map((key) => (jsx("div", { className: "h-9 animate-pulse rounded bg-gray-200" }, key))) })) : agreements.length === 0 ? (jsxs("div", { className: "rounded-lg border border-dashed border-gray-200 bg-gray-50 p-6 text-center text-sm text-gray-600 md:p-10", "data-testid": "disclaimer-agreements-empty", children: [jsx(emptyState.Icon, { className: "mx-auto mb-2 h-8 w-8 text-blue-600", "aria-hidden": "true" }), jsx("p", { className: "font-medium text-gray-900", children: emptyState.heading }), jsx("p", { className: "mt-1 text-sm text-gray-600", children: emptyState.description })] })) : (jsx("div", { className: "overflow-hidden rounded-lg border border-gray-200 bg-white", children: jsxs(Table$1, { children: [jsx(TableHeader$1, { children: jsxs(TableRow$1, { children: [jsx(TableHead, { children: t.columnUser }), jsx(TableHead, { className: "w-0 whitespace-nowrap", children: t.columnAgreedAt })] }) }), jsx(TableBody, { children: agreements.map((agreement) => {
291393
+ const agreedAt = new Date(agreement.agreed_at);
291394
+ // Primary is the full name, falling back to the username.
291395
+ // Secondary is the email, falling back to the username only
291396
+ // when the primary is the name (never print it twice).
291397
+ const primary = agreement.user_full_name || agreement.user_id;
291398
+ const secondary = agreement.user_email ||
291399
+ (primary !== agreement.user_id ? agreement.user_id : null);
291400
+ return (jsxs(TableRow$1, { "data-testid": "disclaimer-agreement-row", "data-username": agreement.user_id, children: [jsxs(TableCell$1, { children: [jsx("div", { className: "font-medium text-gray-900", "data-testid": "disclaimer-agreement-user", children: primary }), secondary && jsx("div", { className: "text-xs text-gray-500", children: secondary })] }), jsx(TableCell$1, { className: "text-sm whitespace-nowrap text-gray-600", children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { children: formatDistanceToNow(agreedAt, { addSuffix: true }) }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: format$1(agreedAt, "MMM dd, yyyy 'at' h:mm a") }) })] }) })] }, agreement.id));
291401
+ }) })] }) })), jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: isFetching })] }) })] }));
291402
+ }
291403
+
291404
+ var agreementsModal = /*#__PURE__*/Object.freeze({
291405
+ __proto__: null,
291406
+ AgreementsModal: AgreementsModal
291407
+ });
291408
+
291179
291409
  function ImagePreviewModal({ url, onClose }) {
291180
291410
  return (jsx("div", { className: "bg-opacity-75 fixed inset-0 z-50 flex items-center justify-center bg-black p-4", onClick: onClose, children: jsxs("div", { className: "relative flex h-full w-full items-center justify-center", children: [jsx("button", { className: "bg-opacity-50 hover:bg-opacity-70 absolute top-2 right-2 rounded-full bg-black p-1 text-white", onClick: (e) => {
291181
291411
  e.stopPropagation();