best-unit 0.0.7 → 0.0.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/best-unit.js CHANGED
@@ -1,459 +1,388 @@
1
- function et() {
1
+ function tt() {
2
2
  console.log("npm package test!!!");
3
3
  }
4
- function tt() {
4
+ function nt() {
5
5
  console.log("Current time:", (/* @__PURE__ */ new Date()).toISOString());
6
6
  }
7
- var D, d, ye, S, oe, ge, be, ke, Z, J, K, M = {}, we = [], Me = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, B = Array.isArray;
8
- function C(e, t) {
9
- for (var _ in t) e[_] = t[_];
10
- return e;
7
+ var D, h, ve, w, oe, ge, ye, be, X, G, J, A = {}, ke = [], De = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, W = Array.isArray;
8
+ function E(t, e) {
9
+ for (var n in e) t[n] = e[n];
10
+ return t;
11
11
  }
12
- function ee(e) {
13
- e && e.parentNode && e.parentNode.removeChild(e);
12
+ function Z(t) {
13
+ t && t.parentNode && t.parentNode.removeChild(t);
14
14
  }
15
- function E(e, t, _) {
16
- var n, o, r, l = {};
17
- for (r in t) r == "key" ? n = t[r] : r == "ref" ? o = t[r] : l[r] = t[r];
18
- if (arguments.length > 2 && (l.children = arguments.length > 3 ? D.call(arguments, 2) : _), typeof e == "function" && e.defaultProps != null) for (r in e.defaultProps) l[r] === void 0 && (l[r] = e.defaultProps[r]);
19
- return L(e, l, n, o, null);
15
+ function $(t, e, n) {
16
+ var o, _, r, l = {};
17
+ for (r in e) r == "key" ? o = e[r] : r == "ref" ? _ = e[r] : l[r] = e[r];
18
+ if (arguments.length > 2 && (l.children = arguments.length > 3 ? D.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (r in t.defaultProps) l[r] === void 0 && (l[r] = t.defaultProps[r]);
19
+ return F(t, l, o, _, null);
20
20
  }
21
- function L(e, t, _, n, o) {
22
- var r = { type: e, props: t, key: _, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: o ?? ++ye, __i: -1, __u: 0 };
23
- return o == null && d.vnode != null && d.vnode(r), r;
21
+ function F(t, e, n, o, _) {
22
+ var r = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: _ ?? ++ve, __i: -1, __u: 0 };
23
+ return _ == null && h.vnode != null && h.vnode(r), r;
24
24
  }
25
- function q(e) {
26
- return e.children;
25
+ function I(t) {
26
+ return t.children;
27
27
  }
28
- function I(e, t) {
29
- this.props = e, this.context = t;
28
+ function L(t, e) {
29
+ this.props = t, this.context = e;
30
30
  }
31
- function P(e, t) {
32
- if (t == null) return e.__ ? P(e.__, e.__i + 1) : null;
33
- for (var _; t < e.__k.length; t++) if ((_ = e.__k[t]) != null && _.__e != null) return _.__e;
34
- return typeof e.type == "function" ? P(e) : null;
31
+ function P(t, e) {
32
+ if (e == null) return t.__ ? P(t.__, t.__i + 1) : null;
33
+ for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
34
+ return typeof t.type == "function" ? P(t) : null;
35
35
  }
36
- function xe(e) {
37
- var t, _;
38
- if ((e = e.__) != null && e.__c != null) {
39
- for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((_ = e.__k[t]) != null && _.__e != null) {
40
- e.__e = e.__c.base = _.__e;
36
+ function Ce(t) {
37
+ var e, n;
38
+ if ((t = t.__) != null && t.__c != null) {
39
+ for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
40
+ t.__e = t.__c.base = n.__e;
41
41
  break;
42
42
  }
43
- return xe(e);
43
+ return Ce(t);
44
44
  }
45
45
  }
46
- function ie(e) {
47
- (!e.__d && (e.__d = !0) && S.push(e) && !R.__r++ || oe != d.debounceRendering) && ((oe = d.debounceRendering) || ge)(R);
46
+ function _e(t) {
47
+ (!t.__d && (t.__d = !0) && w.push(t) && !j.__r++ || oe != h.debounceRendering) && ((oe = h.debounceRendering) || ge)(j);
48
48
  }
49
- function R() {
50
- for (var e, t, _, n, o, r, l, u = 1; S.length; ) S.length > u && S.sort(be), e = S.shift(), u = S.length, e.__d && (_ = void 0, o = (n = (t = e).__v).__e, r = [], l = [], t.__P && ((_ = C({}, n)).__v = n.__v + 1, d.vnode && d.vnode(_), te(t.__P, _, n, t.__n, t.__P.namespaceURI, 32 & n.__u ? [o] : null, r, o ?? P(n), !!(32 & n.__u), l), _.__v = n.__v, _.__.__k[_.__i] = _, Se(r, _, l), _.__e != o && xe(_)));
51
- R.__r = 0;
49
+ function j() {
50
+ for (var t, e, n, o, _, r, l, a = 1; w.length; ) w.length > a && w.sort(ye), t = w.shift(), a = w.length, t.__d && (n = void 0, _ = (o = (e = t).__v).__e, r = [], l = [], e.__P && ((n = E({}, o)).__v = o.__v + 1, h.vnode && h.vnode(n), ee(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [_] : null, r, _ ?? P(o), !!(32 & o.__u), l), n.__v = o.__v, n.__.__k[n.__i] = n, Se(r, n, l), n.__e != _ && Ce(n)));
51
+ j.__r = 0;
52
52
  }
53
- function Ce(e, t, _, n, o, r, l, u, c, s, f) {
54
- var i, p, a, g, w, b, h = n && n.__k || we, m = t.length;
55
- for (c = De(_, t, h, c, m), i = 0; i < m; i++) (a = _.__k[i]) != null && (p = a.__i == -1 ? M : h[a.__i] || M, a.__i = i, b = te(e, a, p, o, r, l, u, c, s, f), g = a.__e, a.ref && p.ref != a.ref && (p.ref && _e(p.ref, null, a), f.push(a.ref, a.__c || g, a)), w == null && g != null && (w = g), 4 & a.__u || p.__k === a.__k ? c = $e(a, c, e) : typeof a.type == "function" && b !== void 0 ? c = b : g && (c = g.nextSibling), a.__u &= -7);
56
- return _.__e = w, c;
53
+ function xe(t, e, n, o, _, r, l, a, u, c, s) {
54
+ var i, p, f, b, C, k, m = o && o.__k || ke, v = e.length;
55
+ for (u = Me(n, e, m, u, v), i = 0; i < v; i++) (f = n.__k[i]) != null && (p = f.__i == -1 ? A : m[f.__i] || A, f.__i = i, k = ee(t, f, p, _, r, l, a, u, c, s), b = f.__e, f.ref && p.ref != f.ref && (p.ref && te(p.ref, null, f), s.push(f.ref, f.__c || b, f)), C == null && b != null && (C = b), 4 & f.__u || p.__k === f.__k ? u = Ee(f, u, t) : typeof f.type == "function" && k !== void 0 ? u = k : b && (u = b.nextSibling), f.__u &= -7);
56
+ return n.__e = C, u;
57
57
  }
58
- function De(e, t, _, n, o) {
59
- var r, l, u, c, s, f = _.length, i = f, p = 0;
60
- for (e.__k = new Array(o), r = 0; r < o; r++) (l = t[r]) != null && typeof l != "boolean" && typeof l != "function" ? (c = r + p, (l = e.__k[r] = typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? L(null, l, null, null, null) : B(l) ? L(q, { children: l }, null, null, null) : l.constructor == null && l.__b > 0 ? L(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : l).__ = e, l.__b = e.__b + 1, u = null, (s = l.__i = Fe(l, _, c, i)) != -1 && (i--, (u = _[s]) && (u.__u |= 2)), u == null || u.__v == null ? (s == -1 && (o > f ? p-- : o < f && p++), typeof l.type != "function" && (l.__u |= 4)) : s != c && (s == c - 1 ? p-- : s == c + 1 ? p++ : (s > c ? p-- : p++, l.__u |= 4))) : e.__k[r] = null;
61
- if (i) for (r = 0; r < f; r++) (u = _[r]) != null && (2 & u.__u) == 0 && (u.__e == n && (n = P(u)), Pe(u, u));
62
- return n;
58
+ function Me(t, e, n, o, _) {
59
+ var r, l, a, u, c, s = n.length, i = s, p = 0;
60
+ for (t.__k = new Array(_), r = 0; r < _; r++) (l = e[r]) != null && typeof l != "boolean" && typeof l != "function" ? (u = r + p, (l = t.__k[r] = typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? F(null, l, null, null, null) : W(l) ? F(I, { children: l }, null, null, null) : l.constructor == null && l.__b > 0 ? F(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : l).__ = t, l.__b = t.__b + 1, a = null, (c = l.__i = ze(l, n, u, i)) != -1 && (i--, (a = n[c]) && (a.__u |= 2)), a == null || a.__v == null ? (c == -1 && (_ > s ? p-- : _ < s && p++), typeof l.type != "function" && (l.__u |= 4)) : c != u && (c == u - 1 ? p-- : c == u + 1 ? p++ : (c > u ? p-- : p++, l.__u |= 4))) : t.__k[r] = null;
61
+ if (i) for (r = 0; r < s; r++) (a = n[r]) != null && (2 & a.__u) == 0 && (a.__e == o && (o = P(a)), $e(a, a));
62
+ return o;
63
63
  }
64
- function $e(e, t, _) {
65
- var n, o;
66
- if (typeof e.type == "function") {
67
- for (n = e.__k, o = 0; n && o < n.length; o++) n[o] && (n[o].__ = e, t = $e(n[o], t, _));
68
- return t;
64
+ function Ee(t, e, n) {
65
+ var o, _;
66
+ if (typeof t.type == "function") {
67
+ for (o = t.__k, _ = 0; o && _ < o.length; _++) o[_] && (o[_].__ = t, e = Ee(o[_], e, n));
68
+ return e;
69
69
  }
70
- e.__e != t && (t && e.type && !_.contains(t) && (t = P(e)), _.insertBefore(e.__e, t || null), t = e.__e);
70
+ t.__e != e && (e && t.type && !n.contains(e) && (e = P(t)), n.insertBefore(t.__e, e || null), e = t.__e);
71
71
  do
72
- t = t && t.nextSibling;
73
- while (t != null && t.nodeType == 8);
74
- return t;
72
+ e = e && e.nextSibling;
73
+ while (e != null && e.nodeType == 8);
74
+ return e;
75
75
  }
76
- function Fe(e, t, _, n) {
77
- var o, r, l = e.key, u = e.type, c = t[_];
78
- if (c === null && e.key == null || c && l == c.key && u == c.type && (2 & c.__u) == 0) return _;
79
- if (n > (c != null && (2 & c.__u) == 0 ? 1 : 0)) for (o = _ - 1, r = _ + 1; o >= 0 || r < t.length; ) {
80
- if (o >= 0) {
81
- if ((c = t[o]) && (2 & c.__u) == 0 && l == c.key && u == c.type) return o;
82
- o--;
76
+ function ze(t, e, n, o) {
77
+ var _, r, l = t.key, a = t.type, u = e[n];
78
+ if (u === null && t.key == null || u && l == u.key && a == u.type && (2 & u.__u) == 0) return n;
79
+ if (o > (u != null && (2 & u.__u) == 0 ? 1 : 0)) for (_ = n - 1, r = n + 1; _ >= 0 || r < e.length; ) {
80
+ if (_ >= 0) {
81
+ if ((u = e[_]) && (2 & u.__u) == 0 && l == u.key && a == u.type) return _;
82
+ _--;
83
83
  }
84
- if (r < t.length) {
85
- if ((c = t[r]) && (2 & c.__u) == 0 && l == c.key && u == c.type) return r;
84
+ if (r < e.length) {
85
+ if ((u = e[r]) && (2 & u.__u) == 0 && l == u.key && a == u.type) return r;
86
86
  r++;
87
87
  }
88
88
  }
89
89
  return -1;
90
90
  }
91
- function le(e, t, _) {
92
- t[0] == "-" ? e.setProperty(t, _ ?? "") : e[t] = _ == null ? "" : typeof _ != "number" || Me.test(t) ? _ : _ + "px";
91
+ function ie(t, e, n) {
92
+ e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || De.test(e) ? n : n + "px";
93
93
  }
94
- function j(e, t, _, n, o) {
94
+ function B(t, e, n, o, _) {
95
95
  var r, l;
96
- e: if (t == "style") if (typeof _ == "string") e.style.cssText = _;
96
+ e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
97
97
  else {
98
- if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) _ && t in _ || le(e.style, t, "");
99
- if (_) for (t in _) n && _[t] == n[t] || le(e.style, t, _[t]);
98
+ if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || ie(t.style, e, "");
99
+ if (n) for (e in n) o && n[e] == o[e] || ie(t.style, e, n[e]);
100
100
  }
101
- else if (t[0] == "o" && t[1] == "n") r = t != (t = t.replace(ke, "$1")), l = t.toLowerCase(), t = l in e || t == "onFocusOut" || t == "onFocusIn" ? l.slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + r] = _, _ ? n ? _.u = n.u : (_.u = Z, e.addEventListener(t, r ? K : J, r)) : e.removeEventListener(t, r ? K : J, r);
101
+ else if (e[0] == "o" && e[1] == "n") r = e != (e = e.replace(be, "$1")), l = e.toLowerCase(), e = l in t || e == "onFocusOut" || e == "onFocusIn" ? l.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + r] = n, n ? o ? n.u = o.u : (n.u = X, t.addEventListener(e, r ? J : G, r)) : t.removeEventListener(e, r ? J : G, r);
102
102
  else {
103
- if (o == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
104
- else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
105
- e[t] = _ ?? "";
103
+ if (_ == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
104
+ else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
105
+ t[e] = n ?? "";
106
106
  break e;
107
107
  } catch {
108
108
  }
109
- typeof _ == "function" || (_ == null || _ === !1 && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && _ == 1 ? "" : _));
109
+ typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
110
110
  }
111
111
  }
112
- function ue(e) {
113
- return function(t) {
112
+ function le(t) {
113
+ return function(e) {
114
114
  if (this.l) {
115
- var _ = this.l[t.type + e];
116
- if (t.t == null) t.t = Z++;
117
- else if (t.t < _.u) return;
118
- return _(d.event ? d.event(t) : t);
115
+ var n = this.l[e.type + t];
116
+ if (e.t == null) e.t = X++;
117
+ else if (e.t < n.u) return;
118
+ return n(h.event ? h.event(e) : e);
119
119
  }
120
120
  };
121
121
  }
122
- function te(e, t, _, n, o, r, l, u, c, s) {
123
- var f, i, p, a, g, w, b, h, m, H, $, F, T, re, O, N, V, x = t.type;
124
- if (t.constructor != null) return null;
125
- 128 & _.__u && (c = !!(32 & _.__u), r = [u = t.__e = _.__e]), (f = d.__b) && f(t);
122
+ function ee(t, e, n, o, _, r, l, a, u, c) {
123
+ var s, i, p, f, b, C, k, m, v, H, S, M, T, re, z, U, V, x = e.type;
124
+ if (e.constructor != null) return null;
125
+ 128 & n.__u && (u = !!(32 & n.__u), r = [a = e.__e = n.__e]), (s = h.__b) && s(e);
126
126
  e: if (typeof x == "function") try {
127
- if (h = t.props, m = "prototype" in x && x.prototype.render, H = (f = x.contextType) && n[f.__c], $ = f ? H ? H.props.value : f.__ : n, _.__c ? b = (i = t.__c = _.__c).__ = i.__E : (m ? t.__c = i = new x(h, $) : (t.__c = i = new I(h, $), i.constructor = x, i.render = je), H && H.sub(i), i.props = h, i.state || (i.state = {}), i.context = $, i.__n = n, p = i.__d = !0, i.__h = [], i._sb = []), m && i.__s == null && (i.__s = i.state), m && x.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = C({}, i.__s)), C(i.__s, x.getDerivedStateFromProps(h, i.__s))), a = i.props, g = i.state, i.__v = t, p) m && x.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), m && i.componentDidMount != null && i.__h.push(i.componentDidMount);
127
+ if (m = e.props, v = "prototype" in x && x.prototype.render, H = (s = x.contextType) && o[s.__c], S = s ? H ? H.props.value : s.__ : o, n.__c ? k = (i = e.__c = n.__c).__ = i.__E : (v ? e.__c = i = new x(m, S) : (e.__c = i = new L(m, S), i.constructor = x, i.render = Le), H && H.sub(i), i.props = m, i.state || (i.state = {}), i.context = S, i.__n = o, p = i.__d = !0, i.__h = [], i._sb = []), v && i.__s == null && (i.__s = i.state), v && x.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = E({}, i.__s)), E(i.__s, x.getDerivedStateFromProps(m, i.__s))), f = i.props, b = i.state, i.__v = e, p) v && x.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), v && i.componentDidMount != null && i.__h.push(i.componentDidMount);
128
128
  else {
129
- if (m && x.getDerivedStateFromProps == null && h !== a && i.componentWillReceiveProps != null && i.componentWillReceiveProps(h, $), !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(h, i.__s, $) === !1 || t.__v == _.__v) {
130
- for (t.__v != _.__v && (i.props = h, i.state = i.__s, i.__d = !1), t.__e = _.__e, t.__k = _.__k, t.__k.some(function(U) {
131
- U && (U.__ = t);
132
- }), F = 0; F < i._sb.length; F++) i.__h.push(i._sb[F]);
129
+ if (v && x.getDerivedStateFromProps == null && m !== f && i.componentWillReceiveProps != null && i.componentWillReceiveProps(m, S), !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(m, i.__s, S) === !1 || e.__v == n.__v) {
130
+ for (e.__v != n.__v && (i.props = m, i.state = i.__s, i.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(N) {
131
+ N && (N.__ = e);
132
+ }), M = 0; M < i._sb.length; M++) i.__h.push(i._sb[M]);
133
133
  i._sb = [], i.__h.length && l.push(i);
134
134
  break e;
135
135
  }
136
- i.componentWillUpdate != null && i.componentWillUpdate(h, i.__s, $), m && i.componentDidUpdate != null && i.__h.push(function() {
137
- i.componentDidUpdate(a, g, w);
136
+ i.componentWillUpdate != null && i.componentWillUpdate(m, i.__s, S), v && i.componentDidUpdate != null && i.__h.push(function() {
137
+ i.componentDidUpdate(f, b, C);
138
138
  });
139
139
  }
140
- if (i.context = $, i.props = h, i.__P = e, i.__e = !1, T = d.__r, re = 0, m) {
141
- for (i.state = i.__s, i.__d = !1, T && T(t), f = i.render(i.props, i.state, i.context), O = 0; O < i._sb.length; O++) i.__h.push(i._sb[O]);
140
+ if (i.context = S, i.props = m, i.__P = t, i.__e = !1, T = h.__r, re = 0, v) {
141
+ for (i.state = i.__s, i.__d = !1, T && T(e), s = i.render(i.props, i.state, i.context), z = 0; z < i._sb.length; z++) i.__h.push(i._sb[z]);
142
142
  i._sb = [];
143
143
  } else do
144
- i.__d = !1, T && T(t), f = i.render(i.props, i.state, i.context), i.state = i.__s;
144
+ i.__d = !1, T && T(e), s = i.render(i.props, i.state, i.context), i.state = i.__s;
145
145
  while (i.__d && ++re < 25);
146
- i.state = i.__s, i.getChildContext != null && (n = C(C({}, n), i.getChildContext())), m && !p && i.getSnapshotBeforeUpdate != null && (w = i.getSnapshotBeforeUpdate(a, g)), N = f, f != null && f.type === q && f.key == null && (N = Ee(f.props.children)), u = Ce(e, B(N) ? N : [N], t, _, n, o, r, l, u, c, s), i.base = t.__e, t.__u &= -161, i.__h.length && l.push(i), b && (i.__E = i.__ = null);
147
- } catch (U) {
148
- if (t.__v = null, c || r != null) if (U.then) {
149
- for (t.__u |= c ? 160 : 128; u && u.nodeType == 8 && u.nextSibling; ) u = u.nextSibling;
150
- r[r.indexOf(u)] = null, t.__e = u;
151
- } else for (V = r.length; V--; ) ee(r[V]);
152
- else t.__e = _.__e, t.__k = _.__k;
153
- d.__e(U, t, _);
146
+ i.state = i.__s, i.getChildContext != null && (o = E(E({}, o), i.getChildContext())), v && !p && i.getSnapshotBeforeUpdate != null && (C = i.getSnapshotBeforeUpdate(f, b)), U = s, s != null && s.type === I && s.key == null && (U = we(s.props.children)), a = xe(t, W(U) ? U : [U], e, n, o, _, r, l, a, u, c), i.base = e.__e, e.__u &= -161, i.__h.length && l.push(i), k && (i.__E = i.__ = null);
147
+ } catch (N) {
148
+ if (e.__v = null, u || r != null) if (N.then) {
149
+ for (e.__u |= u ? 160 : 128; a && a.nodeType == 8 && a.nextSibling; ) a = a.nextSibling;
150
+ r[r.indexOf(a)] = null, e.__e = a;
151
+ } else for (V = r.length; V--; ) Z(r[V]);
152
+ else e.__e = n.__e, e.__k = n.__k;
153
+ h.__e(N, e, n);
154
154
  }
155
- else r == null && t.__v == _.__v ? (t.__k = _.__k, t.__e = _.__e) : u = t.__e = Oe(_.__e, t, _, n, o, r, l, c, s);
156
- return (f = d.diffed) && f(t), 128 & t.__u ? void 0 : u;
155
+ else r == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : a = e.__e = Be(n.__e, e, n, o, _, r, l, u, c);
156
+ return (s = h.diffed) && s(e), 128 & e.__u ? void 0 : a;
157
157
  }
158
- function Se(e, t, _) {
159
- for (var n = 0; n < _.length; n++) _e(_[n], _[++n], _[++n]);
160
- d.__c && d.__c(t, e), e.some(function(o) {
158
+ function Se(t, e, n) {
159
+ for (var o = 0; o < n.length; o++) te(n[o], n[++o], n[++o]);
160
+ h.__c && h.__c(e, t), t.some(function(_) {
161
161
  try {
162
- e = o.__h, o.__h = [], e.some(function(r) {
163
- r.call(o);
162
+ t = _.__h, _.__h = [], t.some(function(r) {
163
+ r.call(_);
164
164
  });
165
165
  } catch (r) {
166
- d.__e(r, o.__v);
166
+ h.__e(r, _.__v);
167
167
  }
168
168
  });
169
169
  }
170
- function Ee(e) {
171
- return typeof e != "object" || e == null || e.__b && e.__b > 0 ? e : B(e) ? e.map(Ee) : C({}, e);
170
+ function we(t) {
171
+ return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : W(t) ? t.map(we) : E({}, t);
172
172
  }
173
- function Oe(e, t, _, n, o, r, l, u, c) {
174
- var s, f, i, p, a, g, w, b = _.props, h = t.props, m = t.type;
175
- if (m == "svg" ? o = "http://www.w3.org/2000/svg" : m == "math" ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), r != null) {
176
- for (s = 0; s < r.length; s++) if ((a = r[s]) && "setAttribute" in a == !!m && (m ? a.localName == m : a.nodeType == 3)) {
177
- e = a, r[s] = null;
173
+ function Be(t, e, n, o, _, r, l, a, u) {
174
+ var c, s, i, p, f, b, C, k = n.props, m = e.props, v = e.type;
175
+ if (v == "svg" ? _ = "http://www.w3.org/2000/svg" : v == "math" ? _ = "http://www.w3.org/1998/Math/MathML" : _ || (_ = "http://www.w3.org/1999/xhtml"), r != null) {
176
+ for (c = 0; c < r.length; c++) if ((f = r[c]) && "setAttribute" in f == !!v && (v ? f.localName == v : f.nodeType == 3)) {
177
+ t = f, r[c] = null;
178
178
  break;
179
179
  }
180
180
  }
181
- if (e == null) {
182
- if (m == null) return document.createTextNode(h);
183
- e = document.createElementNS(o, m, h.is && h), u && (d.__m && d.__m(t, r), u = !1), r = null;
181
+ if (t == null) {
182
+ if (v == null) return document.createTextNode(m);
183
+ t = document.createElementNS(_, v, m.is && m), a && (h.__m && h.__m(e, r), a = !1), r = null;
184
184
  }
185
- if (m == null) b === h || u && e.data == h || (e.data = h);
185
+ if (v == null) k === m || a && t.data == m || (t.data = m);
186
186
  else {
187
- if (r = r && D.call(e.childNodes), b = _.props || M, !u && r != null) for (b = {}, s = 0; s < e.attributes.length; s++) b[(a = e.attributes[s]).name] = a.value;
188
- for (s in b) if (a = b[s], s != "children") {
189
- if (s == "dangerouslySetInnerHTML") i = a;
190
- else if (!(s in h)) {
191
- if (s == "value" && "defaultValue" in h || s == "checked" && "defaultChecked" in h) continue;
192
- j(e, s, null, a, o);
187
+ if (r = r && D.call(t.childNodes), k = n.props || A, !a && r != null) for (k = {}, c = 0; c < t.attributes.length; c++) k[(f = t.attributes[c]).name] = f.value;
188
+ for (c in k) if (f = k[c], c != "children") {
189
+ if (c == "dangerouslySetInnerHTML") i = f;
190
+ else if (!(c in m)) {
191
+ if (c == "value" && "defaultValue" in m || c == "checked" && "defaultChecked" in m) continue;
192
+ B(t, c, null, f, _);
193
193
  }
194
194
  }
195
- for (s in h) a = h[s], s == "children" ? p = a : s == "dangerouslySetInnerHTML" ? f = a : s == "value" ? g = a : s == "checked" ? w = a : u && typeof a != "function" || b[s] === a || j(e, s, a, b[s], o);
196
- if (f) u || i && (f.__html == i.__html || f.__html == e.innerHTML) || (e.innerHTML = f.__html), t.__k = [];
197
- else if (i && (e.innerHTML = ""), Ce(t.type == "template" ? e.content : e, B(p) ? p : [p], t, _, n, m == "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, r, l, r ? r[0] : _.__k && P(_, 0), u, c), r != null) for (s = r.length; s--; ) ee(r[s]);
198
- u || (s = "value", m == "progress" && g == null ? e.removeAttribute("value") : g != null && (g !== e[s] || m == "progress" && !g || m == "option" && g != b[s]) && j(e, s, g, b[s], o), s = "checked", w != null && w != e[s] && j(e, s, w, b[s], o));
195
+ for (c in m) f = m[c], c == "children" ? p = f : c == "dangerouslySetInnerHTML" ? s = f : c == "value" ? b = f : c == "checked" ? C = f : a && typeof f != "function" || k[c] === f || B(t, c, f, k[c], _);
196
+ if (s) a || i && (s.__html == i.__html || s.__html == t.innerHTML) || (t.innerHTML = s.__html), e.__k = [];
197
+ else if (i && (t.innerHTML = ""), xe(e.type == "template" ? t.content : t, W(p) ? p : [p], e, n, o, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : _, r, l, r ? r[0] : n.__k && P(n, 0), a, u), r != null) for (c = r.length; c--; ) Z(r[c]);
198
+ a || (c = "value", v == "progress" && b == null ? t.removeAttribute("value") : b != null && (b !== t[c] || v == "progress" && !b || v == "option" && b != k[c]) && B(t, c, b, k[c], _), c = "checked", C != null && C != t[c] && B(t, c, C, k[c], _));
199
199
  }
200
- return e;
200
+ return t;
201
201
  }
202
- function _e(e, t, _) {
202
+ function te(t, e, n) {
203
203
  try {
204
- if (typeof e == "function") {
205
- var n = typeof e.__u == "function";
206
- n && e.__u(), n && t == null || (e.__u = e(t));
207
- } else e.current = t;
208
- } catch (o) {
209
- d.__e(o, _);
204
+ if (typeof t == "function") {
205
+ var o = typeof t.__u == "function";
206
+ o && t.__u(), o && e == null || (t.__u = t(e));
207
+ } else t.current = e;
208
+ } catch (_) {
209
+ h.__e(_, n);
210
210
  }
211
211
  }
212
- function Pe(e, t, _) {
213
- var n, o;
214
- if (d.unmount && d.unmount(e), (n = e.ref) && (n.current && n.current != e.__e || _e(n, null, t)), (n = e.__c) != null) {
215
- if (n.componentWillUnmount) try {
216
- n.componentWillUnmount();
212
+ function $e(t, e, n) {
213
+ var o, _;
214
+ if (h.unmount && h.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || te(o, null, e)), (o = t.__c) != null) {
215
+ if (o.componentWillUnmount) try {
216
+ o.componentWillUnmount();
217
217
  } catch (r) {
218
- d.__e(r, t);
218
+ h.__e(r, e);
219
219
  }
220
- n.base = n.__P = null;
220
+ o.base = o.__P = null;
221
221
  }
222
- if (n = e.__k) for (o = 0; o < n.length; o++) n[o] && Pe(n[o], t, _ || typeof e.type != "function");
223
- _ || ee(e.__e), e.__c = e.__ = e.__e = void 0;
224
- }
225
- function je(e, t, _) {
226
- return this.constructor(e, _);
227
- }
228
- function z(e, t, _) {
229
- var n, o, r, l;
230
- t == document && (t = document.documentElement), d.__ && d.__(e, t), o = (n = typeof _ == "function") ? null : _ && _.__k || t.__k, r = [], l = [], te(t, e = (!n && _ || t).__k = E(q, null, [e]), o || M, M, t.namespaceURI, !n && _ ? [_] : o ? null : t.firstChild ? D.call(t.childNodes) : null, r, !n && _ ? _ : o ? o.__e : t.firstChild, n, l), Se(r, e, l);
231
- }
232
- function He(e, t) {
233
- z(e, t, He);
234
- }
235
- function Te(e, t, _) {
236
- var n, o, r, l, u = C({}, e.props);
237
- for (r in e.type && e.type.defaultProps && (l = e.type.defaultProps), t) r == "key" ? n = t[r] : r == "ref" ? o = t[r] : u[r] = t[r] === void 0 && l != null ? l[r] : t[r];
238
- return arguments.length > 2 && (u.children = arguments.length > 3 ? D.call(arguments, 2) : _), L(e.type, u, n || e.key, o || e.ref, null);
239
- }
240
- D = we.slice, d = { __e: function(e, t, _, n) {
241
- for (var o, r, l; t = t.__; ) if ((o = t.__c) && !o.__) try {
242
- if ((r = o.constructor) && r.getDerivedStateFromError != null && (o.setState(r.getDerivedStateFromError(e)), l = o.__d), o.componentDidCatch != null && (o.componentDidCatch(e, n || {}), l = o.__d), l) return o.__E = o;
243
- } catch (u) {
244
- e = u;
245
- }
246
- throw e;
247
- } }, ye = 0, I.prototype.setState = function(e, t) {
248
- var _;
249
- _ = this.__s != null && this.__s != this.state ? this.__s : this.__s = C({}, this.state), typeof e == "function" && (e = e(C({}, _), this.props)), e && C(_, e), e != null && this.__v && (t && this._sb.push(t), ie(this));
250
- }, I.prototype.forceUpdate = function(e) {
251
- this.__v && (this.__e = !0, e && this.__h.push(e), ie(this));
252
- }, I.prototype.render = q, S = [], ge = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, be = function(e, t) {
253
- return e.__v.__b - t.__v.__b;
254
- }, R.__r = 0, ke = /(PointerCapture)$|Capture$/i, Z = 0, J = ue(!1), K = ue(!0);
255
- var Ie = 0;
256
- function k(e, t, _, n, o, r) {
257
- t || (t = {});
258
- var l, u, c = t;
259
- if ("ref" in c) for (u in c = {}, t) u == "ref" ? l = t[u] : c[u] = t[u];
260
- var s = { type: e, props: c, key: _, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Ie, __i: -1, __u: 0, __source: o, __self: r };
261
- if (typeof e == "function" && (l = e.defaultProps)) for (u in l) c[u] === void 0 && (c[u] = l[u]);
262
- return d.vnode && d.vnode(s), s;
263
- }
264
- function ne() {
265
- return (ne = Object.assign ? Object.assign.bind() : function(e) {
266
- for (var t = 1; t < arguments.length; t++) {
267
- var _ = arguments[t];
268
- for (var n in _) Object.prototype.hasOwnProperty.call(_, n) && (e[n] = _[n]);
269
- }
270
- return e;
271
- }).apply(this, arguments);
222
+ if (o = t.__k) for (_ = 0; _ < o.length; _++) o[_] && $e(o[_], e, n || typeof t.type != "function");
223
+ n || Z(t.__e), t.__c = t.__ = t.__e = void 0;
272
224
  }
273
- var We = ["context", "children"];
274
- function Re(e) {
275
- this.getChildContext = function() {
276
- return e.context;
277
- };
278
- var t = e.children, _ = function(n, o) {
279
- if (n == null) return {};
280
- var r, l, u = {}, c = Object.keys(n);
281
- for (l = 0; l < c.length; l++) o.indexOf(r = c[l]) >= 0 || (u[r] = n[r]);
282
- return u;
283
- }(e, We);
284
- return Te(t, _);
285
- }
286
- function Be() {
287
- var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
288
- this.dispatchEvent(e), this._vdom = E(Re, ne({}, this._props, { context: e.detail.context }), function t(_, n) {
289
- if (_.nodeType === 3) return _.data;
290
- if (_.nodeType !== 1) return null;
291
- var o = [], r = {}, l = 0, u = _.attributes, c = _.childNodes;
292
- for (l = u.length; l--; ) u[l].name !== "slot" && (r[u[l].name] = u[l].value, r[Ne(u[l].name)] = u[l].value);
293
- for (l = c.length; l--; ) {
294
- var s = t(c[l], null), f = c[l].slot;
295
- f ? r[f] = E(se, { name: f }, s) : o[l] = s;
296
- }
297
- var i = n ? E(se, null, o) : o;
298
- return E(n || _.nodeName.toLowerCase(), r, i);
299
- }(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? He : z)(this._vdom, this._root);
300
- }
301
- function Ne(e) {
302
- return e.replace(/-(\w)/g, function(t, _) {
303
- return _ ? _.toUpperCase() : "";
304
- });
225
+ function Le(t, e, n) {
226
+ return this.constructor(t, n);
305
227
  }
306
- function qe(e, t, _) {
307
- if (this._vdom) {
308
- var n = {};
309
- n[e] = _ = _ ?? void 0, n[Ne(e)] = _, this._vdom = Te(this._vdom, n), z(this._vdom, this._root);
310
- }
228
+ function q(t, e, n) {
229
+ var o, _, r, l;
230
+ e == document && (e = document.documentElement), h.__ && h.__(t, e), _ = (o = typeof n == "function") ? null : n && n.__k || e.__k, r = [], l = [], ee(e, t = (!o && n || e).__k = $(I, null, [t]), _ || A, A, e.namespaceURI, !o && n ? [n] : _ ? null : e.firstChild ? D.call(e.childNodes) : null, r, !o && n ? n : _ ? _.__e : e.firstChild, o, l), Se(r, t, l);
311
231
  }
312
- function ze() {
313
- z(this._vdom = null, this._root);
232
+ function Pe(t, e) {
233
+ q(t, e, Pe);
314
234
  }
315
- function se(e, t) {
316
- var _ = this;
317
- return E("slot", ne({}, e, { ref: function(n) {
318
- n ? (_.ref = n, _._listener || (_._listener = function(o) {
319
- o.stopPropagation(), o.detail.context = t;
320
- }, n.addEventListener("_preact", _._listener))) : _.ref.removeEventListener("_preact", _._listener);
321
- } }));
235
+ function He(t, e, n) {
236
+ var o, _, r, l, a = E({}, t.props);
237
+ for (r in t.type && t.type.defaultProps && (l = t.type.defaultProps), e) r == "key" ? o = e[r] : r == "ref" ? _ = e[r] : a[r] = e[r] === void 0 && l != null ? l[r] : e[r];
238
+ return arguments.length > 2 && (a.children = arguments.length > 3 ? D.call(arguments, 2) : n), F(t.type, a, o || t.key, _ || t.ref, null);
322
239
  }
323
- function Ue(e, t, _, n) {
324
- function o() {
325
- var r = Reflect.construct(HTMLElement, [], o);
326
- return r._vdomComponent = e, r._root = n && n.shadow ? r.attachShadow({ mode: n.mode || "open" }) : r, r;
240
+ D = ke.slice, h = { __e: function(t, e, n, o) {
241
+ for (var _, r, l; e = e.__; ) if ((_ = e.__c) && !_.__) try {
242
+ if ((r = _.constructor) && r.getDerivedStateFromError != null && (_.setState(r.getDerivedStateFromError(t)), l = _.__d), _.componentDidCatch != null && (_.componentDidCatch(t, o || {}), l = _.__d), l) return _.__E = _;
243
+ } catch (a) {
244
+ t = a;
327
245
  }
328
- return (o.prototype = Object.create(HTMLElement.prototype)).constructor = o, o.prototype.connectedCallback = Be, o.prototype.attributeChangedCallback = qe, o.prototype.disconnectedCallback = ze, _ = _ || e.observedAttributes || Object.keys(e.propTypes || {}), o.observedAttributes = _, _.forEach(function(r) {
329
- Object.defineProperty(o.prototype, r, { get: function() {
330
- return this._vdom.props[r];
331
- }, set: function(l) {
332
- this._vdom ? this.attributeChangedCallback(r, null, l) : (this._props || (this._props = {}), this._props[r] = l, this.connectedCallback());
333
- var u = typeof l;
334
- l != null && u !== "string" && u !== "boolean" && u !== "number" || this.setAttribute(r, l);
335
- } });
336
- }), customElements.define(t || e.tagName || e.displayName || e.name, o);
337
- }
338
- const Ve = ({ name: e = "World" }) => /* @__PURE__ */ k("p", { children: [
339
- "Hello, ",
340
- e,
341
- "!"
342
- ] });
343
- Ue(Ve, "x-greeting", ["name"], { shadow: !1 });
344
- var Q, v, G, ce, X = 0, Ae = [], y = d, ae = y.__b, fe = y.__r, pe = y.diffed, de = y.__c, he = y.unmount, me = y.__;
345
- function Ge(e, t) {
346
- y.__h && y.__h(v, e, X || t), X = 0;
347
- var _ = v.__H || (v.__H = { __: [], __h: [] });
348
- return e >= _.__.length && _.__.push({}), _.__[e];
349
- }
350
- function A(e) {
351
- return X = 1, Je(Le, e);
352
- }
353
- function Je(e, t, _) {
354
- var n = Ge(Q++, 2);
355
- if (n.t = e, !n.__c && (n.__ = [Le(void 0, t), function(u) {
356
- var c = n.__N ? n.__N[0] : n.__[0], s = n.t(c, u);
357
- c !== s && (n.__N = [s, n.__[1]], n.__c.setState({}));
358
- }], n.__c = v, !v.__f)) {
359
- var o = function(u, c, s) {
360
- if (!n.__c.__H) return !0;
361
- var f = n.__c.__H.__.filter(function(p) {
246
+ throw t;
247
+ } }, ve = 0, L.prototype.setState = function(t, e) {
248
+ var n;
249
+ n = this.__s != null && this.__s != this.state ? this.__s : this.__s = E({}, this.state), typeof t == "function" && (t = t(E({}, n), this.props)), t && E(n, t), t != null && this.__v && (e && this._sb.push(e), _e(this));
250
+ }, L.prototype.forceUpdate = function(t) {
251
+ this.__v && (this.__e = !0, t && this.__h.push(t), _e(this));
252
+ }, L.prototype.render = I, w = [], ge = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, ye = function(t, e) {
253
+ return t.__v.__b - e.__v.__b;
254
+ }, j.__r = 0, be = /(PointerCapture)$|Capture$/i, X = 0, G = le(!1), J = le(!0);
255
+ var Re = 0;
256
+ function d(t, e, n, o, _, r) {
257
+ e || (e = {});
258
+ var l, a, u = e;
259
+ if ("ref" in u) for (a in u = {}, e) a == "ref" ? l = e[a] : u[a] = e[a];
260
+ var c = { type: t, props: u, key: n, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Re, __i: -1, __u: 0, __source: _, __self: r };
261
+ if (typeof t == "function" && (l = t.defaultProps)) for (a in l) u[a] === void 0 && (u[a] = l[a]);
262
+ return h.vnode && h.vnode(c), c;
263
+ }
264
+ var O, g, Y, ae, K = 0, Te = [], y = h, ce = y.__b, ue = y.__r, se = y.diffed, fe = y.__c, pe = y.unmount, de = y.__;
265
+ function Ue(t, e) {
266
+ y.__h && y.__h(g, t, K || e), K = 0;
267
+ var n = g.__H || (g.__H = { __: [], __h: [] });
268
+ return t >= n.__.length && n.__.push({}), n.__[t];
269
+ }
270
+ function Ne(t) {
271
+ return K = 1, je(Fe, t);
272
+ }
273
+ function je(t, e, n) {
274
+ var o = Ue(O++, 2);
275
+ if (o.t = t, !o.__c && (o.__ = [Fe(void 0, e), function(a) {
276
+ var u = o.__N ? o.__N[0] : o.__[0], c = o.t(u, a);
277
+ u !== c && (o.__N = [c, o.__[1]], o.__c.setState({}));
278
+ }], o.__c = g, !g.__f)) {
279
+ var _ = function(a, u, c) {
280
+ if (!o.__c.__H) return !0;
281
+ var s = o.__c.__H.__.filter(function(p) {
362
282
  return !!p.__c;
363
283
  });
364
- if (f.every(function(p) {
284
+ if (s.every(function(p) {
365
285
  return !p.__N;
366
- })) return !r || r.call(this, u, c, s);
367
- var i = n.__c.props !== u;
368
- return f.forEach(function(p) {
286
+ })) return !r || r.call(this, a, u, c);
287
+ var i = o.__c.props !== a;
288
+ return s.forEach(function(p) {
369
289
  if (p.__N) {
370
- var a = p.__[0];
371
- p.__ = p.__N, p.__N = void 0, a !== p.__[0] && (i = !0);
290
+ var f = p.__[0];
291
+ p.__ = p.__N, p.__N = void 0, f !== p.__[0] && (i = !0);
372
292
  }
373
- }), r && r.call(this, u, c, s) || i;
293
+ }), r && r.call(this, a, u, c) || i;
374
294
  };
375
- v.__f = !0;
376
- var r = v.shouldComponentUpdate, l = v.componentWillUpdate;
377
- v.componentWillUpdate = function(u, c, s) {
295
+ g.__f = !0;
296
+ var r = g.shouldComponentUpdate, l = g.componentWillUpdate;
297
+ g.componentWillUpdate = function(a, u, c) {
378
298
  if (this.__e) {
379
- var f = r;
380
- r = void 0, o(u, c, s), r = f;
299
+ var s = r;
300
+ r = void 0, _(a, u, c), r = s;
381
301
  }
382
- l && l.call(this, u, c, s);
383
- }, v.shouldComponentUpdate = o;
302
+ l && l.call(this, a, u, c);
303
+ }, g.shouldComponentUpdate = _;
384
304
  }
385
- return n.__N || n.__;
305
+ return o.__N || o.__;
386
306
  }
387
- function Ke() {
388
- for (var e; e = Ae.shift(); ) if (e.__P && e.__H) try {
389
- e.__H.__h.forEach(W), e.__H.__h.forEach(Y), e.__H.__h = [];
390
- } catch (t) {
391
- e.__H.__h = [], y.__e(t, e.__v);
307
+ function Oe(t, e) {
308
+ var n = Ue(O++, 3);
309
+ !y.__s && qe(n.__H, e) && (n.__ = t, n.u = e, g.__H.__h.push(n));
310
+ }
311
+ function We() {
312
+ for (var t; t = Te.shift(); ) if (t.__P && t.__H) try {
313
+ t.__H.__h.forEach(R), t.__H.__h.forEach(Q), t.__H.__h = [];
314
+ } catch (e) {
315
+ t.__H.__h = [], y.__e(e, t.__v);
392
316
  }
393
317
  }
394
- y.__b = function(e) {
395
- v = null, ae && ae(e);
396
- }, y.__ = function(e, t) {
397
- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), me && me(e, t);
398
- }, y.__r = function(e) {
399
- fe && fe(e), Q = 0;
400
- var t = (v = e.__c).__H;
401
- t && (G === v ? (t.__h = [], v.__h = [], t.__.forEach(function(_) {
402
- _.__N && (_.__ = _.__N), _.u = _.__N = void 0;
403
- })) : (t.__h.forEach(W), t.__h.forEach(Y), t.__h = [], Q = 0)), G = v;
404
- }, y.diffed = function(e) {
405
- pe && pe(e);
406
- var t = e.__c;
407
- t && t.__H && (t.__H.__h.length && (Ae.push(t) !== 1 && ce === y.requestAnimationFrame || ((ce = y.requestAnimationFrame) || Qe)(Ke)), t.__H.__.forEach(function(_) {
408
- _.u && (_.__H = _.u), _.u = void 0;
409
- })), G = v = null;
410
- }, y.__c = function(e, t) {
411
- t.some(function(_) {
318
+ y.__b = function(t) {
319
+ g = null, ce && ce(t);
320
+ }, y.__ = function(t, e) {
321
+ t && e.__k && e.__k.__m && (t.__m = e.__k.__m), de && de(t, e);
322
+ }, y.__r = function(t) {
323
+ ue && ue(t), O = 0;
324
+ var e = (g = t.__c).__H;
325
+ e && (Y === g ? (e.__h = [], g.__h = [], e.__.forEach(function(n) {
326
+ n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
327
+ })) : (e.__h.forEach(R), e.__h.forEach(Q), e.__h = [], O = 0)), Y = g;
328
+ }, y.diffed = function(t) {
329
+ se && se(t);
330
+ var e = t.__c;
331
+ e && e.__H && (e.__H.__h.length && (Te.push(e) !== 1 && ae === y.requestAnimationFrame || ((ae = y.requestAnimationFrame) || Ie)(We)), e.__H.__.forEach(function(n) {
332
+ n.u && (n.__H = n.u), n.u = void 0;
333
+ })), Y = g = null;
334
+ }, y.__c = function(t, e) {
335
+ e.some(function(n) {
412
336
  try {
413
- _.__h.forEach(W), _.__h = _.__h.filter(function(n) {
414
- return !n.__ || Y(n);
337
+ n.__h.forEach(R), n.__h = n.__h.filter(function(o) {
338
+ return !o.__ || Q(o);
415
339
  });
416
- } catch (n) {
417
- t.some(function(o) {
418
- o.__h && (o.__h = []);
419
- }), t = [], y.__e(n, _.__v);
340
+ } catch (o) {
341
+ e.some(function(_) {
342
+ _.__h && (_.__h = []);
343
+ }), e = [], y.__e(o, n.__v);
420
344
  }
421
- }), de && de(e, t);
422
- }, y.unmount = function(e) {
423
- he && he(e);
424
- var t, _ = e.__c;
425
- _ && _.__H && (_.__H.__.forEach(function(n) {
345
+ }), fe && fe(t, e);
346
+ }, y.unmount = function(t) {
347
+ pe && pe(t);
348
+ var e, n = t.__c;
349
+ n && n.__H && (n.__H.__.forEach(function(o) {
426
350
  try {
427
- W(n);
428
- } catch (o) {
429
- t = o;
351
+ R(o);
352
+ } catch (_) {
353
+ e = _;
430
354
  }
431
- }), _.__H = void 0, t && y.__e(t, _.__v));
355
+ }), n.__H = void 0, e && y.__e(e, n.__v));
432
356
  };
433
- var ve = typeof requestAnimationFrame == "function";
434
- function Qe(e) {
435
- var t, _ = function() {
436
- clearTimeout(n), ve && cancelAnimationFrame(t), setTimeout(e);
437
- }, n = setTimeout(_, 35);
438
- ve && (t = requestAnimationFrame(_));
439
- }
440
- function W(e) {
441
- var t = v, _ = e.__c;
442
- typeof _ == "function" && (e.__c = void 0, _()), v = t;
443
- }
444
- function Y(e) {
445
- var t = v;
446
- e.__c = e.__(), v = t;
447
- }
448
- function Le(e, t) {
449
- return typeof t == "function" ? t(e) : t;
450
- }
451
- function Xe({ onClick: e, color: t, children: _ }) {
452
- return /* @__PURE__ */ k(
357
+ var he = typeof requestAnimationFrame == "function";
358
+ function Ie(t) {
359
+ var e, n = function() {
360
+ clearTimeout(o), he && cancelAnimationFrame(e), setTimeout(t);
361
+ }, o = setTimeout(n, 35);
362
+ he && (e = requestAnimationFrame(n));
363
+ }
364
+ function R(t) {
365
+ var e = g, n = t.__c;
366
+ typeof n == "function" && (t.__c = void 0, n()), g = e;
367
+ }
368
+ function Q(t) {
369
+ var e = g;
370
+ t.__c = t.__(), g = e;
371
+ }
372
+ function qe(t, e) {
373
+ return !t || t.length !== e.length || e.some(function(n, o) {
374
+ return n !== t[o];
375
+ });
376
+ }
377
+ function Fe(t, e) {
378
+ return typeof e == "function" ? e(t) : e;
379
+ }
380
+ function Ve({ onClick: t, color: e, children: n }) {
381
+ return /* @__PURE__ */ d(
453
382
  "button",
454
383
  {
455
384
  style: {
456
- background: t || "#1890ff",
385
+ background: e || "#1890ff",
457
386
  color: "#fff",
458
387
  border: "none",
459
388
  borderRadius: 4,
@@ -461,116 +390,317 @@ function Xe({ onClick: e, color: t, children: _ }) {
461
390
  cursor: "pointer",
462
391
  fontSize: 16
463
392
  },
464
- onClick: e,
465
- children: _
393
+ onClick: t,
394
+ children: n
466
395
  }
467
396
  );
468
397
  }
469
- function Ye({ visible: e, onClose: t, onSubmit: _, color: n }) {
470
- const [o, r] = A(""), [l, u] = A(""), [c, s] = A(!1), [f, i] = A("");
471
- return e ? /* @__PURE__ */ k("div", { style: {
472
- position: "fixed",
473
- top: 0,
474
- left: 0,
475
- right: 0,
476
- bottom: 0,
477
- background: "rgba(0,0,0,0.3)",
478
- display: "flex",
479
- alignItems: "center",
480
- justifyContent: "center",
481
- zIndex: 9999
482
- }, children: /* @__PURE__ */ k(
483
- "form",
398
+ function Ye({ visible: t, onClose: e, onSubmit: n, color: o }) {
399
+ const [_, r] = Ne({
400
+ amount: "",
401
+ rechargeChannel: "paypal",
402
+ currency: "USD",
403
+ loading: !1,
404
+ error: "",
405
+ amountError: "",
406
+ rechargeChannelError: "",
407
+ currencyError: ""
408
+ });
409
+ return Oe(() => {
410
+ t || r({
411
+ amount: "",
412
+ rechargeChannel: "paypal",
413
+ currency: "USD",
414
+ loading: !1,
415
+ error: "",
416
+ amountError: "",
417
+ rechargeChannelError: "",
418
+ currencyError: ""
419
+ });
420
+ }, [t]), t ? /* @__PURE__ */ d(
421
+ "div",
484
422
  {
485
- onSubmit: async (a) => {
486
- a.preventDefault(), s(!0), i("");
487
- try {
488
- await _({ name: o, email: l }), t();
489
- } catch {
490
- i("提交失败,请重试");
491
- } finally {
492
- s(!1);
493
- }
423
+ style: {
424
+ position: "fixed",
425
+ top: 0,
426
+ left: 0,
427
+ right: 0,
428
+ bottom: 0,
429
+ background: "rgba(0,0,0,0.7)",
430
+ display: "flex",
431
+ alignItems: "center",
432
+ justifyContent: "center",
433
+ zIndex: 9999
494
434
  },
495
- style: { background: "#fff", padding: 24, borderRadius: 8, minWidth: 320 },
496
- children: [
497
- /* @__PURE__ */ k("h2", { style: { color: n || "#1890ff" }, children: "表单" }),
498
- /* @__PURE__ */ k("div", { style: { marginBottom: 12 }, children: [
499
- /* @__PURE__ */ k(
500
- "input",
501
- {
502
- type: "text",
503
- placeholder: "姓名",
504
- value: o,
505
- onInput: (a) => r(a.target.value),
506
- required: !0,
507
- style: { width: "100%", padding: 8, marginBottom: 8 }
508
- }
509
- ),
510
- /* @__PURE__ */ k(
511
- "input",
512
- {
513
- type: "email",
514
- placeholder: "邮箱",
515
- value: l,
516
- onInput: (a) => u(a.target.value),
517
- required: !0,
518
- style: { width: "100%", padding: 8 }
435
+ onClick: (u) => {
436
+ u.target === u.currentTarget && e();
437
+ },
438
+ children: /* @__PURE__ */ d(
439
+ "form",
440
+ {
441
+ onSubmit: async (u) => {
442
+ u.preventDefault();
443
+ let c = !0;
444
+ if (r((s) => ({ ...s, amountError: "", rechargeChannelError: "" })), _.amount.trim() || (r((s) => ({ ...s, amountError: "请输入充值金额" })), c = !1), _.rechargeChannel || (r((s) => ({ ...s, rechargeChannelError: "请选择支付平台" })), c = !1), !!c) {
445
+ r((s) => ({ ...s, loading: !0, error: "" }));
446
+ try {
447
+ await n({ amount: _.amount, rechargeChannel: _.rechargeChannel, currency: _.currency }), e();
448
+ } catch {
449
+ r((s) => ({ ...s, error: "提交失败,请重试" }));
450
+ } finally {
451
+ r((s) => ({ ...s, loading: !1 }));
452
+ }
519
453
  }
520
- )
521
- ] }),
522
- f && /* @__PURE__ */ k("div", { style: { color: "red", marginBottom: 8 }, children: f }),
523
- /* @__PURE__ */ k(
524
- "button",
525
- {
526
- type: "submit",
527
- disabled: c,
528
- style: {
529
- background: n || "#1890ff",
530
- color: "#fff",
531
- border: "none",
532
- borderRadius: 4,
533
- padding: "8px 16px",
534
- cursor: "pointer",
535
- fontSize: 16
536
- },
537
- children: c ? "提交中..." : "提交"
538
- }
539
- ),
540
- /* @__PURE__ */ k(
541
- "button",
542
- {
543
- type: "button",
544
- onClick: t,
545
- style: { marginLeft: 12, background: "#eee", color: "#333", border: "none", borderRadius: 4, padding: "8px 16px", cursor: "pointer", fontSize: 16 },
546
- children: "取消"
547
- }
548
- )
549
- ]
454
+ },
455
+ style: {
456
+ background: "#181A20",
457
+ padding: 32,
458
+ borderRadius: 12,
459
+ minWidth: 360,
460
+ color: o || "#fff",
461
+ boxShadow: "0 4px 24px rgba(0,0,0,0.5)",
462
+ position: "relative"
463
+ },
464
+ onClick: (u) => u.stopPropagation(),
465
+ children: [
466
+ /* @__PURE__ */ d(
467
+ "button",
468
+ {
469
+ type: "button",
470
+ onClick: e,
471
+ style: {
472
+ position: "absolute",
473
+ right: 16,
474
+ top: 16,
475
+ background: "none",
476
+ border: "none",
477
+ color: "#fff",
478
+ fontSize: 22,
479
+ cursor: "pointer",
480
+ lineHeight: 1
481
+ },
482
+ "aria-label": "关闭",
483
+ children: "×"
484
+ }
485
+ ),
486
+ /* @__PURE__ */ d("div", { style: { fontWeight: 600, fontSize: 18, marginBottom: 24, textAlign: "left" }, children: "在线充值" }),
487
+ /* @__PURE__ */ d("div", { style: { marginBottom: 18 }, children: [
488
+ /* @__PURE__ */ d("div", { style: { marginBottom: 8, fontSize: 14 }, children: [
489
+ /* @__PURE__ */ d("span", { style: { color: "#00E8C6" }, children: "*" }),
490
+ " 充值金额"
491
+ ] }),
492
+ /* @__PURE__ */ d(
493
+ "input",
494
+ {
495
+ type: "text",
496
+ placeholder: "请输入充值金额",
497
+ value: _.amount,
498
+ onInput: (u) => {
499
+ const c = u.target.value;
500
+ r((s) => ({
501
+ ...s,
502
+ amount: c,
503
+ amountError: c.trim() ? "" : s.amountError
504
+ }));
505
+ },
506
+ style: {
507
+ width: "100%",
508
+ padding: "10px 12px",
509
+ borderRadius: 6,
510
+ boxSizing: "border-box",
511
+ border: _.amountError ? "1px solid #ff4d4f" : "1px solid #23262F",
512
+ background: "#23262F",
513
+ color: "#fff",
514
+ fontSize: 15,
515
+ outline: "none",
516
+ marginBottom: 0
517
+ }
518
+ }
519
+ ),
520
+ _.amountError && /* @__PURE__ */ d("div", { style: { color: "#ff4d4f", fontSize: 13, marginTop: 4 }, children: _.amountError })
521
+ ] }),
522
+ /* @__PURE__ */ d("div", { style: { marginBottom: 18 }, children: [
523
+ /* @__PURE__ */ d("div", { style: { marginBottom: 8, fontSize: 14 }, children: [
524
+ /* @__PURE__ */ d("span", { style: { color: "#00E8C6" }, children: "*" }),
525
+ " 支付平台"
526
+ ] }),
527
+ /* @__PURE__ */ d(
528
+ "select",
529
+ {
530
+ style: {
531
+ width: "100%",
532
+ padding: "10px 12px",
533
+ borderRadius: 6,
534
+ border: _.rechargeChannelError ? "1px solid #ff4d4f" : "1px solid #23262F",
535
+ background: "#23262F",
536
+ color: "#fff",
537
+ fontSize: 15,
538
+ outline: "none"
539
+ },
540
+ value: _.rechargeChannel,
541
+ onInput: (u) => {
542
+ const c = u.target.value;
543
+ r((s) => ({
544
+ ...s,
545
+ rechargeChannel: c,
546
+ rechargeChannelError: c ? "" : s.rechargeChannelError
547
+ }));
548
+ },
549
+ children: [
550
+ /* @__PURE__ */ d("option", { value: "alipay", children: "支付宝" }),
551
+ /* @__PURE__ */ d("option", { value: "wechat", children: "微信" }),
552
+ /* @__PURE__ */ d("option", { value: "paypal", children: "PayPal" })
553
+ ]
554
+ }
555
+ ),
556
+ _.rechargeChannelError && /* @__PURE__ */ d("div", { style: { color: "#ff4d4f", fontSize: 13, marginTop: 4 }, children: _.rechargeChannelError })
557
+ ] }),
558
+ /* @__PURE__ */ d("div", { style: { marginBottom: 24 }, children: [
559
+ /* @__PURE__ */ d("div", { style: { marginBottom: 8, fontSize: 14 }, children: "币种" }),
560
+ /* @__PURE__ */ d(
561
+ "select",
562
+ {
563
+ style: {
564
+ width: "100%",
565
+ padding: "10px 12px",
566
+ borderRadius: 6,
567
+ border: "1px solid #23262F",
568
+ background: "#23262F",
569
+ color: "#fff",
570
+ fontSize: 15,
571
+ outline: "none"
572
+ },
573
+ value: _.currency,
574
+ children: [
575
+ /* @__PURE__ */ d("option", { value: "USD", children: "USD" }),
576
+ /* @__PURE__ */ d("option", { value: "CNY", children: "CNY" }),
577
+ /* @__PURE__ */ d("option", { value: "EUR", children: "EUR" })
578
+ ]
579
+ }
580
+ )
581
+ ] }),
582
+ _.error && /* @__PURE__ */ d("div", { style: { color: "#ff4d4f", marginBottom: 12 }, children: _.error }),
583
+ /* @__PURE__ */ d("div", { style: { display: "flex", justifyContent: "flex-end", gap: 12 }, children: [
584
+ /* @__PURE__ */ d(
585
+ "button",
586
+ {
587
+ type: "button",
588
+ onClick: e,
589
+ style: { background: "#23262F", color: "#fff", border: "none", borderRadius: 6, padding: "8px 24px", fontSize: 15, cursor: "pointer" },
590
+ children: "取消"
591
+ }
592
+ ),
593
+ /* @__PURE__ */ d(
594
+ "button",
595
+ {
596
+ type: "submit",
597
+ disabled: _.loading,
598
+ style: { background: "#00E8C6", color: "#fff", border: "none", borderRadius: 6, padding: "8px 24px", fontSize: 15, cursor: "pointer", fontWeight: 600 },
599
+ children: _.loading ? "提交中..." : "去支付"
600
+ }
601
+ )
602
+ ] })
603
+ ]
604
+ }
605
+ )
550
606
  }
551
- ) }) : null;
607
+ ) : null;
608
+ }
609
+ function ne() {
610
+ return (ne = Object.assign ? Object.assign.bind() : function(t) {
611
+ for (var e = 1; e < arguments.length; e++) {
612
+ var n = arguments[e];
613
+ for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
614
+ }
615
+ return t;
616
+ }).apply(this, arguments);
617
+ }
618
+ var Ge = ["context", "children"];
619
+ function Je(t) {
620
+ this.getChildContext = function() {
621
+ return t.context;
622
+ };
623
+ var e = t.children, n = function(o, _) {
624
+ if (o == null) return {};
625
+ var r, l, a = {}, u = Object.keys(o);
626
+ for (l = 0; l < u.length; l++) _.indexOf(r = u[l]) >= 0 || (a[r] = o[r]);
627
+ return a;
628
+ }(t, Ge);
629
+ return He(e, n);
630
+ }
631
+ function Ke() {
632
+ var t = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
633
+ this.dispatchEvent(t), this._vdom = $(Je, ne({}, this._props, { context: t.detail.context }), function e(n, o) {
634
+ if (n.nodeType === 3) return n.data;
635
+ if (n.nodeType !== 1) return null;
636
+ var _ = [], r = {}, l = 0, a = n.attributes, u = n.childNodes;
637
+ for (l = a.length; l--; ) a[l].name !== "slot" && (r[a[l].name] = a[l].value, r[Ae(a[l].name)] = a[l].value);
638
+ for (l = u.length; l--; ) {
639
+ var c = e(u[l], null), s = u[l].slot;
640
+ s ? r[s] = $(me, { name: s }, c) : _[l] = c;
641
+ }
642
+ var i = o ? $(me, null, _) : _;
643
+ return $(o || n.nodeName.toLowerCase(), r, i);
644
+ }(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? Pe : q)(this._vdom, this._root);
645
+ }
646
+ function Ae(t) {
647
+ return t.replace(/-(\w)/g, function(e, n) {
648
+ return n ? n.toUpperCase() : "";
649
+ });
650
+ }
651
+ function Qe(t, e, n) {
652
+ if (this._vdom) {
653
+ var o = {};
654
+ o[t] = n = n ?? void 0, o[Ae(t)] = n, this._vdom = He(this._vdom, o), q(this._vdom, this._root);
655
+ }
656
+ }
657
+ function Xe() {
658
+ q(this._vdom = null, this._root);
659
+ }
660
+ function me(t, e) {
661
+ var n = this;
662
+ return $("slot", ne({}, t, { ref: function(o) {
663
+ o ? (n.ref = o, n._listener || (n._listener = function(_) {
664
+ _.stopPropagation(), _.detail.context = e;
665
+ }, o.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
666
+ } }));
667
+ }
668
+ function Ze(t, e, n, o) {
669
+ function _() {
670
+ var r = Reflect.construct(HTMLElement, [], _);
671
+ return r._vdomComponent = t, r._root = r, r;
672
+ }
673
+ return (_.prototype = Object.create(HTMLElement.prototype)).constructor = _, _.prototype.connectedCallback = Ke, _.prototype.attributeChangedCallback = Qe, _.prototype.disconnectedCallback = Xe, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), _.observedAttributes = n, n.forEach(function(r) {
674
+ Object.defineProperty(_.prototype, r, { get: function() {
675
+ return this._vdom.props[r];
676
+ }, set: function(l) {
677
+ this._vdom ? this.attributeChangedCallback(r, null, l) : (this._props || (this._props = {}), this._props[r] = l, this.connectedCallback());
678
+ var a = typeof l;
679
+ l != null && a !== "string" && a !== "boolean" && a !== "number" || this.setAttribute(r, l);
680
+ } });
681
+ }), customElements.define(e, _);
552
682
  }
553
- function Ze(e) {
554
- const [t, _] = A(!1), n = e.theme?.primaryColor;
555
- return /* @__PURE__ */ k("div", { children: [
556
- /* @__PURE__ */ k(Xe, { color: n, onClick: () => _(!0), children: "打开表单" }),
557
- /* @__PURE__ */ k(
683
+ function et(t) {
684
+ const [e, n] = Ne(!1), o = t.theme?.primaryColor;
685
+ return /* @__PURE__ */ d("div", { children: [
686
+ /* @__PURE__ */ d(Ve, { color: o, onClick: () => n(!0), children: "打开表单" }),
687
+ /* @__PURE__ */ d(
558
688
  Ye,
559
689
  {
560
- visible: t,
561
- onClose: () => _(!1),
690
+ visible: e,
691
+ onClose: () => n(!1),
562
692
  onSubmit: async (r) => {
563
693
  console.log("submit", r);
564
694
  },
565
- color: n
695
+ color: o
566
696
  }
567
697
  )
568
698
  ] });
569
699
  }
570
- Ue(Ze, "x-best-modal-form", ["theme"], { shadow: !1 });
571
- const _t = ["x-greeting", "x-best-modal-form"];
700
+ Ze(et, "x-best-modal-form", ["theme"]);
701
+ const rt = ["x-greeting", "x-best-modal-form"];
572
702
  export {
573
- _t as components,
574
- et as npmTest,
575
- tt as printCurrentTime
703
+ rt as components,
704
+ tt as npmTest,
705
+ nt as printCurrentTime
576
706
  };