@arbidocs/blocks 0.4.146 → 0.4.147

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/agents/index.cjs +262 -262
  2. package/dist/agents/index.js +5 -5
  3. package/dist/{chunk-MFMASSEO.cjs → chunk-AINU3EJ6.cjs} +8 -8
  4. package/dist/{chunk-MFMASSEO.cjs.map → chunk-AINU3EJ6.cjs.map} +1 -1
  5. package/dist/{chunk-O2GW5IY6.cjs → chunk-AO7SK6WP.cjs} +29 -29
  6. package/dist/{chunk-O2GW5IY6.cjs.map → chunk-AO7SK6WP.cjs.map} +1 -1
  7. package/dist/{chunk-OBWYM25Y.js → chunk-DAHCRVPM.js} +3 -3
  8. package/dist/{chunk-OBWYM25Y.js.map → chunk-DAHCRVPM.js.map} +1 -1
  9. package/dist/{chunk-FUTMU4FR.js → chunk-DGV7HQA7.js} +6 -179
  10. package/dist/chunk-DGV7HQA7.js.map +1 -0
  11. package/dist/{chunk-O6IEZDRC.cjs → chunk-GRGS5M6O.cjs} +181 -3
  12. package/dist/chunk-GRGS5M6O.cjs.map +1 -0
  13. package/dist/{chunk-A6IU4GIW.js → chunk-H74HEPKT.js} +3 -3
  14. package/dist/{chunk-A6IU4GIW.js.map → chunk-H74HEPKT.js.map} +1 -1
  15. package/dist/{chunk-LPYEUD2D.cjs → chunk-IL3WB3YX.cjs} +3 -3
  16. package/dist/{chunk-LPYEUD2D.cjs.map → chunk-IL3WB3YX.cjs.map} +1 -1
  17. package/dist/{chunk-C3CGJK7A.cjs → chunk-LTU35TQN.cjs} +5 -5
  18. package/dist/{chunk-C3CGJK7A.cjs.map → chunk-LTU35TQN.cjs.map} +1 -1
  19. package/dist/{chunk-T5B7FM7S.js → chunk-LZRMXJIE.js} +3 -3
  20. package/dist/{chunk-T5B7FM7S.js.map → chunk-LZRMXJIE.js.map} +1 -1
  21. package/dist/{chunk-OPTBQSCV.cjs → chunk-MFY2ZNP6.cjs} +2 -181
  22. package/dist/{chunk-FUTMU4FR.js.map → chunk-MFY2ZNP6.cjs.map} +1 -1
  23. package/dist/{chunk-6HCJ3ZEU.js → chunk-R6VCPDPF.js} +178 -6
  24. package/dist/chunk-R6VCPDPF.js.map +1 -0
  25. package/dist/{chunk-C44TDH54.js → chunk-SUUPR735.js} +3 -3
  26. package/dist/{chunk-C44TDH54.js.map → chunk-SUUPR735.js.map} +1 -1
  27. package/dist/{chunk-RB7GX2VT.cjs → chunk-T5I4NRFP.cjs} +6 -6
  28. package/dist/{chunk-RB7GX2VT.cjs.map → chunk-T5I4NRFP.cjs.map} +1 -1
  29. package/dist/chunk-U37AYUPI.cjs +5371 -0
  30. package/dist/chunk-U37AYUPI.cjs.map +1 -0
  31. package/dist/{chunk-IJST4EBM.js → chunk-VUR63NMQ.js} +5 -5
  32. package/dist/{chunk-IJST4EBM.js.map → chunk-VUR63NMQ.js.map} +1 -1
  33. package/dist/chunk-WIZ7Z7FN.js +5179 -0
  34. package/dist/chunk-WIZ7Z7FN.js.map +1 -0
  35. package/dist/collaboration/index.cjs +73 -73
  36. package/dist/collaboration/index.js +2 -2
  37. package/dist/connect/docx.cjs +7 -7
  38. package/dist/connect/docx.js +4 -4
  39. package/dist/connect/index.cjs +1029 -125
  40. package/dist/connect/index.cjs.map +1 -1
  41. package/dist/connect/index.d.ts +1 -0
  42. package/dist/connect/index.js +910 -13
  43. package/dist/connect/index.js.map +1 -1
  44. package/dist/connection/connectors/ConnectedAppsSettings.d.ts +24 -0
  45. package/dist/connection/connectors/ConnectedDriveSyncDialog.d.ts +12 -0
  46. package/dist/connection/connectors/ConnectedMailboxSyncDialog.d.ts +12 -0
  47. package/dist/connection/connectors/index.d.ts +4 -0
  48. package/dist/connection/connectors/sync-labels.d.ts +21 -0
  49. package/dist/connection/settings-page/ConnectedSettingsPage.d.ts +4 -0
  50. package/dist/connection/settings-page/index.d.ts +1 -1
  51. package/dist/files/index.cjs +2 -2
  52. package/dist/files/index.js +2 -2
  53. package/dist/index.cjs +395 -395
  54. package/dist/index.js +11 -11
  55. package/dist/settings/PlanBadge.d.ts +1 -1
  56. package/dist/settings/index.cjs +545 -3710
  57. package/dist/settings/index.cjs.map +1 -1
  58. package/dist/settings/index.js +8 -3525
  59. package/dist/settings/index.js.map +1 -1
  60. package/dist/site/index.cjs +5 -5
  61. package/dist/site/index.js +1 -1
  62. package/dist/studio/index.cjs +1 -1
  63. package/dist/studio/index.js +1 -1
  64. package/dist/workflow-canvas/index.cjs +18 -18
  65. package/dist/workflow-canvas/index.js +5 -5
  66. package/node_modules/@arbidocs/coedit/package.json +1 -1
  67. package/package.json +4 -4
  68. package/dist/chunk-5YHEHEJT.js +0 -1667
  69. package/dist/chunk-5YHEHEJT.js.map +0 -1
  70. package/dist/chunk-6HCJ3ZEU.js.map +0 -1
  71. package/dist/chunk-O6IEZDRC.cjs.map +0 -1
  72. package/dist/chunk-OPTBQSCV.cjs.map +0 -1
  73. package/dist/chunk-U73KPFYH.cjs +0 -1717
  74. package/dist/chunk-U73KPFYH.cjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { PageLoading, WorkspacePageFrame, WorkspaceIdentityPanel, WorkspaceProjectSlot, WorkspaceAudienceLine, CommonWorkspaceToggle, ExpandableSection, LeaveFooter } from '../chunk-EV7W64B6.js';
3
- import { DraggableHeader, SettingsSection, ProfileCard, AvatarPicker, IdentityVerificationCard, IdentityVerificationDialog, RequireVerified, PasswordChangeDialog, SettingsCard, SettingsActionRow, EMAIL_NOTIFICATION_KEYS, EMAIL_NOTIFICATION_CATEGORIES, NotificationCategoryList, toNotificationCategories, toActiveSessionViews, SettingsRow, ActiveSessionsDialog, LogoutDialog, toLogoutSessionViews, SettingsDangerZone, DeleteAccountDialog, toDeleteBlockerViews, SettingsPanel, PremiumModelsFrame, SettingsPage, serverConnectionView, ServerConnectionButton, ModelProviderLabel } from '../chunk-5YHEHEJT.js';
3
+ import { DraggableHeader, SettingsSection, ProfileCard, AvatarPicker, IdentityVerificationCard, IdentityVerificationDialog, RequireVerified, PasswordChangeDialog, SettingsCard, SettingsActionRow, EMAIL_NOTIFICATION_KEYS, EMAIL_NOTIFICATION_CATEGORIES, NotificationCategoryList, toNotificationCategories, toActiveSessionViews, SettingsRow, ActiveSessionsDialog, LogoutDialog, toLogoutSessionViews, SettingsDangerZone, DeleteAccountDialog, toDeleteBlockerViews, SettingsPanel, PremiumModelsFrame, ConnectionsLoading, ConnectionsError, ConnectionsEmpty, SettingsPage, SyncDialogBody, SyncField, SyncSelect, SyncSmallNote, SyncLoading, SyncReconnectNotice, SyncNote, SyncTreeFrame, SyncLinkRow, SyncLinkButton, SyncOptions, SyncOptionToggle, SyncDialogFooter, serverConnectionView, ServerConnectionButton, ModelProviderLabel, SyncFolderRow, SyncFolderStatus, ConnectionCard } from '../chunk-WIZ7Z7FN.js';
4
4
  export { ConnectedAssistantDock, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useSemanticSearch, useWorkspaceDocs } from '../chunk-CSI2B2H5.js';
5
- import { useConnectedWorkspaceRole, ConnectedNativeDocxEditor } from '../chunk-OBWYM25Y.js';
6
- export { ConnectedWorkflowDocumentsField, ConnectedWorkflowLauncher, ConnectedWorkflowsTable, DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, NativeDocxSupportProvider, toWorkflowFieldDocument, useConnectedAgentOptions, useConnectedWorkflowScopeSource, useConnectedWorkspaceRole, useNativeDocxSupport } from '../chunk-OBWYM25Y.js';
5
+ import { useConnectedWorkspaceRole, ConnectedNativeDocxEditor } from '../chunk-DAHCRVPM.js';
6
+ export { ConnectedWorkflowDocumentsField, ConnectedWorkflowLauncher, ConnectedWorkflowsTable, DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, NativeDocxSupportProvider, toWorkflowFieldDocument, useConnectedAgentOptions, useConnectedWorkflowScopeSource, useConnectedWorkspaceRole, useNativeDocxSupport } from '../chunk-DAHCRVPM.js';
7
7
  export { ConnectedWorkspaceDataProvider, useConnectedConversations, useConnectedDocuments, useConnectedTags } from '../chunk-DN2KI4BU.js';
8
8
  import { ConnectionProvider, useConnection, useConnectedWorkspace } from '../chunk-US3S4DCB.js';
9
9
  export { ConnectionProvider, SESSION_EXPIRED_MESSAGE, isAuthenticated, useConnectedWorkspace, useConnection } from '../chunk-US3S4DCB.js';
@@ -12,21 +12,25 @@ import '../chunk-MTSKK3BN.js';
12
12
  import '../chunk-2FL7QJKJ.js';
13
13
  import '../chunk-HFZ45FD3.js';
14
14
  import { FilesFilterBar, FolderFilterButton, FolderPickerRow } from '../chunk-7RJTEWYM.js';
15
- import { WorkspaceActivityList, WorkspaceNotificationMenu, ThreadFollowMenuItem, ThreadFollowButton, TagTable, LoadingIndicator, EntityIdentityBar, IDENTITY_NAME_MAX_LENGTH, tagTableDocx } from '../chunk-A6IU4GIW.js';
15
+ import '../chunk-RC6VTY2H.js';
16
+ import { WorkspaceActivityList, WorkspaceNotificationMenu, ThreadFollowMenuItem, ThreadFollowButton, TagTable, LoadingIndicator, EntityIdentityBar, IDENTITY_NAME_MAX_LENGTH, tagTableDocx } from '../chunk-H74HEPKT.js';
16
17
  import { MemberAvatarStack } from '../chunk-XNOASBGW.js';
18
+ import '../chunk-66TA5IBN.js';
17
19
  import { WorkspaceIdentity, workspaceKindColor } from '../chunk-A3XPS2EU.js';
18
- import { PlainMailBodyEditor, draftMailCompose, replyMailCompose, emptyMailCompose, MailGrid, MailMessageView, MailDocumentPicker, parseMailRecipients } from '../chunk-6HCJ3ZEU.js';
20
+ import '../chunk-NHZK64TQ.js';
21
+ import { PlainMailBodyEditor, buildMailFolderTree, MailFolderTree, draftMailCompose, replyMailCompose, emptyMailCompose, MailGrid, MailMessageView, MailDocumentPicker, parseMailRecipients } from '../chunk-R6VCPDPF.js';
19
22
  import '../chunk-SV65E4QW.js';
20
23
  import { DOCX_MIME_TYPE } from '../chunk-QXMR5YHC.js';
21
24
  import '../chunk-AF6RDAJF.js';
22
- import { buildLibrarySkills, filterLibrarySkills, SKILL_SOURCE_LABELS, SKILL_TYPE_LABELS, SkillViewToggle, SkillFilterChips, SkillTile, SkillGenerateForm, SkillLibraryDetail, parseSkillFrontmatter, SKILL_MAIN_FILENAME, SkillEditForm, DEFAULT_AGENT_CAPABILITIES, stripPersonaPreamble, AgentCreator, DEFAULT_AGENT_TYPES, DEFAULT_AGENT_TEMPLATES, AgentAvatarField, isValidAgentName, AgentConnectInstructions, TaskRunsDialog, TaskActivityDialog, WorkflowStepBar, composePersona, importSkillFile, importSkillFromUrl, WorkflowRunner, skillSlug, serializeSkill, fromPlanSteps, toPlanSteps, useWorkflowView, workflowToSkillMarkdown } from '../chunk-C44TDH54.js';
25
+ import { buildLibrarySkills, filterLibrarySkills, SKILL_SOURCE_LABELS, SKILL_TYPE_LABELS, SkillViewToggle, SkillFilterChips, SkillTile, SkillGenerateForm, SkillLibraryDetail, parseSkillFrontmatter, SKILL_MAIN_FILENAME, SkillEditForm, DEFAULT_AGENT_CAPABILITIES, stripPersonaPreamble, AgentCreator, DEFAULT_AGENT_TYPES, DEFAULT_AGENT_TEMPLATES, AgentAvatarField, isValidAgentName, AgentConnectInstructions, TaskRunsDialog, TaskActivityDialog, WorkflowStepBar, composePersona, importSkillFile, importSkillFromUrl, WorkflowRunner, skillSlug, serializeSkill, fromPlanSteps, toPlanSteps, useWorkflowView, workflowToSkillMarkdown } from '../chunk-SUUPR735.js';
23
26
  import { MultiSelect } from '../chunk-CQCC7LE7.js';
24
- import { PersonPill } from '../chunk-T5B7FM7S.js';
27
+ import { PersonPill } from '../chunk-LZRMXJIE.js';
25
28
  import '../chunk-IXWJGOM2.js';
26
- import '../chunk-RLWIUUQ5.js';
27
29
  import { TriStateFilterMenu } from '../chunk-KSHKTOY2.js';
30
+ import '../chunk-RLWIUUQ5.js';
28
31
  import '../chunk-P6GHJSLR.js';
29
32
  import '../chunk-EVUEIBNU.js';
33
+ import '../chunk-5LXQPP2K.js';
30
34
  import '../chunk-YKQ2DPIP.js';
31
35
  import { SelectionBar, SelectionBarAction } from '../chunk-NUNKSZKU.js';
32
36
  import { FilterInput } from '../chunk-YU2KUMGE.js';
@@ -54,11 +58,11 @@ import { fmtDate, initials } from '../chunk-OXF2IFXG.js';
54
58
  import '../chunk-VUNV25KB.js';
55
59
  import { lazy, useState, useMemo, useEffect, useCallback, useRef, Suspense, useSyncExternalStore, useLayoutEffect } from 'react';
56
60
  import { QueryClient, QueryClientProvider, useQueryClient, useQuery } from '@tanstack/react-query';
57
- import { ArbiProvider, useConversations, useRunConversation, useWorkspaceActivity, useWorkspaceUsers, isWorkspaceNotificationType, useArbi, useNotifications, useDeleteNotifications, useMarkNotificationsRead, useWorkspaces, useWorkspaceNotificationLevel, useFollowThread, useUploadSkillFiles, useSkills, useSetSkillVisibility, useDeleteSkill, useSkillSource, useAgentModels, useMcpTools, useAgentConfig, useAgentWorkspaces, useCreateAgent, useSaveAgentConfig, useGrantAgentAccess, useRevokeAgentAccess, useGenerateAgentAvatar, useWorkflowRuns, useConversationActivity, useAgents, ArtifactCanvas, useArbiChat, useDocuments, useTagKindSchema, useTags, useSetTagValues, useUpdateTagKindSchema, useInvalidateTagData, useShellWorkspaces, ArbiBotHeadIcon, useProfile, useUpdateProfile, useRequestEmailChange, useConfirmEmailChange, useNameEditor, useAvatarCrop, useEmailChange, ImageCropModal, useIdentityVerification, usePasswordChange, usePasswordChangeForm, useNotificationPreferences, useSessions, useCurrentSessionId, useTerminateSession, useSignOut, useDeleteAccount, useDeleteAccountFlow, useMailClient, defaultMailAlias, useClaimNativeAlias, useMailOnline, useConnectMailAccount, useDisconnectMailAccount, useMailPolicy, useMailAccounts, useUserSettings, useUpdateUserSettings, useAvailableModels, useUpdateWorkspace, useAddWorkspaceMembers, useRemoveWorkspaceMembers, toShellWorkspace, useArbiWebSocket, useWorkNotifications, mailDraftIdFromContent, useMailUnlock, useMailFolders, useMailMessages, useMailDraftCompose, useMailMessage, useMailCache, MailOfflineUnavailableError, accountPath, useCalendarEvents, useCalendars, useFetchCalendarEvent, useCalendarSettings, useCalendarOverlays, useCalendarOutbox, useCalendarAccounts, useSyncAccountsOnOpen, useResumeCalendarAccountConnect, useCreateEvent, useUpdateEvent, useDeleteEvent, useMoveEvent, useRespondToEvent, useCreateCalendar, useUpdateCalendar, useDeleteCalendar, useImportCalendar, useSaveCalendarSettings, useRefreshCalendar, useCalendarEvent, useMailAttachmentText, useCalendarEventByUid, getPublicBookingPage, bookPublicSlot, PublicBookingError, useAgentSession, useStartAgentSession, useCloseAgentSession, isQueuedCalendarWrite, isAliasTakenError, nextAliasSuggestion, aliasTakenMessage, mailJson, ArbiWebSocketProvider, isDeploymentUserNotification, getWorkspaceActionText, getWorkspaceSentPhrase, describeServerNotification, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_TITLE, documentActivityPhrase, isSignatureNotificationType, inputRequestTitle, WORK_NOTIFICATION_LABELS, useArbiSessionState, documentDisplayName, getWorkspaceKind, formatRelativeTime, useCreateWork, useActOnStep, useConversationThreads, ProviderIcon, formatGbpPerMillionTokens, fileAttachment, useMailProjects, useSaveMailDraft, useSendMail, useMailDraftReplaced, useCalendarInvitations, useDecideCounter, useSearchContacts, usePublishCalendar, useCalendarShares, useShareCalendar, useUnshareCalendar, useSubscribeCalendar, useHolidayCountries, useAddHolidayCalendar, cancelPublicBooking, AiAnswer, signatureNotificationPhrase, signatureRequestMeta, getNotificationTypeMeta, useMailDraftEditor, useFreeBusy, useRooms, useFindTime, useCalendarSupport, useStartCalendarAccountOAuth, useConnectOAuthAccount, useAppPasswords, splitAppPasswords, useBookingPages, useDeleteBookingPage, useSyncCalendarAccount, useUpdateCalendarAccount, useDisconnectCalendarAccount, ACCOUNT_VENDOR, useCalDavProfiles, useConnectCalDavAccount, useCreateAppPassword, useCreateFeed, useSaveBookingPage, useCreateRoom, useRevokeAppPassword } from '@arbidocs/react';
61
+ import { ArbiProvider, useConversations, useRunConversation, useWorkspaceActivity, useWorkspaceUsers, isWorkspaceNotificationType, useArbi, useNotifications, useDeleteNotifications, useMarkNotificationsRead, useWorkspaces, useWorkspaceNotificationLevel, useFollowThread, useUploadSkillFiles, useSkills, useSetSkillVisibility, useDeleteSkill, useSkillSource, useAgentModels, useMcpTools, useAgentConfig, useAgentWorkspaces, useCreateAgent, useSaveAgentConfig, useGrantAgentAccess, useRevokeAgentAccess, useGenerateAgentAvatar, useWorkflowRuns, useConversationActivity, useAgents, ArtifactCanvas, useArbiChat, useDocuments, useTagKindSchema, useTags, useSetTagValues, useUpdateTagKindSchema, useInvalidateTagData, useShellWorkspaces, ArbiBotHeadIcon, useProfile, useUpdateProfile, useRequestEmailChange, useConfirmEmailChange, useNameEditor, useAvatarCrop, useEmailChange, ImageCropModal, useIdentityVerification, usePasswordChange, usePasswordChangeForm, useNotificationPreferences, useSessions, useCurrentSessionId, useTerminateSession, useSignOut, useDeleteAccount, useDeleteAccountFlow, useMailClient, defaultMailAlias, useClaimNativeAlias, useMailOnline, useConnectMailAccount, useDisconnectMailAccount, useMailPolicy, useMailAccounts, useUserSettings, useUpdateUserSettings, useAvailableModels, useConnectorVendorVisibility, useConnectorCatalog, useMyConnectors, useDisconnectConnector, useSlackConnection, useDisconnectSlack, isMailboxSyncVendor, isSharePointVendor, useUpdateWorkspace, useAddWorkspaceMembers, useRemoveWorkspaceMembers, toShellWorkspace, useEnableMailboxSync, useMailboxFolders, useEnableDriveSync, useDriveFolderChildren, connectorErrorStatus, useArbiWebSocket, useWorkNotifications, mailDraftIdFromContent, useMailUnlock, useMailFolders, useMailMessages, useMailDraftCompose, useMailMessage, useMailCache, MailOfflineUnavailableError, accountPath, useCalendarEvents, useCalendars, useFetchCalendarEvent, useCalendarSettings, useCalendarOverlays, useCalendarOutbox, useCalendarAccounts, useSyncAccountsOnOpen, useResumeCalendarAccountConnect, useCreateEvent, useUpdateEvent, useDeleteEvent, useMoveEvent, useRespondToEvent, useCreateCalendar, useUpdateCalendar, useDeleteCalendar, useImportCalendar, useSaveCalendarSettings, useRefreshCalendar, useCalendarEvent, useMailAttachmentText, useCalendarEventByUid, getPublicBookingPage, bookPublicSlot, PublicBookingError, useAgentSession, useStartAgentSession, useCloseAgentSession, isQueuedCalendarWrite, isAliasTakenError, nextAliasSuggestion, aliasTakenMessage, mailJson, connectorReturnTo, ArbiWebSocketProvider, isDeploymentUserNotification, getWorkspaceActionText, getWorkspaceSentPhrase, describeServerNotification, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_TITLE, documentActivityPhrase, isSignatureNotificationType, inputRequestTitle, WORK_NOTIFICATION_LABELS, useArbiSessionState, documentDisplayName, getWorkspaceKind, formatRelativeTime, useCreateWork, useActOnStep, useConversationThreads, ProviderIcon, formatGbpPerMillionTokens, useDriveFolderDocCount, fileAttachment, useMailProjects, useSaveMailDraft, useSendMail, useMailDraftReplaced, useCalendarInvitations, useDecideCounter, useSearchContacts, usePublishCalendar, useCalendarShares, useShareCalendar, useUnshareCalendar, useSubscribeCalendar, useHolidayCountries, useAddHolidayCalendar, cancelPublicBooking, AiAnswer, signatureNotificationPhrase, signatureRequestMeta, getNotificationTypeMeta, useMailDraftEditor, useFreeBusy, useRooms, useFindTime, useCalendarSupport, useStartCalendarAccountOAuth, useConnectOAuthAccount, useAppPasswords, splitAppPasswords, useBookingPages, useDeleteBookingPage, SHAREPOINT_VENDORS, useSyncCalendarAccount, useUpdateCalendarAccount, useDisconnectCalendarAccount, ACCOUNT_VENDOR, useCalDavProfiles, useConnectCalDavAccount, useCreateAppPassword, useCreateFeed, useSaveBookingPage, useCreateRoom, useRevokeAppPassword } from '@arbidocs/react';
58
62
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
59
- import { Button, Label, Input, cn, Textarea, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Switch, getEntityLabel, DocumentEntity, EntityPill, ShieldIcon, EntityIcon, Tooltip, TooltipTrigger, TooltipContent, Popover, PopoverTrigger, PopoverContent, Tabs, TabsList, TabsTrigger, TabsContent, DialogFooter, UserEntity } from '@arbidocs/react/ui';
63
+ import { Button, Label, Input, cn, Textarea, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Switch, Badge, getEntityLabel, DocumentEntity, EntityPill, ShieldIcon, EntityIcon, Tooltip, TooltipTrigger, TooltipContent, Popover, PopoverTrigger, PopoverContent, Tabs, TabsList, TabsTrigger, TabsContent, DialogFooter, UserEntity } from '@arbidocs/react/ui';
60
64
  import { useNotify } from '@arbidocs/react/shell';
61
- import { Bell, Activity, Info, UserCheck, Trash2, Loader2, Upload, Link2, Search, Plus, ArrowLeft, ExternalLink, Monitor, UserCircle, KeyRound, Radio, LogOut, Wifi, RotateCcw, User, Mail, HatGlasses, MessageSquare, FolderInput, Settings, Video, Printer, CalendarDays, Clock, MapPin, Globe, X, Paperclip, Send, Inbox, CalendarX, CalendarCheck, CalendarSearch, Pencil, DoorOpen, RefreshCw, CheckCircle2, AlertTriangle, Check, Copy } from 'lucide-react';
65
+ import { Bell, Activity, Info, UserCheck, Trash2, Loader2, Upload, Link2, Search, Plus, ArrowLeft, ExternalLink, Monitor, UserCircle, KeyRound, Radio, LogOut, Wifi, RotateCcw, Mail, User, HatGlasses, MessageSquare, PlugZap, FolderInput, Settings, Video, Printer, CalendarDays, Clock, MapPin, Globe, X, Paperclip, Send, Inbox, CalendarX, CalendarCheck, CalendarSearch, Pencil, DoorOpen, RefreshCw, CheckCircle2, AlertTriangle, Check, Copy } from 'lucide-react';
62
66
  import { useIsOnline, downloadBlob, useOptionalDocumentTools, fetchDocumentPdf, DocumentToolsProvider } from '@arbidocs/react/document-tools';
63
67
  import { useStreamedArtifact } from '@arbidocs/react/artifacts';
64
68
  import { bytesToBase64 } from '@arbidocs/client';
@@ -3660,11 +3664,269 @@ function ConnectedPremiumModels() {
3660
3664
  }
3661
3665
  ) }) }) });
3662
3666
  }
3667
+ var FAMILY_PRESENTATION = {
3668
+ microsoft: {
3669
+ name: "Microsoft",
3670
+ description: "One Microsoft connection covers both Outlook (email) and OneDrive (files) \u2014 import documents from either into a workspace.",
3671
+ descriptionWithSharePoint: "One Microsoft connection covers Outlook (email), OneDrive and SharePoint (files) \u2014 import documents from any of them into a workspace."
3672
+ },
3673
+ gmail: {
3674
+ name: "Google",
3675
+ description: "One Google connection covers both Gmail (email) and Google Drive (files) \u2014 import documents from either into a workspace."
3676
+ }
3677
+ };
3678
+ var EMAIL_AND_DRIVE_SUBTITLE = [
3679
+ "Connect Microsoft or Google once \u2014 a single connection lets you import documents",
3680
+ "from both their email (Outlook / Gmail) and their cloud storage (OneDrive / Google Drive)",
3681
+ "into a workspace."
3682
+ ].join(" ");
3683
+ function toConnectionCardView(catalog, userConnector, options) {
3684
+ const isConnected = !!userConnector;
3685
+ const presentation = FAMILY_PRESENTATION[catalog.vendor_key];
3686
+ const description = (options.sharePointVisible ? presentation?.descriptionWithSharePoint : void 0) ?? presentation?.description ?? catalog.description;
3687
+ return {
3688
+ id: catalog.vendor_key,
3689
+ title: presentation?.name ?? catalog.display_name,
3690
+ description: description ?? void 0,
3691
+ iconUrl: catalog.icon_url,
3692
+ iconAlt: catalog.display_name,
3693
+ status: isConnected ? "connected" : catalog.requires_per_user_auth ? "available" : "organisation",
3694
+ justConnected: options.justConnected,
3695
+ identity: userConnector?.vendor_user_identity,
3696
+ warning: isConnected && userConnector?.token_scheme === "env" ? "Reconnect to upgrade security \u2014 your access token isn't yet bound to your session." : void 0,
3697
+ note: !catalog.requires_per_user_auth && !isConnected ? "Enabled for your organisation \u2014 no personal login required" : void 0,
3698
+ // Mailbox connectors show a read-only notice when native mail writes are disabled; sync is
3699
+ // configured per-workspace from the Add-files flow, not on this tab.
3700
+ showReadOnlyNotice: isMailboxSyncVendor(catalog.vendor_key) && !options.mailWriteEnabled,
3701
+ isDisconnecting: options.isDisconnecting
3702
+ };
3703
+ }
3704
+ function ConnectedAppsSettings({
3705
+ justConnectedVendor = null,
3706
+ onJustConnectedSeen
3707
+ }) {
3708
+ const arbi = useArbi();
3709
+ const { notify, navigate } = useBlocksEnvironment();
3710
+ const { data: mailPolicy } = useMailPolicy();
3711
+ const isVendorVisible = useConnectorVendorVisibility();
3712
+ useEffect(() => {
3713
+ if (!justConnectedVendor || !onJustConnectedSeen) return;
3714
+ const timer = setTimeout(onJustConnectedSeen, 4e3);
3715
+ return () => clearTimeout(timer);
3716
+ }, [justConnectedVendor, onJustConnectedSeen]);
3717
+ useEffect(() => {
3718
+ if (!justConnectedVendor) return;
3719
+ void arbi.connectors.bridgeTokens({ vendor: justConnectedVendor });
3720
+ }, [justConnectedVendor, arbi]);
3721
+ const {
3722
+ data: catalog = [],
3723
+ isLoading: catalogLoading,
3724
+ error: catalogError
3725
+ } = useConnectorCatalog();
3726
+ const { data: myConnectors = [], isLoading: myLoading } = useMyConnectors();
3727
+ const disconnect = useDisconnectConnector();
3728
+ const {
3729
+ data: slackConnection,
3730
+ isLoading: slackLoading,
3731
+ isPending: slackStatusPendingQuery,
3732
+ isFetching: slackStatusFetching,
3733
+ isError: slackStatusError,
3734
+ refetch: refetchSlackConnection
3735
+ } = useSlackConnection();
3736
+ const slackStatusPending = slackStatusPendingQuery || slackStatusFetching || justConnectedVendor === "slack" && !slackConnection?.connected && !slackStatusError;
3737
+ const disconnectSlack = useDisconnectSlack();
3738
+ const { data: agents = [] } = useAgents();
3739
+ const [slackAgentId, setSlackAgentId] = useState("");
3740
+ const { data: slackAgentWorkspaces = [], isLoading: slackAgentWorkspacesLoading } = useAgentWorkspaces(slackAgentId, { enabled: Boolean(slackAgentId) });
3741
+ const [slackAuthorizing, setSlackAuthorizing] = useState(false);
3742
+ const [slackAgentEditorOpen, setSlackAgentEditorOpen] = useState(false);
3743
+ const isLoading = catalogLoading || myLoading;
3744
+ const connectedByVendor = Object.fromEntries(myConnectors.map((uc) => [uc.vendor_key, uc]));
3745
+ const handleConnect = async (vendorKey) => {
3746
+ navigate(await arbi.connectors.authorize(vendorKey));
3747
+ };
3748
+ const handleSlackConnect = async () => {
3749
+ if (!slackAgentId) return;
3750
+ setSlackAuthorizing(true);
3751
+ try {
3752
+ navigate(await arbi.connectors.slack.authorize(slackAgentId));
3753
+ } catch (error) {
3754
+ notify(
3755
+ error instanceof Error ? error.message : "Could not start Slack authorization",
3756
+ "error"
3757
+ );
3758
+ setSlackAuthorizing(false);
3759
+ }
3760
+ };
3761
+ const handleDisconnect = (vendorKey) => {
3762
+ disconnect.mutate({ vendorKey });
3763
+ if (vendorKey === "microsoft") {
3764
+ for (const spVendor of SHAREPOINT_VENDORS) {
3765
+ if (connectedByVendor[spVendor]) {
3766
+ disconnect.mutate({ vendorKey: spVendor });
3767
+ }
3768
+ }
3769
+ }
3770
+ };
3771
+ if (isLoading) {
3772
+ return /* @__PURE__ */ jsx(ConnectionsLoading, { message: "Loading connected apps\u2026" });
3773
+ }
3774
+ if (catalogError) {
3775
+ return /* @__PURE__ */ jsx(ConnectionsError, { message: "Failed to load connector catalog. Please refresh and try again." });
3776
+ }
3777
+ const visibleCatalog = catalog.filter((c) => isVendorVisible(c.vendor_key));
3778
+ const sharePointVisible = isVendorVisible("microsoft_sharepoint");
3779
+ const emailCatalog = visibleCatalog.filter((c) => isMailboxSyncVendor(c.vendor_key));
3780
+ const mcpCatalog = visibleCatalog.filter(
3781
+ (c) => !isMailboxSyncVendor(c.vendor_key) && !isSharePointVendor(c.vendor_key)
3782
+ );
3783
+ const renderCard = (entry) => /* @__PURE__ */ jsx(
3784
+ ConnectionCard,
3785
+ {
3786
+ connection: toConnectionCardView(entry, connectedByVendor[entry.vendor_key], {
3787
+ isDisconnecting: disconnect.isPending && disconnect.variables?.vendorKey === entry.vendor_key,
3788
+ sharePointVisible,
3789
+ mailWriteEnabled: mailPolicy?.enabled_providers.includes(entry.vendor_key) ?? false,
3790
+ // A `?connected=microsoft_sharepoint` return has no card of its own — alias
3791
+ // it to the Microsoft family card so its "Just connected" badge still lights.
3792
+ justConnected: justConnectedVendor === entry.vendor_key || entry.vendor_key === "microsoft" && isSharePointVendor(justConnectedVendor ?? "")
3793
+ }),
3794
+ onConnect: handleConnect,
3795
+ onDisconnect: handleDisconnect
3796
+ },
3797
+ entry.vendor_key
3798
+ );
3799
+ const renderGroup = (title, subtitle, icon2, entries) => {
3800
+ if (entries.length === 0) return null;
3801
+ return /* @__PURE__ */ jsx(SettingsSection, { icon: icon2, title, children: /* @__PURE__ */ jsxs(SettingsCard, { className: "space-y-3", children: [
3802
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: subtitle }),
3803
+ /* @__PURE__ */ jsx("div", { className: "space-y-2", children: entries.map(renderCard) })
3804
+ ] }) });
3805
+ };
3806
+ return /* @__PURE__ */ jsxs(SettingsPanel, { className: "max-w-2xl", children: [
3807
+ /* @__PURE__ */ jsxs("section", { className: "rounded-xl border border-border bg-card px-5 py-4", children: [
3808
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4", children: [
3809
+ /* @__PURE__ */ jsx("div", { className: "mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ jsx(Mail, { className: "h-5 w-5" }) }),
3810
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
3811
+ /* @__PURE__ */ jsx("div", { className: "font-heading text-sm font-semibold text-foreground", children: "Slack" }),
3812
+ /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-sm text-muted-foreground", children: "Connect Slack to an existing ARBI agent. The agent uses its configured default workspace." }),
3813
+ slackConnection?.connected && /* @__PURE__ */ jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [
3814
+ "Connected to ",
3815
+ slackConnection.agent_name
3816
+ ] })
3817
+ ] }),
3818
+ slackConnection?.connected ? /* @__PURE__ */ jsxs(
3819
+ Button,
3820
+ {
3821
+ variant: "outline",
3822
+ size: "sm",
3823
+ onClick: () => disconnectSlack.mutate(),
3824
+ disabled: disconnectSlack.isPending,
3825
+ className: "text-destructive hover:bg-destructive/10 hover:text-destructive",
3826
+ children: [
3827
+ disconnectSlack.isPending ? /* @__PURE__ */ jsx(Loader2, { className: "mr-1.5 h-3.5 w-3.5 animate-spin" }) : null,
3828
+ "Disconnect"
3829
+ ]
3830
+ }
3831
+ ) : slackStatusPending ? /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "gap-1.5 text-muted-foreground", children: [
3832
+ /* @__PURE__ */ jsx(Loader2, { className: "h-3 w-3 animate-spin" }),
3833
+ "Pending"
3834
+ ] }) : slackStatusError ? /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => void refetchSlackConnection(), children: "Retry status check" }) : slackConnection?.configured ? /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-muted-foreground", children: "Not connected" }) : /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-muted-foreground", children: "Unavailable" })
3835
+ ] }),
3836
+ !slackConnection?.connected && !slackStatusPending && /* @__PURE__ */ jsxs(
3837
+ "div",
3838
+ {
3839
+ className: "mt-4 flex flex-wrap items-end gap-3 border-t border-border/60 pt-4",
3840
+ "data-testid": "slack-agent-setup",
3841
+ children: [
3842
+ /* @__PURE__ */ jsxs("label", { className: "min-w-56 flex-1 space-y-1.5", children: [
3843
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "ARBI agent" }),
3844
+ /* @__PURE__ */ jsxs(
3845
+ "select",
3846
+ {
3847
+ className: "h-10 w-full rounded-md border border-input bg-background px-3 text-sm pointer-coarse:h-11",
3848
+ value: slackAgentId,
3849
+ onChange: (event) => setSlackAgentId(event.target.value),
3850
+ children: [
3851
+ /* @__PURE__ */ jsx("option", { value: "", children: "Choose an agent" }),
3852
+ agents.map((agent) => /* @__PURE__ */ jsx("option", { value: agent.external_id, children: agent.given_name || agent.email }, agent.external_id))
3853
+ ]
3854
+ }
3855
+ )
3856
+ ] }),
3857
+ /* @__PURE__ */ jsx(
3858
+ Button,
3859
+ {
3860
+ variant: "outline",
3861
+ size: "sm",
3862
+ onClick: () => setSlackAgentEditorOpen(true),
3863
+ disabled: slackLoading || slackAuthorizing,
3864
+ children: "Create Slack agent"
3865
+ }
3866
+ ),
3867
+ /* @__PURE__ */ jsxs(
3868
+ Button,
3869
+ {
3870
+ size: "sm",
3871
+ onClick: () => void handleSlackConnect(),
3872
+ disabled: !slackConnection?.configured || !slackAgentId || slackLoading || slackAuthorizing,
3873
+ children: [
3874
+ slackAuthorizing ? /* @__PURE__ */ jsx(Loader2, { className: "mr-1.5 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx(ExternalLink, { className: "mr-1.5 h-3.5 w-3.5" }),
3875
+ slackAuthorizing ? "Starting Slack authorization\u2026" : "Connect to Slack"
3876
+ ]
3877
+ }
3878
+ ),
3879
+ slackAgentId && /* @__PURE__ */ jsxs(
3880
+ "div",
3881
+ {
3882
+ className: "w-full rounded-md bg-muted/40 px-3 py-2 text-xs",
3883
+ "data-testid": "slack-agent-workspaces",
3884
+ children: [
3885
+ /* @__PURE__ */ jsx("p", { className: "font-medium text-foreground", children: "Agent workspace access" }),
3886
+ slackAgentWorkspacesLoading ? /* @__PURE__ */ jsx("p", { className: "mt-1 text-muted-foreground", children: "Loading access\u2026" }) : slackAgentWorkspaces.length ? /* @__PURE__ */ jsx("ul", { className: "mt-1 space-y-1", children: slackAgentWorkspaces.map((workspace) => /* @__PURE__ */ jsxs("li", { className: "flex flex-wrap gap-x-2", children: [
3887
+ /* @__PURE__ */ jsx("span", { children: workspace.name }),
3888
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: workspace.role }),
3889
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: workspace.permanent ? "Standing access" : "Temporary access" }),
3890
+ workspace.is_default && /* @__PURE__ */ jsx("span", { className: "font-medium", children: "Slack default" })
3891
+ ] }, workspace.workspace_ext_id)) }) : /* @__PURE__ */ jsx("p", { className: "mt-1 text-muted-foreground", children: "No workspace access. Share a workspace with this agent in that workspace\u2019s Members settings." })
3892
+ ]
3893
+ }
3894
+ ),
3895
+ slackStatusError ? /* @__PURE__ */ jsx("p", { className: "w-full text-xs text-muted-foreground", children: "ARBI could not check Slack availability. Retry the status check above before connecting." }) : !slackConnection?.configured ? /* @__PURE__ */ jsx("p", { className: "w-full text-xs text-muted-foreground", children: "Slack is unavailable because this ARBI deployment has not configured its Slack app credentials. You can still create an agent and set its workspace access; an administrator must configure Slack before connecting." }) : /* @__PURE__ */ jsx("p", { className: "w-full text-xs text-muted-foreground", children: "Slack DMs wake this agent and receive replies there. It uses the marked default workspace; standing access is required." })
3896
+ ]
3897
+ }
3898
+ ),
3899
+ /* @__PURE__ */ jsx(
3900
+ ConnectedAgentCreator,
3901
+ {
3902
+ open: slackAgentEditorOpen,
3903
+ onOpenChange: setSlackAgentEditorOpen,
3904
+ initialName: "SlackAssistant",
3905
+ onSaved: (agentExtId) => {
3906
+ setSlackAgentId(agentExtId);
3907
+ setSlackAgentEditorOpen(false);
3908
+ }
3909
+ }
3910
+ )
3911
+ ] }),
3912
+ catalog.length === 0 ? /* @__PURE__ */ jsx(SettingsCard, { children: /* @__PURE__ */ jsx(ConnectionsEmpty, { message: "No connectors available yet." }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3913
+ renderGroup("Email & Drive", EMAIL_AND_DRIVE_SUBTITLE, /* @__PURE__ */ jsx(Mail, {}), emailCatalog),
3914
+ renderGroup(
3915
+ "Apps & Integrations (MCP)",
3916
+ "Connect your legal tools so the ARBI agent can search them live during a conversation.",
3917
+ /* @__PURE__ */ jsx(PlugZap, {}),
3918
+ mcpCatalog
3919
+ )
3920
+ ] }),
3921
+ /* @__PURE__ */ jsx("p", { className: "px-1 text-xs text-muted-foreground", children: "ARBI requests only the minimum permissions needed. Your credentials are encrypted and never shared. You can disconnect at any time." })
3922
+ ] });
3923
+ }
3663
3924
  var SETTINGS_SECTION_IDS = {
3664
3925
  account: "account",
3665
3926
  mail: "mail",
3666
3927
  privacy: "privacy",
3667
- chat: "chat"
3928
+ chat: "chat",
3929
+ connectedApps: "connected-apps"
3668
3930
  };
3669
3931
  function accountSettingsSection(props) {
3670
3932
  return {
@@ -3698,6 +3960,14 @@ function chatSettingsSection() {
3698
3960
  render: () => /* @__PURE__ */ jsx(ConnectedPremiumModels, {})
3699
3961
  };
3700
3962
  }
3963
+ function connectedAppsSettingsSection(props) {
3964
+ return {
3965
+ id: SETTINGS_SECTION_IDS.connectedApps,
3966
+ label: "Connected Apps",
3967
+ icon: /* @__PURE__ */ jsx(PlugZap, { className: "w-6 h-6" }),
3968
+ render: () => /* @__PURE__ */ jsx(ConnectedAppsSettings, { ...props })
3969
+ };
3970
+ }
3701
3971
  var DEFAULT_SETTINGS_SECTIONS = [
3702
3972
  accountSettingsSection(),
3703
3973
  privacySettingsSection(),
@@ -4078,6 +4348,633 @@ function ConnectedWorkspaceSettings({
4078
4348
  })
4079
4349
  ] });
4080
4350
  }
4351
+
4352
+ // src/connection/connectors/sync-labels.ts
4353
+ var BACKFILL_OPTIONS = [
4354
+ { value: "1", label: "Last 1 day" },
4355
+ { value: "7", label: "Last 7 days" },
4356
+ { value: "30", label: "Last 30 days" },
4357
+ { value: "90", label: "Last 90 days" },
4358
+ { value: "365", label: "Last year" }
4359
+ ];
4360
+ function formatLastSync(iso) {
4361
+ const date = new Date(iso);
4362
+ if (Number.isNaN(date.getTime())) return iso;
4363
+ const diffMs = Date.now() - date.getTime();
4364
+ const diffMin = Math.round(diffMs / 6e4);
4365
+ if (diffMin < 1) return "just now";
4366
+ if (diffMin < 60) return `${diffMin}m ago`;
4367
+ const diffHr = Math.round(diffMin / 60);
4368
+ if (diffHr < 24) return `${diffHr}h ago`;
4369
+ const diffDay = Math.round(diffHr / 24);
4370
+ if (diffDay < 30) return `${diffDay}d ago`;
4371
+ return date.toLocaleDateString();
4372
+ }
4373
+ function windowLabel(days) {
4374
+ return BACKFILL_OPTIONS.find((o) => o.value === String(days))?.label ?? `Last ${days} days`;
4375
+ }
4376
+ function ConnectedMailboxSyncDialog({
4377
+ catalog,
4378
+ userConnector,
4379
+ open,
4380
+ onOpenChange,
4381
+ lockedWorkspaceExtId,
4382
+ onEnabled
4383
+ }) {
4384
+ const enableSync = useEnableMailboxSync();
4385
+ const disconnect = useDisconnectConnector();
4386
+ const arbi = useArbi();
4387
+ const { notify, navigate } = useBlocksEnvironment();
4388
+ const reconnect = async () => {
4389
+ try {
4390
+ await disconnect.mutateAsync({ vendorKey: catalog.vendor_key });
4391
+ } catch {
4392
+ }
4393
+ try {
4394
+ navigate(await arbi.connectors.authorize(catalog.vendor_key, connectorReturnTo()));
4395
+ } catch {
4396
+ notify("Could not start reconnection. Please try again.", "error");
4397
+ }
4398
+ };
4399
+ const { data: workspaces = [] } = useWorkspaces({ enabled: open && !lockedWorkspaceExtId });
4400
+ const memberWorkspaces = workspaces.filter((w) => w.is_member);
4401
+ const [tokensBridged, setTokensBridged] = useState(false);
4402
+ useEffect(() => {
4403
+ if (!open) {
4404
+ setTokensBridged(false);
4405
+ return;
4406
+ }
4407
+ if (!userConnector?.is_connected) {
4408
+ setTokensBridged(true);
4409
+ return;
4410
+ }
4411
+ let cancelled = false;
4412
+ void arbi.connectors.bridgeTokens({ vendor: catalog.vendor_key }).finally(() => {
4413
+ if (!cancelled) setTokensBridged(true);
4414
+ });
4415
+ return () => {
4416
+ cancelled = true;
4417
+ };
4418
+ }, [open, arbi, userConnector?.is_connected, catalog.vendor_key]);
4419
+ const [workspaceExtId, setWorkspaceExtId] = useState("");
4420
+ const [backfill, setBackfill] = useState("1");
4421
+ const [backfillSince, setBackfillSince] = useState("");
4422
+ const [selectedFolders, setSelectedFolders] = useState([]);
4423
+ const [skipDuplicates, setSkipDuplicates] = useState(true);
4424
+ const [autoRename, setAutoRename] = useState(false);
4425
+ const [shared, setShared] = useState(false);
4426
+ const [autoSync, setAutoSync] = useState(false);
4427
+ useEffect(() => {
4428
+ if (!open) return;
4429
+ const target = lockedWorkspaceExtId ?? userConnector?.sync_workspace_ext_id ?? "";
4430
+ const workspaceSync = lockedWorkspaceExtId ? userConnector?.syncs?.find((s) => s.workspace_ext_id === lockedWorkspaceExtId) : void 0;
4431
+ setWorkspaceExtId(target);
4432
+ const since = workspaceSync?.backfill_since ?? userConnector?.backfill_since ?? null;
4433
+ if (since) {
4434
+ setBackfill("custom");
4435
+ setBackfillSince(since.slice(0, 10));
4436
+ } else {
4437
+ setBackfill(String(workspaceSync?.backfill_window ?? userConnector?.backfill_window ?? 1));
4438
+ setBackfillSince("");
4439
+ }
4440
+ setSelectedFolders(workspaceSync?.folders ?? userConnector?.sync_folders ?? []);
4441
+ setSkipDuplicates(workspaceSync?.skip_duplicates ?? userConnector?.skip_duplicates ?? true);
4442
+ setAutoRename(workspaceSync?.auto_rename ?? userConnector?.auto_rename ?? false);
4443
+ setShared(workspaceSync?.shared ?? userConnector?.shared ?? false);
4444
+ setAutoSync(workspaceSync?.auto_sync ?? userConnector?.auto_sync ?? false);
4445
+ }, [open, lockedWorkspaceExtId, userConnector]);
4446
+ const {
4447
+ data: folders = [],
4448
+ isLoading: foldersQueryLoading,
4449
+ error: foldersError
4450
+ } = useMailboxFolders(catalog.vendor_key, open && tokensBridged);
4451
+ const foldersLoading = !tokensBridged || foldersQueryLoading;
4452
+ const folderTree = buildMailFolderTree(folders);
4453
+ const [expandAllNonce, setExpandAllNonce] = useState(0);
4454
+ const [collapseAllNonce, setCollapseAllNonce] = useState(0);
4455
+ const selectAllIds = folderTree.flatMap(
4456
+ (n) => n.folder ? [n.folder.id] : n.children.flatMap((c) => c.folder ? [c.folder.id] : [])
4457
+ );
4458
+ const allSelected = selectAllIds.length > 0 && selectAllIds.every((id) => selectedFolders.includes(id));
4459
+ const toggleAllFolders = () => setSelectedFolders(allSelected ? [] : selectAllIds);
4460
+ const isCustomBackfill = backfill === "custom";
4461
+ const customDateMissing = isCustomBackfill && !backfillSince;
4462
+ const handleEnableSubmit = () => {
4463
+ if (!workspaceExtId || selectedFolders.length === 0 || customDateMissing) return;
4464
+ enableSync.mutate(
4465
+ {
4466
+ vendorKey: catalog.vendor_key,
4467
+ workspaceExtId,
4468
+ // A fixed date overrides the rolling window server-side; keep a sane
4469
+ // window value for backward compatibility.
4470
+ backfillWindow: isCustomBackfill ? 90 : Number(backfill),
4471
+ backfillSince: isCustomBackfill ? (/* @__PURE__ */ new Date(`${backfillSince}T00:00:00Z`)).toISOString() : null,
4472
+ folders: selectedFolders,
4473
+ skipDuplicates,
4474
+ autoRename,
4475
+ shared,
4476
+ autoSync
4477
+ },
4478
+ {
4479
+ onSuccess: () => {
4480
+ notify("Email settings saved", "success");
4481
+ onOpenChange(false);
4482
+ onEnabled?.(workspaceExtId);
4483
+ },
4484
+ onError: (err) => {
4485
+ let msg = "Could not enable email sync. Please try again.";
4486
+ const status = connectorErrorStatus(err);
4487
+ if (status !== void 0) {
4488
+ if (status === 403) {
4489
+ msg = "You are not a member of the selected workspace.";
4490
+ } else if (status === 404) {
4491
+ msg = "This connector is not available for email sync.";
4492
+ }
4493
+ }
4494
+ notify(msg, "error");
4495
+ }
4496
+ }
4497
+ );
4498
+ };
4499
+ const mailboxName = catalog.vendor_key === "gmail" ? "Gmail" : catalog.vendor_key === "microsoft" ? "Outlook" : catalog.display_name;
4500
+ return /* @__PURE__ */ jsxs(
4501
+ ModalScaffold,
4502
+ {
4503
+ open,
4504
+ onOpenChange,
4505
+ title: `${mailboxName} Import Settings`,
4506
+ description: `Import emails from ${catalog.display_name} into a workspace so the ARBI agent can search them. This is read-only \u2014 ARBI imports a copy and never modifies or deletes anything in your mailbox.`,
4507
+ showDescription: true,
4508
+ className: "w-[92vw] sm:max-w-lg",
4509
+ children: [
4510
+ /* @__PURE__ */ jsxs(SyncDialogBody, { children: [
4511
+ !lockedWorkspaceExtId && /* @__PURE__ */ jsx(SyncField, { label: "Target workspace", htmlFor: "sync-workspace", children: /* @__PURE__ */ jsx(
4512
+ SyncSelect,
4513
+ {
4514
+ id: "sync-workspace",
4515
+ value: workspaceExtId,
4516
+ onValueChange: setWorkspaceExtId,
4517
+ placeholder: "Select a workspace",
4518
+ options: memberWorkspaces.map((w) => ({ value: w.external_id, label: w.name }))
4519
+ }
4520
+ ) }),
4521
+ /* @__PURE__ */ jsxs(SyncField, { label: "Backfill window", htmlFor: "sync-backfill", children: [
4522
+ /* @__PURE__ */ jsx(
4523
+ SyncSelect,
4524
+ {
4525
+ id: "sync-backfill",
4526
+ value: backfill,
4527
+ onValueChange: setBackfill,
4528
+ options: [...BACKFILL_OPTIONS, { value: "custom", label: "Custom date\u2026" }]
4529
+ }
4530
+ ),
4531
+ isCustomBackfill && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
4532
+ /* @__PURE__ */ jsx(
4533
+ Input,
4534
+ {
4535
+ type: "date",
4536
+ value: backfillSince,
4537
+ max: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
4538
+ onChange: (e) => setBackfillSince(e.target.value),
4539
+ "data-testid": "backfill-since-date",
4540
+ "aria-label": "Import emails since date"
4541
+ }
4542
+ ),
4543
+ /* @__PURE__ */ jsx(SyncSmallNote, { children: "Emails are always imported from this date onward \u2014 the start point never moves." })
4544
+ ] })
4545
+ ] }),
4546
+ /* @__PURE__ */ jsx(
4547
+ SyncField,
4548
+ {
4549
+ label: `Folders to import${selectedFolders.length > 0 ? ` (${selectedFolders.length})` : ""}`,
4550
+ hint: "Select at least one folder to import.",
4551
+ actions: folders.length > 0 && /* @__PURE__ */ jsxs(SyncLinkRow, { children: [
4552
+ /* @__PURE__ */ jsx(
4553
+ SyncLinkButton,
4554
+ {
4555
+ onClick: () => setExpandAllNonce((n) => n + 1),
4556
+ testId: "mail-folders-expand-all",
4557
+ children: "Expand all"
4558
+ }
4559
+ ),
4560
+ /* @__PURE__ */ jsx(
4561
+ SyncLinkButton,
4562
+ {
4563
+ onClick: () => setCollapseAllNonce((n) => n + 1),
4564
+ testId: "mail-folders-collapse-all",
4565
+ children: "Collapse all"
4566
+ }
4567
+ ),
4568
+ /* @__PURE__ */ jsx(SyncLinkButton, { onClick: toggleAllFolders, children: allSelected ? "Clear all" : "Select all" })
4569
+ ] }),
4570
+ children: foldersLoading ? /* @__PURE__ */ jsx(SyncLoading, { children: "Loading folders\u2026" }) : foldersError ? (
4571
+ // A failed fetch is not an empty mailbox: it hides auth/scope errors (e.g. a Gmail
4572
+ // account needing reconnect).
4573
+ /* @__PURE__ */ jsx(
4574
+ SyncReconnectNotice,
4575
+ {
4576
+ message: `Couldn\u2019t load folders from ${catalog.display_name}. Reconnect the account and try again.`,
4577
+ onReconnect: () => void reconnect(),
4578
+ isPending: disconnect.isPending,
4579
+ testId: "folders-reconnect"
4580
+ }
4581
+ )
4582
+ ) : folders.length === 0 ? /* @__PURE__ */ jsx(SyncNote, { children: "No folders found." }) : /* @__PURE__ */ jsx(SyncTreeFrame, { children: /* @__PURE__ */ jsx(
4583
+ MailFolderTree,
4584
+ {
4585
+ nodes: folderTree,
4586
+ selected: selectedFolders,
4587
+ onChange: setSelectedFolders,
4588
+ expandAllNonce,
4589
+ collapseAllNonce
4590
+ }
4591
+ ) })
4592
+ }
4593
+ ),
4594
+ /* @__PURE__ */ jsxs(SyncOptions, { children: [
4595
+ /* @__PURE__ */ jsx(
4596
+ SyncOptionToggle,
4597
+ {
4598
+ checked: skipDuplicates,
4599
+ onCheckedChange: setSkipDuplicates,
4600
+ title: "Skip duplicates",
4601
+ description: "Skip files identical to ones already in the workspace.",
4602
+ testId: "mailbox-sync-skip-duplicates"
4603
+ }
4604
+ ),
4605
+ /* @__PURE__ */ jsx(
4606
+ SyncOptionToggle,
4607
+ {
4608
+ checked: autoRename,
4609
+ onCheckedChange: setAutoRename,
4610
+ title: "Auto-rename",
4611
+ description: "Generate a descriptive title with AI instead of using the sender and subject.",
4612
+ testId: "mailbox-sync-auto-rename"
4613
+ }
4614
+ ),
4615
+ /* @__PURE__ */ jsx(
4616
+ SyncOptionToggle,
4617
+ {
4618
+ checked: shared,
4619
+ onCheckedChange: setShared,
4620
+ title: "Share with the workspace",
4621
+ description: shared ? "Imported documents are visible to everyone in the workspace." : "Imported documents stay private to you.",
4622
+ testId: "mailbox-sync-shared"
4623
+ }
4624
+ ),
4625
+ /* @__PURE__ */ jsx(
4626
+ SyncOptionToggle,
4627
+ {
4628
+ checked: autoSync,
4629
+ onCheckedChange: setAutoSync,
4630
+ title: "Sync automatically",
4631
+ description: "Check for new email when you sign in, instead of only when you click Sync now. Requires you to be signed in \u2014 nothing syncs while you are away.",
4632
+ testId: "mailbox-sync-auto-sync"
4633
+ }
4634
+ )
4635
+ ] })
4636
+ ] }),
4637
+ /* @__PURE__ */ jsx(
4638
+ SyncDialogFooter,
4639
+ {
4640
+ onCancel: () => onOpenChange(false),
4641
+ onSave: handleEnableSubmit,
4642
+ saveDisabled: !workspaceExtId || selectedFolders.length === 0 || customDateMissing,
4643
+ isSaving: enableSync.isPending
4644
+ }
4645
+ )
4646
+ ]
4647
+ }
4648
+ );
4649
+ }
4650
+ var DRIVE_PRODUCT_NAMES = {
4651
+ gmail: "Google Drive",
4652
+ microsoft_sharepoint: "SharePoint",
4653
+ box: "Box",
4654
+ dropbox: "Dropbox",
4655
+ onenote: "OneNote",
4656
+ clio: "Clio"
4657
+ };
4658
+ function DriveFolderNode({
4659
+ vendorKey,
4660
+ folder,
4661
+ depth,
4662
+ selected,
4663
+ onToggle,
4664
+ enabled,
4665
+ ancestorSelected,
4666
+ expandAllNonce,
4667
+ collapseAllNonce
4668
+ }) {
4669
+ const isSelected = ancestorSelected || selected.includes(folder.id);
4670
+ const [expanded, setExpanded] = useState(() => selected.includes(folder.id) || expandAllNonce > 0);
4671
+ const appliedNonce = useRef(expandAllNonce);
4672
+ useEffect(() => {
4673
+ if (expandAllNonce > appliedNonce.current) {
4674
+ appliedNonce.current = expandAllNonce;
4675
+ setExpanded(true);
4676
+ }
4677
+ }, [expandAllNonce]);
4678
+ const appliedCollapseNonce = useRef(collapseAllNonce);
4679
+ useEffect(() => {
4680
+ if (collapseAllNonce > appliedCollapseNonce.current) {
4681
+ appliedCollapseNonce.current = collapseAllNonce;
4682
+ setExpanded(false);
4683
+ }
4684
+ }, [collapseAllNonce]);
4685
+ const { data: children = [], isLoading } = useDriveFolderChildren(
4686
+ vendorKey,
4687
+ folder.id,
4688
+ enabled && expanded
4689
+ );
4690
+ const isSelectable = folder.selectable !== false;
4691
+ const { data: docCount, isLoading: countLoading } = useDriveFolderDocCount(
4692
+ vendorKey,
4693
+ folder.id,
4694
+ enabled && isSelectable
4695
+ // ← disabled for site: nodes
4696
+ );
4697
+ const mightHaveChildren = docCount == null || docCount > 0;
4698
+ const orderedChildren = [...children].sort((a, b) => a.name.localeCompare(b.name));
4699
+ return /* @__PURE__ */ jsx(
4700
+ SyncFolderRow,
4701
+ {
4702
+ id: folder.id,
4703
+ name: folder.name,
4704
+ depth,
4705
+ hasChildren: mightHaveChildren,
4706
+ isExpanded: expanded,
4707
+ onToggleExpanded: () => setExpanded((e) => !e),
4708
+ isSelectable,
4709
+ checked: isSelected,
4710
+ disabled: ancestorSelected,
4711
+ onCheckedChange: () => onToggle(folder.id),
4712
+ count: typeof docCount === "number" ? docCount : void 0,
4713
+ isCountLoading: isSelectable && countLoading,
4714
+ children: isLoading ? /* @__PURE__ */ jsx(SyncFolderStatus, { depth, kind: "loading" }) : orderedChildren.length === 0 ? /* @__PURE__ */ jsx(SyncFolderStatus, { depth, kind: "empty" }) : orderedChildren.map((child) => /* @__PURE__ */ jsx(
4715
+ DriveFolderNode,
4716
+ {
4717
+ vendorKey,
4718
+ folder: child,
4719
+ depth: depth + 1,
4720
+ selected,
4721
+ onToggle,
4722
+ enabled,
4723
+ ancestorSelected: isSelected,
4724
+ expandAllNonce,
4725
+ collapseAllNonce
4726
+ },
4727
+ child.id
4728
+ ))
4729
+ }
4730
+ );
4731
+ }
4732
+ function ConnectedDriveSyncDialog({
4733
+ catalog,
4734
+ userConnector,
4735
+ open,
4736
+ onOpenChange,
4737
+ lockedWorkspaceExtId,
4738
+ onEnabled
4739
+ }) {
4740
+ const enableSync = useEnableDriveSync();
4741
+ const disconnect = useDisconnectConnector();
4742
+ const arbi = useArbi();
4743
+ const { notify, navigate } = useBlocksEnvironment();
4744
+ const reconnect = async () => {
4745
+ try {
4746
+ await disconnect.mutateAsync({ vendorKey: catalog.vendor_key });
4747
+ } catch {
4748
+ }
4749
+ try {
4750
+ navigate(await arbi.connectors.authorize(catalog.vendor_key, connectorReturnTo()));
4751
+ } catch {
4752
+ notify("Could not start reconnection. Please try again.", "error");
4753
+ }
4754
+ };
4755
+ const { data: workspaces = [] } = useWorkspaces({ enabled: open && !lockedWorkspaceExtId });
4756
+ const memberWorkspaces = workspaces.filter((w) => w.is_member);
4757
+ const [tokensBridged, setTokensBridged] = useState(false);
4758
+ useEffect(() => {
4759
+ if (!open) {
4760
+ setTokensBridged(false);
4761
+ return;
4762
+ }
4763
+ if (!userConnector?.is_connected) {
4764
+ setTokensBridged(true);
4765
+ return;
4766
+ }
4767
+ let cancelled = false;
4768
+ void arbi.connectors.bridgeTokens({ vendor: catalog.vendor_key }).finally(() => {
4769
+ if (!cancelled) setTokensBridged(true);
4770
+ });
4771
+ return () => {
4772
+ cancelled = true;
4773
+ };
4774
+ }, [open, arbi, userConnector?.is_connected, catalog.vendor_key]);
4775
+ const [workspaceExtId, setWorkspaceExtId] = useState("");
4776
+ const [selectedFolders, setSelectedFolders] = useState([]);
4777
+ const [skipDuplicates, setSkipDuplicates] = useState(false);
4778
+ const [autoRename, setAutoRename] = useState(false);
4779
+ const [shared, setShared] = useState(false);
4780
+ const [autoSync, setAutoSync] = useState(false);
4781
+ useEffect(() => {
4782
+ if (!open) return;
4783
+ const target = lockedWorkspaceExtId ?? userConnector?.drive_sync_workspace_ext_id ?? "";
4784
+ setWorkspaceExtId(target);
4785
+ setSelectedFolders(userConnector?.drive_sync_folders ?? []);
4786
+ setSkipDuplicates(userConnector?.drive_skip_duplicates ?? false);
4787
+ setAutoRename(userConnector?.drive_auto_rename ?? false);
4788
+ setShared(userConnector?.drive_shared ?? false);
4789
+ setAutoSync(userConnector?.drive_auto_sync ?? false);
4790
+ setExpandAllNonce(0);
4791
+ setCollapseAllNonce(0);
4792
+ }, [open, lockedWorkspaceExtId, userConnector]);
4793
+ const [expandAllNonce, setExpandAllNonce] = useState(0);
4794
+ const [collapseAllNonce, setCollapseAllNonce] = useState(0);
4795
+ const treeEnabled = open && tokensBridged;
4796
+ const {
4797
+ data: folders = [],
4798
+ isLoading: foldersQueryLoading,
4799
+ error: foldersError
4800
+ } = useDriveFolderChildren(catalog.vendor_key, "root", treeEnabled);
4801
+ const foldersLoading = !tokensBridged || foldersQueryLoading;
4802
+ const needsReconnect = connectorErrorStatus(foldersError) === 409;
4803
+ const toggleFolder = (id) => setSelectedFolders((prev) => prev.includes(id) ? prev.filter((f) => f !== id) : [...prev, id]);
4804
+ const orderedFolders = [...folders].sort(
4805
+ (a, b) => a.name.localeCompare(b.name)
4806
+ );
4807
+ const handleEnableSubmit = () => {
4808
+ if (!workspaceExtId || selectedFolders.length === 0) return;
4809
+ const foldersToSubmit = selectedFolders.filter((id) => !id.startsWith("site:"));
4810
+ if (foldersToSubmit.length === 0) return;
4811
+ enableSync.mutate(
4812
+ {
4813
+ vendorKey: catalog.vendor_key,
4814
+ workspaceExtId,
4815
+ folders: foldersToSubmit,
4816
+ skipDuplicates,
4817
+ autoRename,
4818
+ shared,
4819
+ autoSync
4820
+ },
4821
+ {
4822
+ onSuccess: () => {
4823
+ notify(`${productName} settings saved`, "success");
4824
+ onOpenChange(false);
4825
+ onEnabled?.(workspaceExtId);
4826
+ },
4827
+ onError: (err) => {
4828
+ let msg = `Could not enable ${productName} sync. Please try again.`;
4829
+ const status = connectorErrorStatus(err);
4830
+ if (status !== void 0) {
4831
+ if (status === 403) {
4832
+ msg = "You are not a member of the selected workspace.";
4833
+ } else if (status === 409) {
4834
+ msg = `Reconnect needed \u2014 re-authorize your account to enable ${productName}.`;
4835
+ } else if (status === 404) {
4836
+ msg = `This connector is not available for ${productName} sync.`;
4837
+ }
4838
+ }
4839
+ notify(msg, "error");
4840
+ }
4841
+ }
4842
+ );
4843
+ };
4844
+ const productName = DRIVE_PRODUCT_NAMES[catalog.vendor_key] ?? "OneDrive";
4845
+ const reconnectButtonProps = {
4846
+ onReconnect: () => void reconnect(),
4847
+ isPending: disconnect.isPending,
4848
+ testId: "drive-folders-reconnect"
4849
+ };
4850
+ return /* @__PURE__ */ jsxs(
4851
+ ModalScaffold,
4852
+ {
4853
+ open,
4854
+ onOpenChange,
4855
+ title: `${productName} Import Settings`,
4856
+ description: `Import documents from ${productName} into a workspace so the ARBI agent can search them. This is read-only \u2014 ARBI imports a copy and never modifies or deletes anything in your ${productName}.`,
4857
+ showDescription: true,
4858
+ className: "w-[92vw] sm:max-w-lg",
4859
+ children: [
4860
+ /* @__PURE__ */ jsxs(SyncDialogBody, { children: [
4861
+ !lockedWorkspaceExtId && /* @__PURE__ */ jsx(SyncField, { label: "Target workspace", htmlFor: "drive-sync-workspace", children: /* @__PURE__ */ jsx(
4862
+ SyncSelect,
4863
+ {
4864
+ id: "drive-sync-workspace",
4865
+ value: workspaceExtId,
4866
+ onValueChange: setWorkspaceExtId,
4867
+ placeholder: "Select a workspace",
4868
+ options: memberWorkspaces.map((w) => ({ value: w.external_id, label: w.name }))
4869
+ }
4870
+ ) }),
4871
+ /* @__PURE__ */ jsx(
4872
+ SyncField,
4873
+ {
4874
+ label: `Folders to import${selectedFolders.length > 0 ? ` (${selectedFolders.length})` : ""}`,
4875
+ hint: "Select at least one folder. Importing a folder includes everything inside it.",
4876
+ actions: orderedFolders.length > 0 && /* @__PURE__ */ jsxs(SyncLinkRow, { children: [
4877
+ /* @__PURE__ */ jsx(
4878
+ SyncLinkButton,
4879
+ {
4880
+ onClick: () => setExpandAllNonce((n) => n + 1),
4881
+ testId: "drive-folders-expand-all",
4882
+ children: "Expand all"
4883
+ }
4884
+ ),
4885
+ /* @__PURE__ */ jsx(
4886
+ SyncLinkButton,
4887
+ {
4888
+ onClick: () => setCollapseAllNonce((n) => n + 1),
4889
+ testId: "drive-folders-collapse-all",
4890
+ children: "Collapse all"
4891
+ }
4892
+ )
4893
+ ] }),
4894
+ children: foldersLoading ? /* @__PURE__ */ jsx(SyncLoading, { children: "Loading folders\u2026" }) : needsReconnect ? /* @__PURE__ */ jsx(
4895
+ SyncReconnectNotice,
4896
+ {
4897
+ ...reconnectButtonProps,
4898
+ message: `Reconnect ${catalog.display_name} to enable ${productName} \u2014 your account needs to grant file access.`
4899
+ }
4900
+ ) : foldersError ? /* @__PURE__ */ jsx(
4901
+ SyncReconnectNotice,
4902
+ {
4903
+ ...reconnectButtonProps,
4904
+ message: `Couldn\u2019t load folders from ${productName}. Reconnect the account and try again.`
4905
+ }
4906
+ ) : orderedFolders.length === 0 ? /* @__PURE__ */ jsx(SyncNote, { children: "No folders found." }) : /* @__PURE__ */ jsx(SyncTreeFrame, { children: /* @__PURE__ */ jsx("div", { className: "space-y-0.5", "data-testid": "drive-folder-tree", children: orderedFolders.map((f) => /* @__PURE__ */ jsx(
4907
+ DriveFolderNode,
4908
+ {
4909
+ vendorKey: catalog.vendor_key,
4910
+ folder: f,
4911
+ depth: 0,
4912
+ selected: selectedFolders,
4913
+ onToggle: toggleFolder,
4914
+ enabled: treeEnabled,
4915
+ ancestorSelected: false,
4916
+ expandAllNonce,
4917
+ collapseAllNonce
4918
+ },
4919
+ f.id
4920
+ )) }) })
4921
+ }
4922
+ ),
4923
+ /* @__PURE__ */ jsxs(SyncOptions, { children: [
4924
+ /* @__PURE__ */ jsx(
4925
+ SyncOptionToggle,
4926
+ {
4927
+ checked: skipDuplicates,
4928
+ onCheckedChange: setSkipDuplicates,
4929
+ title: "Skip duplicates",
4930
+ description: "Skip files identical to ones already in the workspace."
4931
+ }
4932
+ ),
4933
+ /* @__PURE__ */ jsx(
4934
+ SyncOptionToggle,
4935
+ {
4936
+ checked: autoRename,
4937
+ onCheckedChange: setAutoRename,
4938
+ title: "Auto-rename",
4939
+ description: "Generate a descriptive title with AI instead of using the filename."
4940
+ }
4941
+ ),
4942
+ /* @__PURE__ */ jsx(
4943
+ SyncOptionToggle,
4944
+ {
4945
+ checked: shared,
4946
+ onCheckedChange: setShared,
4947
+ title: "Share with the workspace",
4948
+ description: shared ? "Imported documents are visible to everyone in the workspace." : "Imported documents stay private to you."
4949
+ }
4950
+ ),
4951
+ /* @__PURE__ */ jsx(
4952
+ SyncOptionToggle,
4953
+ {
4954
+ checked: autoSync,
4955
+ onCheckedChange: setAutoSync,
4956
+ title: "Sync automatically",
4957
+ description: "Check for new files when you sign in, instead of only when you click Sync now. Requires you to be signed in \u2014 nothing syncs while you are away.",
4958
+ testId: "drive-sync-auto-sync"
4959
+ }
4960
+ )
4961
+ ] })
4962
+ ] }),
4963
+ /* @__PURE__ */ jsx(
4964
+ SyncDialogFooter,
4965
+ {
4966
+ onCancel: () => onOpenChange(false),
4967
+ onSave: handleEnableSubmit,
4968
+ saveDisabled: !workspaceExtId || selectedFolders.length === 0,
4969
+ isSaving: enableSync.isPending,
4970
+ cancelButton: { testId: "drive-sync-cancel" },
4971
+ saveButton: { testId: "drive-sync-save" }
4972
+ }
4973
+ )
4974
+ ]
4975
+ }
4976
+ );
4977
+ }
4081
4978
  function useConnectedDocxNotifications(onOpen) {
4082
4979
  const arbi = useArbi();
4083
4980
  const { status, user, apiUrl } = useConnection();
@@ -9624,6 +10521,6 @@ function ConnectedAgentChatPanel({
9624
10521
  ] });
9625
10522
  }
9626
10523
 
9627
- export { ArbiAppProvider, ConnectedAccountSettings, ConnectedAgentChatPanel, ConnectedAgentCreator, ConnectedCalendar, ConnectedDangerZone, ConnectedIdentityVerification, ConnectedLogoutDialog, ConnectedMailAccounts, ConnectedMailComposer, ConnectedMailInviteCard, ConnectedMailMessage, ConnectedMailSettings, ConnectedMailSetup, ConnectedMailbox, ConnectedNotificationCenter, ConnectedNotificationPreferences, ConnectedPasswordChangeDialog, ConnectedPremiumModels, ConnectedPrivacySettings, ConnectedProfileCard, ConnectedPublicBooking, ConnectedRequireVerified, ConnectedSecuritySection, ConnectedSessionsRow, ConnectedSettingsPage, ConnectedSkillUpload, ConnectedSkillsLibrary, ConnectedTagTable, ConnectedTaskAccessRequest, ConnectedTaskActivityDialog, ConnectedThreadFollow, ConnectedUpcomingEvents, ConnectedWorkflowHistory, ConnectedWorkflowRunner, ConnectedWorkspaceActivity, ConnectedWorkspaceNotificationMenu, ConnectedWorkspaceSettings, DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS, DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS, DEFAULT_SETTINGS_SECTIONS, NotificationCenter, NotificationEvent, SETTINGS_SECTION_IDS, SessionStatusIcon, StreamedArtifact, WorkflowRunThread, accountSettingsSection, bookingCancelLink, buildNotificationCenterItems, chatSettingsSection, countNotificationTypes, defaultUnmetPasswordRequirement, filterNotificationCenterItems, mailSettingsSection, openMeetingLink, privacySettingsSection, renderSessionStatusIcon, requestCalendarComposer, requestCalendarEvent, resolveMailbox, useCalendarViewStore, useConnectedDocxNotifications, useConnectedShellWorkspaces, useConnectedWorkNotifications, useConnectedWorkspaceSettings, workflowRunView };
10524
+ export { ArbiAppProvider, BACKFILL_OPTIONS, ConnectedAccountSettings, ConnectedAgentChatPanel, ConnectedAgentCreator, ConnectedAppsSettings, ConnectedCalendar, ConnectedDangerZone, ConnectedDriveSyncDialog, ConnectedIdentityVerification, ConnectedLogoutDialog, ConnectedMailAccounts, ConnectedMailComposer, ConnectedMailInviteCard, ConnectedMailMessage, ConnectedMailSettings, ConnectedMailSetup, ConnectedMailbox, ConnectedMailboxSyncDialog, ConnectedNotificationCenter, ConnectedNotificationPreferences, ConnectedPasswordChangeDialog, ConnectedPremiumModels, ConnectedPrivacySettings, ConnectedProfileCard, ConnectedPublicBooking, ConnectedRequireVerified, ConnectedSecuritySection, ConnectedSessionsRow, ConnectedSettingsPage, ConnectedSkillUpload, ConnectedSkillsLibrary, ConnectedTagTable, ConnectedTaskAccessRequest, ConnectedTaskActivityDialog, ConnectedThreadFollow, ConnectedUpcomingEvents, ConnectedWorkflowHistory, ConnectedWorkflowRunner, ConnectedWorkspaceActivity, ConnectedWorkspaceNotificationMenu, ConnectedWorkspaceSettings, DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS, DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS, DEFAULT_SETTINGS_SECTIONS, NotificationCenter, NotificationEvent, SETTINGS_SECTION_IDS, SessionStatusIcon, StreamedArtifact, WorkflowRunThread, accountSettingsSection, bookingCancelLink, buildNotificationCenterItems, chatSettingsSection, connectedAppsSettingsSection, countNotificationTypes, defaultUnmetPasswordRequirement, filterNotificationCenterItems, formatLastSync, mailSettingsSection, openMeetingLink, privacySettingsSection, renderSessionStatusIcon, requestCalendarComposer, requestCalendarEvent, resolveMailbox, useCalendarViewStore, useConnectedDocxNotifications, useConnectedShellWorkspaces, useConnectedWorkNotifications, useConnectedWorkspaceSettings, windowLabel, workflowRunView };
9628
10525
  //# sourceMappingURL=index.js.map
9629
10526
  //# sourceMappingURL=index.js.map