@opentiny/tiny-robot 0.3.1-alpha.7 → 0.3.1-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index5.js CHANGED
@@ -1,161 +1,529 @@
1
- import { onMounted as U, nextTick as B, h as C, defineComponent as _, render as R, onBeforeUnmount as D, Teleport as W, computed as h, ref as E, createBlock as F, openBlock as g, Transition as j, normalizeProps as q, guardReactiveProps as L, withCtx as Z, createElementBlock as G, createCommentVNode as J, renderSlot as K, useSlots as Q, watch as X, useAttrs as Y, resolveDynamicComponent as ee, unref as S, mergeProps as k, createVNode as te } from "vue";
2
- import { a as oe, c as re, e as ne } from "./index4.js";
3
- import { t as u } from "./utils.js";
4
- import { _ as N } from "./_plugin-vue_export-helper.js";
5
- import { u as se } from "./useSlotRefs.js";
6
- const pe = _({
7
- setup: (r) => () => C(W, r.propsFactory(), r.vnodeFactory()),
8
- props: ["propsFactory", "vnodeFactory"]
9
- });
10
- function ae(r, n) {
11
- let e = null, t = null, s = !1;
12
- U(() => {
13
- B(() => {
14
- s || (t = document.createElement("div"), e = C(pe, { propsFactory: r, vnodeFactory: n }), R(e, t));
15
- });
16
- }), D(() => {
17
- s = !0, B(() => {
18
- t && (R(null, t), t.remove(), e = null, t = null);
19
- });
1
+ import { defineComponent as k, openBlock as m, createElementBlock as y, renderSlot as g, unref as v, toDisplayString as be, createCommentVNode as X, markRaw as z, provide as S, inject as C, computed as _, toValue as B, reactive as fe, createBlock as E, resolveDynamicComponent as U, mergeProps as A, withCtx as R, normalizeProps as T, guardReactiveProps as $, withDirectives as me, createElementVNode as K, normalizeClass as pe, Fragment as N, renderList as G, createVNode as ge, vShow as _e, ref as q, watch as Y, onMounted as he, onUnmounted as Be, nextTick as J } from "vue";
2
+ import { _ as P } from "./_plugin-vue_export-helper.js";
3
+ import { i as Re, w as xe, g as ve, a as ye } from "./index4.js";
4
+ const Q = Symbol("bubble-message-group"), Z = Symbol("bubble-box-renderer-matches"), ee = Symbol("bubble-box-fallback-renderer"), te = Symbol(
5
+ "bubble-box-prop-fallback-renderer"
6
+ ), ne = Symbol("bubble-content-renderer-matches"), se = Symbol(
7
+ "bubble-content-fallback-renderer"
8
+ ), oe = Symbol(
9
+ "bubble-content-prop-fallback-renderer"
10
+ ), j = Symbol("bubble-store"), re = Symbol("bubble-state-change-fn"), et = {
11
+ LOADING: -1,
12
+ NORMAL: 0,
13
+ CONTENT: 10,
14
+ ROLE: 20
15
+ }, Ee = {
16
+ class: "tr-bubble__box",
17
+ "data-box-type": "box"
18
+ }, Ce = /* @__PURE__ */ k({
19
+ __name: "Box",
20
+ props: {
21
+ placement: {},
22
+ shape: {}
23
+ },
24
+ setup(t) {
25
+ return (n, e) => (m(), y("div", Ee, [
26
+ g(n.$slots, "default", {}, void 0, !0)
27
+ ]));
28
+ }
29
+ }), ae = /* @__PURE__ */ P(Ce, [["__scopeId", "data-v-98101726"]]), Se = {
30
+ key: 0,
31
+ class: "tr-bubble__text",
32
+ "data-type": "text"
33
+ }, ke = /* @__PURE__ */ k({
34
+ __name: "Text",
35
+ props: {
36
+ message: {},
37
+ contentIndex: {}
38
+ },
39
+ setup(t) {
40
+ const n = t, e = Oe(() => n.message, n.contentIndex);
41
+ return (a, c) => {
42
+ var i;
43
+ return v(e) ? (m(), y("p", Se, be(typeof v(e) == "string" ? v(e) : (i = v(e)) == null ? void 0 : i.text), 1)) : X("", !0);
44
+ };
45
+ }
46
+ }), le = /* @__PURE__ */ P(ke, [["__scopeId", "data-v-53daeb22"]]), ce = [], ue = [], de = z(ae), ie = z(le);
47
+ function Ie(t) {
48
+ const { boxRendererMatches: n, fallbackBoxRenderer: e } = t;
49
+ n && S(Z, n), e && S(ee, e);
50
+ }
51
+ function Me(t) {
52
+ const { fallbackBoxRenderer: n } = t;
53
+ n && S(te, n);
54
+ }
55
+ function Ae(t, n) {
56
+ const e = C(Z, ce), a = C(ee, void 0), c = C(te, void 0);
57
+ return _(() => {
58
+ const i = B(t), s = B(e).find((b) => b.find(i, n));
59
+ return s ? {
60
+ renderer: s.renderer,
61
+ attributes: s.attributes
62
+ } : {
63
+ renderer: B(c) || B(a) || de
64
+ };
20
65
  });
21
66
  }
22
- function ce(r, n) {
23
- return h(() => {
24
- var v;
25
- if (n instanceof HTMLElement)
26
- return n;
27
- const e = n, t = oe(r), s = (v = t == null ? void 0 : t.getRootNode) == null ? void 0 : v.call(t), i = s instanceof ShadowRoot, d = i ? s : document.body;
28
- if (e) {
29
- if (!i && e === "body")
30
- return document.body;
31
- const f = d.querySelector(e);
32
- if (f instanceof Node) return f;
33
- }
34
- return d;
67
+ function Le(t) {
68
+ const { contentRendererMatches: n, fallbackContentRenderer: e } = t;
69
+ n && S(ne, n), e && S(se, e);
70
+ }
71
+ function Te(t) {
72
+ const { fallbackContentRenderer: n } = t;
73
+ n && S(oe, n);
74
+ }
75
+ function $e(t, n) {
76
+ const e = C(ne, ue), a = C(se, void 0), c = C(oe, void 0);
77
+ return _(() => {
78
+ const i = B(t), s = B(e).find((b) => b.find(i, n));
79
+ return s ? s.renderer : B(c) || B(a) || ie;
80
+ });
81
+ }
82
+ function Ne(t) {
83
+ S(re, t);
84
+ }
85
+ function tt() {
86
+ return C(re, (t, n) => {
87
+ console.warn(`[Bubble] State change function not found for key: ${t}`);
35
88
  });
36
89
  }
37
- const ie = /* @__PURE__ */ _({
38
- __name: "Popper",
90
+ function H(t) {
91
+ const n = C(j, void 0);
92
+ if (n)
93
+ return n;
94
+ const e = fe(t || {});
95
+ return S(j, e), e;
96
+ }
97
+ const M = (t) => {
98
+ var n;
99
+ return ((n = t.state) == null ? void 0 : n.content) ?? t.content;
100
+ }, Oe = (t, n) => _(() => {
101
+ const e = M(B(t));
102
+ return Array.isArray(e) ? e.at(n ?? 0) : e;
103
+ });
104
+ function Fe(t) {
105
+ S(Q, t);
106
+ }
107
+ function Ge() {
108
+ return C(Q, void 0);
109
+ }
110
+ function nt(t, n) {
111
+ const e = _(() => {
112
+ const c = Object.entries(t.message).filter(([i]) => !n.includes(i));
113
+ return Object.fromEntries(c);
114
+ }), a = _(() => ({
115
+ ...t,
116
+ message: e.value
117
+ }));
118
+ return {
119
+ restMessage: e,
120
+ restProps: a
121
+ };
122
+ }
123
+ const W = /* @__PURE__ */ k({
124
+ __name: "BubbleBoxWrapper",
39
125
  props: {
40
- show: { type: Boolean },
41
- transitionProps: {}
126
+ role: {},
127
+ placement: {},
128
+ shape: {},
129
+ messages: {},
130
+ contentIndex: {}
42
131
  },
43
- setup(r, { expose: n }) {
44
- const e = E(null);
45
- return n({
46
- popperRef: e
47
- }), (t, s) => (g(), F(j, q(L(r.transitionProps)), {
48
- default: Z(() => [
49
- r.show ? (g(), G("div", {
50
- key: 0,
51
- class: "tr-base-popper",
52
- ref_key: "popperRef",
53
- ref: e
54
- }, [
55
- K(t.$slots, "default", {}, void 0, !0)
56
- ], 512)) : J("", !0)
132
+ setup(t) {
133
+ const n = t, e = Ae(() => n.messages, n.contentIndex);
134
+ return (a, c) => (m(), E(U(v(e).renderer), A({
135
+ "data-role": n.role,
136
+ "data-placement": n.placement,
137
+ "data-shape": n.shape
138
+ }, v(e).attributes), {
139
+ default: R(() => [
140
+ g(a.$slots, "default")
57
141
  ]),
58
142
  _: 3
59
- }, 16));
143
+ }, 16, ["data-role", "data-placement", "data-shape"]));
60
144
  }
61
- }), le = /* @__PURE__ */ N(ie, [["__scopeId", "data-v-25c13ab7"]]), ue = /* @__PURE__ */ _({
62
- inheritAttrs: !1,
63
- __name: "index",
145
+ }), D = /* @__PURE__ */ k({
146
+ __name: "BubbleContentWrapper",
64
147
  props: {
65
- appendTo: {},
66
- offset: {},
67
- placement: {
68
- default: "top-center"
69
- },
70
- preventOverflow: {
71
- type: Boolean
148
+ message: {},
149
+ contentIndex: {}
150
+ },
151
+ emits: ["state-change"],
152
+ setup(t, { emit: n }) {
153
+ const e = t, a = $e(() => e.message, e.contentIndex), c = n;
154
+ return Ne((s, b) => {
155
+ c("state-change", {
156
+ key: s,
157
+ value: b,
158
+ contentIndex: e.contentIndex
159
+ });
160
+ }), (s, b) => (m(), E(U(v(a)), T($(e)), null, 16));
161
+ }
162
+ }), Pe = ["data-role", "data-placement"], we = { class: "tr-bubble__body" }, Ke = { class: "tr-bubble__content" }, De = { class: "tr-bubble__after" }, Ue = /* @__PURE__ */ k({
163
+ __name: "Bubble",
164
+ props: {
165
+ content: {},
166
+ reasoning_content: {},
167
+ tool_calls: {},
168
+ tool_call_id: {},
169
+ name: {},
170
+ role: {},
171
+ id: {},
172
+ loading: { type: Boolean },
173
+ state: {},
174
+ hidden: { type: Boolean },
175
+ avatar: {},
176
+ placement: { default: "start" },
177
+ shape: { default: "corner" },
178
+ contentRenderMode: { default: "single" },
179
+ fallbackBoxRenderer: {},
180
+ fallbackContentRenderer: {}
181
+ },
182
+ emits: ["state-change"],
183
+ setup(t, { emit: n }) {
184
+ const e = t, a = n;
185
+ H();
186
+ const c = Ge(), i = _(() => B(c)), s = _(() => {
187
+ var w;
188
+ if ((w = i.value) != null && w.messages.length)
189
+ return i.value.messages;
190
+ const { role: h, content: f, reasoning_content: u, tool_calls: r, tool_call_id: l, name: d, id: o, loading: p, state: I } = e;
191
+ return [{ role: h, content: f, reasoning_content: u, tool_calls: r, tool_call_id: l, name: d, id: o, loading: p, state: I }];
192
+ });
193
+ Me({ fallbackBoxRenderer: () => e.fallbackBoxRenderer }), Te({ fallbackContentRenderer: () => e.fallbackContentRenderer });
194
+ const b = _(() => s.value.length === 0 ? !0 : e.hidden), x = _(() => e.contentRenderMode === "split" && s.value.length === 1 && Array.isArray(M(s.value[0])));
195
+ return (h, f) => me((m(), y("div", {
196
+ class: "tr-bubble",
197
+ "data-role": e.role,
198
+ "data-placement": e.placement
199
+ }, [
200
+ g(h.$slots, "prefix", {
201
+ messages: s.value,
202
+ role: t.role
203
+ }, void 0, !0),
204
+ K("div", we, [
205
+ e.avatar ? (m(), E(U(e.avatar), {
206
+ key: 0,
207
+ class: pe(["tr-bubble__avatar", h.$style["tr-bubble__avatar"]])
208
+ }, null, 8, ["class"])) : X("", !0),
209
+ K("div", Ke, [
210
+ x.value ? (m(!0), y(N, { key: 0 }, G(v(M)(s.value[0]), (u, r) => (m(), E(W, {
211
+ key: r,
212
+ class: "tr-bubble__box",
213
+ role: e.role,
214
+ placement: e.placement,
215
+ shape: e.shape,
216
+ messages: s.value,
217
+ "content-index": r
218
+ }, {
219
+ default: R(() => [
220
+ ge(D, {
221
+ message: s.value[0],
222
+ "content-index": r,
223
+ onStateChange: f[0] || (f[0] = (l) => a("state-change", { ...l, messageIndex: 0 }))
224
+ }, null, 8, ["message", "content-index"]),
225
+ g(h.$slots, "content-footer", {
226
+ messages: s.value,
227
+ role: e.role,
228
+ contentIndex: r
229
+ }, void 0, !0)
230
+ ]),
231
+ _: 2
232
+ }, 1032, ["role", "placement", "shape", "messages", "content-index"]))), 128)) : (m(), E(W, {
233
+ key: 1,
234
+ role: e.role,
235
+ placement: e.placement,
236
+ shape: e.shape,
237
+ messages: s.value
238
+ }, {
239
+ default: R(() => [
240
+ (m(!0), y(N, null, G(s.value, (u, r) => (m(), y(N, {
241
+ key: `message-${r}`
242
+ }, [
243
+ Array.isArray(v(M)(u)) ? (m(!0), y(N, { key: 0 }, G(v(M)(u), (l, d) => (m(), E(D, {
244
+ key: `content-${d}`,
245
+ message: u,
246
+ "content-index": d,
247
+ onStateChange: (o) => a("state-change", { ...o, messageIndex: r })
248
+ }, null, 8, ["message", "content-index", "onStateChange"]))), 128)) : (m(), E(D, {
249
+ key: 1,
250
+ message: u,
251
+ onStateChange: (l) => a("state-change", { ...l, messageIndex: r })
252
+ }, null, 8, ["message", "onStateChange"]))
253
+ ], 64))), 128)),
254
+ g(h.$slots, "content-footer", {
255
+ messages: s.value,
256
+ role: e.role
257
+ }, void 0, !0)
258
+ ]),
259
+ _: 3
260
+ }, 8, ["role", "placement", "shape", "messages"]))
261
+ ]),
262
+ K("div", De, [
263
+ g(h.$slots, "after", {
264
+ messages: s.value,
265
+ role: t.role
266
+ }, void 0, !0)
267
+ ])
268
+ ]),
269
+ g(h.$slots, "suffix", {
270
+ messages: s.value,
271
+ role: t.role
272
+ }, void 0, !0)
273
+ ], 8, Pe)), [
274
+ [_e, !b.value]
275
+ ]);
276
+ }
277
+ }), Ye = {
278
+ "tr-bubble__avatar": "_tr-bubble__avatar_1r87c_2"
279
+ }, He = {
280
+ $style: Ye
281
+ }, L = /* @__PURE__ */ P(Ue, [["__cssModules", He], ["__scopeId", "data-v-eb4c3985"]]);
282
+ function V(t, n) {
283
+ const e = Y(t, (a, c) => {
284
+ c === !0 && a === !1 && (n(), e());
285
+ });
286
+ return e;
287
+ }
288
+ function je(t, n, e) {
289
+ const { scrollOnMount: a = !0, bottomThreshold: c = 20, scrollThrottle: i = 0 } = e ?? {}, s = q(!0);
290
+ let b = !1;
291
+ const x = /* @__PURE__ */ new Set(), h = () => ye(t), { y: f, isScrolling: u } = Re(h, { throttle: i }), r = (o) => o.scrollHeight - o.scrollTop - o.clientHeight <= c, l = async (o = "auto") => {
292
+ const p = B(h);
293
+ if (p && (await J(), p.scrollTo({ top: p.scrollHeight, behavior: o }), o === "smooth" && !r(p))) {
294
+ const I = V(u, () => {
295
+ p.scrollTo({ top: p.scrollHeight, behavior: "auto" }), x.delete(I);
296
+ });
297
+ x.add(I);
298
+ }
299
+ }, d = () => {
300
+ b || !s.value || (b = !0, requestAnimationFrame(async () => {
301
+ b = !1, await l("auto");
302
+ }));
303
+ };
304
+ return Y(
305
+ f,
306
+ () => {
307
+ const o = B(h);
308
+ o && (s.value = r(o));
72
309
  },
73
- show: {
74
- type: Boolean
310
+ { flush: "post" }
311
+ ), xe(
312
+ n,
313
+ () => {
314
+ d();
75
315
  },
76
- transitionProps: {},
77
- triggerEvents: {}
316
+ { flush: "post", throttle: 100 }
317
+ ), he(() => {
318
+ a && l("smooth");
319
+ }), Be(() => {
320
+ x.forEach((o) => {
321
+ o();
322
+ }), x.clear();
323
+ }), ve("keydown", (o) => {
324
+ if (o.key === "End" && !s.value) {
325
+ const p = V(u, () => {
326
+ l("auto"), x.delete(p);
327
+ });
328
+ x.add(p);
329
+ }
330
+ }), {
331
+ scrollToBottom: l
332
+ };
333
+ }
334
+ const We = /* @__PURE__ */ k({
335
+ __name: "BubbleItem",
336
+ props: {
337
+ messageGroup: {},
338
+ roleConfig: {},
339
+ contentRenderMode: {}
78
340
  },
79
- setup(r, {
80
- expose: n
81
- }) {
82
- const e = r, t = Q(), {
83
- vnodes: s,
84
- ref: i,
85
- setRef: d
86
- } = se(t.trigger), v = (o = {}) => {
87
- const p = {};
88
- for (const [c, a] of Object.entries(o))
89
- /^on[A-Z]/.test(c) && typeof a == "function" && (p[c] = a);
90
- return p;
91
- }, f = E(null), b = h(() => {
92
- var o;
93
- return ((o = f.value) == null ? void 0 : o.popperRef) || null;
94
- }), m = h(() => {
95
- var o, p;
96
- return typeof e.offset == "number" ? {
97
- mainAxis: e.offset,
98
- crossAxis: 0
99
- } : {
100
- mainAxis: ((o = e.offset) == null ? void 0 : o.mainAxis) ?? 0,
101
- crossAxis: ((p = e.offset) == null ? void 0 : p.crossAxis) ?? 0
102
- };
341
+ emits: ["state-change"],
342
+ setup(t, { emit: n }) {
343
+ const e = t, a = n;
344
+ return Fe(() => e.messageGroup), (c, i) => (m(), E(L, A(t.roleConfig, {
345
+ role: t.messageGroup.role,
346
+ "content-render-mode": t.contentRenderMode,
347
+ onStateChange: i[0] || (i[0] = (s) => a("state-change", s))
103
348
  }), {
104
- top: $,
105
- bottom: O,
106
- left: w,
107
- right: V,
108
- width: z,
109
- update: A
110
- } = re(i), {
111
- width: x,
112
- height: P
113
- } = ne(b, void 0, {
114
- box: "border-box"
115
- }), H = h(() => {
116
- const {
117
- placement: o,
118
- preventOverflow: p
119
- } = e, c = {}, a = (l, y) => {
120
- if (!p) {
121
- c[l] = y;
122
- return;
349
+ prefix: R((s) => [
350
+ g(c.$slots, "prefix", T($(s)))
351
+ ]),
352
+ suffix: R((s) => [
353
+ g(c.$slots, "suffix", T($(s)))
354
+ ]),
355
+ "content-footer": R((s) => [
356
+ g(c.$slots, "content-footer", T($(s)))
357
+ ]),
358
+ after: R((s) => [
359
+ g(c.$slots, "after", T($(s)))
360
+ ]),
361
+ _: 3
362
+ }, 16, ["role", "content-render-mode"]));
363
+ }
364
+ }), Ve = /* @__PURE__ */ k({
365
+ __name: "BubbleList",
366
+ props: {
367
+ messages: {},
368
+ groupStrategy: { type: [String, Function], default: "divider" },
369
+ dividerRole: { default: "user" },
370
+ fallbackRole: { default: "assistant" },
371
+ roleConfigs: {},
372
+ contentRenderMode: {},
373
+ autoScroll: { type: Boolean }
374
+ },
375
+ emits: ["state-change"],
376
+ setup(t, { expose: n, emit: e }) {
377
+ const a = t, c = e;
378
+ H();
379
+ const i = q(null);
380
+ let s = async () => {
381
+ };
382
+ if (a.autoScroll) {
383
+ const f = _(() => a.messages.at(-1)), { scrollToBottom: u } = je(i, () => {
384
+ var r, l;
385
+ return [
386
+ a.messages.length,
387
+ (r = f.value) == null ? void 0 : r.content,
388
+ (l = f.value) == null ? void 0 : l.reasoning_content
389
+ ];
390
+ });
391
+ s = u, Y(
392
+ () => {
393
+ var r;
394
+ return (r = f.value) == null ? void 0 : r.role;
395
+ },
396
+ async (r) => {
397
+ r === "user" && (await J(), u("smooth"));
123
398
  }
124
- const T = u(l === "top" ? P.value : x.value);
125
- l === "top" ? c[l] = `clamp(var(--tr-base-popper-min-top), ${y}, calc(var(--tr-base-popper-max-bottom) - ${T}))` : l === "left" && (c[l] = `clamp(var(--tr-base-popper-min-left), ${y}, calc(var(--tr-base-popper-max-right) - ${T}))`);
126
- };
127
- return o.includes("top") && a("top", u($.value - P.value - m.value.mainAxis)), o.includes("bottom") && a("top", u(O.value + m.value.mainAxis)), o.includes("left") && a("left", u(w.value + m.value.crossAxis)), o.includes("right") && a("left", u(V.value - x.value + m.value.crossAxis)), o.includes("center") && a("left", u(w.value + z.value / 2 - x.value / 2 + m.value.crossAxis)), c;
128
- });
129
- X(() => e.show, (o) => {
130
- o && A();
131
- }, {
132
- flush: "post"
133
- });
134
- const I = ce(i, e.appendTo), M = Y();
135
- return ae(() => ({
136
- to: I.value
137
- }), () => te(le, k({
138
- ref: f,
139
- show: e.show,
140
- transitionProps: e.transitionProps,
141
- style: H.value
142
- }, M), {
143
- default: () => {
144
- var o;
145
- return [(o = t.content) == null ? void 0 : o.call(t)];
399
+ );
400
+ }
401
+ const b = (f) => {
402
+ const u = [];
403
+ let r = !1;
404
+ for (const [l, d] of f.entries()) {
405
+ const o = u[u.length - 1];
406
+ Array.isArray(M(d)) ? (u.push({
407
+ role: d.role || "",
408
+ messages: [d],
409
+ messageIndexes: [l],
410
+ startIndex: l
411
+ }), r = !0) : o && o.role === d.role && !r ? (o.messages.push(d), o.messageIndexes.push(l)) : (u.push({
412
+ role: d.role || "",
413
+ messages: [d],
414
+ messageIndexes: [l],
415
+ startIndex: l
416
+ }), r = !1);
417
+ }
418
+ return u;
419
+ }, x = (f, u) => {
420
+ const r = [];
421
+ let l = !1;
422
+ for (const [d, o] of f.entries()) {
423
+ const p = r[r.length - 1], I = o.role === u;
424
+ Array.isArray(M(o)) ? (r.push({
425
+ role: o.role || "",
426
+ messages: [o],
427
+ messageIndexes: [d],
428
+ startIndex: d
429
+ }), l = !0) : p && p.role === u === I && !l ? (p.messages.push(o), p.messageIndexes.push(d)) : (r.push({
430
+ role: I ? u : o.role || "",
431
+ messages: [o],
432
+ messageIndexes: [d],
433
+ startIndex: d
434
+ }), l = !1);
146
435
  }
147
- })), n({
148
- triggerRef: i,
149
- popperRef: b,
150
- update: A
151
- }), (o, p) => (g(), F(ee(S(s)[0]), k({
152
- ref: S(d)
153
- }, v(e.triggerEvents)), null, 16));
436
+ return r;
437
+ }, h = _(() => a.messages.length === 0 ? [] : typeof a.groupStrategy == "function" ? a.groupStrategy(a.messages, a.dividerRole) : a.groupStrategy === "consecutive" ? b(a.messages) : x(a.messages, a.dividerRole));
438
+ return n({
439
+ scrollToBottom: s
440
+ }), (f, u) => (m(), y("div", {
441
+ class: "tr-bubble-list",
442
+ ref_key: "listRef",
443
+ ref: i
444
+ }, [
445
+ (m(!0), y(N, null, G(h.value, (r, l) => {
446
+ var d;
447
+ return m(), E(We, {
448
+ key: l,
449
+ role: r.role || a.fallbackRole,
450
+ "role-config": (d = a.roleConfigs) == null ? void 0 : d[r.role || a.fallbackRole],
451
+ "message-group": r,
452
+ "content-render-mode": a.contentRenderMode,
453
+ onStateChange: (o) => c("state-change", { ...o, messageIndex: r.startIndex + o.messageIndex })
454
+ }, {
455
+ prefix: R((o) => [
456
+ g(f.$slots, "prefix", A({ ref_for: !0 }, o, {
457
+ messageIndexes: r.messageIndexes
458
+ }), void 0, !0)
459
+ ]),
460
+ suffix: R((o) => [
461
+ g(f.$slots, "suffix", A({ ref_for: !0 }, o, {
462
+ messageIndexes: r.messageIndexes
463
+ }), void 0, !0)
464
+ ]),
465
+ "content-footer": R((o) => [
466
+ g(f.$slots, "content-footer", A({ ref_for: !0 }, o, {
467
+ messageIndexes: r.messageIndexes
468
+ }), void 0, !0)
469
+ ]),
470
+ after: R((o) => [
471
+ g(f.$slots, "after", A({ ref_for: !0 }, o, {
472
+ messageIndexes: r.messageIndexes
473
+ }), void 0, !0)
474
+ ]),
475
+ _: 2
476
+ }, 1032, ["role", "role-config", "message-group", "content-render-mode", "onStateChange"]);
477
+ }), 128))
478
+ ], 512));
154
479
  }
155
- }), fe = /* @__PURE__ */ N(ue, [["__scopeId", "data-v-f1e25842"]]);
156
- fe.name = "TrBasePopper";
480
+ }), O = /* @__PURE__ */ P(Ve, [["__scopeId", "data-v-5336988b"]]), F = /* @__PURE__ */ k({
481
+ __name: "BubbleProvider",
482
+ props: {
483
+ boxRendererMatches: {},
484
+ contentRendererMatches: {},
485
+ fallbackBoxRenderer: { type: [Object, Function] },
486
+ fallbackContentRenderer: { type: [Object, Function] },
487
+ store: {}
488
+ },
489
+ setup(t) {
490
+ const n = t;
491
+ H(n.store);
492
+ const e = _(() => (n.boxRendererMatches || []).concat(ce).sort((s, b) => (s.priority ?? 0) - (b.priority ?? 0))), a = _(() => (n.contentRendererMatches || []).concat(ue).sort((s, b) => (s.priority ?? 0) - (b.priority ?? 0))), c = _(() => n.fallbackBoxRenderer || de), i = _(() => n.fallbackContentRenderer || ie);
493
+ return Ie({ boxRendererMatches: e, fallbackBoxRenderer: c }), Le({ contentRendererMatches: a, fallbackContentRenderer: i }), (s, b) => g(s.$slots, "default");
494
+ }
495
+ }), st = {
496
+ Box: ae,
497
+ Text: le
498
+ };
499
+ L.name = "TrBubble";
500
+ const Xe = function(t) {
501
+ t.component(L.name, L);
502
+ };
503
+ L.install = Xe;
504
+ const ot = L;
505
+ O.name = "TrBubbleList";
506
+ const ze = function(t) {
507
+ t.component(O.name, O);
508
+ };
509
+ O.install = ze;
510
+ const rt = O;
511
+ F.name = "TrBubbleProvider";
512
+ const qe = function(t) {
513
+ t.component(F.name, F);
514
+ };
515
+ F.install = qe;
516
+ const at = F;
157
517
  export {
158
- fe as B,
159
- ae as c,
160
- ce as u
518
+ ot as B,
519
+ rt as a,
520
+ at as b,
521
+ et as c,
522
+ st as d,
523
+ Ae as e,
524
+ $e as f,
525
+ tt as g,
526
+ Oe as h,
527
+ nt as i,
528
+ je as u
161
529
  };