twd-js 1.3.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -15
- package/dist/bundled.d.ts +5 -0
- package/dist/bundled.es.js +603 -433
- package/dist/bundled.umd.js +7 -2
- package/dist/index.cjs.js +44 -39
- package/dist/index.d.ts +76 -2
- package/dist/index.es.js +3952 -3792
- package/dist/{jsx-runtime-DqUUEvWR.mjs → jsx-runtime-BGWd3k7q.mjs} +2 -2
- package/dist/mock-sw.js +1 -1
- package/dist/ui.es.js +1 -1
- package/package.json +12 -10
package/dist/bundled.es.js
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
var
|
|
1
|
+
var V, h, Re, $, de, Ce, $e, Ee, re, J, Z, A = {}, Ie = [], je = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, X = Array.isArray;
|
|
2
2
|
function T(t, e) {
|
|
3
3
|
for (var n in e) t[n] = e[n];
|
|
4
4
|
return t;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function oe(t) {
|
|
7
7
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
var r,
|
|
11
|
-
for (
|
|
12
|
-
if (arguments.length > 2 && (
|
|
13
|
-
return
|
|
9
|
+
function Oe(t, e, n) {
|
|
10
|
+
var r, i, o, l = {};
|
|
11
|
+
for (o in e) o == "key" ? r = e[o] : o == "ref" ? i = e[o] : l[o] = e[o];
|
|
12
|
+
if (arguments.length > 2 && (l.children = arguments.length > 3 ? V.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (o in t.defaultProps) l[o] === void 0 && (l[o] = t.defaultProps[o]);
|
|
13
|
+
return U(t, l, r, i, null);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
var
|
|
17
|
-
return
|
|
15
|
+
function U(t, e, n, r, i) {
|
|
16
|
+
var o = { type: t, props: e, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++Re, __i: -1, __u: 0 };
|
|
17
|
+
return i == null && h.vnode != null && h.vnode(o), o;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function N(t) {
|
|
20
20
|
return t.children;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function F(t, e) {
|
|
23
23
|
this.props = t, this.context = e;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
if (e == null) return t.__ ?
|
|
25
|
+
function I(t, e) {
|
|
26
|
+
if (e == null) return t.__ ? I(t.__, t.__i + 1) : null;
|
|
27
27
|
for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
|
|
28
|
-
return typeof t.type == "function" ?
|
|
28
|
+
return typeof t.type == "function" ? I(t) : null;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function We(t) {
|
|
31
31
|
var e, n;
|
|
32
32
|
if ((t = t.__) != null && t.__c != null) {
|
|
33
33
|
for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
|
|
34
34
|
t.__e = t.__c.base = n.__e;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return We(t);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
(!t.__d && (t.__d = !0) &&
|
|
40
|
+
function ue(t) {
|
|
41
|
+
(!t.__d && (t.__d = !0) && $.push(t) && !O.__r++ || de != h.debounceRendering) && ((de = h.debounceRendering) || Ce)(O);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
for (var t, e, n, r,
|
|
45
|
-
|
|
43
|
+
function O() {
|
|
44
|
+
for (var t, e, n, r, i, o, l, _ = 1; $.length; ) $.length > _ && $.sort($e), t = $.shift(), _ = $.length, t.__d && (n = void 0, r = void 0, i = (r = (e = t).__v).__e, o = [], l = [], e.__P && ((n = T({}, r)).__v = r.__v + 1, h.vnode && h.vnode(n), se(e.__P, n, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [i] : null, o, i ?? I(r), !!(32 & r.__u), l), n.__v = r.__v, n.__.__k[n.__i] = n, Ae(o, n, l), r.__e = r.__ = null, n.__e != i && We(n)));
|
|
45
|
+
O.__r = 0;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
var
|
|
49
|
-
for (
|
|
50
|
-
return n.__e =
|
|
47
|
+
function Le(t, e, n, r, i, o, l, _, p, a, d) {
|
|
48
|
+
var s, c, u, g, k, b, v, m = r && r.__k || Ie, R = e.length;
|
|
49
|
+
for (p = qe(n, e, m, p, R), s = 0; s < R; s++) (u = n.__k[s]) != null && (c = u.__i == -1 ? A : m[u.__i] || A, u.__i = s, b = se(t, u, c, i, o, l, _, p, a, d), g = u.__e, u.ref && c.ref != u.ref && (c.ref && ie(c.ref, null, u), d.push(u.ref, u.__c || g, u)), k == null && g != null && (k = g), (v = !!(4 & u.__u)) || c.__k === u.__k ? p = He(u, p, t, v) : typeof u.type == "function" && b !== void 0 ? p = b : g && (p = g.nextSibling), u.__u &= -7);
|
|
50
|
+
return n.__e = k, p;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
var
|
|
54
|
-
for (t.__k = new Array(
|
|
55
|
-
if (
|
|
52
|
+
function qe(t, e, n, r, i) {
|
|
53
|
+
var o, l, _, p, a, d = n.length, s = d, c = 0;
|
|
54
|
+
for (t.__k = new Array(i), o = 0; o < i; o++) (l = e[o]) != null && typeof l != "boolean" && typeof l != "function" ? (typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? l = t.__k[o] = U(null, l, null, null, null) : X(l) ? l = t.__k[o] = U(N, { children: l }, null, null, null) : l.constructor === void 0 && l.__b > 0 ? l = t.__k[o] = U(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : t.__k[o] = l, p = o + c, l.__ = t, l.__b = t.__b + 1, _ = null, (a = l.__i = Ve(l, n, p, s)) != -1 && (s--, (_ = n[a]) && (_.__u |= 2)), _ == null || _.__v == null ? (a == -1 && (i > d ? c-- : i < d && c++), typeof l.type != "function" && (l.__u |= 4)) : a != p && (a == p - 1 ? c-- : a == p + 1 ? c++ : (a > p ? c-- : c++, l.__u |= 4))) : t.__k[o] = null;
|
|
55
|
+
if (s) for (o = 0; o < d; o++) (_ = n[o]) != null && (2 & _.__u) == 0 && (_.__e == r && (r = I(_)), Ne(_, _));
|
|
56
56
|
return r;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
var
|
|
58
|
+
function He(t, e, n, r) {
|
|
59
|
+
var i, o;
|
|
60
60
|
if (typeof t.type == "function") {
|
|
61
|
-
for (
|
|
61
|
+
for (i = t.__k, o = 0; i && o < i.length; o++) i[o] && (i[o].__ = t, e = He(i[o], e, n, r));
|
|
62
62
|
return e;
|
|
63
63
|
}
|
|
64
|
-
t.__e != e && (r && (e && t.type && !e.parentNode && (e =
|
|
64
|
+
t.__e != e && (r && (e && t.type && !e.parentNode && (e = I(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
|
|
65
65
|
do
|
|
66
66
|
e = e && e.nextSibling;
|
|
67
67
|
while (e != null && e.nodeType == 8);
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
var
|
|
72
|
-
if (a === null &&
|
|
73
|
-
if (r > (
|
|
74
|
-
for (
|
|
70
|
+
function Ve(t, e, n, r) {
|
|
71
|
+
var i, o, l, _ = t.key, p = t.type, a = e[n], d = a != null && (2 & a.__u) == 0;
|
|
72
|
+
if (a === null && _ == null || d && _ == a.key && p == a.type) return n;
|
|
73
|
+
if (r > (d ? 1 : 0)) {
|
|
74
|
+
for (i = n - 1, o = n + 1; i >= 0 || o < e.length; ) if ((a = e[l = i >= 0 ? i-- : o++]) != null && (2 & a.__u) == 0 && _ == a.key && p == a.type) return l;
|
|
75
75
|
}
|
|
76
76
|
return -1;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" ||
|
|
78
|
+
function fe(t, e, n) {
|
|
79
|
+
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || je.test(e) ? n : n + "px";
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
var
|
|
81
|
+
function B(t, e, n, r, i) {
|
|
82
|
+
var o, l;
|
|
83
83
|
e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
|
|
84
84
|
else {
|
|
85
|
-
if (typeof r == "string" && (t.style.cssText = r = ""), r) for (e in r) n && e in n ||
|
|
86
|
-
if (n) for (e in n) r && n[e] == r[e] ||
|
|
85
|
+
if (typeof r == "string" && (t.style.cssText = r = ""), r) for (e in r) n && e in n || fe(t.style, e, "");
|
|
86
|
+
if (n) for (e in n) r && n[e] == r[e] || fe(t.style, e, n[e]);
|
|
87
87
|
}
|
|
88
|
-
else if (e[0] == "o" && e[1] == "n")
|
|
88
|
+
else if (e[0] == "o" && e[1] == "n") o = e != (e = e.replace(Ee, "$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 + o] = n, n ? r ? n.u = r.u : (n.u = re, t.addEventListener(e, o ? Z : J, o)) : t.removeEventListener(e, o ? Z : J, o);
|
|
89
89
|
else {
|
|
90
|
-
if (
|
|
90
|
+
if (i == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
91
91
|
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 {
|
|
92
92
|
t[e] = n ?? "";
|
|
93
93
|
break e;
|
|
@@ -96,99 +96,99 @@ function D(t, e, n, r, s) {
|
|
|
96
96
|
typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function pe(t) {
|
|
100
100
|
return function(e) {
|
|
101
101
|
if (this.l) {
|
|
102
102
|
var n = this.l[e.type + t];
|
|
103
|
-
if (e.t == null) e.t =
|
|
103
|
+
if (e.t == null) e.t = re++;
|
|
104
104
|
else if (e.t < n.u) return;
|
|
105
105
|
return n(h.event ? h.event(e) : e);
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
var
|
|
111
|
-
if (e.constructor
|
|
112
|
-
128 & n.__u && (
|
|
113
|
-
e: if (typeof
|
|
114
|
-
if (
|
|
109
|
+
function se(t, e, n, r, i, o, l, _, p, a) {
|
|
110
|
+
var d, s, c, u, g, k, b, v, m, R, C, z, W, ce, P, L, Y, x = e.type;
|
|
111
|
+
if (e.constructor !== void 0) return null;
|
|
112
|
+
128 & n.__u && (p = !!(32 & n.__u), o = [_ = e.__e = n.__e]), (d = h.__b) && d(e);
|
|
113
|
+
e: if (typeof x == "function") try {
|
|
114
|
+
if (v = e.props, m = "prototype" in x && x.prototype.render, R = (d = x.contextType) && r[d.__c], C = d ? R ? R.props.value : d.__ : r, n.__c ? b = (s = e.__c = n.__c).__ = s.__E : (m ? e.__c = s = new x(v, C) : (e.__c = s = new F(v, C), s.constructor = x, s.render = Ke), R && R.sub(s), s.state || (s.state = {}), s.__n = r, c = s.__d = !0, s.__h = [], s._sb = []), m && s.__s == null && (s.__s = s.state), m && x.getDerivedStateFromProps != null && (s.__s == s.state && (s.__s = T({}, s.__s)), T(s.__s, x.getDerivedStateFromProps(v, s.__s))), u = s.props, g = s.state, s.__v = e, c) m && x.getDerivedStateFromProps == null && s.componentWillMount != null && s.componentWillMount(), m && s.componentDidMount != null && s.__h.push(s.componentDidMount);
|
|
115
115
|
else {
|
|
116
|
-
if (
|
|
117
|
-
for (e.__v != n.__v && (
|
|
118
|
-
|
|
119
|
-
}),
|
|
120
|
-
|
|
116
|
+
if (m && x.getDerivedStateFromProps == null && v !== u && s.componentWillReceiveProps != null && s.componentWillReceiveProps(v, C), e.__v == n.__v || !s.__e && s.shouldComponentUpdate != null && s.shouldComponentUpdate(v, s.__s, C) === !1) {
|
|
117
|
+
for (e.__v != n.__v && (s.props = v, s.state = s.__s, s.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(E) {
|
|
118
|
+
E && (E.__ = e);
|
|
119
|
+
}), z = 0; z < s._sb.length; z++) s.__h.push(s._sb[z]);
|
|
120
|
+
s._sb = [], s.__h.length && l.push(s);
|
|
121
121
|
break e;
|
|
122
122
|
}
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
s.componentWillUpdate != null && s.componentWillUpdate(v, s.__s, C), m && s.componentDidUpdate != null && s.__h.push(function() {
|
|
124
|
+
s.componentDidUpdate(u, g, k);
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
if (
|
|
128
|
-
for (
|
|
129
|
-
|
|
127
|
+
if (s.context = C, s.props = v, s.__P = t, s.__e = !1, W = h.__r, ce = 0, m) {
|
|
128
|
+
for (s.state = s.__s, s.__d = !1, W && W(e), d = s.render(s.props, s.state, s.context), P = 0; P < s._sb.length; P++) s.__h.push(s._sb[P]);
|
|
129
|
+
s._sb = [];
|
|
130
130
|
} else do
|
|
131
|
-
|
|
132
|
-
while (
|
|
133
|
-
|
|
134
|
-
} catch (
|
|
135
|
-
if (e.__v = null,
|
|
136
|
-
for (e.__u |=
|
|
137
|
-
|
|
131
|
+
s.__d = !1, W && W(e), d = s.render(s.props, s.state, s.context), s.state = s.__s;
|
|
132
|
+
while (s.__d && ++ce < 25);
|
|
133
|
+
s.state = s.__s, s.getChildContext != null && (r = T(T({}, r), s.getChildContext())), m && !c && s.getSnapshotBeforeUpdate != null && (k = s.getSnapshotBeforeUpdate(u, g)), L = d, d != null && d.type === N && d.key == null && (L = Me(d.props.children)), _ = Le(t, X(L) ? L : [L], e, n, r, i, o, l, _, p, a), s.base = e.__e, e.__u &= -161, s.__h.length && l.push(s), b && (s.__E = s.__ = null);
|
|
134
|
+
} catch (E) {
|
|
135
|
+
if (e.__v = null, p || o != null) if (E.then) {
|
|
136
|
+
for (e.__u |= p ? 160 : 128; _ && _.nodeType == 8 && _.nextSibling; ) _ = _.nextSibling;
|
|
137
|
+
o[o.indexOf(_)] = null, e.__e = _;
|
|
138
138
|
} else {
|
|
139
|
-
for (
|
|
140
|
-
|
|
139
|
+
for (Y = o.length; Y--; ) oe(o[Y]);
|
|
140
|
+
Q(e);
|
|
141
141
|
}
|
|
142
|
-
else e.__e = n.__e, e.__k = n.__k,
|
|
143
|
-
h.__e(
|
|
142
|
+
else e.__e = n.__e, e.__k = n.__k, E.then || Q(e);
|
|
143
|
+
h.__e(E, e, n);
|
|
144
144
|
}
|
|
145
|
-
else
|
|
146
|
-
return (
|
|
145
|
+
else o == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : _ = e.__e = Xe(n.__e, e, n, r, i, o, l, p, a);
|
|
146
|
+
return (d = h.diffed) && d(e), 128 & e.__u ? void 0 : _;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(
|
|
148
|
+
function Q(t) {
|
|
149
|
+
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(Q);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function Ae(t, e, n) {
|
|
152
152
|
for (var r = 0; r < n.length; r++) ie(n[r], n[++r], n[++r]);
|
|
153
|
-
h.__c && h.__c(e, t), t.some(function(
|
|
153
|
+
h.__c && h.__c(e, t), t.some(function(i) {
|
|
154
154
|
try {
|
|
155
|
-
t =
|
|
156
|
-
|
|
155
|
+
t = i.__h, i.__h = [], t.some(function(o) {
|
|
156
|
+
o.call(i);
|
|
157
157
|
});
|
|
158
|
-
} catch (
|
|
159
|
-
h.__e(
|
|
158
|
+
} catch (o) {
|
|
159
|
+
h.__e(o, i.__v);
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t :
|
|
163
|
+
function Me(t) {
|
|
164
|
+
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : X(t) ? t.map(Me) : T({}, t);
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
var a,
|
|
168
|
-
if (
|
|
169
|
-
for (a = 0; a <
|
|
170
|
-
t =
|
|
166
|
+
function Xe(t, e, n, r, i, o, l, _, p) {
|
|
167
|
+
var a, d, s, c, u, g, k, b = n.props || A, v = e.props, m = e.type;
|
|
168
|
+
if (m == "svg" ? i = "http://www.w3.org/2000/svg" : m == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), o != null) {
|
|
169
|
+
for (a = 0; a < o.length; a++) if ((u = o[a]) && "setAttribute" in u == !!m && (m ? u.localName == m : u.nodeType == 3)) {
|
|
170
|
+
t = u, o[a] = null;
|
|
171
171
|
break;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
if (t == null) {
|
|
175
|
-
if (
|
|
176
|
-
t = document.createElementNS(
|
|
175
|
+
if (m == null) return document.createTextNode(v);
|
|
176
|
+
t = document.createElementNS(i, m, v.is && v), _ && (h.__m && h.__m(e, o), _ = !1), o = null;
|
|
177
177
|
}
|
|
178
|
-
if (
|
|
178
|
+
if (m == null) b === v || _ && t.data == v || (t.data = v);
|
|
179
179
|
else {
|
|
180
|
-
if (
|
|
181
|
-
for (a in
|
|
182
|
-
if (a == "dangerouslySetInnerHTML")
|
|
183
|
-
else if (!(a in
|
|
184
|
-
if (a == "value" && "defaultValue" in
|
|
185
|
-
|
|
180
|
+
if (o = o && V.call(t.childNodes), !_ && o != null) for (b = {}, a = 0; a < t.attributes.length; a++) b[(u = t.attributes[a]).name] = u.value;
|
|
181
|
+
for (a in b) if (u = b[a], a != "children") {
|
|
182
|
+
if (a == "dangerouslySetInnerHTML") s = u;
|
|
183
|
+
else if (!(a in v)) {
|
|
184
|
+
if (a == "value" && "defaultValue" in v || a == "checked" && "defaultChecked" in v) continue;
|
|
185
|
+
B(t, a, null, u, i);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
for (a in
|
|
189
|
-
if (
|
|
190
|
-
else if (
|
|
191
|
-
|
|
188
|
+
for (a in v) u = v[a], a == "children" ? c = u : a == "dangerouslySetInnerHTML" ? d = u : a == "value" ? g = u : a == "checked" ? k = u : _ && typeof u != "function" || b[a] === u || B(t, a, u, b[a], i);
|
|
189
|
+
if (d) _ || s && (d.__html == s.__html || d.__html == t.innerHTML) || (t.innerHTML = d.__html), e.__k = [];
|
|
190
|
+
else if (s && (t.innerHTML = ""), Le(e.type == "template" ? t.content : t, X(c) ? c : [c], e, n, r, m == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, o, l, o ? o[0] : n.__k && I(n, 0), _, p), o != null) for (a = o.length; a--; ) oe(o[a]);
|
|
191
|
+
_ || (a = "value", m == "progress" && g == null ? t.removeAttribute("value") : g != null && (g !== t[a] || m == "progress" && !g || m == "option" && g != b[a]) && B(t, a, g, b[a], i), a = "checked", k != null && k != t[a] && B(t, a, k, b[a], i));
|
|
192
192
|
}
|
|
193
193
|
return t;
|
|
194
194
|
}
|
|
@@ -198,186 +198,268 @@ function ie(t, e, n) {
|
|
|
198
198
|
var r = typeof t.__u == "function";
|
|
199
199
|
r && t.__u(), r && e == null || (t.__u = t(e));
|
|
200
200
|
} else t.current = e;
|
|
201
|
-
} catch (
|
|
202
|
-
h.__e(
|
|
201
|
+
} catch (i) {
|
|
202
|
+
h.__e(i, n);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
var r,
|
|
205
|
+
function Ne(t, e, n) {
|
|
206
|
+
var r, i;
|
|
207
207
|
if (h.unmount && h.unmount(t), (r = t.ref) && (r.current && r.current != t.__e || ie(r, null, e)), (r = t.__c) != null) {
|
|
208
208
|
if (r.componentWillUnmount) try {
|
|
209
209
|
r.componentWillUnmount();
|
|
210
|
-
} catch (
|
|
211
|
-
h.__e(
|
|
210
|
+
} catch (o) {
|
|
211
|
+
h.__e(o, e);
|
|
212
212
|
}
|
|
213
213
|
r.base = r.__P = null;
|
|
214
214
|
}
|
|
215
|
-
if (r = t.__k) for (
|
|
216
|
-
n ||
|
|
215
|
+
if (r = t.__k) for (i = 0; i < r.length; i++) r[i] && Ne(r[i], e, n || typeof t.type != "function");
|
|
216
|
+
n || oe(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Ke(t, e, n) {
|
|
219
219
|
return this.constructor(t, n);
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
var r,
|
|
223
|
-
e == document && (e = document.documentElement), h.__ && h.__(t, e),
|
|
221
|
+
function Ye(t, e, n) {
|
|
222
|
+
var r, i, o, l;
|
|
223
|
+
e == document && (e = document.documentElement), h.__ && h.__(t, e), i = (r = !1) ? null : e.__k, o = [], l = [], se(e, t = e.__k = Oe(N, null, [t]), i || A, A, e.namespaceURI, i ? null : e.firstChild ? V.call(e.childNodes) : null, o, i ? i.__e : e.firstChild, r, l), Ae(o, t, l);
|
|
224
224
|
}
|
|
225
|
-
|
|
226
|
-
for (var
|
|
227
|
-
if ((
|
|
228
|
-
} catch (
|
|
229
|
-
t =
|
|
225
|
+
V = Ie.slice, h = { __e: function(t, e, n, r) {
|
|
226
|
+
for (var i, o, l; e = e.__; ) if ((i = e.__c) && !i.__) try {
|
|
227
|
+
if ((o = i.constructor) && o.getDerivedStateFromError != null && (i.setState(o.getDerivedStateFromError(t)), l = i.__d), i.componentDidCatch != null && (i.componentDidCatch(t, r || {}), l = i.__d), l) return i.__E = i;
|
|
228
|
+
} catch (_) {
|
|
229
|
+
t = _;
|
|
230
230
|
}
|
|
231
231
|
throw t;
|
|
232
|
-
} },
|
|
232
|
+
} }, Re = 0, F.prototype.setState = function(t, e) {
|
|
233
233
|
var n;
|
|
234
|
-
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = T({}, this.state), typeof t == "function" && (t = t(T({}, n), this.props)), t && T(n, t), t != null && this.__v && (e && this._sb.push(e),
|
|
235
|
-
},
|
|
236
|
-
this.__v && (this.__e = !0, t && this.__h.push(t),
|
|
237
|
-
},
|
|
234
|
+
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = T({}, this.state), typeof t == "function" && (t = t(T({}, n), this.props)), t && T(n, t), t != null && this.__v && (e && this._sb.push(e), ue(this));
|
|
235
|
+
}, F.prototype.forceUpdate = function(t) {
|
|
236
|
+
this.__v && (this.__e = !0, t && this.__h.push(t), ue(this));
|
|
237
|
+
}, F.prototype.render = N, $ = [], Ce = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, $e = function(t, e) {
|
|
238
238
|
return t.__v.__b - e.__v.__b;
|
|
239
|
-
},
|
|
240
|
-
var
|
|
241
|
-
function
|
|
239
|
+
}, O.__r = 0, Ee = /(PointerCapture)$|Capture$/i, re = 0, J = pe(!1), Z = pe(!0);
|
|
240
|
+
var Ge = 0;
|
|
241
|
+
function f(t, e, n, r, i, o) {
|
|
242
242
|
e || (e = {});
|
|
243
|
-
var
|
|
244
|
-
if ("ref" in
|
|
245
|
-
var a = { type: t, props:
|
|
246
|
-
if (typeof t == "function" && (
|
|
243
|
+
var l, _, p = e;
|
|
244
|
+
if ("ref" in p) for (_ in p = {}, e) _ == "ref" ? l = e[_] : p[_] = e[_];
|
|
245
|
+
var a = { type: t, props: p, key: n, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Ge, __i: -1, __u: 0, __source: i, __self: o };
|
|
246
|
+
if (typeof t == "function" && (l = t.defaultProps)) for (_ in l) p[_] === void 0 && (p[_] = l[_]);
|
|
247
247
|
return h.vnode && h.vnode(a), a;
|
|
248
248
|
}
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
249
|
+
const Je = {
|
|
250
|
+
// Colors
|
|
251
|
+
primary: "#3b82f6",
|
|
252
|
+
background: "#1e293b",
|
|
253
|
+
backgroundSecondary: "#334155",
|
|
254
|
+
border: "#475569",
|
|
255
|
+
borderLight: "#64748b",
|
|
256
|
+
text: "#f1f5f9",
|
|
257
|
+
textSecondary: "#cbd5e1",
|
|
258
|
+
textMuted: "#94a3b8",
|
|
259
|
+
// Status colors
|
|
260
|
+
success: "#22c55e",
|
|
261
|
+
successBg: "#14532d",
|
|
262
|
+
error: "#ef4444",
|
|
263
|
+
errorBg: "#7f1d1d",
|
|
264
|
+
warning: "#fbbf24",
|
|
265
|
+
warningBg: "#78350f",
|
|
266
|
+
skip: "#475569",
|
|
267
|
+
skipBg: "#334155",
|
|
268
|
+
// Interactive elements
|
|
269
|
+
buttonPrimary: "#3b82f6",
|
|
270
|
+
buttonPrimaryText: "#ffffff",
|
|
271
|
+
buttonSecondary: "#334155",
|
|
272
|
+
buttonSecondaryText: "#f1f5f9",
|
|
273
|
+
buttonBorder: "#475569",
|
|
274
|
+
// Spacing
|
|
275
|
+
spacingXs: "4px",
|
|
276
|
+
spacingSm: "6px",
|
|
277
|
+
spacingMd: "8px",
|
|
278
|
+
spacingLg: "12px",
|
|
279
|
+
spacingXl: "14px",
|
|
280
|
+
// Typography
|
|
281
|
+
fontSizeXs: "10px",
|
|
282
|
+
fontSizeSm: "12px",
|
|
283
|
+
fontSizeMd: "14px",
|
|
284
|
+
fontSizeLg: "16px",
|
|
285
|
+
fontWeightNormal: "400",
|
|
286
|
+
fontWeightMedium: "500",
|
|
287
|
+
fontWeightBold: "700",
|
|
288
|
+
// Layout
|
|
289
|
+
sidebarWidth: "320px",
|
|
290
|
+
borderRadius: "8px",
|
|
291
|
+
borderRadiusLg: "6px",
|
|
292
|
+
// Effects
|
|
293
|
+
shadow: "2px 0 8px rgba(0,0,0,0.3)",
|
|
294
|
+
shadowSm: "0 2px 4px rgba(0, 0, 0, 0.2)",
|
|
295
|
+
// Z-index
|
|
296
|
+
zIndexSidebar: "1000",
|
|
297
|
+
zIndexSticky: "1000",
|
|
298
|
+
// Animation
|
|
299
|
+
animationDuration: "0.2s",
|
|
300
|
+
// Icon colors
|
|
301
|
+
iconColor: "#f1f5f9",
|
|
302
|
+
iconColorSecondary: "#cbd5e1"
|
|
303
|
+
};
|
|
304
|
+
function Ze(t = {}) {
|
|
305
|
+
const e = { ...Je, ...t };
|
|
306
|
+
return Object.entries(e).map(([n, r]) => `${`--twd-${n.replace(/([A-Z])/g, "-$1").toLowerCase()}`}: ${r};`).join(`
|
|
307
|
+
`);
|
|
308
|
+
}
|
|
309
|
+
function Qe(t) {
|
|
310
|
+
const e = "twd-theme-variables";
|
|
311
|
+
let n = document.getElementById(e);
|
|
312
|
+
n || (n = document.createElement("style"), n.id = e, document.head.appendChild(n));
|
|
313
|
+
const r = Ze(t);
|
|
314
|
+
n.textContent = `
|
|
315
|
+
:root {
|
|
316
|
+
${r}
|
|
317
|
+
}
|
|
318
|
+
`;
|
|
319
|
+
}
|
|
320
|
+
const et = (t) => {
|
|
321
|
+
const { Component: e, createRoot: n, theme: r } = t;
|
|
322
|
+
Qe(r);
|
|
323
|
+
const i = document.createElement("div");
|
|
324
|
+
i.setAttribute("id", "twd-sidebar-root"), document.body.appendChild(i), n(i).render(e);
|
|
325
|
+
}, tt = async (t, e, n, r) => {
|
|
326
|
+
for (const i in t) await t[i]();
|
|
327
|
+
et({ Component: e, createRoot: n, theme: r });
|
|
255
328
|
};
|
|
256
|
-
var
|
|
257
|
-
function
|
|
258
|
-
|
|
329
|
+
var M, y, G, he, q = 0, ze = [], w = h, ge = w.__b, me = w.__r, ve = w.diffed, ye = w.__c, we = w.unmount, be = w.__;
|
|
330
|
+
function ae(t, e) {
|
|
331
|
+
w.__h && w.__h(y, t, q || e), q = 0;
|
|
259
332
|
var n = y.__H || (y.__H = { __: [], __h: [] });
|
|
260
333
|
return t >= n.__.length && n.__.push({}), n.__[t];
|
|
261
334
|
}
|
|
262
|
-
function
|
|
263
|
-
return
|
|
335
|
+
function ee(t) {
|
|
336
|
+
return q = 1, nt(Be, t);
|
|
264
337
|
}
|
|
265
|
-
function
|
|
266
|
-
var r =
|
|
267
|
-
if (r.t = t, !r.__c && (r.__ = [
|
|
268
|
-
var
|
|
269
|
-
|
|
338
|
+
function nt(t, e, n) {
|
|
339
|
+
var r = ae(M++, 2);
|
|
340
|
+
if (r.t = t, !r.__c && (r.__ = [Be(void 0, e), function(_) {
|
|
341
|
+
var p = r.__N ? r.__N[0] : r.__[0], a = r.t(p, _);
|
|
342
|
+
p !== a && (r.__N = [a, r.__[1]], r.__c.setState({}));
|
|
270
343
|
}], r.__c = y, !y.__f)) {
|
|
271
|
-
var
|
|
344
|
+
var i = function(_, p, a) {
|
|
272
345
|
if (!r.__c.__H) return !0;
|
|
273
|
-
var
|
|
274
|
-
return !!
|
|
346
|
+
var d = r.__c.__H.__.filter(function(c) {
|
|
347
|
+
return !!c.__c;
|
|
275
348
|
});
|
|
276
|
-
if (
|
|
277
|
-
return !
|
|
278
|
-
})) return !
|
|
279
|
-
var
|
|
280
|
-
return
|
|
281
|
-
if (
|
|
282
|
-
var
|
|
283
|
-
|
|
349
|
+
if (d.every(function(c) {
|
|
350
|
+
return !c.__N;
|
|
351
|
+
})) return !o || o.call(this, _, p, a);
|
|
352
|
+
var s = r.__c.props !== _;
|
|
353
|
+
return d.forEach(function(c) {
|
|
354
|
+
if (c.__N) {
|
|
355
|
+
var u = c.__[0];
|
|
356
|
+
c.__ = c.__N, c.__N = void 0, u !== c.__[0] && (s = !0);
|
|
284
357
|
}
|
|
285
|
-
}),
|
|
358
|
+
}), o && o.call(this, _, p, a) || s;
|
|
286
359
|
};
|
|
287
360
|
y.__f = !0;
|
|
288
|
-
var
|
|
289
|
-
y.componentWillUpdate = function(
|
|
361
|
+
var o = y.shouldComponentUpdate, l = y.componentWillUpdate;
|
|
362
|
+
y.componentWillUpdate = function(_, p, a) {
|
|
290
363
|
if (this.__e) {
|
|
291
|
-
var
|
|
292
|
-
|
|
364
|
+
var d = o;
|
|
365
|
+
o = void 0, i(_, p, a), o = d;
|
|
293
366
|
}
|
|
294
|
-
|
|
295
|
-
}, y.shouldComponentUpdate =
|
|
367
|
+
l && l.call(this, _, p, a);
|
|
368
|
+
}, y.shouldComponentUpdate = i;
|
|
296
369
|
}
|
|
297
370
|
return r.__N || r.__;
|
|
298
371
|
}
|
|
299
|
-
function
|
|
300
|
-
var n =
|
|
301
|
-
!
|
|
372
|
+
function le(t, e) {
|
|
373
|
+
var n = ae(M++, 3);
|
|
374
|
+
!w.__s && Pe(n.__H, e) && (n.__ = t, n.u = e, y.__H.__h.push(n));
|
|
375
|
+
}
|
|
376
|
+
function H(t) {
|
|
377
|
+
return q = 5, rt(function() {
|
|
378
|
+
return { current: t };
|
|
379
|
+
}, []);
|
|
302
380
|
}
|
|
303
|
-
function
|
|
304
|
-
|
|
305
|
-
|
|
381
|
+
function rt(t, e) {
|
|
382
|
+
var n = ae(M++, 7);
|
|
383
|
+
return Pe(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
|
|
384
|
+
}
|
|
385
|
+
function ot() {
|
|
386
|
+
for (var t; t = ze.shift(); ) if (t.__P && t.__H) try {
|
|
387
|
+
t.__H.__h.forEach(j), t.__H.__h.forEach(te), t.__H.__h = [];
|
|
306
388
|
} catch (e) {
|
|
307
|
-
t.__H.__h = [],
|
|
389
|
+
t.__H.__h = [], w.__e(e, t.__v);
|
|
308
390
|
}
|
|
309
391
|
}
|
|
310
|
-
|
|
311
|
-
y = null,
|
|
312
|
-
},
|
|
313
|
-
t && e.__k && e.__k.__m && (t.__m = e.__k.__m),
|
|
314
|
-
},
|
|
315
|
-
|
|
392
|
+
w.__b = function(t) {
|
|
393
|
+
y = null, ge && ge(t);
|
|
394
|
+
}, w.__ = function(t, e) {
|
|
395
|
+
t && e.__k && e.__k.__m && (t.__m = e.__k.__m), be && be(t, e);
|
|
396
|
+
}, w.__r = function(t) {
|
|
397
|
+
me && me(t), M = 0;
|
|
316
398
|
var e = (y = t.__c).__H;
|
|
317
|
-
e && (
|
|
399
|
+
e && (G === y ? (e.__h = [], y.__h = [], e.__.forEach(function(n) {
|
|
318
400
|
n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
|
|
319
|
-
})) : (e.__h.forEach(
|
|
320
|
-
},
|
|
321
|
-
|
|
401
|
+
})) : (e.__h.forEach(j), e.__h.forEach(te), e.__h = [], M = 0)), G = y;
|
|
402
|
+
}, w.diffed = function(t) {
|
|
403
|
+
ve && ve(t);
|
|
322
404
|
var e = t.__c;
|
|
323
|
-
e && e.__H && (e.__H.__h.length && (
|
|
405
|
+
e && e.__H && (e.__H.__h.length && (ze.push(e) !== 1 && he === w.requestAnimationFrame || ((he = w.requestAnimationFrame) || st)(ot)), e.__H.__.forEach(function(n) {
|
|
324
406
|
n.u && (n.__H = n.u), n.u = void 0;
|
|
325
|
-
})),
|
|
326
|
-
},
|
|
407
|
+
})), G = y = null;
|
|
408
|
+
}, w.__c = function(t, e) {
|
|
327
409
|
e.some(function(n) {
|
|
328
410
|
try {
|
|
329
|
-
n.__h.forEach(
|
|
330
|
-
return !r.__ ||
|
|
411
|
+
n.__h.forEach(j), n.__h = n.__h.filter(function(r) {
|
|
412
|
+
return !r.__ || te(r);
|
|
331
413
|
});
|
|
332
414
|
} catch (r) {
|
|
333
|
-
e.some(function(
|
|
334
|
-
|
|
335
|
-
}), e = [],
|
|
415
|
+
e.some(function(i) {
|
|
416
|
+
i.__h && (i.__h = []);
|
|
417
|
+
}), e = [], w.__e(r, n.__v);
|
|
336
418
|
}
|
|
337
|
-
}),
|
|
338
|
-
},
|
|
339
|
-
|
|
419
|
+
}), ye && ye(t, e);
|
|
420
|
+
}, w.unmount = function(t) {
|
|
421
|
+
we && we(t);
|
|
340
422
|
var e, n = t.__c;
|
|
341
423
|
n && n.__H && (n.__H.__.forEach(function(r) {
|
|
342
424
|
try {
|
|
343
|
-
|
|
344
|
-
} catch (
|
|
345
|
-
e =
|
|
425
|
+
j(r);
|
|
426
|
+
} catch (i) {
|
|
427
|
+
e = i;
|
|
346
428
|
}
|
|
347
|
-
}), n.__H = void 0, e &&
|
|
429
|
+
}), n.__H = void 0, e && w.__e(e, n.__v));
|
|
348
430
|
};
|
|
349
|
-
var
|
|
350
|
-
function
|
|
431
|
+
var ke = typeof requestAnimationFrame == "function";
|
|
432
|
+
function st(t) {
|
|
351
433
|
var e, n = function() {
|
|
352
|
-
clearTimeout(r),
|
|
434
|
+
clearTimeout(r), ke && cancelAnimationFrame(e), setTimeout(t);
|
|
353
435
|
}, r = setTimeout(n, 35);
|
|
354
|
-
|
|
436
|
+
ke && (e = requestAnimationFrame(n));
|
|
355
437
|
}
|
|
356
|
-
function
|
|
438
|
+
function j(t) {
|
|
357
439
|
var e = y, n = t.__c;
|
|
358
440
|
typeof n == "function" && (t.__c = void 0, n()), y = e;
|
|
359
441
|
}
|
|
360
|
-
function
|
|
442
|
+
function te(t) {
|
|
361
443
|
var e = y;
|
|
362
444
|
t.__c = t.__(), y = e;
|
|
363
445
|
}
|
|
364
|
-
function
|
|
446
|
+
function Pe(t, e) {
|
|
365
447
|
return !t || t.length !== e.length || e.some(function(n, r) {
|
|
366
448
|
return n !== t[r];
|
|
367
449
|
});
|
|
368
450
|
}
|
|
369
|
-
function
|
|
451
|
+
function Be(t, e) {
|
|
370
452
|
return typeof e == "function" ? e(t) : e;
|
|
371
453
|
}
|
|
372
|
-
const
|
|
454
|
+
const it = (t) => {
|
|
373
455
|
const e = /* @__PURE__ */ new Map(), n = [];
|
|
374
456
|
for (const r of t) e.set(r.id, { ...r, childrenNodes: [] });
|
|
375
457
|
for (const r of e.values())
|
|
376
458
|
r.parent ? e.get(r.parent)?.childrenNodes?.push(r) : n.push(r);
|
|
377
459
|
return n;
|
|
378
|
-
},
|
|
460
|
+
}, at = {
|
|
379
461
|
animation: "spin 1s linear infinite"
|
|
380
|
-
},
|
|
462
|
+
}, lt = () => /* @__PURE__ */ f(
|
|
381
463
|
"svg",
|
|
382
464
|
{
|
|
383
465
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -385,23 +467,23 @@ const tt = (t) => {
|
|
|
385
467
|
height: "24",
|
|
386
468
|
viewBox: "0 0 24 24",
|
|
387
469
|
fill: "none",
|
|
388
|
-
stroke: "
|
|
470
|
+
stroke: "var(--twd-icon-color-secondary)",
|
|
389
471
|
strokeWidth: "2",
|
|
390
472
|
strokeLinecap: "round",
|
|
391
473
|
strokeLinejoin: "round",
|
|
392
474
|
className: "lucide lucide-loader-circle-icon lucide-loader-circle",
|
|
393
|
-
style:
|
|
475
|
+
style: at,
|
|
394
476
|
"data-testid": "loader-icon",
|
|
395
|
-
children: /* @__PURE__ */
|
|
477
|
+
children: /* @__PURE__ */ f("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
396
478
|
}
|
|
397
|
-
),
|
|
398
|
-
|
|
479
|
+
), D = document.createElement("style");
|
|
480
|
+
D && !document.getElementById("loader-spin-keyframes") && (D.id = "loader-spin-keyframes", D.innerHTML = `
|
|
399
481
|
@keyframes spin {
|
|
400
482
|
0% { transform: rotate(0deg); }
|
|
401
483
|
100% { transform: rotate(360deg); }
|
|
402
484
|
}
|
|
403
|
-
`, document.head.appendChild(
|
|
404
|
-
const
|
|
485
|
+
`, document.head.appendChild(D));
|
|
486
|
+
const K = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ f(
|
|
405
487
|
"svg",
|
|
406
488
|
{
|
|
407
489
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -409,7 +491,7 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
409
491
|
height: "16",
|
|
410
492
|
viewBox: "0 0 24 24",
|
|
411
493
|
fill: "none",
|
|
412
|
-
stroke: "
|
|
494
|
+
stroke: "var(--twd-icon-color)",
|
|
413
495
|
strokeWidth: "2",
|
|
414
496
|
strokeLinecap: "round",
|
|
415
497
|
strokeLinejoin: "round",
|
|
@@ -417,13 +499,13 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
417
499
|
"data-testid": n,
|
|
418
500
|
children: e
|
|
419
501
|
}
|
|
420
|
-
),
|
|
502
|
+
), _t = () => /* @__PURE__ */ f(K, { className: "lucide-play-icon lucide-play", dataTestId: "play-icon", children: /* @__PURE__ */ f("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }) }), De = ({ id: t, name: e, skip: n, only: r }) => /* @__PURE__ */ f(N, { children: [
|
|
421
503
|
e,
|
|
422
504
|
" ",
|
|
423
|
-
r && /* @__PURE__ */
|
|
505
|
+
r && /* @__PURE__ */ f(
|
|
424
506
|
"span",
|
|
425
507
|
{
|
|
426
|
-
style: { color: "
|
|
508
|
+
style: { color: "var(--twd-primary)" },
|
|
427
509
|
"data-testid": `only-indicator-${t}`,
|
|
428
510
|
children: [
|
|
429
511
|
" ",
|
|
@@ -431,10 +513,10 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
431
513
|
]
|
|
432
514
|
}
|
|
433
515
|
),
|
|
434
|
-
n && /* @__PURE__ */
|
|
516
|
+
n && /* @__PURE__ */ f(
|
|
435
517
|
"span",
|
|
436
518
|
{
|
|
437
|
-
style: { color: "
|
|
519
|
+
style: { color: "var(--twd-text-secondary)" },
|
|
438
520
|
"data-testid": `skip-indicator-${t}`,
|
|
439
521
|
children: [
|
|
440
522
|
" ",
|
|
@@ -442,36 +524,36 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
442
524
|
]
|
|
443
525
|
}
|
|
444
526
|
)
|
|
445
|
-
] }),
|
|
527
|
+
] }), ct = (t) => {
|
|
446
528
|
switch (t.status) {
|
|
447
529
|
case "pass":
|
|
448
530
|
return {
|
|
449
531
|
item: {
|
|
450
|
-
background: "
|
|
532
|
+
background: "var(--twd-success-bg)"
|
|
451
533
|
},
|
|
452
534
|
container: {
|
|
453
|
-
borderLeft: "3px solid
|
|
535
|
+
borderLeft: "3px solid var(--twd-success)"
|
|
454
536
|
}
|
|
455
537
|
};
|
|
456
538
|
case "fail":
|
|
457
539
|
return {
|
|
458
540
|
item: {
|
|
459
|
-
background: "
|
|
541
|
+
background: "var(--twd-error-bg)"
|
|
460
542
|
},
|
|
461
543
|
container: {
|
|
462
|
-
borderLeft: "3px solid
|
|
544
|
+
borderLeft: "3px solid var(--twd-error)"
|
|
463
545
|
}
|
|
464
546
|
};
|
|
465
547
|
case "skip":
|
|
466
548
|
return {
|
|
467
549
|
item: {
|
|
468
|
-
background: "
|
|
550
|
+
background: "var(--twd-skip-bg)"
|
|
469
551
|
}
|
|
470
552
|
};
|
|
471
553
|
case "running":
|
|
472
554
|
return {
|
|
473
555
|
item: {
|
|
474
|
-
background: "
|
|
556
|
+
background: "var(--twd-warning-bg)"
|
|
475
557
|
}
|
|
476
558
|
};
|
|
477
559
|
default:
|
|
@@ -481,40 +563,72 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
481
563
|
}
|
|
482
564
|
};
|
|
483
565
|
}
|
|
484
|
-
},
|
|
566
|
+
}, dt = (t) => t.startsWith("Assertion passed") || t.startsWith("Event fired") ? { color: "var(--twd-success)", fontWeight: "var(--twd-font-weight-bold)" } : t.startsWith("Test failed") ? { color: "var(--twd-error)", fontWeight: "var(--twd-font-weight-bold)" } : {}, ut = ({
|
|
485
567
|
node: t,
|
|
486
568
|
depth: e,
|
|
487
569
|
id: n,
|
|
488
570
|
runTest: r
|
|
489
571
|
}) => {
|
|
490
|
-
const
|
|
491
|
-
|
|
572
|
+
const i = ct(t), o = H(null), l = H(t.status), _ = H(t.logs?.length || 0), p = typeof window < "u" && sessionStorage.getItem("twd-last-run-test-name") === t.name;
|
|
573
|
+
le(() => {
|
|
574
|
+
const d = o.current;
|
|
575
|
+
if (!d || !t.logs || t.logs.length === 0) return;
|
|
576
|
+
const s = l.current === "running" && (t.status === "pass" || t.status === "fail"), c = t.logs.length > _.current;
|
|
577
|
+
(s || c) && setTimeout(() => {
|
|
578
|
+
d.scrollTop = d.scrollHeight;
|
|
579
|
+
}, 0), l.current = t.status, _.current = t.logs.length;
|
|
580
|
+
}, [t.status, t.logs]);
|
|
581
|
+
const a = () => {
|
|
582
|
+
switch (t.status) {
|
|
583
|
+
case "pass":
|
|
584
|
+
return "passed";
|
|
585
|
+
case "fail":
|
|
586
|
+
return "failed";
|
|
587
|
+
case "running":
|
|
588
|
+
return "running";
|
|
589
|
+
case "skip":
|
|
590
|
+
return "skipped";
|
|
591
|
+
default:
|
|
592
|
+
return "not run";
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
return /* @__PURE__ */ f(
|
|
492
596
|
"li",
|
|
493
597
|
{
|
|
494
598
|
style: {
|
|
495
|
-
marginBottom: "
|
|
496
|
-
marginLeft: e *
|
|
497
|
-
...
|
|
599
|
+
marginBottom: "var(--twd-spacing-xs)",
|
|
600
|
+
marginLeft: `calc(${e} * var(--twd-spacing-sm))`,
|
|
601
|
+
...i.container
|
|
498
602
|
},
|
|
499
603
|
"data-testid": `test-list-item-${n}`,
|
|
604
|
+
"data-test-name": t.name,
|
|
605
|
+
role: "listitem",
|
|
606
|
+
"aria-label": `Test ${t.name}, status: ${a()}`,
|
|
500
607
|
children: [
|
|
501
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ f(
|
|
502
609
|
"div",
|
|
503
610
|
{
|
|
504
611
|
style: {
|
|
505
612
|
display: "flex",
|
|
506
613
|
alignItems: "left",
|
|
507
614
|
justifyContent: "space-between",
|
|
508
|
-
padding: "
|
|
509
|
-
borderRadius: "
|
|
510
|
-
...
|
|
615
|
+
padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
|
|
616
|
+
borderRadius: "var(--twd-border-radius)",
|
|
617
|
+
...i.item,
|
|
618
|
+
...p && {
|
|
619
|
+
border: "1px dashed var(--twd-border)"
|
|
620
|
+
}
|
|
511
621
|
},
|
|
512
622
|
children: [
|
|
513
|
-
/* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ f(
|
|
514
624
|
"span",
|
|
515
625
|
{
|
|
516
|
-
style: {
|
|
517
|
-
|
|
626
|
+
style: {
|
|
627
|
+
fontWeight: "var(--twd-font-weight-medium)",
|
|
628
|
+
color: "var(--twd-text)",
|
|
629
|
+
maxWidth: "220px"
|
|
630
|
+
},
|
|
631
|
+
children: /* @__PURE__ */ f(
|
|
518
632
|
De,
|
|
519
633
|
{
|
|
520
634
|
id: n,
|
|
@@ -525,19 +639,19 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
525
639
|
)
|
|
526
640
|
}
|
|
527
641
|
),
|
|
528
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ f(
|
|
529
643
|
"button",
|
|
530
644
|
{
|
|
531
645
|
onClick: () => r(n),
|
|
532
646
|
"aria-label": `Run ${t.name} test`,
|
|
533
647
|
style: {
|
|
534
648
|
background: "transparent",
|
|
535
|
-
border: "1px solid
|
|
536
|
-
borderRadius: "
|
|
649
|
+
border: "1px solid var(--twd-border-light)",
|
|
650
|
+
borderRadius: "var(--twd-border-radius)",
|
|
537
651
|
padding: "0",
|
|
538
652
|
cursor: "pointer",
|
|
539
653
|
verticalAlign: "middle",
|
|
540
|
-
fontSize: "
|
|
654
|
+
fontSize: "var(--twd-font-size-sm)",
|
|
541
655
|
width: "24px",
|
|
542
656
|
height: "24px",
|
|
543
657
|
display: "flex",
|
|
@@ -546,38 +660,39 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
546
660
|
},
|
|
547
661
|
disabled: t.status === "running",
|
|
548
662
|
"data-testid": `run-test-button-${n}`,
|
|
549
|
-
children: t.status === "running" ? /* @__PURE__ */
|
|
663
|
+
children: t.status === "running" ? /* @__PURE__ */ f(lt, {}) : /* @__PURE__ */ f(_t, {})
|
|
550
664
|
}
|
|
551
665
|
)
|
|
552
666
|
]
|
|
553
667
|
}
|
|
554
668
|
),
|
|
555
|
-
t.logs && t.logs.length > 0 && /* @__PURE__ */
|
|
669
|
+
t.logs && t.logs.length > 0 && /* @__PURE__ */ f(
|
|
556
670
|
"ul",
|
|
557
671
|
{
|
|
672
|
+
ref: o,
|
|
558
673
|
style: {
|
|
559
|
-
borderRadius: "
|
|
674
|
+
borderRadius: "var(--twd-border-radius)",
|
|
560
675
|
maxHeight: "260px",
|
|
561
676
|
overflowY: "auto",
|
|
562
677
|
padding: 0,
|
|
563
|
-
background: "
|
|
678
|
+
background: "var(--twd-background-secondary)",
|
|
564
679
|
listStyle: "none",
|
|
565
|
-
marginTop: "
|
|
680
|
+
marginTop: "var(--twd-spacing-xs)",
|
|
566
681
|
textAlign: "left"
|
|
567
682
|
},
|
|
568
|
-
children: t.logs.map((
|
|
683
|
+
children: t.logs.map((d, s) => /* @__PURE__ */ f(
|
|
569
684
|
"li",
|
|
570
685
|
{
|
|
571
686
|
style: {
|
|
572
|
-
fontSize: "
|
|
573
|
-
padding: "
|
|
574
|
-
borderBottom: "1px solid
|
|
575
|
-
color: "
|
|
576
|
-
...
|
|
687
|
+
fontSize: "var(--twd-font-size-sm)",
|
|
688
|
+
padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
|
|
689
|
+
borderBottom: "1px solid var(--twd-border-light)",
|
|
690
|
+
color: "var(--twd-text)",
|
|
691
|
+
...dt(d)
|
|
577
692
|
},
|
|
578
|
-
children:
|
|
693
|
+
children: d
|
|
579
694
|
},
|
|
580
|
-
|
|
695
|
+
s
|
|
581
696
|
))
|
|
582
697
|
}
|
|
583
698
|
)
|
|
@@ -585,65 +700,97 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
585
700
|
},
|
|
586
701
|
t.name
|
|
587
702
|
);
|
|
588
|
-
},
|
|
589
|
-
const [n, r] =
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
703
|
+
}, ft = () => /* @__PURE__ */ f(K, { className: "lucide-chevron-down-icon lucide-chevron-down", dataTestId: "chevron-down-icon", children: /* @__PURE__ */ f("path", { d: "m6 9 6 6 6-6" }) }), pt = () => /* @__PURE__ */ f(K, { className: "lucide-chevron-right-icon lucide-chevron-right", dataTestId: "chevron-right-icon", children: /* @__PURE__ */ f("path", { d: "m9 18 6-6-6-6" }) }), ht = ({ tests: t, runTest: e }) => {
|
|
704
|
+
const [n, r] = ee({}), i = H(null), o = H(!1), l = (a) => r((d) => ({ ...d, [a]: !d[a] }));
|
|
705
|
+
le(() => {
|
|
706
|
+
if (o.current) return;
|
|
707
|
+
const a = sessionStorage.getItem("twd-last-run-test-name");
|
|
708
|
+
if (!a) return;
|
|
709
|
+
const d = setTimeout(() => {
|
|
710
|
+
const s = document.querySelector(`[data-test-name="${a}"]`);
|
|
711
|
+
if (s) {
|
|
712
|
+
const c = i.current?.closest('[data-testid="twd-sidebar"]');
|
|
713
|
+
if (c) {
|
|
714
|
+
const u = s.getBoundingClientRect(), g = c.getBoundingClientRect(), k = c.scrollTop, b = u.top - g.top + k;
|
|
715
|
+
c.scrollTo({
|
|
716
|
+
top: b - 150,
|
|
717
|
+
// 150px offset from top
|
|
718
|
+
behavior: "smooth"
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
o.current = !0;
|
|
722
|
+
}
|
|
723
|
+
}, 100);
|
|
724
|
+
return () => clearTimeout(d);
|
|
725
|
+
}, []);
|
|
726
|
+
const _ = (a, d = 0) => {
|
|
727
|
+
if (a.type === "test")
|
|
728
|
+
return /* @__PURE__ */ f(
|
|
729
|
+
ut,
|
|
593
730
|
{
|
|
594
|
-
node:
|
|
595
|
-
depth:
|
|
596
|
-
id:
|
|
597
|
-
runTest: () => e(
|
|
731
|
+
node: a,
|
|
732
|
+
depth: d,
|
|
733
|
+
id: a.id,
|
|
734
|
+
runTest: () => e(a.id)
|
|
598
735
|
},
|
|
599
|
-
|
|
736
|
+
a.id
|
|
600
737
|
);
|
|
601
|
-
const
|
|
602
|
-
return /* @__PURE__ */
|
|
603
|
-
/* @__PURE__ */
|
|
738
|
+
const s = n[a.id];
|
|
739
|
+
return /* @__PURE__ */ f("li", { style: { marginLeft: `calc(${d} * var(--twd-spacing-lg))` }, children: [
|
|
740
|
+
/* @__PURE__ */ f(
|
|
604
741
|
"span",
|
|
605
742
|
{
|
|
606
743
|
style: {
|
|
607
|
-
fontWeight: "bold",
|
|
744
|
+
fontWeight: "var(--twd-font-weight-bold)",
|
|
608
745
|
cursor: "pointer",
|
|
609
|
-
color: "
|
|
746
|
+
color: "var(--twd-text)",
|
|
610
747
|
display: "flex",
|
|
611
748
|
alignItems: "center",
|
|
612
749
|
justifyContent: "space-between",
|
|
613
|
-
marginBottom: "
|
|
614
|
-
gap: "
|
|
750
|
+
marginBottom: "var(--twd-spacing-xs)",
|
|
751
|
+
gap: "var(--twd-spacing-sm)"
|
|
615
752
|
},
|
|
616
|
-
"data-testid": `test-group-${
|
|
753
|
+
"data-testid": `test-group-${a.name}`,
|
|
617
754
|
tabIndex: 0,
|
|
618
755
|
role: "button",
|
|
619
|
-
"aria-expanded": !
|
|
620
|
-
|
|
756
|
+
"aria-expanded": !s,
|
|
757
|
+
"aria-label": `${s ? "Expand" : "Collapse"} test suite ${a.name}`,
|
|
758
|
+
onClick: () => l(a.id),
|
|
621
759
|
children: [
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
|
|
760
|
+
/* @__PURE__ */ f(De, { id: a.id, name: a.name, skip: a.skip, only: a.only }),
|
|
761
|
+
s ? /* @__PURE__ */ f(pt, {}) : /* @__PURE__ */ f(ft, {})
|
|
624
762
|
]
|
|
625
763
|
}
|
|
626
764
|
),
|
|
627
|
-
!
|
|
628
|
-
] },
|
|
629
|
-
},
|
|
630
|
-
return /* @__PURE__ */
|
|
631
|
-
|
|
765
|
+
!s && a.childrenNodes && a.childrenNodes.length > 0 && /* @__PURE__ */ f("ul", { style: { listStyle: "none", padding: 0, margin: 0 }, children: a.childrenNodes.map((c) => _(c, d + 1)) })
|
|
766
|
+
] }, a.id);
|
|
767
|
+
}, p = it(t);
|
|
768
|
+
return /* @__PURE__ */ f(
|
|
769
|
+
"ul",
|
|
770
|
+
{
|
|
771
|
+
ref: i,
|
|
772
|
+
style: { listStyle: "none", padding: 0, margin: 0 },
|
|
773
|
+
role: "list",
|
|
774
|
+
"aria-label": "Test list",
|
|
775
|
+
children: p.map((a) => _(a))
|
|
776
|
+
}
|
|
777
|
+
);
|
|
778
|
+
}, gt = {
|
|
632
779
|
left: {
|
|
633
780
|
left: 0,
|
|
634
|
-
borderTopRightRadius: "
|
|
635
|
-
borderBottomRightRadius: "
|
|
781
|
+
borderTopRightRadius: "var(--twd-border-radius-lg)",
|
|
782
|
+
borderBottomRightRadius: "var(--twd-border-radius-lg)",
|
|
636
783
|
borderTopLeftRadius: "0",
|
|
637
784
|
borderBottomLeftRadius: "0"
|
|
638
785
|
},
|
|
639
786
|
right: {
|
|
640
787
|
right: 0,
|
|
641
|
-
borderTopLeftRadius: "
|
|
642
|
-
borderBottomLeftRadius: "
|
|
788
|
+
borderTopLeftRadius: "var(--twd-border-radius-lg)",
|
|
789
|
+
borderBottomLeftRadius: "var(--twd-border-radius-lg)",
|
|
643
790
|
borderTopRightRadius: "0",
|
|
644
791
|
borderBottomRightRadius: "0"
|
|
645
792
|
}
|
|
646
|
-
},
|
|
793
|
+
}, mt = ({ setOpen: t, position: e }) => /* @__PURE__ */ f(
|
|
647
794
|
"button",
|
|
648
795
|
{
|
|
649
796
|
"aria-label": "Open TWD sidebar",
|
|
@@ -651,24 +798,24 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
651
798
|
position: "fixed",
|
|
652
799
|
top: "50%",
|
|
653
800
|
transform: "translateY(-50%)",
|
|
654
|
-
background: "
|
|
655
|
-
color: "
|
|
656
|
-
padding: "
|
|
801
|
+
background: "var(--twd-button-primary)",
|
|
802
|
+
color: "var(--twd-button-primary-text)",
|
|
803
|
+
padding: "var(--twd-spacing-sm) 10px",
|
|
657
804
|
cursor: "pointer",
|
|
658
|
-
fontSize: "
|
|
659
|
-
...
|
|
805
|
+
fontSize: "var(--twd-font-size-sm)",
|
|
806
|
+
...gt[e]
|
|
660
807
|
},
|
|
661
808
|
onClick: () => t(!0),
|
|
662
809
|
children: "TWD"
|
|
663
810
|
}
|
|
664
|
-
),
|
|
665
|
-
|
|
666
|
-
const n = document.documentElement;
|
|
667
|
-
return t ? e === "left" ? n.style.marginLeft =
|
|
811
|
+
), vt = ({ isOpen: t, position: e }) => {
|
|
812
|
+
le(() => {
|
|
813
|
+
const n = document.documentElement, r = getComputedStyle(document.documentElement).getPropertyValue("--twd-sidebar-width") || "280px";
|
|
814
|
+
return t ? e === "left" ? n.style.marginLeft = r : n.style.marginRight = r : (n.style.marginRight = "0", n.style.marginLeft = "0"), () => {
|
|
668
815
|
n.style.marginRight = "0", n.style.marginLeft = "0";
|
|
669
816
|
};
|
|
670
817
|
}, [t, e]);
|
|
671
|
-
},
|
|
818
|
+
}, yt = () => typeof window < "u" ? (window.__TWD_STATE__ || (window.__TWD_STATE__ = {
|
|
672
819
|
handlers: /* @__PURE__ */ new Map(),
|
|
673
820
|
beforeEachHooks: /* @__PURE__ */ new Map(),
|
|
674
821
|
afterEachHooks: /* @__PURE__ */ new Map(),
|
|
@@ -678,109 +825,109 @@ const V = ({ className: t, children: e, dataTestId: n }) => /* @__PURE__ */ c(
|
|
|
678
825
|
beforeEachHooks: /* @__PURE__ */ new Map(),
|
|
679
826
|
afterEachHooks: /* @__PURE__ */ new Map(),
|
|
680
827
|
stack: []
|
|
681
|
-
},
|
|
828
|
+
}, _e = yt(), S = _e.handlers, Se = _e.beforeEachHooks, xe = _e.afterEachHooks, wt = (t) => {
|
|
682
829
|
const e = [], n = [];
|
|
683
830
|
let r = t;
|
|
684
831
|
for (; r; )
|
|
685
|
-
|
|
832
|
+
Se.has(r) && e.unshift(...Se.get(r)), xe.has(r) && n.push(...xe.get(r)), r = S.get(r)?.parent;
|
|
686
833
|
return { before: e, after: n };
|
|
687
|
-
},
|
|
688
|
-
const e =
|
|
689
|
-
return e ? e.only ? !0 : e.children ? e.children.some((n) =>
|
|
690
|
-
},
|
|
691
|
-
let e =
|
|
834
|
+
}, ne = (t) => {
|
|
835
|
+
const e = S.get(t);
|
|
836
|
+
return e ? e.only ? !0 : e.children ? e.children.some((n) => ne(n)) : !1 : !1;
|
|
837
|
+
}, bt = (t) => {
|
|
838
|
+
let e = S.get(t);
|
|
692
839
|
for (; e?.parent; ) {
|
|
693
|
-
const n =
|
|
840
|
+
const n = S.get(e.parent);
|
|
694
841
|
if (n?.only) return !0;
|
|
695
842
|
e = n;
|
|
696
843
|
}
|
|
697
844
|
return !1;
|
|
698
|
-
},
|
|
699
|
-
let e =
|
|
845
|
+
}, Te = (t) => {
|
|
846
|
+
let e = S.get(t);
|
|
700
847
|
for (; e; ) {
|
|
701
848
|
if (e.skip) return !0;
|
|
702
849
|
if (!e.parent) break;
|
|
703
|
-
e =
|
|
850
|
+
e = S.get(e.parent);
|
|
704
851
|
}
|
|
705
852
|
return !1;
|
|
706
853
|
};
|
|
707
|
-
class
|
|
854
|
+
class Ue {
|
|
708
855
|
events;
|
|
709
856
|
constructor(e) {
|
|
710
857
|
this.events = e;
|
|
711
858
|
}
|
|
712
859
|
async runAll() {
|
|
713
|
-
const e = Array.from(
|
|
860
|
+
const e = Array.from(S.values()).filter(
|
|
714
861
|
(r) => !r.parent && r.type === "suite"
|
|
715
|
-
), n = Array.from(
|
|
862
|
+
), n = Array.from(S.values()).some((r) => r.only);
|
|
716
863
|
for (const r of e)
|
|
717
864
|
await this.runSuite(r, n);
|
|
718
|
-
return
|
|
865
|
+
return S;
|
|
719
866
|
}
|
|
720
867
|
async runSingle(e) {
|
|
721
|
-
const n =
|
|
868
|
+
const n = S.get(e);
|
|
722
869
|
if (!n || n.type !== "test") return;
|
|
723
870
|
await this.runTest(n, !1);
|
|
724
871
|
}
|
|
725
872
|
async runSuite(e, n) {
|
|
726
|
-
if (
|
|
873
|
+
if (Te(e.id) && !ne(e.id)) {
|
|
727
874
|
this.events.onSkip?.(e);
|
|
728
875
|
return;
|
|
729
876
|
}
|
|
730
|
-
if (n && !
|
|
877
|
+
if (n && !ne(e.id)) return;
|
|
731
878
|
this.events.onSuiteStart?.(e);
|
|
732
|
-
const
|
|
733
|
-
for (const
|
|
734
|
-
|
|
879
|
+
const i = (e.children || []).map((o) => S.get(o));
|
|
880
|
+
for (const o of i)
|
|
881
|
+
o.type === "suite" ? await this.runSuite(o, n) : o.type === "test" && await this.runTest(o, n);
|
|
735
882
|
this.events.onSuiteEnd?.(e);
|
|
736
883
|
}
|
|
737
884
|
async runTest(e, n) {
|
|
738
|
-
if ((
|
|
885
|
+
if ((Te(e.id) || e.skip) && !e.only) {
|
|
739
886
|
this.events.onSkip(e);
|
|
740
887
|
return;
|
|
741
888
|
}
|
|
742
|
-
const
|
|
743
|
-
if (n && !e.only && !
|
|
889
|
+
const i = bt(e.id);
|
|
890
|
+
if (n && !e.only && !i) {
|
|
744
891
|
this.events.onSkip(e);
|
|
745
892
|
return;
|
|
746
893
|
}
|
|
747
894
|
this.events.onStart?.(e);
|
|
748
|
-
const
|
|
895
|
+
const o = wt(e.parent);
|
|
749
896
|
try {
|
|
750
|
-
for (const
|
|
897
|
+
for (const l of o.before) await l();
|
|
751
898
|
e.logs = [], await e.handler(), this.events.onPass(e);
|
|
752
|
-
} catch (
|
|
753
|
-
this.events.onFail(e,
|
|
899
|
+
} catch (l) {
|
|
900
|
+
this.events.onFail(e, l);
|
|
754
901
|
} finally {
|
|
755
|
-
for (const
|
|
902
|
+
for (const l of o.after) await l();
|
|
756
903
|
}
|
|
757
904
|
}
|
|
758
905
|
}
|
|
759
|
-
window.__testRunner =
|
|
760
|
-
const
|
|
906
|
+
window.__testRunner = Ue;
|
|
907
|
+
const kt = "1.4.0", St = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
|
|
761
908
|
rules: []
|
|
762
909
|
}), window.__TWD_MOCK_STATE__) : {
|
|
763
910
|
rules: []
|
|
764
|
-
},
|
|
911
|
+
}, xt = St(), Fe = xt.rules, Tt = async (t) => {
|
|
765
912
|
if ("serviceWorker" in navigator) {
|
|
766
913
|
const e = t ?? "/mock-sw.js";
|
|
767
|
-
await navigator.serviceWorker.register(`${e}?v=${
|
|
914
|
+
await navigator.serviceWorker.register(`${e}?v=${kt}`), navigator.serviceWorker.controller || await new Promise((n) => {
|
|
768
915
|
navigator.serviceWorker.addEventListener("controllerchange", n, { once: !0 });
|
|
769
916
|
}), navigator.serviceWorker.addEventListener("message", (n) => {
|
|
770
917
|
if (n.data?.type === "EXECUTED") {
|
|
771
|
-
const { alias: r, request:
|
|
772
|
-
|
|
918
|
+
const { alias: r, request: i } = n.data, o = Fe.find((l) => l.alias === r);
|
|
919
|
+
o && (o.executed = !0, o.request = i);
|
|
773
920
|
}
|
|
774
921
|
});
|
|
775
922
|
}
|
|
776
|
-
},
|
|
777
|
-
/* @__PURE__ */
|
|
778
|
-
/* @__PURE__ */
|
|
779
|
-
/* @__PURE__ */
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
] }),
|
|
782
|
-
const t =
|
|
783
|
-
return /* @__PURE__ */
|
|
923
|
+
}, Rt = () => Fe, Ct = () => /* @__PURE__ */ f(K, { className: "lucide-wifi-pen-icon lucide-wifi-pen", dataTestId: "wifi-pen-icon", children: [
|
|
924
|
+
/* @__PURE__ */ f("path", { d: "M2 8.82a15 15 0 0 1 20 0" }),
|
|
925
|
+
/* @__PURE__ */ f("path", { d: "M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z" }),
|
|
926
|
+
/* @__PURE__ */ f("path", { d: "M5 12.859a10 10 0 0 1 10.5-2.222" }),
|
|
927
|
+
/* @__PURE__ */ f("path", { d: "M8.5 16.429a5 5 0 0 1 3-1.406" })
|
|
928
|
+
] }), $t = () => {
|
|
929
|
+
const t = Rt(), e = t.filter((r) => r.executed);
|
|
930
|
+
return /* @__PURE__ */ f(
|
|
784
931
|
"button",
|
|
785
932
|
{
|
|
786
933
|
onClick: () => {
|
|
@@ -788,104 +935,120 @@ const mt = "1.3.3", yt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__
|
|
|
788
935
|
},
|
|
789
936
|
"aria-label": "View mock rules details in console",
|
|
790
937
|
style: {
|
|
791
|
-
background: "
|
|
792
|
-
border: "1px solid
|
|
793
|
-
borderRadius: "
|
|
794
|
-
padding: "
|
|
938
|
+
background: "var(--twd-button-secondary)",
|
|
939
|
+
border: "1px solid var(--twd-button-border)",
|
|
940
|
+
borderRadius: "var(--twd-border-radius-lg)",
|
|
941
|
+
padding: "var(--twd-spacing-md) var(--twd-spacing-lg)",
|
|
795
942
|
cursor: "pointer",
|
|
796
|
-
fontSize: "
|
|
797
|
-
color: "
|
|
943
|
+
fontSize: "var(--twd-font-size-sm)",
|
|
944
|
+
color: "var(--twd-button-secondary-text)",
|
|
798
945
|
display: "flex",
|
|
799
946
|
alignItems: "center",
|
|
800
|
-
gap: "
|
|
947
|
+
gap: "var(--twd-spacing-md)",
|
|
801
948
|
marginBottom: "10px",
|
|
802
949
|
width: "100%",
|
|
803
950
|
textAlign: "left",
|
|
804
|
-
transition: "all
|
|
805
|
-
boxShadow: "
|
|
951
|
+
transition: "all var(--twd-animation-duration) ease",
|
|
952
|
+
boxShadow: "var(--twd-shadow-sm)"
|
|
806
953
|
},
|
|
807
954
|
children: [
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
/* @__PURE__ */
|
|
955
|
+
/* @__PURE__ */ f(Ct, {}),
|
|
956
|
+
/* @__PURE__ */ f("span", { style: { flex: 1 }, children: [
|
|
810
957
|
"Rules: ",
|
|
811
958
|
e.length,
|
|
812
959
|
"/",
|
|
813
960
|
t.length,
|
|
814
961
|
" triggered"
|
|
815
962
|
] }),
|
|
816
|
-
/* @__PURE__ */
|
|
817
|
-
fontSize: "
|
|
818
|
-
color: "
|
|
819
|
-
fontWeight: "
|
|
963
|
+
/* @__PURE__ */ f("span", { style: {
|
|
964
|
+
fontSize: "var(--twd-font-size-xs)",
|
|
965
|
+
color: "var(--twd-text)",
|
|
966
|
+
fontWeight: "var(--twd-font-weight-medium)"
|
|
820
967
|
}, children: "View rules in console" })
|
|
821
968
|
]
|
|
822
969
|
}
|
|
823
970
|
);
|
|
824
|
-
},
|
|
825
|
-
left: { left: 0, borderRight: "1px solid
|
|
826
|
-
right: { right: 0, borderLeft: "1px solid
|
|
827
|
-
},
|
|
828
|
-
const [n, r] =
|
|
829
|
-
|
|
830
|
-
const
|
|
831
|
-
onStart: (
|
|
832
|
-
|
|
971
|
+
}, Et = {
|
|
972
|
+
left: { left: 0, borderRight: "1px solid var(--twd-border)" },
|
|
973
|
+
right: { right: 0, borderLeft: "1px solid var(--twd-border)" }
|
|
974
|
+
}, It = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Wt = (t) => sessionStorage.getItem("twd-sidebar-open") ? sessionStorage.getItem("twd-sidebar-open") === "true" : t, Lt = ({ open: t, position: e = "left" }) => {
|
|
975
|
+
const [n, r] = ee(0), [i, o] = ee(Wt(t));
|
|
976
|
+
vt({ isOpen: i, position: e });
|
|
977
|
+
const l = new Ue({
|
|
978
|
+
onStart: (c) => {
|
|
979
|
+
c.status = "running", r((u) => u + 1);
|
|
833
980
|
},
|
|
834
|
-
onPass: (
|
|
835
|
-
|
|
981
|
+
onPass: (c) => {
|
|
982
|
+
c.status = "pass", r((u) => u + 1);
|
|
836
983
|
},
|
|
837
|
-
onFail: (
|
|
838
|
-
|
|
984
|
+
onFail: (c, u) => {
|
|
985
|
+
c.status = "fail", console.error("Test failed:", c.name, u), c.logs.push(`Test failed: ${u.message}`), r((g) => g + 1);
|
|
839
986
|
},
|
|
840
|
-
onSkip: (
|
|
841
|
-
|
|
987
|
+
onSkip: (c) => {
|
|
988
|
+
c.status = "skip", r((u) => u + 1);
|
|
842
989
|
}
|
|
843
|
-
}),
|
|
844
|
-
|
|
845
|
-
},
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
990
|
+
}), _ = (c) => {
|
|
991
|
+
o(c), sessionStorage.setItem("twd-sidebar-open", c.toString());
|
|
992
|
+
}, p = async () => {
|
|
993
|
+
sessionStorage.removeItem("twd-last-run-test-name"), await l.runAll();
|
|
994
|
+
}, a = async (c) => {
|
|
995
|
+
const u = Array.from(S.values()).filter((g) => g.type === "test").find((g) => g.id === c);
|
|
996
|
+
u && (sessionStorage.setItem("twd-last-run-test-name", u.name), await l.runSingle(u.id));
|
|
997
|
+
}, d = Array.from(S.values());
|
|
998
|
+
if (!i)
|
|
999
|
+
return /* @__PURE__ */ f(mt, { position: e, setOpen: _ });
|
|
1000
|
+
const s = d.filter((c) => c.type === "test").length;
|
|
1001
|
+
return /* @__PURE__ */ f(
|
|
853
1002
|
"div",
|
|
854
1003
|
{
|
|
855
1004
|
style: {
|
|
856
|
-
fontFamily:
|
|
1005
|
+
fontFamily: It,
|
|
857
1006
|
position: "fixed",
|
|
858
1007
|
top: 0,
|
|
859
1008
|
bottom: 0,
|
|
860
|
-
width: "
|
|
861
|
-
background: "
|
|
862
|
-
fontSize: "
|
|
1009
|
+
width: "var(--twd-sidebar-width)",
|
|
1010
|
+
background: "var(--twd-background)",
|
|
1011
|
+
fontSize: "var(--twd-font-size-md)",
|
|
863
1012
|
overflowY: "auto",
|
|
864
|
-
boxShadow: "
|
|
1013
|
+
boxShadow: "var(--twd-shadow)",
|
|
865
1014
|
textAlign: "left",
|
|
866
|
-
zIndex:
|
|
867
|
-
...
|
|
1015
|
+
zIndex: "var(--twd-z-index-sidebar)",
|
|
1016
|
+
...Et[e]
|
|
868
1017
|
},
|
|
869
1018
|
"data-testid": "twd-sidebar",
|
|
1019
|
+
role: "complementary",
|
|
1020
|
+
"aria-label": "Test While Developing sidebar",
|
|
870
1021
|
children: [
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
|
|
873
|
-
|
|
1022
|
+
/* @__PURE__ */ f("div", { style: {
|
|
1023
|
+
padding: "var(--twd-spacing-md)",
|
|
1024
|
+
background: "var(--twd-background)",
|
|
1025
|
+
position: "sticky",
|
|
1026
|
+
top: 0,
|
|
1027
|
+
zIndex: "var(--twd-z-index-sticky)",
|
|
1028
|
+
borderBottom: "1px solid var(--twd-border)"
|
|
1029
|
+
}, children: [
|
|
1030
|
+
/* @__PURE__ */ f("div", { style: {
|
|
1031
|
+
display: "flex",
|
|
1032
|
+
justifyContent: "space-between",
|
|
1033
|
+
alignItems: "center",
|
|
1034
|
+
marginBottom: "var(--twd-spacing-xl)"
|
|
1035
|
+
}, children: [
|
|
1036
|
+
/* @__PURE__ */ f(
|
|
874
1037
|
"button",
|
|
875
1038
|
{
|
|
876
|
-
onClick:
|
|
1039
|
+
onClick: p,
|
|
877
1040
|
style: {
|
|
878
|
-
background: "
|
|
879
|
-
color: "
|
|
880
|
-
padding: "
|
|
881
|
-
borderRadius: "
|
|
1041
|
+
background: "var(--twd-button-primary)",
|
|
1042
|
+
color: "var(--twd-button-primary-text)",
|
|
1043
|
+
padding: "var(--twd-spacing-xs) var(--twd-spacing-md)",
|
|
1044
|
+
borderRadius: "var(--twd-border-radius)",
|
|
882
1045
|
border: "none",
|
|
883
1046
|
cursor: "pointer"
|
|
884
1047
|
},
|
|
885
1048
|
children: "Run All"
|
|
886
1049
|
}
|
|
887
1050
|
),
|
|
888
|
-
/* @__PURE__ */
|
|
1051
|
+
/* @__PURE__ */ f(
|
|
889
1052
|
"button",
|
|
890
1053
|
{
|
|
891
1054
|
"aria-label": "Close sidebar",
|
|
@@ -893,65 +1056,72 @@ const mt = "1.3.3", yt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__
|
|
|
893
1056
|
background: "transparent",
|
|
894
1057
|
border: "none",
|
|
895
1058
|
cursor: "pointer",
|
|
896
|
-
fontSize: "
|
|
1059
|
+
fontSize: "var(--twd-font-size-md)",
|
|
897
1060
|
paddingRight: "0",
|
|
898
1061
|
paddingLeft: "0"
|
|
899
1062
|
},
|
|
900
|
-
onClick: () =>
|
|
1063
|
+
onClick: () => _(!1),
|
|
901
1064
|
children: "✖"
|
|
902
1065
|
}
|
|
903
1066
|
)
|
|
904
1067
|
] }),
|
|
905
|
-
/* @__PURE__ */
|
|
906
|
-
|
|
1068
|
+
/* @__PURE__ */ f("div", { style: {
|
|
1069
|
+
display: "flex",
|
|
1070
|
+
justifyContent: "space-between",
|
|
1071
|
+
alignItems: "center",
|
|
1072
|
+
fontSize: "var(--twd-font-size-md)",
|
|
1073
|
+
color: "var(--twd-text-secondary)",
|
|
1074
|
+
marginBottom: "10px"
|
|
1075
|
+
}, children: [
|
|
1076
|
+
/* @__PURE__ */ f("span", { style: { color: "var(--twd-text)" }, children: [
|
|
907
1077
|
"Total: ",
|
|
908
|
-
|
|
1078
|
+
s
|
|
909
1079
|
] }),
|
|
910
|
-
/* @__PURE__ */
|
|
911
|
-
/* @__PURE__ */
|
|
1080
|
+
/* @__PURE__ */ f("div", { style: { display: "flex", gap: "var(--twd-spacing-xs)" }, children: [
|
|
1081
|
+
/* @__PURE__ */ f("span", { style: { color: "var(--twd-success)" }, children: [
|
|
912
1082
|
"✓ ",
|
|
913
|
-
|
|
1083
|
+
d.filter((c) => c.status === "pass").length
|
|
914
1084
|
] }),
|
|
915
|
-
/* @__PURE__ */
|
|
1085
|
+
/* @__PURE__ */ f("span", { style: { color: "var(--twd-error)" }, children: [
|
|
916
1086
|
"✗ ",
|
|
917
|
-
|
|
1087
|
+
d.filter((c) => c.status === "fail").length
|
|
918
1088
|
] })
|
|
919
1089
|
] })
|
|
920
1090
|
] }),
|
|
921
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ f($t, {})
|
|
922
1092
|
] }),
|
|
923
|
-
/* @__PURE__ */
|
|
924
|
-
|
|
1093
|
+
/* @__PURE__ */ f("div", { style: { padding: "var(--twd-spacing-md)" }, children: /* @__PURE__ */ f(
|
|
1094
|
+
ht,
|
|
925
1095
|
{
|
|
926
|
-
tests:
|
|
927
|
-
name:
|
|
928
|
-
depth:
|
|
929
|
-
status:
|
|
930
|
-
logs:
|
|
931
|
-
id:
|
|
932
|
-
parent:
|
|
933
|
-
type:
|
|
934
|
-
only:
|
|
935
|
-
skip:
|
|
1096
|
+
tests: d.map((c) => ({
|
|
1097
|
+
name: c.name,
|
|
1098
|
+
depth: c.depth,
|
|
1099
|
+
status: c.status,
|
|
1100
|
+
logs: c.logs,
|
|
1101
|
+
id: c.id,
|
|
1102
|
+
parent: c.parent,
|
|
1103
|
+
type: c.type,
|
|
1104
|
+
only: c.only,
|
|
1105
|
+
skip: c.skip
|
|
936
1106
|
})),
|
|
937
|
-
runTest:
|
|
1107
|
+
runTest: a
|
|
938
1108
|
}
|
|
939
1109
|
) })
|
|
940
1110
|
]
|
|
941
1111
|
}
|
|
942
1112
|
);
|
|
943
|
-
},
|
|
1113
|
+
}, Ht = (t) => ({
|
|
944
1114
|
render: (e) => {
|
|
945
|
-
|
|
1115
|
+
Ye(e, t);
|
|
946
1116
|
}
|
|
947
|
-
}),
|
|
948
|
-
const { open: n = !0, position: r = "left", serviceWorker:
|
|
949
|
-
|
|
1117
|
+
}), At = (t, e) => {
|
|
1118
|
+
const { open: n = !0, position: r = "left", serviceWorker: i = !0, serviceWorkerUrl: o = "/mock-sw.js", theme: l } = e || {};
|
|
1119
|
+
tt(t, /* @__PURE__ */ f(Lt, { open: n, position: r }), Ht, l), i && Tt(o).then(() => {
|
|
950
1120
|
console.log("Request mocking initialized");
|
|
951
1121
|
}).catch((_) => {
|
|
952
1122
|
console.error("Error initializing request mocking:", _);
|
|
953
1123
|
});
|
|
954
1124
|
};
|
|
955
1125
|
export {
|
|
956
|
-
|
|
1126
|
+
At as initTWD
|
|
957
1127
|
};
|