@ddict/bubble 1.3.5 → 1.3.7

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/bubble.es.js CHANGED
@@ -1,75 +1,75 @@
1
- import { computed as B, ref as R, shallowRef as It, watch as ue, getCurrentScope as Mt, onScopeDispose as Dt, shallowReadonly as ae, unref as Te, createElementBlock as w, openBlock as p, createStaticVNode as Ne, createElementVNode as b, createVNode as H, toDisplayString as ge, Fragment as be, renderList as Re, createCommentVNode as M, normalizeClass as k, createTextVNode as ve, onUnmounted as We, createBlock as N, normalizeStyle as Pe, withModifiers as Qe, onMounted as mt, nextTick as Fe } from "vue";
2
- const G = Math.min, O = Math.max, $e = Math.round, Ee = Math.floor, q = (e) => ({
1
+ import { computed as R, ref as k, shallowRef as Pt, watch as Q, getCurrentScope as Vt, onScopeDispose as Nt, shallowReadonly as ae, unref as ve, createElementBlock as v, openBlock as p, createStaticVNode as Xe, createElementVNode as C, createVNode as O, toDisplayString as ne, Fragment as K, renderList as me, createCommentVNode as M, normalizeClass as $, createTextVNode as be, onUnmounted as qe, createBlock as W, normalizeStyle as Ze, withModifiers as Ht, onMounted as gt, nextTick as it } from "vue";
2
+ const Ae = Math.min, ee = Math.max, $e = Math.round, Te = Math.floor, Y = (e) => ({
3
3
  x: e,
4
4
  y: e
5
- }), Ot = {
5
+ }), Ut = {
6
6
  left: "right",
7
7
  right: "left",
8
8
  bottom: "top",
9
9
  top: "bottom"
10
- }, Ft = {
10
+ }, Zt = {
11
11
  start: "end",
12
12
  end: "start"
13
13
  };
14
- function et(e, t, n) {
15
- return O(e, G(t, n));
14
+ function ot(e, t, n) {
15
+ return ee(e, Ae(t, n));
16
16
  }
17
- function we(e, t) {
17
+ function Ie(e, t) {
18
18
  return typeof e == "function" ? e(t) : e;
19
19
  }
20
- function J(e) {
20
+ function ie(e) {
21
21
  return e.split("-")[0];
22
22
  }
23
- function xe(e) {
23
+ function Be(e) {
24
24
  return e.split("-")[1];
25
25
  }
26
- function ht(e) {
26
+ function vt(e) {
27
27
  return e === "x" ? "y" : "x";
28
28
  }
29
- function pt(e) {
29
+ function bt(e) {
30
30
  return e === "y" ? "height" : "width";
31
31
  }
32
- function oe(e) {
33
- return ["top", "bottom"].includes(J(e)) ? "y" : "x";
32
+ function de(e) {
33
+ return ["top", "bottom"].includes(ie(e)) ? "y" : "x";
34
34
  }
35
- function gt(e) {
36
- return ht(oe(e));
35
+ function Ct(e) {
36
+ return vt(de(e));
37
37
  }
38
- function zt(e, t, n) {
38
+ function jt(e, t, n) {
39
39
  n === void 0 && (n = !1);
40
- const o = xe(e), i = gt(e), r = pt(i);
41
- let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
42
- return t.reference[r] > t.floating[r] && (s = Ae(s)), [s, Ae(s)];
40
+ const i = Be(e), o = Ct(e), s = bt(o);
41
+ let r = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
42
+ return t.reference[s] > t.floating[s] && (r = ke(r)), [r, ke(r)];
43
43
  }
44
- function _t(e) {
45
- const t = Ae(e);
46
- return [He(e), t, He(t)];
44
+ function Xt(e) {
45
+ const t = ke(e);
46
+ return [je(e), t, je(t)];
47
47
  }
48
- function He(e) {
49
- return e.replace(/start|end/g, (t) => Ft[t]);
48
+ function je(e) {
49
+ return e.replace(/start|end/g, (t) => Zt[t]);
50
50
  }
51
- function Vt(e, t, n) {
52
- const o = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
51
+ function qt(e, t, n) {
52
+ const i = ["left", "right"], o = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
53
53
  switch (e) {
54
54
  case "top":
55
55
  case "bottom":
56
- return n ? t ? i : o : t ? o : i;
56
+ return n ? t ? o : i : t ? i : o;
57
57
  case "left":
58
58
  case "right":
59
- return t ? r : s;
59
+ return t ? s : r;
60
60
  default:
61
61
  return [];
62
62
  }
63
63
  }
64
- function Pt(e, t, n, o) {
65
- const i = xe(e);
66
- let r = Vt(J(e), n === "start", o);
67
- return i && (r = r.map((s) => s + "-" + i), t && (r = r.concat(r.map(He)))), r;
64
+ function Yt(e, t, n, i) {
65
+ const o = Be(e);
66
+ let s = qt(ie(e), n === "start", i);
67
+ return o && (s = s.map((r) => r + "-" + o), t && (s = s.concat(s.map(je)))), s;
68
68
  }
69
- function Ae(e) {
70
- return e.replace(/left|right|bottom|top/g, (t) => Ot[t]);
69
+ function ke(e) {
70
+ return e.replace(/left|right|bottom|top/g, (t) => Ut[t]);
71
71
  }
72
- function Ht(e) {
72
+ function Gt(e) {
73
73
  return {
74
74
  top: 0,
75
75
  right: 0,
@@ -78,259 +78,259 @@ function Ht(e) {
78
78
  ...e
79
79
  };
80
80
  }
81
- function Nt(e) {
82
- return typeof e != "number" ? Ht(e) : {
81
+ function Kt(e) {
82
+ return typeof e != "number" ? Gt(e) : {
83
83
  top: e,
84
84
  right: e,
85
85
  bottom: e,
86
86
  left: e
87
87
  };
88
88
  }
89
- function ke(e) {
89
+ function Re(e) {
90
90
  const {
91
91
  x: t,
92
92
  y: n,
93
- width: o,
94
- height: i
93
+ width: i,
94
+ height: o
95
95
  } = e;
96
96
  return {
97
- width: o,
98
- height: i,
97
+ width: i,
98
+ height: o,
99
99
  top: n,
100
100
  left: t,
101
- right: t + o,
102
- bottom: n + i,
101
+ right: t + i,
102
+ bottom: n + o,
103
103
  x: t,
104
104
  y: n
105
105
  };
106
106
  }
107
- function tt(e, t, n) {
107
+ function rt(e, t, n) {
108
108
  let {
109
- reference: o,
110
- floating: i
109
+ reference: i,
110
+ floating: o
111
111
  } = e;
112
- const r = oe(t), s = gt(t), a = pt(s), l = J(t), c = r === "y", u = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, h = o[a] / 2 - i[a] / 2;
113
- let m;
112
+ const s = de(t), r = Ct(t), a = bt(r), l = ie(t), c = s === "y", u = i.x + i.width / 2 - o.width / 2, h = i.y + i.height / 2 - o.height / 2, g = i[a] / 2 - o[a] / 2;
113
+ let f;
114
114
  switch (l) {
115
115
  case "top":
116
- m = {
116
+ f = {
117
117
  x: u,
118
- y: o.y - i.height
118
+ y: i.y - o.height
119
119
  };
120
120
  break;
121
121
  case "bottom":
122
- m = {
122
+ f = {
123
123
  x: u,
124
- y: o.y + o.height
124
+ y: i.y + i.height
125
125
  };
126
126
  break;
127
127
  case "right":
128
- m = {
129
- x: o.x + o.width,
130
- y: d
128
+ f = {
129
+ x: i.x + i.width,
130
+ y: h
131
131
  };
132
132
  break;
133
133
  case "left":
134
- m = {
135
- x: o.x - i.width,
136
- y: d
134
+ f = {
135
+ x: i.x - o.width,
136
+ y: h
137
137
  };
138
138
  break;
139
139
  default:
140
- m = {
141
- x: o.x,
142
- y: o.y
140
+ f = {
141
+ x: i.x,
142
+ y: i.y
143
143
  };
144
144
  }
145
- switch (xe(t)) {
145
+ switch (Be(t)) {
146
146
  case "start":
147
- m[s] -= h * (n && c ? -1 : 1);
147
+ f[r] -= g * (n && c ? -1 : 1);
148
148
  break;
149
149
  case "end":
150
- m[s] += h * (n && c ? -1 : 1);
150
+ f[r] += g * (n && c ? -1 : 1);
151
151
  break;
152
152
  }
153
- return m;
153
+ return f;
154
154
  }
155
- const Wt = async (e, t, n) => {
155
+ const Jt = async (e, t, n) => {
156
156
  const {
157
- placement: o = "bottom",
158
- strategy: i = "absolute",
159
- middleware: r = [],
160
- platform: s
161
- } = n, a = r.filter(Boolean), l = await (s.isRTL == null ? void 0 : s.isRTL(t));
162
- let c = await s.getElementRects({
157
+ placement: i = "bottom",
158
+ strategy: o = "absolute",
159
+ middleware: s = [],
160
+ platform: r
161
+ } = n, a = s.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(t));
162
+ let c = await r.getElementRects({
163
163
  reference: e,
164
164
  floating: t,
165
- strategy: i
165
+ strategy: o
166
166
  }), {
167
167
  x: u,
168
- y: d
169
- } = tt(c, o, l), h = o, m = {}, f = 0;
170
- for (let v = 0; v < a.length; v++) {
168
+ y: h
169
+ } = rt(c, i, l), g = i, f = {}, m = 0;
170
+ for (let w = 0; w < a.length; w++) {
171
171
  const {
172
- name: x,
173
- fn: y
174
- } = a[v], {
175
- x: L,
176
- y: S,
177
- data: $,
178
- reset: E
179
- } = await y({
172
+ name: y,
173
+ fn: L
174
+ } = a[w], {
175
+ x,
176
+ y: T,
177
+ data: A,
178
+ reset: S
179
+ } = await L({
180
180
  x: u,
181
- y: d,
182
- initialPlacement: o,
183
- placement: h,
184
- strategy: i,
185
- middlewareData: m,
181
+ y: h,
182
+ initialPlacement: i,
183
+ placement: g,
184
+ strategy: o,
185
+ middlewareData: f,
186
186
  rects: c,
187
- platform: s,
187
+ platform: r,
188
188
  elements: {
189
189
  reference: e,
190
190
  floating: t
191
191
  }
192
192
  });
193
- u = L ?? u, d = S ?? d, m = {
194
- ...m,
195
- [x]: {
196
- ...m[x],
197
- ...$
193
+ u = x ?? u, h = T ?? h, f = {
194
+ ...f,
195
+ [y]: {
196
+ ...f[y],
197
+ ...A
198
198
  }
199
- }, E && f <= 50 && (f++, typeof E == "object" && (E.placement && (h = E.placement), E.rects && (c = E.rects === !0 ? await s.getElementRects({
199
+ }, S && m <= 50 && (m++, typeof S == "object" && (S.placement && (g = S.placement), S.rects && (c = S.rects === !0 ? await r.getElementRects({
200
200
  reference: e,
201
201
  floating: t,
202
- strategy: i
203
- }) : E.rects), {
202
+ strategy: o
203
+ }) : S.rects), {
204
204
  x: u,
205
- y: d
206
- } = tt(c, h, l)), v = -1);
205
+ y: h
206
+ } = rt(c, g, l)), w = -1);
207
207
  }
208
208
  return {
209
209
  x: u,
210
- y: d,
211
- placement: h,
212
- strategy: i,
213
- middlewareData: m
210
+ y: h,
211
+ placement: g,
212
+ strategy: o,
213
+ middlewareData: f
214
214
  };
215
215
  };
216
- async function Ue(e, t) {
216
+ async function wt(e, t) {
217
217
  var n;
218
218
  t === void 0 && (t = {});
219
219
  const {
220
- x: o,
221
- y: i,
222
- platform: r,
223
- rects: s,
220
+ x: i,
221
+ y: o,
222
+ platform: s,
223
+ rects: r,
224
224
  elements: a,
225
225
  strategy: l
226
226
  } = e, {
227
227
  boundary: c = "clippingAncestors",
228
228
  rootBoundary: u = "viewport",
229
- elementContext: d = "floating",
230
- altBoundary: h = !1,
231
- padding: m = 0
232
- } = we(t, e), f = Nt(m), x = a[h ? d === "floating" ? "reference" : "floating" : d], y = ke(await r.getClippingRect({
233
- element: (n = await (r.isElement == null ? void 0 : r.isElement(x))) == null || n ? x : x.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(a.floating)),
229
+ elementContext: h = "floating",
230
+ altBoundary: g = !1,
231
+ padding: f = 0
232
+ } = Ie(t, e), m = Kt(f), y = a[g ? h === "floating" ? "reference" : "floating" : h], L = Re(await s.getClippingRect({
233
+ element: (n = await (s.isElement == null ? void 0 : s.isElement(y))) == null || n ? y : y.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(a.floating)),
234
234
  boundary: c,
235
235
  rootBoundary: u,
236
236
  strategy: l
237
- })), L = d === "floating" ? {
238
- x: o,
239
- y: i,
240
- width: s.floating.width,
241
- height: s.floating.height
242
- } : s.reference, S = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a.floating)), $ = await (r.isElement == null ? void 0 : r.isElement(S)) ? await (r.getScale == null ? void 0 : r.getScale(S)) || {
237
+ })), x = h === "floating" ? {
238
+ x: i,
239
+ y: o,
240
+ width: r.floating.width,
241
+ height: r.floating.height
242
+ } : r.reference, T = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a.floating)), A = await (s.isElement == null ? void 0 : s.isElement(T)) ? await (s.getScale == null ? void 0 : s.getScale(T)) || {
243
243
  x: 1,
244
244
  y: 1
245
245
  } : {
246
246
  x: 1,
247
247
  y: 1
248
- }, E = ke(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
248
+ }, S = Re(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
249
249
  elements: a,
250
- rect: L,
251
- offsetParent: S,
250
+ rect: x,
251
+ offsetParent: T,
252
252
  strategy: l
253
- }) : L);
253
+ }) : x);
254
254
  return {
255
- top: (y.top - E.top + f.top) / $.y,
256
- bottom: (E.bottom - y.bottom + f.bottom) / $.y,
257
- left: (y.left - E.left + f.left) / $.x,
258
- right: (E.right - y.right + f.right) / $.x
255
+ top: (L.top - S.top + m.top) / A.y,
256
+ bottom: (S.bottom - L.bottom + m.bottom) / A.y,
257
+ left: (L.left - S.left + m.left) / A.x,
258
+ right: (S.right - L.right + m.right) / A.x
259
259
  };
260
260
  }
261
- const Ut = function(e) {
261
+ const Qt = function(e) {
262
262
  return e === void 0 && (e = {}), {
263
263
  name: "flip",
264
264
  options: e,
265
265
  async fn(t) {
266
- var n, o;
266
+ var n, i;
267
267
  const {
268
- placement: i,
269
- middlewareData: r,
270
- rects: s,
268
+ placement: o,
269
+ middlewareData: s,
270
+ rects: r,
271
271
  initialPlacement: a,
272
272
  platform: l,
273
273
  elements: c
274
274
  } = t, {
275
275
  mainAxis: u = !0,
276
- crossAxis: d = !0,
277
- fallbackPlacements: h,
278
- fallbackStrategy: m = "bestFit",
279
- fallbackAxisSideDirection: f = "none",
280
- flipAlignment: v = !0,
281
- ...x
282
- } = we(e, t);
283
- if ((n = r.arrow) != null && n.alignmentOffset)
276
+ crossAxis: h = !0,
277
+ fallbackPlacements: g,
278
+ fallbackStrategy: f = "bestFit",
279
+ fallbackAxisSideDirection: m = "none",
280
+ flipAlignment: w = !0,
281
+ ...y
282
+ } = Ie(e, t);
283
+ if ((n = s.arrow) != null && n.alignmentOffset)
284
284
  return {};
285
- const y = J(i), L = oe(a), S = J(a) === a, $ = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), E = h || (S || !v ? [Ae(a)] : _t(a)), I = f !== "none";
286
- !h && I && E.push(...Pt(a, v, f, $));
287
- const T = [a, ...E], D = await Ue(t, x), z = [];
288
- let _ = ((o = r.flip) == null ? void 0 : o.overflows) || [];
289
- if (u && z.push(D[y]), d) {
290
- const j = zt(i, s, $);
291
- z.push(D[j[0]], D[j[1]]);
285
+ const L = ie(o), x = de(a), T = ie(a) === a, A = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), S = g || (T || !w ? [ke(a)] : Xt(a)), B = m !== "none";
286
+ !g && B && S.push(...Yt(a, w, m, A));
287
+ const E = [a, ...S], D = await wt(t, y), Z = [];
288
+ let J = ((i = s.flip) == null ? void 0 : i.overflows) || [];
289
+ if (u && Z.push(D[L]), h) {
290
+ const j = jt(o, r, A);
291
+ Z.push(D[j[0]], D[j[1]]);
292
292
  }
293
- if (_ = [..._, {
294
- placement: i,
295
- overflows: z
296
- }], !z.every((j) => j <= 0)) {
297
- var ee, Le;
298
- const j = (((ee = r.flip) == null ? void 0 : ee.index) || 0) + 1, Y = T[j];
299
- if (Y)
293
+ if (J = [...J, {
294
+ placement: o,
295
+ overflows: Z
296
+ }], !Z.every((j) => j <= 0)) {
297
+ var he, pe;
298
+ const j = (((he = s.flip) == null ? void 0 : he.index) || 0) + 1, ye = E[j];
299
+ if (ye)
300
300
  return {
301
301
  data: {
302
302
  index: j,
303
- overflows: _
303
+ overflows: J
304
304
  },
305
305
  reset: {
306
- placement: Y
306
+ placement: ye
307
307
  }
308
308
  };
309
- let te = (Le = _.filter((K) => K.overflows[0] <= 0).sort((K, V) => K.overflows[1] - V.overflows[1])[0]) == null ? void 0 : Le.placement;
310
- if (!te)
311
- switch (m) {
309
+ let q = (pe = J.filter((P) => P.overflows[0] <= 0).sort((P, V) => P.overflows[1] - V.overflows[1])[0]) == null ? void 0 : pe.placement;
310
+ if (!q)
311
+ switch (f) {
312
312
  case "bestFit": {
313
- var me;
314
- const K = (me = _.filter((V) => {
315
- if (I) {
316
- const P = oe(V.placement);
317
- return P === L || // Create a bias to the `y` side axis due to horizontal
313
+ var z;
314
+ const P = (z = J.filter((V) => {
315
+ if (B) {
316
+ const N = de(V.placement);
317
+ return N === x || // Create a bias to the `y` side axis due to horizontal
318
318
  // reading directions favoring greater width.
319
- P === "y";
319
+ N === "y";
320
320
  }
321
321
  return !0;
322
- }).map((V) => [V.placement, V.overflows.filter((P) => P > 0).reduce((P, he) => P + he, 0)]).sort((V, P) => V[1] - P[1])[0]) == null ? void 0 : me[0];
323
- K && (te = K);
322
+ }).map((V) => [V.placement, V.overflows.filter((N) => N > 0).reduce((N, De) => N + De, 0)]).sort((V, N) => V[1] - N[1])[0]) == null ? void 0 : z[0];
323
+ P && (q = P);
324
324
  break;
325
325
  }
326
326
  case "initialPlacement":
327
- te = a;
327
+ q = a;
328
328
  break;
329
329
  }
330
- if (i !== te)
330
+ if (o !== q)
331
331
  return {
332
332
  reset: {
333
- placement: te
333
+ placement: q
334
334
  }
335
335
  };
336
336
  }
@@ -338,150 +338,111 @@ const Ut = function(e) {
338
338
  }
339
339
  };
340
340
  };
341
- async function Zt(e, t) {
341
+ async function en(e, t) {
342
342
  const {
343
343
  placement: n,
344
- platform: o,
345
- elements: i
346
- } = e, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = J(n), a = xe(n), l = oe(n) === "y", c = ["left", "top"].includes(s) ? -1 : 1, u = r && l ? -1 : 1, d = we(t, e);
344
+ platform: i,
345
+ elements: o
346
+ } = e, s = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), r = ie(n), a = Be(n), l = de(n) === "y", c = ["left", "top"].includes(r) ? -1 : 1, u = s && l ? -1 : 1, h = Ie(t, e);
347
347
  let {
348
+ mainAxis: g,
349
+ crossAxis: f,
350
+ alignmentAxis: m
351
+ } = typeof h == "number" ? {
348
352
  mainAxis: h,
349
- crossAxis: m,
350
- alignmentAxis: f
351
- } = typeof d == "number" ? {
352
- mainAxis: d,
353
353
  crossAxis: 0,
354
354
  alignmentAxis: null
355
355
  } : {
356
356
  mainAxis: 0,
357
357
  crossAxis: 0,
358
358
  alignmentAxis: null,
359
- ...d
359
+ ...h
360
360
  };
361
- return a && typeof f == "number" && (m = a === "end" ? f * -1 : f), l ? {
362
- x: m * u,
363
- y: h * c
361
+ return a && typeof m == "number" && (f = a === "end" ? m * -1 : m), l ? {
362
+ x: f * u,
363
+ y: g * c
364
364
  } : {
365
- x: h * c,
366
- y: m * u
365
+ x: g * c,
366
+ y: f * u
367
367
  };
368
368
  }
369
- const jt = function(e) {
369
+ const tn = function(e) {
370
370
  return e === void 0 && (e = 0), {
371
371
  name: "offset",
372
372
  options: e,
373
373
  async fn(t) {
374
- var n, o;
374
+ var n, i;
375
375
  const {
376
- x: i,
377
- y: r,
378
- placement: s,
376
+ x: o,
377
+ y: s,
378
+ placement: r,
379
379
  middlewareData: a
380
- } = t, l = await Zt(t, e);
381
- return s === ((n = a.offset) == null ? void 0 : n.placement) && (o = a.arrow) != null && o.alignmentOffset ? {} : {
382
- x: i + l.x,
383
- y: r + l.y,
380
+ } = t, l = await en(t, e);
381
+ return r === ((n = a.offset) == null ? void 0 : n.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
382
+ x: o + l.x,
383
+ y: s + l.y,
384
384
  data: {
385
385
  ...l,
386
- placement: s
386
+ placement: r
387
387
  }
388
388
  };
389
389
  }
390
390
  };
391
- }, Xt = function(e) {
391
+ }, nn = function(e) {
392
392
  return e === void 0 && (e = {}), {
393
393
  name: "shift",
394
394
  options: e,
395
395
  async fn(t) {
396
396
  const {
397
397
  x: n,
398
- y: o,
399
- placement: i
398
+ y: i,
399
+ placement: o
400
400
  } = t, {
401
- mainAxis: r = !0,
402
- crossAxis: s = !1,
401
+ mainAxis: s = !0,
402
+ crossAxis: r = !1,
403
403
  limiter: a = {
404
- fn: (x) => {
404
+ fn: (y) => {
405
405
  let {
406
- x: y,
407
- y: L
408
- } = x;
406
+ x: L,
407
+ y: x
408
+ } = y;
409
409
  return {
410
- x: y,
411
- y: L
410
+ x: L,
411
+ y: x
412
412
  };
413
413
  }
414
414
  },
415
415
  ...l
416
- } = we(e, t), c = {
416
+ } = Ie(e, t), c = {
417
417
  x: n,
418
- y: o
419
- }, u = await Ue(t, l), d = oe(J(i)), h = ht(d);
420
- let m = c[h], f = c[d];
421
- if (r) {
422
- const x = h === "y" ? "top" : "left", y = h === "y" ? "bottom" : "right", L = m + u[x], S = m - u[y];
423
- m = et(L, m, S);
424
- }
418
+ y: i
419
+ }, u = await wt(t, l), h = de(ie(o)), g = vt(h);
420
+ let f = c[g], m = c[h];
425
421
  if (s) {
426
- const x = d === "y" ? "top" : "left", y = d === "y" ? "bottom" : "right", L = f + u[x], S = f - u[y];
427
- f = et(L, f, S);
422
+ const y = g === "y" ? "top" : "left", L = g === "y" ? "bottom" : "right", x = f + u[y], T = f - u[L];
423
+ f = ot(x, f, T);
424
+ }
425
+ if (r) {
426
+ const y = h === "y" ? "top" : "left", L = h === "y" ? "bottom" : "right", x = m + u[y], T = m - u[L];
427
+ m = ot(x, m, T);
428
428
  }
429
- const v = a.fn({
429
+ const w = a.fn({
430
430
  ...t,
431
- [h]: m,
432
- [d]: f
431
+ [g]: f,
432
+ [h]: m
433
433
  });
434
434
  return {
435
- ...v,
435
+ ...w,
436
436
  data: {
437
- x: v.x - n,
438
- y: v.y - o
437
+ x: w.x - n,
438
+ y: w.y - i
439
439
  }
440
440
  };
441
441
  }
442
442
  };
443
- }, Yt = function(e) {
444
- return e === void 0 && (e = {}), {
445
- name: "size",
446
- options: e,
447
- async fn(t) {
448
- const {
449
- placement: n,
450
- rects: o,
451
- platform: i,
452
- elements: r
453
- } = t, {
454
- apply: s = () => {
455
- },
456
- ...a
457
- } = we(e, t), l = await Ue(t, a), c = J(n), u = xe(n), d = oe(n) === "y", {
458
- width: h,
459
- height: m
460
- } = o.floating;
461
- let f, v;
462
- c === "top" || c === "bottom" ? (f = c, v = u === (await (i.isRTL == null ? void 0 : i.isRTL(r.floating)) ? "start" : "end") ? "left" : "right") : (v = c, f = u === "end" ? "top" : "bottom");
463
- const x = m - l.top - l.bottom, y = h - l.left - l.right, L = G(m - l[f], x), S = G(h - l[v], y), $ = !t.middlewareData.shift;
464
- let E = L, I = S;
465
- if (d ? I = u || $ ? G(S, y) : y : E = u || $ ? G(L, x) : x, $ && !u) {
466
- const D = O(l.left, 0), z = O(l.right, 0), _ = O(l.top, 0), ee = O(l.bottom, 0);
467
- d ? I = h - 2 * (D !== 0 || z !== 0 ? D + z : O(l.left, l.right)) : E = m - 2 * (_ !== 0 || ee !== 0 ? _ + ee : O(l.top, l.bottom));
468
- }
469
- await s({
470
- ...t,
471
- availableWidth: I,
472
- availableHeight: E
473
- });
474
- const T = await i.getDimensions(r.floating);
475
- return h !== T.width || m !== T.height ? {
476
- reset: {
477
- rects: !0
478
- }
479
- } : {};
480
- }
481
- };
482
443
  };
483
- function se(e) {
484
- return Ze(e) ? (e.nodeName || "").toLowerCase() : "#document";
444
+ function re(e) {
445
+ return Ye(e) ? (e.nodeName || "").toLowerCase() : "#document";
485
446
  }
486
447
  function F(e) {
487
448
  var t;
@@ -489,33 +450,33 @@ function F(e) {
489
450
  }
490
451
  function X(e) {
491
452
  var t;
492
- return (t = (Ze(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
453
+ return (t = (Ye(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
493
454
  }
494
- function Ze(e) {
455
+ function Ye(e) {
495
456
  return e instanceof Node || e instanceof F(e).Node;
496
457
  }
497
- function U(e) {
458
+ function H(e) {
498
459
  return e instanceof Element || e instanceof F(e).Element;
499
460
  }
500
- function Z(e) {
461
+ function U(e) {
501
462
  return e instanceof HTMLElement || e instanceof F(e).HTMLElement;
502
463
  }
503
- function nt(e) {
464
+ function st(e) {
504
465
  return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof F(e).ShadowRoot;
505
466
  }
506
- function ye(e) {
467
+ function we(e) {
507
468
  const {
508
469
  overflow: t,
509
470
  overflowX: n,
510
- overflowY: o,
511
- display: i
512
- } = W(e);
513
- return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !["inline", "contents"].includes(i);
471
+ overflowY: i,
472
+ display: o
473
+ } = _(e);
474
+ return /auto|scroll|overlay|hidden|clip/.test(t + i + n) && !["inline", "contents"].includes(o);
514
475
  }
515
- function Kt(e) {
516
- return ["table", "td", "th"].includes(se(e));
476
+ function on(e) {
477
+ return ["table", "td", "th"].includes(re(e));
517
478
  }
518
- function Be(e) {
479
+ function Me(e) {
519
480
  return [":popover-open", ":modal"].some((t) => {
520
481
  try {
521
482
  return e.matches(t);
@@ -524,32 +485,32 @@ function Be(e) {
524
485
  }
525
486
  });
526
487
  }
527
- function je(e) {
528
- const t = Xe(), n = W(e);
529
- return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
488
+ function Ge(e) {
489
+ const t = Ke(), n = _(e);
490
+ return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (n.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (n.contain || "").includes(i));
530
491
  }
531
- function Gt(e) {
532
- let t = Q(e);
533
- for (; Z(t) && !fe(t); ) {
534
- if (Be(t))
492
+ function rn(e) {
493
+ let t = G(e);
494
+ for (; U(t) && !fe(t); ) {
495
+ if (Me(t))
535
496
  return null;
536
- if (je(t))
497
+ if (Ge(t))
537
498
  return t;
538
- t = Q(t);
499
+ t = G(t);
539
500
  }
540
501
  return null;
541
502
  }
542
- function Xe() {
503
+ function Ke() {
543
504
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
544
505
  }
545
506
  function fe(e) {
546
- return ["html", "body", "#document"].includes(se(e));
507
+ return ["html", "body", "#document"].includes(re(e));
547
508
  }
548
- function W(e) {
509
+ function _(e) {
549
510
  return F(e).getComputedStyle(e);
550
511
  }
551
- function Ie(e) {
552
- return U(e) ? {
512
+ function Oe(e) {
513
+ return H(e) ? {
553
514
  scrollLeft: e.scrollLeft,
554
515
  scrollTop: e.scrollTop
555
516
  } : {
@@ -557,107 +518,107 @@ function Ie(e) {
557
518
  scrollTop: e.scrollY
558
519
  };
559
520
  }
560
- function Q(e) {
561
- if (se(e) === "html")
521
+ function G(e) {
522
+ if (re(e) === "html")
562
523
  return e;
563
524
  const t = (
564
525
  // Step into the shadow DOM of the parent of a slotted node.
565
526
  e.assignedSlot || // DOM Element detected.
566
527
  e.parentNode || // ShadowRoot detected.
567
- nt(e) && e.host || // Fallback.
528
+ st(e) && e.host || // Fallback.
568
529
  X(e)
569
530
  );
570
- return nt(t) ? t.host : t;
531
+ return st(t) ? t.host : t;
571
532
  }
572
- function vt(e) {
573
- const t = Q(e);
574
- return fe(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Z(t) && ye(t) ? t : vt(t);
533
+ function yt(e) {
534
+ const t = G(e);
535
+ return fe(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : U(t) && we(t) ? t : yt(t);
575
536
  }
576
537
  function Ce(e, t, n) {
577
- var o;
538
+ var i;
578
539
  t === void 0 && (t = []), n === void 0 && (n = !0);
579
- const i = vt(e), r = i === ((o = e.ownerDocument) == null ? void 0 : o.body), s = F(i);
580
- return r ? t.concat(s, s.visualViewport || [], ye(i) ? i : [], s.frameElement && n ? Ce(s.frameElement) : []) : t.concat(i, Ce(i, [], n));
581
- }
582
- function Ct(e) {
583
- const t = W(e);
584
- let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
585
- const i = Z(e), r = i ? e.offsetWidth : n, s = i ? e.offsetHeight : o, a = $e(n) !== r || $e(o) !== s;
586
- return a && (n = r, o = s), {
540
+ const o = yt(e), s = o === ((i = e.ownerDocument) == null ? void 0 : i.body), r = F(o);
541
+ return s ? t.concat(r, r.visualViewport || [], we(o) ? o : [], r.frameElement && n ? Ce(r.frameElement) : []) : t.concat(o, Ce(o, [], n));
542
+ }
543
+ function xt(e) {
544
+ const t = _(e);
545
+ let n = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
546
+ const o = U(e), s = o ? e.offsetWidth : n, r = o ? e.offsetHeight : i, a = $e(n) !== s || $e(i) !== r;
547
+ return a && (n = s, i = r), {
587
548
  width: n,
588
- height: o,
549
+ height: i,
589
550
  $: a
590
551
  };
591
552
  }
592
- function Ye(e) {
593
- return U(e) ? e : e.contextElement;
553
+ function Je(e) {
554
+ return H(e) ? e : e.contextElement;
594
555
  }
595
- function de(e) {
596
- const t = Ye(e);
597
- if (!Z(t))
598
- return q(1);
556
+ function ue(e) {
557
+ const t = Je(e);
558
+ if (!U(t))
559
+ return Y(1);
599
560
  const n = t.getBoundingClientRect(), {
600
- width: o,
601
- height: i,
602
- $: r
603
- } = Ct(t);
604
- let s = (r ? $e(n.width) : n.width) / o, a = (r ? $e(n.height) : n.height) / i;
605
- return (!s || !Number.isFinite(s)) && (s = 1), (!a || !Number.isFinite(a)) && (a = 1), {
606
- x: s,
561
+ width: i,
562
+ height: o,
563
+ $: s
564
+ } = xt(t);
565
+ let r = (s ? $e(n.width) : n.width) / i, a = (s ? $e(n.height) : n.height) / o;
566
+ return (!r || !Number.isFinite(r)) && (r = 1), (!a || !Number.isFinite(a)) && (a = 1), {
567
+ x: r,
607
568
  y: a
608
569
  };
609
570
  }
610
- const qt = /* @__PURE__ */ q(0);
611
- function bt(e) {
571
+ const sn = /* @__PURE__ */ Y(0);
572
+ function Lt(e) {
612
573
  const t = F(e);
613
- return !Xe() || !t.visualViewport ? qt : {
574
+ return !Ke() || !t.visualViewport ? sn : {
614
575
  x: t.visualViewport.offsetLeft,
615
576
  y: t.visualViewport.offsetTop
616
577
  };
617
578
  }
618
- function Jt(e, t, n) {
579
+ function ln(e, t, n) {
619
580
  return t === void 0 && (t = !1), !n || t && n !== F(e) ? !1 : t;
620
581
  }
621
- function ie(e, t, n, o) {
582
+ function oe(e, t, n, i) {
622
583
  t === void 0 && (t = !1), n === void 0 && (n = !1);
623
- const i = e.getBoundingClientRect(), r = Ye(e);
624
- let s = q(1);
625
- t && (o ? U(o) && (s = de(o)) : s = de(e));
626
- const a = Jt(r, n, o) ? bt(r) : q(0);
627
- let l = (i.left + a.x) / s.x, c = (i.top + a.y) / s.y, u = i.width / s.x, d = i.height / s.y;
628
- if (r) {
629
- const h = F(r), m = o && U(o) ? F(o) : o;
630
- let f = h, v = f.frameElement;
631
- for (; v && o && m !== f; ) {
632
- const x = de(v), y = v.getBoundingClientRect(), L = W(v), S = y.left + (v.clientLeft + parseFloat(L.paddingLeft)) * x.x, $ = y.top + (v.clientTop + parseFloat(L.paddingTop)) * x.y;
633
- l *= x.x, c *= x.y, u *= x.x, d *= x.y, l += S, c += $, f = F(v), v = f.frameElement;
584
+ const o = e.getBoundingClientRect(), s = Je(e);
585
+ let r = Y(1);
586
+ t && (i ? H(i) && (r = ue(i)) : r = ue(e));
587
+ const a = ln(s, n, i) ? Lt(s) : Y(0);
588
+ let l = (o.left + a.x) / r.x, c = (o.top + a.y) / r.y, u = o.width / r.x, h = o.height / r.y;
589
+ if (s) {
590
+ const g = F(s), f = i && H(i) ? F(i) : i;
591
+ let m = g, w = m.frameElement;
592
+ for (; w && i && f !== m; ) {
593
+ const y = ue(w), L = w.getBoundingClientRect(), x = _(w), T = L.left + (w.clientLeft + parseFloat(x.paddingLeft)) * y.x, A = L.top + (w.clientTop + parseFloat(x.paddingTop)) * y.y;
594
+ l *= y.x, c *= y.y, u *= y.x, h *= y.y, l += T, c += A, m = F(w), w = m.frameElement;
634
595
  }
635
596
  }
636
- return ke({
597
+ return Re({
637
598
  width: u,
638
- height: d,
599
+ height: h,
639
600
  x: l,
640
601
  y: c
641
602
  });
642
603
  }
643
- function Qt(e) {
604
+ function an(e) {
644
605
  let {
645
606
  elements: t,
646
607
  rect: n,
647
- offsetParent: o,
648
- strategy: i
608
+ offsetParent: i,
609
+ strategy: o
649
610
  } = e;
650
- const r = i === "fixed", s = X(o), a = t ? Be(t.floating) : !1;
651
- if (o === s || a && r)
611
+ const s = o === "fixed", r = X(i), a = t ? Me(t.floating) : !1;
612
+ if (i === r || a && s)
652
613
  return n;
653
614
  let l = {
654
615
  scrollLeft: 0,
655
616
  scrollTop: 0
656
- }, c = q(1);
657
- const u = q(0), d = Z(o);
658
- if ((d || !d && !r) && ((se(o) !== "body" || ye(s)) && (l = Ie(o)), Z(o))) {
659
- const h = ie(o);
660
- c = de(o), u.x = h.x + o.clientLeft, u.y = h.y + o.clientTop;
617
+ }, c = Y(1);
618
+ const u = Y(0), h = U(i);
619
+ if ((h || !h && !s) && ((re(i) !== "body" || we(r)) && (l = Oe(i)), U(i))) {
620
+ const g = oe(i);
621
+ c = ue(i), u.x = g.x + i.clientLeft, u.y = g.y + i.clientTop;
661
622
  }
662
623
  return {
663
624
  width: n.width * c.x,
@@ -666,93 +627,93 @@ function Qt(e) {
666
627
  y: n.y * c.y - l.scrollTop * c.y + u.y
667
628
  };
668
629
  }
669
- function en(e) {
630
+ function cn(e) {
670
631
  return Array.from(e.getClientRects());
671
632
  }
672
- function wt(e) {
673
- return ie(X(e)).left + Ie(e).scrollLeft;
633
+ function Tt(e) {
634
+ return oe(X(e)).left + Oe(e).scrollLeft;
674
635
  }
675
- function tn(e) {
676
- const t = X(e), n = Ie(e), o = e.ownerDocument.body, i = O(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), r = O(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
677
- let s = -n.scrollLeft + wt(e);
636
+ function un(e) {
637
+ const t = X(e), n = Oe(e), i = e.ownerDocument.body, o = ee(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), s = ee(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
638
+ let r = -n.scrollLeft + Tt(e);
678
639
  const a = -n.scrollTop;
679
- return W(o).direction === "rtl" && (s += O(t.clientWidth, o.clientWidth) - i), {
680
- width: i,
681
- height: r,
682
- x: s,
640
+ return _(i).direction === "rtl" && (r += ee(t.clientWidth, i.clientWidth) - o), {
641
+ width: o,
642
+ height: s,
643
+ x: r,
683
644
  y: a
684
645
  };
685
646
  }
686
- function nn(e, t) {
687
- const n = F(e), o = X(e), i = n.visualViewport;
688
- let r = o.clientWidth, s = o.clientHeight, a = 0, l = 0;
689
- if (i) {
690
- r = i.width, s = i.height;
691
- const c = Xe();
692
- (!c || c && t === "fixed") && (a = i.offsetLeft, l = i.offsetTop);
647
+ function dn(e, t) {
648
+ const n = F(e), i = X(e), o = n.visualViewport;
649
+ let s = i.clientWidth, r = i.clientHeight, a = 0, l = 0;
650
+ if (o) {
651
+ s = o.width, r = o.height;
652
+ const c = Ke();
653
+ (!c || c && t === "fixed") && (a = o.offsetLeft, l = o.offsetTop);
693
654
  }
694
655
  return {
695
- width: r,
696
- height: s,
656
+ width: s,
657
+ height: r,
697
658
  x: a,
698
659
  y: l
699
660
  };
700
661
  }
701
- function on(e, t) {
702
- const n = ie(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, r = Z(e) ? de(e) : q(1), s = e.clientWidth * r.x, a = e.clientHeight * r.y, l = i * r.x, c = o * r.y;
662
+ function fn(e, t) {
663
+ const n = oe(e, !0, t === "fixed"), i = n.top + e.clientTop, o = n.left + e.clientLeft, s = U(e) ? ue(e) : Y(1), r = e.clientWidth * s.x, a = e.clientHeight * s.y, l = o * s.x, c = i * s.y;
703
664
  return {
704
- width: s,
665
+ width: r,
705
666
  height: a,
706
667
  x: l,
707
668
  y: c
708
669
  };
709
670
  }
710
- function ot(e, t, n) {
711
- let o;
671
+ function lt(e, t, n) {
672
+ let i;
712
673
  if (t === "viewport")
713
- o = nn(e, n);
674
+ i = dn(e, n);
714
675
  else if (t === "document")
715
- o = tn(X(e));
716
- else if (U(t))
717
- o = on(t, n);
676
+ i = un(X(e));
677
+ else if (H(t))
678
+ i = fn(t, n);
718
679
  else {
719
- const i = bt(e);
720
- o = {
680
+ const o = Lt(e);
681
+ i = {
721
682
  ...t,
722
- x: t.x - i.x,
723
- y: t.y - i.y
683
+ x: t.x - o.x,
684
+ y: t.y - o.y
724
685
  };
725
686
  }
726
- return ke(o);
687
+ return Re(i);
727
688
  }
728
- function xt(e, t) {
729
- const n = Q(e);
730
- return n === t || !U(n) || fe(n) ? !1 : W(n).position === "fixed" || xt(n, t);
689
+ function St(e, t) {
690
+ const n = G(e);
691
+ return n === t || !H(n) || fe(n) ? !1 : _(n).position === "fixed" || St(n, t);
731
692
  }
732
- function sn(e, t) {
693
+ function mn(e, t) {
733
694
  const n = t.get(e);
734
695
  if (n)
735
696
  return n;
736
- let o = Ce(e, [], !1).filter((a) => U(a) && se(a) !== "body"), i = null;
737
- const r = W(e).position === "fixed";
738
- let s = r ? Q(e) : e;
739
- for (; U(s) && !fe(s); ) {
740
- const a = W(s), l = je(s);
741
- !l && a.position === "fixed" && (i = null), (r ? !l && !i : !l && a.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || ye(s) && !l && xt(e, s)) ? o = o.filter((u) => u !== s) : i = a, s = Q(s);
697
+ let i = Ce(e, [], !1).filter((a) => H(a) && re(a) !== "body"), o = null;
698
+ const s = _(e).position === "fixed";
699
+ let r = s ? G(e) : e;
700
+ for (; H(r) && !fe(r); ) {
701
+ const a = _(r), l = Ge(r);
702
+ !l && a.position === "fixed" && (o = null), (s ? !l && !o : !l && a.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || we(r) && !l && St(e, r)) ? i = i.filter((u) => u !== r) : o = a, r = G(r);
742
703
  }
743
- return t.set(e, o), o;
704
+ return t.set(e, i), i;
744
705
  }
745
- function rn(e) {
706
+ function hn(e) {
746
707
  let {
747
708
  element: t,
748
709
  boundary: n,
749
- rootBoundary: o,
750
- strategy: i
710
+ rootBoundary: i,
711
+ strategy: o
751
712
  } = e;
752
- const s = [...n === "clippingAncestors" ? Be(t) ? [] : sn(t, this._c) : [].concat(n), o], a = s[0], l = s.reduce((c, u) => {
753
- const d = ot(t, u, i);
754
- return c.top = O(d.top, c.top), c.right = G(d.right, c.right), c.bottom = G(d.bottom, c.bottom), c.left = O(d.left, c.left), c;
755
- }, ot(t, a, i));
713
+ const r = [...n === "clippingAncestors" ? Me(t) ? [] : mn(t, this._c) : [].concat(n), i], a = r[0], l = r.reduce((c, u) => {
714
+ const h = lt(t, u, o);
715
+ return c.top = ee(h.top, c.top), c.right = Ae(h.right, c.right), c.bottom = Ae(h.bottom, c.bottom), c.left = ee(h.left, c.left), c;
716
+ }, lt(t, a, o));
756
717
  return {
757
718
  width: l.right - l.left,
758
719
  height: l.bottom - l.top,
@@ -760,324 +721,324 @@ function rn(e) {
760
721
  y: l.top
761
722
  };
762
723
  }
763
- function ln(e) {
724
+ function pn(e) {
764
725
  const {
765
726
  width: t,
766
727
  height: n
767
- } = Ct(e);
728
+ } = xt(e);
768
729
  return {
769
730
  width: t,
770
731
  height: n
771
732
  };
772
733
  }
773
- function an(e, t, n) {
774
- const o = Z(t), i = X(t), r = n === "fixed", s = ie(e, !0, r, t);
734
+ function gn(e, t, n) {
735
+ const i = U(t), o = X(t), s = n === "fixed", r = oe(e, !0, s, t);
775
736
  let a = {
776
737
  scrollLeft: 0,
777
738
  scrollTop: 0
778
739
  };
779
- const l = q(0);
780
- if (o || !o && !r)
781
- if ((se(t) !== "body" || ye(i)) && (a = Ie(t)), o) {
782
- const d = ie(t, !0, r, t);
783
- l.x = d.x + t.clientLeft, l.y = d.y + t.clientTop;
784
- } else i && (l.x = wt(i));
785
- const c = s.left + a.scrollLeft - l.x, u = s.top + a.scrollTop - l.y;
740
+ const l = Y(0);
741
+ if (i || !i && !s)
742
+ if ((re(t) !== "body" || we(o)) && (a = Oe(t)), i) {
743
+ const h = oe(t, !0, s, t);
744
+ l.x = h.x + t.clientLeft, l.y = h.y + t.clientTop;
745
+ } else o && (l.x = Tt(o));
746
+ const c = r.left + a.scrollLeft - l.x, u = r.top + a.scrollTop - l.y;
786
747
  return {
787
748
  x: c,
788
749
  y: u,
789
- width: s.width,
790
- height: s.height
750
+ width: r.width,
751
+ height: r.height
791
752
  };
792
753
  }
793
- function ze(e) {
794
- return W(e).position === "static";
754
+ function He(e) {
755
+ return _(e).position === "static";
795
756
  }
796
- function it(e, t) {
797
- return !Z(e) || W(e).position === "fixed" ? null : t ? t(e) : e.offsetParent;
757
+ function at(e, t) {
758
+ return !U(e) || _(e).position === "fixed" ? null : t ? t(e) : e.offsetParent;
798
759
  }
799
- function yt(e, t) {
760
+ function Et(e, t) {
800
761
  const n = F(e);
801
- if (Be(e))
762
+ if (Me(e))
802
763
  return n;
803
- if (!Z(e)) {
804
- let i = Q(e);
805
- for (; i && !fe(i); ) {
806
- if (U(i) && !ze(i))
807
- return i;
808
- i = Q(i);
764
+ if (!U(e)) {
765
+ let o = G(e);
766
+ for (; o && !fe(o); ) {
767
+ if (H(o) && !He(o))
768
+ return o;
769
+ o = G(o);
809
770
  }
810
771
  return n;
811
772
  }
812
- let o = it(e, t);
813
- for (; o && Kt(o) && ze(o); )
814
- o = it(o, t);
815
- return o && fe(o) && ze(o) && !je(o) ? n : o || Gt(e) || n;
773
+ let i = at(e, t);
774
+ for (; i && on(i) && He(i); )
775
+ i = at(i, t);
776
+ return i && fe(i) && He(i) && !Ge(i) ? n : i || rn(e) || n;
816
777
  }
817
- const cn = async function(e) {
818
- const t = this.getOffsetParent || yt, n = this.getDimensions, o = await n(e.floating);
778
+ const vn = async function(e) {
779
+ const t = this.getOffsetParent || Et, n = this.getDimensions, i = await n(e.floating);
819
780
  return {
820
- reference: an(e.reference, await t(e.floating), e.strategy),
781
+ reference: gn(e.reference, await t(e.floating), e.strategy),
821
782
  floating: {
822
783
  x: 0,
823
784
  y: 0,
824
- width: o.width,
825
- height: o.height
785
+ width: i.width,
786
+ height: i.height
826
787
  }
827
788
  };
828
789
  };
829
- function un(e) {
830
- return W(e).direction === "rtl";
790
+ function bn(e) {
791
+ return _(e).direction === "rtl";
831
792
  }
832
- const dn = {
833
- convertOffsetParentRelativeRectToViewportRelativeRect: Qt,
793
+ const Cn = {
794
+ convertOffsetParentRelativeRectToViewportRelativeRect: an,
834
795
  getDocumentElement: X,
835
- getClippingRect: rn,
836
- getOffsetParent: yt,
837
- getElementRects: cn,
838
- getClientRects: en,
839
- getDimensions: ln,
840
- getScale: de,
841
- isElement: U,
842
- isRTL: un
796
+ getClippingRect: hn,
797
+ getOffsetParent: Et,
798
+ getElementRects: vn,
799
+ getClientRects: cn,
800
+ getDimensions: pn,
801
+ getScale: ue,
802
+ isElement: H,
803
+ isRTL: bn
843
804
  };
844
- function fn(e, t) {
845
- let n = null, o;
846
- const i = X(e);
847
- function r() {
805
+ function wn(e, t) {
806
+ let n = null, i;
807
+ const o = X(e);
808
+ function s() {
848
809
  var a;
849
- clearTimeout(o), (a = n) == null || a.disconnect(), n = null;
810
+ clearTimeout(i), (a = n) == null || a.disconnect(), n = null;
850
811
  }
851
- function s(a, l) {
852
- a === void 0 && (a = !1), l === void 0 && (l = 1), r();
812
+ function r(a, l) {
813
+ a === void 0 && (a = !1), l === void 0 && (l = 1), s();
853
814
  const {
854
815
  left: c,
855
816
  top: u,
856
- width: d,
857
- height: h
817
+ width: h,
818
+ height: g
858
819
  } = e.getBoundingClientRect();
859
- if (a || t(), !d || !h)
820
+ if (a || t(), !h || !g)
860
821
  return;
861
- const m = Ee(u), f = Ee(i.clientWidth - (c + d)), v = Ee(i.clientHeight - (u + h)), x = Ee(c), L = {
862
- rootMargin: -m + "px " + -f + "px " + -v + "px " + -x + "px",
863
- threshold: O(0, G(1, l)) || 1
822
+ const f = Te(u), m = Te(o.clientWidth - (c + h)), w = Te(o.clientHeight - (u + g)), y = Te(c), x = {
823
+ rootMargin: -f + "px " + -m + "px " + -w + "px " + -y + "px",
824
+ threshold: ee(0, Ae(1, l)) || 1
864
825
  };
865
- let S = !0;
866
- function $(E) {
867
- const I = E[0].intersectionRatio;
868
- if (I !== l) {
869
- if (!S)
870
- return s();
871
- I ? s(!1, I) : o = setTimeout(() => {
872
- s(!1, 1e-7);
826
+ let T = !0;
827
+ function A(S) {
828
+ const B = S[0].intersectionRatio;
829
+ if (B !== l) {
830
+ if (!T)
831
+ return r();
832
+ B ? r(!1, B) : i = setTimeout(() => {
833
+ r(!1, 1e-7);
873
834
  }, 1e3);
874
835
  }
875
- S = !1;
836
+ T = !1;
876
837
  }
877
838
  try {
878
- n = new IntersectionObserver($, {
879
- ...L,
839
+ n = new IntersectionObserver(A, {
840
+ ...x,
880
841
  // Handle <iframe>s
881
- root: i.ownerDocument
842
+ root: o.ownerDocument
882
843
  });
883
844
  } catch {
884
- n = new IntersectionObserver($, L);
845
+ n = new IntersectionObserver(A, x);
885
846
  }
886
847
  n.observe(e);
887
848
  }
888
- return s(!0), r;
849
+ return r(!0), s;
889
850
  }
890
- function mn(e, t, n, o) {
891
- o === void 0 && (o = {});
851
+ function yn(e, t, n, i) {
852
+ i === void 0 && (i = {});
892
853
  const {
893
- ancestorScroll: i = !0,
894
- ancestorResize: r = !0,
895
- elementResize: s = typeof ResizeObserver == "function",
854
+ ancestorScroll: o = !0,
855
+ ancestorResize: s = !0,
856
+ elementResize: r = typeof ResizeObserver == "function",
896
857
  layoutShift: a = typeof IntersectionObserver == "function",
897
858
  animationFrame: l = !1
898
- } = o, c = Ye(e), u = i || r ? [...c ? Ce(c) : [], ...Ce(t)] : [];
899
- u.forEach((y) => {
900
- i && y.addEventListener("scroll", n, {
859
+ } = i, c = Je(e), u = o || s ? [...c ? Ce(c) : [], ...Ce(t)] : [];
860
+ u.forEach((L) => {
861
+ o && L.addEventListener("scroll", n, {
901
862
  passive: !0
902
- }), r && y.addEventListener("resize", n);
863
+ }), s && L.addEventListener("resize", n);
903
864
  });
904
- const d = c && a ? fn(c, n) : null;
905
- let h = -1, m = null;
906
- s && (m = new ResizeObserver((y) => {
907
- let [L] = y;
908
- L && L.target === c && m && (m.unobserve(t), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
909
- var S;
910
- (S = m) == null || S.observe(t);
865
+ const h = c && a ? wn(c, n) : null;
866
+ let g = -1, f = null;
867
+ r && (f = new ResizeObserver((L) => {
868
+ let [x] = L;
869
+ x && x.target === c && f && (f.unobserve(t), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
870
+ var T;
871
+ (T = f) == null || T.observe(t);
911
872
  })), n();
912
- }), c && !l && m.observe(c), m.observe(t));
913
- let f, v = l ? ie(e) : null;
914
- l && x();
915
- function x() {
916
- const y = ie(e);
917
- v && (y.x !== v.x || y.y !== v.y || y.width !== v.width || y.height !== v.height) && n(), v = y, f = requestAnimationFrame(x);
873
+ }), c && !l && f.observe(c), f.observe(t));
874
+ let m, w = l ? oe(e) : null;
875
+ l && y();
876
+ function y() {
877
+ const L = oe(e);
878
+ w && (L.x !== w.x || L.y !== w.y || L.width !== w.width || L.height !== w.height) && n(), w = L, m = requestAnimationFrame(y);
918
879
  }
919
880
  return n(), () => {
920
- var y;
921
- u.forEach((L) => {
922
- i && L.removeEventListener("scroll", n), r && L.removeEventListener("resize", n);
923
- }), d == null || d(), (y = m) == null || y.disconnect(), m = null, l && cancelAnimationFrame(f);
881
+ var L;
882
+ u.forEach((x) => {
883
+ o && x.removeEventListener("scroll", n), s && x.removeEventListener("resize", n);
884
+ }), h == null || h(), (L = f) == null || L.disconnect(), f = null, l && cancelAnimationFrame(m);
924
885
  };
925
886
  }
926
- const hn = jt, pn = Xt, gn = Ut, vn = Yt, Cn = (e, t, n) => {
927
- const o = /* @__PURE__ */ new Map(), i = {
928
- platform: dn,
887
+ const xn = tn, Ln = nn, Tn = Qt, Sn = (e, t, n) => {
888
+ const i = /* @__PURE__ */ new Map(), o = {
889
+ platform: Cn,
929
890
  ...n
930
- }, r = {
931
- ...i.platform,
932
- _c: o
891
+ }, s = {
892
+ ...o.platform,
893
+ _c: i
933
894
  };
934
- return Wt(e, t, {
935
- ...i,
936
- platform: r
895
+ return Jt(e, t, {
896
+ ...o,
897
+ platform: s
937
898
  });
938
899
  };
939
- function bn(e) {
900
+ function En(e) {
940
901
  return e != null && typeof e == "object" && "$el" in e;
941
902
  }
942
- function st(e) {
943
- if (bn(e)) {
903
+ function ct(e) {
904
+ if (En(e)) {
944
905
  const t = e.$el;
945
- return Ze(t) && se(t) === "#comment" ? null : t;
906
+ return Ye(t) && re(t) === "#comment" ? null : t;
946
907
  }
947
908
  return e;
948
909
  }
949
- function pe(e) {
950
- return typeof e == "function" ? e() : Te(e);
910
+ function ge(e) {
911
+ return typeof e == "function" ? e() : ve(e);
951
912
  }
952
- function Lt(e) {
913
+ function At(e) {
953
914
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
954
915
  }
955
- function rt(e, t) {
956
- const n = Lt(e);
916
+ function ut(e, t) {
917
+ const n = At(e);
957
918
  return Math.round(t * n) / n;
958
919
  }
959
- function wn(e, t, n) {
920
+ function An(e, t, n) {
960
921
  n === void 0 && (n = {});
961
- const o = n.whileElementsMounted, i = B(() => {
962
- var T;
963
- return (T = pe(n.open)) != null ? T : !0;
964
- }), r = B(() => pe(n.middleware)), s = B(() => {
965
- var T;
966
- return (T = pe(n.placement)) != null ? T : "bottom";
967
- }), a = B(() => {
968
- var T;
969
- return (T = pe(n.strategy)) != null ? T : "absolute";
970
- }), l = B(() => {
971
- var T;
972
- return (T = pe(n.transform)) != null ? T : !0;
973
- }), c = B(() => st(e.value)), u = B(() => st(t.value)), d = R(0), h = R(0), m = R(a.value), f = R(s.value), v = It({}), x = R(!1), y = B(() => {
974
- const T = {
975
- position: m.value,
922
+ const i = n.whileElementsMounted, o = R(() => {
923
+ var E;
924
+ return (E = ge(n.open)) != null ? E : !0;
925
+ }), s = R(() => ge(n.middleware)), r = R(() => {
926
+ var E;
927
+ return (E = ge(n.placement)) != null ? E : "bottom";
928
+ }), a = R(() => {
929
+ var E;
930
+ return (E = ge(n.strategy)) != null ? E : "absolute";
931
+ }), l = R(() => {
932
+ var E;
933
+ return (E = ge(n.transform)) != null ? E : !0;
934
+ }), c = R(() => ct(e.value)), u = R(() => ct(t.value)), h = k(0), g = k(0), f = k(a.value), m = k(r.value), w = Pt({}), y = k(!1), L = R(() => {
935
+ const E = {
936
+ position: f.value,
976
937
  left: "0",
977
938
  top: "0"
978
939
  };
979
940
  if (!u.value)
980
- return T;
981
- const D = rt(u.value, d.value), z = rt(u.value, h.value);
941
+ return E;
942
+ const D = ut(u.value, h.value), Z = ut(u.value, g.value);
982
943
  return l.value ? {
983
- ...T,
984
- transform: "translate(" + D + "px, " + z + "px)",
985
- ...Lt(u.value) >= 1.5 && {
944
+ ...E,
945
+ transform: "translate(" + D + "px, " + Z + "px)",
946
+ ...At(u.value) >= 1.5 && {
986
947
  willChange: "transform"
987
948
  }
988
949
  } : {
989
- position: m.value,
950
+ position: f.value,
990
951
  left: D + "px",
991
- top: z + "px"
952
+ top: Z + "px"
992
953
  };
993
954
  });
994
- let L;
995
- function S() {
996
- c.value == null || u.value == null || Cn(c.value, u.value, {
997
- middleware: r.value,
998
- placement: s.value,
955
+ let x;
956
+ function T() {
957
+ c.value == null || u.value == null || Sn(c.value, u.value, {
958
+ middleware: s.value,
959
+ placement: r.value,
999
960
  strategy: a.value
1000
- }).then((T) => {
1001
- d.value = T.x, h.value = T.y, m.value = T.strategy, f.value = T.placement, v.value = T.middlewareData, x.value = !0;
961
+ }).then((E) => {
962
+ h.value = E.x, g.value = E.y, f.value = E.strategy, m.value = E.placement, w.value = E.middlewareData, y.value = !0;
1002
963
  });
1003
964
  }
1004
- function $() {
1005
- typeof L == "function" && (L(), L = void 0);
965
+ function A() {
966
+ typeof x == "function" && (x(), x = void 0);
1006
967
  }
1007
- function E() {
1008
- if ($(), o === void 0) {
1009
- S();
968
+ function S() {
969
+ if (A(), i === void 0) {
970
+ T();
1010
971
  return;
1011
972
  }
1012
973
  if (c.value != null && u.value != null) {
1013
- L = o(c.value, u.value, S);
974
+ x = i(c.value, u.value, T);
1014
975
  return;
1015
976
  }
1016
977
  }
1017
- function I() {
1018
- i.value || (x.value = !1);
978
+ function B() {
979
+ o.value || (y.value = !1);
1019
980
  }
1020
- return ue([r, s, a], S, {
981
+ return Q([s, r, a], T, {
1021
982
  flush: "sync"
1022
- }), ue([c, u], E, {
983
+ }), Q([c, u], S, {
1023
984
  flush: "sync"
1024
- }), ue(i, I, {
985
+ }), Q(o, B, {
1025
986
  flush: "sync"
1026
- }), Mt() && Dt($), {
1027
- x: ae(d),
1028
- y: ae(h),
1029
- strategy: ae(m),
1030
- placement: ae(f),
1031
- middlewareData: ae(v),
1032
- isPositioned: ae(x),
1033
- floatingStyles: y,
1034
- update: S
987
+ }), Vt() && Nt(A), {
988
+ x: ae(h),
989
+ y: ae(g),
990
+ strategy: ae(f),
991
+ placement: ae(m),
992
+ middlewareData: ae(w),
993
+ isPositioned: ae(y),
994
+ floatingStyles: L,
995
+ update: T
1035
996
  };
1036
997
  }
1037
- const xn = "data:image/svg+xml,%3csvg%20width='1324'%20height='1326'%20viewBox='0%200%201324%201326'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='141'%20y='78'%20width='1042'%20height='1170'%20fill='white'/%3e%3cpath%20d='M184.533%201.99984C135.867%207.19984%2089.8666%2029.8665%2056.4%2065.1998C29.6%2093.4665%2012.5333%20126.266%203.73329%20166.4L0.666626%20180V663.333V1146.67L3.73329%201160.27C12.5333%201200.4%2029.6%201233.2%2056.4%201261.47C90.4%201297.33%20135.333%201319.33%20185.6%201324.67C203.333%201326.53%201122.53%201326.4%201139.73%201324.53C1188.53%201319.33%201229.07%201299.73%201264.13%201264.8C1294.27%201234.67%201311.47%201202.67%201320.8%201159.33C1323.2%201148.4%201323.33%201130%201323.33%20663.333C1323.33%20196.667%201323.2%20178.266%201320.8%20167.333C1311.47%20124%201294.27%2091.9998%201264.13%2061.8664C1229.07%2026.9331%201188.53%207.33314%201139.73%202.13314C1124.67%200.399809%20200%200.399842%20184.533%201.99984ZM732.933%20151.466C746.8%20152.933%20763.333%20157.6%20774%20163.067C800.267%20176.267%20822.4%20200.4%20833.2%20227.333C841.867%20249.333%20841.467%20233.467%20841.067%20502C840.533%20777.6%20841.733%20750.267%20829.2%20776.133C822.133%20790.933%20810.667%20806.533%20800.267%20815.2C795.2%20819.6%20793.2%20822.267%20792%20827.067C786.133%20848.267%20768.667%20885.867%20755.2%20906.133C724.533%20952%20681.2%20986.133%20624%201009.33C615.6%201012.8%20608.4%201015.87%20608.133%201016.13C607.867%201016.27%20614.533%201023.33%20622.933%201031.6C633.467%201042.13%20639.333%201049.07%20642.133%201054.4C646.933%201063.87%20645.467%201064%20672.667%201050.8C724.933%201025.47%20762.933%20994.8%20794.933%20952C811.467%20929.867%20829.867%20895.333%20839.333%20868.267C841.333%20862.667%20843.467%20858%20844.133%20858C844.667%20858%20845.6%20859.333%20846.133%20860.933C848.267%20868.133%20863.333%20900.8%20870.133%20913.2C898%20963.867%20931.6%201001.2%20975.333%201030.27C989.867%201040%201017.2%201054.4%201031.6%201059.73L1037.2%201061.87L1041.33%201054.67C1048.4%201042.4%201056.67%201032.27%201067.87%201022.4L1078.67%201012.8L1071.6%201010.27C1067.87%201008.8%201060.53%201006%201055.6%201004.13C1040.93%20998.533%201013.73%20984%201000%20974.267C985.733%20964.133%20960.8%20940.667%20948.933%20926.267C935.067%20909.333%20921.467%20887.467%20910%20864C900.133%20844%20887.2%20812.133%20884.667%20801.6L883.733%20798H971.867H1060V769.333V740.667H963.333H866.533L867.333%20736.267C868.4%20729.867%20870.4%20693.067%20871.467%20662.933C872.267%20639.067%20872.533%20636.4%20874.8%20635.2C878.667%20633.2%20881.333%20626.667%20882.267%20617.333L883.067%20608.667H872.133C864.133%20608.667%20861.067%20608.133%20860.533%20606.8C860%20605.467%20881.2%20466%20886.133%20438.267L886.933%20433.867L977.867%20434.4C1066.67%20434.8%201068.93%20434.8%201079.87%20437.733C1124.8%20449.6%201158.67%20482.533%201172.93%20528L1176.67%20540V808V1076L1172.93%201087.73C1158.53%201133.6%201126.13%201164.93%201078.93%201178.4L1068.67%201181.33L812.667%201181.73C638.8%201182%20552.667%201181.73%20544.4%201180.67C488.667%201174.4%20443.2%201132.13%20432.533%201076.93C431.067%201068.93%20430.667%201046.4%20430.667%20956.667V846.133L340.4%20845.6C252.8%20845.2%20249.6%20845.067%20239.067%20842.267C196.533%20831.067%20164.533%20800.133%20151.067%20757.333L147.333%20745.333V499.333V253.333L150.4%20242C159.067%20209.067%20180.4%20181.866%20210.667%20164.933C221.2%20159.066%20240.4%20152.933%20252.667%20151.6C268.533%20149.733%20716.933%20149.6%20732.933%20151.466Z'%20fill='%233B5695'/%3e%3cpath%20d='M256.533%20213.333C232.933%20218.533%20214.133%20237.067%20209.333%20259.733C208.4%20264.533%20208%20337.2%20208.267%20502L208.667%20737.333L211.733%20744.933C218.533%20761.733%20231.733%20774.533%20248.667%20780.933L256.667%20784L490%20784.4C749.2%20784.8%20734.4%20785.333%20750.133%20776C764.267%20767.6%20775.467%20752.4%20778.667%20737.067C779.6%20732.8%20780%20652.133%20779.733%20494L779.333%20257.333L775.067%20248.267C767.2%20231.6%20756.933%20222%20740.133%20215.467L731.333%20212L498%20211.733C306.8%20211.6%20263.2%20211.867%20256.533%20213.333ZM492%20281.2C546.267%20290.267%20590.267%20311.2%20622.533%20343.333C653.867%20374.667%20671.867%20409.867%20680.267%20456.667C684.133%20478.533%20684.133%20516.267%20680.133%20538.533C665.467%20621.067%20606.933%20684.4%20524%20707.467C490%20716.933%20488.4%20716.933%20392.4%20717.6L305.333%20718.133V498V277.867L391.733%20278.4C465.733%20278.8%20480%20279.2%20492%20281.2Z'%20fill='%233B5695'/%3e%3cpath%20d='M384%20462.933V576.133L345.067%20611.467C306.533%20646.267%20306.133%20646.667%20310.667%20647.067C313.2%20647.333%20348.933%20647.333%20390%20646.933C472.667%20646.267%20477.6%20645.867%20503.6%20637.333C527.6%20629.333%20543.333%20620%20560.267%20603.6C590.133%20574.667%20604.4%20536.267%20602.267%20489.733C600.533%20450.267%20588.267%20420%20564%20395.333C546.8%20377.867%20531.6%20368.4%20506.267%20360C482.933%20352.133%20474.533%20351.2%20427.067%20350.4L384%20349.733V462.933Z'%20fill='%233B5695'/%3e%3c/svg%3e", re = (e, t) => {
998
+ const $n = "data:image/svg+xml,%3csvg%20width='1324'%20height='1326'%20viewBox='0%200%201324%201326'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='141'%20y='78'%20width='1042'%20height='1170'%20fill='white'/%3e%3cpath%20d='M184.533%201.99984C135.867%207.19984%2089.8666%2029.8665%2056.4%2065.1998C29.6%2093.4665%2012.5333%20126.266%203.73329%20166.4L0.666626%20180V663.333V1146.67L3.73329%201160.27C12.5333%201200.4%2029.6%201233.2%2056.4%201261.47C90.4%201297.33%20135.333%201319.33%20185.6%201324.67C203.333%201326.53%201122.53%201326.4%201139.73%201324.53C1188.53%201319.33%201229.07%201299.73%201264.13%201264.8C1294.27%201234.67%201311.47%201202.67%201320.8%201159.33C1323.2%201148.4%201323.33%201130%201323.33%20663.333C1323.33%20196.667%201323.2%20178.266%201320.8%20167.333C1311.47%20124%201294.27%2091.9998%201264.13%2061.8664C1229.07%2026.9331%201188.53%207.33314%201139.73%202.13314C1124.67%200.399809%20200%200.399842%20184.533%201.99984ZM732.933%20151.466C746.8%20152.933%20763.333%20157.6%20774%20163.067C800.267%20176.267%20822.4%20200.4%20833.2%20227.333C841.867%20249.333%20841.467%20233.467%20841.067%20502C840.533%20777.6%20841.733%20750.267%20829.2%20776.133C822.133%20790.933%20810.667%20806.533%20800.267%20815.2C795.2%20819.6%20793.2%20822.267%20792%20827.067C786.133%20848.267%20768.667%20885.867%20755.2%20906.133C724.533%20952%20681.2%20986.133%20624%201009.33C615.6%201012.8%20608.4%201015.87%20608.133%201016.13C607.867%201016.27%20614.533%201023.33%20622.933%201031.6C633.467%201042.13%20639.333%201049.07%20642.133%201054.4C646.933%201063.87%20645.467%201064%20672.667%201050.8C724.933%201025.47%20762.933%20994.8%20794.933%20952C811.467%20929.867%20829.867%20895.333%20839.333%20868.267C841.333%20862.667%20843.467%20858%20844.133%20858C844.667%20858%20845.6%20859.333%20846.133%20860.933C848.267%20868.133%20863.333%20900.8%20870.133%20913.2C898%20963.867%20931.6%201001.2%20975.333%201030.27C989.867%201040%201017.2%201054.4%201031.6%201059.73L1037.2%201061.87L1041.33%201054.67C1048.4%201042.4%201056.67%201032.27%201067.87%201022.4L1078.67%201012.8L1071.6%201010.27C1067.87%201008.8%201060.53%201006%201055.6%201004.13C1040.93%20998.533%201013.73%20984%201000%20974.267C985.733%20964.133%20960.8%20940.667%20948.933%20926.267C935.067%20909.333%20921.467%20887.467%20910%20864C900.133%20844%20887.2%20812.133%20884.667%20801.6L883.733%20798H971.867H1060V769.333V740.667H963.333H866.533L867.333%20736.267C868.4%20729.867%20870.4%20693.067%20871.467%20662.933C872.267%20639.067%20872.533%20636.4%20874.8%20635.2C878.667%20633.2%20881.333%20626.667%20882.267%20617.333L883.067%20608.667H872.133C864.133%20608.667%20861.067%20608.133%20860.533%20606.8C860%20605.467%20881.2%20466%20886.133%20438.267L886.933%20433.867L977.867%20434.4C1066.67%20434.8%201068.93%20434.8%201079.87%20437.733C1124.8%20449.6%201158.67%20482.533%201172.93%20528L1176.67%20540V808V1076L1172.93%201087.73C1158.53%201133.6%201126.13%201164.93%201078.93%201178.4L1068.67%201181.33L812.667%201181.73C638.8%201182%20552.667%201181.73%20544.4%201180.67C488.667%201174.4%20443.2%201132.13%20432.533%201076.93C431.067%201068.93%20430.667%201046.4%20430.667%20956.667V846.133L340.4%20845.6C252.8%20845.2%20249.6%20845.067%20239.067%20842.267C196.533%20831.067%20164.533%20800.133%20151.067%20757.333L147.333%20745.333V499.333V253.333L150.4%20242C159.067%20209.067%20180.4%20181.866%20210.667%20164.933C221.2%20159.066%20240.4%20152.933%20252.667%20151.6C268.533%20149.733%20716.933%20149.6%20732.933%20151.466Z'%20fill='%233B5695'/%3e%3cpath%20d='M256.533%20213.333C232.933%20218.533%20214.133%20237.067%20209.333%20259.733C208.4%20264.533%20208%20337.2%20208.267%20502L208.667%20737.333L211.733%20744.933C218.533%20761.733%20231.733%20774.533%20248.667%20780.933L256.667%20784L490%20784.4C749.2%20784.8%20734.4%20785.333%20750.133%20776C764.267%20767.6%20775.467%20752.4%20778.667%20737.067C779.6%20732.8%20780%20652.133%20779.733%20494L779.333%20257.333L775.067%20248.267C767.2%20231.6%20756.933%20222%20740.133%20215.467L731.333%20212L498%20211.733C306.8%20211.6%20263.2%20211.867%20256.533%20213.333ZM492%20281.2C546.267%20290.267%20590.267%20311.2%20622.533%20343.333C653.867%20374.667%20671.867%20409.867%20680.267%20456.667C684.133%20478.533%20684.133%20516.267%20680.133%20538.533C665.467%20621.067%20606.933%20684.4%20524%20707.467C490%20716.933%20488.4%20716.933%20392.4%20717.6L305.333%20718.133V498V277.867L391.733%20278.4C465.733%20278.8%20480%20279.2%20492%20281.2Z'%20fill='%233B5695'/%3e%3cpath%20d='M384%20462.933V576.133L345.067%20611.467C306.533%20646.267%20306.133%20646.667%20310.667%20647.067C313.2%20647.333%20348.933%20647.333%20390%20646.933C472.667%20646.267%20477.6%20645.867%20503.6%20637.333C527.6%20629.333%20543.333%20620%20560.267%20603.6C590.133%20574.667%20604.4%20536.267%20602.267%20489.733C600.533%20450.267%20588.267%20420%20564%20395.333C546.8%20377.867%20531.6%20368.4%20506.267%20360C482.933%20352.133%20474.533%20351.2%20427.067%20350.4L384%20349.733V462.933Z'%20fill='%233B5695'/%3e%3c/svg%3e", se = (e, t) => {
1038
999
  const n = e.__vccOpts || e;
1039
- for (const [o, i] of t)
1040
- n[o] = i;
1000
+ for (const [i, o] of t)
1001
+ n[i] = o;
1041
1002
  return n;
1042
- }, yn = {
1003
+ }, kn = {
1043
1004
  name: "Logo"
1044
- }, Ln = {
1045
- src: xn,
1005
+ }, Rn = {
1006
+ src: $n,
1046
1007
  alt: "DDict Logo",
1047
1008
  class: "w-6 h-6 cursor-pointer"
1048
1009
  };
1049
- function Sn(e, t, n, o, i, r) {
1050
- return p(), w("img", Ln);
1010
+ function In(e, t, n, i, o, s) {
1011
+ return p(), v("img", Rn);
1051
1012
  }
1052
- const En = /* @__PURE__ */ re(yn, [["render", Sn]]), Tn = {}, $n = {
1013
+ const Bn = /* @__PURE__ */ se(kn, [["render", In]]), Mn = {}, On = {
1053
1014
  class: "w-12 h-12 text-primary",
1054
1015
  xmlns: "http://www.w3.org/2000/svg",
1055
1016
  viewBox: "0 0 24 24"
1056
- }, An = /* @__PURE__ */ Ne('<circle cx="18" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".67" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".33" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="6" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin="0" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle>', 3), kn = [
1057
- An
1017
+ }, Dn = /* @__PURE__ */ Xe('<circle cx="18" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".67" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".33" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="6" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin="0" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle>', 3), Fn = [
1018
+ Dn
1058
1019
  ];
1059
- function Rn(e, t) {
1060
- return p(), w("svg", $n, kn);
1020
+ function Wn(e, t) {
1021
+ return p(), v("svg", On, Fn);
1061
1022
  }
1062
- const Bn = /* @__PURE__ */ re(Tn, [["render", Rn]]), In = { class: "rounded-lg bg-base-100 px-4 py-2 border border-base-300 shadow-lg" }, Mn = { class: "flex justify-center" }, Dn = {
1023
+ const _n = /* @__PURE__ */ se(Mn, [["render", Wn]]), zn = { class: "rounded-lg bg-base-100 px-4 py-2 border border-base-300 shadow-lg" }, Pn = { class: "flex justify-center" }, Vn = {
1063
1024
  __name: "Loading",
1064
1025
  setup(e) {
1065
- return (t, n) => (p(), w("div", In, [
1066
- b("div", Mn, [
1067
- H(Bn)
1026
+ return (t, n) => (p(), v("div", zn, [
1027
+ C("div", Pn, [
1028
+ O(_n)
1068
1029
  ])
1069
1030
  ]));
1070
1031
  }
1071
- }, On = {
1032
+ }, Nn = {
1072
1033
  name: "Phonetic",
1073
1034
  props: ["phonetic"]
1074
- }, Fn = { class: "p-0 m-0" }, zn = { class: "text-xs font-md text-base-content/60" };
1075
- function _n(e, t, n, o, i, r) {
1076
- return p(), w("p", Fn, [
1077
- b("span", zn, "/" + ge(n.phonetic) + "/", 1)
1035
+ }, Hn = { class: "p-0 m-0" }, Un = { class: "text-xs font-md text-base-content/60" };
1036
+ function Zn(e, t, n, i, o, s) {
1037
+ return p(), v("p", Hn, [
1038
+ C("span", Un, "/" + ne(n.phonetic) + "/", 1)
1078
1039
  ]);
1079
1040
  }
1080
- const Vn = /* @__PURE__ */ re(On, [["render", _n]]), Pn = { class: "flex flex-col gap-2" }, Hn = {
1041
+ const jn = /* @__PURE__ */ se(Nn, [["render", Zn]]), Xn = { class: "flex flex-col gap-2" }, qn = {
1081
1042
  __name: "Sentences",
1082
1043
  props: {
1083
1044
  sentences: {
@@ -1086,22 +1047,22 @@ const Vn = /* @__PURE__ */ re(On, [["render", _n]]), Pn = { class: "flex flex-co
1086
1047
  }
1087
1048
  },
1088
1049
  setup(e) {
1089
- const t = e, n = B(() => t.sentences.split(`
1050
+ const t = e, n = R(() => t.sentences.split(`
1090
1051
  `));
1091
- return (o, i) => (p(), w("div", Pn, [
1092
- (p(!0), w(be, null, Re(n.value, (r, s) => (p(), w("p", {
1093
- key: s,
1052
+ return (i, o) => (p(), v("div", Xn, [
1053
+ (p(!0), v(K, null, me(n.value, (s, r) => (p(), v("p", {
1054
+ key: r,
1094
1055
  class: "text-base text-base-content leading-tight p-0 mr-2"
1095
- }, ge(r), 1))), 128))
1056
+ }, ne(s), 1))), 128))
1096
1057
  ]));
1097
1058
  }
1098
- }, Nn = /* @__PURE__ */ b("p", { class: "text-sm font-medium text-primary text-center" }, [
1099
- /* @__PURE__ */ ve(" 🤔 Don't understand? "),
1100
- /* @__PURE__ */ b("span", { class: "text-secondary font-semibold" }, "Try AI"),
1101
- /* @__PURE__ */ ve(" ✨ ")
1102
- ], -1), Wn = [
1103
- Nn
1104
- ], Un = {
1059
+ }, Yn = /* @__PURE__ */ C("p", { class: "text-sm font-medium text-primary text-center" }, [
1060
+ /* @__PURE__ */ be(" 🤔 Don't understand? "),
1061
+ /* @__PURE__ */ C("span", { class: "text-secondary font-semibold" }, "Try AI"),
1062
+ /* @__PURE__ */ be(" ✨ ")
1063
+ ], -1), Gn = [
1064
+ Yn
1065
+ ], Kn = {
1105
1066
  __name: "AIPromptButton",
1106
1067
  props: {
1107
1068
  show: {
@@ -1115,18 +1076,18 @@ const Vn = /* @__PURE__ */ re(On, [["render", _n]]), Pn = { class: "flex flex-co
1115
1076
  },
1116
1077
  emits: ["click"],
1117
1078
  setup(e) {
1118
- return (t, n) => e.show ? (p(), w("div", {
1079
+ return (t, n) => e.show ? (p(), v("div", {
1119
1080
  key: 0,
1120
- class: k([
1081
+ class: $([
1121
1082
  "mt-2 p-2 bg-gradient-to-r rounded-lg border transition-all duration-200",
1122
1083
  e.isLoading ? "from-primary/5 to-secondary/5 border-primary/10 cursor-not-allowed opacity-75" : "from-primary/10 to-secondary/10 border-primary/20 cursor-pointer hover:from-primary/20 hover:to-secondary/20 hover:border-primary/30"
1123
1084
  ]),
1124
- onClick: n[0] || (n[0] = (o) => !e.isLoading && t.$emit("click"))
1125
- }, Wn, 2)) : M("", !0);
1085
+ onClick: n[0] || (n[0] = (i) => !e.isLoading && t.$emit("click"))
1086
+ }, Gn, 2)) : M("", !0);
1126
1087
  }
1127
- }, Zn = /* @__PURE__ */ b("p", { class: "text-sm font-medium text-accent text-center" }, "💡 Need Summary? ✨", -1), jn = [
1128
- Zn
1129
- ], Xn = {
1088
+ }, Jn = /* @__PURE__ */ C("p", { class: "text-sm font-medium text-accent text-center" }, "💡 Need Summary? ✨", -1), Qn = [
1089
+ Jn
1090
+ ], ei = {
1130
1091
  __name: "AIExplainPromptButton",
1131
1092
  props: {
1132
1093
  show: {
@@ -1140,22 +1101,22 @@ const Vn = /* @__PURE__ */ re(On, [["render", _n]]), Pn = { class: "flex flex-co
1140
1101
  },
1141
1102
  emits: ["click"],
1142
1103
  setup(e) {
1143
- return (t, n) => e.show ? (p(), w("div", {
1104
+ return (t, n) => e.show ? (p(), v("div", {
1144
1105
  key: 0,
1145
- class: k([
1106
+ class: $([
1146
1107
  "mt-2 p-2 bg-gradient-to-r rounded-lg border transition-all duration-200",
1147
1108
  e.isLoading ? "from-accent/5 to-info/5 border-accent/10 cursor-not-allowed opacity-75" : "from-accent/10 to-info/10 border-accent/20 cursor-pointer hover:from-accent/20 hover:to-info/20 hover:border-accent/30"
1148
1109
  ]),
1149
- onClick: n[0] || (n[0] = (o) => !e.isLoading && t.$emit("click"))
1150
- }, jn, 2)) : M("", !0);
1110
+ onClick: n[0] || (n[0] = (i) => !e.isLoading && t.$emit("click"))
1111
+ }, Qn, 2)) : M("", !0);
1151
1112
  }
1152
- }, Yn = /* @__PURE__ */ b("p", { class: "text-sm font-medium text-success text-center" }, [
1153
- /* @__PURE__ */ ve(" 📚 Learn this? "),
1154
- /* @__PURE__ */ b("span", { class: "text-warning font-semibold" }, "Study now"),
1155
- /* @__PURE__ */ ve(" 🎯 ")
1156
- ], -1), Kn = [
1157
- Yn
1158
- ], Gn = {
1113
+ }, ti = /* @__PURE__ */ C("p", { class: "text-sm font-medium text-success text-center" }, [
1114
+ /* @__PURE__ */ be(" 📚 Learn this? "),
1115
+ /* @__PURE__ */ C("span", { class: "text-warning font-semibold" }, "Study now"),
1116
+ /* @__PURE__ */ be(" 🎯 ")
1117
+ ], -1), ni = [
1118
+ ti
1119
+ ], ii = {
1159
1120
  __name: "LearnPromptButton",
1160
1121
  props: {
1161
1122
  show: {
@@ -1165,68 +1126,68 @@ const Vn = /* @__PURE__ */ re(On, [["render", _n]]), Pn = { class: "flex flex-co
1165
1126
  },
1166
1127
  emits: ["click"],
1167
1128
  setup(e) {
1168
- return (t, n) => e.show ? (p(), w("div", {
1129
+ return (t, n) => e.show ? (p(), v("div", {
1169
1130
  key: 0,
1170
- class: k([
1131
+ class: $([
1171
1132
  "mt-2 p-2 bg-gradient-to-r rounded-lg border transition-all duration-200",
1172
1133
  "from-success/10 to-warning/10 border-success/20 cursor-pointer hover:from-success/20 hover:to-warning/20 hover:border-success/30"
1173
1134
  ]),
1174
- onClick: n[0] || (n[0] = (o) => t.$emit("click"))
1175
- }, Kn)) : M("", !0);
1135
+ onClick: n[0] || (n[0] = (i) => t.$emit("click"))
1136
+ }, ni)) : M("", !0);
1176
1137
  }
1177
- }, qn = { class: "capitalize text-base italic font-normal text-base-content/60" }, Jn = { class: "text-base leading-6 text-base-content" }, Qn = {
1138
+ }, oi = { class: "capitalize text-base italic font-normal text-base-content/60" }, ri = { class: "text-base leading-6 text-base-content" }, si = {
1178
1139
  __name: "Dict",
1179
1140
  props: {
1180
1141
  dictionary: Array
1181
1142
  },
1182
1143
  setup(e) {
1183
- return (t, n) => (p(), w("div", null, [
1184
- (p(!0), w(be, null, Re(e.dictionary, (o, i) => (p(), w("div", {
1185
- key: i,
1144
+ return (t, n) => (p(), v("div", null, [
1145
+ (p(!0), v(K, null, me(e.dictionary, (i, o) => (p(), v("div", {
1146
+ key: o,
1186
1147
  class: "mt-2"
1187
1148
  }, [
1188
- b("p", qn, ge(o.pos), 1),
1189
- b("span", Jn, ge(o.terms.join(", ")), 1)
1149
+ C("p", oi, ne(i.pos), 1),
1150
+ C("span", ri, ne(i.terms.join(", ")), 1)
1190
1151
  ]))), 128))
1191
1152
  ]));
1192
1153
  }
1193
- }, eo = { class: "" }, to = /* @__PURE__ */ b("p", { class: "capitalize text-base italic font-normal text-base-content/60 mt-2" }, "Summary", -1), no = {
1154
+ }, li = { class: "" }, ai = /* @__PURE__ */ C("p", { class: "capitalize text-base italic font-normal text-base-content/60 mt-2" }, "Summary", -1), ci = {
1194
1155
  key: 0,
1195
1156
  class: "list-none list-outside mt-2"
1196
- }, oo = ["innerHTML"], io = {
1157
+ }, ui = ["innerHTML"], di = {
1197
1158
  __name: "Explanation",
1198
1159
  props: {
1199
1160
  explanation: Object
1200
1161
  },
1201
1162
  setup(e) {
1202
1163
  return (t, n) => {
1203
- var o, i;
1204
- return p(), w("div", eo, [
1205
- to,
1206
- (o = e.explanation) != null && o.result ? (p(), w("ul", no, [
1207
- (p(!0), w(be, null, Re(((i = e.explanation) == null ? void 0 : i.result.split(`
1208
- `)) || [], (r, s) => (p(), w("li", {
1209
- key: `${r}-${s}`,
1210
- innerHTML: r,
1164
+ var i, o;
1165
+ return p(), v("div", li, [
1166
+ ai,
1167
+ (i = e.explanation) != null && i.result ? (p(), v("ul", ci, [
1168
+ (p(!0), v(K, null, me(((o = e.explanation) == null ? void 0 : o.result.split(`
1169
+ `)) || [], (s, r) => (p(), v("li", {
1170
+ key: `${s}-${r}`,
1171
+ innerHTML: s,
1211
1172
  class: "text-base text-base-content"
1212
- }, null, 8, oo))), 128))
1173
+ }, null, 8, ui))), 128))
1213
1174
  ])) : M("", !0)
1214
1175
  ]);
1215
1176
  };
1216
1177
  }
1217
- }, so = ["disabled"], ro = /* @__PURE__ */ b("path", {
1178
+ }, fi = ["disabled"], mi = /* @__PURE__ */ C("path", {
1218
1179
  d: "M2.33325 4.66667H3.51125C3.82693 4.6667 4.13239 4.55473 4.37325 4.35067L6.83392 2.26667C6.99592 2.12953 7.19374 2.04156 7.40407 2.01312C7.61441 1.98468 7.82849 2.01696 8.02109 2.10615C8.21369 2.19534 8.37678 2.33772 8.49114 2.51652C8.60551 2.69532 8.66638 2.90309 8.66659 3.11534V12.8847C8.66649 13.097 8.60565 13.305 8.49125 13.4839C8.37685 13.6628 8.21367 13.8053 8.02094 13.8945C7.82822 13.9837 7.614 14.0159 7.40356 13.9874C7.19312 13.9588 6.99523 13.8707 6.83325 13.7333L4.37325 11.6487C4.13229 11.4449 3.82685 11.3331 3.51125 11.3333H2.33325C2.06804 11.3333 1.81368 11.228 1.62615 11.0404C1.43861 10.8529 1.33325 10.5986 1.33325 10.3333V5.66667C1.33325 5.40145 1.43861 5.1471 1.62615 4.95956C1.81368 4.77203 2.06804 4.66667 2.33325 4.66667ZM11.1779 11.18C11.5969 10.763 11.9294 10.2674 12.1562 9.72156C12.3831 9.17572 12.4999 8.59044 12.4999 7.99934C12.4999 7.40823 12.3831 6.82295 12.1562 6.27711C11.9294 5.73127 11.5969 5.23564 11.1779 4.81867C11.1317 4.77098 11.0765 4.73297 11.0155 4.70686C10.9544 4.68075 10.8888 4.66705 10.8224 4.66657C10.756 4.66609 10.6902 4.67883 10.6288 4.70406C10.5674 4.72929 10.5116 4.76649 10.4647 4.8135C10.4179 4.86051 10.3808 4.91639 10.3558 4.97787C10.3307 5.03935 10.3181 5.10521 10.3188 5.17159C10.3195 5.23798 10.3334 5.30357 10.3597 5.36453C10.3859 5.42549 10.4241 5.48061 10.4719 5.52667C10.7977 5.85079 11.0562 6.23609 11.2326 6.66043C11.409 7.08477 11.4998 7.53979 11.4998 7.99934C11.4998 8.45888 11.409 8.9139 11.2326 9.33824C11.0562 9.76258 10.7977 10.1479 10.4719 10.472C10.4241 10.5181 10.3859 10.5732 10.3597 10.6341C10.3334 10.6951 10.3195 10.7607 10.3188 10.8271C10.3181 10.8935 10.3307 10.9593 10.3558 11.0208C10.3808 11.0823 10.4179 11.1382 10.4647 11.1852C10.5116 11.2322 10.5674 11.2694 10.6288 11.2946C10.6902 11.3198 10.756 11.3326 10.8224 11.3321C10.8888 11.3316 10.9544 11.3179 11.0155 11.2918C11.0765 11.2657 11.1317 11.2277 11.1779 11.18ZM12.7113 13.2127C12.6123 13.2126 12.5157 13.1832 12.4335 13.1281C12.3513 13.0731 12.2873 12.9949 12.2495 12.9035C12.2118 12.8121 12.202 12.7115 12.2214 12.6146C12.2408 12.5176 12.2886 12.4285 12.3586 12.3587C12.9317 11.7866 13.3865 11.1071 13.6967 10.359C14.0069 9.61101 14.1666 8.80915 14.1666 7.99934C14.1666 7.18952 14.0069 6.38766 13.6967 5.63963C13.3865 4.8916 12.9317 4.2121 12.3586 3.64C12.3122 3.59351 12.2754 3.53834 12.2503 3.47764C12.2252 3.41693 12.2124 3.35188 12.2124 3.2862C12.2125 3.22052 12.2255 3.15549 12.2507 3.09483C12.2759 3.03417 12.3128 2.97907 12.3593 2.93267C12.4057 2.88627 12.4609 2.84948 12.5216 2.8244C12.5823 2.79932 12.6474 2.78645 12.7131 2.78651C12.7787 2.78657 12.8438 2.79957 12.9044 2.82476C12.9651 2.84995 13.0202 2.88685 13.0666 2.93334C13.7327 3.59825 14.2612 4.38801 14.6218 5.25741C14.9824 6.12681 15.168 7.05879 15.168 8C15.168 8.94122 14.9824 9.87319 14.6218 10.7426C14.2612 11.612 13.7327 12.4018 13.0666 13.0667C13.02 13.1134 12.9646 13.1504 12.9036 13.1756C12.8426 13.2007 12.7772 13.2129 12.7113 13.2127Z",
1219
1180
  fill: "currentColor"
1220
- }, null, -1), lo = [
1221
- ro
1222
- ], ao = ["disabled"], co = /* @__PURE__ */ b("path", {
1181
+ }, null, -1), hi = [
1182
+ mi
1183
+ ], pi = ["disabled"], gi = /* @__PURE__ */ C("path", {
1223
1184
  "fill-rule": "evenodd",
1224
1185
  d: "M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z",
1225
1186
  "clip-rule": "evenodd",
1226
1187
  fill: "currentColor"
1227
- }, null, -1), uo = [
1228
- co
1229
- ], fo = {
1188
+ }, null, -1), vi = [
1189
+ gi
1190
+ ], bi = {
1230
1191
  __name: "Player",
1231
1192
  props: {
1232
1193
  tts: {
@@ -1240,158 +1201,158 @@ const Vn = /* @__PURE__ */ re(On, [["render", _n]]), Pn = { class: "flex flex-co
1240
1201
  },
1241
1202
  emits: ["loadTTS"],
1242
1203
  setup(e, { emit: t }) {
1243
- const n = e, o = t, i = B(() => n.tts), r = R(!1), s = new Audio(), a = new (window.AudioContext || window.webkitAudioContext)();
1204
+ const n = e, i = t, o = R(() => n.tts), s = k(!1), r = new Audio(), a = new (window.AudioContext || window.webkitAudioContext)();
1244
1205
  let l = null;
1245
- ue(
1246
- i,
1206
+ Q(
1207
+ o,
1247
1208
  () => {
1248
- if (!i.value) {
1249
- r.value = !1;
1209
+ if (!o.value) {
1210
+ s.value = !1;
1250
1211
  return;
1251
1212
  }
1252
1213
  u();
1253
1214
  },
1254
1215
  { immediate: !0 }
1255
- ), We(() => {
1256
- h(), s.src = "", a.close();
1216
+ ), qe(() => {
1217
+ g(), r.src = "", a.close();
1257
1218
  });
1258
1219
  function c() {
1259
- if (i.value) {
1220
+ if (o.value) {
1260
1221
  u();
1261
1222
  return;
1262
1223
  }
1263
- r.value = !0, o("loadTTS");
1224
+ s.value = !0, i("loadTTS");
1264
1225
  }
1265
1226
  async function u() {
1266
- if (i.value) {
1267
- r.value = !0;
1227
+ if (o.value) {
1228
+ s.value = !0;
1268
1229
  try {
1269
- s.src = i.value, s.playbackRate = 0.7, await s.play(), s.onended = () => {
1270
- r.value = !1;
1230
+ r.src = o.value, r.playbackRate = 0.7, await r.play(), r.onended = () => {
1231
+ s.value = !1;
1271
1232
  };
1272
1233
  } catch {
1273
- await d();
1234
+ await h();
1274
1235
  }
1275
1236
  }
1276
1237
  }
1277
- async function d() {
1238
+ async function h() {
1278
1239
  try {
1279
- const f = await (await fetch(i.value)).arrayBuffer(), v = await a.decodeAudioData(f);
1280
- l = a.createBufferSource(), l.buffer = v, l.playbackRate.value = 0.7, l.connect(a.destination), l.start(), l.onended = () => {
1281
- r.value = !1, l = null;
1240
+ const m = await (await fetch(o.value)).arrayBuffer(), w = await a.decodeAudioData(m);
1241
+ l = a.createBufferSource(), l.buffer = w, l.playbackRate.value = 0.7, l.connect(a.destination), l.start(), l.onended = () => {
1242
+ s.value = !1, l = null;
1282
1243
  };
1283
1244
  } catch {
1284
- r.value = !1;
1245
+ s.value = !1;
1285
1246
  }
1286
1247
  }
1287
- function h() {
1288
- l && (l.stop(), l.disconnect(), l = null), s.pause(), s.currentTime = 0, r.value = !1;
1248
+ function g() {
1249
+ l && (l.stop(), l.disconnect(), l = null), r.pause(), r.currentTime = 0, s.value = !1;
1289
1250
  }
1290
- return (m, f) => r.value ? (p(), w("button", {
1251
+ return (f, m) => s.value ? (p(), v("button", {
1291
1252
  key: 1,
1292
- class: k(["btn btn-xs btn-circle", [
1253
+ class: $(["btn btn-xs btn-circle", [
1293
1254
  { "btn-ghost": !e.disabled },
1294
1255
  { "!bg-transparent !border-none !shadow-none !ring-0": e.disabled }
1295
1256
  ]]),
1296
1257
  disabled: e.disabled,
1297
- onClick: h
1258
+ onClick: g
1298
1259
  }, [
1299
- (p(), w("svg", {
1300
- class: k(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1260
+ (p(), v("svg", {
1261
+ class: $(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1301
1262
  viewBox: "0 0 24 24",
1302
1263
  fill: "none",
1303
1264
  xmlns: "http://www.w3.org/2000/svg"
1304
- }, uo, 2))
1305
- ], 10, ao)) : (p(), w("button", {
1265
+ }, vi, 2))
1266
+ ], 10, pi)) : (p(), v("button", {
1306
1267
  key: 0,
1307
- class: k(["btn btn-xs btn-circle", [
1268
+ class: $(["btn btn-xs btn-circle", [
1308
1269
  { "btn-ghost": !e.disabled },
1309
1270
  { "!bg-transparent !border-none !shadow-none !ring-0": e.disabled }
1310
1271
  ]]),
1311
1272
  disabled: e.disabled,
1312
1273
  onClick: c
1313
1274
  }, [
1314
- (p(), w("svg", {
1315
- class: k(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1275
+ (p(), v("svg", {
1276
+ class: $(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1316
1277
  viewBox: "0 0 16 16",
1317
1278
  fill: "none",
1318
1279
  xmlns: "http://www.w3.org/2000/svg"
1319
- }, lo, 2))
1320
- ], 10, so));
1280
+ }, hi, 2))
1281
+ ], 10, fi));
1321
1282
  }
1322
- }, mo = {
1283
+ }, Ci = {
1323
1284
  class: "bg-base-100 tooltip tooltip-top before:!bottom-[100%] before:!bg-base-100 before:!border before:!border-solid before:!border-base-300 before:!shadow-lg before:!rounded-md before:!text-base-content after:!border-transparent",
1324
1285
  "data-tip": "Favorite"
1325
- }, ho = ["disabled"], po = /* @__PURE__ */ b("path", {
1286
+ }, wi = ["disabled"], yi = /* @__PURE__ */ C("path", {
1326
1287
  d: "M14.9491 5.89315C14.8278 5.53128 14.5111 5.27252 14.1226 5.21783L10.5264 4.7114L8.91813 1.55315C8.74435 1.21195 8.39257 1 7.99998 1C7.60739 1 7.25557 1.21195 7.08183 1.55315L5.47358 4.7114L1.8774 5.21783C1.48888 5.27252 1.17219 5.53128 1.05086 5.89315C0.929554 6.25501 1.02881 6.64477 1.30993 6.91038L3.91217 9.36871L3.29786 12.8399C3.2315 13.215 3.38755 13.5868 3.7052 13.8105C3.88128 13.9344 4.08938 14 4.30704 14C4.47232 14 4.63705 13.9606 4.78341 13.886L7.99995 12.2471L11.2165 13.886C11.3628 13.9606 11.5276 14 11.6929 14C11.9106 14 12.1187 13.9345 12.2948 13.8105C12.6124 13.5868 12.7685 13.215 12.7021 12.84L12.0878 9.36871L14.6901 6.91035C14.9712 6.64477 15.0704 6.25498 14.9491 5.89315ZM14.0266 6.25082L11.2455 8.87813C11.1335 8.98392 11.0824 9.13637 11.1089 9.28575L11.7654 12.9956C11.7701 13.0226 11.759 13.0493 11.7362 13.0653C11.7202 13.0766 11.7038 13.079 11.6929 13.079C11.6809 13.079 11.6694 13.0762 11.6587 13.0708L8.22108 11.3192C8.15189 11.284 8.07593 11.2663 7.99998 11.2663C7.92402 11.2663 7.84807 11.284 7.77882 11.3193L4.34118 13.0708C4.33052 13.0763 4.31904 13.079 4.30701 13.079C4.29611 13.079 4.27969 13.0767 4.26373 13.0654C4.24092 13.0494 4.22975 13.0226 4.2345 12.9957L4.89104 9.28584C4.91747 9.13646 4.86637 8.98401 4.75439 8.87822L1.97327 6.25091C1.95308 6.23184 1.94595 6.20383 1.95466 6.17786C1.9634 6.15185 1.98612 6.13326 2.01405 6.12933L5.85743 5.58807C6.0122 5.56626 6.14599 5.47208 6.21521 5.33616L7.93404 1.9608C7.94653 1.9363 7.97178 1.92107 7.99998 1.92107C8.02818 1.92107 8.05343 1.9363 8.06591 1.9608L9.78468 5.33607C9.85391 5.47199 9.9877 5.5662 10.1425 5.58799L13.9859 6.12924C14.0138 6.1332 14.0365 6.15176 14.0452 6.17777C14.0539 6.20374 14.0468 6.23175 14.0266 6.25082Z",
1327
1288
  fill: "currentColor"
1328
- }, null, -1), go = [
1329
- po
1330
- ], vo = /* @__PURE__ */ b("path", {
1289
+ }, null, -1), xi = [
1290
+ yi
1291
+ ], Li = /* @__PURE__ */ C("path", {
1331
1292
  d: "M7.47207 1.31905C7.57125 1.12371 7.77589 1 8.00001 1C8.22413 1 8.42877 1.12367 8.52795 1.31905L10.3721 4.95175L14.4959 5.53427C14.7177 5.5656 14.9019 5.7166 14.9712 5.9238C15.0404 6.13101 14.9827 6.35843 14.8222 6.51049L11.8382 9.33816L12.5427 13.3309C12.5806 13.5456 12.4897 13.7626 12.3084 13.8906C12.1272 14.0187 11.8868 14.0356 11.6884 13.9342L8.00004 12.0491L4.31158 13.9343C4.11323 14.0356 3.87286 14.0187 3.69157 13.8907C3.51028 13.7627 3.4195 13.5457 3.45736 13.3309L4.1618 9.33819L1.17781 6.51052C1.01735 6.35846 0.959571 6.13101 1.02884 5.92383C1.09807 5.71663 1.28232 5.56563 1.50409 5.53431L5.62787 4.95178L7.47207 1.31905Z",
1332
1293
  fill: "currentColor"
1333
- }, null, -1), Co = [
1334
- vo
1335
- ], bo = {
1294
+ }, null, -1), Ti = [
1295
+ Li
1296
+ ], Si = {
1336
1297
  __name: "Favorite",
1337
1298
  props: {
1338
1299
  isFilled: Boolean,
1339
1300
  disabled: Boolean
1340
1301
  },
1341
1302
  setup(e) {
1342
- return (t, n) => (p(), w("div", mo, [
1343
- b("button", {
1344
- class: k(["btn btn-xs btn-circle", [
1303
+ return (t, n) => (p(), v("div", Ci, [
1304
+ C("button", {
1305
+ class: $(["btn btn-xs btn-circle", [
1345
1306
  { "btn-ghost": !e.disabled },
1346
1307
  { "!bg-transparent !border-none !shadow-none !ring-0": e.disabled }
1347
1308
  ]]),
1348
1309
  disabled: e.disabled
1349
1310
  }, [
1350
- e.isFilled ? (p(), w("svg", {
1311
+ e.isFilled ? (p(), v("svg", {
1351
1312
  key: 1,
1352
- class: k(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1313
+ class: $(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1353
1314
  viewBox: "0 0 16 16",
1354
1315
  fill: "none",
1355
1316
  xmlns: "http://www.w3.org/2000/svg"
1356
- }, Co, 2)) : (p(), w("svg", {
1317
+ }, Ti, 2)) : (p(), v("svg", {
1357
1318
  key: 0,
1358
- class: k(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1319
+ class: $(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1359
1320
  viewBox: "0 0 16 16",
1360
1321
  fill: "none",
1361
1322
  xmlns: "http://www.w3.org/2000/svg"
1362
- }, go, 2))
1363
- ], 10, ho)
1323
+ }, xi, 2))
1324
+ ], 10, wi)
1364
1325
  ]));
1365
1326
  }
1366
- }, wo = {}, xo = {
1327
+ }, Ei = {}, Ai = {
1367
1328
  class: "w-6 h-6 text-primary",
1368
1329
  xmlns: "http://www.w3.org/2000/svg",
1369
1330
  viewBox: "0 0 24 24"
1370
- }, yo = /* @__PURE__ */ Ne('<circle cx="18" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".67" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".33" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="6" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin="0" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle>', 3), Lo = [
1371
- yo
1331
+ }, $i = /* @__PURE__ */ Xe('<circle cx="18" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".67" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".33" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="6" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin="0" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle>', 3), ki = [
1332
+ $i
1372
1333
  ];
1373
- function So(e, t) {
1374
- return p(), w("svg", xo, Lo);
1334
+ function Ri(e, t) {
1335
+ return p(), v("svg", Ai, ki);
1375
1336
  }
1376
- const St = /* @__PURE__ */ re(wo, [["render", So]]), Eo = {
1337
+ const Qe = /* @__PURE__ */ se(Ei, [["render", Ri]]), Ii = {
1377
1338
  class: "bg-base-100 tooltip tooltip-top before:!bottom-[100%] before:!bg-base-100 before:!border before:!border-solid before:!border-base-300 before:!shadow-lg before:!rounded-md before:!text-base-content after:!border-transparent",
1378
1339
  "data-tip": "AI Translate"
1379
- }, To = ["disabled"], $o = /* @__PURE__ */ b("path", {
1340
+ }, Bi = ["disabled"], Mi = /* @__PURE__ */ C("path", {
1380
1341
  d: "M6.8544 3.20309C5.39975 2.89815 4.26277 1.76117 3.95787 0.30649C3.92042 0.12792 3.76292 0 3.58041 0C3.3979 0 3.2404 0.12792 3.20297 0.30652C2.89805 1.76117 1.76107 2.89812 0.306418 3.20302C0.127818 3.24045 -0.00012207 3.39798 -0.00012207 3.58046C-0.00012207 3.76295 0.127798 3.92047 0.306418 3.9579C1.76105 4.26285 2.89798 5.3998 3.2029 6.85448C3.24033 7.03307 3.39783 7.16102 3.58034 7.16102C3.76282 7.16102 3.92035 7.0331 3.95778 6.85448C4.26272 5.39983 5.39973 4.26287 6.85438 3.95799C7.03297 3.92056 7.16092 3.76306 7.16092 3.58056C7.1609 3.39805 7.03297 3.24052 6.8544 3.20309ZM3.58036 5.60938C3.14292 4.73132 2.42956 4.01792 1.55151 3.58049C2.42958 3.14305 3.14297 2.42968 3.58041 1.55161C4.01785 2.4297 4.73122 3.14307 5.60926 3.58053C4.73119 4.01797 4.0178 4.73132 3.58036 5.60938Z",
1381
1342
  fill: "currentColor"
1382
- }, null, -1), Ao = /* @__PURE__ */ b("path", {
1343
+ }, null, -1), Oi = /* @__PURE__ */ C("path", {
1383
1344
  d: "M6.21683 9.574C5.53147 9.4303 4.99578 8.8947 4.85209 8.2093C4.81466 8.0307 4.65716 7.90271 4.47465 7.90271C4.29217 7.90271 4.13464 8.0306 4.09721 8.2092C3.95352 8.8946 3.4178 9.4303 2.73244 9.574C2.55385 9.6114 2.4259 9.7689 2.4259 9.9514C2.4259 10.1339 2.55383 10.2914 2.73244 10.3288C3.41778 10.4725 3.95349 11.0082 4.09716 11.6936C4.13459 11.8722 4.2921 12.0002 4.4746 12.0002C4.65709 12.0002 4.81461 11.8723 4.85204 11.6936C4.99574 11.0082 5.53145 10.4725 6.21683 10.3289C6.39543 10.2914 6.52337 10.1339 6.52337 9.9514C6.52337 9.7689 6.39545 9.6114 6.21683 9.574ZM4.47463 10.6408C4.29163 10.3688 4.05725 10.1345 3.78526 9.9515C4.0573 9.7684 4.29163 9.5341 4.47463 9.2621C4.65765 9.5341 4.892 9.7685 5.164 9.9515C4.892 10.1345 4.65763 10.3688 4.47463 10.6408Z",
1384
1345
  fill: "currentColor"
1385
- }, null, -1), ko = /* @__PURE__ */ b("path", {
1346
+ }, null, -1), Di = /* @__PURE__ */ C("path", {
1386
1347
  d: "M11.4271 6.00324C10.5007 5.80904 9.7766 5.08496 9.5825 4.15859C9.545 3.98 9.3875 3.85205 9.205 3.85205C9.0225 3.85205 8.865 3.97995 8.8276 4.15857C8.6334 5.08496 7.90932 5.80902 6.98293 6.0032C6.80434 6.04063 6.67639 6.19815 6.67639 6.38064C6.67639 6.56312 6.80431 6.72062 6.98293 6.75807C7.9093 6.95228 8.6334 7.67633 8.8275 8.6027C8.865 8.7813 9.0225 8.9093 9.205 8.9093C9.3875 8.9093 9.545 8.7814 9.5824 8.6027C9.7766 7.67633 10.5007 6.95228 11.4271 6.75812C11.6057 6.72067 11.7336 6.56317 11.7336 6.38068C11.7336 6.1982 11.6057 6.04067 11.4271 6.00324ZM9.205 7.47681C8.9365 7.02634 8.5593 6.64914 8.1089 6.38066C8.5593 6.11218 8.9365 5.73502 9.205 5.28453C9.4735 5.73502 9.8507 6.11221 10.3012 6.38068C9.8507 6.64916 9.4735 7.02636 9.205 7.47681Z",
1387
1348
  fill: "currentColor"
1388
- }, null, -1), Ro = [
1389
- $o,
1390
- Ao,
1391
- ko
1392
- ], Bo = /* @__PURE__ */ Ne('<path d="M6.8544 3.20309C5.39975 2.89815 4.26277 1.76117 3.95787 0.30649C3.92042 0.12792 3.76292 0 3.58041 0C3.3979 0 3.2404 0.12792 3.20297 0.30652C2.89805 1.76117 1.76107 2.89812 0.306418 3.20302C0.127818 3.24045 -0.00012207 3.39798 -0.00012207 3.58046C-0.00012207 3.76295 0.127798 3.92047 0.306418 3.9579C1.76105 4.26285 2.89798 5.3998 3.2029 6.85448C3.24033 7.03307 3.39783 7.16102 3.58034 7.16102C3.76282 7.16102 3.92035 7.0331 3.95778 6.85448C4.26272 5.39983 5.39973 4.26287 6.85438 3.95799C7.03297 3.92056 7.16092 3.76306 7.16092 3.58056C7.1609 3.39805 7.03297 3.24052 6.8544 3.20309ZM3.58036 5.60938C3.14292 4.73132 2.42956 4.01792 1.55151 3.58049C2.42958 3.14305 3.14297 2.42968 3.58041 1.55161C4.01785 2.4297 4.73122 3.14307 5.60926 3.58053C4.73119 4.01797 4.0178 4.73132 3.58036 5.60938Z" fill="currentColor"></path><path d="M6.21683 9.574C5.53147 9.4303 4.99578 8.8947 4.85209 8.2093C4.81466 8.0307 4.65716 7.90271 4.47465 7.90271C4.29217 7.90271 4.13464 8.0306 4.09721 8.2092C3.95352 8.8946 3.4178 9.4303 2.73244 9.574C2.55385 9.6114 2.4259 9.7689 2.4259 9.9514C2.4259 10.1339 2.55383 10.2914 2.73244 10.3288C3.41778 10.4725 3.95349 11.0082 4.09716 11.6936C4.13459 11.8722 4.2921 12.0002 4.4746 12.0002C4.65709 12.0002 4.81461 11.8723 4.85204 11.6936C4.99574 11.0082 5.53145 10.4725 6.21683 10.3289C6.39543 10.2914 6.52337 10.1339 6.52337 9.9514C6.52337 9.7689 6.39545 9.6114 6.21683 9.574ZM4.47463 10.6408C4.29163 10.3688 4.05725 10.1345 3.78526 9.9515C4.0573 9.7684 4.29163 9.5341 4.47463 9.2621C4.65765 9.5341 4.892 9.7685 5.164 9.9515C4.892 10.1345 4.65763 10.3688 4.47463 10.6408Z" fill="currentColor"></path><path d="M11.4271 6.00324C10.5007 5.80904 9.7766 5.08496 9.5825 4.15859C9.545 3.98 9.3875 3.85205 9.205 3.85205C9.0225 3.85205 8.865 3.97995 8.8276 4.15857C8.6334 5.08496 7.90932 5.80902 6.98293 6.0032C6.80434 6.04063 6.67639 6.19815 6.67639 6.38064C6.67639 6.56312 6.80431 6.72062 6.98293 6.75807C7.9093 6.95228 8.6334 7.67633 8.8275 8.6027C8.865 8.7813 9.0225 8.9093 9.205 8.9093C9.3875 8.9093 9.545 8.7814 9.5824 8.6027C9.7766 7.67633 10.5007 6.95228 11.4271 6.75812C11.6057 6.72067 11.7336 6.56317 11.7336 6.38068C11.7336 6.1982 11.6057 6.04067 11.4271 6.00324ZM9.205 7.47681C8.9365 7.02634 8.5593 6.64914 8.1089 6.38066C8.5593 6.11218 8.9365 5.73502 9.205 5.28453C9.4735 5.73502 9.8507 6.11221 10.3012 6.38068C9.8507 6.64916 9.4735 7.02636 9.205 7.47681Z" fill="currentColor"></path><circle cx="3.5" cy="3.5" r="1.5" fill="currentColor"></circle><ellipse cx="4.5" cy="10" rx="0.5" ry="1" fill="currentColor"></ellipse><circle cx="9" cy="6" r="1" fill="currentColor"></circle>', 6), Io = [
1393
- Bo
1394
- ], Mo = {
1349
+ }, null, -1), Fi = [
1350
+ Mi,
1351
+ Oi,
1352
+ Di
1353
+ ], Wi = /* @__PURE__ */ Xe('<path d="M6.8544 3.20309C5.39975 2.89815 4.26277 1.76117 3.95787 0.30649C3.92042 0.12792 3.76292 0 3.58041 0C3.3979 0 3.2404 0.12792 3.20297 0.30652C2.89805 1.76117 1.76107 2.89812 0.306418 3.20302C0.127818 3.24045 -0.00012207 3.39798 -0.00012207 3.58046C-0.00012207 3.76295 0.127798 3.92047 0.306418 3.9579C1.76105 4.26285 2.89798 5.3998 3.2029 6.85448C3.24033 7.03307 3.39783 7.16102 3.58034 7.16102C3.76282 7.16102 3.92035 7.0331 3.95778 6.85448C4.26272 5.39983 5.39973 4.26287 6.85438 3.95799C7.03297 3.92056 7.16092 3.76306 7.16092 3.58056C7.1609 3.39805 7.03297 3.24052 6.8544 3.20309ZM3.58036 5.60938C3.14292 4.73132 2.42956 4.01792 1.55151 3.58049C2.42958 3.14305 3.14297 2.42968 3.58041 1.55161C4.01785 2.4297 4.73122 3.14307 5.60926 3.58053C4.73119 4.01797 4.0178 4.73132 3.58036 5.60938Z" fill="currentColor"></path><path d="M6.21683 9.574C5.53147 9.4303 4.99578 8.8947 4.85209 8.2093C4.81466 8.0307 4.65716 7.90271 4.47465 7.90271C4.29217 7.90271 4.13464 8.0306 4.09721 8.2092C3.95352 8.8946 3.4178 9.4303 2.73244 9.574C2.55385 9.6114 2.4259 9.7689 2.4259 9.9514C2.4259 10.1339 2.55383 10.2914 2.73244 10.3288C3.41778 10.4725 3.95349 11.0082 4.09716 11.6936C4.13459 11.8722 4.2921 12.0002 4.4746 12.0002C4.65709 12.0002 4.81461 11.8723 4.85204 11.6936C4.99574 11.0082 5.53145 10.4725 6.21683 10.3289C6.39543 10.2914 6.52337 10.1339 6.52337 9.9514C6.52337 9.7689 6.39545 9.6114 6.21683 9.574ZM4.47463 10.6408C4.29163 10.3688 4.05725 10.1345 3.78526 9.9515C4.0573 9.7684 4.29163 9.5341 4.47463 9.2621C4.65765 9.5341 4.892 9.7685 5.164 9.9515C4.892 10.1345 4.65763 10.3688 4.47463 10.6408Z" fill="currentColor"></path><path d="M11.4271 6.00324C10.5007 5.80904 9.7766 5.08496 9.5825 4.15859C9.545 3.98 9.3875 3.85205 9.205 3.85205C9.0225 3.85205 8.865 3.97995 8.8276 4.15857C8.6334 5.08496 7.90932 5.80902 6.98293 6.0032C6.80434 6.04063 6.67639 6.19815 6.67639 6.38064C6.67639 6.56312 6.80431 6.72062 6.98293 6.75807C7.9093 6.95228 8.6334 7.67633 8.8275 8.6027C8.865 8.7813 9.0225 8.9093 9.205 8.9093C9.3875 8.9093 9.545 8.7814 9.5824 8.6027C9.7766 7.67633 10.5007 6.95228 11.4271 6.75812C11.6057 6.72067 11.7336 6.56317 11.7336 6.38068C11.7336 6.1982 11.6057 6.04067 11.4271 6.00324ZM9.205 7.47681C8.9365 7.02634 8.5593 6.64914 8.1089 6.38066C8.5593 6.11218 8.9365 5.73502 9.205 5.28453C9.4735 5.73502 9.8507 6.11221 10.3012 6.38068C9.8507 6.64916 9.4735 7.02636 9.205 7.47681Z" fill="currentColor"></path><circle cx="3.5" cy="3.5" r="1.5" fill="currentColor"></circle><ellipse cx="4.5" cy="10" rx="0.5" ry="1" fill="currentColor"></ellipse><circle cx="9" cy="6" r="1" fill="currentColor"></circle>', 6), _i = [
1354
+ Wi
1355
+ ], zi = {
1395
1356
  __name: "AITranslateBtn",
1396
1357
  props: {
1397
1358
  isLoading: Boolean,
@@ -1399,58 +1360,58 @@ const St = /* @__PURE__ */ re(wo, [["render", So]]), Eo = {
1399
1360
  isFilled: Boolean
1400
1361
  },
1401
1362
  setup(e) {
1402
- return (t, n) => (p(), w("div", Eo, [
1403
- e.isLoading ? (p(), N(St, {
1363
+ return (t, n) => (p(), v("div", Ii, [
1364
+ e.isLoading ? (p(), W(Qe, {
1404
1365
  key: 0,
1405
1366
  class: "inset-0 flex items-center justify-center"
1406
- })) : (p(), w("button", {
1367
+ })) : (p(), v("button", {
1407
1368
  key: 1,
1408
- class: k(["btn btn-xs btn-circle", [
1369
+ class: $(["btn btn-xs btn-circle", [
1409
1370
  { "btn-ghost": !e.disabled },
1410
1371
  { "!bg-transparent !border-none !shadow-none !ring-0": e.disabled }
1411
1372
  ]]),
1412
1373
  disabled: e.disabled
1413
1374
  }, [
1414
- e.isFilled ? (p(), w("svg", {
1375
+ e.isFilled ? (p(), v("svg", {
1415
1376
  key: 1,
1416
- class: k(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1377
+ class: $(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1417
1378
  viewBox: "0 0 12 12",
1418
1379
  fill: "none",
1419
1380
  xmlns: "http://www.w3.org/2000/svg"
1420
- }, Io, 2)) : (p(), w("svg", {
1381
+ }, _i, 2)) : (p(), v("svg", {
1421
1382
  key: 0,
1422
- class: k(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1383
+ class: $(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1423
1384
  viewBox: "0 0 12 12",
1424
1385
  fill: "none",
1425
1386
  xmlns: "http://www.w3.org/2000/svg"
1426
- }, Ro, 2))
1427
- ], 10, To))
1387
+ }, Fi, 2))
1388
+ ], 10, Bi))
1428
1389
  ]));
1429
1390
  }
1430
- }, Do = {
1391
+ }, Pi = {
1431
1392
  class: "bg-base-100 tooltip tooltip-top before:!bottom-[100%] before:!bg-base-100 before:!border before:!border-solid before:!border-base-300 before:!shadow-lg before:!rounded-md before:!text-base-content after:!border-transparent",
1432
1393
  "data-tip": "AI Summarize"
1433
- }, Oo = ["disabled"], Fo = /* @__PURE__ */ b("path", {
1394
+ }, Vi = ["disabled"], Ni = /* @__PURE__ */ C("path", {
1434
1395
  stroke: "currentColor",
1435
1396
  "stroke-linecap": "round",
1436
1397
  "stroke-linejoin": "round",
1437
1398
  "stroke-width": "2",
1438
1399
  d: "M21 12h1m-3.5-6.5 1-1M12 3V2M5.5 5.5l-1-1M3 12H2m8 10h4m3-10a5 5 0 1 0-7 4.584V19h4v-2.416A5.001 5.001 0 0 0 17 12z"
1439
- }, null, -1), zo = [
1440
- Fo
1441
- ], _o = /* @__PURE__ */ b("path", {
1400
+ }, null, -1), Hi = [
1401
+ Ni
1402
+ ], Ui = /* @__PURE__ */ C("path", {
1442
1403
  fill: "currentColor",
1443
1404
  d: "M12 7a5 5 0 0 0-2 9.584V19h4v-2.416A5.001 5.001 0 0 0 12 7z"
1444
- }, null, -1), Vo = /* @__PURE__ */ b("path", {
1405
+ }, null, -1), Zi = /* @__PURE__ */ C("path", {
1445
1406
  stroke: "currentColor",
1446
1407
  "stroke-linecap": "round",
1447
1408
  "stroke-linejoin": "round",
1448
1409
  "stroke-width": "2",
1449
1410
  d: "M21 12h1m-3.5-6.5 1-1M12 3V2M5.5 5.5l-1-1M3 12H2m8 10h4m3-10a5 5 0 1 0-7 4.584V19h4v-2.416A5.001 5.001 0 0 0 17 12z"
1450
- }, null, -1), Po = [
1451
- _o,
1452
- Vo
1453
- ], Ho = {
1411
+ }, null, -1), ji = [
1412
+ Ui,
1413
+ Zi
1414
+ ], Xi = {
1454
1415
  __name: "AIExplainBtn",
1455
1416
  props: {
1456
1417
  isLoading: Boolean,
@@ -1458,76 +1419,76 @@ const St = /* @__PURE__ */ re(wo, [["render", So]]), Eo = {
1458
1419
  isFilled: Boolean
1459
1420
  },
1460
1421
  setup(e) {
1461
- return (t, n) => (p(), w("div", Do, [
1462
- e.isLoading ? (p(), N(St, { key: 0 })) : (p(), w("button", {
1422
+ return (t, n) => (p(), v("div", Pi, [
1423
+ e.isLoading ? (p(), W(Qe, { key: 0 })) : (p(), v("button", {
1463
1424
  key: 1,
1464
- class: k(["btn btn-xs btn-circle", [
1425
+ class: $(["btn btn-xs btn-circle", [
1465
1426
  { "btn-ghost": !e.disabled },
1466
1427
  { "!bg-transparent !border-none !shadow-none !ring-0": e.disabled }
1467
1428
  ]]),
1468
1429
  disabled: e.disabled
1469
1430
  }, [
1470
- e.isFilled ? (p(), w("svg", {
1431
+ e.isFilled ? (p(), v("svg", {
1471
1432
  key: 1,
1472
- class: k(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1433
+ class: $(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1473
1434
  viewBox: "0 0 24 24",
1474
1435
  fill: "none",
1475
1436
  xmlns: "http://www.w3.org/2000/svg"
1476
- }, Po, 2)) : (p(), w("svg", {
1437
+ }, ji, 2)) : (p(), v("svg", {
1477
1438
  key: 0,
1478
- class: k(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1439
+ class: $(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform": e.disabled }]]),
1479
1440
  viewBox: "0 0 24 24",
1480
1441
  fill: "none",
1481
1442
  xmlns: "http://www.w3.org/2000/svg"
1482
- }, zo, 2))
1483
- ], 10, Oo))
1443
+ }, Hi, 2))
1444
+ ], 10, Vi))
1484
1445
  ]));
1485
1446
  }
1486
- }, No = {}, Wo = { class: "btn btn-xs btn-ghost btn-circle" }, Uo = /* @__PURE__ */ b("svg", {
1447
+ }, qi = {}, Yi = { class: "btn btn-xs btn-ghost btn-circle" }, Gi = /* @__PURE__ */ C("svg", {
1487
1448
  class: "w-4 h-4 text-primary",
1488
1449
  viewBox: "0 0 24 24",
1489
1450
  fill: "none",
1490
1451
  xmlns: "http://www.w3.org/2000/svg"
1491
1452
  }, [
1492
- /* @__PURE__ */ b("path", {
1453
+ /* @__PURE__ */ C("path", {
1493
1454
  d: "M9.12596 1.63869C9.46935 1.54364 9.83221 1.70329 9.99413 2.02068C10.3672 2.75191 11.1261 3.25 12 3.25C12.8739 3.25 13.6328 2.75191 14.0059 2.02068C14.1678 1.70329 14.5307 1.54364 14.874 1.63869C16.5585 2.10497 18.0759 2.9704 19.3184 4.12574C19.5611 4.35137 19.6269 4.70948 19.4804 5.00666C19.3331 5.30535 19.25 5.6419 19.25 6C19.25 7.24263 20.2574 8.25 21.5 8.25L21.5314 8.24977C21.8629 8.24504 22.1583 8.45859 22.2576 8.77495C22.5777 9.79397 22.75 10.8776 22.75 12C22.75 12.7408 22.6749 13.4649 22.5318 14.1648C22.4548 14.5411 22.1059 14.7985 21.7237 14.7609C21.6504 14.7537 21.5758 14.75 21.5 14.75C20.2574 14.75 19.25 15.7574 19.25 17C19.25 17.5531 19.4486 18.0579 19.7793 18.4498C20.027 18.7434 20.0128 19.1767 19.7465 19.4535C18.4777 20.7719 16.8745 21.7678 15.0721 22.3044C14.6807 22.4209 14.2681 22.2029 14.1437 21.814C13.8535 20.906 13.0024 20.25 12 20.25C10.9976 20.25 10.1465 20.906 9.85629 21.814C9.73195 22.2029 9.31927 22.4209 8.92789 22.3044C7.12545 21.7678 5.52229 20.7719 4.25353 19.4535C3.98716 19.1767 3.97299 18.7434 4.22072 18.4498C4.55139 18.0579 4.75 17.5531 4.75 17C4.75 15.7574 3.74264 14.75 2.5 14.75C2.42423 14.75 2.34963 14.7537 2.27634 14.7609C1.89406 14.7985 1.54519 14.5411 1.46821 14.1648C1.32505 13.4649 1.25 12.7408 1.25 12C1.25 10.8776 1.42227 9.79398 1.74236 8.77494C1.84173 8.45859 2.13705 8.24504 2.4686 8.24977L2.5 8.25C3.74264 8.25 4.75 7.24263 4.75 6C4.75 5.6419 4.66689 5.30535 4.51962 5.00666C4.3731 4.70948 4.43894 4.35137 4.68159 4.12574C5.92411 2.9704 7.44153 2.10497 9.12596 1.63869ZM6.08277 4.88991C6.19152 5.24123 6.25 5.61424 6.25 6C6.25 7.88945 4.85261 9.45253 3.03493 9.71213C2.84898 10.4432 2.75 11.2096 2.75 12C2.75 12.4294 2.77921 12.8516 2.83567 13.2648C4.74948 13.4346 6.25 15.0421 6.25 17C6.25 17.6669 6.0754 18.2941 5.76971 18.8372C6.62645 19.6184 7.63002 20.2404 8.73362 20.657C9.37706 19.5189 10.598 18.75 12 18.75C13.402 18.75 14.6229 19.5189 15.2664 20.657C16.37 20.2404 17.3735 19.6184 18.2303 18.8372C17.9246 18.2941 17.75 17.6669 17.75 17C17.75 15.0421 19.2505 13.4346 21.1643 13.2648C21.2208 12.8516 21.25 12.4294 21.25 12C21.25 11.2096 21.151 10.4432 20.9651 9.71213C19.1474 9.45252 17.75 7.88945 17.75 6C17.75 5.61424 17.8085 5.24123 17.9172 4.88991C17.0618 4.1771 16.0762 3.61614 15.0018 3.24775C14.3184 4.15897 13.2287 4.75 12 4.75C10.7713 4.75 9.68158 4.15897 8.99819 3.24775C7.92382 3.61614 6.93823 4.1771 6.08277 4.88991Z",
1494
1455
  fill: "currentColor"
1495
1456
  }),
1496
- /* @__PURE__ */ b("path", {
1457
+ /* @__PURE__ */ C("path", {
1497
1458
  d: "M7.75 12C7.75 9.65278 9.65279 7.75 12 7.75C14.3472 7.75 16.25 9.65278 16.25 12C16.25 14.3472 14.3472 16.25 12 16.25C9.65279 16.25 7.75 14.3472 7.75 12ZM12 9.25C10.4812 9.25 9.25 10.4812 9.25 12C9.25 13.5188 10.4812 14.75 12 14.75C13.5188 14.75 14.75 13.5188 14.75 12C14.75 10.4812 13.5188 9.25 12 9.25Z",
1498
1459
  fill: "currentColor"
1499
1460
  })
1500
- ], -1), Zo = [
1501
- Uo
1461
+ ], -1), Ki = [
1462
+ Gi
1502
1463
  ];
1503
- function jo(e, t) {
1504
- return p(), w("button", Wo, Zo);
1464
+ function Ji(e, t) {
1465
+ return p(), v("button", Yi, Ki);
1505
1466
  }
1506
- const Xo = /* @__PURE__ */ re(No, [["render", jo]]), Yo = {}, Ko = { class: "btn btn-xs btn-circle btn-ghost" }, Go = /* @__PURE__ */ b("svg", {
1467
+ const Qi = /* @__PURE__ */ se(qi, [["render", Ji]]), eo = {}, to = { class: "btn btn-xs btn-circle btn-ghost" }, no = /* @__PURE__ */ C("svg", {
1507
1468
  class: "w-4 h-4 text-primary",
1508
1469
  viewBox: "0 0 16 16",
1509
1470
  fill: "none",
1510
1471
  xmlns: "http://www.w3.org/2000/svg"
1511
1472
  }, [
1512
- /* @__PURE__ */ b("path", {
1473
+ /* @__PURE__ */ C("path", {
1513
1474
  "fill-rule": "evenodd",
1514
1475
  "clip-rule": "evenodd",
1515
1476
  d: "M3.19102 3.19102C3.44571 2.93633 3.85864 2.93633 4.11333 3.19102L12.809 11.8867C13.0637 12.1414 13.0637 12.5543 12.809 12.809C12.5543 13.0637 12.1414 13.0637 11.8867 12.809L3.19102 4.11333C2.93633 3.85864 2.93633 3.44571 3.19102 3.19102Z",
1516
1477
  fill: "currentColor"
1517
1478
  }),
1518
- /* @__PURE__ */ b("path", {
1479
+ /* @__PURE__ */ C("path", {
1519
1480
  "fill-rule": "evenodd",
1520
1481
  "clip-rule": "evenodd",
1521
1482
  d: "M12.809 3.19102C13.0637 3.44571 13.0637 3.85864 12.809 4.11333L4.11333 12.809C3.85864 13.0637 3.44571 13.0637 3.19102 12.809C2.93633 12.5543 2.93633 12.1414 3.19102 11.8867L11.8867 3.19102C12.1414 2.93633 12.5543 2.93633 12.809 3.19102Z",
1522
1483
  fill: "currentColor"
1523
1484
  })
1524
- ], -1), qo = [
1525
- Go
1485
+ ], -1), io = [
1486
+ no
1526
1487
  ];
1527
- function Jo(e, t) {
1528
- return p(), w("button", Ko, qo);
1488
+ function oo(e, t) {
1489
+ return p(), v("button", to, io);
1529
1490
  }
1530
- const Qo = /* @__PURE__ */ re(Yo, [["render", Jo]]), ei = {
1491
+ const ro = /* @__PURE__ */ se(eo, [["render", oo]]), so = {
1531
1492
  name: "ThemeSelector",
1532
1493
  props: {
1533
1494
  currentTheme: {
@@ -1564,55 +1525,61 @@ const Qo = /* @__PURE__ */ re(Yo, [["render", Jo]]), ei = {
1564
1525
  });
1565
1526
  }
1566
1527
  }
1567
- }, ti = { class: "dropdown dropdown-end z-50" }, ni = /* @__PURE__ */ b("div", {
1528
+ }, lo = { class: "dropdown dropdown-end z-50" }, ao = /* @__PURE__ */ C("div", {
1568
1529
  tabindex: "0",
1569
1530
  role: "button",
1570
1531
  class: "btn btn-ghost btn-circle btn-xs"
1571
1532
  }, [
1572
- /* @__PURE__ */ b("svg", {
1533
+ /* @__PURE__ */ C("svg", {
1573
1534
  class: "w-4 h-4 text-primary",
1574
1535
  fill: "currentColor",
1575
1536
  viewBox: "0 0 20 20"
1576
1537
  }, [
1577
- /* @__PURE__ */ b("path", { d: "M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z" })
1538
+ /* @__PURE__ */ C("path", { d: "M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z" })
1578
1539
  ])
1579
- ], -1), oi = {
1540
+ ], -1), co = {
1580
1541
  tabindex: "0",
1581
1542
  class: "dropdown-content menu p-2 shadow bg-base-100 rounded-box w-52 max-h-96 overflow-y-auto z-50 border border-base-300"
1582
- }, ii = ["id", "value", "checked", "onChange"], si = ["for"], ri = { class: "flex items-center gap-2" };
1583
- function li(e, t, n, o, i, r) {
1584
- return p(), w("div", ti, [
1585
- ni,
1586
- b("ul", oi, [
1587
- (p(!0), w(be, null, Re(i.availableThemes, (s) => (p(), w("li", {
1588
- key: s.value
1543
+ }, uo = ["id", "value", "checked", "onChange"], fo = ["for"], mo = { class: "flex items-center gap-2" };
1544
+ function ho(e, t, n, i, o, s) {
1545
+ return p(), v("div", lo, [
1546
+ ao,
1547
+ C("ul", co, [
1548
+ (p(!0), v(K, null, me(o.availableThemes, (r) => (p(), v("li", {
1549
+ key: r.value
1589
1550
  }, [
1590
- b("input", {
1551
+ C("input", {
1591
1552
  type: "radio",
1592
- id: `theme-${s.value}`,
1593
- value: s.value,
1594
- checked: n.currentTheme === s.value,
1595
- onChange: (a) => r.handleThemeChange(s.value),
1553
+ id: `theme-${r.value}`,
1554
+ value: r.value,
1555
+ checked: n.currentTheme === r.value,
1556
+ onChange: (a) => s.handleThemeChange(r.value),
1596
1557
  class: "theme-controller sr-only"
1597
- }, null, 40, ii),
1598
- b("label", {
1599
- for: `theme-${s.value}`,
1600
- class: k(["cursor-pointer rounded-lg px-2 py-1 hover:bg-base-200", { "bg-primary text-primary-content": n.currentTheme === s.value }]),
1601
- onClick: t[0] || (t[0] = (...a) => r.handleLabelClick && r.handleLabelClick(...a))
1558
+ }, null, 40, uo),
1559
+ C("label", {
1560
+ for: `theme-${r.value}`,
1561
+ class: $(["cursor-pointer rounded-lg px-2 py-1 hover:bg-base-200", { "bg-primary text-primary-content": n.currentTheme === r.value }]),
1562
+ onClick: t[0] || (t[0] = (...a) => s.handleLabelClick && s.handleLabelClick(...a))
1602
1563
  }, [
1603
- b("span", ri, [
1604
- b("span", {
1564
+ C("span", mo, [
1565
+ C("span", {
1605
1566
  class: "w-3 h-3 rounded-full",
1606
- style: Pe({ backgroundColor: s.color })
1567
+ style: Ze({ backgroundColor: r.color })
1607
1568
  }, null, 4),
1608
- ve(" " + ge(s.name), 1)
1569
+ be(" " + ne(r.name), 1)
1609
1570
  ])
1610
- ], 10, si)
1571
+ ], 10, fo)
1611
1572
  ]))), 128))
1612
1573
  ])
1613
1574
  ]);
1614
1575
  }
1615
- const ai = /* @__PURE__ */ re(ei, [["render", li]]), ci = { class: "flex flex-col" }, ui = { class: "flex justify-start items-center" }, di = { class: "flex items-center gap-1" }, fi = /* @__PURE__ */ b("div", { class: "w-5" }, null, -1), mi = { class: "flex justify-end items-center" }, lt = {
1576
+ const po = /* @__PURE__ */ se(so, [["render", ho]]), go = { class: "flex flex-col" }, vo = {
1577
+ class: "flex min-w-0 gap-1",
1578
+ "data-mode-toggle": ""
1579
+ }, bo = ["disabled"], Co = { class: "flex shrink-0 items-center" }, wo = {
1580
+ key: 0,
1581
+ class: "flex items-center gap-1 px-2 pb-1"
1582
+ }, dt = {
1616
1583
  __name: "Header",
1617
1584
  props: {
1618
1585
  tts: String,
@@ -1632,6 +1599,14 @@ const ai = /* @__PURE__ */ re(ei, [["render", li]]), ci = { class: "flex flex-co
1632
1599
  showThemeSelector: {
1633
1600
  type: Boolean,
1634
1601
  default: !0
1602
+ },
1603
+ mode: {
1604
+ type: String,
1605
+ default: "translate"
1606
+ },
1607
+ canWrite: {
1608
+ type: Boolean,
1609
+ default: !0
1635
1610
  }
1636
1611
  },
1637
1612
  emits: [
@@ -1642,117 +1617,273 @@ const ai = /* @__PURE__ */ re(ei, [["render", li]]), ci = { class: "flex flex-co
1642
1617
  "aiTranslate",
1643
1618
  "aiExplain",
1644
1619
  "themeChange",
1645
- "dragStart"
1620
+ "dragStart",
1621
+ "requestTranslate",
1622
+ "requestWrite"
1646
1623
  ],
1647
1624
  setup(e, { emit: t }) {
1648
- const n = e, o = t, i = (s) => {
1649
- s.target.closest('button, input, select, textarea, [role="button"]') || (o("dragStart", { type: "mouse", event: s }), s.preventDefault());
1650
- }, r = (s) => {
1651
- s.target.closest('button, input, select, textarea, [role="button"]') || (o("dragStart", { type: "touch", event: s }), s.preventDefault());
1625
+ const n = e, i = R(() => n.mode !== "write" && !n.isServiceUnavailable), o = t, s = (a) => {
1626
+ a.target.closest('button, input, select, textarea, [role="button"]') || (o("dragStart", { type: "mouse", event: a }), a.preventDefault());
1627
+ }, r = (a) => {
1628
+ a.target.closest('button, input, select, textarea, [role="button"]') || (o("dragStart", { type: "touch", event: a }), a.preventDefault());
1652
1629
  };
1653
- return (s, a) => (p(), w("div", ci, [
1654
- b("div", {
1655
- class: "flex p-2 pt-2 pb-1 flex-row justify-between cursor-grab active:cursor-grabbing",
1656
- onMousedown: i,
1630
+ return (a, l) => (p(), v("div", go, [
1631
+ C("div", {
1632
+ class: "flex cursor-grab flex-row items-center justify-between gap-1 p-2 pb-1 active:cursor-grabbing",
1633
+ onMousedown: s,
1657
1634
  onTouchstart: r
1658
1635
  }, [
1659
- b("div", ui, [
1660
- e.isServiceUnavailable ? M("", !0) : (p(), N(fo, {
1661
- key: 0,
1662
- disabled: e.isAITranslationLoading || e.isAIExplainLoading,
1663
- tts: n.tts,
1664
- onLoadTTS: a[0] || (a[0] = (l) => s.$emit("loadTTS"))
1665
- }, null, 8, ["disabled", "tts"]))
1636
+ C("div", vo, [
1637
+ C("button", {
1638
+ type: "button",
1639
+ class: $(["btn btn-xs", e.mode === "write" ? "btn-ghost" : "btn-primary"]),
1640
+ "data-mode": "translate",
1641
+ onClick: l[0] || (l[0] = (c) => o("requestTranslate"))
1642
+ }, " Translate ", 2),
1643
+ C("button", {
1644
+ type: "button",
1645
+ class: $(["btn btn-xs", e.mode === "write" ? "btn-primary" : "btn-ghost"]),
1646
+ disabled: !e.canWrite,
1647
+ "data-mode": "write",
1648
+ onClick: l[1] || (l[1] = (c) => o("requestWrite"))
1649
+ }, " Write ", 10, bo)
1666
1650
  ]),
1667
- b("div", di, [
1668
- fi,
1669
- !e.isServiceUnavailable && e.isAITranslateVisible ? (p(), N(Mo, {
1670
- key: 0,
1671
- isLoading: e.isAITranslationLoading,
1672
- isFilled: e.isAITranslate,
1673
- onClick: a[1] || (a[1] = (l) => o("aiTranslate"))
1674
- }, null, 8, ["isLoading", "isFilled"])) : M("", !0),
1675
- !e.isServiceUnavailable && e.isAIExplainVisible ? (p(), N(Ho, {
1676
- key: 1,
1677
- isLoading: e.isAIExplainLoading,
1678
- isFilled: e.isAIExplain,
1679
- onClick: a[2] || (a[2] = (l) => o("aiExplain"))
1680
- }, null, 8, ["isLoading", "isFilled"])) : M("", !0),
1681
- !e.isServiceUnavailable && n.isFavoriteFeatureEnabled ? (p(), N(bo, {
1682
- key: 2,
1683
- isFilled: n.isFavorite,
1684
- onClick: a[3] || (a[3] = (l) => o("favorite")),
1685
- disabled: e.isAITranslationLoading || e.isAIExplainLoading
1686
- }, null, 8, ["isFilled", "disabled"])) : M("", !0)
1687
- ]),
1688
- b("div", mi, [
1689
- e.showThemeSelector ? (p(), N(ai, {
1651
+ C("div", Co, [
1652
+ e.showThemeSelector ? (p(), W(po, {
1690
1653
  key: 0,
1691
1654
  "current-theme": e.theme,
1692
- onThemeChange: a[4] || (a[4] = (l) => o("themeChange", l))
1655
+ onThemeChange: l[2] || (l[2] = (c) => o("themeChange", c))
1693
1656
  }, null, 8, ["current-theme"])) : M("", !0),
1694
- H(Xo, {
1695
- onClick: a[5] || (a[5] = (l) => o("setting"))
1657
+ O(Qi, {
1658
+ onClick: l[3] || (l[3] = (c) => o("setting"))
1696
1659
  }),
1697
- H(Qo, {
1698
- onClick: a[6] || (a[6] = (l) => o("close"))
1660
+ O(ro, {
1661
+ onClick: l[4] || (l[4] = (c) => o("close"))
1699
1662
  })
1700
1663
  ])
1701
- ], 32)
1664
+ ], 32),
1665
+ i.value ? (p(), v("div", wo, [
1666
+ O(bi, {
1667
+ disabled: e.isAITranslationLoading || e.isAIExplainLoading,
1668
+ tts: n.tts,
1669
+ onLoadTTS: l[5] || (l[5] = (c) => a.$emit("loadTTS"))
1670
+ }, null, 8, ["disabled", "tts"]),
1671
+ e.isAITranslateVisible ? (p(), W(zi, {
1672
+ key: 0,
1673
+ isLoading: e.isAITranslationLoading,
1674
+ isFilled: e.isAITranslate,
1675
+ onClick: l[6] || (l[6] = (c) => o("aiTranslate"))
1676
+ }, null, 8, ["isLoading", "isFilled"])) : M("", !0),
1677
+ e.isAIExplainVisible ? (p(), W(Xi, {
1678
+ key: 1,
1679
+ isLoading: e.isAIExplainLoading,
1680
+ isFilled: e.isAIExplain,
1681
+ onClick: l[7] || (l[7] = (c) => o("aiExplain"))
1682
+ }, null, 8, ["isLoading", "isFilled"])) : M("", !0),
1683
+ n.isFavoriteFeatureEnabled ? (p(), W(Si, {
1684
+ key: 2,
1685
+ isFilled: n.isFavorite,
1686
+ onClick: l[8] || (l[8] = (c) => o("favorite")),
1687
+ disabled: e.isAITranslationLoading || e.isAIExplainLoading
1688
+ }, null, 8, ["isFilled", "disabled"])) : M("", !0)
1689
+ ])) : M("", !0)
1702
1690
  ]));
1703
1691
  }
1704
- }, hi = /* @__PURE__ */ b("svg", {
1705
- class: "mb-1 mr-1 h-3 w-3",
1706
- viewBox: "0 0 12 12",
1707
- fill: "none",
1708
- "aria-hidden": "true"
1709
- }, [
1710
- /* @__PURE__ */ b("path", {
1711
- d: "M10.5 4.5v6h-6",
1712
- stroke: "currentColor",
1713
- "stroke-width": "1.5",
1714
- "stroke-linecap": "round"
1715
- }),
1716
- /* @__PURE__ */ b("path", {
1717
- d: "M10.5 7.5v3h-3",
1718
- stroke: "currentColor",
1719
- "stroke-width": "1.5",
1720
- "stroke-linecap": "round"
1721
- })
1722
- ], -1), pi = [
1723
- hi
1724
- ], gi = {
1692
+ }, yo = { class: "pointer-events-none absolute inset-0 z-20" }, xo = ["data-resize", "aria-label", "onPointerdown"], Lo = {
1725
1693
  __name: "ResizeHandle",
1726
- emits: ["resizeStart", "resizeReset"],
1694
+ emits: ["resizeStart"],
1727
1695
  setup(e, { emit: t }) {
1728
- const n = t, o = (i) => {
1729
- var r, s;
1730
- i.pointerType === "mouse" && i.button !== 0 || (i.preventDefault(), i.stopPropagation(), (s = (r = i.currentTarget).setPointerCapture) == null || s.call(r, i.pointerId), n("resizeStart", { axis: "both", event: i }));
1696
+ const n = t, i = [
1697
+ { name: "n", class: "inset-x-3 top-0 h-2 cursor-ns-resize" },
1698
+ { name: "s", class: "inset-x-3 bottom-0 h-2 cursor-ns-resize" },
1699
+ { name: "e", class: "inset-y-3 right-0 w-2 cursor-ew-resize" },
1700
+ { name: "w", class: "inset-y-3 left-0 w-2 cursor-ew-resize" },
1701
+ { name: "nw", class: "left-0 top-0 h-3 w-3 cursor-nwse-resize" },
1702
+ { name: "ne", class: "right-0 top-0 h-3 w-3 cursor-nesw-resize" },
1703
+ { name: "sw", class: "bottom-0 left-0 h-3 w-3 cursor-nesw-resize" },
1704
+ { name: "se", class: "bottom-0 right-0 h-3 w-3 cursor-nwse-resize" }
1705
+ ], o = (s, r) => {
1706
+ var a, l;
1707
+ r.pointerType === "mouse" && r.button !== 0 || (r.preventDefault(), r.stopPropagation(), (l = (a = r.currentTarget).setPointerCapture) == null || l.call(a, r.pointerId), n("resizeStart", { edge: s, event: r }));
1731
1708
  };
1732
- return (i, r) => (p(), w("div", {
1733
- "data-resize": "both",
1734
- class: "absolute bottom-0 right-0 z-20 flex h-6 w-6 cursor-nwse-resize select-none items-end justify-end rounded-be-md text-base-content/50 touch-none hover:bg-base-content/10 hover:text-primary",
1735
- "aria-label": "Resize",
1736
- title: "Drag to resize. Double-click to reset.",
1737
- onPointerdown: o,
1738
- onDblclick: r[0] || (r[0] = Qe((s) => n("resizeReset"), ["stop", "prevent"])),
1739
- onClick: r[1] || (r[1] = Qe(() => {
1740
- }, ["stop"]))
1741
- }, pi, 32));
1709
+ return (s, r) => (p(), v("div", yo, [
1710
+ (p(), v(K, null, me(i, (a) => C("div", {
1711
+ key: a.name,
1712
+ "data-resize": a.name,
1713
+ class: $(["pointer-events-auto absolute touch-none hover:bg-base-content/20", a.class]),
1714
+ "aria-label": `Resize from the ${a.name} border`,
1715
+ onPointerdown: (l) => o(a.name, l),
1716
+ onClick: r[0] || (r[0] = Ht(() => {
1717
+ }, ["stop"]))
1718
+ }, null, 42, xo)), 64))
1719
+ ]));
1720
+ }
1721
+ }, et = 4, Ee = "check", To = [
1722
+ { value: "check", label: "Check" },
1723
+ { value: "improve", label: "Improve" },
1724
+ { value: "improve-plus", label: "Academy" },
1725
+ { value: "friendly", label: "Friendly" },
1726
+ { value: "simplify", label: "Simplify" },
1727
+ { value: "more-detailed", label: "More detailed" }
1728
+ ], So = /* @__PURE__ */ new Set(["", "text", "search", "email", "url", "tel"]), Eo = 4e4;
1729
+ function $t(e, t) {
1730
+ return !!e && String(t || "").trim().length >= et;
1731
+ }
1732
+ function Ao(e) {
1733
+ const t = (e == null ? void 0 : e.nodeType) === 3 ? e.parentElement : e;
1734
+ if (!t || t.nodeType !== 1) return !1;
1735
+ if ($o(t)) return !0;
1736
+ if (t.disabled || t.readOnly) return !1;
1737
+ const n = t.tagName;
1738
+ return n === "TEXTAREA" ? !0 : n === "INPUT" ? So.has((t.type || "text").toLowerCase()) : !1;
1739
+ }
1740
+ function $o(e) {
1741
+ var n;
1742
+ let t = e;
1743
+ for (; t && t.nodeType === 1; ) {
1744
+ const i = (n = t.getAttribute) == null ? void 0 : n.call(t, "contenteditable"), o = typeof t.contentEditable == "string" ? t.contentEditable : "";
1745
+ if (i === "false" || o === "false") return !1;
1746
+ if (t.isContentEditable || i === "" || i === "true" || i === "plaintext-only" || o === "true" || o === "plaintext-only")
1747
+ return !0;
1748
+ t = t.parentElement;
1749
+ }
1750
+ return !1;
1751
+ }
1752
+ function ko(e, t) {
1753
+ const n = ft(e), i = ft(t);
1754
+ return !n.length && !i.length ? [] : n.length * i.length > Eo ? [{ value: String(t || ""), added: !1, removed: !1 }] : Mo(n, i, Bo(n, i));
1755
+ }
1756
+ function Ro(e) {
1757
+ return String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1758
+ }
1759
+ function Io(e, t) {
1760
+ return ko(e, t).map((n) => {
1761
+ const i = Ro(n.value);
1762
+ return n.added ? `<span class="bg-success/40">${i}</span>` : n.removed ? `<span class="bg-error/30 line-through">${i}</span>` : i;
1763
+ }).join("");
1764
+ }
1765
+ function ft(e) {
1766
+ return String(e || "").split(/(\s+)/).filter((t) => t.length);
1767
+ }
1768
+ function Bo(e, t) {
1769
+ const n = Array.from({ length: e.length + 1 }, () => new Array(t.length + 1).fill(0));
1770
+ for (let i = e.length - 1; i >= 0; i--)
1771
+ for (let o = t.length - 1; o >= 0; o--)
1772
+ n[i][o] = e[i] === t[o] ? n[i + 1][o + 1] + 1 : Math.max(n[i + 1][o], n[i][o + 1]);
1773
+ return n;
1774
+ }
1775
+ function Mo(e, t, n) {
1776
+ const i = [];
1777
+ let o = 0, s = 0;
1778
+ const r = (a, l, c) => {
1779
+ const u = i[i.length - 1];
1780
+ if (u && u.added === l && u.removed === c) {
1781
+ u.value += a;
1782
+ return;
1783
+ }
1784
+ i.push({ value: a, added: l, removed: c });
1785
+ };
1786
+ for (; o < e.length && s < t.length; )
1787
+ e[o] === t[s] ? (r(e[o], !1, !1), o += 1, s += 1) : n[o + 1][s] >= n[o][s + 1] ? (r(e[o], !1, !0), o += 1) : (r(t[s], !0, !1), s += 1);
1788
+ for (; o < e.length; )
1789
+ r(e[o], !1, !0), o += 1;
1790
+ for (; s < t.length; )
1791
+ r(t[s], !0, !1), s += 1;
1792
+ return i;
1793
+ }
1794
+ const Oo = {
1795
+ class: "flex flex-col gap-2 border-t border-base-300 p-3",
1796
+ "data-write-view": ""
1797
+ }, Do = { class: "flex items-center gap-1" }, Fo = ["value", "disabled"], Wo = ["value"], _o = ["disabled"], zo = ["disabled"], Po = {
1798
+ key: 0,
1799
+ "data-write-loading": ""
1800
+ }, Vo = {
1801
+ key: 1,
1802
+ class: "text-sm"
1803
+ }, No = ["innerHTML"], Ho = {
1804
+ key: 3,
1805
+ class: "whitespace-pre-wrap break-words text-sm",
1806
+ "data-result": ""
1807
+ }, Uo = {
1808
+ __name: "WriteView",
1809
+ props: {
1810
+ text: {
1811
+ type: String,
1812
+ default: ""
1813
+ },
1814
+ result: {
1815
+ type: String,
1816
+ default: ""
1817
+ },
1818
+ action: {
1819
+ type: String,
1820
+ default: "check"
1821
+ },
1822
+ loading: Boolean,
1823
+ editable: Boolean,
1824
+ unavailable: Boolean
1825
+ },
1826
+ emits: ["action", "copy", "replace"],
1827
+ setup(e, { emit: t }) {
1828
+ const n = e, i = t, o = R(() => n.text.trim().length < et), s = R(() => !n.loading && !!n.result), r = R(() => n.editable && s.value), a = R(() => n.action === "check" && !!n.result), l = R(() => a.value ? Io(n.text, n.result) : "");
1829
+ function c() {
1830
+ s.value && i("copy", n.result);
1831
+ }
1832
+ function u() {
1833
+ r.value && i("replace", { text: n.text, result: n.result });
1834
+ }
1835
+ return (h, g) => (p(), v("div", Oo, [
1836
+ C("div", Do, [
1837
+ C("select", {
1838
+ class: "select select-bordered select-xs min-w-0 flex-1",
1839
+ value: e.action,
1840
+ disabled: e.loading || o.value,
1841
+ "data-write-action": "",
1842
+ onChange: g[0] || (g[0] = (f) => i("action", f.target.value))
1843
+ }, [
1844
+ (p(!0), v(K, null, me(ve(To), (f) => (p(), v("option", {
1845
+ key: f.value,
1846
+ value: f.value
1847
+ }, ne(f.label), 9, Wo))), 128))
1848
+ ], 40, Fo),
1849
+ C("button", {
1850
+ type: "button",
1851
+ class: "btn btn-xs",
1852
+ disabled: !s.value,
1853
+ "data-copy": "",
1854
+ onClick: c
1855
+ }, " Copy ", 8, _o),
1856
+ C("button", {
1857
+ type: "button",
1858
+ class: "btn btn-xs btn-primary",
1859
+ disabled: !r.value,
1860
+ "data-replace": "",
1861
+ onClick: u
1862
+ }, " Replace ", 8, zo)
1863
+ ]),
1864
+ e.loading ? (p(), v("div", Po, [
1865
+ O(Qe)
1866
+ ])) : e.unavailable ? (p(), v("p", Vo, "Service Unavailable")) : a.value ? (p(), v("pre", {
1867
+ key: 2,
1868
+ class: "m-0 whitespace-pre-wrap break-words font-sans text-sm",
1869
+ "data-diff": "",
1870
+ innerHTML: l.value
1871
+ }, null, 8, No)) : e.result ? (p(), v("p", Ho, ne(e.result), 1)) : M("", !0)
1872
+ ]));
1742
1873
  }
1743
- }, ne = {
1874
+ }, te = {
1744
1875
  LOGO: "LOGO",
1745
1876
  LOADING: "LOADING",
1746
1877
  DATA: "DATA",
1747
1878
  ERROR: "ERROR",
1748
1879
  HIDDEN: "HIDDEN"
1749
- }, at = 500, _e = 250, vi = 120, Ci = 8, bi = ["ar", "fa", "iw", "yi", "ur", "pa"], wi = {
1880
+ }, Zo = 320, jo = 240, Xo = 250, qo = 120, Yo = 8, Go = ["ar", "fa", "iw", "yi", "ur", "pa"], Ko = {
1750
1881
  key: 0,
1751
1882
  class: "flex justify-center"
1752
- }, xi = {
1883
+ }, Jo = {
1753
1884
  key: 1,
1754
1885
  class: "flex justify-center"
1755
- }, yi = { class: "p-3 border-t border-base-300" }, Li = {
1886
+ }, Qo = { class: "p-3 border-t border-base-300" }, er = {
1756
1887
  name: "Bubble",
1757
1888
  props: [
1758
1889
  "translation",
@@ -1766,7 +1897,13 @@ const ai = /* @__PURE__ */ re(ei, [["render", li]]), ci = { class: "flex flex-co
1766
1897
  "aiExplainMinLength",
1767
1898
  "theme",
1768
1899
  "showThemeSelector",
1769
- "constrained"
1900
+ "constrained",
1901
+ "mode",
1902
+ "editable",
1903
+ "writing",
1904
+ "writeAction",
1905
+ "isWriteLoading",
1906
+ "selectedText"
1770
1907
  ],
1771
1908
  emits: [
1772
1909
  "logo",
@@ -1780,7 +1917,9 @@ const ai = /* @__PURE__ */ re(ei, [["render", li]]), ci = { class: "flex flex-co
1780
1917
  "themeChange",
1781
1918
  "dragStart",
1782
1919
  "resizeStart",
1783
- "resizeReset"
1920
+ "write",
1921
+ "replace",
1922
+ "copy"
1784
1923
  ],
1785
1924
  data() {
1786
1925
  return {
@@ -1797,15 +1936,55 @@ const ai = /* @__PURE__ */ re(ei, [["render", li]]), ci = { class: "flex flex-co
1797
1936
  return !this.isAITranslate && !this.isServiceUnavailable && ((t = (e = this.data) == null ? void 0 : e.dictionary) == null ? void 0 : t.length) === 0 && !!((n = this.data) != null && n.result);
1798
1937
  },
1799
1938
  showAIExplainPrompt() {
1800
- var e, t, n, o, i;
1801
- return !this.isAIExplain && !this.isServiceUnavailable && ((t = (e = this.data) == null ? void 0 : e.dictionary) == null ? void 0 : t.length) === 0 && !!((n = this.data) != null && n.result) && ((i = (o = this.data) == null ? void 0 : o.text) == null ? void 0 : i.length) >= this.aiExplainMinLength;
1939
+ var e, t, n, i, o;
1940
+ return !this.isAIExplain && !this.isServiceUnavailable && ((t = (e = this.data) == null ? void 0 : e.dictionary) == null ? void 0 : t.length) === 0 && !!((n = this.data) != null && n.result) && ((o = (i = this.data) == null ? void 0 : i.text) == null ? void 0 : o.length) >= this.aiExplainMinLength;
1802
1941
  },
1803
1942
  showLearnPrompt() {
1804
1943
  var e;
1805
1944
  return this.isFavorite && !this.isServiceUnavailable && !!((e = this.data) != null && e.result);
1945
+ },
1946
+ isWrite() {
1947
+ return this.mode === "write";
1948
+ },
1949
+ currentAction() {
1950
+ var e;
1951
+ return this.writeAction || ((e = this.writing) == null ? void 0 : e.action) || Ee;
1952
+ },
1953
+ activeText() {
1954
+ var e, t;
1955
+ return this.selectedText || ((e = this.writing) == null ? void 0 : e.text) || ((t = this.data) == null ? void 0 : t.text) || "";
1956
+ },
1957
+ canWrite() {
1958
+ return this.activeText.trim().length >= et;
1959
+ },
1960
+ shownResult() {
1961
+ var e;
1962
+ return !((e = this.writing) != null && e.result) || this.selectedText && this.writing.text && this.writing.text !== this.selectedText ? "" : this.writing.result;
1806
1963
  }
1807
1964
  },
1808
1965
  methods: {
1966
+ handleLogo() {
1967
+ if ($t(this.editable, this.selectedText)) {
1968
+ this.$emit("write", { text: this.selectedText, action: this.currentAction });
1969
+ return;
1970
+ }
1971
+ this.$emit("logo");
1972
+ },
1973
+ requestWrite() {
1974
+ this.isWrite || !this.canWrite || this.$emit("write", { text: this.activeText, action: this.currentAction });
1975
+ },
1976
+ requestTranslate() {
1977
+ this.isWrite && this.$emit("logo");
1978
+ },
1979
+ handleWriteAction(e) {
1980
+ !this.canWrite || e === this.currentAction || this.$emit("write", { text: this.activeText, action: e });
1981
+ },
1982
+ handleCopy(e) {
1983
+ this.$emit("copy", e);
1984
+ },
1985
+ handleReplace(e) {
1986
+ this.editable && this.$emit("replace", e);
1987
+ },
1809
1988
  handleAITranslate() {
1810
1989
  this.isAITranslationLoading = !0, this.$emit("aiTranslate");
1811
1990
  },
@@ -1824,9 +2003,9 @@ const ai = /* @__PURE__ */ re(ei, [["render", li]]), ci = { class: "flex flex-co
1824
2003
  watch: {
1825
2004
  translation: {
1826
2005
  handler() {
1827
- var e, t, n, o;
2006
+ var e, t, n, i;
1828
2007
  try {
1829
- this.data = this.translation, this.isLongSentence = !((t = (e = this.data) == null ? void 0 : e.phonetic) != null && t.src || ((o = (n = this.data) == null ? void 0 : n.dictionary) == null ? void 0 : o.length) > 0), this.isServiceUnavailable = !1;
2008
+ this.data = this.translation, this.isLongSentence = !((t = (e = this.data) == null ? void 0 : e.phonetic) != null && t.src || ((i = (n = this.data) == null ? void 0 : n.dictionary) == null ? void 0 : i.length) > 0), this.isServiceUnavailable = !1;
1830
2009
  } catch {
1831
2010
  this.isServiceUnavailable = !0;
1832
2011
  } finally {
@@ -1842,22 +2021,20 @@ const ai = /* @__PURE__ */ re(ei, [["render", li]]), ci = { class: "flex flex-co
1842
2021
  immediate: !0
1843
2022
  },
1844
2023
  status() {
1845
- this.status === ne.ERROR && (this.isServiceUnavailable = !0);
2024
+ this.status === te.ERROR && (this.isServiceUnavailable = !0);
1846
2025
  }
1847
2026
  }
1848
- }, Si = /* @__PURE__ */ Object.assign(Li, {
2027
+ }, tr = /* @__PURE__ */ Object.assign(er, {
1849
2028
  setup(e) {
1850
2029
  return (t, n) => {
1851
- var o, i, r, s, a, l, c, u, d, h, m;
1852
- return e.status === Te(ne).LOGO ? (p(), w("div", wi, [
1853
- H(En, {
1854
- onClick: n[0] || (n[0] = (f) => t.$emit("logo"))
1855
- })
1856
- ])) : e.status === Te(ne).LOADING ? (p(), w("div", xi, [
1857
- H(Dn)
1858
- ])) : e.status !== Te(ne).HIDDEN ? (p(), w("div", {
2030
+ var i, o, s, r, a, l, c, u, h, g, f;
2031
+ return e.status === ve(te).LOGO ? (p(), v("div", Ko, [
2032
+ O(Bn, { onClick: t.handleLogo }, null, 8, ["onClick"])
2033
+ ])) : e.status === ve(te).LOADING ? (p(), v("div", Jo, [
2034
+ O(Vn)
2035
+ ])) : e.status !== ve(te).HIDDEN ? (p(), v("div", {
1859
2036
  key: 2,
1860
- class: k([
2037
+ class: $([
1861
2038
  "wrapper rounded-lg text-base-content text-sm shadow-lg relative bg-[length:300%_300%] bg-[position:0%_50%]",
1862
2039
  e.constrained ? "flex h-full w-full min-w-0 flex-col" : "",
1863
2040
  {
@@ -1866,102 +2043,122 @@ const ai = /* @__PURE__ */ re(ei, [["render", li]]), ci = { class: "flex flex-co
1866
2043
  }
1867
2044
  ])
1868
2045
  }, [
1869
- b("div", {
1870
- class: k([
2046
+ C("div", {
2047
+ class: $([
1871
2048
  "bg-base-100 rounded-md relative z-10",
1872
2049
  e.constrained ? "flex min-h-0 min-w-0 flex-1 flex-col" : ""
1873
2050
  ])
1874
2051
  }, [
1875
- t.isServiceUnavailable ? (p(), N(lt, {
2052
+ t.isServiceUnavailable ? (p(), W(dt, {
1876
2053
  key: 0,
1877
2054
  class: "shrink-0",
1878
2055
  isServiceUnavailable: t.isServiceUnavailable,
1879
2056
  isLongSentence: !1,
1880
2057
  theme: e.theme,
1881
2058
  showThemeSelector: e.showThemeSelector,
1882
- onFavorite: n[1] || (n[1] = (f) => t.$emit("favorite")),
1883
- onSetting: n[2] || (n[2] = (f) => t.$emit("settings")),
1884
- onClose: n[3] || (n[3] = (f) => t.$emit("close")),
1885
- onLoadTTS: n[4] || (n[4] = (f) => t.$emit("loadTTS")),
1886
- onThemeChange: n[5] || (n[5] = (f) => t.$emit("themeChange", f))
1887
- }, null, 8, ["isServiceUnavailable", "theme", "showThemeSelector"])) : (p(), N(lt, {
2059
+ mode: e.mode,
2060
+ canWrite: t.canWrite,
2061
+ onFavorite: n[0] || (n[0] = (m) => t.$emit("favorite")),
2062
+ onSetting: n[1] || (n[1] = (m) => t.$emit("settings")),
2063
+ onClose: n[2] || (n[2] = (m) => t.$emit("close")),
2064
+ onLoadTTS: n[3] || (n[3] = (m) => t.$emit("loadTTS")),
2065
+ onThemeChange: n[4] || (n[4] = (m) => t.$emit("themeChange", m)),
2066
+ onRequestTranslate: t.requestTranslate,
2067
+ onRequestWrite: t.requestWrite
2068
+ }, null, 8, ["isServiceUnavailable", "theme", "showThemeSelector", "mode", "canWrite", "onRequestTranslate", "onRequestWrite"])) : (p(), W(dt, {
1888
2069
  key: 1,
1889
2070
  class: "shrink-0",
1890
2071
  tts: e.tts,
1891
2072
  isFavorite: e.isFavorite,
1892
2073
  isAITranslate: e.isAITranslate,
1893
- isAITranslateVisible: ((i = (o = t.data) == null ? void 0 : o.dictionary) == null ? void 0 : i.length) === 0,
2074
+ isAITranslateVisible: ((o = (i = t.data) == null ? void 0 : i.dictionary) == null ? void 0 : o.length) === 0,
1894
2075
  isAIExplain: e.isAIExplain,
1895
- isAIExplainVisible: ((s = (r = t.data) == null ? void 0 : r.text) == null ? void 0 : s.length) >= e.aiExplainMinLength,
2076
+ isAIExplainVisible: ((r = (s = t.data) == null ? void 0 : s.text) == null ? void 0 : r.length) >= e.aiExplainMinLength,
1896
2077
  isAITranslationLoading: t.isAITranslationLoading,
1897
2078
  isAIExplainLoading: t.isAIExplainLoading,
1898
2079
  isFavoriteFeatureEnabled: e.isFavoriteFeatureEnabled,
1899
2080
  isLongSentence: t.isLongSentence,
1900
2081
  theme: e.theme,
1901
2082
  showThemeSelector: e.showThemeSelector,
1902
- onFavorite: n[6] || (n[6] = (f) => t.$emit("favorite")),
1903
- onSetting: n[7] || (n[7] = (f) => t.$emit("settings")),
1904
- onClose: n[8] || (n[8] = (f) => t.$emit("close")),
1905
- onLoadTTS: n[9] || (n[9] = (f) => t.$emit("loadTTS")),
2083
+ mode: e.mode,
2084
+ canWrite: t.canWrite,
2085
+ onFavorite: n[5] || (n[5] = (m) => t.$emit("favorite")),
2086
+ onSetting: n[6] || (n[6] = (m) => t.$emit("settings")),
2087
+ onClose: n[7] || (n[7] = (m) => t.$emit("close")),
2088
+ onLoadTTS: n[8] || (n[8] = (m) => t.$emit("loadTTS")),
1906
2089
  onAiTranslate: t.handleAITranslate,
1907
2090
  onAiExplain: t.handleAIExplain,
1908
- onThemeChange: n[10] || (n[10] = (f) => t.$emit("themeChange", f)),
1909
- onDragStart: n[11] || (n[11] = (f) => t.$emit("dragStart", f))
1910
- }, null, 8, ["tts", "isFavorite", "isAITranslate", "isAITranslateVisible", "isAIExplain", "isAIExplainVisible", "isAITranslationLoading", "isAIExplainLoading", "isFavoriteFeatureEnabled", "isLongSentence", "theme", "showThemeSelector", "onAiTranslate", "onAiExplain"])),
1911
- b("div", {
1912
- class: k(
2091
+ onThemeChange: n[9] || (n[9] = (m) => t.$emit("themeChange", m)),
2092
+ onDragStart: n[10] || (n[10] = (m) => t.$emit("dragStart", m)),
2093
+ onRequestTranslate: t.requestTranslate,
2094
+ onRequestWrite: t.requestWrite
2095
+ }, null, 8, ["tts", "isFavorite", "isAITranslate", "isAITranslateVisible", "isAIExplain", "isAIExplainVisible", "isAITranslationLoading", "isAIExplainLoading", "isFavoriteFeatureEnabled", "isLongSentence", "theme", "showThemeSelector", "mode", "canWrite", "onAiTranslate", "onAiExplain", "onRequestTranslate", "onRequestWrite"])),
2096
+ C("div", {
2097
+ class: $(
1913
2098
  e.constrained ? "min-h-0 min-w-0 flex-1 overflow-y-auto overflow-x-hidden break-words overscroll-contain" : ""
1914
2099
  )
1915
2100
  }, [
1916
- b("div", yi, [
1917
- (l = (a = t.data) == null ? void 0 : a.phonetic) != null && l.src ? (p(), N(Vn, {
1918
- key: 0,
1919
- phonetic: (u = (c = t.data) == null ? void 0 : c.phonetic) == null ? void 0 : u.src
1920
- }, null, 8, ["phonetic"])) : M("", !0),
1921
- H(Hn, {
1922
- sentences: t.isServiceUnavailable ? "Service Unavailable" : (d = t.data) == null ? void 0 : d.result
1923
- }, null, 8, ["sentences"]),
1924
- H(Un, {
1925
- show: t.showAIPrompt,
1926
- isLoading: t.isAITranslationLoading,
1927
- onClick: t.handleAITranslate
1928
- }, null, 8, ["show", "isLoading", "onClick"]),
1929
- H(Xn, {
1930
- show: t.showAIExplainPrompt,
1931
- isLoading: t.isAIExplainLoading,
1932
- onClick: t.handleAIExplain
1933
- }, null, 8, ["show", "isLoading", "onClick"]),
1934
- H(Gn, {
1935
- show: t.showLearnPrompt,
1936
- onClick: t.handleLearn
1937
- }, null, 8, ["show", "onClick"])
1938
- ]),
1939
- !t.isServiceUnavailable && ((m = (h = t.data) == null ? void 0 : h.dictionary) == null ? void 0 : m.length) > 0 ? (p(), N(Qn, {
2101
+ t.isWrite ? (p(), W(Uo, {
1940
2102
  key: 0,
1941
- class: "p-3 pt-0 border-t border-base-300",
1942
- dictionary: t.data.dictionary
1943
- }, null, 8, ["dictionary"])) : M("", !0),
1944
- !t.isServiceUnavailable && e.isAIExplain && e.explanation ? (p(), N(io, {
1945
- key: 1,
1946
- class: "p-3 pt-0 border-t border-base-300",
1947
- explanation: e.explanation
1948
- }, null, 8, ["explanation"])) : M("", !0)
2103
+ text: t.activeText,
2104
+ result: t.shownResult,
2105
+ action: t.currentAction,
2106
+ loading: e.isWriteLoading,
2107
+ editable: e.editable,
2108
+ unavailable: t.isServiceUnavailable,
2109
+ onAction: t.handleWriteAction,
2110
+ onCopy: t.handleCopy,
2111
+ onReplace: t.handleReplace
2112
+ }, null, 8, ["text", "result", "action", "loading", "editable", "unavailable", "onAction", "onCopy", "onReplace"])) : (p(), v(K, { key: 1 }, [
2113
+ C("div", Qo, [
2114
+ (l = (a = t.data) == null ? void 0 : a.phonetic) != null && l.src ? (p(), W(jn, {
2115
+ key: 0,
2116
+ phonetic: (u = (c = t.data) == null ? void 0 : c.phonetic) == null ? void 0 : u.src
2117
+ }, null, 8, ["phonetic"])) : M("", !0),
2118
+ O(qn, {
2119
+ sentences: t.isServiceUnavailable ? "Service Unavailable" : (h = t.data) == null ? void 0 : h.result
2120
+ }, null, 8, ["sentences"]),
2121
+ O(Kn, {
2122
+ show: t.showAIPrompt,
2123
+ isLoading: t.isAITranslationLoading,
2124
+ onClick: t.handleAITranslate
2125
+ }, null, 8, ["show", "isLoading", "onClick"]),
2126
+ O(ei, {
2127
+ show: t.showAIExplainPrompt,
2128
+ isLoading: t.isAIExplainLoading,
2129
+ onClick: t.handleAIExplain
2130
+ }, null, 8, ["show", "isLoading", "onClick"]),
2131
+ O(ii, {
2132
+ show: t.showLearnPrompt,
2133
+ onClick: t.handleLearn
2134
+ }, null, 8, ["show", "onClick"])
2135
+ ]),
2136
+ !t.isServiceUnavailable && ((f = (g = t.data) == null ? void 0 : g.dictionary) == null ? void 0 : f.length) > 0 ? (p(), W(si, {
2137
+ key: 0,
2138
+ class: "p-3 pt-0 border-t border-base-300",
2139
+ dictionary: t.data.dictionary
2140
+ }, null, 8, ["dictionary"])) : M("", !0),
2141
+ !t.isServiceUnavailable && e.isAIExplain && e.explanation ? (p(), W(di, {
2142
+ key: 1,
2143
+ class: "p-3 pt-0 border-t border-base-300",
2144
+ explanation: e.explanation
2145
+ }, null, 8, ["explanation"])) : M("", !0)
2146
+ ], 64))
1949
2147
  ], 2),
1950
- H(gi, {
1951
- onResizeStart: n[12] || (n[12] = (f) => t.$emit("resizeStart", f)),
1952
- onResizeReset: n[13] || (n[13] = (f) => t.$emit("resizeReset"))
2148
+ O(Lo, {
2149
+ onResizeStart: n[11] || (n[11] = (m) => t.$emit("resizeStart", m))
1953
2150
  })
1954
2151
  ], 2)
1955
2152
  ], 2)) : M("", !0);
1956
2153
  };
1957
2154
  }
1958
2155
  });
1959
- function Ei(e) {
2156
+ function nr(e) {
1960
2157
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1961
2158
  }
1962
- var Ve = { exports: {} }, ct;
1963
- function Ti() {
1964
- return ct || (ct = 1, function(e) {
2159
+ var Ue = { exports: {} }, mt;
2160
+ function ir() {
2161
+ return mt || (mt = 1, function(e) {
1965
2162
  (function() {
1966
2163
  var t = [
1967
2164
  "direction",
@@ -2000,8 +2197,8 @@ function Ti() {
2000
2197
  "wordSpacing",
2001
2198
  "tabSize",
2002
2199
  "MozTabSize"
2003
- ], n = typeof window < "u", o = n && window.mozInnerScreenX != null;
2004
- function i(r, s, a) {
2200
+ ], n = typeof window < "u", i = n && window.mozInnerScreenX != null;
2201
+ function o(s, r, a) {
2005
2202
  if (!n)
2006
2203
  throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");
2007
2204
  var l = a && a.debug || !1;
@@ -2011,51 +2208,51 @@ function Ti() {
2011
2208
  }
2012
2209
  var u = document.createElement("div");
2013
2210
  u.id = "input-textarea-caret-position-mirror-div", document.body.appendChild(u);
2014
- var d = u.style, h = window.getComputedStyle ? window.getComputedStyle(r) : r.currentStyle, m = r.nodeName === "INPUT";
2015
- d.whiteSpace = "pre-wrap", m || (d.wordWrap = "break-word"), d.position = "absolute", l || (d.visibility = "hidden"), t.forEach(function(x) {
2016
- m && x === "lineHeight" ? d.lineHeight = h.height : d[x] = h[x];
2017
- }), o ? r.scrollHeight > parseInt(h.height) && (d.overflowY = "scroll") : d.overflow = "hidden", u.textContent = r.value.substring(0, s), m && (u.textContent = u.textContent.replace(/\s/g, " "));
2018
- var f = document.createElement("span");
2019
- f.textContent = r.value.substring(s) || ".", u.appendChild(f);
2020
- var v = {
2021
- top: f.offsetTop + parseInt(h.borderTopWidth),
2022
- left: f.offsetLeft + parseInt(h.borderLeftWidth),
2023
- height: parseInt(h.lineHeight)
2211
+ var h = u.style, g = window.getComputedStyle ? window.getComputedStyle(s) : s.currentStyle, f = s.nodeName === "INPUT";
2212
+ h.whiteSpace = "pre-wrap", f || (h.wordWrap = "break-word"), h.position = "absolute", l || (h.visibility = "hidden"), t.forEach(function(y) {
2213
+ f && y === "lineHeight" ? h.lineHeight = g.height : h[y] = g[y];
2214
+ }), i ? s.scrollHeight > parseInt(g.height) && (h.overflowY = "scroll") : h.overflow = "hidden", u.textContent = s.value.substring(0, r), f && (u.textContent = u.textContent.replace(/\s/g, " "));
2215
+ var m = document.createElement("span");
2216
+ m.textContent = s.value.substring(r) || ".", u.appendChild(m);
2217
+ var w = {
2218
+ top: m.offsetTop + parseInt(g.borderTopWidth),
2219
+ left: m.offsetLeft + parseInt(g.borderLeftWidth),
2220
+ height: parseInt(g.lineHeight)
2024
2221
  };
2025
- return l ? f.style.backgroundColor = "#aaa" : document.body.removeChild(u), v;
2222
+ return l ? m.style.backgroundColor = "#aaa" : document.body.removeChild(u), w;
2026
2223
  }
2027
- e.exports = i;
2224
+ e.exports = o;
2028
2225
  })();
2029
- }(Ve)), Ve.exports;
2226
+ }(Ue)), Ue.exports;
2030
2227
  }
2031
- var $i = Ti();
2032
- const ut = /* @__PURE__ */ Ei($i);
2228
+ var or = ir();
2229
+ const ht = /* @__PURE__ */ nr(or);
2033
2230
  function ce(e) {
2034
2231
  const t = window.getSelection();
2035
2232
  let n = t + "";
2036
2233
  if (n = n.trim(), e && e.type === "password" || !n.length && (!(e && e.selectionEnd) || (n = e.value.substring(e.selectionStart, e.selectionEnd), n = n.trim(), !n.length)))
2037
2234
  return !1;
2038
- let i = t.getRangeAt(0).getBoundingClientRect(), { top: r, bottom: s, left: a, width: l, height: c } = i;
2039
- if (!s && !a) {
2235
+ let o = t.getRangeAt(0).getBoundingClientRect(), { top: s, bottom: r, left: a, width: l, height: c } = o;
2236
+ if (!r && !a) {
2040
2237
  if (!e.selectionEnd)
2041
2238
  return !1;
2042
- let u = ut(e, e.selectionStart), d = ut(e, e.selectionEnd);
2043
- i = e.getBoundingClientRect(), a = i.left + u.left, l = d.left - u.left, u.top != d.top && (a = i.left, l = i.width), r = i.top + u.top, s = i.top + d.top + 20;
2239
+ let u = ht(e, e.selectionStart), h = ht(e, e.selectionEnd);
2240
+ o = e.getBoundingClientRect(), a = o.left + u.left, l = h.left - u.left, u.top != h.top && (a = o.left, l = o.width), s = o.top + u.top, r = o.top + h.top + 20;
2044
2241
  }
2045
- return c === 0 && (c = s - r), {
2242
+ return c === 0 && (c = r - s), {
2046
2243
  text: n,
2047
2244
  // position
2048
2245
  x: a,
2049
- y: r,
2050
- top: r,
2051
- bottom: s,
2246
+ y: s,
2247
+ top: s,
2248
+ bottom: r,
2052
2249
  left: a,
2053
2250
  right: a + l,
2054
2251
  width: l,
2055
2252
  height: c
2056
2253
  };
2057
2254
  }
2058
- function Ai() {
2255
+ function rr() {
2059
2256
  const e = document.getElementsByTagName("ddict-div");
2060
2257
  for (let t of e)
2061
2258
  if (!t.parentNode.matches('wrapper[dir="rtl"]')) {
@@ -2063,94 +2260,184 @@ function Ai() {
2063
2260
  n.setAttribute("dir", "rtl"), t.parentNode.insertBefore(n, t), n.appendChild(t);
2064
2261
  }
2065
2262
  }
2066
- function ki() {
2263
+ function sr() {
2067
2264
  const e = document.querySelectorAll('wrapper[dir="rtl"]');
2068
2265
  for (let t of e) {
2069
2266
  const n = t.querySelector("ddict-div");
2070
2267
  n && (t.parentNode.insertBefore(n, t), t.remove());
2071
2268
  }
2072
2269
  }
2073
- const dt = {
2074
- supportRTL: Ai,
2075
- removeRTL: ki
2076
- }, Ri = 2;
2077
- function Bi(e, t, n = Ri) {
2270
+ const pt = {
2271
+ supportRTL: rr,
2272
+ removeRTL: sr
2273
+ }, lr = 2, ar = {
2274
+ n: { x: !1, y: !0, fromStartX: !1, fromStartY: !0 },
2275
+ s: { x: !1, y: !0, fromStartX: !1, fromStartY: !1 },
2276
+ e: { x: !0, y: !1, fromStartX: !1, fromStartY: !1 },
2277
+ w: { x: !0, y: !1, fromStartX: !0, fromStartY: !1 },
2278
+ ne: { x: !0, y: !0, fromStartX: !1, fromStartY: !0 },
2279
+ nw: { x: !0, y: !0, fromStartX: !0, fromStartY: !0 },
2280
+ se: { x: !0, y: !0, fromStartX: !1, fromStartY: !1 },
2281
+ sw: { x: !0, y: !0, fromStartX: !0, fromStartY: !1 }
2282
+ };
2283
+ function cr(e, t, n = lr) {
2078
2284
  return Math.abs(e) >= n || Math.abs(t) >= n;
2079
2285
  }
2080
- function ft(e, t, n) {
2081
- const o = n > t ? n : t;
2082
- return Math.min(o, Math.max(t, e));
2083
- }
2084
- function Ii({
2085
- width: e,
2086
- height: t,
2087
- dx: n,
2088
- dy: o,
2089
- scale: i = 1,
2090
- axis: r = "both",
2091
- minWidth: s,
2092
- minHeight: a,
2093
- maxWidth: l,
2094
- maxHeight: c
2095
- }) {
2096
- const u = i > 0 ? i : 1, d = r === "x" || r === "both", h = r === "y" || r === "both";
2097
- return {
2098
- width: d ? Math.round(ft(e + n / u, s, l)) : e,
2099
- height: h ? Math.round(ft(t + o / u, a, c)) : t
2100
- };
2286
+ function Se(e, t, n) {
2287
+ const i = n > t ? n : t;
2288
+ return Math.min(i, Math.max(t, e));
2101
2289
  }
2102
- function Mi({
2103
- left: e,
2104
- top: t,
2105
- scale: n = 1,
2106
- viewportWidth: o,
2107
- viewportHeight: i,
2108
- margin: r = 8
2290
+ function ur({
2291
+ x: e,
2292
+ y: t,
2293
+ width: n,
2294
+ height: i,
2295
+ dx: o,
2296
+ dy: s,
2297
+ scale: r = 1,
2298
+ edge: a,
2299
+ minWidth: l,
2300
+ minHeight: c,
2301
+ viewportWidth: u,
2302
+ viewportHeight: h,
2303
+ margin: g = 8
2109
2304
  }) {
2110
- const s = n > 0 ? n : 1;
2305
+ const f = ar[a];
2306
+ if (!f) return { x: e, y: t, width: n, height: i };
2307
+ const m = r > 0 ? r : 1, w = e + n * m, y = t + i * m, L = u - g, x = h - g;
2308
+ let T = e, A = t, S = n, B = i;
2309
+ if (f.x && f.fromStartX) {
2310
+ const E = g, D = w - l * m;
2311
+ T = Se(e + o, E, D), S = (w - T) / m;
2312
+ } else f.x && (S = Se(
2313
+ n + o / m,
2314
+ l,
2315
+ Math.max(l, (L - e) / m)
2316
+ ));
2317
+ if (f.y && f.fromStartY) {
2318
+ const E = g, D = y - c * m;
2319
+ A = Se(t + s, E, D), B = (y - A) / m;
2320
+ } else f.y && (B = Se(
2321
+ i + s / m,
2322
+ c,
2323
+ Math.max(c, (x - t) / m)
2324
+ ));
2111
2325
  return {
2112
- maxWidth: (o - e - r) / s,
2113
- maxHeight: (i - t - r) / s
2326
+ x: Math.round(T),
2327
+ y: Math.round(A),
2328
+ width: Math.round(S),
2329
+ height: Math.round(B)
2114
2330
  };
2115
2331
  }
2116
- const Di = {
2332
+ function dr(e) {
2333
+ const t = br(e);
2334
+ if (!t) return null;
2335
+ if (Cr(t)) {
2336
+ const s = t.selectionStart, r = t.selectionEnd;
2337
+ return s == null || r == null || s === r ? null : {
2338
+ kind: "value",
2339
+ element: t,
2340
+ start: s,
2341
+ end: r,
2342
+ text: t.value.slice(s, r)
2343
+ };
2344
+ }
2345
+ const n = window.getSelection();
2346
+ if (!n || n.rangeCount === 0) return null;
2347
+ const i = n.getRangeAt(0).cloneRange(), o = i.toString();
2348
+ return o ? { kind: "range", element: t, range: i, text: o } : null;
2349
+ }
2350
+ function fr(e, t) {
2351
+ return !e || t == null ? !1 : e.kind === "value" ? hr(e, t) : pr(e, t);
2352
+ }
2353
+ async function mr(e) {
2354
+ var t;
2355
+ if (!e) return !1;
2356
+ try {
2357
+ if ((t = navigator.clipboard) != null && t.writeText)
2358
+ return await navigator.clipboard.writeText(e), !0;
2359
+ } catch {
2360
+ }
2361
+ return vr(e);
2362
+ }
2363
+ function hr(e, t) {
2364
+ const n = e.element;
2365
+ if (!n || n.value.slice(e.start, e.end) !== e.text) return !1;
2366
+ const i = n.value.slice(0, e.start) + t + n.value.slice(e.end);
2367
+ gr(n, i);
2368
+ const o = e.start + t.length;
2369
+ return n.focus(), n.setSelectionRange(o, o), kt(n), !0;
2370
+ }
2371
+ function pr(e, t) {
2372
+ const n = e.range;
2373
+ if (!n || n.toString() !== e.text) return !1;
2374
+ n.deleteContents();
2375
+ const i = n.startContainer.ownerDocument.createTextNode(t);
2376
+ return n.insertNode(i), n.setStartAfter(i), n.collapse(!0), kt(e.element), !0;
2377
+ }
2378
+ function gr(e, t) {
2379
+ var i;
2380
+ const n = (i = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), "value")) == null ? void 0 : i.set;
2381
+ n ? n.call(e, t) : e.value = t;
2382
+ }
2383
+ function kt(e) {
2384
+ e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 }));
2385
+ }
2386
+ function vr(e) {
2387
+ const t = document.createElement("textarea");
2388
+ t.value = e, t.setAttribute("readonly", ""), t.style.position = "fixed", t.style.left = "-9999px", document.body.appendChild(t), t.select();
2389
+ let n = !1;
2390
+ try {
2391
+ n = document.execCommand("copy");
2392
+ } catch {
2393
+ n = !1;
2394
+ }
2395
+ return t.remove(), n;
2396
+ }
2397
+ function br(e) {
2398
+ return e ? e.nodeType === 3 ? e.parentElement : e : null;
2399
+ }
2400
+ function Cr(e) {
2401
+ return e.tagName === "TEXTAREA" || e.tagName === "INPUT";
2402
+ }
2403
+ const wr = {
2117
2404
  __name: "HotKeysListener",
2118
2405
  props: {
2119
2406
  textSelected: String
2120
2407
  },
2121
2408
  emits: ["toggleKey", "close"],
2122
2409
  setup(e, { emit: t }) {
2123
- const n = e, o = t, i = () => {
2410
+ const n = e, i = t, o = () => {
2124
2411
  setTimeout(() => {
2125
2412
  n.textSelected && a("DoubleClick");
2126
2413
  }, 50);
2127
- }, r = (l) => {
2128
- (l.altKey && l.key.toLowerCase() === "w" || l.key === "∑") && n.textSelected && (a("Alt+W"), l.preventDefault()), l.key === "Escape" && (a("Escape"), l.preventDefault());
2129
2414
  }, s = (l) => {
2415
+ (l.altKey && l.key.toLowerCase() === "w" || l.key === "∑") && n.textSelected && (a("Alt+W"), l.preventDefault()), l.key === "Escape" && (a("Escape"), l.preventDefault());
2416
+ }, r = (l) => {
2130
2417
  l.key === "Shift" && n.textSelected && a("Shift");
2131
2418
  }, a = (l) => {
2132
2419
  switch (l) {
2133
2420
  case "DoubleClick":
2134
- o("toggleKey", "DoubleClick");
2421
+ i("toggleKey", "DoubleClick");
2135
2422
  break;
2136
2423
  case "Shift":
2137
- o("toggleKey", "Shift");
2424
+ i("toggleKey", "Shift");
2138
2425
  break;
2139
2426
  case "Alt+W":
2140
- o("toggleKey", "Alt+W");
2427
+ i("toggleKey", "Alt+W");
2141
2428
  break;
2142
2429
  case "Escape":
2143
- o("close");
2430
+ i("close");
2144
2431
  break;
2145
2432
  }
2146
2433
  };
2147
- return mt(() => {
2148
- window.addEventListener("dblclick", i), window.addEventListener("keydown", r), window.addEventListener("keyup", s);
2149
- }), We(() => {
2150
- window.removeEventListener("dblclick", i), window.removeEventListener("keydown", r), window.removeEventListener("keyup", s);
2151
- }), (l, c) => (p(), w("div"));
2434
+ return gt(() => {
2435
+ window.addEventListener("dblclick", o), window.addEventListener("keydown", s), window.addEventListener("keyup", r);
2436
+ }), qe(() => {
2437
+ window.removeEventListener("dblclick", o), window.removeEventListener("keydown", s), window.removeEventListener("keyup", r);
2438
+ }), (l, c) => (p(), v("div"));
2152
2439
  }
2153
- }, Oi = ["data-theme"], zi = {
2440
+ }, yr = ["data-theme"], Lr = {
2154
2441
  __name: "BubbleWrapper",
2155
2442
  props: {
2156
2443
  translation: Object,
@@ -2176,6 +2463,22 @@ const Di = {
2176
2463
  showThemeSelector: {
2177
2464
  type: Boolean,
2178
2465
  default: !0
2466
+ },
2467
+ mode: {
2468
+ type: String,
2469
+ default: "translate"
2470
+ },
2471
+ writing: {
2472
+ type: Object,
2473
+ default: null
2474
+ },
2475
+ writeAction: {
2476
+ type: String,
2477
+ default: Ee
2478
+ },
2479
+ isWriteLoading: {
2480
+ type: Boolean,
2481
+ default: !1
2179
2482
  }
2180
2483
  },
2181
2484
  emits: [
@@ -2188,220 +2491,249 @@ const Di = {
2188
2491
  "aiTranslate",
2189
2492
  "aiExplain",
2190
2493
  "learn",
2191
- "themeChange"
2494
+ "themeChange",
2495
+ "write",
2496
+ "replace",
2497
+ "copy"
2192
2498
  ],
2193
2499
  setup(e, { emit: t }) {
2194
- const n = e, o = t, i = R(null), r = R(null), s = R(null), a = R(!1), l = R(""), c = R(n.theme), u = R(!1), d = R(!1), h = R({ x: 0, y: 0 }), m = R(null), f = R(null), v = R(null), x = R(!1);
2195
- let y = !1, L = 0, S = !1, $ = "", E = "";
2196
- const I = B(() => typeof window > "u" || !s.value || !l.value ? null : {
2197
- getBoundingClientRect: () => ce(s.value),
2198
- getClientRects: () => ce(s.value)
2199
- }), { floatingStyles: T, update: D } = wn(I, i, {
2500
+ const n = e, i = t, o = k(null), s = k(null), r = k(null), a = k(!1), l = k(""), c = k(!1), u = k(n.writeAction || Ee);
2501
+ let h = null;
2502
+ Q(
2503
+ () => n.writeAction,
2504
+ (d, b) => {
2505
+ d && d !== b && (u.value = d);
2506
+ }
2507
+ );
2508
+ const g = k(n.theme), f = k(!1), m = k(!1), w = k({ x: 0, y: 0 }), y = k(null), L = k(null), x = k(null), T = k(!1);
2509
+ let A = !1, S = 0, B = !1, E = "", D = "";
2510
+ const Z = R(() => typeof window > "u" || !r.value || !l.value ? null : {
2511
+ getBoundingClientRect: () => ce(r.value),
2512
+ getClientRects: () => ce(r.value)
2513
+ }), { floatingStyles: J, update: he } = An(Z, o, {
2200
2514
  placement: "bottom",
2201
- middleware: [
2202
- hn(4),
2203
- gn(),
2204
- pn(),
2205
- vn({
2206
- apply({ rects: g, elements: C }) {
2207
- if (C.floating.style.zIndex = 9999, f.value) return;
2208
- let A = g.reference.width > _e ? g.reference.width / n.scale : _e;
2209
- A > at && (A = at), C.floating.style.maxWidth = A + "px";
2210
- }
2211
- })
2212
- ],
2213
- whileElementsMounted(g, C, A) {
2214
- return mn(g, C, A, {
2515
+ middleware: [xn(4), Tn(), Ln()],
2516
+ whileElementsMounted(d, b, I) {
2517
+ return yn(d, b, I, {
2215
2518
  ancestorScroll: !0,
2216
2519
  elementResize: !1
2217
2520
  });
2218
2521
  }
2219
- }), z = B(
2220
- () => n.status === ne.DATA || n.status === ne.ERROR
2221
- ), _ = B(() => !!f.value && z.value), ee = B(() => {
2222
- let g = T.value;
2223
- if (m.value)
2224
- g = {
2225
- ...g,
2522
+ }), pe = R(
2523
+ () => n.status === te.DATA || n.status === te.ERROR
2524
+ ), z = R(() => {
2525
+ var d, b;
2526
+ return pe.value ? {
2527
+ width: ((d = L.value) == null ? void 0 : d.width) ?? Zo,
2528
+ height: ((b = L.value) == null ? void 0 : b.height) ?? jo
2529
+ } : null;
2530
+ }), j = R(() => {
2531
+ let d = J.value;
2532
+ if (y.value)
2533
+ d = {
2534
+ ...d,
2226
2535
  position: "fixed",
2227
- left: `${m.value.x}px`,
2228
- top: `${m.value.y}px`,
2536
+ left: `${y.value.x}px`,
2537
+ top: `${y.value.y}px`,
2229
2538
  transform: "none"
2230
2539
  };
2231
- else if (x.value && s.value && l.value) {
2232
- const C = ce(s.value);
2233
- C && (g = {
2234
- ...g,
2540
+ else if (T.value && r.value && l.value) {
2541
+ const b = ce(r.value);
2542
+ b && (d = {
2543
+ ...d,
2235
2544
  position: "fixed",
2236
- left: `${C.x}px`,
2237
- top: `${C.y + C.height + 4}px`,
2545
+ left: `${b.x}px`,
2546
+ top: `${b.y + b.height + 4}px`,
2238
2547
  transform: "none"
2239
2548
  });
2240
2549
  }
2241
- return _.value && (g = {
2242
- ...g,
2243
- width: `${f.value.width}px`,
2244
- height: `${f.value.height}px`,
2245
- maxWidth: `${f.value.width}px`,
2550
+ return d = {
2551
+ ...d,
2552
+ zIndex: 9999
2553
+ }, z.value && (d = {
2554
+ ...d,
2555
+ width: `${z.value.width}px`,
2556
+ height: `${z.value.height}px`,
2557
+ maxWidth: `${z.value.width}px`,
2246
2558
  boxSizing: "border-box"
2247
- }), g;
2248
- }), Le = B(() => {
2249
- const g = {
2559
+ }), d;
2560
+ }), ye = R(() => {
2561
+ const d = {
2250
2562
  transform: n.scale !== 1 ? `scale(${n.scale})` : "none",
2251
2563
  transformOrigin: "top left"
2252
2564
  };
2253
- return _.value && (g.width = `${f.value.width}px`, g.height = `${f.value.height}px`, g.boxSizing = "border-box"), g;
2565
+ return z.value && (d.width = `${z.value.width}px`, d.height = `${z.value.height}px`, d.boxSizing = "border-box"), d;
2254
2566
  });
2255
- mt(() => {
2256
- document.addEventListener("keyup", (g) => {
2257
- if (!ce(g.target)) {
2258
- l.value = "", Y();
2567
+ gt(() => {
2568
+ document.addEventListener("keyup", (d) => {
2569
+ if (!ce(d.target)) {
2570
+ P();
2259
2571
  return;
2260
2572
  }
2261
- }), document.documentElement.onclick = (g) => {
2262
- if (Ke()) return;
2263
- const C = ce(g.target);
2264
- if (!C) {
2265
- l.value = "", Y();
2573
+ }), document.documentElement.onclick = (d) => {
2574
+ if (tt()) return;
2575
+ const b = ce(d.target);
2576
+ if (!b) {
2577
+ P();
2266
2578
  return;
2267
2579
  }
2268
- me(C, g);
2269
- }, document.documentElement.ontouchend = (g) => {
2270
- if (Ke()) return;
2271
- const C = ce(g.target);
2272
- if (!C) {
2273
- l.value = "", Y();
2580
+ q(b, d);
2581
+ }, document.documentElement.ontouchend = (d) => {
2582
+ if (tt()) return;
2583
+ const b = ce(d.target);
2584
+ if (!b) {
2585
+ P();
2274
2586
  return;
2275
2587
  }
2276
- me(C, g);
2588
+ q(b, d);
2277
2589
  };
2278
- }), We(() => {
2279
- document.documentElement.onclick = null, document.documentElement.ontouchend = null, clearTimeout(L), document.removeEventListener("mousemove", V), document.removeEventListener("mouseup", he), document.removeEventListener("touchmove", P), document.removeEventListener("touchend", Me), Oe();
2590
+ }), qe(() => {
2591
+ document.documentElement.onclick = null, document.documentElement.ontouchend = null, clearTimeout(S), document.removeEventListener("mousemove", We), document.removeEventListener("mouseup", ze), document.removeEventListener("touchmove", _e), document.removeEventListener("touchend", Pe), Ne();
2280
2592
  });
2281
- const me = (g, C) => {
2282
- n.status !== ne.LOGO && o("close"), a.value && !x.value && (x.value = !0), s.value = C.target, l.value = g.text, a.value = !0, Fe(D);
2283
- }, j = (g) => {
2284
- g.stopPropagation();
2285
- }, Y = async () => {
2286
- Oe(), a.value = !1, m.value = null, x.value = !1, o("close");
2287
- }, te = (g) => {
2288
- c.value = g, o("themeChange", g);
2289
- }, K = ({ type: g, event: C }) => {
2290
- u.value = !0;
2291
- const A = i.value.getBoundingClientRect();
2292
- if (g === "mouse")
2293
- h.value = {
2294
- x: C.clientX - A.left,
2295
- y: C.clientY - A.top
2296
- }, document.addEventListener("mousemove", V), document.addEventListener("mouseup", he);
2297
- else if (g === "touch") {
2298
- const le = C.touches[0];
2299
- h.value = {
2300
- x: le.clientX - A.left,
2301
- y: le.clientY - A.top
2302
- }, document.addEventListener("touchmove", P), document.addEventListener("touchend", Me);
2593
+ const q = (d, b) => {
2594
+ n.status !== te.LOGO && i("close"), a.value && !T.value && (T.value = !0), r.value = b.target, c.value = Ao(b.target), h = c.value ? dr(b.target) : null, l.value = d.text, a.value = !0, it(he);
2595
+ }, P = () => {
2596
+ l.value = "", c.value = !1, h = null, Fe();
2597
+ }, V = (d) => {
2598
+ mr(d), i("copy", d);
2599
+ }, N = (d) => {
2600
+ fr(h, d == null ? void 0 : d.result) && (l.value = d.result, h = null), i("replace", d);
2601
+ }, De = (d) => {
2602
+ d != null && d.action && (u.value = d.action), i("write", d);
2603
+ }, Rt = (d) => {
2604
+ if ($t(c.value, l.value)) {
2605
+ i("write", {
2606
+ text: l.value,
2607
+ action: u.value || Ee
2608
+ });
2609
+ return;
2303
2610
  }
2304
- }, V = (g) => {
2305
- u.value && (m.value = {
2306
- x: g.clientX - h.value.x,
2307
- y: g.clientY - h.value.y
2611
+ i("toggleKey", d);
2612
+ }, It = (d) => {
2613
+ d.stopPropagation();
2614
+ }, Fe = async () => {
2615
+ Ne(), a.value = !1, y.value = null, T.value = !1, i("close");
2616
+ }, Bt = (d) => {
2617
+ g.value = d, i("themeChange", d);
2618
+ }, Mt = ({ type: d, event: b }) => {
2619
+ f.value = !0;
2620
+ const I = o.value.getBoundingClientRect();
2621
+ if (d === "mouse")
2622
+ w.value = {
2623
+ x: b.clientX - I.left,
2624
+ y: b.clientY - I.top
2625
+ }, document.addEventListener("mousemove", We), document.addEventListener("mouseup", ze);
2626
+ else if (d === "touch") {
2627
+ const le = b.touches[0];
2628
+ w.value = {
2629
+ x: le.clientX - I.left,
2630
+ y: le.clientY - I.top
2631
+ }, document.addEventListener("touchmove", _e), document.addEventListener("touchend", Pe);
2632
+ }
2633
+ }, We = (d) => {
2634
+ f.value && (y.value = {
2635
+ x: d.clientX - w.value.x,
2636
+ y: d.clientY - w.value.y
2308
2637
  });
2309
- }, P = (g) => {
2310
- if (!u.value) return;
2311
- const C = g.touches[0];
2312
- m.value = {
2313
- x: C.clientX - h.value.x,
2314
- y: C.clientY - h.value.y
2638
+ }, _e = (d) => {
2639
+ if (!f.value) return;
2640
+ const b = d.touches[0];
2641
+ y.value = {
2642
+ x: b.clientX - w.value.x,
2643
+ y: b.clientY - w.value.y
2315
2644
  };
2316
- }, he = () => {
2317
- u.value && De(), u.value = !1, document.removeEventListener("mousemove", V), document.removeEventListener("mouseup", he);
2318
- }, Me = () => {
2319
- u.value && De(), u.value = !1, document.removeEventListener("touchmove", P), document.removeEventListener("touchend", Me);
2320
- }, Ke = () => u.value || d.value ? !0 : y ? (y = !1, clearTimeout(L), !0) : !1, De = () => {
2321
- y = !0, clearTimeout(L), L = window.setTimeout(() => {
2322
- y = !1;
2645
+ }, ze = () => {
2646
+ f.value && Ve(), f.value = !1, document.removeEventListener("mousemove", We), document.removeEventListener("mouseup", ze);
2647
+ }, Pe = () => {
2648
+ f.value && Ve(), f.value = !1, document.removeEventListener("touchmove", _e), document.removeEventListener("touchend", Pe);
2649
+ }, tt = () => f.value || m.value ? !0 : A ? (A = !1, clearTimeout(S), !0) : !1, Ve = () => {
2650
+ A = !0, clearTimeout(S), S = window.setTimeout(() => {
2651
+ A = !1;
2323
2652
  }, 50);
2324
- }, Et = () => {
2325
- !document.body || S || ($ = document.body.style.cursor, E = document.body.style.userSelect, document.body.style.cursor = "nwse-resize", document.body.style.userSelect = "none", S = !0);
2326
- }, Tt = () => {
2327
- !document.body || !S || (document.body.style.cursor = $, document.body.style.userSelect = E, S = !1);
2328
- }, $t = () => {
2329
- if (m.value || !i.value) return;
2330
- const g = i.value.getBoundingClientRect();
2331
- m.value = { x: g.left, y: g.top };
2332
- }, At = ({ axis: g, event: C }) => {
2333
- !r.value || !i.value || !r.value.offsetWidth || !r.value.offsetHeight || (d.value = !0, v.value = {
2334
- x: C.clientX,
2335
- y: C.clientY,
2336
- width: r.value.offsetWidth,
2337
- height: r.value.offsetHeight,
2338
- axis: g,
2653
+ }, Ot = {
2654
+ n: "ns-resize",
2655
+ s: "ns-resize",
2656
+ e: "ew-resize",
2657
+ w: "ew-resize",
2658
+ ne: "nesw-resize",
2659
+ sw: "nesw-resize",
2660
+ nw: "nwse-resize",
2661
+ se: "nwse-resize"
2662
+ }, Dt = (d) => {
2663
+ !document.body || B || (E = document.body.style.cursor, D = document.body.style.userSelect, document.body.style.cursor = Ot[d] || "nwse-resize", document.body.style.userSelect = "none", B = !0);
2664
+ }, Ft = () => {
2665
+ !document.body || !B || (document.body.style.cursor = E, document.body.style.userSelect = D, B = !1);
2666
+ }, Wt = ({ edge: d, event: b }) => {
2667
+ if (!s.value || !o.value || !s.value.offsetWidth || !s.value.offsetHeight) return;
2668
+ const I = o.value.getBoundingClientRect();
2669
+ m.value = !0, x.value = {
2670
+ pointerX: b.clientX,
2671
+ pointerY: b.clientY,
2672
+ left: I.left,
2673
+ top: I.top,
2674
+ width: s.value.offsetWidth,
2675
+ height: s.value.offsetHeight,
2676
+ edge: d,
2339
2677
  moved: !1
2340
- }, Et(), document.addEventListener("pointermove", Ge), document.addEventListener("pointerup", Se), document.addEventListener("pointercancel", Se));
2341
- }, kt = (g, C) => {
2342
- if (!d.value || !v.value || !i.value) return;
2343
- const A = g - v.value.x, le = C - v.value.y;
2344
- if (!v.value.moved && !Bi(A, le)) return;
2345
- v.value.moved || (v.value.moved = !0, $t());
2346
- const qe = i.value.getBoundingClientRect(), Je = Mi({
2347
- left: qe.left,
2348
- top: qe.top,
2678
+ }, Dt(d), document.addEventListener("pointermove", nt), document.addEventListener("pointerup", xe), document.addEventListener("pointercancel", xe);
2679
+ }, _t = (d, b) => {
2680
+ if (!m.value || !x.value || !o.value) return;
2681
+ const I = d - x.value.pointerX, le = b - x.value.pointerY;
2682
+ if (!x.value.moved && !cr(I, le)) return;
2683
+ x.value.moved = !0;
2684
+ const Le = ur({
2685
+ x: x.value.left,
2686
+ y: x.value.top,
2687
+ width: x.value.width,
2688
+ height: x.value.height,
2689
+ dx: I,
2690
+ dy: le,
2349
2691
  scale: n.scale,
2692
+ edge: x.value.edge,
2693
+ minWidth: Xo,
2694
+ minHeight: qo,
2350
2695
  viewportWidth: window.innerWidth,
2351
2696
  viewportHeight: window.innerHeight,
2352
- margin: Ci
2353
- });
2354
- f.value = Ii({
2355
- width: v.value.width,
2356
- height: v.value.height,
2357
- dx: A,
2358
- dy: le,
2359
- scale: n.scale,
2360
- axis: v.value.axis,
2361
- minWidth: _e,
2362
- minHeight: vi,
2363
- maxWidth: Je.maxWidth,
2364
- maxHeight: Je.maxHeight
2697
+ margin: Yo
2365
2698
  });
2366
- }, Ge = (g) => {
2367
- g.cancelable && g.preventDefault(), kt(g.clientX, g.clientY);
2368
- }, Se = () => {
2369
- Oe();
2370
- }, Oe = () => {
2371
- d.value && De(), d.value = !1, v.value = null, Tt(), document.removeEventListener("pointermove", Ge), document.removeEventListener("pointerup", Se), document.removeEventListener("pointercancel", Se);
2372
- }, Rt = () => {
2373
- f.value = null, Fe(D);
2374
- }, Bt = () => {
2375
- var C;
2376
- const g = (C = n == null ? void 0 : n.translation) == null ? void 0 : C.target;
2377
- bi.includes(g) ? dt.supportRTL() : dt.removeRTL();
2699
+ y.value = { x: Le.x, y: Le.y }, L.value = { width: Le.width, height: Le.height };
2700
+ }, nt = (d) => {
2701
+ d.cancelable && d.preventDefault(), _t(d.clientX, d.clientY);
2702
+ }, xe = () => {
2703
+ Ne();
2704
+ }, Ne = () => {
2705
+ m.value && Ve(), m.value = !1, x.value = null, Ft(), document.removeEventListener("pointermove", nt), document.removeEventListener("pointerup", xe), document.removeEventListener("pointercancel", xe);
2706
+ }, zt = () => {
2707
+ var b;
2708
+ const d = (b = n == null ? void 0 : n.translation) == null ? void 0 : b.target;
2709
+ Go.includes(d) ? pt.supportRTL() : pt.removeRTL();
2378
2710
  };
2379
- return ue(
2711
+ return Q(
2380
2712
  () => n.status,
2381
2713
  () => {
2382
- a.value && Fe(D), Bt();
2714
+ a.value && it(he), zt();
2383
2715
  }
2384
- ), ue(
2716
+ ), Q(
2385
2717
  () => n.theme,
2386
- (g) => {
2387
- c.value = g;
2718
+ (d) => {
2719
+ g.value = d;
2388
2720
  }
2389
- ), (g, C) => (p(), w(be, null, [
2390
- a.value ? (p(), w("div", {
2721
+ ), (d, b) => (p(), v(K, null, [
2722
+ a.value ? (p(), v("div", {
2391
2723
  key: 0,
2392
2724
  ref_key: "floatingEl",
2393
- ref: i,
2394
- style: Pe(ee.value),
2395
- onClick: j
2725
+ ref: o,
2726
+ style: Ze(j.value),
2727
+ onClick: It
2396
2728
  }, [
2397
- b("div", {
2729
+ C("div", {
2398
2730
  ref_key: "contentEl",
2399
- ref: r,
2731
+ ref: s,
2400
2732
  class: "relative rounded-lg",
2401
- style: Pe(Le.value),
2402
- "data-theme": c.value
2733
+ style: Ze(ye.value),
2734
+ "data-theme": g.value
2403
2735
  }, [
2404
- H(Si, {
2736
+ O(tr, {
2405
2737
  translation: n.translation,
2406
2738
  explanation: n.explanation,
2407
2739
  tts: n.tts,
@@ -2411,32 +2743,40 @@ const Di = {
2411
2743
  isAITranslate: n.isAITranslate,
2412
2744
  isAIExplain: n.isAIExplain,
2413
2745
  aiExplainMinLength: n.aiExplainMinLength,
2414
- theme: c.value,
2746
+ theme: g.value,
2415
2747
  showThemeSelector: n.showThemeSelector,
2416
- constrained: _.value,
2417
- onLogo: C[0] || (C[0] = (A) => o("logo")),
2418
- onFavorite: C[1] || (C[1] = (A) => o("favorite")),
2419
- onSettings: C[2] || (C[2] = (A) => o("settings")),
2420
- onClose: Y,
2421
- onLoadTTS: C[3] || (C[3] = (A) => o("loadTTS")),
2422
- onAiTranslate: C[4] || (C[4] = (A) => o("aiTranslate")),
2423
- onAiExplain: C[5] || (C[5] = (A) => o("aiExplain")),
2424
- onLearn: C[6] || (C[6] = (A) => o("learn", A)),
2425
- onThemeChange: te,
2426
- onDragStart: K,
2427
- onResizeStart: At,
2428
- onResizeReset: Rt
2429
- }, null, 8, ["translation", "explanation", "tts", "status", "isFavorite", "isFavoriteFeatureEnabled", "isAITranslate", "isAIExplain", "aiExplainMinLength", "theme", "showThemeSelector", "constrained"])
2430
- ], 12, Oi)
2748
+ constrained: pe.value,
2749
+ mode: n.mode,
2750
+ writing: n.writing,
2751
+ writeAction: u.value,
2752
+ isWriteLoading: n.isWriteLoading,
2753
+ editable: c.value,
2754
+ selectedText: l.value,
2755
+ onLogo: b[0] || (b[0] = (I) => i("logo")),
2756
+ onWrite: De,
2757
+ onReplace: N,
2758
+ onCopy: V,
2759
+ onFavorite: b[1] || (b[1] = (I) => i("favorite")),
2760
+ onSettings: b[2] || (b[2] = (I) => i("settings")),
2761
+ onClose: Fe,
2762
+ onLoadTTS: b[3] || (b[3] = (I) => i("loadTTS")),
2763
+ onAiTranslate: b[4] || (b[4] = (I) => i("aiTranslate")),
2764
+ onAiExplain: b[5] || (b[5] = (I) => i("aiExplain")),
2765
+ onLearn: b[6] || (b[6] = (I) => i("learn", I)),
2766
+ onThemeChange: Bt,
2767
+ onDragStart: Mt,
2768
+ onResizeStart: Wt
2769
+ }, null, 8, ["translation", "explanation", "tts", "status", "isFavorite", "isFavoriteFeatureEnabled", "isAITranslate", "isAIExplain", "aiExplainMinLength", "theme", "showThemeSelector", "constrained", "mode", "writing", "writeAction", "isWriteLoading", "editable", "selectedText"])
2770
+ ], 12, yr)
2431
2771
  ], 4)) : M("", !0),
2432
- H(Di, {
2772
+ O(wr, {
2433
2773
  textSelected: l.value,
2434
- onToggleKey: C[7] || (C[7] = (A) => o("toggleKey", A)),
2435
- onClose: Y
2774
+ onToggleKey: Rt,
2775
+ onClose: Fe
2436
2776
  }, null, 8, ["textSelected"])
2437
2777
  ], 64));
2438
2778
  }
2439
2779
  };
2440
2780
  export {
2441
- zi as default
2781
+ Lr as default
2442
2782
  };