twd-js 1.5.2 → 1.6.1
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/bundled.d.ts +1 -0
- package/dist/bundled.es.js +708 -620
- package/dist/index.cjs.js +58 -41
- package/dist/index.d.ts +31 -1
- package/dist/index.es.js +5104 -4882
- package/dist/mock-sw.js +1 -1
- package/dist/runner.cjs.js +1 -1
- package/dist/runner.d.ts +10 -2
- package/dist/runner.es.js +139 -107
- package/package.json +5 -5
package/dist/bundled.es.js
CHANGED
|
@@ -1,252 +1,244 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Qe = (
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
for (var r in
|
|
7
|
-
return
|
|
1
|
+
var Ye = Object.defineProperty;
|
|
2
|
+
var Qe = (t, e, r) => e in t ? Ye(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var ne = (t, e, r) => Qe(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
var Z, w, ze, M, ve, Ne, We, He, ce, ie, ae, G = {}, K = [], Ze = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ee = Array.isArray;
|
|
5
|
+
function E(t, e) {
|
|
6
|
+
for (var r in e) t[r] = e[r];
|
|
7
|
+
return t;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
9
|
+
function ue(t) {
|
|
10
|
+
t && t.parentNode && t.parentNode.removeChild(t);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
var n,
|
|
14
|
-
for (
|
|
15
|
-
if (arguments.length > 2 && (l.children = arguments.length > 3 ?
|
|
16
|
-
return
|
|
12
|
+
function et(t, e, r) {
|
|
13
|
+
var n, o, s, l = {};
|
|
14
|
+
for (s in e) s == "key" ? n = e[s] : s == "ref" ? o = e[s] : l[s] = e[s];
|
|
15
|
+
if (arguments.length > 2 && (l.children = arguments.length > 3 ? Z.call(arguments, 2) : r), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) l[s] === void 0 && (l[s] = t.defaultProps[s]);
|
|
16
|
+
return V(t, l, n, o, null);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
var
|
|
20
|
-
return
|
|
18
|
+
function V(t, e, r, n, o) {
|
|
19
|
+
var s = { type: t, props: e, key: r, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: o ?? ++ze, __i: -1, __u: 0 };
|
|
20
|
+
return o == null && w.vnode != null && w.vnode(s), s;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
22
|
+
function U(t) {
|
|
23
|
+
return t.children;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
this.props =
|
|
25
|
+
function J(t, e) {
|
|
26
|
+
this.props = t, this.context = e;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
if (
|
|
30
|
-
for (var r;
|
|
31
|
-
return typeof
|
|
28
|
+
function W(t, e) {
|
|
29
|
+
if (e == null) return t.__ ? W(t.__, t.__i + 1) : null;
|
|
30
|
+
for (var r; e < t.__k.length; e++) if ((r = t.__k[e]) != null && r.__e != null) return r.__e;
|
|
31
|
+
return typeof t.type == "function" ? W(t) : null;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
e.__e = e.__c.base = r.__e;
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
return Pe(e);
|
|
33
|
+
function tt(t) {
|
|
34
|
+
if (t.__P && t.__d) {
|
|
35
|
+
var e = t.__v, r = e.__e, n = [], o = [], s = E({}, e);
|
|
36
|
+
s.__v = e.__v + 1, w.vnode && w.vnode(s), _e(t.__P, s, e, t.__n, t.__P.namespaceURI, 32 & e.__u ? [r] : null, n, r ?? W(e), !!(32 & e.__u), o), s.__v = e.__v, s.__.__k[s.__i] = s, Pe(n, s, o), e.__e = e.__ = null, s.__e != r && Be(s);
|
|
41
37
|
}
|
|
42
38
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
39
|
+
function Be(t) {
|
|
40
|
+
if ((t = t.__) != null && t.__c != null) return t.__e = t.__c.base = null, t.__k.some(function(e) {
|
|
41
|
+
if (e != null && e.__e != null) return t.__e = t.__c.base = e.__e;
|
|
42
|
+
}), Be(t);
|
|
43
|
+
}
|
|
44
|
+
function we(t) {
|
|
45
|
+
(!t.__d && (t.__d = !0) && M.push(t) && !Y.__r++ || ve != w.debounceRendering) && ((ve = w.debounceRendering) || Ne)(Y);
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
-
for (var
|
|
48
|
-
|
|
47
|
+
function Y() {
|
|
48
|
+
for (var t, e = 1; M.length; ) M.length > e && M.sort(We), t = M.shift(), e = M.length, tt(t);
|
|
49
|
+
Y.__r = 0;
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
var i,
|
|
52
|
-
for (
|
|
53
|
-
return r.__e =
|
|
51
|
+
function De(t, e, r, n, o, s, l, d, u, a, p) {
|
|
52
|
+
var i, f, _, v, T, b, m, g = n && n.__k || K, I = e.length;
|
|
53
|
+
for (u = rt(r, e, g, u, I), i = 0; i < I; i++) (_ = r.__k[i]) != null && (f = _.__i != -1 && g[_.__i] || G, _.__i = i, b = _e(t, _, f, o, s, l, d, u, a, p), v = _.__e, _.ref && f.ref != _.ref && (f.ref && pe(f.ref, null, _), p.push(_.ref, _.__c || v, _)), T == null && v != null && (T = v), (m = !!(4 & _.__u)) || f.__k === _.__k ? u = Fe(_, u, t, m) : typeof _.type == "function" && b !== void 0 ? u = b : v && (u = v.nextSibling), _.__u &= -7);
|
|
54
|
+
return r.__e = T, u;
|
|
54
55
|
}
|
|
55
|
-
function rt(
|
|
56
|
-
var
|
|
57
|
-
for (
|
|
58
|
-
if (i) for (
|
|
56
|
+
function rt(t, e, r, n, o) {
|
|
57
|
+
var s, l, d, u, a, p = r.length, i = p, f = 0;
|
|
58
|
+
for (t.__k = new Array(o), s = 0; s < o; s++) (l = e[s]) != null && typeof l != "boolean" && typeof l != "function" ? (typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? l = t.__k[s] = V(null, l, null, null, null) : ee(l) ? l = t.__k[s] = V(U, { children: l }, null, null, null) : l.constructor === void 0 && l.__b > 0 ? l = t.__k[s] = V(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : t.__k[s] = l, u = s + f, l.__ = t, l.__b = t.__b + 1, d = null, (a = l.__i = nt(l, r, u, i)) != -1 && (i--, (d = r[a]) && (d.__u |= 2)), d == null || d.__v == null ? (a == -1 && (o > p ? f-- : o < p && f++), typeof l.type != "function" && (l.__u |= 4)) : a != u && (a == u - 1 ? f-- : a == u + 1 ? f++ : (a > u ? f-- : f++, l.__u |= 4))) : t.__k[s] = null;
|
|
59
|
+
if (i) for (s = 0; s < p; s++) (d = r[s]) != null && (2 & d.__u) == 0 && (d.__e == n && (n = W(d)), Ue(d, d));
|
|
59
60
|
return n;
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
-
var
|
|
63
|
-
if (typeof
|
|
64
|
-
for (
|
|
65
|
-
return
|
|
62
|
+
function Fe(t, e, r, n) {
|
|
63
|
+
var o, s;
|
|
64
|
+
if (typeof t.type == "function") {
|
|
65
|
+
for (o = t.__k, s = 0; o && s < o.length; s++) o[s] && (o[s].__ = t, e = Fe(o[s], e, r, n));
|
|
66
|
+
return e;
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
+
t.__e != e && (n && (e && t.type && !e.parentNode && (e = W(t)), r.insertBefore(t.__e, e || null)), e = t.__e);
|
|
68
69
|
do
|
|
69
|
-
|
|
70
|
-
while (
|
|
71
|
-
return
|
|
70
|
+
e = e && e.nextSibling;
|
|
71
|
+
while (e != null && e.nodeType == 8);
|
|
72
|
+
return e;
|
|
72
73
|
}
|
|
73
|
-
function nt(
|
|
74
|
-
var
|
|
75
|
-
if (a === null &&
|
|
76
|
-
if (n > (
|
|
77
|
-
for (
|
|
74
|
+
function nt(t, e, r, n) {
|
|
75
|
+
var o, s, l, d = t.key, u = t.type, a = e[r], p = a != null && (2 & a.__u) == 0;
|
|
76
|
+
if (a === null && d == null || p && d == a.key && u == a.type) return r;
|
|
77
|
+
if (n > (p ? 1 : 0)) {
|
|
78
|
+
for (o = r - 1, s = r + 1; o >= 0 || s < e.length; ) if ((a = e[l = o >= 0 ? o-- : s++]) != null && (2 & a.__u) == 0 && d == a.key && u == a.type) return l;
|
|
78
79
|
}
|
|
79
80
|
return -1;
|
|
80
81
|
}
|
|
81
|
-
function ye(
|
|
82
|
-
|
|
82
|
+
function ye(t, e, r) {
|
|
83
|
+
e[0] == "-" ? t.setProperty(e, r ?? "") : t[e] = r == null ? "" : typeof r != "number" || Ze.test(e) ? r : r + "px";
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
-
var
|
|
86
|
-
e: if (
|
|
85
|
+
function j(t, e, r, n, o) {
|
|
86
|
+
var s, l;
|
|
87
|
+
e: if (e == "style") if (typeof r == "string") t.style.cssText = r;
|
|
87
88
|
else {
|
|
88
|
-
if (typeof n == "string" && (
|
|
89
|
-
if (r) for (
|
|
89
|
+
if (typeof n == "string" && (t.style.cssText = n = ""), n) for (e in n) r && e in r || ye(t.style, e, "");
|
|
90
|
+
if (r) for (e in r) n && r[e] == n[e] || ye(t.style, e, r[e]);
|
|
90
91
|
}
|
|
91
|
-
else if (
|
|
92
|
+
else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(He, "$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 + s] = r, r ? n ? r.u = n.u : (r.u = ce, t.addEventListener(e, s ? ae : ie, s)) : t.removeEventListener(e, s ? ae : ie, s);
|
|
92
93
|
else {
|
|
93
|
-
if (
|
|
94
|
-
else if (
|
|
95
|
-
e
|
|
94
|
+
if (o == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
95
|
+
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 {
|
|
96
|
+
t[e] = r ?? "";
|
|
96
97
|
break e;
|
|
97
98
|
} catch {
|
|
98
99
|
}
|
|
99
|
-
typeof r == "function" || (r == null || r === !1 &&
|
|
100
|
+
typeof r == "function" || (r == null || r === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && r == 1 ? "" : r));
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
function be(
|
|
103
|
-
return function(
|
|
103
|
+
function be(t) {
|
|
104
|
+
return function(e) {
|
|
104
105
|
if (this.l) {
|
|
105
|
-
var r = this.l[
|
|
106
|
-
if (
|
|
107
|
-
else if (
|
|
108
|
-
return r(w.event ? w.event(
|
|
106
|
+
var r = this.l[e.type + t];
|
|
107
|
+
if (e.t == null) e.t = ce++;
|
|
108
|
+
else if (e.t < r.u) return;
|
|
109
|
+
return r(w.event ? w.event(e) : e);
|
|
109
110
|
}
|
|
110
111
|
};
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
-
var
|
|
114
|
-
if (
|
|
115
|
-
128 & r.__u && (
|
|
116
|
-
e: if (typeof
|
|
117
|
-
if (m =
|
|
113
|
+
function _e(t, e, r, n, o, s, l, d, u, a) {
|
|
114
|
+
var p, i, f, _, v, T, b, m, g, I, $, L, h, y, C, R = e.type;
|
|
115
|
+
if (e.constructor !== void 0) return null;
|
|
116
|
+
128 & r.__u && (u = !!(32 & r.__u), s = [d = e.__e = r.__e]), (p = w.__b) && p(e);
|
|
117
|
+
e: if (typeof R == "function") try {
|
|
118
|
+
if (m = e.props, g = "prototype" in R && R.prototype.render, I = (p = R.contextType) && n[p.__c], $ = p ? I ? I.props.value : p.__ : n, r.__c ? b = (i = e.__c = r.__c).__ = i.__E : (g ? e.__c = i = new R(m, $) : (e.__c = i = new J(m, $), i.constructor = R, i.render = ot), I && I.sub(i), i.state || (i.state = {}), i.__n = n, f = i.__d = !0, i.__h = [], i._sb = []), g && i.__s == null && (i.__s = i.state), g && R.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = E({}, i.__s)), E(i.__s, R.getDerivedStateFromProps(m, i.__s))), _ = i.props, v = i.state, i.__v = e, f) g && R.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), g && i.componentDidMount != null && i.__h.push(i.componentDidMount);
|
|
118
119
|
else {
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}),
|
|
123
|
-
i._sb = [], i.__h.length && l.push(i);
|
|
120
|
+
if (g && R.getDerivedStateFromProps == null && m !== _ && i.componentWillReceiveProps != null && i.componentWillReceiveProps(m, $), e.__v == r.__v || !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(m, i.__s, $) === !1) {
|
|
121
|
+
e.__v != r.__v && (i.props = m, i.state = i.__s, i.__d = !1), e.__e = r.__e, e.__k = r.__k, e.__k.some(function(N) {
|
|
122
|
+
N && (N.__ = e);
|
|
123
|
+
}), K.push.apply(i.__h, i._sb), i._sb = [], i.__h.length && l.push(i);
|
|
124
124
|
break e;
|
|
125
125
|
}
|
|
126
|
-
i.componentWillUpdate != null && i.componentWillUpdate(m, i.__s, $),
|
|
127
|
-
i.componentDidUpdate(
|
|
126
|
+
i.componentWillUpdate != null && i.componentWillUpdate(m, i.__s, $), g && i.componentDidUpdate != null && i.__h.push(function() {
|
|
127
|
+
i.componentDidUpdate(_, v, T);
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
if (i.context = $, i.props = m, i.__P =
|
|
131
|
-
|
|
132
|
-
i.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
for (t.__u |= f ? 160 : 128; c && c.nodeType == 8 && c.nextSibling; ) c = c.nextSibling;
|
|
140
|
-
o[o.indexOf(c)] = null, t.__e = c;
|
|
130
|
+
if (i.context = $, i.props = m, i.__P = t, i.__e = !1, L = w.__r, h = 0, g) i.state = i.__s, i.__d = !1, L && L(e), p = i.render(i.props, i.state, i.context), K.push.apply(i.__h, i._sb), i._sb = [];
|
|
131
|
+
else do
|
|
132
|
+
i.__d = !1, L && L(e), p = i.render(i.props, i.state, i.context), i.state = i.__s;
|
|
133
|
+
while (i.__d && ++h < 25);
|
|
134
|
+
i.state = i.__s, i.getChildContext != null && (n = E(E({}, n), i.getChildContext())), g && !f && i.getSnapshotBeforeUpdate != null && (T = i.getSnapshotBeforeUpdate(_, v)), y = p != null && p.type === U && p.key == null ? Oe(p.props.children) : p, d = De(t, ee(y) ? y : [y], e, r, n, o, s, l, d, u, a), i.base = e.__e, e.__u &= -161, i.__h.length && l.push(i), b && (i.__E = i.__ = null);
|
|
135
|
+
} catch (N) {
|
|
136
|
+
if (e.__v = null, u || s != null) if (N.then) {
|
|
137
|
+
for (e.__u |= u ? 160 : 128; d && d.nodeType == 8 && d.nextSibling; ) d = d.nextSibling;
|
|
138
|
+
s[s.indexOf(d)] = null, e.__e = d;
|
|
141
139
|
} else {
|
|
142
|
-
for (
|
|
143
|
-
|
|
140
|
+
for (C = s.length; C--; ) ue(s[C]);
|
|
141
|
+
le(e);
|
|
144
142
|
}
|
|
145
|
-
else
|
|
146
|
-
w.__e(
|
|
143
|
+
else e.__e = r.__e, e.__k = r.__k, N.then || le(e);
|
|
144
|
+
w.__e(N, e, r);
|
|
147
145
|
}
|
|
148
|
-
else
|
|
149
|
-
return (
|
|
146
|
+
else s == null && e.__v == r.__v ? (e.__k = r.__k, e.__e = r.__e) : d = e.__e = st(r.__e, e, r, n, o, s, l, u, a);
|
|
147
|
+
return (p = w.diffed) && p(e), 128 & e.__u ? void 0 : d;
|
|
150
148
|
}
|
|
151
|
-
function
|
|
152
|
-
|
|
149
|
+
function le(t) {
|
|
150
|
+
t && (t.__c && (t.__c.__e = !0), t.__k && t.__k.some(le));
|
|
153
151
|
}
|
|
154
|
-
function
|
|
155
|
-
for (var n = 0; n < r.length; n++)
|
|
156
|
-
w.__c && w.__c(
|
|
152
|
+
function Pe(t, e, r) {
|
|
153
|
+
for (var n = 0; n < r.length; n++) pe(r[n], r[++n], r[++n]);
|
|
154
|
+
w.__c && w.__c(e, t), t.some(function(o) {
|
|
157
155
|
try {
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
t = o.__h, o.__h = [], t.some(function(s) {
|
|
157
|
+
s.call(o);
|
|
160
158
|
});
|
|
161
|
-
} catch (
|
|
162
|
-
w.__e(
|
|
159
|
+
} catch (s) {
|
|
160
|
+
w.__e(s, o.__v);
|
|
163
161
|
}
|
|
164
162
|
});
|
|
165
163
|
}
|
|
166
|
-
function
|
|
167
|
-
return typeof
|
|
164
|
+
function Oe(t) {
|
|
165
|
+
return typeof t != "object" || t == null || t.__b > 0 ? t : ee(t) ? t.map(Oe) : E({}, t);
|
|
168
166
|
}
|
|
169
|
-
function
|
|
170
|
-
var a,
|
|
171
|
-
if (
|
|
172
|
-
for (a = 0; a <
|
|
173
|
-
|
|
167
|
+
function st(t, e, r, n, o, s, l, d, u) {
|
|
168
|
+
var a, p, i, f, _, v, T, b = r.props || G, m = e.props, g = e.type;
|
|
169
|
+
if (g == "svg" ? o = "http://www.w3.org/2000/svg" : g == "math" ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), s != null) {
|
|
170
|
+
for (a = 0; a < s.length; a++) if ((_ = s[a]) && "setAttribute" in _ == !!g && (g ? _.localName == g : _.nodeType == 3)) {
|
|
171
|
+
t = _, s[a] = null;
|
|
174
172
|
break;
|
|
175
173
|
}
|
|
176
174
|
}
|
|
177
|
-
if (
|
|
178
|
-
if (
|
|
179
|
-
|
|
175
|
+
if (t == null) {
|
|
176
|
+
if (g == null) return document.createTextNode(m);
|
|
177
|
+
t = document.createElementNS(o, g, m.is && m), d && (w.__m && w.__m(e, s), d = !1), s = null;
|
|
180
178
|
}
|
|
181
|
-
if (
|
|
179
|
+
if (g == null) b === m || d && t.data == m || (t.data = m);
|
|
182
180
|
else {
|
|
183
|
-
if (
|
|
184
|
-
for (a in
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
for (a in m) p = m[a], a == "children" ? u = p : a == "dangerouslySetInnerHTML" ? h = p : a == "value" ? _ = p : a == "checked" ? g = p : c && typeof p != "function" || v[a] === p || O(e, a, p, v[a], s);
|
|
192
|
-
if (h) c || i && (h.__html == i.__html || h.__html == e.innerHTML) || (e.innerHTML = h.__html), t.__k = [];
|
|
193
|
-
else if (i && (e.innerHTML = ""), Fe(t.type == "template" ? e.content : e, Z(u) ? u : [u], t, r, n, y == "foreignObject" ? "http://www.w3.org/1999/xhtml" : s, o, l, o ? o[0] : r.__k && I(r, 0), c, f), o != null) for (a = o.length; a--; ) ce(o[a]);
|
|
194
|
-
c || (a = "value", y == "progress" && _ == null ? e.removeAttribute("value") : _ != null && (_ !== e[a] || y == "progress" && !_ || y == "option" && _ != v[a]) && O(e, a, _, v[a], s), a = "checked", g != null && g != e[a] && O(e, a, g, v[a], s));
|
|
181
|
+
if (s = s && Z.call(t.childNodes), !d && s != null) for (b = {}, a = 0; a < t.attributes.length; a++) b[(_ = t.attributes[a]).name] = _.value;
|
|
182
|
+
for (a in b) _ = b[a], a == "dangerouslySetInnerHTML" ? i = _ : a == "children" || a in m || a == "value" && "defaultValue" in m || a == "checked" && "defaultChecked" in m || j(t, a, null, _, o);
|
|
183
|
+
for (a in m) _ = m[a], a == "children" ? f = _ : a == "dangerouslySetInnerHTML" ? p = _ : a == "value" ? v = _ : a == "checked" ? T = _ : d && typeof _ != "function" || b[a] === _ || j(t, a, _, b[a], o);
|
|
184
|
+
if (p) d || i && (p.__html == i.__html || p.__html == t.innerHTML) || (t.innerHTML = p.__html), e.__k = [];
|
|
185
|
+
else if (i && (t.innerHTML = ""), De(e.type == "template" ? t.content : t, ee(f) ? f : [f], e, r, n, g == "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, s, l, s ? s[0] : r.__k && W(r, 0), d, u), s != null) for (a = s.length; a--; ) ue(s[a]);
|
|
186
|
+
d || (a = "value", g == "progress" && v == null ? t.removeAttribute("value") : v != null && (v !== t[a] || g == "progress" && !v || g == "option" && v != b[a]) && j(t, a, v, b[a], o), a = "checked", T != null && T != t[a] && j(t, a, T, b[a], o));
|
|
195
187
|
}
|
|
196
|
-
return
|
|
188
|
+
return t;
|
|
197
189
|
}
|
|
198
|
-
function
|
|
190
|
+
function pe(t, e, r) {
|
|
199
191
|
try {
|
|
200
|
-
if (typeof
|
|
201
|
-
var n = typeof
|
|
202
|
-
n &&
|
|
203
|
-
} else
|
|
204
|
-
} catch (
|
|
205
|
-
w.__e(
|
|
192
|
+
if (typeof t == "function") {
|
|
193
|
+
var n = typeof t.__u == "function";
|
|
194
|
+
n && t.__u(), n && e == null || (t.__u = t(e));
|
|
195
|
+
} else t.current = e;
|
|
196
|
+
} catch (o) {
|
|
197
|
+
w.__e(o, r);
|
|
206
198
|
}
|
|
207
199
|
}
|
|
208
|
-
function
|
|
209
|
-
var n,
|
|
210
|
-
if (w.unmount && w.unmount(
|
|
200
|
+
function Ue(t, e, r) {
|
|
201
|
+
var n, o;
|
|
202
|
+
if (w.unmount && w.unmount(t), (n = t.ref) && (n.current && n.current != t.__e || pe(n, null, e)), (n = t.__c) != null) {
|
|
211
203
|
if (n.componentWillUnmount) try {
|
|
212
204
|
n.componentWillUnmount();
|
|
213
|
-
} catch (
|
|
214
|
-
w.__e(
|
|
205
|
+
} catch (s) {
|
|
206
|
+
w.__e(s, e);
|
|
215
207
|
}
|
|
216
208
|
n.base = n.__P = null;
|
|
217
209
|
}
|
|
218
|
-
if (n =
|
|
219
|
-
r ||
|
|
210
|
+
if (n = t.__k) for (o = 0; o < n.length; o++) n[o] && Ue(n[o], e, r || typeof t.type != "function");
|
|
211
|
+
r || ue(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
220
212
|
}
|
|
221
|
-
function
|
|
222
|
-
return this.constructor(
|
|
213
|
+
function ot(t, e, r) {
|
|
214
|
+
return this.constructor(t, r);
|
|
223
215
|
}
|
|
224
|
-
function it(
|
|
225
|
-
var n,
|
|
226
|
-
|
|
216
|
+
function it(t, e, r) {
|
|
217
|
+
var n, o, s, l;
|
|
218
|
+
e == document && (e = document.documentElement), w.__ && w.__(t, e), o = (n = !1) ? null : e.__k, s = [], l = [], _e(e, t = e.__k = et(U, null, [t]), o || G, G, e.namespaceURI, o ? null : e.firstChild ? Z.call(e.childNodes) : null, s, o ? o.__e : e.firstChild, n, l), Pe(s, t, l);
|
|
227
219
|
}
|
|
228
|
-
|
|
229
|
-
for (var
|
|
230
|
-
if ((
|
|
231
|
-
} catch (
|
|
232
|
-
|
|
220
|
+
Z = K.slice, w = { __e: function(t, e, r, n) {
|
|
221
|
+
for (var o, s, l; e = e.__; ) if ((o = e.__c) && !o.__) try {
|
|
222
|
+
if ((s = o.constructor) && s.getDerivedStateFromError != null && (o.setState(s.getDerivedStateFromError(t)), l = o.__d), o.componentDidCatch != null && (o.componentDidCatch(t, n || {}), l = o.__d), l) return o.__E = o;
|
|
223
|
+
} catch (d) {
|
|
224
|
+
t = d;
|
|
233
225
|
}
|
|
234
|
-
throw
|
|
235
|
-
} },
|
|
226
|
+
throw t;
|
|
227
|
+
} }, ze = 0, J.prototype.setState = function(t, e) {
|
|
236
228
|
var r;
|
|
237
|
-
r = this.__s != null && this.__s != this.state ? this.__s : this.__s =
|
|
238
|
-
},
|
|
239
|
-
this.__v && (this.__e = !0,
|
|
240
|
-
},
|
|
241
|
-
return
|
|
242
|
-
},
|
|
229
|
+
r = this.__s != null && this.__s != this.state ? this.__s : this.__s = E({}, this.state), typeof t == "function" && (t = t(E({}, r), this.props)), t && E(r, t), t != null && this.__v && (e && this._sb.push(e), we(this));
|
|
230
|
+
}, J.prototype.forceUpdate = function(t) {
|
|
231
|
+
this.__v && (this.__e = !0, t && this.__h.push(t), we(this));
|
|
232
|
+
}, J.prototype.render = U, M = [], Ne = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, We = function(t, e) {
|
|
233
|
+
return t.__v.__b - e.__v.__b;
|
|
234
|
+
}, Y.__r = 0, He = /(PointerCapture)$|Capture$/i, ce = 0, ie = be(!1), ae = be(!0);
|
|
243
235
|
var at = 0;
|
|
244
|
-
function
|
|
245
|
-
|
|
246
|
-
var l,
|
|
247
|
-
if ("ref" in
|
|
248
|
-
var a = { type:
|
|
249
|
-
if (typeof
|
|
236
|
+
function c(t, e, r, n, o, s) {
|
|
237
|
+
e || (e = {});
|
|
238
|
+
var l, d, u = e;
|
|
239
|
+
if ("ref" in u) for (d in u = {}, e) d == "ref" ? l = e[d] : u[d] = e[d];
|
|
240
|
+
var a = { type: t, props: u, key: r, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --at, __i: -1, __u: 0, __source: o, __self: s };
|
|
241
|
+
if (typeof t == "function" && (l = t.defaultProps)) for (d in l) u[d] === void 0 && (u[d] = l[d]);
|
|
250
242
|
return w.vnode && w.vnode(a), a;
|
|
251
243
|
}
|
|
252
244
|
const lt = {
|
|
@@ -312,165 +304,162 @@ const lt = {
|
|
|
312
304
|
iconColor: "#f1f5f9",
|
|
313
305
|
iconColorSecondary: "#cbd5e1"
|
|
314
306
|
};
|
|
315
|
-
function
|
|
316
|
-
const
|
|
317
|
-
return Object.entries(
|
|
307
|
+
function dt(t = {}) {
|
|
308
|
+
const e = { ...lt, ...t };
|
|
309
|
+
return Object.entries(e).map(([r, n]) => `${`--twd-${r.replace(/([A-Z])/g, "-$1").toLowerCase()}`}: ${n};`).join(`
|
|
318
310
|
`);
|
|
319
311
|
}
|
|
320
|
-
function
|
|
321
|
-
const
|
|
322
|
-
let r = document.getElementById(
|
|
323
|
-
r || (r = document.createElement("style"), r.id =
|
|
324
|
-
const n =
|
|
312
|
+
function ct(t) {
|
|
313
|
+
const e = "twd-theme-variables";
|
|
314
|
+
let r = document.getElementById(e);
|
|
315
|
+
r || (r = document.createElement("style"), r.id = e, document.head.appendChild(r));
|
|
316
|
+
const n = dt(t);
|
|
325
317
|
r.textContent = `
|
|
326
318
|
:root {
|
|
327
319
|
${n}
|
|
328
320
|
}
|
|
329
321
|
`;
|
|
330
322
|
}
|
|
331
|
-
const
|
|
332
|
-
const { Component:
|
|
333
|
-
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
},
|
|
337
|
-
for (const
|
|
338
|
-
|
|
323
|
+
const ut = (t) => {
|
|
324
|
+
const { Component: e, createRoot: r, theme: n } = t;
|
|
325
|
+
ct(n);
|
|
326
|
+
const o = document.createElement("div");
|
|
327
|
+
o.setAttribute("id", "twd-sidebar-root"), document.body.appendChild(o), r(o).render(e);
|
|
328
|
+
}, _t = async (t, e, r, n) => {
|
|
329
|
+
for (const o in t) await t[o]();
|
|
330
|
+
ut({ Component: e, createRoot: r, theme: n });
|
|
339
331
|
};
|
|
340
|
-
var
|
|
341
|
-
function
|
|
342
|
-
|
|
343
|
-
var r =
|
|
344
|
-
return
|
|
332
|
+
var P, k, se, ke, Q = 0, je = [], S = w, Se = S.__b, xe = S.__r, Te = S.diffed, Ce = S.__c, Re = S.unmount, Ie = S.__;
|
|
333
|
+
function fe(t, e) {
|
|
334
|
+
S.__h && S.__h(k, t, Q || e), Q = 0;
|
|
335
|
+
var r = k.__H || (k.__H = { __: [], __h: [] });
|
|
336
|
+
return t >= r.__.length && r.__.push({}), r.__[t];
|
|
345
337
|
}
|
|
346
|
-
function
|
|
347
|
-
return
|
|
338
|
+
function B(t) {
|
|
339
|
+
return Q = 1, pt(Ve, t);
|
|
348
340
|
}
|
|
349
|
-
function pt(
|
|
350
|
-
var n =
|
|
351
|
-
if (n.t =
|
|
352
|
-
var
|
|
353
|
-
|
|
354
|
-
}], n.__c =
|
|
355
|
-
var
|
|
341
|
+
function pt(t, e, r) {
|
|
342
|
+
var n = fe(P++, 2);
|
|
343
|
+
if (n.t = t, !n.__c && (n.__ = [Ve(void 0, e), function(d) {
|
|
344
|
+
var u = n.__N ? n.__N[0] : n.__[0], a = n.t(u, d);
|
|
345
|
+
u !== a && (n.__N = [a, n.__[1]], n.__c.setState({}));
|
|
346
|
+
}], n.__c = k, !k.__f)) {
|
|
347
|
+
var o = function(d, u, a) {
|
|
356
348
|
if (!n.__c.__H) return !0;
|
|
357
|
-
var
|
|
358
|
-
return
|
|
349
|
+
var p = n.__c.__H.__.filter(function(f) {
|
|
350
|
+
return f.__c;
|
|
359
351
|
});
|
|
360
|
-
if (
|
|
361
|
-
return !
|
|
362
|
-
})) return !
|
|
363
|
-
var i = n.__c.props !==
|
|
364
|
-
return
|
|
365
|
-
if (
|
|
366
|
-
var
|
|
367
|
-
|
|
352
|
+
if (p.every(function(f) {
|
|
353
|
+
return !f.__N;
|
|
354
|
+
})) return !s || s.call(this, d, u, a);
|
|
355
|
+
var i = n.__c.props !== d;
|
|
356
|
+
return p.some(function(f) {
|
|
357
|
+
if (f.__N) {
|
|
358
|
+
var _ = f.__[0];
|
|
359
|
+
f.__ = f.__N, f.__N = void 0, _ !== f.__[0] && (i = !0);
|
|
368
360
|
}
|
|
369
|
-
}),
|
|
361
|
+
}), s && s.call(this, d, u, a) || i;
|
|
370
362
|
};
|
|
371
|
-
|
|
372
|
-
var
|
|
373
|
-
|
|
363
|
+
k.__f = !0;
|
|
364
|
+
var s = k.shouldComponentUpdate, l = k.componentWillUpdate;
|
|
365
|
+
k.componentWillUpdate = function(d, u, a) {
|
|
374
366
|
if (this.__e) {
|
|
375
|
-
var
|
|
376
|
-
|
|
367
|
+
var p = s;
|
|
368
|
+
s = void 0, o(d, u, a), s = p;
|
|
377
369
|
}
|
|
378
|
-
l && l.call(this,
|
|
379
|
-
},
|
|
370
|
+
l && l.call(this, d, u, a);
|
|
371
|
+
}, k.shouldComponentUpdate = o;
|
|
380
372
|
}
|
|
381
373
|
return n.__N || n.__;
|
|
382
374
|
}
|
|
383
|
-
function
|
|
384
|
-
var r =
|
|
385
|
-
!
|
|
375
|
+
function te(t, e) {
|
|
376
|
+
var r = fe(P++, 3);
|
|
377
|
+
!S.__s && qe(r.__H, e) && (r.__ = t, r.u = e, k.__H.__h.push(r));
|
|
386
378
|
}
|
|
387
|
-
function
|
|
388
|
-
return
|
|
389
|
-
return { current:
|
|
379
|
+
function F(t) {
|
|
380
|
+
return Q = 5, z(function() {
|
|
381
|
+
return { current: t };
|
|
390
382
|
}, []);
|
|
391
383
|
}
|
|
392
|
-
function
|
|
393
|
-
var r =
|
|
394
|
-
return
|
|
384
|
+
function z(t, e) {
|
|
385
|
+
var r = fe(P++, 7);
|
|
386
|
+
return qe(r.__H, e) && (r.__ = t(), r.__H = e, r.__h = t), r.__;
|
|
395
387
|
}
|
|
396
388
|
function ft() {
|
|
397
|
-
for (var
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
389
|
+
for (var t; t = je.shift(); ) {
|
|
390
|
+
var e = t.__H;
|
|
391
|
+
if (t.__P && e) try {
|
|
392
|
+
e.__h.some(X), e.__h.some(de), e.__h = [];
|
|
393
|
+
} catch (r) {
|
|
394
|
+
e.__h = [], S.__e(r, t.__v);
|
|
395
|
+
}
|
|
401
396
|
}
|
|
402
397
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
},
|
|
406
|
-
|
|
407
|
-
},
|
|
408
|
-
xe && xe(
|
|
409
|
-
var
|
|
410
|
-
|
|
398
|
+
S.__b = function(t) {
|
|
399
|
+
k = null, Se && Se(t);
|
|
400
|
+
}, S.__ = function(t, e) {
|
|
401
|
+
t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Ie && Ie(t, e);
|
|
402
|
+
}, S.__r = function(t) {
|
|
403
|
+
xe && xe(t), P = 0;
|
|
404
|
+
var e = (k = t.__c).__H;
|
|
405
|
+
e && (se === k ? (e.__h = [], k.__h = [], e.__.some(function(r) {
|
|
411
406
|
r.__N && (r.__ = r.__N), r.u = r.__N = void 0;
|
|
412
|
-
})) : (
|
|
413
|
-
},
|
|
414
|
-
Te && Te(
|
|
415
|
-
var
|
|
416
|
-
|
|
407
|
+
})) : (e.__h.some(X), e.__h.some(de), e.__h = [], P = 0)), se = k;
|
|
408
|
+
}, S.diffed = function(t) {
|
|
409
|
+
Te && Te(t);
|
|
410
|
+
var e = t.__c;
|
|
411
|
+
e && e.__H && (e.__H.__h.length && (je.push(e) !== 1 && ke === S.requestAnimationFrame || ((ke = S.requestAnimationFrame) || ht)(ft)), e.__H.__.some(function(r) {
|
|
417
412
|
r.u && (r.__H = r.u), r.u = void 0;
|
|
418
|
-
})),
|
|
419
|
-
},
|
|
420
|
-
|
|
413
|
+
})), se = k = null;
|
|
414
|
+
}, S.__c = function(t, e) {
|
|
415
|
+
e.some(function(r) {
|
|
421
416
|
try {
|
|
422
|
-
r.__h.
|
|
423
|
-
return !n.__ ||
|
|
417
|
+
r.__h.some(X), r.__h = r.__h.filter(function(n) {
|
|
418
|
+
return !n.__ || de(n);
|
|
424
419
|
});
|
|
425
420
|
} catch (n) {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
}),
|
|
421
|
+
e.some(function(o) {
|
|
422
|
+
o.__h && (o.__h = []);
|
|
423
|
+
}), e = [], S.__e(n, r.__v);
|
|
429
424
|
}
|
|
430
|
-
}),
|
|
431
|
-
},
|
|
432
|
-
Re && Re(
|
|
433
|
-
var
|
|
434
|
-
r && r.__H && (r.__H.__.
|
|
425
|
+
}), Ce && Ce(t, e);
|
|
426
|
+
}, S.unmount = function(t) {
|
|
427
|
+
Re && Re(t);
|
|
428
|
+
var e, r = t.__c;
|
|
429
|
+
r && r.__H && (r.__H.__.some(function(n) {
|
|
435
430
|
try {
|
|
436
431
|
X(n);
|
|
437
|
-
} catch (
|
|
438
|
-
|
|
432
|
+
} catch (o) {
|
|
433
|
+
e = o;
|
|
439
434
|
}
|
|
440
|
-
}), r.__H = void 0,
|
|
435
|
+
}), r.__H = void 0, e && S.__e(e, r.__v));
|
|
441
436
|
};
|
|
442
|
-
var
|
|
443
|
-
function ht(
|
|
444
|
-
var
|
|
445
|
-
clearTimeout(n),
|
|
437
|
+
var $e = typeof requestAnimationFrame == "function";
|
|
438
|
+
function ht(t) {
|
|
439
|
+
var e, r = function() {
|
|
440
|
+
clearTimeout(n), $e && cancelAnimationFrame(e), setTimeout(t);
|
|
446
441
|
}, n = setTimeout(r, 35);
|
|
447
|
-
|
|
442
|
+
$e && (e = requestAnimationFrame(r));
|
|
448
443
|
}
|
|
449
|
-
function X(
|
|
450
|
-
var
|
|
451
|
-
typeof r == "function" && (
|
|
444
|
+
function X(t) {
|
|
445
|
+
var e = k, r = t.__c;
|
|
446
|
+
typeof r == "function" && (t.__c = void 0, r()), k = e;
|
|
452
447
|
}
|
|
453
|
-
function
|
|
454
|
-
var
|
|
455
|
-
|
|
448
|
+
function de(t) {
|
|
449
|
+
var e = k;
|
|
450
|
+
t.__c = t.__(), k = e;
|
|
456
451
|
}
|
|
457
|
-
function
|
|
458
|
-
return !
|
|
459
|
-
return r !==
|
|
452
|
+
function qe(t, e) {
|
|
453
|
+
return !t || t.length !== e.length || e.some(function(r, n) {
|
|
454
|
+
return r !== t[n];
|
|
460
455
|
});
|
|
461
456
|
}
|
|
462
|
-
function
|
|
463
|
-
return typeof
|
|
457
|
+
function Ve(t, e) {
|
|
458
|
+
return typeof e == "function" ? e(t) : e;
|
|
464
459
|
}
|
|
465
|
-
const gt =
|
|
466
|
-
const t = /* @__PURE__ */ new Map(), r = [];
|
|
467
|
-
for (const n of e) t.set(n.id, { ...n, childrenNodes: [] });
|
|
468
|
-
for (const n of t.values())
|
|
469
|
-
n.parent ? t.get(n.parent)?.childrenNodes?.push(n) : r.push(n);
|
|
470
|
-
return r;
|
|
471
|
-
}, mt = {
|
|
460
|
+
const gt = {
|
|
472
461
|
animation: "spin 1s linear infinite"
|
|
473
|
-
},
|
|
462
|
+
}, mt = () => /* @__PURE__ */ c(
|
|
474
463
|
"svg",
|
|
475
464
|
{
|
|
476
465
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -483,18 +472,18 @@ const gt = (e) => {
|
|
|
483
472
|
strokeLinecap: "round",
|
|
484
473
|
strokeLinejoin: "round",
|
|
485
474
|
className: "lucide lucide-loader-circle-icon lucide-loader-circle",
|
|
486
|
-
style:
|
|
475
|
+
style: gt,
|
|
487
476
|
"data-testid": "loader-icon",
|
|
488
|
-
children: /* @__PURE__ */
|
|
477
|
+
children: /* @__PURE__ */ c("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
489
478
|
}
|
|
490
|
-
),
|
|
491
|
-
|
|
479
|
+
), q = document.createElement("style");
|
|
480
|
+
q && !document.getElementById("loader-spin-keyframes") && (q.id = "loader-spin-keyframes", q.innerHTML = `
|
|
492
481
|
@keyframes spin {
|
|
493
482
|
0% { transform: rotate(0deg); }
|
|
494
483
|
100% { transform: rotate(360deg); }
|
|
495
484
|
}
|
|
496
|
-
`, document.head.appendChild(
|
|
497
|
-
const
|
|
485
|
+
`, document.head.appendChild(q));
|
|
486
|
+
const re = ({ className: t, children: e, dataTestId: r }) => /* @__PURE__ */ c(
|
|
498
487
|
"svg",
|
|
499
488
|
{
|
|
500
489
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -506,29 +495,29 @@ const ee = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ d(
|
|
|
506
495
|
strokeWidth: "2",
|
|
507
496
|
strokeLinecap: "round",
|
|
508
497
|
strokeLinejoin: "round",
|
|
509
|
-
className: `lucide ${
|
|
498
|
+
className: `lucide ${t}`,
|
|
510
499
|
"data-testid": r,
|
|
511
|
-
children:
|
|
500
|
+
children: e
|
|
512
501
|
}
|
|
513
|
-
),
|
|
514
|
-
|
|
502
|
+
), vt = () => /* @__PURE__ */ c(re, { className: "lucide-play-icon lucide-play", dataTestId: "play-icon", children: /* @__PURE__ */ c("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" }) }), Je = ({ id: t, name: e, skip: r, only: n }) => /* @__PURE__ */ c(U, { children: [
|
|
503
|
+
e,
|
|
515
504
|
" ",
|
|
516
|
-
n && /* @__PURE__ */
|
|
505
|
+
n && /* @__PURE__ */ c(
|
|
517
506
|
"span",
|
|
518
507
|
{
|
|
519
508
|
style: { color: "var(--twd-primary)" },
|
|
520
|
-
"data-testid": `only-indicator-${
|
|
509
|
+
"data-testid": `only-indicator-${t}`,
|
|
521
510
|
children: [
|
|
522
511
|
" ",
|
|
523
512
|
"(only)"
|
|
524
513
|
]
|
|
525
514
|
}
|
|
526
515
|
),
|
|
527
|
-
r && /* @__PURE__ */
|
|
516
|
+
r && /* @__PURE__ */ c(
|
|
528
517
|
"span",
|
|
529
518
|
{
|
|
530
519
|
style: { color: "var(--twd-text-secondary)" },
|
|
531
|
-
"data-testid": `skip-indicator-${
|
|
520
|
+
"data-testid": `skip-indicator-${t}`,
|
|
532
521
|
children: [
|
|
533
522
|
" ",
|
|
534
523
|
"(skipped)"
|
|
@@ -536,30 +525,30 @@ const ee = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ d(
|
|
|
536
525
|
}
|
|
537
526
|
)
|
|
538
527
|
] });
|
|
539
|
-
var
|
|
540
|
-
const
|
|
528
|
+
var A = /* @__PURE__ */ ((t) => (t.CHAI_DIFF = "chai-diff", t.CHAI_MESSAGE = "chai-message", t.ERROR = "error", t))(A || {});
|
|
529
|
+
const wt = (t) => {
|
|
541
530
|
try {
|
|
542
|
-
const
|
|
543
|
-
if (
|
|
544
|
-
return
|
|
531
|
+
const e = JSON.parse(t);
|
|
532
|
+
if (e && typeof e == "object" && "type" in e)
|
|
533
|
+
return e;
|
|
545
534
|
} catch {
|
|
546
535
|
}
|
|
547
536
|
return null;
|
|
548
|
-
},
|
|
549
|
-
if (
|
|
550
|
-
if (
|
|
551
|
-
if (typeof
|
|
552
|
-
if (typeof
|
|
537
|
+
}, Ee = (t) => {
|
|
538
|
+
if (t === null) return "null";
|
|
539
|
+
if (t === void 0) return "undefined";
|
|
540
|
+
if (typeof t == "string") return t;
|
|
541
|
+
if (typeof t == "object")
|
|
553
542
|
try {
|
|
554
|
-
return JSON.stringify(
|
|
543
|
+
return JSON.stringify(t, null, 2);
|
|
555
544
|
} catch {
|
|
556
|
-
return String(
|
|
545
|
+
return String(t);
|
|
557
546
|
}
|
|
558
|
-
return String(
|
|
559
|
-
},
|
|
560
|
-
const r =
|
|
561
|
-
if (r?.type ===
|
|
562
|
-
return /* @__PURE__ */
|
|
547
|
+
return String(t);
|
|
548
|
+
}, yt = (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)" } : {}, bt = (t) => t.type === "chai-message" || t.type === "error", kt = (t, e) => e && bt(e) ? e.message : t, St = ({ log: t, index: e }) => {
|
|
549
|
+
const r = wt(t);
|
|
550
|
+
if (r?.type === A.CHAI_DIFF)
|
|
551
|
+
return /* @__PURE__ */ c(
|
|
563
552
|
"li",
|
|
564
553
|
{
|
|
565
554
|
style: {
|
|
@@ -569,22 +558,22 @@ const yt = (e) => {
|
|
|
569
558
|
color: "var(--twd-text)"
|
|
570
559
|
},
|
|
571
560
|
children: [
|
|
572
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ c("div", { style: {
|
|
573
562
|
color: "var(--twd-error)",
|
|
574
563
|
fontWeight: "var(--twd-font-weight-bold)",
|
|
575
564
|
marginBottom: "var(--twd-spacing-xs)"
|
|
576
565
|
}, children: "❌ Assertion failed" }),
|
|
577
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ c("div", { style: {
|
|
578
567
|
marginTop: "var(--twd-spacing-xs)",
|
|
579
568
|
paddingLeft: "var(--twd-spacing-sm)",
|
|
580
569
|
borderLeft: "2px solid var(--twd-success)"
|
|
581
570
|
}, children: [
|
|
582
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ c("div", { style: {
|
|
583
572
|
color: "var(--twd-success)",
|
|
584
573
|
fontWeight: "var(--twd-font-weight-medium)",
|
|
585
574
|
marginBottom: "var(--twd-spacing-xs)"
|
|
586
575
|
}, children: "Expected:" }),
|
|
587
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ c("pre", { style: {
|
|
588
577
|
margin: 0,
|
|
589
578
|
padding: "var(--twd-spacing-xs)",
|
|
590
579
|
background: "var(--twd-background)",
|
|
@@ -593,19 +582,19 @@ const yt = (e) => {
|
|
|
593
582
|
overflowX: "auto",
|
|
594
583
|
whiteSpace: "pre-wrap",
|
|
595
584
|
wordBreak: "break-word"
|
|
596
|
-
}, children:
|
|
585
|
+
}, children: Ee(r.expected) })
|
|
597
586
|
] }),
|
|
598
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ c("div", { style: {
|
|
599
588
|
marginTop: "var(--twd-spacing-xs)",
|
|
600
589
|
paddingLeft: "var(--twd-spacing-sm)",
|
|
601
590
|
borderLeft: "2px solid var(--twd-error)"
|
|
602
591
|
}, children: [
|
|
603
|
-
/* @__PURE__ */
|
|
592
|
+
/* @__PURE__ */ c("div", { style: {
|
|
604
593
|
color: "var(--twd-error)",
|
|
605
594
|
fontWeight: "var(--twd-font-weight-medium)",
|
|
606
595
|
marginBottom: "var(--twd-spacing-xs)"
|
|
607
596
|
}, children: "Actual:" }),
|
|
608
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ c("pre", { style: {
|
|
609
598
|
margin: 0,
|
|
610
599
|
padding: "var(--twd-spacing-xs)",
|
|
611
600
|
background: "var(--twd-background)",
|
|
@@ -614,14 +603,14 @@ const yt = (e) => {
|
|
|
614
603
|
overflowX: "auto",
|
|
615
604
|
whiteSpace: "pre-wrap",
|
|
616
605
|
wordBreak: "break-word"
|
|
617
|
-
}, children:
|
|
606
|
+
}, children: Ee(r.actual) })
|
|
618
607
|
] })
|
|
619
608
|
]
|
|
620
609
|
},
|
|
621
|
-
|
|
610
|
+
e
|
|
622
611
|
);
|
|
623
|
-
const n =
|
|
624
|
-
return /* @__PURE__ */
|
|
612
|
+
const n = kt(t, r);
|
|
613
|
+
return /* @__PURE__ */ c(
|
|
625
614
|
"li",
|
|
626
615
|
{
|
|
627
616
|
style: {
|
|
@@ -629,13 +618,13 @@ const yt = (e) => {
|
|
|
629
618
|
padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
|
|
630
619
|
borderBottom: "1px solid var(--twd-border-light)",
|
|
631
620
|
color: "var(--twd-text)",
|
|
632
|
-
...
|
|
621
|
+
...yt(n)
|
|
633
622
|
},
|
|
634
623
|
children: n
|
|
635
624
|
},
|
|
636
|
-
|
|
625
|
+
e
|
|
637
626
|
);
|
|
638
|
-
},
|
|
627
|
+
}, H = {
|
|
639
628
|
container: {
|
|
640
629
|
marginBottom: "var(--twd-spacing-xs)"
|
|
641
630
|
},
|
|
@@ -676,8 +665,8 @@ const yt = (e) => {
|
|
|
676
665
|
marginTop: "var(--twd-spacing-xs)",
|
|
677
666
|
textAlign: "left"
|
|
678
667
|
}
|
|
679
|
-
},
|
|
680
|
-
switch (
|
|
668
|
+
}, xt = (t) => {
|
|
669
|
+
switch (t.status) {
|
|
681
670
|
case "pass":
|
|
682
671
|
return {
|
|
683
672
|
item: {
|
|
@@ -715,39 +704,39 @@ const yt = (e) => {
|
|
|
715
704
|
}
|
|
716
705
|
};
|
|
717
706
|
}
|
|
718
|
-
},
|
|
719
|
-
node:
|
|
720
|
-
depth:
|
|
707
|
+
}, Tt = ({
|
|
708
|
+
node: t,
|
|
709
|
+
depth: e,
|
|
721
710
|
id: r,
|
|
722
711
|
runTest: n
|
|
723
712
|
}) => {
|
|
724
|
-
const
|
|
713
|
+
const o = F(null), s = F(t.status), l = F(t.logs?.length || 0), d = z(() => xt(t), [t.status]), u = typeof window < "u" && sessionStorage.getItem("twd-last-run-test-name") === t.name, a = z(
|
|
725
714
|
() => ({
|
|
726
|
-
...
|
|
727
|
-
marginLeft: `calc(${
|
|
728
|
-
...
|
|
715
|
+
...H.container,
|
|
716
|
+
marginLeft: `calc(${e} * var(--twd-spacing-sm))`,
|
|
717
|
+
...d.container || {}
|
|
729
718
|
}),
|
|
730
|
-
[
|
|
731
|
-
),
|
|
719
|
+
[e, d]
|
|
720
|
+
), p = z(
|
|
732
721
|
() => ({
|
|
733
|
-
...
|
|
734
|
-
...
|
|
735
|
-
...
|
|
722
|
+
...H.item,
|
|
723
|
+
...d.item,
|
|
724
|
+
...u && {
|
|
736
725
|
border: "1px dashed var(--twd-border)"
|
|
737
726
|
}
|
|
738
727
|
}),
|
|
739
|
-
[
|
|
728
|
+
[d, u]
|
|
740
729
|
);
|
|
741
|
-
|
|
742
|
-
const
|
|
743
|
-
if (!
|
|
744
|
-
const
|
|
745
|
-
(
|
|
746
|
-
|
|
747
|
-
}, 0),
|
|
748
|
-
}, [
|
|
730
|
+
te(() => {
|
|
731
|
+
const f = o.current;
|
|
732
|
+
if (!f || !t.logs || t.logs.length === 0) return;
|
|
733
|
+
const _ = s.current === "running" && (t.status === "pass" || t.status === "fail"), v = t.logs.length > l.current;
|
|
734
|
+
(_ || v) && setTimeout(() => {
|
|
735
|
+
f.scrollTop = f.scrollHeight;
|
|
736
|
+
}, 0), s.current = t.status, l.current = t.logs.length;
|
|
737
|
+
}, [t.status, t.logs]);
|
|
749
738
|
const i = () => {
|
|
750
|
-
switch (
|
|
739
|
+
switch (t.status) {
|
|
751
740
|
case "pass":
|
|
752
741
|
return "passed";
|
|
753
742
|
case "fail":
|
|
@@ -760,80 +749,80 @@ const yt = (e) => {
|
|
|
760
749
|
return "not run";
|
|
761
750
|
}
|
|
762
751
|
};
|
|
763
|
-
return /* @__PURE__ */
|
|
752
|
+
return /* @__PURE__ */ c(
|
|
764
753
|
"li",
|
|
765
754
|
{
|
|
766
755
|
style: a,
|
|
767
756
|
"data-testid": `test-list-item-${r}`,
|
|
768
|
-
"data-test-name":
|
|
757
|
+
"data-test-name": t.name,
|
|
769
758
|
role: "listitem",
|
|
770
|
-
"aria-label": `Test ${
|
|
759
|
+
"aria-label": `Test ${t.name}, status: ${i()}`,
|
|
771
760
|
children: [
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
|
|
761
|
+
/* @__PURE__ */ c("div", { style: p, children: [
|
|
762
|
+
/* @__PURE__ */ c("span", { style: H.nameSpan, children: /* @__PURE__ */ c(
|
|
763
|
+
Je,
|
|
775
764
|
{
|
|
776
765
|
id: r,
|
|
777
|
-
name:
|
|
778
|
-
skip:
|
|
779
|
-
only:
|
|
766
|
+
name: t.name,
|
|
767
|
+
skip: t.skip,
|
|
768
|
+
only: t.only
|
|
780
769
|
}
|
|
781
770
|
) }),
|
|
782
|
-
/* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ c(
|
|
783
772
|
"button",
|
|
784
773
|
{
|
|
785
774
|
onClick: () => n(r),
|
|
786
|
-
"aria-label": `Run ${
|
|
787
|
-
style:
|
|
788
|
-
disabled:
|
|
775
|
+
"aria-label": `Run ${t.name} test`,
|
|
776
|
+
style: H.button,
|
|
777
|
+
disabled: t.status === "running",
|
|
789
778
|
"data-testid": `run-test-button-${r}`,
|
|
790
|
-
children:
|
|
779
|
+
children: t.status === "running" ? /* @__PURE__ */ c(mt, {}) : /* @__PURE__ */ c(vt, {})
|
|
791
780
|
}
|
|
792
781
|
)
|
|
793
782
|
] }),
|
|
794
|
-
|
|
783
|
+
t.logs && t.logs.length > 0 && /* @__PURE__ */ c("ul", { ref: o, style: H.logsList, children: t.logs.map((f, _) => /* @__PURE__ */ c(St, { log: f, index: _ }, _)) })
|
|
795
784
|
]
|
|
796
785
|
},
|
|
797
|
-
|
|
786
|
+
t.name
|
|
798
787
|
);
|
|
799
|
-
},
|
|
800
|
-
const [
|
|
801
|
-
|
|
802
|
-
if (
|
|
788
|
+
}, Ct = () => /* @__PURE__ */ c(re, { className: "lucide-chevron-down-icon lucide-chevron-down", dataTestId: "chevron-down-icon", children: /* @__PURE__ */ c("path", { d: "m6 9 6 6 6-6" }) }), Rt = () => /* @__PURE__ */ c(re, { className: "lucide-chevron-right-icon lucide-chevron-right", dataTestId: "chevron-right-icon", children: /* @__PURE__ */ c("path", { d: "m9 18 6-6-6-6" }) }), It = ({ roots: t, runTest: e, searchQuery: r = "" }) => {
|
|
789
|
+
const [n, o] = B({}), s = F(null), l = F(!1), d = (a) => o((p) => ({ ...p, [a]: !p[a] }));
|
|
790
|
+
te(() => {
|
|
791
|
+
if (l.current) return;
|
|
803
792
|
const a = sessionStorage.getItem("twd-last-run-test-name");
|
|
804
793
|
if (!a) return;
|
|
805
|
-
const
|
|
794
|
+
const p = setTimeout(() => {
|
|
806
795
|
const i = document.querySelector(`[data-test-name="${a}"]`);
|
|
807
796
|
if (i) {
|
|
808
|
-
const
|
|
809
|
-
if (
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
top:
|
|
797
|
+
const f = s.current?.closest('[data-testid="twd-sidebar"]');
|
|
798
|
+
if (f) {
|
|
799
|
+
const _ = i.getBoundingClientRect(), v = f.getBoundingClientRect(), T = f.scrollTop, b = _.top - v.top + T;
|
|
800
|
+
f.scrollTo({
|
|
801
|
+
top: b - 150,
|
|
813
802
|
// 150px offset from top
|
|
814
803
|
behavior: "smooth"
|
|
815
804
|
});
|
|
816
805
|
}
|
|
817
|
-
|
|
806
|
+
l.current = !0;
|
|
818
807
|
}
|
|
819
808
|
}, 100);
|
|
820
|
-
return () => clearTimeout(
|
|
809
|
+
return () => clearTimeout(p);
|
|
821
810
|
}, []);
|
|
822
|
-
const
|
|
811
|
+
const u = (a, p = 0) => {
|
|
823
812
|
if (a.type === "test")
|
|
824
|
-
return /* @__PURE__ */
|
|
825
|
-
|
|
813
|
+
return /* @__PURE__ */ c(
|
|
814
|
+
Tt,
|
|
826
815
|
{
|
|
827
816
|
node: a,
|
|
828
|
-
depth:
|
|
817
|
+
depth: p,
|
|
829
818
|
id: a.id,
|
|
830
|
-
runTest: () =>
|
|
819
|
+
runTest: () => e(a.id)
|
|
831
820
|
},
|
|
832
821
|
a.id
|
|
833
822
|
);
|
|
834
|
-
const i =
|
|
835
|
-
return /* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
823
|
+
const i = n[a.id];
|
|
824
|
+
return /* @__PURE__ */ c("li", { style: { marginLeft: `calc(${p} * var(--twd-spacing-lg))` }, children: [
|
|
825
|
+
/* @__PURE__ */ c(
|
|
837
826
|
"div",
|
|
838
827
|
{
|
|
839
828
|
style: {
|
|
@@ -843,7 +832,7 @@ const yt = (e) => {
|
|
|
843
832
|
padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
|
|
844
833
|
marginBottom: "var(--twd-spacing-sm)"
|
|
845
834
|
},
|
|
846
|
-
children: /* @__PURE__ */
|
|
835
|
+
children: /* @__PURE__ */ c(
|
|
847
836
|
"span",
|
|
848
837
|
{
|
|
849
838
|
style: {
|
|
@@ -863,29 +852,38 @@ const yt = (e) => {
|
|
|
863
852
|
role: "button",
|
|
864
853
|
"aria-expanded": !i,
|
|
865
854
|
"aria-label": `${i ? "Expand" : "Collapse"} test suite ${a.name}`,
|
|
866
|
-
onClick: () =>
|
|
855
|
+
onClick: () => d(a.id),
|
|
867
856
|
children: [
|
|
868
|
-
/* @__PURE__ */
|
|
869
|
-
i ? /* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ c(Je, { id: a.id, name: a.name, skip: a.skip, only: a.only }),
|
|
858
|
+
i ? /* @__PURE__ */ c(Rt, {}) : /* @__PURE__ */ c(Ct, {})
|
|
870
859
|
]
|
|
871
860
|
}
|
|
872
861
|
)
|
|
873
862
|
}
|
|
874
863
|
),
|
|
875
|
-
!i && a.childrenNodes && a.childrenNodes.length > 0 && /* @__PURE__ */
|
|
864
|
+
!i && a.childrenNodes && a.childrenNodes.length > 0 && /* @__PURE__ */ c("ul", { style: { listStyle: "none", padding: 0, margin: 0 }, children: a.childrenNodes.map((f) => u(f, p + 1)) })
|
|
876
865
|
] }, a.id);
|
|
877
|
-
}
|
|
878
|
-
return /* @__PURE__ */
|
|
866
|
+
};
|
|
867
|
+
return /* @__PURE__ */ c(
|
|
879
868
|
"ul",
|
|
880
869
|
{
|
|
881
870
|
ref: s,
|
|
882
871
|
style: { listStyle: "none", padding: 0, margin: 0 },
|
|
883
872
|
role: "list",
|
|
884
873
|
"aria-label": "Test list",
|
|
885
|
-
children:
|
|
874
|
+
children: t.length === 0 && r ? /* @__PURE__ */ c("li", { style: {
|
|
875
|
+
padding: "var(--twd-spacing-md)",
|
|
876
|
+
color: "var(--twd-text-secondary)",
|
|
877
|
+
fontSize: "var(--twd-font-size-sm)",
|
|
878
|
+
textAlign: "center"
|
|
879
|
+
}, children: [
|
|
880
|
+
'No tests match "',
|
|
881
|
+
r,
|
|
882
|
+
'"'
|
|
883
|
+
] }) : t.map((a) => u(a))
|
|
886
884
|
}
|
|
887
885
|
);
|
|
888
|
-
},
|
|
886
|
+
}, $t = {
|
|
889
887
|
left: {
|
|
890
888
|
left: 0,
|
|
891
889
|
borderTopRightRadius: "var(--twd-border-radius-lg)",
|
|
@@ -900,7 +898,7 @@ const yt = (e) => {
|
|
|
900
898
|
borderTopRightRadius: "0",
|
|
901
899
|
borderBottomRightRadius: "0"
|
|
902
900
|
}
|
|
903
|
-
},
|
|
901
|
+
}, Et = ({ setOpen: t, position: e }) => /* @__PURE__ */ c(
|
|
904
902
|
"button",
|
|
905
903
|
{
|
|
906
904
|
"aria-label": "Open TWD sidebar",
|
|
@@ -913,19 +911,19 @@ const yt = (e) => {
|
|
|
913
911
|
padding: "var(--twd-spacing-sm) 10px",
|
|
914
912
|
cursor: "pointer",
|
|
915
913
|
fontSize: "var(--twd-font-size-sm)",
|
|
916
|
-
|
|
914
|
+
...$t[e]
|
|
917
915
|
},
|
|
918
|
-
onClick: () =>
|
|
916
|
+
onClick: () => t(!0),
|
|
919
917
|
children: "TWD"
|
|
920
918
|
}
|
|
921
|
-
),
|
|
922
|
-
|
|
919
|
+
), At = ({ isOpen: t, position: e }) => {
|
|
920
|
+
te(() => {
|
|
923
921
|
const r = document.documentElement, n = getComputedStyle(document.documentElement).getPropertyValue("--twd-sidebar-width") || "280px";
|
|
924
|
-
return
|
|
922
|
+
return t ? e === "left" ? r.style.marginLeft = n : r.style.marginRight = n : (r.style.marginRight = "0", r.style.marginLeft = "0"), () => {
|
|
925
923
|
r.style.marginRight = "0", r.style.marginLeft = "0";
|
|
926
924
|
};
|
|
927
|
-
}, [
|
|
928
|
-
},
|
|
925
|
+
}, [t, e]);
|
|
926
|
+
}, Lt = () => typeof window < "u" ? (window.__TWD_STATE__ || (window.__TWD_STATE__ = {
|
|
929
927
|
handlers: /* @__PURE__ */ new Map(),
|
|
930
928
|
beforeEachHooks: /* @__PURE__ */ new Map(),
|
|
931
929
|
afterEachHooks: /* @__PURE__ */ new Map(),
|
|
@@ -935,129 +933,161 @@ const yt = (e) => {
|
|
|
935
933
|
beforeEachHooks: /* @__PURE__ */ new Map(),
|
|
936
934
|
afterEachHooks: /* @__PURE__ */ new Map(),
|
|
937
935
|
stack: []
|
|
938
|
-
},
|
|
939
|
-
const
|
|
940
|
-
let n =
|
|
936
|
+
}, he = Lt(), x = he.handlers, Ae = he.beforeEachHooks, Le = he.afterEachHooks, Mt = (t) => {
|
|
937
|
+
const e = [], r = [];
|
|
938
|
+
let n = t;
|
|
941
939
|
for (; n; )
|
|
942
|
-
|
|
943
|
-
return { before:
|
|
944
|
-
},
|
|
945
|
-
const
|
|
946
|
-
return
|
|
947
|
-
},
|
|
948
|
-
let
|
|
949
|
-
for (;
|
|
950
|
-
const r =
|
|
940
|
+
Ae.has(n) && e.unshift(...Ae.get(n)), Le.has(n) && r.push(...Le.get(n)), n = x.get(n)?.parent;
|
|
941
|
+
return { before: e, after: r };
|
|
942
|
+
}, D = (t) => {
|
|
943
|
+
const e = x.get(t);
|
|
944
|
+
return e ? e.only ? !0 : e.children ? e.children.some((r) => D(r)) : !1 : !1;
|
|
945
|
+
}, zt = (t) => {
|
|
946
|
+
let e = x.get(t);
|
|
947
|
+
for (; e?.parent; ) {
|
|
948
|
+
const r = x.get(e.parent);
|
|
951
949
|
if (r?.only) return !0;
|
|
952
|
-
|
|
950
|
+
e = r;
|
|
953
951
|
}
|
|
954
952
|
return !1;
|
|
955
|
-
},
|
|
956
|
-
let
|
|
957
|
-
for (;
|
|
958
|
-
if (
|
|
959
|
-
if (!
|
|
960
|
-
|
|
953
|
+
}, oe = (t) => {
|
|
954
|
+
let e = x.get(t);
|
|
955
|
+
for (; e; ) {
|
|
956
|
+
if (e.skip) return !0;
|
|
957
|
+
if (!e.parent) break;
|
|
958
|
+
e = x.get(e.parent);
|
|
961
959
|
}
|
|
962
960
|
return !1;
|
|
963
961
|
};
|
|
964
|
-
class
|
|
965
|
-
constructor(
|
|
966
|
-
|
|
967
|
-
this
|
|
962
|
+
class Xe {
|
|
963
|
+
constructor(e, r) {
|
|
964
|
+
ne(this, "events");
|
|
965
|
+
ne(this, "retryCount");
|
|
966
|
+
this.events = e, this.retryCount = r?.retryCount ?? 1;
|
|
968
967
|
}
|
|
969
968
|
async runAll() {
|
|
970
|
-
const
|
|
969
|
+
const e = Array.from(x.values()).filter(
|
|
971
970
|
(n) => !n.parent && n.type === "suite"
|
|
972
|
-
), r = Array.from(
|
|
973
|
-
for (const n of
|
|
971
|
+
), r = Array.from(x.values()).some((n) => n.only);
|
|
972
|
+
for (const n of e)
|
|
974
973
|
await this.runSuite(n, r);
|
|
975
|
-
return
|
|
974
|
+
return x;
|
|
976
975
|
}
|
|
977
|
-
async runSingle(
|
|
978
|
-
const r =
|
|
976
|
+
async runSingle(e) {
|
|
977
|
+
const r = x.get(e);
|
|
979
978
|
if (!r || r.type !== "test") return;
|
|
980
979
|
await this.runTest(r, !1);
|
|
981
980
|
}
|
|
982
|
-
async
|
|
983
|
-
|
|
984
|
-
|
|
981
|
+
async runByIds(e) {
|
|
982
|
+
const r = new Set(e), n = Array.from(x.values()).filter(
|
|
983
|
+
(s) => !s.parent && s.type === "suite"
|
|
984
|
+
), o = Array.from(x.values()).some((s) => s.only);
|
|
985
|
+
for (const s of n)
|
|
986
|
+
await this.runSuiteByIds(s, r, o);
|
|
987
|
+
return x;
|
|
988
|
+
}
|
|
989
|
+
async runSuiteByIds(e, r, n) {
|
|
990
|
+
if (!this.hasDescendantInSet(e, r)) return;
|
|
991
|
+
if (oe(e.id) && !D(e.id)) {
|
|
992
|
+
this.events.onSkip?.(e);
|
|
985
993
|
return;
|
|
986
994
|
}
|
|
987
|
-
if (
|
|
988
|
-
this.events.onSuiteStart?.(
|
|
989
|
-
const
|
|
990
|
-
for (const
|
|
991
|
-
|
|
992
|
-
this.events.onSuiteEnd?.(
|
|
995
|
+
if (n && !D(e.id)) return;
|
|
996
|
+
this.events.onSuiteStart?.(e);
|
|
997
|
+
const l = (e.children || []).map((d) => x.get(d));
|
|
998
|
+
for (const d of l)
|
|
999
|
+
d.type === "suite" ? await this.runSuiteByIds(d, r, n) : d.type === "test" && r.has(d.id) && await this.runTest(d, n);
|
|
1000
|
+
this.events.onSuiteEnd?.(e);
|
|
993
1001
|
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1002
|
+
hasDescendantInSet(e, r) {
|
|
1003
|
+
return r.has(e.id) ? !0 : e.children ? e.children.some((n) => {
|
|
1004
|
+
const o = x.get(n);
|
|
1005
|
+
return o ? this.hasDescendantInSet(o, r) : !1;
|
|
1006
|
+
}) : !1;
|
|
1007
|
+
}
|
|
1008
|
+
async runSuite(e, r) {
|
|
1009
|
+
if (oe(e.id) && !D(e.id)) {
|
|
1010
|
+
this.events.onSkip?.(e);
|
|
997
1011
|
return;
|
|
998
1012
|
}
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1013
|
+
if (r && !D(e.id)) return;
|
|
1014
|
+
this.events.onSuiteStart?.(e);
|
|
1015
|
+
const o = (e.children || []).map((s) => x.get(s));
|
|
1016
|
+
for (const s of o)
|
|
1017
|
+
s.type === "suite" ? await this.runSuite(s, r) : s.type === "test" && await this.runTest(s, r);
|
|
1018
|
+
this.events.onSuiteEnd?.(e);
|
|
1019
|
+
}
|
|
1020
|
+
async runTest(e, r) {
|
|
1021
|
+
if ((oe(e.id) || e.skip) && !e.only) {
|
|
1022
|
+
this.events.onSkip(e);
|
|
1002
1023
|
return;
|
|
1003
1024
|
}
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
t.logs = [], await t.handler(), this.events.onPass(t);
|
|
1009
|
-
} catch (l) {
|
|
1010
|
-
this.events.onFail(t, l);
|
|
1011
|
-
} finally {
|
|
1012
|
-
for (const l of o.after) await l();
|
|
1025
|
+
const o = zt(e.id);
|
|
1026
|
+
if (r && !e.only && !o) {
|
|
1027
|
+
this.events.onSkip(e);
|
|
1028
|
+
return;
|
|
1013
1029
|
}
|
|
1030
|
+
this.events.onStart?.(e);
|
|
1031
|
+
const s = Mt(e.parent);
|
|
1032
|
+
let l = null;
|
|
1033
|
+
for (let d = 1; d <= this.retryCount; d++)
|
|
1034
|
+
try {
|
|
1035
|
+
for (const u of s.before) await u();
|
|
1036
|
+
e.logs = [], await e.handler(), this.events.onPass(e, d > 1 ? d : void 0);
|
|
1037
|
+
return;
|
|
1038
|
+
} catch (u) {
|
|
1039
|
+
l = u;
|
|
1040
|
+
} finally {
|
|
1041
|
+
for (const u of s.after) await u();
|
|
1042
|
+
}
|
|
1043
|
+
this.events.onFail(e, l);
|
|
1014
1044
|
}
|
|
1015
1045
|
}
|
|
1016
|
-
window.__testRunner =
|
|
1017
|
-
const
|
|
1046
|
+
window.__testRunner = Xe;
|
|
1047
|
+
const ge = "1.6.1", Nt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
|
|
1018
1048
|
rules: [],
|
|
1019
1049
|
counts: {}
|
|
1020
1050
|
}), window.__TWD_MOCK_STATE__) : {
|
|
1021
1051
|
rules: [],
|
|
1022
1052
|
counts: {}
|
|
1023
|
-
},
|
|
1024
|
-
let
|
|
1025
|
-
const
|
|
1026
|
-
if (
|
|
1053
|
+
}, O = Nt(), me = O.rules;
|
|
1054
|
+
let Me = !1;
|
|
1055
|
+
const Wt = async (t) => {
|
|
1056
|
+
if (Me) {
|
|
1027
1057
|
console.warn("[TWD] Request mocking already initialized");
|
|
1028
1058
|
return;
|
|
1029
1059
|
}
|
|
1030
1060
|
if ("serviceWorker" in navigator) {
|
|
1031
|
-
|
|
1032
|
-
const
|
|
1033
|
-
await navigator.serviceWorker.register(`${
|
|
1061
|
+
Me = !0;
|
|
1062
|
+
const e = t ?? "/mock-sw.js";
|
|
1063
|
+
await navigator.serviceWorker.register(`${e}?v=${ge}`), navigator.serviceWorker.controller || await new Promise((r) => {
|
|
1034
1064
|
navigator.serviceWorker.addEventListener("controllerchange", r, { once: !0 });
|
|
1035
1065
|
}), navigator.serviceWorker.addEventListener("message", (r) => {
|
|
1036
1066
|
if (r.data?.type === "EXECUTED") {
|
|
1037
|
-
const { alias: n, request:
|
|
1038
|
-
l && (l.executed = !0, l.request =
|
|
1067
|
+
const { alias: n, request: o, hitCount: s } = r.data, l = me.find((d) => d.alias === n);
|
|
1068
|
+
l && (l.executed = !0, l.request = o, l.hitCount = s), O.counts[n] = s ?? (O.counts[n] ?? 0) + 1;
|
|
1039
1069
|
}
|
|
1040
1070
|
});
|
|
1041
1071
|
}
|
|
1042
|
-
},
|
|
1072
|
+
}, Ht = () => me, Bt = () => {
|
|
1043
1073
|
navigator.serviceWorker.controller?.postMessage({
|
|
1044
1074
|
type: "CLEAR_RULES",
|
|
1045
|
-
version:
|
|
1046
|
-
}),
|
|
1047
|
-
for (const
|
|
1048
|
-
delete
|
|
1049
|
-
},
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
/* @__PURE__ */
|
|
1052
|
-
/* @__PURE__ */
|
|
1053
|
-
/* @__PURE__ */
|
|
1075
|
+
version: ge
|
|
1076
|
+
}), me.length = 0;
|
|
1077
|
+
for (const t in O.counts)
|
|
1078
|
+
delete O.counts[t];
|
|
1079
|
+
}, Dt = () => /* @__PURE__ */ c(re, { className: "lucide-wifi-pen-icon lucide-wifi-pen", dataTestId: "wifi-pen-icon", children: [
|
|
1080
|
+
/* @__PURE__ */ c("path", { d: "M2 8.82a15 15 0 0 1 20 0" }),
|
|
1081
|
+
/* @__PURE__ */ c("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" }),
|
|
1082
|
+
/* @__PURE__ */ c("path", { d: "M5 12.859a10 10 0 0 1 10.5-2.222" }),
|
|
1083
|
+
/* @__PURE__ */ c("path", { d: "M8.5 16.429a5 5 0 0 1 3-1.406" })
|
|
1054
1084
|
] }), Ft = () => {
|
|
1055
|
-
const
|
|
1056
|
-
return /* @__PURE__ */
|
|
1085
|
+
const t = Ht(), e = t.filter((n) => n.executed);
|
|
1086
|
+
return /* @__PURE__ */ c(
|
|
1057
1087
|
"button",
|
|
1058
1088
|
{
|
|
1059
1089
|
onClick: () => {
|
|
1060
|
-
console.group("🌐 TWD Mock Rules"), console.log("Total rules:",
|
|
1090
|
+
console.group("🌐 TWD Mock Rules"), console.log("Total rules:", t.length), console.log("Triggered rules:", e.length), console.log("Rules details:"), console.log(t), console.groupEnd();
|
|
1061
1091
|
},
|
|
1062
1092
|
"aria-label": "View mock rules details in console",
|
|
1063
1093
|
style: {
|
|
@@ -1078,15 +1108,15 @@ const Nt = async (e) => {
|
|
|
1078
1108
|
boxShadow: "var(--twd-shadow-sm)"
|
|
1079
1109
|
},
|
|
1080
1110
|
children: [
|
|
1081
|
-
/* @__PURE__ */
|
|
1082
|
-
/* @__PURE__ */
|
|
1111
|
+
/* @__PURE__ */ c(Dt, {}),
|
|
1112
|
+
/* @__PURE__ */ c("span", { style: { flex: 1 }, children: [
|
|
1083
1113
|
"Rules: ",
|
|
1084
|
-
t.length,
|
|
1085
|
-
"/",
|
|
1086
1114
|
e.length,
|
|
1115
|
+
"/",
|
|
1116
|
+
t.length,
|
|
1087
1117
|
" triggered"
|
|
1088
1118
|
] }),
|
|
1089
|
-
/* @__PURE__ */
|
|
1119
|
+
/* @__PURE__ */ c("span", { style: {
|
|
1090
1120
|
fontSize: "var(--twd-font-size-xs)",
|
|
1091
1121
|
color: "var(--twd-text)",
|
|
1092
1122
|
fontWeight: "var(--twd-font-weight-medium)"
|
|
@@ -1094,105 +1124,171 @@ const Nt = async (e) => {
|
|
|
1094
1124
|
]
|
|
1095
1125
|
}
|
|
1096
1126
|
);
|
|
1097
|
-
},
|
|
1098
|
-
function
|
|
1099
|
-
|
|
1127
|
+
}, Pt = /* @__PURE__ */ new Map();
|
|
1128
|
+
function Ot() {
|
|
1129
|
+
Pt.clear();
|
|
1100
1130
|
}
|
|
1101
|
-
const Ut = (
|
|
1131
|
+
const Ut = (t) => t instanceof Error && "actual" in t && "expected" in t, Ge = (t) => t.actual !== void 0 && t.expected !== void 0 ? {
|
|
1102
1132
|
type: "diff",
|
|
1103
|
-
actual:
|
|
1104
|
-
expected:
|
|
1105
|
-
operator:
|
|
1133
|
+
actual: t.actual,
|
|
1134
|
+
expected: t.expected,
|
|
1135
|
+
operator: t.operator
|
|
1106
1136
|
} : {
|
|
1107
1137
|
type: "message",
|
|
1108
|
-
message:
|
|
1109
|
-
},
|
|
1110
|
-
const
|
|
1111
|
-
if (
|
|
1112
|
-
const r =
|
|
1113
|
-
console.error(`Assertion failed with operator: ${r}`), console.group("Expected:"), console.log(
|
|
1138
|
+
message: t.message
|
|
1139
|
+
}, jt = (t) => {
|
|
1140
|
+
const e = Ge(t);
|
|
1141
|
+
if (e.type === "diff") {
|
|
1142
|
+
const r = e.operator || "unknown";
|
|
1143
|
+
console.error(`Assertion failed with operator: ${r}`), console.group("Expected:"), console.log(e.expected), console.groupEnd(), console.group("Actual:"), console.log(e.actual), console.groupEnd();
|
|
1114
1144
|
} else
|
|
1115
|
-
console.error(
|
|
1116
|
-
},
|
|
1117
|
-
if (
|
|
1118
|
-
return `Test "${
|
|
1119
|
-
if (
|
|
1120
|
-
if (!
|
|
1121
|
-
return `Test "${
|
|
1122
|
-
const
|
|
1145
|
+
console.error(e.message);
|
|
1146
|
+
}, qt = (t) => {
|
|
1147
|
+
if (t.status === "pass")
|
|
1148
|
+
return `Test "${t.name}" passed.`;
|
|
1149
|
+
if (t.status === "fail") {
|
|
1150
|
+
if (!t.logs || t.logs.length === 0)
|
|
1151
|
+
return `Test "${t.name}" failed.`;
|
|
1152
|
+
const e = t.logs[t.logs.length - 1];
|
|
1123
1153
|
try {
|
|
1124
|
-
const r = JSON.parse(
|
|
1125
|
-
return r.type ===
|
|
1154
|
+
const r = JSON.parse(e);
|
|
1155
|
+
return r.type === A.CHAI_MESSAGE || r.type === A.ERROR ? `Test "${t.name}" failed. ${r.message}` : r.type === A.CHAI_DIFF ? `Test "${t.name}" failed. Expected value does not match actual value.` : `Test "${t.name}" failed.`;
|
|
1126
1156
|
} catch {
|
|
1127
|
-
return `Test "${
|
|
1157
|
+
return `Test "${t.name}" failed. ${e}`;
|
|
1128
1158
|
}
|
|
1129
|
-
} else if (
|
|
1130
|
-
return `Test "${
|
|
1159
|
+
} else if (t.status === "skip")
|
|
1160
|
+
return `Test "${t.name}" skipped.`;
|
|
1131
1161
|
return "";
|
|
1132
|
-
},
|
|
1133
|
-
const
|
|
1134
|
-
return n > 0 ? (
|
|
1135
|
-
},
|
|
1162
|
+
}, Vt = (t) => {
|
|
1163
|
+
const e = t.filter((l) => l.type === "test"), r = e.filter((l) => l.status === "pass").length, n = e.filter((l) => l.status === "fail").length, o = e.filter((l) => l.status === "skip").length, s = [];
|
|
1164
|
+
return n > 0 ? (s.push("Test run completed."), s.push(`${r} test${r !== 1 ? "s" : ""} passed`), s.push(`${n} test${n !== 1 ? "s" : ""} failed`), o > 0 && s.push(`${o} test${o !== 1 ? "s" : ""} skipped`), s.join(", ") + ".") : (s.push("All tests passed."), s.push(`${r} test${r !== 1 ? "s" : ""} completed`), o > 0 && s.push(`${o} test${o !== 1 ? "s" : ""} skipped`), s.join(", ") + ".");
|
|
1165
|
+
}, Jt = ({ value: t, onChange: e }) => /* @__PURE__ */ c("div", { style: { position: "relative", marginBottom: "var(--twd-spacing-md)" }, children: /* @__PURE__ */ c(
|
|
1166
|
+
"input",
|
|
1167
|
+
{
|
|
1168
|
+
type: "search",
|
|
1169
|
+
id: "twd-search-input",
|
|
1170
|
+
"aria-label": "Filter tests",
|
|
1171
|
+
placeholder: "Filter tests...",
|
|
1172
|
+
value: t,
|
|
1173
|
+
onChange: (r) => e(r.target.value),
|
|
1174
|
+
style: {
|
|
1175
|
+
width: "100%",
|
|
1176
|
+
padding: "var(--twd-spacing-md)",
|
|
1177
|
+
background: "var(--twd-background)",
|
|
1178
|
+
color: "var(--twd-text)",
|
|
1179
|
+
border: "1px solid var(--twd-border)",
|
|
1180
|
+
borderRadius: "var(--twd-border-radius)",
|
|
1181
|
+
fontSize: "var(--twd-font-size-md)",
|
|
1182
|
+
boxSizing: "border-box",
|
|
1183
|
+
outline: "none"
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
) }), Xt = (t, e) => {
|
|
1187
|
+
if (!e.trim()) return t;
|
|
1188
|
+
const r = e.toLowerCase(), n = (o) => {
|
|
1189
|
+
const s = o.name.toLowerCase().includes(r);
|
|
1190
|
+
if (o.type === "test")
|
|
1191
|
+
return s ? o : null;
|
|
1192
|
+
const l = (o.childrenNodes || []).map(n).filter((d) => d !== null);
|
|
1193
|
+
return s || l.length > 0 ? {
|
|
1194
|
+
...o,
|
|
1195
|
+
childrenNodes: s ? o.childrenNodes : l
|
|
1196
|
+
} : null;
|
|
1197
|
+
};
|
|
1198
|
+
return t.map(n).filter((o) => o !== null);
|
|
1199
|
+
}, Gt = (t) => {
|
|
1200
|
+
const e = /* @__PURE__ */ new Map(), r = [];
|
|
1201
|
+
for (const n of t) e.set(n.id, { ...n, childrenNodes: [] });
|
|
1202
|
+
for (const n of e.values())
|
|
1203
|
+
n.parent ? e.get(n.parent)?.childrenNodes?.push(n) : r.push(n);
|
|
1204
|
+
return r;
|
|
1205
|
+
}, Kt = {
|
|
1136
1206
|
left: { left: 0, borderRight: "1px solid var(--twd-border)" },
|
|
1137
1207
|
right: { right: 0, borderLeft: "1px solid var(--twd-border)" }
|
|
1138
|
-
},
|
|
1139
|
-
const
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1208
|
+
}, Yt = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Qt = (t) => t ? sessionStorage.getItem("twd-search-filter") || "" : (sessionStorage.removeItem("twd-search-filter"), ""), Zt = (t) => sessionStorage.getItem("twd-sidebar-open") ? sessionStorage.getItem("twd-sidebar-open") === "true" : t, Ke = (t) => {
|
|
1209
|
+
const e = [];
|
|
1210
|
+
for (const r of t)
|
|
1211
|
+
r.type === "test" && e.push(r.id), r.childrenNodes && e.push(...Ke(r.childrenNodes));
|
|
1212
|
+
return e;
|
|
1213
|
+
}, er = ({ open: t, position: e = "left", search: r }) => {
|
|
1214
|
+
const [n, o] = B(0), [s, l] = B(Zt(t));
|
|
1215
|
+
At({ isOpen: s, position: e });
|
|
1216
|
+
const [d, u] = B(""), [a, p] = B(Qt(r));
|
|
1217
|
+
te(() => {
|
|
1218
|
+
const h = () => o((y) => y + 1);
|
|
1219
|
+
return window.addEventListener("twd:state-change", h), () => window.removeEventListener("twd:state-change", h);
|
|
1145
1220
|
}, []);
|
|
1146
|
-
const
|
|
1147
|
-
onStart: (
|
|
1148
|
-
|
|
1221
|
+
const i = new Xe({
|
|
1222
|
+
onStart: (h) => {
|
|
1223
|
+
h.status = "running", o((y) => y + 1);
|
|
1149
1224
|
},
|
|
1150
|
-
onPass: (
|
|
1151
|
-
|
|
1225
|
+
onPass: (h) => {
|
|
1226
|
+
h.status = "pass", o((y) => y + 1);
|
|
1152
1227
|
},
|
|
1153
|
-
onFail: (
|
|
1154
|
-
if (
|
|
1155
|
-
|
|
1156
|
-
const
|
|
1157
|
-
|
|
1158
|
-
type:
|
|
1159
|
-
expected:
|
|
1160
|
-
actual:
|
|
1161
|
-
})) :
|
|
1162
|
-
type:
|
|
1163
|
-
message: `Test failed: ${
|
|
1228
|
+
onFail: (h, y) => {
|
|
1229
|
+
if (h.status = "fail", console.group(`%c❌ Test failed: ${h.name}`, "color: red; font-weight: bold;"), Ut(y)) {
|
|
1230
|
+
jt(y);
|
|
1231
|
+
const C = Ge(y);
|
|
1232
|
+
C.type === "diff" ? h.logs.push(JSON.stringify({
|
|
1233
|
+
type: A.CHAI_DIFF,
|
|
1234
|
+
expected: C.expected,
|
|
1235
|
+
actual: C.actual
|
|
1236
|
+
})) : h.logs.push(JSON.stringify({
|
|
1237
|
+
type: A.CHAI_MESSAGE,
|
|
1238
|
+
message: `Test failed: ${C.message}`
|
|
1164
1239
|
}));
|
|
1165
1240
|
} else
|
|
1166
|
-
console.error(
|
|
1167
|
-
type:
|
|
1168
|
-
message: `Test failed: ${
|
|
1241
|
+
console.error(y.message), h.logs.push(JSON.stringify({
|
|
1242
|
+
type: A.ERROR,
|
|
1243
|
+
message: `Test failed: ${y.message}`
|
|
1169
1244
|
}));
|
|
1170
|
-
console.groupEnd(),
|
|
1245
|
+
console.groupEnd(), o((C) => C + 1);
|
|
1171
1246
|
},
|
|
1172
|
-
onSkip: (
|
|
1173
|
-
|
|
1247
|
+
onSkip: (h) => {
|
|
1248
|
+
h.status = "skip", o((y) => y + 1);
|
|
1174
1249
|
}
|
|
1175
|
-
}),
|
|
1176
|
-
|
|
1177
|
-
},
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1250
|
+
}), f = (h) => {
|
|
1251
|
+
p(h), h ? sessionStorage.setItem("twd-search-filter", h) : sessionStorage.removeItem("twd-search-filter");
|
|
1252
|
+
}, _ = (h) => {
|
|
1253
|
+
l(h), sessionStorage.setItem("twd-sidebar-open", h.toString());
|
|
1254
|
+
}, v = Array.from(x.values()), T = z(
|
|
1255
|
+
() => Gt(v),
|
|
1256
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1257
|
+
[n]
|
|
1258
|
+
), b = z(
|
|
1259
|
+
() => Xt(T, a),
|
|
1260
|
+
[T, a]
|
|
1261
|
+
), { filteredTestIds: m, displayTests: g } = z(() => {
|
|
1262
|
+
if (a) {
|
|
1263
|
+
const h = Ke(b), y = new Set(h);
|
|
1264
|
+
return {
|
|
1265
|
+
filteredTestIds: h,
|
|
1266
|
+
displayTests: v.filter((C) => C.type === "test" && y.has(C.id))
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
return {
|
|
1270
|
+
filteredTestIds: null,
|
|
1271
|
+
displayTests: v.filter((h) => h.type === "test")
|
|
1272
|
+
};
|
|
1273
|
+
}, [b, a, n]), I = async () => {
|
|
1274
|
+
u(""), sessionStorage.removeItem("twd-last-run-test-name"), m ? await i.runByIds(m) : await i.runAll();
|
|
1275
|
+
const h = Vt(v);
|
|
1276
|
+
u(h);
|
|
1277
|
+
}, $ = async (h) => {
|
|
1278
|
+
const y = Array.from(x.values()).filter((R) => R.type === "test").find((R) => R.id === h);
|
|
1279
|
+
if (!y) return;
|
|
1280
|
+
u(""), sessionStorage.setItem("twd-last-run-test-name", y.name), await i.runSingle(y.id);
|
|
1281
|
+
const C = qt(y);
|
|
1282
|
+
u(C);
|
|
1283
|
+
};
|
|
1188
1284
|
if (!s)
|
|
1189
|
-
return /* @__PURE__ */
|
|
1190
|
-
const
|
|
1191
|
-
return /* @__PURE__ */
|
|
1285
|
+
return /* @__PURE__ */ c(Et, { position: e, setOpen: _ });
|
|
1286
|
+
const L = g.length;
|
|
1287
|
+
return /* @__PURE__ */ c(
|
|
1192
1288
|
"div",
|
|
1193
1289
|
{
|
|
1194
1290
|
style: {
|
|
1195
|
-
fontFamily:
|
|
1291
|
+
fontFamily: Yt,
|
|
1196
1292
|
position: "fixed",
|
|
1197
1293
|
top: 0,
|
|
1198
1294
|
bottom: 0,
|
|
@@ -1205,14 +1301,14 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1205
1301
|
zIndex: "var(--twd-z-index-sidebar)",
|
|
1206
1302
|
pointerEvents: "all",
|
|
1207
1303
|
isolation: "isolate",
|
|
1208
|
-
...
|
|
1304
|
+
...Kt[e]
|
|
1209
1305
|
},
|
|
1210
1306
|
"data-testid": "twd-sidebar",
|
|
1211
1307
|
role: "complementary",
|
|
1212
1308
|
"aria-label": "Test While Developing sidebar",
|
|
1213
1309
|
children: [
|
|
1214
|
-
/* @__PURE__ */
|
|
1215
|
-
/* @__PURE__ */
|
|
1310
|
+
/* @__PURE__ */ c("div", { "aria-live": "polite", "aria-atomic": "true", style: { position: "absolute", width: "1px", height: "1px", margin: "-1px", border: "0", padding: "0", overflow: "hidden", clip: "rect(0 0 0 0)" }, children: d }),
|
|
1311
|
+
/* @__PURE__ */ c("div", { style: {
|
|
1216
1312
|
padding: "var(--twd-spacing-md)",
|
|
1217
1313
|
background: "var(--twd-background)",
|
|
1218
1314
|
position: "sticky",
|
|
@@ -1220,17 +1316,17 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1220
1316
|
zIndex: "var(--twd-z-index-sticky)",
|
|
1221
1317
|
borderBottom: "1px solid var(--twd-border)"
|
|
1222
1318
|
}, children: [
|
|
1223
|
-
/* @__PURE__ */
|
|
1319
|
+
/* @__PURE__ */ c("div", { style: {
|
|
1224
1320
|
display: "flex",
|
|
1225
1321
|
justifyContent: "space-between",
|
|
1226
1322
|
alignItems: "center",
|
|
1227
1323
|
marginBottom: "var(--twd-spacing-xl)"
|
|
1228
1324
|
}, children: [
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
/* @__PURE__ */
|
|
1325
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", gap: "var(--twd-spacing-xs)" }, children: [
|
|
1326
|
+
/* @__PURE__ */ c(
|
|
1231
1327
|
"button",
|
|
1232
1328
|
{
|
|
1233
|
-
onClick:
|
|
1329
|
+
onClick: I,
|
|
1234
1330
|
style: {
|
|
1235
1331
|
background: "var(--twd-button-primary)",
|
|
1236
1332
|
color: "var(--twd-button-primary-text)",
|
|
@@ -1239,14 +1335,14 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1239
1335
|
border: "none",
|
|
1240
1336
|
cursor: "pointer"
|
|
1241
1337
|
},
|
|
1242
|
-
children: "Run All"
|
|
1338
|
+
children: /* @__PURE__ */ c("span", { "aria-live": "polite", children: a ? "Run Filtered" : "Run All" })
|
|
1243
1339
|
}
|
|
1244
1340
|
),
|
|
1245
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ c(
|
|
1246
1342
|
"button",
|
|
1247
1343
|
{
|
|
1248
1344
|
onClick: () => {
|
|
1249
|
-
|
|
1345
|
+
Bt(), Ot();
|
|
1250
1346
|
},
|
|
1251
1347
|
"aria-label": "Clear all mocks",
|
|
1252
1348
|
style: {
|
|
@@ -1260,16 +1356,16 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1260
1356
|
children: "Clear mocks"
|
|
1261
1357
|
}
|
|
1262
1358
|
),
|
|
1263
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ c("span", { style: {
|
|
1264
1360
|
color: "var(--twd-text-secondary)",
|
|
1265
1361
|
fontSize: "var(--twd-font-size-sm)",
|
|
1266
1362
|
alignSelf: "center"
|
|
1267
1363
|
}, children: [
|
|
1268
1364
|
"v",
|
|
1269
|
-
|
|
1365
|
+
ge
|
|
1270
1366
|
] })
|
|
1271
1367
|
] }),
|
|
1272
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ c(
|
|
1273
1369
|
"button",
|
|
1274
1370
|
{
|
|
1275
1371
|
"aria-label": "Close sidebar",
|
|
@@ -1281,12 +1377,12 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1281
1377
|
paddingRight: "0",
|
|
1282
1378
|
paddingLeft: "0"
|
|
1283
1379
|
},
|
|
1284
|
-
onClick: () =>
|
|
1380
|
+
onClick: () => _(!1),
|
|
1285
1381
|
children: "✖"
|
|
1286
1382
|
}
|
|
1287
1383
|
)
|
|
1288
1384
|
] }),
|
|
1289
|
-
/* @__PURE__ */
|
|
1385
|
+
/* @__PURE__ */ c("div", { style: {
|
|
1290
1386
|
display: "flex",
|
|
1291
1387
|
justifyContent: "space-between",
|
|
1292
1388
|
alignItems: "center",
|
|
@@ -1294,55 +1390,47 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1294
1390
|
color: "var(--twd-text-secondary)",
|
|
1295
1391
|
marginBottom: "10px"
|
|
1296
1392
|
}, children: [
|
|
1297
|
-
/* @__PURE__ */
|
|
1393
|
+
/* @__PURE__ */ c("span", { style: { color: "var(--twd-text)" }, children: [
|
|
1298
1394
|
"Total: ",
|
|
1299
|
-
|
|
1395
|
+
L
|
|
1300
1396
|
] }),
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
/* @__PURE__ */
|
|
1397
|
+
/* @__PURE__ */ c("div", { style: { display: "flex", gap: "var(--twd-spacing-xs)" }, children: [
|
|
1398
|
+
/* @__PURE__ */ c("span", { style: { color: "var(--twd-success)" }, children: [
|
|
1303
1399
|
"✓ ",
|
|
1304
|
-
|
|
1400
|
+
g.filter((h) => h.status === "pass").length
|
|
1305
1401
|
] }),
|
|
1306
|
-
/* @__PURE__ */
|
|
1402
|
+
/* @__PURE__ */ c("span", { style: { color: "var(--twd-error)" }, children: [
|
|
1307
1403
|
"✗ ",
|
|
1308
|
-
|
|
1404
|
+
g.filter((h) => h.status === "fail").length
|
|
1309
1405
|
] })
|
|
1310
1406
|
] })
|
|
1311
1407
|
] }),
|
|
1312
|
-
/* @__PURE__ */
|
|
1408
|
+
/* @__PURE__ */ c(Ft, {}),
|
|
1409
|
+
r && /* @__PURE__ */ c(Jt, { value: a, onChange: f })
|
|
1313
1410
|
] }),
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
|
|
1411
|
+
/* @__PURE__ */ c("div", { style: { padding: "var(--twd-spacing-md)" }, children: /* @__PURE__ */ c(
|
|
1412
|
+
It,
|
|
1316
1413
|
{
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
status: _.status,
|
|
1321
|
-
logs: _.logs,
|
|
1322
|
-
id: _.id,
|
|
1323
|
-
parent: _.parent,
|
|
1324
|
-
type: _.type,
|
|
1325
|
-
only: _.only,
|
|
1326
|
-
skip: _.skip
|
|
1327
|
-
})),
|
|
1328
|
-
runTest: i
|
|
1414
|
+
roots: b,
|
|
1415
|
+
runTest: $,
|
|
1416
|
+
searchQuery: a
|
|
1329
1417
|
}
|
|
1330
1418
|
) })
|
|
1331
1419
|
]
|
|
1332
1420
|
}
|
|
1333
1421
|
);
|
|
1334
|
-
},
|
|
1335
|
-
render: (
|
|
1336
|
-
it(
|
|
1422
|
+
}, tr = (t) => ({
|
|
1423
|
+
render: (e) => {
|
|
1424
|
+
it(e, t);
|
|
1337
1425
|
}
|
|
1338
|
-
}),
|
|
1339
|
-
const { open: r = !0, position: n = "left", serviceWorker:
|
|
1340
|
-
|
|
1426
|
+
}), nr = (t, e) => {
|
|
1427
|
+
const { open: r = !0, position: n = "left", serviceWorker: o = !0, serviceWorkerUrl: s = "/mock-sw.js", theme: l, search: d } = e || {};
|
|
1428
|
+
_t(t, /* @__PURE__ */ c(er, { open: r, position: n, ...d !== void 0 && { search: d } }), tr, l), o && Wt(s).then(() => {
|
|
1341
1429
|
console.log("Request mocking initialized");
|
|
1342
|
-
}).catch((
|
|
1343
|
-
console.error("Error initializing request mocking:",
|
|
1430
|
+
}).catch((u) => {
|
|
1431
|
+
console.error("Error initializing request mocking:", u);
|
|
1344
1432
|
});
|
|
1345
1433
|
};
|
|
1346
1434
|
export {
|
|
1347
|
-
|
|
1435
|
+
nr as initTWD
|
|
1348
1436
|
};
|