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

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