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