@astralbeam/sdk 0.30.7 → 0.30.8
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/README.md +3 -1
- package/dist/api.d.ts +1 -1
- package/dist/{badge-C5nSyoPM.js → badge-C-0oJPBL.js} +1 -1
- package/dist/client.d.ts +4 -0
- package/dist/client.js +3 -3
- package/dist/combobox-Dv3RPBJS.js +48 -0
- package/dist/{core-DJGoi0HX.js → core-sNbWKLab.js} +182 -46
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/{index-b-MbK0XS.d.ts → index-C9_dLp_O.d.ts} +5 -1
- package/dist/{index-BVfd2Jll.d.ts → index-Cf_9MRpM.d.ts} +2 -0
- package/dist/{item-D7P71wsB.js → item-CEtiY2lf.js} +1 -1
- package/dist/listings-BOpTUVaq.js +1 -0
- package/dist/mcp-servers-DXA0NF6Y.js +1 -0
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/{styles.generated-BrC_vo9p.js → styles.generated-D0caROd2.js} +2 -2
- package/dist/widget-CpwYlGfb.js +21 -0
- package/package.json +1 -1
- package/dist/combobox-DXIOk4hb.js +0 -42
- package/dist/listings-CwKMku_E.js +0 -1
- package/dist/mcp-servers-CQTKrhfj.js +0 -1
- package/dist/widget-DoNGl4gQ.js +0 -27
|
@@ -11113,7 +11113,8 @@ function projectThreadMessages(records, pendingInteractions = [], liveToolMessag
|
|
|
11113
11113
|
createdAt: new Date(message.created_at),
|
|
11114
11114
|
metadata: { astralbeam: {
|
|
11115
11115
|
state: message.state,
|
|
11116
|
-
authorTenantUserId: message.author_tenant_user_id
|
|
11116
|
+
authorTenantUserId: message.author_tenant_user_id,
|
|
11117
|
+
clientMessageId: message.client_message_id
|
|
11117
11118
|
} }
|
|
11118
11119
|
});
|
|
11119
11120
|
}
|
|
@@ -11132,6 +11133,9 @@ function selectedThread(key, id) {
|
|
|
11132
11133
|
}
|
|
11133
11134
|
// src/lib/drafts.ts
|
|
11134
11135
|
let draftSessionId;
|
|
11136
|
+
function chatDraftIdentity(identity, options) {
|
|
11137
|
+
return JSON.stringify([identity, chatPlacementKey(options)]);
|
|
11138
|
+
}
|
|
11135
11139
|
function draftStorageKey(apiUrl, identity, threadId) {
|
|
11136
11140
|
if (!threadId) {
|
|
11137
11141
|
if (!draftSessionId) try {
|
|
@@ -11163,12 +11167,43 @@ function storedThreadDraft(apiUrl, identity, threadId, text, slot = "draft") {
|
|
|
11163
11167
|
if (!identity) return "";
|
|
11164
11168
|
const key = `astralbeam:${slot}:${draftStorageKey(apiUrl, identity, threadId)}`;
|
|
11165
11169
|
try {
|
|
11166
|
-
|
|
11167
|
-
if (text) globalThis.localStorage?.
|
|
11168
|
-
|
|
11170
|
+
const session = slot === "sent" ? globalThis.sessionStorage : void 0;
|
|
11171
|
+
if (text === void 0) return session?.getItem(key) ?? globalThis.localStorage?.getItem(key) ?? "";
|
|
11172
|
+
if (text) (session ?? globalThis.localStorage)?.setItem(key, text);
|
|
11173
|
+
else session?.removeItem(key);
|
|
11174
|
+
if (session || !text) globalThis.localStorage?.removeItem(key);
|
|
11169
11175
|
} catch {}
|
|
11170
11176
|
return "";
|
|
11171
11177
|
}
|
|
11178
|
+
function isRecoverableContent(content) {
|
|
11179
|
+
return typeof content === "string" || typeof content.content === "string" || Array.isArray(content.content) && content.content.every((part) => part?.type === "text" ? typeof part.content === "string" : [
|
|
11180
|
+
"image",
|
|
11181
|
+
"document",
|
|
11182
|
+
"audio",
|
|
11183
|
+
"video"
|
|
11184
|
+
].includes(part?.type) && part.source?.type === "file" && typeof part.source.value === "string");
|
|
11185
|
+
}
|
|
11186
|
+
/** A dispatched send belongs to this tab and verified account, placement, API, and thread. */
|
|
11187
|
+
function storedPendingSubmission(scope, change) {
|
|
11188
|
+
if (!scope.identity || !scope.threadId) return;
|
|
11189
|
+
const key = `astralbeam:pending:${draftStorageKey(scope.apiUrl, scope.identity, scope.threadId)}`;
|
|
11190
|
+
try {
|
|
11191
|
+
const storage = globalThis.sessionStorage;
|
|
11192
|
+
if (!storage) return;
|
|
11193
|
+
if (change && "save" in change) {
|
|
11194
|
+
if (!isRecoverableContent(change.save.content)) return;
|
|
11195
|
+
storage.setItem(key, JSON.stringify(change.save));
|
|
11196
|
+
return change.save;
|
|
11197
|
+
}
|
|
11198
|
+
const pending = JSON.parse(storage.getItem(key) ?? "null");
|
|
11199
|
+
if (change) {
|
|
11200
|
+
if (pending?.key === change.clearKey) storage.removeItem(key);
|
|
11201
|
+
return;
|
|
11202
|
+
}
|
|
11203
|
+
if (!pending || typeof pending.id !== "string" || typeof pending.key !== "string" || typeof pending.clientId !== "string" || !pending.content || !isRecoverableContent(pending.content) || !Number.isFinite(pending.dispatchedAt) || !Array.isArray(pending.tools) || pending.draftFileIds !== void 0 && (!Array.isArray(pending.draftFileIds) || !pending.draftFileIds.every((id) => typeof id === "string"))) return;
|
|
11204
|
+
return pending;
|
|
11205
|
+
} catch {}
|
|
11206
|
+
}
|
|
11172
11207
|
function storedThreadAttachments({ apiUrl, identity, threadId, update, moveTo }) {
|
|
11173
11208
|
const applyChanges = () => {
|
|
11174
11209
|
if (!identity) return [];
|
|
@@ -11830,7 +11865,10 @@ function describeSandboxCommandRun(run) {
|
|
|
11830
11865
|
return parts.join(" · ");
|
|
11831
11866
|
}
|
|
11832
11867
|
// src/core/session.ts
|
|
11833
|
-
const HISTORY_FAILED = "
|
|
11868
|
+
const HISTORY_FAILED = "Refresh this conversation or start a new one before sending.";
|
|
11869
|
+
const UNCONFIRMED_SEND = "This message may not have been sent. Retry to send it.";
|
|
11870
|
+
const EXPIRED_RETRY = "This message could not be confirmed within 24 hours. Check the saved conversation before sending it again.";
|
|
11871
|
+
const ADMISSION_REPLAY_MS = 864e5;
|
|
11834
11872
|
const CORE_OPTION_KEYS = Object.keys({
|
|
11835
11873
|
agentId: true,
|
|
11836
11874
|
threadId: true,
|
|
@@ -11900,11 +11938,13 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
11900
11938
|
operation = void 0;
|
|
11901
11939
|
update({});
|
|
11902
11940
|
};
|
|
11903
|
-
const
|
|
11941
|
+
const retryExpired = (delivery) => delivery !== void 0 && Date.now() - delivery.dispatchedAt >= ADMISSION_REPLAY_MS;
|
|
11942
|
+
const project = ({ id, content, phase, error, delivery }) => ({
|
|
11904
11943
|
id,
|
|
11905
11944
|
content,
|
|
11906
11945
|
phase,
|
|
11907
|
-
...error ? { error } : {}
|
|
11946
|
+
...error ? { error } : {},
|
|
11947
|
+
...phase === "failed" && retryExpired(delivery) ? { retryExpired: true } : {}
|
|
11908
11948
|
});
|
|
11909
11949
|
const nextPhases = {
|
|
11910
11950
|
submitting: [
|
|
@@ -11912,7 +11952,7 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
11912
11952
|
"failed",
|
|
11913
11953
|
"refused"
|
|
11914
11954
|
],
|
|
11915
|
-
failed: ["submitting"],
|
|
11955
|
+
failed: ["submitting", "accepted"],
|
|
11916
11956
|
accepted: [],
|
|
11917
11957
|
refused: []
|
|
11918
11958
|
};
|
|
@@ -11925,10 +11965,10 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
11925
11965
|
};
|
|
11926
11966
|
const currentAttempt = (attempt) => attempt.submission === submission && currentOperation(attempt);
|
|
11927
11967
|
const ownsAttempt = (attempt) => currentAttempt(attempt) && attempt.submission.phase === "submitting";
|
|
11928
|
-
const endUnaccepted = (sent, error) => sent.delivery
|
|
11968
|
+
const endUnaccepted = (sent, error) => sent.delivery ? settle(sent, "failed", error ?? /* @__PURE__ */ new Error(UNCONFIRMED_SEND)) : settle(sent, "refused", error);
|
|
11929
11969
|
const releaseSubmission = (reason) => {
|
|
11930
11970
|
const released = submission;
|
|
11931
|
-
if (released?.phase === "submitting") endUnaccepted(released, released.delivery
|
|
11971
|
+
if (released?.phase === "submitting") endUnaccepted(released, released.delivery ? void 0 : new Error(reason));
|
|
11932
11972
|
if (released?.phase === "refused") released.onRefused?.();
|
|
11933
11973
|
submission = void 0;
|
|
11934
11974
|
return released;
|
|
@@ -11941,6 +11981,33 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
11941
11981
|
let stopAuthentication;
|
|
11942
11982
|
let unsubscribeAuthentication;
|
|
11943
11983
|
let identity;
|
|
11984
|
+
const pendingScope = (threadId) => {
|
|
11985
|
+
const auth = authenticationState(authentication);
|
|
11986
|
+
if (auth.status !== "ready") return;
|
|
11987
|
+
return {
|
|
11988
|
+
apiUrl: live.apiUrl ?? "https://astralbeam.ai/api",
|
|
11989
|
+
identity: chatDraftIdentity(authenticationIdentity(auth.currentUser), live),
|
|
11990
|
+
threadId
|
|
11991
|
+
};
|
|
11992
|
+
};
|
|
11993
|
+
const recoverSubmission = (threadId) => {
|
|
11994
|
+
const scope = pendingScope(threadId);
|
|
11995
|
+
const pending = scope && storedPendingSubmission(scope);
|
|
11996
|
+
if (!scope || !pending) return;
|
|
11997
|
+
const { id, key, content, ...dispatch } = pending;
|
|
11998
|
+
const delivery = {
|
|
11999
|
+
...dispatch,
|
|
12000
|
+
scope
|
|
12001
|
+
};
|
|
12002
|
+
return {
|
|
12003
|
+
id,
|
|
12004
|
+
key,
|
|
12005
|
+
content,
|
|
12006
|
+
phase: "failed",
|
|
12007
|
+
error: /* @__PURE__ */ new Error(retryExpired(delivery) ? EXPIRED_RETRY : UNCONFIRMED_SEND),
|
|
12008
|
+
delivery
|
|
12009
|
+
};
|
|
12010
|
+
};
|
|
11944
12011
|
let started = false;
|
|
11945
12012
|
let selectionGeneration = 0;
|
|
11946
12013
|
let toolExecutionGeneration = 0;
|
|
@@ -11981,20 +12048,36 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
11981
12048
|
}
|
|
11982
12049
|
};
|
|
11983
12050
|
const clientId = newUuid();
|
|
12051
|
+
const clearAcceptedDraft = (sent) => {
|
|
12052
|
+
if (!sent.delivery?.scope) return;
|
|
12053
|
+
const { scope, draftFileIds } = sent.delivery;
|
|
12054
|
+
const clear = () => storedPendingSubmission(scope, { clearKey: sent.key });
|
|
12055
|
+
if (draftFileIds) storedThreadDraft(scope.apiUrl, scope.identity, scope.threadId, "", "sent");
|
|
12056
|
+
if (!draftFileIds?.length) return void clear();
|
|
12057
|
+
const submitted = new Set(draftFileIds);
|
|
12058
|
+
storedThreadAttachments({
|
|
12059
|
+
...scope,
|
|
12060
|
+
update: (files) => files.filter((file) => !submitted.has(file.id))
|
|
12061
|
+
}).then(clear, (error) => debug?.("error", "Accepted draft files could not be cleared", error));
|
|
12062
|
+
};
|
|
11984
12063
|
const acceptSubmission = () => {
|
|
11985
|
-
|
|
12064
|
+
const sent = submission;
|
|
12065
|
+
if (!sent || !settle(sent, "accepted")) return;
|
|
12066
|
+
clearAcceptedDraft(sent);
|
|
11986
12067
|
if (state.thread) update({ thread: {
|
|
11987
12068
|
...state.thread,
|
|
11988
12069
|
hasMessages: true
|
|
11989
12070
|
} });
|
|
11990
|
-
|
|
12071
|
+
sent.callbacks?.onAccepted?.();
|
|
11991
12072
|
};
|
|
11992
12073
|
const replaceAcceptedMessage = (record) => {
|
|
11993
12074
|
const messages = [...client.getSnapshot().messages];
|
|
11994
|
-
const index = messages.findLastIndex((message) => message.role === "user");
|
|
12075
|
+
const index = messages.findLastIndex((message) => message.role === "user" && message.metadata?.astralbeamSubmissionId === submission?.id);
|
|
11995
12076
|
if (index !== -1) {
|
|
11996
|
-
|
|
11997
|
-
|
|
12077
|
+
const accepted = projectThreadMessages([record])[0];
|
|
12078
|
+
if (messages.some((message, other) => other !== index && message.id === record.id)) messages.splice(index, 1);
|
|
12079
|
+
else messages[index] = accepted;
|
|
12080
|
+
rememberAttachments([accepted]);
|
|
11998
12081
|
client.setMessagesManually(messages);
|
|
11999
12082
|
if (unsubscribeSnapshot) observeSnapshot();
|
|
12000
12083
|
}
|
|
@@ -12208,19 +12291,22 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
12208
12291
|
if (!toolCallId || !liveToolCalls.has(toolCallId)) throw new Error("A saved tool call cannot execute again. Send a new message to request it.");
|
|
12209
12292
|
const results = toolResults;
|
|
12210
12293
|
const key = toolResultKey(toolCallId);
|
|
12294
|
+
const resultClientId = operation?.clientId;
|
|
12211
12295
|
const resultIdentity = identity;
|
|
12212
12296
|
const apiUrl = authentication.apiUrl;
|
|
12213
12297
|
try {
|
|
12214
12298
|
const output = await execute(input, context);
|
|
12215
12299
|
if (identity === resultIdentity && authentication.apiUrl === apiUrl) results.set(key, {
|
|
12216
12300
|
outcome: "succeeded",
|
|
12217
|
-
output: output ?? null
|
|
12301
|
+
output: output ?? null,
|
|
12302
|
+
clientId: resultClientId
|
|
12218
12303
|
});
|
|
12219
12304
|
return output;
|
|
12220
12305
|
} catch (error) {
|
|
12221
12306
|
if (!(error instanceof Error && HOST_TOOL_NOT_EXECUTED in error) && identity === resultIdentity && authentication.apiUrl === apiUrl) results.set(key, {
|
|
12222
12307
|
outcome: "unknown",
|
|
12223
|
-
output: { error: error instanceof Error ? error.message : String(error) }
|
|
12308
|
+
output: { error: error instanceof Error ? error.message : String(error) },
|
|
12309
|
+
clientId: resultClientId
|
|
12224
12310
|
});
|
|
12225
12311
|
throw error;
|
|
12226
12312
|
}
|
|
@@ -12249,20 +12335,24 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
12249
12335
|
let path = getRunChatUrl();
|
|
12250
12336
|
let payload;
|
|
12251
12337
|
const sent = body.messages.at(-1)?.role === "user" && owner.kind === "submission" && ownsAttempt(owner) ? owner.submission : void 0;
|
|
12252
|
-
const
|
|
12253
|
-
if (sent)
|
|
12254
|
-
|
|
12255
|
-
|
|
12256
|
-
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12262
|
-
|
|
12263
|
-
|
|
12264
|
-
|
|
12265
|
-
|
|
12338
|
+
const previous = sent?.delivery;
|
|
12339
|
+
if (sent) {
|
|
12340
|
+
if (retryExpired(sent.delivery)) throw new Error(EXPIRED_RETRY);
|
|
12341
|
+
owner.clientId = previous?.clientId ?? clientId;
|
|
12342
|
+
payload = {
|
|
12343
|
+
...body,
|
|
12344
|
+
threadId: thread.id,
|
|
12345
|
+
resume: void 0,
|
|
12346
|
+
parentRunId: void 0,
|
|
12347
|
+
messages: [body.messages.at(-1)],
|
|
12348
|
+
tools: previous?.tools ?? body.tools,
|
|
12349
|
+
forwardedProps: {
|
|
12350
|
+
...body.forwardedProps,
|
|
12351
|
+
clientId: owner.clientId,
|
|
12352
|
+
clientMessageId: sent.id
|
|
12353
|
+
}
|
|
12354
|
+
};
|
|
12355
|
+
} else {
|
|
12266
12356
|
scopeCompletedToolCalls();
|
|
12267
12357
|
const history = await loadThreadMessages(thread.id, auth, void 0, liveToolMessageIds);
|
|
12268
12358
|
if (!currentOperation(owner)) throw new DOMException("Request cancelled", "AbortError");
|
|
@@ -12270,19 +12360,21 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
12270
12360
|
retainToolResults(history);
|
|
12271
12361
|
const available = history.pendingInteractions.filter((pending) => toolResults.has(toolResultKey(pending.toolCallId)));
|
|
12272
12362
|
const source = available.find((pending) => pending.toolCallId === body.messages.at(-1)?.toolCallId) ?? available[0];
|
|
12363
|
+
owner.clientId = (source && toolResults.get(toolResultKey(source.toolCallId))?.clientId) ?? clientId;
|
|
12273
12364
|
const results = history.pendingInteractions.flatMap((pending) => {
|
|
12274
12365
|
const submitted = toolResults.get(toolResultKey(pending.toolCallId));
|
|
12275
12366
|
return submitted && pending.sourceMessageId === source?.sourceMessageId ? [{
|
|
12276
12367
|
source_message_id: pending.sourceMessageId,
|
|
12277
12368
|
source_part_id: pending.sourcePartId,
|
|
12278
12369
|
response_target_id: pending.responseTargetId,
|
|
12279
|
-
|
|
12370
|
+
outcome: submitted.outcome,
|
|
12371
|
+
output: submitted.output
|
|
12280
12372
|
}] : [];
|
|
12281
12373
|
});
|
|
12282
12374
|
if (results.length === 0) return new Response("", { headers: { "Content-Type": "text/event-stream" } });
|
|
12283
12375
|
path = getResolveChatToolResultUrl(thread.id);
|
|
12284
12376
|
payload = {
|
|
12285
|
-
client_id: clientId,
|
|
12377
|
+
client_id: owner.clientId,
|
|
12286
12378
|
run_id: body.runId,
|
|
12287
12379
|
...body.parentRunId ? { parent_run_id: body.parentRunId } : {},
|
|
12288
12380
|
results
|
|
@@ -12293,10 +12385,28 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
12293
12385
|
const headers = new Headers(init.headers);
|
|
12294
12386
|
if (sent) headers.set("Idempotency-Key", sent.key);
|
|
12295
12387
|
if (!currentOperation(owner)) throw new DOMException("Request cancelled", "AbortError");
|
|
12296
|
-
if (sent &&
|
|
12297
|
-
|
|
12298
|
-
|
|
12299
|
-
|
|
12388
|
+
if (sent && !previous) {
|
|
12389
|
+
const scope = pendingScope(thread.id);
|
|
12390
|
+
const dispatch = {
|
|
12391
|
+
tools: body.tools,
|
|
12392
|
+
clientId,
|
|
12393
|
+
dispatchedAt: Date.now(),
|
|
12394
|
+
draftFileIds: sent.callbacks?.draftFileIds
|
|
12395
|
+
};
|
|
12396
|
+
sent.delivery = {
|
|
12397
|
+
...dispatch,
|
|
12398
|
+
scope
|
|
12399
|
+
};
|
|
12400
|
+
if (scope) {
|
|
12401
|
+
const { id, key, content } = sent;
|
|
12402
|
+
if (storedPendingSubmission(scope, { save: {
|
|
12403
|
+
id,
|
|
12404
|
+
key,
|
|
12405
|
+
content,
|
|
12406
|
+
...dispatch
|
|
12407
|
+
} }) && dispatch.draftFileIds) storedThreadDraft(scope.apiUrl, scope.identity, scope.threadId, "", "sent");
|
|
12408
|
+
}
|
|
12409
|
+
}
|
|
12300
12410
|
const response = await astralBeamChatFetch(path, {
|
|
12301
12411
|
...auth,
|
|
12302
12412
|
...init,
|
|
@@ -12304,7 +12414,10 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
12304
12414
|
body: JSON.stringify(payload)
|
|
12305
12415
|
}).catch((error) => {
|
|
12306
12416
|
if (!currentOperation(owner)) throw error;
|
|
12307
|
-
if (sent &&
|
|
12417
|
+
if (sent && !previous && isAstralBeamApiError(error) && (error.status === 400 || error.status === 413 || error.status === 429)) {
|
|
12418
|
+
if (sent.delivery?.scope) storedPendingSubmission(sent.delivery.scope, { clearKey: sent.key });
|
|
12419
|
+
sent.delivery = void 0;
|
|
12420
|
+
}
|
|
12308
12421
|
const limit = isAstralBeamApiError(error) ? error.body?.usage_limit : void 0;
|
|
12309
12422
|
if (limit) update({ usageLimitReached: {
|
|
12310
12423
|
name: limit.name,
|
|
@@ -12420,13 +12533,18 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
12420
12533
|
else {
|
|
12421
12534
|
if (history.thread.role === "viewer") disposeRenders();
|
|
12422
12535
|
const agentChanged = state.thread?.agentId !== history.thread.agent_id;
|
|
12536
|
+
submission ??= recoverSubmission(threadId);
|
|
12423
12537
|
update({
|
|
12424
12538
|
thread: threadFromRecord(history.thread, history.messages.length > 0),
|
|
12425
12539
|
messagesCursor: history.page_after ?? void 0,
|
|
12426
|
-
pendingInteractions: history.pendingInteractions
|
|
12540
|
+
pendingInteractions: history.pendingInteractions,
|
|
12541
|
+
submission: submission && project(submission)
|
|
12427
12542
|
});
|
|
12428
12543
|
if (agentChanged) resolveCapabilities();
|
|
12429
12544
|
if (messages.length === 0) next.setMessagesManually([]);
|
|
12545
|
+
const pending = submission;
|
|
12546
|
+
const { auth } = state;
|
|
12547
|
+
if (pending?.phase === "failed" && auth.status === "ready" && currentRead() && history.messages.some((message) => message.role === "user" && message.client_message_id === pending.id && message.author_tenant_user_id === auth.currentUser.user.id)) acceptSubmission();
|
|
12430
12548
|
}
|
|
12431
12549
|
return {
|
|
12432
12550
|
messages,
|
|
@@ -12472,8 +12590,10 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
12472
12590
|
if (eventType === "astralbeam_thread") {
|
|
12473
12591
|
const event = data;
|
|
12474
12592
|
if (state.thread?.id === event.threadId) {
|
|
12475
|
-
if (
|
|
12476
|
-
|
|
12593
|
+
if (submission?.phase === "submitting") {
|
|
12594
|
+
if (event.acceptedMessage) replaceAcceptedMessage(event.acceptedMessage);
|
|
12595
|
+
if (event.acceptedMessageId) acceptSubmission();
|
|
12596
|
+
}
|
|
12477
12597
|
if (event.saved) for (const id of event.executableToolCallIds ?? []) {
|
|
12478
12598
|
if (!liveToolCalls.has(id)) toolResults.delete(toolResultKey(id));
|
|
12479
12599
|
liveToolCalls.add(id);
|
|
@@ -12699,7 +12819,7 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
12699
12819
|
if (threadKey) selectedThread(threadKey, record.id);
|
|
12700
12820
|
};
|
|
12701
12821
|
const refreshThread = async (explicit = true) => {
|
|
12702
|
-
if (!
|
|
12822
|
+
if (!selectedId || client.getIsLoading()) return;
|
|
12703
12823
|
const generation = selectionGeneration;
|
|
12704
12824
|
try {
|
|
12705
12825
|
client.detach();
|
|
@@ -12831,7 +12951,16 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
12831
12951
|
if (!ownsAttempt(attempt)) return project(sent);
|
|
12832
12952
|
scopeCompletedToolCalls();
|
|
12833
12953
|
if (!await waitToDispatch(attempt)) return project(sent);
|
|
12834
|
-
|
|
12954
|
+
if (typeof sent.content !== "string" || sent.content.trim()) {
|
|
12955
|
+
const content = typeof sent.content === "string" ? { content: sent.content } : sent.content;
|
|
12956
|
+
await attempt.client.sendMessage({
|
|
12957
|
+
...content,
|
|
12958
|
+
metadata: {
|
|
12959
|
+
...content.metadata,
|
|
12960
|
+
astralbeamSubmissionId: sent.id
|
|
12961
|
+
}
|
|
12962
|
+
});
|
|
12963
|
+
}
|
|
12835
12964
|
if (!currentAttempt(attempt)) return project(sent);
|
|
12836
12965
|
endUnaccepted(sent, attempt.client.getError());
|
|
12837
12966
|
if (currentAttempt(attempt)) await refreshThread(false);
|
|
@@ -12858,7 +12987,6 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
12858
12987
|
content,
|
|
12859
12988
|
phase: "submitting",
|
|
12860
12989
|
key: newUuid(),
|
|
12861
|
-
delivery: { state: "undispatched" },
|
|
12862
12990
|
callbacks
|
|
12863
12991
|
};
|
|
12864
12992
|
submission = sent;
|
|
@@ -12877,7 +13005,14 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
12877
13005
|
};
|
|
12878
13006
|
const retry = async () => {
|
|
12879
13007
|
const sent = submission;
|
|
12880
|
-
if (operation || client.getIsLoading() ||
|
|
13008
|
+
if (operation || client.getIsLoading() || sent?.phase !== "failed") return void 0;
|
|
13009
|
+
if (retryExpired(sent.delivery)) {
|
|
13010
|
+
sent.error = /* @__PURE__ */ new Error(EXPIRED_RETRY);
|
|
13011
|
+
const expired = project(sent);
|
|
13012
|
+
update({ submission: expired });
|
|
13013
|
+
return expired;
|
|
13014
|
+
}
|
|
13015
|
+
if (!settle(sent, "submitting")) return void 0;
|
|
12881
13016
|
update({ error: void 0 });
|
|
12882
13017
|
return deliver(sent);
|
|
12883
13018
|
};
|
|
@@ -13016,6 +13151,7 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
13016
13151
|
}).catch(() => void 0);
|
|
13017
13152
|
},
|
|
13018
13153
|
reload: async () => {
|
|
13154
|
+
if (client.getIsLoading()) return;
|
|
13019
13155
|
const generation = selectionGeneration;
|
|
13020
13156
|
await refreshThread();
|
|
13021
13157
|
if (generation !== selectionGeneration || state.error) return;
|
|
@@ -13088,7 +13224,7 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
13088
13224
|
debug?.("status", "conversation reset");
|
|
13089
13225
|
newThread();
|
|
13090
13226
|
if (state.auth.status === "ready") {
|
|
13091
|
-
const draftIdentity =
|
|
13227
|
+
const draftIdentity = chatDraftIdentity(authenticationIdentity(state.auth.currentUser), live);
|
|
13092
13228
|
const apiUrl = live.apiUrl ?? "https://astralbeam.ai/api";
|
|
13093
13229
|
storedThreadDraft(apiUrl, draftIdentity, "", "");
|
|
13094
13230
|
storedThreadDraft(apiUrl, draftIdentity, "", "", "sent");
|
package/dist/core.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as ChatSubmissionCallbacks, B as RenderWidgetInput, C as lastPartInProgress, D as AstralBeamChatState, E as AstralBeamChatCoreOptions, F as McpCatalog, G as SandboxStatus, H as SandboxArtifact, I as McpConnectionOperation, J as ParametersSchema, K as InferParameters, L as ChatAuthenticationState, M as createAstralBeamChat, N as ChatPendingInteraction, O as ChatStreamCallbacks, P as ChatThread, R as WidgetDeclaration, S as isSettledToolCall, T as AstralBeamChatCore, U as SandboxCommandRun, V as SandboxActivity, W as SandboxFileWrite, X as ToolDefinition, Y as StandardSchemaV1, _ as readSandboxArtifact, a as defineTool, b as sandboxRefusal, c as SANDBOX_LIST_FILES_TOOL, d as SANDBOX_RUN_COMMAND_TOOL, f as SANDBOX_STATUS_EVENT, g as isSandboxTool, h as describeSandboxCommandRun, i as WebSource, j as WidgetRenderRequest, k as ChatSubmission, l as SANDBOX_PUBLISH_ARTIFACT_TOOL, m as collectSandboxActivity, n as WebEvidence, o as ASK_QUESTIONNAIRE_TOOL, p as SANDBOX_WRITE_FILE_TOOL, q as JsonSchemaObject, r as WebPartMetadata, s as RENDER_WIDGET_TOOL, t as WebCitation, u as SANDBOX_READ_FILE_TOOL, v as readSandboxCommandRun, w as AgentToolInfo, x as hasPendingToolRun, y as readSandboxFileWrite, z as buildAgentTools } from "./index-
|
|
1
|
+
import { A as ChatSubmissionCallbacks, B as RenderWidgetInput, C as lastPartInProgress, D as AstralBeamChatState, E as AstralBeamChatCoreOptions, F as McpCatalog, G as SandboxStatus, H as SandboxArtifact, I as McpConnectionOperation, J as ParametersSchema, K as InferParameters, L as ChatAuthenticationState, M as createAstralBeamChat, N as ChatPendingInteraction, O as ChatStreamCallbacks, P as ChatThread, R as WidgetDeclaration, S as isSettledToolCall, T as AstralBeamChatCore, U as SandboxCommandRun, V as SandboxActivity, W as SandboxFileWrite, X as ToolDefinition, Y as StandardSchemaV1, _ as readSandboxArtifact, a as defineTool, b as sandboxRefusal, c as SANDBOX_LIST_FILES_TOOL, d as SANDBOX_RUN_COMMAND_TOOL, f as SANDBOX_STATUS_EVENT, g as isSandboxTool, h as describeSandboxCommandRun, i as WebSource, j as WidgetRenderRequest, k as ChatSubmission, l as SANDBOX_PUBLISH_ARTIFACT_TOOL, m as collectSandboxActivity, n as WebEvidence, o as ASK_QUESTIONNAIRE_TOOL, p as SANDBOX_WRITE_FILE_TOOL, q as JsonSchemaObject, r as WebPartMetadata, s as RENDER_WIDGET_TOOL, t as WebCitation, u as SANDBOX_READ_FILE_TOOL, v as readSandboxCommandRun, w as AgentToolInfo, x as hasPendingToolRun, y as readSandboxFileWrite, z as buildAgentTools } from "./index-C9_dLp_O.js";
|
|
2
2
|
export { ASK_QUESTIONNAIRE_TOOL, type AgentToolInfo, type AstralBeamChatCore, type AstralBeamChatCoreOptions, type AstralBeamChatState, type ChatAuthenticationState, type ChatPendingInteraction, type ChatStreamCallbacks, type ChatSubmission, type ChatSubmissionCallbacks, type ChatThread, type InferParameters, type JsonSchemaObject, type McpCatalog, type McpConnectionOperation, type ParametersSchema, RENDER_WIDGET_TOOL, type RenderWidgetInput, SANDBOX_LIST_FILES_TOOL, SANDBOX_PUBLISH_ARTIFACT_TOOL, SANDBOX_READ_FILE_TOOL, SANDBOX_RUN_COMMAND_TOOL, SANDBOX_STATUS_EVENT, SANDBOX_WRITE_FILE_TOOL, type SandboxActivity, type SandboxArtifact, type SandboxCommandRun, type SandboxFileWrite, type SandboxStatus, type StandardSchemaV1, type ToolDefinition, type WebCitation, type WebEvidence, type WebPartMetadata, type WebSource, type WidgetDeclaration, type WidgetRenderRequest, buildAgentTools, collectSandboxActivity, createAstralBeamChat, defineTool, describeSandboxCommandRun, hasPendingToolRun, isSandboxTool, isSettledToolCall, lastPartInProgress, readSandboxArtifact, readSandboxCommandRun, readSandboxFileWrite, sandboxRefusal };
|
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { h as ASK_QUESTIONNAIRE_TOOL, g as RENDER_WIDGET_TOOL, _ as SANDBOX_LIST_FILES_TOOL, v as SANDBOX_PUBLISH_ARTIFACT_TOOL, y as SANDBOX_READ_FILE_TOOL, b as SANDBOX_RUN_COMMAND_TOOL, x as SANDBOX_STATUS_EVENT, S as SANDBOX_WRITE_FILE_TOOL, m as buildAgentTools, i as collectSandboxActivity, r as createAstralBeamChat, t as defineTool, a as describeSandboxCommandRun, d as hasPendingToolRun, o as isSandboxTool, f as isSettledToolCall, p as lastPartInProgress, s as readSandboxArtifact, c as readSandboxCommandRun, l as readSandboxFileWrite, u as sandboxRefusal } from "./core-
|
|
1
|
+
export { h as ASK_QUESTIONNAIRE_TOOL, g as RENDER_WIDGET_TOOL, _ as SANDBOX_LIST_FILES_TOOL, v as SANDBOX_PUBLISH_ARTIFACT_TOOL, y as SANDBOX_READ_FILE_TOOL, b as SANDBOX_RUN_COMMAND_TOOL, x as SANDBOX_STATUS_EVENT, S as SANDBOX_WRITE_FILE_TOOL, m as buildAgentTools, i as collectSandboxActivity, r as createAstralBeamChat, t as defineTool, a as describeSandboxCommandRun, d as hasPendingToolRun, o as isSandboxTool, f as isSettledToolCall, p as lastPartInProgress, s as readSandboxArtifact, c as readSandboxCommandRun, l as readSandboxFileWrite, u as sandboxRefusal } from "./core-sNbWKLab.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as GetThreadAttachmentParams, Jt as UploadedChatFile, V as CurrentUser, ct as McpConnectionEncoded, ir as personalMcpGetCatalog, xr as JwtOptions, xt as PersonalMcpTestConnection200 } from "./index-
|
|
1
|
+
import { $ as GetThreadAttachmentParams, Jt as UploadedChatFile, V as CurrentUser, ct as McpConnectionEncoded, ir as personalMcpGetCatalog, xr as JwtOptions, xt as PersonalMcpTestConnection200 } from "./index-Cf_9MRpM.js";
|
|
2
2
|
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
3
3
|
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
4
4
|
/** The Standard properties. */
|
|
@@ -6517,6 +6517,8 @@ interface ChatSubmissionCallbacks {
|
|
|
6517
6517
|
onThreadReady?: ((threadId: string) => void) | undefined;
|
|
6518
6518
|
/** Called once after the server acknowledges input, before generation finishes. */
|
|
6519
6519
|
onAccepted?: (() => void) | undefined;
|
|
6520
|
+
/** @internal Identifies only the widget's submitted draft attachments during reload recovery. */
|
|
6521
|
+
draftFileIds?: readonly string[] | undefined;
|
|
6520
6522
|
}
|
|
6521
6523
|
/**
|
|
6522
6524
|
* The transport and tool options of the drop-in widget, minus everything about its UI, plus this
|
|
@@ -6549,6 +6551,8 @@ interface ChatSubmission {
|
|
|
6549
6551
|
content: string | MultimodalContent;
|
|
6550
6552
|
phase: "submitting" | "accepted" | "failed" | "refused";
|
|
6551
6553
|
error?: Error | undefined;
|
|
6554
|
+
/** The server's replay window has closed and this delivery cannot be safely retried. */
|
|
6555
|
+
retryExpired?: true;
|
|
6552
6556
|
}
|
|
6553
6557
|
interface AstralBeamChatState {
|
|
6554
6558
|
messages: ChatClientSnapshot["messages"];
|
|
@@ -258,6 +258,7 @@ type ChatHistoryPageEncodedMessagesItem = {
|
|
|
258
258
|
parent_message_id: string | null;
|
|
259
259
|
parts: ChatHistoryPageEncodedMessagesItemPartsItem[];
|
|
260
260
|
author_tenant_user_id: string | null;
|
|
261
|
+
client_message_id?: string;
|
|
261
262
|
source_assistant_message_id: string | null;
|
|
262
263
|
source_tool_part_id: string | null;
|
|
263
264
|
response_target_id: string | null;
|
|
@@ -444,6 +445,7 @@ interface ChatMessageEncoded {
|
|
|
444
445
|
parent_message_id: string | null;
|
|
445
446
|
parts: ChatMessageEncodedPartsItem[];
|
|
446
447
|
author_tenant_user_id: string | null;
|
|
448
|
+
client_message_id?: string;
|
|
447
449
|
source_assistant_message_id: string | null;
|
|
448
450
|
source_tool_part_id: string | null;
|
|
449
451
|
response_target_id: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jn as e,Or as t,Tr as n,Yn as r,jr as i,qn as a,tt as o,ur as s}from"./styles.generated-BrC_vo9p.js";var c=/* @__PURE__ */ i(t(),1);const l=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M240.49,63.51a12,12,0,0,0-17,0L192,95,161,64l31.52-31.51a12,12,0,0,0-17-17L144,47,120.49,23.51a12,12,0,1,0-17,17L107,44,56.89,94.14a44,44,0,0,0,0,62.23l12.88,12.88L23.51,215.51a12,12,0,0,0,17,17l46.26-46.26,12.88,12.88a44,44,0,0,0,62.23,0L212,149l3.51,3.52a12,12,0,0,0,17-17L209,112l31.52-31.51A12,12,0,0,0,240.49,63.51Zm-95.6,118.63a20,20,0,0,1-28.29,0L73.86,139.4a20,20,0,0,1,0-28.29L124,61l71,71Z`}))],[`duotone`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M212,132l-58.63,58.63a32,32,0,0,1-45.25,0L65.37,147.88a32,32,0,0,1,0-45.25L124,44Z`,opacity:`0.2`}),/* @__PURE__ */ c.createElement(`path`,{d:`M237.66,66.34a8,8,0,0,0-11.32,0L192,100.69,155.31,64l34.35-34.34a8,8,0,1,0-11.32-11.32L144,52.69,117.66,26.34a8,8,0,0,0-11.32,11.32L112.69,44l-53,53a40,40,0,0,0,0,56.57l15.71,15.71L26.34,218.34a8,8,0,0,0,11.32,11.32l49.09-49.09,15.71,15.71a40,40,0,0,0,56.57,0l53-53,6.34,6.35a8,8,0,0,0,11.32-11.32L203.31,112l34.35-34.34A8,8,0,0,0,237.66,66.34ZM147.72,185a24,24,0,0,1-33.95,0L71,142.23a24,24,0,0,1,0-33.95l53-53L200.69,132Z`}))],[`fill`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M237.66,77.66,203.31,112l26.35,26.34a8,8,0,0,1-11.32,11.32L212,143.31l-53,53a40,40,0,0,1-56.57,0L86.75,180.57,37.66,229.66a8,8,0,0,1-11.32-11.32l49.09-49.09L59.72,153.54a40,40,0,0,1,0-56.57l53-53-6.35-6.34a8,8,0,0,1,11.32-11.32L144,52.69l34.34-34.35a8,8,0,1,1,11.32,11.32L155.31,64,192,100.69l34.34-34.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M236.24,67.76a6,6,0,0,0-8.48,0L192,103.51,152.49,64l35.75-35.76a6,6,0,0,0-8.48-8.48L144,55.51,116.24,27.76a6,6,0,1,0-8.48,8.48L115.51,44,61.13,98.38a38,38,0,0,0,0,53.75l17.13,17.12-50.5,50.51a6,6,0,1,0,8.48,8.48l50.51-50.5,17.13,17.13a38,38,0,0,0,53.74,0L212,140.49l7.76,7.75a6,6,0,0,0,8.48-8.48L200.49,112l35.75-35.76A6,6,0,0,0,236.24,67.76ZM149.13,186.38a26,26,0,0,1-36.77,0L69.62,143.64a26,26,0,0,1,0-36.77L124,52.49,203.51,132Z`}))],[`regular`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M237.66,66.34a8,8,0,0,0-11.32,0L192,100.69,155.31,64l34.35-34.34a8,8,0,1,0-11.32-11.32L144,52.69,117.66,26.34a8,8,0,0,0-11.32,11.32L112.69,44l-53,53a40,40,0,0,0,0,56.57l15.71,15.71L26.34,218.34a8,8,0,0,0,11.32,11.32l49.09-49.09,15.71,15.71a40,40,0,0,0,56.57,0l53-53,6.34,6.35a8,8,0,0,0,11.32-11.32L203.31,112l34.35-34.34A8,8,0,0,0,237.66,66.34ZM147.72,185a24,24,0,0,1-33.95,0L71,142.23a24,24,0,0,1,0-33.95l53-53L200.69,132Z`}))],[`thin`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M234.83,69.17a4,4,0,0,0-5.66,0L192,106.34,149.66,64l37.17-37.17a4,4,0,1,0-5.66-5.66L144,58.34,114.83,29.17a4,4,0,0,0-5.66,5.66L118.34,44,62.54,99.8a36.05,36.05,0,0,0,0,50.91l18.55,18.54L29.17,221.17a4,4,0,0,0,5.66,5.66l51.92-51.92,18.54,18.55a36.06,36.06,0,0,0,50.91,0l55.8-55.8,9.17,9.17a4,4,0,0,0,5.66-5.66L197.66,112l37.17-37.17A4,4,0,0,0,234.83,69.17ZM150.54,187.8a28,28,0,0,1-39.59,0L68.2,145.05a28,28,0,0,1,0-39.59L124,49.66,206.34,132Z`}))]]),u=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),/* @__PURE__ */ c.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),d=c.forwardRef((e,t)=>/* @__PURE__ */ c.createElement(n,{ref:t,...e,weights:l}));d.displayName=`PlugIcon`;const f=c.forwardRef((e,t)=>/* @__PURE__ */ c.createElement(n,{ref:t,...e,weights:u}));f.displayName=`TrashIcon`;var p=a();function m({className:t,size:n=`default`,...r}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`card`,"data-size":n,className:e(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,t),...r})}function h({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`card-header`,className:e(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,t),...n})}function g({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`card-title`,className:e(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,t),...n})}function _({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`card-content`,className:e(`px-(--card-spacing)`,t),...n})}function v({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`card-footer`,className:e(`flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)`,t),...n})}function y({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`label`,{"data-slot":`label`,className:e(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,t),...n})}const b=r(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function x({className:t,orientation:n=`vertical`,...r}){return/* @__PURE__ */ (0,p.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":n,className:e(b({orientation:n}),t),...r})}function S({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(y,{"data-slot":`field-label`,className:e(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,t),...n})}function C({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`p`,{"data-slot":`field-description`,className:e(`text-start text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function w({className:t,children:n,errors:r,...i}){let a=(0,c.useMemo)(()=>{if(n)return n;if(!r?.length)return null;let e=[...new Map(r.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:/* @__PURE__ */ (0,p.jsx)(`ul`,{className:`ms-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&/* @__PURE__ */ (0,p.jsx)(`li`,{children:e.message},t))})},[n,r]);return a?/* @__PURE__ */ (0,p.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:e(`text-sm font-normal text-destructive`,t),...i,children:a}):null}const T=r(`group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted`,{variants:{variant:{default:`border-transparent`,outline:`border-border`,muted:`border-transparent bg-muted/50`},size:{default:`gap-2.5 px-3 py-2.5`,sm:`gap-2.5 px-3 py-2.5`,xs:`gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0`}},defaultVariants:{variant:`default`,size:`default`}});function E({className:t,variant:n=`default`,size:r=`default`,render:i,...a}){return o({defaultTagName:`div`,props:s({className:e(T({variant:n,size:r,className:t}))},a),render:i,state:{slot:`item`,variant:n,size:r}})}const D=r(`flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none`,{variants:{variant:{default:`bg-transparent`,icon:`[&_svg:not([class*='size-'])]:size-4`,image:`size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover`}},defaultVariants:{variant:`default`}});function O({className:t,variant:n=`default`,...r}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`item-media`,"data-variant":n,className:e(D({variant:n,className:t})),...r})}function k({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`item-content`,className:e(`flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none`,t),...n})}function A({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`p`,{"data-slot":`item-description`,className:e(`line-clamp-2 text-start text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function j({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`item-actions`,className:e(`flex items-center gap-2`,t),...n})}export{O as a,w as c,_ as d,v as f,d as g,f as h,A as i,S as l,g as m,j as n,x as o,h as p,k as r,C as s,E as t,m as u};
|
|
1
|
+
import{Jn as e,Or as t,Tr as n,Yn as r,jr as i,qn as a,tt as o,ur as s}from"./styles.generated-D0caROd2.js";var c=/* @__PURE__ */ i(t(),1);const l=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M240.49,63.51a12,12,0,0,0-17,0L192,95,161,64l31.52-31.51a12,12,0,0,0-17-17L144,47,120.49,23.51a12,12,0,1,0-17,17L107,44,56.89,94.14a44,44,0,0,0,0,62.23l12.88,12.88L23.51,215.51a12,12,0,0,0,17,17l46.26-46.26,12.88,12.88a44,44,0,0,0,62.23,0L212,149l3.51,3.52a12,12,0,0,0,17-17L209,112l31.52-31.51A12,12,0,0,0,240.49,63.51Zm-95.6,118.63a20,20,0,0,1-28.29,0L73.86,139.4a20,20,0,0,1,0-28.29L124,61l71,71Z`}))],[`duotone`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M212,132l-58.63,58.63a32,32,0,0,1-45.25,0L65.37,147.88a32,32,0,0,1,0-45.25L124,44Z`,opacity:`0.2`}),/* @__PURE__ */ c.createElement(`path`,{d:`M237.66,66.34a8,8,0,0,0-11.32,0L192,100.69,155.31,64l34.35-34.34a8,8,0,1,0-11.32-11.32L144,52.69,117.66,26.34a8,8,0,0,0-11.32,11.32L112.69,44l-53,53a40,40,0,0,0,0,56.57l15.71,15.71L26.34,218.34a8,8,0,0,0,11.32,11.32l49.09-49.09,15.71,15.71a40,40,0,0,0,56.57,0l53-53,6.34,6.35a8,8,0,0,0,11.32-11.32L203.31,112l34.35-34.34A8,8,0,0,0,237.66,66.34ZM147.72,185a24,24,0,0,1-33.95,0L71,142.23a24,24,0,0,1,0-33.95l53-53L200.69,132Z`}))],[`fill`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M237.66,77.66,203.31,112l26.35,26.34a8,8,0,0,1-11.32,11.32L212,143.31l-53,53a40,40,0,0,1-56.57,0L86.75,180.57,37.66,229.66a8,8,0,0,1-11.32-11.32l49.09-49.09L59.72,153.54a40,40,0,0,1,0-56.57l53-53-6.35-6.34a8,8,0,0,1,11.32-11.32L144,52.69l34.34-34.35a8,8,0,1,1,11.32,11.32L155.31,64,192,100.69l34.34-34.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M236.24,67.76a6,6,0,0,0-8.48,0L192,103.51,152.49,64l35.75-35.76a6,6,0,0,0-8.48-8.48L144,55.51,116.24,27.76a6,6,0,1,0-8.48,8.48L115.51,44,61.13,98.38a38,38,0,0,0,0,53.75l17.13,17.12-50.5,50.51a6,6,0,1,0,8.48,8.48l50.51-50.5,17.13,17.13a38,38,0,0,0,53.74,0L212,140.49l7.76,7.75a6,6,0,0,0,8.48-8.48L200.49,112l35.75-35.76A6,6,0,0,0,236.24,67.76ZM149.13,186.38a26,26,0,0,1-36.77,0L69.62,143.64a26,26,0,0,1,0-36.77L124,52.49,203.51,132Z`}))],[`regular`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M237.66,66.34a8,8,0,0,0-11.32,0L192,100.69,155.31,64l34.35-34.34a8,8,0,1,0-11.32-11.32L144,52.69,117.66,26.34a8,8,0,0,0-11.32,11.32L112.69,44l-53,53a40,40,0,0,0,0,56.57l15.71,15.71L26.34,218.34a8,8,0,0,0,11.32,11.32l49.09-49.09,15.71,15.71a40,40,0,0,0,56.57,0l53-53,6.34,6.35a8,8,0,0,0,11.32-11.32L203.31,112l34.35-34.34A8,8,0,0,0,237.66,66.34ZM147.72,185a24,24,0,0,1-33.95,0L71,142.23a24,24,0,0,1,0-33.95l53-53L200.69,132Z`}))],[`thin`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M234.83,69.17a4,4,0,0,0-5.66,0L192,106.34,149.66,64l37.17-37.17a4,4,0,1,0-5.66-5.66L144,58.34,114.83,29.17a4,4,0,0,0-5.66,5.66L118.34,44,62.54,99.8a36.05,36.05,0,0,0,0,50.91l18.55,18.54L29.17,221.17a4,4,0,0,0,5.66,5.66l51.92-51.92,18.54,18.55a36.06,36.06,0,0,0,50.91,0l55.8-55.8,9.17,9.17a4,4,0,0,0,5.66-5.66L197.66,112l37.17-37.17A4,4,0,0,0,234.83,69.17ZM150.54,187.8a28,28,0,0,1-39.59,0L68.2,145.05a28,28,0,0,1,0-39.59L124,49.66,206.34,132Z`}))]]),u=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),/* @__PURE__ */ c.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,/* @__PURE__ */ c.createElement(c.Fragment,null,/* @__PURE__ */ c.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),d=c.forwardRef((e,t)=>/* @__PURE__ */ c.createElement(n,{ref:t,...e,weights:l}));d.displayName=`PlugIcon`;const f=c.forwardRef((e,t)=>/* @__PURE__ */ c.createElement(n,{ref:t,...e,weights:u}));f.displayName=`TrashIcon`;var p=a();function m({className:t,size:n=`default`,...r}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`card`,"data-size":n,className:e(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,t),...r})}function h({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`card-header`,className:e(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,t),...n})}function g({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`card-title`,className:e(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,t),...n})}function _({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`card-content`,className:e(`px-(--card-spacing)`,t),...n})}function v({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`card-footer`,className:e(`flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)`,t),...n})}function y({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`label`,{"data-slot":`label`,className:e(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,t),...n})}const b=r(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function x({className:t,orientation:n=`vertical`,...r}){return/* @__PURE__ */ (0,p.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":n,className:e(b({orientation:n}),t),...r})}function S({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(y,{"data-slot":`field-label`,className:e(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,t),...n})}function C({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`p`,{"data-slot":`field-description`,className:e(`text-start text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function w({className:t,children:n,errors:r,...i}){let a=(0,c.useMemo)(()=>{if(n)return n;if(!r?.length)return null;let e=[...new Map(r.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:/* @__PURE__ */ (0,p.jsx)(`ul`,{className:`ms-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&/* @__PURE__ */ (0,p.jsx)(`li`,{children:e.message},t))})},[n,r]);return a?/* @__PURE__ */ (0,p.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:e(`text-sm font-normal text-destructive`,t),...i,children:a}):null}const T=r(`group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted`,{variants:{variant:{default:`border-transparent`,outline:`border-border`,muted:`border-transparent bg-muted/50`},size:{default:`gap-2.5 px-3 py-2.5`,sm:`gap-2.5 px-3 py-2.5`,xs:`gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0`}},defaultVariants:{variant:`default`,size:`default`}});function E({className:t,variant:n=`default`,size:r=`default`,render:i,...a}){return o({defaultTagName:`div`,props:s({className:e(T({variant:n,size:r,className:t}))},a),render:i,state:{slot:`item`,variant:n,size:r}})}const D=r(`flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none`,{variants:{variant:{default:`bg-transparent`,icon:`[&_svg:not([class*='size-'])]:size-4`,image:`size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover`}},defaultVariants:{variant:`default`}});function O({className:t,variant:n=`default`,...r}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`item-media`,"data-variant":n,className:e(D({variant:n,className:t})),...r})}function k({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`item-content`,className:e(`flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none`,t),...n})}function A({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`p`,{"data-slot":`item-description`,className:e(`line-clamp-2 text-start text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function j({className:t,...n}){return/* @__PURE__ */ (0,p.jsx)(`div`,{"data-slot":`item-actions`,className:e(`flex items-center gap-2`,t),...n})}export{O as a,w as c,_ as d,v as f,d as g,f as h,A as i,S as l,g as m,j as n,x as o,h as p,k as r,C as s,E as t,m as u};
|