@arbidocs/react 0.4.137 → 0.4.139

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,10 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkG7NSGLUA_cjs = require('./chunk-G7NSGLUA.cjs');
3
+ var chunkQXGGFMMX_cjs = require('./chunk-QXGGFMMX.cjs');
4
4
  var chunkTYUQFRHF_cjs = require('./chunk-TYUQFRHF.cjs');
5
5
  var chunkZWFMFOGP_cjs = require('./chunk-ZWFMFOGP.cjs');
6
6
  require('./chunk-VOFNX4P6.cjs');
7
- var chunk6PPWZILQ_cjs = require('./chunk-6PPWZILQ.cjs');
7
+ var chunkKLPY2HUC_cjs = require('./chunk-KLPY2HUC.cjs');
8
+ var chunkTMPDW7J5_cjs = require('./chunk-TMPDW7J5.cjs');
9
+ var chunkR2MF7YCW_cjs = require('./chunk-R2MF7YCW.cjs');
8
10
  var chunk65WT5PHA_cjs = require('./chunk-65WT5PHA.cjs');
9
11
  var chunkOC7F5SNA_cjs = require('./chunk-OC7F5SNA.cjs');
10
12
  var chunkWYZJLZ67_cjs = require('./chunk-WYZJLZ67.cjs');
@@ -12,8 +14,6 @@ var chunkZ3LLUO32_cjs = require('./chunk-Z3LLUO32.cjs');
12
14
  var chunkHUZB36QU_cjs = require('./chunk-HUZB36QU.cjs');
13
15
  var chunkHJDR5HEO_cjs = require('./chunk-HJDR5HEO.cjs');
14
16
  var chunkS6A6FSG7_cjs = require('./chunk-S6A6FSG7.cjs');
15
- var chunkTMPDW7J5_cjs = require('./chunk-TMPDW7J5.cjs');
16
- var chunkR2MF7YCW_cjs = require('./chunk-R2MF7YCW.cjs');
17
17
  var React = require('react');
18
18
  var reactQuery = require('@tanstack/react-query');
19
19
  var browser = require('@arbidocs/sdk/browser');
@@ -43,7 +43,7 @@ function useUpdateConversation() {
43
43
  conversationId,
44
44
  patch
45
45
  }) => arbi.conversations.update(conversationId, patch),
46
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.allConversations() })
46
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.allConversations() })
47
47
  });
48
48
  }
49
49
  function useCreateWork() {
@@ -51,7 +51,7 @@ function useCreateWork() {
51
51
  const qc = reactQuery.useQueryClient();
52
52
  return reactQuery.useMutation({
53
53
  mutationFn: (body) => arbi.conversations.createWork(body),
54
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.allConversations() })
54
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.allConversations() })
55
55
  });
56
56
  }
57
57
  function useRunConversation() {
@@ -59,7 +59,7 @@ function useRunConversation() {
59
59
  const qc = reactQuery.useQueryClient();
60
60
  return reactQuery.useMutation({
61
61
  mutationFn: (conversationId) => arbi.conversations.runWithAuth(conversationId),
62
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.allConversations() })
62
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.allConversations() })
63
63
  });
64
64
  }
65
65
  function useActOnStep() {
@@ -70,7 +70,7 @@ function useActOnStep() {
70
70
  conversationId,
71
71
  body
72
72
  }) => arbi.conversations.actOnStep(conversationId, body),
73
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.allConversations() })
73
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.allConversations() })
74
74
  });
75
75
  }
76
76
  function useSendBackStep() {
@@ -83,7 +83,7 @@ function useSendBackStep() {
83
83
  to,
84
84
  note
85
85
  }) => arbi.conversations.sendBackStep(conversationId, step, { to, note }),
86
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.allConversations() })
86
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.allConversations() })
87
87
  });
88
88
  }
89
89
  function usePlanWork() {
@@ -95,7 +95,7 @@ function usePlanWork() {
95
95
  function useConversationPendingAuth(conversationId, options) {
96
96
  const arbi = chunkR2MF7YCW_cjs.useArbi();
97
97
  return reactQuery.useQuery({
98
- queryKey: [...chunkG7NSGLUA_cjs.arbiQueryKeys.allConversations(), conversationId ?? "", "pending-auth"],
98
+ queryKey: [...chunkQXGGFMMX_cjs.arbiQueryKeys.allConversations(), conversationId ?? "", "pending-auth"],
99
99
  queryFn: () => arbi.conversations.pendingAuth(conversationId),
100
100
  enabled: (options?.enabled ?? true) && !!conversationId && arbi.isLoggedIn,
101
101
  retry: false
@@ -104,7 +104,7 @@ function useConversationPendingAuth(conversationId, options) {
104
104
  function useConversationActivity(conversationId, options) {
105
105
  const arbi = chunkR2MF7YCW_cjs.useArbi();
106
106
  return reactQuery.useQuery({
107
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.conversationActivity(conversationId ?? ""),
107
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.conversationActivity(conversationId ?? ""),
108
108
  queryFn: () => arbi.conversations.activity(conversationId),
109
109
  enabled: (options?.enabled ?? true) && !!conversationId && arbi.isLoggedIn,
110
110
  refetchInterval: options?.live ? 2500 : false
@@ -113,7 +113,7 @@ function useConversationActivity(conversationId, options) {
113
113
  function useWorkflows(options) {
114
114
  const arbi = chunkR2MF7YCW_cjs.useArbi();
115
115
  return reactQuery.useQuery({
116
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.workflows(),
116
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.workflows(),
117
117
  queryFn: () => arbi.workflows.list(),
118
118
  // A clock or event can fire while the list is open, without a write here.
119
119
  refetchInterval: options?.live ? 1e4 : false,
@@ -123,7 +123,7 @@ function useWorkflows(options) {
123
123
  function useWorkflowRuns(workflowId) {
124
124
  const arbi = chunkR2MF7YCW_cjs.useArbi();
125
125
  return reactQuery.useQuery({
126
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.workflowRuns(workflowId ?? ""),
126
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.workflowRuns(workflowId ?? ""),
127
127
  queryFn: () => arbi.workflows.runs(workflowId),
128
128
  enabled: !!workflowId && arbi.isLoggedIn,
129
129
  refetchInterval: 3e3,
@@ -136,7 +136,7 @@ function useCreateWorkflow() {
136
136
  const qc = reactQuery.useQueryClient();
137
137
  return reactQuery.useMutation({
138
138
  mutationFn: (body) => arbi.workflows.create(body),
139
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.workflows() })
139
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.workflows() })
140
140
  });
141
141
  }
142
142
  function useUpdateWorkflow() {
@@ -147,7 +147,7 @@ function useUpdateWorkflow() {
147
147
  workflowId,
148
148
  patch
149
149
  }) => arbi.workflows.update(workflowId, patch),
150
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.workflows() })
150
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.workflows() })
151
151
  });
152
152
  }
153
153
  function useDeleteWorkflow() {
@@ -155,18 +155,18 @@ function useDeleteWorkflow() {
155
155
  const qc = reactQuery.useQueryClient();
156
156
  return reactQuery.useMutation({
157
157
  mutationFn: (workflowId) => arbi.workflows.delete(workflowId),
158
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.workflows() })
158
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.workflows() })
159
159
  });
160
160
  }
161
161
  function useRunWorkflow() {
162
162
  const arbi = chunkR2MF7YCW_cjs.useArbi();
163
163
  const qc = reactQuery.useQueryClient();
164
164
  return reactQuery.useMutation({
165
- mutationKey: chunkG7NSGLUA_cjs.arbiMutationKeys.runWorkflow(),
165
+ mutationKey: chunkQXGGFMMX_cjs.arbiMutationKeys.runWorkflow(),
166
166
  mutationFn: (workflowId) => arbi.workflows.run(workflowId),
167
167
  onSuccess: () => Promise.all([
168
- qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.workflows() }),
169
- qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.allConversations() })
168
+ qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.workflows() }),
169
+ qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.allConversations() })
170
170
  ])
171
171
  });
172
172
  }
@@ -175,7 +175,7 @@ function useCreateAgent() {
175
175
  const qc = reactQuery.useQueryClient();
176
176
  return reactQuery.useMutation({
177
177
  mutationFn: (name) => arbi.agents.create(name),
178
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.agents() })
178
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.agents() })
179
179
  });
180
180
  }
181
181
  function useGenerateAgentAvatar() {
@@ -183,13 +183,13 @@ function useGenerateAgentAvatar() {
183
183
  const qc = reactQuery.useQueryClient();
184
184
  return reactQuery.useMutation({
185
185
  mutationFn: ({ agentExtId, prompt }) => arbi.agents.generateAvatar(agentExtId, prompt),
186
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.agents() })
186
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.agents() })
187
187
  });
188
188
  }
189
189
  function useAuthorizeLimits(options) {
190
190
  const arbi = chunkR2MF7YCW_cjs.useArbi();
191
191
  return reactQuery.useQuery({
192
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.authorizeLimits(),
192
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.authorizeLimits(),
193
193
  queryFn: () => arbi.agents.authorizeLimits(),
194
194
  enabled: (options?.enabled ?? true) && arbi.isLoggedIn
195
195
  });
@@ -197,7 +197,7 @@ function useAuthorizeLimits(options) {
197
197
  function useMcpTools(options) {
198
198
  const arbi = chunkR2MF7YCW_cjs.useArbi();
199
199
  return reactQuery.useQuery({
200
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.mcpTools(),
200
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.mcpTools(),
201
201
  queryFn: () => arbi.health.mcpTools(),
202
202
  enabled: (options?.enabled ?? true) && arbi.isLoggedIn
203
203
  });
@@ -205,7 +205,7 @@ function useMcpTools(options) {
205
205
  function useAgentConfig(agentExtId, options) {
206
206
  const arbi = chunkR2MF7YCW_cjs.useArbi();
207
207
  return reactQuery.useQuery({
208
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.agentConfig(agentExtId),
208
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.agentConfig(agentExtId),
209
209
  queryFn: async () => agentExtId ? await arbi.agents.getConfig(agentExtId) : await arbi.agentConfig.get("default"),
210
210
  enabled: (options?.enabled ?? true) && arbi.isLoggedIn
211
211
  });
@@ -213,7 +213,7 @@ function useAgentConfig(agentExtId, options) {
213
213
  function useAgentModels(options) {
214
214
  const arbi = chunkR2MF7YCW_cjs.useArbi();
215
215
  return reactQuery.useQuery({
216
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.models(),
216
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.models(),
217
217
  queryFn: async () => (await arbi.agentConfig.getModels()).models.map((m) => m.model_name),
218
218
  enabled: (options?.enabled ?? true) && arbi.isLoggedIn
219
219
  });
@@ -236,17 +236,17 @@ function useSaveAgentConfig() {
236
236
  });
237
237
  },
238
238
  onSuccess: (_saved, { agentExtId }) => Promise.all([
239
- qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.configs() }),
240
- qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.agentConfig(agentExtId) }),
239
+ qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.configs() }),
240
+ qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.agentConfig(agentExtId) }),
241
241
  // The agent list shows the pinned persona/model, so it refreshes too.
242
- qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.agents() })
242
+ qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.agents() })
243
243
  ])
244
244
  });
245
245
  }
246
246
  function useAgentWorkspaces(agentExtId, options) {
247
247
  const arbi = chunkR2MF7YCW_cjs.useArbi();
248
248
  return reactQuery.useQuery({
249
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.agentWorkspaces(agentExtId ?? ""),
249
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.agentWorkspaces(agentExtId ?? ""),
250
250
  queryFn: () => arbi.agents.listWorkspaces(agentExtId),
251
251
  enabled: (options?.enabled ?? true) && !!agentExtId && arbi.isLoggedIn
252
252
  });
@@ -267,7 +267,7 @@ function useGrantAgentAccess() {
267
267
  if (!agent?.email) throw new Error("The agent's address is unknown.");
268
268
  return arbi.workspaces.grantAccess({ workspaceId, emails: [agent.email] });
269
269
  },
270
- onSuccess: (_res, { agentExtId }) => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.agentWorkspaces(agentExtId) })
270
+ onSuccess: (_res, { agentExtId }) => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.agentWorkspaces(agentExtId) })
271
271
  });
272
272
  }
273
273
  function useRevokeAgentAccess() {
@@ -286,13 +286,13 @@ function useRevokeAgentAccess() {
286
286
  if (previous && previous !== workspaceId) await arbi.selectWorkspace(previous);
287
287
  }
288
288
  },
289
- onSuccess: (_res, { agentExtId }) => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.agentWorkspaces(agentExtId) })
289
+ onSuccess: (_res, { agentExtId }) => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.agentWorkspaces(agentExtId) })
290
290
  });
291
291
  }
292
292
  function useSkills(options) {
293
293
  const arbi = chunkR2MF7YCW_cjs.useArbi();
294
294
  return reactQuery.useQuery({
295
- queryKey: [...chunkG7NSGLUA_cjs.arbiQueryKeys.skills(), options?.includeHidden ?? false],
295
+ queryKey: [...chunkQXGGFMMX_cjs.arbiQueryKeys.skills(), options?.includeHidden ?? false],
296
296
  queryFn: () => arbi.assistant.listSkills({ includeHidden: options?.includeHidden }),
297
297
  refetchInterval: options?.live ? 5e3 : false,
298
298
  enabled: (options?.enabled ?? true) && arbi.isLoggedIn,
@@ -313,7 +313,8 @@ function useUploadSkillFiles() {
313
313
  for (const entry of entries) {
314
314
  const result = await arbi.documents.uploadFile(entry.content, entry.fileName, {
315
315
  folder: entry.folder,
316
- wpType: "skill"
316
+ wpType: "skill",
317
+ shared: entry.shared ?? false
317
318
  });
318
319
  if (result.skipped?.length)
319
320
  throw new Error(
@@ -323,7 +324,36 @@ function useUploadSkillFiles() {
323
324
  }
324
325
  return results;
325
326
  },
326
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.skills() })
327
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.skills() })
328
+ });
329
+ }
330
+ function useSkillSource(docExtId, options) {
331
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
332
+ return reactQuery.useQuery({
333
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.skillSource(docExtId ?? ""),
334
+ queryFn: async () => {
335
+ const response = await arbi.documents.download(docExtId);
336
+ if (!response.ok) throw new Error(`Could not read the skill (${response.status})`);
337
+ return response.text();
338
+ },
339
+ enabled: (options?.enabled ?? true) && !!docExtId && arbi.isLoggedIn,
340
+ staleTime: 5 * 6e4
341
+ });
342
+ }
343
+ function useDeleteSkill() {
344
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
345
+ const qc = reactQuery.useQueryClient();
346
+ return reactQuery.useMutation({
347
+ mutationFn: (docExtId) => arbi.documents.delete([docExtId]),
348
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.skills() })
349
+ });
350
+ }
351
+ function useSetSkillVisibility() {
352
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
353
+ const qc = reactQuery.useQueryClient();
354
+ return reactQuery.useMutation({
355
+ mutationFn: ({ docExtId, visibility }) => arbi.documents.update([{ external_id: docExtId, shared: visibility === "global" }]),
356
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.skills() })
327
357
  });
328
358
  }
329
359
  function useStartWorkQuery() {
@@ -350,13 +380,13 @@ function useStartWorkQuery() {
350
380
  `The run ${response.id} started, but its thread is not available yet. Do not submit it again.`
351
381
  );
352
382
  },
353
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.allConversations() })
383
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.allConversations() })
354
384
  });
355
385
  }
356
386
  function useAgentSession(agentId, options) {
357
387
  const arbi = chunkR2MF7YCW_cjs.useArbi();
358
388
  return reactQuery.useQuery({
359
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.agentSession(agentId ?? ""),
389
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.agentSession(agentId ?? ""),
360
390
  queryFn: () => arbi.agents.getSession(agentId),
361
391
  enabled: !!agentId && arbi.isLoggedIn && (options?.enabled ?? true),
362
392
  refetchInterval: 5e3
@@ -365,7 +395,7 @@ function useAgentSession(agentId, options) {
365
395
  function useAgentChats(agentId) {
366
396
  const arbi = chunkR2MF7YCW_cjs.useArbi();
367
397
  return reactQuery.useQuery({
368
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.agentChats(agentId ?? ""),
398
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.agentChats(agentId ?? ""),
369
399
  queryFn: () => arbi.agents.listChats(agentId),
370
400
  enabled: !!agentId && arbi.isLoggedIn,
371
401
  refetchInterval: 5e3
@@ -374,10 +404,10 @@ function useAgentChats(agentId) {
374
404
  function refreshAgentSession(qc, agentId) {
375
405
  return Promise.all(
376
406
  [
377
- chunkG7NSGLUA_cjs.arbiQueryKeys.agentSession(agentId),
378
- chunkG7NSGLUA_cjs.arbiQueryKeys.agentWorkspaces(agentId),
379
- chunkG7NSGLUA_cjs.arbiQueryKeys.agentChats(agentId),
380
- chunkG7NSGLUA_cjs.arbiQueryKeys.sessions()
407
+ chunkQXGGFMMX_cjs.arbiQueryKeys.agentSession(agentId),
408
+ chunkQXGGFMMX_cjs.arbiQueryKeys.agentWorkspaces(agentId),
409
+ chunkQXGGFMMX_cjs.arbiQueryKeys.agentChats(agentId),
410
+ chunkQXGGFMMX_cjs.arbiQueryKeys.sessions()
381
411
  ].map((queryKey) => qc.invalidateQueries({ queryKey }))
382
412
  );
383
413
  }
@@ -524,8 +554,8 @@ function useArbiChat(options = {}) {
524
554
  const recoveryIntervalMs = streamRecovery?.intervalMs ?? 3e3;
525
555
  const recoveryTimeoutMs = streamRecovery?.timeoutMs ?? 12e4;
526
556
  const arbi = chunkR2MF7YCW_cjs.useArbi();
527
- const { data: docs = [], isLoading: isLoadingDocuments, refetch } = chunkG7NSGLUA_cjs.useDocuments(workspaceId);
528
- const ordinaryHistory = chunkG7NSGLUA_cjs.useConversations(workspaceId, { enabled: !agentId, live: true });
557
+ const { data: docs = [], isLoading: isLoadingDocuments, refetch } = chunkQXGGFMMX_cjs.useDocuments(workspaceId);
558
+ const ordinaryHistory = chunkQXGGFMMX_cjs.useConversations(workspaceId, { enabled: !agentId, live: true });
529
559
  const agentHistory = useAgentChats(agentId);
530
560
  const stored = React.useMemo(
531
561
  () => agentId ? (agentHistory.data ?? []).filter((chat) => chat.workspace_ext_id === workspaceId).map((chat) => ({
@@ -540,7 +570,7 @@ function useArbiChat(options = {}) {
540
570
  );
541
571
  const isLoadingThreads = agentId ? agentHistory.isLoading : ordinaryHistory.isLoading;
542
572
  const refetchConversations = agentId ? agentHistory.refetch : ordinaryHistory.refetch;
543
- const query = chunkG7NSGLUA_cjs.useAssistantQuery();
573
+ const query = chunkQXGGFMMX_cjs.useAssistantQuery();
544
574
  const { mutateAsync } = query;
545
575
  const [stagedFiles, setStagedFiles] = React.useState([]);
546
576
  const [threads, setThreads] = React.useState(() => [emptyThread()]);
@@ -600,7 +630,7 @@ function useArbiChat(options = {}) {
600
630
  (conversation) => conversation.external_id === active.conversationId && conversation.status === "generating"
601
631
  ) || active.messages.some((message) => message.status === "streaming");
602
632
  const needsLoad = !!active.conversationId && !active.isLoaded;
603
- const loaded = chunkG7NSGLUA_cjs.useConversationThreads(workspaceId, active.conversationId ?? void 0, {
633
+ const loaded = chunkQXGGFMMX_cjs.useConversationThreads(workspaceId, active.conversationId ?? void 0, {
604
634
  enabled: needsLoad || liveHistory && !isRunning && !isPostingComment,
605
635
  live: liveHistory
606
636
  });
@@ -1381,14 +1411,14 @@ function useArbiDocumentSync(workspaceId) {
1381
1411
  if (!workspaceId) return;
1382
1412
  if (client.isMessageType(msg, "batch_complete")) {
1383
1413
  if (msg.workspace_ext_id !== workspaceId) return;
1384
- void queryClient.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.documents(workspaceId) });
1385
- void queryClient.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.tags(workspaceId) });
1414
+ void queryClient.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.documents(workspaceId) });
1415
+ void queryClient.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.tags(workspaceId) });
1386
1416
  return;
1387
1417
  }
1388
1418
  if (client.isMessageType(msg, "task_update")) {
1389
1419
  if (msg.workspace_ext_id !== workspaceId) return;
1390
1420
  if (TERMINAL_STATUSES.has(msg.status)) {
1391
- void queryClient.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.documents(workspaceId) });
1421
+ void queryClient.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.documents(workspaceId) });
1392
1422
  }
1393
1423
  }
1394
1424
  });
@@ -1517,7 +1547,7 @@ function useShellWorkspaces(options) {
1517
1547
  }
1518
1548
  function useArbiShellWorkspaces(options = {}) {
1519
1549
  const arbi = chunkR2MF7YCW_cjs.useArbi();
1520
- const query = chunkG7NSGLUA_cjs.useWorkspaces();
1550
+ const query = chunkQXGGFMMX_cjs.useWorkspaces();
1521
1551
  const { select, ...rest } = options;
1522
1552
  const defaultSelect = React.useCallback(
1523
1553
  (workspace) => arbi.selectWorkspace(workspace.id),
@@ -1536,7 +1566,7 @@ function useFacts(workspaceId, options) {
1536
1566
  const { enabled = true, ...filter } = options ?? {};
1537
1567
  const workspace = workspaceId ?? (arbi.hasWorkspace ? arbi.getWorkspaceId() : "");
1538
1568
  return reactQuery.useQuery({
1539
- queryKey: [...chunkG7NSGLUA_cjs.arbiQueryKeys.facts(workspace), filter],
1569
+ queryKey: [...chunkQXGGFMMX_cjs.arbiQueryKeys.facts(workspace), filter],
1540
1570
  queryFn: () => arbi.facts.list(filter),
1541
1571
  enabled: enabled && !!workspace && arbi.hasWorkspace,
1542
1572
  staleTime: 3e4
@@ -1544,7 +1574,7 @@ function useFacts(workspaceId, options) {
1544
1574
  }
1545
1575
  function useRefreshFacts() {
1546
1576
  const qc = reactQuery.useQueryClient();
1547
- return () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.allFacts() });
1577
+ return () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.allFacts() });
1548
1578
  }
1549
1579
  function useCreateFact() {
1550
1580
  const arbi = chunkR2MF7YCW_cjs.useArbi();
@@ -1589,8 +1619,8 @@ function openWorkspaceId(arbi) {
1589
1619
  }
1590
1620
  function invalidateTagData(qc, workspaceId) {
1591
1621
  return Promise.all([
1592
- qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.tags(workspaceId) }),
1593
- qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.facts(workspaceId) })
1622
+ qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.tags(workspaceId) }),
1623
+ qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.facts(workspaceId) })
1594
1624
  ]);
1595
1625
  }
1596
1626
  function useInvalidateTagData() {
@@ -1605,7 +1635,7 @@ function useTagKindSchema(kind, options) {
1605
1635
  const arbi = chunkR2MF7YCW_cjs.useArbi();
1606
1636
  const workspaceId = openWorkspaceId(arbi) ?? "";
1607
1637
  return reactQuery.useQuery({
1608
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.tagKind(workspaceId, kind ?? ""),
1638
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.tagKind(workspaceId, kind ?? ""),
1609
1639
  queryFn: () => arbi.tagKinds.get(kind),
1610
1640
  enabled: (options?.enabled ?? true) && !!kind && !!workspaceId
1611
1641
  });
@@ -1614,7 +1644,7 @@ function useUpdateTagKindSchema() {
1614
1644
  const arbi = chunkR2MF7YCW_cjs.useArbi();
1615
1645
  const qc = reactQuery.useQueryClient();
1616
1646
  return reactQuery.useMutation({
1617
- mutationKey: chunkG7NSGLUA_cjs.arbiMutationKeys.updateTagKindSchema(),
1647
+ mutationKey: chunkQXGGFMMX_cjs.arbiMutationKeys.updateTagKindSchema(),
1618
1648
  mutationFn: ({
1619
1649
  kind,
1620
1650
  fields
@@ -1622,7 +1652,7 @@ function useUpdateTagKindSchema() {
1622
1652
  onSuccess: (schema) => {
1623
1653
  const workspaceId = openWorkspaceId(arbi);
1624
1654
  if (!workspaceId) return;
1625
- qc.setQueryData(chunkG7NSGLUA_cjs.arbiQueryKeys.tagKind(workspaceId, schema.kind), schema);
1655
+ qc.setQueryData(chunkQXGGFMMX_cjs.arbiQueryKeys.tagKind(workspaceId, schema.kind), schema);
1626
1656
  return invalidateTagData(qc, workspaceId);
1627
1657
  }
1628
1658
  });
@@ -1641,7 +1671,7 @@ function useSetTagValues() {
1641
1671
  function useFilteredProjects(filters, options) {
1642
1672
  const arbi = chunkR2MF7YCW_cjs.useArbi();
1643
1673
  return reactQuery.useQuery({
1644
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.projectsFiltered(filters.stage, filters.leadUser),
1674
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.projectsFiltered(filters.stage, filters.leadUser),
1645
1675
  queryFn: () => arbi.projects.list(filters),
1646
1676
  enabled: options?.enabled ?? arbi.isLoggedIn
1647
1677
  });
@@ -1654,14 +1684,14 @@ function useUpdateProjectFields() {
1654
1684
  projectExtId,
1655
1685
  patch
1656
1686
  }) => arbi.projects.update(projectExtId, patch),
1657
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.projects() })
1687
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.projects() })
1658
1688
  });
1659
1689
  }
1660
1690
  function useProjectEvents(projectExtId, options) {
1661
1691
  const arbi = chunkR2MF7YCW_cjs.useArbi();
1662
1692
  return reactQuery.useQuery({
1663
1693
  queryKey: [
1664
- ...chunkG7NSGLUA_cjs.arbiQueryKeys.projectEvents(projectExtId ?? ""),
1694
+ ...chunkQXGGFMMX_cjs.arbiQueryKeys.projectEvents(projectExtId ?? ""),
1665
1695
  options?.kind ?? "all",
1666
1696
  options?.limit ?? "default"
1667
1697
  ],
@@ -1672,7 +1702,7 @@ function useProjectEvents(projectExtId, options) {
1672
1702
  function useConversationUsage(conversationId, options) {
1673
1703
  const arbi = chunkR2MF7YCW_cjs.useArbi();
1674
1704
  return reactQuery.useQuery({
1675
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.conversationUsage(conversationId ?? ""),
1705
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.conversationUsage(conversationId ?? ""),
1676
1706
  queryFn: () => arbi.conversations.usage(conversationId),
1677
1707
  enabled: (options?.enabled ?? true) && !!conversationId && arbi.isLoggedIn,
1678
1708
  refetchInterval: options?.live ? 1e4 : false
@@ -1681,7 +1711,7 @@ function useConversationUsage(conversationId, options) {
1681
1711
  function useProjectConversationUsage(projectExtId, monthsBack = 0, options) {
1682
1712
  const arbi = chunkR2MF7YCW_cjs.useArbi();
1683
1713
  return reactQuery.useQuery({
1684
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.projectConversationUsage(projectExtId ?? "", monthsBack),
1714
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.projectConversationUsage(projectExtId ?? "", monthsBack),
1685
1715
  queryFn: () => arbi.projects.usageByConversation(projectExtId, monthsBack),
1686
1716
  enabled: (options?.enabled ?? true) && !!projectExtId && arbi.isLoggedIn
1687
1717
  });
@@ -1689,7 +1719,7 @@ function useProjectConversationUsage(projectExtId, monthsBack = 0, options) {
1689
1719
  function useContacts(options) {
1690
1720
  const arbi = chunkR2MF7YCW_cjs.useArbi();
1691
1721
  return reactQuery.useQuery({
1692
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.contacts(),
1722
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.contacts(),
1693
1723
  queryFn: () => arbi.contacts.list(),
1694
1724
  enabled: (options?.enabled ?? true) && arbi.isLoggedIn
1695
1725
  });
@@ -1704,7 +1734,7 @@ function usePendingContacts(options) {
1704
1734
  }
1705
1735
  function useInvalidateContacts() {
1706
1736
  const qc = reactQuery.useQueryClient();
1707
- return () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.contacts() });
1737
+ return () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.contacts() });
1708
1738
  }
1709
1739
  function useInviteContacts() {
1710
1740
  const arbi = chunkR2MF7YCW_cjs.useArbi();
@@ -1738,6 +1768,26 @@ function useDeleteContact() {
1738
1768
  onSuccess: () => invalidate()
1739
1769
  });
1740
1770
  }
1771
+ function useSearchContacts(q, { debounceMs = 200 } = {}) {
1772
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
1773
+ const term = useDebounced(q.trim(), debounceMs);
1774
+ return reactQuery.useQuery({
1775
+ queryKey: [...chunkQXGGFMMX_cjs.arbiQueryKeys.contacts(), "search", term],
1776
+ queryFn: () => arbi.contacts.search(term),
1777
+ enabled: term.length > 0 && arbi.isLoggedIn,
1778
+ staleTime: 6e4,
1779
+ placeholderData: (previous) => previous,
1780
+ retry: false
1781
+ });
1782
+ }
1783
+ function useDebounced(value, ms) {
1784
+ const [debounced, setDebounced] = React.useState(value);
1785
+ React.useEffect(() => {
1786
+ const t = setTimeout(() => setDebounced(value), ms);
1787
+ return () => clearTimeout(t);
1788
+ }, [value, ms]);
1789
+ return debounced;
1790
+ }
1741
1791
  var AccountClientContext = React.createContext(null);
1742
1792
  function arbiProfile(arbi) {
1743
1793
  const profile = arbi.user.profile();
@@ -1833,11 +1883,11 @@ function useProfile(options) {
1833
1883
  const { client, enabled } = useAccountClient();
1834
1884
  const qc = reactQuery.useQueryClient();
1835
1885
  React.useEffect(
1836
- () => client.onProfileChange(() => qc.setQueryData(chunkG7NSGLUA_cjs.arbiQueryKeys.profile(), client.profile())),
1886
+ () => client.onProfileChange(() => qc.setQueryData(chunkQXGGFMMX_cjs.arbiQueryKeys.profile(), client.profile())),
1837
1887
  [client, qc]
1838
1888
  );
1839
1889
  return reactQuery.useQuery({
1840
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.profile(),
1890
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.profile(),
1841
1891
  queryFn: () => client.profile(),
1842
1892
  enabled: (options?.enabled ?? true) && enabled,
1843
1893
  staleTime: Infinity
@@ -1852,9 +1902,9 @@ function useUpdateProfile() {
1852
1902
  return client.profile();
1853
1903
  },
1854
1904
  onSuccess: (profile) => {
1855
- qc.setQueryData(chunkG7NSGLUA_cjs.arbiQueryKeys.profile(), profile);
1856
- void qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.identity() });
1857
- return qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.workspaces() });
1905
+ qc.setQueryData(chunkQXGGFMMX_cjs.arbiQueryKeys.profile(), profile);
1906
+ void qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.identity() });
1907
+ return qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.workspaces() });
1858
1908
  }
1859
1909
  });
1860
1910
  }
@@ -1937,7 +1987,7 @@ function useConfirmEmailChange() {
1937
1987
  const qc = reactQuery.useQueryClient();
1938
1988
  return reactQuery.useMutation({
1939
1989
  mutationFn: ({ newEmail, code }) => client.confirmEmailChange(newEmail, code),
1940
- onSuccess: () => qc.setQueryData(chunkG7NSGLUA_cjs.arbiQueryKeys.profile(), client.profile())
1990
+ onSuccess: () => qc.setQueryData(chunkQXGGFMMX_cjs.arbiQueryKeys.profile(), client.profile())
1941
1991
  });
1942
1992
  }
1943
1993
  function useEmailChange({
@@ -2105,7 +2155,7 @@ function toNotificationPreferences(stored, keys) {
2105
2155
  function useUserSettings(options) {
2106
2156
  const arbi = chunkR2MF7YCW_cjs.useArbi();
2107
2157
  return reactQuery.useQuery({
2108
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings(),
2158
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings(),
2109
2159
  queryFn: () => arbi.settings.get(),
2110
2160
  enabled: (options?.enabled ?? true) && arbi.isLoggedIn
2111
2161
  });
@@ -2118,18 +2168,18 @@ function useNotificationPreferences(keys, options) {
2118
2168
  const save = reactQuery.useMutation({
2119
2169
  mutationFn: (patch) => arbi.settings.update({ email_notifications: patch }),
2120
2170
  onMutate: async (patch) => {
2121
- await qc.cancelQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings() });
2122
- const previous = qc.getQueryData(chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings());
2171
+ await qc.cancelQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings() });
2172
+ const previous = qc.getQueryData(chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings());
2123
2173
  qc.setQueryData(
2124
- chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings(),
2174
+ chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings(),
2125
2175
  (old) => old ? { ...old, email_notifications: { ...old.email_notifications, ...patch } } : old
2126
2176
  );
2127
2177
  return { previous };
2128
2178
  },
2129
2179
  onError: (_err, _patch, context) => {
2130
- qc.setQueryData(chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings(), context?.previous);
2180
+ qc.setQueryData(chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings(), context?.previous);
2131
2181
  },
2132
- onSettled: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings() })
2182
+ onSettled: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings() })
2133
2183
  });
2134
2184
  const model = React.useMemo(() => toNotificationPreferences(stored, keys), [stored, keys]);
2135
2185
  const setAll = React.useCallback(
@@ -2156,18 +2206,18 @@ function useRelevanceSave() {
2156
2206
  return reactQuery.useMutation({
2157
2207
  mutationFn: (patch) => arbi.settings.update(patch),
2158
2208
  onMutate: async (patch) => {
2159
- await qc.cancelQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings() });
2160
- const previous = qc.getQueryData(chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings());
2209
+ await qc.cancelQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings() });
2210
+ const previous = qc.getQueryData(chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings());
2161
2211
  qc.setQueryData(
2162
- chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings(),
2212
+ chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings(),
2163
2213
  (old) => old ? { ...old, ...patch } : old
2164
2214
  );
2165
2215
  return { previous };
2166
2216
  },
2167
2217
  onError: (_err, _patch, context) => {
2168
- qc.setQueryData(chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings(), context?.previous);
2218
+ qc.setQueryData(chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings(), context?.previous);
2169
2219
  },
2170
- onSettled: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings() })
2220
+ onSettled: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings() })
2171
2221
  });
2172
2222
  }
2173
2223
  function useWorkspaceNotificationLevel(workspaceId, options) {
@@ -2178,7 +2228,7 @@ function useWorkspaceNotificationLevel(workspaceId, options) {
2178
2228
  const setLevel = React.useCallback(
2179
2229
  (next) => {
2180
2230
  if (!workspaceId) return;
2181
- const current = qc.getQueryData(chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings()) ?? settings.data;
2231
+ const current = qc.getQueryData(chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings()) ?? settings.data;
2182
2232
  save.mutate(browser.settings.workspaceLevelPatch(current, workspaceId, next));
2183
2233
  },
2184
2234
  [qc, save, settings.data, workspaceId]
@@ -2199,7 +2249,7 @@ function useFollowThread(conversationId, options) {
2199
2249
  const setFollowing = React.useCallback(
2200
2250
  (on, callbacks) => {
2201
2251
  if (!conversationId) return;
2202
- const current = qc.getQueryData(chunkG7NSGLUA_cjs.arbiQueryKeys.userSettings()) ?? settings.data;
2252
+ const current = qc.getQueryData(chunkQXGGFMMX_cjs.arbiQueryKeys.userSettings()) ?? settings.data;
2203
2253
  save.mutate(
2204
2254
  {
2205
2255
  followed_threads: browser.settings.withMembership(
@@ -2224,7 +2274,7 @@ function useFollowThread(conversationId, options) {
2224
2274
  function useSessions(options) {
2225
2275
  const { client, enabled } = useAccountClient();
2226
2276
  return reactQuery.useQuery({
2227
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.sessions(),
2277
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.sessions(),
2228
2278
  queryFn: () => client.listSessions(),
2229
2279
  enabled: (options?.enabled ?? true) && enabled
2230
2280
  });
@@ -2234,7 +2284,7 @@ function useTerminateSession() {
2234
2284
  const qc = reactQuery.useQueryClient();
2235
2285
  return reactQuery.useMutation({
2236
2286
  mutationFn: (sessionId) => client.terminateSession(sessionId),
2237
- onSuccess: () => qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.sessions() })
2287
+ onSuccess: () => qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.sessions() })
2238
2288
  });
2239
2289
  }
2240
2290
  function useSignOut() {
@@ -2377,7 +2427,7 @@ function useIdentityVerificationFlow(api, {
2377
2427
  const apiRef = React.useRef(api);
2378
2428
  apiRef.current = api;
2379
2429
  const query = reactQuery.useQuery({
2380
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.identity(),
2430
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.identity(),
2381
2431
  queryFn: () => apiRef.current.status(),
2382
2432
  enabled,
2383
2433
  staleTime: 6e4
@@ -2395,7 +2445,7 @@ function useIdentityVerificationFlow(api, {
2395
2445
  const lastVerified = React.useRef(void 0);
2396
2446
  const apply = React.useCallback(
2397
2447
  (next) => {
2398
- qc.setQueryData(chunkG7NSGLUA_cjs.arbiQueryKeys.identity(), next);
2448
+ qc.setQueryData(chunkQXGGFMMX_cjs.arbiQueryKeys.identity(), next);
2399
2449
  if (lastVerified.current !== void 0 && lastVerified.current !== next.verified) {
2400
2450
  onVerifiedChange?.(next.verified);
2401
2451
  }
@@ -2590,12 +2640,12 @@ function useIdentityVerification(options = {}) {
2590
2640
  enabled,
2591
2641
  formatPrice,
2592
2642
  onVerifiedChange: (verified) => {
2593
- void qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.profile() });
2643
+ void qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.profile() });
2594
2644
  onVerifiedChange?.(verified);
2595
2645
  },
2596
2646
  onNameAccepted: (name) => {
2597
- void qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.profile() });
2598
- void qc.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.workspaces() });
2647
+ void qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.profile() });
2648
+ void qc.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.workspaces() });
2599
2649
  onNameAccepted?.(name);
2600
2650
  }
2601
2651
  });
@@ -2736,7 +2786,8 @@ var mailQueryKeys = {
2736
2786
  folders: (accountId) => ["mail", "folders", accountId],
2737
2787
  allMessages: () => ["mail", "messages"],
2738
2788
  messages: (accountId, folderId, query, cursor) => ["mail", "messages", accountId, folderId, query, cursor],
2739
- message: (accountId, messageId) => ["mail", "message", accountId, messageId]
2789
+ message: (accountId, messageId) => ["mail", "message", accountId, messageId],
2790
+ attachmentText: (accountId, messageId, attachmentId) => ["mail", "attachment-text", accountId, messageId, attachmentId]
2740
2791
  };
2741
2792
  function useMailOnline() {
2742
2793
  return React.useSyncExternalStore(
@@ -2812,6 +2863,25 @@ function useMailMessage(account, messageId, options = {}) {
2812
2863
  retry: false
2813
2864
  });
2814
2865
  }
2866
+ function decodeBase64Text(b64) {
2867
+ const bytes = Uint8Array.from(atob(b64), (c) => c.charCodeAt(0));
2868
+ return new TextDecoder().decode(bytes);
2869
+ }
2870
+ function useMailAttachmentText(accountId, messageId, attachment, options = {}) {
2871
+ const { client } = useMailClient();
2872
+ return reactQuery.useQuery({
2873
+ queryKey: mailQueryKeys.attachmentText(accountId, messageId, attachment?.id ?? ""),
2874
+ queryFn: async () => {
2875
+ const a = attachment;
2876
+ if (a.content_base64) return decodeBase64Text(a.content_base64);
2877
+ const path = `${accountPath(accountId)}/messages/${encodeURIComponent(messageId)}/attachments/${encodeURIComponent(a.id)}`;
2878
+ return (await client.fetch(path)).text();
2879
+ },
2880
+ enabled: !!attachment && (options.enabled ?? true),
2881
+ staleTime: Infinity,
2882
+ retry: false
2883
+ });
2884
+ }
2815
2885
  function useClaimNativeAlias(onClaimed) {
2816
2886
  const { client } = useMailClient();
2817
2887
  const queryClient = reactQuery.useQueryClient();
@@ -3012,8 +3082,633 @@ function useMailDraftReplaced(draftId, onReplaced) {
3012
3082
  return () => window.removeEventListener(MAIL_DRAFT_REPLACED_EVENT, listener);
3013
3083
  }, [draftId]);
3014
3084
  }
3085
+
3086
+ // src/calendar/keys.ts
3087
+ var calendarQueryKeys = {
3088
+ all: () => ["arbi", "calendar"],
3089
+ settings: () => ["arbi", "calendar", "settings"],
3090
+ calendars: () => ["arbi", "calendar", "calendars"],
3091
+ /** Every event list: the prefix an event write invalidates. */
3092
+ events: () => ["arbi", "calendar", "events"],
3093
+ eventList: (p) => [
3094
+ "arbi",
3095
+ "calendar",
3096
+ "events",
3097
+ { start: p.start, end: p.end, calendars: p.calendars?.join(",") ?? null }
3098
+ ],
3099
+ /** Every single event read. */
3100
+ eventDetails: () => ["arbi", "calendar", "event"],
3101
+ event: (id, recurrenceId) => ["arbi", "calendar", "event", id, recurrenceId ?? null],
3102
+ shares: (calId) => ["arbi", "calendar", "shares", calId],
3103
+ invitations: () => ["arbi", "calendar", "invitations"],
3104
+ holidayCountries: () => ["arbi", "calendar", "holiday-countries"],
3105
+ allRooms: () => ["arbi", "calendar", "rooms"],
3106
+ rooms: (q) => ["arbi", "calendar", "rooms", q],
3107
+ freebusy: (attendees, start, end) => ["arbi", "calendar", "freebusy", attendees.join(","), start, end],
3108
+ allLookups: () => ["arbi", "calendar", "lookup"],
3109
+ lookup: (uid) => ["arbi", "calendar", "lookup", uid],
3110
+ overlays: (workspaceId, w, layers) => [
3111
+ "arbi",
3112
+ "calendar",
3113
+ "overlays",
3114
+ workspaceId,
3115
+ w ? { start: w.start, end: w.end, layers: layers?.join(",") } : null
3116
+ ],
3117
+ accounts: () => ["arbi", "calendar", "accounts"],
3118
+ caldavProfiles: () => ["arbi", "calendar", "caldav-profiles"],
3119
+ appPasswords: () => ["arbi", "calendar", "app-passwords"],
3120
+ bookingPages: () => ["arbi", "calendar", "booking-pages"],
3121
+ /** The offline outbox (writes made offline, not yet sent). */
3122
+ outbox: () => ["arbi", "calendar", "outbox"]
3123
+ };
3124
+ function isQueuedCalendarWrite(value) {
3125
+ return !!value && typeof value === "object" && value.queued === true;
3126
+ }
3127
+ var CalendarSupportContext = React.createContext({});
3128
+ function CalendarSupportProvider({
3129
+ value,
3130
+ children
3131
+ }) {
3132
+ return /* @__PURE__ */ jsxRuntime.jsx(CalendarSupportContext.Provider, { value, children });
3133
+ }
3134
+ function useCalendarSupport() {
3135
+ return React.useContext(CalendarSupportContext);
3136
+ }
3137
+ function invalidateCalendarEvents(qc) {
3138
+ return Promise.all([
3139
+ qc.invalidateQueries({ queryKey: calendarQueryKeys.events() }),
3140
+ qc.invalidateQueries({ queryKey: calendarQueryKeys.eventDetails() }),
3141
+ qc.invalidateQueries({ queryKey: calendarQueryKeys.invitations() }),
3142
+ qc.invalidateQueries({ queryKey: calendarQueryKeys.allLookups() })
3143
+ ]);
3144
+ }
3145
+ function invalidateCalendars(qc) {
3146
+ return Promise.all([
3147
+ qc.invalidateQueries({ queryKey: calendarQueryKeys.calendars() }),
3148
+ qc.invalidateQueries({ queryKey: calendarQueryKeys.events() })
3149
+ ]);
3150
+ }
3151
+ function useOfflineRead() {
3152
+ const { offline } = useCalendarSupport();
3153
+ return {
3154
+ read: (key, fetch) => offline ? offline.read(key, fetch) : fetch(),
3155
+ // Offline-capable queries must run without the network to reach the saved copy.
3156
+ networkMode: offline ? "always" : void 0
3157
+ };
3158
+ }
3159
+ function useOfflineWrite() {
3160
+ const { offline } = useCalendarSupport();
3161
+ return {
3162
+ write: (op, send) => offline ? offline.write(op, send) : send(),
3163
+ networkMode: offline ? "always" : void 0
3164
+ };
3165
+ }
3166
+ function useCalendarSettings(enabled = true) {
3167
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3168
+ const { read, networkMode } = useOfflineRead();
3169
+ return reactQuery.useQuery({
3170
+ queryKey: calendarQueryKeys.settings(),
3171
+ queryFn: () => read(calendarQueryKeys.settings(), () => arbi.calendar.getSettings()),
3172
+ networkMode,
3173
+ enabled: enabled && arbi.isLoggedIn,
3174
+ staleTime: 5 * 6e4,
3175
+ retry: false
3176
+ });
3177
+ }
3178
+ function useCalendars(enabled = true) {
3179
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3180
+ const { read, networkMode } = useOfflineRead();
3181
+ return reactQuery.useQuery({
3182
+ queryKey: calendarQueryKeys.calendars(),
3183
+ queryFn: () => read(calendarQueryKeys.calendars(), () => arbi.calendar.listCalendars()),
3184
+ networkMode,
3185
+ enabled: enabled && arbi.isLoggedIn,
3186
+ staleTime: 6e4,
3187
+ retry: false
3188
+ });
3189
+ }
3190
+ function useCalendarEvents(params) {
3191
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3192
+ const { read, networkMode } = useOfflineRead();
3193
+ return reactQuery.useQuery({
3194
+ queryKey: params ? calendarQueryKeys.eventList(params) : calendarQueryKeys.events(),
3195
+ queryFn: () => read(
3196
+ calendarQueryKeys.eventList(params),
3197
+ () => arbi.calendar.listEvents(params)
3198
+ ),
3199
+ networkMode,
3200
+ enabled: !!params && arbi.isLoggedIn,
3201
+ staleTime: 3e4,
3202
+ placeholderData: (previous) => previous,
3203
+ retry: false
3204
+ });
3205
+ }
3206
+ function useCalendarEvent(id, recurrenceId) {
3207
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3208
+ const { read, networkMode } = useOfflineRead();
3209
+ return reactQuery.useQuery({
3210
+ queryKey: calendarQueryKeys.event(id ?? "", recurrenceId),
3211
+ queryFn: () => read(
3212
+ calendarQueryKeys.event(id, recurrenceId),
3213
+ () => arbi.calendar.getEvent(id, recurrenceId)
3214
+ ),
3215
+ networkMode,
3216
+ enabled: !!id && arbi.isLoggedIn,
3217
+ retry: false
3218
+ });
3219
+ }
3220
+ function useFetchCalendarEvent() {
3221
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3222
+ const qc = reactQuery.useQueryClient();
3223
+ const { read, networkMode } = useOfflineRead();
3224
+ return (id, recurrenceId) => qc.fetchQuery({
3225
+ queryKey: calendarQueryKeys.event(id, recurrenceId),
3226
+ queryFn: () => read(
3227
+ calendarQueryKeys.event(id, recurrenceId),
3228
+ () => arbi.calendar.getEvent(id, recurrenceId)
3229
+ ),
3230
+ networkMode,
3231
+ retry: false
3232
+ });
3233
+ }
3234
+ function useCalendarOverlays(range, layers) {
3235
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3236
+ const workspaceId = arbi.hasWorkspace ? arbi.getWorkspaceId() : null;
3237
+ return reactQuery.useQuery({
3238
+ queryKey: calendarQueryKeys.overlays(workspaceId, range ?? void 0, layers),
3239
+ queryFn: () => arbi.calendar.listOverlays(range, layers),
3240
+ enabled: !!workspaceId && !!range && layers.length > 0,
3241
+ staleTime: 6e4,
3242
+ placeholderData: (previous) => previous,
3243
+ retry: false
3244
+ });
3245
+ }
3246
+ function useCalendarOutbox() {
3247
+ const qc = reactQuery.useQueryClient();
3248
+ const { offline } = useCalendarSupport();
3249
+ React.useEffect(
3250
+ () => offline?.subscribe(() => {
3251
+ void qc.invalidateQueries({ queryKey: calendarQueryKeys.outbox() });
3252
+ }),
3253
+ [offline, qc]
3254
+ );
3255
+ return reactQuery.useQuery({
3256
+ queryKey: calendarQueryKeys.outbox(),
3257
+ queryFn: () => offline ? offline.pending() : Promise.resolve([]),
3258
+ networkMode: "always",
3259
+ staleTime: Infinity
3260
+ });
3261
+ }
3262
+ function useCalendarShares(calId) {
3263
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3264
+ return reactQuery.useQuery({
3265
+ queryKey: calendarQueryKeys.shares(calId ?? ""),
3266
+ queryFn: () => arbi.calendar.listShares(calId),
3267
+ enabled: !!calId && arbi.isLoggedIn,
3268
+ retry: false
3269
+ });
3270
+ }
3271
+ function useHolidayCountries(enabled = true) {
3272
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3273
+ return reactQuery.useQuery({
3274
+ queryKey: calendarQueryKeys.holidayCountries(),
3275
+ queryFn: () => arbi.calendar.listHolidayCountries(),
3276
+ enabled: enabled && arbi.isLoggedIn,
3277
+ staleTime: Infinity,
3278
+ retry: false
3279
+ });
3280
+ }
3281
+ function useRooms(q) {
3282
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3283
+ return reactQuery.useQuery({
3284
+ queryKey: calendarQueryKeys.rooms(q ?? {}),
3285
+ queryFn: () => arbi.calendar.listRooms(q ?? {}),
3286
+ enabled: !!q && arbi.isLoggedIn,
3287
+ staleTime: 3e4,
3288
+ placeholderData: (previous) => previous,
3289
+ retry: false
3290
+ });
3291
+ }
3292
+ function useFreeBusy(attendees, start, end) {
3293
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3294
+ return reactQuery.useQuery({
3295
+ queryKey: calendarQueryKeys.freebusy(attendees, start ?? "", end ?? ""),
3296
+ queryFn: () => arbi.calendar.freeBusy({ attendees, start, end }),
3297
+ enabled: attendees.length > 0 && !!start && !!end && arbi.isLoggedIn,
3298
+ staleTime: 3e4,
3299
+ placeholderData: (previous) => previous,
3300
+ retry: false
3301
+ });
3302
+ }
3303
+ function useCalendarInvitations() {
3304
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3305
+ return reactQuery.useQuery({
3306
+ queryKey: calendarQueryKeys.invitations(),
3307
+ queryFn: () => arbi.calendar.listInvitations(),
3308
+ enabled: arbi.isLoggedIn,
3309
+ staleTime: 3e4,
3310
+ refetchInterval: 6e4,
3311
+ retry: false
3312
+ });
3313
+ }
3314
+ function useCalendarEventByUid(uid) {
3315
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3316
+ return reactQuery.useQuery({
3317
+ queryKey: calendarQueryKeys.lookup(uid ?? ""),
3318
+ queryFn: () => arbi.calendar.lookupByUid(uid),
3319
+ enabled: !!uid && arbi.isLoggedIn,
3320
+ retry: false
3321
+ });
3322
+ }
3323
+ function useSaveCalendarSettings() {
3324
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3325
+ const qc = reactQuery.useQueryClient();
3326
+ return reactQuery.useMutation({
3327
+ mutationFn: (body) => arbi.calendar.putSettings(body),
3328
+ onSuccess: (data) => qc.setQueryData(calendarQueryKeys.settings(), data)
3329
+ });
3330
+ }
3331
+ function useCreateCalendar() {
3332
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3333
+ const qc = reactQuery.useQueryClient();
3334
+ return reactQuery.useMutation({
3335
+ mutationFn: (body) => arbi.calendar.createCalendar(body),
3336
+ onSuccess: () => invalidateCalendars(qc)
3337
+ });
3338
+ }
3339
+ function useUpdateCalendar() {
3340
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3341
+ const qc = reactQuery.useQueryClient();
3342
+ return reactQuery.useMutation({
3343
+ mutationFn: ({ id, body }) => arbi.calendar.updateCalendar(id, body),
3344
+ onSuccess: () => invalidateCalendars(qc)
3345
+ });
3346
+ }
3347
+ function useDeleteCalendar() {
3348
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3349
+ const qc = reactQuery.useQueryClient();
3350
+ return reactQuery.useMutation({
3351
+ mutationFn: (calId) => arbi.calendar.deleteCalendar(calId),
3352
+ onSuccess: () => invalidateCalendars(qc)
3353
+ });
3354
+ }
3355
+ function useCreateEvent() {
3356
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3357
+ const qc = reactQuery.useQueryClient();
3358
+ const { write, networkMode } = useOfflineWrite();
3359
+ return reactQuery.useMutation({
3360
+ mutationFn: (body) => write({ kind: "create", body }, () => arbi.calendar.createEvent(body)),
3361
+ networkMode,
3362
+ onSuccess: () => invalidateCalendarEvents(qc)
3363
+ });
3364
+ }
3365
+ function useUpdateEvent() {
3366
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3367
+ const qc = reactQuery.useQueryClient();
3368
+ const { write, networkMode } = useOfflineWrite();
3369
+ return reactQuery.useMutation({
3370
+ mutationFn: ({ target, body }) => write({ kind: "update", target, body }, () => arbi.calendar.updateEvent(target, body)),
3371
+ networkMode,
3372
+ onSuccess: () => invalidateCalendarEvents(qc)
3373
+ });
3374
+ }
3375
+ function useDeleteEvent() {
3376
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3377
+ const qc = reactQuery.useQueryClient();
3378
+ const { write, networkMode } = useOfflineWrite();
3379
+ return reactQuery.useMutation({
3380
+ mutationFn: (target) => write({ kind: "delete", target }, () => arbi.calendar.deleteEvent(target)),
3381
+ networkMode,
3382
+ onSuccess: () => invalidateCalendarEvents(qc)
3383
+ });
3384
+ }
3385
+ function useMoveEvent() {
3386
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3387
+ const qc = reactQuery.useQueryClient();
3388
+ return reactQuery.useMutation({
3389
+ mutationFn: ({ id, calendarId }) => arbi.calendar.moveEvent(id, calendarId),
3390
+ onSuccess: () => invalidateCalendarEvents(qc)
3391
+ });
3392
+ }
3393
+ function useRespondToEvent() {
3394
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3395
+ const qc = reactQuery.useQueryClient();
3396
+ const { write, networkMode } = useOfflineWrite();
3397
+ return reactQuery.useMutation({
3398
+ mutationFn: (params) => write({ kind: "respond", params }, () => arbi.calendar.respond(params)),
3399
+ networkMode,
3400
+ onSuccess: () => invalidateCalendarEvents(qc)
3401
+ });
3402
+ }
3403
+ function useImportCalendar() {
3404
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3405
+ const qc = reactQuery.useQueryClient();
3406
+ return reactQuery.useMutation({
3407
+ mutationFn: ({ ics, calendarId }) => arbi.calendar.importIcs(ics, calendarId),
3408
+ onSuccess: () => invalidateCalendarEvents(qc)
3409
+ });
3410
+ }
3411
+ function useShareCalendar() {
3412
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3413
+ const qc = reactQuery.useQueryClient();
3414
+ return reactQuery.useMutation({
3415
+ mutationFn: ({ calId, grantee, role }) => arbi.calendar.share(calId, grantee, role),
3416
+ onSuccess: (_d, v) => qc.invalidateQueries({ queryKey: calendarQueryKeys.shares(v.calId) })
3417
+ });
3418
+ }
3419
+ function useUnshareCalendar() {
3420
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3421
+ const qc = reactQuery.useQueryClient();
3422
+ return reactQuery.useMutation({
3423
+ mutationFn: ({ calId, userId }) => arbi.calendar.unshare(calId, userId),
3424
+ onSuccess: (_d, v) => qc.invalidateQueries({ queryKey: calendarQueryKeys.shares(v.calId) })
3425
+ });
3426
+ }
3427
+ function useSubscribeCalendar() {
3428
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3429
+ const qc = reactQuery.useQueryClient();
3430
+ return reactQuery.useMutation({
3431
+ mutationFn: (body) => arbi.calendar.subscribe(body),
3432
+ onSuccess: () => invalidateCalendars(qc)
3433
+ });
3434
+ }
3435
+ function useRefreshCalendar() {
3436
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3437
+ const qc = reactQuery.useQueryClient();
3438
+ return reactQuery.useMutation({
3439
+ mutationFn: (calId) => arbi.calendar.refresh(calId),
3440
+ onSuccess: () => invalidateCalendars(qc)
3441
+ });
3442
+ }
3443
+ function useAddHolidayCalendar() {
3444
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3445
+ const qc = reactQuery.useQueryClient();
3446
+ return reactQuery.useMutation({
3447
+ mutationFn: (body) => arbi.calendar.addHolidays(body),
3448
+ onSuccess: () => invalidateCalendars(qc)
3449
+ });
3450
+ }
3451
+ function useCreateRoom() {
3452
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3453
+ const qc = reactQuery.useQueryClient();
3454
+ return reactQuery.useMutation({
3455
+ mutationFn: (body) => arbi.calendar.createRoom(body),
3456
+ onSuccess: () => qc.invalidateQueries({ queryKey: calendarQueryKeys.allRooms() })
3457
+ });
3458
+ }
3459
+ function useFindTime() {
3460
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3461
+ return reactQuery.useMutation({ mutationFn: (body) => arbi.calendar.findTime(body) });
3462
+ }
3463
+ function useDecideCounter() {
3464
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3465
+ const qc = reactQuery.useQueryClient();
3466
+ return reactQuery.useMutation({
3467
+ mutationFn: ({
3468
+ id,
3469
+ accept,
3470
+ comment
3471
+ }) => arbi.calendar.decideCounter(id, accept, comment),
3472
+ onSuccess: () => invalidateCalendarEvents(qc)
3473
+ });
3474
+ }
3475
+ function usePublishCalendar() {
3476
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3477
+ const qc = reactQuery.useQueryClient();
3478
+ return reactQuery.useMutation({
3479
+ mutationFn: ({ accountId, calendarId }) => arbi.calendar.publishToAccount(accountId, calendarId),
3480
+ onSuccess: () => {
3481
+ void invalidateCalendars(qc);
3482
+ void qc.invalidateQueries({ queryKey: calendarQueryKeys.accounts() });
3483
+ }
3484
+ });
3485
+ }
3486
+ function invalidateAccounts(qc) {
3487
+ return Promise.all([
3488
+ qc.invalidateQueries({ queryKey: calendarQueryKeys.accounts() }),
3489
+ qc.invalidateQueries({ queryKey: calendarQueryKeys.calendars() }),
3490
+ qc.invalidateQueries({ queryKey: calendarQueryKeys.events() })
3491
+ ]);
3492
+ }
3493
+ function useCalendarAccounts(enabled = true) {
3494
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3495
+ return reactQuery.useQuery({
3496
+ queryKey: calendarQueryKeys.accounts(),
3497
+ queryFn: () => arbi.calendar.listAccounts(),
3498
+ enabled: enabled && arbi.isLoggedIn,
3499
+ staleTime: 3e4,
3500
+ retry: false
3501
+ });
3502
+ }
3503
+ function useCalDavProfiles(enabled = true) {
3504
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3505
+ return reactQuery.useQuery({
3506
+ queryKey: calendarQueryKeys.caldavProfiles(),
3507
+ queryFn: () => arbi.calendar.listCalDavProfiles(),
3508
+ enabled: enabled && arbi.isLoggedIn,
3509
+ staleTime: 10 * 6e4,
3510
+ retry: false
3511
+ });
3512
+ }
3513
+ async function connectOAuthCalendarAccount(arbi, connectors, kind, backgroundSync = false) {
3514
+ try {
3515
+ return await arbi.calendar.connectOAuthAccount(kind, backgroundSync);
3516
+ } catch (err) {
3517
+ if (!(err instanceof browser.ArbiApiError) || err.status !== 401 || !connectors) throw err;
3518
+ await connectors.bridge(browser.ACCOUNT_VENDOR[kind]);
3519
+ return arbi.calendar.connectOAuthAccount(kind, backgroundSync);
3520
+ }
3521
+ }
3522
+ function useConnectOAuthAccount() {
3523
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3524
+ const { connectors } = useCalendarSupport();
3525
+ const qc = reactQuery.useQueryClient();
3526
+ return reactQuery.useMutation({
3527
+ mutationFn: ({ kind, backgroundSync }) => connectOAuthCalendarAccount(arbi, connectors, kind, !!backgroundSync),
3528
+ onSuccess: () => invalidateAccounts(qc)
3529
+ });
3530
+ }
3531
+ function useConnectCalDavAccount() {
3532
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3533
+ const qc = reactQuery.useQueryClient();
3534
+ return reactQuery.useMutation({
3535
+ mutationFn: (body) => arbi.calendar.connectCalDavAccount(body),
3536
+ onSuccess: () => invalidateAccounts(qc)
3537
+ });
3538
+ }
3539
+ function useUpdateCalendarAccount() {
3540
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3541
+ const qc = reactQuery.useQueryClient();
3542
+ return reactQuery.useMutation({
3543
+ mutationFn: ({ id, backgroundSync }) => arbi.calendar.updateAccount(id, backgroundSync),
3544
+ onSuccess: () => invalidateAccounts(qc)
3545
+ });
3546
+ }
3547
+ function useSyncCalendarAccount() {
3548
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3549
+ const qc = reactQuery.useQueryClient();
3550
+ return reactQuery.useMutation({
3551
+ mutationFn: (id) => arbi.calendar.syncAccount(id),
3552
+ onSettled: () => invalidateAccounts(qc)
3553
+ });
3554
+ }
3555
+ function useDisconnectCalendarAccount() {
3556
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3557
+ const qc = reactQuery.useQueryClient();
3558
+ return reactQuery.useMutation({
3559
+ mutationFn: (id) => arbi.calendar.disconnectAccount(id),
3560
+ onSuccess: () => invalidateAccounts(qc)
3561
+ });
3562
+ }
3563
+ var PENDING_CONNECT_KEY = "arbi-calendar-pending-account-connect";
3564
+ function readPendingConnect() {
3565
+ try {
3566
+ const raw = window.sessionStorage.getItem(PENDING_CONNECT_KEY);
3567
+ if (!raw) return null;
3568
+ const value = JSON.parse(raw);
3569
+ if (!value || Date.now() - value.at > 30 * 6e4) return null;
3570
+ return value;
3571
+ } catch {
3572
+ return null;
3573
+ }
3574
+ }
3575
+ function clearPendingConnect() {
3576
+ try {
3577
+ window.sessionStorage.removeItem(PENDING_CONNECT_KEY);
3578
+ } catch {
3579
+ }
3580
+ }
3581
+ function useStartCalendarAccountOAuth() {
3582
+ const { connectors, oauthReturnPath } = useCalendarSupport();
3583
+ if (!connectors) return void 0;
3584
+ return async (kind, backgroundSync = false) => {
3585
+ try {
3586
+ window.sessionStorage.setItem(
3587
+ PENDING_CONNECT_KEY,
3588
+ JSON.stringify({ kind, backgroundSync, at: Date.now() })
3589
+ );
3590
+ } catch {
3591
+ }
3592
+ const returnPath = oauthReturnPath ?? `${window.location.pathname}${window.location.search}`;
3593
+ window.location.assign(await connectors.authorize(browser.ACCOUNT_VENDOR[kind], returnPath));
3594
+ };
3595
+ }
3596
+ function useResumeCalendarAccountConnect(onDone) {
3597
+ const { connectors } = useCalendarSupport();
3598
+ const connect = useConnectOAuthAccount();
3599
+ const started = React.useRef(false);
3600
+ React.useEffect(() => {
3601
+ if (started.current || !connectors) return;
3602
+ const pending = readPendingConnect();
3603
+ if (!pending) return;
3604
+ let live = true;
3605
+ void connectors.connectedVendors().then((vendors) => {
3606
+ if (!live || started.current || !vendors.includes(browser.ACCOUNT_VENDOR[pending.kind])) return;
3607
+ started.current = true;
3608
+ clearPendingConnect();
3609
+ connect.mutate(
3610
+ { kind: pending.kind, backgroundSync: pending.backgroundSync },
3611
+ {
3612
+ onSuccess: (account) => onDone?.({ account }),
3613
+ onError: (error) => onDone?.({ error })
3614
+ }
3615
+ );
3616
+ }).catch(() => {
3617
+ });
3618
+ return () => {
3619
+ live = false;
3620
+ };
3621
+ }, [connectors]);
3622
+ return connect;
3623
+ }
3624
+ var syncedThisSession = /* @__PURE__ */ new Set();
3625
+ function resetCalendarAccountSyncState() {
3626
+ syncedThisSession.clear();
3627
+ }
3628
+ function useSyncAccountsOnOpen(enabled = true) {
3629
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3630
+ const { data: accounts } = useCalendarAccounts(enabled);
3631
+ const qc = reactQuery.useQueryClient();
3632
+ const [syncing, setSyncing] = React.useState(false);
3633
+ React.useEffect(() => {
3634
+ if (!enabled || !accounts?.length) return;
3635
+ const due = accounts.filter((a) => !syncedThisSession.has(a.id));
3636
+ if (!due.length) return;
3637
+ for (const a of due) syncedThisSession.add(a.id);
3638
+ setSyncing(true);
3639
+ void Promise.allSettled(due.map((a) => arbi.calendar.syncAccount(a.id))).then(() => {
3640
+ setSyncing(false);
3641
+ void invalidateAccounts(qc);
3642
+ });
3643
+ }, [enabled, accounts, arbi, qc]);
3644
+ return { syncing };
3645
+ }
3646
+ function useAppPasswords(enabled = true) {
3647
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3648
+ return reactQuery.useQuery({
3649
+ queryKey: calendarQueryKeys.appPasswords(),
3650
+ queryFn: () => arbi.calendar.listAppPasswords(),
3651
+ enabled: enabled && arbi.isLoggedIn,
3652
+ staleTime: 3e4,
3653
+ retry: false
3654
+ });
3655
+ }
3656
+ function useInvalidateAppPasswords() {
3657
+ const qc = reactQuery.useQueryClient();
3658
+ return () => qc.invalidateQueries({ queryKey: calendarQueryKeys.appPasswords() });
3659
+ }
3660
+ function useCreateAppPassword() {
3661
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3662
+ const invalidate = useInvalidateAppPasswords();
3663
+ return reactQuery.useMutation({
3664
+ mutationFn: (body) => arbi.calendar.createAppPassword(body),
3665
+ onSuccess: () => invalidate()
3666
+ });
3667
+ }
3668
+ function useCreateFeed() {
3669
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3670
+ const invalidate = useInvalidateAppPasswords();
3671
+ return reactQuery.useMutation({
3672
+ mutationFn: (body) => arbi.calendar.createFeed(body),
3673
+ onSuccess: () => invalidate()
3674
+ });
3675
+ }
3676
+ function useRevokeAppPassword() {
3677
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3678
+ const invalidate = useInvalidateAppPasswords();
3679
+ return reactQuery.useMutation({
3680
+ mutationFn: (id) => arbi.calendar.revokeAppPassword(id),
3681
+ onSuccess: () => invalidate()
3682
+ });
3683
+ }
3684
+ function useBookingPages(enabled = true) {
3685
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3686
+ return reactQuery.useQuery({
3687
+ queryKey: calendarQueryKeys.bookingPages(),
3688
+ queryFn: () => arbi.calendar.listBookingPages(),
3689
+ enabled: enabled && arbi.isLoggedIn,
3690
+ staleTime: 3e4,
3691
+ retry: false
3692
+ });
3693
+ }
3694
+ function useSaveBookingPage() {
3695
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3696
+ const qc = reactQuery.useQueryClient();
3697
+ return reactQuery.useMutation({
3698
+ mutationFn: (body) => arbi.calendar.putBookingPage(body),
3699
+ onSuccess: () => qc.invalidateQueries({ queryKey: calendarQueryKeys.bookingPages() })
3700
+ });
3701
+ }
3702
+ function useDeleteBookingPage() {
3703
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
3704
+ const qc = reactQuery.useQueryClient();
3705
+ return reactQuery.useMutation({
3706
+ mutationFn: (slug) => arbi.calendar.deleteBookingPage(slug),
3707
+ onSuccess: () => qc.invalidateQueries({ queryKey: calendarQueryKeys.bookingPages() })
3708
+ });
3709
+ }
3015
3710
  function useWorkspaceDocs(workspaceId) {
3016
- const { data: docs = [], isLoading, isError } = chunkG7NSGLUA_cjs.useDocuments(workspaceId);
3711
+ const { data: docs = [], isLoading, isError } = chunkQXGGFMMX_cjs.useDocuments(workspaceId);
3017
3712
  const docIds = React.useMemo(
3018
3713
  () => docs.map((d) => d.external_id).filter((id) => !!id),
3019
3714
  [docs]
@@ -3021,7 +3716,7 @@ function useWorkspaceDocs(workspaceId) {
3021
3716
  return { wsId: workspaceId, docs, docIds, isLoading, isError, ready: docIds.length > 0 };
3022
3717
  }
3023
3718
  function useAiTask() {
3024
- const mutation = chunkG7NSGLUA_cjs.useAssistantQuery();
3719
+ const mutation = chunkQXGGFMMX_cjs.useAssistantQuery();
3025
3720
  const [status, setStatus] = React.useState("idle");
3026
3721
  const [text, setText] = React.useState("");
3027
3722
  const [stepCount, setStepCount] = React.useState(0);
@@ -3641,8 +4336,8 @@ function DocumentReview({
3641
4336
  onClose,
3642
4337
  className
3643
4338
  }) {
3644
- const parsedQuery = chunkG7NSGLUA_cjs.useParsedDocument(docId, stage);
3645
- const tagsQuery = chunkG7NSGLUA_cjs.useTags(workspaceId);
4339
+ const parsedQuery = chunkQXGGFMMX_cjs.useParsedDocument(docId, stage);
4340
+ const tagsQuery = chunkQXGGFMMX_cjs.useTags(workspaceId);
3646
4341
  const tagNameById = React__default.default.useMemo(() => {
3647
4342
  const map = /* @__PURE__ */ new Map();
3648
4343
  for (const t of tagsQuery.data ?? []) {
@@ -3873,7 +4568,7 @@ function SemanticSearch({
3873
4568
  const { results, status, error, search, isRunning, query } = useSemanticSearch(docIds);
3874
4569
  const [value, setValue] = React.useState("");
3875
4570
  const [selected, setSelected] = React.useState(null);
3876
- const { data: docs = [] } = chunkG7NSGLUA_cjs.useDocuments(workspaceId, { enabled: !!workspaceId });
4571
+ const { data: docs = [] } = chunkQXGGFMMX_cjs.useDocuments(workspaceId, { enabled: !!workspaceId });
3877
4572
  const docMap = React.useMemo(() => {
3878
4573
  const map = /* @__PURE__ */ new Map();
3879
4574
  for (const d of docs) if (d.external_id) map.set(d.external_id, d);
@@ -4975,7 +5670,7 @@ function ActivityFeed({
4975
5670
  enabled,
4976
5671
  "data-testid": testId = "activity-feed"
4977
5672
  }) {
4978
- const { data, isLoading, isError } = chunkG7NSGLUA_cjs.useActivity({ limit, enabled });
5673
+ const { data, isLoading, isError } = chunkQXGGFMMX_cjs.useActivity({ limit, enabled });
4979
5674
  if (isLoading) {
4980
5675
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkS6A6FSG7_cjs.cn("space-y-2", className), "data-testid": testId, "aria-busy": "true", children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 py-1.5", children: [
4981
5676
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4 shrink-0 animate-pulse rounded-full bg-muted" }),
@@ -5030,7 +5725,7 @@ function useWorkNotifications(options) {
5030
5725
  const queryKey = ["work-notifications", options.apiUrl, options.userId];
5031
5726
  const query = reactQuery.useQuery({
5032
5727
  queryKey,
5033
- queryFn: async () => (await Promise.all(workTypes.map((type) => arbi.notifications.list(type)))).flat(),
5728
+ queryFn: async () => (await Promise.all(workTypes.map((type) => arbi.notifications.list({ type })))).flat(),
5034
5729
  enabled: options.enabled && Boolean(options.userId),
5035
5730
  refetchInterval: 3e4
5036
5731
  });
@@ -5044,6 +5739,401 @@ function useWorkNotifications(options) {
5044
5739
  });
5045
5740
  return { ...query, markRead: receipt.mutateAsync };
5046
5741
  }
5742
+ function useNotifications(options = {}) {
5743
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
5744
+ const queries = reactQuery.useQueryClient();
5745
+ const limit = options.limit ?? 100;
5746
+ const ws = React.useContext(ArbiWsContext);
5747
+ React.useEffect(
5748
+ () => ws?.subscribe((message) => {
5749
+ if ("sender" in message && "recipient" in message)
5750
+ void queries.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.allNotifications() });
5751
+ }),
5752
+ [ws, queries]
5753
+ );
5754
+ return reactQuery.useQuery({
5755
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.notifications(limit),
5756
+ queryFn: () => arbi.notifications.list({ limit }),
5757
+ enabled: (options.enabled ?? true) && arbi.isLoggedIn
5758
+ });
5759
+ }
5760
+ function useDeleteNotifications() {
5761
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
5762
+ const queries = reactQuery.useQueryClient();
5763
+ return reactQuery.useMutation({
5764
+ mutationFn: (ids) => arbi.notifications.delete(ids),
5765
+ onSuccess: () => queries.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.allNotifications() })
5766
+ });
5767
+ }
5768
+ function useMarkNotificationsRead() {
5769
+ const arbi = chunkR2MF7YCW_cjs.useArbi();
5770
+ const queries = reactQuery.useQueryClient();
5771
+ return reactQuery.useMutation({
5772
+ mutationFn: (ids) => arbi.notifications.markRead(ids),
5773
+ onSuccess: () => queries.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.allNotifications() })
5774
+ });
5775
+ }
5776
+
5777
+ // src/notifications/server-notifications.ts
5778
+ function notificationUserName(user) {
5779
+ return [user.given_name, user.family_name].filter(Boolean).join(" ") || user.email;
5780
+ }
5781
+ var CONVERSATION_ID = /^con-[a-zA-Z0-9]+$/;
5782
+ var DOCUMENT_ID = /^doc-[a-zA-Z0-9]+$/;
5783
+ function parse(content) {
5784
+ try {
5785
+ const value = JSON.parse(content || "{}");
5786
+ return value && typeof value === "object" ? value : null;
5787
+ } catch {
5788
+ return null;
5789
+ }
5790
+ }
5791
+ function inputRequestTitle(content) {
5792
+ const metadata = parse(content);
5793
+ if (!metadata) return "ARBI needs your input \u2014 open the thread to reply";
5794
+ const timeout = typeof metadata.timeout_seconds === "number" ? metadata.timeout_seconds : 300;
5795
+ const minutes = Math.ceil(timeout / 60);
5796
+ const deadline = typeof metadata.expires_at === "string" ? new Date(metadata.expires_at) : null;
5797
+ if (deadline && Number.isFinite(deadline.getTime())) {
5798
+ return `ARBI needs your input \u2014 ${minutes} min to reply (until ${deadline.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })})`;
5799
+ }
5800
+ return `ARBI needs your input \u2014 ${minutes} min to reply`;
5801
+ }
5802
+ function documentActivityMeta(content) {
5803
+ const meta = parse(content);
5804
+ if (!meta) return {};
5805
+ const documentId = typeof meta.doc_ext_id === "string" && DOCUMENT_ID.test(meta.doc_ext_id) ? meta.doc_ext_id : void 0;
5806
+ const version = typeof meta.version === "number" && Number.isInteger(meta.version) && meta.version > 0 ? meta.version : void 0;
5807
+ const reason = typeof meta.reason === "string" ? meta.reason : void 0;
5808
+ return { documentId, reason, version };
5809
+ }
5810
+ function documentActivityPhrase(content) {
5811
+ const { reason, version } = documentActivityMeta(content);
5812
+ if (reason === "signed") return "signed a document";
5813
+ return version ? `saved version ${version} of a document` : "saved a new version of a document";
5814
+ }
5815
+ function docxMentionMeta(content) {
5816
+ const meta = parse(content);
5817
+ if (!meta || typeof meta.document_id !== "string" || !DOCUMENT_ID.test(meta.document_id))
5818
+ return {};
5819
+ return {
5820
+ documentId: meta.document_id,
5821
+ commentId: typeof meta.comment_id === "string" && meta.comment_id ? meta.comment_id : void 0
5822
+ };
5823
+ }
5824
+ function signatureRequestMeta(content) {
5825
+ const meta = parse(content);
5826
+ if (!meta) return {};
5827
+ const documentId = typeof meta.document_id === "string" && DOCUMENT_ID.test(meta.document_id) ? meta.document_id : void 0;
5828
+ const version = typeof meta.signed_version === "number" && Number.isInteger(meta.signed_version) ? meta.signed_version : void 0;
5829
+ return { documentId, version };
5830
+ }
5831
+ var SIGNATURE_NOTIFICATION_TYPES = [
5832
+ "signature_requested",
5833
+ "signature_completed",
5834
+ "signature_declined"
5835
+ ];
5836
+ function isSignatureNotificationType(type) {
5837
+ return SIGNATURE_NOTIFICATION_TYPES.includes(type ?? "");
5838
+ }
5839
+ function signatureNotificationPhrase(type, incoming) {
5840
+ if (incoming) {
5841
+ switch (type) {
5842
+ case "signature_requested":
5843
+ return { lead: "", showPerson: true, verb: "asked you to sign", tail: "" };
5844
+ case "signature_completed":
5845
+ return { lead: "", showPerson: true, verb: "signed", tail: " \u2014 everyone has now signed" };
5846
+ case "signature_declined":
5847
+ return { lead: "", showPerson: true, verb: "declined to sign", tail: "" };
5848
+ }
5849
+ }
5850
+ switch (type) {
5851
+ case "signature_requested":
5852
+ return { lead: "You asked", showPerson: true, verb: "to sign", tail: "" };
5853
+ case "signature_completed":
5854
+ return { lead: "You signed", showPerson: false, verb: "", tail: " \u2014 everyone has now signed" };
5855
+ case "signature_declined":
5856
+ return { lead: "You declined to sign", showPerson: false, verb: "", tail: "" };
5857
+ }
5858
+ }
5859
+ function callNotificationMeta(content) {
5860
+ const meta = parse(content);
5861
+ return {
5862
+ callExtId: typeof meta?.call_ext_id === "string" && /^call-[a-zA-Z0-9]{8}$/.test(meta.call_ext_id) ? meta.call_ext_id : void 0
5863
+ };
5864
+ }
5865
+ var BOX_SEAT_REFUSED = "box_seat_refused";
5866
+ var BOX_SEAT_REFUSED_TITLE = "Invitation not sent: your Box has no seat left. Your Box admins have been notified and can add users in the ARBI portal.";
5867
+ var BOX_SEAT_REFUSED_ACTION = "Open the ARBI portal";
5868
+ function isDeploymentUserNotification(type) {
5869
+ return type === "deployment_user_invited" || type === "deployment_user_registered";
5870
+ }
5871
+ var ALLOWED_PORTAL_ORIGINS = ["https://portal.arbicity.com"];
5872
+ function safePortalUrl(value, origins = ALLOWED_PORTAL_ORIGINS) {
5873
+ if (typeof value !== "string") return void 0;
5874
+ try {
5875
+ const url = new URL(value);
5876
+ if (url.protocol !== "https:" || !origins.includes(url.origin)) return void 0;
5877
+ return url.href;
5878
+ } catch {
5879
+ return void 0;
5880
+ }
5881
+ }
5882
+ function deploymentUserMeta(content, origins = ALLOWED_PORTAL_ORIGINS) {
5883
+ const meta = parse(content);
5884
+ if (!meta) return { external: false };
5885
+ const email = typeof meta.email === "string" && meta.email.trim() ? meta.email.trim() : void 0;
5886
+ return {
5887
+ email,
5888
+ external: meta.user_type === "external",
5889
+ portalUrl: safePortalUrl(meta.portal_url, origins)
5890
+ };
5891
+ }
5892
+ function documentDisplayName(doc) {
5893
+ return doc?.doc_metadata?.title || doc?.file_name || void 0;
5894
+ }
5895
+ var WORK_NOTIFICATION_LABELS = {
5896
+ conversation_ready: "A task is ready",
5897
+ conversation_done: "A task was marked done",
5898
+ conversation_notified: "You were notified in a thread",
5899
+ workflow_failed: "A workflow failed to run"
5900
+ };
5901
+ function conversationTarget(n) {
5902
+ if (!n.conversation_ext_id || !CONVERSATION_ID.test(n.conversation_ext_id)) return void 0;
5903
+ return {
5904
+ kind: "conversation",
5905
+ workspaceId: n.workspace_ext_id ?? void 0,
5906
+ conversationId: n.conversation_ext_id,
5907
+ ...n.message_ext_id ? { messageId: n.message_ext_id } : {}
5908
+ };
5909
+ }
5910
+ function signatureTitle(n, senderName, documentName) {
5911
+ const type = n.type;
5912
+ const { documentId } = signatureRequestMeta(n.content);
5913
+ const name = documentId ? documentName?.(n.workspace_ext_id, documentId) : void 0;
5914
+ const fallback = type === "signature_requested" ? "a document" : "your document";
5915
+ const { verb, tail } = signatureNotificationPhrase(type, true);
5916
+ return `${senderName} ${verb} ${name ?? fallback}${tail}`;
5917
+ }
5918
+ function quotaPercent(type) {
5919
+ if (type === "quota_threshold_100") return 100;
5920
+ if (type === "quota_threshold_90") return 90;
5921
+ if (type === "quota_threshold_50") return 50;
5922
+ return null;
5923
+ }
5924
+ function describeServerNotification(n, options = {}) {
5925
+ const senderName = options.senderName ?? notificationUserName(n.sender);
5926
+ const workspace = n.workspace_ext_id ? { kind: "workspace", workspaceId: n.workspace_ext_id } : void 0;
5927
+ const type = n.type;
5928
+ if (type === BOX_SEAT_REFUSED) {
5929
+ return {
5930
+ title: BOX_SEAT_REFUSED_TITLE,
5931
+ variant: "warning",
5932
+ actionLabel: BOX_SEAT_REFUSED_ACTION,
5933
+ target: { kind: "seats" }
5934
+ };
5935
+ }
5936
+ const pct = quotaPercent(type);
5937
+ if (pct !== null) {
5938
+ return {
5939
+ title: `You have used ${pct}% of your daily AI limit for this project.`,
5940
+ variant: pct === 100 ? "error" : pct === 90 ? "warning" : "info",
5941
+ target: { kind: "projects" }
5942
+ };
5943
+ }
5944
+ switch (type) {
5945
+ case "call_missed":
5946
+ return {
5947
+ title: `Missed call from ${senderName}`,
5948
+ variant: "warning",
5949
+ actionLabel: "Call back",
5950
+ target: { kind: "call-back", user: n.sender }
5951
+ };
5952
+ case "native_mail_received":
5953
+ return {
5954
+ title: "New email in your encrypted inbox",
5955
+ variant: "info",
5956
+ target: { kind: "mail" }
5957
+ };
5958
+ case "mail_draft_ready": {
5959
+ const draftId = mailDraftIdFromContent(n.content);
5960
+ return {
5961
+ title: `${senderName} left a draft email for you to review`,
5962
+ variant: "info",
5963
+ target: { kind: "mail", ...draftId ? { draftId } : {} }
5964
+ };
5965
+ }
5966
+ case "workspaceuser_added_owner":
5967
+ return { title: `${senderName} added you as owner`, variant: "info", target: workspace };
5968
+ case "workspaceuser_added_collaborator":
5969
+ return {
5970
+ title: `${senderName} added you as collaborator`,
5971
+ variant: "info",
5972
+ target: workspace
5973
+ };
5974
+ case "workspaceuser_added_guest":
5975
+ return { title: `${senderName} added you as guest`, variant: "info", target: workspace };
5976
+ case "workspaceuser_removed":
5977
+ return { title: `${senderName} removed you from a workspace`, variant: "warning" };
5978
+ case "workspaceuser_updated_owner":
5979
+ return {
5980
+ title: `${senderName} changed your role to owner`,
5981
+ variant: "info",
5982
+ target: workspace
5983
+ };
5984
+ case "workspaceuser_updated_collaborator":
5985
+ return {
5986
+ title: `${senderName} changed your role to collaborator`,
5987
+ variant: "info",
5988
+ target: workspace
5989
+ };
5990
+ case "workspaceuser_updated_guest":
5991
+ return {
5992
+ title: `${senderName} changed your role to guest`,
5993
+ variant: "info",
5994
+ target: workspace
5995
+ };
5996
+ case "signature_requested":
5997
+ case "signature_completed":
5998
+ case "signature_declined": {
5999
+ const { documentId, version } = signatureRequestMeta(n.content);
6000
+ return {
6001
+ title: signatureTitle(n, senderName, options.documentName),
6002
+ variant: type === "signature_completed" ? "success" : type === "signature_declined" ? "warning" : "info",
6003
+ actionLabel: type === "signature_requested" ? "Review and sign" : "Open",
6004
+ // A request opens the current version on its PDF, where the banner offers "Review and
6005
+ // sign"; a completed request opens the signed copy.
6006
+ target: documentId ? {
6007
+ kind: "document",
6008
+ workspaceId: n.workspace_ext_id ?? void 0,
6009
+ documentId,
6010
+ ...version ? { version } : {},
6011
+ tab: "pdf"
6012
+ } : void 0
6013
+ };
6014
+ }
6015
+ case "docx_mention": {
6016
+ const { documentId, commentId } = docxMentionMeta(n.content);
6017
+ return {
6018
+ title: `${senderName} mentioned you in a document comment`,
6019
+ variant: "info",
6020
+ target: documentId ? {
6021
+ kind: "document",
6022
+ workspaceId: n.workspace_ext_id ?? void 0,
6023
+ documentId,
6024
+ ...commentId ? { commentId } : {}
6025
+ } : void 0
6026
+ };
6027
+ }
6028
+ case "agent_input_requested":
6029
+ return { title: inputRequestTitle(n.content), variant: "info", target: conversationTarget(n) };
6030
+ case "mention":
6031
+ return {
6032
+ title: `${senderName} mentioned you in a conversation`,
6033
+ variant: "info",
6034
+ target: conversationTarget(n)
6035
+ };
6036
+ case "thread_reply":
6037
+ return {
6038
+ title: `${senderName} replied in a thread`,
6039
+ variant: "info",
6040
+ target: conversationTarget(n)
6041
+ };
6042
+ case "document_activity": {
6043
+ const { documentId, version } = documentActivityMeta(n.content);
6044
+ return {
6045
+ title: `${senderName} ${documentActivityPhrase(n.content)}`,
6046
+ variant: "info",
6047
+ target: documentId ? {
6048
+ kind: "document",
6049
+ workspaceId: n.workspace_ext_id ?? void 0,
6050
+ documentId,
6051
+ ...version ? { version } : {}
6052
+ } : void 0
6053
+ };
6054
+ }
6055
+ // Each of these opens the thread, so the person it is for finds it. One about your own thread
6056
+ // (you started the work) says so.
6057
+ case "conversation_ready":
6058
+ return {
6059
+ title: n.sender.external_id === n.recipient.external_id ? "Your thread is ready" : `${senderName}\u2019s thread is ready`,
6060
+ variant: "info",
6061
+ target: conversationTarget(n)
6062
+ };
6063
+ case "conversation_notified":
6064
+ return {
6065
+ title: `${senderName} notified you in a thread`,
6066
+ variant: "info",
6067
+ target: conversationTarget(n)
6068
+ };
6069
+ case "conversation_done":
6070
+ return {
6071
+ title: `${senderName} marked a thread done`,
6072
+ variant: "success",
6073
+ target: conversationTarget(n)
6074
+ };
6075
+ case "workflow_completed": {
6076
+ const workflowId = parse(n.content)?.workflow_ext_id;
6077
+ return {
6078
+ title: "A workflow completed",
6079
+ variant: "success",
6080
+ target: {
6081
+ kind: "workflows",
6082
+ ...typeof workflowId === "string" ? { workflowId } : {}
6083
+ }
6084
+ };
6085
+ }
6086
+ case "workflow_failed":
6087
+ return {
6088
+ title: "A workflow failed to start",
6089
+ variant: "error",
6090
+ target: { kind: "workflows" }
6091
+ };
6092
+ case "deployment_user_invited":
6093
+ case "deployment_user_registered": {
6094
+ const { email, external, portalUrl } = deploymentUserMeta(n.content, options.portalOrigins);
6095
+ const suffix = external ? " \xB7 External" : "";
6096
+ return {
6097
+ title: type === "deployment_user_invited" ? `${senderName} invited ${email ?? "a new user"}${suffix}` : `${email ?? senderName} joined${suffix}`,
6098
+ variant: "info",
6099
+ ...portalUrl && {
6100
+ actionLabel: "Manage users",
6101
+ target: { kind: "url", url: portalUrl }
6102
+ }
6103
+ };
6104
+ }
6105
+ case "contact_accepted":
6106
+ return { title: `${senderName} joined the platform`, variant: "success", target: workspace };
6107
+ case "workspace_access_request":
6108
+ return {
6109
+ title: `${senderName} asked for workspace access`,
6110
+ variant: "info",
6111
+ // Straight into the review — granting needs a workspace choice and a role, so a bare
6112
+ // "grant" action could never be right here.
6113
+ target: { kind: "access-request", notification: n }
6114
+ };
6115
+ case "storage_quota_exceeded":
6116
+ return {
6117
+ title: "Your storage is full. Mail still arrives, but new uploads and attachments are paused until you free space or add storage.",
6118
+ variant: "error",
6119
+ target: { kind: "storage" }
6120
+ };
6121
+ case "signup_reward":
6122
+ return {
6123
+ title: n.content ? `\u{1F389} Signup bonus \u2014 ${n.content}` : "\u{1F389} You earned a signup bonus!",
6124
+ variant: "success",
6125
+ target: { kind: "projects" }
6126
+ };
6127
+ case "referral_reward":
6128
+ return {
6129
+ title: n.content ? `\u{1F381} Reward \u2014 ${n.content}` : "\u{1F381} You earned a reward!",
6130
+ variant: "success",
6131
+ target: { kind: "projects" }
6132
+ };
6133
+ default:
6134
+ return null;
6135
+ }
6136
+ }
5047
6137
 
5048
6138
  // src/directmessages/utils.ts
5049
6139
  function userInitials(user) {
@@ -5133,7 +6223,7 @@ function useDirectMessages(options) {
5133
6223
  enabled
5134
6224
  });
5135
6225
  const contactsQuery = reactQuery.useQuery({
5136
- queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.contacts(),
6226
+ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.contacts(),
5137
6227
  queryFn: () => arbi.contacts.list(),
5138
6228
  enabled
5139
6229
  });
@@ -5335,7 +6425,7 @@ function ConversationList({
5335
6425
  children: c.subtitle ?? preview
5336
6426
  }
5337
6427
  ),
5338
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: lastMessage ? chunk6PPWZILQ_cjs.formatRelativeTime(lastMessage.createdAt) : "" })
6428
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: lastMessage ? chunkKLPY2HUC_cjs.formatRelativeTime(lastMessage.createdAt) : "" })
5339
6429
  ] })
5340
6430
  ] })
5341
6431
  ] });
@@ -5419,7 +6509,7 @@ function MessageBubble({
5419
6509
  isLastOfRun,
5420
6510
  senderName: message.isMine ? "You" : userDisplayName(message.sender),
5421
6511
  classNames,
5422
- formatTimestamp: chunk6PPWZILQ_cjs.formatRelativeTime
6512
+ formatTimestamp: chunkKLPY2HUC_cjs.formatRelativeTime
5423
6513
  }
5424
6514
  );
5425
6515
  }
@@ -6402,10 +7492,10 @@ function DocumentTable({
6402
7492
  extraColumns,
6403
7493
  className
6404
7494
  }) {
6405
- const query = chunkG7NSGLUA_cjs.useDocuments(workspaceId, { enabled: !documents });
7495
+ const query = chunkQXGGFMMX_cjs.useDocuments(workspaceId, { enabled: !documents });
6406
7496
  const rows = documents ?? query.data ?? [];
6407
7497
  const isLoading = !documents && query.isLoading;
6408
- const tagsQuery = chunkG7NSGLUA_cjs.useTags(workspaceId);
7498
+ const tagsQuery = chunkQXGGFMMX_cjs.useTags(workspaceId);
6409
7499
  const tagNameById = React__default.default.useMemo(() => {
6410
7500
  const map = /* @__PURE__ */ new Map();
6411
7501
  for (const t of tagsQuery.data ?? []) {
@@ -6586,7 +7676,7 @@ function DocumentCardMenu({
6586
7676
  const invalidateDocuments = () => {
6587
7677
  const workspaceId = arbi.getWorkspaceId();
6588
7678
  if (workspaceId) {
6589
- void queryClient.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.documents(workspaceId) });
7679
+ void queryClient.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.documents(workspaceId) });
6590
7680
  }
6591
7681
  };
6592
7682
  const download = reactQuery.useMutation({
@@ -6685,10 +7775,10 @@ function DocumentGallery({
6685
7775
  minTileWidth = 148,
6686
7776
  className
6687
7777
  }) {
6688
- const query = chunkG7NSGLUA_cjs.useDocuments(workspaceId, { enabled: !documents });
7778
+ const query = chunkQXGGFMMX_cjs.useDocuments(workspaceId, { enabled: !documents });
6689
7779
  const rows = documents ?? query.data ?? [];
6690
7780
  const isLoading = !documents && query.isLoading;
6691
- const tagsQuery = chunkG7NSGLUA_cjs.useTags(workspaceId);
7781
+ const tagsQuery = chunkQXGGFMMX_cjs.useTags(workspaceId);
6692
7782
  const tagNameById = React__default.default.useMemo(() => {
6693
7783
  const map = /* @__PURE__ */ new Map();
6694
7784
  for (const t of tagsQuery.data ?? []) {
@@ -6700,7 +7790,7 @@ function DocumentGallery({
6700
7790
  () => rows.map((d) => d.external_id).filter((id) => !!id),
6701
7791
  [rows]
6702
7792
  );
6703
- const thumbsQuery = chunkG7NSGLUA_cjs.useThumbnails(docIds);
7793
+ const thumbsQuery = chunkQXGGFMMX_cjs.useThumbnails(docIds);
6704
7794
  const thumbs = thumbsQuery.data ?? {};
6705
7795
  const session = useArbiSessionStore();
6706
7796
  const storeSelected = useArbiSessionState((s) => s.selectedDocumentIds);
@@ -6736,7 +7826,7 @@ function DocumentGallery({
6736
7826
  setRenamingId(null);
6737
7827
  const activeWorkspace = workspaceId ?? arbi.getWorkspaceId();
6738
7828
  if (activeWorkspace) {
6739
- void queryClient.invalidateQueries({ queryKey: chunkG7NSGLUA_cjs.arbiQueryKeys.documents(activeWorkspace) });
7829
+ void queryClient.invalidateQueries({ queryKey: chunkQXGGFMMX_cjs.arbiQueryKeys.documents(activeWorkspace) });
6740
7830
  }
6741
7831
  }
6742
7832
  });
@@ -7354,115 +8444,115 @@ function hasVideoTrack(blob) {
7354
8444
 
7355
8445
  Object.defineProperty(exports, "PROJECT_CREATION_DENIED_REASON", {
7356
8446
  enumerable: true,
7357
- get: function () { return chunkG7NSGLUA_cjs.PROJECT_CREATION_DENIED_REASON; }
8447
+ get: function () { return chunkQXGGFMMX_cjs.PROJECT_CREATION_DENIED_REASON; }
7358
8448
  });
7359
8449
  Object.defineProperty(exports, "arbiMutationKeys", {
7360
8450
  enumerable: true,
7361
- get: function () { return chunkG7NSGLUA_cjs.arbiMutationKeys; }
8451
+ get: function () { return chunkQXGGFMMX_cjs.arbiMutationKeys; }
7362
8452
  });
7363
8453
  Object.defineProperty(exports, "arbiQueryKeys", {
7364
8454
  enumerable: true,
7365
- get: function () { return chunkG7NSGLUA_cjs.arbiQueryKeys; }
8455
+ get: function () { return chunkQXGGFMMX_cjs.arbiQueryKeys; }
7366
8456
  });
7367
8457
  Object.defineProperty(exports, "isUsageMetered", {
7368
8458
  enumerable: true,
7369
- get: function () { return chunkG7NSGLUA_cjs.isUsageMetered; }
8459
+ get: function () { return chunkQXGGFMMX_cjs.isUsageMetered; }
7370
8460
  });
7371
8461
  Object.defineProperty(exports, "useActivity", {
7372
8462
  enumerable: true,
7373
- get: function () { return chunkG7NSGLUA_cjs.useActivity; }
8463
+ get: function () { return chunkQXGGFMMX_cjs.useActivity; }
7374
8464
  });
7375
8465
  Object.defineProperty(exports, "useAgents", {
7376
8466
  enumerable: true,
7377
- get: function () { return chunkG7NSGLUA_cjs.useAgents; }
8467
+ get: function () { return chunkQXGGFMMX_cjs.useAgents; }
7378
8468
  });
7379
8469
  Object.defineProperty(exports, "useAssistantQuery", {
7380
8470
  enumerable: true,
7381
- get: function () { return chunkG7NSGLUA_cjs.useAssistantQuery; }
8471
+ get: function () { return chunkQXGGFMMX_cjs.useAssistantQuery; }
7382
8472
  });
7383
8473
  Object.defineProperty(exports, "useCanCreateProjects", {
7384
8474
  enumerable: true,
7385
- get: function () { return chunkG7NSGLUA_cjs.useCanCreateProjects; }
8475
+ get: function () { return chunkQXGGFMMX_cjs.useCanCreateProjects; }
7386
8476
  });
7387
8477
  Object.defineProperty(exports, "useConfigs", {
7388
8478
  enumerable: true,
7389
- get: function () { return chunkG7NSGLUA_cjs.useConfigs; }
8479
+ get: function () { return chunkQXGGFMMX_cjs.useConfigs; }
7390
8480
  });
7391
8481
  Object.defineProperty(exports, "useConversationThreads", {
7392
8482
  enumerable: true,
7393
- get: function () { return chunkG7NSGLUA_cjs.useConversationThreads; }
8483
+ get: function () { return chunkQXGGFMMX_cjs.useConversationThreads; }
7394
8484
  });
7395
8485
  Object.defineProperty(exports, "useConversations", {
7396
8486
  enumerable: true,
7397
- get: function () { return chunkG7NSGLUA_cjs.useConversations; }
8487
+ get: function () { return chunkQXGGFMMX_cjs.useConversations; }
7398
8488
  });
7399
8489
  Object.defineProperty(exports, "useCurrentUser", {
7400
8490
  enumerable: true,
7401
- get: function () { return chunkG7NSGLUA_cjs.useCurrentUser; }
8491
+ get: function () { return chunkQXGGFMMX_cjs.useCurrentUser; }
7402
8492
  });
7403
8493
  Object.defineProperty(exports, "useDeleteAgents", {
7404
8494
  enumerable: true,
7405
- get: function () { return chunkG7NSGLUA_cjs.useDeleteAgents; }
8495
+ get: function () { return chunkQXGGFMMX_cjs.useDeleteAgents; }
7406
8496
  });
7407
8497
  Object.defineProperty(exports, "useDocuments", {
7408
8498
  enumerable: true,
7409
- get: function () { return chunkG7NSGLUA_cjs.useDocuments; }
8499
+ get: function () { return chunkQXGGFMMX_cjs.useDocuments; }
7410
8500
  });
7411
8501
  Object.defineProperty(exports, "useFirmPool", {
7412
8502
  enumerable: true,
7413
- get: function () { return chunkG7NSGLUA_cjs.useFirmPool; }
8503
+ get: function () { return chunkQXGGFMMX_cjs.useFirmPool; }
7414
8504
  });
7415
8505
  Object.defineProperty(exports, "useHealth", {
7416
8506
  enumerable: true,
7417
- get: function () { return chunkG7NSGLUA_cjs.useHealth; }
8507
+ get: function () { return chunkQXGGFMMX_cjs.useHealth; }
7418
8508
  });
7419
8509
  Object.defineProperty(exports, "useParsedDocument", {
7420
8510
  enumerable: true,
7421
- get: function () { return chunkG7NSGLUA_cjs.useParsedDocument; }
8511
+ get: function () { return chunkQXGGFMMX_cjs.useParsedDocument; }
7422
8512
  });
7423
8513
  Object.defineProperty(exports, "useProjectInvoices", {
7424
8514
  enumerable: true,
7425
- get: function () { return chunkG7NSGLUA_cjs.useProjectInvoices; }
8515
+ get: function () { return chunkQXGGFMMX_cjs.useProjectInvoices; }
7426
8516
  });
7427
8517
  Object.defineProperty(exports, "useProjectUsage", {
7428
8518
  enumerable: true,
7429
- get: function () { return chunkG7NSGLUA_cjs.useProjectUsage; }
8519
+ get: function () { return chunkQXGGFMMX_cjs.useProjectUsage; }
7430
8520
  });
7431
8521
  Object.defineProperty(exports, "useProjects", {
7432
8522
  enumerable: true,
7433
- get: function () { return chunkG7NSGLUA_cjs.useProjects; }
8523
+ get: function () { return chunkQXGGFMMX_cjs.useProjects; }
7434
8524
  });
7435
8525
  Object.defineProperty(exports, "useProjectsUsage", {
7436
8526
  enumerable: true,
7437
- get: function () { return chunkG7NSGLUA_cjs.useProjectsUsage; }
8527
+ get: function () { return chunkQXGGFMMX_cjs.useProjectsUsage; }
7438
8528
  });
7439
8529
  Object.defineProperty(exports, "useTags", {
7440
8530
  enumerable: true,
7441
- get: function () { return chunkG7NSGLUA_cjs.useTags; }
8531
+ get: function () { return chunkQXGGFMMX_cjs.useTags; }
7442
8532
  });
7443
8533
  Object.defineProperty(exports, "useThumbnails", {
7444
8534
  enumerable: true,
7445
- get: function () { return chunkG7NSGLUA_cjs.useThumbnails; }
8535
+ get: function () { return chunkQXGGFMMX_cjs.useThumbnails; }
7446
8536
  });
7447
8537
  Object.defineProperty(exports, "useTopUpFirmPool", {
7448
8538
  enumerable: true,
7449
- get: function () { return chunkG7NSGLUA_cjs.useTopUpFirmPool; }
8539
+ get: function () { return chunkQXGGFMMX_cjs.useTopUpFirmPool; }
7450
8540
  });
7451
8541
  Object.defineProperty(exports, "useUserUsageToday", {
7452
8542
  enumerable: true,
7453
- get: function () { return chunkG7NSGLUA_cjs.useUserUsageToday; }
8543
+ get: function () { return chunkQXGGFMMX_cjs.useUserUsageToday; }
7454
8544
  });
7455
8545
  Object.defineProperty(exports, "useWorkspaceActivity", {
7456
8546
  enumerable: true,
7457
- get: function () { return chunkG7NSGLUA_cjs.useWorkspaceActivity; }
8547
+ get: function () { return chunkQXGGFMMX_cjs.useWorkspaceActivity; }
7458
8548
  });
7459
8549
  Object.defineProperty(exports, "useWorkspaceUsers", {
7460
8550
  enumerable: true,
7461
- get: function () { return chunkG7NSGLUA_cjs.useWorkspaceUsers; }
8551
+ get: function () { return chunkQXGGFMMX_cjs.useWorkspaceUsers; }
7462
8552
  });
7463
8553
  Object.defineProperty(exports, "useWorkspaces", {
7464
8554
  enumerable: true,
7465
- get: function () { return chunkG7NSGLUA_cjs.useWorkspaces; }
8555
+ get: function () { return chunkQXGGFMMX_cjs.useWorkspaces; }
7466
8556
  });
7467
8557
  Object.defineProperty(exports, "cleanDraftMarkdown", {
7468
8558
  enumerable: true,
@@ -7498,39 +8588,63 @@ Object.defineProperty(exports, "unwrapCitationLinks", {
7498
8588
  });
7499
8589
  Object.defineProperty(exports, "DEFAULT_NOTIFY_TONE", {
7500
8590
  enumerable: true,
7501
- get: function () { return chunk6PPWZILQ_cjs.DEFAULT_NOTIFY_TONE; }
8591
+ get: function () { return chunkKLPY2HUC_cjs.DEFAULT_NOTIFY_TONE; }
8592
+ });
8593
+ Object.defineProperty(exports, "MAX_SESSION_NOTIFICATIONS", {
8594
+ enumerable: true,
8595
+ get: function () { return chunkKLPY2HUC_cjs.MAX_SESSION_NOTIFICATIONS; }
7502
8596
  });
7503
8597
  Object.defineProperty(exports, "NotificationBell", {
7504
8598
  enumerable: true,
7505
- get: function () { return chunk6PPWZILQ_cjs.NotificationBell; }
8599
+ get: function () { return chunkKLPY2HUC_cjs.NotificationBell; }
7506
8600
  });
7507
8601
  Object.defineProperty(exports, "Toaster", {
7508
8602
  enumerable: true,
7509
- get: function () { return chunk6PPWZILQ_cjs.Toaster; }
8603
+ get: function () { return chunkKLPY2HUC_cjs.Toaster; }
8604
+ });
8605
+ Object.defineProperty(exports, "configureNotify", {
8606
+ enumerable: true,
8607
+ get: function () { return chunkKLPY2HUC_cjs.configureNotify; }
7510
8608
  });
7511
8609
  Object.defineProperty(exports, "formatRelativeTime", {
7512
8610
  enumerable: true,
7513
- get: function () { return chunk6PPWZILQ_cjs.formatRelativeTime; }
8611
+ get: function () { return chunkKLPY2HUC_cjs.formatRelativeTime; }
7514
8612
  });
7515
8613
  Object.defineProperty(exports, "notify", {
7516
8614
  enumerable: true,
7517
- get: function () { return chunk6PPWZILQ_cjs.notify; }
8615
+ get: function () { return chunkKLPY2HUC_cjs.notify; }
8616
+ });
8617
+ Object.defineProperty(exports, "persistNotifyHistory", {
8618
+ enumerable: true,
8619
+ get: function () { return chunkKLPY2HUC_cjs.persistNotifyHistory; }
7518
8620
  });
7519
8621
  Object.defineProperty(exports, "seedNotifications", {
7520
8622
  enumerable: true,
7521
- get: function () { return chunk6PPWZILQ_cjs.seedNotifications; }
8623
+ get: function () { return chunkKLPY2HUC_cjs.seedNotifications; }
7522
8624
  });
7523
8625
  Object.defineProperty(exports, "selectUnread", {
7524
8626
  enumerable: true,
7525
- get: function () { return chunk6PPWZILQ_cjs.selectUnread; }
8627
+ get: function () { return chunkKLPY2HUC_cjs.selectUnread; }
7526
8628
  });
7527
8629
  Object.defineProperty(exports, "toast", {
7528
8630
  enumerable: true,
7529
- get: function () { return chunk6PPWZILQ_cjs.toast; }
8631
+ get: function () { return chunkKLPY2HUC_cjs.toast; }
7530
8632
  });
7531
8633
  Object.defineProperty(exports, "useNotify", {
7532
8634
  enumerable: true,
7533
- get: function () { return chunk6PPWZILQ_cjs.useNotify; }
8635
+ get: function () { return chunkKLPY2HUC_cjs.useNotify; }
8636
+ });
8637
+ Object.defineProperty(exports, "ArbiProvider", {
8638
+ enumerable: true,
8639
+ get: function () { return chunkR2MF7YCW_cjs.ArbiProvider; }
8640
+ });
8641
+ Object.defineProperty(exports, "useArbi", {
8642
+ enumerable: true,
8643
+ get: function () { return chunkR2MF7YCW_cjs.useArbi; }
8644
+ });
8645
+ Object.defineProperty(exports, "useDeploymentDomain", {
8646
+ enumerable: true,
8647
+ get: function () { return chunkR2MF7YCW_cjs.useDeploymentDomain; }
7534
8648
  });
7535
8649
  Object.defineProperty(exports, "AUDIO_MIME_PREFERENCE", {
7536
8650
  enumerable: true,
@@ -8272,17 +9386,9 @@ Object.defineProperty(exports, "cn", {
8272
9386
  enumerable: true,
8273
9387
  get: function () { return chunkS6A6FSG7_cjs.cn; }
8274
9388
  });
8275
- Object.defineProperty(exports, "ArbiProvider", {
9389
+ Object.defineProperty(exports, "ACCOUNT_VENDOR", {
8276
9390
  enumerable: true,
8277
- get: function () { return chunkR2MF7YCW_cjs.ArbiProvider; }
8278
- });
8279
- Object.defineProperty(exports, "useArbi", {
8280
- enumerable: true,
8281
- get: function () { return chunkR2MF7YCW_cjs.useArbi; }
8282
- });
8283
- Object.defineProperty(exports, "useDeploymentDomain", {
8284
- enumerable: true,
8285
- get: function () { return chunkR2MF7YCW_cjs.useDeploymentDomain; }
9391
+ get: function () { return browser.ACCOUNT_VENDOR; }
8286
9392
  });
8287
9393
  Object.defineProperty(exports, "Arbi", {
8288
9394
  enumerable: true,
@@ -8296,6 +9402,18 @@ Object.defineProperty(exports, "DEFAULT_AI_USD_PER_GBP", {
8296
9402
  enumerable: true,
8297
9403
  get: function () { return browser.DEFAULT_AI_USD_PER_GBP; }
8298
9404
  });
9405
+ Object.defineProperty(exports, "PublicBookingError", {
9406
+ enumerable: true,
9407
+ get: function () { return browser.PublicBookingError; }
9408
+ });
9409
+ Object.defineProperty(exports, "bookPublicSlot", {
9410
+ enumerable: true,
9411
+ get: function () { return browser.bookPublicSlot; }
9412
+ });
9413
+ Object.defineProperty(exports, "cancelPublicBooking", {
9414
+ enumerable: true,
9415
+ get: function () { return browser.cancelPublicBooking; }
9416
+ });
8299
9417
  Object.defineProperty(exports, "formatGbp", {
8300
9418
  enumerable: true,
8301
9419
  get: function () { return browser.formatGbp; }
@@ -8304,6 +9422,14 @@ Object.defineProperty(exports, "formatGbpPerMillionTokens", {
8304
9422
  enumerable: true,
8305
9423
  get: function () { return browser.formatGbpPerMillionTokens; }
8306
9424
  });
9425
+ Object.defineProperty(exports, "getPublicBookingPage", {
9426
+ enumerable: true,
9427
+ get: function () { return browser.getPublicBookingPage; }
9428
+ });
9429
+ Object.defineProperty(exports, "splitAppPasswords", {
9430
+ enumerable: true,
9431
+ get: function () { return browser.splitAppPasswords; }
9432
+ });
8307
9433
  Object.defineProperty(exports, "usdToGbp", {
8308
9434
  enumerable: true,
8309
9435
  get: function () { return browser.usdToGbp; }
@@ -8312,6 +9438,7 @@ Object.defineProperty(exports, "isMessageType", {
8312
9438
  enumerable: true,
8313
9439
  get: function () { return client.isMessageType; }
8314
9440
  });
9441
+ exports.ALLOWED_PORTAL_ORIGINS = ALLOWED_PORTAL_ORIGINS;
8315
9442
  exports.AccountClientProvider = AccountClientProvider;
8316
9443
  exports.ActivityFeed = ActivityFeed;
8317
9444
  exports.AiActionCard = AiActionCard;
@@ -8321,6 +9448,10 @@ exports.ArbiBotIcon = ArbiBotIcon;
8321
9448
  exports.ArbiSessionStateProvider = ArbiSessionStateProvider;
8322
9449
  exports.ArbiWebSocketProvider = ArbiWebSocketProvider;
8323
9450
  exports.ArtifactCanvas = ArtifactCanvas;
9451
+ exports.BOX_SEAT_REFUSED = BOX_SEAT_REFUSED;
9452
+ exports.BOX_SEAT_REFUSED_ACTION = BOX_SEAT_REFUSED_ACTION;
9453
+ exports.BOX_SEAT_REFUSED_TITLE = BOX_SEAT_REFUSED_TITLE;
9454
+ exports.CalendarSupportProvider = CalendarSupportProvider;
8324
9455
  exports.ChatBubble = ChatBubble;
8325
9456
  exports.CitationRenderer = CitationRenderer;
8326
9457
  exports.ClaudeIcon = ClaudeIcon;
@@ -8361,24 +9492,35 @@ exports.OpenAIIcon = OpenAIIcon;
8361
9492
  exports.PhotoCapture = PhotoCapture;
8362
9493
  exports.ProviderIcon = ProviderIcon;
8363
9494
  exports.RUN_WINDOW_MS = RUN_WINDOW_MS;
9495
+ exports.SIGNATURE_NOTIFICATION_TYPES = SIGNATURE_NOTIFICATION_TYPES;
8364
9496
  exports.SemanticSearch = SemanticSearch;
8365
9497
  exports.StartByEmail = StartByEmail;
8366
9498
  exports.TypingIndicator = TypingIndicator;
8367
9499
  exports.VideoCapture = VideoCapture;
8368
9500
  exports.VoiceNoteRecorder = VoiceNoteRecorder;
9501
+ exports.WORK_NOTIFICATION_LABELS = WORK_NOTIFICATION_LABELS;
8369
9502
  exports.accountPath = accountPath;
8370
9503
  exports.aliasTakenMessage = aliasTakenMessage;
8371
9504
  exports.annotateThread = annotateThread;
8372
9505
  exports.announceMailDraftReplaced = announceMailDraftReplaced;
8373
9506
  exports.arbiAccountClient = arbiAccountClient;
8374
9507
  exports.arbiMailClient = arbiMailClient;
9508
+ exports.calendarQueryKeys = calendarQueryKeys;
9509
+ exports.callNotificationMeta = callNotificationMeta;
8375
9510
  exports.captureFrameAsBlob = captureFrameAsBlob;
9511
+ exports.connectOAuthCalendarAccount = connectOAuthCalendarAccount;
8376
9512
  exports.createArbiSessionStore = createArbiSessionStore;
8377
9513
  exports.createMailClient = createMailClient;
8378
9514
  exports.cropImage = cropImage;
8379
9515
  exports.dayKey = dayKey;
8380
9516
  exports.defaultMailAlias = defaultMailAlias;
9517
+ exports.deploymentUserMeta = deploymentUserMeta;
8381
9518
  exports.describeActivity = describeActivity;
9519
+ exports.describeServerNotification = describeServerNotification;
9520
+ exports.documentActivityMeta = documentActivityMeta;
9521
+ exports.documentActivityPhrase = documentActivityPhrase;
9522
+ exports.documentDisplayName = documentDisplayName;
9523
+ exports.docxMentionMeta = docxMentionMeta;
8382
9524
  exports.downloadRecoveryFile = downloadRecoveryFile;
8383
9525
  exports.fileAttachment = fileAttachment;
8384
9526
  exports.formatIdentityPrice = formatIdentityPrice;
@@ -8388,8 +9530,14 @@ exports.getWorkspaceKind = getWorkspaceKind;
8388
9530
  exports.getWorkspaceSentPhrase = getWorkspaceSentPhrase;
8389
9531
  exports.hasVideoTrack = hasVideoTrack;
8390
9532
  exports.identityStepFor = identityStepFor;
9533
+ exports.inputRequestTitle = inputRequestTitle;
9534
+ exports.invalidateCalendarEvents = invalidateCalendarEvents;
9535
+ exports.invalidateCalendars = invalidateCalendars;
8391
9536
  exports.invalidateTagData = invalidateTagData;
8392
9537
  exports.isAliasTakenError = isAliasTakenError;
9538
+ exports.isDeploymentUserNotification = isDeploymentUserNotification;
9539
+ exports.isQueuedCalendarWrite = isQueuedCalendarWrite;
9540
+ exports.isSignatureNotificationType = isSignatureNotificationType;
8393
9541
  exports.isWorkspaceNotificationType = isWorkspaceNotificationType;
8394
9542
  exports.mailDraftIdFromContent = mailDraftIdFromContent;
8395
9543
  exports.mailJson = mailJson;
@@ -8397,13 +9545,18 @@ exports.mailQueryKeys = mailQueryKeys;
8397
9545
  exports.mountDiditVerification = mountDiditVerification;
8398
9546
  exports.nextAliasSuggestion = nextAliasSuggestion;
8399
9547
  exports.nextViewingDocument = nextViewingDocument;
9548
+ exports.notificationUserName = notificationUserName;
8400
9549
  exports.parseActivityContent = parseActivityContent;
8401
9550
  exports.parseDeleteAccountBlockers = parseDeleteAccountBlockers;
8402
9551
  exports.pickRecentWorkspaces = pickRecentWorkspaces;
8403
9552
  exports.redlineStats = redlineStats;
9553
+ exports.resetCalendarAccountSyncState = resetCalendarAccountSyncState;
8404
9554
  exports.resolveActiveWorkspace = resolveActiveWorkspace;
9555
+ exports.safePortalUrl = safePortalUrl;
8405
9556
  exports.selectIsGenerating = selectIsGenerating;
8406
9557
  exports.selectViewingDocumentId = selectViewingDocumentId;
9558
+ exports.signatureNotificationPhrase = signatureNotificationPhrase;
9559
+ exports.signatureRequestMeta = signatureRequestMeta;
8407
9560
  exports.textToArtifact = textToArtifact;
8408
9561
  exports.titleFromQuestion = titleFromQuestion;
8409
9562
  exports.toChatCitations = toChatCitations;
@@ -8413,12 +9566,14 @@ exports.toRedlineMarkdown = toRedlineMarkdown;
8413
9566
  exports.toShellWorkspace = toShellWorkspace;
8414
9567
  exports.useAccountClient = useAccountClient;
8415
9568
  exports.useActOnStep = useActOnStep;
9569
+ exports.useAddHolidayCalendar = useAddHolidayCalendar;
8416
9570
  exports.useAgentChats = useAgentChats;
8417
9571
  exports.useAgentConfig = useAgentConfig;
8418
9572
  exports.useAgentModels = useAgentModels;
8419
9573
  exports.useAgentSession = useAgentSession;
8420
9574
  exports.useAgentWorkspaces = useAgentWorkspaces;
8421
9575
  exports.useAiTask = useAiTask;
9576
+ exports.useAppPasswords = useAppPasswords;
8422
9577
  exports.useArbiChat = useArbiChat;
8423
9578
  exports.useArbiConnected = useArbiConnected;
8424
9579
  exports.useArbiDocumentSync = useArbiDocumentSync;
@@ -8434,41 +9589,74 @@ exports.useArbiWsTask = useArbiWsTask;
8434
9589
  exports.useArbiWsTasks = useArbiWsTasks;
8435
9590
  exports.useAuthorizeLimits = useAuthorizeLimits;
8436
9591
  exports.useAvatarCrop = useAvatarCrop;
9592
+ exports.useBookingPages = useBookingPages;
9593
+ exports.useCalDavProfiles = useCalDavProfiles;
9594
+ exports.useCalendarAccounts = useCalendarAccounts;
9595
+ exports.useCalendarEvent = useCalendarEvent;
9596
+ exports.useCalendarEventByUid = useCalendarEventByUid;
9597
+ exports.useCalendarEvents = useCalendarEvents;
9598
+ exports.useCalendarInvitations = useCalendarInvitations;
9599
+ exports.useCalendarOutbox = useCalendarOutbox;
9600
+ exports.useCalendarOverlays = useCalendarOverlays;
9601
+ exports.useCalendarSettings = useCalendarSettings;
9602
+ exports.useCalendarShares = useCalendarShares;
9603
+ exports.useCalendarSupport = useCalendarSupport;
9604
+ exports.useCalendars = useCalendars;
8437
9605
  exports.useCameraStream = useCameraStream;
8438
9606
  exports.useClaimNativeAlias = useClaimNativeAlias;
8439
9607
  exports.useCloseAgentSession = useCloseAgentSession;
8440
9608
  exports.useCommandPalette = useCommandPalette;
8441
9609
  exports.useConfirmEmailChange = useConfirmEmailChange;
9610
+ exports.useConnectCalDavAccount = useConnectCalDavAccount;
8442
9611
  exports.useConnectMailAccount = useConnectMailAccount;
9612
+ exports.useConnectOAuthAccount = useConnectOAuthAccount;
8443
9613
  exports.useContacts = useContacts;
8444
9614
  exports.useConversationActivity = useConversationActivity;
8445
9615
  exports.useConversationPendingAuth = useConversationPendingAuth;
8446
9616
  exports.useConversationUsage = useConversationUsage;
8447
9617
  exports.useCreateAgent = useCreateAgent;
9618
+ exports.useCreateAppPassword = useCreateAppPassword;
9619
+ exports.useCreateCalendar = useCreateCalendar;
8448
9620
  exports.useCreateContact = useCreateContact;
9621
+ exports.useCreateEvent = useCreateEvent;
8449
9622
  exports.useCreateFact = useCreateFact;
8450
9623
  exports.useCreateFacts = useCreateFacts;
9624
+ exports.useCreateFeed = useCreateFeed;
9625
+ exports.useCreateRoom = useCreateRoom;
8451
9626
  exports.useCreateWork = useCreateWork;
8452
9627
  exports.useCreateWorkflow = useCreateWorkflow;
8453
9628
  exports.useCurrentSessionId = useCurrentSessionId;
9629
+ exports.useDecideCounter = useDecideCounter;
8454
9630
  exports.useDeleteAccount = useDeleteAccount;
8455
9631
  exports.useDeleteAccountFlow = useDeleteAccountFlow;
9632
+ exports.useDeleteBookingPage = useDeleteBookingPage;
9633
+ exports.useDeleteCalendar = useDeleteCalendar;
8456
9634
  exports.useDeleteContact = useDeleteContact;
9635
+ exports.useDeleteEvent = useDeleteEvent;
8457
9636
  exports.useDeleteFact = useDeleteFact;
9637
+ exports.useDeleteNotifications = useDeleteNotifications;
9638
+ exports.useDeleteSkill = useDeleteSkill;
8458
9639
  exports.useDeleteWorkflow = useDeleteWorkflow;
8459
9640
  exports.useDirectMessages = useDirectMessages;
9641
+ exports.useDisconnectCalendarAccount = useDisconnectCalendarAccount;
8460
9642
  exports.useDisconnectMailAccount = useDisconnectMailAccount;
8461
9643
  exports.useEmailChange = useEmailChange;
8462
9644
  exports.useFacts = useFacts;
9645
+ exports.useFetchCalendarEvent = useFetchCalendarEvent;
8463
9646
  exports.useFilteredProjects = useFilteredProjects;
9647
+ exports.useFindTime = useFindTime;
8464
9648
  exports.useFollowThread = useFollowThread;
9649
+ exports.useFreeBusy = useFreeBusy;
8465
9650
  exports.useGenerateAgentAvatar = useGenerateAgentAvatar;
8466
9651
  exports.useGrantAgentAccess = useGrantAgentAccess;
9652
+ exports.useHolidayCountries = useHolidayCountries;
8467
9653
  exports.useIdentityVerification = useIdentityVerification;
8468
9654
  exports.useIdentityVerificationFlow = useIdentityVerificationFlow;
9655
+ exports.useImportCalendar = useImportCalendar;
8469
9656
  exports.useInvalidateTagData = useInvalidateTagData;
8470
9657
  exports.useInviteContacts = useInviteContacts;
8471
9658
  exports.useMailAccounts = useMailAccounts;
9659
+ exports.useMailAttachmentText = useMailAttachmentText;
8472
9660
  exports.useMailCache = useMailCache;
8473
9661
  exports.useMailClient = useMailClient;
8474
9662
  exports.useMailDraftCompose = useMailDraftCompose;
@@ -8481,9 +9669,12 @@ exports.useMailOnline = useMailOnline;
8481
9669
  exports.useMailPolicy = useMailPolicy;
8482
9670
  exports.useMailProjects = useMailProjects;
8483
9671
  exports.useMailUnlock = useMailUnlock;
9672
+ exports.useMarkNotificationsRead = useMarkNotificationsRead;
8484
9673
  exports.useMcpTools = useMcpTools;
9674
+ exports.useMoveEvent = useMoveEvent;
8485
9675
  exports.useNameEditor = useNameEditor;
8486
9676
  exports.useNotificationPreferences = useNotificationPreferences;
9677
+ exports.useNotifications = useNotifications;
8487
9678
  exports.usePasswordChange = usePasswordChange;
8488
9679
  exports.usePasswordChangeForm = usePasswordChangeForm;
8489
9680
  exports.usePendingContacts = usePendingContacts;
@@ -8491,27 +9682,47 @@ exports.usePlanWork = usePlanWork;
8491
9682
  exports.useProfile = useProfile;
8492
9683
  exports.useProjectConversationUsage = useProjectConversationUsage;
8493
9684
  exports.useProjectEvents = useProjectEvents;
9685
+ exports.usePublishCalendar = usePublishCalendar;
9686
+ exports.useRefreshCalendar = useRefreshCalendar;
8494
9687
  exports.useRequestEmailChange = useRequestEmailChange;
9688
+ exports.useRespondToEvent = useRespondToEvent;
9689
+ exports.useResumeCalendarAccountConnect = useResumeCalendarAccountConnect;
8495
9690
  exports.useRevokeAgentAccess = useRevokeAgentAccess;
9691
+ exports.useRevokeAppPassword = useRevokeAppPassword;
9692
+ exports.useRooms = useRooms;
8496
9693
  exports.useRunConversation = useRunConversation;
8497
9694
  exports.useRunWorkflow = useRunWorkflow;
8498
9695
  exports.useSaveAgentConfig = useSaveAgentConfig;
9696
+ exports.useSaveBookingPage = useSaveBookingPage;
9697
+ exports.useSaveCalendarSettings = useSaveCalendarSettings;
8499
9698
  exports.useSaveMailDraft = useSaveMailDraft;
9699
+ exports.useSearchContacts = useSearchContacts;
8500
9700
  exports.useSearchFacts = useSearchFacts;
8501
9701
  exports.useSemanticSearch = useSemanticSearch;
8502
9702
  exports.useSendBackStep = useSendBackStep;
8503
9703
  exports.useSendMail = useSendMail;
8504
9704
  exports.useSessions = useSessions;
9705
+ exports.useSetSkillVisibility = useSetSkillVisibility;
8505
9706
  exports.useSetTagValues = useSetTagValues;
9707
+ exports.useShareCalendar = useShareCalendar;
8506
9708
  exports.useShellWorkspaces = useShellWorkspaces;
8507
9709
  exports.useSignOut = useSignOut;
9710
+ exports.useSkillSource = useSkillSource;
8508
9711
  exports.useSkills = useSkills;
8509
9712
  exports.useStartAgentSession = useStartAgentSession;
9713
+ exports.useStartCalendarAccountOAuth = useStartCalendarAccountOAuth;
8510
9714
  exports.useStartWorkQuery = useStartWorkQuery;
9715
+ exports.useSubscribeCalendar = useSubscribeCalendar;
9716
+ exports.useSyncAccountsOnOpen = useSyncAccountsOnOpen;
9717
+ exports.useSyncCalendarAccount = useSyncCalendarAccount;
8511
9718
  exports.useTagKindSchema = useTagKindSchema;
8512
9719
  exports.useTerminateSession = useTerminateSession;
9720
+ exports.useUnshareCalendar = useUnshareCalendar;
9721
+ exports.useUpdateCalendar = useUpdateCalendar;
9722
+ exports.useUpdateCalendarAccount = useUpdateCalendarAccount;
8513
9723
  exports.useUpdateContact = useUpdateContact;
8514
9724
  exports.useUpdateConversation = useUpdateConversation;
9725
+ exports.useUpdateEvent = useUpdateEvent;
8515
9726
  exports.useUpdateFact = useUpdateFact;
8516
9727
  exports.useUpdateMailMessage = useUpdateMailMessage;
8517
9728
  exports.useUpdateProfile = useUpdateProfile;