@opentiny/tiny-robot 0.3.0-alpha.13 → 0.3.0-alpha.15
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/action-group/index.js +7 -7
- package/dist/attachments/index.js +71 -71
- package/dist/bubble/index.js +1905 -1171
- package/dist/container/index.js +29 -29
- package/dist/feedback/index.js +52 -52
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/history/index.js +30 -30
- package/dist/index.d.ts +438 -388
- package/dist/index.js +74 -68
- package/dist/index3.js +283 -269
- package/dist/loading.js +4 -0
- package/dist/mcp-server-picker/index.js +632 -632
- package/dist/question/index.js +54 -54
- package/dist/sender/index.js +835 -812
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +62 -62
- package/dist/suggestion-pills/index.js +1 -1
- package/dist/suggestion-popover/index.js +185 -184
- package/dist/tiny-robot-svgs.js +377 -257
- package/package.json +4 -3
package/dist/index3.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { onMounted as re, nextTick as
|
|
1
|
+
import { onMounted as re, nextTick as me, watch as k, getCurrentScope as ge, onScopeDispose as we, getCurrentInstance as j, isRef as ie, toValue as w, hasInjectionContext as le, inject as be, toRefs as ye, customRef as Oe, shallowRef as y, computed as P, reactive as Z, unref as Se, watchEffect as se, ref as ue, readonly as Te } from "vue";
|
|
2
2
|
function z(e) {
|
|
3
|
-
return
|
|
3
|
+
return ge() ? (we(e), !0) : !1;
|
|
4
4
|
}
|
|
5
|
+
// @__NO_SIDE_EFFECTS__
|
|
5
6
|
function ee() {
|
|
6
7
|
const e = /* @__PURE__ */ new Set(), t = (i) => {
|
|
7
8
|
e.delete(i);
|
|
@@ -9,24 +10,24 @@ function ee() {
|
|
|
9
10
|
return {
|
|
10
11
|
on: (i) => {
|
|
11
12
|
e.add(i);
|
|
12
|
-
const
|
|
13
|
-
return z(
|
|
14
|
-
off:
|
|
13
|
+
const a = () => t(i);
|
|
14
|
+
return z(a), {
|
|
15
|
+
off: a
|
|
15
16
|
};
|
|
16
17
|
},
|
|
17
18
|
off: t,
|
|
18
|
-
trigger: (...i) => Promise.all(Array.from(e).map((
|
|
19
|
+
trigger: (...i) => Promise.all(Array.from(e).map((a) => a(...i))),
|
|
19
20
|
clear: () => {
|
|
20
21
|
e.clear();
|
|
21
22
|
}
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
|
-
const B = /* @__PURE__ */ new WeakMap(), Ee = (...e) => {
|
|
25
|
+
const B = /* @__PURE__ */ new WeakMap(), Ee = /* @__NO_SIDE_EFFECTS__ */ (...e) => {
|
|
25
26
|
var t;
|
|
26
27
|
const o = e[0], n = (t = j()) == null ? void 0 : t.proxy;
|
|
27
28
|
if (n == null && !le())
|
|
28
29
|
throw new Error("injectLocal must be called in setup");
|
|
29
|
-
return n && B.has(n) && o in B.get(n) ? B.get(n)[o] :
|
|
30
|
+
return n && B.has(n) && o in B.get(n) ? B.get(n)[o] : be(...e);
|
|
30
31
|
}, $ = typeof window < "u" && typeof document < "u";
|
|
31
32
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
32
33
|
const xe = (e) => e != null, We = Object.prototype.toString, Me = (e) => We.call(e) === "[object Object]", W = () => {
|
|
@@ -44,36 +45,36 @@ function Y(e, t) {
|
|
|
44
45
|
return o;
|
|
45
46
|
}
|
|
46
47
|
const Fe = (e) => e();
|
|
47
|
-
function
|
|
48
|
+
function ce(e, t = {}) {
|
|
48
49
|
let o, n, u = W;
|
|
49
|
-
const i = (
|
|
50
|
-
clearTimeout(
|
|
50
|
+
const i = (s) => {
|
|
51
|
+
clearTimeout(s), u(), u = W;
|
|
51
52
|
};
|
|
52
|
-
let
|
|
53
|
-
return (
|
|
54
|
-
const d =
|
|
55
|
-
return o && i(o), d <= 0 ||
|
|
56
|
-
u = t.rejectOnCancel ?
|
|
57
|
-
o && i(o), n = void 0,
|
|
58
|
-
},
|
|
59
|
-
n && i(n), n = void 0, s(
|
|
53
|
+
let a;
|
|
54
|
+
return (s) => {
|
|
55
|
+
const d = w(e), v = w(t.maxWait);
|
|
56
|
+
return o && i(o), d <= 0 || v !== void 0 && v <= 0 ? (n && (i(n), n = void 0), Promise.resolve(s())) : new Promise((l, c) => {
|
|
57
|
+
u = t.rejectOnCancel ? c : l, a = s, v && !n && (n = setTimeout(() => {
|
|
58
|
+
o && i(o), n = void 0, l(a());
|
|
59
|
+
}, v)), o = setTimeout(() => {
|
|
60
|
+
n && i(n), n = void 0, l(s());
|
|
60
61
|
}, d);
|
|
61
62
|
});
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
-
let t = 0, o, n = !0, u = W, i,
|
|
66
|
-
!ie(e[0]) && typeof e[0] == "object" ? { delay:
|
|
67
|
-
const
|
|
65
|
+
function ae(...e) {
|
|
66
|
+
let t = 0, o, n = !0, u = W, i, a, r, s, d;
|
|
67
|
+
!ie(e[0]) && typeof e[0] == "object" ? { delay: a, trailing: r = !0, leading: s = !0, rejectOnCancel: d = !1 } = e[0] : [a, r = !0, s = !0, d = !1] = e;
|
|
68
|
+
const v = () => {
|
|
68
69
|
o && (clearTimeout(o), o = void 0, u(), u = W);
|
|
69
70
|
};
|
|
70
|
-
return (
|
|
71
|
-
const p =
|
|
72
|
-
return
|
|
73
|
-
u = d ?
|
|
74
|
-
t = Date.now(), n = !0, f(
|
|
75
|
-
}, Math.max(0, p -
|
|
76
|
-
})), !
|
|
71
|
+
return (c) => {
|
|
72
|
+
const p = w(a), h = Date.now() - t, O = () => i = c();
|
|
73
|
+
return v(), p <= 0 ? (t = Date.now(), O()) : (h > p && (s || !n) ? (t = Date.now(), O()) : r && (i = new Promise((f, m) => {
|
|
74
|
+
u = d ? m : f, o = setTimeout(() => {
|
|
75
|
+
t = Date.now(), n = !0, f(O()), v();
|
|
76
|
+
}, Math.max(0, p - h));
|
|
77
|
+
})), !s && !o && (o = setTimeout(() => n = !0, p)), n = !1, i);
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
80
|
function te(e) {
|
|
@@ -82,25 +83,27 @@ function te(e) {
|
|
|
82
83
|
function _e(e, t, o = !1) {
|
|
83
84
|
return t.reduce((n, u) => (u in e && (!o || e[u] !== void 0) && (n[u] = e[u]), n), {});
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function C(e) {
|
|
86
87
|
return Array.isArray(e) ? e : [e];
|
|
87
88
|
}
|
|
88
89
|
function Le(e) {
|
|
89
90
|
return j();
|
|
90
91
|
}
|
|
92
|
+
// @__NO_SIDE_EFFECTS__
|
|
91
93
|
function ke(e, t = 200, o = {}) {
|
|
92
94
|
return Y(
|
|
93
|
-
|
|
95
|
+
ce(t, o),
|
|
94
96
|
e
|
|
95
97
|
);
|
|
96
98
|
}
|
|
99
|
+
// @__NO_SIDE_EFFECTS__
|
|
97
100
|
function De(e, t = 200, o = !1, n = !0, u = !1) {
|
|
98
101
|
return Y(
|
|
99
|
-
|
|
102
|
+
ae(t, o, n, u),
|
|
100
103
|
e
|
|
101
104
|
);
|
|
102
105
|
}
|
|
103
|
-
function
|
|
106
|
+
function fe(e, t, o = {}) {
|
|
104
107
|
const {
|
|
105
108
|
eventFilter: n = Fe,
|
|
106
109
|
...u
|
|
@@ -114,18 +117,18 @@ function ae(e, t, o = {}) {
|
|
|
114
117
|
u
|
|
115
118
|
);
|
|
116
119
|
}
|
|
117
|
-
function
|
|
120
|
+
function Re(e, t = {}) {
|
|
118
121
|
if (!ie(e))
|
|
119
|
-
return
|
|
122
|
+
return ye(e);
|
|
120
123
|
const o = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
121
124
|
for (const n in e.value)
|
|
122
|
-
o[n] =
|
|
125
|
+
o[n] = Oe(() => ({
|
|
123
126
|
get() {
|
|
124
127
|
return e.value[n];
|
|
125
128
|
},
|
|
126
129
|
set(u) {
|
|
127
130
|
var i;
|
|
128
|
-
if ((i =
|
|
131
|
+
if ((i = w(t.replaceRef)) != null ? i : !0)
|
|
129
132
|
if (Array.isArray(e.value)) {
|
|
130
133
|
const r = [...e.value];
|
|
131
134
|
r[n] = u, e.value = r;
|
|
@@ -140,7 +143,7 @@ function Ce(e, t = {}) {
|
|
|
140
143
|
return o;
|
|
141
144
|
}
|
|
142
145
|
function N(e, t = !0, o) {
|
|
143
|
-
Le() ? re(e, o) : t ? e() :
|
|
146
|
+
Le() ? re(e, o) : t ? e() : me(e);
|
|
144
147
|
}
|
|
145
148
|
function Xe(e, t, o = {}) {
|
|
146
149
|
const {
|
|
@@ -148,16 +151,16 @@ function Xe(e, t, o = {}) {
|
|
|
148
151
|
maxWait: u = void 0,
|
|
149
152
|
...i
|
|
150
153
|
} = o;
|
|
151
|
-
return
|
|
154
|
+
return fe(
|
|
152
155
|
e,
|
|
153
156
|
t,
|
|
154
157
|
{
|
|
155
158
|
...i,
|
|
156
|
-
eventFilter:
|
|
159
|
+
eventFilter: ce(n, { maxWait: u })
|
|
157
160
|
}
|
|
158
161
|
);
|
|
159
162
|
}
|
|
160
|
-
function
|
|
163
|
+
function Ce(e, t, o) {
|
|
161
164
|
return k(
|
|
162
165
|
e,
|
|
163
166
|
t,
|
|
@@ -172,204 +175,207 @@ function Qe(e, t, o = {}) {
|
|
|
172
175
|
throttle: n = 0,
|
|
173
176
|
trailing: u = !0,
|
|
174
177
|
leading: i = !0,
|
|
175
|
-
...
|
|
178
|
+
...a
|
|
176
179
|
} = o;
|
|
177
|
-
return
|
|
180
|
+
return fe(
|
|
178
181
|
e,
|
|
179
182
|
t,
|
|
180
183
|
{
|
|
181
|
-
...
|
|
182
|
-
eventFilter:
|
|
184
|
+
...a,
|
|
185
|
+
eventFilter: ae(n, u, i)
|
|
183
186
|
}
|
|
184
187
|
);
|
|
185
188
|
}
|
|
186
|
-
const
|
|
187
|
-
function
|
|
189
|
+
const A = $ ? window : void 0, Ve = $ ? window.document : void 0;
|
|
190
|
+
function S(e) {
|
|
188
191
|
var t;
|
|
189
|
-
const o =
|
|
192
|
+
const o = w(e);
|
|
190
193
|
return (t = o == null ? void 0 : o.$el) != null ? t : o;
|
|
191
194
|
}
|
|
192
195
|
function M(...e) {
|
|
193
196
|
const t = [], o = () => {
|
|
194
197
|
t.forEach((r) => r()), t.length = 0;
|
|
195
|
-
}, n = (r,
|
|
196
|
-
const r =
|
|
197
|
-
return r.every((
|
|
198
|
-
}), i =
|
|
198
|
+
}, n = (r, s, d, v) => (r.addEventListener(s, d, v), () => r.removeEventListener(s, d, v)), u = P(() => {
|
|
199
|
+
const r = C(w(e[0])).filter((s) => s != null);
|
|
200
|
+
return r.every((s) => typeof s != "string") ? r : void 0;
|
|
201
|
+
}), i = Ce(
|
|
199
202
|
() => {
|
|
200
|
-
var r,
|
|
203
|
+
var r, s;
|
|
201
204
|
return [
|
|
202
|
-
(
|
|
203
|
-
|
|
204
|
-
|
|
205
|
+
(s = (r = u.value) == null ? void 0 : r.map((d) => S(d))) != null ? s : [A].filter((d) => d != null),
|
|
206
|
+
C(w(u.value ? e[1] : e[0])),
|
|
207
|
+
C(Se(u.value ? e[2] : e[1])),
|
|
205
208
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
206
|
-
|
|
209
|
+
w(u.value ? e[3] : e[2])
|
|
207
210
|
];
|
|
208
211
|
},
|
|
209
|
-
([r,
|
|
210
|
-
if (o(), !(r != null && r.length) || !(
|
|
212
|
+
([r, s, d, v]) => {
|
|
213
|
+
if (o(), !(r != null && r.length) || !(s != null && s.length) || !(d != null && d.length))
|
|
211
214
|
return;
|
|
212
|
-
const
|
|
215
|
+
const l = Me(v) ? { ...v } : v;
|
|
213
216
|
t.push(
|
|
214
217
|
...r.flatMap(
|
|
215
|
-
(
|
|
216
|
-
(p) => d.map((
|
|
218
|
+
(c) => s.flatMap(
|
|
219
|
+
(p) => d.map((h) => n(c, p, h, l))
|
|
217
220
|
)
|
|
218
221
|
)
|
|
219
222
|
);
|
|
220
223
|
},
|
|
221
224
|
{ flush: "post" }
|
|
222
|
-
),
|
|
225
|
+
), a = () => {
|
|
223
226
|
i(), o();
|
|
224
227
|
};
|
|
225
|
-
return z(o),
|
|
228
|
+
return z(o), a;
|
|
226
229
|
}
|
|
227
230
|
let ne = !1;
|
|
228
231
|
function Ue(e, t, o = {}) {
|
|
229
|
-
const { window: n =
|
|
232
|
+
const { window: n = A, ignore: u = [], capture: i = !0, detectIframe: a = !1, controls: r = !1 } = o;
|
|
230
233
|
if (!n)
|
|
231
234
|
return r ? { stop: W, cancel: W, trigger: W } : W;
|
|
232
235
|
if (Pe && !ne) {
|
|
233
236
|
ne = !0;
|
|
234
237
|
const f = { passive: !0 };
|
|
235
|
-
Array.from(n.document.body.children).forEach((
|
|
238
|
+
Array.from(n.document.body.children).forEach((m) => m.addEventListener("click", W, f)), n.document.documentElement.addEventListener("click", W, f);
|
|
236
239
|
}
|
|
237
|
-
let
|
|
238
|
-
const d = (f) =>
|
|
239
|
-
if (typeof
|
|
240
|
-
return Array.from(n.document.querySelectorAll(
|
|
240
|
+
let s = !0;
|
|
241
|
+
const d = (f) => w(u).some((m) => {
|
|
242
|
+
if (typeof m == "string")
|
|
243
|
+
return Array.from(n.document.querySelectorAll(m)).some((b) => b === f.target || f.composedPath().includes(b));
|
|
241
244
|
{
|
|
242
|
-
const
|
|
243
|
-
return
|
|
245
|
+
const b = S(m);
|
|
246
|
+
return b && (f.target === b || f.composedPath().includes(b));
|
|
244
247
|
}
|
|
245
248
|
});
|
|
246
|
-
function
|
|
247
|
-
const
|
|
248
|
-
return
|
|
249
|
+
function v(f) {
|
|
250
|
+
const m = w(f);
|
|
251
|
+
return m && m.$.subTree.shapeFlag === 16;
|
|
249
252
|
}
|
|
250
|
-
function
|
|
251
|
-
const
|
|
252
|
-
return
|
|
253
|
+
function l(f, m) {
|
|
254
|
+
const b = w(f), T = b.$.subTree && b.$.subTree.children;
|
|
255
|
+
return T == null || !Array.isArray(T) ? !1 : T.some((E) => E.el === m.target || m.composedPath().includes(E.el));
|
|
253
256
|
}
|
|
254
|
-
const
|
|
255
|
-
const
|
|
256
|
-
if (f.target != null && !(!(
|
|
257
|
-
if ("detail" in f && f.detail === 0 && (
|
|
258
|
-
|
|
257
|
+
const c = (f) => {
|
|
258
|
+
const m = S(e);
|
|
259
|
+
if (f.target != null && !(!(m instanceof Element) && v(e) && l(e, f)) && !(!m || m === f.target || f.composedPath().includes(m))) {
|
|
260
|
+
if ("detail" in f && f.detail === 0 && (s = !d(f)), !s) {
|
|
261
|
+
s = !0;
|
|
259
262
|
return;
|
|
260
263
|
}
|
|
261
264
|
t(f);
|
|
262
265
|
}
|
|
263
266
|
};
|
|
264
267
|
let p = !1;
|
|
265
|
-
const
|
|
268
|
+
const h = [
|
|
266
269
|
M(n, "click", (f) => {
|
|
267
270
|
p || (p = !0, setTimeout(() => {
|
|
268
271
|
p = !1;
|
|
269
|
-
}, 0),
|
|
272
|
+
}, 0), c(f));
|
|
270
273
|
}, { passive: !0, capture: i }),
|
|
271
274
|
M(n, "pointerdown", (f) => {
|
|
272
|
-
const
|
|
273
|
-
|
|
275
|
+
const m = S(e);
|
|
276
|
+
s = !d(f) && !!(m && !f.composedPath().includes(m));
|
|
274
277
|
}, { passive: !0 }),
|
|
275
|
-
|
|
278
|
+
a && M(n, "blur", (f) => {
|
|
276
279
|
setTimeout(() => {
|
|
277
|
-
var
|
|
278
|
-
const
|
|
279
|
-
((
|
|
280
|
+
var m;
|
|
281
|
+
const b = S(e);
|
|
282
|
+
((m = n.document.activeElement) == null ? void 0 : m.tagName) === "IFRAME" && !(b != null && b.contains(n.document.activeElement)) && t(f);
|
|
280
283
|
}, 0);
|
|
281
284
|
}, { passive: !0 })
|
|
282
|
-
].filter(Boolean),
|
|
285
|
+
].filter(Boolean), O = () => h.forEach((f) => f());
|
|
283
286
|
return r ? {
|
|
284
|
-
stop:
|
|
287
|
+
stop: O,
|
|
285
288
|
cancel: () => {
|
|
286
|
-
|
|
289
|
+
s = !1;
|
|
287
290
|
},
|
|
288
291
|
trigger: (f) => {
|
|
289
|
-
|
|
292
|
+
s = !0, c(f), s = !1;
|
|
290
293
|
}
|
|
291
|
-
} :
|
|
294
|
+
} : O;
|
|
292
295
|
}
|
|
296
|
+
// @__NO_SIDE_EFFECTS__
|
|
293
297
|
function He() {
|
|
294
298
|
const e = y(!1), t = j();
|
|
295
299
|
return t && re(() => {
|
|
296
300
|
e.value = !0;
|
|
297
301
|
}, t), e;
|
|
298
302
|
}
|
|
303
|
+
// @__NO_SIDE_EFFECTS__
|
|
299
304
|
function G(e) {
|
|
300
|
-
const t = He();
|
|
301
|
-
return
|
|
305
|
+
const t = /* @__PURE__ */ He();
|
|
306
|
+
return P(() => (t.value, !!e()));
|
|
302
307
|
}
|
|
303
|
-
function
|
|
304
|
-
const { window: n =
|
|
308
|
+
function de(e, t, o = {}) {
|
|
309
|
+
const { window: n = A, ...u } = o;
|
|
305
310
|
let i;
|
|
306
|
-
const
|
|
311
|
+
const a = /* @__PURE__ */ G(() => n && "MutationObserver" in n), r = () => {
|
|
307
312
|
i && (i.disconnect(), i = void 0);
|
|
308
|
-
},
|
|
309
|
-
const
|
|
313
|
+
}, s = P(() => {
|
|
314
|
+
const c = w(e), p = C(c).map(S).filter(xe);
|
|
310
315
|
return new Set(p);
|
|
311
316
|
}), d = k(
|
|
312
|
-
() =>
|
|
313
|
-
(
|
|
314
|
-
r(),
|
|
317
|
+
() => s.value,
|
|
318
|
+
(c) => {
|
|
319
|
+
r(), a.value && c.size && (i = new MutationObserver(t), c.forEach((p) => i.observe(p, u)));
|
|
315
320
|
},
|
|
316
321
|
{ immediate: !0, flush: "post" }
|
|
317
|
-
),
|
|
322
|
+
), v = () => i == null ? void 0 : i.takeRecords(), l = () => {
|
|
318
323
|
d(), r();
|
|
319
324
|
};
|
|
320
|
-
return z(
|
|
321
|
-
isSupported:
|
|
322
|
-
stop:
|
|
323
|
-
takeRecords:
|
|
325
|
+
return z(l), {
|
|
326
|
+
isSupported: a,
|
|
327
|
+
stop: l,
|
|
328
|
+
takeRecords: v
|
|
324
329
|
};
|
|
325
330
|
}
|
|
326
331
|
const ze = Symbol("vueuse-ssr-width");
|
|
332
|
+
// @__NO_SIDE_EFFECTS__
|
|
327
333
|
function Ne() {
|
|
328
|
-
const e = le() ? Ee(ze, null) : null;
|
|
334
|
+
const e = le() ? /* @__PURE__ */ Ee(ze, null) : null;
|
|
329
335
|
return typeof e == "number" ? e : void 0;
|
|
330
336
|
}
|
|
331
337
|
function Be(e, t = {}) {
|
|
332
|
-
const { window: o =
|
|
338
|
+
const { window: o = A, ssrWidth: n = /* @__PURE__ */ Ne() } = t, u = /* @__PURE__ */ G(() => o && "matchMedia" in o && typeof o.matchMedia == "function"), i = y(typeof n == "number"), a = y(), r = y(!1), s = (d) => {
|
|
333
339
|
r.value = d.matches;
|
|
334
340
|
};
|
|
335
|
-
return
|
|
341
|
+
return se(() => {
|
|
336
342
|
if (i.value) {
|
|
337
343
|
i.value = !u.value;
|
|
338
|
-
const d =
|
|
339
|
-
r.value = d.some((
|
|
340
|
-
const
|
|
341
|
-
let
|
|
342
|
-
return
|
|
344
|
+
const d = w(e).split(",");
|
|
345
|
+
r.value = d.some((v) => {
|
|
346
|
+
const l = v.includes("not all"), c = v.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), p = v.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
347
|
+
let h = !!(c || p);
|
|
348
|
+
return c && h && (h = n >= te(c[1])), p && h && (h = n <= te(p[1])), l ? !h : h;
|
|
343
349
|
});
|
|
344
350
|
return;
|
|
345
351
|
}
|
|
346
|
-
u.value && (
|
|
347
|
-
}), M(
|
|
352
|
+
u.value && (a.value = o.matchMedia(w(e)), r.value = a.value.matches);
|
|
353
|
+
}), M(a, "change", s, { passive: !0 }), P(() => r.value);
|
|
348
354
|
}
|
|
349
|
-
function
|
|
350
|
-
const { window: n =
|
|
355
|
+
function ve(e, t, o = {}) {
|
|
356
|
+
const { window: n = A, ...u } = o;
|
|
351
357
|
let i;
|
|
352
|
-
const
|
|
358
|
+
const a = /* @__PURE__ */ G(() => n && "ResizeObserver" in n), r = () => {
|
|
353
359
|
i && (i.disconnect(), i = void 0);
|
|
354
|
-
},
|
|
355
|
-
const
|
|
356
|
-
return Array.isArray(
|
|
360
|
+
}, s = P(() => {
|
|
361
|
+
const l = w(e);
|
|
362
|
+
return Array.isArray(l) ? l.map((c) => S(c)) : [S(l)];
|
|
357
363
|
}), d = k(
|
|
358
|
-
|
|
359
|
-
(
|
|
360
|
-
if (r(),
|
|
364
|
+
s,
|
|
365
|
+
(l) => {
|
|
366
|
+
if (r(), a.value && n) {
|
|
361
367
|
i = new ResizeObserver(t);
|
|
362
|
-
for (const
|
|
363
|
-
|
|
368
|
+
for (const c of l)
|
|
369
|
+
c && i.observe(c, u);
|
|
364
370
|
}
|
|
365
371
|
},
|
|
366
372
|
{ immediate: !0, flush: "post" }
|
|
367
|
-
),
|
|
373
|
+
), v = () => {
|
|
368
374
|
r(), d();
|
|
369
375
|
};
|
|
370
|
-
return z(
|
|
371
|
-
isSupported:
|
|
372
|
-
stop:
|
|
376
|
+
return z(v), {
|
|
377
|
+
isSupported: a,
|
|
378
|
+
stop: v
|
|
373
379
|
};
|
|
374
380
|
}
|
|
375
381
|
function qe(e, t = {}) {
|
|
@@ -378,75 +384,75 @@ function qe(e, t = {}) {
|
|
|
378
384
|
windowResize: n = !0,
|
|
379
385
|
windowScroll: u = !0,
|
|
380
386
|
immediate: i = !0,
|
|
381
|
-
updateTiming:
|
|
382
|
-
} = t, r = y(0),
|
|
383
|
-
function
|
|
384
|
-
const
|
|
385
|
-
if (!
|
|
386
|
-
o && (r.value = 0,
|
|
387
|
+
updateTiming: a = "sync"
|
|
388
|
+
} = t, r = y(0), s = y(0), d = y(0), v = y(0), l = y(0), c = y(0), p = y(0), h = y(0);
|
|
389
|
+
function O() {
|
|
390
|
+
const m = S(e);
|
|
391
|
+
if (!m) {
|
|
392
|
+
o && (r.value = 0, s.value = 0, d.value = 0, v.value = 0, l.value = 0, c.value = 0, p.value = 0, h.value = 0);
|
|
387
393
|
return;
|
|
388
394
|
}
|
|
389
|
-
const
|
|
390
|
-
r.value =
|
|
395
|
+
const b = m.getBoundingClientRect();
|
|
396
|
+
r.value = b.height, s.value = b.bottom, d.value = b.left, v.value = b.right, l.value = b.top, c.value = b.width, p.value = b.x, h.value = b.y;
|
|
391
397
|
}
|
|
392
398
|
function f() {
|
|
393
|
-
|
|
399
|
+
a === "sync" ? O() : a === "next-frame" && requestAnimationFrame(() => O());
|
|
394
400
|
}
|
|
395
|
-
return
|
|
401
|
+
return ve(e, f), k(() => S(e), (m) => !m && f()), de(e, f, {
|
|
396
402
|
attributeFilter: ["style", "class"]
|
|
397
403
|
}), u && M("scroll", f, { capture: !0, passive: !0 }), n && M("resize", f, { passive: !0 }), N(() => {
|
|
398
404
|
i && f();
|
|
399
405
|
}), {
|
|
400
406
|
height: r,
|
|
401
|
-
bottom:
|
|
407
|
+
bottom: s,
|
|
402
408
|
left: d,
|
|
403
|
-
right:
|
|
404
|
-
top:
|
|
405
|
-
width:
|
|
409
|
+
right: v,
|
|
410
|
+
top: l,
|
|
411
|
+
width: c,
|
|
406
412
|
x: p,
|
|
407
|
-
y:
|
|
413
|
+
y: h,
|
|
408
414
|
update: f
|
|
409
415
|
};
|
|
410
416
|
}
|
|
411
417
|
function Je(e, t = { width: 0, height: 0 }, o = {}) {
|
|
412
|
-
const { window: n =
|
|
413
|
-
var
|
|
414
|
-
return (
|
|
415
|
-
}),
|
|
418
|
+
const { window: n = A, box: u = "content-box" } = o, i = P(() => {
|
|
419
|
+
var l, c;
|
|
420
|
+
return (c = (l = S(e)) == null ? void 0 : l.namespaceURI) == null ? void 0 : c.includes("svg");
|
|
421
|
+
}), a = y(t.width), r = y(t.height), { stop: s } = ve(
|
|
416
422
|
e,
|
|
417
|
-
([
|
|
418
|
-
const
|
|
423
|
+
([l]) => {
|
|
424
|
+
const c = u === "border-box" ? l.borderBoxSize : u === "content-box" ? l.contentBoxSize : l.devicePixelContentBoxSize;
|
|
419
425
|
if (n && i.value) {
|
|
420
|
-
const p =
|
|
426
|
+
const p = S(e);
|
|
421
427
|
if (p) {
|
|
422
|
-
const
|
|
423
|
-
|
|
428
|
+
const h = p.getBoundingClientRect();
|
|
429
|
+
a.value = h.width, r.value = h.height;
|
|
424
430
|
}
|
|
425
|
-
} else if (
|
|
426
|
-
const p =
|
|
427
|
-
|
|
431
|
+
} else if (c) {
|
|
432
|
+
const p = C(c);
|
|
433
|
+
a.value = p.reduce((h, { inlineSize: O }) => h + O, 0), r.value = p.reduce((h, { blockSize: O }) => h + O, 0);
|
|
428
434
|
} else
|
|
429
|
-
|
|
435
|
+
a.value = l.contentRect.width, r.value = l.contentRect.height;
|
|
430
436
|
},
|
|
431
437
|
o
|
|
432
438
|
);
|
|
433
439
|
N(() => {
|
|
434
|
-
const
|
|
435
|
-
|
|
440
|
+
const l = S(e);
|
|
441
|
+
l && (a.value = "offsetWidth" in l ? l.offsetWidth : t.width, r.value = "offsetHeight" in l ? l.offsetHeight : t.height);
|
|
436
442
|
});
|
|
437
443
|
const d = k(
|
|
438
|
-
() =>
|
|
439
|
-
(
|
|
440
|
-
|
|
444
|
+
() => S(e),
|
|
445
|
+
(l) => {
|
|
446
|
+
a.value = l ? t.width : 0, r.value = l ? t.height : 0;
|
|
441
447
|
}
|
|
442
448
|
);
|
|
443
|
-
function
|
|
444
|
-
|
|
449
|
+
function v() {
|
|
450
|
+
s(), d();
|
|
445
451
|
}
|
|
446
452
|
return {
|
|
447
|
-
width:
|
|
453
|
+
width: a,
|
|
448
454
|
height: r,
|
|
449
|
-
stop:
|
|
455
|
+
stop: v
|
|
450
456
|
};
|
|
451
457
|
}
|
|
452
458
|
const je = {
|
|
@@ -468,30 +474,37 @@ function $e(e) {
|
|
|
468
474
|
function Ke(e = {}) {
|
|
469
475
|
const {
|
|
470
476
|
document: t = Ve
|
|
471
|
-
} = e, o =
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
c()
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
477
|
+
} = e, o = ue($e(e.initialFiles)), { on: n, trigger: u } = /* @__PURE__ */ ee(), { on: i, trigger: a } = /* @__PURE__ */ ee(), r = P(() => {
|
|
478
|
+
var l;
|
|
479
|
+
const c = (l = S(e.input)) != null ? l : t ? t.createElement("input") : void 0;
|
|
480
|
+
return c && (c.type = "file", c.onchange = (p) => {
|
|
481
|
+
const h = p.target;
|
|
482
|
+
o.value = h.files, u(o.value);
|
|
483
|
+
}, c.oncancel = () => {
|
|
484
|
+
a();
|
|
485
|
+
}), c;
|
|
486
|
+
}), s = () => {
|
|
487
|
+
o.value = null, r.value && r.value.value && (r.value.value = "", u(null));
|
|
488
|
+
}, d = (l) => {
|
|
489
|
+
const c = r.value;
|
|
490
|
+
c && (c.multiple = w(l.multiple), c.accept = w(l.accept), c.webkitdirectory = w(l.directory), Ie(l, "capture") && (c.capture = w(l.capture)));
|
|
491
|
+
}, v = (l) => {
|
|
492
|
+
const c = r.value;
|
|
493
|
+
if (!c)
|
|
483
494
|
return;
|
|
484
|
-
const
|
|
495
|
+
const p = {
|
|
485
496
|
...je,
|
|
486
497
|
...e,
|
|
487
|
-
...
|
|
498
|
+
...l
|
|
488
499
|
};
|
|
489
|
-
|
|
500
|
+
d(p), w(p.reset) && s(), c.click();
|
|
490
501
|
};
|
|
491
|
-
return {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
502
|
+
return se(() => {
|
|
503
|
+
d(e);
|
|
504
|
+
}), {
|
|
505
|
+
files: Te(o),
|
|
506
|
+
open: v,
|
|
507
|
+
reset: s,
|
|
495
508
|
onCancel: i,
|
|
496
509
|
onChange: n
|
|
497
510
|
};
|
|
@@ -503,7 +516,7 @@ function Ze(e, t = {}) {
|
|
|
503
516
|
idle: n = 200,
|
|
504
517
|
onStop: u = W,
|
|
505
518
|
onScroll: i = W,
|
|
506
|
-
offset:
|
|
519
|
+
offset: a = {
|
|
507
520
|
left: 0,
|
|
508
521
|
right: 0,
|
|
509
522
|
top: 0,
|
|
@@ -512,48 +525,48 @@ function Ze(e, t = {}) {
|
|
|
512
525
|
observe: r = {
|
|
513
526
|
mutation: !1
|
|
514
527
|
},
|
|
515
|
-
eventListenerOptions:
|
|
528
|
+
eventListenerOptions: s = {
|
|
516
529
|
capture: !1,
|
|
517
530
|
passive: !0
|
|
518
531
|
},
|
|
519
532
|
behavior: d = "auto",
|
|
520
|
-
window:
|
|
521
|
-
onError:
|
|
522
|
-
console.error(
|
|
533
|
+
window: v = A,
|
|
534
|
+
onError: l = (g) => {
|
|
535
|
+
console.error(g);
|
|
523
536
|
}
|
|
524
|
-
} = t,
|
|
537
|
+
} = t, c = typeof r == "boolean" ? {
|
|
525
538
|
mutation: r
|
|
526
|
-
} : r, p = y(0),
|
|
539
|
+
} : r, p = y(0), h = y(0), O = P({
|
|
527
540
|
get() {
|
|
528
541
|
return p.value;
|
|
529
542
|
},
|
|
530
|
-
set(
|
|
531
|
-
|
|
543
|
+
set(g) {
|
|
544
|
+
m(g, void 0);
|
|
532
545
|
}
|
|
533
|
-
}), f =
|
|
546
|
+
}), f = P({
|
|
534
547
|
get() {
|
|
535
|
-
return
|
|
548
|
+
return h.value;
|
|
536
549
|
},
|
|
537
|
-
set(
|
|
538
|
-
|
|
550
|
+
set(g) {
|
|
551
|
+
m(void 0, g);
|
|
539
552
|
}
|
|
540
553
|
});
|
|
541
|
-
function
|
|
542
|
-
var x, D,
|
|
543
|
-
if (!
|
|
554
|
+
function m(g, _) {
|
|
555
|
+
var x, D, R, H;
|
|
556
|
+
if (!v)
|
|
544
557
|
return;
|
|
545
|
-
const I =
|
|
558
|
+
const I = w(e);
|
|
546
559
|
if (!I)
|
|
547
560
|
return;
|
|
548
|
-
(
|
|
549
|
-
top: (x =
|
|
550
|
-
left: (D =
|
|
551
|
-
behavior:
|
|
561
|
+
(R = I instanceof Document ? v.document.body : I) == null || R.scrollTo({
|
|
562
|
+
top: (x = w(_)) != null ? x : f.value,
|
|
563
|
+
left: (D = w(g)) != null ? D : O.value,
|
|
564
|
+
behavior: w(d)
|
|
552
565
|
});
|
|
553
|
-
const
|
|
554
|
-
|
|
566
|
+
const F = ((H = I == null ? void 0 : I.document) == null ? void 0 : H.documentElement) || (I == null ? void 0 : I.documentElement) || I;
|
|
567
|
+
O != null && (p.value = F.scrollLeft), f != null && (h.value = F.scrollTop);
|
|
555
568
|
}
|
|
556
|
-
const
|
|
569
|
+
const b = y(!1), T = Z({
|
|
557
570
|
left: !0,
|
|
558
571
|
right: !1,
|
|
559
572
|
top: !0,
|
|
@@ -563,46 +576,46 @@ function Ze(e, t = {}) {
|
|
|
563
576
|
right: !1,
|
|
564
577
|
top: !1,
|
|
565
578
|
bottom: !1
|
|
566
|
-
}), X = (
|
|
567
|
-
|
|
568
|
-
},
|
|
579
|
+
}), X = (g) => {
|
|
580
|
+
b.value && (b.value = !1, E.left = !1, E.right = !1, E.top = !1, E.bottom = !1, u(g));
|
|
581
|
+
}, he = /* @__PURE__ */ ke(X, o + n), V = (g) => {
|
|
569
582
|
var _;
|
|
570
|
-
if (!
|
|
583
|
+
if (!v)
|
|
571
584
|
return;
|
|
572
|
-
const x = ((_ =
|
|
573
|
-
E.left =
|
|
574
|
-
const U = Math.abs(
|
|
575
|
-
D === "flex" &&
|
|
585
|
+
const x = ((_ = g == null ? void 0 : g.document) == null ? void 0 : _.documentElement) || (g == null ? void 0 : g.documentElement) || S(g), { display: D, flexDirection: R, direction: H } = getComputedStyle(x), I = H === "rtl" ? -1 : 1, F = x.scrollLeft;
|
|
586
|
+
E.left = F < p.value, E.right = F > p.value;
|
|
587
|
+
const U = Math.abs(F * I) <= (a.left || 0), q = Math.abs(F * I) + x.clientWidth >= x.scrollWidth - (a.right || 0) - oe;
|
|
588
|
+
D === "flex" && R === "row-reverse" ? (T.left = q, T.right = U) : (T.left = U, T.right = q), p.value = F;
|
|
576
589
|
let L = x.scrollTop;
|
|
577
|
-
|
|
578
|
-
const J = Math.abs(L) <= (
|
|
579
|
-
D === "flex" &&
|
|
580
|
-
}, Q = (
|
|
590
|
+
g === v.document && !L && (L = v.document.body.scrollTop), E.top = L < h.value, E.bottom = L > h.value;
|
|
591
|
+
const J = Math.abs(L) <= (a.top || 0), K = Math.abs(L) + x.clientHeight >= x.scrollHeight - (a.bottom || 0) - oe;
|
|
592
|
+
D === "flex" && R === "column-reverse" ? (T.top = K, T.bottom = J) : (T.top = J, T.bottom = K), h.value = L;
|
|
593
|
+
}, Q = (g) => {
|
|
581
594
|
var _;
|
|
582
|
-
if (!
|
|
595
|
+
if (!v)
|
|
583
596
|
return;
|
|
584
|
-
const x = (_ =
|
|
585
|
-
V(x),
|
|
597
|
+
const x = (_ = g.target.documentElement) != null ? _ : g.target;
|
|
598
|
+
V(x), b.value = !0, he(g), i(g);
|
|
586
599
|
};
|
|
587
600
|
return M(
|
|
588
601
|
e,
|
|
589
602
|
"scroll",
|
|
590
|
-
o ? De(Q, o, !0, !1) : Q,
|
|
591
|
-
|
|
603
|
+
o ? /* @__PURE__ */ De(Q, o, !0, !1) : Q,
|
|
604
|
+
s
|
|
592
605
|
), N(() => {
|
|
593
606
|
try {
|
|
594
|
-
const
|
|
595
|
-
if (!
|
|
607
|
+
const g = w(e);
|
|
608
|
+
if (!g)
|
|
596
609
|
return;
|
|
597
|
-
V(
|
|
598
|
-
} catch (
|
|
599
|
-
|
|
610
|
+
V(g);
|
|
611
|
+
} catch (g) {
|
|
612
|
+
l(g);
|
|
600
613
|
}
|
|
601
|
-
}),
|
|
614
|
+
}), c != null && c.mutation && e != null && e !== v && e !== document && de(
|
|
602
615
|
e,
|
|
603
616
|
() => {
|
|
604
|
-
const
|
|
605
|
-
|
|
617
|
+
const g = w(e);
|
|
618
|
+
g && V(g);
|
|
606
619
|
},
|
|
607
620
|
{
|
|
608
621
|
attributes: !0,
|
|
@@ -613,20 +626,20 @@ function Ze(e, t = {}) {
|
|
|
613
626
|
e,
|
|
614
627
|
"scrollend",
|
|
615
628
|
X,
|
|
616
|
-
|
|
629
|
+
s
|
|
617
630
|
), {
|
|
618
|
-
x:
|
|
631
|
+
x: O,
|
|
619
632
|
y: f,
|
|
620
|
-
isScrolling:
|
|
621
|
-
arrivedState:
|
|
633
|
+
isScrolling: b,
|
|
634
|
+
arrivedState: T,
|
|
622
635
|
directions: E,
|
|
623
636
|
measure() {
|
|
624
|
-
const
|
|
625
|
-
|
|
637
|
+
const g = w(e);
|
|
638
|
+
v && g && V(g);
|
|
626
639
|
}
|
|
627
640
|
};
|
|
628
641
|
}
|
|
629
|
-
const
|
|
642
|
+
const pe = {
|
|
630
643
|
x: 0,
|
|
631
644
|
y: 0,
|
|
632
645
|
pointerId: 0,
|
|
@@ -637,12 +650,12 @@ const ve = {
|
|
|
637
650
|
height: 0,
|
|
638
651
|
twist: 0,
|
|
639
652
|
pointerType: null
|
|
640
|
-
}, Ye = /* @__PURE__ */ Object.keys(
|
|
653
|
+
}, Ye = /* @__PURE__ */ Object.keys(pe);
|
|
641
654
|
function et(e = {}) {
|
|
642
655
|
const {
|
|
643
|
-
target: t =
|
|
644
|
-
} = e, o = y(!1), n =
|
|
645
|
-
Object.assign(n.value,
|
|
656
|
+
target: t = A
|
|
657
|
+
} = e, o = y(!1), n = ue(e.initialValue || {});
|
|
658
|
+
Object.assign(n.value, pe, n.value);
|
|
646
659
|
const u = (i) => {
|
|
647
660
|
o.value = !0, !(e.pointerTypes && !e.pointerTypes.includes(i.pointerType)) && (n.value = _e(i, Ye, !1));
|
|
648
661
|
};
|
|
@@ -651,38 +664,39 @@ function et(e = {}) {
|
|
|
651
664
|
M(t, ["pointerdown", "pointermove", "pointerup"], u, i), M(t, "pointerleave", () => o.value = !1, i);
|
|
652
665
|
}
|
|
653
666
|
return {
|
|
654
|
-
...
|
|
667
|
+
...Re(n),
|
|
655
668
|
isInside: o
|
|
656
669
|
};
|
|
657
670
|
}
|
|
671
|
+
// @__NO_SIDE_EFFECTS__
|
|
658
672
|
function tt(e = {}) {
|
|
659
673
|
const {
|
|
660
|
-
window: t =
|
|
674
|
+
window: t = A,
|
|
661
675
|
initialWidth: o = Number.POSITIVE_INFINITY,
|
|
662
676
|
initialHeight: n = Number.POSITIVE_INFINITY,
|
|
663
677
|
listenOrientation: u = !0,
|
|
664
678
|
includeScrollbar: i = !0,
|
|
665
|
-
type:
|
|
666
|
-
} = e, r = y(o),
|
|
679
|
+
type: a = "inner"
|
|
680
|
+
} = e, r = y(o), s = y(n), d = () => {
|
|
667
681
|
if (t)
|
|
668
|
-
if (
|
|
669
|
-
r.value = t.outerWidth,
|
|
670
|
-
else if (
|
|
671
|
-
const { width:
|
|
672
|
-
r.value = Math.round(
|
|
673
|
-
} else i ? (r.value = t.innerWidth,
|
|
682
|
+
if (a === "outer")
|
|
683
|
+
r.value = t.outerWidth, s.value = t.outerHeight;
|
|
684
|
+
else if (a === "visual" && t.visualViewport) {
|
|
685
|
+
const { width: l, height: c, scale: p } = t.visualViewport;
|
|
686
|
+
r.value = Math.round(l * p), s.value = Math.round(c * p);
|
|
687
|
+
} else i ? (r.value = t.innerWidth, s.value = t.innerHeight) : (r.value = t.document.documentElement.clientWidth, s.value = t.document.documentElement.clientHeight);
|
|
674
688
|
};
|
|
675
689
|
d(), N(d);
|
|
676
|
-
const
|
|
677
|
-
if (M("resize", d,
|
|
678
|
-
const
|
|
679
|
-
k(
|
|
690
|
+
const v = { passive: !0 };
|
|
691
|
+
if (M("resize", d, v), t && a === "visual" && t.visualViewport && M(t.visualViewport, "resize", d, v), u) {
|
|
692
|
+
const l = Be("(orientation: portrait)");
|
|
693
|
+
k(l, () => d());
|
|
680
694
|
}
|
|
681
|
-
return { width: r, height:
|
|
695
|
+
return { width: r, height: s };
|
|
682
696
|
}
|
|
683
697
|
export {
|
|
684
698
|
qe as a,
|
|
685
|
-
|
|
699
|
+
S as b,
|
|
686
700
|
tt as c,
|
|
687
701
|
Ke as d,
|
|
688
702
|
Je as e,
|