juneau 0.14.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,59 +1,59 @@
1
- import { useState as E, useRef as W, useEffect as oe, useCallback as S, useMemo as fe, useContext as ce, createContext as ge } from "react";
2
- import { jsx as n, jsxs as h, Fragment as _e } from "react/jsx-runtime";
3
- import je from "react-markdown";
4
- import Se from "remark-gfm";
5
- function Ae(e) {
1
+ import { useState as H, useRef as F, useEffect as ie, useCallback as j, useMemo as ge, useContext as ce, createContext as be } from "react";
2
+ import { jsx as n, jsxs as m, Fragment as _e } from "react/jsx-runtime";
3
+ import Se from "react-markdown";
4
+ import Ae from "remark-gfm";
5
+ function ze(e) {
6
6
  return e.map((t) => t.role !== "assistant" || t.parts.some((a) => a.type === "text") ? t : { ...t, parts: [{ type: "text", text: "" }] });
7
7
  }
8
- const g = (e) => new Promise((t) => setTimeout(t, e));
9
- function ze(e) {
8
+ const b = (e) => new Promise((t) => setTimeout(t, e));
9
+ function Me(e) {
10
10
  return e.parts.filter((t) => t.type === "text").map((t) => t.text).join("");
11
11
  }
12
12
  async function ue(e, t, a) {
13
13
  for await (const r of e)
14
14
  if (a?.aborted || (t(r), r.type === "done" || r.type === "error")) break;
15
15
  }
16
- function be(e) {
16
+ function ve(e) {
17
17
  return e.type === "proposal";
18
18
  }
19
- function nn(e) {
19
+ function sn(e) {
20
20
  return e.type === "chart" && Array.isArray(e.series);
21
21
  }
22
- const Me = 1;
23
- function sn(e) {
22
+ const Ie = 1;
23
+ function rn(e) {
24
24
  return e.map((t) => ({
25
25
  ...t,
26
- v: Me,
26
+ v: Ie,
27
27
  createdAt: t.createdAt.toISOString(),
28
28
  parts: t.parts.filter((a) => !(a.type === "activity" && a.status === "running")).map(Te)
29
29
  }));
30
30
  }
31
31
  function Te(e) {
32
- return be(e) && !e.proposal.resolved ? { ...e, proposal: { ...e.proposal, resolved: "expired" } } : e;
32
+ return ve(e) && !e.proposal.resolved ? { ...e, proposal: { ...e.proposal, resolved: "expired" } } : e;
33
33
  }
34
- function rn(e) {
34
+ function on(e) {
35
35
  return e.map(({ v: t, ...a }) => ({
36
36
  ...a,
37
37
  createdAt: new Date(a.createdAt)
38
38
  }));
39
39
  }
40
- function Ie(e, t) {
40
+ function Le(e, t) {
41
41
  if (t <= 0 || e.length <= t) return e;
42
42
  let a = e.length - t;
43
43
  for (; a < e.length && e[a].role === "assistant"; )
44
44
  a++;
45
45
  return e.slice(a);
46
46
  }
47
- function on(e, t) {
47
+ function cn(e, t) {
48
48
  return t <= 0 || e.length <= t ? [...e].sort(pe) : [...e].sort(pe).slice(0, t);
49
49
  }
50
- const pe = (e, t) => t.updatedAt.getTime() - e.updatedAt.getTime(), cn = {
50
+ const pe = (e, t) => t.updatedAt.getTime() - e.updatedAt.getTime(), ln = {
51
51
  async *sendMessage(e) {
52
- const t = [...e.messages].reverse().find((r) => r.role === "user"), a = t ? ze(t).toLowerCase() : "";
53
- a.includes("activity") || a.includes("progress") || a.includes("document") || a.includes("dokument") ? yield* Le() : a.includes("table") || a.includes("data") || a.includes("list") || a.includes("show") ? yield* Be() : a.includes("proposal") || a.includes("suggest") || a.includes("recommend") ? yield* Pe() : a.includes("entity") || a.includes("card") || a.includes("detail") || a.includes("find") ? yield* $e() : a.includes("help") || a.includes("what can") || a.includes("how do") ? yield* De() : a.includes("error") || a.includes("fail") || a.includes("break") ? yield* Re() : yield* Ee(a);
52
+ const t = [...e.messages].reverse().find((r) => r.role === "user"), a = t ? Me(t).toLowerCase() : "";
53
+ a.includes("activity") || a.includes("progress") || a.includes("document") || a.includes("dokument") ? yield* Be() : a.includes("table") || a.includes("data") || a.includes("list") || a.includes("show") ? yield* Pe() : a.includes("proposal") || a.includes("suggest") || a.includes("recommend") ? yield* $e() : a.includes("entity") || a.includes("card") || a.includes("detail") || a.includes("find") ? yield* De() : a.includes("help") || a.includes("what can") || a.includes("how do") ? yield* Re() : a.includes("error") || a.includes("fail") || a.includes("break") ? yield* Ee() : yield* He(a);
54
54
  }
55
55
  };
56
- async function* Le() {
56
+ async function* Be() {
57
57
  yield {
58
58
  type: "part",
59
59
  part: {
@@ -63,7 +63,7 @@ async function* Le() {
63
63
  description: "Looking for the best skill for this request.",
64
64
  status: "running"
65
65
  }
66
- }, await g(700), yield {
66
+ }, await b(700), yield {
67
67
  type: "part",
68
68
  part: {
69
69
  type: "activity",
@@ -72,7 +72,7 @@ async function* Le() {
72
72
  description: "Using Document Search.",
73
73
  status: "done"
74
74
  }
75
- }, await g(300), yield {
75
+ }, await b(300), yield {
76
76
  type: "part",
77
77
  part: {
78
78
  type: "activity",
@@ -81,7 +81,7 @@ async function* Le() {
81
81
  description: "Looking up document by ID.",
82
82
  status: "running"
83
83
  }
84
- }, await g(900), yield {
84
+ }, await b(900), yield {
85
85
  type: "part",
86
86
  part: {
87
87
  type: "activity",
@@ -90,13 +90,13 @@ async function* Le() {
90
90
  description: "Found document INV-2024-0894.",
91
91
  status: "done"
92
92
  }
93
- }, await g(300), yield* x(`
93
+ }, await b(300), yield* x(`
94
94
  Found document **INV-2024-0894** from **DataSys a.s.** for **CZK 390 000**.`, 25), yield { type: "done" };
95
95
  }
96
- async function* Be() {
96
+ async function* Pe() {
97
97
  yield* x(`Here is a summary of the data you requested:
98
98
 
99
- `, 30), await g(400), yield {
99
+ `, 30), await b(400), yield {
100
100
  type: "part",
101
101
  part: {
102
102
  type: "table",
@@ -109,13 +109,13 @@ async function* Be() {
109
109
  { Name: "Item Epsilon", Category: "Type B", Value: "2,200", Status: "Active" }
110
110
  ]
111
111
  }
112
- }, await g(300), yield* x(`
112
+ }, await b(300), yield* x(`
113
113
  Total across all entries: **7,900** — Type A accounts for the largest share at 53%.`, 25), yield { type: "done" };
114
114
  }
115
- async function* Pe() {
115
+ async function* $e() {
116
116
  yield* x(`Based on the current data, I have a suggestion for you:
117
117
 
118
- `, 30), await g(500), yield {
118
+ `, 30), await b(500), yield {
119
119
  type: "part",
120
120
  part: {
121
121
  type: "proposal",
@@ -130,10 +130,10 @@ async function* Pe() {
130
130
  }
131
131
  }, yield { type: "done" };
132
132
  }
133
- async function* $e() {
133
+ async function* De() {
134
134
  yield* x(`I found these records matching your request:
135
135
 
136
- `, 30), await g(400), yield {
136
+ `, 30), await b(400), yield {
137
137
  type: "part",
138
138
  part: {
139
139
  type: "entity-list",
@@ -162,10 +162,10 @@ async function* $e() {
162
162
  }
163
163
  ]
164
164
  }
165
- }, await g(300), yield* x(`
165
+ }, await b(300), yield* x(`
166
166
  Here is the detail of the first one:
167
167
 
168
- `, 25), await g(300), yield {
168
+ `, 25), await b(300), yield {
169
169
  type: "part",
170
170
  part: {
171
171
  type: "entity",
@@ -184,35 +184,35 @@ Here is the detail of the first one:
184
184
  }
185
185
  }, yield { type: "done" };
186
186
  }
187
- async function* De() {
187
+ async function* Re() {
188
188
  yield* x(`I'm a general-purpose AI assistant. Here's what I can help with:
189
189
 
190
- `, 30), await g(200), yield* x(`- **Summarise data** — ask me to show, list, or summarise information
191
- `, 22), await g(150), yield* x(`- **Make suggestions** — ask me to recommend or propose something
192
- `, 22), await g(150), yield* x(`- **Answer questions** — ask me anything and I'll do my best
193
- `, 22), await g(200), yield* x(`
190
+ `, 30), await b(200), yield* x(`- **Summarise data** — ask me to show, list, or summarise information
191
+ `, 22), await b(150), yield* x(`- **Make suggestions** — ask me to recommend or propose something
192
+ `, 22), await b(150), yield* x(`- **Answer questions** — ask me anything and I'll do my best
193
+ `, 22), await b(200), yield* x(`
194
194
  Try asking: *"Show me the data"* or *"Can you suggest something?"*`, 25), yield { type: "done" };
195
195
  }
196
- async function* Re() {
197
- yield* x("Attempting to process your request…", 30), await g(800), yield { type: "error", message: "Simulated error: the upstream service returned an unexpected response." };
196
+ async function* Ee() {
197
+ yield* x("Attempting to process your request…", 30), await b(800), yield { type: "error", message: "Simulated error: the upstream service returned an unexpected response." };
198
198
  }
199
- async function* Ee(e) {
199
+ async function* He(e) {
200
200
  yield* x(`Got it — you asked about *"${e || "your request"}"*.
201
201
 
202
- `, 30), await g(400), yield* x(`I'm a **mock adapter** used for development. I respond to a few trigger words:
202
+ `, 30), await b(400), yield* x(`I'm a **mock adapter** used for development. I respond to a few trigger words:
203
203
 
204
- `, 25), await g(200), yield* x(`- Say **"show"**, **"list"**, **"data"**, or **"table"** → renders a data table
205
- `, 22), await g(150), yield* x(`- Say **"suggest"**, **"recommend"**, or **"proposal"** → renders a proposal card
206
- `, 22), await g(150), yield* x(`- Say **"entity"**, **"card"**, **"detail"**, or **"find"** → renders entity cards
207
- `, 22), await g(150), yield* x(`- Say **"help"** or **"what can you do"** → shows capabilities
208
- `, 22), await g(150), yield* x(`- Say **"error"** or **"fail"** → simulates an error response
204
+ `, 25), await b(200), yield* x(`- Say **"show"**, **"list"**, **"data"**, or **"table"** → renders a data table
205
+ `, 22), await b(150), yield* x(`- Say **"suggest"**, **"recommend"**, or **"proposal"** → renders a proposal card
206
+ `, 22), await b(150), yield* x(`- Say **"entity"**, **"card"**, **"detail"**, or **"find"** → renders entity cards
207
+ `, 22), await b(150), yield* x(`- Say **"help"** or **"what can you do"** → shows capabilities
208
+ `, 22), await b(150), yield* x(`- Say **"error"** or **"fail"** → simulates an error response
209
209
  `, 22), yield { type: "done" };
210
210
  }
211
211
  async function* x(e, t) {
212
212
  for (let r = 0; r < e.length; r += 3)
213
- yield { type: "text", text: e.slice(r, r + 3) }, await g(t);
213
+ yield { type: "text", text: e.slice(r, r + 3) }, await b(t);
214
214
  }
215
- function ve(e) {
215
+ function we(e) {
216
216
  if (!e || e === "[DONE]") return [];
217
217
  let t;
218
218
  try {
@@ -245,19 +245,19 @@ function ve(e) {
245
245
  return [];
246
246
  }
247
247
  }
248
- function ln(e, t = {}) {
248
+ function dn(e, t = {}) {
249
249
  const {
250
250
  method: a = "POST",
251
251
  headers: r = {},
252
252
  getHeaders: s,
253
- getBody: i,
253
+ getBody: o,
254
254
  getMessages: d,
255
- parseEvent: o = Ve,
255
+ parseEvent: i = Ve,
256
256
  credentials: l
257
257
  } = t;
258
258
  return {
259
259
  async *sendMessage(u) {
260
- const p = s ? await s(u) : {}, c = d ? await d(u.messages) : u.messages, f = { ...u, messages: c }, C = i ? i(f) : { messages: f.messages, context: f.context }, y = await fetch(e, {
260
+ const p = s ? await s(u) : {}, c = d ? await d(u.messages) : u.messages, f = { ...u, messages: c }, C = o ? o(f) : { messages: f.messages, context: f.context }, y = await fetch(e, {
261
261
  method: a,
262
262
  credentials: l,
263
263
  headers: {
@@ -268,30 +268,30 @@ function ln(e, t = {}) {
268
268
  body: JSON.stringify(C)
269
269
  });
270
270
  if (!y.ok) {
271
- const M = await y.text().catch(() => `HTTP ${y.status}`);
272
- yield { type: "error", message: `Request failed (${y.status}): ${M}` };
271
+ const I = await y.text().catch(() => `HTTP ${y.status}`);
272
+ yield { type: "error", message: `Request failed (${y.status}): ${I}` };
273
273
  return;
274
274
  }
275
275
  if (!y.body) {
276
276
  yield { type: "error", message: "Response body is empty — server may not support streaming." };
277
277
  return;
278
278
  }
279
- yield* He(y.body, o);
279
+ yield* qe(y.body, i);
280
280
  }
281
281
  };
282
282
  }
283
- async function* He(e, t) {
283
+ async function* qe(e, t) {
284
284
  const a = e.getReader(), r = new TextDecoder();
285
285
  let s = "";
286
286
  try {
287
287
  for (; ; ) {
288
- const { done: i, value: d } = await a.read();
289
- if (i) break;
288
+ const { done: o, value: d } = await a.read();
289
+ if (o) break;
290
290
  s += r.decode(d, { stream: !0 });
291
- const o = s.split(`
291
+ const i = s.split(`
292
292
  `);
293
- s = o.pop() ?? "";
294
- for (const l of o) {
293
+ s = i.pop() ?? "";
294
+ for (const l of i) {
295
295
  const u = l.trim();
296
296
  if (!(!u || u.startsWith(":")) && u.startsWith("data: ")) {
297
297
  const p = u.slice(6);
@@ -312,7 +312,7 @@ async function* He(e, t) {
312
312
  }
313
313
  const Ve = (e) => {
314
314
  if (!e || e === "[DONE]") return [];
315
- const t = ve(e);
315
+ const t = we(e);
316
316
  if (t.length > 0) return t;
317
317
  try {
318
318
  const a = JSON.parse(e);
@@ -324,20 +324,20 @@ const Ve = (e) => {
324
324
  return [];
325
325
  }
326
326
  };
327
- function dn(e, t = {}) {
327
+ function un(e, t = {}) {
328
328
  const {
329
329
  method: a = "POST",
330
330
  headers: r = {},
331
331
  getHeaders: s,
332
- getBody: i,
333
- parseChunk: d = qe,
334
- credentials: o
332
+ getBody: o,
333
+ parseChunk: d = We,
334
+ credentials: i
335
335
  } = t;
336
336
  return {
337
337
  async *sendMessage(l) {
338
- const u = s ? await s(l) : {}, p = i ? i(l) : { messages: l.messages, context: l.context }, c = await fetch(e, {
338
+ const u = s ? await s(l) : {}, p = o ? o(l) : { messages: l.messages, context: l.context }, c = await fetch(e, {
339
339
  method: a,
340
- credentials: o,
340
+ credentials: i,
341
341
  headers: {
342
342
  "Content-Type": "application/json",
343
343
  ...r,
@@ -363,13 +363,13 @@ async function* Oe(e, t) {
363
363
  let s = "";
364
364
  try {
365
365
  for (; ; ) {
366
- const { done: i, value: d } = await a.read();
367
- if (i) break;
366
+ const { done: o, value: d } = await a.read();
367
+ if (o) break;
368
368
  s += r.decode(d, { stream: !0 });
369
- const o = s.split(`
369
+ const i = s.split(`
370
370
  `);
371
- s = o.pop() ?? "";
372
- for (const l of o) {
371
+ s = i.pop() ?? "";
372
+ for (const l of i) {
373
373
  const u = l.trim();
374
374
  if (!u) continue;
375
375
  const p = t(u);
@@ -378,8 +378,8 @@ async function* Oe(e, t) {
378
378
  }
379
379
  }
380
380
  if (s.trim()) {
381
- const i = t(s.trim());
382
- for (const d of i)
381
+ const o = t(s.trim());
382
+ for (const d of o)
383
383
  if (yield d, d.type === "done" || d.type === "error") return;
384
384
  }
385
385
  } finally {
@@ -387,90 +387,90 @@ async function* Oe(e, t) {
387
387
  }
388
388
  yield { type: "done" };
389
389
  }
390
- const qe = (e) => {
391
- const t = ve(e);
390
+ const We = (e) => {
391
+ const t = we(e);
392
392
  return t.length > 0 ? t : e ? [{ type: "text", text: e }] : [];
393
393
  };
394
- let We = 0;
395
- const ne = () => `msg-${++We}-${Date.now()}`, ye = Ae;
396
- function Fe({
394
+ let Fe = 0;
395
+ const ne = () => `msg-${++Fe}-${Date.now()}`, ye = ze;
396
+ function Ze({
397
397
  adapter: e,
398
398
  context: t,
399
399
  onProposalConfirm: a,
400
400
  onProposalCancel: r,
401
401
  initialMessages: s,
402
- historyLimit: i,
402
+ historyLimit: o,
403
403
  onMessagesChange: d
404
404
  }) {
405
- const [o, l] = E(s ?? []), [u, p] = E(""), [c, f] = E(!1), [C, y] = E(!1), [M, A] = E(null), T = W(null), I = W(!1), F = W(d);
406
- oe(() => {
407
- F.current = d;
408
- }), oe(() => {
409
- !I.current || c || (I.current = !1, F.current?.(o));
410
- }, [o, c]);
411
- const j = S((m) => {
405
+ const [i, l] = H(s ?? []), [u, p] = H(""), [c, f] = H(!1), [C, y] = H(!1), [I, S] = H(null), A = F(null), T = F(!1), q = F(d);
406
+ ie(() => {
407
+ q.current = d;
408
+ }), ie(() => {
409
+ !T.current || c || (T.current = !1, q.current?.(i));
410
+ }, [i, c]);
411
+ const z = j((h) => {
412
412
  l((v) => {
413
413
  const _ = v[v.length - 1];
414
414
  if (!_ || _.role !== "assistant") return v;
415
- if (m.type === "activity" && m.id) {
416
- const w = [..._.parts], b = w.findIndex(
417
- (N) => N.type === "activity" && N.id === m.id
415
+ if (h.type === "activity" && h.id) {
416
+ const w = [..._.parts], g = w.findIndex(
417
+ (N) => N.type === "activity" && N.id === h.id
418
418
  );
419
- if (b !== -1)
420
- return w[b] = m, [...v.slice(0, -1), { ..._, parts: w }];
419
+ if (g !== -1)
420
+ return w[g] = h, [...v.slice(0, -1), { ..._, parts: w }];
421
421
  }
422
422
  return [
423
423
  ...v.slice(0, -1),
424
- { ..._, parts: [..._.parts, m] }
424
+ { ..._, parts: [..._.parts, h] }
425
425
  ];
426
426
  });
427
- }, []), H = S((m) => {
427
+ }, []), L = j((h) => {
428
428
  l((v) => {
429
429
  const _ = v[v.length - 1];
430
430
  if (!_ || _.role !== "assistant") return v;
431
- const w = [..._.parts], b = w[w.length - 1];
432
- return b?.type === "text" ? w[w.length - 1] = { type: "text", text: b.text + m } : w.push({ type: "text", text: m }), [...v.slice(0, -1), { ..._, parts: w }];
431
+ const w = [..._.parts], g = w[w.length - 1];
432
+ return g?.type === "text" ? w[w.length - 1] = { type: "text", text: g.text + h } : w.push({ type: "text", text: h }), [...v.slice(0, -1), { ..._, parts: w }];
433
433
  });
434
- }, []), V = S(async (m, v) => {
435
- A(null);
434
+ }, []), V = j(async (h, v) => {
435
+ S(null);
436
436
  const _ = {
437
437
  id: ne(),
438
438
  role: "user",
439
- parts: [{ type: "text", text: m }],
439
+ parts: [{ type: "text", text: h }],
440
440
  createdAt: /* @__PURE__ */ new Date()
441
441
  }, w = ne();
442
- let b = !1;
442
+ let g = !1;
443
443
  const N = () => {
444
- if (b) return;
445
- b = !0;
446
- const $ = {
444
+ if (g) return;
445
+ g = !0;
446
+ const D = {
447
447
  id: w,
448
448
  role: "assistant",
449
449
  parts: [],
450
450
  createdAt: /* @__PURE__ */ new Date()
451
451
  };
452
- l((q) => [...q, $]);
452
+ l((W) => [...W, D]);
453
453
  };
454
- l(($) => [...$, _]), f(!0), y(!0), T.current?.abort();
454
+ l((D) => [...D, _]), f(!0), y(!0), A.current?.abort();
455
455
  const de = new AbortController();
456
- T.current = de;
456
+ A.current = de;
457
457
  try {
458
- const $ = Ie(
458
+ const D = Le(
459
459
  [...v, _],
460
- i ?? Number.POSITIVE_INFINITY
461
- ), q = e.sendMessage({ messages: ye($), context: t });
460
+ o ?? Number.POSITIVE_INFINITY
461
+ ), W = e.sendMessage({ messages: ye(D), context: t });
462
462
  await ue(
463
- q,
463
+ W,
464
464
  (Z) => {
465
465
  switch (y(!1), Z.type) {
466
466
  case "text":
467
- N(), H(Z.text);
467
+ N(), L(Z.text);
468
468
  break;
469
469
  case "part":
470
- N(), j(Z.part);
470
+ N(), z(Z.part);
471
471
  break;
472
472
  case "error":
473
- N(), j({ type: "error", message: Z.message }), A(Z.message);
473
+ N(), z({ type: "error", message: Z.message }), S(Z.message);
474
474
  break;
475
475
  case "done":
476
476
  break;
@@ -478,49 +478,49 @@ function Fe({
478
478
  },
479
479
  de.signal
480
480
  );
481
- } catch ($) {
482
- const q = $ instanceof Error ? $.message : "Unknown error occurred";
483
- A(q), N(), j({ type: "error", message: q });
481
+ } catch (D) {
482
+ const W = D instanceof Error ? D.message : "Unknown error occurred";
483
+ S(W), N(), z({ type: "error", message: W });
484
484
  } finally {
485
- I.current = !0, f(!1), y(!1);
485
+ T.current = !0, f(!1), y(!1);
486
486
  }
487
- }, [e, t, i, H, j]), G = S(async () => {
488
- const m = u.trim();
489
- !m || c || (p(""), await V(m, o));
490
- }, [u, c, o, V]), Q = S(async (m) => {
491
- !m.trim() || c || await V(m, o);
492
- }, [c, o, V]), Y = S(async (m) => {
487
+ }, [e, t, o, L, z]), G = j(async () => {
488
+ const h = u.trim();
489
+ !h || c || (p(""), await V(h, i));
490
+ }, [u, c, i, V]), Q = j(async (h) => {
491
+ !h.trim() || c || await V(h, i);
492
+ }, [c, i, V]), Y = j(async (h) => {
493
493
  if (c) return;
494
- A(null), f(!0), y(!0);
494
+ S(null), f(!0), y(!0);
495
495
  const v = {
496
496
  id: ne(),
497
497
  role: "assistant",
498
498
  parts: [],
499
499
  createdAt: /* @__PURE__ */ new Date()
500
500
  };
501
- l((b) => [...b, v]), T.current?.abort();
501
+ l((g) => [...g, v]), A.current?.abort();
502
502
  const _ = new AbortController();
503
- T.current = _;
503
+ A.current = _;
504
504
  const w = {
505
505
  id: ne(),
506
506
  role: "system",
507
- parts: [{ type: "text", text: m }],
507
+ parts: [{ type: "text", text: h }],
508
508
  createdAt: /* @__PURE__ */ new Date()
509
509
  };
510
510
  try {
511
- const b = e.sendMessage({ messages: ye([w]), context: t });
511
+ const g = e.sendMessage({ messages: ye([w]), context: t });
512
512
  await ue(
513
- b,
513
+ g,
514
514
  (N) => {
515
515
  switch (y(!1), N.type) {
516
516
  case "text":
517
- H(N.text);
517
+ L(N.text);
518
518
  break;
519
519
  case "part":
520
- j(N.part);
520
+ z(N.part);
521
521
  break;
522
522
  case "error":
523
- j({ type: "error", message: N.message }), A(N.message);
523
+ z({ type: "error", message: N.message }), S(N.message);
524
524
  break;
525
525
  case "done":
526
526
  break;
@@ -528,30 +528,30 @@ function Fe({
528
528
  },
529
529
  _.signal
530
530
  );
531
- } catch (b) {
532
- const N = b instanceof Error ? b.message : "Unknown error occurred";
533
- A(N), j({ type: "error", message: N });
531
+ } catch (g) {
532
+ const N = g instanceof Error ? g.message : "Unknown error occurred";
533
+ S(N), z({ type: "error", message: N });
534
534
  } finally {
535
- I.current = !0, f(!1), y(!1);
535
+ T.current = !0, f(!1), y(!1);
536
536
  }
537
- }, [c, e, t, H, j]), X = S(() => {
538
- T.current?.abort(), f(!1), y(!1);
539
- }, []), ee = S((m) => {
540
- T.current?.abort(), I.current = !0, l(m ?? []), p(""), A(null), f(!1), y(!1);
541
- }, []), O = S((m, v) => {
542
- I.current = !0, l((_) => _.map((w) => ({
537
+ }, [c, e, t, L, z]), X = j(() => {
538
+ A.current?.abort(), f(!1), y(!1);
539
+ }, []), ee = j((h) => {
540
+ A.current?.abort(), T.current = !0, l(h ?? []), p(""), S(null), f(!1), y(!1);
541
+ }, []), O = j((h, v) => {
542
+ T.current = !0, l((_) => _.map((w) => ({
543
543
  ...w,
544
544
  parts: w.parts.map(
545
- (b) => be(b) && b.proposal.id === m ? { ...b, proposal: { ...b.proposal, resolved: v } } : b
545
+ (g) => ve(g) && g.proposal.id === h ? { ...g, proposal: { ...g.proposal, resolved: v } } : g
546
546
  )
547
547
  })));
548
- }, []), te = S((m, v) => {
549
- O(m, "confirmed"), a?.(m, v);
550
- }, [a, O]), ae = S((m) => {
551
- O(m, "cancelled"), r?.(m);
548
+ }, []), te = j((h, v) => {
549
+ O(h, "confirmed"), a?.(h, v);
550
+ }, [a, O]), ae = j((h) => {
551
+ O(h, "cancelled"), r?.(h);
552
552
  }, [r, O]);
553
- return fe(() => ({
554
- messages: o,
553
+ return ge(() => ({
554
+ messages: i,
555
555
  input: u,
556
556
  setInput: p,
557
557
  sendMessage: G,
@@ -560,12 +560,12 @@ function Fe({
560
560
  stop: X,
561
561
  isLoading: c,
562
562
  isConnecting: C,
563
- error: M,
563
+ error: I,
564
564
  reset: ee,
565
565
  confirmProposal: te,
566
566
  cancelProposal: ae
567
567
  }), [
568
- o,
568
+ i,
569
569
  u,
570
570
  G,
571
571
  Q,
@@ -573,13 +573,13 @@ function Fe({
573
573
  X,
574
574
  c,
575
575
  C,
576
- M,
576
+ I,
577
577
  ee,
578
578
  te,
579
579
  ae
580
580
  ]);
581
581
  }
582
- const we = {
582
+ const xe = {
583
583
  sidebarTitle: "AI Assistant",
584
584
  clearConversation: "Clear conversation",
585
585
  resetConversation: "Reset conversation",
@@ -606,29 +606,29 @@ const we = {
606
606
  actionRules: "Rules",
607
607
  historyEmpty: "No previous chats",
608
608
  historyDeleteChat: "Delete chat"
609
- }, xe = ge(we);
610
- function R() {
611
- return ce(xe);
609
+ }, Ce = be(xe);
610
+ function E() {
611
+ return ce(Ce);
612
612
  }
613
- const Ze = "_root_14q8g_1", Je = {
614
- root: Ze
613
+ const Je = "_root_1etc2_1", Ue = {
614
+ root: Je
615
615
  };
616
- function un({ children: e, theme: t, labels: a, defaultTitle: r, className: s, style: i }) {
616
+ function pn({ children: e, theme: t, labels: a, defaultTitle: r, className: s, style: o }) {
617
617
  const d = {
618
- ...we,
618
+ ...xe,
619
619
  ...r ? { sidebarTitle: r } : {},
620
620
  ...a
621
- }, o = t ? Ue(t) : void 0;
622
- return /* @__PURE__ */ n(xe.Provider, { value: d, children: /* @__PURE__ */ n(
621
+ }, i = t ? Ke(t) : void 0;
622
+ return /* @__PURE__ */ n(Ce.Provider, { value: d, children: /* @__PURE__ */ n(
623
623
  "div",
624
624
  {
625
- className: [Je.root, s].filter(Boolean).join(" "),
626
- style: { ...o, ...i },
625
+ className: [Ue.root, s].filter(Boolean).join(" "),
626
+ style: { ...i, ...o },
627
627
  children: e
628
628
  }
629
629
  ) });
630
630
  }
631
- function Ue(e) {
631
+ function Ke(e) {
632
632
  const t = {
633
633
  "--juneau-color-primary": e.colorPrimary,
634
634
  "--juneau-color-primary-dark": e.colorPrimaryDark,
@@ -677,8 +677,8 @@ function Ue(e) {
677
677
  Object.entries(t).filter(([, a]) => a !== void 0)
678
678
  );
679
679
  }
680
- const le = ge(null);
681
- function Ke() {
680
+ const le = be(null);
681
+ function Ge() {
682
682
  const e = ce(le);
683
683
  if (!e)
684
684
  throw new Error(
@@ -686,34 +686,34 @@ function Ke() {
686
686
  );
687
687
  return e;
688
688
  }
689
- function pn() {
689
+ function yn() {
690
690
  return ce(le);
691
691
  }
692
- function yn({
692
+ function hn({
693
693
  adapter: e,
694
694
  context: t,
695
695
  onProposalConfirm: a,
696
696
  onProposalCancel: r,
697
697
  initialMessages: s,
698
- historyLimit: i,
698
+ historyLimit: o,
699
699
  onMessagesChange: d,
700
- children: o
700
+ children: i
701
701
  }) {
702
- const [l, u] = E(t), p = S((C) => {
702
+ const [l, u] = H(t), p = j((C) => {
703
703
  u(typeof C == "function" ? (y) => C(y) : C);
704
- }, []), c = Fe({
704
+ }, []), c = Ze({
705
705
  adapter: e,
706
706
  context: l,
707
707
  onProposalConfirm: a,
708
708
  onProposalCancel: r,
709
709
  initialMessages: s,
710
- historyLimit: i,
710
+ historyLimit: o,
711
711
  onMessagesChange: d
712
- }), f = fe(
712
+ }), f = ge(
713
713
  () => ({ ...c, setContext: p }),
714
714
  [c, p]
715
715
  );
716
- return /* @__PURE__ */ n(le.Provider, { value: f, children: o });
716
+ return /* @__PURE__ */ n(le.Provider, { value: f, children: i });
717
717
  }
718
718
  const mn = {
719
719
  sidebarTitle: "AI Asistent",
@@ -743,7 +743,7 @@ const mn = {
743
743
  historyEmpty: "Žádné předchozí konverzace",
744
744
  historyDeleteChat: "Smazat konverzaci"
745
745
  };
746
- function Ce({ className: e, style: t, "aria-hidden": a = !0 }) {
746
+ function Ne({ className: e, style: t, "aria-hidden": a = !0 }) {
747
747
  return /* @__PURE__ */ n(
748
748
  "svg",
749
749
  {
@@ -759,7 +759,7 @@ function Ce({ className: e, style: t, "aria-hidden": a = !0 }) {
759
759
  }
760
760
  );
761
761
  }
762
- function Ge({ className: e, style: t, "aria-hidden": a = !0 }) {
762
+ function Qe({ className: e, style: t, "aria-hidden": a = !0 }) {
763
763
  return /* @__PURE__ */ n(
764
764
  "svg",
765
765
  {
@@ -775,7 +775,7 @@ function Ge({ className: e, style: t, "aria-hidden": a = !0 }) {
775
775
  }
776
776
  );
777
777
  }
778
- function Qe({ className: e, style: t, "aria-hidden": a = !0 }) {
778
+ function Ye({ className: e, style: t, "aria-hidden": a = !0 }) {
779
779
  return /* @__PURE__ */ n(
780
780
  "svg",
781
781
  {
@@ -791,7 +791,7 @@ function Qe({ className: e, style: t, "aria-hidden": a = !0 }) {
791
791
  }
792
792
  );
793
793
  }
794
- function Ye({ className: e, style: t, "aria-hidden": a = !0 }) {
794
+ function Xe({ className: e, style: t, "aria-hidden": a = !0 }) {
795
795
  return /* @__PURE__ */ n(
796
796
  "svg",
797
797
  {
@@ -807,7 +807,7 @@ function Ye({ className: e, style: t, "aria-hidden": a = !0 }) {
807
807
  }
808
808
  );
809
809
  }
810
- function Xe({ className: e, style: t, "aria-hidden": a = !0 }) {
810
+ function et({ className: e, style: t, "aria-hidden": a = !0 }) {
811
811
  return /* @__PURE__ */ n(
812
812
  "svg",
813
813
  {
@@ -823,7 +823,7 @@ function Xe({ className: e, style: t, "aria-hidden": a = !0 }) {
823
823
  }
824
824
  );
825
825
  }
826
- function et({ className: e, style: t, "aria-hidden": a = !0 }) {
826
+ function tt({ className: e, style: t, "aria-hidden": a = !0 }) {
827
827
  return /* @__PURE__ */ n(
828
828
  "svg",
829
829
  {
@@ -839,7 +839,7 @@ function et({ className: e, style: t, "aria-hidden": a = !0 }) {
839
839
  }
840
840
  );
841
841
  }
842
- function tt({ className: e, style: t, "aria-hidden": a = !0 }) {
842
+ function at({ className: e, style: t, "aria-hidden": a = !0 }) {
843
843
  return /* @__PURE__ */ n(
844
844
  "svg",
845
845
  {
@@ -855,7 +855,7 @@ function tt({ className: e, style: t, "aria-hidden": a = !0 }) {
855
855
  }
856
856
  );
857
857
  }
858
- function at({ className: e, style: t, "aria-hidden": a = !0 }) {
858
+ function nt({ className: e, style: t, "aria-hidden": a = !0 }) {
859
859
  return /* @__PURE__ */ n(
860
860
  "svg",
861
861
  {
@@ -871,7 +871,7 @@ function at({ className: e, style: t, "aria-hidden": a = !0 }) {
871
871
  }
872
872
  );
873
873
  }
874
- function nt({ className: e, style: t, "aria-hidden": a = !0 }) {
874
+ function st({ className: e, style: t, "aria-hidden": a = !0 }) {
875
875
  return /* @__PURE__ */ n(
876
876
  "svg",
877
877
  {
@@ -887,7 +887,7 @@ function nt({ className: e, style: t, "aria-hidden": a = !0 }) {
887
887
  }
888
888
  );
889
889
  }
890
- function st({ className: e, style: t, "aria-hidden": a = !0 }) {
890
+ function rt({ className: e, style: t, "aria-hidden": a = !0 }) {
891
891
  return /* @__PURE__ */ n(
892
892
  "svg",
893
893
  {
@@ -903,7 +903,7 @@ function st({ className: e, style: t, "aria-hidden": a = !0 }) {
903
903
  }
904
904
  );
905
905
  }
906
- function rt({ className: e, style: t, "aria-hidden": a = !0 }) {
906
+ function ot({ className: e, style: t, "aria-hidden": a = !0 }) {
907
907
  return /* @__PURE__ */ n(
908
908
  "svg",
909
909
  {
@@ -919,49 +919,49 @@ function rt({ className: e, style: t, "aria-hidden": a = !0 }) {
919
919
  }
920
920
  );
921
921
  }
922
- const it = "_wrapper_v5oy7_1", ot = "_table_v5oy7_8", ct = "_th_v5oy7_14", lt = "_tr_v5oy7_24", dt = "_td_v5oy7_32", J = {
922
+ const it = "_wrapper_izvjy_1", ct = "_table_izvjy_15", lt = "_th_izvjy_27", dt = "_tr_izvjy_47", ut = "_td_izvjy_63", J = {
923
923
  wrapper: it,
924
- table: ot,
925
- th: ct,
926
- tr: lt,
927
- td: dt
924
+ table: ct,
925
+ th: lt,
926
+ tr: dt,
927
+ td: ut
928
928
  };
929
- function ut({ part: e }) {
930
- return /* @__PURE__ */ n("div", { className: J.wrapper, "data-juneau": "table-part", children: /* @__PURE__ */ h("table", { className: J.table, children: [
929
+ function pt({ part: e }) {
930
+ return /* @__PURE__ */ n("div", { className: J.wrapper, "data-juneau": "table-part", children: /* @__PURE__ */ m("table", { className: J.table, children: [
931
931
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ n("tr", { children: e.columns.map((t) => /* @__PURE__ */ n("th", { className: J.th, children: t }, t)) }) }),
932
932
  /* @__PURE__ */ n("tbody", { children: e.rows.map((t, a) => /* @__PURE__ */ n("tr", { className: J.tr, children: e.columns.map((r) => /* @__PURE__ */ n("td", { className: J.td, children: String(t[r] ?? "") }, r)) }, a)) })
933
933
  ] }) });
934
934
  }
935
- const pt = "_card_1un2m_1", yt = "_header_1un2m_9", mt = "_icon_1un2m_16", ht = "_title_1un2m_24", ft = "_description_1un2m_30", gt = "_cardResolved_1un2m_37", _t = "_resolvedBadge_1un2m_41", bt = "_actions_1un2m_52", vt = "_confirm_1un2m_57", wt = "_cancel_1un2m_73", z = {
936
- card: pt,
937
- header: yt,
935
+ const yt = "_card_99bqr_1", ht = "_header_99bqr_17", mt = "_icon_99bqr_31", ft = "_title_99bqr_47", gt = "_description_99bqr_59", bt = "_cardResolved_99bqr_73", _t = "_resolvedBadge_99bqr_81", vt = "_actions_99bqr_103", wt = "_confirm_99bqr_113", xt = "_cancel_99bqr_145", M = {
936
+ card: yt,
937
+ header: ht,
938
938
  icon: mt,
939
- title: ht,
940
- description: ft,
941
- cardResolved: gt,
939
+ title: ft,
940
+ description: gt,
941
+ cardResolved: bt,
942
942
  resolvedBadge: _t,
943
- actions: bt,
944
- confirm: vt,
945
- cancel: wt
943
+ actions: vt,
944
+ confirm: wt,
945
+ cancel: xt
946
946
  };
947
- function xt({ part: e, onConfirm: t, onCancel: a }) {
948
- const r = R(), { proposal: s } = e, i = s.resolved === "confirmed" ? r.proposalConfirmed : s.resolved === "cancelled" ? r.proposalCancelled : s.resolved === "expired" ? r.proposalExpired : null;
949
- return /* @__PURE__ */ h(
947
+ function Ct({ part: e, onConfirm: t, onCancel: a }) {
948
+ const r = E(), { proposal: s } = e, o = s.resolved === "confirmed" ? r.proposalConfirmed : s.resolved === "cancelled" ? r.proposalCancelled : s.resolved === "expired" ? r.proposalExpired : null;
949
+ return /* @__PURE__ */ m(
950
950
  "div",
951
951
  {
952
- className: s.resolved ? `${z.card} ${z.cardResolved}` : z.card,
952
+ className: s.resolved ? `${M.card} ${M.cardResolved}` : M.card,
953
953
  "data-juneau": "proposal-card",
954
954
  children: [
955
- /* @__PURE__ */ h("div", { className: z.header, children: [
956
- /* @__PURE__ */ n("svg", { className: z.icon, viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M10 1a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 1zM5.05 3.05a.75.75 0 011.06 1.06l-1.06 1.06a.75.75 0 11-1.06-1.06l1.06-1.06zm9.9 0a.75.75 0 010 1.06l-1.06 1.06a.75.75 0 11-1.06-1.06l1.06-1.06a.75.75 0 011.06 0zM10 6a4 4 0 100 8 4 4 0 000-8zm-9 4a.75.75 0 01.75-.75h1.5a.75.75 0 010 1.5h-1.5A.75.75 0 011 10zm15.75-.75a.75.75 0 000 1.5h1.5a.75.75 0 000-1.5h-1.5zM4.11 14.89a.75.75 0 010 1.06l-1.06 1.06a.75.75 0 11-1.06-1.06l1.06-1.06a.75.75 0 011.06 0zm11.84 1.06a.75.75 0 10-1.06-1.06l-1.06 1.06a.75.75 0 101.06 1.06l1.06-1.06zM10 17.25a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5a.75.75 0 01.75-.75z" }) }),
957
- /* @__PURE__ */ n("span", { className: z.title, children: s.title })
955
+ /* @__PURE__ */ m("div", { className: M.header, children: [
956
+ /* @__PURE__ */ n("svg", { className: M.icon, viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M10 1a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 1zM5.05 3.05a.75.75 0 011.06 1.06l-1.06 1.06a.75.75 0 11-1.06-1.06l1.06-1.06zm9.9 0a.75.75 0 010 1.06l-1.06 1.06a.75.75 0 11-1.06-1.06l1.06-1.06a.75.75 0 011.06 0zM10 6a4 4 0 100 8 4 4 0 000-8zm-9 4a.75.75 0 01.75-.75h1.5a.75.75 0 010 1.5h-1.5A.75.75 0 011 10zm15.75-.75a.75.75 0 000 1.5h1.5a.75.75 0 000-1.5h-1.5zM4.11 14.89a.75.75 0 010 1.06l-1.06 1.06a.75.75 0 11-1.06-1.06l1.06-1.06a.75.75 0 011.06 0zm11.84 1.06a.75.75 0 10-1.06-1.06l-1.06 1.06a.75.75 0 101.06 1.06l1.06-1.06zM10 17.25a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5a.75.75 0 01.75-.75z" }) }),
957
+ /* @__PURE__ */ n("span", { className: M.title, children: s.title })
958
958
  ] }),
959
- s.description && /* @__PURE__ */ n("p", { className: z.description, children: s.description }),
960
- i ? /* @__PURE__ */ n("span", { className: z.resolvedBadge, children: i }) : /* @__PURE__ */ h("div", { className: z.actions, children: [
959
+ s.description && /* @__PURE__ */ n("p", { className: M.description, children: s.description }),
960
+ o ? /* @__PURE__ */ n("span", { className: M.resolvedBadge, children: o }) : /* @__PURE__ */ m("div", { className: M.actions, children: [
961
961
  /* @__PURE__ */ n(
962
962
  "button",
963
963
  {
964
- className: z.confirm,
964
+ className: M.confirm,
965
965
  onClick: () => t(s.id, s.payload),
966
966
  children: s.confirmLabel ?? r.proposalConfirm
967
967
  }
@@ -969,7 +969,7 @@ function xt({ part: e, onConfirm: t, onCancel: a }) {
969
969
  /* @__PURE__ */ n(
970
970
  "button",
971
971
  {
972
- className: z.cancel,
972
+ className: M.cancel,
973
973
  onClick: () => a(s.id),
974
974
  children: s.cancelLabel ?? r.proposalCancel
975
975
  }
@@ -979,53 +979,53 @@ function xt({ part: e, onConfirm: t, onCancel: a }) {
979
979
  }
980
980
  );
981
981
  }
982
- const Ct = "_activity_2jjfs_1", Nt = "_indicator_2jjfs_13", kt = "_content_2jjfs_36", jt = "_title_2jjfs_40", St = "_description_2jjfs_45", U = {
983
- activity: Ct,
984
- indicator: Nt,
985
- content: kt,
986
- title: jt,
987
- description: St
982
+ const Nt = "_activity_1661l_1", kt = "_indicator_1661l_25", jt = "_content_1661l_71", St = "_title_1661l_79", At = "_description_1661l_89", U = {
983
+ activity: Nt,
984
+ indicator: kt,
985
+ content: jt,
986
+ title: St,
987
+ description: At
988
988
  };
989
- function At({ part: e }) {
990
- return /* @__PURE__ */ h("div", { className: U.activity, "data-status": e.status, "data-juneau": "activity-part", children: [
989
+ function zt({ part: e }) {
990
+ return /* @__PURE__ */ m("div", { className: U.activity, "data-status": e.status, "data-juneau": "activity-part", children: [
991
991
  /* @__PURE__ */ n("span", { className: U.indicator, "aria-hidden": "true" }),
992
- /* @__PURE__ */ h("div", { className: U.content, children: [
992
+ /* @__PURE__ */ m("div", { className: U.content, children: [
993
993
  /* @__PURE__ */ n("div", { className: U.title, children: e.title }),
994
994
  e.description && /* @__PURE__ */ n("div", { className: U.description, children: e.description })
995
995
  ] })
996
996
  ] });
997
997
  }
998
- const zt = "_card_jwkcu_1", Mt = "_cardClickable_jwkcu_14", Tt = "_header_jwkcu_24", It = "_title_jwkcu_30", Lt = "_subtitle_jwkcu_36", Bt = "_fields_jwkcu_41", Pt = "_fieldRow_jwkcu_48", $t = "_fieldLabel_jwkcu_55", Dt = "_fieldValue_jwkcu_61", Rt = "_badge_jwkcu_68", Et = "_badgeSuccess_jwkcu_76", Ht = "_badgeWarning_jwkcu_81", Vt = "_badgeDanger_jwkcu_86", Ot = "_badgeNeutral_jwkcu_91", k = {
999
- card: zt,
1000
- cardClickable: Mt,
998
+ const Mt = "_card_jwkcu_1", It = "_cardClickable_jwkcu_14", Tt = "_header_jwkcu_24", Lt = "_title_jwkcu_30", Bt = "_subtitle_jwkcu_36", Pt = "_fields_jwkcu_41", $t = "_fieldRow_jwkcu_48", Dt = "_fieldLabel_jwkcu_55", Rt = "_fieldValue_jwkcu_61", Et = "_badge_jwkcu_68", Ht = "_badgeSuccess_jwkcu_76", qt = "_badgeWarning_jwkcu_81", Vt = "_badgeDanger_jwkcu_86", Ot = "_badgeNeutral_jwkcu_91", k = {
999
+ card: Mt,
1000
+ cardClickable: It,
1001
1001
  header: Tt,
1002
- title: It,
1003
- subtitle: Lt,
1004
- fields: Bt,
1005
- fieldRow: Pt,
1006
- fieldLabel: $t,
1007
- fieldValue: Dt,
1008
- badge: Rt,
1009
- badgeSuccess: Et,
1010
- badgeWarning: Ht,
1002
+ title: Lt,
1003
+ subtitle: Bt,
1004
+ fields: Pt,
1005
+ fieldRow: $t,
1006
+ fieldLabel: Dt,
1007
+ fieldValue: Rt,
1008
+ badge: Et,
1009
+ badgeSuccess: Ht,
1010
+ badgeWarning: qt,
1011
1011
  badgeDanger: Vt,
1012
1012
  badgeNeutral: Ot
1013
- }, qt = {
1013
+ }, Wt = {
1014
1014
  success: k.badgeSuccess,
1015
1015
  warning: k.badgeWarning,
1016
1016
  danger: k.badgeDanger,
1017
1017
  neutral: k.badgeNeutral
1018
1018
  };
1019
- function Ne({ part: e, onEntityClick: t }) {
1020
- const { entity: a, entityType: r } = e, s = t !== void 0, i = /* @__PURE__ */ h(_e, { children: [
1021
- /* @__PURE__ */ h("div", { className: k.header, children: [
1019
+ function ke({ part: e, onEntityClick: t }) {
1020
+ const { entity: a, entityType: r } = e, s = t !== void 0, o = /* @__PURE__ */ m(_e, { children: [
1021
+ /* @__PURE__ */ m("div", { className: k.header, children: [
1022
1022
  /* @__PURE__ */ n("span", { className: k.title, children: a.title }),
1023
1023
  a.subtitle && /* @__PURE__ */ n("span", { className: k.subtitle, children: a.subtitle })
1024
1024
  ] }),
1025
- a.fields && a.fields.length > 0 && /* @__PURE__ */ n("dl", { className: k.fields, children: a.fields.map((d, o) => /* @__PURE__ */ h("div", { className: k.fieldRow, children: [
1025
+ a.fields && a.fields.length > 0 && /* @__PURE__ */ n("dl", { className: k.fields, children: a.fields.map((d, i) => /* @__PURE__ */ m("div", { className: k.fieldRow, children: [
1026
1026
  /* @__PURE__ */ n("dt", { className: k.fieldLabel, children: d.label }),
1027
- /* @__PURE__ */ n("dd", { className: k.fieldValue, children: d.badge ? /* @__PURE__ */ n("span", { className: `${k.badge} ${qt[d.badge]}`, children: d.value }) : d.value })
1028
- ] }, o)) })
1027
+ /* @__PURE__ */ n("dd", { className: k.fieldValue, children: d.badge ? /* @__PURE__ */ n("span", { className: `${k.badge} ${Wt[d.badge]}`, children: d.value }) : d.value })
1028
+ ] }, i)) })
1029
1029
  ] });
1030
1030
  return s ? /* @__PURE__ */ n(
1031
1031
  "button",
@@ -1034,19 +1034,19 @@ function Ne({ part: e, onEntityClick: t }) {
1034
1034
  className: `${k.card} ${k.cardClickable}`,
1035
1035
  onClick: () => t(a, r),
1036
1036
  "data-juneau": "entity-card",
1037
- children: i
1037
+ children: o
1038
1038
  }
1039
- ) : /* @__PURE__ */ n("div", { className: k.card, "data-juneau": "entity-card", children: i });
1039
+ ) : /* @__PURE__ */ n("div", { className: k.card, "data-juneau": "entity-card", children: o });
1040
1040
  }
1041
- const Wt = "_list_a2maw_1", Ft = "_listTitle_a2maw_11", me = {
1042
- list: Wt,
1043
- listTitle: Ft
1041
+ const Ft = "_list_a2maw_1", Zt = "_listTitle_a2maw_11", he = {
1042
+ list: Ft,
1043
+ listTitle: Zt
1044
1044
  };
1045
- function Zt({ part: e, onEntityClick: t }) {
1046
- return /* @__PURE__ */ h("div", { className: me.list, "data-juneau": "entity-list-part", children: [
1047
- e.title && /* @__PURE__ */ n("span", { className: me.listTitle, children: e.title }),
1045
+ function Jt({ part: e, onEntityClick: t }) {
1046
+ return /* @__PURE__ */ m("div", { className: he.list, "data-juneau": "entity-list-part", children: [
1047
+ e.title && /* @__PURE__ */ n("span", { className: he.listTitle, children: e.title }),
1048
1048
  e.entities.map((a, r) => /* @__PURE__ */ n(
1049
- Ne,
1049
+ ke,
1050
1050
  {
1051
1051
  part: { type: "entity", entity: a, entityType: e.entityType },
1052
1052
  onEntityClick: t
@@ -1055,28 +1055,28 @@ function Zt({ part: e, onEntityClick: t }) {
1055
1055
  ))
1056
1056
  ] });
1057
1057
  }
1058
- const Jt = "_markdown_1yi3y_1", Ut = "_unknownPart_1yi3y_84", Kt = "_errorText_1yi3y_98", Gt = "_errorIcon_1yi3y_106", se = {
1059
- markdown: Jt,
1060
- unknownPart: Ut,
1061
- errorText: Kt,
1062
- errorIcon: Gt
1058
+ const Ut = "_markdown_sznoh_1", Kt = "_unknownPart_sznoh_167", Gt = "_errorText_sznoh_195", Qt = "_errorIcon_sznoh_211", se = {
1059
+ markdown: Ut,
1060
+ unknownPart: Kt,
1061
+ errorText: Gt,
1062
+ errorIcon: Qt
1063
1063
  };
1064
- function Qt({ part: e, onProposalConfirm: t, onProposalCancel: a, onEntityClick: r, renderPart: s }) {
1064
+ function Yt({ part: e, onProposalConfirm: t, onProposalCancel: a, onEntityClick: r, renderPart: s }) {
1065
1065
  if (s) {
1066
- const i = s(e);
1067
- if (i != null)
1068
- return /* @__PURE__ */ n(_e, { children: i });
1066
+ const o = s(e);
1067
+ if (o != null)
1068
+ return /* @__PURE__ */ n(_e, { children: o });
1069
1069
  }
1070
1070
  switch (e.type) {
1071
1071
  case "text":
1072
- return /* @__PURE__ */ n("div", { className: se.markdown, children: /* @__PURE__ */ n(je, { remarkPlugins: [Se], children: e.text }) });
1072
+ return /* @__PURE__ */ n("div", { className: se.markdown, children: /* @__PURE__ */ n(Se, { remarkPlugins: [Ae], children: e.text }) });
1073
1073
  case "table":
1074
- return /* @__PURE__ */ n(ut, { part: e });
1074
+ return /* @__PURE__ */ n(pt, { part: e });
1075
1075
  case "activity":
1076
- return /* @__PURE__ */ n(At, { part: e });
1076
+ return /* @__PURE__ */ n(zt, { part: e });
1077
1077
  case "proposal":
1078
1078
  return /* @__PURE__ */ n(
1079
- xt,
1079
+ Ct,
1080
1080
  {
1081
1081
  part: e,
1082
1082
  onConfirm: t,
@@ -1084,16 +1084,16 @@ function Qt({ part: e, onProposalConfirm: t, onProposalCancel: a, onEntityClick:
1084
1084
  }
1085
1085
  );
1086
1086
  case "entity":
1087
- return /* @__PURE__ */ n(Ne, { part: e, onEntityClick: r });
1087
+ return /* @__PURE__ */ n(ke, { part: e, onEntityClick: r });
1088
1088
  case "entity-list":
1089
- return /* @__PURE__ */ n(Zt, { part: e, onEntityClick: r });
1089
+ return /* @__PURE__ */ n(Jt, { part: e, onEntityClick: r });
1090
1090
  case "error":
1091
- return /* @__PURE__ */ h("span", { className: se.errorText, children: [
1092
- /* @__PURE__ */ n(rt, { className: se.errorIcon }),
1091
+ return /* @__PURE__ */ m("span", { className: se.errorText, children: [
1092
+ /* @__PURE__ */ n(ot, { className: se.errorIcon }),
1093
1093
  e.message
1094
1094
  ] });
1095
1095
  default:
1096
- return globalThis.process?.env?.NODE_ENV !== "production" ? /* @__PURE__ */ h("div", { className: se.unknownPart, children: [
1096
+ return globalThis.process?.env?.NODE_ENV !== "production" ? /* @__PURE__ */ m("div", { className: se.unknownPart, children: [
1097
1097
  "Unhandled part type: ",
1098
1098
  /* @__PURE__ */ n("code", { children: e.type }),
1099
1099
  " — pass a",
@@ -1103,75 +1103,75 @@ function Qt({ part: e, onProposalConfirm: t, onProposalCancel: a, onEntityClick:
1103
1103
  ] }) : null;
1104
1104
  }
1105
1105
  }
1106
- const Yt = "_wrapper_1q20p_1", Xt = "_user_1q20p_8", ea = "_assistant_1q20p_12", ta = "_avatar_1q20p_16", aa = "_content_1q20p_43", na = "_bubble_1q20p_51", sa = "_card_1q20p_70", ra = "_empty_1q20p_92", L = {
1107
- wrapper: Yt,
1108
- user: Xt,
1109
- assistant: ea,
1110
- avatar: ta,
1111
- content: aa,
1112
- bubble: na,
1113
- card: sa,
1114
- empty: ra
1106
+ const Xt = "_wrapper_1q20p_1", ea = "_user_1q20p_8", ta = "_assistant_1q20p_12", aa = "_avatar_1q20p_16", na = "_content_1q20p_43", sa = "_bubble_1q20p_51", ra = "_card_1q20p_70", oa = "_empty_1q20p_92", B = {
1107
+ wrapper: Xt,
1108
+ user: ea,
1109
+ assistant: ta,
1110
+ avatar: aa,
1111
+ content: na,
1112
+ bubble: sa,
1113
+ card: ra,
1114
+ empty: oa
1115
1115
  }, ia = /* @__PURE__ */ new Set(["text", "error", "activity"]);
1116
- function ke(e) {
1116
+ function je(e) {
1117
1117
  return !ia.has(e.type);
1118
1118
  }
1119
- function oa(e) {
1119
+ function ca(e) {
1120
1120
  const t = [];
1121
1121
  return e.forEach((a, r) => {
1122
- const s = ke(a), i = t[t.length - 1];
1123
- if (i && !s && !i.card) {
1124
- i.parts.push({ part: a, index: r });
1122
+ const s = je(a), o = t[t.length - 1];
1123
+ if (o && !s && !o.card) {
1124
+ o.parts.push({ part: a, index: r });
1125
1125
  return;
1126
1126
  }
1127
1127
  t.push({ card: s, parts: [{ part: a, index: r }] });
1128
1128
  }), t;
1129
1129
  }
1130
- function ca({ message: e, onProposalConfirm: t, onProposalCancel: a, onEntityClick: r, assistantIcon: s, renderPart: i }) {
1131
- const d = R(), o = e.role === "user", l = (p, c) => /* @__PURE__ */ n(
1132
- Qt,
1130
+ function la({ message: e, onProposalConfirm: t, onProposalCancel: a, onEntityClick: r, assistantIcon: s, renderPart: o }) {
1131
+ const d = E(), i = e.role === "user", l = (p, c) => /* @__PURE__ */ n(
1132
+ Yt,
1133
1133
  {
1134
1134
  part: p,
1135
1135
  onProposalConfirm: t,
1136
1136
  onProposalCancel: a,
1137
1137
  onEntityClick: r,
1138
- renderPart: i
1138
+ renderPart: o
1139
1139
  },
1140
1140
  c
1141
- ), u = e.parts.some(ke);
1142
- return /* @__PURE__ */ h(
1141
+ ), u = e.parts.some(je);
1142
+ return /* @__PURE__ */ m(
1143
1143
  "div",
1144
1144
  {
1145
- className: `${L.wrapper} ${o ? L.user : L.assistant}`,
1145
+ className: `${B.wrapper} ${i ? B.user : B.assistant}`,
1146
1146
  "data-juneau": "message",
1147
1147
  "data-juneau-role": e.role,
1148
1148
  children: [
1149
- !o && /* @__PURE__ */ n("div", { className: L.avatar, "aria-hidden": "true", "data-juneau": "assistant-avatar", children: s ?? /* @__PURE__ */ n(Ce, {}) }),
1150
- u ? /* @__PURE__ */ n("div", { className: L.content, children: oa(e.parts).map((p, c) => /* @__PURE__ */ n(
1149
+ !i && /* @__PURE__ */ n("div", { className: B.avatar, "aria-hidden": "true", "data-juneau": "assistant-avatar", children: s ?? /* @__PURE__ */ n(Ne, {}) }),
1150
+ u ? /* @__PURE__ */ n("div", { className: B.content, children: ca(e.parts).map((p, c) => /* @__PURE__ */ n(
1151
1151
  "div",
1152
1152
  {
1153
- className: p.card ? L.card : L.bubble,
1153
+ className: p.card ? B.card : B.bubble,
1154
1154
  "data-juneau-segment": p.card ? "card" : "bubble",
1155
1155
  children: p.parts.map(({ part: f, index: C }) => l(f, C))
1156
1156
  },
1157
1157
  c
1158
- )) }) : /* @__PURE__ */ h("div", { className: L.bubble, "data-juneau-segment": "bubble", children: [
1158
+ )) }) : /* @__PURE__ */ m("div", { className: B.bubble, "data-juneau-segment": "bubble", children: [
1159
1159
  e.parts.map((p, c) => l(p, c)),
1160
- e.parts.length === 0 && /* @__PURE__ */ n("span", { className: L.empty })
1160
+ e.parts.length === 0 && /* @__PURE__ */ n("span", { className: B.empty })
1161
1161
  ] }),
1162
- o && /* @__PURE__ */ n("div", { className: L.avatar, children: d.userLabel })
1162
+ i && /* @__PURE__ */ n("div", { className: B.avatar, children: d.userLabel })
1163
1163
  ]
1164
1164
  }
1165
1165
  );
1166
1166
  }
1167
- const la = "_wrapper_1dvvu_1", da = "_dot_1dvvu_8", ua = "_connectingLabel_1dvvu_19", K = {
1168
- wrapper: la,
1169
- dot: da,
1170
- connectingLabel: ua
1167
+ const da = "_wrapper_1oco7_1", ua = "_dot_1oco7_15", pa = "_connectingLabel_1oco7_37", K = {
1168
+ wrapper: da,
1169
+ dot: ua,
1170
+ connectingLabel: pa
1171
1171
  };
1172
- function pa({ connecting: e = !1 }) {
1173
- const t = R();
1174
- return /* @__PURE__ */ h(
1172
+ function ya({ connecting: e = !1 }) {
1173
+ const t = E();
1174
+ return /* @__PURE__ */ m(
1175
1175
  "div",
1176
1176
  {
1177
1177
  className: K.wrapper,
@@ -1186,82 +1186,82 @@ function pa({ connecting: e = !1 }) {
1186
1186
  }
1187
1187
  );
1188
1188
  }
1189
- const ya = "_list_1f8gn_1", ma = "_empty_1f8gn_11", ha = "_hint_1f8gn_24", fa = "_typing_1f8gn_31", re = {
1190
- list: ya,
1189
+ const ha = "_list_ixto8_1", ma = "_empty_ixto8_21", fa = "_hint_ixto8_47", ga = "_typing_ixto8_61", re = {
1190
+ list: ha,
1191
1191
  empty: ma,
1192
- hint: ha,
1193
- typing: fa
1192
+ hint: fa,
1193
+ typing: ga
1194
1194
  };
1195
- function ga({ messages: e, isLoading: t, isConnecting: a, onProposalConfirm: r, onProposalCancel: s, onEntityClick: i, assistantIcon: d, renderPart: o, emptyState: l }) {
1196
- const u = R(), p = W(null);
1197
- return oe(() => {
1195
+ function ba({ messages: e, isLoading: t, isConnecting: a, onProposalConfirm: r, onProposalCancel: s, onEntityClick: o, assistantIcon: d, renderPart: i, emptyState: l }) {
1196
+ const u = E(), p = F(null);
1197
+ return ie(() => {
1198
1198
  p.current?.scrollIntoView({ behavior: "smooth" });
1199
- }, [e, t]), /* @__PURE__ */ h("div", { className: re.list, "data-juneau": "message-list", children: [
1200
- e.length === 0 && (l ?? /* @__PURE__ */ h("div", { className: re.empty, "data-juneau": "empty-state", children: [
1199
+ }, [e, t]), /* @__PURE__ */ m("div", { className: re.list, "data-juneau": "message-list", children: [
1200
+ e.length === 0 && (l ?? /* @__PURE__ */ m("div", { className: re.empty, "data-juneau": "empty-state", children: [
1201
1201
  /* @__PURE__ */ n("p", { children: u.emptyStateText }),
1202
1202
  /* @__PURE__ */ n("p", { className: re.hint, children: /* @__PURE__ */ n("em", { children: u.emptyStateHint }) })
1203
1203
  ] })),
1204
1204
  e.map((c) => /* @__PURE__ */ n(
1205
- ca,
1205
+ la,
1206
1206
  {
1207
1207
  message: c,
1208
1208
  onProposalConfirm: r,
1209
1209
  onProposalCancel: s,
1210
- onEntityClick: i,
1210
+ onEntityClick: o,
1211
1211
  assistantIcon: d,
1212
- renderPart: o
1212
+ renderPart: i
1213
1213
  },
1214
1214
  c.id
1215
1215
  )),
1216
- t && /* @__PURE__ */ n("div", { className: re.typing, children: /* @__PURE__ */ n(pa, { connecting: a }) }),
1216
+ t && /* @__PURE__ */ n("div", { className: re.typing, children: /* @__PURE__ */ n(ya, { connecting: a }) }),
1217
1217
  /* @__PURE__ */ n("div", { ref: p })
1218
1218
  ] });
1219
1219
  }
1220
- const _a = "_wrapper_v8iyr_1", ba = "_textarea_v8iyr_11", va = "_toolbar_v8iyr_35", wa = "_actions_v8iyr_45", xa = "_actionBtn_v8iyr_52", Ca = "_sendBtn_v8iyr_85", Na = "_spinnerIcon_v8iyr_116", ka = "_stopBtn_v8iyr_126", ja = "_stopIcon_v8iyr_149", B = {
1220
+ const _a = "_wrapper_ehrkb_1", va = "_textarea_ehrkb_21", wa = "_toolbar_ehrkb_69", xa = "_actions_ehrkb_89", Ca = "_actionBtn_ehrkb_103", Na = "_sendBtn_ehrkb_169", ka = "_spinnerIcon_ehrkb_231", ja = "_stopBtn_ehrkb_251", Sa = "_stopIcon_ehrkb_297", P = {
1221
1221
  wrapper: _a,
1222
- textarea: ba,
1223
- toolbar: va,
1224
- actions: wa,
1225
- actionBtn: xa,
1226
- sendBtn: Ca,
1227
- spinnerIcon: Na,
1228
- stopBtn: ka,
1229
- stopIcon: ja
1222
+ textarea: va,
1223
+ toolbar: wa,
1224
+ actions: xa,
1225
+ actionBtn: Ca,
1226
+ sendBtn: Na,
1227
+ spinnerIcon: ka,
1228
+ stopBtn: ja,
1229
+ stopIcon: Sa
1230
1230
  };
1231
- function Sa({ value: e, onChange: t, onSend: a, onStop: r, isLoading: s, placeholder: i, actions: d, sendIcon: o }) {
1232
- const l = R(), u = W(null), p = W(!1);
1233
- oe(() => {
1231
+ function Aa({ value: e, onChange: t, onSend: a, onStop: r, isLoading: s, placeholder: o, actions: d, sendIcon: i }) {
1232
+ const l = E(), u = F(null), p = F(!1);
1233
+ ie(() => {
1234
1234
  p.current && !s && u.current?.focus(), p.current = s;
1235
1235
  }, [s]);
1236
1236
  const c = [
1237
- { icon: /* @__PURE__ */ n(Qe, {}), label: l.actionAddFile },
1238
- { icon: /* @__PURE__ */ n(Ye, {}), label: l.actionQuickActions },
1239
- { icon: /* @__PURE__ */ n(Xe, {}), label: l.actionNew },
1240
- { icon: /* @__PURE__ */ n(et, {}), label: l.actionHistory },
1241
- { icon: /* @__PURE__ */ n(tt, {}), label: l.actionRules }
1237
+ { icon: /* @__PURE__ */ n(Ye, {}), label: l.actionAddFile },
1238
+ { icon: /* @__PURE__ */ n(Xe, {}), label: l.actionQuickActions },
1239
+ { icon: /* @__PURE__ */ n(et, {}), label: l.actionNew },
1240
+ { icon: /* @__PURE__ */ n(tt, {}), label: l.actionHistory },
1241
+ { icon: /* @__PURE__ */ n(at, {}), label: l.actionRules }
1242
1242
  ], f = d ?? c, C = (y) => {
1243
1243
  y.key === "Enter" && !y.shiftKey && (y.preventDefault(), s || a());
1244
1244
  };
1245
- return /* @__PURE__ */ h("div", { className: B.wrapper, "data-juneau": "input", children: [
1245
+ return /* @__PURE__ */ m("div", { className: P.wrapper, "data-juneau": "input", children: [
1246
1246
  /* @__PURE__ */ n(
1247
1247
  "textarea",
1248
1248
  {
1249
1249
  ref: u,
1250
- className: B.textarea,
1250
+ className: P.textarea,
1251
1251
  "data-juneau": "input-textarea",
1252
1252
  value: e,
1253
1253
  onChange: (y) => t(y.target.value),
1254
1254
  onKeyDown: C,
1255
- placeholder: i ?? l.inputPlaceholder,
1255
+ placeholder: o ?? l.inputPlaceholder,
1256
1256
  rows: 3,
1257
1257
  "aria-label": l.sendMessage
1258
1258
  }
1259
1259
  ),
1260
- /* @__PURE__ */ h("div", { className: B.toolbar, children: [
1261
- f.length > 0 && /* @__PURE__ */ n("div", { className: B.actions, children: f.map((y, M) => /* @__PURE__ */ h(
1260
+ /* @__PURE__ */ m("div", { className: P.toolbar, children: [
1261
+ f.length > 0 && /* @__PURE__ */ n("div", { className: P.actions, children: f.map((y, I) => /* @__PURE__ */ m(
1262
1262
  "button",
1263
1263
  {
1264
- className: B.actionBtn,
1264
+ className: P.actionBtn,
1265
1265
  type: "button",
1266
1266
  disabled: s,
1267
1267
  "aria-label": y.label,
@@ -1271,30 +1271,30 @@ function Sa({ value: e, onChange: t, onSend: a, onStop: r, isLoading: s, placeho
1271
1271
  /* @__PURE__ */ n("span", { children: y.label })
1272
1272
  ]
1273
1273
  },
1274
- M
1274
+ I
1275
1275
  )) }),
1276
- s && r ? /* @__PURE__ */ h(
1276
+ s && r ? /* @__PURE__ */ m(
1277
1277
  "button",
1278
1278
  {
1279
- className: B.stopBtn,
1279
+ className: P.stopBtn,
1280
1280
  onClick: r,
1281
1281
  "aria-label": l.stopMessage,
1282
1282
  type: "button",
1283
1283
  children: [
1284
- /* @__PURE__ */ n("svg", { className: B.stopIcon, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ n("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" }) }),
1284
+ /* @__PURE__ */ n("svg", { className: P.stopIcon, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ n("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" }) }),
1285
1285
  /* @__PURE__ */ n("span", { children: l.stopMessage })
1286
1286
  ]
1287
1287
  }
1288
- ) : /* @__PURE__ */ h(
1288
+ ) : /* @__PURE__ */ m(
1289
1289
  "button",
1290
1290
  {
1291
- className: B.sendBtn,
1291
+ className: P.sendBtn,
1292
1292
  onClick: a,
1293
1293
  disabled: s || !e.trim(),
1294
1294
  "aria-label": l.sendMessage,
1295
1295
  type: "button",
1296
1296
  children: [
1297
- s ? /* @__PURE__ */ n("svg", { className: B.spinnerIcon, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeDasharray: "32", strokeDashoffset: "12" }) }) : o ?? /* @__PURE__ */ n(Ge, {}),
1297
+ s ? /* @__PURE__ */ n("svg", { className: P.spinnerIcon, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeDasharray: "32", strokeDashoffset: "12" }) }) : i ?? /* @__PURE__ */ n(Qe, {}),
1298
1298
  /* @__PURE__ */ n("span", { children: l.sendMessage })
1299
1299
  ]
1300
1300
  }
@@ -1302,32 +1302,33 @@ function Sa({ value: e, onChange: t, onSend: a, onStop: r, isLoading: s, placeho
1302
1302
  ] })
1303
1303
  ] });
1304
1304
  }
1305
- const Aa = "_wrapper_1kefv_1", za = "_icon_1kefv_14", Ma = "_message_1kefv_20", Ta = "_dismiss_1kefv_24", ie = {
1306
- wrapper: Aa,
1307
- icon: za,
1308
- message: Ma,
1305
+ const za = "_wrapper_1e3w5_1", Ma = "_icon_1e3w5_27", Ia = "_message_1e3w5_39", Ta = "_dismiss_1e3w5_47", oe = {
1306
+ wrapper: za,
1307
+ icon: Ma,
1308
+ message: Ia,
1309
1309
  dismiss: Ta
1310
1310
  };
1311
- function Ia({ message: e, onDismiss: t }) {
1312
- const a = R();
1313
- return /* @__PURE__ */ h("div", { className: ie.wrapper, role: "alert", "data-juneau": "error", children: [
1314
- /* @__PURE__ */ n("svg", { className: ie.icon, viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
1315
- /* @__PURE__ */ n("span", { className: ie.message, children: e }),
1316
- t && /* @__PURE__ */ n("button", { className: ie.dismiss, onClick: t, "aria-label": a.errorDismiss, children: /* @__PURE__ */ n("svg", { viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z" }) }) })
1311
+ function La({ message: e, onDismiss: t }) {
1312
+ const a = E();
1313
+ return /* @__PURE__ */ m("div", { className: oe.wrapper, role: "alert", "data-juneau": "error", children: [
1314
+ /* @__PURE__ */ n("svg", { className: oe.icon, viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
1315
+ /* @__PURE__ */ n("span", { className: oe.message, children: e }),
1316
+ t && /* @__PURE__ */ n("button", { className: oe.dismiss, onClick: t, "aria-label": a.errorDismiss, children: /* @__PURE__ */ n("svg", { viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z" }) }) })
1317
1317
  ] });
1318
1318
  }
1319
- const La = "_chat_1acbe_1", Ba = {
1320
- chat: La
1319
+ const Ba = "_chat_nablk_1", Pa = "_aboveInput_nablk_15", me = {
1320
+ chat: Ba,
1321
+ aboveInput: Pa
1321
1322
  };
1322
- function Pa({
1323
+ function $a({
1323
1324
  messages: e,
1324
1325
  input: t,
1325
1326
  isLoading: a,
1326
1327
  isConnecting: r,
1327
1328
  error: s,
1328
- onInputChange: i,
1329
+ onInputChange: o,
1329
1330
  onSend: d,
1330
- onStop: o,
1331
+ onStop: i,
1331
1332
  onProposalConfirm: l,
1332
1333
  onProposalCancel: u,
1333
1334
  onEntityClick: p,
@@ -1335,20 +1336,21 @@ function Pa({
1335
1336
  assistantIcon: f,
1336
1337
  actions: C,
1337
1338
  sendIcon: y,
1338
- renderPart: M,
1339
- emptyState: A,
1339
+ renderPart: I,
1340
+ emptyState: S,
1341
+ aboveInput: A,
1340
1342
  className: T,
1341
- style: I
1343
+ style: q
1342
1344
  }) {
1343
- return /* @__PURE__ */ h(
1345
+ return /* @__PURE__ */ m(
1344
1346
  "div",
1345
1347
  {
1346
- className: [Ba.chat, T].filter(Boolean).join(" "),
1347
- style: I,
1348
+ className: [me.chat, T].filter(Boolean).join(" "),
1349
+ style: q,
1348
1350
  "data-juneau": "chat",
1349
1351
  children: [
1350
1352
  /* @__PURE__ */ n(
1351
- ga,
1353
+ ba,
1352
1354
  {
1353
1355
  messages: e,
1354
1356
  isLoading: a,
@@ -1357,18 +1359,19 @@ function Pa({
1357
1359
  onProposalCancel: u,
1358
1360
  onEntityClick: p,
1359
1361
  assistantIcon: f,
1360
- renderPart: M,
1361
- emptyState: A
1362
+ renderPart: I,
1363
+ emptyState: S
1362
1364
  }
1363
1365
  ),
1364
- s && /* @__PURE__ */ n(Ia, { message: s }),
1366
+ s && /* @__PURE__ */ n(La, { message: s }),
1367
+ A != null && /* @__PURE__ */ n("div", { className: me.aboveInput, "data-juneau": "above-input", "data-juneau-above-input": "", children: A }),
1365
1368
  /* @__PURE__ */ n(
1366
- Sa,
1369
+ Aa,
1367
1370
  {
1368
1371
  value: t,
1369
- onChange: i,
1372
+ onChange: o,
1370
1373
  onSend: d,
1371
- onStop: o,
1374
+ onStop: i,
1372
1375
  isLoading: a,
1373
1376
  placeholder: c,
1374
1377
  actions: C,
@@ -1379,71 +1382,71 @@ function Pa({
1379
1382
  }
1380
1383
  );
1381
1384
  }
1382
- const $a = "_header_1ss3g_1", Da = "_left_1ss3g_12", Ra = "_icon_1ss3g_18", Ea = "_title_1ss3g_23", Ha = "_resetBtn_1ss3g_29", Va = "_actions_1ss3g_50", Oa = "_badge_1ss3g_57", D = {
1383
- header: $a,
1384
- left: Da,
1385
- icon: Ra,
1386
- title: Ea,
1387
- resetBtn: Ha,
1385
+ const Da = "_header_1br16_1", Ra = "_left_1br16_23", Ea = "_icon_1br16_35", Ha = "_title_1br16_45", qa = "_resetBtn_1br16_57", Va = "_actions_1br16_99", Oa = "_badge_1br16_113", R = {
1386
+ header: Da,
1387
+ left: Ra,
1388
+ icon: Ea,
1389
+ title: Ha,
1390
+ resetBtn: qa,
1388
1391
  actions: Va,
1389
1392
  badge: Oa
1390
1393
  };
1391
- function qa({
1394
+ function Wa({
1392
1395
  title: e,
1393
1396
  onMinimize: t,
1394
1397
  isMinimized: a,
1395
1398
  icon: r,
1396
1399
  onReset: s,
1397
- badge: i,
1400
+ badge: o,
1398
1401
  headerActions: d
1399
1402
  }) {
1400
- const o = R();
1401
- return /* @__PURE__ */ h("div", { className: D.header, "data-juneau": "header", children: [
1402
- /* @__PURE__ */ h("div", { className: D.left, children: [
1403
- /* @__PURE__ */ n("span", { className: D.icon, "aria-hidden": "true", "data-juneau": "header-icon", children: r ?? /* @__PURE__ */ n(Ce, {}) }),
1404
- /* @__PURE__ */ n("span", { className: D.title, children: e ?? o.sidebarTitle }),
1405
- i && /* @__PURE__ */ n("span", { className: D.badge, "data-juneau": "header-badge", children: i })
1403
+ const i = E();
1404
+ return /* @__PURE__ */ m("div", { className: R.header, "data-juneau": "header", children: [
1405
+ /* @__PURE__ */ m("div", { className: R.left, children: [
1406
+ /* @__PURE__ */ n("span", { className: R.icon, "aria-hidden": "true", "data-juneau": "header-icon", children: r ?? /* @__PURE__ */ n(Ne, {}) }),
1407
+ /* @__PURE__ */ n("span", { className: R.title, children: e ?? i.sidebarTitle }),
1408
+ o && /* @__PURE__ */ n("span", { className: R.badge, "data-juneau": "header-badge", children: o })
1406
1409
  ] }),
1407
- (t || s || d) && /* @__PURE__ */ h("div", { className: D.actions, children: [
1410
+ (t || s || d) && /* @__PURE__ */ m("div", { className: R.actions, children: [
1408
1411
  d,
1409
1412
  s && /* @__PURE__ */ n(
1410
1413
  "button",
1411
1414
  {
1412
- className: D.resetBtn,
1415
+ className: R.resetBtn,
1413
1416
  onClick: s,
1414
- title: o.resetConversation,
1415
- "aria-label": o.resetConversation,
1417
+ title: i.resetConversation,
1418
+ "aria-label": i.resetConversation,
1416
1419
  "data-juneau": "header-reset",
1417
- children: /* @__PURE__ */ n(st, {})
1420
+ children: /* @__PURE__ */ n(rt, {})
1418
1421
  }
1419
1422
  ),
1420
1423
  t && /* @__PURE__ */ n(
1421
1424
  "button",
1422
1425
  {
1423
- className: D.resetBtn,
1426
+ className: R.resetBtn,
1424
1427
  onClick: t,
1425
- title: a ? o.expandSidebar : o.minimizeSidebar,
1426
- "aria-label": a ? o.expandSidebar : o.minimizeSidebar,
1428
+ title: a ? i.expandSidebar : i.minimizeSidebar,
1429
+ "aria-label": a ? i.expandSidebar : i.minimizeSidebar,
1427
1430
  "data-juneau": "header-minimize",
1428
- children: a ? /* @__PURE__ */ n(nt, {}) : /* @__PURE__ */ n(at, {})
1431
+ children: a ? /* @__PURE__ */ n(st, {}) : /* @__PURE__ */ n(nt, {})
1429
1432
  }
1430
1433
  )
1431
1434
  ] })
1432
1435
  ] });
1433
1436
  }
1434
- const Wa = "_sidebar_17ski_1", Fa = "_minimized_17ski_20", he = {
1435
- sidebar: Wa,
1436
- minimized: Fa
1437
+ const Fa = "_sidebar_u9ybt_1", Za = "_minimized_u9ybt_39", fe = {
1438
+ sidebar: Fa,
1439
+ minimized: Za
1437
1440
  };
1438
- function hn({
1441
+ function fn({
1439
1442
  title: e,
1440
1443
  icon: t,
1441
1444
  assistantIcon: a,
1442
1445
  actions: r,
1443
1446
  sendIcon: s,
1444
- height: i = "60vh",
1447
+ height: o = "60vh",
1445
1448
  className: d,
1446
- style: o,
1449
+ style: i,
1447
1450
  onReset: l,
1448
1451
  confirmReset: u,
1449
1452
  renderPart: p,
@@ -1451,143 +1454,145 @@ function hn({
1451
1454
  headerActions: f,
1452
1455
  badge: C,
1453
1456
  minimized: y,
1454
- onMinimizedChange: M,
1455
- emptyState: A
1457
+ onMinimizedChange: I,
1458
+ emptyState: S,
1459
+ aboveInput: A
1456
1460
  }) {
1457
- const [T, I] = E(!1), F = y !== void 0, j = F ? y : T, H = () => {
1458
- const w = !j;
1459
- F || I(w), M?.(w);
1461
+ const [T, q] = H(!1), z = y !== void 0, L = z ? y : T, V = () => {
1462
+ const g = !L;
1463
+ z || q(g), I?.(g);
1460
1464
  }, {
1461
- messages: V,
1462
- input: G,
1463
- setInput: Q,
1464
- sendMessage: Y,
1465
- stop: X,
1466
- isLoading: ee,
1467
- isConnecting: O,
1468
- error: te,
1469
- reset: ae,
1470
- confirmProposal: m,
1471
- cancelProposal: v
1472
- } = Ke(), _ = l ? async () => {
1473
- u && !await u() || (ae(), l());
1465
+ messages: G,
1466
+ input: Q,
1467
+ setInput: Y,
1468
+ sendMessage: X,
1469
+ stop: ee,
1470
+ isLoading: O,
1471
+ isConnecting: te,
1472
+ error: ae,
1473
+ reset: h,
1474
+ confirmProposal: v,
1475
+ cancelProposal: _
1476
+ } = Ge(), w = l ? async () => {
1477
+ u && !await u() || (h(), l());
1474
1478
  } : void 0;
1475
- return /* @__PURE__ */ h(
1479
+ return /* @__PURE__ */ m(
1476
1480
  "aside",
1477
1481
  {
1478
- className: [he.sidebar, j ? he.minimized : "", d].filter(Boolean).join(" "),
1479
- style: { height: j ? void 0 : i, ...o },
1482
+ className: [fe.sidebar, L ? fe.minimized : "", d].filter(Boolean).join(" "),
1483
+ style: { height: L ? void 0 : o, ...i },
1480
1484
  "data-juneau": "sidebar",
1481
1485
  children: [
1482
1486
  /* @__PURE__ */ n(
1483
- qa,
1487
+ Wa,
1484
1488
  {
1485
1489
  title: e,
1486
1490
  icon: t,
1487
- onMinimize: H,
1488
- isMinimized: j,
1489
- onReset: _,
1491
+ onMinimize: V,
1492
+ isMinimized: L,
1493
+ onReset: w,
1490
1494
  badge: C,
1491
1495
  headerActions: f
1492
1496
  }
1493
1497
  ),
1494
- !j && /* @__PURE__ */ n(
1495
- Pa,
1498
+ !L && /* @__PURE__ */ n(
1499
+ $a,
1496
1500
  {
1497
- messages: V,
1498
- input: G,
1499
- isLoading: ee,
1500
- isConnecting: O,
1501
- error: te,
1502
- onInputChange: Q,
1503
- onSend: Y,
1504
- onStop: X,
1505
- onProposalConfirm: m,
1506
- onProposalCancel: v,
1501
+ messages: G,
1502
+ input: Q,
1503
+ isLoading: O,
1504
+ isConnecting: te,
1505
+ error: ae,
1506
+ onInputChange: Y,
1507
+ onSend: X,
1508
+ onStop: ee,
1509
+ onProposalConfirm: v,
1510
+ onProposalCancel: _,
1507
1511
  assistantIcon: a ?? t,
1508
1512
  actions: r,
1509
1513
  sendIcon: s,
1510
1514
  renderPart: p,
1511
1515
  onEntityClick: c,
1512
- emptyState: A
1516
+ emptyState: S,
1517
+ aboveInput: A
1513
1518
  }
1514
1519
  )
1515
1520
  ]
1516
1521
  }
1517
1522
  );
1518
1523
  }
1519
- const Za = "_list_180ms_1", Ja = "_item_180ms_10", Ua = "_chat_180ms_16", Ka = "_chatActive_180ms_36", Ga = "_title_180ms_40", Qa = "_date_180ms_50", Ya = "_empty_180ms_82", P = {
1520
- list: Za,
1521
- item: Ja,
1522
- chat: Ua,
1523
- chatActive: Ka,
1524
- title: Ga,
1525
- date: Qa,
1526
- delete: "_delete_180ms_56",
1527
- empty: Ya
1524
+ const Ja = "_list_j7fvh_1", Ua = "_item_j7fvh_19", Ka = "_chat_j7fvh_31", Ga = "_chatActive_j7fvh_71", Qa = "_title_j7fvh_79", Ya = "_date_j7fvh_99", Xa = "_empty_j7fvh_163", $ = {
1525
+ list: Ja,
1526
+ item: Ua,
1527
+ chat: Ka,
1528
+ chatActive: Ga,
1529
+ title: Qa,
1530
+ date: Ya,
1531
+ delete: "_delete_j7fvh_111",
1532
+ empty: Xa
1528
1533
  };
1529
- function fn({ chats: e, onSelect: t, activeChatId: a, onDelete: r }) {
1530
- const s = R();
1531
- return e.length === 0 ? /* @__PURE__ */ n("p", { className: P.empty, children: s.historyEmpty }) : /* @__PURE__ */ n("ul", { className: P.list, "data-juneau": "history-list", children: e.map((i) => /* @__PURE__ */ h("li", { className: P.item, children: [
1532
- /* @__PURE__ */ h(
1534
+ function gn({ chats: e, onSelect: t, activeChatId: a, onDelete: r }) {
1535
+ const s = E();
1536
+ return e.length === 0 ? /* @__PURE__ */ n("p", { className: $.empty, children: s.historyEmpty }) : /* @__PURE__ */ n("ul", { className: $.list, "data-juneau": "history-list", children: e.map((o) => /* @__PURE__ */ m("li", { className: $.item, children: [
1537
+ /* @__PURE__ */ m(
1533
1538
  "button",
1534
1539
  {
1535
- className: i.id === a ? `${P.chat} ${P.chatActive}` : P.chat,
1536
- onClick: () => t(i.id),
1540
+ className: o.id === a ? `${$.chat} ${$.chatActive}` : $.chat,
1541
+ onClick: () => t(o.id),
1537
1542
  children: [
1538
- /* @__PURE__ */ n("span", { className: P.title, children: i.title }),
1539
- /* @__PURE__ */ n("span", { className: P.date, children: i.updatedAt.toLocaleDateString(void 0, { day: "numeric", month: "short" }) })
1543
+ /* @__PURE__ */ n("span", { className: $.title, children: o.title }),
1544
+ /* @__PURE__ */ n("span", { className: $.date, children: o.updatedAt.toLocaleDateString(void 0, { day: "numeric", month: "short" }) })
1540
1545
  ]
1541
1546
  }
1542
1547
  ),
1543
1548
  r && /* @__PURE__ */ n(
1544
1549
  "button",
1545
1550
  {
1546
- className: P.delete,
1547
- onClick: () => r(i.id),
1551
+ className: $.delete,
1552
+ onClick: () => r(o.id),
1548
1553
  "aria-label": s.historyDeleteChat,
1549
1554
  children: /* @__PURE__ */ n("svg", { viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z" }) })
1550
1555
  }
1551
1556
  )
1552
- ] }, i.id)) });
1557
+ ] }, o.id)) });
1553
1558
  }
1554
1559
  export {
1555
- At as AiActivityPart,
1556
- Pa as AiChat,
1560
+ zt as AiActivityPart,
1561
+ $a as AiChat,
1557
1562
  le as AiChatContext,
1558
- qa as AiChatHeader,
1559
- fn as AiChatHistoryList,
1560
- yn as AiChatProvider,
1561
- Ne as AiEntityCard,
1562
- Zt as AiEntityListPart,
1563
- Ia as AiError,
1564
- Sa as AiInput,
1565
- ca as AiMessageBubble,
1566
- ga as AiMessageList,
1567
- Qt as AiMessagePartRenderer,
1568
- xt as AiProposalCard,
1569
- hn as AiSidebar,
1570
- ut as AiTablePart,
1571
- pa as AiTypingIndicator,
1572
- un as JuneauProvider,
1563
+ Wa as AiChatHeader,
1564
+ gn as AiChatHistoryList,
1565
+ hn as AiChatProvider,
1566
+ ke as AiEntityCard,
1567
+ Jt as AiEntityListPart,
1568
+ La as AiError,
1569
+ Aa as AiInput,
1570
+ la as AiMessageBubble,
1571
+ ba as AiMessageList,
1572
+ Yt as AiMessagePartRenderer,
1573
+ Ct as AiProposalCard,
1574
+ fn as AiSidebar,
1575
+ pt as AiTablePart,
1576
+ ya as AiTypingIndicator,
1577
+ pn as JuneauProvider,
1573
1578
  ue as consumeStream,
1574
- dn as createFetchStreamAdapter,
1575
- ln as createSseAdapter,
1576
- g as delay,
1577
- rn as deserializeMessages,
1578
- ze as getMessageText,
1579
- nn as isChartPart,
1580
- be as isProposalPart,
1579
+ un as createFetchStreamAdapter,
1580
+ dn as createSseAdapter,
1581
+ b as delay,
1582
+ on as deserializeMessages,
1583
+ Me as getMessageText,
1584
+ sn as isChartPart,
1585
+ ve as isProposalPart,
1581
1586
  mn as juneauCs,
1582
- we as juneauEn,
1583
- cn as mockAdapter,
1584
- ve as parseJuneauWire,
1585
- sn as serializeForStorage,
1586
- Ae as serializeMessages,
1587
- on as trimChats,
1588
- Ie as trimHistory,
1589
- Fe as useAiChat,
1590
- Ke as useAiChatContext,
1591
- pn as useAiChatContextSafe
1587
+ xe as juneauEn,
1588
+ ln as mockAdapter,
1589
+ we as parseJuneauWire,
1590
+ rn as serializeForStorage,
1591
+ ze as serializeMessages,
1592
+ cn as trimChats,
1593
+ Le as trimHistory,
1594
+ Ze as useAiChat,
1595
+ Ge as useAiChatContext,
1596
+ yn as useAiChatContextSafe
1592
1597
  };
1593
1598
  //# sourceMappingURL=index.js.map