@ahmetilhn/hanui 5.3.2 → 5.4.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/build/chat.js CHANGED
@@ -1,389 +1,802 @@
1
1
  "use client";
2
- import { jsxs as u, jsx as t, Fragment as it } from "react/jsx-runtime";
3
- import { memo as b, useRef as A, useEffect as P, forwardRef as ot, useState as X, Children as lt, isValidElement as ct, cloneElement as rt } from "react";
4
- import { ArrowDown as _t, StopFill as dt, ArrowUp as mt, CheckLg as ht, ClipboardFill as ut } from "react-bootstrap-icons";
5
- import { useHanui as w, useAnnounce as tt, useStickToBottom as et, IconButton as G, Textarea as pt, hasOpenSurface as bt, Disclosure as at, Spinner as gt, ScrollArea as yt, StatusDot as vt } from "@ahmetilhn/hanui";
6
- const h = (...e) => {
7
- let a = "";
8
- for (const n of e)
9
- n && (a = a === "" ? n : `${a} ${n}`);
10
- return a;
11
- }, g = (e, a) => Object.assign(e, { displayName: a }), H = /* @__PURE__ */ new Set(), x = (e, ...a) => {
12
- for (const n of a) if (n !== void 0) return n;
13
- return process.env.NODE_ENV !== "production" && !H.has(e) && (H.add(e), console.error(
2
+ import { jsxs as h, jsx as a, Fragment as Ye } from "react/jsx-runtime";
3
+ import { memo as g, useRef as L, useEffect as U, forwardRef as We, useState as ce, useMemo as he, Fragment as Xe, Children as Je, isValidElement as Qe, cloneElement as Ve } from "react";
4
+ import { ArrowDown as et, StopFill as tt, ArrowUp as nt, CheckLg as st, ClipboardFill as at } from "react-bootstrap-icons";
5
+ import { useHanui as C, useAnnounce as Pe, useStickToBottom as Ke, IconButton as te, Textarea as it, hasOpenSurface as rt, Disclosure as Be, Spinner as ot, ScrollArea as ct, StatusDot as lt } from "@ahmetilhn/hanui";
6
+ const m = (...e) => {
7
+ let n = "";
8
+ for (const t of e)
9
+ t && (n = n === "" ? t : `${n} ${t}`);
10
+ return n;
11
+ }, k = (e, n) => Object.assign(e, { displayName: n }), pe = /* @__PURE__ */ new Set(), x = (e, ...n) => {
12
+ for (const t of n) if (t !== void 0) return t;
13
+ return process.env.NODE_ENV !== "production" && !pe.has(e) && (pe.add(e), console.error(
14
14
  `[hanui] Eksik metin: ${e}. Prop olarak geçin ya da <HanuiProvider labels={…}> içinde bir kez tanımlayın. Metinsiz bırakılan öğe ekran okuyucuda adsız kalır.`
15
15
  )), "";
16
- }, nt = (e, a, ...n) => a ? a(...n) : x(e), Nt = "hanui-thread-R1LCJ", kt = "hanui-thread__scroll-37EaI", xt = "hanui-thread__column-57FQh", ft = "hanui-thread__dock-y0Tt9", Ct = "hanui-thread__latest-ZNmqY", L = {
17
- thread: Nt,
18
- thread__scroll: kt,
19
- thread__column: xt,
20
- thread__dock: ft,
21
- thread__latest: Ct
22
- }, $t = ({ children: e, dock: a, isStreaming: n, label: i, className: o, testId: l }) => {
23
- var p, y, N;
24
- const { labels: s } = w(), d = tt(), c = A(null), { isAtEnd: _, scrollToEnd: r } = et(c), m = A(n);
25
- return P(() => {
26
- var f;
27
- m.current && !n && d(x("ChatThread.replyReady", (f = s == null ? void 0 : s.chat) == null ? void 0 : f.replyReady)), m.current = n;
28
- }, [d, n, (p = s == null ? void 0 : s.chat) == null ? void 0 : p.replyReady]), /* @__PURE__ */ u("div", { className: h(L.thread, o), "data-testid": l, children: [
29
- /* @__PURE__ */ t(
16
+ }, Fe = (e, n, ...t) => n ? n(...t) : x(e), dt = "hanui-thread-R1LCJ", _t = "hanui-thread__scroll-37EaI", ut = "hanui-thread__column-57FQh", mt = "hanui-thread__dock-y0Tt9", ht = "hanui-thread__latest-ZNmqY", D = {
17
+ thread: dt,
18
+ thread__scroll: _t,
19
+ thread__column: ut,
20
+ thread__dock: mt,
21
+ thread__latest: ht
22
+ }, pt = ({ children: e, dock: n, isStreaming: t, label: i, className: r, testId: o }) => {
23
+ var f, b, y;
24
+ const { labels: s } = C(), l = Pe(), c = L(null), { isAtEnd: _, scrollToEnd: d } = Ke(c), u = L(t);
25
+ return U(() => {
26
+ var v;
27
+ u.current && !t && l(x("ChatThread.replyReady", (v = s == null ? void 0 : s.chat) == null ? void 0 : v.replyReady)), u.current = t;
28
+ }, [l, t, (f = s == null ? void 0 : s.chat) == null ? void 0 : f.replyReady]), /* @__PURE__ */ h("div", { className: m(D.thread, r), "data-testid": o, children: [
29
+ /* @__PURE__ */ a(
30
30
  "div",
31
31
  {
32
32
  ref: c,
33
- className: L.thread__scroll,
33
+ className: D.thread__scroll,
34
34
  role: "region",
35
- "aria-label": x("ChatThread.label", i, (y = s == null ? void 0 : s.chat) == null ? void 0 : y.thread),
35
+ "aria-label": x("ChatThread.label", i, (b = s == null ? void 0 : s.chat) == null ? void 0 : b.thread),
36
36
  tabIndex: 0,
37
- children: /* @__PURE__ */ t("div", { className: L.thread__column, children: e })
37
+ children: /* @__PURE__ */ a("div", { className: D.thread__column, children: e })
38
38
  }
39
39
  ),
40
- /* @__PURE__ */ u("div", { className: L.thread__dock, children: [
41
- !_ && /* @__PURE__ */ t(
42
- G,
40
+ /* @__PURE__ */ h("div", { className: D.thread__dock, children: [
41
+ !_ && /* @__PURE__ */ a(
42
+ te,
43
43
  {
44
- className: L.thread__latest,
45
- icon: /* @__PURE__ */ t(_t, { "aria-hidden": !0 }),
46
- label: x("ChatThread.scrollToLatest", (N = s == null ? void 0 : s.chat) == null ? void 0 : N.scrollToLatest),
44
+ className: D.thread__latest,
45
+ icon: /* @__PURE__ */ a(et, { "aria-hidden": !0 }),
46
+ label: x("ChatThread.scrollToLatest", (y = s == null ? void 0 : s.chat) == null ? void 0 : y.scrollToLatest),
47
47
  variant: "outline",
48
48
  shape: "round",
49
49
  size: "sm",
50
- onClick: r
50
+ onClick: d
51
51
  }
52
52
  ),
53
- a !== void 0 && /* @__PURE__ */ t("div", { className: L.thread__column, children: a })
53
+ n !== void 0 && /* @__PURE__ */ a("div", { className: D.thread__column, children: n })
54
54
  ] })
55
55
  ] });
56
- }, Na = /* @__PURE__ */ b(
57
- /* @__PURE__ */ g($t, "ChatThread")
58
- ), wt = "hanui-message-z5uVx", Tt = "hanui-message__avatar-QzWck", St = "hanui-message__main-1rh-A", At = "hanui-message__body-Ngiqq", Lt = "hanui-message__actions-dQ0Fn", E = {
59
- message: wt,
56
+ }, Xs = /* @__PURE__ */ g(
57
+ /* @__PURE__ */ k(pt, "ChatThread")
58
+ ), bt = "hanui-message-z5uVx", ft = "hanui-message__avatar-QzWck", yt = "hanui-message__main-1rh-A", gt = "hanui-message__body-Ngiqq", kt = "hanui-message__actions-dQ0Fn", M = {
59
+ message: bt,
60
60
  "message--user": "hanui-message--user-Mq6gb",
61
- message__avatar: Tt,
62
- message__main: St,
61
+ message__avatar: ft,
62
+ message__main: yt,
63
63
  "message--assistant": "hanui-message--assistant-ndkmH",
64
- message__body: At,
65
- message__actions: Lt
66
- }, Et = ({
64
+ message__body: gt,
65
+ message__actions: kt
66
+ }, wt = ({
67
67
  author: e,
68
- children: a,
69
- avatar: n,
68
+ children: n,
69
+ avatar: t,
70
70
  actions: i,
71
- isStreaming: o,
72
- className: l,
71
+ isStreaming: r,
72
+ className: o,
73
73
  testId: s
74
- }) => /* @__PURE__ */ u(
74
+ }) => /* @__PURE__ */ h(
75
75
  "article",
76
76
  {
77
- className: h(E.message, E[`message--${e}`], l),
78
- "aria-busy": o || void 0,
77
+ className: m(M.message, M[`message--${e}`], o),
78
+ "aria-busy": r || void 0,
79
79
  "data-testid": s,
80
80
  children: [
81
- e === "assistant" && n !== void 0 && /* @__PURE__ */ t("div", { className: E.message__avatar, children: n }),
82
- /* @__PURE__ */ u("div", { className: E.message__main, children: [
83
- /* @__PURE__ */ t("div", { className: E.message__body, children: a }),
84
- i !== void 0 && /* @__PURE__ */ t("div", { className: E.message__actions, children: i })
81
+ e === "assistant" && t !== void 0 && /* @__PURE__ */ a("div", { className: M.message__avatar, children: t }),
82
+ /* @__PURE__ */ h("div", { className: M.message__main, children: [
83
+ /* @__PURE__ */ a("div", { className: M.message__body, children: n }),
84
+ i !== void 0 && /* @__PURE__ */ a("div", { className: M.message__actions, children: i })
85
85
  ] })
86
86
  ]
87
87
  }
88
- ), ka = /* @__PURE__ */ b(
89
- /* @__PURE__ */ g(Et, "ChatMessage")
90
- ), zt = "hanui-prompt-qHV1e", Mt = "hanui-prompt__box-sUQDu", Ot = "hanui-prompt__field-EmvTZ", Bt = "hanui-prompt__start-2tqre", Pt = "hanui-prompt__end-Zp7fi", It = "hanui-prompt__hint-4TpeC", S = {
91
- prompt: zt,
92
- prompt__box: Mt,
88
+ ), Js = /* @__PURE__ */ g(
89
+ /* @__PURE__ */ k(wt, "ChatMessage")
90
+ ), vt = "hanui-prompt-qHV1e", Nt = "hanui-prompt__box-sUQDu", St = "hanui-prompt__field-EmvTZ", xt = "hanui-prompt__start-2tqre", At = "hanui-prompt__end-Zp7fi", Tt = "hanui-prompt__hint-4TpeC", R = {
91
+ prompt: vt,
92
+ prompt__box: Nt,
93
93
  "prompt__box--disabled": "hanui-prompt__box--disabled-xu-Yk",
94
- prompt__field: Ot,
95
- prompt__start: Bt,
96
- prompt__end: Pt,
97
- prompt__hint: It
98
- }, Dt = /* @__PURE__ */ ot(
94
+ prompt__field: St,
95
+ prompt__start: xt,
96
+ prompt__end: At,
97
+ prompt__hint: Tt
98
+ }, Ct = /* @__PURE__ */ We(
99
99
  ({
100
100
  value: e,
101
- onChange: a,
102
- onSubmit: n,
101
+ onChange: n,
102
+ onSubmit: t,
103
103
  onStop: i,
104
- isBusy: o,
105
- isDisabled: l,
104
+ isBusy: r,
105
+ isDisabled: o,
106
106
  isSubmitDisabled: s,
107
- placeholder: d,
107
+ placeholder: l,
108
108
  label: c,
109
109
  maxRows: _ = 8,
110
- hint: r,
111
- start: m,
112
- end: p,
113
- className: y,
114
- testId: N
115
- }, f) => {
116
- var j, Q;
117
- const { labels: C } = w(), V = e.trim() === "";
118
- P(() => {
119
- if (!o || !i) return;
120
- const $ = (U) => {
121
- U.key !== "Escape" || U.defaultPrevented || bt() || i();
110
+ hint: d,
111
+ start: u,
112
+ end: f,
113
+ className: b,
114
+ testId: y
115
+ }, v) => {
116
+ var _e, ue;
117
+ const { labels: w } = C(), K = e.trim() === "";
118
+ U(() => {
119
+ if (!r || !i) return;
120
+ const A = (me) => {
121
+ me.key !== "Escape" || me.defaultPrevented || rt() || i();
122
122
  };
123
- return document.addEventListener("keydown", $), () => document.removeEventListener("keydown", $);
124
- }, [o, i]);
125
- const st = ($) => {
126
- $.key !== "Enter" || $.shiftKey || $.nativeEvent.isComposing || ($.preventDefault(), !V && !o && !l && !s && n());
123
+ return document.addEventListener("keydown", A), () => document.removeEventListener("keydown", A);
124
+ }, [r, i]);
125
+ const qe = (A) => {
126
+ A.key !== "Enter" || A.shiftKey || A.nativeEvent.isComposing || (A.preventDefault(), !K && !r && !o && !s && t());
127
127
  };
128
- return /* @__PURE__ */ u("div", { className: h(S.prompt, y), "data-testid": N, children: [
129
- /* @__PURE__ */ u("div", { className: h(S.prompt__box, l && S["prompt__box--disabled"]), children: [
130
- m !== void 0 && /* @__PURE__ */ t("div", { className: S.prompt__start, children: m }),
131
- /* @__PURE__ */ t(
132
- pt,
128
+ return /* @__PURE__ */ h("div", { className: m(R.prompt, b), "data-testid": y, children: [
129
+ /* @__PURE__ */ h("div", { className: m(R.prompt__box, o && R["prompt__box--disabled"]), children: [
130
+ u !== void 0 && /* @__PURE__ */ a("div", { className: R.prompt__start, children: u }),
131
+ /* @__PURE__ */ a(
132
+ it,
133
133
  {
134
- ref: f,
135
- className: S.prompt__field,
134
+ ref: v,
135
+ className: R.prompt__field,
136
136
  variant: "bare",
137
137
  rows: 1,
138
138
  isAutoSize: !0,
139
139
  maxRows: _,
140
140
  value: e,
141
- placeholder: d,
142
- "aria-label": c ?? d,
143
- disabled: l,
144
- onChange: ($) => a($.target.value),
145
- onKeyDown: st
141
+ placeholder: l,
142
+ "aria-label": c ?? l,
143
+ disabled: o,
144
+ onChange: (A) => n(A.target.value),
145
+ onKeyDown: qe
146
146
  }
147
147
  ),
148
- p !== void 0 && /* @__PURE__ */ t("div", { className: S.prompt__end, children: p }),
149
- o ? /* @__PURE__ */ t(
150
- G,
148
+ f !== void 0 && /* @__PURE__ */ a("div", { className: R.prompt__end, children: f }),
149
+ r ? /* @__PURE__ */ a(
150
+ te,
151
151
  {
152
- icon: /* @__PURE__ */ t(dt, { "aria-hidden": !0 }),
153
- label: x("PromptInput.stop", (j = C == null ? void 0 : C.chat) == null ? void 0 : j.stop),
152
+ icon: /* @__PURE__ */ a(tt, { "aria-hidden": !0 }),
153
+ label: x("PromptInput.stop", (_e = w == null ? void 0 : w.chat) == null ? void 0 : _e.stop),
154
154
  variant: "outline",
155
155
  shape: "round",
156
156
  onClick: i,
157
157
  disabled: !i
158
158
  }
159
- ) : /* @__PURE__ */ t(
160
- G,
159
+ ) : /* @__PURE__ */ a(
160
+ te,
161
161
  {
162
- icon: /* @__PURE__ */ t(mt, { "aria-hidden": !0 }),
163
- label: x("PromptInput.send", (Q = C == null ? void 0 : C.chat) == null ? void 0 : Q.send),
162
+ icon: /* @__PURE__ */ a(nt, { "aria-hidden": !0 }),
163
+ label: x("PromptInput.send", (ue = w == null ? void 0 : w.chat) == null ? void 0 : ue.send),
164
164
  variant: "solid",
165
165
  shape: "round",
166
- onClick: n,
167
- disabled: V || l || s
166
+ onClick: t,
167
+ disabled: K || o || s
168
168
  }
169
169
  )
170
170
  ] }),
171
- r !== void 0 && /* @__PURE__ */ t("div", { className: S.prompt__hint, children: r })
171
+ d !== void 0 && /* @__PURE__ */ a("div", { className: R.prompt__hint, children: d })
172
172
  ] });
173
173
  }
174
- ), xa = /* @__PURE__ */ b(
175
- /* @__PURE__ */ g(Dt, "PromptInput")
176
- ), Rt = "hanui-grid-4EfQ-", Ft = "hanui-card-KTt0-", Kt = "hanui-card__label-LNLTF", Gt = "hanui-card__description-eIx-0", I = {
177
- grid: Rt,
178
- card: Ft,
179
- card__label: Kt,
180
- card__description: Gt
181
- }, qt = ({ label: e, items: a, onPick: n, className: i, testId: o }) => /* @__PURE__ */ t("div", { role: "group", "aria-label": e, className: h(I.grid, i), "data-testid": o, children: a.map((l) => /* @__PURE__ */ u("button", { type: "button", className: I.card, onClick: () => n(l), children: [
182
- /* @__PURE__ */ t("span", { className: I.card__label, children: l.label }),
183
- l.description && /* @__PURE__ */ t("span", { className: I.card__description, children: l.description })
184
- ] }, l.id)) }), fa = /* @__PURE__ */ b(
185
- /* @__PURE__ */ g(qt, "PromptSuggestions")
186
- ), Xt = "hanui-prose-kAp6f", Vt = {
187
- prose: Xt
188
- }, jt = ({ className: e, testId: a, ...n }) => /* @__PURE__ */ t("div", { className: h(Vt.prose, e), "data-testid": a, ...n }), Ca = /* @__PURE__ */ b(/* @__PURE__ */ g(jt, "Prose")), Qt = "hanui-block-M1yL9", Ut = "hanui-block__header-F2iBP", Ht = "hanui-block__language-lmdS9", Jt = "hanui-block__body-wDCJ2", Zt = "hanui-block__pre--EERi", Yt = "hanui-block__highlighted-JK1Yj", z = {
189
- block: Qt,
190
- block__header: Ut,
191
- block__language: Ht,
192
- block__body: Jt,
193
- block__pre: Zt,
194
- block__highlighted: Yt
195
- }, Wt = 1600, te = ({ code: e, language: a, html: n, maxHeight: i, className: o, testId: l }) => {
196
- var y;
197
- const { labels: s } = w(), d = tt(), [c, _] = X(!1), r = A(void 0);
198
- P(() => () => window.clearTimeout(r.current), []);
199
- const m = async () => {
200
- var N;
174
+ ), Qs = /* @__PURE__ */ g(
175
+ /* @__PURE__ */ k(Ct, "PromptInput")
176
+ ), Et = "hanui-grid-4EfQ-", $t = "hanui-card-KTt0-", Rt = "hanui-card__label-LNLTF", Ot = "hanui-card__description-eIx-0", q = {
177
+ grid: Et,
178
+ card: $t,
179
+ card__label: Rt,
180
+ card__description: Ot
181
+ }, Lt = ({ label: e, items: n, onPick: t, className: i, testId: r }) => /* @__PURE__ */ a("div", { role: "group", "aria-label": e, className: m(q.grid, i), "data-testid": r, children: n.map((o) => /* @__PURE__ */ h("button", { type: "button", className: q.card, onClick: () => t(o), children: [
182
+ /* @__PURE__ */ a("span", { className: q.card__label, children: o.label }),
183
+ o.description && /* @__PURE__ */ a("span", { className: q.card__description, children: o.description })
184
+ ] }, o.id)) }), Vs = /* @__PURE__ */ g(
185
+ /* @__PURE__ */ k(Lt, "PromptSuggestions")
186
+ ), zt = "hanui-prose-kAp6f", It = {
187
+ prose: zt
188
+ }, Dt = ({ className: e, testId: n, ...t }) => /* @__PURE__ */ a("div", { className: m(It.prose, e), "data-testid": n, ...t }), ea = /* @__PURE__ */ g(/* @__PURE__ */ k(Dt, "Prose")), Mt = /^(?:[ \t]*\r?\n)+/, Pt = " ", Kt = (e) => (e == null ? void 0 : e.trim().toLowerCase()) === "json", Bt = (e, n) => {
189
+ let t = n + 1;
190
+ for (; t < e.length && e[t] !== '"'; ) t += e[t] === "\\" ? 2 : 1;
191
+ return t + 1;
192
+ }, Ft = (e, n) => {
193
+ let t = n;
194
+ for (; t < e.length && /\s/.test(e[t]); ) t++;
195
+ return t;
196
+ }, jt = (e) => {
197
+ try {
198
+ JSON.parse(e);
199
+ } catch {
200
+ return e;
201
+ }
202
+ let n = "", t = 0;
203
+ const i = () => `
204
+ ${Pt.repeat(t)}`;
205
+ for (let r = 0; r < e.length; r++) {
206
+ const o = e[r];
207
+ if (o === '"') {
208
+ const s = Bt(e, r);
209
+ n += e.slice(r, s), r = s - 1;
210
+ } else if (o === "{" || o === "[") {
211
+ const s = Ft(e, r + 1);
212
+ e[s] === (o === "{" ? "}" : "]") ? (n += o + e[s], r = s) : (t++, n += o + i());
213
+ } else o === "}" || o === "]" ? (t--, n += i() + o) : o === "," ? n += `,${i()}` : o === ":" ? n += ": " : /\s/.test(o) || (n += o);
214
+ }
215
+ return n;
216
+ }, Zt = (e, n) => {
217
+ const t = e.replace(Mt, "").trimEnd();
218
+ return Kt(n) ? jt(t) : t;
219
+ }, p = (e) => new Set(e.split(" ")), $ = /"(?:[^"\\\n]|\\.)*"?/, H = /'(?:[^'\\\n]|\\.)*'?/, je = /`(?:[^`\\]|\\[\s\S])*`?/, le = /"""[\s\S]*?(?:"""|(?![\s\S]))/, Ut = /'''[\s\S]*?(?:'''|(?![\s\S]))/, Ht = /'(?:\\[^\n]{1,8}?|[^'\\\n])'/, ne = /\/\/.*/, G = /\/\*[\s\S]*?(?:\*\/|(?![\s\S]))/, z = /#.*/, P = /\b(?:0[xX][\dA-Fa-f_]+|0[bB][01_]+|0[oO][0-7_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][+-]?\d+)?)[A-Za-z]*\b/, I = /[A-Za-z_]\w*/, se = /[{}[\]();,.:]/, de = /@[A-Za-z_][\w.]*/, Gt = /[\w$)\]]/, be = /\S/, fe = "break case catch class const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield async await of static get set as from", qt = "type interface enum implements namespace declare abstract private protected public readonly keyof infer is satisfies override module asserts unique", Yt = "true false null undefined NaN Infinity", Wt = "string number boolean any unknown never object symbol bigint", Xt = "int long short char float double bool boolean byte void unsigned signed string str usize isize u8 u16 u32 u64 u128 i8 i16 i32 i64 i128 f32 f64 rune uint uint8 uint16 uint32 uint64 int8 int16 int32 int64 float32 float64 error any decimal size_t", Jt = "true false null nil nullptr NULL", Ze = "auto break case const continue default do else enum extern for goto if inline register restrict return sizeof static struct switch typedef union volatile while", Qt = `${Ze} alignas alignof catch class constexpr consteval const_cast decltype delete dynamic_cast explicit export friend mutable namespace new noexcept operator private protected public reinterpret_cast static_assert static_cast template this thread_local throw try typeid typename using virtual override final concept requires co_await co_return co_yield`, Vt = "abstract as async await base break case catch checked class const continue default delegate do dynamic else enum event explicit extern finally fixed for foreach get goto if implicit in init interface internal is lock namespace new operator out override params partial private protected public readonly record ref return sealed set sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using var virtual volatile when where while yield", en = "abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package permits private protected public record return sealed static strictfp super switch synchronized this throw throws transient try var volatile while yield", tn = "abstract annotation as break by catch class companion const constructor continue crossinline data do else enum external final finally for fun get if import in infix init inline inner interface internal is lateinit noinline object open operator out override package private protected public reified return sealed set super suspend this throw try typealias val var vararg when where while", nn = "actor as associatedtype async await break case catch class continue default defer deinit do else enum extension fallthrough fileprivate final for func guard if import in init inout internal is lazy let mutating open operator override private protocol public repeat rethrows return self Self some static struct subscript super switch throw throws try typealias var weak where while", sn = "break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var", an = "as async await break const continue crate dyn else enum extern fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait type unsafe use where while", rn = "abstract and array as break callable case catch class clone const continue declare default do echo else elseif empty extends final finally fn for foreach function global goto if implements include include_once instanceof insteadof interface isset list match namespace new or print private protected public readonly require require_once return static switch throw trait try unset use var while xor yield", on = "if then else elif fi for while until do done case esac in function return local export select time break continue declare readonly unset shift source alias exit", cn = "FROM AS RUN CMD LABEL EXPOSE ENV ADD COPY ENTRYPOINT VOLUME USER WORKDIR ARG ONBUILD STOPSIGNAL HEALTHCHECK SHELL MAINTAINER", ae = (e, n) => ({
220
+ rules: [
221
+ ["comment", ne],
222
+ ["comment", G],
223
+ ["string", $],
224
+ ["string", H],
225
+ ["string", je],
226
+ /*
227
+ * Düzenli ifade. Tamamı (kapanış `/` ve bayraklar) önce gelir; alternatifler AYRIK olduğu
228
+ * için geri dönüş doğrusaldır.
229
+ * ⚠ Karakter sınıfının kapanışı bu kuralda ZORUNLU. `\]?` dıştaki tekrar ve sondaki `/` ile
230
+ * birkaç bin `[`de üstel geri dönüş yapıp sayfayı kilitliyordu.
231
+ * Kapanmamış ifade alttaki kural: sonda aranan bir `/` yok, bu yüzden başarısız olup geri
232
+ * dönmez; gövde satır sonuna kadar boyanır.
233
+ */
234
+ ["regex", /\/(?![*/])(?:\\.|\[(?:\\.|[^\]\\\n])*\]|[^/\\\n[])+\/[dgimsuvy]*/],
235
+ ["regex", /\/(?![*/])(?:\\.|\[(?:\\.|[^\]\\\n])*\]?|[^/\\\n[])*/],
236
+ /*
237
+ * Bileşen etiketi yalnızca JSX'te; TS'te `<` bir tür parametresi ya da karşılaştırma. Açılış
238
+ * etiketi addan sonra gelemez (`useState<string>`); kapanış gelebilir (`Kaydet</Button>`).
239
+ */
240
+ ...n ? [
241
+ ["tag", /<\/[A-Za-z][\w.:-]*/],
242
+ ["tag", /<[A-Za-z][\w.:-]*/, Gt]
243
+ ] : [],
244
+ ["name", de],
245
+ ["number", P],
246
+ ["word", /[A-Za-z_$][\w$]*/],
247
+ ["punctuation", se]
248
+ ],
249
+ keywords: p(e ? `${fe} ${qt}` : fe),
250
+ literals: p(Yt),
251
+ types: e ? p(Wt) : void 0,
252
+ hasCapitalTypes: !0
253
+ }), T = (e, n = []) => ({
254
+ rules: [
255
+ ...n,
256
+ ["comment", ne],
257
+ ["comment", G],
258
+ /* Önişlemci (`#include`) ve Rust özniteliği (`#[derive(Debug)]`). */
259
+ ["keyword", /^[ \t]*#[ \t]*[a-z]+|#!?\[[^\]\n]*\]/],
260
+ ["string", le],
261
+ ["string", $],
262
+ ["string", Ht],
263
+ /* Go'nun ham dizesi. */
264
+ ["string", je],
265
+ ["name", de],
266
+ ["number", P],
267
+ ["word", I],
268
+ ["punctuation", se]
269
+ ],
270
+ keywords: p(e),
271
+ literals: p(Jt),
272
+ types: p(Xt),
273
+ hasCapitalTypes: !0
274
+ }), ye = () => ({
275
+ rules: [
276
+ ["comment", z],
277
+ [
278
+ "string",
279
+ /(?:\b[rRbBuUfF]{1,2})?(?:"""[\s\S]*?(?:"""|(?![\s\S]))|'''[\s\S]*?(?:'''|(?![\s\S])))/
280
+ ],
281
+ ["string", /(?:\b[rRbBuUfF]{1,2})?(?:"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?)/],
282
+ ["name", de],
283
+ ["number", P],
284
+ ["word", I],
285
+ ["punctuation", se]
286
+ ],
287
+ keywords: p(
288
+ "and as assert async await break class continue def del elif else except finally for from global if import in is lambda nonlocal not or pass raise return try while with yield match case"
289
+ ),
290
+ literals: p("True False None"),
291
+ types: p("int float str bool list dict set tuple bytes object"),
292
+ hasCapitalTypes: !0
293
+ }), ge = () => ({
294
+ rules: [
295
+ ["comment", z],
296
+ ["string", $],
297
+ ["string", H],
298
+ /* Sembol (`:ad`) sabittir; `Foo::Bar` içindeki `:Bar` değil. */
299
+ ["number", /:[A-Za-z_]\w*[?!]?/, /[\w:]/],
300
+ ["name", /@{1,2}[A-Za-z_]\w*/],
301
+ ["number", P],
302
+ ["word", /[A-Za-z_]\w*[?!]?/],
303
+ ["punctuation", se]
304
+ ],
305
+ keywords: p(
306
+ "alias and begin break case class def defined? do else elsif end ensure for if in module next not or redo rescue retry return self super then undef unless until when while yield require require_relative attr_accessor attr_reader attr_writer private protected public raise"
307
+ ),
308
+ literals: p("true false nil"),
309
+ hasCapitalTypes: !0
310
+ }), Ue = (e) => ({
311
+ rules: [
312
+ /* `#` yorum açar yalnızca kelime başında: `$#`, `a#b` yorum değil. */
313
+ ["comment", z, /[^\s;|&(]/],
314
+ /* Kabukta çift tırnak satır aşar, tek tırnak kaçış tanımaz. */
315
+ ["string", /"(?:[^"\\]|\\[\s\S])*"?/],
316
+ ["string", /'[^']*'?/],
317
+ ["name", /\$(?:\{[^}\n]*\}?|[A-Za-z_]\w*|[@#?$!*\d-])/],
318
+ ["number", /\b\d+\b/],
319
+ ["word", /[A-Za-z_][\w-]*/],
320
+ ["punctuation", /[{}[\]();|&]/]
321
+ ],
322
+ keywords: p(e)
323
+ }), ke = () => ({
324
+ rules: [
325
+ ["comment", ne],
326
+ ["comment", G],
327
+ /* Anahtar: ardından `:` gelen dize. */
328
+ ["name", /"(?:[^"\\\n]|\\.)*"(?=\s*:)/],
329
+ ["string", $],
330
+ ["number", /-?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],
331
+ ["word", I],
332
+ ["punctuation", /[{}[\],:]/]
333
+ ],
334
+ literals: p("true false null")
335
+ }), we = () => ({
336
+ rules: [
337
+ ["comment", z, be],
338
+ /* Anahtar; ilk karakteri `-` olamaz (`- ad:` bir liste öğesi). */
339
+ [
340
+ "name",
341
+ /(?:"(?:[^"\\\n]|\\.)*"|'[^'\n]*'|[\w$./][\w$./-]*(?:[ \t]+[\w$./-]+)*)(?=[ \t]*:(?:[ \t]|$))/
342
+ ],
343
+ ["string", $],
344
+ ["string", H],
345
+ /* Çapa (`&ad`), takma ad (`*ad`), etiket (`!!str`). */
346
+ ["type", /[&*][\w-]+|!!?[\w-]+/, be],
347
+ ["punctuation", /^[ \t]*-(?=[ \t]|$)|[{}[\],]|[|>][-+]?(?=[ \t]*$)/],
348
+ ["number", /[-+]?\b\d[\d_]*(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],
349
+ ["word", I]
350
+ ],
351
+ literals: p("true false null True False Null TRUE FALSE NULL")
352
+ }), ln = () => ({
353
+ rules: [
354
+ ["comment", z],
355
+ ["type", /^[ \t]*\[\[?[^\]\n]*\]\]?/],
356
+ ["name", /(?:"[^"\n]*"|[\w.-]+)(?=[ \t]*=)/],
357
+ ["string", le],
358
+ ["string", Ut],
359
+ ["string", $],
360
+ ["string", /'[^'\n]*'?/],
361
+ [
362
+ "number",
363
+ /\b\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b|[-+]?\b\d[\d_]*(?:\.\d+)?(?:[eE][+-]?\d+)?\b/
364
+ ],
365
+ ["word", I],
366
+ ["punctuation", /[{}[\],=]/]
367
+ ],
368
+ literals: p("true false inf nan")
369
+ }), ie = () => ({
370
+ rules: [
371
+ ["comment", G],
372
+ /* SCSS/Less satır yorumu; `url(http://…)` içindeki `//` değil. */
373
+ ["comment", ne, /:/],
374
+ ["string", $],
375
+ ["string", H],
376
+ ["keyword", /@[\w-]+|!important\b/],
377
+ /*
378
+ * Özellik adı: ardındaki `:` bir bildirimi açıyorsa (`;` ya da `}` `{`dan önce geliyorsa).
379
+ * `a:hover {` bir seçici — ardından önce `{` geliyor.
380
+ */
381
+ ["name", /-{0,2}[A-Za-z][\w-]*(?=\s*:[^;{}]*[;}])/],
382
+ ["name", /\$[\w-]+/],
383
+ ["number", /#[\dA-Fa-f]{3,8}\b|-?(?:\b\d+(?:\.\d+)?|\.\d+)(?:%|[A-Za-z]+\b)?/],
384
+ ["word", /-?[A-Za-z_][\w-]*/],
385
+ ["punctuation", /[{}();:,]/]
386
+ ]
387
+ }), Y = () => ({
388
+ rules: [
389
+ ["comment", /<!--[\s\S]*?(?:-->|(?![\s\S]))/],
390
+ ["keyword", /<![A-Za-z][^>]*>?|<\?[\s\S]*?(?:\?>|(?![\s\S]))/],
391
+ ["markup", /<\/?[A-Za-z][\w:.-]*(?:"[^"]*"?|'[^']*'?|[^'">])*>?/],
392
+ /* Karakter başvurusu (`&amp;`). */
393
+ ["number", /&#?\w+;/]
394
+ ]
395
+ }), ve = () => ({
396
+ rules: [
397
+ [
398
+ "string",
399
+ /^[ \t]*```[\s\S]*?(?:^[ \t]*```|(?![\s\S]))|^[ \t]*~~~[\s\S]*?(?:^[ \t]*~~~|(?![\s\S]))/
400
+ ],
401
+ ["keyword", /^#{1,6}[ \t].*/],
402
+ ["punctuation", /^[ \t]*(?:[-*+]|\d+[.)])(?=[ \t])|^[ \t]*>/],
403
+ ["string", /`[^`\n]+`/],
404
+ ["name", /!?\[[^\]\n]*\]\([^)\n]*\)/]
405
+ ]
406
+ }), dn = () => ({
407
+ rules: [
408
+ ["comment", /--.*/],
409
+ ["comment", G],
410
+ ["string", /'(?:[^']|'')*'?/],
411
+ ["name", /"[^"\n]*"?|`[^`\n]*`?/],
412
+ ["number", P],
413
+ ["word", I],
414
+ ["punctuation", /[(),;.]/]
415
+ ],
416
+ keywords: p(
417
+ "select from where and or not insert into values update set delete create table alter drop index view join inner left right full outer cross on as group by order having limit offset union all distinct case when then else end is in exists between like ilike primary key foreign references default unique constraint returning with asc desc begin commit rollback transaction if replace check cascade grant revoke add column database schema trigger procedure function declare"
418
+ ),
419
+ literals: p("null true false"),
420
+ types: p(
421
+ "int integer bigint smallint serial bigserial text varchar char boolean bool date time timestamp timestamptz interval numeric decimal real float double json jsonb uuid bytea"
422
+ ),
423
+ isCaseInsensitive: !0
424
+ }), Ne = () => ({
425
+ rules: [
426
+ ["keyword", /^(?:diff|index|\+\+\+|---)(?: .*|$)/],
427
+ ["name", /^@@.*/],
428
+ ["inserted", /^\+.*/],
429
+ ["deleted", /^-.*/]
430
+ ]
431
+ }), Se = () => ({
432
+ rules: [
433
+ ["comment", z],
434
+ ["string", le],
435
+ ["string", $],
436
+ ["name", /\$\w+/],
437
+ ["name", /@\w+/],
438
+ ["number", P],
439
+ ["word", I],
440
+ ["punctuation", /[{}[\]():,!=|]/]
441
+ ],
442
+ keywords: p(
443
+ "query mutation subscription fragment on type input enum interface union scalar schema extend directive implements"
444
+ ),
445
+ literals: p("true false null"),
446
+ /* `ID` tamamı büyük harf ama sabit değil, yerleşik tip. */
447
+ types: p("ID"),
448
+ hasCapitalTypes: !0
449
+ }), _n = () => ({
450
+ rules: [
451
+ ["tag", /<\/?[A-Za-z][\w:.-]*/],
452
+ ["string", /"[^"]*"?|'[^']*'?/],
453
+ ["name", /[^\s"'<>/=]+/],
454
+ ["punctuation", /\/?>|=/]
455
+ ]
456
+ }), W = () => ae(!1, !1), un = () => ae(!1, !0), X = () => ae(!0, !1), mn = () => ae(!0, !0), B = () => Ue(on), xe = () => Ue(cn), Ae = () => T(Ze), re = () => T(Qt), Te = () => T(Vt), Ce = () => T(tn), Ee = () => T(sn), $e = () => T(an), hn = () => T(rn, [
457
+ ["comment", z],
458
+ ["name", /\$[A-Za-z_]\w*/],
459
+ ["string", H]
460
+ ]), Re = {
461
+ javascript: W,
462
+ js: W,
463
+ mjs: W,
464
+ cjs: W,
465
+ jsx: un,
466
+ typescript: X,
467
+ ts: X,
468
+ mts: X,
469
+ cts: X,
470
+ tsx: mn,
471
+ json: ke,
472
+ jsonc: ke,
473
+ bash: B,
474
+ sh: B,
475
+ shell: B,
476
+ zsh: B,
477
+ console: B,
478
+ dockerfile: xe,
479
+ docker: xe,
480
+ python: ye,
481
+ py: ye,
482
+ ruby: ge,
483
+ rb: ge,
484
+ yaml: we,
485
+ yml: we,
486
+ toml: ln,
487
+ css: ie,
488
+ scss: ie,
489
+ less: ie,
490
+ html: Y,
491
+ xml: Y,
492
+ svg: Y,
493
+ vue: Y,
494
+ markdown: ve,
495
+ md: ve,
496
+ sql: dn,
497
+ diff: Ne,
498
+ patch: Ne,
499
+ graphql: Se,
500
+ gql: Se,
501
+ c: Ae,
502
+ h: Ae,
503
+ cpp: re,
504
+ "c++": re,
505
+ hpp: re,
506
+ csharp: Te,
507
+ cs: Te,
508
+ java: () => T(en),
509
+ kotlin: Ce,
510
+ kt: Ce,
511
+ swift: () => T(nn),
512
+ go: Ee,
513
+ golang: Ee,
514
+ rust: $e,
515
+ rs: $e,
516
+ php: hn
517
+ }, pn = 2e4, Oe = /!?[ \t]*\(/y, bn = /^[A-Z][A-Z\d_]+$/, fn = /[(,=:[!&|?{};~+\-*%<>^]/, yn = /* @__PURE__ */ new Set([
518
+ "return",
519
+ "typeof",
520
+ "case",
521
+ "do",
522
+ "else",
523
+ "in",
524
+ "of",
525
+ "new",
526
+ "delete",
527
+ "void",
528
+ "throw",
529
+ "yield",
530
+ "await"
531
+ ]), Le = /* @__PURE__ */ new Map(), He = (e) => {
532
+ const n = Le.get(e);
533
+ if (n) return n;
534
+ const t = e(), r = { pattern: new RegExp(t.rules.map(([, o]) => `(${o.source})`).join("|"), "gm"), grammar: t };
535
+ return Le.set(e, r), r;
536
+ }, gn = (e) => {
537
+ const n = e == null ? void 0 : e.trim().toLowerCase();
538
+ return n && Object.hasOwn(Re, n) ? Re[n] : void 0;
539
+ }, kn = (e, n) => {
540
+ let t = n - 1;
541
+ for (; t >= 0 && /\s/.test(e[t]); ) t--;
542
+ if (t < 0 || fn.test(e[t])) return !0;
543
+ const i = t + 1;
544
+ for (; t >= 0 && /[\w$]/.test(e[t]); ) t--;
545
+ return yn.has(e.slice(t + 1, i));
546
+ }, wn = (e, n, t, i, r) => {
547
+ var l, c, _;
548
+ Oe.lastIndex = r;
549
+ const o = Oe.test(t);
550
+ if (t[i - 1] === ".") return o ? "name" : void 0;
551
+ const s = e.isCaseInsensitive ? n.toLowerCase() : n;
552
+ if ((l = e.keywords) != null && l.has(s)) return "keyword";
553
+ if ((c = e.literals) != null && c.has(s)) return "number";
554
+ if ((_ = e.types) != null && _.has(s)) return "type";
555
+ if (o) return "name";
556
+ if (e.hasCapitalTypes && /^[A-Z]/.test(n))
557
+ return bn.test(n) ? "number" : "type";
558
+ }, Ge = ({ pattern: e, grammar: n }, t) => {
559
+ const i = [], r = (s, l) => {
560
+ if (!s) return;
561
+ const c = i.at(-1);
562
+ c && c.type === l ? c.text += s : i.push({ text: s, type: l });
563
+ };
564
+ let o = 0;
565
+ e.lastIndex = 0;
566
+ for (let s = e.exec(t); s; s = e.exec(t)) {
567
+ const [l] = s, { index: c } = s, _ = c + l.length;
568
+ if (_ === c) {
569
+ e.lastIndex = c + 1;
570
+ continue;
571
+ }
572
+ const [d, , u] = n.rules[s.indexOf(l, 1) - 1];
573
+ if (u !== void 0 && c > 0 && u.test(t[c - 1]) || d === "regex" && !kn(t, c)) {
574
+ e.lastIndex = c + 1;
575
+ continue;
576
+ }
577
+ if (r(t.slice(o, c)), o = _, d === "word") r(l, wn(n, l, t, c, _));
578
+ else if (d === "regex") r(l, "string");
579
+ else if (d === "tag") {
580
+ const b = l[1] === "/" ? 2 : 1, y = l.slice(b);
581
+ r(l.slice(0, b), "punctuation"), r(y, /^[A-Z]/.test(y) || y.includes(".") ? "type" : "keyword");
582
+ } else if (d === "markup")
583
+ for (const b of Ge(He(_n), l)) r(b.text, b.type);
584
+ else r(l, d);
585
+ }
586
+ return r(t.slice(o)), i;
587
+ }, vn = (e, n) => {
588
+ const t = gn(n);
589
+ return t && e.length <= pn ? Ge(He(t), e) : [{ text: e }];
590
+ }, Nn = "hanui-block-M1yL9", Sn = "hanui-block__header-F2iBP", xn = "hanui-block__language-lmdS9", An = "hanui-block__body-wDCJ2", Tn = "hanui-block__pre--EERi", Cn = "hanui-block__highlighted-JK1Yj", O = {
591
+ block: Nn,
592
+ block__header: Sn,
593
+ block__language: xn,
594
+ block__body: An,
595
+ block__pre: Tn,
596
+ block__highlighted: Cn,
597
+ "block__token--comment": "hanui-block__token--comment-eFTyh",
598
+ "block__token--keyword": "hanui-block__token--keyword-qQpj9",
599
+ "block__token--string": "hanui-block__token--string-4onwX",
600
+ "block__token--number": "hanui-block__token--number-DThtL",
601
+ "block__token--name": "hanui-block__token--name-283C9",
602
+ "block__token--type": "hanui-block__token--type-cNUbM",
603
+ "block__token--punctuation": "hanui-block__token--punctuation-Te2u8",
604
+ "block__token--inserted": "hanui-block__token--inserted-sUKnQ",
605
+ "block__token--deleted": "hanui-block__token--deleted-s74a-"
606
+ }, En = 1600, $n = ({ code: e, language: n, html: t, maxHeight: i, className: r, testId: o }) => {
607
+ var v;
608
+ const { labels: s } = C(), l = Pe(), [c, _] = ce(!1), d = L(void 0), u = he(() => t ? e : Zt(e, n), [e, t, n]), f = he(() => t ? [] : vn(u, n), [u, t, n]);
609
+ U(() => () => window.clearTimeout(d.current), []);
610
+ const b = async () => {
611
+ var w;
201
612
  try {
202
- await navigator.clipboard.writeText(e);
613
+ await navigator.clipboard.writeText(u);
203
614
  } catch {
204
615
  return;
205
616
  }
206
- _(!0), d(x("CodeBlock.copied", (N = s == null ? void 0 : s.chat) == null ? void 0 : N.codeCopied)), window.clearTimeout(r.current), r.current = window.setTimeout(() => _(!1), Wt);
207
- }, p = a ?? "";
208
- return /* @__PURE__ */ u("figure", { className: h(z.block, o), "data-testid": l, children: [
209
- /* @__PURE__ */ u("figcaption", { className: z.block__header, children: [
210
- /* @__PURE__ */ t("span", { className: z.block__language, children: p }),
211
- /* @__PURE__ */ t(
212
- G,
617
+ _(!0), l(x("CodeBlock.copied", (w = s == null ? void 0 : s.chat) == null ? void 0 : w.codeCopied)), window.clearTimeout(d.current), d.current = window.setTimeout(() => _(!1), En);
618
+ }, y = n ?? "";
619
+ return /* @__PURE__ */ h("figure", { className: m(O.block, r), "data-testid": o, children: [
620
+ /* @__PURE__ */ h("figcaption", { className: O.block__header, children: [
621
+ /* @__PURE__ */ a("span", { className: O.block__language, children: y }),
622
+ /* @__PURE__ */ a(
623
+ te,
213
624
  {
214
- icon: c ? /* @__PURE__ */ t(ht, { "aria-hidden": !0 }) : /* @__PURE__ */ t(ut, { "aria-hidden": !0 }),
215
- label: nt("CodeBlock.copy", (y = s == null ? void 0 : s.chat) == null ? void 0 : y.codeCopy, p),
625
+ icon: c ? /* @__PURE__ */ a(st, { "aria-hidden": !0 }) : /* @__PURE__ */ a(at, { "aria-hidden": !0 }),
626
+ label: Fe("CodeBlock.copy", (v = s == null ? void 0 : s.chat) == null ? void 0 : v.codeCopy, y),
216
627
  size: "sm",
217
- onClick: m
628
+ onClick: b
218
629
  }
219
630
  )
220
631
  ] }),
221
- /* @__PURE__ */ t(
632
+ /* @__PURE__ */ a(
222
633
  "div",
223
634
  {
224
- className: z.block__body,
635
+ className: O.block__body,
225
636
  style: i === void 0 ? void 0 : { maxBlockSize: i },
226
637
  tabIndex: 0,
227
- role: p ? "region" : void 0,
228
- "aria-label": p || void 0,
229
- children: n ? /* @__PURE__ */ t("div", { className: z.block__highlighted, dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ t("pre", { className: z.block__pre, children: /* @__PURE__ */ t("code", { children: e }) })
638
+ role: y ? "region" : void 0,
639
+ "aria-label": y || void 0,
640
+ children: t ? /* @__PURE__ */ a("div", { className: O.block__highlighted, dangerouslySetInnerHTML: { __html: t } }) : /* @__PURE__ */ a("pre", { className: O.block__pre, children: /* @__PURE__ */ a("code", { children: f.map(
641
+ (w, K) => w.type ? /* @__PURE__ */ a("span", { className: O[`block__token--${w.type}`], children: w.text }, K) : /* @__PURE__ */ a(Xe, { children: w.text }, K)
642
+ ) }) })
230
643
  }
231
644
  )
232
645
  ] });
233
- }, $a = /* @__PURE__ */ b(/* @__PURE__ */ g(te, "CodeBlock")), ee = "hanui-block-zqPjp", ae = "hanui-block__summary-Kkp-X", ne = "hanui-block__indicator-GuJMa", se = "hanui-block__body-mDvrV", D = {
234
- block: ee,
235
- block__summary: ae,
236
- block__indicator: ne,
237
- block__body: se
238
- }, ie = ({
646
+ }, ta = /* @__PURE__ */ g(/* @__PURE__ */ k($n, "CodeBlock")), Rn = "hanui-block-zqPjp", On = "hanui-block__summary-Kkp-X", Ln = "hanui-block__indicator-GuJMa", zn = "hanui-block__body-mDvrV", J = {
647
+ block: Rn,
648
+ block__summary: On,
649
+ block__indicator: Ln,
650
+ block__body: zn
651
+ }, In = ({
239
652
  summary: e,
240
- isRunning: a = !1,
241
- indicator: n,
653
+ isRunning: n = !1,
654
+ indicator: t,
242
655
  isDefaultOpen: i = !1,
243
- children: o,
244
- className: l,
656
+ children: r,
657
+ className: o,
245
658
  testId: s
246
659
  }) => {
247
- const [d, c] = X(a || i), _ = A(!1);
248
- return P(() => {
249
- _.current || c(a || i);
250
- }, [a, i]), /* @__PURE__ */ t(
251
- at,
660
+ const [l, c] = ce(n || i), _ = L(!1);
661
+ return U(() => {
662
+ _.current || c(n || i);
663
+ }, [n, i]), /* @__PURE__ */ a(
664
+ Be,
252
665
  {
253
666
  variant: "plain",
254
- className: h(D.block, l),
255
- summary: /* @__PURE__ */ u("span", { className: D.block__summary, children: [
256
- a && /* @__PURE__ */ t("span", { className: D.block__indicator, children: n ?? /* @__PURE__ */ t(gt, { size: "sm" }) }),
667
+ className: m(J.block, o),
668
+ summary: /* @__PURE__ */ h("span", { className: J.block__summary, children: [
669
+ n && /* @__PURE__ */ a("span", { className: J.block__indicator, children: t ?? /* @__PURE__ */ a(ot, { size: "sm" }) }),
257
670
  e
258
671
  ] }),
259
- isOpen: d,
260
- onOpenChange: (r) => {
261
- _.current = !0, c(r);
672
+ isOpen: l,
673
+ onOpenChange: (d) => {
674
+ _.current = !0, c(d);
262
675
  },
263
676
  testId: s,
264
- children: /* @__PURE__ */ t("div", { className: D.block__body, children: o })
677
+ children: /* @__PURE__ */ a("div", { className: J.block__body, children: r })
265
678
  }
266
679
  );
267
- }, wa = /* @__PURE__ */ b(
268
- /* @__PURE__ */ g(ie, "ReasoningBlock")
269
- ), oe = "hanui-text-WKVxU", le = "hanui-text__body--uP0k", J = {
270
- text: oe,
271
- text__body: le
272
- }, ce = ({ text: e, label: a, maxHeight: n = 180, className: i, testId: o }) => /* @__PURE__ */ t(
273
- yt,
680
+ }, na = /* @__PURE__ */ g(
681
+ /* @__PURE__ */ k(In, "ReasoningBlock")
682
+ ), Dn = "hanui-text-WKVxU", Mn = "hanui-text__body--uP0k", ze = {
683
+ text: Dn,
684
+ text__body: Mn
685
+ }, Pn = ({ text: e, label: n, maxHeight: t = 180, className: i, testId: r }) => /* @__PURE__ */ a(
686
+ ct,
274
687
  {
275
- className: h(J.text, i),
276
- label: a,
277
- maxHeight: n,
688
+ className: m(ze.text, i),
689
+ label: n,
690
+ maxHeight: t,
278
691
  hasFade: !0,
279
692
  isFollowingEnd: !0,
280
- testId: o,
281
- children: /* @__PURE__ */ t("p", { className: J.text__body, children: e })
693
+ testId: r,
694
+ children: /* @__PURE__ */ a("p", { className: ze.text__body, children: e })
282
695
  }
283
- ), Ta = /* @__PURE__ */ b(
284
- /* @__PURE__ */ g(ce, "ReasoningText")
285
- ), re = "hanui-call-tV2P8", _e = "hanui-call__header-8Tw7m", de = "hanui-call__icon-TLzwf", me = "hanui-call__name-EHz6G", he = "hanui-call__summary-M4sLU", ue = "hanui-call__meta-bvpp7", pe = "hanui-call__body-nFK-C", be = "hanui-section-TjSGF", ge = "hanui-section__label-UrgqM", ye = "hanui-section__body-Dy1PX", v = {
286
- call: re,
696
+ ), sa = /* @__PURE__ */ g(
697
+ /* @__PURE__ */ k(Pn, "ReasoningText")
698
+ ), Kn = "hanui-call-tV2P8", Bn = "hanui-call__header-8Tw7m", Fn = "hanui-call__icon-TLzwf", jn = "hanui-call__name-EHz6G", Zn = "hanui-call__summary-M4sLU", Un = "hanui-call__meta-bvpp7", Hn = "hanui-call__body-nFK-C", Gn = "hanui-section-TjSGF", qn = "hanui-section__label-UrgqM", Yn = "hanui-section__body-Dy1PX", N = {
699
+ call: Kn,
287
700
  "call--static": "hanui-call--static-Nldru",
288
- call__header: _e,
289
- call__icon: de,
701
+ call__header: Bn,
702
+ call__icon: Fn,
290
703
  "call__icon--running": "hanui-call__icon--running-Mx1XK",
291
- call__name: me,
292
- call__summary: he,
293
- call__meta: ue,
294
- call__body: pe,
295
- section: be,
296
- section__label: ge,
297
- section__body: ye
298
- }, ve = {
704
+ call__name: jn,
705
+ call__summary: Zn,
706
+ call__meta: Un,
707
+ call__body: Hn,
708
+ section: Gn,
709
+ section__label: qn,
710
+ section__body: Yn
711
+ }, Wn = {
299
712
  running: "neutral",
300
713
  ok: "success",
301
714
  error: "danger",
302
715
  aborted: "warning",
303
716
  interrupted: "danger"
304
- }, Ne = ({
717
+ }, Xn = ({
305
718
  icon: e,
306
- name: a,
307
- summary: n,
719
+ name: n,
720
+ summary: t,
308
721
  status: i,
309
- meta: o,
310
- isDefaultOpen: l,
722
+ meta: r,
723
+ isDefaultOpen: o,
311
724
  isOpen: s,
312
- onOpenChange: d,
725
+ onOpenChange: l,
313
726
  children: c,
314
727
  className: _,
315
- testId: r
728
+ testId: d
316
729
  }) => {
317
- var N, f;
318
- const { labels: m } = w(), p = x(`ToolCall.status.${i}`, (f = (N = m == null ? void 0 : m.chat) == null ? void 0 : N.toolStatus) == null ? void 0 : f[i]), y = /* @__PURE__ */ u("span", { className: v.call__header, children: [
319
- e !== void 0 && /* @__PURE__ */ t(
730
+ var y, v;
731
+ const { labels: u } = C(), f = x(`ToolCall.status.${i}`, (v = (y = u == null ? void 0 : u.chat) == null ? void 0 : y.toolStatus) == null ? void 0 : v[i]), b = /* @__PURE__ */ h("span", { className: N.call__header, children: [
732
+ e !== void 0 && /* @__PURE__ */ a(
320
733
  "span",
321
734
  {
322
- className: h(v.call__icon, i === "running" && v["call__icon--running"]),
735
+ className: m(N.call__icon, i === "running" && N["call__icon--running"]),
323
736
  "aria-hidden": !0,
324
737
  children: e
325
738
  }
326
739
  ),
327
- /* @__PURE__ */ t("span", { className: v.call__name, children: a }),
328
- n !== void 0 && /* @__PURE__ */ t("span", { className: v.call__summary, children: n }),
329
- /* @__PURE__ */ t(vt, { tone: ve[i], label: p, isPulsing: i === "running" })
740
+ /* @__PURE__ */ a("span", { className: N.call__name, children: n }),
741
+ t !== void 0 && /* @__PURE__ */ a("span", { className: N.call__summary, children: t }),
742
+ /* @__PURE__ */ a(lt, { tone: Wn[i], label: f, isPulsing: i === "running" })
330
743
  ] });
331
- return c === void 0 ? /* @__PURE__ */ u("div", { className: h(v.call, v["call--static"], _), "data-testid": r, children: [
332
- y,
333
- o !== void 0 && /* @__PURE__ */ t("span", { className: v.call__meta, children: o })
334
- ] }) : /* @__PURE__ */ t(
335
- at,
744
+ return c === void 0 ? /* @__PURE__ */ h("div", { className: m(N.call, N["call--static"], _), "data-testid": d, children: [
745
+ b,
746
+ r !== void 0 && /* @__PURE__ */ a("span", { className: N.call__meta, children: r })
747
+ ] }) : /* @__PURE__ */ a(
748
+ Be,
336
749
  {
337
- className: h(v.call, _),
338
- summary: y,
339
- meta: o,
340
- isDefaultOpen: l,
750
+ className: m(N.call, _),
751
+ summary: b,
752
+ meta: r,
753
+ isDefaultOpen: o,
341
754
  isOpen: s,
342
- onOpenChange: d,
343
- testId: r,
344
- children: /* @__PURE__ */ t("div", { className: v.call__body, children: c })
755
+ onOpenChange: l,
756
+ testId: d,
757
+ children: /* @__PURE__ */ a("div", { className: N.call__body, children: c })
345
758
  }
346
759
  );
347
- }, Sa = ({ label: e, children: a, className: n }) => (
760
+ }, aa = ({ label: e, children: n, className: t }) => (
348
761
  /*
349
762
  * Başlık bir HEADING değil: sohbet akışında başlık düzeyi tüketicinin sayfasına bağlı ve sabit bir
350
763
  * `h4` hiyerarşiyi bozuyordu. Bölüm de bir landmark değil (her araç kartında bir "bölge" gürültü).
351
764
  */
352
- /* @__PURE__ */ u("div", { className: h(v.section, n), children: [
353
- /* @__PURE__ */ t("span", { className: v.section__label, children: e }),
354
- /* @__PURE__ */ t("div", { className: v.section__body, children: a })
765
+ /* @__PURE__ */ h("div", { className: m(N.section, t), children: [
766
+ /* @__PURE__ */ a("span", { className: N.section__label, children: e }),
767
+ /* @__PURE__ */ a("div", { className: N.section__body, children: n })
355
768
  ] })
356
- ), Aa = /* @__PURE__ */ b(/* @__PURE__ */ g(Ne, "ToolCall")), ke = "hanui-terminal-D4Bz8", xe = "hanui-terminal__command-A7PG2", fe = "hanui-terminal__prompt-9N1g2", Ce = "hanui-terminal__stderr-qCNFe", $e = "hanui-terminal__srOnly-2pmQA", M = {
357
- terminal: ke,
358
- terminal__command: xe,
359
- terminal__prompt: fe,
360
- terminal__stderr: Ce,
361
- terminal__srOnly: $e
362
- }, we = ({
769
+ ), ia = /* @__PURE__ */ g(/* @__PURE__ */ k(Xn, "ToolCall")), Jn = "hanui-terminal-D4Bz8", Qn = "hanui-terminal__command-A7PG2", Vn = "hanui-terminal__prompt-9N1g2", es = "hanui-terminal__stderr-qCNFe", ts = "hanui-terminal__srOnly-2pmQA", F = {
770
+ terminal: Jn,
771
+ terminal__command: Qn,
772
+ terminal__prompt: Vn,
773
+ terminal__stderr: es,
774
+ terminal__srOnly: ts
775
+ }, ns = ({
363
776
  command: e,
364
- chunks: a,
365
- label: n,
777
+ chunks: n,
778
+ label: t,
366
779
  maxHeight: i = 300,
367
- className: o,
368
- testId: l
780
+ className: r,
781
+ testId: o
369
782
  }) => {
370
783
  var _;
371
- const { labels: s } = w(), d = A(null);
372
- et(d);
784
+ const { labels: s } = C(), l = L(null);
785
+ Ke(l);
373
786
  const c = x("TerminalOutput.stderr", (_ = s == null ? void 0 : s.chat) == null ? void 0 : _.stderr);
374
- return /* @__PURE__ */ u(
787
+ return /* @__PURE__ */ h(
375
788
  "pre",
376
789
  {
377
- ref: d,
378
- className: h(M.terminal, o),
790
+ ref: l,
791
+ className: m(F.terminal, r),
379
792
  style: { maxBlockSize: i },
380
793
  tabIndex: 0,
381
794
  role: "region",
382
- "aria-label": n,
383
- "data-testid": l,
795
+ "aria-label": t,
796
+ "data-testid": o,
384
797
  children: [
385
- e !== void 0 && /* @__PURE__ */ u("span", { className: M.terminal__command, children: [
386
- /* @__PURE__ */ u("span", { className: M.terminal__prompt, "aria-hidden": !0, children: [
798
+ e !== void 0 && /* @__PURE__ */ h("span", { className: F.terminal__command, children: [
799
+ /* @__PURE__ */ h("span", { className: F.terminal__prompt, "aria-hidden": !0, children: [
387
800
  "$",
388
801
  " "
389
802
  ] }),
@@ -391,172 +804,172 @@ const h = (...e) => {
391
804
  `
392
805
  `
393
806
  ] }),
394
- a.map(
395
- (r, m) => r.stream === "stderr" ? /* @__PURE__ */ u("span", { className: M.terminal__stderr, children: [
396
- /* @__PURE__ */ t("span", { className: M.terminal__srOnly, children: `${c}: ` }),
397
- r.text
398
- ] }, m) : /* @__PURE__ */ t("span", { children: r.text }, m)
807
+ n.map(
808
+ (d, u) => d.stream === "stderr" ? /* @__PURE__ */ h("span", { className: F.terminal__stderr, children: [
809
+ /* @__PURE__ */ a("span", { className: F.terminal__srOnly, children: `${c}: ` }),
810
+ d.text
811
+ ] }, u) : /* @__PURE__ */ a("span", { children: d.text }, u)
399
812
  )
400
813
  ]
401
814
  }
402
815
  );
403
- }, La = /* @__PURE__ */ b(
404
- /* @__PURE__ */ g(we, "TerminalOutput")
405
- ), Te = "hanui-list-GC4NK", Se = "hanui-list__item-N8DAn", Ae = "hanui-list__index-VrSMs", Le = "hanui-list__text-4tll-", Ee = "hanui-list__title-seHfJ", ze = "hanui-list__plain-ZcCvx", Me = "hanui-list__domain-sJLI7", T = {
406
- list: Te,
407
- list__item: Se,
408
- list__index: Ae,
409
- list__text: Le,
410
- list__title: Ee,
411
- list__plain: ze,
412
- list__domain: Me
413
- }, Oe = ({ items: e, label: a, className: n, testId: i }) => {
414
- var l;
415
- const { labels: o } = w();
416
- return /* @__PURE__ */ t(
816
+ }, ra = /* @__PURE__ */ g(
817
+ /* @__PURE__ */ k(ns, "TerminalOutput")
818
+ ), ss = "hanui-list-GC4NK", as = "hanui-list__item-N8DAn", is = "hanui-list__index-VrSMs", rs = "hanui-list__text-4tll-", os = "hanui-list__title-seHfJ", cs = "hanui-list__plain-ZcCvx", ls = "hanui-list__domain-sJLI7", E = {
819
+ list: ss,
820
+ list__item: as,
821
+ list__index: is,
822
+ list__text: rs,
823
+ list__title: os,
824
+ list__plain: cs,
825
+ list__domain: ls
826
+ }, ds = ({ items: e, label: n, className: t, testId: i }) => {
827
+ var o;
828
+ const { labels: r } = C();
829
+ return /* @__PURE__ */ a(
417
830
  "ol",
418
831
  {
419
- className: h(T.list, n),
420
- "aria-label": x("SourceList.label", a, (l = o == null ? void 0 : o.chat) == null ? void 0 : l.sources),
832
+ className: m(E.list, t),
833
+ "aria-label": x("SourceList.label", n, (o = r == null ? void 0 : r.chat) == null ? void 0 : o.sources),
421
834
  "data-testid": i,
422
- children: e.map((s, d) => /* @__PURE__ */ u("li", { className: T.list__item, children: [
423
- /* @__PURE__ */ t("span", { className: T.list__index, "aria-hidden": !0, children: d + 1 }),
424
- /* @__PURE__ */ u("span", { className: T.list__text, children: [
425
- s.url ? /* @__PURE__ */ t(
835
+ children: e.map((s, l) => /* @__PURE__ */ h("li", { className: E.list__item, children: [
836
+ /* @__PURE__ */ a("span", { className: E.list__index, "aria-hidden": !0, children: l + 1 }),
837
+ /* @__PURE__ */ h("span", { className: E.list__text, children: [
838
+ s.url ? /* @__PURE__ */ a(
426
839
  "a",
427
840
  {
428
- className: T.list__title,
841
+ className: E.list__title,
429
842
  href: s.url,
430
843
  target: "_blank",
431
844
  rel: "noopener noreferrer",
432
845
  children: s.title
433
846
  }
434
- ) : s.onSelect ? /* @__PURE__ */ t("button", { type: "button", className: T.list__title, onClick: s.onSelect, children: s.title }) : /* @__PURE__ */ t("span", { className: T.list__plain, children: s.title }),
435
- s.domain && /* @__PURE__ */ t("span", { className: T.list__domain, children: s.domain })
847
+ ) : s.onSelect ? /* @__PURE__ */ a("button", { type: "button", className: E.list__title, onClick: s.onSelect, children: s.title }) : /* @__PURE__ */ a("span", { className: E.list__plain, children: s.title }),
848
+ s.domain && /* @__PURE__ */ a("span", { className: E.list__domain, children: s.domain })
436
849
  ] })
437
850
  ] }, s.id))
438
851
  }
439
852
  );
440
- }, Ea = /* @__PURE__ */ b(
441
- /* @__PURE__ */ g(Oe, "SourceList")
442
- ), Be = "hanui-citation-XrGMb", Pe = "hanui-citation__srOnly-GnMQp", O = {
443
- citation: Be,
444
- citation__srOnly: Pe,
853
+ }, oa = /* @__PURE__ */ g(
854
+ /* @__PURE__ */ k(ds, "SourceList")
855
+ ), _s = "hanui-citation-XrGMb", us = "hanui-citation__srOnly-GnMQp", j = {
856
+ citation: _s,
857
+ citation__srOnly: us,
445
858
  "citation--static": "hanui-citation--static-8gXHs"
446
- }, Ie = ({ index: e, href: a, onClick: n, className: i }) => {
859
+ }, ms = ({ index: e, href: n, onClick: t, className: i }) => {
447
860
  var s;
448
- const { labels: o } = w(), l = nt("Citation.label", (s = o == null ? void 0 : o.chat) == null ? void 0 : s.citation, e);
449
- return a ? /* @__PURE__ */ t("a", { className: h(O.citation, i), href: a, "aria-label": l, children: e }) : n ? /* @__PURE__ */ t(
861
+ const { labels: r } = C(), o = Fe("Citation.label", (s = r == null ? void 0 : r.chat) == null ? void 0 : s.citation, e);
862
+ return n ? /* @__PURE__ */ a("a", { className: m(j.citation, i), href: n, "aria-label": o, children: e }) : t ? /* @__PURE__ */ a(
450
863
  "button",
451
864
  {
452
865
  type: "button",
453
- className: h(O.citation, i),
454
- onClick: n,
455
- "aria-label": l,
866
+ className: m(j.citation, i),
867
+ onClick: t,
868
+ "aria-label": o,
456
869
  children: e
457
870
  }
458
- ) : /* @__PURE__ */ u("span", { className: h(O.citation, O["citation--static"], i), children: [
459
- /* @__PURE__ */ t("span", { "aria-hidden": !0, children: e }),
460
- /* @__PURE__ */ t("span", { className: O.citation__srOnly, children: l })
871
+ ) : /* @__PURE__ */ h("span", { className: m(j.citation, j["citation--static"], i), children: [
872
+ /* @__PURE__ */ a("span", { "aria-hidden": !0, children: e }),
873
+ /* @__PURE__ */ a("span", { className: j.citation__srOnly, children: o })
461
874
  ] });
462
- }, za = /* @__PURE__ */ b(/* @__PURE__ */ g(Ie, "Citation")), De = "hanui-actions-c8XlJ", Re = "hanui-actions__meta-j-X3I", Z = {
463
- actions: De,
464
- actions__meta: Re
465
- }, Fe = "button:not(:disabled), a[href]", Ke = ({ children: e, meta: a, label: n, className: i, testId: o }) => {
875
+ }, ca = /* @__PURE__ */ g(/* @__PURE__ */ k(ms, "Citation")), hs = "hanui-actions-c8XlJ", ps = "hanui-actions__meta-j-X3I", Ie = {
876
+ actions: hs,
877
+ actions__meta: ps
878
+ }, bs = "button:not(:disabled), a[href]", fs = ({ children: e, meta: n, label: t, className: i, testId: r }) => {
466
879
  var c;
467
- const { labels: l } = w(), s = A(null), d = (_) => {
468
- var C;
469
- const r = [...((C = s.current) == null ? void 0 : C.querySelectorAll(Fe)) ?? []], m = r.indexOf(document.activeElement);
470
- if (m < 0 || r.length === 0) return;
471
- const p = getComputedStyle(_.currentTarget).direction === "rtl", y = p ? "ArrowLeft" : "ArrowRight", N = p ? "ArrowRight" : "ArrowLeft", f = _.key === y ? r[(m + 1) % r.length] : _.key === N ? r[(m - 1 + r.length) % r.length] : _.key === "Home" ? r[0] : _.key === "End" ? r[r.length - 1] : null;
472
- f && (_.preventDefault(), f.focus());
880
+ const { labels: o } = C(), s = L(null), l = (_) => {
881
+ var w;
882
+ const d = [...((w = s.current) == null ? void 0 : w.querySelectorAll(bs)) ?? []], u = d.indexOf(document.activeElement);
883
+ if (u < 0 || d.length === 0) return;
884
+ const f = getComputedStyle(_.currentTarget).direction === "rtl", b = f ? "ArrowLeft" : "ArrowRight", y = f ? "ArrowRight" : "ArrowLeft", v = _.key === b ? d[(u + 1) % d.length] : _.key === y ? d[(u - 1 + d.length) % d.length] : _.key === "Home" ? d[0] : _.key === "End" ? d[d.length - 1] : null;
885
+ v && (_.preventDefault(), v.focus());
473
886
  };
474
- return /* @__PURE__ */ u(
887
+ return /* @__PURE__ */ h(
475
888
  "div",
476
889
  {
477
890
  ref: s,
478
891
  role: "toolbar",
479
- "aria-label": x("MessageActions.label", n, (c = l == null ? void 0 : l.chat) == null ? void 0 : c.messageActions),
480
- className: h(Z.actions, i),
481
- onKeyDown: d,
482
- "data-testid": o,
892
+ "aria-label": x("MessageActions.label", t, (c = o == null ? void 0 : o.chat) == null ? void 0 : c.messageActions),
893
+ className: m(Ie.actions, i),
894
+ onKeyDown: l,
895
+ "data-testid": r,
483
896
  children: [
484
897
  e,
485
- a !== void 0 && /* @__PURE__ */ t("span", { className: Z.actions__meta, children: a })
898
+ n !== void 0 && /* @__PURE__ */ a("span", { className: Ie.actions__meta, children: n })
486
899
  ]
487
900
  }
488
901
  );
489
- }, Ma = /* @__PURE__ */ b(
490
- /* @__PURE__ */ g(Ke, "MessageActions")
491
- ), Ge = "hanui-bar-UJGDL", qe = "hanui-bar__brand-ZUcIw", Xe = "hanui-bar__start-nvmHH", Ve = "hanui-bar__end-NNQve", R = {
492
- bar: Ge,
493
- bar__brand: qe,
494
- bar__start: Xe,
495
- bar__end: Ve
496
- }, Y = "--hanui-header-height", je = ({ brand: e, start: a, end: n, className: i, testId: o }) => {
497
- const l = A(null);
498
- return P(() => {
499
- const s = l.current;
902
+ }, la = /* @__PURE__ */ g(
903
+ /* @__PURE__ */ k(fs, "MessageActions")
904
+ ), ys = "hanui-bar-UJGDL", gs = "hanui-bar__brand-ZUcIw", ks = "hanui-bar__start-nvmHH", ws = "hanui-bar__end-NNQve", Q = {
905
+ bar: ys,
906
+ bar__brand: gs,
907
+ bar__start: ks,
908
+ bar__end: ws
909
+ }, De = "--hanui-header-height", vs = ({ brand: e, start: n, end: t, className: i, testId: r }) => {
910
+ const o = L(null);
911
+ return U(() => {
912
+ const s = o.current;
500
913
  if (!s || typeof ResizeObserver > "u") return;
501
- const d = document.documentElement, c = new ResizeObserver(
914
+ const l = document.documentElement, c = new ResizeObserver(
502
915
  ([_]) => {
503
- var r, m;
504
- return d.style.setProperty(
505
- Y,
506
- `${Math.round(((m = (r = _.borderBoxSize) == null ? void 0 : r[0]) == null ? void 0 : m.blockSize) ?? s.offsetHeight)}px`
916
+ var d, u;
917
+ return l.style.setProperty(
918
+ De,
919
+ `${Math.round(((u = (d = _.borderBoxSize) == null ? void 0 : d[0]) == null ? void 0 : u.blockSize) ?? s.offsetHeight)}px`
507
920
  );
508
921
  }
509
922
  );
510
923
  return c.observe(s), () => {
511
- c.disconnect(), d.style.removeProperty(Y);
924
+ c.disconnect(), l.style.removeProperty(De);
512
925
  };
513
- }, []), /* @__PURE__ */ u("header", { ref: l, className: h(R.bar, i), "data-testid": o, children: [
514
- /* @__PURE__ */ t("div", { className: R.bar__brand, children: e }),
515
- a !== void 0 && /* @__PURE__ */ t("div", { className: R.bar__start, children: a }),
516
- n !== void 0 && /* @__PURE__ */ t("div", { className: R.bar__end, children: n })
926
+ }, []), /* @__PURE__ */ h("header", { ref: o, className: m(Q.bar, i), "data-testid": r, children: [
927
+ /* @__PURE__ */ a("div", { className: Q.bar__brand, children: e }),
928
+ n !== void 0 && /* @__PURE__ */ a("div", { className: Q.bar__start, children: n }),
929
+ t !== void 0 && /* @__PURE__ */ a("div", { className: Q.bar__end, children: t })
517
930
  ] });
518
- }, Oa = /* @__PURE__ */ b(/* @__PURE__ */ g(je, "AppBar")), Qe = "hanui-list-e54gu", Ue = "hanui-list__window-ESrZX", He = "hanui-list__slot-DxSnX", Je = "hanui-item-DKEGh", Ze = "hanui-item__start-Yb3xf", Ye = "hanui-item__body-kD4Qk", We = "hanui-item__end-3SCT-", k = {
519
- list: Qe,
931
+ }, da = /* @__PURE__ */ g(/* @__PURE__ */ k(vs, "AppBar")), Ns = "hanui-list-e54gu", Ss = "hanui-list__window-ESrZX", xs = "hanui-list__slot-DxSnX", As = "hanui-item-DKEGh", Ts = "hanui-item__start-Yb3xf", Cs = "hanui-item__body-kD4Qk", Es = "hanui-item__end-3SCT-", S = {
932
+ list: Ns,
520
933
  "list--virtual": "hanui-list--virtual-zxqy5",
521
- list__window: Ue,
522
- list__slot: He,
523
- item: Je,
934
+ list__window: Ss,
935
+ list__slot: xs,
936
+ item: As,
524
937
  "item--selected": "hanui-item--selected-AMl3I",
525
938
  "item--muted": "hanui-item--muted-XBeA3",
526
- item__start: Ze,
527
- item__body: Ye,
528
- item__end: We
529
- }, W = 6, ta = ({
939
+ item__start: Ts,
940
+ item__body: Cs,
941
+ item__end: Es
942
+ }, Me = 6, $s = ({
530
943
  label: e,
531
- children: a,
532
- rowHeight: n,
944
+ children: n,
945
+ rowHeight: t,
533
946
  maxHeight: i = 320,
534
- className: o,
535
- testId: l
947
+ className: r,
948
+ testId: o
536
949
  }) => {
537
- const s = lt.toArray(a).filter(ct), [d, c] = X(0);
538
- if (!n)
539
- return /* @__PURE__ */ t("ul", { className: h(k.list, o), "aria-label": e, "data-testid": l, children: s });
540
- const _ = Math.max(0, Math.floor(d / n) - W), r = Math.min(s.length, Math.ceil((d + i) / n) + W);
541
- return /* @__PURE__ */ t(
950
+ const s = Je.toArray(n).filter(Qe), [l, c] = ce(0);
951
+ if (!t)
952
+ return /* @__PURE__ */ a("ul", { className: m(S.list, r), "aria-label": e, "data-testid": o, children: s });
953
+ const _ = Math.max(0, Math.floor(l / t) - Me), d = Math.min(s.length, Math.ceil((l + i) / t) + Me);
954
+ return /* @__PURE__ */ a(
542
955
  "div",
543
956
  {
544
- className: h(k.list, k["list--virtual"], o),
545
- style: { maxBlockSize: i, "--hanui-row-height": `${n}px` },
546
- onScroll: (m) => c(m.currentTarget.scrollTop),
547
- "data-testid": l,
548
- children: /* @__PURE__ */ t(
957
+ className: m(S.list, S["list--virtual"], r),
958
+ style: { maxBlockSize: i, "--hanui-row-height": `${t}px` },
959
+ onScroll: (u) => c(u.currentTarget.scrollTop),
960
+ "data-testid": o,
961
+ children: /* @__PURE__ */ a(
549
962
  "ul",
550
963
  {
551
964
  "aria-label": e,
552
- className: k.list__window,
965
+ className: S.list__window,
553
966
  style: {
554
- blockSize: s.length * n,
555
- paddingBlockStart: _ * n
967
+ blockSize: s.length * t,
968
+ paddingBlockStart: _ * t
556
969
  },
557
- children: s.slice(_, r).map(
558
- (m, p) => rt(m, {
559
- "aria-posinset": _ + p + 1,
970
+ children: s.slice(_, d).map(
971
+ (u, f) => Ve(u, {
972
+ "aria-posinset": _ + f + 1,
560
973
  "aria-setsize": s.length
561
974
  })
562
975
  )
@@ -564,144 +977,144 @@ const h = (...e) => {
564
977
  )
565
978
  }
566
979
  );
567
- }, Ba = ({
980
+ }, _a = ({
568
981
  children: e,
569
- start: a,
570
- end: n,
982
+ start: n,
983
+ end: t,
571
984
  onClick: i,
572
- href: o,
573
- isSelected: l,
985
+ href: r,
986
+ isSelected: o,
574
987
  isMuted: s,
575
- testId: d,
988
+ testId: l,
576
989
  "aria-posinset": c,
577
990
  "aria-setsize": _
578
991
  }) => {
579
- const { linkComponent: r } = w(), m = h(
580
- k.item,
581
- l && k["item--selected"],
582
- s && k["item--muted"]
583
- ), p = /* @__PURE__ */ u(it, { children: [
584
- a !== void 0 && /* @__PURE__ */ t("span", { className: k.item__start, children: a }),
585
- /* @__PURE__ */ t("span", { className: k.item__body, children: e }),
586
- n !== void 0 && /* @__PURE__ */ t("span", { className: k.item__end, children: n })
587
- ] }), y = r ?? "a";
588
- return /* @__PURE__ */ t("li", { className: k.list__slot, "aria-posinset": c, "aria-setsize": _, children: o ? /* @__PURE__ */ t(y, { href: o, className: m, "data-testid": d, children: p }) : /* @__PURE__ */ t(
992
+ const { linkComponent: d } = C(), u = m(
993
+ S.item,
994
+ o && S["item--selected"],
995
+ s && S["item--muted"]
996
+ ), f = /* @__PURE__ */ h(Ye, { children: [
997
+ n !== void 0 && /* @__PURE__ */ a("span", { className: S.item__start, children: n }),
998
+ /* @__PURE__ */ a("span", { className: S.item__body, children: e }),
999
+ t !== void 0 && /* @__PURE__ */ a("span", { className: S.item__end, children: t })
1000
+ ] }), b = d ?? "a";
1001
+ return /* @__PURE__ */ a("li", { className: S.list__slot, "aria-posinset": c, "aria-setsize": _, children: r ? /* @__PURE__ */ a(b, { href: r, className: u, "data-testid": l, children: f }) : /* @__PURE__ */ a(
589
1002
  "button",
590
1003
  {
591
1004
  type: "button",
592
- className: m,
1005
+ className: u,
593
1006
  onClick: i,
594
- "aria-pressed": l,
595
- "data-testid": d,
596
- children: p
1007
+ "aria-pressed": o,
1008
+ "data-testid": l,
1009
+ children: f
597
1010
  }
598
1011
  ) });
599
- }, Pa = /* @__PURE__ */ b(
600
- /* @__PURE__ */ g(ta, "ActionList")
601
- ), ea = "hanui-bar-OZjXz", aa = "hanui-bar__segment-hexbp", na = "hanui-bar__marker-E0FeF", F = {
602
- bar: ea,
603
- bar__segment: aa,
604
- bar__marker: na,
1012
+ }, ua = /* @__PURE__ */ g(
1013
+ /* @__PURE__ */ k($s, "ActionList")
1014
+ ), Rs = "hanui-bar-OZjXz", Os = "hanui-bar__segment-hexbp", Ls = "hanui-bar__marker-E0FeF", V = {
1015
+ bar: Rs,
1016
+ bar__segment: Os,
1017
+ bar__marker: Ls,
605
1018
  "bar__marker--danger": "hanui-bar__marker--danger-245FK"
606
- }, K = (e, a) => a <= 0 ? 0 : Math.min(100, Math.max(0, e / a * 100)), sa = (e) => e === "muted" ? "var(--hanui-text-3)" : `var(--hanui-${e})`, ia = ({ label: e, max: a, segments: n, markers: i = [], className: o, testId: l }) => {
1019
+ }, ee = (e, n) => n <= 0 ? 0 : Math.min(100, Math.max(0, e / n * 100)), zs = (e) => e === "muted" ? "var(--hanui-text-3)" : `var(--hanui-${e})`, Is = ({ label: e, max: n, segments: t, markers: i = [], className: r, testId: o }) => {
607
1020
  const s = [
608
- ...n.map((c) => c.label),
1021
+ ...t.map((c) => c.label),
609
1022
  ...i.map((c) => c.label)
610
1023
  ];
611
- let d = 0;
612
- return /* @__PURE__ */ u(
1024
+ let l = 0;
1025
+ return /* @__PURE__ */ h(
613
1026
  "div",
614
1027
  {
615
1028
  role: "img",
616
1029
  "aria-label": `${e}: ${s.join(", ")}`,
617
- className: h(F.bar, o),
618
- "data-testid": l,
1030
+ className: m(V.bar, r),
1031
+ "data-testid": o,
619
1032
  children: [
620
- n.map((c) => {
621
- const _ = c.from ?? d, r = c.to ?? _ + (c.value ?? 0);
622
- return d = r, /* @__PURE__ */ t(
1033
+ t.map((c) => {
1034
+ const _ = c.from ?? l, d = c.to ?? _ + (c.value ?? 0);
1035
+ return l = d, /* @__PURE__ */ a(
623
1036
  "span",
624
1037
  {
625
- className: F.bar__segment,
1038
+ className: V.bar__segment,
626
1039
  title: c.label,
627
1040
  style: {
628
- insetInlineStart: `${K(_, a)}%`,
629
- inlineSize: `${K(r, a) - K(_, a)}%`,
630
- backgroundColor: sa(c.tone)
1041
+ insetInlineStart: `${ee(_, n)}%`,
1042
+ inlineSize: `${ee(d, n) - ee(_, n)}%`,
1043
+ backgroundColor: zs(c.tone)
631
1044
  }
632
1045
  },
633
1046
  c.id
634
1047
  );
635
1048
  }),
636
- i.map((c) => /* @__PURE__ */ t(
1049
+ i.map((c) => /* @__PURE__ */ a(
637
1050
  "span",
638
1051
  {
639
- className: h(
640
- F.bar__marker,
641
- c.tone === "danger" && F["bar__marker--danger"]
1052
+ className: m(
1053
+ V.bar__marker,
1054
+ c.tone === "danger" && V["bar__marker--danger"]
642
1055
  ),
643
1056
  title: c.label,
644
- style: { insetInlineStart: `${K(c.at, a)}%` }
1057
+ style: { insetInlineStart: `${ee(c.at, n)}%` }
645
1058
  },
646
1059
  c.id
647
1060
  ))
648
1061
  ]
649
1062
  }
650
1063
  );
651
- }, Ia = /* @__PURE__ */ b(
652
- /* @__PURE__ */ g(ia, "SegmentBar")
653
- ), oa = "hanui-legend-zryov", la = "hanui-legend__item-GGrR-", ca = "hanui-legend__swatch-2MkAR", q = {
654
- legend: oa,
655
- legend__item: la,
656
- legend__swatch: ca
657
- }, ra = (e) => e === "muted" ? "var(--hanui-text-3)" : `var(--hanui-${e})`, _a = ({ items: e, className: a, testId: n }) => /* @__PURE__ */ t("ul", { className: h(q.legend, a), "data-testid": n, children: e.map((i) => /* @__PURE__ */ u("li", { className: q.legend__item, children: [
658
- /* @__PURE__ */ t(
1064
+ }, ma = /* @__PURE__ */ g(
1065
+ /* @__PURE__ */ k(Is, "SegmentBar")
1066
+ ), Ds = "hanui-legend-zryov", Ms = "hanui-legend__item-GGrR-", Ps = "hanui-legend__swatch-2MkAR", oe = {
1067
+ legend: Ds,
1068
+ legend__item: Ms,
1069
+ legend__swatch: Ps
1070
+ }, Ks = (e) => e === "muted" ? "var(--hanui-text-3)" : `var(--hanui-${e})`, Bs = ({ items: e, className: n, testId: t }) => /* @__PURE__ */ a("ul", { className: m(oe.legend, n), "data-testid": t, children: e.map((i) => /* @__PURE__ */ h("li", { className: oe.legend__item, children: [
1071
+ /* @__PURE__ */ a(
659
1072
  "span",
660
1073
  {
661
1074
  "aria-hidden": !0,
662
- className: q.legend__swatch,
663
- style: { backgroundColor: ra(i.tone) }
1075
+ className: oe.legend__swatch,
1076
+ style: { backgroundColor: Ks(i.tone) }
664
1077
  }
665
1078
  ),
666
1079
  i.label
667
- ] }, i.id)) }), Da = /* @__PURE__ */ b(/* @__PURE__ */ g(_a, "Legend")), da = "hanui-list-KSLu5", ma = "hanui-list__row-k7aHp", ha = "hanui-list__term-vsD5B", ua = "hanui-list__value-6GY6z", B = {
668
- list: da,
669
- list__row: ma,
670
- list__term: ha,
671
- list__value: ua,
1080
+ ] }, i.id)) }), ha = /* @__PURE__ */ g(/* @__PURE__ */ k(Bs, "Legend")), Fs = "hanui-list-KSLu5", js = "hanui-list__row-k7aHp", Zs = "hanui-list__term-vsD5B", Us = "hanui-list__value-6GY6z", Z = {
1081
+ list: Fs,
1082
+ list__row: js,
1083
+ list__term: Zs,
1084
+ list__value: Us,
672
1085
  "list__value--technical": "hanui-list__value--technical-I-UYE"
673
- }, pa = ({ items: e, className: a, testId: n }) => /* @__PURE__ */ t("dl", { className: h(B.list, a), "data-testid": n, children: e.map((i, o) => /* @__PURE__ */ u("div", { className: B.list__row, children: [
674
- /* @__PURE__ */ t("dt", { className: B.list__term, children: i.term }),
675
- /* @__PURE__ */ t(
1086
+ }, Hs = ({ items: e, className: n, testId: t }) => /* @__PURE__ */ a("dl", { className: m(Z.list, n), "data-testid": t, children: e.map((i, r) => /* @__PURE__ */ h("div", { className: Z.list__row, children: [
1087
+ /* @__PURE__ */ a("dt", { className: Z.list__term, children: i.term }),
1088
+ /* @__PURE__ */ a(
676
1089
  "dd",
677
1090
  {
678
- className: h(B.list__value, i.isTechnical && B["list__value--technical"]),
1091
+ className: m(Z.list__value, i.isTechnical && Z["list__value--technical"]),
679
1092
  children: i.description
680
1093
  }
681
1094
  )
682
- ] }, o)) }), Ra = /* @__PURE__ */ b(
683
- /* @__PURE__ */ g(pa, "DescriptionList")
1095
+ ] }, r)) }), pa = /* @__PURE__ */ g(
1096
+ /* @__PURE__ */ k(Hs, "DescriptionList")
684
1097
  );
685
1098
  export {
686
- Pa as ActionList,
687
- Ba as ActionListItem,
688
- Oa as AppBar,
689
- ka as ChatMessage,
690
- Na as ChatThread,
691
- za as Citation,
692
- $a as CodeBlock,
693
- Ra as DescriptionList,
694
- Da as Legend,
695
- Ma as MessageActions,
696
- xa as PromptInput,
697
- fa as PromptSuggestions,
698
- Ca as Prose,
699
- wa as ReasoningBlock,
700
- Ta as ReasoningText,
701
- Ia as SegmentBar,
702
- Ea as SourceList,
703
- La as TerminalOutput,
704
- Aa as ToolCall,
705
- Sa as ToolCallSection
1099
+ ua as ActionList,
1100
+ _a as ActionListItem,
1101
+ da as AppBar,
1102
+ Js as ChatMessage,
1103
+ Xs as ChatThread,
1104
+ ca as Citation,
1105
+ ta as CodeBlock,
1106
+ pa as DescriptionList,
1107
+ ha as Legend,
1108
+ la as MessageActions,
1109
+ Qs as PromptInput,
1110
+ Vs as PromptSuggestions,
1111
+ ea as Prose,
1112
+ na as ReasoningBlock,
1113
+ sa as ReasoningText,
1114
+ ma as SegmentBar,
1115
+ oa as SourceList,
1116
+ ra as TerminalOutput,
1117
+ ia as ToolCall,
1118
+ aa as ToolCallSection
706
1119
  };
707
1120
  //# sourceMappingURL=chat.js.map